@vouchfor/embeds 1.3.2 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/es/{browser-1b4c09f1.js → browser-f8654733.js} +2 -2
- package/dist/es/{browser-1b4c09f1.js.map → browser-f8654733.js.map} +1 -1
- package/dist/es/embeds.js +1 -1
- package/dist/es/{index-37e10211.js → index-65006a92.js} +2153 -2150
- package/dist/es/index-65006a92.js.map +1 -0
- package/dist/iife/dialog-embed/{browser-aef6773c.js → browser-b36b6e3e.js} +2 -2
- package/dist/iife/dialog-embed/{browser-aef6773c.js.map → browser-b36b6e3e.js.map} +1 -1
- package/dist/iife/dialog-embed/embed.iife.js +83 -83
- package/dist/iife/dialog-embed/embed.iife.js.map +1 -1
- package/dist/iife/dialog-embed/embed.js +1 -1
- package/dist/iife/dialog-embed/{index-98ee90b7.js → index-72887ffc.js} +2420 -2404
- package/dist/iife/dialog-embed/index-72887ffc.js.map +1 -0
- package/dist/iife/embeds.iife.js +82 -82
- package/dist/iife/embeds.iife.js.map +1 -1
- package/dist/iife/player-embed/{browser-3fc50faa.js → browser-69a47b14.js} +2 -2
- package/dist/iife/player-embed/{browser-3fc50faa.js.map → browser-69a47b14.js.map} +1 -1
- package/dist/iife/player-embed/embed.iife.js +80 -80
- package/dist/iife/player-embed/embed.iife.js.map +1 -1
- package/dist/iife/player-embed/embed.js +1 -1
- package/dist/iife/player-embed/{index-ec0750d4.js → index-854590ba.js} +2389 -2373
- package/dist/iife/player-embed/index-854590ba.js.map +1 -0
- package/package.json +2 -2
- package/dist/es/index-37e10211.js.map +0 -1
- package/dist/iife/dialog-embed/index-98ee90b7.js.map +0 -1
- package/dist/iife/player-embed/index-ec0750d4.js.map +0 -1
@@ -1,44 +1,44 @@
|
|
1
|
-
var
|
1
|
+
var Ly=Object.defineProperty;var _y=(Ue,ri,Yt)=>ri in Ue?Ly(Ue,ri,{enumerable:!0,configurable:!0,writable:!0,value:Yt}):Ue[ri]=Yt;var Zu=(Ue,ri,Yt)=>(_y(Ue,typeof ri!="symbol"?ri+"":ri,Yt),Yt);var playerEmbed=function(Ue){var Yu;"use strict";function ri(s,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in s)){const n=Object.getOwnPropertyDescriptor(i,r);n&&Object.defineProperty(s,r,n.get?n:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}/**
|
2
2
|
* @license
|
3
3
|
* Copyright 2019 Google LLC
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
5
|
-
*/const Yt=globalThis,Hn=Yt.ShadowRoot&&(Yt.ShadyCSS===void 0||Yt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,cA=Symbol(),hA=new WeakMap;let
|
5
|
+
*/const Yt=globalThis,Hn=Yt.ShadowRoot&&(Yt.ShadyCSS===void 0||Yt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,cA=Symbol(),hA=new WeakMap;let id=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==cA)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Hn&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=hA.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&hA.set(t,e))}return e}toString(){return this.cssText}};const sd=s=>new id(typeof s=="string"?s:s+"",void 0,cA),rd=(s,e)=>{if(Hn)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),r=Yt.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,s.appendChild(i)}},uA=Hn?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return sd(t)})(s):s;/**
|
6
6
|
* @license
|
7
7
|
* Copyright 2017 Google LLC
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
9
|
-
*/const{is:
|
9
|
+
*/const{is:nd,defineProperty:od,getOwnPropertyDescriptor:ad,getOwnPropertyNames:Ad,getOwnPropertySymbols:ld,getPrototypeOf:cd}=Object,mi=globalThis,dA=mi.trustedTypes,hd=dA?dA.emptyScript:"",$n=mi.reactiveElementPolyfillSupport,xs=(s,e)=>s,Sr={toAttribute(s,e){switch(e){case Boolean:s=s?hd:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},Yn=(s,e)=>!nd(s,e),gA={attribute:!0,type:String,converter:Sr,reflect:!1,hasChanged:Yn};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),mi.litPropertyMetadata??(mi.litPropertyMetadata=new WeakMap);let Ds=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=gA){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(e,i,t);r!==void 0&&od(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){const{get:r,set:n}=ad(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const a=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??gA}static _$Ei(){if(this.hasOwnProperty(xs("elementProperties")))return;const e=cd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(xs("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(xs("properties"))){const t=this.properties,i=[...Ad(t),...ld(t)];for(const r of i)this.createProperty(r,t[r])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,r]of t)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const r=this._$Eu(t,i);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const r of i)t.unshift(uA(r))}else e!==void 0&&t.push(uA(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$Eg=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$ES(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$E_??(this._$E_=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$E_)==null||t.delete(e)}_$ES(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return rd(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$E_)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$E_)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t){var n;const i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){const o=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:Sr).toAttribute(t,i.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){var n;const i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:Sr;this._$Em=r,this[r]=a.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,i,r=!1,n){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??Yn)(r?n:this[e],t))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.C(n,this[n],o)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$E_)==null||i.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(t)):this._$ET()}catch(r){throw e=!1,this._$ET(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$E_)==null||t.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EO(t,this[t]))),this._$ET()}updated(e){}firstUpdated(e){}};Ds.elementStyles=[],Ds.shadowRootOptions={mode:"open"},Ds[xs("elementProperties")]=new Map,Ds[xs("finalized")]=new Map,$n==null||$n({ReactiveElement:Ds}),(mi.reactiveElementVersions??(mi.reactiveElementVersions=[])).push("2.0.2");/**
|
10
10
|
* @license
|
11
11
|
* Copyright 2017 Google LLC
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
13
|
-
*/const Rs=globalThis,wr=Rs.trustedTypes,fA=wr?wr.createPolicy("lit-html",{createHTML:s=>s}):void 0,Kn="$lit$",ni=`lit$${(Math.random()+"").slice(9)}$`,Vn="?"+ni,
|
13
|
+
*/const Rs=globalThis,wr=Rs.trustedTypes,fA=wr?wr.createPolicy("lit-html",{createHTML:s=>s}):void 0,Kn="$lit$",ni=`lit$${(Math.random()+"").slice(9)}$`,Vn="?"+ni,ud=`<${Vn}>`,Ni=document,Tr=()=>Ni.createComment(""),Ls=s=>s===null||typeof s!="object"&&typeof s!="function",pA=Array.isArray,EA=s=>pA(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",Jn=`[
|
14
14
|
\f\r]`,_s=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,IA=/-->/g,mA=/>/g,Fi=RegExp(`>|${Jn}(?:([^\\s"'>=/]+)(${Jn}*=${Jn}*(?:[^
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),CA=/'/g,yA=/"/g,BA=/^(?:script|style|textarea|title)$/i,
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),CA=/'/g,yA=/"/g,BA=/^(?:script|style|textarea|title)$/i,Ci=Symbol.for("lit-noChange"),qe=Symbol.for("lit-nothing"),vA=new WeakMap,Mi=Ni.createTreeWalker(Ni,129);function QA(s,e){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return fA!==void 0?fA.createHTML(e):e}const bA=(s,e)=>{const t=s.length-1,i=[];let r,n=e===2?"<svg>":"",o=_s;for(let a=0;a<t;a++){const A=s[a];let l,c,h=-1,u=0;for(;u<A.length&&(o.lastIndex=u,c=o.exec(A),c!==null);)u=o.lastIndex,o===_s?c[1]==="!--"?o=IA:c[1]!==void 0?o=mA:c[2]!==void 0?(BA.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=Fi):c[3]!==void 0&&(o=Fi):o===Fi?c[0]===">"?(o=r??_s,h=-1):c[1]===void 0?h=-2:(h=o.lastIndex-c[2].length,l=c[1],o=c[3]===void 0?Fi:c[3]==='"'?yA:CA):o===yA||o===CA?o=Fi:o===IA||o===mA?o=_s:(o=Fi,r=void 0);const d=o===Fi&&s[a+1].startsWith("/>")?" ":"";n+=o===_s?A+ud:h>=0?(i.push(l),A.slice(0,h)+Kn+A.slice(h)+ni+d):A+ni+(h===-2?a:d)}return[QA(s,n+(s[t]||"<?>")+(e===2?"</svg>":"")),i]};let Wn=class ed{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let n=0,o=0;const a=e.length-1,A=this.parts,[l,c]=bA(e,t);if(this.el=ed.createElement(l,i),Mi.currentNode=this.el.content,t===2){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=Mi.nextNode())!==null&&A.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const h of r.getAttributeNames())if(h.endsWith(Kn)){const u=c[o++],d=r.getAttribute(h).split(ni),g=/([.?@])?(.*)/.exec(u);A.push({type:1,index:n,name:g[2],strings:d,ctor:g[1]==="."?wA:g[1]==="?"?TA:g[1]==="@"?xA:ks}),r.removeAttribute(h)}else h.startsWith(ni)&&(A.push({type:6,index:n}),r.removeAttribute(h));if(BA.test(r.tagName)){const h=r.textContent.split(ni),u=h.length-1;if(u>0){r.textContent=wr?wr.emptyScript:"";for(let d=0;d<u;d++)r.append(h[d],Tr()),Mi.nextNode(),A.push({type:2,index:++n});r.append(h[u],Tr())}}}else if(r.nodeType===8)if(r.data===Vn)A.push({type:2,index:n});else{let h=-1;for(;(h=r.data.indexOf(ni,h+1))!==-1;)A.push({type:7,index:n}),h+=ni.length-1}n++}}static createElement(e,t){const i=Ni.createElement("template");return i.innerHTML=e,i}};function Pi(s,e,t=s,i){var o,a;if(e===Ci)return e;let r=i!==void 0?(o=t._$Co)==null?void 0:o[i]:t._$Cl;const n=Ls(e)?void 0:e._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),n===void 0?r=void 0:(r=new n(s),r._$AT(s,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=r:t._$Cl=r),r!==void 0&&(e=Pi(s,r._$AS(s,e.values),r,i)),e}let SA=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,r=((e==null?void 0:e.creationScope)??Ni).importNode(t,!0);Mi.currentNode=r;let n=Mi.nextNode(),o=0,a=0,A=i[0];for(;A!==void 0;){if(o===A.index){let l;A.type===2?l=new qn(n,n.nextSibling,this,e):A.type===1?l=new A.ctor(n,A.name,A.strings,this,e):A.type===6&&(l=new DA(n,this,e)),this._$AV.push(l),A=i[++a]}o!==(A==null?void 0:A.index)&&(n=Mi.nextNode(),o++)}return Mi.currentNode=Ni,r}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},qn=class td{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=qe,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Pi(this,e,t),Ls(e)?e===qe||e==null||e===""?(this._$AH!==qe&&this._$AR(),this._$AH=qe):e!==this._$AH&&e!==Ci&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):EA(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==qe&&Ls(this._$AH)?this._$AA.nextSibling.data=e:this.$(Ni.createTextNode(e)),this._$AH=e}g(e){var n;const{values:t,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Wn.createElement(QA(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(t);else{const o=new SA(r,this),a=o.u(this.options);o.p(t),this.$(a),this._$AH=o}}_$AC(e){let t=vA.get(e.strings);return t===void 0&&vA.set(e.strings,t=new Wn(e)),t}T(e){pA(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,r=0;for(const n of e)r===t.length?t.push(i=new td(this.k(Tr()),this.k(Tr()),this,this.options)):i=t[r],i._$AI(n),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e&&e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},ks=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,n){this.type=1,this._$AH=qe,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=qe}_$AI(e,t=this,i,r){const n=this.strings;let o=!1;if(n===void 0)e=Pi(this,e,t,0),o=!Ls(e)||e!==this._$AH&&e!==Ci,o&&(this._$AH=e);else{const a=e;let A,l;for(e=n[0],A=0;A<n.length-1;A++)l=Pi(this,a[i+A],t,A),l===Ci&&(l=this._$AH[A]),o||(o=!Ls(l)||l!==this._$AH[A]),l===qe?e=qe:e!==qe&&(e+=(l??"")+n[A+1]),this._$AH[A]=l}o&&!r&&this.O(e)}O(e){e===qe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},wA=class extends ks{constructor(){super(...arguments),this.type=3}O(e){this.element[this.name]=e===qe?void 0:e}},TA=class extends ks{constructor(){super(...arguments),this.type=4}O(e){this.element.toggleAttribute(this.name,!!e&&e!==qe)}},xA=class extends ks{constructor(e,t,i,r,n){super(e,t,i,r,n),this.type=5}_$AI(e,t=this){if((e=Pi(this,e,t,0)??qe)===Ci)return;const i=this._$AH,r=e===qe&&i!==qe||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==qe&&(i===qe||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},DA=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Pi(this,e)}};const dd={j:Kn,P:ni,A:Vn,C:1,M:bA,L:SA,R:EA,V:Pi,D:qn,I:ks,H:TA,N:xA,U:wA,B:DA},jn=Rs.litHtmlPolyfillSupport;jn==null||jn(Wn,qn),(Rs.litHtmlVersions??(Rs.litHtmlVersions=[])).push("3.1.0");/**
|
16
16
|
* @license
|
17
17
|
* Copyright 2019 Google LLC
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
19
|
-
*/const xr=globalThis,Xn=xr.ShadowRoot&&(xr.ShadyCSS===void 0||xr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,zn=Symbol(),RA=new WeakMap;let LA=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==zn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Xn&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=RA.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&RA.set(t,e))}return e}toString(){return this.cssText}};const Ns=s=>new LA(typeof s=="string"?s:s+"",void 0,zn),nt=(s,...e)=>{const t=s.length===1?s[0]:e.reduce((i,r,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[n+1],s[0]);return new LA(t,s,zn)},
|
19
|
+
*/const xr=globalThis,Xn=xr.ShadowRoot&&(xr.ShadyCSS===void 0||xr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,zn=Symbol(),RA=new WeakMap;let LA=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==zn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Xn&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=RA.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&RA.set(t,e))}return e}toString(){return this.cssText}};const Ns=s=>new LA(typeof s=="string"?s:s+"",void 0,zn),nt=(s,...e)=>{const t=s.length===1?s[0]:e.reduce((i,r,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[n+1],s[0]);return new LA(t,s,zn)},gd=(s,e)=>{if(Xn)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),r=xr.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,s.appendChild(i)}},_A=Xn?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return Ns(t)})(s):s;/**
|
20
20
|
* @license
|
21
21
|
* Copyright 2017 Google LLC
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
23
|
-
*/const{is:
|
23
|
+
*/const{is:fd,defineProperty:pd,getOwnPropertyDescriptor:Ed,getOwnPropertyNames:Id,getOwnPropertySymbols:md,getPrototypeOf:Cd}=Object,yi=globalThis,kA=yi.trustedTypes,yd=kA?kA.emptyScript:"",Zn=yi.reactiveElementPolyfillSupport,Fs=(s,e)=>s,eo={toAttribute(s,e){switch(e){case Boolean:s=s?yd:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},NA=(s,e)=>!fd(s,e),FA={attribute:!0,type:String,converter:eo,reflect:!1,hasChanged:NA};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),yi.litPropertyMetadata??(yi.litPropertyMetadata=new WeakMap);let ns=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=FA){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(e,i,t);r!==void 0&&pd(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){const{get:r,set:n}=Ed(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const a=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??FA}static _$Ei(){if(this.hasOwnProperty(Fs("elementProperties")))return;const e=Cd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Fs("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Fs("properties"))){const t=this.properties,i=[...Id(t),...md(t)];for(const r of i)this.createProperty(r,t[r])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,r]of t)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const r=this._$Eu(t,i);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const r of i)t.unshift(_A(r))}else e!==void 0&&t.push(_A(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$Eg=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$ES(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$E_??(this._$E_=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$E_)==null||t.delete(e)}_$ES(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return gd(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$E_)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$E_)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t){var n;const i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){const o=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:eo).toAttribute(t,i.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){var n;const i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:eo;this._$Em=r,this[r]=a.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,i,r=!1,n){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??NA)(r?n:this[e],t))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.C(n,this[n],o)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$E_)==null||i.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(t)):this._$ET()}catch(r){throw e=!1,this._$ET(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$E_)==null||t.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EO(t,this[t]))),this._$ET()}updated(e){}firstUpdated(e){}};ns.elementStyles=[],ns.shadowRootOptions={mode:"open"},ns[Fs("elementProperties")]=new Map,ns[Fs("finalized")]=new Map,Zn==null||Zn({ReactiveElement:ns}),(yi.reactiveElementVersions??(yi.reactiveElementVersions=[])).push("2.0.2");/**
|
24
24
|
* @license
|
25
25
|
* Copyright 2017 Google LLC
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
27
|
-
*/const Ms=globalThis,Dr=Ms.trustedTypes,MA=Dr?Dr.createPolicy("lit-html",{createHTML:s=>s}):void 0,PA="$lit$",
|
27
|
+
*/const Ms=globalThis,Dr=Ms.trustedTypes,MA=Dr?Dr.createPolicy("lit-html",{createHTML:s=>s}):void 0,PA="$lit$",Bi=`lit$${(Math.random()+"").slice(9)}$`,OA="?"+Bi,Bd=`<${OA}>`,Oi=document,Ps=()=>Oi.createComment(""),Os=s=>s===null||typeof s!="object"&&typeof s!="function",UA=Array.isArray,vd=s=>UA(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",to=`[
|
28
28
|
\f\r]`,Us=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,GA=/-->/g,HA=/>/g,Ui=RegExp(`>|${to}(?:([^\\s"'>=/]+)(${to}*=${to}*(?:[^
|
29
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),$A=/'/g,YA=/"/g,KA=/^(?:script|style|textarea|title)$/i,
|
29
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),$A=/'/g,YA=/"/g,KA=/^(?:script|style|textarea|title)$/i,Qd=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),Ee=Qd(1),vi=Symbol.for("lit-noChange"),tt=Symbol.for("lit-nothing"),VA=new WeakMap,Gi=Oi.createTreeWalker(Oi,129);function JA(s,e){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return MA!==void 0?MA.createHTML(e):e}const bd=(s,e)=>{const t=s.length-1,i=[];let r,n=e===2?"<svg>":"",o=Us;for(let a=0;a<t;a++){const A=s[a];let l,c,h=-1,u=0;for(;u<A.length&&(o.lastIndex=u,c=o.exec(A),c!==null);)u=o.lastIndex,o===Us?c[1]==="!--"?o=GA:c[1]!==void 0?o=HA:c[2]!==void 0?(KA.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=Ui):c[3]!==void 0&&(o=Ui):o===Ui?c[0]===">"?(o=r??Us,h=-1):c[1]===void 0?h=-2:(h=o.lastIndex-c[2].length,l=c[1],o=c[3]===void 0?Ui:c[3]==='"'?YA:$A):o===YA||o===$A?o=Ui:o===GA||o===HA?o=Us:(o=Ui,r=void 0);const d=o===Ui&&s[a+1].startsWith("/>")?" ":"";n+=o===Us?A+Bd:h>=0?(i.push(l),A.slice(0,h)+PA+A.slice(h)+Bi+d):A+Bi+(h===-2?a:d)}return[JA(s,n+(s[t]||"<?>")+(e===2?"</svg>":"")),i]};class Gs{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let n=0,o=0;const a=e.length-1,A=this.parts,[l,c]=bd(e,t);if(this.el=Gs.createElement(l,i),Gi.currentNode=this.el.content,t===2){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=Gi.nextNode())!==null&&A.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const h of r.getAttributeNames())if(h.endsWith(PA)){const u=c[o++],d=r.getAttribute(h).split(Bi),g=/([.?@])?(.*)/.exec(u);A.push({type:1,index:n,name:g[2],strings:d,ctor:g[1]==="."?wd:g[1]==="?"?Td:g[1]==="@"?xd:Rr}),r.removeAttribute(h)}else h.startsWith(Bi)&&(A.push({type:6,index:n}),r.removeAttribute(h));if(KA.test(r.tagName)){const h=r.textContent.split(Bi),u=h.length-1;if(u>0){r.textContent=Dr?Dr.emptyScript:"";for(let d=0;d<u;d++)r.append(h[d],Ps()),Gi.nextNode(),A.push({type:2,index:++n});r.append(h[u],Ps())}}}else if(r.nodeType===8)if(r.data===OA)A.push({type:2,index:n});else{let h=-1;for(;(h=r.data.indexOf(Bi,h+1))!==-1;)A.push({type:7,index:n}),h+=Bi.length-1}n++}}static createElement(e,t){const i=Oi.createElement("template");return i.innerHTML=e,i}}function os(s,e,t=s,i){var o,a;if(e===vi)return e;let r=i!==void 0?(o=t._$Co)==null?void 0:o[i]:t._$Cl;const n=Os(e)?void 0:e._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),n===void 0?r=void 0:(r=new n(s),r._$AT(s,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=r:t._$Cl=r),r!==void 0&&(e=os(s,r._$AS(s,e.values),r,i)),e}let Sd=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,r=((e==null?void 0:e.creationScope)??Oi).importNode(t,!0);Gi.currentNode=r;let n=Gi.nextNode(),o=0,a=0,A=i[0];for(;A!==void 0;){if(o===A.index){let l;A.type===2?l=new Hs(n,n.nextSibling,this,e):A.type===1?l=new A.ctor(n,A.name,A.strings,this,e):A.type===6&&(l=new Dd(n,this,e)),this._$AV.push(l),A=i[++a]}o!==(A==null?void 0:A.index)&&(n=Gi.nextNode(),o++)}return Gi.currentNode=Oi,r}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}};class Hs{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=tt,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=os(this,e,t),Os(e)?e===tt||e==null||e===""?(this._$AH!==tt&&this._$AR(),this._$AH=tt):e!==this._$AH&&e!==vi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):vd(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==tt&&Os(this._$AH)?this._$AA.nextSibling.data=e:this.$(Oi.createTextNode(e)),this._$AH=e}g(e){var n;const{values:t,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Gs.createElement(JA(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(t);else{const o=new Sd(r,this),a=o.u(this.options);o.p(t),this.$(a),this._$AH=o}}_$AC(e){let t=VA.get(e.strings);return t===void 0&&VA.set(e.strings,t=new Gs(e)),t}T(e){UA(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,r=0;for(const n of e)r===t.length?t.push(i=new Hs(this.k(Ps()),this.k(Ps()),this,this.options)):i=t[r],i._$AI(n),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e&&e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class Rr{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,n){this.type=1,this._$AH=tt,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=tt}_$AI(e,t=this,i,r){const n=this.strings;let o=!1;if(n===void 0)e=os(this,e,t,0),o=!Os(e)||e!==this._$AH&&e!==vi,o&&(this._$AH=e);else{const a=e;let A,l;for(e=n[0],A=0;A<n.length-1;A++)l=os(this,a[i+A],t,A),l===vi&&(l=this._$AH[A]),o||(o=!Os(l)||l!==this._$AH[A]),l===tt?e=tt:e!==tt&&(e+=(l??"")+n[A+1]),this._$AH[A]=l}o&&!r&&this.O(e)}O(e){e===tt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class wd extends Rr{constructor(){super(...arguments),this.type=3}O(e){this.element[this.name]=e===tt?void 0:e}}class Td extends Rr{constructor(){super(...arguments),this.type=4}O(e){this.element.toggleAttribute(this.name,!!e&&e!==tt)}}class xd extends Rr{constructor(e,t,i,r,n){super(e,t,i,r,n),this.type=5}_$AI(e,t=this){if((e=os(this,e,t,0)??tt)===vi)return;const i=this._$AH,r=e===tt&&i!==tt||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==tt&&(i===tt||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class Dd{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){os(this,e)}}const io=Ms.litHtmlPolyfillSupport;io==null||io(Gs,Hs),(Ms.litHtmlVersions??(Ms.litHtmlVersions=[])).push("3.1.0");const Rd=(s,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let r=i._$litPart$;if(r===void 0){const n=(t==null?void 0:t.renderBefore)??null;i._$litPart$=r=new Hs(e.insertBefore(Ps(),n),n,void 0,t??{})}return r._$AI(s),r};/**
|
30
30
|
* @license
|
31
31
|
* Copyright 2017 Google LLC
|
32
32
|
* SPDX-License-Identifier: BSD-3-Clause
|
33
|
-
*/let as=class extends ns{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=
|
33
|
+
*/let as=class extends ns{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Rd(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return vi}};as._$litElement$=!0,as.finalized=!0,(Yu=globalThis.litElementHydrateSupport)==null||Yu.call(globalThis,{LitElement:as});const so=globalThis.litElementPolyfillSupport;so==null||so({LitElement:as}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.2");/**
|
34
34
|
* @license
|
35
35
|
* Copyright 2017 Google LLC
|
36
36
|
* SPDX-License-Identifier: BSD-3-Clause
|
37
|
-
*/const
|
37
|
+
*/const Ld=s=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(s,e)}):customElements.define(s,e)};/**
|
38
38
|
* @license
|
39
39
|
* Copyright 2017 Google LLC
|
40
40
|
* SPDX-License-Identifier: BSD-3-Clause
|
41
|
-
*/const
|
41
|
+
*/const _d={attribute:!0,type:String,converter:Sr,reflect:!1,hasChanged:Yn},kd=(s=_d,e,t)=>{const{kind:i,metadata:r}=t;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),n.set(t.name,s),i==="accessor"){const{name:o}=t;return{set(a){const A=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,A,s)},init(a){return a!==void 0&&this.C(o,void 0,s),a}}}if(i==="setter"){const{name:o}=t;return function(a){const A=this[o];e.call(this,a),this.requestUpdate(o,A,s)}}throw Error("Unsupported decorator location: "+i)};function z(s){return(e,t)=>typeof t=="object"?kd(s,e,t):((i,r,n)=>{const o=r.hasOwnProperty(n);return r.constructor.createProperty(n,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(r,n):void 0})(s,e,t)}/**
|
42
42
|
* @license
|
43
43
|
* Copyright 2017 Google LLC
|
44
44
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -50,7 +50,7 @@ var Ry=Object.defineProperty;var Ly=(Pe,ri,Yt)=>ri in Pe?Ry(Pe,ri,{enumerable:!0
|
|
50
50
|
* @license
|
51
51
|
* Copyright 2020 Google LLC
|
52
52
|
* SPDX-License-Identifier: BSD-3-Clause
|
53
|
-
*/const{D:
|
53
|
+
*/const{D:Nd}=dd,Fd=s=>s.strings===void 0,WA=()=>document.createComment(""),$s=(s,e,t)=>{var n;const i=s._$AA.parentNode,r=e===void 0?s._$AB:e._$AA;if(t===void 0){const o=i.insertBefore(WA(),r),a=i.insertBefore(WA(),r);t=new Nd(o,a,s,s.options)}else{const o=t._$AB.nextSibling,a=t._$AM,A=a!==s;if(A){let l;(n=t._$AQ)==null||n.call(t,s),t._$AM=s,t._$AP!==void 0&&(l=s._$AU)!==a._$AU&&t._$AP(l)}if(o!==r||A){let l=t._$AA;for(;l!==o;){const c=l.nextSibling;i.insertBefore(l,r),l=c}}}return t},$i=(s,e,t=s)=>(s._$AI(e,t),s),Md={},Pd=(s,e=Md)=>s._$AH=e,Od=s=>s._$AH,ro=s=>{var i;(i=s._$AP)==null||i.call(s,!1,!0);let e=s._$AA;const t=s._$AB.nextSibling;for(;e!==t;){const r=e.nextSibling;e.remove(),e=r}};/**
|
54
54
|
* @license
|
55
55
|
* Copyright 2017 Google LLC
|
56
56
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -58,40 +58,40 @@ var Ry=Object.defineProperty;var Ly=(Pe,ri,Yt)=>ri in Pe?Ry(Pe,ri,{enumerable:!0
|
|
58
58
|
* @license
|
59
59
|
* Copyright 2017 Google LLC
|
60
60
|
* SPDX-License-Identifier: BSD-3-Clause
|
61
|
-
*/const Ks=(s,e)=>{var i;const t=s._$AN;if(t===void 0)return!1;for(const r of t)(i=r._$AO)==null||i.call(r,e,!1),Ks(r,e);return!0},Lr=s=>{let e,t;do{if((e=s._$AM)===void 0)break;t=e._$AN,t.delete(s),s=e}while((t==null?void 0:t.size)===0)},qA=s=>{for(let e;e=s._$AM;s=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(s))break;t.add(s),
|
61
|
+
*/const Ks=(s,e)=>{var i;const t=s._$AN;if(t===void 0)return!1;for(const r of t)(i=r._$AO)==null||i.call(r,e,!1),Ks(r,e);return!0},Lr=s=>{let e,t;do{if((e=s._$AM)===void 0)break;t=e._$AN,t.delete(s),s=e}while((t==null?void 0:t.size)===0)},qA=s=>{for(let e;e=s._$AM;s=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(s))break;t.add(s),Hd(e)}};function Ud(s){this._$AN!==void 0?(Lr(this),this._$AM=s,qA(this)):this._$AM=s}function Gd(s,e=!1,t=0){const i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(e)if(Array.isArray(i))for(let n=t;n<i.length;n++)Ks(i[n],!1),Lr(i[n]);else i!=null&&(Ks(i,!1),Lr(i));else Ks(this,s)}const Hd=s=>{s.type==As.CHILD&&(s._$AP??(s._$AP=Gd),s._$AQ??(s._$AQ=Ud))};let jA=class extends Ys{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),qA(this),this.isConnected=e._$AU}_$AO(e,t=!0){var i,r;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(r=this.disconnected)==null||r.call(this)),t&&(Ks(this,e),Lr(this))}setValue(e){if(Fd(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};/**
|
62
62
|
* @license
|
63
63
|
* Copyright 2020 Google LLC
|
64
64
|
* SPDX-License-Identifier: BSD-3-Clause
|
65
|
-
*/const ht=()=>new
|
65
|
+
*/const ht=()=>new $d;let $d=class{};const no=new WeakMap,ut=ls(class extends jA{render(s){return qe}update(s,[e]){var i;const t=e!==this.G;return t&&this.G!==void 0&&this.ot(void 0),(t||this.rt!==this.lt)&&(this.G=e,this.ct=(i=s.options)==null?void 0:i.host,this.ot(this.lt=s.element)),qe}ot(s){if(typeof this.G=="function"){const e=this.ct??globalThis;let t=no.get(e);t===void 0&&(t=new WeakMap,no.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ct,void 0),t.set(this.G,s),s!==void 0&&this.G.call(this.ct,s)}else this.G.value=s}get rt(){var s,e;return typeof this.G=="function"?(s=no.get(this.ct??globalThis))==null?void 0:s.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});function Yd(s,e,t){function i(r){t.dispatchEvent(new CustomEvent(r.type,r))}return e.addEventListener(s,i),()=>{e.removeEventListener(s,i)}}class Kd{constructor(e,t){this._events=[],this._cleanup=[],this._forwardElementRef=ht(),this.host=e,this._events=t,e.addController(this)}register(){return ut(this._forwardElementRef)}hostConnected(){requestAnimationFrame(()=>{this._events.forEach(e=>{this._forwardElementRef.value&&this._cleanup.push(Yd(e,this._forwardElementRef.value,this.host))})})}hostDisconnected(){this._cleanup.forEach(e=>{e()}),this._cleanup=[]}}/**
|
66
66
|
* @license
|
67
67
|
* Copyright 2019 Google LLC
|
68
68
|
* SPDX-License-Identifier: BSD-3-Clause
|
69
|
-
*/const _r=globalThis,oo=_r.ShadowRoot&&(_r.ShadyCSS===void 0||_r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,XA=Symbol(),zA=new WeakMap;let
|
69
|
+
*/const _r=globalThis,oo=_r.ShadowRoot&&(_r.ShadyCSS===void 0||_r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,XA=Symbol(),zA=new WeakMap;let Vd=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==XA)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(oo&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=zA.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&zA.set(t,e))}return e}toString(){return this.cssText}};const Jd=s=>new Vd(typeof s=="string"?s:s+"",void 0,XA),Wd=(s,e)=>{if(oo)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),r=_r.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,s.appendChild(i)}},ZA=oo?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return Jd(t)})(s):s;/**
|
70
70
|
* @license
|
71
71
|
* Copyright 2017 Google LLC
|
72
72
|
* SPDX-License-Identifier: BSD-3-Clause
|
73
|
-
*/const{is:
|
73
|
+
*/const{is:qd,defineProperty:jd,getOwnPropertyDescriptor:Xd,getOwnPropertyNames:zd,getOwnPropertySymbols:Zd,getPrototypeOf:eg}=Object,Qi=globalThis,el=Qi.trustedTypes,tg=el?el.emptyScript:"",ao=Qi.reactiveElementPolyfillSupport,Vs=(s,e)=>s,Ao={toAttribute(s,e){switch(e){case Boolean:s=s?tg:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},lo=(s,e)=>!qd(s,e),tl={attribute:!0,type:String,converter:Ao,reflect:!1,hasChanged:lo};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Qi.litPropertyMetadata??(Qi.litPropertyMetadata=new WeakMap);class Js extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=tl){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(e,i,t);r!==void 0&&jd(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){const{get:r,set:n}=Xd(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const a=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??tl}static _$Ei(){if(this.hasOwnProperty(Vs("elementProperties")))return;const e=eg(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Vs("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Vs("properties"))){const t=this.properties,i=[...zd(t),...Zd(t)];for(const r of i)this.createProperty(r,t[r])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,r]of t)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const r=this._$Eu(t,i);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const r of i)t.unshift(ZA(r))}else e!==void 0&&t.push(ZA(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$Eg=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$ES??(this._$ES=[])).push(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$ES)==null||t.splice(this._$ES.indexOf(e)>>>0,1)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Wd(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t){var n;const i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){const o=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:Ao).toAttribute(t,i.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){var n;const i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:Ao;this._$Em=r,this[r]=a.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,i,r=!1,n){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??lo)(r?n:this[e],t))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.C(n,this[n],o)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$ES)==null||i.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(t)):this._$ET()}catch(r){throw e=!1,this._$ET(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)==null||t.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EO(t,this[t]))),this._$ET()}updated(e){}firstUpdated(e){}}Js.elementStyles=[],Js.shadowRootOptions={mode:"open"},Js[Vs("elementProperties")]=new Map,Js[Vs("finalized")]=new Map,ao==null||ao({ReactiveElement:Js}),(Qi.reactiveElementVersions??(Qi.reactiveElementVersions=[])).push("2.0.0");/**
|
74
74
|
* @license
|
75
75
|
* Copyright 2017 Google LLC
|
76
76
|
* SPDX-License-Identifier: BSD-3-Clause
|
77
|
-
*/const
|
78
|
-
${e}`,
|
79
|
-
${e}`,
|
77
|
+
*/const ig=Symbol();class kr{get taskComplete(){return this.t||(this.status===1?this.t=new Promise((e,t)=>{this.i=e,this.o=t}):this.status===3?this.t=Promise.reject(this.h):this.t=Promise.resolve(this.l)),this.t}constructor(e,t,i){var n;this.u=0,this.status=0,(this.p=e).addController(this);const r=typeof t=="object"?t:{task:t,args:i};this._=r.task,this.v=r.args,this.j=r.argsEqual??sg,this.m=r.onComplete,this.g=r.onError,this.autoRun=r.autoRun??!0,"initialValue"in r&&(this.l=r.initialValue,this.status=2,this.k=(n=this.A)==null?void 0:n.call(this))}hostUpdate(){this.autoRun===!0&&this.O()}hostUpdated(){this.autoRun==="afterUpdate"&&this.O()}A(){if(this.v===void 0)return;const e=this.v();if(!Array.isArray(e))throw Error("The args function must return an array");return e}async O(){const e=this.A(),t=this.k;this.k=e,e===t||e===void 0||t!==void 0&&this.j(t,e)||await this.run(e)}async run(e){var o,a,A,l,c;let t,i;e??(e=this.A()),this.k=e,this.status===1?(o=this.T)==null||o.abort():(this.t=void 0,this.i=void 0,this.o=void 0),this.status=1,this.autoRun==="afterUpdate"?queueMicrotask(()=>this.p.requestUpdate()):this.p.requestUpdate();const r=++this.u;this.T=new AbortController;let n=!1;try{t=await this._(e,{signal:this.T.signal})}catch(h){n=!0,i=h}if(this.u===r){if(t===ig)this.status=0;else{if(n===!1){try{(a=this.m)==null||a.call(this,t)}catch{}this.status=2,(A=this.i)==null||A.call(this,t)}else{try{(l=this.g)==null||l.call(this,i)}catch{}this.status=3,(c=this.o)==null||c.call(this,i)}this.l=t,this.h=i}this.p.requestUpdate()}}abort(e){var t;this.status===1&&((t=this.T)==null||t.abort(e))}get value(){return this.l}get error(){return this.h}render(e){var t,i,r,n;switch(this.status){case 0:return(t=e.initial)==null?void 0:t.call(e);case 1:return(i=e.pending)==null?void 0:i.call(e);case 2:return(r=e.complete)==null?void 0:r.call(e,this.value);case 3:return(n=e.error)==null?void 0:n.call(e,this.error);default:throw Error("Unexpected status: "+this.status)}}}const sg=(s,e)=>s===e||s.length===e.length&&s.every((t,i)=>!lo(t,e[i]));let Nr;const rg=new Uint8Array(16);function ng(){if(!Nr&&(Nr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Nr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Nr(rg)}const at=[];for(let s=0;s<256;++s)at.push((s+256).toString(16).slice(1));function og(s,e=0){return at[s[e+0]]+at[s[e+1]]+at[s[e+2]]+at[s[e+3]]+"-"+at[s[e+4]]+at[s[e+5]]+"-"+at[s[e+6]]+at[s[e+7]]+"-"+at[s[e+8]]+at[s[e+9]]+"-"+at[s[e+10]]+at[s[e+11]]+at[s[e+12]]+at[s[e+13]]+at[s[e+14]]+at[s[e+15]]}const il={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Yi(s,e,t){if(il.randomUUID&&!e&&!s)return il.randomUUID();s=s||{};const i=s.random||(s.rng||ng)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let r=0;r<16;++r)e[t+r]=i[r];return e}return og(i)}const sl="https://d2rxhdlm2q91uk.cloudfront.net",ag="https://d1ix11aj5kfygl.cloudfront.net",Ag="https://d157jlwnudd93d.cloudfront.net",rl="https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev",lg="https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging",cg="https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod",hg="http://localhost:6060/v2",ug="https://embed-dev.vouchfor.com/v2",dg="https://embed-staging.vouchfor.com/v2",gg="https://embed.vouchfor.com/v2";function Fr(s){if(!["local","dev","staging","prod"].includes(s))throw new Error(`Unknown environment: ${s}`);if(s==="local")return{videoUrl:sl,publicApiUrl:rl,embedApiUrl:hg};if(s==="dev")return{videoUrl:sl,publicApiUrl:rl,embedApiUrl:ug};if(s==="staging")return{videoUrl:ag,publicApiUrl:lg,embedApiUrl:dg};if(s==="prod")return{videoUrl:Ag,publicApiUrl:cg,embedApiUrl:gg}}class fg{constructor(e){this._fetching=!1,this.getVouch=async(t,i,r)=>{var c;const{embedApiUrl:n}=Fr(t),o=Yi(),a=await fetch(`${n}/vouches/${r}`,{method:"GET",headers:[["X-Api-Key",i],["X-Cache-Check",o]]}),A=await a.json();return this.host.dispatchEvent(new CustomEvent("vouch:loaded",{detail:A==null?void 0:A.id})),((c=a==null?void 0:a.headers)==null?void 0:c.get("X-Cache-Check"))!==o&&fetch(`${n}/vouches/${r}`,{method:"GET",headers:[["X-Api-Key",i],["Cache-Control","max-age=0"]]}),A},this.getTemplate=async(t,i,r)=>{var c;const{embedApiUrl:n}=Fr(t),o=Yi(),a=await fetch(`${n}/templates/${r}`,{method:"GET",headers:[["X-Api-Key",i],["X-Cache-Check",o]]}),A=await a.json();return((c=a==null?void 0:a.headers)==null?void 0:c.get("X-Cache-Check"))!==o&&fetch(`${n}/templates/${r}`,{method:"GET",headers:[["X-Api-Key",i],["Cache-Control","max-age=0"]]}),A},this.host=e,new kr(this.host,async([t,i,r,n,o])=>{var a,A,l,c;try{if(e.vouch=void 0,e.template=void 0,r){let h;o&&(this.fetching=!0,h=await this.getTemplate(t,i,o)),this._vouch=r,e.template=h??((A=(a=r==null?void 0:r.settings)==null?void 0:a.template)==null?void 0:A.instance)}else if(n){this.fetching=!0;const[h,u]=await Promise.all([this.getVouch(t,i,n),o?this.getTemplate(t,i,o):null]);this._vouch=h,e.template=u??((c=(l=h==null?void 0:h.settings)==null?void 0:l.template)==null?void 0:c.instance)}}finally{this.fetching=!1}},()=>[e.env,e.apiKey,e.data,e.vouchId,e.templateId]),new kr(this.host,([t,i])=>{e.vouch=t?{...t,questions:{items:t==null?void 0:t.questions.items.filter((r,n)=>!(i!=null&&i.length)||(i==null?void 0:i.includes(n+1)))}}:void 0},()=>[this._vouch,e.questions])}set fetching(e){this._fetching!==e&&(this._fetching=e,this.host.requestUpdate())}get fetching(){return this._fetching}}const pg=(s,e,t,i)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const r=Object.getOwnPropertyDescriptor(s,t),n=Object.getOwnPropertyDescriptor(e,t);!Eg(r,n)&&i||Object.defineProperty(s,t,n)},Eg=function(s,e){return s===void 0||s.configurable||s.writable===e.writable&&s.enumerable===e.enumerable&&s.configurable===e.configurable&&(s.writable||s.value===e.value)},Ig=(s,e)=>{const t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(s)&&Object.setPrototypeOf(s,t)},mg=(s,e)=>`/* Wrapped ${s}*/
|
78
|
+
${e}`,Cg=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),yg=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Bg=(s,e,t)=>{const i=t===""?"":`with ${t.trim()}() `,r=mg.bind(null,i,e.toString());Object.defineProperty(r,"name",yg),Object.defineProperty(s,"toString",{...Cg,value:r})};function vg(s,e,{ignoreNonConfigurable:t=!1}={}){const{name:i}=s;for(const r of Reflect.ownKeys(e))pg(s,e,r,t);return Ig(s,e),Bg(s,e,i),s}const Qg=new WeakMap,nl=new WeakMap;function co(s,{cacheKey:e,cache:t=new Map,maxAge:i}={}){if(i===0)return s;if(typeof i=="number"){if(i>2147483647)throw new TypeError("The `maxAge` option cannot exceed 2147483647.");if(i<0)throw new TypeError("The `maxAge` option should not be a negative number.")}const r=function(...n){var l;const o=e?e(n):n[0],a=t.get(o);if(a)return a.data;const A=s.apply(this,n);if(t.set(o,{data:A,maxAge:i?Date.now()+i:Number.POSITIVE_INFINITY}),typeof i=="number"&&i!==Number.POSITIVE_INFINITY){const c=setTimeout(()=>{t.delete(o)},i);(l=c.unref)==null||l.call(c);const h=nl.get(s)??new Set;h.add(c),nl.set(s,h)}return A};return vg(r,s,{ignoreNonConfigurable:!0}),Qg.set(r,t),r}var ol=function(){};const bg=(s,e,t)=>Math.min(Math.max(t,s),e),al=(s,e,t)=>{const i=e-s;return i===0?1:(t-s)/i},ho=(s,e,t)=>-t*s+t*e+s,Al=(s,e)=>t=>Math.max(Math.min(t,e),s),Ws=s=>s%1?Number(s.toFixed(5)):s,Mr=/(-)?([\d]*\.?[\d])+/g,uo=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Sg=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function qs(s){return typeof s=="string"}const Pr={test:s=>typeof s=="number",parse:parseFloat,transform:s=>s},ll=Object.assign(Object.assign({},Pr),{transform:Al(0,1)});Object.assign(Object.assign({},Pr),{default:1});const js=(s=>({test:e=>qs(e)&&e.endsWith(s)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${s}`}))("%");Object.assign(Object.assign({},js),{parse:s=>js.parse(s)/100,transform:s=>js.transform(s*100)});const go=(s,e)=>t=>!!(qs(t)&&Sg.test(t)&&t.startsWith(s)||e&&Object.prototype.hasOwnProperty.call(t,e)),cl=(s,e,t)=>i=>{if(!qs(i))return i;const[r,n,o,a]=i.match(Mr);return{[s]:parseFloat(r),[e]:parseFloat(n),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ki={test:go("hsl","hue"),parse:cl("hue","saturation","lightness"),transform:({hue:s,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(s)+", "+js.transform(Ws(e))+", "+js.transform(Ws(t))+", "+Ws(ll.transform(i))+")"},wg=Al(0,255),fo=Object.assign(Object.assign({},Pr),{transform:s=>Math.round(wg(s))}),bi={test:go("rgb","red"),parse:cl("red","green","blue"),transform:({red:s,green:e,blue:t,alpha:i=1})=>"rgba("+fo.transform(s)+", "+fo.transform(e)+", "+fo.transform(t)+", "+Ws(ll.transform(i))+")"};function Tg(s){let e="",t="",i="",r="";return s.length>5?(e=s.substr(1,2),t=s.substr(3,2),i=s.substr(5,2),r=s.substr(7,2)):(e=s.substr(1,1),t=s.substr(2,1),i=s.substr(3,1),r=s.substr(4,1),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const po={test:go("#"),parse:Tg,transform:bi.transform},Or={test:s=>bi.test(s)||po.test(s)||Ki.test(s),parse:s=>bi.test(s)?bi.parse(s):Ki.test(s)?Ki.parse(s):po.parse(s),transform:s=>qs(s)?s:s.hasOwnProperty("red")?bi.transform(s):Ki.transform(s)},hl="${c}",ul="${n}";function xg(s){var e,t,i,r;return isNaN(s)&&qs(s)&&((t=(e=s.match(Mr))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((r=(i=s.match(uo))===null||i===void 0?void 0:i.length)!==null&&r!==void 0?r:0)>0}function dl(s){typeof s=="number"&&(s=`${s}`);const e=[];let t=0;const i=s.match(uo);i&&(t=i.length,s=s.replace(uo,hl),e.push(...i.map(Or.parse)));const r=s.match(Mr);return r&&(s=s.replace(Mr,ul),e.push(...r.map(Pr.parse))),{values:e,numColors:t,tokenised:s}}function gl(s){return dl(s).values}function fl(s){const{values:e,numColors:t,tokenised:i}=dl(s),r=e.length;return n=>{let o=i;for(let a=0;a<r;a++)o=o.replace(a<t?hl:ul,a<t?Or.transform(n[a]):Ws(n[a]));return o}}const Dg=s=>typeof s=="number"?0:s;function Rg(s){const e=gl(s);return fl(s)(e.map(Dg))}const pl={test:xg,parse:gl,createTransformer:fl,getAnimatableNone:Rg};function Eo(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<.16666666666666666?s+(e-s)*6*t:t<.5?e:t<.6666666666666666?s+(e-s)*(.6666666666666666-t)*6:s}function El({hue:s,saturation:e,lightness:t,alpha:i}){s/=360,e/=100,t/=100;let r=0,n=0,o=0;if(!e)r=n=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,A=2*t-a;r=Eo(A,a,s+.3333333333333333),n=Eo(A,a,s),o=Eo(A,a,s-.3333333333333333)}return{red:Math.round(r*255),green:Math.round(n*255),blue:Math.round(o*255),alpha:i}}const Lg=(s,e,t)=>{const i=s*s,r=e*e;return Math.sqrt(Math.max(0,t*(r-i)+i))},_g=[po,bi,Ki],Il=s=>_g.find(e=>e.test(s)),ml=(s,e)=>{let t=Il(s),i=Il(e),r=t.parse(s),n=i.parse(e);t===Ki&&(r=El(r),t=bi),i===Ki&&(n=El(n),i=bi);const o=Object.assign({},r);return a=>{for(const A in o)A!=="alpha"&&(o[A]=Lg(r[A],n[A],a));return o.alpha=ho(r.alpha,n.alpha,a),t.transform(o)}},kg=s=>typeof s=="number",Ng=(s,e)=>t=>e(s(t)),Cl=(...s)=>s.reduce(Ng);function yl(s,e){return kg(s)?t=>ho(s,e,t):Or.test(s)?ml(s,e):Ql(s,e)}const Bl=(s,e)=>{const t=[...s],i=t.length,r=s.map((n,o)=>yl(n,e[o]));return n=>{for(let o=0;o<i;o++)t[o]=r[o](n);return t}},Fg=(s,e)=>{const t=Object.assign(Object.assign({},s),e),i={};for(const r in t)s[r]!==void 0&&e[r]!==void 0&&(i[r]=yl(s[r],e[r]));return r=>{for(const n in i)t[n]=i[n](r);return t}};function vl(s){const e=pl.parse(s),t=e.length;let i=0,r=0,n=0;for(let o=0;o<t;o++)i||typeof e[o]=="number"?i++:e[o].hue!==void 0?n++:r++;return{parsed:e,numNumbers:i,numRGB:r,numHSL:n}}const Ql=(s,e)=>{const t=pl.createTransformer(e),i=vl(s),r=vl(e);return i.numHSL===r.numHSL&&i.numRGB===r.numRGB&&i.numNumbers>=r.numNumbers?Cl(Bl(i.parsed,r.parsed),t):o=>`${o>0?e:s}`},Mg=(s,e)=>t=>ho(s,e,t);function Pg(s){if(typeof s=="number")return Mg;if(typeof s=="string")return Or.test(s)?ml:Ql;if(Array.isArray(s))return Bl;if(typeof s=="object")return Fg}function Og(s,e,t){const i=[],r=t||Pg(s[0]),n=s.length-1;for(let o=0;o<n;o++){let a=r(s[o],s[o+1]);if(e){const A=Array.isArray(e)?e[o]:e;a=Cl(A,a)}i.push(a)}return i}function Ug([s,e],[t]){return i=>t(al(s,e,i))}function Gg(s,e){const t=s.length,i=t-1;return r=>{let n=0,o=!1;if(r<=s[0]?o=!0:r>=s[i]&&(n=i-1,o=!0),!o){let A=1;for(;A<t&&!(s[A]>r||A===i);A++);n=A-1}const a=al(s[n],s[n+1],r);return e[n](a)}}function Hg(s,e,{clamp:t=!0,ease:i,mixer:r}={}){const n=s.length;ol(n===e.length),ol(!i||!Array.isArray(i)||i.length===n-1),s[0]>s[n-1]&&(s=[].concat(s),e=[].concat(e),s.reverse(),e.reverse());const o=Og(e,i,r),a=n===2?Ug(s,o):Gg(s,o);return t?A=>a(bg(s[0],s[n-1],A)):a}const Ur=s=>e=>1-s(1-e),Io=s=>e=>e<=.5?s(2*e)/2:(2-s(2*(1-e)))/2,$g=s=>e=>Math.pow(e,s),bl=s=>e=>e*e*((s+1)*e-s),Yg=s=>{const e=bl(s);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))},Sl=1.525,Kg=4/11,Vg=8/11,Jg=9/10,Wg=s=>s,mo=$g(2),qg=Ur(mo),jg=Io(mo),wl=s=>1-Math.sin(Math.acos(s)),Tl=Ur(wl),Xg=Io(Tl),Co=bl(Sl),zg=Ur(Co),Zg=Io(Co),ef=Yg(Sl),tf=4356/361,sf=35442/1805,rf=16061/1805,Gr=s=>{if(s===1||s===0)return s;const e=s*s;return s<Kg?7.5625*e:s<Vg?9.075*e-9.9*s+3.4:s<Jg?tf*e-sf*s+rf:10.8*s*s-20.52*s+10.72},nf=Ur(Gr),of=s=>s<.5?.5*(1-Gr(1-s*2)):.5*Gr(s*2-1)+.5,af=(s,e,t,i)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const r=Object.getOwnPropertyDescriptor(s,t),n=Object.getOwnPropertyDescriptor(e,t);!Af(r,n)&&i||Object.defineProperty(s,t,n)},Af=function(s,e){return s===void 0||s.configurable||s.writable===e.writable&&s.enumerable===e.enumerable&&s.configurable===e.configurable&&(s.writable||s.value===e.value)},lf=(s,e)=>{const t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(s)&&Object.setPrototypeOf(s,t)},cf=(s,e)=>`/* Wrapped ${s}*/
|
79
|
+
${e}`,hf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),uf=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),df=(s,e,t)=>{const i=t===""?"":`with ${t.trim()}() `,r=cf.bind(null,i,e.toString());Object.defineProperty(r,"name",uf),Object.defineProperty(s,"toString",{...hf,value:r})};function gf(s,e,{ignoreNonConfigurable:t=!1}={}){const{name:i}=s;for(const r of Reflect.ownKeys(e))af(s,e,r,t);return lf(s,e),df(s,e,i),s}const ff=new WeakMap;function oi(s,{cacheKey:e=([i])=>i,cache:t=new Map}={}){const i=new Map,r=function(...n){const o=e(n);if(i.has(o))return i.get(o);const a=(async()=>{try{if(t&&await t.has(o))return await t.get(o);const l=await s.apply(this,n);try{return l}finally{t&&await t.set(o,l)}}finally{i.delete(o)}})();return i.set(o,a),a};return gf(r,s,{ignoreNonConfigurable:!0}),ff.set(r,t),r}var Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yo(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Bo={exports:{}};(function(s,e){(function(t,i){i(e)})(Hr,function(t){function i(v){var w,F,H=new Error(v);return w=H,F=i.prototype,Object.setPrototypeOf?Object.setPrototypeOf(w,F):w.__proto__=F,H}function r(v,w,F){var H=w.slice(0,F).split(/\n/),K=H.length,j=H[K-1].length+1;throw i(v+=" at line "+K+" col "+j+`:
|
80
80
|
|
81
81
|
`+w.split(/\n/)[K-1]+`
|
82
82
|
`+Array(j).join(" ")+"^")}i.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var n=new Function("return this")().Promise,o=!1;try{o=new Function("return (async function(){}).constructor")()}catch(v){if(!(v instanceof SyntaxError))throw v}function a(v,w){return Object.prototype.hasOwnProperty.call(v,w)}function A(v,w,F){for(var H in w)a(w,H)&&(w[H]==null||typeof w[H]!="object"||H!=="storage"&&H!=="prefixes"||F?v[H]=w[H]:v[H]=A({},w[H]));return v}var l=/^async +/,c=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,h=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,u=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,d=/[.*+\-?^${}()|[\]\\]/g;function g(v){return d.test(v)?v.replace(d,"\\$&"):v}function f(v,w){w.rmWhitespace&&(v=v.replace(/[\r\n]+/g,`
|
83
|
-
`).replace(/^\s+|\s+$/gm,"")),c.lastIndex=0,h.lastIndex=0,u.lastIndex=0;var F=w.prefixes,H=[F.h,F.b,F.i,F.r,F.c,F.e].reduce(function(
|
84
|
-
`)}}return K}var b=function(){function v(w){this.cache=w}return v.prototype.define=function(w,F){this.cache[w]=F},v.prototype.get=function(w){return this.cache[w]},v.prototype.remove=function(w){delete this.cache[w]},v.prototype.reset=function(){this.cache={}},v.prototype.load=function(w){A(this.cache,w,!0)},v}();function L(v,w,F,H){if(w&&w.length>0)throw i((H?"Native":"")+"Helper '"+v+"' doesn't accept blocks");if(F&&F.length>0)throw i((H?"Native":"")+"Helper '"+v+"' doesn't accept filters")}var R={"&":"&","<":"<",">":">",'"':""","'":"'"};function O(v){return R[v]}var k=new b({}),W=new b({each:function(v,w){var F="",H=v.params[0];if(L("each",w,!1),v.async)return new Promise(function(j){(function se(ue,
|
83
|
+
`).replace(/^\s+|\s+$/gm,"")),c.lastIndex=0,h.lastIndex=0,u.lastIndex=0;var F=w.prefixes,H=[F.h,F.b,F.i,F.r,F.c,F.e].reduce(function(oe,Ie){return oe&&Ie?oe+"|"+g(Ie):Ie?g(Ie):oe},""),K=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+g(w.tags[1])+")","g"),j=new RegExp("([^]*?)"+g(w.tags[0])+"(-|_)?\\s*("+H+")?\\s*","g"),se=0,ue=!1;function le(oe,Ie){var Be,ce={f:[]},Ae=0,ne="c";function be(We){var rt=v.slice(se,We),Xe=rt.trim();if(ne==="f")Xe==="safe"?ce.raw=!0:w.async&&l.test(Xe)?(Xe=Xe.replace(l,""),ce.f.push([Xe,"",!0])):ce.f.push([Xe,""]);else if(ne==="fp")ce.f[ce.f.length-1][1]+=Xe;else if(ne==="err"){if(Xe){var pt=rt.search(/\S/);r("invalid syntax",v,se+pt)}}else ce[ne]=Xe;se=We+1}for(Ie==="h"||Ie==="b"||Ie==="c"?ne="n":Ie==="r"&&(ce.raw=!0,Ie="i"),K.lastIndex=se;(Be=K.exec(v))!==null;){var Pe=Be[1],Te=Be[2],ke=Be[3],Oe=Be[4],De=Be[5],ve=Be.index;if(Pe)Pe==="("?(Ae===0&&(ne==="n"?(be(ve),ne="p"):ne==="f"&&(be(ve),ne="fp")),Ae++):Pe===")"?--Ae===0&&ne!=="c"&&(be(ve),ne="err"):Ae===0&&Pe==="|"?(be(ve),ne="f"):Pe==="=>"&&(be(ve),se+=1,ne="res");else if(Te)if(Te==="/*"){var He=v.indexOf("*/",K.lastIndex);He===-1&&r("unclosed comment",v,Be.index),K.lastIndex=He+2}else Te==="'"?(h.lastIndex=Be.index,h.exec(v)?K.lastIndex=h.lastIndex:r("unclosed string",v,Be.index)):Te==='"'?(u.lastIndex=Be.index,u.exec(v)?K.lastIndex=u.lastIndex:r("unclosed string",v,Be.index)):Te==="`"&&(c.lastIndex=Be.index,c.exec(v)?K.lastIndex=c.lastIndex:r("unclosed string",v,Be.index));else if(ke)return be(ve),se=ve+Be[0].length,j.lastIndex=se,ue=De,Oe&&Ie==="h"&&(Ie="s"),ce.t=Ie,ce}return r("unclosed tag",v,oe),ce}var Ce=function oe(Ie,Be){Ie.b=[],Ie.d=[];var ce,Ae=!1,ne=[];function be(pt,fi){pt&&(pt=function(Et,ti,ii,si){var ct,G;return typeof ti.autoTrim=="string"?ct=G=ti.autoTrim:Array.isArray(ti.autoTrim)&&(ct=ti.autoTrim[1],G=ti.autoTrim[0]),(ii||ii===!1)&&(ct=ii),(si||si===!1)&&(G=si),ct==="slurp"&&G==="slurp"?Et.trim():(ct==="_"||ct==="slurp"?Et=String.prototype.trimLeft?Et.trimLeft():Et.replace(/^[\s\uFEFF\xA0]+/,""):ct!=="-"&&ct!=="nl"||(Et=Et.replace(/^(?:\n|\r|\r\n)/,"")),G==="_"||G==="slurp"?Et=String.prototype.trimRight?Et.trimRight():Et.replace(/[\s\uFEFF\xA0]+$/,""):G!=="-"&&G!=="nl"||(Et=Et.replace(/(?:\n|\r|\r\n)$/,"")),Et)}(pt,w,ue,fi))&&(pt=pt.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),ne.push(pt))}for(;(ce=j.exec(v))!==null;){var Pe,Te=ce[1],ke=ce[2],Oe=ce[3]||"";for(var De in F)if(F[De]===Oe){Pe=De;break}be(Te,ke),se=ce.index+ce[0].length,Pe||r("unrecognized tag type: "+Oe,v,se);var ve=le(ce.index,Pe),He=ve.t;if(He==="h"){var We=ve.n||"";w.async&&l.test(We)&&(ve.a=!0,ve.n=We.replace(l,"")),ve=oe(ve),ne.push(ve)}else if(He==="c"){if(Ie.n===ve.n)return Ae?(Ae.d=ne,Ie.b.push(Ae)):Ie.d=ne,Ie;r("Helper start and end don't match",v,ce.index+ce[0].length)}else if(He==="b"){Ae?(Ae.d=ne,Ie.b.push(Ae)):Ie.d=ne;var rt=ve.n||"";w.async&&l.test(rt)&&(ve.a=!0,ve.n=rt.replace(l,"")),Ae=ve,ne=[]}else if(He==="s"){var Xe=ve.n||"";w.async&&l.test(Xe)&&(ve.a=!0,ve.n=Xe.replace(l,"")),ne.push(ve)}else ne.push(ve)}if(!Be)throw i('unclosed helper "'+Ie.n+'"');return be(v.slice(se,v.length),!1),Ie.d=ne,Ie}({f:[]},!0);if(w.plugins)for(var Se=0;Se<w.plugins.length;Se++){var Le=w.plugins[Se];Le.processAST&&(Ce.d=Le.processAST(Ce.d,w))}return Ce.d}function p(v,w){var F=f(v,w),H="var tR='';"+(w.useWith?"with("+w.varName+"||{}){":"")+T(F,w)+"if(cb){cb(null,tR)} return tR"+(w.useWith?"}":"");if(w.plugins)for(var K=0;K<w.plugins.length;K++){var j=w.plugins[K];j.processFnString&&(H=j.processFnString(H,w))}return H}function y(v,w){for(var F=0;F<w.length;F++){var H=w[F][0],K=w[F][1];v=(w[F][2]?"await ":"")+"c.l('F','"+H+"')("+v,K&&(v+=","+K),v+=")"}return v}function B(v,w,F,H,K,j){var se="{exec:"+(K?"async ":"")+C(F,w,v)+",params:["+H+"]";return j&&(se+=",name:'"+j+"'"),K&&(se+=",async:true"),se+="}"}function Q(v,w){for(var F="[",H=0;H<v.length;H++){var K=v[H];F+=B(w,K.res||"",K.d,K.p||"",K.a,K.n),H<v.length&&(F+=",")}return F+="]"}function C(v,w,F){return"function("+w+"){var tR='';"+T(v,F)+"return tR}"}function T(v,w){for(var F=0,H=v.length,K="";F<H;F++){var j=v[F];if(typeof j=="string")K+="tR+='"+j+"';";else{var se=j.t,ue=j.c||"",le=j.f,Ce=j.n||"",Se=j.p||"",Le=j.res||"",oe=j.b,Ie=!!j.a;if(se==="i"){w.defaultFilter&&(ue="c.l('F','"+w.defaultFilter+"')("+ue+")");var Be=y(ue,le);!j.raw&&w.autoEscape&&(Be="c.l('F','e')("+Be+")"),K+="tR+="+Be+";"}else if(se==="h")if(w.storage.nativeHelpers.get(Ce))K+=w.storage.nativeHelpers.get(Ce)(j,w);else{var ce=(Ie?"await ":"")+"c.l('H','"+Ce+"')("+B(w,Le,j.d,Se,Ie);ce+=oe?","+Q(oe,w):",[]",K+="tR+="+y(ce+=",c)",le)+";"}else se==="s"?K+="tR+="+y((Ie?"await ":"")+"c.l('H','"+Ce+"')({params:["+Se+"]},[],c)",le)+";":se==="e"&&(K+=ue+`
|
84
|
+
`)}}return K}var b=function(){function v(w){this.cache=w}return v.prototype.define=function(w,F){this.cache[w]=F},v.prototype.get=function(w){return this.cache[w]},v.prototype.remove=function(w){delete this.cache[w]},v.prototype.reset=function(){this.cache={}},v.prototype.load=function(w){A(this.cache,w,!0)},v}();function L(v,w,F,H){if(w&&w.length>0)throw i((H?"Native":"")+"Helper '"+v+"' doesn't accept blocks");if(F&&F.length>0)throw i((H?"Native":"")+"Helper '"+v+"' doesn't accept filters")}var R={"&":"&","<":"<",">":">",'"':""","'":"'"};function O(v){return R[v]}var k=new b({}),W=new b({each:function(v,w){var F="",H=v.params[0];if(L("each",w,!1),v.async)return new Promise(function(j){(function se(ue,le,Ce,Se,Le){Ce(ue[le],le).then(function(oe){Se+=oe,le===ue.length-1?Le(Se):se(ue,le+1,Ce,Se,Le)})})(H,0,v.exec,F,j)});for(var K=0;K<H.length;K++)F+=v.exec(H[K],K);return F},foreach:function(v,w){var F=v.params[0];if(L("foreach",w,!1),v.async)return new Promise(function(j){(function se(ue,le,Ce,Se,Le,oe){Se(le[Ce],ue[le[Ce]]).then(function(Ie){Le+=Ie,Ce===le.length-1?oe(Le):se(ue,le,Ce+1,Se,Le,oe)})})(F,Object.keys(F),0,v.exec,"",j)});var H="";for(var K in F)a(F,K)&&(H+=v.exec(K,F[K]));return H},include:function(v,w,F){L("include",w,!1);var H=F.storage.templates.get(v.params[0]);if(!H)throw i('Could not fetch template "'+v.params[0]+'"');return H(v.params[1],F)},extends:function(v,w,F){var H=v.params[1]||{};H.content=v.exec();for(var K=0;K<w.length;K++){var j=w[K];H[j.name]=j.exec()}var se=F.storage.templates.get(v.params[0]);if(!se)throw i('Could not fetch template "'+v.params[0]+'"');return se(H,F)},useScope:function(v,w){return L("useScope",w,!1),v.exec(v.params[0])}}),$=new b({if:function(v,w){L("if",!1,v.f,!0);var F="if("+v.p+"){"+T(v.d,w)+"}";if(v.b)for(var H=0;H<v.b.length;H++){var K=v.b[H];K.n==="else"?F+="else{"+T(K.d,w)+"}":K.n==="elif"&&(F+="else if("+K.p+"){"+T(K.d,w)+"}")}return F},try:function(v,w){if(L("try",!1,v.f,!0),!v.b||v.b.length!==1||v.b[0].n!=="catch")throw i("native helper 'try' only accepts 1 block, 'catch'");var F="try{"+T(v.d,w)+"}",H=v.b[0];return F+="catch"+(H.res?"("+H.res+")":"")+"{"+T(H.d,w)+"}"},block:function(v,w){return L("block",v.b,v.f,!0),"if(!"+w.varName+"["+v.p+"]){tR+=("+C(v.d,"",w)+")()}else{tR+="+w.varName+"["+v.p+"]}"}}),te=new b({e:function(v){var w=String(v);return/[&<>"']/.test(w)?w.replace(/[&<>"']/g,O):w}}),Z={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(v,w){if(v==="H"){var F=this.storage.helpers.get(w);if(F)return F;throw i("Can't find helper '"+w+"'")}if(v==="F"){var H=this.storage.filters.get(w);if(H)return H;throw i("Can't find filter '"+w+"'")}},async:!1,storage:{helpers:W,nativeHelpers:$,filters:te,templates:k},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function S(v,w){var F={};return A(F,Z),w&&A(F,w),v&&A(F,v),F.l.bind(F),F}function D(v,w){var F=S(w||{}),H=Function;if(F.async){if(!o)throw i("This environment doesn't support async/await");H=o}try{return new H(F.varName,"c","cb",p(v,F))}catch(K){throw K instanceof SyntaxError?i(`Bad template syntax
|
85
85
|
|
86
86
|
`+K.message+`
|
87
87
|
`+Array(K.message.length+1).join("=")+`
|
88
|
-
`+p(v,F)):K}}function U(v,w){var F;return w.cache&&w.name&&w.storage.templates.get(w.name)?w.storage.templates.get(w.name):(F=typeof v=="function"?v:D(v,w),w.cache&&w.name&&w.storage.templates.define(w.name,F),F)}ee.l.bind(ee),t.compile=D,t.compileScope=T,t.compileScopeIntoFunction=C,t.compileToString=p,t.defaultConfig=ee,t.filters=te,t.getConfig=S,t.helpers=W,t.nativeHelpers=$,t.parse=f,t.render=function(v,w,F,H){var K=S(F||{});if(!K.async)return U(v,K)(w,K);if(!H){if(typeof n=="function")return new n(function(j,se){try{j(U(v,K)(w,K))}catch(ue){se(ue)}});throw i("Please provide a callback function, this env doesn't support Promises")}try{U(v,K)(w,K,H)}catch(j){return H(j)}},t.templates=k,Object.defineProperty(t,"__esModule",{value:!0})})})(Bo,Bo.exports);var $r=Bo.exports,xl={},vo={},ye={};Object.defineProperty(ye,"__esModule",{value:!0}),ye.default=ye.Wrap=ye.Unit=ye.PrintOptions=ye.PositionType=ye.Overflow=ye.NodeType=ye.MeasureMode=ye.LogLevel=ye.Justify=ye.Gutter=ye.FlexDirection=ye.ExperimentalFeature=ye.Errata=ye.Edge=ye.Display=ye.Direction=ye.Dimension=ye.Align=void 0;let oi=function(s){return s[s.Auto=0]="Auto",s[s.FlexStart=1]="FlexStart",s[s.Center=2]="Center",s[s.FlexEnd=3]="FlexEnd",s[s.Stretch=4]="Stretch",s[s.Baseline=5]="Baseline",s[s.SpaceBetween=6]="SpaceBetween",s[s.SpaceAround=7]="SpaceAround",s}({});ye.Align=oi;let Qo=function(s){return s[s.Width=0]="Width",s[s.Height=1]="Height",s}({});ye.Dimension=Qo;let Yr=function(s){return s[s.Inherit=0]="Inherit",s[s.LTR=1]="LTR",s[s.RTL=2]="RTL",s}({});ye.Direction=Yr;let bo=function(s){return s[s.Flex=0]="Flex",s[s.None=1]="None",s}({});ye.Display=bo;let Kt=function(s){return s[s.Left=0]="Left",s[s.Top=1]="Top",s[s.Right=2]="Right",s[s.Bottom=3]="Bottom",s[s.Start=4]="Start",s[s.End=5]="End",s[s.Horizontal=6]="Horizontal",s[s.Vertical=7]="Vertical",s[s.All=8]="All",s}({});ye.Edge=Kt;let Xs=function(s){return s[s.None=0]="None",s[s.StretchFlexBasis=1]="StretchFlexBasis",s[s.All=2147483647]="All",s[s.Classic=2147483646]="Classic",s}({});ye.Errata=Xs;let Kr=function(s){return s[s.WebFlexBasis=0]="WebFlexBasis",s[s.AbsolutePercentageAgainstPaddingEdge=1]="AbsolutePercentageAgainstPaddingEdge",s[s.FixJNILocalRefOverflows=2]="FixJNILocalRefOverflows",s}({});ye.ExperimentalFeature=Kr;let zs=function(s){return s[s.Column=0]="Column",s[s.ColumnReverse=1]="ColumnReverse",s[s.Row=2]="Row",s[s.RowReverse=3]="RowReverse",s}({});ye.FlexDirection=zs;let Vr=function(s){return s[s.Column=0]="Column",s[s.Row=1]="Row",s[s.All=2]="All",s}({});ye.Gutter=Vr;let Vi=function(s){return s[s.FlexStart=0]="FlexStart",s[s.Center=1]="Center",s[s.FlexEnd=2]="FlexEnd",s[s.SpaceBetween=3]="SpaceBetween",s[s.SpaceAround=4]="SpaceAround",s[s.SpaceEvenly=5]="SpaceEvenly",s}({});ye.Justify=Vi;let Ji=function(s){return s[s.Error=0]="Error",s[s.Warn=1]="Warn",s[s.Info=2]="Info",s[s.Debug=3]="Debug",s[s.Verbose=4]="Verbose",s[s.Fatal=5]="Fatal",s}({});ye.LogLevel=Ji;let Jr=function(s){return s[s.Undefined=0]="Undefined",s[s.Exactly=1]="Exactly",s[s.AtMost=2]="AtMost",s}({});ye.MeasureMode=Jr;let So=function(s){return s[s.Default=0]="Default",s[s.Text=1]="Text",s}({});ye.NodeType=So;let Wr=function(s){return s[s.Visible=0]="Visible",s[s.Hidden=1]="Hidden",s[s.Scroll=2]="Scroll",s}({});ye.Overflow=Wr;let qr=function(s){return s[s.Static=0]="Static",s[s.Relative=1]="Relative",s[s.Absolute=2]="Absolute",s}({});ye.PositionType=qr;let jr=function(s){return s[s.Layout=1]="Layout",s[s.Style=2]="Style",s[s.Children=4]="Children",s}({});ye.PrintOptions=jr;let Zs=function(s){return s[s.Undefined=0]="Undefined",s[s.Point=1]="Point",s[s.Percent=2]="Percent",s[s.Auto=3]="Auto",s}({});ye.Unit=Zs;let Xr=function(s){return s[s.NoWrap=0]="NoWrap",s[s.Wrap=1]="Wrap",s[s.WrapReverse=2]="WrapReverse",s}({});ye.Wrap=Xr;var ff={ALIGN_AUTO:oi.Auto,ALIGN_FLEX_START:oi.FlexStart,ALIGN_CENTER:oi.Center,ALIGN_FLEX_END:oi.FlexEnd,ALIGN_STRETCH:oi.Stretch,ALIGN_BASELINE:oi.Baseline,ALIGN_SPACE_BETWEEN:oi.SpaceBetween,ALIGN_SPACE_AROUND:oi.SpaceAround,DIMENSION_WIDTH:Qo.Width,DIMENSION_HEIGHT:Qo.Height,DIRECTION_INHERIT:Yr.Inherit,DIRECTION_LTR:Yr.LTR,DIRECTION_RTL:Yr.RTL,DISPLAY_FLEX:bo.Flex,DISPLAY_NONE:bo.None,EDGE_LEFT:Kt.Left,EDGE_TOP:Kt.Top,EDGE_RIGHT:Kt.Right,EDGE_BOTTOM:Kt.Bottom,EDGE_START:Kt.Start,EDGE_END:Kt.End,EDGE_HORIZONTAL:Kt.Horizontal,EDGE_VERTICAL:Kt.Vertical,EDGE_ALL:Kt.All,ERRATA_NONE:Xs.None,ERRATA_STRETCH_FLEX_BASIS:Xs.StretchFlexBasis,ERRATA_ALL:Xs.All,ERRATA_CLASSIC:Xs.Classic,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:Kr.WebFlexBasis,EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE:Kr.AbsolutePercentageAgainstPaddingEdge,EXPERIMENTAL_FEATURE_FIX_JNILOCAL_REF_OVERFLOWS:Kr.FixJNILocalRefOverflows,FLEX_DIRECTION_COLUMN:zs.Column,FLEX_DIRECTION_COLUMN_REVERSE:zs.ColumnReverse,FLEX_DIRECTION_ROW:zs.Row,FLEX_DIRECTION_ROW_REVERSE:zs.RowReverse,GUTTER_COLUMN:Vr.Column,GUTTER_ROW:Vr.Row,GUTTER_ALL:Vr.All,JUSTIFY_FLEX_START:Vi.FlexStart,JUSTIFY_CENTER:Vi.Center,JUSTIFY_FLEX_END:Vi.FlexEnd,JUSTIFY_SPACE_BETWEEN:Vi.SpaceBetween,JUSTIFY_SPACE_AROUND:Vi.SpaceAround,JUSTIFY_SPACE_EVENLY:Vi.SpaceEvenly,LOG_LEVEL_ERROR:Ji.Error,LOG_LEVEL_WARN:Ji.Warn,LOG_LEVEL_INFO:Ji.Info,LOG_LEVEL_DEBUG:Ji.Debug,LOG_LEVEL_VERBOSE:Ji.Verbose,LOG_LEVEL_FATAL:Ji.Fatal,MEASURE_MODE_UNDEFINED:Jr.Undefined,MEASURE_MODE_EXACTLY:Jr.Exactly,MEASURE_MODE_AT_MOST:Jr.AtMost,NODE_TYPE_DEFAULT:So.Default,NODE_TYPE_TEXT:So.Text,OVERFLOW_VISIBLE:Wr.Visible,OVERFLOW_HIDDEN:Wr.Hidden,OVERFLOW_SCROLL:Wr.Scroll,POSITION_TYPE_STATIC:qr.Static,POSITION_TYPE_RELATIVE:qr.Relative,POSITION_TYPE_ABSOLUTE:qr.Absolute,PRINT_OPTIONS_LAYOUT:jr.Layout,PRINT_OPTIONS_STYLE:jr.Style,PRINT_OPTIONS_CHILDREN:jr.Children,UNIT_UNDEFINED:Zs.Undefined,UNIT_POINT:Zs.Point,UNIT_PERCENT:Zs.Percent,UNIT_AUTO:Zs.Auto,WRAP_NO_WRAP:Xr.NoWrap,WRAP_WRAP:Xr.Wrap,WRAP_WRAP_REVERSE:Xr.WrapReverse};ye.default=ff,Object.defineProperty(vo,"__esModule",{value:!0}),vo.default=Ef;var Si=pf(ye);function Dl(s){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Dl=function(i){return i?t:e})(s)}function pf(s,e){if(!e&&s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var t=Dl(e);if(t&&t.has(s))return t.get(s);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in s)if(n!=="default"&&Object.prototype.hasOwnProperty.call(s,n)){var o=r?Object.getOwnPropertyDescriptor(s,n):null;o&&(o.get||o.set)?Object.defineProperty(i,n,o):i[n]=s[n]}return i.default=s,t&&t.set(s,i),i}function Ef(s){function e(r,n,o){const a=r[n];r[n]=function(){for(var A=arguments.length,l=new Array(A),c=0;c<A;c++)l[c]=arguments[c];return o.call(this,a,...l)}}for(const r of["setPosition","setMargin","setFlexBasis","setWidth","setHeight","setMinWidth","setMinHeight","setMaxWidth","setMaxHeight","setPadding"]){const n={[Si.Unit.Point]:s.Node.prototype[r],[Si.Unit.Percent]:s.Node.prototype[`${r}Percent`],[Si.Unit.Auto]:s.Node.prototype[`${r}Auto`]};e(s.Node.prototype,r,function(o){for(var a=arguments.length,A=new Array(a>1?a-1:0),l=1;l<a;l++)A[l-1]=arguments[l];const c=A.pop();let h,u;if(c==="auto")h=Si.Unit.Auto,u=void 0;else if(typeof c=="object")h=c.unit,u=c.valueOf();else if(h=typeof c=="string"&&c.endsWith("%")?Si.Unit.Percent:Si.Unit.Point,u=parseFloat(c),!Number.isNaN(c)&&Number.isNaN(u))throw new Error(`Invalid value ${c} for ${r}`);if(!n[h])throw new Error(`Failed to execute "${r}": Unsupported unit '${c}'`);return u!==void 0?n[h].call(this,...A,u):n[h].call(this,...A)})}function t(r){return s.MeasureCallback.implement({measure:function(){const{width:n,height:o}=r(...arguments);return{width:n??NaN,height:o??NaN}}})}e(s.Node.prototype,"setMeasureFunc",function(r,n){return n?r.call(this,t(n)):this.unsetMeasureFunc()});function i(r){return s.DirtiedCallback.implement({dirtied:r})}return e(s.Node.prototype,"setDirtiedFunc",function(r,n){r.call(this,i(n))}),e(s.Config.prototype,"free",function(){s.Config.destroy(this)}),e(s.Node,"create",(r,n)=>n?s.Node.createWithConfig(n):s.Node.createDefault()),e(s.Node.prototype,"free",function(){s.Node.destroy(this)}),e(s.Node.prototype,"freeRecursive",function(){for(let r=0,n=this.getChildCount();r<n;++r)this.getChild(0).freeRecursive();this.free()}),e(s.Node.prototype,"calculateLayout",function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Si.Direction.LTR;return r.call(this,n,o,a)}),{Config:s.Config,Node:s.Node,...Si.default}}var Rl={exports:{}};(function(s,e){var t=(()=>{var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(r){r=r||{};var n;n||(n=typeof r<"u"?r:{});var o,a;n.ready=new Promise(function(I,m){o=I,a=m});var A=Object.assign({},n),l="";typeof document<"u"&&document.currentScript&&(l=document.currentScript.src),i&&(l=i),l.indexOf("blob:")!==0?l=l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):l="";var c=n.print||console.log.bind(console),h=n.printErr||console.warn.bind(console);Object.assign(n,A),A=null;var u;n.wasmBinary&&(u=n.wasmBinary),n.noExitRuntime,typeof WebAssembly!="object"&&U("no native wasm support detected");var d,g=!1;function f(I,m,x){x=m+x;for(var _="";!(m>=x);){var M=I[m++];if(!M)break;if(M&128){var V=I[m++]&63;if((M&224)==192)_+=String.fromCharCode((M&31)<<6|V);else{var q=I[m++]&63;M=(M&240)==224?(M&15)<<12|V<<6|q:(M&7)<<18|V<<12|q<<6|I[m++]&63,65536>M?_+=String.fromCharCode(M):(M-=65536,_+=String.fromCharCode(55296|M>>10,56320|M&1023))}}else _+=String.fromCharCode(M)}return _}var p,y,B,Q,C,T,b,L,R;function O(){var I=d.buffer;p=I,n.HEAP8=y=new Int8Array(I),n.HEAP16=Q=new Int16Array(I),n.HEAP32=T=new Int32Array(I),n.HEAPU8=B=new Uint8Array(I),n.HEAPU16=C=new Uint16Array(I),n.HEAPU32=b=new Uint32Array(I),n.HEAPF32=L=new Float32Array(I),n.HEAPF64=R=new Float64Array(I)}var k,W=[],$=[],te=[];function ee(){var I=n.preRun.shift();W.unshift(I)}var S=0,D=null;function U(I){throw n.onAbort&&n.onAbort(I),I="Aborted("+I+")",h(I),g=!0,I=new WebAssembly.RuntimeError(I+". Build with -sASSERTIONS for more info."),a(I),I}function v(I){return I.startsWith("data:application/octet-stream;base64,")}var w;if(w="data:application/octet-stream;base64,AGFzbQEAAAABvgM4YAF/AGACf38AYAF/AX9gA39/fwBgAn98AGACf38Bf2ADf39/AX9gAABgA39/fABgAX8BfGADf399AX1gBX9/f39/AX9gAn9/AXxgAAF/YAZ/f31/fX8AYAR/f39/AX9gAn9/AX1gBn9/f39/fwF/YAV/f39/fwBgBH9/f38AYAN/fn8BfmAHf39/f39/fwBgBn9/f39/fwBgAn19AX1gAX0Bf2ABfwF9YAZ/fH9/f38Bf2ACf30AYAR/fHx/AGAIf39/f39/f38AYA1/f39/f39/f39/f39/AGAKf39/f39/f39/fwBgBX9/f39/AXxgBH9/fX0BfWAEfHx/fwF9YA5/fX1/f399fX9/f39/fwF/YAZ/f319f38AYAJ+fwF/YAR/fX1/AX1gA399fQF9YAF8AXxgBH98fHwAYAV/f319fQF9YA5/fX1/f399fX9/f39/fwBgB39/fX99f38AYA1/fX99f31/fX19fX1/AX9gBX9/fX19AGAEf39+fgBgB39/f39/f38Bf2ACfH8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AIQRDAADAfyEFIAYoAgRBAWsOAgIBAwsgAUH/////e3FBgICAgAJqviEEIAFBgICAgARxRQ0BCyAEIAOUQwrXIzyUIQUMAQsgBCEFC0MAAAAAIQQCQCAAKALYASIAQfDhg/wHRg0AIABBj568/AdGDQRB8CEhAQJAIABBqtWq/QdHBEAgAL4iBCAEWw0BQfghIQELIAEqAgAhBCABKAIEQQFrDgIEAQYLIABB/////3txQYCAgIACar4hBCAAQYCAgIAEcUUNAwsgBCADlEMK1yM8lCEEDAILIAQhBQtDAAAAACEEAkAgACgC3AEiAEHw4YP8B0YNACAAQY+evPwHRg0CQfAhIQECQCAAQarVqv0HRwRAIAC+IgQgBFsNAUH4ISEBCyABKgIAIQQgASgCBEEBaw4CAgEECyAAQf////97cUGAgICAAmq+IQQgAEGAgICABHFFDQELIAQgA5RDCtcjPJQhBAsgBEMAAAAAYEUNAQsgAiAEXg0BCyAFQwAAAABgRQRAIAIPCyAFIAIgAiAFXRshBAsgBAsEACAAC74BAQN/IAAtAABBIHFFBEACQCABIQMCQCACIAAiASgCECIABH8gAAUgARB+DQEgASgCEAsgASgCFCIFa0sEQCABIAMgAiABKAIkEQYAGgwCCwJAIAEoAlBBAEgNACACIQADQCAAIgRFDQEgAyAEQQFrIgBqLQAAQQpHDQALIAEgAyAEIAEoAiQRBgAgBEkNASADIARqIQMgAiAEayECIAEoAhQhBQsgBSADIAIQKxogASABKAIUIAJqNgIUCwsLC20BAX8jAEGAAmsiBSQAIARBgMAEcSACIANMckUEQCAFIAFB/wFxIAIgA2siA0GAAiADQYACSSIBGxAqGiABRQRAA0AgACAFQYACECcgA0GAAmsiA0H/AUsNAAsLIAAgBSADECcLIAVBgAJqJAALzAIBBX8gAARAIABBBGsiASgCACIFIQMgASECIABBCGsoAgAiACAAQX5xIgRHBEAgASAEayICKAIEIgAgAigCCDYCCCACKAIIIAA2AgQgBCAFaiEDCyABIAVqIgQoAgAiASABIARqQQRrKAIARwRAIAQoAgQiACAEKAIINgIIIAQoA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AAMB/ITcgBSgCBEEBaw4CAgEDCyADQf////97cUGAgICAAmq+IQIgA0GAgICABHFFDQELIAIgBpRDCtcjPJQhNwwBCyACITcLQwAAAAAhAgJAAkACQCAAKALUASIDQfDhg/wHRg0AIANBj568/AdGDQFB8CEhBQJAIANBqtWq/QdHBEAgA74iAiACWw0BQfghIQULIAUqAgAhAkMAAMB/ITQgBSgCBEEBaw4CAgEDCyADQf////97cUGAgICAAmq+IQIgA0GAgICABHFFDQELIAIgB5RDCtcjPJQhNAwBCyACITQLQwAAAAAhAgJAAkACQCAAKALcASIDQfDhg/wHRg0AIANBj568/AdGDQFB8CEhBQJAIANBqtWq/QdHBEAgA74iAiACWw0BQfghIQULIAUqAgAhAkMAAMB/ITkgBSgCBEEBaw4CAgEDCyADQf////97cUGAgICAAmq+IQIgA0GAgICABHFFDQELIAIgB5RDCtcjPJQhOQwBCyACITkLIAEgNCATQQFLIgMbIEGTIgIgAlsgAiAzXnENASA3IDkgAxsgQZMiAiACWyACIDNdcQ0BIAAoArgELQAQQQFxDQAgMyECIDpDAAAAAFsNAiAAKAKoBEUNAgJAAkAgACoCICIBIAFbBEAgASECDAELIAAqAhwiAkMAAAAAXkUNAQsgAiACXARAIDghAgwECyAAKgIgIQELIAEgAVwEQCAzIQIgACoCHCIBQwAAAABeRQ0DCyA4IQIgAUMAAAAAXA0CIDMhAgwCCyA4IQILIAIgAlwNACACIDOTITUMAQsgM0MAAAAAXUUNACAzjCE1CyACITggKUUEQAJAIBggIUYEQEMAAAAAITQMAQtDAAAAACE5IBghBQNAIAUoAgAiDyATIA8qArQCIgEgQxAlITcCQCA1QwAAAABdBEAgNyAPED2MlCICQwAAAABeIAJDAAAAAF1yRQ0BAn0gDyATIDUgP5UgApQgN5IiNCA4ECUiMyAzXCIDIA8gEyA2ECQgDyATECCSIA8gEyA2ECMgDyATECGSkiICIAJcckUEQCAzIAIQHgwBCyACIDMgAxsLIQIgNCA0XCACIAJcciACIDRbcg0BIDkgAiA3k5IhOS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AsMACAAKAIAIAE2AhALFwAgACgCACIAIAAoAhBBfnEgAXI2AhAL/QEBA38jAEEQayICJAAgACgCACEAIAFDAAAAAGBFBEAgAkHXETYCACMAQRBrIgMkACADIAI2AgwCQCAADQBB6DYtAAAEQEHkNigCACEADAELQRwQHSIAQoCAgPwDNwIUIABCADcCDCAAQQA2AgAgAEEAOgAIIABBATYCBEHkNiAANgIAQeg2QQE6AABB4DZB4DYoAgBBAWo2AgALIAAoAgQhBAJAIAAtAAhBCHEEQCAAQQBBBUEAQbwhIAIgBBERABoMAQsgAEEAQQVBvCEgAiAEEQsAGgsgA0EQaiQAECwACyAAQwAAAAAgASABQwAAAABbGzgCFCACQRBqJAALPAAgAUEDSQRAQQEgAXQhASAAKAIAIgACfyACBEAgACgCDCABcgwBCyAAKAIMIAFBf3NxCzYCDA8LEAQAC00BAn9BBBAdIQFBHBAdIgBCgICA/AM3AhQgAEIANwIMIABBADYCACAAQQA6AAggAEEBNgIEQeA2QeA2KAIAQQFqNgIAIAEgADYCACABCxAAIABBDTYCBCAAIAE2AgALEAAgAEEKNgIEIAAgATYCAAsQACAAQQc2AgQgACABNgIACyMAIAJBBUdBACACG0UEQEGoLCADIAQQYw8LQbgtIAMgBBBjCyIBAX4gASACrSADrUIghoQgBCAAERQAIgVCIIinJAEgBacLqAEBBX8gACgCVCIDKAIAIQUgAygCBCIEIAAoAhQgACgCHCIHayIGIAQgBkkbIgYEQCAFIAcgBhArGiADIAMoAgAgBmoiBTYCACADIAMoAgQgBmsiBDYCBAsgBCACIAIgBEsbIgQEQCAFIAEgBBArGiADIAMoAgAgBGoiBTYCACADIAMoAgQgBGs2AgQLIAVBADoAACAAIAAoAiwiATYCHCAAIAE2AhQgAgsEAEIACwQAQQALigUCBn4CfyABIAEoAgBBB2pBeHEiAUEQajYCACAAIQkgASkDACEDIAEpAwghBiMAQSBrIggkAAJAIAZC////////////AIMiBEKAgICAgIDAgDx9IARCgICAgICAwP/DAH1UBEAgBkIEhiADQjyIhCEEIANC//////////8PgyIDQoGAgICAgICACFoEQCAEQoGAgICAgICAwAB8IQIMAgsgBEKAgICAgICAgEB9IQIgA0KAgICAgICAgAhSDQEgAiAEQgGDfCECDAELIANQIARCgICAgICAwP//AFQgBEKAgICAgIDA//8AURtFBEAgBkIEhiADQjyIhEL/////////A4NCgICAgICAgPz/AIQhAgwBC0KAgICAgICA+P8AIQIgBEL///////+//8MAVg0AQgAhAiAEQjCIpyIAQZH3AEkNACADIQIgBkL///////8/g0KAgICAgIDAAIQiBSEHAkAgAEGB9wBrIgFBwABxBEAgAiABQUBqrYYhB0IAIQIMAQsgAUUNACAHIAGtIgSGIAJBwAAgAWutiIQhByACIASGIQILIAggAjcDECAIIAc3AxgCQEGB+AAgAGsiAEHAAHEEQCAFIABBQGqtiCEDQgAhBQwBCyAARQ0AIAVBwAAgAGuthiADIACtIgKIhCEDIAUgAoghBQsgCCADNwMAIAggBTcDCCAIKQMIQgSGIAgpAwAiA0I8iIQhAiAIKQMQIAgpAxiEQgBSrSADQv//////////D4OEIgNCgYCAgICAgIAIWgRAIAJCAXwhAgwBCyADQoCAgICAgICACFINACACQgGDIAJ8IQILIAhBIGokACAJIAIgBkKAgICAgICAgIB/g4S/OQMAC5gYAxJ/AXwDfiMAQbAEayIMJAAgDEEANgIsAkAgAb0iGUIAUwRAQQEhEUGZCSETIAGaIgG9IRkMAQsgBEGAEHEEQEEBIRFBnAkhEwwBC0GfCUGaCSAEQQFxIhEbIRMgEUUhFQsCQCAZQoCAgICAgID4/wCDQoCAgICAgID4/wBRBEAgAEEgIAIgEUEDaiIDIARB//97cRAoIAAgEyARECcgAEGTE0GDGyAFQSBxIgUbQbQWQYcbIAUbIAEgAWIbQQMQJyAAQSAgAiADIARBgMAAcxAoIAMgAiACIANIGyEKDAELIAxBEGohEgJAAn8CQCABIAxBLGoQdCIBIAGgIgFEAAAAAAAAAABiBEAgDCAMKAIsIgZBAWs2AiwgBUEgciIOQeEARw0BDAMLIAVBIHIiDkHhAEYNA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gCACAAaigCAAUgAAsRAQBBEBAdIgAgAikDCDcDCCAAIAIpAwA3AwAgAkEQaiQAIAALYwECfyMAQRBrIgMkACABIAAoAgQiBEEBdWohASAAKAIAIQAgAyABIAIgBEEBcQR/IAEoAgAgAGooAgAFIAALEQMAQRAQHSIAIAMpAwg3AwggACADKQMANwMAIANBEGokACAACzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRBAALOQEBfyABIAAoAgQiBEEBdWohASAAKAIAIQAgASACIAMgBEEBcQR/IAEoAgAgAGooAgAFIAALEQgACwkAIAEgABECAAsFAEGbNwsPACABIAAoAgBqIAI2AgALDQAgASAAKAIAaigCAAsYAQF/QRAQHSIAQgA3AwggAEEANgIAIAALGAEBf0EQEB0iAEIANwMAIABCADcDCCAACwwAQTAQHUEAQTAQKgs3AQF/IAEgACgCBCIDQQF1aiEBIAAoAgAhACABIAIgA0EBcQR/IAEoAgAgAGooAgAFIAALERsACwUAQZY3CyEAIAAgASgCACABIAEsAAtBAEgbQZM3IAIoAgAQDzYCAAsqAQF/QQwQHSIBQQA6AAQgASAAKAIANgIIIABBADYCACABQcgjNgIAIAELBQBBkzcLBQBBkDcLIQAgACABKAIAIAEgASwAC0EASBtB/DYgAigCABAPNgIAC9gBAQR/IwBBIGsiAyQAIAEoAgAiBEHw////B0kEQAJAAkAgBEELTwRAIARBD3JBAWoiBRAdIQYgAyAFQYCAgIB4cjYCECADIAY2AgggAyAENgIMIAQgBmohBQwBCyADIAQ6ABMgA0EIaiIGIARqIQUgBEUNAQsgBiABQQRqIAQQKxoLIAVBADoAACADIAI2AgAgA0EYaiADQQhqIAMgABEDACADKAIYEBAgAygCGCIAEAYgAygCABAGIAMsABNBAEgEQCADKAIIECkLIANBIGokACAADwsQBAALKgEBf0EMEB0iAUEAOgAEIAEgACgCADYCCCAAQQA2AgAgAUHQIjYCACABCwUAQfw2C2kBAn8jAEEQayIGJAAgASAAKAIEIgdBAXV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bYiAlsgAiACXCADIANccXINACAAIAI4AiADQCAALQAEIgRBBHENASAAIARBBHI6AAQgACgCFCIEBEAgACAEEQAACyAAQYCAgP4HNgK0AiAAKAKoBCIADQALCwsPACAAKAIAQarVqv0HEEwLDgAgACgCACABthAxEEwLDgAgACgCACABthAvEEwLcAICfQF/AkAgACgCACIAKgIcIgMgAbYiAlsgAiACXCADIANccXINACAAIAI4AhwDQCAALQAEIgRBBHENASAAIARBBHI6AAQgACgCFCIEBEAgACAEEQAACyAAQYCAgP4HNgK0AiAAKAKoBCIADQALCwt3AQF/AkAgACgCACIAKAIYIgJBFnZBAXEgAUYNACAAIAJB////fXEgAUEWdEGAgIACcXI2AhgDQCAALQAEIgFBBHENASAAIAFBBHI6AAQgACgCFCIBBEAgACABEQAACyAAQYCAgP4HNgK0AiAAKAKoBCIADQALCwt3AQF/AkAgACgCACIAKAIYIgJBFHZBA3EgAUYNACAAIAJB//+/fnEgAUEUdEGAgMABcXI2AhgDQCAALQAEIgFBBHENASAAIAFBBHI6AAQgACgCFCIBBEAgACABEQAACyAAQYCAgP4HNgK0AiAAKAKoBCIADQALCwsRACAAKAIAIAFBqtWq/QcQSwsQACAAKAIAIAEgArYQMRBLCxAAIAAoAgAgASACthAvEEsLcwEBfwJAIAAoAgAiACgCGCICQQR2QQdxIAFGDQAgACACQY9/cSABQQR0QfAAcXI2AhgDQCAALQAEIgFBBHENASAAIAFBBHI6AAQgACgCFCIBBEAgACABEQAACyAAQYCAgP4HNgK0AiAAKAKoBCIADQALCwt1AQF/AkAgACgCACIAKAIYIgJBEnZBA3EgAUYNACAAIAJB//9PcSABQRJ0QYCAMHFyNgIYA0AgAC0ABCIBQQRxDQEgACABQQRyOgAEIAAoAhQiAQRAIAAgAREAAAsgAEGAgID+BzYCtAIgACgCqAQiAA0ACwsLC9IiIwBBgAgL5RlPbmx5IGxlYWYgbm9kZXMgd2l0aCBjdXN0b20gbWVhc3VyZSBmdW5jdGlvbnMgc2hvdWxkIG1hbnVhb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JDgAAAAkADgAADgBBuygLAQwAQccoCxUTAAAAABMAAAAACQwAAAAAAAwAAAwAQfUoCwEQAEGBKQsVDwAAAAQPAAAAAAkQAAAAAAAQAAAQAEGvKQsBEgBBuykLHhEAAAAAEQAAAAAJEgAAAAAAEgAAEgAAGgAAABoaGgBB8ikLDhoAAAAaGhoAAAAAAAAJAEGjKgsBFABBryoLFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABB3SoLARYAQekqCycVAAAAABUAAAAACRYAAAAAABYAABYAADAxMjM0NTY3ODlBQkNERUYAQbQrCwHVAEHcKwsI//////////8AQaAsCwnwHwEAAAAAAAUAQbQsCwHQAEHMLAsK0QAAANIAAADUGwBB5CwLAQIAQfQsCwj//////////wBBuC0LAQUAQcQtCwHTAEHcLQsO0QAAANQAAADoGwAAAAQAQfQtCwEBAEGELgsF/////woAQcguCwHW",!v(w)){var F=w;w=n.locateFile?n.locateFile(F,l):l+F}function H(){var I=w;try{if(I==w&&u)return new Uint8Array(u);if(v(I))try{var m=xy(I.slice(37)),x=new Uint8Array(m.length);for(I=0;I<m.length;++I)x[I]=m.charCodeAt(I);var _=x}catch{throw Error("Converting base64 string to bytes failed.")}else _=void 0;var M=_;if(M)return M;throw"both async and sync fetching of the wasm failed"}catch(V){U(V)}}function K(){return u||typeof fetch!="function"?Promise.resolve().then(function(){return H()}):fetch(w,{credentials:"same-origin"}).then(function(I){if(!I.ok)throw"failed to load wasm binary file at '"+w+"'";return I.arrayBuffer()}).catch(function(){return H()})}function j(I){for(;0<I.length;)I.shift()(n)}function se(I){if(I===void 0)return"_unknown";I=I.replace(/[^a-zA-Z0-9_]/g,"$");var m=I.charCodeAt(0);return 48<=m&&57>=m?"_"+I:I}function ue(I,m){return I=se(I),function(){return m.apply(this,arguments)}}var Ae=[{},{value:void 0},{value:null},{value:!0},{value:!1}],Ce=[];function be(I){var m=Error,x=ue(I,function(_){this.name=I,this.message=_,_=Error(_).stack,_!==void 0&&(this.stack=this.toString()+`
|
89
|
-
`+_.replace(/^Error(:[^\n]*)?\n/,""))});return x.prototype=Object.create(m.prototype),x.prototype.constructor=x,x.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},x}var Re=void 0;function ne(I){throw new Re(I)}var Ie=I=>(I||ne("Cannot use deleted val. handle = "+I),Ae[I].value),ve=I=>{switch(I){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var m=Ce.length?Ce.pop():Ae.length;return Ae[m]={fa:1,value:I},m}},he=void 0,le=void 0;function oe(I){for(var m="";B[I];)m+=le[B[I++]];return m}var we=[];function Oe(){for(;we.length;){var I=we.pop();I.L.Z=!1,I.delete()}}var Le=void 0,Me={};function Ue(I,m){for(m===void 0&&ne("ptr should not be undefined");I.P;)m=I.aa(m),I=I.P;return m}var xe={};function Be(I){I=Wu(I);var m=oe(I);return pi(I),m}function He(I,m){var x=xe[I];return x===void 0&&ne(m+" has unknown type "+Be(I)),x}function We(){}var rt=!1;function Xe(I){--I.count.value,I.count.value===0&&(I.S?I.T.V(I.S):I.O.M.V(I.N))}function pt(I,m,x){return m===x?I:x.P===void 0?null:(I=pt(I,m,x.P),I===null?null:x.ma(I))}var gi={};function Et(I,m){return m=Ue(I,m),Me[m]}var ti=void 0;function ii(I){throw new ti(I)}function si(I,m){return m.O&&m.N||ii("makeClassHandle requires ptr and ptrType"),!!m.T!=!!m.S&&ii("Both smartPtrType and smartPtr must be specified"),m.count={value:1},ct(Object.create(I,{L:{value:m}}))}function ct(I){return typeof FinalizationRegistry>"u"?(ct=m=>m,I):(rt=new FinalizationRegistry(m=>{Xe(m.L)}),ct=m=>{var x=m.L;return x.S&&rt.register(m,{L:x},m),m},We=m=>{rt.unregister(m)},ct(I))}var G={};function ae(I){for(;I.length;){var m=I.pop();I.pop()(m)}}function de(I){return this.fromWireType(T[I>>2])}var Se={},Qe={};function $e(I,m,x){function _(X){X=x(X),X.length!==I.length&&ii("Mismatched type converter count");for(var ie=0;ie<I.length;++ie)mt(I[ie],X[ie])}I.forEach(function(X){Qe[X]=m});var M=Array(m.length),V=[],q=0;m.forEach((X,ie)=>{xe.hasOwnProperty(X)?M[ie]=xe[X]:(V.push(X),Se.hasOwnProperty(X)||(Se[X]=[]),Se[X].push(()=>{M[ie]=xe[X],++q,q===V.length&&_(M)}))}),V.length===0&&_(M)}function It(I){switch(I){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+I)}}function mt(I,m,x={}){if(!("argPackAdvance"in m))throw new TypeError("registerType registeredInstance requires argPackAdvance");var _=m.name;if(I||ne('type "'+_+'" must have a positive integer typeid pointer'),xe.hasOwnProperty(I)){if(x.ta)return;ne("Cannot register type '"+_+"' twice")}xe[I]=m,delete Qe[I],Se.hasOwnProperty(I)&&(m=Se[I],delete Se[I],m.forEach(M=>M()))}function Ss(I){ne(I.L.O.M.name+" instance already deleted")}function Ct(){}function rs(I,m,x){if(I[m].R===void 0){var _=I[m];I[m]=function(){return I[m].R.hasOwnProperty(arguments.length)||ne("Function '"+x+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+I[m].R+")!"),I[m].R[arguments.length].apply(this,arguments)},I[m].R=[],I[m].R[_.Y]=_}}function ws(I,m){n.hasOwnProperty(I)?(ne("Cannot register public name '"+I+"' twice"),rs(n,I,I),n.hasOwnProperty(void 0)&&ne("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),n[I].R[void 0]=m):n[I]=m}function ki(I,m,x,_,M,V,q,X){this.name=I,this.constructor=m,this.W=x,this.V=_,this.P=M,this.oa=V,this.aa=q,this.ma=X,this.ia=[]}function vr(I,m,x){for(;m!==x;)m.aa||ne("Expected null or instance of "+x.name+", got an instance of "+m.name),I=m.aa(I),m=m.P;return I}function Qr(I,m){return m===null?(this.da&&ne("null is not a valid "+this.name),0):(m.L||ne('Cannot pass "'+AA(m)+'" as a '+this.name),m.L.N||ne("Cannot pass deleted object as a pointer of type "+this.name),vr(m.L.N,m.L.O.M,this.M))}function Ts(I,m){if(m===null){if(this.da&&ne("null is not a valid "+this.name),this.ca){var x=this.ea();return I!==null&&I.push(this.V,x),x}return 0}if(m.L||ne('Cannot pass "'+AA(m)+'" as a '+this.name),m.L.N||ne("Cannot pass deleted object as a pointer of type "+this.name),!this.ba&&m.L.O.ba&&ne("Cannot convert argument of type "+(m.L.T?m.L.T.name:m.L.O.name)+" to parameter type "+this.name),x=vr(m.L.N,m.L.O.M,this.M),this.ca)switch(m.L.S===void 0&&ne("Passing raw pointer to smart pointer is illegal"),this.Aa){case 0:m.L.T===this?x=m.L.S:ne("Cannot convert argument of type "+(m.L.T?m.L.T.name:m.L.O.name)+" to parameter type "+this.name);break;case 1:x=m.L.S;break;case 2:if(m.L.T===this)x=m.L.S;else{var _=m.clone();x=this.wa(x,ve(function(){_.delete()})),I!==null&&I.push(this.V,x)}break;default:ne("Unsupporting sharing policy")}return x}function gy(I,m){return m===null?(this.da&&ne("null is not a valid "+this.name),0):(m.L||ne('Cannot pass "'+AA(m)+'" as a '+this.name),m.L.N||ne("Cannot pass deleted object as a pointer of type "+this.name),m.L.O.ba&&ne("Cannot convert argument of type "+m.L.O.name+" to parameter type "+this.name),vr(m.L.N,m.L.O.M,this.M))}function fi(I,m,x,_){this.name=I,this.M=m,this.da=x,this.ba=_,this.ca=!1,this.V=this.wa=this.ea=this.ja=this.Aa=this.va=void 0,m.P!==void 0?this.toWireType=Ts:(this.toWireType=_?Qr:gy,this.U=null)}function fy(I,m){n.hasOwnProperty(I)||ii("Replacing nonexistant public symbol"),n[I]=m,n[I].Y=void 0}function py(I,m){var x=[];return function(){if(x.length=0,Object.assign(x,arguments),I.includes("j")){var _=n["dynCall_"+I];_=x&&x.length?_.apply(null,[m].concat(x)):_.call(null,m)}else _=k.get(m).apply(null,x);return _}}function Ht(I,m){I=oe(I);var x=I.includes("j")?py(I,m):k.get(m);return typeof x!="function"&&ne("unknown function pointer with signature "+I+": "+m),x}var Yu=void 0;function Pn(I,m){function x(V){M[V]||xe[V]||(Qe[V]?Qe[V].forEach(x):(_.push(V),M[V]=!0))}var _=[],M={};throw m.forEach(x),new Yu(I+": "+_.map(Be).join([", "]))}function nA(I,m,x,_,M){var V=m.length;2>V&&ne("argTypes array size mismatch! Must at least get return value and 'this' types!");var q=m[1]!==null&&x!==null,X=!1;for(x=1;x<m.length;++x)if(m[x]!==null&&m[x].U===void 0){X=!0;break}var ie=m[0].name!=="void",Z=V-2,re=Array(Z),fe=[],_e=[];return function(){if(arguments.length!==Z&&ne("function "+I+" called with "+arguments.length+" arguments, expected "+Z+" args!"),_e.length=0,fe.length=q?2:1,fe[0]=M,q){var ze=m[1].toWireType(_e,this);fe[1]=ze}for(var Ne=0;Ne<Z;++Ne)re[Ne]=m[Ne+2].toWireType(_e,arguments[Ne]),fe.push(re[Ne]);if(Ne=_.apply(null,fe),X)ae(_e);else for(var Rt=q?1:2;Rt<m.length;Rt++){var $t=Rt===1?ze:re[Rt-2];m[Rt].U!==null&&m[Rt].U($t)}return ze=ie?m[0].fromWireType(Ne):void 0,ze}}function oA(I,m){for(var x=[],_=0;_<I;_++)x.push(b[m+4*_>>2]);return x}function aA(I){4<I&&--Ae[I].fa===0&&(Ae[I]=void 0,Ce.push(I))}function AA(I){if(I===null)return"null";var m=typeof I;return m==="object"||m==="array"||m==="function"?I.toString():""+I}function Ey(I,m){switch(m){case 2:return function(x){return this.fromWireType(L[x>>2])};case 3:return function(x){return this.fromWireType(R[x>>3])};default:throw new TypeError("Unknown float type: "+I)}}function Iy(I,m,x){switch(m){case 0:return x?function(_){return y[_]}:function(_){return B[_]};case 1:return x?function(_){return Q[_>>1]}:function(_){return C[_>>1]};case 2:return x?function(_){return T[_>>2]}:function(_){return b[_>>2]};default:throw new TypeError("Unknown integer type: "+I)}}function my(I,m){for(var x="",_=0;!(_>=m/2);++_){var M=Q[I+2*_>>1];if(M==0)break;x+=String.fromCharCode(M)}return x}function Cy(I,m,x){if(x===void 0&&(x=2147483647),2>x)return 0;x-=2;var _=m;x=x<2*I.length?x/2:I.length;for(var M=0;M<x;++M)Q[m>>1]=I.charCodeAt(M),m+=2;return Q[m>>1]=0,m-_}function yy(I){return 2*I.length}function By(I,m){for(var x=0,_="";!(x>=m/4);){var M=T[I+4*x>>2];if(M==0)break;++x,65536<=M?(M-=65536,_+=String.fromCharCode(55296|M>>10,56320|M&1023)):_+=String.fromCharCode(M)}return _}function vy(I,m,x){if(x===void 0&&(x=2147483647),4>x)return 0;var _=m;x=_+x-4;for(var M=0;M<I.length;++M){var V=I.charCodeAt(M);if(55296<=V&&57343>=V){var q=I.charCodeAt(++M);V=65536+((V&1023)<<10)|q&1023}if(T[m>>2]=V,m+=4,m+4>x)break}return T[m>>2]=0,m-_}function Qy(I){for(var m=0,x=0;x<I.length;++x){var _=I.charCodeAt(x);55296<=_&&57343>=_&&++x,m+=4}return m}var by={};function Ku(I){var m=by[I];return m===void 0?oe(I):m}var On=[];function Sy(I){var m=On.length;return On.push(I),m}function wy(I,m){for(var x=Array(I),_=0;_<I;++_)x[_]=He(b[m+4*_>>2],"parameter "+_);return x}var Vu=[],Ty=[null,[],[]];Re=n.BindingError=be("BindingError"),n.count_emval_handles=function(){for(var I=0,m=5;m<Ae.length;++m)Ae[m]!==void 0&&++I;return I},n.get_first_emval=function(){for(var I=5;I<Ae.length;++I)if(Ae[I]!==void 0)return Ae[I];return null},he=n.PureVirtualError=be("PureVirtualError");for(var Ju=Array(256),Un=0;256>Un;++Un)Ju[Un]=String.fromCharCode(Un);le=Ju,n.getInheritedInstanceCount=function(){return Object.keys(Me).length},n.getLiveInheritedInstances=function(){var I=[],m;for(m in Me)Me.hasOwnProperty(m)&&I.push(Me[m]);return I},n.flushPendingDeletes=Oe,n.setDelayFunction=function(I){Le=I,we.length&&Le&&Le(Oe)},ti=n.InternalError=be("InternalError"),Ct.prototype.isAliasOf=function(I){if(!(this instanceof Ct&&I instanceof Ct))return!1;var m=this.L.O.M,x=this.L.N,_=I.L.O.M;for(I=I.L.N;m.P;)x=m.aa(x),m=m.P;for(;_.P;)I=_.aa(I),_=_.P;return m===_&&x===I},Ct.prototype.clone=function(){if(this.L.N||Ss(this),this.L.$)return this.L.count.value+=1,this;var I=ct,m=Object,x=m.create,_=Object.getPrototypeOf(this),M=this.L;return I=I(x.call(m,_,{L:{value:{count:M.count,Z:M.Z,$:M.$,N:M.N,O:M.O,S:M.S,T:M.T}}})),I.L.count.value+=1,I.L.Z=!1,I},Ct.prototype.delete=function(){this.L.N||Ss(this),this.L.Z&&!this.L.$&&ne("Object already scheduled for deletion"),We(this),Xe(this.L),this.L.$||(this.L.S=void 0,this.L.N=void 0)},Ct.prototype.isDeleted=function(){return!this.L.N},Ct.prototype.deleteLater=function(){return this.L.N||Ss(this),this.L.Z&&!this.L.$&&ne("Object already scheduled for deletion"),we.push(this),we.length===1&&Le&&Le(Oe),this.L.Z=!0,this},fi.prototype.pa=function(I){return this.ja&&(I=this.ja(I)),I},fi.prototype.ga=function(I){this.V&&this.V(I)},fi.prototype.argPackAdvance=8,fi.prototype.readValueFromPointer=de,fi.prototype.deleteObject=function(I){I!==null&&I.delete()},fi.prototype.fromWireType=function(I){function m(){return this.ca?si(this.M.W,{O:this.va,N:x,T:this,S:I}):si(this.M.W,{O:this,N:I})}var x=this.pa(I);if(!x)return this.ga(I),null;var _=Et(this.M,x);if(_!==void 0)return _.L.count.value===0?(_.L.N=x,_.L.S=I,_.clone()):(_=_.clone(),this.ga(I),_);if(_=this.M.oa(x),_=gi[_],!_)return m.call(this);_=this.ba?_.ka:_.pointerType;var M=pt(x,this.M,_.M);return M===null?m.call(this):this.ca?si(_.M.W,{O:_,N:M,T:this,S:I}):si(_.M.W,{O:_,N:M})},Yu=n.UnboundTypeError=be("UnboundTypeError");var xy=typeof atob=="function"?atob:function(I){var m="",x=0;I=I.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(I.charAt(x++)),M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(I.charAt(x++)),V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(I.charAt(x++)),q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(I.charAt(x++));_=_<<2|M>>4,M=(M&15)<<4|V>>2;var X=(V&3)<<6|q;m+=String.fromCharCode(_),V!==64&&(m+=String.fromCharCode(M)),q!==64&&(m+=String.fromCharCode(X))}while(x<I.length);return m},Dy={p:function(I,m,x){I=oe(I),m=He(m,"wrapper"),x=Ie(x);var _=[].slice,M=m.M,V=M.W,q=M.P.W,X=M.P.constructor;I=ue(I,function(){M.P.ia.forEach((function(Z){if(this[Z]===q[Z])throw new he("Pure virtual function "+Z+" must be implemented in JavaScript")}).bind(this)),Object.defineProperty(this,"__parent",{value:V}),this.__construct.apply(this,_.call(arguments))}),V.__construct=function(){this===V&&ne("Pass correct 'this' to __construct");var Z=X.implement.apply(void 0,[this].concat(_.call(arguments)));We(Z);var re=Z.L;Z.notifyOnDestruction(),re.$=!0,Object.defineProperties(this,{L:{value:re}}),ct(this),Z=re.N,Z=Ue(M,Z),Me.hasOwnProperty(Z)?ne("Tried to register registered instance: "+Z):Me[Z]=this},V.__destruct=function(){this===V&&ne("Pass correct 'this' to __destruct"),We(this);var Z=this.L.N;Z=Ue(M,Z),Me.hasOwnProperty(Z)?delete Me[Z]:ne("Tried to unregister unregistered instance: "+Z)},I.prototype=Object.create(V);for(var ie in x)I.prototype[ie]=x[ie];return ve(I)},j:function(I){var m=G[I];delete G[I];var x=m.ea,_=m.V,M=m.ha,V=M.map(q=>q.sa).concat(M.map(q=>q.ya));$e([I],V,q=>{var X={};return M.forEach((ie,Z)=>{var re=q[Z],fe=ie.qa,_e=ie.ra,ze=q[Z+M.length],Ne=ie.xa,Rt=ie.za;X[ie.na]={read:$t=>re.fromWireType(fe(_e,$t)),write:($t,br)=>{var Ei=[];Ne(Rt,$t,ze.toWireType(Ei,br)),ae(Ei)}}}),[{name:m.name,fromWireType:function(ie){var Z={},re;for(re in X)Z[re]=X[re].read(ie);return _(ie),Z},toWireType:function(ie,Z){for(var re in X)if(!(re in Z))throw new TypeError('Missing field: "'+re+'"');var fe=x();for(re in X)X[re].write(fe,Z[re]);return ie!==null&&ie.push(_,fe),fe},argPackAdvance:8,readValueFromPointer:de,U:_}]})},v:function(){},B:function(I,m,x,_,M){var V=It(x);m=oe(m),mt(I,{name:m,fromWireType:function(q){return!!q},toWireType:function(q,X){return X?_:M},argPackAdvance:8,readValueFromPointer:function(q){if(x===1)var X=y;else if(x===2)X=Q;else if(x===4)X=T;else throw new TypeError("Unknown boolean type size: "+m);return this.fromWireType(X[q>>V])},U:null})},f:function(I,m,x,_,M,V,q,X,ie,Z,re,fe,_e){re=oe(re),V=Ht(M,V),X&&(X=Ht(q,X)),Z&&(Z=Ht(ie,Z)),_e=Ht(fe,_e);var ze=se(re);ws(ze,function(){Pn("Cannot construct "+re+" due to unbound types",[_])}),$e([I,m,x],_?[_]:[],function(Ne){if(Ne=Ne[0],_)var Rt=Ne.M,$t=Rt.W;else $t=Ct.prototype;Ne=ue(ze,function(){if(Object.getPrototypeOf(this)!==br)throw new Re("Use 'new' to construct "+re);if(Ei.X===void 0)throw new Re(re+" has no accessible constructor");var Xu=Ei.X[arguments.length];if(Xu===void 0)throw new Re("Tried to invoke ctor of "+re+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(Ei.X).toString()+") parameters instead!");return Xu.apply(this,arguments)});var br=Object.create($t,{constructor:{value:Ne}});Ne.prototype=br;var Ei=new ki(re,Ne,br,_e,Rt,V,X,Z);Rt=new fi(re,Ei,!0,!1),$t=new fi(re+"*",Ei,!1,!1);var ju=new fi(re+" const*",Ei,!1,!0);return gi[I]={pointerType:$t,ka:ju},fy(ze,Ne),[Rt,$t,ju]})},c:function(I,m,x,_,M,V,q){var X=oA(x,_);m=oe(m),V=Ht(M,V),$e([],[I],function(ie){function Z(){Pn("Cannot call "+re+" due to unbound types",X)}ie=ie[0];var re=ie.name+"."+m;m.startsWith("@@")&&(m=Symbol[m.substring(2)]);var fe=ie.M.constructor;return fe[m]===void 0?(Z.Y=x-1,fe[m]=Z):(rs(fe,m,re),fe[m].R[x-1]=Z),$e([],X,function(_e){return _e=nA(re,[_e[0],null].concat(_e.slice(1)),null,V,q),fe[m].R===void 0?(_e.Y=x-1,fe[m]=_e):fe[m].R[x-1]=_e,[]}),[]})},o:function(I,m,x,_,M,V){0<m||U();var q=oA(m,x);M=Ht(_,M),$e([],[I],function(X){X=X[0];var ie="constructor "+X.name;if(X.M.X===void 0&&(X.M.X=[]),X.M.X[m-1]!==void 0)throw new Re("Cannot register multiple constructors with identical number of parameters ("+(m-1)+") for class '"+X.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return X.M.X[m-1]=()=>{Pn("Cannot construct "+X.name+" due to unbound types",q)},$e([],q,function(Z){return Z.splice(1,0,null),X.M.X[m-1]=nA(ie,Z,null,M,V),[]}),[]})},a:function(I,m,x,_,M,V,q,X){var ie=oA(x,_);m=oe(m),V=Ht(M,V),$e([],[I],function(Z){function re(){Pn("Cannot call "+fe+" due to unbound types",ie)}Z=Z[0];var fe=Z.name+"."+m;m.startsWith("@@")&&(m=Symbol[m.substring(2)]),X&&Z.M.ia.push(m);var _e=Z.M.W,ze=_e[m];return ze===void 0||ze.R===void 0&&ze.className!==Z.name&&ze.Y===x-2?(re.Y=x-2,re.className=Z.name,_e[m]=re):(rs(_e,m,fe),_e[m].R[x-2]=re),$e([],ie,function(Ne){return Ne=nA(fe,Ne,Z,V,q),_e[m].R===void 0?(Ne.Y=x-2,_e[m]=Ne):_e[m].R[x-2]=Ne,[]}),[]})},A:function(I,m){m=oe(m),mt(I,{name:m,fromWireType:function(x){var _=Ie(x);return aA(x),_},toWireType:function(x,_){return ve(_)},argPackAdvance:8,readValueFromPointer:de,U:null})},m:function(I,m,x){x=It(x),m=oe(m),mt(I,{name:m,fromWireType:function(_){return _},toWireType:function(_,M){return M},argPackAdvance:8,readValueFromPointer:Ey(m,x),U:null})},d:function(I,m,x,_,M){m=oe(m),M===-1&&(M=4294967295),M=It(x);var V=X=>X;if(_===0){var q=32-8*x;V=X=>X<<q>>>q}x=m.includes("unsigned")?function(X,ie){return ie>>>0}:function(X,ie){return ie},mt(I,{name:m,fromWireType:V,toWireType:x,argPackAdvance:8,readValueFromPointer:Iy(m,M,_!==0),U:null})},b:function(I,m,x){function _(V){V>>=2;var q=b;return new M(p,q[V+1],q[V])}var M=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][m];x=oe(x),mt(I,{name:x,fromWireType:_,argPackAdvance:8,readValueFromPointer:_},{ta:!0})},n:function(I,m){m=oe(m);var x=m==="std::string";mt(I,{name:m,fromWireType:function(_){var M=b[_>>2],V=_+4;if(x)for(var q=V,X=0;X<=M;++X){var ie=V+X;if(X==M||B[ie]==0){if(q=q?f(B,q,ie-q):"",Z===void 0)var Z=q;else Z+=String.fromCharCode(0),Z+=q;q=ie+1}}else{for(Z=Array(M),X=0;X<M;++X)Z[X]=String.fromCharCode(B[V+X]);Z=Z.join("")}return pi(_),Z},toWireType:function(_,M){M instanceof ArrayBuffer&&(M=new Uint8Array(M));var V,q=typeof M=="string";if(q||M instanceof Uint8Array||M instanceof Uint8ClampedArray||M instanceof Int8Array||ne("Cannot pass non-string to std::string"),x&&q){var X=0;for(V=0;V<M.length;++V){var ie=M.charCodeAt(V);127>=ie?X++:2047>=ie?X+=2:55296<=ie&&57343>=ie?(X+=4,++V):X+=3}V=X}else V=M.length;if(X=lA(4+V+1),ie=X+4,b[X>>2]=V,x&&q){if(q=ie,ie=V+1,V=B,0<ie){ie=q+ie-1;for(var Z=0;Z<M.length;++Z){var re=M.charCodeAt(Z);if(55296<=re&&57343>=re){var fe=M.charCodeAt(++Z);re=65536+((re&1023)<<10)|fe&1023}if(127>=re){if(q>=ie)break;V[q++]=re}else{if(2047>=re){if(q+1>=ie)break;V[q++]=192|re>>6}else{if(65535>=re){if(q+2>=ie)break;V[q++]=224|re>>12}else{if(q+3>=ie)break;V[q++]=240|re>>18,V[q++]=128|re>>12&63}V[q++]=128|re>>6&63}V[q++]=128|re&63}}V[q]=0}}else if(q)for(q=0;q<V;++q)Z=M.charCodeAt(q),255<Z&&(pi(ie),ne("String has UTF-16 code units that do not fit in 8 bits")),B[ie+q]=Z;else for(q=0;q<V;++q)B[ie+q]=M[q];return _!==null&&_.push(pi,X),X},argPackAdvance:8,readValueFromPointer:de,U:function(_){pi(_)}})},i:function(I,m,x){if(x=oe(x),m===2)var _=my,M=Cy,V=yy,q=()=>C,X=1;else m===4&&(_=By,M=vy,V=Qy,q=()=>b,X=2);mt(I,{name:x,fromWireType:function(ie){for(var Z=b[ie>>2],re=q(),fe,_e=ie+4,ze=0;ze<=Z;++ze){var Ne=ie+4+ze*m;(ze==Z||re[Ne>>X]==0)&&(_e=_(_e,Ne-_e),fe===void 0?fe=_e:(fe+=String.fromCharCode(0),fe+=_e),_e=Ne+m)}return pi(ie),fe},toWireType:function(ie,Z){typeof Z!="string"&&ne("Cannot pass non-string to C++ string type "+x);var re=V(Z),fe=lA(4+re+m);return b[fe>>2]=re>>X,M(Z,fe+4,re+m),ie!==null&&ie.push(pi,fe),fe},argPackAdvance:8,readValueFromPointer:de,U:function(ie){pi(ie)}})},k:function(I,m,x,_,M,V){G[I]={name:oe(m),ea:Ht(x,_),V:Ht(M,V),ha:[]}},h:function(I,m,x,_,M,V,q,X,ie,Z){G[I].ha.push({na:oe(m),sa:x,qa:Ht(_,M),ra:V,ya:q,xa:Ht(X,ie),za:Z})},C:function(I,m){m=oe(m),mt(I,{ua:!0,name:m,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},s:function(I,m,x,_,M){I=On[I],m=Ie(m),x=Ku(x);var V=[];return b[_>>2]=ve(V),I(m,x,V,M)},t:function(I,m,x,_){I=On[I],m=Ie(m),x=Ku(x),I(m,x,null,_)},g:aA,l:function(I,m){var x=wy(I,m),_=x[0];m=_.name+"_$"+x.slice(1).map(function(q){return q.name}).join("_")+"$";var M=Vu[m];if(M!==void 0)return M;var V=Array(I-1);return M=Sy((q,X,ie,Z)=>{for(var re=0,fe=0;fe<I-1;++fe)V[fe]=x[fe+1].readValueFromPointer(Z+re),re+=x[fe+1].argPackAdvance;for(q=q[X].apply(q,V),fe=0;fe<I-1;++fe)x[fe+1].la&&x[fe+1].la(V[fe]);if(!_.ua)return _.toWireType(ie,q)}),Vu[m]=M},q:function(I){4<I&&(Ae[I].fa+=1)},r:function(I){var m=Ie(I);ae(m),aA(I)},e:function(){U("")},x:function(I,m,x){B.copyWithin(I,m,m+x)},w:function(I){var m=B.length;if(I>>>=0,2147483648<I)return!1;for(var x=1;4>=x;x*=2){var _=m*(1+.2/x);_=Math.min(_,I+100663296);var M=Math;_=Math.max(I,_),M=M.min.call(M,2147483648,_+(65536-_%65536)%65536);e:{try{d.grow(M-p.byteLength+65535>>>16),O();var V=1;break e}catch{}V=void 0}if(V)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(I,m,x,_){for(var M=0,V=0;V<x;V++){var q=b[m>>2],X=b[m+4>>2];m+=8;for(var ie=0;ie<X;ie++){var Z=B[q+ie],re=Ty[I];Z===0||Z===10?((I===1?c:h)(f(re,0)),re.length=0):re.push(Z)}M+=X}return b[_>>2]=M,0}};(function(){function I(M){n.asm=M.exports,d=n.asm.D,O(),k=n.asm.I,$.unshift(n.asm.E),S--,n.monitorRunDependencies&&n.monitorRunDependencies(S),S==0&&D&&(M=D,D=null,M())}function m(M){I(M.instance)}function x(M){return K().then(function(V){return WebAssembly.instantiate(V,_)}).then(function(V){return V}).then(M,function(V){h("failed to asynchronously prepare wasm: "+V),U(V)})}var _={a:Dy};if(S++,n.monitorRunDependencies&&n.monitorRunDependencies(S),n.instantiateWasm)try{return n.instantiateWasm(_,I)}catch(M){h("Module.instantiateWasm callback failed with error: "+M),a(M)}return function(){return u||typeof WebAssembly.instantiateStreaming!="function"||v(w)||typeof fetch!="function"?x(m):fetch(w,{credentials:"same-origin"}).then(function(M){return WebAssembly.instantiateStreaming(M,_).then(m,function(V){return h("wasm streaming compile failed: "+V),h("falling back to ArrayBuffer instantiation"),x(m)})})}().catch(a),{}})(),n.___wasm_call_ctors=function(){return(n.___wasm_call_ctors=n.asm.E).apply(null,arguments)};var Wu=n.___getTypeName=function(){return(Wu=n.___getTypeName=n.asm.F).apply(null,arguments)};n.__embind_initialize_bindings=function(){return(n.__embind_initialize_bindings=n.asm.G).apply(null,arguments)};var lA=n._malloc=function(){return(lA=n._malloc=n.asm.H).apply(null,arguments)},pi=n._free=function(){return(pi=n._free=n.asm.J).apply(null,arguments)};n.dynCall_jiji=function(){return(n.dynCall_jiji=n.asm.K).apply(null,arguments)};var Gn;D=function I(){Gn||qu(),Gn||(D=I)};function qu(){function I(){if(!Gn&&(Gn=!0,n.calledRun=!0,!g)){if(j($),o(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;){var m=n.postRun.shift();te.unshift(m)}j(te)}}if(!(0<S)){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)ee();j(W),0<S||(n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),I()},1)):I())}}if(n.preInit)for(typeof n.preInit=="function"&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();return qu(),r.ready}})();s.exports=t})(Rl);var If=Rl.exports;(function(s){Object.defineProperty(s,"__esModule",{value:!0});var e={loadYoga:!0};s.loadYoga=o;var t=r(vo),i=ye;Object.keys(i).forEach(function(a){a==="default"||a==="__esModule"||Object.prototype.hasOwnProperty.call(e,a)||a in s&&s[a]===i[a]||Object.defineProperty(s,a,{enumerable:!0,get:function(){return i[a]}})});function r(a){return a&&a.__esModule?a:{default:a}}const n=If;async function o(){return(0,t.default)(await n())}})(xl);var wo={exports:{}};(function(s,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Hr<"u"&&Hr,i=function(){function n(){this.fetch=!1,this.DOMException=t.DOMException}return n.prototype=t,new n}();(function(n){(function(o){var a=typeof n<"u"&&n||typeof self<"u"&&self||typeof a<"u"&&a,A={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(S){return S&&DataView.prototype.isPrototypeOf(S)}if(A.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(S){return S&&c.indexOf(Object.prototype.toString.call(S))>-1};function u(S){if(typeof S!="string"&&(S=String(S)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(S)||S==="")throw new TypeError('Invalid character in header field name: "'+S+'"');return S.toLowerCase()}function d(S){return typeof S!="string"&&(S=String(S)),S}function g(S){var D={next:function(){var U=S.shift();return{done:U===void 0,value:U}}};return A.iterable&&(D[Symbol.iterator]=function(){return D}),D}function f(S){this.map={},S instanceof f?S.forEach(function(D,U){this.append(U,D)},this):Array.isArray(S)?S.forEach(function(D){this.append(D[0],D[1])},this):S&&Object.getOwnPropertyNames(S).forEach(function(D){this.append(D,S[D])},this)}f.prototype.append=function(S,D){S=u(S),D=d(D);var U=this.map[S];this.map[S]=U?U+", "+D:D},f.prototype.delete=function(S){delete this.map[u(S)]},f.prototype.get=function(S){return S=u(S),this.has(S)?this.map[S]:null},f.prototype.has=function(S){return this.map.hasOwnProperty(u(S))},f.prototype.set=function(S,D){this.map[u(S)]=d(D)},f.prototype.forEach=function(S,D){for(var U in this.map)this.map.hasOwnProperty(U)&&S.call(D,this.map[U],U,this)},f.prototype.keys=function(){var S=[];return this.forEach(function(D,U){S.push(U)}),g(S)},f.prototype.values=function(){var S=[];return this.forEach(function(D){S.push(D)}),g(S)},f.prototype.entries=function(){var S=[];return this.forEach(function(D,U){S.push([U,D])}),g(S)},A.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function p(S){if(S.bodyUsed)return Promise.reject(new TypeError("Already read"));S.bodyUsed=!0}function y(S){return new Promise(function(D,U){S.onload=function(){D(S.result)},S.onerror=function(){U(S.error)}})}function B(S){var D=new FileReader,U=y(D);return D.readAsArrayBuffer(S),U}function Q(S){var D=new FileReader,U=y(D);return D.readAsText(S),U}function C(S){for(var D=new Uint8Array(S),U=new Array(D.length),v=0;v<D.length;v++)U[v]=String.fromCharCode(D[v]);return U.join("")}function T(S){if(S.slice)return S.slice(0);var D=new Uint8Array(S.byteLength);return D.set(new Uint8Array(S)),D.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(S){this.bodyUsed=this.bodyUsed,this._bodyInit=S,S?typeof S=="string"?this._bodyText=S:A.blob&&Blob.prototype.isPrototypeOf(S)?this._bodyBlob=S:A.formData&&FormData.prototype.isPrototypeOf(S)?this._bodyFormData=S:A.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)?this._bodyText=S.toString():A.arrayBuffer&&A.blob&&l(S)?(this._bodyArrayBuffer=T(S.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):A.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(S)||h(S))?this._bodyArrayBuffer=T(S):this._bodyText=S=Object.prototype.toString.call(S):this._bodyText="",this.headers.get("content-type")||(typeof S=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):A.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},A.blob&&(this.blob=function(){var S=p(this);if(S)return S;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var S=p(this);return S||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(B)}),this.text=function(){var S=p(this);if(S)return S;if(this._bodyBlob)return Q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(C(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},A.formData&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function R(S){var D=S.toUpperCase();return L.indexOf(D)>-1?D:S}function O(S,D){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');D=D||{};var U=D.body;if(S instanceof O){if(S.bodyUsed)throw new TypeError("Already read");this.url=S.url,this.credentials=S.credentials,D.headers||(this.headers=new f(S.headers)),this.method=S.method,this.mode=S.mode,this.signal=S.signal,!U&&S._bodyInit!=null&&(U=S._bodyInit,S.bodyUsed=!0)}else this.url=String(S);if(this.credentials=D.credentials||this.credentials||"same-origin",(D.headers||!this.headers)&&(this.headers=new f(D.headers)),this.method=R(D.method||this.method||"GET"),this.mode=D.mode||this.mode||null,this.signal=D.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(U),(this.method==="GET"||this.method==="HEAD")&&(D.cache==="no-store"||D.cache==="no-cache")){var v=/([?&])_=[^&]*/;if(v.test(this.url))this.url=this.url.replace(v,"$1_="+new Date().getTime());else{var w=/\?/;this.url+=(w.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}O.prototype.clone=function(){return new O(this,{body:this._bodyInit})};function k(S){var D=new FormData;return S.trim().split("&").forEach(function(U){if(U){var v=U.split("="),w=v.shift().replace(/\+/g," "),F=v.join("=").replace(/\+/g," ");D.append(decodeURIComponent(w),decodeURIComponent(F))}}),D}function W(S){var D=new f,U=S.replace(/\r?\n[\t ]+/g," ");return U.split("\r").map(function(v){return v.indexOf(`
|
90
|
-
`)===0?v.substr(1,v.length):v}).forEach(function(v){var w=v.split(":"),F=w.shift().trim();if(F){var H=w.join(":").trim();D.append(F,H)}}),D}b.call(O.prototype);function $(S,D){if(!(this instanceof $))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');D||(D={}),this.type="default",this.status=D.status===void 0?200:D.status,this.ok=this.status>=200&&this.status<300,this.statusText=D.statusText===void 0?"":""+D.statusText,this.headers=new f(D.headers),this.url=D.url||"",this._initBody(S)}b.call($.prototype),$.prototype.clone=function(){return new $(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},$.error=function(){var S=new $(null,{status:0,statusText:""});return S.type="error",S};var te=[301,302,303,307,308];$.redirect=function(S,D){if(te.indexOf(D)===-1)throw new RangeError("Invalid status code");return new $(null,{status:D,headers:{location:S}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(D,U){this.message=D,this.name=U;var v=Error(D);this.stack=v.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function ee(S,D){return new Promise(function(U,v){var w=new O(S,D);if(w.signal&&w.signal.aborted)return v(new o.DOMException("Aborted","AbortError"));var F=new XMLHttpRequest;function H(){F.abort()}F.onload=function(){var j={status:F.status,statusText:F.statusText,headers:W(F.getAllResponseHeaders()||"")};j.url="responseURL"in F?F.responseURL:j.headers.get("X-Request-URL");var se="response"in F?F.response:F.responseText;setTimeout(function(){U(new $(se,j))},0)},F.onerror=function(){setTimeout(function(){v(new TypeError("Network request failed"))},0)},F.ontimeout=function(){setTimeout(function(){v(new TypeError("Network request failed"))},0)},F.onabort=function(){setTimeout(function(){v(new o.DOMException("Aborted","AbortError"))},0)};function K(j){try{return j===""&&a.location.href?a.location.href:j}catch{return j}}F.open(w.method,K(w.url),!0),w.credentials==="include"?F.withCredentials=!0:w.credentials==="omit"&&(F.withCredentials=!1),"responseType"in F&&(A.blob?F.responseType="blob":A.arrayBuffer&&w.headers.get("Content-Type")&&w.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(F.responseType="arraybuffer")),D&&typeof D.headers=="object"&&!(D.headers instanceof f)?Object.getOwnPropertyNames(D.headers).forEach(function(j){F.setRequestHeader(j,d(D.headers[j]))}):w.headers.forEach(function(j,se){F.setRequestHeader(se,j)}),w.signal&&(w.signal.addEventListener("abort",H),F.onreadystatechange=function(){F.readyState===4&&w.signal.removeEventListener("abort",H)}),F.send(typeof w._bodyInit>"u"?null:w._bodyInit)})}return ee.polyfill=!0,a.fetch||(a.fetch=ee,a.Headers=f,a.Request=O,a.Response=$),o.Headers=f,o.Request=O,o.Response=$,o.fetch=ee,o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=t.fetch?t:i;e=r.fetch,e.default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,s.exports=e})(wo,wo.exports);var mf=wo.exports;const Cf=yo(mf);function To({canvas:s,scenes:e,currentTime:t}){if(e&&s){const i=e.scenes.filter(({start:n,duration:o})=>t>=n&&t<=n+o);if(i.length<=0)return;const r=s.getContext("2d");if(r){const n=e.transitionDuration,o=Math.max(...e.scenes.map(({start:a,duration:A})=>a+A));r.globalCompositeOperation="lighter",r.clearRect(0,0,s.width,s.height),i.forEach(({start:a,duration:A,draw:l,transitionCanvas:c})=>{if(r.globalAlpha=1,c.width=c.height=0,c.width=s.width,c.height=s.height,c.getContext("2d")){const u=a+A,d=a===0,g=u===o;l({currentTime:t,canvas:c}),!d&&t>=a&&t<=a+n?r.globalAlpha=Math.max(0,Math.min(1,(t-a)/n)):!g&&t>=u-n&&t<=u&&(r.globalAlpha=Math.max(0,Math.min(1,(u-t)/n))),r.drawImage(c,0,0,s.width,s.height)}})}}}function yf(s){if(typeof s=="string"){const[e,t]=s.split(":");return Math.min(parseFloat(e),parseFloat(t))}return s}function Bf(s){if(typeof s=="string"){const[e,t]=s.split(":"),i=parseFloat(e),r=parseFloat(t);return i/r}return s}function xo({resolution:s,aspectRatio:e}){const t=yf(s),i=Bf(e),r=i>=1,n=Math.min(r?t*i:t/i,t),o=Math.max(r?t*i:t/i,t);return{resolution:t,aspectRatio:i,height:r?n:o,width:r?o:n}}function vf({format:s,resolution:e,aspectRatio:t,sourceWidth:i,sourceHeight:r}){const{width:n,height:o}=xo({resolution:e,aspectRatio:t}),a=i/r,A=t>a;let l=1;if(s==="letterbox"||s==="letterbox-video")l=A?o/r:n/i;else if(s==="squarebox"){const g=Math.min(o,n);l=i>=r?g/r:g/i}else s==="crop"&&(l=A?n/i:o/r);const c=n/l,h=o/l,u=(i-c)/2,d=(r-h)/2;return{sx:u,sy:d,sWidth:c,sHeight:h,scale:l}}function er({source:s,sx:e,sy:t,sw:i,sh:r,dx:n,dy:o,dw:a,dh:A}){const l=(s==null?void 0:s.naturalWidth)??(s==null?void 0:s.videoWidth)??(s==null?void 0:s.width),c=(s==null?void 0:s.naturalHeight)??(s==null?void 0:s.videoHeight)??(s==null?void 0:s.height);e=e??0,t=t??0,i=i??l,r=r??c,i<0&&(e+=i,i=Math.abs(i)),r<0&&(t+=r,r=Math.abs(r)),a<0&&(n+=a,a=Math.abs(a)),A<0&&(o+=A,A=Math.abs(A));const h=Math.max(e,0),u=Math.min(e+i,l),d=Math.max(t,0),g=Math.min(t+r,c),f=a/i,p=A/r;return[s,h,d,u-h,g-d,e<0?n-e*f:n,t<0?o-t*p:o,(u-h)*f,(g-d)*p]}function Ll({context:s,source:e,crop:t,format:i="letterbox",posX:r,posY:n,drawAreaWidth:o,drawAreaHeight:a,sourceWidth:A,sourceHeight:l,cropCanvas:c,letterboxCanvas:h}){const{x:u,y:d,width:g,height:f}=t??{},p=A*(u??0),y=l*(d??0),B=A*Math.min(1-(u??0),g??1),Q=l*Math.min(1-(d??0),f??1),C=c.getContext("2d");if(C){c.width=B,c.height=Q;const D=er({source:e,sx:p,sy:y,sw:B,sh:Q,dx:0,dy:0,dw:B,dh:Q});C.drawImage(...D)}const T=B/Q,{sx:b,sy:L,sWidth:R,sHeight:O,scale:k}=vf({resolution:Math.min(o,a),aspectRatio:o/a,format:i,sourceWidth:B,sourceHeight:Q}),W=c&&typeof s.filter<"u";if(i==="letterbox"||i==="squarebox"||i==="letterbox-video"&&!W){if(b<0){const D=Math.abs(b)*k;s.fillStyle="black",s.beginPath(),s.rect(r,n,D,a),s.rect(r+o-D,n,D,a),s.fill(),s.closePath()}if(L<0){const D=Math.abs(L)*k;s.fillStyle="black",s.beginPath(),s.rect(r,n,o,D),s.rect(r,n+a-D,o,D),s.fill(),s.closePath()}}if(i==="letterbox-video"&&W){const D=h.getContext("2d");if(D){h.width=B,h.height=Q,s.save(),s.globalCompositeOperation="destination-out",s.fillRect(r,n,o,a);const U=er({source:c,sx:b,sy:L,sw:R,sh:O,dx:r,dy:n,dw:o,dh:a});s.globalCompositeOperation="source-over",s.drawImage(...U),D.save();const v=1.2,w=-(B*v-B)/2,F=-(Q*v-Q)/2,H=Math.min(B/20,Q/20);if(D.filter=`blur(${H}px) brightness(20%)`,D.translate(w,F),D.scale(v,v),D.drawImage(c,0,0,B,Q),D.restore(),s.globalCompositeOperation="destination-over",b<0){const K=o/T,j=a/K,se=er({source:h,sy:(1-j)*Q/2,sh:j*Q,dx:r,dy:n,dw:o,dh:a});s.drawImage(...se)}if(L<0){const K=a*T,j=o/K,se=er({source:h,sx:(1-j)*B/2,sw:j*B,dx:r,dy:n,dw:o,dh:a});s.drawImage(...se)}s.restore()}}else{const D=er({source:c,sx:b,sy:L,sw:R,sh:O,dx:r,dy:n,dw:o,dh:a});s.drawImage(...D)}const $=b*-1*k,te=L*-1*k,ee=o-$*2,S=a-te*2;return{dx:$,dy:te,dw:ee,dh:S}}function _l({context:s,word:e,maxW:t=1/0}){const i=[],r=s.measureText(e);if(r.width<t)return[{text:e,metrics:r}];for(let n=0;n<e.length;n++){const o=i[i.length-1],a=((o==null?void 0:o.text)??"")+e[n],A=s.measureText(a);A.width<t?i[o?i.length-1:0]={text:a,metrics:A}:i.push({text:e[n],metrics:s.measureText(e[n])})}return i}const kl=co(({font:s,scale:e,context:t,maxW:i,maxH:r,text:n,minSize:o,maxSize:a})=>{var A,l;let c=0;if(a){c=(o??0)*e;let u=0;for(;a*e>c+1;){c+=1;const d=tn({context:t,font:s,fontSize:c,text:n,maxW:i});if(u=d.reduce((g,f)=>(f.metrics.width>g&&(g=f.metrics.width),g),0),u>i||d.length*c>r){c-=1;break}}}else c=parseFloat(((l=(A=s.match(en))==null?void 0:A.groups)==null?void 0:l.value)??"0")*e;return c},{cacheKey:([{font:s,text:e,minSize:t,maxSize:i,scale:r,maxW:n,maxH:o}])=>`${s}_${e}_${t}_${i}_${r}_${n}_${o}`});function Qf(s,e){return typeof s=="number"?{top:s*e,right:s*e,bottom:s*e,left:s*e}:{top:typeof s.top=="number"?s.top*e:s.top,right:typeof s.right=="number"?s.right*e:s.right,bottom:typeof s.bottom=="number"?s.bottom*e:s.bottom,left:typeof s.left=="number"?s.left*e:s.left}}function Nl(s,e){return typeof s=="number"?{top:s*e,right:s*e,bottom:s*e,left:s*e}:{top:(typeof s.top=="number"?s.top*e:s.top)??0,right:(typeof s.right=="number"?s.right*e:s.right)??0,bottom:(typeof s.bottom=="number"?s.bottom*e:s.bottom)??0,left:(typeof s.left=="number"?s.left*e:s.left)??0}}function Fl(s,e,{layout:t,scale:i=1}){const{position:r="static",inset:n,width:o,height:a,minWidth:A,minHeight:l,maxWidth:c,maxHeight:h,flex:u,gap:d,margin:g,padding:f,direction:p="column",align:y="start",alignSelf:B,justify:Q="start"}=t,C={static:s.POSITION_TYPE_STATIC,relative:s.POSITION_TYPE_RELATIVE,absolute:s.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(C[r]),n){const{top:R,right:O,bottom:k,left:W}=Qf(n,i);R&&e.setPosition(s.EDGE_TOP,R),O&&e.setPosition(s.EDGE_RIGHT,O),k&&e.setPosition(s.EDGE_BOTTOM,k),W&&e.setPosition(s.EDGE_LEFT,W)}const T={row:s.FLEX_DIRECTION_ROW,column:s.FLEX_DIRECTION_COLUMN,"row-reverse":s.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":s.FLEX_DIRECTION_COLUMN_REVERSE};e.setFlexDirection(T[p]);const b={start:s.ALIGN_FLEX_START,end:s.ALIGN_FLEX_END,center:s.ALIGN_CENTER,stretch:s.ALIGN_STRETCH};e.setAlignItems(b[y]),B&&e.setAlignSelf(b[B]);const L={start:s.JUSTIFY_FLEX_START,end:s.JUSTIFY_FLEX_END,center:s.JUSTIFY_CENTER,"space-between":s.JUSTIFY_SPACE_BETWEEN,"space-around":s.JUSTIFY_SPACE_AROUND,"space-evenly":s.JUSTIFY_SPACE_EVENLY};if(e.setJustifyContent(L[Q]),g){const{top:R,right:O,bottom:k,left:W}=Nl(g,i);e.setMargin(s.EDGE_TOP,R),e.setMargin(s.EDGE_RIGHT,O),e.setMargin(s.EDGE_BOTTOM,k),e.setMargin(s.EDGE_LEFT,W)}if(f){const{top:R,right:O,bottom:k,left:W}=Nl(f,i);e.setPadding(s.EDGE_TOP,R),e.setPadding(s.EDGE_RIGHT,O),e.setPadding(s.EDGE_BOTTOM,k),e.setPadding(s.EDGE_LEFT,W)}u&&e.setFlex(u),e.setGap(s.GUTTER_ALL,(d??0)*i),o&&e.setWidth(typeof o=="number"?o*i:o),a&&(typeof a=="function"?e.setHeight("100%"):e.setHeight(typeof a=="number"?a*i:a)),A&&e.setMinWidth(typeof A=="number"?A*i:A),l&&e.setMinHeight(typeof l=="number"?l*i:l),c&&e.setMaxWidth(typeof c=="number"?c*i:c),h&&e.setMaxHeight(typeof h=="number"?h*i:h)}function Ml({canvas:s,debug:e=!1,scale:t=1,position:i=[]}){i.forEach(({x:r,y:n,width:o,height:a,childNodes:A,element:l})=>{const c=s.getContext("2d",{alpha:!1});if(c){const{draw:h}=l;h&&(c.save(),h({scale:t,dx:r,dy:n,dw:o,dh:a}),e&&(c.strokeStyle="red",c.strokeRect(r,n,o,a))),Ml({canvas:s,debug:e,scale:t,position:A}),c.restore()}})}function Pl(s,e,t,i){const r=t.map((n,o)=>{const a=s.Node.create(),{radius:A,elements:l=[],draw:c,...h}=n;return Fl(s,a,{layout:h,scale:i}),e.insertChild(a,o),{node:a,element:n,childNodes:Pl(s,a,l,i)}});return e.calculateLayout(),r}function Ol(s,e,t=0,i=0){const{top:r,left:n}=s.getComputedLayout();return e.map(({node:o,element:a,childNodes:A})=>{const{top:l,left:c,width:h,height:u}=o.getComputedLayout(),d=t+c,g=i+l;return{x:n+d,y:r+g,width:h,height:u,element:a,childNodes:Ol(s,A,d,g)}})}function Ul(s,e){s.forEach(({node:t,element:i,childNodes:r})=>{const{height:n}=i;if(n&&typeof n=="function"){const o=t.getComputedWidth(),a=t.getComputedHeight(),A=n({width:o,maxHeight:a,scale:e});t.setHeight(A)}Ul(r,e)})}function bf({yoga:s,canvas:e,origin:t,elements:i,...r}){const n={inset:{top:0,left:0},width:e.width,height:e.height,...t},o=s.Node.create();Fl(s,o,{layout:n}),o.calculateLayout();const{width:a,height:A}=o.getComputedLayout(),l=Math.min(a,A)/1080,c=Pl(s,o,i,l);Ul(c,l),o.calculateLayout();const h=Ol(o,c);return Ml({...r,scale:l,canvas:e,position:h})}const Sf={linear:Jg,easeIn:mo,easeInOut:qg,easeOut:Wg,circIn:wl,circInOut:jg,circOut:Tl,backIn:Co,backInOut:zg,backOut:Xg,anticipate:Zg,bounceIn:rf,bounceInOut:nf,bounceOut:Gr},zr=co((s,e,{clamp:t=!0,ease:i="easeIn",...r}={})=>Gg(s,e,{...r,clamp:t,ease:Sf[i]}),{cacheKey:([s,e,t])=>JSON.stringify({from:s,to:e,options:t})}),Gl=[{family:"Noto Arabic",regex:/\p{Script=Arabic}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArabic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Chinese",regex:/\p{Script=Han}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSC-VariableFont_wght.woff2",style:"normal"},{family:"Noto Hebrew",regex:/\p{Script=Hebrew}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansHebrew-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Hindi",regex:/\p{Script=Devanagari}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansDevanagari-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Japanese",regex:/\p{Script=Han}|\p{Script=Katakana}|\p{Script=Hiragana}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansJP-VariableFont_wght.woff2",style:"normal"},{family:"Noto Korean",regex:/\p{Script=Hangul}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKR-VariableFont_wght.woff2",style:"normal"},{family:"Noto Color Emoji",regex:/\p{Extended_Pictographic}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoColorEmoji-Regular.woff2",style:"normal"}];function Zr({text:s,font:e}){let t=e;return Gl.forEach(({family:i,regex:r})=>{r.exec(s)&&(t+=`, ${i}`)}),t}const ai=1.8,en=/(?<value>\d+\.?\d*)(?=px)/;function wf(s,e=1){return typeof s=="number"?{topLeft:s*e,topRight:s*e,bottomRight:s*e,bottomLeft:s*e}:{topLeft:((s==null?void 0:s.topLeft)??0)*e,topRight:((s==null?void 0:s.topRight)??0)*e,bottomRight:((s==null?void 0:s.bottomRight)??0)*e,bottomLeft:((s==null?void 0:s.bottomLeft)??0)*e}}function Hl(s){const{visible:e,node:t}=s,i=[...(t==null?void 0:t.elements)??[],...(s==null?void 0:s.elements)??[]];return e??(t&&t.type!=="box"&&t.type!=="gradient"?!!t.value:i==null?void 0:i.some(r=>Hl(r)))}function $l({yoga:s,debug:e=!1,canvas:t,cropCanvas:i,posterCanvas:r,letterboxCanvas:n,elements:o=[],currentTime:a,contentTime:A,sceneTime:l,totalDuration:c,contentDuration:h,sceneDuration:u}){return o.map(d=>{var g,f,p,y,B,Q,C,T;const{node:b,transient:L=[{from:0,duration:1/0}]}=d,R=t.getContext("2d"),O={total:a,content:A,scene:l},k={total:c,content:h,scene:u},W=L.reduce(($,{type:te="scene",from:ee,duration:S,animation:D})=>{const U=ee<0?k[te]+ee:ee;return O[te]>=U&&O[te]<=U+S&&$.push({type:te,animation:D,duration:S,from:U}),$},[]);if(R&&W.length>0&&Hl(d)){let $=d.width,te=d.height;if((b==null?void 0:b.type)==="text"&&b.value){const{align:ee="left"}=b,S=Zr({text:b.value,font:b.font});R.save(),R.font=S,R.textBaseline="top",R.textAlign=ee,b.wrap?te=({width:D,maxHeight:U,scale:v})=>{var w,F;const H=kl({font:S,scale:v,context:R,maxW:D,maxH:U,text:b.value??"",minSize:(w=b.fill)==null?void 0:w.minSize,maxSize:(F=b.fill)==null?void 0:F.maxSize});return tn({context:R,font:S,fontSize:H,text:b.value??"",maxW:D}).length*H}:($=R.measureText(b.value).width,te=parseFloat(((f=(g=S.match(en))==null?void 0:g.groups)==null?void 0:f.value)??"0")),R.restore()}if((b==null?void 0:b.type)==="image"&&b.image&&b.size){const ee=((p=b.image)==null?void 0:p.naturalWidth)??((y=b.image)==null?void 0:y.width),S=((B=b.image)==null?void 0:B.naturalHeight)??((Q=b.image)==null?void 0:Q.height),D=ee/S,U=(C=b.size)==null?void 0:C.width,v=(T=b.size)==null?void 0:T.height;$=U??(D>=1?(v??0)*D:(v??0)/D),te=v??(D<1?(U??0)*D:(U??0)/D)}return{...d,width:$,height:te,elements:$l({yoga:s,debug:e,canvas:t,cropCanvas:i,posterCanvas:r,letterboxCanvas:n,elements:d.elements,currentTime:a,contentTime:A,sceneTime:l,totalDuration:c,contentDuration:h,sceneDuration:u}),draw:({dx:ee,dy:S,dw:D,dh:U,scale:v})=>{var w,F,H,K,j,se,ue,Ae,Ce,be,Re,ne,Ie;if(W.forEach(ve=>{const{type:he="scene",from:le,duration:oe,animation:we={type:"fade",duration:.3333333333333333,easing:{in:"easeOut",out:"easeOut"}}}=ve;if(we){const{type:Oe,duration:Le,easing:{in:Me="easeOut",out:Ue="easeOut"}={}}=we;if(le>0&&O[he]<=le+Le)switch(Oe){case"fade":{const xe=zr([le,le+Le],[0,1],{ease:Me});R.globalAlpha=xe(O[he]);break}case"slide":{const{options:xe}=we,Be={up:[{x:0,y:U},{x:0,y:0}],right:[{x:D,y:0},{x:0,y:0}],down:[{x:0,y:-U},{x:0,y:0}],left:[{x:-D,y:0},{x:0,y:0}]},He=zr([le,le+Le],Be[xe.direction.in],{ease:Me}),{x:We,y:rt}=He(O[he]);R.translate(We,rt);break}}if(le+oe<k[he]&&le+oe-Le<=O[he])switch(Oe){case"fade":{const xe=zr([le+oe-Le,le+oe],[1,0],{ease:Ue});R.globalAlpha=xe(O[he]);break}case"slide":{const{options:xe}=we,Be={up:[{x:0,y:0},{x:0,y:-U}],right:[{x:0,y:0},{x:D,y:0}],down:[{x:0,y:0},{x:0,y:U}],left:[{x:0,y:0},{x:-D,y:0}]},He=zr([le+oe-Le,le+oe],Be[xe.direction.out],{ease:Ue}),{x:We,y:rt}=He(O[he]);R.translate(We,rt);break}}}}),b){const{type:ve}=b;if(d.radius){const{topLeft:he,topRight:le,bottomRight:oe,bottomLeft:we}=wf(d.radius,v);R.beginPath(),R.moveTo(ee+Math.min(U/ai,he),S),R.lineTo(ee+D-Math.min(U/ai,le),S),R.quadraticCurveTo(ee+D,S,ee+D,S+Math.min(U/ai,le)),R.lineTo(ee+D,S+U-Math.min(U/ai,oe)),R.quadraticCurveTo(ee+D,S+U,ee+D-Math.min(U/ai,oe),S+U),R.lineTo(ee+Math.min(U/ai,we),S+U),R.quadraticCurveTo(ee,S+U,ee,S+U-Math.min(U/ai,we)),R.lineTo(ee,S+Math.min(U/ai,he)),R.quadraticCurveTo(ee,S,ee+Math.min(U/ai,he),S),R.closePath(),e&&(R.strokeStyle="blue",R.stroke()),R.clip()}if(ve==="box"&&(R.fillStyle=b.background,R.fillRect(ee,S,D,U)),ve==="text"&&b.value){const{align:he="left"}=b,le=Zr({text:b.value,font:b.font}),oe=kl({font:le,scale:v,context:R,maxW:D,maxH:U,text:b.value??"",minSize:(w=b.fill)==null?void 0:w.minSize,maxSize:(F=b.fill)==null?void 0:F.maxSize});R.font=le.replace(en,oe.toString()),R.textBaseline="top",R.fillStyle=b.color,R.textAlign=he;const we={left:ee,center:ee+D/2,right:ee+D};b.wrap?tn({context:R,font:le,fontSize:oe,text:b.value,maxW:D}).forEach((Le,Me)=>{R.fillText(Le.text,we[he],S+oe*Me)}):R.fillText(b.value,we[he],S)}if(ve==="image"&&b.image&&R.drawImage(b.image,ee,S,D,U),ve==="video"&&((H=b.video)!=null&&H.node||(K=b.video)!=null&&K.getSource)){const he=b.format??"letterbox",le=((se=(j=b.video)==null?void 0:j.getSource)==null?void 0:se.call(j,l))??b.video.node,oe=(le==null?void 0:le.videoWidth)??(le==null?void 0:le.naturalWidth)??(le==null?void 0:le.width),we=(le==null?void 0:le.videoHeight)??(le==null?void 0:le.naturalHeight)??(le==null?void 0:le.height);if(oe&&we){const{dx:Le,dy:Me,dw:Ue,dh:xe}=Ll({context:R,cropCanvas:i,letterboxCanvas:n,source:le,format:he,crop:(ue=b==null?void 0:b.value)==null?void 0:ue.crop,sourceWidth:oe,sourceHeight:we,posX:ee,posY:S,drawAreaWidth:D,drawAreaHeight:U});b.elements&&Do({yoga:s,debug:e,canvas:t,cropCanvas:i,posterCanvas:r,letterboxCanvas:n,elements:b.elements,currentTime:a,contentTime:A,sceneTime:l,totalDuration:c,contentDuration:h,sceneDuration:u,origin:{inset:{top:Math.max(S,S+Me),left:Math.max(ee,ee+Le)},width:Math.min(D,Ue),height:Math.min(U,xe)}})}const Oe=1/3;if(b.poster&&a>=0&&a<=Oe){R.save(),R.globalAlpha=1-a/Oe;const Le=((Ae=b.poster)==null?void 0:Ae.naturalWidth)??((Ce=b.poster)==null?void 0:Ce.width),Me=((be=b.poster)==null?void 0:be.naturalHeight)??((Re=b.poster)==null?void 0:Re.height);r.width=r.height=0,r.width=D,r.height=U;const Ue=r.getContext("2d");if(Ue&&Le&&Me){const{dx:xe,dy:Be,dw:He,dh:We}=Ll({context:Ue,cropCanvas:i,letterboxCanvas:n,source:b.poster,format:he,crop:(ne=b==null?void 0:b.value)==null?void 0:ne.crop,sourceWidth:Le,sourceHeight:Me,posX:0,posY:0,drawAreaWidth:D,drawAreaHeight:U});b.elements&&Do({yoga:s,debug:e,canvas:r,cropCanvas:i,posterCanvas:r,letterboxCanvas:n,elements:b.elements,currentTime:a,contentTime:A,sceneTime:l,totalDuration:c,contentDuration:h,sceneDuration:u,origin:{inset:{top:Math.max(0,Be),left:Math.max(0,xe)},width:Math.min(D,He),height:Math.min(U,We)}}),R.drawImage(r,ee,S,D,U),R.restore()}}}if(ve==="gradient"&&b.value){const he=R.createLinearGradient(ee+D,S,ee+D,S+U);(Ie=b.value)==null||Ie.forEach(le=>{he.addColorStop(le.percent,le.color)}),R.fillStyle=he,R.fillRect(ee,S,D,U)}}}}}}).filter(Boolean)}function Do({yoga:s,debug:e,canvas:t,cropCanvas:i,posterCanvas:r,letterboxCanvas:n,elements:o,currentTime:a,contentTime:A,sceneTime:l,totalDuration:c,contentDuration:h,sceneDuration:u,...d}){return bf({...d,yoga:s,debug:e,canvas:t,elements:$l({yoga:s,debug:e,canvas:t,cropCanvas:i,posterCanvas:r,letterboxCanvas:n,elements:o,currentTime:a,contentTime:A,sceneTime:l,totalDuration:c,contentDuration:h,sceneDuration:u})})}const tn=co(({context:s,font:e,fontSize:t,text:i,maxW:r=1/0})=>{try{return s.save(),s.font=e.replace(en,t.toString()),i.split(`
|
91
|
-
`).flatMap(o=>{const a=o.split(" ").filter(Boolean);return a.length?a.slice(1).reduce((A,l)=>{const h=`${A[A.length-1].text} ${l}`.trim(),u=s.measureText(h);return u.width>r?A=[...A,..._l({context:s,word:l,maxW:r})]:A[A.length-1]={text:h,metrics:u},A},_l({context:s,word:a[0],maxW:r})):{text:"",metrics:s.measureText("")}})}finally{s.restore()}},{cacheKey:([{font:s,fontSize:e,text:t,maxW:i}])=>`${s}_${e}_${t}_${i}`}),Tf=/\d{0,2}:?\d{2}:\d{2}\.\d{3}\s-->\s\d{0,2}:?\d{2}:\d{2}\.\d{3}\s{1,2}.*/g,xf=/\d{0,2}:?\d{2}:\d{2}\.\d{3}/g;function
|
88
|
+
`+p(v,F)):K}}function U(v,w){var F;return w.cache&&w.name&&w.storage.templates.get(w.name)?w.storage.templates.get(w.name):(F=typeof v=="function"?v:D(v,w),w.cache&&w.name&&w.storage.templates.define(w.name,F),F)}Z.l.bind(Z),t.compile=D,t.compileScope=T,t.compileScopeIntoFunction=C,t.compileToString=p,t.defaultConfig=Z,t.filters=te,t.getConfig=S,t.helpers=W,t.nativeHelpers=$,t.parse=f,t.render=function(v,w,F,H){var K=S(F||{});if(!K.async)return U(v,K)(w,K);if(!H){if(typeof n=="function")return new n(function(j,se){try{j(U(v,K)(w,K))}catch(ue){se(ue)}});throw i("Please provide a callback function, this env doesn't support Promises")}try{U(v,K)(w,K,H)}catch(j){return H(j)}},t.templates=k,Object.defineProperty(t,"__esModule",{value:!0})})})(Bo,Bo.exports);var $r=Bo.exports,vo={exports:{}};(function(s,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Hr<"u"&&Hr,i=function(){function n(){this.fetch=!1,this.DOMException=t.DOMException}return n.prototype=t,new n}();(function(n){(function(o){var a=typeof n<"u"&&n||typeof self<"u"&&self||typeof a<"u"&&a,A={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(S){return S&&DataView.prototype.isPrototypeOf(S)}if(A.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(S){return S&&c.indexOf(Object.prototype.toString.call(S))>-1};function u(S){if(typeof S!="string"&&(S=String(S)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(S)||S==="")throw new TypeError('Invalid character in header field name: "'+S+'"');return S.toLowerCase()}function d(S){return typeof S!="string"&&(S=String(S)),S}function g(S){var D={next:function(){var U=S.shift();return{done:U===void 0,value:U}}};return A.iterable&&(D[Symbol.iterator]=function(){return D}),D}function f(S){this.map={},S instanceof f?S.forEach(function(D,U){this.append(U,D)},this):Array.isArray(S)?S.forEach(function(D){this.append(D[0],D[1])},this):S&&Object.getOwnPropertyNames(S).forEach(function(D){this.append(D,S[D])},this)}f.prototype.append=function(S,D){S=u(S),D=d(D);var U=this.map[S];this.map[S]=U?U+", "+D:D},f.prototype.delete=function(S){delete this.map[u(S)]},f.prototype.get=function(S){return S=u(S),this.has(S)?this.map[S]:null},f.prototype.has=function(S){return this.map.hasOwnProperty(u(S))},f.prototype.set=function(S,D){this.map[u(S)]=d(D)},f.prototype.forEach=function(S,D){for(var U in this.map)this.map.hasOwnProperty(U)&&S.call(D,this.map[U],U,this)},f.prototype.keys=function(){var S=[];return this.forEach(function(D,U){S.push(U)}),g(S)},f.prototype.values=function(){var S=[];return this.forEach(function(D){S.push(D)}),g(S)},f.prototype.entries=function(){var S=[];return this.forEach(function(D,U){S.push([U,D])}),g(S)},A.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function p(S){if(S.bodyUsed)return Promise.reject(new TypeError("Already read"));S.bodyUsed=!0}function y(S){return new Promise(function(D,U){S.onload=function(){D(S.result)},S.onerror=function(){U(S.error)}})}function B(S){var D=new FileReader,U=y(D);return D.readAsArrayBuffer(S),U}function Q(S){var D=new FileReader,U=y(D);return D.readAsText(S),U}function C(S){for(var D=new Uint8Array(S),U=new Array(D.length),v=0;v<D.length;v++)U[v]=String.fromCharCode(D[v]);return U.join("")}function T(S){if(S.slice)return S.slice(0);var D=new Uint8Array(S.byteLength);return D.set(new Uint8Array(S)),D.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(S){this.bodyUsed=this.bodyUsed,this._bodyInit=S,S?typeof S=="string"?this._bodyText=S:A.blob&&Blob.prototype.isPrototypeOf(S)?this._bodyBlob=S:A.formData&&FormData.prototype.isPrototypeOf(S)?this._bodyFormData=S:A.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)?this._bodyText=S.toString():A.arrayBuffer&&A.blob&&l(S)?(this._bodyArrayBuffer=T(S.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):A.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(S)||h(S))?this._bodyArrayBuffer=T(S):this._bodyText=S=Object.prototype.toString.call(S):this._bodyText="",this.headers.get("content-type")||(typeof S=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):A.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},A.blob&&(this.blob=function(){var S=p(this);if(S)return S;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var S=p(this);return S||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(B)}),this.text=function(){var S=p(this);if(S)return S;if(this._bodyBlob)return Q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(C(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},A.formData&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function R(S){var D=S.toUpperCase();return L.indexOf(D)>-1?D:S}function O(S,D){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');D=D||{};var U=D.body;if(S instanceof O){if(S.bodyUsed)throw new TypeError("Already read");this.url=S.url,this.credentials=S.credentials,D.headers||(this.headers=new f(S.headers)),this.method=S.method,this.mode=S.mode,this.signal=S.signal,!U&&S._bodyInit!=null&&(U=S._bodyInit,S.bodyUsed=!0)}else this.url=String(S);if(this.credentials=D.credentials||this.credentials||"same-origin",(D.headers||!this.headers)&&(this.headers=new f(D.headers)),this.method=R(D.method||this.method||"GET"),this.mode=D.mode||this.mode||null,this.signal=D.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(U),(this.method==="GET"||this.method==="HEAD")&&(D.cache==="no-store"||D.cache==="no-cache")){var v=/([?&])_=[^&]*/;if(v.test(this.url))this.url=this.url.replace(v,"$1_="+new Date().getTime());else{var w=/\?/;this.url+=(w.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}O.prototype.clone=function(){return new O(this,{body:this._bodyInit})};function k(S){var D=new FormData;return S.trim().split("&").forEach(function(U){if(U){var v=U.split("="),w=v.shift().replace(/\+/g," "),F=v.join("=").replace(/\+/g," ");D.append(decodeURIComponent(w),decodeURIComponent(F))}}),D}function W(S){var D=new f,U=S.replace(/\r?\n[\t ]+/g," ");return U.split("\r").map(function(v){return v.indexOf(`
|
89
|
+
`)===0?v.substr(1,v.length):v}).forEach(function(v){var w=v.split(":"),F=w.shift().trim();if(F){var H=w.join(":").trim();D.append(F,H)}}),D}b.call(O.prototype);function $(S,D){if(!(this instanceof $))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');D||(D={}),this.type="default",this.status=D.status===void 0?200:D.status,this.ok=this.status>=200&&this.status<300,this.statusText=D.statusText===void 0?"":""+D.statusText,this.headers=new f(D.headers),this.url=D.url||"",this._initBody(S)}b.call($.prototype),$.prototype.clone=function(){return new $(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},$.error=function(){var S=new $(null,{status:0,statusText:""});return S.type="error",S};var te=[301,302,303,307,308];$.redirect=function(S,D){if(te.indexOf(D)===-1)throw new RangeError("Invalid status code");return new $(null,{status:D,headers:{location:S}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(D,U){this.message=D,this.name=U;var v=Error(D);this.stack=v.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function Z(S,D){return new Promise(function(U,v){var w=new O(S,D);if(w.signal&&w.signal.aborted)return v(new o.DOMException("Aborted","AbortError"));var F=new XMLHttpRequest;function H(){F.abort()}F.onload=function(){var j={status:F.status,statusText:F.statusText,headers:W(F.getAllResponseHeaders()||"")};j.url="responseURL"in F?F.responseURL:j.headers.get("X-Request-URL");var se="response"in F?F.response:F.responseText;setTimeout(function(){U(new $(se,j))},0)},F.onerror=function(){setTimeout(function(){v(new TypeError("Network request failed"))},0)},F.ontimeout=function(){setTimeout(function(){v(new TypeError("Network request failed"))},0)},F.onabort=function(){setTimeout(function(){v(new o.DOMException("Aborted","AbortError"))},0)};function K(j){try{return j===""&&a.location.href?a.location.href:j}catch{return j}}F.open(w.method,K(w.url),!0),w.credentials==="include"?F.withCredentials=!0:w.credentials==="omit"&&(F.withCredentials=!1),"responseType"in F&&(A.blob?F.responseType="blob":A.arrayBuffer&&w.headers.get("Content-Type")&&w.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(F.responseType="arraybuffer")),D&&typeof D.headers=="object"&&!(D.headers instanceof f)?Object.getOwnPropertyNames(D.headers).forEach(function(j){F.setRequestHeader(j,d(D.headers[j]))}):w.headers.forEach(function(j,se){F.setRequestHeader(se,j)}),w.signal&&(w.signal.addEventListener("abort",H),F.onreadystatechange=function(){F.readyState===4&&w.signal.removeEventListener("abort",H)}),F.send(typeof w._bodyInit>"u"?null:w._bodyInit)})}return Z.polyfill=!0,a.fetch||(a.fetch=Z,a.Headers=f,a.Request=O,a.Response=$),o.Headers=f,o.Request=O,o.Response=$,o.fetch=Z,o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=t.fetch?t:i;e=r.fetch,e.default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,s.exports=e})(vo,vo.exports);var pf=vo.exports;const Ef=yo(pf);var xl={},Qo={},ye={};Object.defineProperty(ye,"__esModule",{value:!0}),ye.default=ye.Wrap=ye.Unit=ye.PrintOptions=ye.PositionType=ye.Overflow=ye.NodeType=ye.MeasureMode=ye.LogLevel=ye.Justify=ye.Gutter=ye.FlexDirection=ye.ExperimentalFeature=ye.Errata=ye.Edge=ye.Display=ye.Direction=ye.Dimension=ye.Align=void 0;let ai=function(s){return s[s.Auto=0]="Auto",s[s.FlexStart=1]="FlexStart",s[s.Center=2]="Center",s[s.FlexEnd=3]="FlexEnd",s[s.Stretch=4]="Stretch",s[s.Baseline=5]="Baseline",s[s.SpaceBetween=6]="SpaceBetween",s[s.SpaceAround=7]="SpaceAround",s}({});ye.Align=ai;let bo=function(s){return s[s.Width=0]="Width",s[s.Height=1]="Height",s}({});ye.Dimension=bo;let Yr=function(s){return s[s.Inherit=0]="Inherit",s[s.LTR=1]="LTR",s[s.RTL=2]="RTL",s}({});ye.Direction=Yr;let So=function(s){return s[s.Flex=0]="Flex",s[s.None=1]="None",s}({});ye.Display=So;let Kt=function(s){return s[s.Left=0]="Left",s[s.Top=1]="Top",s[s.Right=2]="Right",s[s.Bottom=3]="Bottom",s[s.Start=4]="Start",s[s.End=5]="End",s[s.Horizontal=6]="Horizontal",s[s.Vertical=7]="Vertical",s[s.All=8]="All",s}({});ye.Edge=Kt;let Xs=function(s){return s[s.None=0]="None",s[s.StretchFlexBasis=1]="StretchFlexBasis",s[s.All=2147483647]="All",s[s.Classic=2147483646]="Classic",s}({});ye.Errata=Xs;let Kr=function(s){return s[s.WebFlexBasis=0]="WebFlexBasis",s[s.AbsolutePercentageAgainstPaddingEdge=1]="AbsolutePercentageAgainstPaddingEdge",s[s.FixJNILocalRefOverflows=2]="FixJNILocalRefOverflows",s}({});ye.ExperimentalFeature=Kr;let zs=function(s){return s[s.Column=0]="Column",s[s.ColumnReverse=1]="ColumnReverse",s[s.Row=2]="Row",s[s.RowReverse=3]="RowReverse",s}({});ye.FlexDirection=zs;let Vr=function(s){return s[s.Column=0]="Column",s[s.Row=1]="Row",s[s.All=2]="All",s}({});ye.Gutter=Vr;let Vi=function(s){return s[s.FlexStart=0]="FlexStart",s[s.Center=1]="Center",s[s.FlexEnd=2]="FlexEnd",s[s.SpaceBetween=3]="SpaceBetween",s[s.SpaceAround=4]="SpaceAround",s[s.SpaceEvenly=5]="SpaceEvenly",s}({});ye.Justify=Vi;let Ji=function(s){return s[s.Error=0]="Error",s[s.Warn=1]="Warn",s[s.Info=2]="Info",s[s.Debug=3]="Debug",s[s.Verbose=4]="Verbose",s[s.Fatal=5]="Fatal",s}({});ye.LogLevel=Ji;let Jr=function(s){return s[s.Undefined=0]="Undefined",s[s.Exactly=1]="Exactly",s[s.AtMost=2]="AtMost",s}({});ye.MeasureMode=Jr;let wo=function(s){return s[s.Default=0]="Default",s[s.Text=1]="Text",s}({});ye.NodeType=wo;let Wr=function(s){return s[s.Visible=0]="Visible",s[s.Hidden=1]="Hidden",s[s.Scroll=2]="Scroll",s}({});ye.Overflow=Wr;let qr=function(s){return s[s.Static=0]="Static",s[s.Relative=1]="Relative",s[s.Absolute=2]="Absolute",s}({});ye.PositionType=qr;let jr=function(s){return s[s.Layout=1]="Layout",s[s.Style=2]="Style",s[s.Children=4]="Children",s}({});ye.PrintOptions=jr;let Zs=function(s){return s[s.Undefined=0]="Undefined",s[s.Point=1]="Point",s[s.Percent=2]="Percent",s[s.Auto=3]="Auto",s}({});ye.Unit=Zs;let Xr=function(s){return s[s.NoWrap=0]="NoWrap",s[s.Wrap=1]="Wrap",s[s.WrapReverse=2]="WrapReverse",s}({});ye.Wrap=Xr;var If={ALIGN_AUTO:ai.Auto,ALIGN_FLEX_START:ai.FlexStart,ALIGN_CENTER:ai.Center,ALIGN_FLEX_END:ai.FlexEnd,ALIGN_STRETCH:ai.Stretch,ALIGN_BASELINE:ai.Baseline,ALIGN_SPACE_BETWEEN:ai.SpaceBetween,ALIGN_SPACE_AROUND:ai.SpaceAround,DIMENSION_WIDTH:bo.Width,DIMENSION_HEIGHT:bo.Height,DIRECTION_INHERIT:Yr.Inherit,DIRECTION_LTR:Yr.LTR,DIRECTION_RTL:Yr.RTL,DISPLAY_FLEX:So.Flex,DISPLAY_NONE:So.None,EDGE_LEFT:Kt.Left,EDGE_TOP:Kt.Top,EDGE_RIGHT:Kt.Right,EDGE_BOTTOM:Kt.Bottom,EDGE_START:Kt.Start,EDGE_END:Kt.End,EDGE_HORIZONTAL:Kt.Horizontal,EDGE_VERTICAL:Kt.Vertical,EDGE_ALL:Kt.All,ERRATA_NONE:Xs.None,ERRATA_STRETCH_FLEX_BASIS:Xs.StretchFlexBasis,ERRATA_ALL:Xs.All,ERRATA_CLASSIC:Xs.Classic,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:Kr.WebFlexBasis,EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE:Kr.AbsolutePercentageAgainstPaddingEdge,EXPERIMENTAL_FEATURE_FIX_JNILOCAL_REF_OVERFLOWS:Kr.FixJNILocalRefOverflows,FLEX_DIRECTION_COLUMN:zs.Column,FLEX_DIRECTION_COLUMN_REVERSE:zs.ColumnReverse,FLEX_DIRECTION_ROW:zs.Row,FLEX_DIRECTION_ROW_REVERSE:zs.RowReverse,GUTTER_COLUMN:Vr.Column,GUTTER_ROW:Vr.Row,GUTTER_ALL:Vr.All,JUSTIFY_FLEX_START:Vi.FlexStart,JUSTIFY_CENTER:Vi.Center,JUSTIFY_FLEX_END:Vi.FlexEnd,JUSTIFY_SPACE_BETWEEN:Vi.SpaceBetween,JUSTIFY_SPACE_AROUND:Vi.SpaceAround,JUSTIFY_SPACE_EVENLY:Vi.SpaceEvenly,LOG_LEVEL_ERROR:Ji.Error,LOG_LEVEL_WARN:Ji.Warn,LOG_LEVEL_INFO:Ji.Info,LOG_LEVEL_DEBUG:Ji.Debug,LOG_LEVEL_VERBOSE:Ji.Verbose,LOG_LEVEL_FATAL:Ji.Fatal,MEASURE_MODE_UNDEFINED:Jr.Undefined,MEASURE_MODE_EXACTLY:Jr.Exactly,MEASURE_MODE_AT_MOST:Jr.AtMost,NODE_TYPE_DEFAULT:wo.Default,NODE_TYPE_TEXT:wo.Text,OVERFLOW_VISIBLE:Wr.Visible,OVERFLOW_HIDDEN:Wr.Hidden,OVERFLOW_SCROLL:Wr.Scroll,POSITION_TYPE_STATIC:qr.Static,POSITION_TYPE_RELATIVE:qr.Relative,POSITION_TYPE_ABSOLUTE:qr.Absolute,PRINT_OPTIONS_LAYOUT:jr.Layout,PRINT_OPTIONS_STYLE:jr.Style,PRINT_OPTIONS_CHILDREN:jr.Children,UNIT_UNDEFINED:Zs.Undefined,UNIT_POINT:Zs.Point,UNIT_PERCENT:Zs.Percent,UNIT_AUTO:Zs.Auto,WRAP_NO_WRAP:Xr.NoWrap,WRAP_WRAP:Xr.Wrap,WRAP_WRAP_REVERSE:Xr.WrapReverse};ye.default=If,Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.default=Cf;var Si=mf(ye);function Dl(s){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Dl=function(i){return i?t:e})(s)}function mf(s,e){if(!e&&s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var t=Dl(e);if(t&&t.has(s))return t.get(s);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in s)if(n!=="default"&&Object.prototype.hasOwnProperty.call(s,n)){var o=r?Object.getOwnPropertyDescriptor(s,n):null;o&&(o.get||o.set)?Object.defineProperty(i,n,o):i[n]=s[n]}return i.default=s,t&&t.set(s,i),i}function Cf(s){function e(r,n,o){const a=r[n];r[n]=function(){for(var A=arguments.length,l=new Array(A),c=0;c<A;c++)l[c]=arguments[c];return o.call(this,a,...l)}}for(const r of["setPosition","setMargin","setFlexBasis","setWidth","setHeight","setMinWidth","setMinHeight","setMaxWidth","setMaxHeight","setPadding"]){const n={[Si.Unit.Point]:s.Node.prototype[r],[Si.Unit.Percent]:s.Node.prototype[`${r}Percent`],[Si.Unit.Auto]:s.Node.prototype[`${r}Auto`]};e(s.Node.prototype,r,function(o){for(var a=arguments.length,A=new Array(a>1?a-1:0),l=1;l<a;l++)A[l-1]=arguments[l];const c=A.pop();let h,u;if(c==="auto")h=Si.Unit.Auto,u=void 0;else if(typeof c=="object")h=c.unit,u=c.valueOf();else if(h=typeof c=="string"&&c.endsWith("%")?Si.Unit.Percent:Si.Unit.Point,u=parseFloat(c),!Number.isNaN(c)&&Number.isNaN(u))throw new Error(`Invalid value ${c} for ${r}`);if(!n[h])throw new Error(`Failed to execute "${r}": Unsupported unit '${c}'`);return u!==void 0?n[h].call(this,...A,u):n[h].call(this,...A)})}function t(r){return s.MeasureCallback.implement({measure:function(){const{width:n,height:o}=r(...arguments);return{width:n??NaN,height:o??NaN}}})}e(s.Node.prototype,"setMeasureFunc",function(r,n){return n?r.call(this,t(n)):this.unsetMeasureFunc()});function i(r){return s.DirtiedCallback.implement({dirtied:r})}return e(s.Node.prototype,"setDirtiedFunc",function(r,n){r.call(this,i(n))}),e(s.Config.prototype,"free",function(){s.Config.destroy(this)}),e(s.Node,"create",(r,n)=>n?s.Node.createWithConfig(n):s.Node.createDefault()),e(s.Node.prototype,"free",function(){s.Node.destroy(this)}),e(s.Node.prototype,"freeRecursive",function(){for(let r=0,n=this.getChildCount();r<n;++r)this.getChild(0).freeRecursive();this.free()}),e(s.Node.prototype,"calculateLayout",function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Si.Direction.LTR;return r.call(this,n,o,a)}),{Config:s.Config,Node:s.Node,...Si.default}}var Rl={exports:{}};(function(s,e){var t=(()=>{var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(r){r=r||{};var n;n||(n=typeof r<"u"?r:{});var o,a;n.ready=new Promise(function(I,m){o=I,a=m});var A=Object.assign({},n),l="";typeof document<"u"&&document.currentScript&&(l=document.currentScript.src),i&&(l=i),l.indexOf("blob:")!==0?l=l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):l="";var c=n.print||console.log.bind(console),h=n.printErr||console.warn.bind(console);Object.assign(n,A),A=null;var u;n.wasmBinary&&(u=n.wasmBinary),n.noExitRuntime,typeof WebAssembly!="object"&&U("no native wasm support detected");var d,g=!1;function f(I,m,x){x=m+x;for(var _="";!(m>=x);){var M=I[m++];if(!M)break;if(M&128){var V=I[m++]&63;if((M&224)==192)_+=String.fromCharCode((M&31)<<6|V);else{var q=I[m++]&63;M=(M&240)==224?(M&15)<<12|V<<6|q:(M&7)<<18|V<<12|q<<6|I[m++]&63,65536>M?_+=String.fromCharCode(M):(M-=65536,_+=String.fromCharCode(55296|M>>10,56320|M&1023))}}else _+=String.fromCharCode(M)}return _}var p,y,B,Q,C,T,b,L,R;function O(){var I=d.buffer;p=I,n.HEAP8=y=new Int8Array(I),n.HEAP16=Q=new Int16Array(I),n.HEAP32=T=new Int32Array(I),n.HEAPU8=B=new Uint8Array(I),n.HEAPU16=C=new Uint16Array(I),n.HEAPU32=b=new Uint32Array(I),n.HEAPF32=L=new Float32Array(I),n.HEAPF64=R=new Float64Array(I)}var k,W=[],$=[],te=[];function Z(){var I=n.preRun.shift();W.unshift(I)}var S=0,D=null;function U(I){throw n.onAbort&&n.onAbort(I),I="Aborted("+I+")",h(I),g=!0,I=new WebAssembly.RuntimeError(I+". Build with -sASSERTIONS for more info."),a(I),I}function v(I){return I.startsWith("data:application/octet-stream;base64,")}var w;if(w="data:application/octet-stream;base64,AGFzbQEAAAABvgM4YAF/AGACf38AYAF/AX9gA39/fwBgAn98AGACf38Bf2ADf39/AX9gAABgA39/fABgAX8BfGADf399AX1gBX9/f39/AX9gAn9/AXxgAAF/YAZ/f31/fX8AYAR/f39/AX9gAn9/AX1gBn9/f39/fwF/YAV/f39/fwBgBH9/f38AYAN/fn8BfmAHf39/f39/fwBgBn9/f39/fwBgAn19AX1gAX0Bf2ABfwF9YAZ/fH9/f38Bf2ACf30AYAR/fHx/AGAIf39/f39/f38AYA1/f39/f39/f39/f39/AGAKf39/f39/f39/fwBgBX9/f39/AXxgBH9/fX0BfWAEfHx/fwF9YA5/fX1/f399fX9/f39/fwF/YAZ/f319f38AYAJ+fwF/YAR/fX1/AX1gA399fQF9YAF8AXxgBH98fHwAYAV/f319fQF9YA5/fX1/f399fX9/f39/fwBgB39/fX99f38AYA1/fX99f31/fX19fX1/AX9gBX9/fX19AGAEf39+fgBgB39/f39/f38Bf2ACfH8BfGAFf398fH8AYAN/f38BfWADf39/AXxgBH9/f3wAYAN/f30AYAZ/f31/fX8BfwKvAR0BYQFhAB0BYQFiAAMBYQFjABUBYQFkABIBYQFlAAcBYQFmAB4BYQFnAAABYQFoAB8BYQFpAAMBYQFqAAABYQFrABYBYQFsAAUBYQFtAAMBYQFuAAEBYQFvABYBYQ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IQELIAEqAgAhBCABKAIEQQFrDgIEAQYLIABB/////3txQYCAgIACar4hBCAAQYCAgIAEcUUNAwsgBCADlEMK1yM8lCEEDAILIAQhBQtDAAAAACEEAkAgACgC3AEiAEHw4YP8B0YNACAAQY+evPwHRg0CQfAhIQECQCAAQarVqv0HRwRAIAC+IgQgBFsNAUH4ISEBCyABKgIAIQQgASgCBEEBaw4CAgEECyAAQf////97cUGAgICAAmq+IQQgAEGAgICABHFFDQELIAQgA5RDCtcjPJQhBAsgBEMAAAAAYEUNAQsgAiAEXg0BCyAFQwAAAABgRQRAIAIPCyAFIAIgAiAFXRshBAsgBAsEACAAC74BAQN/IAAtAABBIHFFBEACQCABIQMCQCACIAAiASgCECIABH8gAAUgARB+DQEgASgCEAsgASgCFCIFa0sEQCABIAMgAiABKAIkEQYAGgwCCwJAIAEoAlBBAEgNACACIQADQCAAIgRFDQEgAyAEQQFrIgBqLQAAQQpHDQALIAEgAyAEIAEoAiQRBgAgBEkNASADIARqIQMgAiAEayECIAEoAhQhBQsgBSADIAIQKxogASABKAIUIAJqNgIUCwsLC20BAX8jAEGAAmsiBSQAIARBgMAEcSACIANMckUEQCAFIAFB/wFxIAIgA2siA0GAAiADQYACSSIBGxAqGiABRQRAA0AgACAFQYACECcgA0GAAmsiA0H/AUsNAAsLIAAgBSADECcLIAVBgAJqJAALzAIBBX8gAARAIABBBGsiASgCACIFIQMgASECIABBCGsoAgAiACAAQX5xIgRHBEAgASAEayICKAIEIgAgAigCCDYCCCACKAIIIAA2AgQgBCAFaiEDCyABIAVqIgQoAgAiASABIARqQQRrKAIARwRAIAQoAgQiACAEKAIINgIIIAQoAgggADYCBCABIANqIQMLIAIgAzYCACADQXxxIAJqQQRrIANBAXI2AgAgAgJ/IAIoAgBBCGsiAUH/AE0EQCABQQN2QQFrDAELIAFBHSABZyIAa3ZBBHMgAEECdGtB7gBqIAFB/x9NDQAaQT8gAUEeIABrdkECcyAAQQF0a0HHAGoiACAAQT9PGwsiAUEEdCIAQdAuajYCBCACIABB2C5qIgAoAgA2AgggACACNgIAIAIoAgggAjYCBEHYNkHYNikDAEIBIAGthoQ3AwALC/ICAgJ/AX4CQCACRQ0AIAAgAToAACAAIAJqIgNBAWsgAToAACACQQNJDQAgACABOgACIAAgAToAASADQQNrIAE6AAAgA0ECayABOgAAIAJBB0kNACAAIAE6AAMgA0EEayABOgAAIAJBCUkNACAAQQAgAGtBA3EiBGoiAyABQf8BcUGBgoQIbCIBNgIAIAMgAiAEa0F8cSIEaiICQQRrIAE2AgAgBEEJSQ0AIAMgATYCCCADIAE2AgQgAkEIayABNgIAIAJBDGsgATYCACAEQRlJDQAgAyABNgIYIAMgATYCFCADIAE2AhAgAyABNgIMIAJBEGsgATYCACACQRRrIAE2AgAgAkEYayABNgIAIAJBHGsgATYCACAEIANBBHFBGHIiBGsiAkEgSQ0AIAGtQoGAgIAQfiEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkEgayICQR9LDQALCyAAC4AEAQN/IAJBgARPBEAgACABIAIQFyAADwsgACACaiEDAkAgACABc0EDcUUEQAJAIABBA3FFBEAgACECDAELIAJFBEAgACECDAELIAAhAgNAIAIgAS0AADoAACABQQFqIQEgAkEBaiICQQNxRQ0BIAIgA0kNAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgA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CyACQQEgBGuthgwBCyACQv////////8Hg0KAgICAgICACIQLIQEgBEH/B0oEQANAAkAgAUKAgICAgICACH0iA0IAUw0AIAMiAUIAUg0AIABEAAAAAAAAAACiDwsgAUIBhiEBIARBAWsiBEH/B0oNAAtB/wchBAsCQCABQoCAgICAgIAIfSIDQgBTDQAgAyIBQgBSDQAgAEQAAAAAAAAAAKIPCyABQv////////8HWARAA0AgBEEBayEEIAFCgICAgICAgARUIQUgAUIBhiEBIAUNAAsLIAJCgICAgICAgICAf4MgAUKAgICAgICACH0gBK1CNIaEIAFBASAEa62IIARBAEobhL8LigEBA38DQCAAQQR0IgFB1C5qIAFB0C5qIgI2AgAgAUHYLmogAjYCACAAQQFqIgBBwABHDQALQTAQTxpB8DZBEDYCAEH0NkEANgIAEIQBQfQ2QaA3KAIANgIAQaA3QfA2NgIAQaQ3QcYBNgIAQag3QQA2AgAQdkGoN0GgNygCADYCAEGgN0GkNzYCAAukAwEHfyAABEAjAEEgayIGJAAgACgCACIBKAKoBCIDBEAgAyABEGsaIAFBADYCqAQLIAEoArAEIgIgASgCrAQiA0cEQEEBIAIgA2tBAnUiAiACQQFNGyEEQQAhAgNAIAMgAkECdGooAgBBADYCqAQgAkEBaiICIARHDQALCyABIAM2ArAEAkAgAyABQbQEaiICKAIARg0AIAZBCGpBAEEAIAIQQCICKAIEIAEoArAEIAEoAqwEIgRrIgVrIgMgBCAFEDYhBSABKAKsBCEEIAEgBTYCrAQgAiAENgIEIAEoArAEIQUgASACKAIINgKwBCACIAU2AgggASgCtAQhByABIAIoAgw2ArQEIAIgBDYCACACIAc2AgwgBCAFRwRAIAIgBSAEIAVrQQNqQXxxajYCCAsgBEUNACAEEEkgASgCrAQhAwsgAwRAIAEgAzYCsAQgAxBJCyABEEkgACgCCCEBIABBADYCCCABBEAgASABKAIAKAIEEQAACyAAKAIEIQEgAEEANgIEIAEEQCABIAEoAgAoAgQRAAALIAZBIGokACAAECkLC5ABAAJ/IAEEQCABKAIAEGQMAQsC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2AgAgACABKAIANgIADwsACyACIAIoAgAiAUEEajYCACAAIAEyAQA3AwAPCyACIAIoAgAiAUEEajYCACAAIAEzAQA3AwAPCyACIAIoAgAiAUEEajYCACAAIAEwAAA3AwAPCyACIAIoAgAiAUEEajYCACAAIAExAAA3AwAPCwALIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASsDADkDAA8LIAAgAiADEQEACw8LIAIgAigCACIBQQRqNgIAIAAgATQCADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATUCADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASkDADcDAAtdAQR/IAAoAgAhAgNAIAIsAAAiAxBGBEBBfyEEIAAgAkEBaiICNgIAIAFBzJmz5gBNBH9BfyADQTBrIgMgAUEKbCIEaiADIARB/////wdzShsFIAQLIQEMAQsLIAELqBQCEn8BfiMAQdAAayIIJAAgCCABNgJMIAhBN2ohFyAIQThqIRQCQAJAAkACQANAIAEhDSAHIA5B/////wdzSg0BIAcgDmohDgJAAkACQCANIgctAAAiCQRAA0ACQAJAIAlB/wFxIgFFBEAgByEBDAELIAFBJUcNASAHIQkDQCAJLQABQSVHBEAgCSEBDAILIAdBAWohByAJLQACIQogCUECaiIBIQkgCkElRg0ACwsgByANayIHIA5B/////wdzIhhKDQcgAARAIAAgDSAHECcLIAcNBiAIIAE2AkwgAUEBaiEHQX8hEgJAIAEsAAEiChBGRQ0AIAEtAAJBJEcNACABQQNqIQcgCkEwayESQQEhFQsgCCAHNgJMQQAhDAJAIAcsAAAiCUEgayIBQR9LBEAgByEKDAELIAchCkEBIAF0IgFBidEEcUUNAANAIAggB0EBaiIKNgJMIAEgDHIhDCAHLAABIglBIGsiAUEgTw0BIAohB0EBIAF0IgFBidEEcQ0ACwsCQCAJQSpGBEACfwJAIAosAAEiARBGRQ0AIAotAAJBJEcNACABQQJ0IARqQcABa0EKNgIAIApBA2ohCUEBIRUgCiwAAUEDdCADakGAA2soAgAMAQsgFQ0GIApBAWohCSAARQRAIAggCTY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AEEAOgAIIABBATYCBEHkNiAANgIAQeg2QQE6AABB4DZB4DYoAgBBAWo2AgALIAAoAgQhBAJAIAAtAAhBCHEEQCAAQQBBBUEAQbwhIAIgBBERABoMAQsgAEEAQQVBvCEgAiAEEQsAGgsgA0EQaiQAECwACyAAQwAAAAAgASABQwAAAABbGzgCFCACQRBqJAALPAAgAUEDSQRAQQEgAXQhASAAKAIAIgACfyACBEAgACgCDCABcgwBCyAAKAIMIAFBf3NxCzYCDA8LEAQAC00BAn9BBBAdIQFBHBAdIgBCgICA/AM3AhQgAEIANwIMIABBADYCACAAQQA6AAggAEEBNgIEQeA2QeA2KAIAQQFqNgIAIAEgADYCACABCxAAIABBDTYCBCAAIAE2AgALEAAgAEEKNgIEIAAgATYCAAsQACAAQQc2AgQgACABNgIACyMAIAJBBUdBACACG0UEQEGoLCADIAQQYw8LQbgtIAMgBBBjCyIBAX4gASACrSADrUIghoQgBCAAERQAIgVCIIinJAEgBacLqAEBBX8gACgCVCIDKAIAIQUgAygCBCIEIAAoAhQgACgCHCIHayIGIAQgBkkbIgYEQCAFIAcgBhArGiADIAMoAgAgBmoiBTYCACADIAMoAgQgBmsiBDYCBAsgBCACIAIgBEsbIgQEQCAFIAEgBBArGiADIAMoAgAgBGoiBTYCACADIAMoAgQgBGs2AgQLIAVBADoAACAAIAAoAiwiATYCHCAAIAE2AhQgAgsEAEIACwQAQQALigUCBn4CfyABIAEoAgBBB2pBeHEiAUEQajYCACAAIQkgASkDACEDIAEpAwghBiMAQSBrIggkAAJAIAZC////////////AIMiBEKAgICAgIDAgDx9IARCgICAgICAwP/DAH1UBEAgBkIEhiADQjyIhCEEIANC//////////8PgyIDQoGAgICAgICACFoEQCAEQoGAgICAgICAwAB8IQIMAgsgBEKAgICAgICAgEB9IQIgA0KAgICAgICAgAhSDQEgAiAEQgGDfCECDAELIANQIARCgICAgICAwP//AFQgBEKAgICAgIDA//8AURtFBEAgBkIEhiADQjyIhEL/////////A4NCgICAgICAgPz/AIQhAg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zcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRBAALOQEBfyABIAAoAgQiBEEBdWohASAAKAIAIQAgASACIAMgBEEBcQR/IAEoAgAgAGooAgAFIAALEQgACwkAIAEgABECAAsFAEGbNwsPACABIAAoAgBqIAI2AgALDQAgASAAKAIAaigCAAsYAQF/QRAQHSIAQgA3AwggAEEANgIAIAALGAEBf0EQEB0iAEIANwMAIABCADcDCCAACwwAQTAQHUEAQTAQKgs3AQF/IAEgACgCBCIDQQF1aiEBIAAoAgAhACABIAIgA0EBcQR/IAEoAgAgAGooAgAFIAALERsACwUAQZY3CyEAIAAgASgCACABIAEsAAtBAEgbQZM3IAIoAgAQDzYCAAsqAQF/QQwQHSIBQQA6AAQgASAAKAIANgIIIABBADYCACABQcgjNgIAIAELBQBBkzcLBQBBkDcLIQAgACABKAIAIAEgASwAC0EASBtB/DYgAigCABAPNgIAC9gBAQR/IwBBIGsiAyQAIAEoAgAiBEHw////B0kEQAJAAkAgBEELTwRAIARBD3JBAWoiBRAdIQYgAyAFQYCAgIB4cjYCECADIAY2AgggAyAENgIMIAQgBmohBQwBCyADIAQ6ABMgA0EIaiIGIARqIQUgBEUNAQsgBiABQQRqIAQQKxoLIAVBADoAACADIAI2AgAgA0EYaiADQQhqIAMgABEDACADKAIYEBAgAygCGCIAEAYgAygCABAGIAMsABNBAEgEQCADKAIIECkLIANBIGokACAADwsQBAALKgEBf0EMEB0iAUEAOgAEIAEgACgCADYCCCAAQQA2AgAgAUHQIjYCACABCwUAQfw2C2kBAn8jAEEQayIGJAAgASAAKAIEIgdBAXVqIQEgACgCACEAIAYgASACIAMgBCAFIAdBAXEEfyABKAIAIABqKAIABSAACxEOAEEQEB0iACAGKQMINwMIIAAgBikDADcDACAGQRBqJAAgAAsFAEH4NgubAQIBfwF9IwBBEGsiAiQAIAAoAgAhACABQQZIBEACfwJAAkACQCABQQRrDgIAAQILIABBpAJqIAAtAKwCQQN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AJAEGjKgsBFABBryoLFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABB3SoLARYAQekqCycVAAAAABUAAAAACRYAAAAAABYAABYAADAxMjM0NTY3ODlBQkNERUYAQbQrCwHVAEHcKwsI//////////8AQaAsCwnwHwEAAAAAAAUAQbQsCwHQAEHMLAsK0QAAANIAAADUGwBB5CwLAQIAQfQsCwj//////////wBBuC0LAQUAQcQtCwHTAEHcLQsO0QAAANQAAADoGwAAAAQAQfQtCwEBAEGELgsF/////woAQcguCwHW",!v(w)){var F=w;w=n.locateFile?n.locateFile(F,l):l+F}function H(){var I=w;try{if(I==w&&u)return new Uint8Array(u);if(v(I))try{var m=Dy(I.slice(37)),x=new Uint8Array(m.length);for(I=0;I<m.length;++I)x[I]=m.charCodeAt(I);var _=x}catch{throw Error("Converting base64 string to bytes failed.")}else _=void 0;var M=_;if(M)return M;throw"both async and sync fetching of the wasm failed"}catch(V){U(V)}}function K(){return u||typeof fetch!="function"?Promise.resolve().then(function(){return H()}):fetch(w,{credentials:"same-origin"}).then(function(I){if(!I.ok)throw"failed to load wasm binary file at '"+w+"'";return I.arrayBuffer()}).catch(function(){return H()})}function j(I){for(;0<I.length;)I.shift()(n)}function se(I){if(I===void 0)return"_unknown";I=I.replace(/[^a-zA-Z0-9_]/g,"$");var m=I.charCodeAt(0);return 48<=m&&57>=m?"_"+I:I}function ue(I,m){return I=se(I),function(){return m.apply(this,arguments)}}var le=[{},{value:void 0},{value:null},{value:!0},{value:!1}],Ce=[];function Se(I){var m=Error,x=ue(I,function(_){this.name=I,this.message=_,_=Error(_).stack,_!==void 0&&(this.stack=this.toString()+`
|
90
|
+
`+_.replace(/^Error(:[^\n]*)?\n/,""))});return x.prototype=Object.create(m.prototype),x.prototype.constructor=x,x.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},x}var Le=void 0;function oe(I){throw new Le(I)}var Ie=I=>(I||oe("Cannot use deleted val. handle = "+I),le[I].value),Be=I=>{switch(I){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var m=Ce.length?Ce.pop():le.length;return le[m]={fa:1,value:I},m}},ce=void 0,Ae=void 0;function ne(I){for(var m="";B[I];)m+=Ae[B[I++]];return m}var be=[];function Pe(){for(;be.length;){var I=be.pop();I.L.Z=!1,I.delete()}}var Te=void 0,ke={};function Oe(I,m){for(m===void 0&&oe("ptr should not be undefined");I.P;)m=I.aa(m),I=I.P;return m}var De={};function ve(I){I=qu(I);var m=ne(I);return Ei(I),m}function He(I,m){var x=De[I];return x===void 0&&oe(m+" has unknown type "+ve(I)),x}function We(){}var rt=!1;function Xe(I){--I.count.value,I.count.value===0&&(I.S?I.T.V(I.S):I.O.M.V(I.N))}function pt(I,m,x){return m===x?I:x.P===void 0?null:(I=pt(I,m,x.P),I===null?null:x.ma(I))}var fi={};function Et(I,m){return m=Oe(I,m),ke[m]}var ti=void 0;function ii(I){throw new ti(I)}function si(I,m){return m.O&&m.N||ii("makeClassHandle requires ptr and ptrType"),!!m.T!=!!m.S&&ii("Both smartPtrType and smartPtr must be specified"),m.count={value:1},ct(Object.create(I,{L:{value:m}}))}function ct(I){return typeof FinalizationRegistry>"u"?(ct=m=>m,I):(rt=new FinalizationRegistry(m=>{Xe(m.L)}),ct=m=>{var x=m.L;return x.S&&rt.register(m,{L:x},m),m},We=m=>{rt.unregister(m)},ct(I))}var G={};function ae(I){for(;I.length;){var m=I.pop();I.pop()(m)}}function de(I){return this.fromWireType(T[I>>2])}var we={},Qe={};function $e(I,m,x){function _(X){X=x(X),X.length!==I.length&&ii("Mismatched type converter count");for(var ie=0;ie<I.length;++ie)mt(I[ie],X[ie])}I.forEach(function(X){Qe[X]=m});var M=Array(m.length),V=[],q=0;m.forEach((X,ie)=>{De.hasOwnProperty(X)?M[ie]=De[X]:(V.push(X),we.hasOwnProperty(X)||(we[X]=[]),we[X].push(()=>{M[ie]=De[X],++q,q===V.length&&_(M)}))}),V.length===0&&_(M)}function It(I){switch(I){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+I)}}function mt(I,m,x={}){if(!("argPackAdvance"in m))throw new TypeError("registerType registeredInstance requires argPackAdvance");var _=m.name;if(I||oe('type "'+_+'" must have a positive integer typeid pointer'),De.hasOwnProperty(I)){if(x.ta)return;oe("Cannot register type '"+_+"' twice")}De[I]=m,delete Qe[I],we.hasOwnProperty(I)&&(m=we[I],delete we[I],m.forEach(M=>M()))}function Ss(I){oe(I.L.O.M.name+" instance already deleted")}function Ct(){}function rs(I,m,x){if(I[m].R===void 0){var _=I[m];I[m]=function(){return I[m].R.hasOwnProperty(arguments.length)||oe("Function '"+x+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+I[m].R+")!"),I[m].R[arguments.length].apply(this,arguments)},I[m].R=[],I[m].R[_.Y]=_}}function ws(I,m){n.hasOwnProperty(I)?(oe("Cannot register public name '"+I+"' twice"),rs(n,I,I),n.hasOwnProperty(void 0)&&oe("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),n[I].R[void 0]=m):n[I]=m}function ki(I,m,x,_,M,V,q,X){this.name=I,this.constructor=m,this.W=x,this.V=_,this.P=M,this.oa=V,this.aa=q,this.ma=X,this.ia=[]}function vr(I,m,x){for(;m!==x;)m.aa||oe("Expected null or instance of "+x.name+", got an instance of "+m.name),I=m.aa(I),m=m.P;return I}function Qr(I,m){return m===null?(this.da&&oe("null is not a valid "+this.name),0):(m.L||oe('Cannot pass "'+AA(m)+'" as a '+this.name),m.L.N||oe("Cannot pass deleted object as a pointer of type "+this.name),vr(m.L.N,m.L.O.M,this.M))}function Ts(I,m){if(m===null){if(this.da&&oe("null is not a valid "+this.name),this.ca){var x=this.ea();return I!==null&&I.push(this.V,x),x}return 0}if(m.L||oe('Cannot pass "'+AA(m)+'" as a '+this.name),m.L.N||oe("Cannot pass deleted object as a pointer of type "+this.name),!this.ba&&m.L.O.ba&&oe("Cannot convert argument of type "+(m.L.T?m.L.T.name:m.L.O.name)+" to parameter type "+this.name),x=vr(m.L.N,m.L.O.M,this.M),this.ca)switch(m.L.S===void 0&&oe("Passing raw pointer to smart pointer is illegal"),this.Aa){case 0:m.L.T===this?x=m.L.S:oe("Cannot convert argument of type "+(m.L.T?m.L.T.name:m.L.O.name)+" to parameter type "+this.name);break;case 1:x=m.L.S;break;case 2:if(m.L.T===this)x=m.L.S;else{var _=m.clone();x=this.wa(x,Be(function(){_.delete()})),I!==null&&I.push(this.V,x)}break;default:oe("Unsupporting sharing policy")}return x}function fy(I,m){return m===null?(this.da&&oe("null is not a valid "+this.name),0):(m.L||oe('Cannot pass "'+AA(m)+'" as a '+this.name),m.L.N||oe("Cannot pass deleted object as a pointer of type "+this.name),m.L.O.ba&&oe("Cannot convert argument of type "+m.L.O.name+" to parameter type "+this.name),vr(m.L.N,m.L.O.M,this.M))}function pi(I,m,x,_){this.name=I,this.M=m,this.da=x,this.ba=_,this.ca=!1,this.V=this.wa=this.ea=this.ja=this.Aa=this.va=void 0,m.P!==void 0?this.toWireType=Ts:(this.toWireType=_?Qr:fy,this.U=null)}function py(I,m){n.hasOwnProperty(I)||ii("Replacing nonexistant public symbol"),n[I]=m,n[I].Y=void 0}function Ey(I,m){var x=[];return function(){if(x.length=0,Object.assign(x,arguments),I.includes("j")){var _=n["dynCall_"+I];_=x&&x.length?_.apply(null,[m].concat(x)):_.call(null,m)}else _=k.get(m).apply(null,x);return _}}function Ht(I,m){I=ne(I);var x=I.includes("j")?Ey(I,m):k.get(m);return typeof x!="function"&&oe("unknown function pointer with signature "+I+": "+m),x}var Ku=void 0;function Pn(I,m){function x(V){M[V]||De[V]||(Qe[V]?Qe[V].forEach(x):(_.push(V),M[V]=!0))}var _=[],M={};throw m.forEach(x),new Ku(I+": "+_.map(ve).join([", "]))}function nA(I,m,x,_,M){var V=m.length;2>V&&oe("argTypes array size mismatch! Must at least get return value and 'this' types!");var q=m[1]!==null&&x!==null,X=!1;for(x=1;x<m.length;++x)if(m[x]!==null&&m[x].U===void 0){X=!0;break}var ie=m[0].name!=="void",ee=V-2,re=Array(ee),fe=[],_e=[];return function(){if(arguments.length!==ee&&oe("function "+I+" called with "+arguments.length+" arguments, expected "+ee+" args!"),_e.length=0,fe.length=q?2:1,fe[0]=M,q){var ze=m[1].toWireType(_e,this);fe[1]=ze}for(var Fe=0;Fe<ee;++Fe)re[Fe]=m[Fe+2].toWireType(_e,arguments[Fe]),fe.push(re[Fe]);if(Fe=_.apply(null,fe),X)ae(_e);else for(var Rt=q?1:2;Rt<m.length;Rt++){var $t=Rt===1?ze:re[Rt-2];m[Rt].U!==null&&m[Rt].U($t)}return ze=ie?m[0].fromWireType(Fe):void 0,ze}}function oA(I,m){for(var x=[],_=0;_<I;_++)x.push(b[m+4*_>>2]);return x}function aA(I){4<I&&--le[I].fa===0&&(le[I]=void 0,Ce.push(I))}function AA(I){if(I===null)return"null";var m=typeof I;return m==="object"||m==="array"||m==="function"?I.toString():""+I}function Iy(I,m){switch(m){case 2:return function(x){return this.fromWireType(L[x>>2])};case 3:return function(x){return this.fromWireType(R[x>>3])};default:throw new TypeError("Unknown float type: "+I)}}function my(I,m,x){switch(m){case 0:return x?function(_){return y[_]}:function(_){return B[_]};case 1:return x?function(_){return Q[_>>1]}:function(_){return C[_>>1]};case 2:return x?function(_){return T[_>>2]}:function(_){return b[_>>2]};default:throw new TypeError("Unknown integer type: "+I)}}function Cy(I,m){for(var x="",_=0;!(_>=m/2);++_){var M=Q[I+2*_>>1];if(M==0)break;x+=String.fromCharCode(M)}return x}function yy(I,m,x){if(x===void 0&&(x=2147483647),2>x)return 0;x-=2;var _=m;x=x<2*I.length?x/2:I.length;for(var M=0;M<x;++M)Q[m>>1]=I.charCodeAt(M),m+=2;return Q[m>>1]=0,m-_}function By(I){return 2*I.length}function vy(I,m){for(var x=0,_="";!(x>=m/4);){var M=T[I+4*x>>2];if(M==0)break;++x,65536<=M?(M-=65536,_+=String.fromCharCode(55296|M>>10,56320|M&1023)):_+=String.fromCharCode(M)}return _}function Qy(I,m,x){if(x===void 0&&(x=2147483647),4>x)return 0;var _=m;x=_+x-4;for(var M=0;M<I.length;++M){var V=I.charCodeAt(M);if(55296<=V&&57343>=V){var q=I.charCodeAt(++M);V=65536+((V&1023)<<10)|q&1023}if(T[m>>2]=V,m+=4,m+4>x)break}return T[m>>2]=0,m-_}function by(I){for(var m=0,x=0;x<I.length;++x){var _=I.charCodeAt(x);55296<=_&&57343>=_&&++x,m+=4}return m}var Sy={};function Vu(I){var m=Sy[I];return m===void 0?ne(I):m}var On=[];function wy(I){var m=On.length;return On.push(I),m}function Ty(I,m){for(var x=Array(I),_=0;_<I;++_)x[_]=He(b[m+4*_>>2],"parameter "+_);return x}var Ju=[],xy=[null,[],[]];Le=n.BindingError=Se("BindingError"),n.count_emval_handles=function(){for(var I=0,m=5;m<le.length;++m)le[m]!==void 0&&++I;return I},n.get_first_emval=function(){for(var I=5;I<le.length;++I)if(le[I]!==void 0)return le[I];return null},ce=n.PureVirtualError=Se("PureVirtualError");for(var Wu=Array(256),Un=0;256>Un;++Un)Wu[Un]=String.fromCharCode(Un);Ae=Wu,n.getInheritedInstanceCount=function(){return Object.keys(ke).length},n.getLiveInheritedInstances=function(){var I=[],m;for(m in ke)ke.hasOwnProperty(m)&&I.push(ke[m]);return I},n.flushPendingDeletes=Pe,n.setDelayFunction=function(I){Te=I,be.length&&Te&&Te(Pe)},ti=n.InternalError=Se("InternalError"),Ct.prototype.isAliasOf=function(I){if(!(this instanceof Ct&&I instanceof Ct))return!1;var m=this.L.O.M,x=this.L.N,_=I.L.O.M;for(I=I.L.N;m.P;)x=m.aa(x),m=m.P;for(;_.P;)I=_.aa(I),_=_.P;return m===_&&x===I},Ct.prototype.clone=function(){if(this.L.N||Ss(this),this.L.$)return this.L.count.value+=1,this;var I=ct,m=Object,x=m.create,_=Object.getPrototypeOf(this),M=this.L;return I=I(x.call(m,_,{L:{value:{count:M.count,Z:M.Z,$:M.$,N:M.N,O:M.O,S:M.S,T:M.T}}})),I.L.count.value+=1,I.L.Z=!1,I},Ct.prototype.delete=function(){this.L.N||Ss(this),this.L.Z&&!this.L.$&&oe("Object already scheduled for deletion"),We(this),Xe(this.L),this.L.$||(this.L.S=void 0,this.L.N=void 0)},Ct.prototype.isDeleted=function(){return!this.L.N},Ct.prototype.deleteLater=function(){return this.L.N||Ss(this),this.L.Z&&!this.L.$&&oe("Object already scheduled for deletion"),be.push(this),be.length===1&&Te&&Te(Pe),this.L.Z=!0,this},pi.prototype.pa=function(I){return this.ja&&(I=this.ja(I)),I},pi.prototype.ga=function(I){this.V&&this.V(I)},pi.prototype.argPackAdvance=8,pi.prototype.readValueFromPointer=de,pi.prototype.deleteObject=function(I){I!==null&&I.delete()},pi.prototype.fromWireType=function(I){function m(){return this.ca?si(this.M.W,{O:this.va,N:x,T:this,S:I}):si(this.M.W,{O:this,N:I})}var x=this.pa(I);if(!x)return this.ga(I),null;var _=Et(this.M,x);if(_!==void 0)return _.L.count.value===0?(_.L.N=x,_.L.S=I,_.clone()):(_=_.clone(),this.ga(I),_);if(_=this.M.oa(x),_=fi[_],!_)return m.call(this);_=this.ba?_.ka:_.pointerType;var M=pt(x,this.M,_.M);return M===null?m.call(this):this.ca?si(_.M.W,{O:_,N:M,T:this,S:I}):si(_.M.W,{O:_,N:M})},Ku=n.UnboundTypeError=Se("UnboundTypeError");var Dy=typeof atob=="function"?atob:function(I){var m="",x=0;I=I.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(I.charAt(x++)),M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(I.charAt(x++)),V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(I.charAt(x++)),q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(I.charAt(x++));_=_<<2|M>>4,M=(M&15)<<4|V>>2;var X=(V&3)<<6|q;m+=String.fromCharCode(_),V!==64&&(m+=String.fromCharCode(M)),q!==64&&(m+=String.fromCharCode(X))}while(x<I.length);return m},Ry={p:function(I,m,x){I=ne(I),m=He(m,"wrapper"),x=Ie(x);var _=[].slice,M=m.M,V=M.W,q=M.P.W,X=M.P.constructor;I=ue(I,function(){M.P.ia.forEach((function(ee){if(this[ee]===q[ee])throw new ce("Pure virtual function "+ee+" must be implemented in JavaScript")}).bind(this)),Object.defineProperty(this,"__parent",{value:V}),this.__construct.apply(this,_.call(arguments))}),V.__construct=function(){this===V&&oe("Pass correct 'this' to __construct");var ee=X.implement.apply(void 0,[this].concat(_.call(arguments)));We(ee);var re=ee.L;ee.notifyOnDestruction(),re.$=!0,Object.defineProperties(this,{L:{value:re}}),ct(this),ee=re.N,ee=Oe(M,ee),ke.hasOwnProperty(ee)?oe("Tried to register registered instance: "+ee):ke[ee]=this},V.__destruct=function(){this===V&&oe("Pass correct 'this' to __destruct"),We(this);var ee=this.L.N;ee=Oe(M,ee),ke.hasOwnProperty(ee)?delete ke[ee]:oe("Tried to unregister unregistered instance: "+ee)},I.prototype=Object.create(V);for(var ie in x)I.prototype[ie]=x[ie];return Be(I)},j:function(I){var m=G[I];delete G[I];var x=m.ea,_=m.V,M=m.ha,V=M.map(q=>q.sa).concat(M.map(q=>q.ya));$e([I],V,q=>{var X={};return M.forEach((ie,ee)=>{var re=q[ee],fe=ie.qa,_e=ie.ra,ze=q[ee+M.length],Fe=ie.xa,Rt=ie.za;X[ie.na]={read:$t=>re.fromWireType(fe(_e,$t)),write:($t,br)=>{var Ii=[];Fe(Rt,$t,ze.toWireType(Ii,br)),ae(Ii)}}}),[{name:m.name,fromWireType:function(ie){var ee={},re;for(re in X)ee[re]=X[re].read(ie);return _(ie),ee},toWireType:function(ie,ee){for(var re in X)if(!(re in ee))throw new TypeError('Missing field: "'+re+'"');var fe=x();for(re in X)X[re].write(fe,ee[re]);return ie!==null&&ie.push(_,fe),fe},argPackAdvance:8,readValueFromPointer:de,U:_}]})},v:function(){},B:function(I,m,x,_,M){var V=It(x);m=ne(m),mt(I,{name:m,fromWireType:function(q){return!!q},toWireType:function(q,X){return X?_:M},argPackAdvance:8,readValueFromPointer:function(q){if(x===1)var X=y;else if(x===2)X=Q;else if(x===4)X=T;else throw new TypeError("Unknown boolean type size: "+m);return this.fromWireType(X[q>>V])},U:null})},f:function(I,m,x,_,M,V,q,X,ie,ee,re,fe,_e){re=ne(re),V=Ht(M,V),X&&(X=Ht(q,X)),ee&&(ee=Ht(ie,ee)),_e=Ht(fe,_e);var ze=se(re);ws(ze,function(){Pn("Cannot construct "+re+" due to unbound types",[_])}),$e([I,m,x],_?[_]:[],function(Fe){if(Fe=Fe[0],_)var Rt=Fe.M,$t=Rt.W;else $t=Ct.prototype;Fe=ue(ze,function(){if(Object.getPrototypeOf(this)!==br)throw new Le("Use 'new' to construct "+re);if(Ii.X===void 0)throw new Le(re+" has no accessible constructor");var zu=Ii.X[arguments.length];if(zu===void 0)throw new Le("Tried to invoke ctor of "+re+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(Ii.X).toString()+") parameters instead!");return zu.apply(this,arguments)});var br=Object.create($t,{constructor:{value:Fe}});Fe.prototype=br;var Ii=new ki(re,Fe,br,_e,Rt,V,X,ee);Rt=new pi(re,Ii,!0,!1),$t=new pi(re+"*",Ii,!1,!1);var Xu=new pi(re+" const*",Ii,!1,!0);return fi[I]={pointerType:$t,ka:Xu},py(ze,Fe),[Rt,$t,Xu]})},c:function(I,m,x,_,M,V,q){var X=oA(x,_);m=ne(m),V=Ht(M,V),$e([],[I],function(ie){function ee(){Pn("Cannot call "+re+" due to unbound types",X)}ie=ie[0];var re=ie.name+"."+m;m.startsWith("@@")&&(m=Symbol[m.substring(2)]);var fe=ie.M.constructor;return fe[m]===void 0?(ee.Y=x-1,fe[m]=ee):(rs(fe,m,re),fe[m].R[x-1]=ee),$e([],X,function(_e){return _e=nA(re,[_e[0],null].concat(_e.slice(1)),null,V,q),fe[m].R===void 0?(_e.Y=x-1,fe[m]=_e):fe[m].R[x-1]=_e,[]}),[]})},o:function(I,m,x,_,M,V){0<m||U();var q=oA(m,x);M=Ht(_,M),$e([],[I],function(X){X=X[0];var ie="constructor "+X.name;if(X.M.X===void 0&&(X.M.X=[]),X.M.X[m-1]!==void 0)throw new Le("Cannot register multiple constructors with identical number of parameters ("+(m-1)+") for class '"+X.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return X.M.X[m-1]=()=>{Pn("Cannot construct "+X.name+" due to unbound types",q)},$e([],q,function(ee){return ee.splice(1,0,null),X.M.X[m-1]=nA(ie,ee,null,M,V),[]}),[]})},a:function(I,m,x,_,M,V,q,X){var ie=oA(x,_);m=ne(m),V=Ht(M,V),$e([],[I],function(ee){function re(){Pn("Cannot call "+fe+" due to unbound types",ie)}ee=ee[0];var fe=ee.name+"."+m;m.startsWith("@@")&&(m=Symbol[m.substring(2)]),X&&ee.M.ia.push(m);var _e=ee.M.W,ze=_e[m];return ze===void 0||ze.R===void 0&&ze.className!==ee.name&&ze.Y===x-2?(re.Y=x-2,re.className=ee.name,_e[m]=re):(rs(_e,m,fe),_e[m].R[x-2]=re),$e([],ie,function(Fe){return Fe=nA(fe,Fe,ee,V,q),_e[m].R===void 0?(Fe.Y=x-2,_e[m]=Fe):_e[m].R[x-2]=Fe,[]}),[]})},A:function(I,m){m=ne(m),mt(I,{name:m,fromWireType:function(x){var _=Ie(x);return aA(x),_},toWireType:function(x,_){return Be(_)},argPackAdvance:8,readValueFromPointer:de,U:null})},m:function(I,m,x){x=It(x),m=ne(m),mt(I,{name:m,fromWireType:function(_){return _},toWireType:function(_,M){return M},argPackAdvance:8,readValueFromPointer:Iy(m,x),U:null})},d:function(I,m,x,_,M){m=ne(m),M===-1&&(M=4294967295),M=It(x);var V=X=>X;if(_===0){var q=32-8*x;V=X=>X<<q>>>q}x=m.includes("unsigned")?function(X,ie){return ie>>>0}:function(X,ie){return ie},mt(I,{name:m,fromWireType:V,toWireType:x,argPackAdvance:8,readValueFromPointer:my(m,M,_!==0),U:null})},b:function(I,m,x){function _(V){V>>=2;var q=b;return new M(p,q[V+1],q[V])}var M=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][m];x=ne(x),mt(I,{name:x,fromWireType:_,argPackAdvance:8,readValueFromPointer:_},{ta:!0})},n:function(I,m){m=ne(m);var x=m==="std::string";mt(I,{name:m,fromWireType:function(_){var M=b[_>>2],V=_+4;if(x)for(var q=V,X=0;X<=M;++X){var ie=V+X;if(X==M||B[ie]==0){if(q=q?f(B,q,ie-q):"",ee===void 0)var ee=q;else ee+=String.fromCharCode(0),ee+=q;q=ie+1}}else{for(ee=Array(M),X=0;X<M;++X)ee[X]=String.fromCharCode(B[V+X]);ee=ee.join("")}return Ei(_),ee},toWireType:function(_,M){M instanceof ArrayBuffer&&(M=new Uint8Array(M));var V,q=typeof M=="string";if(q||M instanceof Uint8Array||M instanceof Uint8ClampedArray||M instanceof Int8Array||oe("Cannot pass non-string to std::string"),x&&q){var X=0;for(V=0;V<M.length;++V){var ie=M.charCodeAt(V);127>=ie?X++:2047>=ie?X+=2:55296<=ie&&57343>=ie?(X+=4,++V):X+=3}V=X}else V=M.length;if(X=lA(4+V+1),ie=X+4,b[X>>2]=V,x&&q){if(q=ie,ie=V+1,V=B,0<ie){ie=q+ie-1;for(var ee=0;ee<M.length;++ee){var re=M.charCodeAt(ee);if(55296<=re&&57343>=re){var fe=M.charCodeAt(++ee);re=65536+((re&1023)<<10)|fe&1023}if(127>=re){if(q>=ie)break;V[q++]=re}else{if(2047>=re){if(q+1>=ie)break;V[q++]=192|re>>6}else{if(65535>=re){if(q+2>=ie)break;V[q++]=224|re>>12}else{if(q+3>=ie)break;V[q++]=240|re>>18,V[q++]=128|re>>12&63}V[q++]=128|re>>6&63}V[q++]=128|re&63}}V[q]=0}}else if(q)for(q=0;q<V;++q)ee=M.charCodeAt(q),255<ee&&(Ei(ie),oe("String has UTF-16 code units that do not fit in 8 bits")),B[ie+q]=ee;else for(q=0;q<V;++q)B[ie+q]=M[q];return _!==null&&_.push(Ei,X),X},argPackAdvance:8,readValueFromPointer:de,U:function(_){Ei(_)}})},i:function(I,m,x){if(x=ne(x),m===2)var _=Cy,M=yy,V=By,q=()=>C,X=1;else m===4&&(_=vy,M=Qy,V=by,q=()=>b,X=2);mt(I,{name:x,fromWireType:function(ie){for(var ee=b[ie>>2],re=q(),fe,_e=ie+4,ze=0;ze<=ee;++ze){var Fe=ie+4+ze*m;(ze==ee||re[Fe>>X]==0)&&(_e=_(_e,Fe-_e),fe===void 0?fe=_e:(fe+=String.fromCharCode(0),fe+=_e),_e=Fe+m)}return Ei(ie),fe},toWireType:function(ie,ee){typeof ee!="string"&&oe("Cannot pass non-string to C++ string type "+x);var re=V(ee),fe=lA(4+re+m);return b[fe>>2]=re>>X,M(ee,fe+4,re+m),ie!==null&&ie.push(Ei,fe),fe},argPackAdvance:8,readValueFromPointer:de,U:function(ie){Ei(ie)}})},k:function(I,m,x,_,M,V){G[I]={name:ne(m),ea:Ht(x,_),V:Ht(M,V),ha:[]}},h:function(I,m,x,_,M,V,q,X,ie,ee){G[I].ha.push({na:ne(m),sa:x,qa:Ht(_,M),ra:V,ya:q,xa:Ht(X,ie),za:ee})},C:function(I,m){m=ne(m),mt(I,{ua:!0,name:m,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},s:function(I,m,x,_,M){I=On[I],m=Ie(m),x=Vu(x);var V=[];return b[_>>2]=Be(V),I(m,x,V,M)},t:function(I,m,x,_){I=On[I],m=Ie(m),x=Vu(x),I(m,x,null,_)},g:aA,l:function(I,m){var x=Ty(I,m),_=x[0];m=_.name+"_$"+x.slice(1).map(function(q){return q.name}).join("_")+"$";var M=Ju[m];if(M!==void 0)return M;var V=Array(I-1);return M=wy((q,X,ie,ee)=>{for(var re=0,fe=0;fe<I-1;++fe)V[fe]=x[fe+1].readValueFromPointer(ee+re),re+=x[fe+1].argPackAdvance;for(q=q[X].apply(q,V),fe=0;fe<I-1;++fe)x[fe+1].la&&x[fe+1].la(V[fe]);if(!_.ua)return _.toWireType(ie,q)}),Ju[m]=M},q:function(I){4<I&&(le[I].fa+=1)},r:function(I){var m=Ie(I);ae(m),aA(I)},e:function(){U("")},x:function(I,m,x){B.copyWithin(I,m,m+x)},w:function(I){var m=B.length;if(I>>>=0,2147483648<I)return!1;for(var x=1;4>=x;x*=2){var _=m*(1+.2/x);_=Math.min(_,I+100663296);var M=Math;_=Math.max(I,_),M=M.min.call(M,2147483648,_+(65536-_%65536)%65536);e:{try{d.grow(M-p.byteLength+65535>>>16),O();var V=1;break e}catch{}V=void 0}if(V)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(I,m,x,_){for(var M=0,V=0;V<x;V++){var q=b[m>>2],X=b[m+4>>2];m+=8;for(var ie=0;ie<X;ie++){var ee=B[q+ie],re=xy[I];ee===0||ee===10?((I===1?c:h)(f(re,0)),re.length=0):re.push(ee)}M+=X}return b[_>>2]=M,0}};(function(){function I(M){n.asm=M.exports,d=n.asm.D,O(),k=n.asm.I,$.unshift(n.asm.E),S--,n.monitorRunDependencies&&n.monitorRunDependencies(S),S==0&&D&&(M=D,D=null,M())}function m(M){I(M.instance)}function x(M){return K().then(function(V){return WebAssembly.instantiate(V,_)}).then(function(V){return V}).then(M,function(V){h("failed to asynchronously prepare wasm: "+V),U(V)})}var _={a:Ry};if(S++,n.monitorRunDependencies&&n.monitorRunDependencies(S),n.instantiateWasm)try{return n.instantiateWasm(_,I)}catch(M){h("Module.instantiateWasm callback failed with error: "+M),a(M)}return function(){return u||typeof WebAssembly.instantiateStreaming!="function"||v(w)||typeof fetch!="function"?x(m):fetch(w,{credentials:"same-origin"}).then(function(M){return WebAssembly.instantiateStreaming(M,_).then(m,function(V){return h("wasm streaming compile failed: "+V),h("falling back to ArrayBuffer instantiation"),x(m)})})}().catch(a),{}})(),n.___wasm_call_ctors=function(){return(n.___wasm_call_ctors=n.asm.E).apply(null,arguments)};var qu=n.___getTypeName=function(){return(qu=n.___getTypeName=n.asm.F).apply(null,arguments)};n.__embind_initialize_bindings=function(){return(n.__embind_initialize_bindings=n.asm.G).apply(null,arguments)};var lA=n._malloc=function(){return(lA=n._malloc=n.asm.H).apply(null,arguments)},Ei=n._free=function(){return(Ei=n._free=n.asm.J).apply(null,arguments)};n.dynCall_jiji=function(){return(n.dynCall_jiji=n.asm.K).apply(null,arguments)};var Gn;D=function I(){Gn||ju(),Gn||(D=I)};function ju(){function I(){if(!Gn&&(Gn=!0,n.calledRun=!0,!g)){if(j($),o(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;){var m=n.postRun.shift();te.unshift(m)}j(te)}}if(!(0<S)){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)Z();j(W),0<S||(n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),I()},1)):I())}}if(n.preInit)for(typeof n.preInit=="function"&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();return ju(),r.ready}})();s.exports=t})(Rl);var yf=Rl.exports;(function(s){Object.defineProperty(s,"__esModule",{value:!0});var e={loadYoga:!0};s.loadYoga=o;var t=r(Qo),i=ye;Object.keys(i).forEach(function(a){a==="default"||a==="__esModule"||Object.prototype.hasOwnProperty.call(e,a)||a in s&&s[a]===i[a]||Object.defineProperty(s,a,{enumerable:!0,get:function(){return i[a]}})});function r(a){return a&&a.__esModule?a:{default:a}}const n=yf;async function o(){return(0,t.default)(await n())}})(xl);function To({canvas:s,scenes:e,currentTime:t}){if(e&&s){const i=e.scenes.filter(({start:n,duration:o})=>t>=n&&t<=n+o);if(i.length<=0)return;const r=s.getContext("2d");if(r){const n=e.transitionDuration,o=Math.max(...e.scenes.map(({start:a,duration:A})=>a+A));r.globalCompositeOperation="lighter",r.clearRect(0,0,s.width,s.height),i.forEach(({start:a,duration:A,draw:l,transitionCanvas:c})=>{if(r.globalAlpha=1,c.width=c.height=0,c.width=s.width,c.height=s.height,c.getContext("2d")){const u=a+A,d=a===0,g=u===o;l({currentTime:t,canvas:c}),!d&&t>=a&&t<=a+n?r.globalAlpha=Math.max(0,Math.min(1,(t-a)/n)):!g&&t>=u-n&&t<=u&&(r.globalAlpha=Math.max(0,Math.min(1,(u-t)/n))),r.drawImage(c,0,0,s.width,s.height)}})}}}function Bf(s){if(typeof s=="string"){const[e,t]=s.split(":");return Math.min(parseFloat(e),parseFloat(t))}return s}function vf(s){if(typeof s=="string"){const[e,t]=s.split(":"),i=parseFloat(e),r=parseFloat(t);return i/r}return s}function xo({resolution:s,aspectRatio:e}){const t=Bf(s),i=vf(e),r=i>=1,n=Math.min(r?t*i:t/i,t),o=Math.max(r?t*i:t/i,t);return{resolution:t,aspectRatio:i,height:r?n:o,width:r?o:n}}function Qf({format:s,resolution:e,aspectRatio:t,sourceWidth:i,sourceHeight:r}){const{width:n,height:o}=xo({resolution:e,aspectRatio:t}),a=i/r,A=t>a;let l=1;if(s==="letterbox"||s==="letterbox-video")l=A?o/r:n/i;else if(s==="squarebox"){const g=Math.min(o,n);l=i>=r?g/r:g/i}else s==="crop"&&(l=A?n/i:o/r);const c=n/l,h=o/l,u=(i-c)/2,d=(r-h)/2;return{sx:u,sy:d,sWidth:c,sHeight:h,scale:l}}function er({source:s,sx:e,sy:t,sw:i,sh:r,dx:n,dy:o,dw:a,dh:A}){const l=(s==null?void 0:s.naturalWidth)??(s==null?void 0:s.videoWidth)??(s==null?void 0:s.width),c=(s==null?void 0:s.naturalHeight)??(s==null?void 0:s.videoHeight)??(s==null?void 0:s.height);e=e??0,t=t??0,i=i??l,r=r??c,i<0&&(e+=i,i=Math.abs(i)),r<0&&(t+=r,r=Math.abs(r)),a<0&&(n+=a,a=Math.abs(a)),A<0&&(o+=A,A=Math.abs(A));const h=Math.max(e,0),u=Math.min(e+i,l),d=Math.max(t,0),g=Math.min(t+r,c),f=a/i,p=A/r;return[s,h,d,u-h,g-d,e<0?n-e*f:n,t<0?o-t*p:o,(u-h)*f,(g-d)*p]}function Ll({context:s,source:e,crop:t,format:i="letterbox",posX:r,posY:n,drawAreaWidth:o,drawAreaHeight:a,sourceWidth:A,sourceHeight:l,cropCanvas:c,letterboxCanvas:h}){const{x:u,y:d,width:g,height:f}=t??{},p=A*(u??0),y=l*(d??0),B=A*Math.min(1-(u??0),g??1),Q=l*Math.min(1-(d??0),f??1),C=c.getContext("2d");if(C){c.width=B,c.height=Q;const D=er({source:e,sx:p,sy:y,sw:B,sh:Q,dx:0,dy:0,dw:B,dh:Q});C.drawImage(...D)}const T=B/Q,{sx:b,sy:L,sWidth:R,sHeight:O,scale:k}=Qf({resolution:Math.min(o,a),aspectRatio:o/a,format:i,sourceWidth:B,sourceHeight:Q}),W=c&&typeof s.filter<"u";if(i==="letterbox"||i==="squarebox"||i==="letterbox-video"&&!W){if(b<0){const D=Math.abs(b)*k;s.fillStyle="black",s.beginPath(),s.rect(r,n,D,a),s.rect(r+o-D,n,D,a),s.fill(),s.closePath()}if(L<0){const D=Math.abs(L)*k;s.fillStyle="black",s.beginPath(),s.rect(r,n,o,D),s.rect(r,n+a-D,o,D),s.fill(),s.closePath()}}if(i==="letterbox-video"&&W){const D=h.getContext("2d");if(D){h.width=B,h.height=Q,s.save(),s.globalCompositeOperation="destination-out",s.fillRect(r,n,o,a);const U=er({source:c,sx:b,sy:L,sw:R,sh:O,dx:r,dy:n,dw:o,dh:a});s.globalCompositeOperation="source-over",s.drawImage(...U),D.save();const v=1.2,w=-(B*v-B)/2,F=-(Q*v-Q)/2,H=Math.min(B/20,Q/20);if(D.filter=`blur(${H}px) brightness(20%)`,D.translate(w,F),D.scale(v,v),D.drawImage(c,0,0,B,Q),D.restore(),s.globalCompositeOperation="destination-over",b<0){const K=o/T,j=a/K,se=er({source:h,sy:(1-j)*Q/2,sh:j*Q,dx:r,dy:n,dw:o,dh:a});s.drawImage(...se)}if(L<0){const K=a*T,j=o/K,se=er({source:h,sx:(1-j)*B/2,sw:j*B,dx:r,dy:n,dw:o,dh:a});s.drawImage(...se)}s.restore()}}else{const D=er({source:c,sx:b,sy:L,sw:R,sh:O,dx:r,dy:n,dw:o,dh:a});s.drawImage(...D)}const $=b*-1*k,te=L*-1*k,Z=o-$*2,S=a-te*2;return{dx:$,dy:te,dw:Z,dh:S}}function _l({context:s,word:e,maxW:t=1/0}){const i=[],r=s.measureText(e);if(r.width<t)return[{text:e,metrics:r}];for(let n=0;n<e.length;n++){const o=i[i.length-1],a=((o==null?void 0:o.text)??"")+e[n],A=s.measureText(a);A.width<t?i[o?i.length-1:0]={text:a,metrics:A}:i.push({text:e[n],metrics:s.measureText(e[n])})}return i}const kl=co(({font:s,scale:e,context:t,maxW:i,maxH:r,text:n,minSize:o,maxSize:a})=>{var A,l;let c=0;if(a){c=(o??0)*e;let u=0;for(;a*e>c+1;){c+=1;const d=tn({context:t,font:s,fontSize:c,text:n,maxW:i});if(u=d.reduce((g,f)=>(f.metrics.width>g&&(g=f.metrics.width),g),0),u>i||d.length*c>r){c-=1;break}}}else c=parseFloat(((l=(A=s.match(en))==null?void 0:A.groups)==null?void 0:l.value)??"0")*e;return c},{cacheKey:([{font:s,text:e,minSize:t,maxSize:i,scale:r,maxW:n,maxH:o}])=>`${s}_${e}_${t}_${i}_${r}_${n}_${o}`});function bf(s,e){return typeof s=="number"?{top:s*e,right:s*e,bottom:s*e,left:s*e}:{top:typeof s.top=="number"?s.top*e:s.top,right:typeof s.right=="number"?s.right*e:s.right,bottom:typeof s.bottom=="number"?s.bottom*e:s.bottom,left:typeof s.left=="number"?s.left*e:s.left}}function Nl(s,e){return typeof s=="number"?{top:s*e,right:s*e,bottom:s*e,left:s*e}:{top:(typeof s.top=="number"?s.top*e:s.top)??0,right:(typeof s.right=="number"?s.right*e:s.right)??0,bottom:(typeof s.bottom=="number"?s.bottom*e:s.bottom)??0,left:(typeof s.left=="number"?s.left*e:s.left)??0}}function Fl(s,e,{layout:t,scale:i=1}){const{position:r="static",inset:n,width:o,height:a,minWidth:A,minHeight:l,maxWidth:c,maxHeight:h,flex:u,gap:d,margin:g,padding:f,direction:p="column",align:y="start",alignSelf:B,justify:Q="start"}=t,C={static:s.POSITION_TYPE_STATIC,relative:s.POSITION_TYPE_RELATIVE,absolute:s.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(C[r]),n){const{top:R,right:O,bottom:k,left:W}=bf(n,i);R&&e.setPosition(s.EDGE_TOP,R),O&&e.setPosition(s.EDGE_RIGHT,O),k&&e.setPosition(s.EDGE_BOTTOM,k),W&&e.setPosition(s.EDGE_LEFT,W)}const T={row:s.FLEX_DIRECTION_ROW,column:s.FLEX_DIRECTION_COLUMN,"row-reverse":s.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":s.FLEX_DIRECTION_COLUMN_REVERSE};e.setFlexDirection(T[p]);const b={start:s.ALIGN_FLEX_START,end:s.ALIGN_FLEX_END,center:s.ALIGN_CENTER,stretch:s.ALIGN_STRETCH};e.setAlignItems(b[y]),B&&e.setAlignSelf(b[B]);const L={start:s.JUSTIFY_FLEX_START,end:s.JUSTIFY_FLEX_END,center:s.JUSTIFY_CENTER,"space-between":s.JUSTIFY_SPACE_BETWEEN,"space-around":s.JUSTIFY_SPACE_AROUND,"space-evenly":s.JUSTIFY_SPACE_EVENLY};if(e.setJustifyContent(L[Q]),g){const{top:R,right:O,bottom:k,left:W}=Nl(g,i);e.setMargin(s.EDGE_TOP,R),e.setMargin(s.EDGE_RIGHT,O),e.setMargin(s.EDGE_BOTTOM,k),e.setMargin(s.EDGE_LEFT,W)}if(f){const{top:R,right:O,bottom:k,left:W}=Nl(f,i);e.setPadding(s.EDGE_TOP,R),e.setPadding(s.EDGE_RIGHT,O),e.setPadding(s.EDGE_BOTTOM,k),e.setPadding(s.EDGE_LEFT,W)}u&&e.setFlex(u),e.setGap(s.GUTTER_ALL,(d??0)*i),o&&e.setWidth(typeof o=="number"?o*i:o),a&&(typeof a=="function"?e.setHeight("100%"):e.setHeight(typeof a=="number"?a*i:a)),A&&e.setMinWidth(typeof A=="number"?A*i:A),l&&e.setMinHeight(typeof l=="number"?l*i:l),c&&e.setMaxWidth(typeof c=="number"?c*i:c),h&&e.setMaxHeight(typeof h=="number"?h*i:h)}function Ml({canvas:s,debug:e=!1,scale:t=1,position:i=[]}){i.forEach(({x:r,y:n,width:o,height:a,childNodes:A,element:l})=>{const c=s.getContext("2d",{alpha:!1});if(c){const{draw:h}=l;h&&(c.save(),h({scale:t,dx:r,dy:n,dw:o,dh:a}),e&&(c.strokeStyle="red",c.strokeRect(r,n,o,a))),Ml({canvas:s,debug:e,scale:t,position:A}),c.restore()}})}function Pl(s,e,t,i){const r=t.map((n,o)=>{const a=s.Node.create(),{radius:A,elements:l=[],draw:c,...h}=n;return Fl(s,a,{layout:h,scale:i}),e.insertChild(a,o),{node:a,element:n,childNodes:Pl(s,a,l,i)}});return e.calculateLayout(),r}function Ol(s,e,t=0,i=0){const{top:r,left:n}=s.getComputedLayout();return e.map(({node:o,element:a,childNodes:A})=>{const{top:l,left:c,width:h,height:u}=o.getComputedLayout(),d=t+c,g=i+l;return{x:n+d,y:r+g,width:h,height:u,element:a,childNodes:Ol(s,A,d,g)}})}function Ul(s,e){s.forEach(({node:t,element:i,childNodes:r})=>{const{height:n}=i;if(n&&typeof n=="function"){const o=t.getComputedWidth(),a=t.getComputedHeight(),A=n({width:o,maxHeight:a,scale:e});t.setHeight(A)}Ul(r,e)})}function Sf({yoga:s,canvas:e,origin:t,elements:i,...r}){const n={inset:{top:0,left:0},width:e.width,height:e.height,...t},o=s.Node.create();Fl(s,o,{layout:n}),o.calculateLayout();const{width:a,height:A}=o.getComputedLayout(),l=Math.min(a,A)/1080,c=Pl(s,o,i,l);Ul(c,l),o.calculateLayout();const h=Ol(o,c);return Ml({...r,scale:l,canvas:e,position:h})}const wf={linear:Wg,easeIn:mo,easeInOut:jg,easeOut:qg,circIn:wl,circInOut:Xg,circOut:Tl,backIn:Co,backInOut:Zg,backOut:zg,anticipate:ef,bounceIn:nf,bounceInOut:of,bounceOut:Gr},zr=co((s,e,{clamp:t=!0,ease:i="easeIn",...r}={})=>Hg(s,e,{...r,clamp:t,ease:wf[i]}),{cacheKey:([s,e,t])=>JSON.stringify({from:s,to:e,options:t})}),Gl=[{family:"Noto Arabic",regex:/\p{Script=Arabic}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArabic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Chinese",regex:/\p{Script=Han}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSC-VariableFont_wght.woff2",style:"normal"},{family:"Noto Hebrew",regex:/\p{Script=Hebrew}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansHebrew-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Hindi",regex:/\p{Script=Devanagari}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansDevanagari-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Japanese",regex:/\p{Script=Han}|\p{Script=Katakana}|\p{Script=Hiragana}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansJP-VariableFont_wght.woff2",style:"normal"},{family:"Noto Korean",regex:/\p{Script=Hangul}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKR-VariableFont_wght.woff2",style:"normal"},{family:"Noto Color Emoji",regex:/\p{Extended_Pictographic}/u,url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoColorEmoji-Regular.woff2",style:"normal"}];function Zr({text:s,font:e}){let t=e;return Gl.forEach(({family:i,regex:r})=>{r.exec(s)&&(t+=`, ${i}`)}),t}const Ai=1.8,en=/(?<value>\d+\.?\d*)(?=px)/;function Hl(s,e=1){return typeof s=="number"?{topLeft:s*e,topRight:s*e,bottomRight:s*e,bottomLeft:s*e}:{topLeft:((s==null?void 0:s.topLeft)??0)*e,topRight:((s==null?void 0:s.topRight)??0)*e,bottomRight:((s==null?void 0:s.bottomRight)??0)*e,bottomLeft:((s==null?void 0:s.bottomLeft)??0)*e}}function $l(s){const{visible:e,node:t}=s,i=[...(t==null?void 0:t.elements)??[],...(s==null?void 0:s.elements)??[]];return e??(t&&t.type!=="box"&&t.type!=="gradient"?!!t.value:i==null?void 0:i.some(r=>$l(r)))}function Yl({yoga:s,debug:e=!1,canvas:t,cropCanvas:i,posterCanvas:r,letterboxCanvas:n,elements:o=[],currentTime:a,contentTime:A,sceneTime:l,totalDuration:c,contentDuration:h,sceneDuration:u}){return o.map(d=>{var g,f,p,y,B,Q,C,T;const{node:b,transient:L=[{from:0,duration:1/0}]}=d,R=t.getContext("2d"),O={total:a,content:A,scene:l},k={total:c,content:h,scene:u},W=L.reduce(($,{type:te="scene",from:Z,duration:S,animation:D})=>{const U=Z<0?k[te]+Z:Z;return O[te]>=U&&O[te]<=U+S&&$.push({type:te,animation:D,duration:S,from:U}),$},[]);if(R&&W.length>0&&$l(d)){let $=d.width,te=d.height;if((b==null?void 0:b.type)==="text"&&b.value){const{align:Z="left"}=b,S=Zr({text:b.value,font:b.font});R.save(),R.font=S,R.textBaseline="top",R.textAlign=Z,b.wrap?te=({width:D,maxHeight:U,scale:v})=>{var w,F;const H=kl({font:S,scale:v,context:R,maxW:D,maxH:U,text:b.value??"",minSize:(w=b.fill)==null?void 0:w.minSize,maxSize:(F=b.fill)==null?void 0:F.maxSize});return tn({context:R,font:S,fontSize:H,text:b.value??"",maxW:D}).length*H}:($=R.measureText(b.value).width,te=parseFloat(((f=(g=S.match(en))==null?void 0:g.groups)==null?void 0:f.value)??"0")),R.restore()}if((b==null?void 0:b.type)==="image"&&b.image&&b.size){const Z=((p=b.image)==null?void 0:p.naturalWidth)??((y=b.image)==null?void 0:y.width),S=((B=b.image)==null?void 0:B.naturalHeight)??((Q=b.image)==null?void 0:Q.height),D=Z/S,U=(C=b.size)==null?void 0:C.width,v=(T=b.size)==null?void 0:T.height;$=U??(D>=1?(v??0)*D:(v??0)/D),te=v??(D<1?(U??0)*D:(U??0)/D)}return{...d,width:$,height:te,elements:Yl({yoga:s,debug:e,canvas:t,cropCanvas:i,posterCanvas:r,letterboxCanvas:n,elements:d.elements,currentTime:a,contentTime:A,sceneTime:l,totalDuration:c,contentDuration:h,sceneDuration:u}),draw:({dx:Z,dy:S,dw:D,dh:U,scale:v})=>{var w,F,H,K,j,se,ue,le,Ce,Se,Le,oe,Ie;if(W.forEach(Be=>{const{type:ce="scene",from:Ae,duration:ne,animation:be={type:"fade",duration:.3333333333333333,easing:{in:"easeOut",out:"easeOut"}}}=Be;if(be){const{type:Pe,duration:Te,easing:{in:ke="easeOut",out:Oe="easeOut"}={}}=be;if(Ae>0&&O[ce]<=Ae+Te)switch(Pe){case"fade":{const De=zr([Ae,Ae+Te],[0,1],{ease:ke});R.globalAlpha=De(O[ce]);break}case"slide":{const{options:De}=be,ve={up:[{x:0,y:U},{x:0,y:0}],right:[{x:D,y:0},{x:0,y:0}],down:[{x:0,y:-U},{x:0,y:0}],left:[{x:-D,y:0},{x:0,y:0}]},He=zr([Ae,Ae+Te],ve[De.direction.in],{ease:ke}),{x:We,y:rt}=He(O[ce]);R.translate(We,rt);break}}if(Ae+ne<k[ce]&&Ae+ne-Te<=O[ce])switch(Pe){case"fade":{const De=zr([Ae+ne-Te,Ae+ne],[1,0],{ease:Oe});R.globalAlpha=De(O[ce]);break}case"slide":{const{options:De}=be,ve={up:[{x:0,y:0},{x:0,y:-U}],right:[{x:0,y:0},{x:D,y:0}],down:[{x:0,y:0},{x:0,y:U}],left:[{x:0,y:0},{x:-D,y:0}]},He=zr([Ae+ne-Te,Ae+ne],ve[De.direction.out],{ease:Oe}),{x:We,y:rt}=He(O[ce]);R.translate(We,rt);break}}}}),b){const{type:Be}=b;if(Be==="box"){const{shadow:{color:ce="rgba(0, 0, 0, 0.5)",blur:Ae=0,offset:{x:ne=0,y:be=0}={}}={}}=b;if(R.save(),R.fillStyle=ce,R.shadowColor=ce,R.shadowBlur=Ae,R.shadowOffsetX=ne+D+t.width,R.shadowOffsetY=be+U+t.height,R.beginPath(),!d.radius)R.rect(Z-D-t.width,S-U-t.height,D,U);else{const{topLeft:Pe,topRight:Te,bottomRight:ke,bottomLeft:Oe}=Hl(d.radius,v);R.roundRect(Z-D-t.width,S-U-t.height,D,U,[Pe,Te,ke,Oe])}R.fill(),R.closePath(),R.restore()}if(d.radius){const{topLeft:ce,topRight:Ae,bottomRight:ne,bottomLeft:be}=Hl(d.radius,v);R.beginPath(),R.moveTo(Z+Math.min(U/Ai,ce),S),R.lineTo(Z+D-Math.min(U/Ai,Ae),S),R.quadraticCurveTo(Z+D,S,Z+D,S+Math.min(U/Ai,Ae)),R.lineTo(Z+D,S+U-Math.min(U/Ai,ne)),R.quadraticCurveTo(Z+D,S+U,Z+D-Math.min(U/Ai,ne),S+U),R.lineTo(Z+Math.min(U/Ai,be),S+U),R.quadraticCurveTo(Z,S+U,Z,S+U-Math.min(U/Ai,be)),R.lineTo(Z,S+Math.min(U/Ai,ce)),R.quadraticCurveTo(Z,S,Z+Math.min(U/Ai,ce),S),R.closePath(),e&&(R.strokeStyle="blue",R.stroke()),R.clip()}if(Be==="box"&&(R.save(),R.fillStyle=b.background,R.fillRect(Z,S,D,U),R.restore()),Be==="text"&&b.value){const{align:ce="left"}=b,Ae=Zr({text:b.value,font:b.font}),ne=kl({font:Ae,scale:v,context:R,maxW:D,maxH:U,text:b.value??"",minSize:(w=b.fill)==null?void 0:w.minSize,maxSize:(F=b.fill)==null?void 0:F.maxSize});R.font=Ae.replace(en,ne.toString()),R.textBaseline="top",R.fillStyle=b.color,R.textAlign=ce;const be={left:Z,center:Z+D/2,right:Z+D};b.wrap?tn({context:R,font:Ae,fontSize:ne,text:b.value,maxW:D}).forEach((Te,ke)=>{R.fillText(Te.text,be[ce],S+ne*ke)}):R.fillText(b.value,be[ce],S)}if(Be==="image"&&b.image&&R.drawImage(b.image,Z,S,D,U),Be==="video"&&((H=b.video)!=null&&H.node||(K=b.video)!=null&&K.getSource)){const ce=b.format??"letterbox",Ae=((se=(j=b.video)==null?void 0:j.getSource)==null?void 0:se.call(j,l))??b.video.node,ne=(Ae==null?void 0:Ae.videoWidth)??(Ae==null?void 0:Ae.naturalWidth)??(Ae==null?void 0:Ae.width),be=(Ae==null?void 0:Ae.videoHeight)??(Ae==null?void 0:Ae.naturalHeight)??(Ae==null?void 0:Ae.height);if(ne&&be){const{dx:Te,dy:ke,dw:Oe,dh:De}=Ll({context:R,cropCanvas:i,letterboxCanvas:n,source:Ae,format:ce,crop:(ue=b==null?void 0:b.value)==null?void 0:ue.crop,sourceWidth:ne,sourceHeight:be,posX:Z,posY:S,drawAreaWidth:D,drawAreaHeight:U});b.elements&&Do({yoga:s,debug:e,canvas:t,cropCanvas:i,posterCanvas:r,letterboxCanvas:n,elements:b.elements,currentTime:a,contentTime:A,sceneTime:l,totalDuration:c,contentDuration:h,sceneDuration:u,origin:{inset:{top:Math.max(S,S+ke),left:Math.max(Z,Z+Te)},width:Math.min(D,Oe),height:Math.min(U,De)}})}const Pe=1/3;if(b.poster&&a>=0&&a<=Pe){R.save(),R.globalAlpha=1-a/Pe;const Te=((le=b.poster)==null?void 0:le.naturalWidth)??((Ce=b.poster)==null?void 0:Ce.width),ke=((Se=b.poster)==null?void 0:Se.naturalHeight)??((Le=b.poster)==null?void 0:Le.height);r.width=r.height=0,r.width=D,r.height=U;const Oe=r.getContext("2d");if(Oe&&Te&&ke){const{dx:De,dy:ve,dw:He,dh:We}=Ll({context:Oe,cropCanvas:i,letterboxCanvas:n,source:b.poster,format:ce,crop:(oe=b==null?void 0:b.value)==null?void 0:oe.crop,sourceWidth:Te,sourceHeight:ke,posX:0,posY:0,drawAreaWidth:D,drawAreaHeight:U});b.elements&&Do({yoga:s,debug:e,canvas:r,cropCanvas:i,posterCanvas:r,letterboxCanvas:n,elements:b.elements,currentTime:a,contentTime:A,sceneTime:l,totalDuration:c,contentDuration:h,sceneDuration:u,origin:{inset:{top:Math.max(0,ve),left:Math.max(0,De)},width:Math.min(D,He),height:Math.min(U,We)}}),R.drawImage(r,Z,S,D,U),R.restore()}}}if(Be==="gradient"&&b.value){const ce=R.createLinearGradient(Z+D,S,Z+D,S+U);(Ie=b.value)==null||Ie.forEach(Ae=>{ce.addColorStop(Ae.percent,Ae.color)}),R.fillStyle=ce,R.fillRect(Z,S,D,U)}}}}}}).filter(Boolean)}function Do({yoga:s,debug:e,canvas:t,cropCanvas:i,posterCanvas:r,letterboxCanvas:n,elements:o,currentTime:a,contentTime:A,sceneTime:l,totalDuration:c,contentDuration:h,sceneDuration:u,...d}){return Sf({...d,yoga:s,debug:e,canvas:t,elements:Yl({yoga:s,debug:e,canvas:t,cropCanvas:i,posterCanvas:r,letterboxCanvas:n,elements:o,currentTime:a,contentTime:A,sceneTime:l,totalDuration:c,contentDuration:h,sceneDuration:u})})}const tn=co(({context:s,font:e,fontSize:t,text:i,maxW:r=1/0})=>{try{return s.save(),s.font=e.replace(en,t.toString()),i.split(`
|
91
|
+
`).flatMap(o=>{const a=o.split(" ").filter(Boolean);return a.length?a.slice(1).reduce((A,l)=>{const h=`${A[A.length-1].text} ${l}`.trim(),u=s.measureText(h);return u.width>r?A=[...A,..._l({context:s,word:l,maxW:r})]:A[A.length-1]={text:h,metrics:u},A},_l({context:s,word:a[0],maxW:r})):{text:"",metrics:s.measureText("")}})}finally{s.restore()}},{cacheKey:([{font:s,fontSize:e,text:t,maxW:i}])=>`${s}_${e}_${t}_${i}`}),Tf=/\d{0,2}:?\d{2}:\d{2}\.\d{3}\s-->\s\d{0,2}:?\d{2}:\d{2}\.\d{3}\s{1,2}.*/g,xf=/\d{0,2}:?\d{2}:\d{2}\.\d{3}/g;function Kl(s){if(!s)return[];const e=s.match(Tf);return e?e==null?void 0:e.map(t=>{const[i,r]=t.replace(`\r
|
92
92
|
`,`
|
93
93
|
`).split(`
|
94
|
-
`),[n,o]=i.match(xf)||[];return{start:n,end:o,text:r}}):[]}function sn(s){const[e,t,i]=s.split(":");return i?parseInt(e)*60*60+parseInt(t)*60+parseFloat(i):parseInt(e)*60+parseInt(t)}function Df({canvas:s,dx:e,dy:t,dw:i,dh:r,sceneTime:n,vttCaptions:o}){if(o){const A=
|
94
|
+
`),[n,o]=i.match(xf)||[];return{start:n,end:o,text:r}}):[]}function sn(s){const[e,t,i]=s.split(":");return i?parseInt(e)*60*60+parseInt(t)*60+parseFloat(i):parseInt(e)*60+parseInt(t)}function Df({canvas:s,dx:e,dy:t,dw:i,dh:r,sceneTime:n,vttCaptions:o}){if(o){const A=Kl(o).find(({start:l,end:c})=>l&&c&&n>=sn(l)&&n<sn(c));if(A){const l=s.getContext("2d");if(l){const c=Math.min(i,r),h=c*.04,u=Zr({text:o,font:`400 ${h}px Roobert Captions`});l.font=u,l.textBaseline="middle";const d=i*.9,g=tn({context:l,font:u,fontSize:h,text:A.text,maxW:d});g.forEach(({text:f,metrics:p},y)=>{const B=e+(i-p.width)/2,Q=t+(r*.85-(h+c*.03)*(g.length-1-y)),C=h*.8,T=h/1.5,b=e+(i-p.width-T)/2,L=Q-C,R=p.width+T,O=C*2,k=l.globalAlpha;l.save(),l.globalAlpha=.8*k,l.fillStyle="#000000",l.beginPath(),l.roundRect(b,L,R,O,c*.01),l.fill(),l.closePath(),l.globalAlpha=k,l.fillStyle="#FFFFFF",l.fillText(f,B,Q),l.restore()})}}}}const Rf={id:"073977ec-6384-4329-b7c5-8275fb513e74",name:"None",entityId:"none",templateId:"a95e537e-fb4d-4d2f-9c72-86c0925c7176",templates:[{id:"046f363c-960a-449c-ae5e-984ac6ab58c2",version:"2",name:"None",entityId:"none",templateId:"a95e537e-fb4d-4d2f-9c72-86c0925c7176",layouts:[{name:"none",tree:`[
|
95
95
|
{
|
96
96
|
"width": "100%",
|
97
97
|
"height": "100%",
|
@@ -168,44 +168,44 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
168
168
|
"width": {{ it.root?.answer?.settings?.crop?.width }},
|
169
169
|
"height": {{ it.root?.answer?.settings?.crop?.height }}
|
170
170
|
}
|
171
|
-
}`}],root:"{{ it.outro?.questions?.items }}"}],system:!0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}],meta:{frameRate:30,resolution:720,transitionDuration:1/3},system:!0,default:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};async function Lf(){if(typeof window>"u"){const s=await Promise.resolve().then(()=>Hu);return new s.Image}return new Image}const Kl=bi(async function(e){return e?new Promise((t,i)=>{Lf().then(r=>{r.onload=()=>{t(r)},r.onerror=n=>{i(n)},r.src=e})}):null});async function Ro({element:s,meta:e},t,i){var r,n,o;let a={...s};const{node:A}=s;if((A==null?void 0:A.type)==="video"&&((r=A==null?void 0:A.value)!=null&&r.src||(n=A==null?void 0:A.value)!=null&&n.playlist)){const l=await t(A.value,e);let c;try{c=await Kl(A.value.poster)}catch{c=null}a={...a,node:{...A,video:l,poster:c,meta:await i(A.value,l.node,e)}}}if((A==null?void 0:A.type)==="image"&&A.value){let l;try{l=await Kl(A.value)}catch{l=null}a={...a,node:{...A,image:l}}}return a.node&&((o=s.node)!=null&&o.elements)&&(a.node.elements=await Promise.all(s.node.elements.map(l=>Ro({element:l,meta:e},t,i)))),s.elements&&(a.elements=await Promise.all(s.elements.map(l=>Ro({element:l,meta:e},t,i)))),a}async function rn(){if(typeof window>"u"){const s=await Promise.resolve().then(()=>Hu),e=new s.Canvas;return e.gpu=!1,e}return document.createElement("canvas")}async function _f(s){var e;try{if((e=await Cf(s,{method:"HEAD"}))!=null&&e.ok)return s}catch{return}}async function kf({sources:s}){let e=null;if(s){const t=s.filter(Boolean).map(i=>_f(i));e=(await Promise.all(t)).find(Boolean)}return e}function tr(s=[]){var e;for(const t of s){if(((e=t==null?void 0:t.node)==null?void 0:e.type)==="video")return t.node;const i=tr(t==null?void 0:t.elements);if(i)return i}}function Nf(s,e){return s.reduce((t,i,r)=>[...t,i.map(({duration:n},o)=>r===s.length-1&&o===i.length-1?n:n-e)],[])}function Ff(s){if(s===null||typeof s!="object")return!1;if(Object.getPrototypeOf(s)===null)return!0;let e=s;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(s)===e}function Mf(s){return s.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}function nn(s){return s.flatMap(e=>e).reduce((e,t)=>e+t,0)}$r.filters.define("parse",s=>typeof s>"u"?null:typeof s=="string"?`"${Mf(s)}"`:Ff(s)||Array.isArray(s)?JSON.stringify(s):s),$r.helpers.define("resolve-source",bi(async s=>{const{sources:e}=s.params[0]??{},t=e==null?void 0:e.filter(Boolean),i=t==null?void 0:t.find(o=>o.includes("blob:")),r=t==null?void 0:t.find(o=>!o.includes("http")),n=i??r??await kf({sources:e});return n?`"${n}"`:"null"},{cacheKey:([s])=>JSON.stringify(s.params[0]??{})}));const ir=(s,e,t)=>$r.render(s,e,$r.getConfig({autoEscape:!1,defaultFilter:"parse",async:!0,asyncHelpers:["resolve-source"],...t}));async function cs({data:s,template:e,burnCaptions:t=!1,debug:i=!1},r,n){var o,a,A,l;const c=await xl.loadYoga(),h=e??Rf;if(!((o=h.templates)!=null&&o.length))throw new Error(`No templates found for template instance: ${h.id}`);let u=h.templates.find(({version:L})=>L===Lo);if(!u){const L=h.templates.map(({version:R})=>`"${R}"`).join(", ");console.warn(`Template renderer expects template version "${Lo}" but got ${L}`),u=h.templates[h.templates.length-1]}const d=await Promise.all(u.content.map(async({scenes:L,root:R})=>{const O={...h.options,...s,intro:h.intro,outro:h.outro};async function k(W,$){return Promise.all(L.map(async({layout:te,duration:ee,data:S,options:D})=>{var U,v,w;const F={...O,index:$,root:W},H=S?JSON.parse(await ir(S,F)):{},K=D?JSON.parse(await ir(D,F)):{},j=ee?parseFloat(await ir(ee,F)):NaN,se=(U=u.layouts.find(Re=>Re.name===te))==null?void 0:U.tree;if(!se)throw new Error(`Layout tree "${te}" not found in template "${u.id}" layouts.`);const ue=JSON.parse(await ir(se,{...H,...K})),Ae=await Promise.all(ue.flatMap(Re=>Ro({element:Re,meta:h.meta},r,n))),Ce=tr(Ae);return{duration:(isNaN(j)?null:j)??((v=Ce==null?void 0:Ce.meta)==null?void 0:v.duration)??0,captions:(w=Ce==null?void 0:Ce.meta)==null?void 0:w.captions,elements:Ae}}))}if(R){const W=JSON.parse(await ir(R,O));return Array.isArray(W)?(await Promise.all(W.map(async($,te)=>k($,te)))).flatMap($=>$):k(W,null)}return k(s,null)}));if(d.every(L=>L.every(R=>{const O=tr(R.elements);return!(O!=null&&O.value.src)&&!(O!=null&&O.value.playlist)}))){const L=d.flatMap(R=>R.map(O=>{const k=tr(O.elements);return!(k!=null&&k.value.src)&&!(k!=null&&k.value.playlist)&&(k==null?void 0:k.value.id)}).filter(Boolean)).join(", ");throw new Error(`Video(s) with ID ${L} failed to load, video can not be processed`)}if(d.every(L=>L.every(R=>R.duration<=0)))throw new Error("No scenes have any duration, video can not be processed");const p=d.reduce((L,R)=>{const O=R.filter(k=>k.duration>0);return O.length>0&&(L=[...L,O]),L},[]),y=((a=h.meta)==null?void 0:a.frameRate)??30,B=((A=h.meta)==null?void 0:A.resolution)??720,Q=((l=h.meta)==null?void 0:l.transitionDuration)??1/3,C=Nf(p,Q),T=nn(C);return{scenes:(await Promise.all(p.map((L,R)=>{const O=nn(C[R]),k=nn(C.slice(0,R));return Promise.all(L.map(async({duration:W,captions:$,elements:te},ee)=>{var S,D;const U=await rn(),v=await rn(),w=await rn(),F=await rn(),H=tr(te),K=nn([...C.slice(0,R),...C[R].slice(0,ee)]);return{draw:({canvas:se,currentTime:ue})=>{const Ae=Math.max(0,ue-k),Ce=Math.max(0,ue-K);Do({yoga:c,debug:i,canvas:se,cropCanvas:U,posterCanvas:F,letterboxCanvas:v,elements:te,currentTime:ue,contentTime:Ae,sceneTime:Ce,totalDuration:T,contentDuration:O,sceneDuration:W}),$&&t&&Df({canvas:se,dx:0,dy:0,dw:se.width,dh:se.height,vttCaptions:$,sceneTime:Ce+((H==null?void 0:H.meta.start)??0)})},duration:W,transitionCanvas:w,start:K,video:H==null?void 0:H.video,videoMeta:H==null?void 0:H.meta,audio:{duration:W,src:(S=H==null?void 0:H.value)==null?void 0:S.src,start:(D=H==null?void 0:H.meta)==null?void 0:D.start}}}))}))).flatMap(L=>L),frameRate:y,resolution:B,transitionDuration:Q,fonts:u.fonts??[],duration:T}}const Lo="2",Pf={name:"@vouchfor/embeds",version:"1.3.2",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds.js",module:"dist/es/embeds.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds.js"},files:["dist","src"],publishConfig:{tag:"latest",access:"public"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:deps":"yarn --cwd ../media-player build","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","build:package":"yarn build","build:storybook":"yarn prebuild && storybook build","generate:manifest":"wca src --outFile custom-elements.json",lint:"eslint . --quiet","lint:fix":"eslint . --fix","lint:staged":"lint-staged",prepublishOnly:"yarn build",size:"size-limit",storybook:"yarn prebuild && storybook dev -p 6007",prebuild:"yarn build:deps && yarn generate:manifest",test:"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:ci":"yarn test --config web-test-runner.ci.config.js"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.0","@vouchfor/media-player":"^2.2.2",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.0"},devDependencies:{"@esm-bundle/chai":"^4.3.4-fix.0","@open-wc/testing":"^3.2.0","@storybook/addon-essentials":"^7.4.5","@storybook/addon-links":"^7.4.5","@storybook/blocks":"^7.4.5","@storybook/web-components":"^7.4.5","@storybook/web-components-vite":"^7.4.5","@types/mocha":"^10.0.1","@vouchfor/eslint-config":"^1.0.0","@vouchfor/prettier-config":"^1.0.0","@web/dev-server-esbuild":"^0.4.1","@web/test-runner":"^0.17.1","@web/test-runner-browserstack":"^0.6.1","@web/test-runner-mocha":"^0.8.1","@web/test-runner-playwright":"^0.10.1",dotenv:"^16.3.1",eslint:"^8.50.0","eslint-plugin-import":"^2.28.1",glob:"^10.3.10","lint-staged":"^14.0.1",lit:"^3.1.0",lodash:"^4.17.21",prettier:"^3.0.3",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-internal":"^1.0.4",sinon:"^17.0.1",storybook:"^7.4.5",typescript:"^5.1.3",vite:"^4.4.9","vite-plugin-commonjs":"^0.10.0","vite-plugin-dts":"^3.6.0","web-component-analyzer":"^1.1.7"}};function Of(s){const{publicApiUrl:e}=Fr(s),t=Yi();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function Uf(s){var n,o,a,A,l,c,h,u,d,g,f,p;if(typeof window>"u")return{client:null,tab:null,request:Yi()};let e=(o=(n=window.localStorage)==null?void 0:n.getItem)==null?void 0:o.call(n,"vouch-uid-visitor"),t=(A=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:A.call(a,"vouch-uid-client"),i=(c=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:c.call(l,"vouch-uid-tab");const r=Yi();return e||(e=Of(s),(u=(h=window.localStorage)==null?void 0:h.setItem)==null||u.call(h,"vouch-uid-visitor",e)),t||(t=Yi(),(g=(d=window.localStorage)==null?void 0:d.setItem)==null||g.call(d,"vouch-uid-client",t)),i||(i=Yi(),(p=(f=window.sessionStorage)==null?void 0:f.setItem)==null||p.call(f,"vouch-uid-tab",i)),{client:t,tab:i,request:r,visitor:e}}function Gf(s,e){return s&&"vouchId"in s?s.vouchId:(e==null?void 0:e.id)??null}function Hf(s="embedded_player"){var r,n;const[e,t]=((n=(r=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:r.split)==null?void 0:n.call(r,"/"))??[],i={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const A=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());i[A]=a}}),{source:s,time:new Date,region:t,country:e,screenHeight:window.screen.height,screenWidth:window.screen.width,referrer:document.referrer,currentUrl:location.href,embedType:"media-player-embed",embedVersion:Pf.version,templateVersion:Lo,...i}}const Vl=1;class $f{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const r=Gf(i,this.host.vouch);!r||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,vouchId:r,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=Fr(this.host.env),{client:i,tab:r,request:n,visitor:o}=Uf(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":r,"x-uid-request":n,"x-uid-visitor":o,"x-reporting-metadata":Hf(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+Vl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]}},this._handleVouchLoaded=({detail:t})=>{t&&(this._hasLoaded[t]||(this._createTrackingEvent("VOUCH_LOADED",{vouchId:t}),this._hasLoaded[t]=!0))},this._handlePlay=()=>{this._hasPlayed||(this._createTrackingEvent("VIDEO_PLAYED",{streamStart:this.host.currentTime}),this._hasPlayed=!0)},this._handleVideoPlay=({detail:{id:t,key:i}})=>{this._answersViewed[i]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[i]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:i,node:r}})=>{var n,o;!this.host.paused&&t===((o=(n=this.host.scene)==null?void 0:n.video)==null?void 0:o.id)&&(this._currentlyPlayingVideo={id:t,key:i,node:r},this._streamLatestTime[i]=r.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=r.currentTime,this._streamLatestTime[i]=r.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+Vl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]},this._pageUnloading=()=>{this._streamEnded(),this._sendTrackingEvent()},this._handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this._pageUnloading()},this._handlePageHide=()=>{this._pageUnloading()},this.host=e,e.addController(this)}hostConnected(){requestAnimationFrame(()=>{var e,t,i,r;"onvisibilitychange"in document?document.addEventListener("visibilitychange",this._handleVisibilityChange):window.addEventListener("pagehide",this._handlePageHide),this.host.addEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.addEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.addEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.addEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,r;this._pageUnloading(),"onvisibilitychange"in document?document.removeEventListener("visibilitychange",this._handleVisibilityChange):window.removeEventListener("pagehide",this._handlePageHide),this.host.removeEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.removeEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.removeEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.removeEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}/**
|
171
|
+
}`}],root:"{{ it.outro?.questions?.items }}"}],system:!0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}],meta:{frameRate:30,resolution:720,transitionDuration:1/3},system:!0,default:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};async function Lf(){if(typeof window>"u"){const s=await Promise.resolve().then(()=>$u);return new s.Image}return new Image}const Vl=oi(async function(e){return e?new Promise((t,i)=>{Lf().then(r=>{r.onload=()=>{t(r)},r.onerror=n=>{i(n)},r.src=e})}):null});async function Ro({element:s,meta:e},t,i){var r,n,o;let a={...s};const{node:A}=s;if((A==null?void 0:A.type)==="video"&&((r=A==null?void 0:A.value)!=null&&r.src||(n=A==null?void 0:A.value)!=null&&n.playlist)){const l=await t(A.value,e);let c;try{c=await Vl(A.value.poster)}catch{c=null}a={...a,node:{...A,video:l,poster:c,meta:await i(A.value,l.node,e)}}}if((A==null?void 0:A.type)==="image"&&A.value){let l;try{l=await Vl(A.value)}catch{l=null}a={...a,node:{...A,image:l}}}return a.node&&((o=s.node)!=null&&o.elements)&&(a.node.elements=await Promise.all(s.node.elements.map(l=>Ro({element:l,meta:e},t,i)))),s.elements&&(a.elements=await Promise.all(s.elements.map(l=>Ro({element:l,meta:e},t,i)))),a}async function rn(){if(typeof window>"u"){const s=await Promise.resolve().then(()=>$u),e=new s.Canvas;return e.gpu=!1,e}return document.createElement("canvas")}async function _f(s){var e;try{if((e=await Ef(s,{method:"HEAD"}))!=null&&e.ok)return s}catch{return}}async function kf({sources:s}){let e=null;if(s){const t=s.filter(Boolean).map(i=>_f(i));e=(await Promise.all(t)).find(Boolean)}return e}function tr(s=[]){var e;for(const t of s){if(((e=t==null?void 0:t.node)==null?void 0:e.type)==="video")return t.node;const i=tr(t==null?void 0:t.elements);if(i)return i}}function Nf(s,e){return s.reduce((t,i,r)=>[...t,i.map(({duration:n},o)=>r===s.length-1&&o===i.length-1?n:n-e)],[])}function Ff(s){if(s===null||typeof s!="object")return!1;if(Object.getPrototypeOf(s)===null)return!0;let e=s;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(s)===e}function Mf(s){return s.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}function nn(s){return s.flatMap(e=>e).reduce((e,t)=>e+t,0)}const Pf=oi(()=>xl.loadYoga());$r.filters.define("parse",s=>typeof s>"u"?null:typeof s=="string"?`"${Mf(s)}"`:Ff(s)||Array.isArray(s)?JSON.stringify(s):s),$r.helpers.define("resolve-source",oi(async s=>{const{sources:e}=s.params[0]??{},t=e==null?void 0:e.filter(Boolean),i=t==null?void 0:t.find(o=>o.includes("blob:")),r=t==null?void 0:t.find(o=>!o.includes("http")),n=i??r??await kf({sources:e});return n?`"${n}"`:"null"},{cacheKey:([s])=>JSON.stringify(s.params[0]??{})}));const ir=(s,e,t)=>$r.render(s,e,$r.getConfig({autoEscape:!1,defaultFilter:"parse",async:!0,asyncHelpers:["resolve-source"],...t}));async function cs({data:s,template:e,burnCaptions:t=!1,debug:i=!1},r,n){var o,a,A,l;const c=await Pf(),h=e??Rf;if(!((o=h.templates)!=null&&o.length))throw new Error(`No templates found for template instance: ${h.id}`);let u=h.templates.find(({version:L})=>L===Lo);if(!u){const L=h.templates.map(({version:R})=>`"${R}"`).join(", ");console.warn(`Template renderer expects template version "${Lo}" but got ${L}`),u=h.templates[h.templates.length-1]}const d=await Promise.all(u.content.map(async({scenes:L,root:R})=>{const O={...h.options,...s,intro:h.intro,outro:h.outro};async function k(W,$){return Promise.all(L.map(async({layout:te,duration:Z,data:S,options:D})=>{var U,v,w;const F={...O,index:$,root:W},H=S?JSON.parse(await ir(S,F)):{},K=D?JSON.parse(await ir(D,F)):{},j=Z?parseFloat(await ir(Z,F)):NaN,se=(U=u.layouts.find(Le=>Le.name===te))==null?void 0:U.tree;if(!se)throw new Error(`Layout tree "${te}" not found in template "${u.id}" layouts.`);const ue=JSON.parse(await ir(se,{...H,...K})),le=await Promise.all(ue.flatMap(Le=>Ro({element:Le,meta:h.meta},r,n))),Ce=tr(le);return{duration:(isNaN(j)?null:j)??((v=Ce==null?void 0:Ce.meta)==null?void 0:v.duration)??0,captions:(w=Ce==null?void 0:Ce.meta)==null?void 0:w.captions,elements:le}}))}if(R){const W=JSON.parse(await ir(R,O));return Array.isArray(W)?(await Promise.all(W.map(async($,te)=>k($,te)))).flatMap($=>$):k(W,null)}return k(s,null)}));if(d.every(L=>L.every(R=>{const O=tr(R.elements);return!(O!=null&&O.value.src)&&!(O!=null&&O.value.playlist)}))){const L=d.flatMap(R=>R.map(O=>{const k=tr(O.elements);return!(k!=null&&k.value.src)&&!(k!=null&&k.value.playlist)&&(k==null?void 0:k.value.id)}).filter(Boolean)).join(", ");throw new Error(`Video(s) with ID ${L} failed to load, video can not be processed`)}if(d.every(L=>L.every(R=>R.duration<=0)))throw new Error("No scenes have any duration, video can not be processed");const p=d.reduce((L,R)=>{const O=R.filter(k=>k.duration>0);return O.length>0&&(L=[...L,O]),L},[]),y=((a=h.meta)==null?void 0:a.frameRate)??30,B=((A=h.meta)==null?void 0:A.resolution)??720,Q=((l=h.meta)==null?void 0:l.transitionDuration)??1/3,C=Nf(p,Q),T=nn(C);return{scenes:(await Promise.all(p.map((L,R)=>{const O=nn(C[R]),k=nn(C.slice(0,R));return Promise.all(L.map(async({duration:W,captions:$,elements:te},Z)=>{var S,D;const U=await rn(),v=await rn(),w=await rn(),F=await rn(),H=tr(te),K=nn([...C.slice(0,R),...C[R].slice(0,Z)]);return{draw:({canvas:se,currentTime:ue})=>{const le=Math.max(0,ue-k),Ce=Math.max(0,ue-K);Do({yoga:c,debug:i,canvas:se,cropCanvas:U,posterCanvas:F,letterboxCanvas:v,elements:te,currentTime:ue,contentTime:le,sceneTime:Ce,totalDuration:T,contentDuration:O,sceneDuration:W}),$&&t&&Df({canvas:se,dx:0,dy:0,dw:se.width,dh:se.height,vttCaptions:$,sceneTime:Ce+((H==null?void 0:H.meta.start)??0)})},duration:W,transitionCanvas:w,start:K,video:H==null?void 0:H.video,videoMeta:H==null?void 0:H.meta,audio:{duration:W,src:(S=H==null?void 0:H.value)==null?void 0:S.src,start:(D=H==null?void 0:H.meta)==null?void 0:D.start}}}))}))).flatMap(L=>L),frameRate:y,resolution:B,transitionDuration:Q,fonts:u.fonts??[],duration:T}}const Lo="2",Of={name:"@vouchfor/embeds",version:"1.4.0",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds.js",module:"dist/es/embeds.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds.js"},files:["dist","src"],publishConfig:{tag:"latest",access:"public"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:deps":"yarn --cwd ../media-player build","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","build:package":"yarn build","build:storybook":"yarn prebuild && storybook build","generate:manifest":"wca src --outFile custom-elements.json",lint:"eslint . --quiet","lint:fix":"eslint . --fix","lint:staged":"lint-staged",prepublishOnly:"yarn build",size:"size-limit",storybook:"yarn prebuild && storybook dev -p 6007",prebuild:"yarn build:deps && yarn generate:manifest",test:"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:ci":"yarn test --config web-test-runner.ci.config.js"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.0","@vouchfor/media-player":"^2.3.0",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.0"},devDependencies:{"@esm-bundle/chai":"^4.3.4-fix.0","@open-wc/testing":"^3.2.0","@storybook/addon-essentials":"^7.4.5","@storybook/addon-links":"^7.4.5","@storybook/blocks":"^7.4.5","@storybook/web-components":"^7.4.5","@storybook/web-components-vite":"^7.4.5","@types/mocha":"^10.0.1","@vouchfor/eslint-config":"^1.0.0","@vouchfor/prettier-config":"^1.0.0","@web/dev-server-esbuild":"^0.4.1","@web/test-runner":"^0.17.1","@web/test-runner-browserstack":"^0.6.1","@web/test-runner-mocha":"^0.8.1","@web/test-runner-playwright":"^0.10.1",dotenv:"^16.3.1",eslint:"^8.50.0","eslint-plugin-import":"^2.28.1",glob:"^10.3.10","lint-staged":"^14.0.1",lit:"^3.1.0",lodash:"^4.17.21",prettier:"^3.0.3",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-internal":"^1.0.4",sinon:"^17.0.1",storybook:"^7.4.5",typescript:"^5.1.3",vite:"^4.4.9","vite-plugin-commonjs":"^0.10.0","vite-plugin-dts":"^3.6.0","web-component-analyzer":"^1.1.7"}};function Uf(s){const{publicApiUrl:e}=Fr(s),t=Yi();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function Gf(s){var n,o,a,A,l,c,h,u,d,g,f,p;if(typeof window>"u")return{client:null,tab:null,request:Yi()};let e=(o=(n=window.localStorage)==null?void 0:n.getItem)==null?void 0:o.call(n,"vouch-uid-visitor"),t=(A=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:A.call(a,"vouch-uid-client"),i=(c=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:c.call(l,"vouch-uid-tab");const r=Yi();return e||(e=Uf(s),(u=(h=window.localStorage)==null?void 0:h.setItem)==null||u.call(h,"vouch-uid-visitor",e)),t||(t=Yi(),(g=(d=window.localStorage)==null?void 0:d.setItem)==null||g.call(d,"vouch-uid-client",t)),i||(i=Yi(),(p=(f=window.sessionStorage)==null?void 0:f.setItem)==null||p.call(f,"vouch-uid-tab",i)),{client:t,tab:i,request:r,visitor:e}}function Hf(s,e){return s&&"vouchId"in s?s.vouchId:(e==null?void 0:e.id)??null}function $f(s="embedded_player"){var r,n;const[e,t]=((n=(r=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:r.split)==null?void 0:n.call(r,"/"))??[],i={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const A=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());i[A]=a}}),{source:s,time:new Date,region:t,country:e,screenHeight:window.screen.height,screenWidth:window.screen.width,referrer:document.referrer,currentUrl:location.href,embedType:"media-player-embed",embedVersion:Of.version,templateVersion:Lo,...i}}const Jl=1;class Yf{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const r=Hf(i,this.host.vouch);!r||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,vouchId:r,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=Fr(this.host.env),{client:i,tab:r,request:n,visitor:o}=Gf(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":r,"x-uid-request":n,"x-uid-visitor":o,"x-reporting-metadata":$f(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+Jl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]}},this._handleVouchLoaded=({detail:t})=>{t&&(this._hasLoaded[t]||(this._createTrackingEvent("VOUCH_LOADED",{vouchId:t}),this._hasLoaded[t]=!0))},this._handlePlay=()=>{this._hasPlayed||(this._createTrackingEvent("VIDEO_PLAYED",{streamStart:this.host.currentTime}),this._hasPlayed=!0)},this._handleVideoPlay=({detail:{id:t,key:i}})=>{this._answersViewed[i]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[i]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:i,node:r}})=>{var n,o;!this.host.paused&&t===((o=(n=this.host.scene)==null?void 0:n.video)==null?void 0:o.id)&&(this._currentlyPlayingVideo={id:t,key:i,node:r},this._streamLatestTime[i]=r.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=r.currentTime,this._streamLatestTime[i]=r.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+Jl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]},this._pageUnloading=()=>{this._streamEnded(),this._sendTrackingEvent()},this._handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this._pageUnloading()},this._handlePageHide=()=>{this._pageUnloading()},this.host=e,e.addController(this)}hostConnected(){requestAnimationFrame(()=>{var e,t,i,r;"onvisibilitychange"in document?document.addEventListener("visibilitychange",this._handleVisibilityChange):window.addEventListener("pagehide",this._handlePageHide),this.host.addEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.addEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.addEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.addEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,r;this._pageUnloading(),"onvisibilitychange"in document?document.removeEventListener("visibilitychange",this._handleVisibilityChange):window.removeEventListener("pagehide",this._handlePageHide),this.host.removeEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.removeEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.removeEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.removeEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}/**
|
172
172
|
* @license
|
173
173
|
* Copyright 2018 Google LLC
|
174
174
|
* SPDX-License-Identifier: BSD-3-Clause
|
175
|
-
*/const Ye=ls(class extends Ys{constructor(s){var e;if(super(s),s.type!==As.ATTRIBUTE||s.name!=="class"||((e=s.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(e=>s[e]).join(" ")+" "}update(s,[e]){var i,r;if(this.it===void 0){this.it=new Set,s.strings!==void 0&&(this.st=new Set(s.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in e)e[n]&&!((i=this.st)!=null&&i.has(n))&&this.it.add(n);return this.render(e)}const t=s.element.classList;for(const n of this.it)n in e||(t.remove(n),this.it.delete(n));for(const n in e){const o=!!e[n];o===this.it.has(n)||(r=this.st)!=null&&r.has(n)||(o?(t.add(n),this.it.add(n)):(t.remove(n),this.it.delete(n)))}return
|
175
|
+
*/const Ye=ls(class extends Ys{constructor(s){var e;if(super(s),s.type!==As.ATTRIBUTE||s.name!=="class"||((e=s.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(e=>s[e]).join(" ")+" "}update(s,[e]){var i,r;if(this.it===void 0){this.it=new Set,s.strings!==void 0&&(this.st=new Set(s.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in e)e[n]&&!((i=this.st)!=null&&i.has(n))&&this.it.add(n);return this.render(e)}const t=s.element.classList;for(const n of this.it)n in e||(t.remove(n),this.it.delete(n));for(const n in e){const o=!!e[n];o===this.it.has(n)||(r=this.st)!=null&&r.has(n)||(o?(t.add(n),this.it.add(n)):(t.remove(n),this.it.delete(n)))}return Ci}});/**
|
176
176
|
* @license
|
177
177
|
* Copyright 2018 Google LLC
|
178
178
|
* SPDX-License-Identifier: BSD-3-Clause
|
179
|
-
*/const Jl="important",Yf=" !"+Jl,_o=ls(class extends Ys{constructor(s){var e;if(super(s),s.type!==As.ATTRIBUTE||s.name!=="style"||((e=s.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((e,t)=>{const i=s[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(s,[e]){const{style:t}=s.element;if(this.ut===void 0)return this.ut=new Set(Object.keys(e)),this.render(e);for(const i of this.ut)e[i]==null&&(this.ut.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const r=e[i];if(r!=null){this.ut.add(i);const n=typeof r=="string"&&r.endsWith(Yf);i.includes("-")||n?t.setProperty(i,n?r.slice(0,-11):r,n?Jl:""):t[i]=r}}return mi}});function Kf(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Wl={exports:{}};(function(s,e){(function(t){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(A,l,c){if(c=c||{},A=A.trim(),l=l.trim(),!l){if(!c.alwaysNormalize)return A;var h=a.parseURL(A);if(!h)throw new Error("Error trying to parse base URL.");return h.path=a.normalizePath(h.path),a.buildURLFromParts(h)}var u=a.parseURL(l);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return c.alwaysNormalize?(u.path=a.normalizePath(u.path),a.buildURLFromParts(u)):l;var d=a.parseURL(A);if(!d)throw new Error("Error trying to parse base URL.");if(!d.netLoc&&d.path&&d.path[0]!=="/"){var g=r.exec(d.path);d.netLoc=g[1],d.path=g[2]}d.netLoc&&!d.path&&(d.path="/");var f={scheme:d.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(f.netLoc=d.netLoc,u.path[0]!=="/"))if(!u.path)f.path=d.path,u.params||(f.params=d.params,u.query||(f.query=d.query));else{var p=d.path,y=p.substring(0,p.lastIndexOf("/")+1)+u.path;f.path=a.normalizePath(y)}return f.path===null&&(f.path=c.alwaysNormalize?a.normalizePath(u.path):u.path),a.buildURLFromParts(f)},parseURL:function(A){var l=i.exec(A);return l?{scheme:l[1]||"",netLoc:l[2]||"",path:l[3]||"",params:l[4]||"",query:l[5]||"",fragment:l[6]||""}:null},normalizePath:function(A){for(A=A.split("").reverse().join("").replace(n,"");A.length!==(A=A.replace(o,"")).length;);return A.split("").reverse().join("")},buildURLFromParts:function(A){return A.scheme+A.netLoc+A.path+A.params+A.query+A.fragment}};s.exports=a})()})(Wl);var ko=Wl.exports;function ql(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(s,r).enumerable})),t.push.apply(t,i)}return t}function vt(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ql(Object(t),!0).forEach(function(i){Vf(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):ql(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}function Vf(s,e,t){return e=Wf(e),e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function Ze(){return Ze=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},Ze.apply(this,arguments)}function Jf(s,e){if(typeof s!="object"||s===null)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var i=t.call(s,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function Wf(s){var e=Jf(s,"string");return typeof e=="symbol"?e:String(e)}const ce=Number.isFinite||function(s){return typeof s=="number"&&isFinite(s)};let E=function(s){return s.MEDIA_ATTACHING="hlsMediaAttaching",s.MEDIA_ATTACHED="hlsMediaAttached",s.MEDIA_DETACHING="hlsMediaDetaching",s.MEDIA_DETACHED="hlsMediaDetached",s.BUFFER_RESET="hlsBufferReset",s.BUFFER_CODECS="hlsBufferCodecs",s.BUFFER_CREATED="hlsBufferCreated",s.BUFFER_APPENDING="hlsBufferAppending",s.BUFFER_APPENDED="hlsBufferAppended",s.BUFFER_EOS="hlsBufferEos",s.BUFFER_FLUSHING="hlsBufferFlushing",s.BUFFER_FLUSHED="hlsBufferFlushed",s.MANIFEST_LOADING="hlsManifestLoading",s.MANIFEST_LOADED="hlsManifestLoaded",s.MANIFEST_PARSED="hlsManifestParsed",s.LEVEL_SWITCHING="hlsLevelSwitching",s.LEVEL_SWITCHED="hlsLevelSwitched",s.LEVEL_LOADING="hlsLevelLoading",s.LEVEL_LOADED="hlsLevelLoaded",s.LEVEL_UPDATED="hlsLevelUpdated",s.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",s.LEVELS_UPDATED="hlsLevelsUpdated",s.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",s.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",s.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",s.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",s.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",s.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",s.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",s.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",s.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",s.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",s.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",s.CUES_PARSED="hlsCuesParsed",s.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",s.INIT_PTS_FOUND="hlsInitPtsFound",s.FRAG_LOADING="hlsFragLoading",s.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",s.FRAG_LOADED="hlsFragLoaded",s.FRAG_DECRYPTED="hlsFragDecrypted",s.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",s.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",s.FRAG_PARSING_METADATA="hlsFragParsingMetadata",s.FRAG_PARSED="hlsFragParsed",s.FRAG_BUFFERED="hlsFragBuffered",s.FRAG_CHANGED="hlsFragChanged",s.FPS_DROP="hlsFpsDrop",s.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",s.ERROR="hlsError",s.DESTROYING="hlsDestroying",s.KEY_LOADING="hlsKeyLoading",s.KEY_LOADED="hlsKeyLoaded",s.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",s.BACK_BUFFER_REACHED="hlsBackBufferReached",s}({}),ge=function(s){return s.NETWORK_ERROR="networkError",s.MEDIA_ERROR="mediaError",s.KEY_SYSTEM_ERROR="keySystemError",s.MUX_ERROR="muxError",s.OTHER_ERROR="otherError",s}({}),Y=function(s){return s.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",s.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",s.KEY_SYSTEM_NO_SESSION="keySystemNoSession",s.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",s.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",s.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",s.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",s.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",s.MANIFEST_LOAD_ERROR="manifestLoadError",s.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",s.MANIFEST_PARSING_ERROR="manifestParsingError",s.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",s.LEVEL_EMPTY_ERROR="levelEmptyError",s.LEVEL_LOAD_ERROR="levelLoadError",s.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",s.LEVEL_PARSING_ERROR="levelParsingError",s.LEVEL_SWITCH_ERROR="levelSwitchError",s.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",s.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",s.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",s.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",s.FRAG_LOAD_ERROR="fragLoadError",s.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",s.FRAG_DECRYPT_ERROR="fragDecryptError",s.FRAG_PARSING_ERROR="fragParsingError",s.FRAG_GAP="fragGap",s.REMUX_ALLOC_ERROR="remuxAllocError",s.KEY_LOAD_ERROR="keyLoadError",s.KEY_LOAD_TIMEOUT="keyLoadTimeOut",s.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",s.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",s.BUFFER_APPEND_ERROR="bufferAppendError",s.BUFFER_APPENDING_ERROR="bufferAppendingError",s.BUFFER_STALLED_ERROR="bufferStalledError",s.BUFFER_FULL_ERROR="bufferFullError",s.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",s.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",s.INTERNAL_EXCEPTION="internalException",s.INTERNAL_ABORTED="aborted",s.UNKNOWN="unknown",s}({});const Wi=function(){},No={trace:Wi,debug:Wi,log:Wi,warn:Wi,info:Wi,error:Wi};let sr=No;function qf(s){const e=self.console[s];return e?e.bind(self.console,`[${s}] >`):Wi}function jf(s,...e){e.forEach(function(t){sr[t]=s[t]?s[t].bind(s):qf(t)})}function Xf(s,e){if(self.console&&s===!0||typeof s=="object"){jf(s,"debug","log","info","warn","error");try{sr.log(`Debug logs enabled for "${e}" in hls.js version 1.4.12`)}catch{sr=No}}else sr=No}const N=sr,zf=/^(\d+)x(\d+)$/,jl=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Ke{constructor(e){typeof e=="string"&&(e=Ke.parseAttrList(e));for(const t in e)e.hasOwnProperty(t)&&(t.substring(0,2)==="X-"&&(this.clientAttrs=this.clientAttrs||[],this.clientAttrs.push(t)),this[t]=e[t])}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const i=new Uint8Array(t.length/2);for(let r=0;r<t.length/2;r++)i[r]=parseInt(t.slice(r*2,r*2+2),16);return i}else return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const i=this[e];return i?parseFloat(i):t}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=zf.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const i={},r='"';for(jl.lastIndex=0;(t=jl.exec(e))!==null;){let n=t[2];n.indexOf(r)===0&&n.lastIndexOf(r)===n.length-1&&(n=n.slice(1,-1));const o=t[1].trim();i[o]=n}return i}}function Zf(s){return s!=="ID"&&s!=="CLASS"&&s!=="START-DATE"&&s!=="DURATION"&&s!=="END-DATE"&&s!=="END-ON-NEXT"}function e0(s){return s==="SCTE35-OUT"||s==="SCTE35-IN"}class Xl{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const i=t.attr;for(const r in i)if(Object.prototype.hasOwnProperty.call(e,r)&&e[r]!==i[r]){N.warn(`DATERANGE tag attribute: "${r}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=r;break}e=Ze(new Ke({}),i,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const i=new Date(this.attr["END-DATE"]);ce(i.getTime())&&(this._endDate=i)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(ce(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&ce(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class on{constructor(){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}}}var Fe={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class zl{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[Fe.AUDIO]:null,[Fe.VIDEO]:null,[Fe.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const i=e.split("@",2),r=[];i.length===1?r[0]=t?t.byteRangeEndOffset:0:r[0]=parseInt(i[1]),r[1]=parseInt(i[0])+r[0],this._byteRange=r}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=ko.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class Fo extends zl{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new on,this.urlId=0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const i=Object.keys(this.levelkeys);if(i.length===1)return this._decryptdata=this.levelkeys[i[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!ce(this.programDateTime))return null;const e=ce(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),i=t.length;if(i>1||i===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,i,r,n,o=!1){const{elementaryStreams:a}=this,A=a[e];if(!A){a[e]={startPTS:t,endPTS:i,startDTS:r,endDTS:n,partial:o};return}A.startPTS=Math.min(A.startPTS,t),A.endPTS=Math.max(A.endPTS,i),A.startDTS=Math.min(A.startDTS,r),A.endDTS=Math.max(A.endDTS,n)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[Fe.AUDIO]=null,e[Fe.VIDEO]=null,e[Fe.AUDIOVIDEO]=null}}class t0 extends zl{constructor(e,t,i,r,n){super(i),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new on,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=r;const o=e.enumeratedString("BYTERANGE");o&&this.setByteRange(o,n),n&&(this.fragOffset=n.fragOffset+n.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const i0=10;class s0{constructor(e){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.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,i=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!i||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&i>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?ce(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||i0}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function Mo(s){return Uint8Array.from(atob(s),e=>e.charCodeAt(0))}function r0(s){const e=Zl(s).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function n0(s){const e=function(i,r,n){const o=i[r];i[r]=i[n],i[n]=o};e(s,0,3),e(s,1,2),e(s,4,5),e(s,6,7)}function o0(s){const e=s.split(":");let t=null;if(e[0]==="data"&&e.length===2){const i=e[1].split(";"),r=i[i.length-1].split(",");if(r.length===2){const n=r[0]==="base64",o=r[1];n?(i.splice(-1,1),t=Mo(o)):t=r0(o)}}return t}function Zl(s){return Uint8Array.from(unescape(encodeURIComponent(s)),e=>e.charCodeAt(0))}var Ve={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Qt={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function ec(s){switch(s){case Qt.FAIRPLAY:return Ve.FAIRPLAY;case Qt.PLAYREADY:return Ve.PLAYREADY;case Qt.WIDEVINE:return Ve.WIDEVINE;case Qt.CLEARKEY:return Ve.CLEARKEY}}var tc={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function a0(s){if(s===tc.WIDEVINE)return Ve.WIDEVINE}function ic(s){switch(s){case Ve.FAIRPLAY:return Qt.FAIRPLAY;case Ve.PLAYREADY:return Qt.PLAYREADY;case Ve.WIDEVINE:return Qt.WIDEVINE;case Ve.CLEARKEY:return Qt.CLEARKEY}}function Po(s){const{drmSystems:e,widevineLicenseUrl:t}=s,i=e?[Ve.FAIRPLAY,Ve.WIDEVINE,Ve.PLAYREADY,Ve.CLEARKEY].filter(r=>!!e[r]):[];return!i[Ve.WIDEVINE]&&t&&i.push(Ve.WIDEVINE),i}const sc=function(){return typeof self<"u"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function A0(s,e,t,i){let r;switch(s){case Ve.FAIRPLAY:r=["cenc","sinf"];break;case Ve.WIDEVINE:case Ve.PLAYREADY:r=["cenc"];break;case Ve.CLEARKEY:r=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${s}`)}return l0(r,e,t,i)}function l0(s,e,t,i){return[{initDataTypes:s,persistentState:i.persistentState||"not-allowed",distinctiveIdentifier:i.distinctiveIdentifier||"not-allowed",sessionTypes:i.sessionTypes||[i.sessionType||"temporary"],audioCapabilities:e.map(n=>({contentType:`audio/mp4; codecs="${n}"`,robustness:i.audioRobustness||"",encryptionScheme:i.audioEncryptionScheme||null})),videoCapabilities:t.map(n=>({contentType:`video/mp4; codecs="${n}"`,robustness:i.videoRobustness||"",encryptionScheme:i.videoEncryptionScheme||null}))}]}function qi(s,e,t){return Uint8Array.prototype.slice?s.slice(e,t):new Uint8Array(Array.prototype.slice.call(s,e,t))}const Oo=(s,e)=>e+10<=s.length&&s[e]===73&&s[e+1]===68&&s[e+2]===51&&s[e+3]<255&&s[e+4]<255&&s[e+6]<128&&s[e+7]<128&&s[e+8]<128&&s[e+9]<128,rc=(s,e)=>e+10<=s.length&&s[e]===51&&s[e+1]===68&&s[e+2]===73&&s[e+3]<255&&s[e+4]<255&&s[e+6]<128&&s[e+7]<128&&s[e+8]<128&&s[e+9]<128,an=(s,e)=>{const t=e;let i=0;for(;Oo(s,e);){i+=10;const r=An(s,e+6);i+=r,rc(s,e+10)&&(i+=10),e+=i}if(i>0)return s.subarray(t,t+i)},An=(s,e)=>{let t=0;return t=(s[e]&127)<<21,t|=(s[e+1]&127)<<14,t|=(s[e+2]&127)<<7,t|=s[e+3]&127,t},c0=(s,e)=>Oo(s,e)&&An(s,e+6)+10<=s.length-e,h0=s=>{const e=oc(s);for(let t=0;t<e.length;t++){const i=e[t];if(nc(i))return E0(i)}},nc=s=>s&&s.key==="PRIV"&&s.info==="com.apple.streaming.transportStreamTimestamp",u0=s=>{const e=String.fromCharCode(s[0],s[1],s[2],s[3]),t=An(s,4),i=10;return{type:e,size:t,data:s.subarray(i,i+t)}},oc=s=>{let e=0;const t=[];for(;Oo(s,e);){const i=An(s,e+6);e+=10;const r=e+i;for(;e+8<r;){const n=u0(s.subarray(e)),o=d0(n);o&&t.push(o),e+=n.size+10}rc(s,e)&&(e+=10)}return t},d0=s=>s.type==="PRIV"?g0(s):s.type[0]==="W"?p0(s):f0(s),g0=s=>{if(s.size<2)return;const e=Vt(s.data,!0),t=new Uint8Array(s.data.subarray(e.length+1));return{key:s.type,info:e,data:t.buffer}},f0=s=>{if(s.size<2)return;if(s.type==="TXXX"){let t=1;const i=Vt(s.data.subarray(t),!0);t+=i.length+1;const r=Vt(s.data.subarray(t));return{key:s.type,info:i,data:r}}const e=Vt(s.data.subarray(1));return{key:s.type,data:e}},p0=s=>{if(s.type==="WXXX"){if(s.size<2)return;let t=1;const i=Vt(s.data.subarray(t),!0);t+=i.length+1;const r=Vt(s.data.subarray(t));return{key:s.type,info:i,data:r}}const e=Vt(s.data);return{key:s.type,data:e}},E0=s=>{if(s.data.byteLength===8){const e=new Uint8Array(s.data),t=e[3]&1;let i=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return i/=45,t&&(i+=4772185884e-2),Math.round(i)}},Vt=(s,e=!1)=>{const t=I0();if(t){const l=t.decode(s);if(e){const c=l.indexOf("\0");return c!==-1?l.substring(0,c):l}return l.replace(/\0/g,"")}const i=s.length;let r,n,o,a="",A=0;for(;A<i;){if(r=s[A++],r===0&&e)return a;if(r===0||r===3)continue;switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(r);break;case 12:case 13:n=s[A++],a+=String.fromCharCode((r&31)<<6|n&63);break;case 14:n=s[A++],o=s[A++],a+=String.fromCharCode((r&15)<<12|(n&63)<<6|(o&63)<<0);break}}return a};let Uo;function I0(){return!Uo&&typeof self.TextDecoder<"u"&&(Uo=new self.TextDecoder("utf-8")),Uo}const Jt={hexDump:function(s){let e="";for(let t=0;t<s.length;t++){let i=s[t].toString(16);i.length<2&&(i="0"+i),e+=i}return e}},ln=Math.pow(2,32)-1,m0=[].push,ac={video:1,audio:2,id3:3,text:4};function At(s){return String.fromCharCode.apply(null,s)}function Ac(s,e){const t=s[e]<<8|s[e+1];return t<0?65536+t:t}function me(s,e){const t=lc(s,e);return t<0?4294967296+t:t}function lc(s,e){return s[e]<<24|s[e+1]<<16|s[e+2]<<8|s[e+3]}function Go(s,e,t){s[e]=t>>24,s[e+1]=t>>16&255,s[e+2]=t>>8&255,s[e+3]=t&255}function Te(s,e){const t=[];if(!e.length)return t;const i=s.byteLength;for(let r=0;r<i;){const n=me(s,r),o=At(s.subarray(r+4,r+8)),a=n>1?r+n:i;if(o===e[0])if(e.length===1)t.push(s.subarray(r+8,a));else{const A=Te(s.subarray(r+8,a),e.slice(1));A.length&&m0.apply(t,A)}r=a}return t}function C0(s){const e=[],t=s[0];let i=8;const r=me(s,i);i+=4;const n=0,o=0;t===0?i+=8:i+=16,i+=2;let a=s.length+o;const A=Ac(s,i);i+=2;for(let l=0;l<A;l++){let c=i;const h=me(s,c);c+=4;const u=h&2147483647;if((h&2147483648)>>>31===1)return N.warn("SIDX has hierarchical references (not supported)"),null;const g=me(s,c);c+=4,e.push({referenceSize:u,subsegmentDuration:g,info:{duration:g/r,start:a,end:a+u-1}}),a+=u,c+=4,i=c}return{earliestPresentationTime:n,timescale:r,version:t,referencesCount:A,references:e}}function cc(s){const e=[],t=Te(s,["moov","trak"]);for(let r=0;r<t.length;r++){const n=t[r],o=Te(n,["tkhd"])[0];if(o){let a=o[0],A=a===0?12:20;const l=me(o,A),c=Te(n,["mdia","mdhd"])[0];if(c){a=c[0],A=a===0?12:20;const h=me(c,A),u=Te(n,["mdia","hdlr"])[0];if(u){const d=At(u.subarray(8,12)),g={soun:Fe.AUDIO,vide:Fe.VIDEO}[d];if(g){const f=Te(n,["mdia","minf","stbl","stsd"])[0];let p;f&&(p=At(f.subarray(12,16))),e[l]={timescale:h,type:g},e[g]={timescale:h,id:l,codec:p}}}}}}return Te(s,["moov","mvex","trex"]).forEach(r=>{const n=me(r,4),o=e[n];o&&(o.default={duration:me(r,12),flags:me(r,20)})}),e}function y0(s,e){if(!s||!e)return s;const t=e.keyId;return t&&e.isCommonEncryption&&Te(s,["moov","trak"]).forEach(r=>{const o=Te(r,["mdia","minf","stbl","stsd"])[0].subarray(8);let a=Te(o,["enca"]);const A=a.length>0;A||(a=Te(o,["encv"])),a.forEach(l=>{const c=A?l.subarray(28):l.subarray(78);Te(c,["sinf"]).forEach(u=>{const d=hc(u);if(d){const g=d.subarray(8,24);g.some(f=>f!==0)||(N.log(`[eme] Patching keyId in 'enc${A?"a":"v"}>sinf>>tenc' box: ${Jt.hexDump(g)} -> ${Jt.hexDump(t)}`),d.set(t,8))}})})}),s}function hc(s){const e=Te(s,["schm"])[0];if(e){const t=At(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return Te(s,["schi","tenc"])[0]}return N.error("[eme] missing 'schm' box"),null}function B0(s,e){return Te(e,["moof","traf"]).reduce((t,i)=>{const r=Te(i,["tfdt"])[0],n=r[0],o=Te(i,["tfhd"]).reduce((a,A)=>{const l=me(A,4),c=s[l];if(c){let h=me(r,4);if(n===1){if(h===ln)return N.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),a;h*=ln+1,h+=me(r,8)}const u=c.timescale||9e4,d=h/u;if(isFinite(d)&&(a===null||d<a))return d}return a},null);return o!==null&&isFinite(o)&&(t===null||o<t)?o:t},null)}function v0(s,e){let t=0,i=0,r=0;const n=Te(s,["moof","traf"]);for(let o=0;o<n.length;o++){const a=n[o],A=Te(a,["tfhd"])[0],l=me(A,4),c=e[l];if(!c)continue;const h=c.default,u=me(A,0)|(h==null?void 0:h.flags);let d=h==null?void 0:h.duration;u&8&&(u&2?d=me(A,12):d=me(A,8));const g=c.timescale||9e4,f=Te(a,["trun"]);for(let p=0;p<f.length;p++){if(t=Q0(f[p]),!t&&d){const y=me(f[p],4);t=d*y}c.type===Fe.VIDEO?i+=t/g:c.type===Fe.AUDIO&&(r+=t/g)}}if(i===0&&r===0){let o=0;const a=Te(s,["sidx"]);for(let A=0;A<a.length;A++){const l=C0(a[A]);l!=null&&l.references&&(o+=l.references.reduce((c,h)=>c+h.info.duration||0,0))}return o}return i||r}function Q0(s){const e=me(s,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let i=0;const r=me(s,4);for(let n=0;n<r;n++){if(e&256){const o=me(s,t);i+=o,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return i}function b0(s,e,t){Te(e,["moof","traf"]).forEach(i=>{Te(i,["tfhd"]).forEach(r=>{const n=me(r,4),o=s[n];if(!o)return;const a=o.timescale||9e4;Te(i,["tfdt"]).forEach(A=>{const l=A[0];let c=me(A,4);if(l===0)c-=t*a,c=Math.max(c,0),Go(A,4,c);else{c*=Math.pow(2,32),c+=me(A,8),c-=t*a,c=Math.max(c,0);const h=Math.floor(c/(ln+1)),u=Math.floor(c%(ln+1));Go(A,4,h),Go(A,8,u)}})})})}function S0(s){const e={valid:null,remainder:null},t=Te(s,["moof"]);if(t){if(t.length<2)return e.remainder=s,e}else return e;const i=t[t.length-1];return e.valid=qi(s,0,i.byteOffset-8),e.remainder=qi(s,i.byteOffset-8),e}function ji(s,e){const t=new Uint8Array(s.length+e.length);return t.set(s),t.set(e,s.length),t}function uc(s,e){const t=[],i=e.samples,r=e.timescale,n=e.id;let o=!1;return Te(i,["moof"]).map(A=>{const l=A.byteOffset-8;Te(A,["traf"]).map(h=>{const u=Te(h,["tfdt"]).map(d=>{const g=d[0];let f=me(d,4);return g===1&&(f*=Math.pow(2,32),f+=me(d,8)),f/r})[0];return u!==void 0&&(s=u),Te(h,["tfhd"]).map(d=>{const g=me(d,4),f=me(d,0)&16777215,p=(f&1)!==0,y=(f&2)!==0,B=(f&8)!==0;let Q=0;const C=(f&16)!==0;let T=0;const b=(f&32)!==0;let L=8;g===n&&(p&&(L+=8),y&&(L+=4),B&&(Q=me(d,L),L+=4),C&&(T=me(d,L),L+=4),b&&(L+=4),e.type==="video"&&(o=w0(e.codec)),Te(h,["trun"]).map(R=>{const O=R[0],k=me(R,0)&16777215,W=(k&1)!==0;let $=0;const te=(k&4)!==0,ee=(k&256)!==0;let S=0;const D=(k&512)!==0;let U=0;const v=(k&1024)!==0,w=(k&2048)!==0;let F=0;const H=me(R,4);let K=8;W&&($=me(R,K),K+=4),te&&(K+=4);let j=$+l;for(let se=0;se<H;se++){if(ee?(S=me(R,K),K+=4):S=Q,D?(U=me(R,K),K+=4):U=T,v&&(K+=4),w&&(O===0?F=me(R,K):F=lc(R,K),K+=4),e.type===Fe.VIDEO){let ue=0;for(;ue<U;){const Ae=me(i,j);if(j+=4,T0(o,i[j])){const Ce=i.subarray(j,j+Ae);dc(Ce,o?2:1,s+F/r,t)}j+=Ae,ue+=Ae+4}}s+=S/r}}))})})}),t}function w0(s){if(!s)return!1;const e=s.indexOf("."),t=e<0?s:s.substring(0,e);return t==="hvc1"||t==="hev1"||t==="dvh1"||t==="dvhe"}function T0(s,e){if(s){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function dc(s,e,t,i){const r=gc(s);let n=0;n+=e;let o=0,a=0,A=!1,l=0;for(;n<r.length;){o=0;do{if(n>=r.length)break;l=r[n++],o+=l}while(l===255);a=0;do{if(n>=r.length)break;l=r[n++],a+=l}while(l===255);const c=r.length-n;if(!A&&o===4&&n<r.length){if(A=!0,r[n++]===181){const u=Ac(r,n);if(n+=2,u===49){const d=me(r,n);if(n+=4,d===1195456820){const g=r[n++];if(g===3){const f=r[n++],p=31&f,y=64&f,B=y?2+p*3:0,Q=new Uint8Array(B);if(y){Q[0]=f;for(let C=1;C<B;C++)Q[C]=r[n++]}i.push({type:g,payloadType:o,pts:t,bytes:Q})}}}}}else if(o===5&&a<c){if(A=!0,a>16){const h=[];for(let g=0;g<16;g++){const f=r[n++].toString(16);h.push(f.length==1?"0"+f:f),(g===3||g===5||g===7||g===9)&&h.push("-")}const u=a-16,d=new Uint8Array(u);for(let g=0;g<u;g++)d[g]=r[n++];i.push({payloadType:o,pts:t,uuid:h.join(""),userData:Vt(d),userDataBytes:d})}}else if(a<c)n+=a;else if(a>c)break}}function gc(s){const e=s.byteLength,t=[];let i=1;for(;i<e-2;)s[i]===0&&s[i+1]===0&&s[i+2]===3?(t.push(i+2),i+=2):i++;if(t.length===0)return s;const r=e-t.length,n=new Uint8Array(r);let o=0;for(i=0;i<r;o++,i++)o===t[0]&&(o++,t.shift()),n[i]=s[o];return n}function x0(s){const e=s[0];let t="",i="",r=0,n=0,o=0,a=0,A=0,l=0;if(e===0){for(;At(s.subarray(l,l+1))!=="\0";)t+=At(s.subarray(l,l+1)),l+=1;for(t+=At(s.subarray(l,l+1)),l+=1;At(s.subarray(l,l+1))!=="\0";)i+=At(s.subarray(l,l+1)),l+=1;i+=At(s.subarray(l,l+1)),l+=1,r=me(s,12),n=me(s,16),a=me(s,20),A=me(s,24),l=28}else if(e===1){l+=4,r=me(s,l),l+=4;const h=me(s,l);l+=4;const u=me(s,l);for(l+=4,o=4294967296*h+u,Number.isSafeInteger(o)||(o=Number.MAX_SAFE_INTEGER,N.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),a=me(s,l),l+=4,A=me(s,l),l+=4;At(s.subarray(l,l+1))!=="\0";)t+=At(s.subarray(l,l+1)),l+=1;for(t+=At(s.subarray(l,l+1)),l+=1;At(s.subarray(l,l+1))!=="\0";)i+=At(s.subarray(l,l+1)),l+=1;i+=At(s.subarray(l,l+1)),l+=1}const c=s.subarray(l,s.byteLength);return{schemeIdUri:t,value:i,timeScale:r,presentationTime:o,presentationTimeDelta:n,eventDuration:a,id:A,payload:c}}function D0(s,...e){const t=e.length;let i=8,r=t;for(;r--;)i+=e[r].byteLength;const n=new Uint8Array(i);for(n[0]=i>>24&255,n[1]=i>>16&255,n[2]=i>>8&255,n[3]=i&255,n.set(s,4),r=0,i=8;r<t;r++)n.set(e[r],i),i+=e[r].byteLength;return n}function R0(s,e,t){if(s.byteLength!==16)throw new RangeError("Invalid system id");let i,r;if(e){i=1,r=new Uint8Array(e.length*16);for(let a=0;a<e.length;a++){const A=e[a];if(A.byteLength!==16)throw new RangeError("Invalid key");r.set(A,a*16)}}else i=0,r=new Uint8Array;let n;i>0?(n=new Uint8Array(4),e.length>0&&new DataView(n.buffer).setUint32(0,e.length,!1)):n=new Uint8Array;const o=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(o.buffer).setUint32(0,t.byteLength,!1),D0([112,115,115,104],new Uint8Array([i,0,0,0]),s,n,r,o,t||new Uint8Array)}function L0(s){if(!(s instanceof ArrayBuffer)||s.byteLength<32)return null;const e={version:0,systemId:"",kids:null,data:null},t=new DataView(s),i=t.getUint32(0);if(s.byteLength!==i&&i>44||t.getUint32(4)!==1886614376||(e.version=t.getUint32(8)>>>24,e.version>1))return null;e.systemId=Jt.hexDump(new Uint8Array(s,12,16));const n=t.getUint32(28);if(e.version===0){if(i-32<n)return null;e.data=new Uint8Array(s,32,n)}else if(e.version===1){e.kids=[];for(let o=0;o<n;o++)e.kids.push(new Uint8Array(s,32+o*16,16))}return e}let cn={};class rr{static clearKeyUriToKeyIdMap(){cn={}}constructor(e,t,i,r=[1],n=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=e,this.uri=t,this.keyFormat=i,this.keyFormatVersions=r,this.iv=n,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&e!=="AES-128"}isSupported(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case Qt.FAIRPLAY:case Qt.WIDEVINE:case Qt.PLAYREADY:case Qt.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof e!="number"&&(this.method==="AES-128"&&!this.iv&&N.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const i=_0(e);return new rr(this.method,this.uri,"identity",this.keyFormatVersions,i)}const t=o0(this.uri);if(t)switch(this.keyFormat){case Qt.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case Qt.PLAYREADY:{const i=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=R0(i,null,t);const r=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),n=String.fromCharCode.apply(null,Array.from(r)),o=n.substring(n.indexOf("<"),n.length),l=new DOMParser().parseFromString(o,"text/xml").getElementsByTagName("KID")[0];if(l){const c=l.childNodes[0]?l.childNodes[0].nodeValue:l.getAttribute("VALUE");if(c){const h=Mo(c).subarray(0,16);n0(h),this.keyId=h}}break}default:{let i=t.subarray(0,16);if(i.length!==16){const r=new Uint8Array(16);r.set(i,16-i.length),i=r}this.keyId=i;break}}if(!this.keyId||this.keyId.byteLength!==16){let i=cn[this.uri];if(!i){const r=Object.keys(cn).length%Number.MAX_SAFE_INTEGER;i=new Uint8Array(16),new DataView(i.buffer,12,4).setUint32(0,r),cn[this.uri]=i}this.keyId=i}return this}}function _0(s){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=s>>8*(15-t)&255;return e}const fc=/\{\$([a-zA-Z0-9-_]+)\}/g;function pc(s){return fc.test(s)}function bt(s,e,t){if(s.variableList!==null||s.hasVariableRefs)for(let i=t.length;i--;){const r=t[i],n=e[r];n&&(e[r]=Ho(s,n))}}function Ho(s,e){if(s.variableList!==null||s.hasVariableRefs){const t=s.variableList;return e.replace(fc,i=>{const r=i.substring(2,i.length-1),n=t==null?void 0:t[r];return n===void 0?(s.playlistParsingError||(s.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),i):n})}return e}function Ec(s,e,t){let i=s.variableList;i||(s.variableList=i={});let r,n;if("QUERYPARAM"in e){r=e.QUERYPARAM;try{const o=new self.URL(t).searchParams;if(o.has(r))n=o.get(r);else throw new Error(`"${r}" does not match any query parameter in URI: "${t}"`)}catch(o){s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${o.message}`))}}else r=e.NAME,n=e.VALUE;r in i?s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):i[r]=n||""}function k0(s,e,t){const i=e.IMPORT;if(t&&i in t){let r=s.variableList;r||(s.variableList=r={}),r[i]=t[i]}else s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${i}"`))}function hn(){if(!(typeof self>"u"))return self.MediaSource||self.WebKitMediaSource}const N0={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}},Ic=hn();function F0(s,e){const t=N0[e];return!!t&&t[s.slice(0,4)]===!0}function $o(s,e){var t;return(t=Ic==null?void 0:Ic.isTypeSupported(`${e||"video"}/mp4;codecs="${s}"`))!=null?t:!1}const mc=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Cc=/#EXT-X-MEDIA:(.*)/g,M0=/^#EXT(?:INF|-X-TARGETDURATION):/m,yc=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),P0=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|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("|"));class Pt{static findGroup(e,t){for(let i=0;i<e.length;i++){const r=e[i];if(r.id===t)return r}}static convertAVC1ToAVCOTI(e){const t=e.split(".");if(t.length>2){let i=t.shift()+".";return i+=parseInt(t.shift()).toString(16),i+=("000"+parseInt(t.shift()).toString(16)).slice(-4),i}return e}static resolve(e,t){return ko.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return M0.test(e)}static parseMasterPlaylist(e,t){const i=pc(e),r={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:i},n=[];mc.lastIndex=0;let o;for(;(o=mc.exec(e))!=null;)if(o[1]){var a;const l=new Ke(o[1]);bt(r,l,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const c=Ho(r,o[2]),h={attrs:l,bitrate:l.decimalInteger("AVERAGE-BANDWIDTH")||l.decimalInteger("BANDWIDTH"),name:l.NAME,url:Pt.resolve(c,t)},u=l.decimalResolution("RESOLUTION");u&&(h.width=u.width,h.height=u.height),O0((l.CODECS||"").split(/[ ,]+/).filter(d=>d),h),h.videoCodec&&h.videoCodec.indexOf("avc1")!==-1&&(h.videoCodec=Pt.convertAVC1ToAVCOTI(h.videoCodec)),(a=h.unknownCodecs)!=null&&a.length||n.push(h),r.levels.push(h)}else if(o[3]){const l=o[3],c=o[4];switch(l){case"SESSION-DATA":{const h=new Ke(c);bt(r,h,["DATA-ID","LANGUAGE","VALUE","URI"]);const u=h["DATA-ID"];u&&(r.sessionData===null&&(r.sessionData={}),r.sessionData[u]=h);break}case"SESSION-KEY":{const h=Bc(c,t,r);h.encrypted&&h.isSupported()?(r.sessionKeys===null&&(r.sessionKeys=[]),r.sessionKeys.push(h)):N.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${c}"`);break}case"DEFINE":{{const h=new Ke(c);bt(r,h,["NAME","VALUE","QUERYPARAM"]),Ec(r,h,t)}break}case"CONTENT-STEERING":{const h=new Ke(c);bt(r,h,["SERVER-URI","PATHWAY-ID"]),r.contentSteering={uri:Pt.resolve(h["SERVER-URI"],t),pathwayId:h["PATHWAY-ID"]||"."};break}case"START":{r.startTimeOffset=vc(c);break}}}const A=n.length>0&&n.length<r.levels.length;return r.levels=A?n:r.levels,r.levels.length===0&&(r.playlistParsingError=new Error("no levels found in manifest")),r}static parseMasterPlaylistMedia(e,t,i){let r;const n={},o=i.levels,a={AUDIO:o.map(l=>({id:l.attrs.AUDIO,audioCodec:l.audioCodec})),SUBTITLES:o.map(l=>({id:l.attrs.SUBTITLES,textCodec:l.textCodec})),"CLOSED-CAPTIONS":[]};let A=0;for(Cc.lastIndex=0;(r=Cc.exec(e))!==null;){const l=new Ke(r[1]),c=l.TYPE;if(c){const h=a[c],u=n[c]||[];n[c]=u,bt(i,l,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const d={attrs:l,bitrate:0,id:A++,groupId:l["GROUP-ID"]||"",instreamId:l["INSTREAM-ID"],name:l.NAME||l.LANGUAGE||"",type:c,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:l.LANGUAGE,url:l.URI?Pt.resolve(l.URI,t):""};if(h!=null&&h.length){const g=Pt.findGroup(h,d.groupId)||h[0];Qc(d,g,"audioCodec"),Qc(d,g,"textCodec")}u.push(d)}}return n}static parseLevelPlaylist(e,t,i,r,n,o){const a=new s0(t),A=a.fragments;let l=null,c=0,h=0,u=0,d=0,g=null,f=new Fo(r,t),p,y,B,Q=-1,C=!1;for(yc.lastIndex=0,a.m3u8=e,a.hasVariableRefs=pc(e);(p=yc.exec(e))!==null;){C&&(C=!1,f=new Fo(r,t),f.start=u,f.sn=c,f.cc=d,f.level=i,l&&(f.initSegment=l,f.rawProgramDateTime=l.rawProgramDateTime,l.rawProgramDateTime=null));const R=p[1];if(R){f.duration=parseFloat(R);const O=(" "+p[2]).slice(1);f.title=O||null,f.tagList.push(O?["INF",R,O]:["INF",R])}else if(p[3]){if(ce(f.duration)){f.start=u,B&&wc(f,B,a),f.sn=c,f.level=i,f.cc=d,f.urlId=n,A.push(f);const O=(" "+p[3]).slice(1);f.relurl=Ho(a,O),bc(f,g),g=f,u+=f.duration,c++,h=0,C=!0}}else if(p[4]){const O=(" "+p[4]).slice(1);g?f.setByteRange(O,g):f.setByteRange(O)}else if(p[5])f.rawProgramDateTime=(" "+p[5]).slice(1),f.tagList.push(["PROGRAM-DATE-TIME",f.rawProgramDateTime]),Q===-1&&(Q=A.length);else{if(p=p[0].match(P0),!p){N.warn("No matches on slow regex match for level playlist!");continue}for(y=1;y<p.length&&!(typeof p[y]<"u");y++);const O=(" "+p[y]).slice(1),k=(" "+p[y+1]).slice(1),W=p[y+2]?(" "+p[y+2]).slice(1):"";switch(O){case"PLAYLIST-TYPE":a.type=k.toUpperCase();break;case"MEDIA-SEQUENCE":c=a.startSN=parseInt(k);break;case"SKIP":{const $=new Ke(k);bt(a,$,["RECENTLY-REMOVED-DATERANGES"]);const te=$.decimalInteger("SKIPPED-SEGMENTS");if(ce(te)){a.skippedSegments=te;for(let S=te;S--;)A.unshift(null);c+=te}const ee=$.enumeratedString("RECENTLY-REMOVED-DATERANGES");ee&&(a.recentlyRemovedDateranges=ee.split(" "));break}case"TARGETDURATION":a.targetduration=Math.max(parseInt(k),1);break;case"VERSION":a.version=parseInt(k);break;case"EXTM3U":break;case"ENDLIST":a.live=!1;break;case"#":(k||W)&&f.tagList.push(W?[k,W]:[k]);break;case"DISCONTINUITY":d++,f.tagList.push(["DIS"]);break;case"GAP":f.gap=!0,f.tagList.push([O]);break;case"BITRATE":f.tagList.push([O,k]);break;case"DATERANGE":{const $=new Ke(k);bt(a,$,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),bt(a,$,$.clientAttrs);const te=new Xl($,a.dateRanges[$.ID]);te.isValid||a.skippedSegments?a.dateRanges[te.id]=te:N.warn(`Ignoring invalid DATERANGE tag: "${k}"`),f.tagList.push(["EXT-X-DATERANGE",k]);break}case"DEFINE":{{const $=new Ke(k);bt(a,$,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in $?k0(a,$,o):Ec(a,$,t)}break}case"DISCONTINUITY-SEQUENCE":d=parseInt(k);break;case"KEY":{const $=Bc(k,t,a);if($.isSupported()){if($.method==="NONE"){B=void 0;break}B||(B={}),B[$.keyFormat]&&(B=Ze({},B)),B[$.keyFormat]=$}else N.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${k}"`);break}case"START":a.startTimeOffset=vc(k);break;case"MAP":{const $=new Ke(k);if(bt(a,$,["BYTERANGE","URI"]),f.duration){const te=new Fo(r,t);Sc(te,$,i,B),l=te,f.initSegment=l,l.rawProgramDateTime&&!f.rawProgramDateTime&&(f.rawProgramDateTime=l.rawProgramDateTime)}else Sc(f,$,i,B),l=f,C=!0;break}case"SERVER-CONTROL":{const $=new Ke(k);a.canBlockReload=$.bool("CAN-BLOCK-RELOAD"),a.canSkipUntil=$.optionalFloat("CAN-SKIP-UNTIL",0),a.canSkipDateRanges=a.canSkipUntil>0&&$.bool("CAN-SKIP-DATERANGES"),a.partHoldBack=$.optionalFloat("PART-HOLD-BACK",0),a.holdBack=$.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const $=new Ke(k);a.partTarget=$.decimalFloatingPoint("PART-TARGET");break}case"PART":{let $=a.partList;$||($=a.partList=[]);const te=h>0?$[$.length-1]:void 0,ee=h++,S=new Ke(k);bt(a,S,["BYTERANGE","URI"]);const D=new t0(S,f,t,ee,te);$.push(D),f.duration+=D.duration;break}case"PRELOAD-HINT":{const $=new Ke(k);bt(a,$,["URI"]),a.preloadHint=$;break}case"RENDITION-REPORT":{const $=new Ke(k);bt(a,$,["URI"]),a.renditionReports=a.renditionReports||[],a.renditionReports.push($);break}default:N.warn(`line parsed but not handled: ${p}`);break}}}g&&!g.relurl?(A.pop(),u-=g.duration,a.partList&&(a.fragmentHint=g)):a.partList&&(bc(f,g),f.cc=d,a.fragmentHint=f,B&&wc(f,B,a));const T=A.length,b=A[0],L=A[T-1];if(u+=a.skippedSegments*a.targetduration,u>0&&T&&L){a.averagetargetduration=u/T;const R=L.sn;a.endSN=R!=="initSegment"?R:0,a.live||(L.endList=!0),b&&(a.startCC=b.cc)}else a.endSN=0,a.startCC=0;return a.fragmentHint&&(u+=a.fragmentHint.duration),a.totalduration=u,a.endCC=d,Q>0&&U0(A,Q),a}}function Bc(s,e,t){var i,r;const n=new Ke(s);bt(t,n,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const o=(i=n.METHOD)!=null?i:"",a=n.URI,A=n.hexadecimalInteger("IV"),l=n.KEYFORMATVERSIONS,c=(r=n.KEYFORMAT)!=null?r:"identity";a&&n.IV&&!A&&N.error(`Invalid IV: ${n.IV}`);const h=a?Pt.resolve(a,e):"",u=(l||"1").split("/").map(Number).filter(Number.isFinite);return new rr(o,h,c,u,A)}function vc(s){const t=new Ke(s).decimalFloatingPoint("TIME-OFFSET");return ce(t)?t:null}function O0(s,e){["video","audio","text"].forEach(t=>{const i=s.filter(r=>F0(r,t));if(i.length){const r=i.filter(n=>n.lastIndexOf("avc1",0)===0||n.lastIndexOf("mp4a",0)===0);e[`${t}Codec`]=r.length>0?r[0]:i[0],s=s.filter(n=>i.indexOf(n)===-1)}}),e.unknownCodecs=s}function Qc(s,e,t){const i=e[t];i&&(s[t]=i)}function U0(s,e){let t=s[e];for(let i=e;i--;){const r=s[i];if(!r)return;r.programDateTime=t.programDateTime-r.duration*1e3,t=r}}function bc(s,e){s.rawProgramDateTime?s.programDateTime=Date.parse(s.rawProgramDateTime):e!=null&&e.programDateTime&&(s.programDateTime=e.endProgramDateTime),ce(s.programDateTime)||(s.programDateTime=null,s.rawProgramDateTime=null)}function Sc(s,e,t,i){s.relurl=e.URI,e.BYTERANGE&&s.setByteRange(e.BYTERANGE),s.level=t,s.sn="initSegment",i&&(s.levelkeys=i),s.initSegment=null}function wc(s,e,t){s.levelkeys=e;const{encryptedFragments:i}=t;(!i.length||i[i.length-1].levelkeys!==e)&&Object.keys(e).some(r=>e[r].isCommonEncryption)&&i.push(s)}var De={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},pe={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Tc(s){const{type:e}=s;switch(e){case De.AUDIO_TRACK:return pe.AUDIO;case De.SUBTITLE_TRACK:return pe.SUBTITLE;default:return pe.MAIN}}function Yo(s,e){let t=s.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class G0{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.LEVEL_LOADING,this.onLevelLoading,this),e.on(E.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(E.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.LEVEL_LOADING,this.onLevelLoading,this),e.off(E.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(E.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,i=t.pLoader,r=t.loader,n=i||r,o=new n(t);return this.loaders[e.type]=o,o}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:i}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:De.MANIFEST,url:i,deliveryDirectives:null})}onLevelLoading(e,t){const{id:i,level:r,url:n,deliveryDirectives:o}=t;this.load({id:i,level:r,responseType:"text",type:De.LEVEL,url:n,deliveryDirectives:o})}onAudioTrackLoading(e,t){const{id:i,groupId:r,url:n,deliveryDirectives:o}=t;this.load({id:i,groupId:r,level:null,responseType:"text",type:De.AUDIO_TRACK,url:n,deliveryDirectives:o})}onSubtitleTrackLoading(e,t){const{id:i,groupId:r,url:n,deliveryDirectives:o}=t;this.load({id:i,groupId:r,level:null,responseType:"text",type:De.SUBTITLE_TRACK,url:n,deliveryDirectives:o})}load(e){var t;const i=this.hls.config;let r=this.getInternalLoader(e);if(r){const l=r.context;if(l&&l.url===e.url){N.trace("[playlist-loader]: playlist request ongoing");return}N.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),r.abort()}let n;if(e.type===De.MANIFEST?n=i.manifestLoadPolicy.default:n=Ze({},i.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),r=this.createInternalLoader(e),(t=e.deliveryDirectives)!=null&&t.part){let l;if(e.type===De.LEVEL&&e.level!==null?l=this.hls.levels[e.level].details:e.type===De.AUDIO_TRACK&&e.id!==null?l=this.hls.audioTracks[e.id].details:e.type===De.SUBTITLE_TRACK&&e.id!==null&&(l=this.hls.subtitleTracks[e.id].details),l){const c=l.partTarget,h=l.targetduration;if(c&&h){const u=Math.max(c*3,h*.8)*1e3;n=Ze({},n,{maxTimeToFirstByteMs:Math.min(u,n.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(u,n.maxTimeToFirstByteMs)})}}}const o=n.errorRetry||n.timeoutRetry||{},a={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},A={onSuccess:(l,c,h,u)=>{const d=this.getInternalLoader(h);this.resetInternalLoader(h.type);const g=l.data;if(g.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,h,new Error("no EXTM3U delimiter"),u||null,c);return}c.parsing.start=performance.now(),Pt.isMediaPlaylist(g)?this.handleTrackOrLevelPlaylist(l,c,h,u||null,d):this.handleMasterPlaylist(l,c,h,u)},onError:(l,c,h,u)=>{this.handleNetworkError(c,h,!1,l,u)},onTimeout:(l,c,h)=>{this.handleNetworkError(c,h,!0,void 0,l)}};r.load(e,a,A)}handleMasterPlaylist(e,t,i,r){const n=this.hls,o=e.data,a=Yo(e,i),A=Pt.parseMasterPlaylist(o,a);if(A.playlistParsingError){this.handleManifestParsingError(e,i,A.playlistParsingError,r,t);return}const{contentSteering:l,levels:c,sessionData:h,sessionKeys:u,startTimeOffset:d,variableList:g}=A;this.variableList=g;const{AUDIO:f=[],SUBTITLES:p,"CLOSED-CAPTIONS":y}=Pt.parseMasterPlaylistMedia(o,a,A);f.length&&!f.some(Q=>!Q.url)&&c[0].audioCodec&&!c[0].attrs.AUDIO&&(N.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),f.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Ke({}),bitrate:0,url:""})),n.trigger(E.MANIFEST_LOADED,{levels:c,audioTracks:f,subtitles:p,captions:y,contentSteering:l,url:a,stats:t,networkDetails:r,sessionData:h,sessionKeys:u,startTimeOffset:d,variableList:g})}handleTrackOrLevelPlaylist(e,t,i,r,n){const o=this.hls,{id:a,level:A,type:l}=i,c=Yo(e,i),h=ce(a)?a:0,u=ce(A)?A:h,d=Tc(i),g=Pt.parseLevelPlaylist(e.data,c,u,d,h,this.variableList);if(l===De.MANIFEST){const f={attrs:new Ke({}),bitrate:0,details:g,name:"",url:c};o.trigger(E.MANIFEST_LOADED,{levels:[f],audioTracks:[],url:c,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),i.levelDetails=g,this.handlePlaylistLoaded(g,e,t,i,r,n)}handleManifestParsingError(e,t,i,r,n){this.hls.trigger(E.ERROR,{type:ge.NETWORK_ERROR,details:Y.MANIFEST_PARSING_ERROR,fatal:t.type===De.MANIFEST,url:e.url,err:i,error:i,reason:i.message,response:e,context:t,networkDetails:r,stats:n})}handleNetworkError(e,t,i=!1,r,n){let o=`A network ${i?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${e.type}`;e.type===De.LEVEL?o+=`: ${e.level} id: ${e.id}`:(e.type===De.AUDIO_TRACK||e.type===De.SUBTITLE_TRACK)&&(o+=` id: ${e.id} group-id: "${e.groupId}"`);const a=new Error(o);N.warn(`[playlist-loader]: ${o}`);let A=Y.UNKNOWN,l=!1;const c=this.getInternalLoader(e);switch(e.type){case De.MANIFEST:A=i?Y.MANIFEST_LOAD_TIMEOUT:Y.MANIFEST_LOAD_ERROR,l=!0;break;case De.LEVEL:A=i?Y.LEVEL_LOAD_TIMEOUT:Y.LEVEL_LOAD_ERROR,l=!1;break;case De.AUDIO_TRACK:A=i?Y.AUDIO_TRACK_LOAD_TIMEOUT:Y.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case De.SUBTITLE_TRACK:A=i?Y.SUBTITLE_TRACK_LOAD_TIMEOUT:Y.SUBTITLE_LOAD_ERROR,l=!1;break}c&&this.resetInternalLoader(e.type);const h={type:ge.NETWORK_ERROR,details:A,fatal:l,url:e.url,loader:c,context:e,error:a,networkDetails:t,stats:n};if(r){const u=(t==null?void 0:t.url)||e.url;h.response=vt({url:u,data:void 0},r)}this.hls.trigger(E.ERROR,h)}handlePlaylistLoaded(e,t,i,r,n,o){const a=this.hls,{type:A,level:l,id:c,groupId:h,deliveryDirectives:u}=r,d=Yo(t,r),g=Tc(r),f=typeof r.level=="number"&&g===pe.MAIN?l:void 0;if(!e.fragments.length){const y=new Error("No Segments found in Playlist");a.trigger(E.ERROR,{type:ge.NETWORK_ERROR,details:Y.LEVEL_EMPTY_ERROR,fatal:!1,url:d,error:y,reason:y.message,response:t,context:r,level:f,parent:g,networkDetails:n,stats:i});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const p=e.playlistParsingError;if(p){a.trigger(E.ERROR,{type:ge.NETWORK_ERROR,details:Y.LEVEL_PARSING_ERROR,fatal:!1,url:d,error:p,reason:p.message,response:t,context:r,level:f,parent:g,networkDetails:n,stats:i});return}switch(e.live&&o&&(o.getCacheAge&&(e.ageHeader=o.getCacheAge()||0),(!o.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),A){case De.MANIFEST:case De.LEVEL:a.trigger(E.LEVEL_LOADED,{details:e,level:f||0,id:c||0,stats:i,networkDetails:n,deliveryDirectives:u});break;case De.AUDIO_TRACK:a.trigger(E.AUDIO_TRACK_LOADED,{details:e,id:c||0,groupId:h||"",stats:i,networkDetails:n,deliveryDirectives:u});break;case De.SUBTITLE_TRACK:a.trigger(E.SUBTITLE_TRACK_LOADED,{details:e,id:c||0,groupId:h||"",stats:i,networkDetails:n,deliveryDirectives:u});break}}}function xc(s,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=s,e.dispatchEvent(t)}function Dc(s,e){const t=s.mode;if(t==="disabled"&&(s.mode="hidden"),s.cues&&!s.cues.getCueById(e.id))try{if(s.addCue(e),!s.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(i){N.debug(`[texttrack-utils]: ${i}`);try{const r=new self.TextTrackCue(e.startTime,e.endTime,e.text);r.id=e.id,s.addCue(r)}catch(r){N.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${r}`)}}t==="disabled"&&(s.mode=t)}function hs(s){const e=s.mode;if(e==="disabled"&&(s.mode="hidden"),s.cues)for(let t=s.cues.length;t--;)s.removeCue(s.cues[t]);e==="disabled"&&(s.mode=e)}function Ko(s,e,t,i){const r=s.mode;if(r==="disabled"&&(s.mode="hidden"),s.cues&&s.cues.length>0){const n=$0(s.cues,e,t);for(let o=0;o<n.length;o++)(!i||i(n[o]))&&s.removeCue(n[o])}r==="disabled"&&(s.mode=r)}function H0(s,e){if(e<s[0].startTime)return 0;const t=s.length-1;if(e>s[t].endTime)return-1;let i=0,r=t;for(;i<=r;){const n=Math.floor((r+i)/2);if(e<s[n].startTime)r=n-1;else if(e>s[n].startTime&&i<t)i=n+1;else return n}return s[i].startTime-e<e-s[r].startTime?i:r}function $0(s,e,t){const i=[],r=H0(s,e);if(r>-1)for(let n=r,o=s.length;n<o;n++){const a=s[n];if(a.startTime>=e&&a.endTime<=t)i.push(a);else if(a.startTime>t)return i}return i}var Ot={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const Y0=.25;function Vo(){if(!(typeof self>"u"))return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}const un=(()=>{const s=Vo();try{new s(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Jo(s,e){return s.getTime()/1e3-e}function K0(s){return Uint8Array.from(s.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class V0{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(E.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(E.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(hs(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const i=e[t];if(i.kind==="metadata"&&i.label==="id3")return xc(i,this.media),i}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:i,enableID3MetadataCues:r}}}=this;if(!i&&!r)return;const{samples:n}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=Vo();for(let a=0;a<n.length;a++){const A=n[a].type;if(A===Ot.emsg&&!i||!r)continue;const l=oc(n[a].data);if(l){const c=n[a].pts;let h=c+n[a].duration;h>un&&(h=un),h-c<=0&&(h=c+Y0);for(let d=0;d<l.length;d++){const g=l[d];if(!nc(g)){this.updateId3CueEnds(c,A);const f=new o(c,h,"");f.value=g,A&&(f.type=A),this.id3Track.addCue(f)}}}}}updateId3CueEnds(e,t){var i;const r=(i=this.id3Track)==null?void 0:i.cues;if(r)for(let n=r.length;n--;){const o=r[n];o.type===t&&o.startTime<e&&o.endTime===un&&(o.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:i,type:r}){const{id3Track:n,hls:o}=this;if(!o)return;const{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:A}}=o;if(n&&(a||A)){let l;r==="audio"?l=c=>c.type===Ot.audioId3&&A:r==="video"?l=c=>c.type===Ot.emsg&&a:l=c=>c.type===Ot.audioId3&&A||c.type===Ot.emsg&&a,Ko(n,t,i,l)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:i,id3Track:r}=this,{dateRanges:n}=t,o=Object.keys(n);if(r){const c=Object.keys(i).filter(h=>!o.includes(h));for(let h=c.length;h--;){const u=c[h];Object.keys(i[u].cues).forEach(d=>{r.removeCue(i[u].cues[d])}),delete i[u]}}const a=t.fragments[t.fragments.length-1];if(o.length===0||!ce(a==null?void 0:a.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const A=a.programDateTime/1e3-a.start,l=Vo();for(let c=0;c<o.length;c++){const h=o[c],u=n[h],d=i[h],g=(d==null?void 0:d.cues)||{};let f=(d==null?void 0:d.durationKnown)||!1;const p=Jo(u.startDate,A);let y=un;const B=u.endDate;if(B)y=Jo(B,A),f=!0;else if(u.endOnNext&&!f){const C=o.reduce((T,b)=>{const L=n[b];return L.class===u.class&&L.id!==b&&L.startDate>u.startDate&&T.push(L),T},[]).sort((T,b)=>T.startDate.getTime()-b.startDate.getTime())[0];C&&(y=Jo(C.startDate,A),f=!0)}const Q=Object.keys(u.attr);for(let C=0;C<Q.length;C++){const T=Q[C];if(!Zf(T))continue;let b=g[T];if(b)f&&!d.durationKnown&&(b.endTime=y);else{let L=u.attr[T];b=new l(p,y,""),e0(T)&&(L=K0(L)),b.value={key:T,data:L},b.type=Ot.dateRange,b.id=h,this.id3Track.addCue(b),g[T]=b}}i[h]={cues:g,dateRange:u,durationKnown:f}}}}class J0{constructor(e){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=()=>this.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:i,targetduration:r}=e,{liveSyncDuration:n,liveSyncDurationCount:o,lowLatencyMode:a}=this.config,A=this.hls.userConfig;let l=a&&i||t;(A.liveSyncDuration||A.liveSyncDurationCount||l===0)&&(l=n!==void 0?n:o*r);const c=r,h=1;return l+Math.min(this.stallCount*h,c)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,i=this.levelDetails;if(e===null||t===null||i===null)return null;const r=i.edge,n=e-t-this.edgeStalled,o=r-i.totalduration,a=r-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(o,n),a)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const i=e.buffered.length;return(i?e.buffered.end(i-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(E.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(E.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(E.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(E.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(E.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(E.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var i;t.details===Y.BUFFER_STALLED_ERROR&&(this.stallCount++,(i=this.levelDetails)!=null&&i.live&&N.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const i=this.computeLatency();if(i===null)return;this._latency=i;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:n}=this.config;if(!r||n===1)return;const o=this.targetLatency;if(o===null)return;const a=i-o,A=Math.min(this.maxLatency,o+t.targetduration),l=a<A;if(t.live&&l&&a>.05&&this.forwardBufferLength>1){const c=Math.min(2,Math.max(1,n)),h=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;e.playbackRate=Math.min(c,Math.max(1,h))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const Wo=["NONE","TYPE-0","TYPE-1",null];var nr={No:"",Yes:"YES",v2:"v2"};function W0(s,e){const{canSkipUntil:t,canSkipDateRanges:i,endSN:r}=s,n=e!==void 0?e-r:0;return t&&n<t?i?nr.v2:nr.Yes:nr.No}class Rc{constructor(e,t,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=i}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class or{constructor(e){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=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.unknownCodecs=e.unknownCodecs,this.codecSet=[e.videoCodec,e.audioCodec].filter(t=>t).join(",").replace(/\.[^.,]+/g,"")}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get attrs(){return this._attrs[this._urlId]}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get uri(){return this.url[this._urlId]||""}get urlId(){return this._urlId}set urlId(e){const t=e%this.url.length;this._urlId!==t&&(this.fragmentError=0,this.loadError=0,this.details=void 0,this._urlId=t)}get audioGroupId(){var e;return(e=this.audioGroupIds)==null?void 0:e[this.urlId]}get textGroupId(){var e;return(e=this.textGroupIds)==null?void 0:e[this.urlId]}addFallback(e){this.url.push(e.url),this._attrs.push(e.attrs)}}function qo(s,e){const t=e.startPTS;if(ce(t)){let i=0,r;e.sn>s.sn?(i=t-s.start,r=s):(i=s.start-t,r=e),r.duration!==i&&(r.duration=i)}else e.sn>s.sn?s.cc===e.cc&&s.minEndPTS?e.start=s.start+(s.minEndPTS-s.start):e.start=s.start+s.duration:e.start=Math.max(s.start-e.duration,0)}function Lc(s,e,t,i,r,n){i-t<=0&&(N.warn("Fragment should have a positive duration",e),i=t+e.duration,n=r+e.duration);let a=t,A=i;const l=e.startPTS,c=e.endPTS;if(ce(l)){const p=Math.abs(l-t);ce(e.deltaPTS)?e.deltaPTS=Math.max(p,e.deltaPTS):e.deltaPTS=p,a=Math.max(t,l),t=Math.min(t,l),r=Math.min(r,e.startDTS),A=Math.min(i,c),i=Math.max(i,c),n=Math.max(n,e.endDTS)}const h=t-e.start;e.start!==0&&(e.start=t),e.duration=i-e.start,e.startPTS=t,e.maxStartPTS=a,e.startDTS=r,e.endPTS=i,e.minEndPTS=A,e.endDTS=n;const u=e.sn;if(!s||u<s.startSN||u>s.endSN)return 0;let d;const g=u-s.startSN,f=s.fragments;for(f[g]=e,d=g;d>0;d--)qo(f[d],f[d-1]);for(d=g;d<f.length-1;d++)qo(f[d],f[d+1]);return s.fragmentHint&&qo(f[f.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,h}function q0(s,e){let t=null;const i=s.fragments;for(let A=i.length-1;A>=0;A--){const l=i[A].initSegment;if(l){t=l;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;let r=0,n;if(z0(s,e,(A,l)=>{A.relurl&&(r=A.cc-l.cc),ce(A.startPTS)&&ce(A.endPTS)&&(l.start=l.startPTS=A.startPTS,l.startDTS=A.startDTS,l.maxStartPTS=A.maxStartPTS,l.endPTS=A.endPTS,l.endDTS=A.endDTS,l.minEndPTS=A.minEndPTS,l.duration=A.endPTS-A.startPTS,l.duration&&(n=l),e.PTSKnown=e.alignedSliding=!0),l.elementaryStreams=A.elementaryStreams,l.loader=A.loader,l.stats=A.stats,l.urlId=A.urlId,A.initSegment&&(l.initSegment=A.initSegment,t=A.initSegment)}),t&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(l=>{var c;(!l.initSegment||l.initSegment.relurl===((c=t)==null?void 0:c.relurl))&&(l.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(A=>!A),e.deltaUpdateFailed){N.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let A=e.skippedSegments;A--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=j0(s.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const o=e.fragments;if(r){N.warn("discontinuity sliding from playlist, take drift into account");for(let A=0;A<o.length;A++)o[A].cc+=r}e.skippedSegments&&(e.startCC=e.fragments[0].cc),X0(s.partList,e.partList,(A,l)=>{l.elementaryStreams=A.elementaryStreams,l.stats=A.stats}),n?Lc(e,n,n.startPTS,n.endPTS,n.startDTS,n.endDTS):_c(s,e),o.length&&(e.totalduration=e.edge-o[0].start),e.driftStartTime=s.driftStartTime,e.driftStart=s.driftStart;const a=e.advancedDateTime;if(e.advanced&&a){const A=e.edge;e.driftStart||(e.driftStartTime=a,e.driftStart=A),e.driftEndTime=a,e.driftEnd=A}else e.driftEndTime=s.driftEndTime,e.driftEnd=s.driftEnd,e.advancedDateTime=s.advancedDateTime}function j0(s,e,t){const i=Ze({},s);return t&&t.forEach(r=>{delete i[r]}),Object.keys(e).forEach(r=>{const n=new Xl(e[r].attr,i[r]);n.isValid?i[r]=n:N.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[r].attr)}"`)}),i}function X0(s,e,t){if(s&&e){let i=0;for(let r=0,n=s.length;r<=n;r++){const o=s[r],a=e[r+i];o&&a&&o.index===a.index&&o.fragment.sn===a.fragment.sn?t(o,a):i--}}}function z0(s,e,t){const i=e.skippedSegments,r=Math.max(s.startSN,e.startSN)-e.startSN,n=(s.fragmentHint?1:0)+(i?e.endSN:Math.min(s.endSN,e.endSN))-e.startSN,o=e.startSN-s.startSN,a=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,A=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;for(let l=r;l<=n;l++){const c=A[o+l];let h=a[l];i&&!h&&l<i&&(h=e.fragments[l]=c),c&&h&&t(c,h)}}function _c(s,e){const t=e.startSN+e.skippedSegments-s.startSN,i=s.fragments;t<0||t>=i.length||jo(e,i[t].start)}function jo(s,e){if(e){const t=s.fragments;for(let i=s.skippedSegments;i<t.length;i++)t[i].start+=e;s.fragmentHint&&(s.fragmentHint.start+=e)}}function Z0(s,e=1/0){let t=1e3*s.targetduration;if(s.updated){const i=s.fragments,r=4;if(i.length&&t*r>e){const n=i[i.length-1].duration*1e3;n<t&&(t=n)}}else t/=2;return Math.round(t)}function ep(s,e,t){if(!(s!=null&&s.details))return null;const i=s.details;let r=i.fragments[e-i.startSN];return r||(r=i.fragmentHint,r&&r.sn===e)?r:e<i.startSN&&t&&t.sn===e?t:null}function kc(s,e,t){var i;return s!=null&&s.details?Nc((i=s.details)==null?void 0:i.partList,e,t):null}function Nc(s,e,t){if(s)for(let i=s.length;i--;){const r=s[i];if(r.index===t&&r.fragment.sn===e)return r}return null}function dn(s){switch(s.details){case Y.FRAG_LOAD_TIMEOUT:case Y.KEY_LOAD_TIMEOUT:case Y.LEVEL_LOAD_TIMEOUT:case Y.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Fc(s,e){const t=dn(e);return s.default[`${t?"timeout":"error"}Retry`]}function Xo(s,e){const t=s.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*s.retryDelayMs,s.maxRetryDelayMs)}function Mc(s){return vt(vt({},s),{errorRetry:null,timeoutRetry:null})}function gn(s,e,t,i){return!!s&&e<s.maxNumRetry&&(tp(i)||!!t)}function tp(s){return s===0&&navigator.onLine===!1||!!s&&(s<400||s>499)}const Pc={search:function(s,e){let t=0,i=s.length-1,r=null,n=null;for(;t<=i;){r=(t+i)/2|0,n=s[r];const o=e(n);if(o>0)t=r+1;else if(o<0)i=r-1;else return n}return null}};function ip(s,e,t){if(e===null||!Array.isArray(s)||!s.length||!ce(e))return null;const i=s[0].programDateTime;if(e<(i||0))return null;const r=s[s.length-1].endProgramDateTime;if(e>=(r||0))return null;t=t||0;for(let n=0;n<s.length;++n){const o=s[n];if(sp(e,t,o))return o}return null}function ar(s,e,t=0,i=0){let r=null;if(s?r=e[s.sn-e[0].sn+1]||null:t===0&&e[0].start===0&&(r=e[0]),r&&zo(t,i,r)===0)return r;const n=Pc.search(e,zo.bind(null,t,i));return n&&(n!==s||!r)?n:r}function zo(s=0,e=0,t){if(t.start<=s&&t.start+t.duration>s)return 0;const i=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-i<=s?1:t.start-i>s&&t.start?-1:0}function sp(s,e,t){const i=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-i>s}function rp(s,e){return Pc.search(s,t=>t.cc<e?1:t.cc>e?-1:0)}const np=3e5;var dt={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Lt={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class op{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=N.log.bind(N,"[info]:"),this.warn=N.warn.bind(N,"[warning]:"),this.error=N.error.bind(N,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(E.ERROR,this.onError,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(E.ERROR,this.onError,this),e.off(E.ERROR,this.onErrorOut,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){this.playlistError=0}stopLoad(){}getVariantLevelIndex(e){return(e==null?void 0:e.type)===pe.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var i,r;if(t.fatal)return;const n=this.hls,o=t.context;switch(t.details){case Y.FRAG_LOAD_ERROR:case Y.FRAG_LOAD_TIMEOUT:case Y.KEY_LOAD_ERROR:case Y.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case Y.FRAG_PARSING_ERROR:if((i=t.frag)!=null&&i.gap){t.errorAction={action:dt.DoNothing,flags:Lt.None};return}case Y.FRAG_GAP:case Y.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=dt.SendAlternateToPenaltyBox;return}case Y.LEVEL_EMPTY_ERROR:case Y.LEVEL_PARSING_ERROR:{var a,A;const l=t.parent===pe.MAIN?t.level:n.loadLevel;t.details===Y.LEVEL_EMPTY_ERROR&&((a=t.context)!=null&&(A=a.levelDetails)!=null&&A.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,l):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,l))}return;case Y.LEVEL_LOAD_ERROR:case Y.LEVEL_LOAD_TIMEOUT:typeof(o==null?void 0:o.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,o.level));return;case Y.AUDIO_TRACK_LOAD_ERROR:case Y.AUDIO_TRACK_LOAD_TIMEOUT:case Y.SUBTITLE_LOAD_ERROR:case Y.SUBTITLE_TRACK_LOAD_TIMEOUT:if(o){const l=n.levels[n.loadLevel];if(l&&(o.type===De.AUDIO_TRACK&&o.groupId===l.audioGroupId||o.type===De.SUBTITLE_TRACK&&o.groupId===l.textGroupId)){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.loadLevel),t.errorAction.action=dt.SendAlternateToPenaltyBox,t.errorAction.flags=Lt.MoveAllAlternatesMatchingHost;return}}return;case Y.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const l=n.levels[n.loadLevel],c=l==null?void 0:l.attrs["HDCP-LEVEL"];c&&(t.errorAction={action:dt.SendAlternateToPenaltyBox,flags:Lt.MoveAllAlternatesMatchingHDCP,hdcpLevel:c})}return;case Y.BUFFER_ADD_CODEC_ERROR:case Y.REMUX_ALLOC_ERROR:t.errorAction=this.getLevelSwitchAction(t,(r=t.level)!=null?r:n.loadLevel);return;case Y.INTERNAL_EXCEPTION:case Y.BUFFER_APPENDING_ERROR:case Y.BUFFER_APPEND_ERROR:case Y.BUFFER_FULL_ERROR:case Y.LEVEL_SWITCH_ERROR:case Y.BUFFER_STALLED_ERROR:case Y.BUFFER_SEEK_OVER_HOLE:case Y.BUFFER_NUDGE_ON_STALL:t.errorAction={action:dt.DoNothing,flags:Lt.None};return}if(t.type===ge.KEY_SYSTEM_ERROR){const l=this.getVariantLevelIndex(t.frag);t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,l);return}}getPlaylistRetryOrSwitchAction(e,t){var i;const r=this.hls,n=Fc(r.config.playlistLoadPolicy,e),o=this.playlistError++,a=(i=e.response)==null?void 0:i.code;if(gn(n,o,dn(e),a))return{action:dt.RetryRequest,flags:Lt.None,retryConfig:n,retryCount:o};const l=this.getLevelSwitchAction(e,t);return n&&(l.retryConfig=n,l.retryCount=o),l}getFragRetryOrSwitchAction(e){const t=this.hls,i=this.getVariantLevelIndex(e.frag),r=t.levels[i],{fragLoadPolicy:n,keyLoadPolicy:o}=t.config,a=Fc(e.details.startsWith("key")?o:n,e),A=t.levels.reduce((h,u)=>h+u.fragmentError,0);if(r){var l;e.details!==Y.FRAG_GAP&&r.fragmentError++;const h=(l=e.response)==null?void 0:l.code;if(gn(a,A,dn(e),h))return{action:dt.RetryRequest,flags:Lt.None,retryConfig:a,retryCount:A}}const c=this.getLevelSwitchAction(e,i);return a&&(c.retryConfig=a,c.retryCount=A),c}getLevelSwitchAction(e,t){const i=this.hls;t==null&&(t=i.loadLevel);const r=this.hls.levels[t];if(r&&(r.loadError++,i.autoLevelEnabled)){var n,o;let a=-1;const{levels:A,loadLevel:l,minAutoLevel:c,maxAutoLevel:h}=i,u=(n=e.frag)==null?void 0:n.type,{type:d,groupId:g}=(o=e.context)!=null?o:{};for(let f=A.length;f--;){const p=(f+l)%A.length;if(p!==l&&p>=c&&p<=h&&A[p].loadError===0){const y=A[p];if(e.details===Y.FRAG_GAP&&e.frag){const B=A[p].details;if(B){const Q=ar(e.frag,B.fragments,e.frag.start);if(Q!=null&&Q.gap)continue}}else{if(d===De.AUDIO_TRACK&&g===y.audioGroupId||d===De.SUBTITLE_TRACK&&g===y.textGroupId)continue;if(u===pe.AUDIO&&r.audioGroupId===y.audioGroupId||u===pe.SUBTITLE&&r.textGroupId===y.textGroupId)continue}a=p;break}}if(a>-1&&i.loadLevel!==a)return e.levelRetry=!0,this.playlistError=0,{action:dt.SendAlternateToPenaltyBox,flags:Lt.None,nextAutoLevel:a}}return{action:dt.SendAlternateToPenaltyBox,flags:Lt.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var i;switch((i=t.errorAction)==null?void 0:i.action){case dt.DoNothing:break;case dt.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==Y.FRAG_GAP&&(t.fatal=!0);break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,i=e.errorAction;if(!i)return;const{flags:r,hdcpLevel:n,nextAutoLevel:o}=i;switch(r){case Lt.None:this.switchLevel(e,o);break;case Lt.MoveAllAlternatesMatchingHost:i.resolved||(i.resolved=this.redundantFailover(e));break;case Lt.MoveAllAlternatesMatchingHDCP:n&&(t.maxHdcpLevel=Wo[Wo.indexOf(n)-1],i.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}i.resolved||this.switchLevel(e,o)}switchLevel(e,t){t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}redundantFailover(e){const{hls:t,penalizedRenditions:i}=this,r=e.parent===pe.MAIN?e.level:t.loadLevel,n=t.levels[r],o=n.url.length,a=e.frag?e.frag.urlId:n.urlId;n.urlId===a&&(!e.frag||n.details)&&this.penalizeRendition(n,e);for(let A=1;A<o;A++){const l=(a+A)%o,c=i[l];if(!c||ap(c,e,i[a]))return this.warn(`Switching to Redundant Stream ${l+1}/${o}: "${n.url[l]}" after ${e.details}`),this.playlistError=0,t.levels.forEach(h=>{h.urlId=l}),t.nextLoadLevel=r,!0}return!1}penalizeRendition(e,t){const{penalizedRenditions:i}=this,r=i[e.urlId]||{lastErrorPerfMs:0,errors:[],details:void 0};r.lastErrorPerfMs=performance.now(),r.errors.push(t),r.details=e.details,i[e.urlId]=r}}function ap(s,e,t){if(performance.now()-s.lastErrorPerfMs>np)return!0;const i=s.details;if(e.details===Y.FRAG_GAP&&i&&e.frag){const r=e.frag.start,n=ar(null,i.fragments,r);if(n&&!n.gap)return!0}if(t&&s.errors.length<t.errors.length){const r=s.errors[s.errors.length-1];if(i&&r.frag&&e.frag&&Math.abs(r.frag.start-e.frag.start)>i.targetduration*3)return!0}return!1}class Zo{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=N.log.bind(N,`${t}:`),this.warn=N.warn.bind(N,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){clearTimeout(this.timer),this.timer=-1}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t){const i=t==null?void 0:t.renditionReports;if(i){let r=-1;for(let n=0;n<i.length;n++){const o=i[n];let a;try{a=new self.URL(o.URI,t.url).href}catch(A){N.warn(`Could not construct new URL for Rendition Report: ${A}`),a=o.URI||""}if(a===e){r=n;break}else a===e.substring(0,a.length)&&(r=n)}if(r!==-1){const n=i[r],o=parseInt(n["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let a=parseInt(n["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const A=Math.min(t.age-t.partTarget,t.targetduration);a>=0&&A>t.partTarget&&(a+=1)}return new Rc(o,a>=0?a:void 0,nr.No)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,i){const{details:r,stats:n}=t,o=self.performance.now(),a=n.loading.first?Math.max(0,o-n.loading.first):0;if(r.advancedDateTime=Date.now()-a,r.live||i!=null&&i.live){if(r.reloaded(i),i&&this.log(`live playlist ${e} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),i&&r.fragments.length>0&&q0(i,r),!this.canLoad||!r.live)return;let A,l,c;if(r.canBlockReload&&r.endSN&&r.advanced){const p=this.hls.config.lowLatencyMode,y=r.lastPartSn,B=r.endSN,Q=r.lastPartIndex,C=Q!==-1,T=y===B,b=p?0:Q;C?(l=T?B+1:y,c=T?b:Q+1):l=B+1;const L=r.age,R=L+r.ageHeader;let O=Math.min(R-r.partTarget,r.targetduration*1.5);if(O>0){if(i&&O>i.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${i.tuneInGoal} to: ${O} with playlist age: ${r.age}`),O=0;else{const k=Math.floor(O/r.targetduration);if(l+=k,c!==void 0){const W=Math.round(O%r.targetduration/r.partTarget);c+=W}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${L.toFixed(2)}s goal: ${O} skip sn ${k} to part ${c}`)}r.tuneInGoal=O}if(A=this.getDeliveryDirectives(r,t.deliveryDirectives,l,c),p||!T){this.loadPlaylist(A);return}}else(r.canBlockReload||r.canSkipUntil)&&(A=this.getDeliveryDirectives(r,t.deliveryDirectives,l,c));const h=this.hls.mainForwardBufferInfo,u=h?h.end-h.len:0,d=(r.edge-u)*1e3,g=Z0(r,d);r.updated&&o>this.requestScheduled+g&&(this.requestScheduled=n.loading.start),l!==void 0&&r.canBlockReload?this.requestScheduled=n.loading.first+g-(r.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+g<o?this.requestScheduled=o:this.requestScheduled-o<=0&&(this.requestScheduled+=g);let f=this.requestScheduled-o;f=Math.max(0,f),this.log(`reload live playlist ${e} in ${Math.round(f)} ms`),this.timer=self.setTimeout(()=>this.loadPlaylist(A),f)}else this.clearTimer()}getDeliveryDirectives(e,t,i,r){let n=W0(e,i);return t!=null&&t.skip&&e.deltaUpdateFailed&&(i=t.msn,r=t.part,n=nr.No),new Rc(i,r,n)}checkRetry(e){const t=e.details,i=dn(e),r=e.errorAction,{action:n,retryCount:o=0,retryConfig:a}=r||{},A=!!r&&!!a&&(n===dt.RetryRequest||!r.resolved&&n===dt.SendAlternateToPenaltyBox);if(A){var l;if(this.requestScheduled=-1,o>=a.maxNumRetry)return!1;if(i&&(l=e.context)!=null&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${o+1}/${a.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const c=Xo(a,o);this.timer=self.setTimeout(()=>this.loadPlaylist(),c),this.warn(`Retrying playlist loading ${o+1}/${a.maxNumRetry} after "${t}" in ${c}ms`)}e.levelRetry=!0,r.resolved=!0}return A}}let ea;class Ap extends Zo{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(E.LEVEL_LOADED,this.onLevelLoaded,this),e.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(E.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(E.FRAG_LOADED,this.onFragLoaded,this),e.on(E.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(E.LEVEL_LOADED,this.onLevelLoaded,this),e.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(E.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(E.FRAG_LOADED,this.onFragLoaded,this),e.off(E.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}startLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.startLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const i=[],r={};let n;t.levels.forEach(o=>{var a;const A=o.attrs;((a=o.audioCodec)==null?void 0:a.indexOf("mp4a.40.34"))!==-1&&(ea||(ea=/chrome|firefox/i.test(navigator.userAgent)),ea&&(o.audioCodec=void 0));const{AUDIO:l,CODECS:c,"FRAME-RATE":h,"PATHWAY-ID":u,RESOLUTION:d,SUBTITLES:g}=A,p=`${`${u||"."}-`}${o.bitrate}-${d}-${h}-${c}`;n=r[p],n?n.addFallback(o):(n=new or(o),r[p]=n,i.push(n)),fn(n,"audio",l),fn(n,"text",g)}),this.filterAndSortMediaOptions(i,t)}filterAndSortMediaOptions(e,t){let i=[],r=[],n=!1,o=!1,a=!1,A=e.filter(({audioCodec:d,videoCodec:g,width:f,height:p,unknownCodecs:y})=>(n||(n=!!(f&&p)),o||(o=!!g),a||(a=!!d),!(y!=null&&y.length)&&(!d||$o(d,"audio"))&&(!g||$o(g,"video"))));if((n||o)&&a&&(A=A.filter(({videoCodec:d,width:g,height:f})=>!!d||!!(g&&f))),A.length===0){Promise.resolve().then(()=>{if(this.hls){const d=new Error("no level with compatible codecs found in manifest");this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:d,reason:d.message})}});return}t.audioTracks&&(i=t.audioTracks.filter(d=>!d.audioCodec||$o(d.audioCodec,"audio")),Oc(i)),t.subtitles&&(r=t.subtitles,Oc(r));const l=A.slice(0);A.sort((d,g)=>d.attrs["HDCP-LEVEL"]!==g.attrs["HDCP-LEVEL"]?(d.attrs["HDCP-LEVEL"]||"")>(g.attrs["HDCP-LEVEL"]||"")?1:-1:d.bitrate!==g.bitrate?d.bitrate-g.bitrate:d.attrs["FRAME-RATE"]!==g.attrs["FRAME-RATE"]?d.attrs.decimalFloatingPoint("FRAME-RATE")-g.attrs.decimalFloatingPoint("FRAME-RATE"):d.attrs.SCORE!==g.attrs.SCORE?d.attrs.decimalFloatingPoint("SCORE")-g.attrs.decimalFloatingPoint("SCORE"):n&&d.height!==g.height?d.height-g.height:0);let c=l[0];if(this.steering&&(A=this.steering.filterParsedLevels(A),A.length!==l.length)){for(let d=0;d<l.length;d++)if(l[d].pathwayId===A[0].pathwayId){c=l[d];break}}this._levels=A;for(let d=0;d<A.length;d++)if(A[d]===c){this._firstLevel=d,this.log(`manifest loaded, ${A.length} level(s) found, first bitrate: ${c.bitrate}`);break}const h=a&&!o,u={levels:A,audioTracks:i,subtitleTracks:r,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:a,video:o,altAudio:!h&&i.some(d=>!!d.url)};this.hls.trigger(E.MANIFEST_PARSED,u),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const c=new Error("invalid level idx"),h=e<0;if(this.hls.trigger(E.ERROR,{type:ge.OTHER_ERROR,details:Y.LEVEL_SWITCH_ERROR,level:e,fatal:h,error:c,reason:c.message}),h)return;e=Math.min(e,t.length-1)}const i=this.currentLevelIndex,r=this.currentLevel,n=r?r.attrs["PATHWAY-ID"]:void 0,o=t[e],a=o.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=o,i===e&&o.details&&r&&n===a)return;this.log(`Switching to level ${e}${a?" with Pathway "+a:""} from level ${i}${n?" with Pathway "+n:""}`);const A=Ze({},o,{level:e,maxBitrate:o.maxBitrate,attrs:o.attrs,uri:o.uri,urlId:o.urlId});delete A._attrs,delete A._urlId,this.hls.trigger(E.LEVEL_SWITCHING,A);const l=o.details;if(!l||l.live){const c=this.switchParams(o.uri,r==null?void 0:r.details);this.loadPlaylist(c)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this._firstLevel}else return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===De.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragLoaded(e,{frag:t}){if(t!==void 0&&t.type===pe.MAIN){const i=this._levels[t.level];i!==void 0&&(i.loadError=0)}}onLevelLoaded(e,t){var i;const{level:r,details:n}=t,o=this._levels[r];if(!o){var a;this.warn(`Invalid level index ${r}`),(a=t.deliveryDirectives)!=null&&a.skip&&(n.deltaUpdateFailed=!0);return}r===this.currentLevelIndex?(o.fragmentError===0&&(o.loadError=0),this.playlistLoaded(r,t,o.details)):(i=t.deliveryDirectives)!=null&&i.skip&&(n.deltaUpdateFailed=!0)}onAudioTrackSwitched(e,t){const i=this.currentLevel;if(!i)return;const r=this.hls.audioTracks[t.id].groupId;if(i.audioGroupIds&&i.audioGroupId!==r){let n=-1;for(let o=0;o<i.audioGroupIds.length;o++)if(i.audioGroupIds[o]===r){n=o;break}n!==-1&&n!==i.urlId&&(i.urlId=n,this.canLoad&&this.startLoad())}}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,i=this.currentLevel;if(i&&this.shouldLoadPlaylist(i)){const r=i.urlId;let n=i.uri;if(e)try{n=e.addDirectives(n)}catch(a){this.warn(`Could not construct new URL with HLS Delivery Directives: ${a}`)}const o=i.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${o?" Pathway "+o:""} URI ${r+1}/${i.url.length} ${n}`),this.clearTimer(),this.hls.trigger(E.LEVEL_LOADING,{url:n,level:t,id:r,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e,t){const i=(n,o)=>o!==t,r=this._levels.filter((n,o)=>o!==e?!0:n.url.length>1&&t!==void 0?(n.url=n.url.filter(i),n.audioGroupIds&&(n.audioGroupIds=n.audioGroupIds.filter(i)),n.textGroupIds&&(n.textGroupIds=n.textGroupIds.filter(i)),n.urlId=0,!0):(this.steering&&this.steering.removeLevel(n),!1));this.hls.trigger(E.LEVELS_UPDATED,{levels:r})}onLevelsUpdated(e,{levels:t}){t.forEach((i,r)=>{const{details:n}=i;n!=null&&n.fragments&&n.fragments.forEach(o=>{o.level=r})}),this._levels=t}}function fn(s,e,t){t&&(e==="audio"?(s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds[s.url.length-1]=t):e==="text"&&(s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds[s.url.length-1]=t))}function Oc(s){const e={};s.forEach(t=>{const i=t.groupId||"";t.id=e[i]=e[i]||0,e[i]++})}var it={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class lp{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(E.BUFFER_APPENDED,this.onBufferAppended,this),e.on(E.FRAG_BUFFERED,this.onFragBuffered,this),e.on(E.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(E.BUFFER_APPENDED,this.onBufferAppended,this),e.off(E.FRAG_BUFFERED,this.onFragBuffered,this),e.off(E.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const i=this.activePartLists[t];if(i)for(let r=i.length;r--;){const n=i[r];if(!n)break;const o=n.end;if(n.start<=e&&o!==null&&e<=o)return n}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:i}=this,r=Object.keys(i);for(let n=r.length;n--;){const o=i[r[n]];if((o==null?void 0:o.body.type)===t&&o.buffered){const a=o.body;if(a.start<=e&&e<=a.end)return a}}return null}detectEvictedFragments(e,t,i,r){this.timeRanges&&(this.timeRanges[e]=t);const n=(r==null?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach(o=>{const a=this.fragments[o];if(!a||n>=a.body.sn)return;if(!a.buffered&&!a.loaded){a.body.type===i&&this.removeFragment(a.body);return}const A=a.range[e];A&&A.time.some(l=>{const c=!this.isTimeBuffered(l.startPTS,l.endPTS,t);return c&&this.removeFragment(a.body),c})})}detectPartialFragments(e){const t=this.timeRanges,{frag:i,part:r}=e;if(!t||i.sn==="initSegment")return;const n=us(i),o=this.fragments[n];if(!o||o.buffered&&i.gap)return;const a=!i.relurl;Object.keys(t).forEach(A=>{const l=i.elementaryStreams[A];if(!l)return;const c=t[A],h=a||l.partial===!0;o.range[A]=this.getBufferedTimes(i,r,h,c)}),o.loaded=null,Object.keys(o.range).length?(o.buffered=!0,(o.body.endList=i.endList||o.body.endList)&&(this.endListFragments[o.body.type]=o),pn(o)||this.removeParts(i.sn-1,i.type)):this.removeFragment(o.body)}removeParts(e,t){const i=this.activePartLists[t];i&&(this.activePartLists[t]=i.filter(r=>r.fragment.sn>=e))}fragBuffered(e,t){const i=us(e);let r=this.fragments[i];!r&&t&&(r=this.fragments[i]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}getBufferedTimes(e,t,i,r){const n={time:[],partial:i},o=e.start,a=e.end,A=e.minEndPTS||a,l=e.maxStartPTS||o;for(let c=0;c<r.length;c++){const h=r.start(c)-this.bufferPadding,u=r.end(c)+this.bufferPadding;if(l>=h&&A<=u){n.time.push({startPTS:Math.max(o,r.start(c)),endPTS:Math.min(a,r.end(c))});break}else if(o<u&&a>h)n.partial=!0,n.time.push({startPTS:Math.max(o,r.start(c)),endPTS:Math.min(a,r.end(c))});else if(a<=h)break}return n}getPartialFragment(e){let t=null,i,r,n,o=0;const{bufferPadding:a,fragments:A}=this;return Object.keys(A).forEach(l=>{const c=A[l];c&&pn(c)&&(r=c.body.start-a,n=c.body.end+a,e>=r&&e<=n&&(i=Math.min(e-r,n-e),o<=i&&(t=c.body,o=i)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||pn(t))}getState(e){const t=us(e),i=this.fragments[t];return i?i.buffered?pn(i)?it.PARTIAL:it.OK:it.APPENDING:it.NOT_LOADED}isTimeBuffered(e,t,i){let r,n;for(let o=0;o<i.length;o++){if(r=i.start(o)-this.bufferPadding,n=i.end(o)+this.bufferPadding,e>=r&&t<=n)return!0;if(t<=r)return!1}return!1}onFragLoaded(e,t){const{frag:i,part:r}=t;if(i.sn==="initSegment"||i.bitrateTest)return;const n=r?null:t,o=us(i);this.fragments[o]={body:i,appendedPTS:null,loaded:n,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:i,part:r,timeRanges:n}=t;if(i.sn==="initSegment")return;const o=i.type;if(r){let a=this.activePartLists[o];a||(this.activePartLists[o]=a=[]),a.push(r)}this.timeRanges=n,Object.keys(n).forEach(a=>{const A=n[a];this.detectEvictedFragments(a,A,o,r)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=us(e);return!!this.fragments[t]}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,i,r,n){r&&!this.hasGaps||Object.keys(this.fragments).forEach(o=>{const a=this.fragments[o];if(!a)return;const A=a.body;A.type!==i||r&&!A.gap||A.start<t&&A.end>e&&(a.buffered||n)&&this.removeFragment(A)})}removeFragment(e){const t=us(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const i=this.activePartLists[e.type];if(i){const r=e.sn;this.activePartLists[e.type]=i.filter(n=>n.fragment.sn!==r)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function pn(s){var e,t,i;return s.buffered&&(s.body.gap||((e=s.range.video)==null?void 0:e.partial)||((t=s.range.audio)==null?void 0:t.partial)||((i=s.range.audiovideo)==null?void 0:i.partial))}function us(s){return`${s.type}_${s.level}_${s.urlId}_${s.sn}`}const Uc=Math.pow(2,17);class cp{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const i=e.url;if(!i)return Promise.reject(new Ai({type:ge.NETWORK_ERROR,details:Y.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${i?"part list":"url"}`),networkDetails:null}));this.abort();const r=this.config,n=r.fLoader,o=r.loader;return new Promise((a,A)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(d=>d[0]==="GAP")){A(Hc(e));return}else e.gap=!1;const l=this.loader=e.loader=n?new n(r):new o(r),c=Gc(e),h=Mc(r.fragLoadPolicy.default),u={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Uc};e.stats=l.stats,l.load(c,u,{onSuccess:(d,g,f,p)=>{this.resetLoader(e,l);let y=d.data;f.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(y.slice(0,16)),y=y.slice(16)),a({frag:e,part:null,payload:y,networkDetails:p})},onError:(d,g,f,p)=>{this.resetLoader(e,l),A(new Ai({type:ge.NETWORK_ERROR,details:Y.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:vt({url:i,data:void 0},d),error:new Error(`HTTP Error ${d.code} ${d.text}`),networkDetails:f,stats:p}))},onAbort:(d,g,f)=>{this.resetLoader(e,l),A(new Ai({type:ge.NETWORK_ERROR,details:Y.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:f,stats:d}))},onTimeout:(d,g,f)=>{this.resetLoader(e,l),A(new Ai({type:ge.NETWORK_ERROR,details:Y.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${u.timeout}ms`),networkDetails:f,stats:d}))},onProgress:(d,g,f,p)=>{t&&t({frag:e,part:null,payload:f,networkDetails:p})}})})}loadPart(e,t,i){this.abort();const r=this.config,n=r.fLoader,o=r.loader;return new Promise((a,A)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){A(Hc(e,t));return}const l=this.loader=e.loader=n?new n(r):new o(r),c=Gc(e,t),h=Mc(r.fragLoadPolicy.default),u={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Uc};t.stats=l.stats,l.load(c,u,{onSuccess:(d,g,f,p)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const y={frag:e,part:t,payload:d.data,networkDetails:p};i(y),a(y)},onError:(d,g,f,p)=>{this.resetLoader(e,l),A(new Ai({type:ge.NETWORK_ERROR,details:Y.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:vt({url:c.url,data:void 0},d),error:new Error(`HTTP Error ${d.code} ${d.text}`),networkDetails:f,stats:p}))},onAbort:(d,g,f)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),A(new Ai({type:ge.NETWORK_ERROR,details:Y.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:f,stats:d}))},onTimeout:(d,g,f)=>{this.resetLoader(e,l),A(new Ai({type:ge.NETWORK_ERROR,details:Y.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${u.timeout}ms`),networkDetails:f,stats:d}))}})})}updateStatsFromPart(e,t){const i=e.stats,r=t.stats,n=r.total;if(i.loaded+=r.loaded,n){const A=Math.round(e.duration/t.duration),l=Math.min(Math.round(i.loaded/n),A),h=(A-l)*Math.round(i.loaded/l);i.total=i.loaded+h}else i.total=Math.max(i.loaded,i.total);const o=i.loading,a=r.loading;o.start?o.first+=a.first-a.start:(o.start=a.start,o.first=a.first),o.end=a.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Gc(s,e=null){const t=e||s,i={frag:s,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},r=t.byteRangeStartOffset,n=t.byteRangeEndOffset;if(ce(r)&&ce(n)){var o;let a=r,A=n;if(s.sn==="initSegment"&&((o=s.decryptdata)==null?void 0:o.method)==="AES-128"){const l=n-r;l%16&&(A=n+(16-l%16)),r!==0&&(i.resetIV=!0,a=r-16)}i.rangeStart=a,i.rangeEnd=A}return i}function Hc(s,e){const t=new Error(`GAP ${s.gap?"tag":"attribute"} found`),i={type:ge.MEDIA_ERROR,details:Y.FRAG_GAP,fatal:!1,frag:s,error:t,networkDetails:null};return e&&(i.part=e),(e||s).stats.aborted=!0,new Ai(i)}class Ai extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class hp{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const t in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[t].loader;if(i){if(e&&e!==i.context.frag.type)return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=Y.KEY_LOAD_ERROR,i,r,n){return new Ai({type:ge.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:n,error:i,networkDetails:r})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:i,cc:r}=e;for(let n=0;n<t.length;n++){const o=t[n];if(r<=o.cc&&(i==="initSegment"||o.sn==="initSegment"||i<o.sn)){this.emeController.selectKeySystemFormat(o).then(a=>{o.setKeyFormat(a)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var i,r;t&&e.setKeyFormat(t);const n=e.decryptdata;if(!n){const l=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,Y.KEY_LOAD_ERROR,l))}const o=n.uri;if(!o)return Promise.reject(this.createKeyLoadError(e,Y.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${o}"`)));let a=this.keyUriToKeyInfo[o];if((i=a)!=null&&i.decryptdata.key)return n.key=a.decryptdata.key,Promise.resolve({frag:e,keyInfo:a});if((r=a)!=null&&r.keyLoadPromise){var A;switch((A=a.mediaKeySessionContext)==null?void 0:A.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return a.keyLoadPromise.then(l=>(n.key=l.keyInfo.decryptdata.key,{frag:e,keyInfo:a}))}}switch(a=this.keyUriToKeyInfo[o]={decryptdata:n,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},n.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return n.keyFormat==="identity"?this.loadKeyHTTP(a,e):this.loadKeyEME(a,e);case"AES-128":return this.loadKeyHTTP(a,e);default:return Promise.reject(this.createKeyLoadError(e,Y.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${n.method}"`)))}}loadKeyEME(e,t){const i={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const r=this.emeController.loadKey(i);if(r)return(e.keyLoadPromise=r.then(n=>(e.mediaKeySessionContext=n,i))).catch(n=>{throw e.keyLoadPromise=null,n})}return Promise.resolve(i)}loadKeyHTTP(e,t){const i=this.config,r=i.loader,n=new r(i);return t.keyLoader=e.loader=n,e.keyLoadPromise=new Promise((o,a)=>{const A={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l=i.keyLoadPolicy.default,c={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(u,d,g,f)=>{const{frag:p,keyInfo:y,url:B}=g;if(!p.decryptdata||y!==this.keyUriToKeyInfo[B])return a(this.createKeyLoadError(p,Y.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),f));y.decryptdata.key=p.decryptdata.key=new Uint8Array(u.data),p.keyLoader=null,y.loader=null,o({frag:p,keyInfo:y})},onError:(u,d,g,f)=>{this.resetLoader(d),a(this.createKeyLoadError(t,Y.KEY_LOAD_ERROR,new Error(`HTTP Error ${u.code} loading key ${u.text}`),g,vt({url:A.url,data:void 0},u)))},onTimeout:(u,d,g)=>{this.resetLoader(d),a(this.createKeyLoadError(t,Y.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),g))},onAbort:(u,d,g)=>{this.resetLoader(d),a(this.createKeyLoadError(t,Y.INTERNAL_ABORTED,new Error("key loading aborted"),g))}};n.load(A,c,h)})}resetLoader(e){const{frag:t,keyInfo:i,url:r}=e,n=i.loader;t.keyLoader===n&&(t.keyLoader=null,i.loader=null),delete this.keyUriToKeyInfo[r],n&&n.destroy()}}class up{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}const dp={length:0,start:()=>0,end:()=>0};class Ge{static isBuffered(e,t){try{if(e){const i=Ge.getBuffered(e);for(let r=0;r<i.length;r++)if(t>=i.start(r)&&t<=i.end(r))return!0}}catch{}return!1}static bufferInfo(e,t,i){try{if(e){const r=Ge.getBuffered(e),n=[];let o;for(o=0;o<r.length;o++)n.push({start:r.start(o),end:r.end(o)});return this.bufferedInfo(n,t,i)}}catch{}return{len:0,start:t,end:t,nextStart:void 0}}static bufferedInfo(e,t,i){t=Math.max(0,t),e.sort(function(l,c){const h=l.start-c.start;return h||c.end-l.end});let r=[];if(i)for(let l=0;l<e.length;l++){const c=r.length;if(c){const h=r[c-1].end;e[l].start-h<i?e[l].end>h&&(r[c-1].end=e[l].end):r.push(e[l])}else r.push(e[l])}else r=e;let n=0,o,a=t,A=t;for(let l=0;l<r.length;l++){const c=r[l].start,h=r[l].end;if(t+i>=c&&t<h)a=c,A=h,n=A-t;else if(t+i<c){o=c;break}}return{len:n,start:a||0,end:A||0,nextStart:o}}static getBuffered(e){try{return e.buffered}catch(t){return N.log("failed to get media.buffered",t),dp}}}class ta{constructor(e,t,i,r=0,n=-1,o=!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=En(),this.buffering={audio:En(),video:En(),audiovideo:En()},this.level=e,this.sn=t,this.id=i,this.size=r,this.part=n,this.partial=o}}function En(){return{start:0,executeStart:0,executeEnd:0,end:0}}function $c(s,e){let t=null;for(let i=0,r=s.length;i<r;i++){const n=s[i];if(n&&n.cc===e){t=n;break}}return t}function gp(s,e,t){return!!(e.details&&(t.endCC>t.startCC||s&&s.cc<t.startCC))}function fp(s,e,t=0){const i=s.fragments,r=e.fragments;if(!r.length||!i.length){N.log("No fragments to align");return}const n=$c(i,r[0].cc);if(!n||n&&!n.startPTS){N.log("No frag in previous level to align on");return}return n}function Yc(s,e){if(s){const t=s.start+e;s.start=s.startPTS=t,s.endPTS=t+s.duration}}function ia(s,e){const t=e.fragments;for(let i=0,r=t.length;i<r;i++)Yc(t[i],s);e.fragmentHint&&Yc(e.fragmentHint,s),e.alignedSliding=!0}function pp(s,e,t){e&&(Ep(s,t,e),!t.alignedSliding&&e.details&&Ip(t,e.details),!t.alignedSliding&&e.details&&!t.skippedSegments&&_c(e.details,t))}function Ep(s,e,t){if(gp(s,t,e)){const i=fp(t.details,e);i&&ce(i.start)&&(N.log(`Adjusting PTS using last level due to CC increase within current level ${e.url}`),ia(i.start,e))}}function Ip(s,e){if(!e.fragments.length||!s.hasProgramDateTime||!e.hasProgramDateTime)return;const t=e.fragments[0].programDateTime,i=s.fragments[0].programDateTime,r=(i-t)/1e3+e.fragments[0].start;r&&ce(r)&&(N.log(`Adjusting PTS using programDateTime delta ${i-t}ms, sliding:${r.toFixed(3)} ${s.url} `),ia(r,s))}function Kc(s,e){if(!s.hasProgramDateTime||!e.hasProgramDateTime)return;const t=s.fragments,i=e.fragments;if(!t.length||!i.length)return;const r=Math.round(i.length/2)-1,n=i[r],o=$c(t,n.cc)||t[Math.round(t.length/2)-1],a=n.programDateTime,A=o.programDateTime;if(a===null||A===null)return;const l=(A-a)/1e3-(o.start-n.start);ia(l,s)}class mp{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class Cp{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function yp(s){const e=s.byteLength,t=e&&new DataView(s.buffer).getUint8(e-1);return t?qi(s,0,e-t):s}class Bp{constructor(){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()}uint8ArrayToUint32Array_(e){const t=new DataView(e),i=new Uint32Array(4);for(let r=0;r<4;r++)i[r]=t.getUint32(r*4);return i}initTable(){const e=this.sBox,t=this.invSBox,i=this.subMix,r=i[0],n=i[1],o=i[2],a=i[3],A=this.invSubMix,l=A[0],c=A[1],h=A[2],u=A[3],d=new Uint32Array(256);let g=0,f=0,p=0;for(p=0;p<256;p++)p<128?d[p]=p<<1:d[p]=p<<1^283;for(p=0;p<256;p++){let y=f^f<<1^f<<2^f<<3^f<<4;y=y>>>8^y&255^99,e[g]=y,t[y]=g;const B=d[g],Q=d[B],C=d[Q];let T=d[y]*257^y*16843008;r[g]=T<<24|T>>>8,n[g]=T<<16|T>>>16,o[g]=T<<8|T>>>24,a[g]=T,T=C*16843009^Q*65537^B*257^g*16843008,l[y]=T<<24|T>>>8,c[y]=T<<16|T>>>16,h[y]=T<<8|T>>>24,u[y]=T,g?(g=B^d[d[d[C^B]]],f^=d[d[f]]):g=f=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let i=!0,r=0;for(;r<t.length&&i;)i=t[r]===this.key[r],r++;if(i)return;this.key=t;const n=this.keySize=t.length;if(n!==4&&n!==6&&n!==8)throw new Error("Invalid aes key size="+n);const o=this.ksRows=(n+6+1)*4;let a,A;const l=this.keySchedule=new Uint32Array(o),c=this.invKeySchedule=new Uint32Array(o),h=this.sBox,u=this.rcon,d=this.invSubMix,g=d[0],f=d[1],p=d[2],y=d[3];let B,Q;for(a=0;a<o;a++){if(a<n){B=l[a]=t[a];continue}Q=B,a%n===0?(Q=Q<<8|Q>>>24,Q=h[Q>>>24]<<24|h[Q>>>16&255]<<16|h[Q>>>8&255]<<8|h[Q&255],Q^=u[a/n|0]<<24):n>6&&a%n===4&&(Q=h[Q>>>24]<<24|h[Q>>>16&255]<<16|h[Q>>>8&255]<<8|h[Q&255]),l[a]=B=(l[a-n]^Q)>>>0}for(A=0;A<o;A++)a=o-A,A&3?Q=l[a]:Q=l[a-4],A<4||a<=4?c[A]=Q:c[A]=g[h[Q>>>24]]^f[h[Q>>>16&255]]^p[h[Q>>>8&255]]^y[h[Q&255]],c[A]=c[A]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,i){const r=this.keySize+6,n=this.invKeySchedule,o=this.invSBox,a=this.invSubMix,A=a[0],l=a[1],c=a[2],h=a[3],u=this.uint8ArrayToUint32Array_(i);let d=u[0],g=u[1],f=u[2],p=u[3];const y=new Int32Array(e),B=new Int32Array(y.length);let Q,C,T,b,L,R,O,k,W,$,te,ee,S,D;const U=this.networkToHostOrderSwap;for(;t<y.length;){for(W=U(y[t]),$=U(y[t+1]),te=U(y[t+2]),ee=U(y[t+3]),L=W^n[0],R=ee^n[1],O=te^n[2],k=$^n[3],S=4,D=1;D<r;D++)Q=A[L>>>24]^l[R>>16&255]^c[O>>8&255]^h[k&255]^n[S],C=A[R>>>24]^l[O>>16&255]^c[k>>8&255]^h[L&255]^n[S+1],T=A[O>>>24]^l[k>>16&255]^c[L>>8&255]^h[R&255]^n[S+2],b=A[k>>>24]^l[L>>16&255]^c[R>>8&255]^h[O&255]^n[S+3],L=Q,R=C,O=T,k=b,S=S+4;Q=o[L>>>24]<<24^o[R>>16&255]<<16^o[O>>8&255]<<8^o[k&255]^n[S],C=o[R>>>24]<<24^o[O>>16&255]<<16^o[k>>8&255]<<8^o[L&255]^n[S+1],T=o[O>>>24]<<24^o[k>>16&255]<<16^o[L>>8&255]<<8^o[R&255]^n[S+2],b=o[k>>>24]<<24^o[L>>16&255]<<16^o[R>>8&255]<<8^o[O&255]^n[S+3],B[t]=U(Q^d),B[t+1]=U(b^g),B[t+2]=U(T^f),B[t+3]=U(C^p),d=W,g=$,f=te,p=ee,t=t+4}return B.buffer}}const vp=16;class sa{constructor(e,{removePKCS7Padding:t=!0}={}){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=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch{}this.subtle===null&&(this.useSoftware=!0)}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const i=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?yp(i):i}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,i){return this.useSoftware?new Promise((r,n)=>{this.softwareDecrypt(new Uint8Array(e),t,i);const o=this.flush();o?r(o.buffer):n(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,i)}softwareDecrypt(e,t,i){const{currentIV:r,currentResult:n,remainderData:o}=this;this.logOnce("JS AES decrypt"),o&&(e=ji(o,e),this.remainderData=null);const a=this.getValidChunk(e);if(!a.length)return null;r&&(i=r);let A=this.softwareDecrypter;A||(A=this.softwareDecrypter=new Bp),A.expandKey(t);const l=n;return this.currentResult=A.decrypt(a.buffer,0,i),this.currentIV=qi(a,-16).buffer,l||null}webCryptoDecrypt(e,t,i){const r=this.subtle;return(this.key!==t||!this.fastAesKey)&&(this.key=t,this.fastAesKey=new Cp(r,t)),this.fastAesKey.expandKey().then(n=>r?(this.logOnce("WebCrypto AES decrypt"),new mp(r,new Uint8Array(i)).decrypt(e.buffer,n)):Promise.reject(new Error("web crypto not initialized"))).catch(n=>(N.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${n.name}: ${n.message}`),this.onWebCryptoError(e,t,i)))}onWebCryptoError(e,t,i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,i);const r=this.flush();if(r)return r.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const i=e.length-e.length%vp;return i!==e.length&&(t=qi(e,0,i),this.remainderData=qi(e,i)),t}logOnce(e){this.logEnabled&&(N.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Qp={toString:function(s){let e="";const t=s.length;for(let i=0;i<t;i++)e+=`[${s.start(i).toFixed(3)}-${s.end(i).toFixed(3)}]`;return e}},J={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"};class ra extends up{constructor(e,t,i,r,n){super(),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=J.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.loadedmetadata=!1,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.onvseeking=null,this.onvended=null,this.logPrefix="",this.log=void 0,this.warn=void 0,this.playlistType=n,this.logPrefix=r,this.log=N.log.bind(N,`${r}:`),this.warn=N.warn.bind(N,`${r}:`),this.hls=e,this.fragmentLoader=new cp(e.config),this.keyLoader=i,this.fragmentTracker=t,this.config=e.config,this.decrypter=new sa(e.config),e.on(E.MANIFEST_LOADED,this.onManifestLoaded,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=J.STOPPED}_streamEnded(e,t){if(t.live||e.nextStart||!e.end||!this.media)return!1;const i=t.partList;if(i!=null&&i.length){const n=i[i.length-1];return Ge.isBuffered(this.media,n.start+n.duration/2)}const r=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(r)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levels[this.levelLastLoaded])==null?void 0:e.details}}onMediaAttached(e,t){const i=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),i.addEventListener("seeking",this.onvseeking),i.addEventListener("ended",this.onvended);const r=this.config;this.levels&&r.autoStartLoad&&this.state===J.STOPPED&&this.startLoad(r.startPosition)}onMediaDetaching(){const e=this.media;e!=null&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.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()}onMediaSeeking(){const{config:e,fragCurrent:t,media:i,mediaBuffer:r,state:n}=this,o=i?i.currentTime:0,a=Ge.bufferInfo(r||i,o,e.maxBufferHole);if(this.log(`media seeking to ${ce(o)?o.toFixed(3):o}, state: ${n}`),this.state===J.ENDED)this.resetLoadingState();else if(t){const A=e.maxFragLookUpTolerance,l=t.start-A,c=t.start+t.duration+A;if(!a.len||c<a.start||l>a.end){const h=o>c;(o<l||h)&&(h&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}i&&(this.fragmentTracker.removeFragmentsInRange(o,1/0,this.playlistType,!0),this.lastCurrentTime=o),!this.loadedmetadata&&!a.len&&(this.nextLoadPosition=this.startPosition=o),this.tickImmediate()}onMediaEnded(){this.startPosition=this.lastCurrentTime=0}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]}onHandlerDestroying(){this.stopLoad(),super.onHandlerDestroying()}onHandlerDestroyed(){this.state=J.STOPPED,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,super.onHandlerDestroyed()}loadFragment(e,t,i){this._loadFragForPlayback(e,t,i)}_loadFragForPlayback(e,t,i){const r=n=>{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${n.part?" p: "+n.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(n)};this._doFragLoad(e,t,i,r).then(n=>{if(!n)return;const o=this.state;if(this.fragContextChanged(e)){(o===J.FRAG_LOADING||!this.fragCurrent&&o===J.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=J.IDLE);return}"payload"in n&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(E.FRAG_LOADED,n)),this._handleFragmentLoadComplete(n)}).catch(n=>{this.state===J.STOPPED||this.state===J.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:i}=this;if(i.getState(e)===it.APPENDING){const n=e.type,o=this.getFwdBufferInfo(this.mediaBuffer,n),a=Math.max(e.duration,o?o.len:this.config.maxBufferLength);this.reduceMaxBufferLength(a)&&i.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?i.removeAllFragments():i.hasParts(e.type)&&(i.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),i.getState(e)===it.PARTIAL&&i.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,i=null){if(!(e-t))return;const r={startOffset:e,endOffset:t,type:i};this.hls.trigger(E.BUFFER_FLUSHING,r)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(i=>{if(!i||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return i}).then(i=>{const{hls:r}=this,{payload:n}=i,o=e.decryptdata;if(n&&n.byteLength>0&&o&&o.key&&o.iv&&o.method==="AES-128"){const a=self.performance.now();return this.decrypter.decrypt(new Uint8Array(n),o.key.buffer,o.iv.buffer).catch(A=>{throw r.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_DECRYPT_ERROR,fatal:!1,error:A,reason:A.message,frag:e}),A}).then(A=>{const l=self.performance.now();return r.trigger(E.FRAG_DECRYPTED,{frag:e,payload:A,stats:{tstart:a,tdecrypt:l}}),i.payload=A,i})}return i}).then(i=>{const{fragCurrent:r,hls:n,levels:o}=this;if(!o)throw new Error("init load aborted, missing levels");const a=e.stats;this.state=J.IDLE,t.fragmentError=0,e.data=new Uint8Array(i.payload),a.parsing.start=a.buffering.start=self.performance.now(),a.parsing.end=a.buffering.end=self.performance.now(),i.frag===r&&n.trigger(E.FRAG_BUFFERED,{stats:a,frag:r,part:null,id:e.type}),this.tick()}).catch(i=>{this.state===J.STOPPED||this.state===J.ERROR||(this.warn(i),this.resetFragmentLoading(e))})}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId}fragBufferedComplete(e,t){var i,r,n,o;const a=this.mediaBuffer?this.mediaBuffer:this.media;this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===pe.MAIN?"level":"track"} ${e.level} (frag:[${((i=e.startPTS)!=null?i:NaN).toFixed(3)}-${((r=e.endPTS)!=null?r:NaN).toFixed(3)}] > buffer:${a?Qp.toString(Ge.getBuffered(a)):"(detached)"})`),this.state=J.IDLE,a&&(!this.loadedmetadata&&e.type==pe.MAIN&&a.buffered.length&&((n=this.fragCurrent)==null?void 0:n.sn)===((o=this.fragPrevious)==null?void 0:o.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:i,part:r,partsLoaded:n}=e,o=!n||n.length===0||n.some(A=>!A),a=new ta(i.level,i.sn,i.stats.chunkCount+1,0,r?r.index:-1,!o);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,i=null,r){var n;const o=t==null?void 0:t.details;if(!this.levels||!o)throw new Error(`frag load aborted, missing level${o?"":" detail"}s`);let a=null;if(e.encrypted&&!((n=e.decryptdata)!=null&&n.key)?(this.log(`Loading key for ${e.sn} of [${o.startSN}-${o.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=J.KEY_LOADING,this.fragCurrent=e,a=this.keyLoader.load(e).then(c=>{if(!this.fragContextChanged(c.frag))return this.hls.trigger(E.KEY_LOADED,c),this.state===J.KEY_LOADING&&(this.state=J.IDLE),c}),this.hls.trigger(E.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(a=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&o.encryptedFragments.length&&this.keyLoader.loadClear(e,o.encryptedFragments),i=Math.max(e.start,i||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const c=o.partList;if(c&&r){i>e.end&&o.fragmentHint&&(e=o.fragmentHint);const h=this.getNextPart(c,e,i);if(h>-1){const u=c[h];this.log(`Loading part sn: ${e.sn} p: ${u.index} cc: ${e.cc} of playlist [${o.startSN}-${o.endSN}] parts [0-${h}-${c.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(i.toFixed(3))}`),this.nextLoadPosition=u.start+u.duration,this.state=J.FRAG_LOADING;let d;return a?d=a.then(g=>!g||this.fragContextChanged(g.frag)?null:this.doFragPartsLoad(e,u,t,r)).catch(g=>this.handleFragLoadError(g)):d=this.doFragPartsLoad(e,u,t,r).catch(g=>this.handleFragLoadError(g)),this.hls.trigger(E.FRAG_LOADING,{frag:e,part:u,targetBufferTime:i}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):d}else if(!e.url||this.loadedEndOfParts(c,i))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${o?"of ["+o.startSN+"-"+o.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(i.toFixed(3))}`),ce(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=J.FRAG_LOADING;const A=this.config.progressive;let l;return A&&a?l=a.then(c=>!c||this.fragContextChanged(c==null?void 0:c.frag)?null:this.fragmentLoader.load(e,r)).catch(c=>this.handleFragLoadError(c)):l=Promise.all([this.fragmentLoader.load(e,A?r:void 0),a]).then(([c])=>(!A&&c&&r&&r(c),c)).catch(c=>this.handleFragLoadError(c)),this.hls.trigger(E.FRAG_LOADING,{frag:e,targetBufferTime:i}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):l}doFragPartsLoad(e,t,i,r){return new Promise((n,o)=>{var a;const A=[],l=(a=i.details)==null?void 0:a.partList,c=h=>{this.fragmentLoader.loadPart(e,h,r).then(u=>{A[h.index]=u;const d=u.part;this.hls.trigger(E.FRAG_LOADED,u);const g=kc(i,e.sn,h.index+1)||Nc(l,e.sn,h.index+1);if(g)c(g);else return n({frag:e,part:d,partsLoaded:A})}).catch(o)};c(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===Y.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(E.ERROR,t)}else this.hls.trigger(E.ERROR,{type:ge.OTHER_ERROR,details:Y.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==J.PARSING){!this.fragCurrent&&this.state!==J.STOPPED&&this.state!==J.ERROR&&(this.state=J.IDLE);return}const{frag:i,part:r,level:n}=t,o=self.performance.now();i.stats.parsing.end=o,r&&(r.stats.parsing.end=o),this.updateLevelTiming(i,r,n,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:i}=this,{level:r,sn:n,part:o}=e;if(!(t!=null&&t[r]))return this.warn(`Levels object was unset while buffering fragment ${n} of level ${r}. The current chunk will not be buffered.`),null;const a=t[r],A=o>-1?kc(a,n,o):null,l=A?A.fragment:ep(a,n,i);return l?(i&&i!==l&&(l.stats=i.stats),{frag:l,part:A,level:a}):null}bufferFragmentData(e,t,i,r,n){var o;if(!e||this.state!==J.PARSING)return;const{data1:a,data2:A}=e;let l=a;if(a&&A&&(l=ji(a,A)),!((o=l)!=null&&o.length))return;const c={type:e.type,frag:t,part:i,chunkMeta:r,parent:t.type,data:l};if(this.hls.trigger(E.BUFFER_APPENDING,c),e.dropped&&e.independent&&!i){if(n)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Ge.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const i=t.currentTime,r=Ge.bufferInfo(t,i,0),n=e.duration,o=Math.min(this.config.maxFragLookUpTolerance*2,n*.25),a=Math.max(Math.min(e.start-o,r.end-o),i+o);e.start-a>o&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){const i=this.getLoadPosition();return ce(i)?this.getFwdBufferInfoAtPos(e,i,t):null}getFwdBufferInfoAtPos(e,t,i){const{config:{maxBufferHole:r}}=this,n=Ge.bufferInfo(e,t,r);if(n.len===0&&n.nextStart!==void 0){const o=this.fragmentTracker.getBufferedFrag(t,i);if(o&&n.nextStart<o.end)return Ge.bufferInfo(e,t,Math.max(n.nextStart,r))}return n}getMaxBufferLength(e){const{config:t}=this;let i;return e?i=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):i=t.maxBufferLength,Math.min(i,t.maxMaxBufferLength)}reduceMaxBufferLength(e){const t=this.config,i=e||t.maxBufferLength;return t.maxMaxBufferLength>=i?(t.maxMaxBufferLength/=2,this.warn(`Reduce max buffer length to ${t.maxMaxBufferLength}s`),!0):!1}getAppendedFrag(e,t=pe.MAIN){const i=this.fragmentTracker.getAppendedFrag(e,pe.MAIN);return i&&"fragment"in i?i.fragment:i}getNextFragment(e,t){const i=t.fragments,r=i.length;if(!r)return null;const{config:n}=this,o=i[0].start;let a;if(t.live){const A=n.initialLiveManifestSize;if(r<A)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${A})`),null;!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(a=this.getInitialLiveFragment(t,i),this.startPosition=a?this.hls.liveSyncPosition||a.start:e)}else e<=o&&(a=i[0]);if(!a){const A=n.lowLatencyMode?t.partEnd:t.fragmentEnd;a=this.getFragmentAtPosition(e,A,t)}return this.mapToInitFragWhenRequired(a)}isLoopLoading(e,t){const i=this.fragmentTracker.getState(e);return(i===it.OK||i===it.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,i,r,n){const o=e.gap,a=this.getNextFragment(this.nextLoadPosition,t);if(a===null)return a;if(e=a,o&&e&&!e.gap&&i.nextStart){const A=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,i.nextStart,r);if(A!==null&&i.len+A.len>=n)return this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,i){let r=-1,n=!1,o=!0;for(let a=0,A=e.length;a<A;a++){const l=e[a];if(o=o&&!l.independent,r>-1&&i<l.start)break;const c=l.loaded;c?r=-1:(n||l.independent||o)&&l.fragment===t&&(r=a),n=c}return r}loadedEndOfParts(e,t){const i=e[e.length-1];return i&&t>i.start&&i.loaded}getInitialLiveFragment(e,t){const i=this.fragPrevious;let r=null;if(i){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${i.programDateTime}`),r=ip(t,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){const n=i.sn+1;if(n>=e.startSN&&n<=e.endSN){const o=t[n-e.startSN];i.cc===o.cc&&(r=o,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=rp(t,i.cc),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const n=this.hls.liveSyncPosition;n!==null&&(r=this.getFragmentAtPosition(n,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,i){const{config:r}=this;let{fragPrevious:n}=this,{fragments:o,endSN:a}=i;const{fragmentHint:A}=i,l=r.maxFragLookUpTolerance,c=i.partList,h=!!(r.lowLatencyMode&&c!=null&&c.length&&A);h&&A&&!this.bitrateTest&&(o=o.concat(A),a=A.sn);let u;if(e<t){const d=e>t-l?0:l;u=ar(n,o,e,d)}else u=o[o.length-1];if(u){const d=u.sn-i.startSN,g=this.fragmentTracker.getState(u);if((g===it.OK||g===it.PARTIAL&&u.gap)&&(n=u),n&&u.sn===n.sn&&(!h||c[0].fragment.sn>u.sn)&&n&&u.level===n.level){const p=o[d+1];u.sn<a&&this.fragmentTracker.getState(p)!==it.OK?u=p:u=null}}return u}synchronizeToLiveEdge(e){const{config:t,media:i}=this;if(!i)return;const r=this.hls.liveSyncPosition,n=i.currentTime,o=e.fragments[0].start,a=e.edge,A=n>=o-t.maxFragLookUpTolerance&&n<=a;if(r!==null&&i.duration>r&&(n<r||!A)){const l=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!A&&i.readyState<4||n<a-l)&&(this.loadedmetadata||(this.nextLoadPosition=r),i.readyState&&(this.warn(`Playback: ${n.toFixed(3)} is located too far from the end of live sliding playlist: ${a}, reset currentTime to : ${r.toFixed(3)}`),i.currentTime=r))}}alignPlaylists(e,t){const{levels:i,levelLastLoaded:r,fragPrevious:n}=this,o=r!==null?i[r]:null,a=e.fragments.length;if(!a)return this.warn("No fragments in live playlist"),0;const A=e.fragments[0].start,l=!t,c=e.alignedSliding&&ce(A);if(l||!c&&!A){pp(n,o,e);const h=e.fragments[0].start;return this.log(`Live playlist sliding: ${h.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} prev-sn: ${n?n.sn:"na"} fragments: ${a}`),h}return A}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let i=this.startPosition;if(i<t&&(i=-1),i===-1||this.lastCurrentTime===-1){const r=this.startTimeOffset!==null,n=r?this.startTimeOffset:e.startTimeOffset;n!==null&&ce(n)?(i=t+n,n<0&&(i+=e.totalduration),i=Math.min(Math.max(t,i),t+e.totalduration),this.log(`Start time offset ${n} found in ${r?"multivariant":"media"} playlist, adjust startPosition to ${i}`),this.startPosition=i):e.live?i=this.hls.liveSyncPosition||t:this.startPosition=i=0,this.lastCurrentTime=i}this.nextLoadPosition=i}getLoadPosition(){const{media:e}=this;let t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t}handleFragLoadAborted(e,t){this.transmuxer&&e.sn!=="initSegment"&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==J.FRAG_LOADING_WAITING_RETRY)&&(this.state=J.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const h=this.getCurrentContext(t.chunkMeta);h&&(t.frag=h.frag)}const i=t.frag;if(!i||i.type!==e||!this.levels)return;if(this.fragContextChanged(i)){var r;this.warn(`Frag load error must match current frag to retry ${i.url} > ${(r=this.fragCurrent)==null?void 0:r.url}`);return}const n=t.details===Y.FRAG_GAP;n&&this.fragmentTracker.fragBuffered(i,!0);const o=t.errorAction,{action:a,retryCount:A=0,retryConfig:l}=o||{};if(o&&a===dt.RetryRequest&&l){var c;this.resetStartWhenNotLoaded((c=this.levelLastLoaded)!=null?c:i.level);const h=Xo(l,A);this.warn(`Fragment ${i.sn} of ${e} ${i.level} errored with ${t.details}, retrying loading ${A+1}/${l.maxNumRetry} in ${h}ms`),o.resolved=!0,this.retryDate=self.performance.now()+h,this.state=J.FRAG_LOADING_WAITING_RETRY}else l&&o?(this.resetFragmentErrors(e),A<l.maxNumRetry?n||(o.resolved=!0):N.warn(`${t.details} reached or exceeded max retry (${A})`)):(o==null?void 0:o.action)===dt.SendAlternateToPenaltyBox?this.state=J.WAITING_LEVEL:this.state=J.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===J.PARSING||this.state===J.PARSED){const t=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,t),r=i&&i.len>.5;r&&this.reduceMaxBufferLength(i.len);const n=!r;return n&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${t} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),n}return!1}resetFragmentErrors(e){e===pe.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==J.STOPPED&&(this.state=J.IDLE)}afterBufferFlushed(e,t,i){if(!e)return;const r=Ge.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,i),this.state===J.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=J.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=this.levels?this.levels[e].details:null;t!=null&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){var t;this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded((t=this.levelLastLoaded)!=null?t:e.level),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,i,r){var n;const o=i.details;if(!o){this.warn("level.details undefined");return}if(Object.keys(e.elementaryStreams).reduce((A,l)=>{const c=e.elementaryStreams[l];if(c){const h=c.endPTS-c.startPTS;if(h<=0)return this.warn(`Could not parse fragment ${e.sn} ${l} duration reliably (${h})`),A||!1;const u=r?0:Lc(o,e,c.startPTS,c.endPTS,c.startDTS,c.endDTS);return this.hls.trigger(E.LEVEL_PTS_UPDATED,{details:o,level:i,drift:u,type:l,frag:e,start:c.startPTS,end:c.endPTS}),!0}return A},!1))i.fragmentError=0;else if(((n=this.transmuxer)==null?void 0:n.error)===null){const A=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(i.fragmentError===0&&(i.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(A.message),this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!1,error:A,frag:e,reason:`Found no media in msn ${e.sn} of level "${i.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=J.PARSED,this.hls.trigger(E.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){if(e.event==="demuxerWorker"){var t,i,r;this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded((t=(i=this.levelLastLoaded)!=null?i:(r=this.fragCurrent)==null?void 0:r.level)!=null?t:0),this.resetLoadingState()}}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Vc(){return self.SourceBuffer||self.WebKitSourceBuffer}function bp(){const s=hn();if(!s)return!1;const e=Vc(),t=s&&typeof s.isTypeSupported=="function"&&s.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),i=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!t&&!!i}function Sp(){var s;const e=Vc();return typeof(e==null||(s=e.prototype)==null?void 0:s.changeType)=="function"}function wp(){return typeof __HLS_WORKER_BUNDLE__=="function"}function Tp(){const s=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),e=self.URL.createObjectURL(s);return{worker:new self.Worker(e),objectURL:e}}function xp(s){const e=new self.URL(s,self.location.href).href;return{worker:new self.Worker(e),scriptURL:e}}function Wt(s="",e=9e4){return{type:s,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Jc{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,i,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,i){}demux(e,t){this.cachedData&&(e=ji(this.cachedData,e),this.cachedData=null);let i=an(e,0),r=i?i.length:0,n;const o=this._audioTrack,a=this._id3Track,A=i?h0(i):void 0,l=e.length;for((this.basePTS===null||this.frameIndex===0&&ce(A))&&(this.basePTS=Dp(A,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),i&&i.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:Ot.audioId3,duration:Number.POSITIVE_INFINITY});r<l;){if(this.canParse(e,r)){const c=this.appendFrame(o,e,r);c?(this.frameIndex++,this.lastPTS=c.sample.pts,r+=c.length,n=r):r=l}else c0(e,r)?(i=an(e,r),a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:Ot.audioId3,duration:Number.POSITIVE_INFINITY}),r+=i.length,n=r):r++;if(r===l&&n!==l){const c=qi(e,n);this.cachedData?this.cachedData=ji(this.cachedData,c):this.cachedData=c}}return{audioTrack:o,videoTrack:Wt(),id3Track:a,textTrack:Wt()}}demuxSampleAes(e,t,i){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Wt(),id3Track:this._id3Track,textTrack:Wt()}}destroy(){}}const Dp=(s,e,t)=>{if(ce(s))return s*90;const i=t?t.baseTime*9e4/t.timescale:0;return e*9e4+i};function Rp(s,e,t,i){let r,n,o,a;const A=navigator.userAgent.toLowerCase(),l=i,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];r=((e[t+2]&192)>>>6)+1;const h=(e[t+2]&60)>>>2;if(h>c.length-1){s.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!0,reason:`invalid ADTS sampling index:${h}`});return}return o=(e[t+2]&1)<<2,o|=(e[t+3]&192)>>>6,N.log(`manifest codec:${i}, ADTS type:${r}, samplingIndex:${h}`),/firefox/i.test(A)?h>=6?(r=5,a=new Array(4),n=h-3):(r=2,a=new Array(2),n=h):A.indexOf("android")!==-1?(r=2,a=new Array(2),n=h):(r=5,a=new Array(4),i&&(i.indexOf("mp4a.40.29")!==-1||i.indexOf("mp4a.40.5")!==-1)||!i&&h>=6?n=h-3:((i&&i.indexOf("mp4a.40.2")!==-1&&(h>=6&&o===1||/vivaldi/i.test(A))||!i&&o===1)&&(r=2,a=new Array(2)),n=h)),a[0]=r<<3,a[0]|=(h&14)>>1,a[1]|=(h&1)<<7,a[1]|=o<<3,r===5&&(a[1]|=(n&14)>>1,a[2]=(n&1)<<7,a[2]|=8,a[3]=0),{config:a,samplerate:c[h],channelCount:o,codec:"mp4a.40."+r,manifestCodec:l}}function Wc(s,e){return s[e]===255&&(s[e+1]&246)===240}function qc(s,e){return s[e+1]&1?7:9}function na(s,e){return(s[e+3]&3)<<11|s[e+4]<<3|(s[e+5]&224)>>>5}function Lp(s,e){return e+5<s.length}function In(s,e){return e+1<s.length&&Wc(s,e)}function _p(s,e){return Lp(s,e)&&Wc(s,e)&&na(s,e)<=s.length-e}function kp(s,e){if(In(s,e)){const t=qc(s,e);if(e+t>=s.length)return!1;const i=na(s,e);if(i<=t)return!1;const r=e+i;return r===s.length||In(s,r)}return!1}function jc(s,e,t,i,r){if(!s.samplerate){const n=Rp(e,t,i,r);if(!n)return;s.config=n.config,s.samplerate=n.samplerate,s.channelCount=n.channelCount,s.codec=n.codec,s.manifestCodec=n.manifestCodec,N.log(`parsed codec:${s.codec}, rate:${n.samplerate}, channels:${n.channelCount}`)}}function Xc(s){return 9216e4/s}function Np(s,e){const t=qc(s,e);if(e+t<=s.length){const i=na(s,e)-t;if(i>0)return{headerLength:t,frameLength:i}}}function zc(s,e,t,i,r){const n=Xc(s.samplerate),o=i+r*n,a=Np(e,t);let A;if(a){const{frameLength:h,headerLength:u}=a,d=u+h,g=Math.max(0,t+d-e.length);g?(A=new Uint8Array(d-u),A.set(e.subarray(t+u,e.length),0)):A=e.subarray(t+u,t+d);const f={unit:A,pts:o};return g||s.samples.push(f),{sample:f,length:d,missing:g}}const l=e.length-t;return A=new Uint8Array(l),A.set(e.subarray(t,e.length),0),{sample:{unit:A,pts:o},length:l,missing:-1}}class Fp extends Jc{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,i,r){super.resetInitSegment(e,t,i,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;let i=(an(e,0)||[]).length;for(let r=e.length;i<r;i++)if(kp(e,i))return N.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return _p(e,t)}appendFrame(e,t,i){jc(e,this.observer,t,i,e.manifestCodec);const r=zc(e,t,i,this.basePTS,this.frameIndex);if(r&&r.missing===0)return r}}const Mp=/\/emsg[-/]ID3/i;class Pp{constructor(e,t){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=t}resetTimeStamp(){}resetInitSegment(e,t,i,r){const n=this.videoTrack=Wt("video",1),o=this.audioTrack=Wt("audio",1),a=this.txtTrack=Wt("text",1);if(this.id3Track=Wt("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const A=cc(e);if(A.video){const{id:l,timescale:c,codec:h}=A.video;n.id=l,n.timescale=a.timescale=c,n.codec=h}if(A.audio){const{id:l,timescale:c,codec:h}=A.audio;o.id=l,o.timescale=c,o.codec=h}a.id=ac.text,n.sampleDuration=0,n.duration=o.duration=r}resetContiguity(){this.remainderData=null}static probe(e){return e=e.length>16384?e.subarray(0,16384):e,Te(e,["moof"]).length>0}demux(e,t){this.timeOffset=t;let i=e;const r=this.videoTrack,n=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=ji(this.remainderData,e));const a=S0(i);this.remainderData=a.remainder,r.samples=a.valid||new Uint8Array}else r.samples=i;const o=this.extractID3Track(r,t);return n.samples=uc(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:o,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,i=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const r=this.extractID3Track(t,this.timeOffset);return i.samples=uc(e,t),{videoTrack:t,audioTrack:Wt(),id3Track:r,textTrack:Wt()}}extractID3Track(e,t){const i=this.id3Track;if(e.samples.length){const r=Te(e.samples,["emsg"]);r&&r.forEach(n=>{const o=x0(n);if(Mp.test(o.schemeIdUri)){const a=ce(o.presentationTime)?o.presentationTime/o.timeScale:t+o.presentationTimeDelta/o.timeScale;let A=o.eventDuration===4294967295?Number.POSITIVE_INFINITY:o.eventDuration/o.timeScale;A<=.001&&(A=Number.POSITIVE_INFINITY);const l=o.payload;i.samples.push({data:l,len:l.byteLength,dts:a,pts:a,type:Ot.emsg,duration:A})}})}return i}demuxSampleAes(e,t,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}let mn=null;const Op=[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],Up=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Gp=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Hp=[0,1,1,4];function Zc(s,e,t,i,r){if(t+24>e.length)return;const n=eh(e,t);if(n&&t+n.frameLength<=e.length){const o=n.samplesPerFrame*9e4/n.sampleRate,a=i+r*o,A={unit:e.subarray(t,t+n.frameLength),pts:a,dts:a};return s.config=[],s.channelCount=n.channelCount,s.samplerate=n.sampleRate,s.samples.push(A),{sample:A,length:n.frameLength,missing:0}}}function eh(s,e){const t=s[e+1]>>3&3,i=s[e+1]>>1&3,r=s[e+2]>>4&15,n=s[e+2]>>2&3;if(t!==1&&r!==0&&r!==15&&n!==3){const o=s[e+2]>>1&1,a=s[e+3]>>6,A=t===3?3-i:i===3?3:4,l=Op[A*14+r-1]*1e3,h=Up[(t===3?0:t===2?1:2)*3+n],u=a===3?1:2,d=Gp[t][i],g=Hp[i],f=d*8*g,p=Math.floor(d*l/h+o)*g;if(mn===null){const Q=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);mn=Q?parseInt(Q[1]):0}return!!mn&&mn<=87&&i===2&&l>=224e3&&a===0&&(s[e+3]=s[e+3]|128),{sampleRate:h,channelCount:u,frameLength:p,samplesPerFrame:f}}}function oa(s,e){return s[e]===255&&(s[e+1]&224)===224&&(s[e+1]&6)!==0}function th(s,e){return e+1<s.length&&oa(s,e)}function $p(s,e){return oa(s,e)&&4<=s.length-e}function Yp(s,e){if(e+1<s.length&&oa(s,e)){const i=eh(s,e);let r=4;i!=null&&i.frameLength&&(r=i.frameLength);const n=e+r;return n===s.length||th(s,n)}return!1}class ih{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,i=e.byteLength-t,r=new Uint8Array(4),n=Math.min(4,t);if(n===0)throw new Error("no bytes available");r.set(e.subarray(i,i+n)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=n*8,this.bytesAvailable-=n}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const i=this.word>>>32-t;if(e>32&&N.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?i<<t|this.readBits(t):i}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t=8,i=8,r;for(let n=0;n<e;n++)i!==0&&(r=this.readEG(),i=(t+r+256)%256),t=i===0?t:i}readSPS(){let e=0,t=0,i=0,r=0,n,o,a;const A=this.readUByte.bind(this),l=this.readBits.bind(this),c=this.readUEG.bind(this),h=this.readBoolean.bind(this),u=this.skipBits.bind(this),d=this.skipEG.bind(this),g=this.skipUEG.bind(this),f=this.skipScalingList.bind(this);A();const p=A();if(l(5),u(3),A(),g(),p===100||p===110||p===122||p===244||p===44||p===83||p===86||p===118||p===128){const b=c();if(b===3&&u(1),g(),g(),u(1),h())for(o=b!==3?8:12,a=0;a<o;a++)h()&&(a<6?f(16):f(64))}g();const y=c();if(y===0)c();else if(y===1)for(u(1),d(),d(),n=c(),a=0;a<n;a++)d();g(),u(1);const B=c(),Q=c(),C=l(1);C===0&&u(1),u(1),h()&&(e=c(),t=c(),i=c(),r=c());let T=[1,1];if(h()&&h())switch(A()){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:{T=[A()<<8|A(),A()<<8|A()];break}}return{width:Math.ceil((B+1)*16-e*2-t*2),height:(2-C)*(Q+1)*16-(C?2:4)*(i+r),pixelRatio:T}}readSliceType(){return this.readUByte(),this.readUEG(),this.readUEG()}}class Kp{constructor(e,t,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new sa(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,i){const r=e[t].unit;if(r.length<=16)return;const n=r.subarray(16,r.length-r.length%16),o=n.buffer.slice(n.byteOffset,n.byteOffset+n.length);this.decryptBuffer(o).then(a=>{const A=new Uint8Array(a);r.set(A,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,i)})}decryptAacSamples(e,t,i){for(;;t++){if(t>=e.length){i();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,i),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,i=new Int8Array(t);let r=0;for(let n=32;n<e.length-16;n+=160,r+=16)i.set(e.subarray(n,n+16),r);return i}getAvcDecryptedUnit(e,t){const i=new Uint8Array(t);let r=0;for(let n=32;n<e.length-16;n+=160,r+=16)e.set(i.subarray(r,r+16),n);return e}decryptAvcSample(e,t,i,r,n){const o=gc(n.data),a=this.getAvcEncryptedData(o);this.decryptBuffer(a.buffer).then(A=>{n.data=this.getAvcDecryptedUnit(o,A),this.decrypter.isSync()||this.decryptAvcSamples(e,t,i+1,r)})}decryptAvcSamples(e,t,i,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,i=0){if(t>=e.length){r();return}const n=e[t].units;for(;!(i>=n.length);i++){const o=n[i];if(!(o.data.length<=48||o.type!==1&&o.type!==5)&&(this.decryptAvcSample(e,t,i,r,o),!this.decrypter.isSync()))return}}}}const gt=188;class wi{constructor(e,t,i){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=e,this.config=t,this.typeSupported=i}static probe(e){const t=wi.syncOffset(e);return t>0&&N.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let i=Math.min(gt*5,e.length-gt)+1,r=0;for(;r<i;){let n=!1,o=-1,a=0;for(let A=r;A<t;A+=gt)if(e[A]===71){if(a++,o===-1&&(o=A,o!==0&&(i=Math.min(o+gt*99,e.length-gt)+1)),n||(n=aa(e,A)===0),n&&a>1&&(o===0&&a>2||A+gt>i))return o}else{if(a)return-1;break}r++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:ac[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,i,r){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=wi.createTrack("video"),this._audioTrack=wi.createTrack("audio",r),this._id3Track=wi.createTrack("id3"),this._txtTrack=wi.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=i,this._duration=r}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_avcTrack:t,_id3Track:i}=this;e&&(e.pesData=null),t&&(t.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null}demux(e,t,i=!1,r=!1){i||(this.sampleAes=null);let n;const o=this._avcTrack,a=this._audioTrack,A=this._id3Track,l=this._txtTrack;let c=o.pid,h=o.pesData,u=a.pid,d=A.pid,g=a.pesData,f=A.pesData,p=null,y=this.pmtParsed,B=this._pmtId,Q=e.length;if(this.remainderData&&(e=ji(this.remainderData,e),Q=e.length,this.remainderData=null),Q<gt&&!r)return this.remainderData=e,{audioTrack:a,videoTrack:o,id3Track:A,textTrack:l};const C=Math.max(0,wi.syncOffset(e));Q-=(Q-C)%gt,Q<e.byteLength&&!r&&(this.remainderData=new Uint8Array(e.buffer,Q,e.buffer.byteLength-Q));let T=0;for(let L=C;L<Q;L+=gt)if(e[L]===71){const R=!!(e[L+1]&64),O=aa(e,L),k=(e[L+3]&48)>>4;let W;if(k>1){if(W=L+5+e[L+4],W===L+gt)continue}else W=L+4;switch(O){case c:R&&(h&&(n=ds(h))&&this.parseAVCPES(o,l,n,!1),h={data:[],size:0}),h&&(h.data.push(e.subarray(W,L+gt)),h.size+=L+gt-W);break;case u:if(R){if(g&&(n=ds(g)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,n);break;case"mp3":this.parseMPEGPES(a,n);break}g={data:[],size:0}}g&&(g.data.push(e.subarray(W,L+gt)),g.size+=L+gt-W);break;case d:R&&(f&&(n=ds(f))&&this.parseID3PES(A,n),f={data:[],size:0}),f&&(f.data.push(e.subarray(W,L+gt)),f.size+=L+gt-W);break;case 0:R&&(W+=e[W]+1),B=this._pmtId=Vp(e,W);break;case B:{R&&(W+=e[W]+1);const $=Jp(e,W,this.typeSupported,i);c=$.avc,c>0&&(o.pid=c),u=$.audio,u>0&&(a.pid=u,a.segmentCodec=$.segmentCodec),d=$.id3,d>0&&(A.pid=d),p!==null&&!y&&(N.warn(`MPEG-TS PMT found at ${L} after unknown PID '${p}'. Backtracking to sync byte @${C} to parse all TS packets.`),p=null,L=C-188),y=this.pmtParsed=!0;break}case 17:case 8191:break;default:p=O;break}}else T++;if(T>0){const L=new Error(`Found ${T} TS packet/s that do not start with 0x47`);this.observer.emit(E.ERROR,E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!1,error:L,reason:L.message})}o.pesData=h,a.pesData=g,A.pesData=f;const b={audioTrack:a,videoTrack:o,id3Track:A,textTrack:l};return r&&this.extractRemainingSamples(b),b}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:i,id3Track:r,textTrack:n}=e,o=i.pesData,a=t.pesData,A=r.pesData;let l;if(o&&(l=ds(o))?(this.parseAVCPES(i,n,l,!0),i.pesData=null):i.pesData=o,a&&(l=ds(a))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break}t.pesData=null}else a!=null&&a.size&&N.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=a;A&&(l=ds(A))?(this.parseID3PES(r,l),r.pesData=null):r.pesData=A}demuxSampleAes(e,t,i){const r=this.demux(e,i,!0,!this.config.progressive),n=this.sampleAes=new Kp(this.observer,this.config,t);return this.decrypt(r,n)}decrypt(e,t){return new Promise(i=>{const{audioTrack:r,videoTrack:n}=e;r.samples&&r.segmentCodec==="aac"?t.decryptAacSamples(r.samples,0,()=>{n.samples?t.decryptAvcSamples(n.samples,0,0,()=>{i(e)}):i(e)}):n.samples&&t.decryptAvcSamples(n.samples,0,0,()=>{i(e)})})}destroy(){this._duration=0}parseAVCPES(e,t,i,r){const n=this.parseAVCNALu(e,i.data);let o=this.avcSample,a,A=!1;i.data=null,o&&n.length&&!e.audFound&&(Ar(o,e),o=this.avcSample=Cn(!1,i.pts,i.dts,"")),n.forEach(l=>{var c;switch(l.type){case 1:{let u=!1;a=!0;const d=l.data;if(A&&d.length>4){const g=new ih(d).readSliceType();(g===2||g===4||g===7||g===9)&&(u=!0)}if(u){var h;(h=o)!=null&&h.frame&&!o.key&&(Ar(o,e),o=this.avcSample=null)}o||(o=this.avcSample=Cn(!0,i.pts,i.dts,"")),o.frame=!0,o.key=u;break}case 5:a=!0,(c=o)!=null&&c.frame&&!o.key&&(Ar(o,e),o=this.avcSample=null),o||(o=this.avcSample=Cn(!0,i.pts,i.dts,"")),o.key=!0,o.frame=!0;break;case 6:{a=!0,dc(l.data,1,i.pts,t.samples);break}case 7:if(a=!0,A=!0,!e.sps){const u=l.data,g=new ih(u).readSPS();e.width=g.width,e.height=g.height,e.pixelRatio=g.pixelRatio,e.sps=[u],e.duration=this._duration;const f=u.subarray(1,4);let p="avc1.";for(let y=0;y<3;y++){let B=f[y].toString(16);B.length<2&&(B="0"+B),p+=B}e.codec=p}break;case 8:a=!0,e.pps||(e.pps=[l.data]);break;case 9:a=!1,e.audFound=!0,o&&Ar(o,e),o=this.avcSample=Cn(!1,i.pts,i.dts,"");break;case 12:a=!0;break;default:a=!1,o&&(o.debug+="unknown NAL "+l.type+" ");break}o&&a&&o.units.push(l)}),r&&o&&(Ar(o,e),this.avcSample=null)}getLastNalUnit(e){var t;let i=this.avcSample,r;if((!i||i.units.length===0)&&(i=e[e.length-1]),(t=i)!=null&&t.units){const n=i.units;r=n[n.length-1]}return r}parseAVCNALu(e,t){const i=t.byteLength;let r=e.naluState||0;const n=r,o=[];let a=0,A,l,c,h=-1,u=0;for(r===-1&&(h=0,u=t[0]&31,r=0,a=1);a<i;){if(A=t[a++],!r){r=A?0:1;continue}if(r===1){r=A?0:2;continue}if(!A)r=3;else if(A===1){if(h>=0){const d={data:t.subarray(h,a-r-1),type:u};o.push(d)}else{const d=this.getLastNalUnit(e.samples);if(d&&(n&&a<=4-n&&d.state&&(d.data=d.data.subarray(0,d.data.byteLength-n)),l=a-r-1,l>0)){const g=new Uint8Array(d.data.byteLength+l);g.set(d.data,0),g.set(t.subarray(0,l),d.data.byteLength),d.data=g,d.state=0}}a<i?(c=t[a]&31,h=a,u=c,r=0):r=-1}else r=0}if(h>=0&&r>=0){const d={data:t.subarray(h,i),type:u,state:r};o.push(d)}if(o.length===0){const d=this.getLastNalUnit(e.samples);if(d){const g=new Uint8Array(d.data.byteLength+t.byteLength);g.set(d.data,0),g.set(t,d.data.byteLength),d.data=g}}return e.naluState=r,o}parseAACPES(e,t){let i=0;const r=this.aacOverFlow;let n=t.data;if(r){this.aacOverFlow=null;const h=r.missing,u=r.sample.unit.byteLength;if(h===-1){const d=new Uint8Array(u+n.byteLength);d.set(r.sample.unit,0),d.set(n,u),n=d}else{const d=u-h;r.sample.unit.set(n.subarray(0,h),d),e.samples.push(r.sample),i=r.missing}}let o,a;for(o=i,a=n.length;o<a-1&&!In(n,o);o++);if(o!==i){let h;const u=o<a-1;u?h=`AAC PES did not start with ADTS header,offset:${o}`:h="No ADTS header found in AAC PES";const d=new Error(h);if(N.warn(`parsing error: ${h}`),this.observer.emit(E.ERROR,E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!1,levelRetry:u,error:d,reason:h}),!u)return}jc(e,this.observer,n,o,this.audioCodec);let A;if(t.pts!==void 0)A=t.pts;else if(r){const h=Xc(e.samplerate);A=r.sample.pts+h}else{N.warn("[tsdemuxer]: AAC PES unknown PTS");return}let l=0,c;for(;o<a;)if(c=zc(e,n,o,A,l),o+=c.length,c.missing){this.aacOverFlow=c;break}else for(l++;o<a-1&&!In(n,o);o++);}parseMPEGPES(e,t){const i=t.data,r=i.length;let n=0,o=0;const a=t.pts;if(a===void 0){N.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<r;)if(th(i,o)){const A=Zc(e,i,o,a,n);if(A)o+=A.length,n++;else break}else o++}parseID3PES(e,t){if(t.pts===void 0){N.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const i=Ze({},t,{type:this._avcTrack?Ot.emsg:Ot.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(i)}}function Cn(s,e,t,i){return{key:s,frame:!1,pts:e,dts:t,units:[],debug:i,length:0}}function aa(s,e){return((s[e+1]&31)<<8)+s[e+2]}function Vp(s,e){return(s[e+10]&31)<<8|s[e+11]}function Jp(s,e,t,i){const r={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},n=(s[e+1]&15)<<8|s[e+2],o=e+3+n-4,a=(s[e+10]&15)<<8|s[e+11];for(e+=12+a;e<o;){const A=aa(s,e);switch(s[e]){case 207:if(!i){N.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:r.audio===-1&&(r.audio=A);break;case 21:r.id3===-1&&(r.id3=A);break;case 219:if(!i){N.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:r.avc===-1&&(r.avc=A);break;case 3:case 4:t.mpeg!==!0&&t.mp3!==!0?N.log("MPEG audio found, not supported in this browser"):r.audio===-1&&(r.audio=A,r.segmentCodec="mp3");break;case 36:N.warn("Unsupported HEVC stream type found");break}e+=((s[e+3]&15)<<8|s[e+4])+5}return r}function ds(s){let e=0,t,i,r,n,o;const a=s.data;if(!s||s.size===0)return null;for(;a[0].length<19&&a.length>1;){const l=new Uint8Array(a[0].length+a[1].length);l.set(a[0]),l.set(a[1],a[0].length),a[0]=l,a.splice(1,1)}if(t=a[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(i=(t[4]<<8)+t[5],i&&i>s.size-6)return null;const l=t[7];l&192&&(n=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,l&64?(o=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,n-o>54e5&&(N.warn(`${Math.round((n-o)/9e4)}s delta between PTS and DTS, align them`),n=o)):o=n),r=t[8];let c=r+9;if(s.size<=c)return null;s.size-=c;const h=new Uint8Array(s.size);for(let u=0,d=a.length;u<d;u++){t=a[u];let g=t.byteLength;if(c)if(c>g){c-=g;continue}else t=t.subarray(c),g-=c,c=0;h.set(t,e),e+=g}return i&&(i-=r+3),{data:h,pts:n,dts:o,len:i}}return null}function Ar(s,e){if(s.units.length&&s.frame){if(s.pts===void 0){const t=e.samples,i=t.length;if(i){const r=t[i-1];s.pts=r.pts,s.dts=r.dts}else{e.dropped++;return}}e.samples.push(s)}s.debug.length&&N.log(s.pts+"/"+s.dts+":"+s.debug)}class Wp extends Jc{resetInitSegment(e,t,i,r){super.resetInitSegment(e,t,i,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;let i=(an(e,0)||[]).length;for(let r=e.length;i<r;i++)if(Yp(e,i))return N.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return $p(e,t)}appendFrame(e,t,i){if(this.basePTS!==null)return Zc(e,t,i,this.basePTS,this.frameIndex)}}class sh{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===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(t===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(t===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(t===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(t===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}}}const Ti=Math.pow(2,32)-1;class P{static init(){P.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:[]};let e;for(e in P.types)P.types.hasOwnProperty(e)&&(P.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=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]),i=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]);P.HDLR_TYPES={video:t,audio:i};const r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n=new Uint8Array([0,0,0,0,0,0,0,0]);P.STTS=P.STSC=P.STCO=n,P.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),P.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),P.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),P.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const o=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),A=new Uint8Array([0,0,0,1]);P.FTYP=P.box(P.types.ftyp,o,A,o,a),P.DINF=P.box(P.types.dinf,P.box(P.types.dref,r))}static box(e,...t){let i=8,r=t.length;const n=r;for(;r--;)i+=t[r].byteLength;const o=new Uint8Array(i);for(o[0]=i>>24&255,o[1]=i>>16&255,o[2]=i>>8&255,o[3]=i&255,o.set(e,4),r=0,i=8;r<n;r++)o.set(t[r],i),i+=t[r].byteLength;return o}static hdlr(e){return P.box(P.types.hdlr,P.HDLR_TYPES[e])}static mdat(e){return P.box(P.types.mdat,e)}static mdhd(e,t){t*=e;const i=Math.floor(t/(Ti+1)),r=Math.floor(t%(Ti+1));return P.box(P.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,i>>24,i>>16&255,i>>8&255,i&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))}static mdia(e){return P.box(P.types.mdia,P.mdhd(e.timescale,e.duration),P.hdlr(e.type),P.minf(e))}static mfhd(e){return P.box(P.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?P.box(P.types.minf,P.box(P.types.smhd,P.SMHD),P.DINF,P.stbl(e)):P.box(P.types.minf,P.box(P.types.vmhd,P.VMHD),P.DINF,P.stbl(e))}static moof(e,t,i){return P.box(P.types.moof,P.mfhd(e),P.traf(i,t))}static moov(e){let t=e.length;const i=[];for(;t--;)i[t]=P.trak(e[t]);return P.box.apply(null,[P.types.moov,P.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(P.mvex(e)))}static mvex(e){let t=e.length;const i=[];for(;t--;)i[t]=P.trex(e[t]);return P.box.apply(null,[P.types.mvex,...i])}static mvhd(e,t){t*=e;const i=Math.floor(t/(Ti+1)),r=Math.floor(t%(Ti+1)),n=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,i>>24,i>>16&255,i>>8&255,i&255,r>>24,r>>16&255,r>>8&255,r&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 P.box(P.types.mvhd,n)}static sdtp(e){const t=e.samples||[],i=new Uint8Array(4+t.length);let r,n;for(r=0;r<t.length;r++)n=t[r].flags,i[r+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return P.box(P.types.sdtp,i)}static stbl(e){return P.box(P.types.stbl,P.stsd(e),P.box(P.types.stts,P.STTS),P.box(P.types.stsc,P.STSC),P.box(P.types.stsz,P.STSZ),P.box(P.types.stco,P.STCO))}static avc1(e){let t=[],i=[],r,n,o;for(r=0;r<e.sps.length;r++)n=e.sps[r],o=n.byteLength,t.push(o>>>8&255),t.push(o&255),t=t.concat(Array.prototype.slice.call(n));for(r=0;r<e.pps.length;r++)n=e.pps[r],o=n.byteLength,i.push(o>>>8&255),i.push(o&255),i=i.concat(Array.prototype.slice.call(n));const a=P.box(P.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(i))),A=e.width,l=e.height,c=e.pixelRatio[0],h=e.pixelRatio[1];return P.box(P.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,A>>8&255,A&255,l>>8&255,l&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]),a,P.box(P.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),P.box(P.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,h>>24,h>>16&255,h>>8&255,h&255])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static mp4a(e){const t=e.samplerate;return P.box(P.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,t&255,0,0]),P.box(P.types.esds,P.esds(e)))}static mp3(e){const t=e.samplerate;return P.box(P.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,t&255,0,0]))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?P.box(P.types.stsd,P.STSD,P.mp3(e)):P.box(P.types.stsd,P.STSD,P.mp4a(e)):P.box(P.types.stsd,P.STSD,P.avc1(e))}static tkhd(e){const t=e.id,i=e.duration*e.timescale,r=e.width,n=e.height,o=Math.floor(i/(Ti+1)),a=Math.floor(i%(Ti+1));return P.box(P.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,a>>24,a>>16&255,a>>8&255,a&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,r>>8&255,r&255,0,0,n>>8&255,n&255,0,0]))}static traf(e,t){const i=P.sdtp(e),r=e.id,n=Math.floor(t/(Ti+1)),o=Math.floor(t%(Ti+1));return P.box(P.types.traf,P.box(P.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),P.box(P.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,o>>24,o>>16&255,o>>8&255,o&255])),P.trun(e,i.length+16+20+8+16+8+8),i)}static trak(e){return e.duration=e.duration||4294967295,P.box(P.types.trak,P.tkhd(e),P.mdia(e))}static trex(e){const t=e.id;return P.box(P.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const i=e.samples||[],r=i.length,n=12+16*r,o=new Uint8Array(n);let a,A,l,c,h,u;for(t+=8+n,o.set([e.type==="video"?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),a=0;a<r;a++)A=i[a],l=A.duration,c=A.size,h=A.flags,u=A.cts,o.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,h.degradPrio&61440,h.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*a);return P.box(P.types.trun,o)}static initSegment(e){P.types||P.init();const t=P.moov(e),i=new Uint8Array(P.FTYP.byteLength+t.byteLength);return i.set(P.FTYP),i.set(t,P.FTYP.byteLength),i}}P.types=void 0,P.HDLR_TYPES=void 0,P.STTS=void 0,P.STSC=void 0,P.STCO=void 0,P.STSZ=void 0,P.VMHD=void 0,P.SMHD=void 0,P.STSD=void 0,P.FTYP=void 0,P.DINF=void 0;const rh=9e4;function Aa(s,e,t=1,i=!1){const r=s*e*t;return i?Math.round(r):r}function qp(s,e,t=1,i=!1){return Aa(s,e,1/t,i)}function lr(s,e=!1){return Aa(s,1e3,1/rh,e)}function jp(s,e=1){return Aa(s,rh,1/e)}const Xp=10*1e3,nh=1024,zp=1152;let yn=null,la=null;class ca{constructor(e,t,i,r=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=e,this.config=t,this.typeSupported=i,this.ISGenerated=!1,yn===null){const o=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);yn=o?parseInt(o[1]):0}if(la===null){const n=navigator.userAgent.match(/Safari\/(\d+)/i);la=n?parseInt(n[1]):0}}destroy(){}resetTimeStamp(e){N.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){N.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){N.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1}getVideoStartPts(e){let t=!1;const i=e.reduce((r,n)=>{const o=n.pts-r;return o<-4294967296?(t=!0,_t(r,n.pts)):o>0?r:n.pts},e[0].pts);return t&&N.debug("PTS rollover detected"),i}remux(e,t,i,r,n,o,a,A){let l,c,h,u,d,g,f=n,p=n;const y=e.pid>-1,B=t.pid>-1,Q=t.samples.length,C=e.samples.length>0,T=a&&Q>0||Q>1;if((!y||C)&&(!B||T)||this.ISGenerated||a){this.ISGenerated||(h=this.generateIS(e,t,n,o));const L=this.isVideoContiguous;let R=-1,O;if(T&&(R=Zp(t.samples),!L&&this.config.forceKeyFrameOnDiscontinuity))if(g=!0,R>0){N.warn(`[mp4-remuxer]: Dropped ${R} out of ${Q} video samples due to a missing keyframe`);const k=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(R),t.dropped+=R,p+=(t.samples[0].pts-k)/t.inputTimeScale,O=p}else R===-1&&(N.warn(`[mp4-remuxer]: No keyframe found out of ${Q} video samples`),g=!1);if(this.ISGenerated){if(C&&T){const k=this.getVideoStartPts(t.samples),$=(_t(e.samples[0].pts,k)-k)/t.inputTimeScale;f+=Math.max(0,$),p+=Math.max(0,-$)}if(C){if(e.samplerate||(N.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),h=this.generateIS(e,t,n,o)),c=this.remuxAudio(e,f,this.isAudioContiguous,o,B||T||A===pe.AUDIO?p:void 0),T){const k=c?c.endPTS-c.startPTS:0;t.inputTimeScale||(N.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),h=this.generateIS(e,t,n,o)),l=this.remuxVideo(t,p,L,k)}}else T&&(l=this.remuxVideo(t,p,L,0));l&&(l.firstKeyFrame=R,l.independent=R!==-1,l.firstKeyFramePTS=O)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(i.samples.length&&(d=oh(i,n,this._initPTS,this._initDTS)),r.samples.length&&(u=ah(r,n,this._initPTS))),{audio:c,video:l,initSegment:h,independent:g,text:u,id3:d}}generateIS(e,t,i,r){const n=e.samples,o=t.samples,a=this.typeSupported,A={},l=this._initPTS;let c=!l||r,h="audio/mp4",u,d,g;if(c&&(u=d=1/0),e.config&&n.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":a.mpeg?(h="audio/mpeg",e.codec=""):a.mp3&&(e.codec="mp3");break}A.audio={id:"audio",container:h,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&a.mpeg?new Uint8Array(0):P.initSegment([e]),metadata:{channelCount:e.channelCount}},c&&(g=e.inputTimeScale,!l||g!==l.timescale?u=d=n[0].pts-Math.round(g*i):c=!1)}if(t.sps&&t.pps&&o.length&&(t.timescale=t.inputTimeScale,A.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:P.initSegment([t]),metadata:{width:t.width,height:t.height}},c))if(g=t.inputTimeScale,!l||g!==l.timescale){const f=this.getVideoStartPts(o),p=Math.round(g*i);d=Math.min(d,_t(o[0].dts,f)-p),u=Math.min(u,f-p)}else c=!1;if(Object.keys(A).length)return this.ISGenerated=!0,c?(this._initPTS={baseTime:u,timescale:g},this._initDTS={baseTime:d,timescale:g}):u=g=void 0,{tracks:A,initPTS:u,timescale:g}}remuxVideo(e,t,i,r){const n=e.inputTimeScale,o=e.samples,a=[],A=o.length,l=this._initPTS;let c=this.nextAvcDts,h=8,u=this.videoSampleDuration,d,g,f=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY,y=!1;if(!i||c===null){const v=t*n,w=o[0].pts-_t(o[0].dts,o[0].pts);c=v-w}const B=l.baseTime*n/l.timescale;for(let v=0;v<A;v++){const w=o[v];w.pts=_t(w.pts-B,c),w.dts=_t(w.dts-B,c),w.dts<o[v>0?v-1:v].dts&&(y=!0)}y&&o.sort(function(v,w){const F=v.dts-w.dts,H=v.pts-w.pts;return F||H}),d=o[0].dts,g=o[o.length-1].dts;const Q=g-d,C=Q?Math.round(Q/(A-1)):u||e.inputTimeScale/30;if(i){const v=d-c,w=v>C,F=v<-1;if((w||F)&&(w?N.warn(`AVC: ${lr(v,!0)} ms (${v}dts) hole between fragments detected, filling it`):N.warn(`AVC: ${lr(-v,!0)} ms (${v}dts) overlapping between fragments detected`),!F||c>=o[0].pts)){d=c;const H=o[0].pts-v;o[0].dts=d,o[0].pts=H,N.log(`Video: First PTS/DTS adjusted: ${lr(H,!0)}/${lr(d,!0)}, delta: ${lr(v,!0)} ms`)}}d=Math.max(0,d);let T=0,b=0;for(let v=0;v<A;v++){const w=o[v],F=w.units,H=F.length;let K=0;for(let j=0;j<H;j++)K+=F[j].data.length;b+=K,T+=H,w.length=K,w.dts=Math.max(w.dts,d),f=Math.min(w.pts,f),p=Math.max(w.pts,p)}g=o[A-1].dts;const L=b+4*T+8;let R;try{R=new Uint8Array(L)}catch(v){this.observer.emit(E.ERROR,E.ERROR,{type:ge.MUX_ERROR,details:Y.REMUX_ALLOC_ERROR,fatal:!1,error:v,bytes:L,reason:`fail allocating video mdat ${L}`});return}const O=new DataView(R.buffer);O.setUint32(0,L),R.set(P.types.mdat,4);let k=!1,W=Number.POSITIVE_INFINITY,$=Number.POSITIVE_INFINITY,te=Number.NEGATIVE_INFINITY,ee=Number.NEGATIVE_INFINITY;for(let v=0;v<A;v++){const w=o[v],F=w.units;let H=0;for(let se=0,ue=F.length;se<ue;se++){const Ae=F[se],Ce=Ae.data,be=Ae.data.byteLength;O.setUint32(h,be),h+=4,R.set(Ce,h),h+=be,H+=4+be}let K;if(v<A-1)u=o[v+1].dts-w.dts,K=o[v+1].pts-w.pts;else{const se=this.config,ue=v>0?w.dts-o[v-1].dts:C;if(K=v>0?w.pts-o[v-1].pts:C,se.stretchShortVideoTrack&&this.nextAudioPts!==null){const Ae=Math.floor(se.maxBufferHole*n),Ce=(r?f+r*n:this.nextAudioPts)-w.pts;Ce>Ae?(u=Ce-ue,u<0?u=ue:k=!0,N.log(`[mp4-remuxer]: It is approximately ${Ce/90} ms to the next segment; using duration ${u/90} ms for the last video frame.`)):u=ue}else u=ue}const j=Math.round(w.pts-w.dts);W=Math.min(W,u),te=Math.max(te,u),$=Math.min($,K),ee=Math.max(ee,K),a.push(new Ah(w.key,u,H,j))}if(a.length){if(yn){if(yn<70){const v=a[0].flags;v.dependsOn=2,v.isNonSync=0}}else if(la&&ee-$<te-W&&C/te<.025&&a[0].cts===0){N.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let v=d;for(let w=0,F=a.length;w<F;w++){const H=v+a[w].duration,K=v+a[w].cts;if(w<F-1){const j=H+a[w+1].cts;a[w].duration=j-K}else a[w].duration=w?a[w-1].duration:C;a[w].cts=0,v=H}}}u=k||!u?C:u,this.nextAvcDts=c=g+u,this.videoSampleDuration=u,this.isVideoContiguous=!0;const S=P.moof(e.sequenceNumber++,d,Ze({},e,{samples:a})),D="video",U={data1:S,data2:R,startPTS:f/n,endPTS:(p+u)/n,startDTS:d/n,endDTS:c/n,type:D,hasAudio:!1,hasVideo:!0,nb:a.length,dropped:e.dropped};return e.samples=[],e.dropped=0,U}remuxAudio(e,t,i,r,n){const o=e.inputTimeScale,a=e.samplerate?e.samplerate:o,A=o/a,l=e.segmentCodec==="aac"?nh:zp,c=l*A,h=this._initPTS,u=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,d=[],g=n!==void 0;let f=e.samples,p=u?0:8,y=this.nextAudioPts||-1;const B=t*o,Q=h.baseTime*o/h.timescale;if(this.isAudioContiguous=i=i||f.length&&y>0&&(r&&Math.abs(B-y)<9e3||Math.abs(_t(f[0].pts-Q,B)-y)<20*c),f.forEach(function(D){D.pts=_t(D.pts-Q,B)}),!i||y<0){if(f=f.filter(D=>D.pts>=0),!f.length)return;n===0?y=0:r&&!g?y=Math.max(0,B):y=f[0].pts}if(e.segmentCodec==="aac"){const D=this.config.maxAudioFramesDrift;for(let U=0,v=y;U<f.length;U++){const w=f[U],F=w.pts,H=F-v,K=Math.abs(1e3*H/o);if(H<=-D*c&&g)U===0&&(N.warn(`Audio frame @ ${(F/o).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*H/o)} ms.`),this.nextAudioPts=y=v=F);else if(H>=D*c&&K<Xp&&g){let j=Math.round(H/c);v=F-j*c,v<0&&(j--,v+=c),U===0&&(this.nextAudioPts=y=v),N.warn(`[mp4-remuxer]: Injecting ${j} audio frame @ ${(v/o).toFixed(3)}s due to ${Math.round(1e3*H/o)} ms gap.`);for(let se=0;se<j;se++){const ue=Math.max(v,0);let Ae=sh.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);Ae||(N.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ae=w.unit.subarray()),f.splice(U,0,{unit:Ae,pts:ue}),v+=c,U++}}w.pts=v,v+=c}}let C=null,T=null,b,L=0,R=f.length;for(;R--;)L+=f[R].unit.byteLength;for(let D=0,U=f.length;D<U;D++){const v=f[D],w=v.unit;let F=v.pts;if(T!==null){const K=d[D-1];K.duration=Math.round((F-T)/A)}else if(i&&e.segmentCodec==="aac"&&(F=y),C=F,L>0){L+=p;try{b=new Uint8Array(L)}catch(K){this.observer.emit(E.ERROR,E.ERROR,{type:ge.MUX_ERROR,details:Y.REMUX_ALLOC_ERROR,fatal:!1,error:K,bytes:L,reason:`fail allocating audio mdat ${L}`});return}u||(new DataView(b.buffer).setUint32(0,L),b.set(P.types.mdat,4))}else return;b.set(w,p);const H=w.byteLength;p+=H,d.push(new Ah(!0,l,H,0)),T=F}const O=d.length;if(!O)return;const k=d[d.length-1];this.nextAudioPts=y=T+A*k.duration;const W=u?new Uint8Array(0):P.moof(e.sequenceNumber++,C/A,Ze({},e,{samples:d}));e.samples=[];const $=C/o,te=y/o,S={data1:W,data2:b,startPTS:$,endPTS:te,startDTS:$,endDTS:te,type:"audio",hasAudio:!0,hasVideo:!1,nb:O};return this.isAudioContiguous=!0,S}remuxEmptyAudio(e,t,i,r){const n=e.inputTimeScale,o=e.samplerate?e.samplerate:n,a=n/o,A=this.nextAudioPts,l=this._initDTS,c=l.baseTime*9e4/l.timescale,h=(A!==null?A:r.startDTS*n)+c,u=r.endDTS*n+c,d=a*nh,g=Math.ceil((u-h)/d),f=sh.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(N.warn("[mp4-remuxer]: remux empty Audio"),!f){N.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const p=[];for(let y=0;y<g;y++){const B=h+y*d;p.push({unit:f,pts:B,dts:B})}return e.samples=p,this.remuxAudio(e,t,i,!1)}}function _t(s,e){let t;if(e===null)return s;for(e<s?t=-8589934592:t=8589934592;Math.abs(s-e)>4294967296;)s+=t;return s}function Zp(s){for(let e=0;e<s.length;e++)if(s[e].key)return e;return-1}function oh(s,e,t,i){const r=s.samples.length;if(!r)return;const n=s.inputTimeScale;for(let a=0;a<r;a++){const A=s.samples[a];A.pts=_t(A.pts-t.baseTime*n/t.timescale,e*n)/n,A.dts=_t(A.dts-i.baseTime*n/i.timescale,e*n)/n}const o=s.samples;return s.samples=[],{samples:o}}function ah(s,e,t){const i=s.samples.length;if(!i)return;const r=s.inputTimeScale;for(let o=0;o<i;o++){const a=s.samples[o];a.pts=_t(a.pts-t.baseTime*r/t.timescale,e*r)/r}s.samples.sort((o,a)=>o.pts-a.pts);const n=s.samples;return s.samples=[],{samples:n}}class Ah{constructor(e,t,i,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=i,this.cts=r,this.flags=new eE(e)}}class eE{constructor(e){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=e?2:1,this.isNonSync=e?0:1}}class tE{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,i,r){this.audioCodec=t,this.videoCodec=i,this.generateInitSegment(y0(e,r)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:i}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const r=this.initData=cc(e);t||(t=lh(r.audio,Fe.AUDIO)),i||(i=lh(r.video,Fe.VIDEO));const n={};r.audio&&r.video?n.audiovideo={container:"video/mp4",codec:t+","+i,initSegment:e,id:"main"}:r.audio?n.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?n.video={container:"video/mp4",codec:i,initSegment:e,id:"main"}:N.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n}remux(e,t,i,r,n,o){var a,A;let{initPTS:l,lastEndTime:c}=this;const h={audio:void 0,video:void 0,text:r,id3:i,initSegment:void 0};ce(c)||(c=this.lastEndTime=n||0);const u=t.samples;if(!(u!=null&&u.length))return h;const d={initPTS:void 0,timescale:1};let g=this.initData;if((a=g)!=null&&a.length||(this.generateInitSegment(u),g=this.initData),!((A=g)!=null&&A.length))return N.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),h;this.emitInitSegment&&(d.tracks=this.initTracks,this.emitInitSegment=!1);const f=v0(u,g),p=B0(g,u),y=p===null?n:p;(iE(l,y,n,f)||d.timescale!==l.timescale&&o)&&(d.initPTS=y-n,l&&l.timescale===1&&N.warn(`Adjusting initPTS by ${d.initPTS-l.baseTime}`),this.initPTS=l={baseTime:d.initPTS,timescale:1});const B=e?y-l.baseTime/l.timescale:c,Q=B+f;b0(g,u,l.baseTime/l.timescale),f>0?this.lastEndTime=Q:(N.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const C=!!g.audio,T=!!g.video;let b="";C&&(b+="audio"),T&&(b+="video");const L={data1:u,startPTS:B,startDTS:B,endPTS:Q,endDTS:Q,type:b,hasAudio:C,hasVideo:T,nb:1,dropped:0};return h.audio=L.type==="audio"?L:void 0,h.video=L.type!=="audio"?L:void 0,h.initSegment=d,h.id3=oh(i,n,l,l),r.samples.length&&(h.text=ah(r,n,l)),h}}function iE(s,e,t,i){if(s===null)return!0;const r=Math.max(i,1),n=e-s.baseTime/s.timescale;return Math.abs(n-t)>r}function lh(s,e){const t=s==null?void 0:s.codec;return t&&t.length>4?t:t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":t==="avc1"||e===Fe.VIDEO?"avc1.42e01e":"mp4a.40.5"}let li;try{li=self.performance.now.bind(self.performance)}catch{N.debug("Unable to use Performance API on this environment"),li=typeof self<"u"&&self.Date.now}const ha=[{demux:Pp,remux:tE},{demux:wi,remux:ca},{demux:Fp,remux:ca},{demux:Wp,remux:ca}];class ch{constructor(e,t,i,r,n){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=e,this.typeSupported=t,this.config=i,this.vendor=r,this.id=n}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,i,r){const n=i.transmuxing;n.executeStart=li();let o=new Uint8Array(e);const{currentTransmuxState:a,transmuxConfig:A}=this;r&&(this.currentTransmuxState=r);const{contiguous:l,discontinuity:c,trackSwitch:h,accurateTimeOffset:u,timeOffset:d,initSegmentChange:g}=r||a,{audioCodec:f,videoCodec:p,defaultInitPts:y,duration:B,initSegmentData:Q}=A,C=sE(o,t);if(C&&C.method==="AES-128"){const R=this.getDecrypter();if(R.isSync()){let O=R.softwareDecrypt(o,C.key.buffer,C.iv.buffer);if(i.part>-1&&(O=R.flush()),!O)return n.executeEnd=li(),ua(i);o=new Uint8Array(O)}else return this.decryptionPromise=R.webCryptoDecrypt(o,C.key.buffer,C.iv.buffer).then(O=>{const k=this.push(O,null,i);return this.decryptionPromise=null,k}),this.decryptionPromise}const T=this.needsProbing(c,h);if(T){const R=this.configureTransmuxer(o);if(R)return N.warn(`[transmuxer] ${R.message}`),this.observer.emit(E.ERROR,E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!1,error:R,reason:R.message}),n.executeEnd=li(),ua(i)}(c||h||g||T)&&this.resetInitSegment(Q,f,p,B,t),(c||g||T)&&this.resetInitialTimestamp(y),l||this.resetContiguity();const b=this.transmux(o,C,d,u,i),L=this.currentTransmuxState;return L.contiguous=!0,L.discontinuity=!1,L.trackSwitch=!1,n.executeEnd=li(),b}flush(e){const t=e.transmuxing;t.executeStart=li();const{decrypter:i,currentTransmuxState:r,decryptionPromise:n}=this;if(n)return n.then(()=>this.flush(e));const o=[],{timeOffset:a}=r;if(i){const h=i.flush();h&&o.push(this.push(h,null,e))}const{demuxer:A,remuxer:l}=this;if(!A||!l)return t.executeEnd=li(),[ua(e)];const c=A.flush(a);return Bn(c)?c.then(h=>(this.flushRemux(o,h,e),o)):(this.flushRemux(o,c,e),o)}flushRemux(e,t,i){const{audioTrack:r,videoTrack:n,id3Track:o,textTrack:a}=t,{accurateTimeOffset:A,timeOffset:l}=this.currentTransmuxState;N.log(`[transmuxer.ts]: Flushed fragment ${i.sn}${i.part>-1?" p: "+i.part:""} of level ${i.level}`);const c=this.remuxer.remux(r,n,o,a,l,A,!0,this.id);e.push({remuxResult:c,chunkMeta:i}),i.transmuxing.executeEnd=li()}resetInitialTimestamp(e){const{demuxer:t,remuxer:i}=this;!t||!i||(t.resetTimeStamp(e),i.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,i,r,n){const{demuxer:o,remuxer:a}=this;!o||!a||(o.resetInitSegment(e,t,i,r),a.resetInitSegment(e,t,i,n))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,i,r,n){let o;return t&&t.method==="SAMPLE-AES"?o=this.transmuxSampleAes(e,t,i,r,n):o=this.transmuxUnencrypted(e,i,r,n),o}transmuxUnencrypted(e,t,i,r){const{audioTrack:n,videoTrack:o,id3Track:a,textTrack:A}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(n,o,a,A,t,i,!1,this.id),chunkMeta:r}}transmuxSampleAes(e,t,i,r,n){return this.demuxer.demuxSampleAes(e,t,i).then(o=>({remuxResult:this.remuxer.remux(o.audioTrack,o.videoTrack,o.id3Track,o.textTrack,i,r,!1,this.id),chunkMeta:n}))}configureTransmuxer(e){const{config:t,observer:i,typeSupported:r,vendor:n}=this;let o;for(let h=0,u=ha.length;h<u;h++)if(ha[h].demux.probe(e)){o=ha[h];break}if(!o)return new Error("Failed to find demuxer by probing fragment data");const a=this.demuxer,A=this.remuxer,l=o.remux,c=o.demux;(!A||!(A instanceof l))&&(this.remuxer=new l(i,t,r,n)),(!a||!(a instanceof c))&&(this.demuxer=new c(i,t,r),this.probe=c.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new sa(this.config)),e}}function sE(s,e){let t=null;return s.byteLength>0&&e!=null&&e.key!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const ua=s=>({remuxResult:{},chunkMeta:s});function Bn(s){return"then"in s&&s.then instanceof Function}class rE{constructor(e,t,i,r,n){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=i,this.duration=r,this.defaultInitPts=n||null}}class nE{constructor(e,t,i,r,n,o){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=e,this.contiguous=t,this.accurateTimeOffset=i,this.trackSwitch=r,this.timeOffset=n,this.initSegmentChange=o}}var hh={exports:{}};(function(s){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function r(A,l,c){this.fn=A,this.context=l,this.once=c||!1}function n(A,l,c,h,u){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new r(c,h||A,u),g=t?t+l:l;return A._events[g]?A._events[g].fn?A._events[g]=[A._events[g],d]:A._events[g].push(d):(A._events[g]=d,A._eventsCount++),A}function o(A,l){--A._eventsCount===0?A._events=new i:delete A._events[l]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,h;if(this._eventsCount===0)return l;for(h in c=this._events)e.call(c,h)&&l.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=t?t+l:l,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var u=0,d=h.length,g=new Array(d);u<d;u++)g[u]=h[u].fn;return g},a.prototype.listenerCount=function(l){var c=t?t+l:l,h=this._events[c];return h?h.fn?1:h.length:0},a.prototype.emit=function(l,c,h,u,d,g){var f=t?t+l:l;if(!this._events[f])return!1;var p=this._events[f],y=arguments.length,B,Q;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),y){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,h),!0;case 4:return p.fn.call(p.context,c,h,u),!0;case 5:return p.fn.call(p.context,c,h,u,d),!0;case 6:return p.fn.call(p.context,c,h,u,d,g),!0}for(Q=1,B=new Array(y-1);Q<y;Q++)B[Q-1]=arguments[Q];p.fn.apply(p.context,B)}else{var C=p.length,T;for(Q=0;Q<C;Q++)switch(p[Q].once&&this.removeListener(l,p[Q].fn,void 0,!0),y){case 1:p[Q].fn.call(p[Q].context);break;case 2:p[Q].fn.call(p[Q].context,c);break;case 3:p[Q].fn.call(p[Q].context,c,h);break;case 4:p[Q].fn.call(p[Q].context,c,h,u);break;default:if(!B)for(T=1,B=new Array(y-1);T<y;T++)B[T-1]=arguments[T];p[Q].fn.apply(p[Q].context,B)}}return!0},a.prototype.on=function(l,c,h){return n(this,l,c,h,!1)},a.prototype.once=function(l,c,h){return n(this,l,c,h,!0)},a.prototype.removeListener=function(l,c,h,u){var d=t?t+l:l;if(!this._events[d])return this;if(!c)return o(this,d),this;var g=this._events[d];if(g.fn)g.fn===c&&(!u||g.once)&&(!h||g.context===h)&&o(this,d);else{for(var f=0,p=[],y=g.length;f<y;f++)(g[f].fn!==c||u&&!g[f].once||h&&g[f].context!==h)&&p.push(g[f]);p.length?this._events[d]=p.length===1?p[0]:p:o(this,d)}return this},a.prototype.removeAllListeners=function(l){var c;return l?(c=t?t+l:l,this._events[c]&&o(this,c)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,s.exports=a})(hh);var oE=hh.exports,da=Kf(oE);const ga=hn()||{isTypeSupported:()=>!1};class uh{constructor(e,t,i,r){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const n=e.config;this.hls=e,this.id=t,this.useWorker=!!n.enableWorker,this.onTransmuxComplete=i,this.onFlush=r;const o=(l,c)=>{c=c||{},c.frag=this.frag,c.id=this.id,l===E.ERROR&&(this.error=c.error),this.hls.trigger(l,c)};this.observer=new da,this.observer.on(E.FRAG_DECRYPTED,o),this.observer.on(E.ERROR,o);const a={mp4:ga.isTypeSupported("video/mp4"),mpeg:ga.isTypeSupported("audio/mpeg"),mp3:ga.isTypeSupported('audio/mp4; codecs="mp3"')},A=navigator.vendor;if(this.useWorker&&typeof Worker<"u"&&(n.workerPath||wp())){try{n.workerPath?(N.log(`loading Web Worker ${n.workerPath} for "${t}"`),this.workerContext=xp(n.workerPath)):(N.log(`injecting Web Worker for "${t}"`),this.workerContext=Tp()),this.onwmsg=h=>this.onWorkerMessage(h);const{worker:c}=this.workerContext;c.addEventListener("message",this.onwmsg),c.onerror=h=>{const u=new Error(`${h.message} (${h.filename}:${h.lineno})`);n.enableWorker=!1,N.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(E.ERROR,{type:ge.OTHER_ERROR,details:Y.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:u})},c.postMessage({cmd:"init",typeSupported:a,vendor:A,id:t,config:JSON.stringify(n)})}catch(c){N.warn(`Error setting up "${t}" Web Worker, fallback to inline`,c),this.resetWorker(),this.error=null,this.transmuxer=new ch(this.observer,a,n,A,t)}return}this.transmuxer=new ch(this.observer,a,n,A,t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,i,r,n,o,a,A,l,c){var h,u;l.transmuxing.start=self.performance.now();const{transmuxer:d}=this,g=o?o.start:n.start,f=n.decryptdata,p=this.frag,y=!(p&&n.cc===p.cc),B=!(p&&l.level===p.level),Q=p?l.sn-p.sn:-1,C=this.part?l.part-this.part.index:-1,T=Q===0&&l.id>1&&l.id===(p==null?void 0:p.stats.chunkCount),b=!B&&(Q===1||Q===0&&(C===1||T&&C<=0)),L=self.performance.now();(B||Q||n.stats.parsing.start===0)&&(n.stats.parsing.start=L),o&&(C||!b)&&(o.stats.parsing.start=L);const R=!(p&&((h=n.initSegment)==null?void 0:h.url)===((u=p.initSegment)==null?void 0:u.url)),O=new nE(y,b,A,B,g,R);if(!b||y||R){N.log(`[transmuxer-interface, ${n.type}]: Starting new transmux session for sn: ${l.sn} p: ${l.part} level: ${l.level} id: ${l.id}
|
179
|
+
*/const Wl="important",Kf=" !"+Wl,_o=ls(class extends Ys{constructor(s){var e;if(super(s),s.type!==As.ATTRIBUTE||s.name!=="style"||((e=s.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((e,t)=>{const i=s[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(s,[e]){const{style:t}=s.element;if(this.ut===void 0)return this.ut=new Set(Object.keys(e)),this.render(e);for(const i of this.ut)e[i]==null&&(this.ut.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const r=e[i];if(r!=null){this.ut.add(i);const n=typeof r=="string"&&r.endsWith(Kf);i.includes("-")||n?t.setProperty(i,n?r.slice(0,-11):r,n?Wl:""):t[i]=r}}return Ci}});function Vf(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var ql={exports:{}};(function(s,e){(function(t){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(A,l,c){if(c=c||{},A=A.trim(),l=l.trim(),!l){if(!c.alwaysNormalize)return A;var h=a.parseURL(A);if(!h)throw new Error("Error trying to parse base URL.");return h.path=a.normalizePath(h.path),a.buildURLFromParts(h)}var u=a.parseURL(l);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return c.alwaysNormalize?(u.path=a.normalizePath(u.path),a.buildURLFromParts(u)):l;var d=a.parseURL(A);if(!d)throw new Error("Error trying to parse base URL.");if(!d.netLoc&&d.path&&d.path[0]!=="/"){var g=r.exec(d.path);d.netLoc=g[1],d.path=g[2]}d.netLoc&&!d.path&&(d.path="/");var f={scheme:d.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(f.netLoc=d.netLoc,u.path[0]!=="/"))if(!u.path)f.path=d.path,u.params||(f.params=d.params,u.query||(f.query=d.query));else{var p=d.path,y=p.substring(0,p.lastIndexOf("/")+1)+u.path;f.path=a.normalizePath(y)}return f.path===null&&(f.path=c.alwaysNormalize?a.normalizePath(u.path):u.path),a.buildURLFromParts(f)},parseURL:function(A){var l=i.exec(A);return l?{scheme:l[1]||"",netLoc:l[2]||"",path:l[3]||"",params:l[4]||"",query:l[5]||"",fragment:l[6]||""}:null},normalizePath:function(A){for(A=A.split("").reverse().join("").replace(n,"");A.length!==(A=A.replace(o,"")).length;);return A.split("").reverse().join("")},buildURLFromParts:function(A){return A.scheme+A.netLoc+A.path+A.params+A.query+A.fragment}};s.exports=a})()})(ql);var ko=ql.exports;function jl(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(s,r).enumerable})),t.push.apply(t,i)}return t}function vt(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jl(Object(t),!0).forEach(function(i){Jf(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):jl(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}function Jf(s,e,t){return e=qf(e),e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function Ze(){return Ze=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},Ze.apply(this,arguments)}function Wf(s,e){if(typeof s!="object"||s===null)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var i=t.call(s,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function qf(s){var e=Wf(s,"string");return typeof e=="symbol"?e:String(e)}const he=Number.isFinite||function(s){return typeof s=="number"&&isFinite(s)};let E=function(s){return s.MEDIA_ATTACHING="hlsMediaAttaching",s.MEDIA_ATTACHED="hlsMediaAttached",s.MEDIA_DETACHING="hlsMediaDetaching",s.MEDIA_DETACHED="hlsMediaDetached",s.BUFFER_RESET="hlsBufferReset",s.BUFFER_CODECS="hlsBufferCodecs",s.BUFFER_CREATED="hlsBufferCreated",s.BUFFER_APPENDING="hlsBufferAppending",s.BUFFER_APPENDED="hlsBufferAppended",s.BUFFER_EOS="hlsBufferEos",s.BUFFER_FLUSHING="hlsBufferFlushing",s.BUFFER_FLUSHED="hlsBufferFlushed",s.MANIFEST_LOADING="hlsManifestLoading",s.MANIFEST_LOADED="hlsManifestLoaded",s.MANIFEST_PARSED="hlsManifestParsed",s.LEVEL_SWITCHING="hlsLevelSwitching",s.LEVEL_SWITCHED="hlsLevelSwitched",s.LEVEL_LOADING="hlsLevelLoading",s.LEVEL_LOADED="hlsLevelLoaded",s.LEVEL_UPDATED="hlsLevelUpdated",s.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",s.LEVELS_UPDATED="hlsLevelsUpdated",s.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",s.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",s.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",s.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",s.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",s.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",s.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",s.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",s.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",s.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",s.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",s.CUES_PARSED="hlsCuesParsed",s.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",s.INIT_PTS_FOUND="hlsInitPtsFound",s.FRAG_LOADING="hlsFragLoading",s.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",s.FRAG_LOADED="hlsFragLoaded",s.FRAG_DECRYPTED="hlsFragDecrypted",s.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",s.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",s.FRAG_PARSING_METADATA="hlsFragParsingMetadata",s.FRAG_PARSED="hlsFragParsed",s.FRAG_BUFFERED="hlsFragBuffered",s.FRAG_CHANGED="hlsFragChanged",s.FPS_DROP="hlsFpsDrop",s.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",s.ERROR="hlsError",s.DESTROYING="hlsDestroying",s.KEY_LOADING="hlsKeyLoading",s.KEY_LOADED="hlsKeyLoaded",s.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",s.BACK_BUFFER_REACHED="hlsBackBufferReached",s}({}),ge=function(s){return s.NETWORK_ERROR="networkError",s.MEDIA_ERROR="mediaError",s.KEY_SYSTEM_ERROR="keySystemError",s.MUX_ERROR="muxError",s.OTHER_ERROR="otherError",s}({}),Y=function(s){return s.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",s.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",s.KEY_SYSTEM_NO_SESSION="keySystemNoSession",s.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",s.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",s.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",s.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",s.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",s.MANIFEST_LOAD_ERROR="manifestLoadError",s.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",s.MANIFEST_PARSING_ERROR="manifestParsingError",s.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",s.LEVEL_EMPTY_ERROR="levelEmptyError",s.LEVEL_LOAD_ERROR="levelLoadError",s.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",s.LEVEL_PARSING_ERROR="levelParsingError",s.LEVEL_SWITCH_ERROR="levelSwitchError",s.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",s.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",s.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",s.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",s.FRAG_LOAD_ERROR="fragLoadError",s.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",s.FRAG_DECRYPT_ERROR="fragDecryptError",s.FRAG_PARSING_ERROR="fragParsingError",s.FRAG_GAP="fragGap",s.REMUX_ALLOC_ERROR="remuxAllocError",s.KEY_LOAD_ERROR="keyLoadError",s.KEY_LOAD_TIMEOUT="keyLoadTimeOut",s.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",s.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",s.BUFFER_APPEND_ERROR="bufferAppendError",s.BUFFER_APPENDING_ERROR="bufferAppendingError",s.BUFFER_STALLED_ERROR="bufferStalledError",s.BUFFER_FULL_ERROR="bufferFullError",s.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",s.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",s.INTERNAL_EXCEPTION="internalException",s.INTERNAL_ABORTED="aborted",s.UNKNOWN="unknown",s}({});const Wi=function(){},No={trace:Wi,debug:Wi,log:Wi,warn:Wi,info:Wi,error:Wi};let sr=No;function jf(s){const e=self.console[s];return e?e.bind(self.console,`[${s}] >`):Wi}function Xf(s,...e){e.forEach(function(t){sr[t]=s[t]?s[t].bind(s):jf(t)})}function zf(s,e){if(self.console&&s===!0||typeof s=="object"){Xf(s,"debug","log","info","warn","error");try{sr.log(`Debug logs enabled for "${e}" in hls.js version 1.4.12`)}catch{sr=No}}else sr=No}const N=sr,Zf=/^(\d+)x(\d+)$/,Xl=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Ke{constructor(e){typeof e=="string"&&(e=Ke.parseAttrList(e));for(const t in e)e.hasOwnProperty(t)&&(t.substring(0,2)==="X-"&&(this.clientAttrs=this.clientAttrs||[],this.clientAttrs.push(t)),this[t]=e[t])}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const i=new Uint8Array(t.length/2);for(let r=0;r<t.length/2;r++)i[r]=parseInt(t.slice(r*2,r*2+2),16);return i}else return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const i=this[e];return i?parseFloat(i):t}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Zf.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const i={},r='"';for(Xl.lastIndex=0;(t=Xl.exec(e))!==null;){let n=t[2];n.indexOf(r)===0&&n.lastIndexOf(r)===n.length-1&&(n=n.slice(1,-1));const o=t[1].trim();i[o]=n}return i}}function e0(s){return s!=="ID"&&s!=="CLASS"&&s!=="START-DATE"&&s!=="DURATION"&&s!=="END-DATE"&&s!=="END-ON-NEXT"}function t0(s){return s==="SCTE35-OUT"||s==="SCTE35-IN"}class zl{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const i=t.attr;for(const r in i)if(Object.prototype.hasOwnProperty.call(e,r)&&e[r]!==i[r]){N.warn(`DATERANGE tag attribute: "${r}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=r;break}e=Ze(new Ke({}),i,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const i=new Date(this.attr["END-DATE"]);he(i.getTime())&&(this._endDate=i)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(he(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&he(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class on{constructor(){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}}}var Me={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Zl{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[Me.AUDIO]:null,[Me.VIDEO]:null,[Me.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const i=e.split("@",2),r=[];i.length===1?r[0]=t?t.byteRangeEndOffset:0:r[0]=parseInt(i[1]),r[1]=parseInt(i[0])+r[0],this._byteRange=r}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=ko.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class Fo extends Zl{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new on,this.urlId=0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const i=Object.keys(this.levelkeys);if(i.length===1)return this._decryptdata=this.levelkeys[i[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!he(this.programDateTime))return null;const e=he(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),i=t.length;if(i>1||i===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,i,r,n,o=!1){const{elementaryStreams:a}=this,A=a[e];if(!A){a[e]={startPTS:t,endPTS:i,startDTS:r,endDTS:n,partial:o};return}A.startPTS=Math.min(A.startPTS,t),A.endPTS=Math.max(A.endPTS,i),A.startDTS=Math.min(A.startDTS,r),A.endDTS=Math.max(A.endDTS,n)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[Me.AUDIO]=null,e[Me.VIDEO]=null,e[Me.AUDIOVIDEO]=null}}class i0 extends Zl{constructor(e,t,i,r,n){super(i),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new on,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=r;const o=e.enumeratedString("BYTERANGE");o&&this.setByteRange(o,n),n&&(this.fragOffset=n.fragOffset+n.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const s0=10;class r0{constructor(e){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.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,i=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!i||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&i>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?he(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||s0}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function Mo(s){return Uint8Array.from(atob(s),e=>e.charCodeAt(0))}function n0(s){const e=ec(s).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function o0(s){const e=function(i,r,n){const o=i[r];i[r]=i[n],i[n]=o};e(s,0,3),e(s,1,2),e(s,4,5),e(s,6,7)}function a0(s){const e=s.split(":");let t=null;if(e[0]==="data"&&e.length===2){const i=e[1].split(";"),r=i[i.length-1].split(",");if(r.length===2){const n=r[0]==="base64",o=r[1];n?(i.splice(-1,1),t=Mo(o)):t=n0(o)}}return t}function ec(s){return Uint8Array.from(unescape(encodeURIComponent(s)),e=>e.charCodeAt(0))}var Ve={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Qt={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function tc(s){switch(s){case Qt.FAIRPLAY:return Ve.FAIRPLAY;case Qt.PLAYREADY:return Ve.PLAYREADY;case Qt.WIDEVINE:return Ve.WIDEVINE;case Qt.CLEARKEY:return Ve.CLEARKEY}}var ic={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function A0(s){if(s===ic.WIDEVINE)return Ve.WIDEVINE}function sc(s){switch(s){case Ve.FAIRPLAY:return Qt.FAIRPLAY;case Ve.PLAYREADY:return Qt.PLAYREADY;case Ve.WIDEVINE:return Qt.WIDEVINE;case Ve.CLEARKEY:return Qt.CLEARKEY}}function Po(s){const{drmSystems:e,widevineLicenseUrl:t}=s,i=e?[Ve.FAIRPLAY,Ve.WIDEVINE,Ve.PLAYREADY,Ve.CLEARKEY].filter(r=>!!e[r]):[];return!i[Ve.WIDEVINE]&&t&&i.push(Ve.WIDEVINE),i}const rc=function(){return typeof self<"u"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function l0(s,e,t,i){let r;switch(s){case Ve.FAIRPLAY:r=["cenc","sinf"];break;case Ve.WIDEVINE:case Ve.PLAYREADY:r=["cenc"];break;case Ve.CLEARKEY:r=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${s}`)}return c0(r,e,t,i)}function c0(s,e,t,i){return[{initDataTypes:s,persistentState:i.persistentState||"not-allowed",distinctiveIdentifier:i.distinctiveIdentifier||"not-allowed",sessionTypes:i.sessionTypes||[i.sessionType||"temporary"],audioCapabilities:e.map(n=>({contentType:`audio/mp4; codecs="${n}"`,robustness:i.audioRobustness||"",encryptionScheme:i.audioEncryptionScheme||null})),videoCapabilities:t.map(n=>({contentType:`video/mp4; codecs="${n}"`,robustness:i.videoRobustness||"",encryptionScheme:i.videoEncryptionScheme||null}))}]}function qi(s,e,t){return Uint8Array.prototype.slice?s.slice(e,t):new Uint8Array(Array.prototype.slice.call(s,e,t))}const Oo=(s,e)=>e+10<=s.length&&s[e]===73&&s[e+1]===68&&s[e+2]===51&&s[e+3]<255&&s[e+4]<255&&s[e+6]<128&&s[e+7]<128&&s[e+8]<128&&s[e+9]<128,nc=(s,e)=>e+10<=s.length&&s[e]===51&&s[e+1]===68&&s[e+2]===73&&s[e+3]<255&&s[e+4]<255&&s[e+6]<128&&s[e+7]<128&&s[e+8]<128&&s[e+9]<128,an=(s,e)=>{const t=e;let i=0;for(;Oo(s,e);){i+=10;const r=An(s,e+6);i+=r,nc(s,e+10)&&(i+=10),e+=i}if(i>0)return s.subarray(t,t+i)},An=(s,e)=>{let t=0;return t=(s[e]&127)<<21,t|=(s[e+1]&127)<<14,t|=(s[e+2]&127)<<7,t|=s[e+3]&127,t},h0=(s,e)=>Oo(s,e)&&An(s,e+6)+10<=s.length-e,u0=s=>{const e=ac(s);for(let t=0;t<e.length;t++){const i=e[t];if(oc(i))return I0(i)}},oc=s=>s&&s.key==="PRIV"&&s.info==="com.apple.streaming.transportStreamTimestamp",d0=s=>{const e=String.fromCharCode(s[0],s[1],s[2],s[3]),t=An(s,4),i=10;return{type:e,size:t,data:s.subarray(i,i+t)}},ac=s=>{let e=0;const t=[];for(;Oo(s,e);){const i=An(s,e+6);e+=10;const r=e+i;for(;e+8<r;){const n=d0(s.subarray(e)),o=g0(n);o&&t.push(o),e+=n.size+10}nc(s,e)&&(e+=10)}return t},g0=s=>s.type==="PRIV"?f0(s):s.type[0]==="W"?E0(s):p0(s),f0=s=>{if(s.size<2)return;const e=Vt(s.data,!0),t=new Uint8Array(s.data.subarray(e.length+1));return{key:s.type,info:e,data:t.buffer}},p0=s=>{if(s.size<2)return;if(s.type==="TXXX"){let t=1;const i=Vt(s.data.subarray(t),!0);t+=i.length+1;const r=Vt(s.data.subarray(t));return{key:s.type,info:i,data:r}}const e=Vt(s.data.subarray(1));return{key:s.type,data:e}},E0=s=>{if(s.type==="WXXX"){if(s.size<2)return;let t=1;const i=Vt(s.data.subarray(t),!0);t+=i.length+1;const r=Vt(s.data.subarray(t));return{key:s.type,info:i,data:r}}const e=Vt(s.data);return{key:s.type,data:e}},I0=s=>{if(s.data.byteLength===8){const e=new Uint8Array(s.data),t=e[3]&1;let i=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return i/=45,t&&(i+=4772185884e-2),Math.round(i)}},Vt=(s,e=!1)=>{const t=m0();if(t){const l=t.decode(s);if(e){const c=l.indexOf("\0");return c!==-1?l.substring(0,c):l}return l.replace(/\0/g,"")}const i=s.length;let r,n,o,a="",A=0;for(;A<i;){if(r=s[A++],r===0&&e)return a;if(r===0||r===3)continue;switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(r);break;case 12:case 13:n=s[A++],a+=String.fromCharCode((r&31)<<6|n&63);break;case 14:n=s[A++],o=s[A++],a+=String.fromCharCode((r&15)<<12|(n&63)<<6|(o&63)<<0);break}}return a};let Uo;function m0(){return!Uo&&typeof self.TextDecoder<"u"&&(Uo=new self.TextDecoder("utf-8")),Uo}const Jt={hexDump:function(s){let e="";for(let t=0;t<s.length;t++){let i=s[t].toString(16);i.length<2&&(i="0"+i),e+=i}return e}},ln=Math.pow(2,32)-1,C0=[].push,Ac={video:1,audio:2,id3:3,text:4};function At(s){return String.fromCharCode.apply(null,s)}function lc(s,e){const t=s[e]<<8|s[e+1];return t<0?65536+t:t}function me(s,e){const t=cc(s,e);return t<0?4294967296+t:t}function cc(s,e){return s[e]<<24|s[e+1]<<16|s[e+2]<<8|s[e+3]}function Go(s,e,t){s[e]=t>>24,s[e+1]=t>>16&255,s[e+2]=t>>8&255,s[e+3]=t&255}function xe(s,e){const t=[];if(!e.length)return t;const i=s.byteLength;for(let r=0;r<i;){const n=me(s,r),o=At(s.subarray(r+4,r+8)),a=n>1?r+n:i;if(o===e[0])if(e.length===1)t.push(s.subarray(r+8,a));else{const A=xe(s.subarray(r+8,a),e.slice(1));A.length&&C0.apply(t,A)}r=a}return t}function y0(s){const e=[],t=s[0];let i=8;const r=me(s,i);i+=4;const n=0,o=0;t===0?i+=8:i+=16,i+=2;let a=s.length+o;const A=lc(s,i);i+=2;for(let l=0;l<A;l++){let c=i;const h=me(s,c);c+=4;const u=h&2147483647;if((h&2147483648)>>>31===1)return N.warn("SIDX has hierarchical references (not supported)"),null;const g=me(s,c);c+=4,e.push({referenceSize:u,subsegmentDuration:g,info:{duration:g/r,start:a,end:a+u-1}}),a+=u,c+=4,i=c}return{earliestPresentationTime:n,timescale:r,version:t,referencesCount:A,references:e}}function hc(s){const e=[],t=xe(s,["moov","trak"]);for(let r=0;r<t.length;r++){const n=t[r],o=xe(n,["tkhd"])[0];if(o){let a=o[0],A=a===0?12:20;const l=me(o,A),c=xe(n,["mdia","mdhd"])[0];if(c){a=c[0],A=a===0?12:20;const h=me(c,A),u=xe(n,["mdia","hdlr"])[0];if(u){const d=At(u.subarray(8,12)),g={soun:Me.AUDIO,vide:Me.VIDEO}[d];if(g){const f=xe(n,["mdia","minf","stbl","stsd"])[0];let p;f&&(p=At(f.subarray(12,16))),e[l]={timescale:h,type:g},e[g]={timescale:h,id:l,codec:p}}}}}}return xe(s,["moov","mvex","trex"]).forEach(r=>{const n=me(r,4),o=e[n];o&&(o.default={duration:me(r,12),flags:me(r,20)})}),e}function B0(s,e){if(!s||!e)return s;const t=e.keyId;return t&&e.isCommonEncryption&&xe(s,["moov","trak"]).forEach(r=>{const o=xe(r,["mdia","minf","stbl","stsd"])[0].subarray(8);let a=xe(o,["enca"]);const A=a.length>0;A||(a=xe(o,["encv"])),a.forEach(l=>{const c=A?l.subarray(28):l.subarray(78);xe(c,["sinf"]).forEach(u=>{const d=uc(u);if(d){const g=d.subarray(8,24);g.some(f=>f!==0)||(N.log(`[eme] Patching keyId in 'enc${A?"a":"v"}>sinf>>tenc' box: ${Jt.hexDump(g)} -> ${Jt.hexDump(t)}`),d.set(t,8))}})})}),s}function uc(s){const e=xe(s,["schm"])[0];if(e){const t=At(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return xe(s,["schi","tenc"])[0]}return N.error("[eme] missing 'schm' box"),null}function v0(s,e){return xe(e,["moof","traf"]).reduce((t,i)=>{const r=xe(i,["tfdt"])[0],n=r[0],o=xe(i,["tfhd"]).reduce((a,A)=>{const l=me(A,4),c=s[l];if(c){let h=me(r,4);if(n===1){if(h===ln)return N.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),a;h*=ln+1,h+=me(r,8)}const u=c.timescale||9e4,d=h/u;if(isFinite(d)&&(a===null||d<a))return d}return a},null);return o!==null&&isFinite(o)&&(t===null||o<t)?o:t},null)}function Q0(s,e){let t=0,i=0,r=0;const n=xe(s,["moof","traf"]);for(let o=0;o<n.length;o++){const a=n[o],A=xe(a,["tfhd"])[0],l=me(A,4),c=e[l];if(!c)continue;const h=c.default,u=me(A,0)|(h==null?void 0:h.flags);let d=h==null?void 0:h.duration;u&8&&(u&2?d=me(A,12):d=me(A,8));const g=c.timescale||9e4,f=xe(a,["trun"]);for(let p=0;p<f.length;p++){if(t=b0(f[p]),!t&&d){const y=me(f[p],4);t=d*y}c.type===Me.VIDEO?i+=t/g:c.type===Me.AUDIO&&(r+=t/g)}}if(i===0&&r===0){let o=0;const a=xe(s,["sidx"]);for(let A=0;A<a.length;A++){const l=y0(a[A]);l!=null&&l.references&&(o+=l.references.reduce((c,h)=>c+h.info.duration||0,0))}return o}return i||r}function b0(s){const e=me(s,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let i=0;const r=me(s,4);for(let n=0;n<r;n++){if(e&256){const o=me(s,t);i+=o,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return i}function S0(s,e,t){xe(e,["moof","traf"]).forEach(i=>{xe(i,["tfhd"]).forEach(r=>{const n=me(r,4),o=s[n];if(!o)return;const a=o.timescale||9e4;xe(i,["tfdt"]).forEach(A=>{const l=A[0];let c=me(A,4);if(l===0)c-=t*a,c=Math.max(c,0),Go(A,4,c);else{c*=Math.pow(2,32),c+=me(A,8),c-=t*a,c=Math.max(c,0);const h=Math.floor(c/(ln+1)),u=Math.floor(c%(ln+1));Go(A,4,h),Go(A,8,u)}})})})}function w0(s){const e={valid:null,remainder:null},t=xe(s,["moof"]);if(t){if(t.length<2)return e.remainder=s,e}else return e;const i=t[t.length-1];return e.valid=qi(s,0,i.byteOffset-8),e.remainder=qi(s,i.byteOffset-8),e}function ji(s,e){const t=new Uint8Array(s.length+e.length);return t.set(s),t.set(e,s.length),t}function dc(s,e){const t=[],i=e.samples,r=e.timescale,n=e.id;let o=!1;return xe(i,["moof"]).map(A=>{const l=A.byteOffset-8;xe(A,["traf"]).map(h=>{const u=xe(h,["tfdt"]).map(d=>{const g=d[0];let f=me(d,4);return g===1&&(f*=Math.pow(2,32),f+=me(d,8)),f/r})[0];return u!==void 0&&(s=u),xe(h,["tfhd"]).map(d=>{const g=me(d,4),f=me(d,0)&16777215,p=(f&1)!==0,y=(f&2)!==0,B=(f&8)!==0;let Q=0;const C=(f&16)!==0;let T=0;const b=(f&32)!==0;let L=8;g===n&&(p&&(L+=8),y&&(L+=4),B&&(Q=me(d,L),L+=4),C&&(T=me(d,L),L+=4),b&&(L+=4),e.type==="video"&&(o=T0(e.codec)),xe(h,["trun"]).map(R=>{const O=R[0],k=me(R,0)&16777215,W=(k&1)!==0;let $=0;const te=(k&4)!==0,Z=(k&256)!==0;let S=0;const D=(k&512)!==0;let U=0;const v=(k&1024)!==0,w=(k&2048)!==0;let F=0;const H=me(R,4);let K=8;W&&($=me(R,K),K+=4),te&&(K+=4);let j=$+l;for(let se=0;se<H;se++){if(Z?(S=me(R,K),K+=4):S=Q,D?(U=me(R,K),K+=4):U=T,v&&(K+=4),w&&(O===0?F=me(R,K):F=cc(R,K),K+=4),e.type===Me.VIDEO){let ue=0;for(;ue<U;){const le=me(i,j);if(j+=4,x0(o,i[j])){const Ce=i.subarray(j,j+le);gc(Ce,o?2:1,s+F/r,t)}j+=le,ue+=le+4}}s+=S/r}}))})})}),t}function T0(s){if(!s)return!1;const e=s.indexOf("."),t=e<0?s:s.substring(0,e);return t==="hvc1"||t==="hev1"||t==="dvh1"||t==="dvhe"}function x0(s,e){if(s){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function gc(s,e,t,i){const r=fc(s);let n=0;n+=e;let o=0,a=0,A=!1,l=0;for(;n<r.length;){o=0;do{if(n>=r.length)break;l=r[n++],o+=l}while(l===255);a=0;do{if(n>=r.length)break;l=r[n++],a+=l}while(l===255);const c=r.length-n;if(!A&&o===4&&n<r.length){if(A=!0,r[n++]===181){const u=lc(r,n);if(n+=2,u===49){const d=me(r,n);if(n+=4,d===1195456820){const g=r[n++];if(g===3){const f=r[n++],p=31&f,y=64&f,B=y?2+p*3:0,Q=new Uint8Array(B);if(y){Q[0]=f;for(let C=1;C<B;C++)Q[C]=r[n++]}i.push({type:g,payloadType:o,pts:t,bytes:Q})}}}}}else if(o===5&&a<c){if(A=!0,a>16){const h=[];for(let g=0;g<16;g++){const f=r[n++].toString(16);h.push(f.length==1?"0"+f:f),(g===3||g===5||g===7||g===9)&&h.push("-")}const u=a-16,d=new Uint8Array(u);for(let g=0;g<u;g++)d[g]=r[n++];i.push({payloadType:o,pts:t,uuid:h.join(""),userData:Vt(d),userDataBytes:d})}}else if(a<c)n+=a;else if(a>c)break}}function fc(s){const e=s.byteLength,t=[];let i=1;for(;i<e-2;)s[i]===0&&s[i+1]===0&&s[i+2]===3?(t.push(i+2),i+=2):i++;if(t.length===0)return s;const r=e-t.length,n=new Uint8Array(r);let o=0;for(i=0;i<r;o++,i++)o===t[0]&&(o++,t.shift()),n[i]=s[o];return n}function D0(s){const e=s[0];let t="",i="",r=0,n=0,o=0,a=0,A=0,l=0;if(e===0){for(;At(s.subarray(l,l+1))!=="\0";)t+=At(s.subarray(l,l+1)),l+=1;for(t+=At(s.subarray(l,l+1)),l+=1;At(s.subarray(l,l+1))!=="\0";)i+=At(s.subarray(l,l+1)),l+=1;i+=At(s.subarray(l,l+1)),l+=1,r=me(s,12),n=me(s,16),a=me(s,20),A=me(s,24),l=28}else if(e===1){l+=4,r=me(s,l),l+=4;const h=me(s,l);l+=4;const u=me(s,l);for(l+=4,o=4294967296*h+u,Number.isSafeInteger(o)||(o=Number.MAX_SAFE_INTEGER,N.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),a=me(s,l),l+=4,A=me(s,l),l+=4;At(s.subarray(l,l+1))!=="\0";)t+=At(s.subarray(l,l+1)),l+=1;for(t+=At(s.subarray(l,l+1)),l+=1;At(s.subarray(l,l+1))!=="\0";)i+=At(s.subarray(l,l+1)),l+=1;i+=At(s.subarray(l,l+1)),l+=1}const c=s.subarray(l,s.byteLength);return{schemeIdUri:t,value:i,timeScale:r,presentationTime:o,presentationTimeDelta:n,eventDuration:a,id:A,payload:c}}function R0(s,...e){const t=e.length;let i=8,r=t;for(;r--;)i+=e[r].byteLength;const n=new Uint8Array(i);for(n[0]=i>>24&255,n[1]=i>>16&255,n[2]=i>>8&255,n[3]=i&255,n.set(s,4),r=0,i=8;r<t;r++)n.set(e[r],i),i+=e[r].byteLength;return n}function L0(s,e,t){if(s.byteLength!==16)throw new RangeError("Invalid system id");let i,r;if(e){i=1,r=new Uint8Array(e.length*16);for(let a=0;a<e.length;a++){const A=e[a];if(A.byteLength!==16)throw new RangeError("Invalid key");r.set(A,a*16)}}else i=0,r=new Uint8Array;let n;i>0?(n=new Uint8Array(4),e.length>0&&new DataView(n.buffer).setUint32(0,e.length,!1)):n=new Uint8Array;const o=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(o.buffer).setUint32(0,t.byteLength,!1),R0([112,115,115,104],new Uint8Array([i,0,0,0]),s,n,r,o,t||new Uint8Array)}function _0(s){if(!(s instanceof ArrayBuffer)||s.byteLength<32)return null;const e={version:0,systemId:"",kids:null,data:null},t=new DataView(s),i=t.getUint32(0);if(s.byteLength!==i&&i>44||t.getUint32(4)!==1886614376||(e.version=t.getUint32(8)>>>24,e.version>1))return null;e.systemId=Jt.hexDump(new Uint8Array(s,12,16));const n=t.getUint32(28);if(e.version===0){if(i-32<n)return null;e.data=new Uint8Array(s,32,n)}else if(e.version===1){e.kids=[];for(let o=0;o<n;o++)e.kids.push(new Uint8Array(s,32+o*16,16))}return e}let cn={};class rr{static clearKeyUriToKeyIdMap(){cn={}}constructor(e,t,i,r=[1],n=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=e,this.uri=t,this.keyFormat=i,this.keyFormatVersions=r,this.iv=n,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&e!=="AES-128"}isSupported(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case Qt.FAIRPLAY:case Qt.WIDEVINE:case Qt.PLAYREADY:case Qt.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof e!="number"&&(this.method==="AES-128"&&!this.iv&&N.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const i=k0(e);return new rr(this.method,this.uri,"identity",this.keyFormatVersions,i)}const t=a0(this.uri);if(t)switch(this.keyFormat){case Qt.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case Qt.PLAYREADY:{const i=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=L0(i,null,t);const r=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),n=String.fromCharCode.apply(null,Array.from(r)),o=n.substring(n.indexOf("<"),n.length),l=new DOMParser().parseFromString(o,"text/xml").getElementsByTagName("KID")[0];if(l){const c=l.childNodes[0]?l.childNodes[0].nodeValue:l.getAttribute("VALUE");if(c){const h=Mo(c).subarray(0,16);o0(h),this.keyId=h}}break}default:{let i=t.subarray(0,16);if(i.length!==16){const r=new Uint8Array(16);r.set(i,16-i.length),i=r}this.keyId=i;break}}if(!this.keyId||this.keyId.byteLength!==16){let i=cn[this.uri];if(!i){const r=Object.keys(cn).length%Number.MAX_SAFE_INTEGER;i=new Uint8Array(16),new DataView(i.buffer,12,4).setUint32(0,r),cn[this.uri]=i}this.keyId=i}return this}}function k0(s){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=s>>8*(15-t)&255;return e}const pc=/\{\$([a-zA-Z0-9-_]+)\}/g;function Ec(s){return pc.test(s)}function bt(s,e,t){if(s.variableList!==null||s.hasVariableRefs)for(let i=t.length;i--;){const r=t[i],n=e[r];n&&(e[r]=Ho(s,n))}}function Ho(s,e){if(s.variableList!==null||s.hasVariableRefs){const t=s.variableList;return e.replace(pc,i=>{const r=i.substring(2,i.length-1),n=t==null?void 0:t[r];return n===void 0?(s.playlistParsingError||(s.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),i):n})}return e}function Ic(s,e,t){let i=s.variableList;i||(s.variableList=i={});let r,n;if("QUERYPARAM"in e){r=e.QUERYPARAM;try{const o=new self.URL(t).searchParams;if(o.has(r))n=o.get(r);else throw new Error(`"${r}" does not match any query parameter in URI: "${t}"`)}catch(o){s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${o.message}`))}}else r=e.NAME,n=e.VALUE;r in i?s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):i[r]=n||""}function N0(s,e,t){const i=e.IMPORT;if(t&&i in t){let r=s.variableList;r||(s.variableList=r={}),r[i]=t[i]}else s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${i}"`))}function hn(){if(!(typeof self>"u"))return self.MediaSource||self.WebKitMediaSource}const F0={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}},mc=hn();function M0(s,e){const t=F0[e];return!!t&&t[s.slice(0,4)]===!0}function $o(s,e){var t;return(t=mc==null?void 0:mc.isTypeSupported(`${e||"video"}/mp4;codecs="${s}"`))!=null?t:!1}const Cc=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,yc=/#EXT-X-MEDIA:(.*)/g,P0=/^#EXT(?:INF|-X-TARGETDURATION):/m,Bc=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),O0=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|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("|"));class Pt{static findGroup(e,t){for(let i=0;i<e.length;i++){const r=e[i];if(r.id===t)return r}}static convertAVC1ToAVCOTI(e){const t=e.split(".");if(t.length>2){let i=t.shift()+".";return i+=parseInt(t.shift()).toString(16),i+=("000"+parseInt(t.shift()).toString(16)).slice(-4),i}return e}static resolve(e,t){return ko.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return P0.test(e)}static parseMasterPlaylist(e,t){const i=Ec(e),r={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:i},n=[];Cc.lastIndex=0;let o;for(;(o=Cc.exec(e))!=null;)if(o[1]){var a;const l=new Ke(o[1]);bt(r,l,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const c=Ho(r,o[2]),h={attrs:l,bitrate:l.decimalInteger("AVERAGE-BANDWIDTH")||l.decimalInteger("BANDWIDTH"),name:l.NAME,url:Pt.resolve(c,t)},u=l.decimalResolution("RESOLUTION");u&&(h.width=u.width,h.height=u.height),U0((l.CODECS||"").split(/[ ,]+/).filter(d=>d),h),h.videoCodec&&h.videoCodec.indexOf("avc1")!==-1&&(h.videoCodec=Pt.convertAVC1ToAVCOTI(h.videoCodec)),(a=h.unknownCodecs)!=null&&a.length||n.push(h),r.levels.push(h)}else if(o[3]){const l=o[3],c=o[4];switch(l){case"SESSION-DATA":{const h=new Ke(c);bt(r,h,["DATA-ID","LANGUAGE","VALUE","URI"]);const u=h["DATA-ID"];u&&(r.sessionData===null&&(r.sessionData={}),r.sessionData[u]=h);break}case"SESSION-KEY":{const h=vc(c,t,r);h.encrypted&&h.isSupported()?(r.sessionKeys===null&&(r.sessionKeys=[]),r.sessionKeys.push(h)):N.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${c}"`);break}case"DEFINE":{{const h=new Ke(c);bt(r,h,["NAME","VALUE","QUERYPARAM"]),Ic(r,h,t)}break}case"CONTENT-STEERING":{const h=new Ke(c);bt(r,h,["SERVER-URI","PATHWAY-ID"]),r.contentSteering={uri:Pt.resolve(h["SERVER-URI"],t),pathwayId:h["PATHWAY-ID"]||"."};break}case"START":{r.startTimeOffset=Qc(c);break}}}const A=n.length>0&&n.length<r.levels.length;return r.levels=A?n:r.levels,r.levels.length===0&&(r.playlistParsingError=new Error("no levels found in manifest")),r}static parseMasterPlaylistMedia(e,t,i){let r;const n={},o=i.levels,a={AUDIO:o.map(l=>({id:l.attrs.AUDIO,audioCodec:l.audioCodec})),SUBTITLES:o.map(l=>({id:l.attrs.SUBTITLES,textCodec:l.textCodec})),"CLOSED-CAPTIONS":[]};let A=0;for(yc.lastIndex=0;(r=yc.exec(e))!==null;){const l=new Ke(r[1]),c=l.TYPE;if(c){const h=a[c],u=n[c]||[];n[c]=u,bt(i,l,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const d={attrs:l,bitrate:0,id:A++,groupId:l["GROUP-ID"]||"",instreamId:l["INSTREAM-ID"],name:l.NAME||l.LANGUAGE||"",type:c,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:l.LANGUAGE,url:l.URI?Pt.resolve(l.URI,t):""};if(h!=null&&h.length){const g=Pt.findGroup(h,d.groupId)||h[0];bc(d,g,"audioCodec"),bc(d,g,"textCodec")}u.push(d)}}return n}static parseLevelPlaylist(e,t,i,r,n,o){const a=new r0(t),A=a.fragments;let l=null,c=0,h=0,u=0,d=0,g=null,f=new Fo(r,t),p,y,B,Q=-1,C=!1;for(Bc.lastIndex=0,a.m3u8=e,a.hasVariableRefs=Ec(e);(p=Bc.exec(e))!==null;){C&&(C=!1,f=new Fo(r,t),f.start=u,f.sn=c,f.cc=d,f.level=i,l&&(f.initSegment=l,f.rawProgramDateTime=l.rawProgramDateTime,l.rawProgramDateTime=null));const R=p[1];if(R){f.duration=parseFloat(R);const O=(" "+p[2]).slice(1);f.title=O||null,f.tagList.push(O?["INF",R,O]:["INF",R])}else if(p[3]){if(he(f.duration)){f.start=u,B&&Tc(f,B,a),f.sn=c,f.level=i,f.cc=d,f.urlId=n,A.push(f);const O=(" "+p[3]).slice(1);f.relurl=Ho(a,O),Sc(f,g),g=f,u+=f.duration,c++,h=0,C=!0}}else if(p[4]){const O=(" "+p[4]).slice(1);g?f.setByteRange(O,g):f.setByteRange(O)}else if(p[5])f.rawProgramDateTime=(" "+p[5]).slice(1),f.tagList.push(["PROGRAM-DATE-TIME",f.rawProgramDateTime]),Q===-1&&(Q=A.length);else{if(p=p[0].match(O0),!p){N.warn("No matches on slow regex match for level playlist!");continue}for(y=1;y<p.length&&!(typeof p[y]<"u");y++);const O=(" "+p[y]).slice(1),k=(" "+p[y+1]).slice(1),W=p[y+2]?(" "+p[y+2]).slice(1):"";switch(O){case"PLAYLIST-TYPE":a.type=k.toUpperCase();break;case"MEDIA-SEQUENCE":c=a.startSN=parseInt(k);break;case"SKIP":{const $=new Ke(k);bt(a,$,["RECENTLY-REMOVED-DATERANGES"]);const te=$.decimalInteger("SKIPPED-SEGMENTS");if(he(te)){a.skippedSegments=te;for(let S=te;S--;)A.unshift(null);c+=te}const Z=$.enumeratedString("RECENTLY-REMOVED-DATERANGES");Z&&(a.recentlyRemovedDateranges=Z.split(" "));break}case"TARGETDURATION":a.targetduration=Math.max(parseInt(k),1);break;case"VERSION":a.version=parseInt(k);break;case"EXTM3U":break;case"ENDLIST":a.live=!1;break;case"#":(k||W)&&f.tagList.push(W?[k,W]:[k]);break;case"DISCONTINUITY":d++,f.tagList.push(["DIS"]);break;case"GAP":f.gap=!0,f.tagList.push([O]);break;case"BITRATE":f.tagList.push([O,k]);break;case"DATERANGE":{const $=new Ke(k);bt(a,$,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),bt(a,$,$.clientAttrs);const te=new zl($,a.dateRanges[$.ID]);te.isValid||a.skippedSegments?a.dateRanges[te.id]=te:N.warn(`Ignoring invalid DATERANGE tag: "${k}"`),f.tagList.push(["EXT-X-DATERANGE",k]);break}case"DEFINE":{{const $=new Ke(k);bt(a,$,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in $?N0(a,$,o):Ic(a,$,t)}break}case"DISCONTINUITY-SEQUENCE":d=parseInt(k);break;case"KEY":{const $=vc(k,t,a);if($.isSupported()){if($.method==="NONE"){B=void 0;break}B||(B={}),B[$.keyFormat]&&(B=Ze({},B)),B[$.keyFormat]=$}else N.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${k}"`);break}case"START":a.startTimeOffset=Qc(k);break;case"MAP":{const $=new Ke(k);if(bt(a,$,["BYTERANGE","URI"]),f.duration){const te=new Fo(r,t);wc(te,$,i,B),l=te,f.initSegment=l,l.rawProgramDateTime&&!f.rawProgramDateTime&&(f.rawProgramDateTime=l.rawProgramDateTime)}else wc(f,$,i,B),l=f,C=!0;break}case"SERVER-CONTROL":{const $=new Ke(k);a.canBlockReload=$.bool("CAN-BLOCK-RELOAD"),a.canSkipUntil=$.optionalFloat("CAN-SKIP-UNTIL",0),a.canSkipDateRanges=a.canSkipUntil>0&&$.bool("CAN-SKIP-DATERANGES"),a.partHoldBack=$.optionalFloat("PART-HOLD-BACK",0),a.holdBack=$.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const $=new Ke(k);a.partTarget=$.decimalFloatingPoint("PART-TARGET");break}case"PART":{let $=a.partList;$||($=a.partList=[]);const te=h>0?$[$.length-1]:void 0,Z=h++,S=new Ke(k);bt(a,S,["BYTERANGE","URI"]);const D=new i0(S,f,t,Z,te);$.push(D),f.duration+=D.duration;break}case"PRELOAD-HINT":{const $=new Ke(k);bt(a,$,["URI"]),a.preloadHint=$;break}case"RENDITION-REPORT":{const $=new Ke(k);bt(a,$,["URI"]),a.renditionReports=a.renditionReports||[],a.renditionReports.push($);break}default:N.warn(`line parsed but not handled: ${p}`);break}}}g&&!g.relurl?(A.pop(),u-=g.duration,a.partList&&(a.fragmentHint=g)):a.partList&&(Sc(f,g),f.cc=d,a.fragmentHint=f,B&&Tc(f,B,a));const T=A.length,b=A[0],L=A[T-1];if(u+=a.skippedSegments*a.targetduration,u>0&&T&&L){a.averagetargetduration=u/T;const R=L.sn;a.endSN=R!=="initSegment"?R:0,a.live||(L.endList=!0),b&&(a.startCC=b.cc)}else a.endSN=0,a.startCC=0;return a.fragmentHint&&(u+=a.fragmentHint.duration),a.totalduration=u,a.endCC=d,Q>0&&G0(A,Q),a}}function vc(s,e,t){var i,r;const n=new Ke(s);bt(t,n,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const o=(i=n.METHOD)!=null?i:"",a=n.URI,A=n.hexadecimalInteger("IV"),l=n.KEYFORMATVERSIONS,c=(r=n.KEYFORMAT)!=null?r:"identity";a&&n.IV&&!A&&N.error(`Invalid IV: ${n.IV}`);const h=a?Pt.resolve(a,e):"",u=(l||"1").split("/").map(Number).filter(Number.isFinite);return new rr(o,h,c,u,A)}function Qc(s){const t=new Ke(s).decimalFloatingPoint("TIME-OFFSET");return he(t)?t:null}function U0(s,e){["video","audio","text"].forEach(t=>{const i=s.filter(r=>M0(r,t));if(i.length){const r=i.filter(n=>n.lastIndexOf("avc1",0)===0||n.lastIndexOf("mp4a",0)===0);e[`${t}Codec`]=r.length>0?r[0]:i[0],s=s.filter(n=>i.indexOf(n)===-1)}}),e.unknownCodecs=s}function bc(s,e,t){const i=e[t];i&&(s[t]=i)}function G0(s,e){let t=s[e];for(let i=e;i--;){const r=s[i];if(!r)return;r.programDateTime=t.programDateTime-r.duration*1e3,t=r}}function Sc(s,e){s.rawProgramDateTime?s.programDateTime=Date.parse(s.rawProgramDateTime):e!=null&&e.programDateTime&&(s.programDateTime=e.endProgramDateTime),he(s.programDateTime)||(s.programDateTime=null,s.rawProgramDateTime=null)}function wc(s,e,t,i){s.relurl=e.URI,e.BYTERANGE&&s.setByteRange(e.BYTERANGE),s.level=t,s.sn="initSegment",i&&(s.levelkeys=i),s.initSegment=null}function Tc(s,e,t){s.levelkeys=e;const{encryptedFragments:i}=t;(!i.length||i[i.length-1].levelkeys!==e)&&Object.keys(e).some(r=>e[r].isCommonEncryption)&&i.push(s)}var Re={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},pe={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function xc(s){const{type:e}=s;switch(e){case Re.AUDIO_TRACK:return pe.AUDIO;case Re.SUBTITLE_TRACK:return pe.SUBTITLE;default:return pe.MAIN}}function Yo(s,e){let t=s.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class H0{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.LEVEL_LOADING,this.onLevelLoading,this),e.on(E.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(E.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.LEVEL_LOADING,this.onLevelLoading,this),e.off(E.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(E.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,i=t.pLoader,r=t.loader,n=i||r,o=new n(t);return this.loaders[e.type]=o,o}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:i}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Re.MANIFEST,url:i,deliveryDirectives:null})}onLevelLoading(e,t){const{id:i,level:r,url:n,deliveryDirectives:o}=t;this.load({id:i,level:r,responseType:"text",type:Re.LEVEL,url:n,deliveryDirectives:o})}onAudioTrackLoading(e,t){const{id:i,groupId:r,url:n,deliveryDirectives:o}=t;this.load({id:i,groupId:r,level:null,responseType:"text",type:Re.AUDIO_TRACK,url:n,deliveryDirectives:o})}onSubtitleTrackLoading(e,t){const{id:i,groupId:r,url:n,deliveryDirectives:o}=t;this.load({id:i,groupId:r,level:null,responseType:"text",type:Re.SUBTITLE_TRACK,url:n,deliveryDirectives:o})}load(e){var t;const i=this.hls.config;let r=this.getInternalLoader(e);if(r){const l=r.context;if(l&&l.url===e.url){N.trace("[playlist-loader]: playlist request ongoing");return}N.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),r.abort()}let n;if(e.type===Re.MANIFEST?n=i.manifestLoadPolicy.default:n=Ze({},i.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),r=this.createInternalLoader(e),(t=e.deliveryDirectives)!=null&&t.part){let l;if(e.type===Re.LEVEL&&e.level!==null?l=this.hls.levels[e.level].details:e.type===Re.AUDIO_TRACK&&e.id!==null?l=this.hls.audioTracks[e.id].details:e.type===Re.SUBTITLE_TRACK&&e.id!==null&&(l=this.hls.subtitleTracks[e.id].details),l){const c=l.partTarget,h=l.targetduration;if(c&&h){const u=Math.max(c*3,h*.8)*1e3;n=Ze({},n,{maxTimeToFirstByteMs:Math.min(u,n.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(u,n.maxTimeToFirstByteMs)})}}}const o=n.errorRetry||n.timeoutRetry||{},a={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},A={onSuccess:(l,c,h,u)=>{const d=this.getInternalLoader(h);this.resetInternalLoader(h.type);const g=l.data;if(g.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,h,new Error("no EXTM3U delimiter"),u||null,c);return}c.parsing.start=performance.now(),Pt.isMediaPlaylist(g)?this.handleTrackOrLevelPlaylist(l,c,h,u||null,d):this.handleMasterPlaylist(l,c,h,u)},onError:(l,c,h,u)=>{this.handleNetworkError(c,h,!1,l,u)},onTimeout:(l,c,h)=>{this.handleNetworkError(c,h,!0,void 0,l)}};r.load(e,a,A)}handleMasterPlaylist(e,t,i,r){const n=this.hls,o=e.data,a=Yo(e,i),A=Pt.parseMasterPlaylist(o,a);if(A.playlistParsingError){this.handleManifestParsingError(e,i,A.playlistParsingError,r,t);return}const{contentSteering:l,levels:c,sessionData:h,sessionKeys:u,startTimeOffset:d,variableList:g}=A;this.variableList=g;const{AUDIO:f=[],SUBTITLES:p,"CLOSED-CAPTIONS":y}=Pt.parseMasterPlaylistMedia(o,a,A);f.length&&!f.some(Q=>!Q.url)&&c[0].audioCodec&&!c[0].attrs.AUDIO&&(N.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),f.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Ke({}),bitrate:0,url:""})),n.trigger(E.MANIFEST_LOADED,{levels:c,audioTracks:f,subtitles:p,captions:y,contentSteering:l,url:a,stats:t,networkDetails:r,sessionData:h,sessionKeys:u,startTimeOffset:d,variableList:g})}handleTrackOrLevelPlaylist(e,t,i,r,n){const o=this.hls,{id:a,level:A,type:l}=i,c=Yo(e,i),h=he(a)?a:0,u=he(A)?A:h,d=xc(i),g=Pt.parseLevelPlaylist(e.data,c,u,d,h,this.variableList);if(l===Re.MANIFEST){const f={attrs:new Ke({}),bitrate:0,details:g,name:"",url:c};o.trigger(E.MANIFEST_LOADED,{levels:[f],audioTracks:[],url:c,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),i.levelDetails=g,this.handlePlaylistLoaded(g,e,t,i,r,n)}handleManifestParsingError(e,t,i,r,n){this.hls.trigger(E.ERROR,{type:ge.NETWORK_ERROR,details:Y.MANIFEST_PARSING_ERROR,fatal:t.type===Re.MANIFEST,url:e.url,err:i,error:i,reason:i.message,response:e,context:t,networkDetails:r,stats:n})}handleNetworkError(e,t,i=!1,r,n){let o=`A network ${i?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${e.type}`;e.type===Re.LEVEL?o+=`: ${e.level} id: ${e.id}`:(e.type===Re.AUDIO_TRACK||e.type===Re.SUBTITLE_TRACK)&&(o+=` id: ${e.id} group-id: "${e.groupId}"`);const a=new Error(o);N.warn(`[playlist-loader]: ${o}`);let A=Y.UNKNOWN,l=!1;const c=this.getInternalLoader(e);switch(e.type){case Re.MANIFEST:A=i?Y.MANIFEST_LOAD_TIMEOUT:Y.MANIFEST_LOAD_ERROR,l=!0;break;case Re.LEVEL:A=i?Y.LEVEL_LOAD_TIMEOUT:Y.LEVEL_LOAD_ERROR,l=!1;break;case Re.AUDIO_TRACK:A=i?Y.AUDIO_TRACK_LOAD_TIMEOUT:Y.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case Re.SUBTITLE_TRACK:A=i?Y.SUBTITLE_TRACK_LOAD_TIMEOUT:Y.SUBTITLE_LOAD_ERROR,l=!1;break}c&&this.resetInternalLoader(e.type);const h={type:ge.NETWORK_ERROR,details:A,fatal:l,url:e.url,loader:c,context:e,error:a,networkDetails:t,stats:n};if(r){const u=(t==null?void 0:t.url)||e.url;h.response=vt({url:u,data:void 0},r)}this.hls.trigger(E.ERROR,h)}handlePlaylistLoaded(e,t,i,r,n,o){const a=this.hls,{type:A,level:l,id:c,groupId:h,deliveryDirectives:u}=r,d=Yo(t,r),g=xc(r),f=typeof r.level=="number"&&g===pe.MAIN?l:void 0;if(!e.fragments.length){const y=new Error("No Segments found in Playlist");a.trigger(E.ERROR,{type:ge.NETWORK_ERROR,details:Y.LEVEL_EMPTY_ERROR,fatal:!1,url:d,error:y,reason:y.message,response:t,context:r,level:f,parent:g,networkDetails:n,stats:i});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const p=e.playlistParsingError;if(p){a.trigger(E.ERROR,{type:ge.NETWORK_ERROR,details:Y.LEVEL_PARSING_ERROR,fatal:!1,url:d,error:p,reason:p.message,response:t,context:r,level:f,parent:g,networkDetails:n,stats:i});return}switch(e.live&&o&&(o.getCacheAge&&(e.ageHeader=o.getCacheAge()||0),(!o.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),A){case Re.MANIFEST:case Re.LEVEL:a.trigger(E.LEVEL_LOADED,{details:e,level:f||0,id:c||0,stats:i,networkDetails:n,deliveryDirectives:u});break;case Re.AUDIO_TRACK:a.trigger(E.AUDIO_TRACK_LOADED,{details:e,id:c||0,groupId:h||"",stats:i,networkDetails:n,deliveryDirectives:u});break;case Re.SUBTITLE_TRACK:a.trigger(E.SUBTITLE_TRACK_LOADED,{details:e,id:c||0,groupId:h||"",stats:i,networkDetails:n,deliveryDirectives:u});break}}}function Dc(s,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=s,e.dispatchEvent(t)}function Rc(s,e){const t=s.mode;if(t==="disabled"&&(s.mode="hidden"),s.cues&&!s.cues.getCueById(e.id))try{if(s.addCue(e),!s.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(i){N.debug(`[texttrack-utils]: ${i}`);try{const r=new self.TextTrackCue(e.startTime,e.endTime,e.text);r.id=e.id,s.addCue(r)}catch(r){N.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${r}`)}}t==="disabled"&&(s.mode=t)}function hs(s){const e=s.mode;if(e==="disabled"&&(s.mode="hidden"),s.cues)for(let t=s.cues.length;t--;)s.removeCue(s.cues[t]);e==="disabled"&&(s.mode=e)}function Ko(s,e,t,i){const r=s.mode;if(r==="disabled"&&(s.mode="hidden"),s.cues&&s.cues.length>0){const n=Y0(s.cues,e,t);for(let o=0;o<n.length;o++)(!i||i(n[o]))&&s.removeCue(n[o])}r==="disabled"&&(s.mode=r)}function $0(s,e){if(e<s[0].startTime)return 0;const t=s.length-1;if(e>s[t].endTime)return-1;let i=0,r=t;for(;i<=r;){const n=Math.floor((r+i)/2);if(e<s[n].startTime)r=n-1;else if(e>s[n].startTime&&i<t)i=n+1;else return n}return s[i].startTime-e<e-s[r].startTime?i:r}function Y0(s,e,t){const i=[],r=$0(s,e);if(r>-1)for(let n=r,o=s.length;n<o;n++){const a=s[n];if(a.startTime>=e&&a.endTime<=t)i.push(a);else if(a.startTime>t)return i}return i}var Ot={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const K0=.25;function Vo(){if(!(typeof self>"u"))return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}const un=(()=>{const s=Vo();try{new s(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Jo(s,e){return s.getTime()/1e3-e}function V0(s){return Uint8Array.from(s.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class J0{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(E.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(E.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(hs(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const i=e[t];if(i.kind==="metadata"&&i.label==="id3")return Dc(i,this.media),i}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:i,enableID3MetadataCues:r}}}=this;if(!i&&!r)return;const{samples:n}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=Vo();for(let a=0;a<n.length;a++){const A=n[a].type;if(A===Ot.emsg&&!i||!r)continue;const l=ac(n[a].data);if(l){const c=n[a].pts;let h=c+n[a].duration;h>un&&(h=un),h-c<=0&&(h=c+K0);for(let d=0;d<l.length;d++){const g=l[d];if(!oc(g)){this.updateId3CueEnds(c,A);const f=new o(c,h,"");f.value=g,A&&(f.type=A),this.id3Track.addCue(f)}}}}}updateId3CueEnds(e,t){var i;const r=(i=this.id3Track)==null?void 0:i.cues;if(r)for(let n=r.length;n--;){const o=r[n];o.type===t&&o.startTime<e&&o.endTime===un&&(o.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:i,type:r}){const{id3Track:n,hls:o}=this;if(!o)return;const{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:A}}=o;if(n&&(a||A)){let l;r==="audio"?l=c=>c.type===Ot.audioId3&&A:r==="video"?l=c=>c.type===Ot.emsg&&a:l=c=>c.type===Ot.audioId3&&A||c.type===Ot.emsg&&a,Ko(n,t,i,l)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:i,id3Track:r}=this,{dateRanges:n}=t,o=Object.keys(n);if(r){const c=Object.keys(i).filter(h=>!o.includes(h));for(let h=c.length;h--;){const u=c[h];Object.keys(i[u].cues).forEach(d=>{r.removeCue(i[u].cues[d])}),delete i[u]}}const a=t.fragments[t.fragments.length-1];if(o.length===0||!he(a==null?void 0:a.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const A=a.programDateTime/1e3-a.start,l=Vo();for(let c=0;c<o.length;c++){const h=o[c],u=n[h],d=i[h],g=(d==null?void 0:d.cues)||{};let f=(d==null?void 0:d.durationKnown)||!1;const p=Jo(u.startDate,A);let y=un;const B=u.endDate;if(B)y=Jo(B,A),f=!0;else if(u.endOnNext&&!f){const C=o.reduce((T,b)=>{const L=n[b];return L.class===u.class&&L.id!==b&&L.startDate>u.startDate&&T.push(L),T},[]).sort((T,b)=>T.startDate.getTime()-b.startDate.getTime())[0];C&&(y=Jo(C.startDate,A),f=!0)}const Q=Object.keys(u.attr);for(let C=0;C<Q.length;C++){const T=Q[C];if(!e0(T))continue;let b=g[T];if(b)f&&!d.durationKnown&&(b.endTime=y);else{let L=u.attr[T];b=new l(p,y,""),t0(T)&&(L=V0(L)),b.value={key:T,data:L},b.type=Ot.dateRange,b.id=h,this.id3Track.addCue(b),g[T]=b}}i[h]={cues:g,dateRange:u,durationKnown:f}}}}class W0{constructor(e){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=()=>this.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:i,targetduration:r}=e,{liveSyncDuration:n,liveSyncDurationCount:o,lowLatencyMode:a}=this.config,A=this.hls.userConfig;let l=a&&i||t;(A.liveSyncDuration||A.liveSyncDurationCount||l===0)&&(l=n!==void 0?n:o*r);const c=r,h=1;return l+Math.min(this.stallCount*h,c)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,i=this.levelDetails;if(e===null||t===null||i===null)return null;const r=i.edge,n=e-t-this.edgeStalled,o=r-i.totalduration,a=r-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(o,n),a)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const i=e.buffered.length;return(i?e.buffered.end(i-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(E.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(E.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(E.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(E.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(E.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(E.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var i;t.details===Y.BUFFER_STALLED_ERROR&&(this.stallCount++,(i=this.levelDetails)!=null&&i.live&&N.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const i=this.computeLatency();if(i===null)return;this._latency=i;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:n}=this.config;if(!r||n===1)return;const o=this.targetLatency;if(o===null)return;const a=i-o,A=Math.min(this.maxLatency,o+t.targetduration),l=a<A;if(t.live&&l&&a>.05&&this.forwardBufferLength>1){const c=Math.min(2,Math.max(1,n)),h=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;e.playbackRate=Math.min(c,Math.max(1,h))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const Wo=["NONE","TYPE-0","TYPE-1",null];var nr={No:"",Yes:"YES",v2:"v2"};function q0(s,e){const{canSkipUntil:t,canSkipDateRanges:i,endSN:r}=s,n=e!==void 0?e-r:0;return t&&n<t?i?nr.v2:nr.Yes:nr.No}class Lc{constructor(e,t,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=i}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class or{constructor(e){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=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.unknownCodecs=e.unknownCodecs,this.codecSet=[e.videoCodec,e.audioCodec].filter(t=>t).join(",").replace(/\.[^.,]+/g,"")}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get attrs(){return this._attrs[this._urlId]}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get uri(){return this.url[this._urlId]||""}get urlId(){return this._urlId}set urlId(e){const t=e%this.url.length;this._urlId!==t&&(this.fragmentError=0,this.loadError=0,this.details=void 0,this._urlId=t)}get audioGroupId(){var e;return(e=this.audioGroupIds)==null?void 0:e[this.urlId]}get textGroupId(){var e;return(e=this.textGroupIds)==null?void 0:e[this.urlId]}addFallback(e){this.url.push(e.url),this._attrs.push(e.attrs)}}function qo(s,e){const t=e.startPTS;if(he(t)){let i=0,r;e.sn>s.sn?(i=t-s.start,r=s):(i=s.start-t,r=e),r.duration!==i&&(r.duration=i)}else e.sn>s.sn?s.cc===e.cc&&s.minEndPTS?e.start=s.start+(s.minEndPTS-s.start):e.start=s.start+s.duration:e.start=Math.max(s.start-e.duration,0)}function _c(s,e,t,i,r,n){i-t<=0&&(N.warn("Fragment should have a positive duration",e),i=t+e.duration,n=r+e.duration);let a=t,A=i;const l=e.startPTS,c=e.endPTS;if(he(l)){const p=Math.abs(l-t);he(e.deltaPTS)?e.deltaPTS=Math.max(p,e.deltaPTS):e.deltaPTS=p,a=Math.max(t,l),t=Math.min(t,l),r=Math.min(r,e.startDTS),A=Math.min(i,c),i=Math.max(i,c),n=Math.max(n,e.endDTS)}const h=t-e.start;e.start!==0&&(e.start=t),e.duration=i-e.start,e.startPTS=t,e.maxStartPTS=a,e.startDTS=r,e.endPTS=i,e.minEndPTS=A,e.endDTS=n;const u=e.sn;if(!s||u<s.startSN||u>s.endSN)return 0;let d;const g=u-s.startSN,f=s.fragments;for(f[g]=e,d=g;d>0;d--)qo(f[d],f[d-1]);for(d=g;d<f.length-1;d++)qo(f[d],f[d+1]);return s.fragmentHint&&qo(f[f.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,h}function j0(s,e){let t=null;const i=s.fragments;for(let A=i.length-1;A>=0;A--){const l=i[A].initSegment;if(l){t=l;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;let r=0,n;if(Z0(s,e,(A,l)=>{A.relurl&&(r=A.cc-l.cc),he(A.startPTS)&&he(A.endPTS)&&(l.start=l.startPTS=A.startPTS,l.startDTS=A.startDTS,l.maxStartPTS=A.maxStartPTS,l.endPTS=A.endPTS,l.endDTS=A.endDTS,l.minEndPTS=A.minEndPTS,l.duration=A.endPTS-A.startPTS,l.duration&&(n=l),e.PTSKnown=e.alignedSliding=!0),l.elementaryStreams=A.elementaryStreams,l.loader=A.loader,l.stats=A.stats,l.urlId=A.urlId,A.initSegment&&(l.initSegment=A.initSegment,t=A.initSegment)}),t&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(l=>{var c;(!l.initSegment||l.initSegment.relurl===((c=t)==null?void 0:c.relurl))&&(l.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(A=>!A),e.deltaUpdateFailed){N.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let A=e.skippedSegments;A--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=X0(s.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const o=e.fragments;if(r){N.warn("discontinuity sliding from playlist, take drift into account");for(let A=0;A<o.length;A++)o[A].cc+=r}e.skippedSegments&&(e.startCC=e.fragments[0].cc),z0(s.partList,e.partList,(A,l)=>{l.elementaryStreams=A.elementaryStreams,l.stats=A.stats}),n?_c(e,n,n.startPTS,n.endPTS,n.startDTS,n.endDTS):kc(s,e),o.length&&(e.totalduration=e.edge-o[0].start),e.driftStartTime=s.driftStartTime,e.driftStart=s.driftStart;const a=e.advancedDateTime;if(e.advanced&&a){const A=e.edge;e.driftStart||(e.driftStartTime=a,e.driftStart=A),e.driftEndTime=a,e.driftEnd=A}else e.driftEndTime=s.driftEndTime,e.driftEnd=s.driftEnd,e.advancedDateTime=s.advancedDateTime}function X0(s,e,t){const i=Ze({},s);return t&&t.forEach(r=>{delete i[r]}),Object.keys(e).forEach(r=>{const n=new zl(e[r].attr,i[r]);n.isValid?i[r]=n:N.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[r].attr)}"`)}),i}function z0(s,e,t){if(s&&e){let i=0;for(let r=0,n=s.length;r<=n;r++){const o=s[r],a=e[r+i];o&&a&&o.index===a.index&&o.fragment.sn===a.fragment.sn?t(o,a):i--}}}function Z0(s,e,t){const i=e.skippedSegments,r=Math.max(s.startSN,e.startSN)-e.startSN,n=(s.fragmentHint?1:0)+(i?e.endSN:Math.min(s.endSN,e.endSN))-e.startSN,o=e.startSN-s.startSN,a=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,A=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;for(let l=r;l<=n;l++){const c=A[o+l];let h=a[l];i&&!h&&l<i&&(h=e.fragments[l]=c),c&&h&&t(c,h)}}function kc(s,e){const t=e.startSN+e.skippedSegments-s.startSN,i=s.fragments;t<0||t>=i.length||jo(e,i[t].start)}function jo(s,e){if(e){const t=s.fragments;for(let i=s.skippedSegments;i<t.length;i++)t[i].start+=e;s.fragmentHint&&(s.fragmentHint.start+=e)}}function ep(s,e=1/0){let t=1e3*s.targetduration;if(s.updated){const i=s.fragments,r=4;if(i.length&&t*r>e){const n=i[i.length-1].duration*1e3;n<t&&(t=n)}}else t/=2;return Math.round(t)}function tp(s,e,t){if(!(s!=null&&s.details))return null;const i=s.details;let r=i.fragments[e-i.startSN];return r||(r=i.fragmentHint,r&&r.sn===e)?r:e<i.startSN&&t&&t.sn===e?t:null}function Nc(s,e,t){var i;return s!=null&&s.details?Fc((i=s.details)==null?void 0:i.partList,e,t):null}function Fc(s,e,t){if(s)for(let i=s.length;i--;){const r=s[i];if(r.index===t&&r.fragment.sn===e)return r}return null}function dn(s){switch(s.details){case Y.FRAG_LOAD_TIMEOUT:case Y.KEY_LOAD_TIMEOUT:case Y.LEVEL_LOAD_TIMEOUT:case Y.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Mc(s,e){const t=dn(e);return s.default[`${t?"timeout":"error"}Retry`]}function Xo(s,e){const t=s.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*s.retryDelayMs,s.maxRetryDelayMs)}function Pc(s){return vt(vt({},s),{errorRetry:null,timeoutRetry:null})}function gn(s,e,t,i){return!!s&&e<s.maxNumRetry&&(ip(i)||!!t)}function ip(s){return s===0&&navigator.onLine===!1||!!s&&(s<400||s>499)}const Oc={search:function(s,e){let t=0,i=s.length-1,r=null,n=null;for(;t<=i;){r=(t+i)/2|0,n=s[r];const o=e(n);if(o>0)t=r+1;else if(o<0)i=r-1;else return n}return null}};function sp(s,e,t){if(e===null||!Array.isArray(s)||!s.length||!he(e))return null;const i=s[0].programDateTime;if(e<(i||0))return null;const r=s[s.length-1].endProgramDateTime;if(e>=(r||0))return null;t=t||0;for(let n=0;n<s.length;++n){const o=s[n];if(rp(e,t,o))return o}return null}function ar(s,e,t=0,i=0){let r=null;if(s?r=e[s.sn-e[0].sn+1]||null:t===0&&e[0].start===0&&(r=e[0]),r&&zo(t,i,r)===0)return r;const n=Oc.search(e,zo.bind(null,t,i));return n&&(n!==s||!r)?n:r}function zo(s=0,e=0,t){if(t.start<=s&&t.start+t.duration>s)return 0;const i=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-i<=s?1:t.start-i>s&&t.start?-1:0}function rp(s,e,t){const i=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-i>s}function np(s,e){return Oc.search(s,t=>t.cc<e?1:t.cc>e?-1:0)}const op=3e5;var dt={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Lt={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class ap{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=N.log.bind(N,"[info]:"),this.warn=N.warn.bind(N,"[warning]:"),this.error=N.error.bind(N,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(E.ERROR,this.onError,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(E.ERROR,this.onError,this),e.off(E.ERROR,this.onErrorOut,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){this.playlistError=0}stopLoad(){}getVariantLevelIndex(e){return(e==null?void 0:e.type)===pe.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var i,r;if(t.fatal)return;const n=this.hls,o=t.context;switch(t.details){case Y.FRAG_LOAD_ERROR:case Y.FRAG_LOAD_TIMEOUT:case Y.KEY_LOAD_ERROR:case Y.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case Y.FRAG_PARSING_ERROR:if((i=t.frag)!=null&&i.gap){t.errorAction={action:dt.DoNothing,flags:Lt.None};return}case Y.FRAG_GAP:case Y.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=dt.SendAlternateToPenaltyBox;return}case Y.LEVEL_EMPTY_ERROR:case Y.LEVEL_PARSING_ERROR:{var a,A;const l=t.parent===pe.MAIN?t.level:n.loadLevel;t.details===Y.LEVEL_EMPTY_ERROR&&((a=t.context)!=null&&(A=a.levelDetails)!=null&&A.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,l):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,l))}return;case Y.LEVEL_LOAD_ERROR:case Y.LEVEL_LOAD_TIMEOUT:typeof(o==null?void 0:o.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,o.level));return;case Y.AUDIO_TRACK_LOAD_ERROR:case Y.AUDIO_TRACK_LOAD_TIMEOUT:case Y.SUBTITLE_LOAD_ERROR:case Y.SUBTITLE_TRACK_LOAD_TIMEOUT:if(o){const l=n.levels[n.loadLevel];if(l&&(o.type===Re.AUDIO_TRACK&&o.groupId===l.audioGroupId||o.type===Re.SUBTITLE_TRACK&&o.groupId===l.textGroupId)){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.loadLevel),t.errorAction.action=dt.SendAlternateToPenaltyBox,t.errorAction.flags=Lt.MoveAllAlternatesMatchingHost;return}}return;case Y.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const l=n.levels[n.loadLevel],c=l==null?void 0:l.attrs["HDCP-LEVEL"];c&&(t.errorAction={action:dt.SendAlternateToPenaltyBox,flags:Lt.MoveAllAlternatesMatchingHDCP,hdcpLevel:c})}return;case Y.BUFFER_ADD_CODEC_ERROR:case Y.REMUX_ALLOC_ERROR:t.errorAction=this.getLevelSwitchAction(t,(r=t.level)!=null?r:n.loadLevel);return;case Y.INTERNAL_EXCEPTION:case Y.BUFFER_APPENDING_ERROR:case Y.BUFFER_APPEND_ERROR:case Y.BUFFER_FULL_ERROR:case Y.LEVEL_SWITCH_ERROR:case Y.BUFFER_STALLED_ERROR:case Y.BUFFER_SEEK_OVER_HOLE:case Y.BUFFER_NUDGE_ON_STALL:t.errorAction={action:dt.DoNothing,flags:Lt.None};return}if(t.type===ge.KEY_SYSTEM_ERROR){const l=this.getVariantLevelIndex(t.frag);t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,l);return}}getPlaylistRetryOrSwitchAction(e,t){var i;const r=this.hls,n=Mc(r.config.playlistLoadPolicy,e),o=this.playlistError++,a=(i=e.response)==null?void 0:i.code;if(gn(n,o,dn(e),a))return{action:dt.RetryRequest,flags:Lt.None,retryConfig:n,retryCount:o};const l=this.getLevelSwitchAction(e,t);return n&&(l.retryConfig=n,l.retryCount=o),l}getFragRetryOrSwitchAction(e){const t=this.hls,i=this.getVariantLevelIndex(e.frag),r=t.levels[i],{fragLoadPolicy:n,keyLoadPolicy:o}=t.config,a=Mc(e.details.startsWith("key")?o:n,e),A=t.levels.reduce((h,u)=>h+u.fragmentError,0);if(r){var l;e.details!==Y.FRAG_GAP&&r.fragmentError++;const h=(l=e.response)==null?void 0:l.code;if(gn(a,A,dn(e),h))return{action:dt.RetryRequest,flags:Lt.None,retryConfig:a,retryCount:A}}const c=this.getLevelSwitchAction(e,i);return a&&(c.retryConfig=a,c.retryCount=A),c}getLevelSwitchAction(e,t){const i=this.hls;t==null&&(t=i.loadLevel);const r=this.hls.levels[t];if(r&&(r.loadError++,i.autoLevelEnabled)){var n,o;let a=-1;const{levels:A,loadLevel:l,minAutoLevel:c,maxAutoLevel:h}=i,u=(n=e.frag)==null?void 0:n.type,{type:d,groupId:g}=(o=e.context)!=null?o:{};for(let f=A.length;f--;){const p=(f+l)%A.length;if(p!==l&&p>=c&&p<=h&&A[p].loadError===0){const y=A[p];if(e.details===Y.FRAG_GAP&&e.frag){const B=A[p].details;if(B){const Q=ar(e.frag,B.fragments,e.frag.start);if(Q!=null&&Q.gap)continue}}else{if(d===Re.AUDIO_TRACK&&g===y.audioGroupId||d===Re.SUBTITLE_TRACK&&g===y.textGroupId)continue;if(u===pe.AUDIO&&r.audioGroupId===y.audioGroupId||u===pe.SUBTITLE&&r.textGroupId===y.textGroupId)continue}a=p;break}}if(a>-1&&i.loadLevel!==a)return e.levelRetry=!0,this.playlistError=0,{action:dt.SendAlternateToPenaltyBox,flags:Lt.None,nextAutoLevel:a}}return{action:dt.SendAlternateToPenaltyBox,flags:Lt.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var i;switch((i=t.errorAction)==null?void 0:i.action){case dt.DoNothing:break;case dt.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==Y.FRAG_GAP&&(t.fatal=!0);break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,i=e.errorAction;if(!i)return;const{flags:r,hdcpLevel:n,nextAutoLevel:o}=i;switch(r){case Lt.None:this.switchLevel(e,o);break;case Lt.MoveAllAlternatesMatchingHost:i.resolved||(i.resolved=this.redundantFailover(e));break;case Lt.MoveAllAlternatesMatchingHDCP:n&&(t.maxHdcpLevel=Wo[Wo.indexOf(n)-1],i.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}i.resolved||this.switchLevel(e,o)}switchLevel(e,t){t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}redundantFailover(e){const{hls:t,penalizedRenditions:i}=this,r=e.parent===pe.MAIN?e.level:t.loadLevel,n=t.levels[r],o=n.url.length,a=e.frag?e.frag.urlId:n.urlId;n.urlId===a&&(!e.frag||n.details)&&this.penalizeRendition(n,e);for(let A=1;A<o;A++){const l=(a+A)%o,c=i[l];if(!c||Ap(c,e,i[a]))return this.warn(`Switching to Redundant Stream ${l+1}/${o}: "${n.url[l]}" after ${e.details}`),this.playlistError=0,t.levels.forEach(h=>{h.urlId=l}),t.nextLoadLevel=r,!0}return!1}penalizeRendition(e,t){const{penalizedRenditions:i}=this,r=i[e.urlId]||{lastErrorPerfMs:0,errors:[],details:void 0};r.lastErrorPerfMs=performance.now(),r.errors.push(t),r.details=e.details,i[e.urlId]=r}}function Ap(s,e,t){if(performance.now()-s.lastErrorPerfMs>op)return!0;const i=s.details;if(e.details===Y.FRAG_GAP&&i&&e.frag){const r=e.frag.start,n=ar(null,i.fragments,r);if(n&&!n.gap)return!0}if(t&&s.errors.length<t.errors.length){const r=s.errors[s.errors.length-1];if(i&&r.frag&&e.frag&&Math.abs(r.frag.start-e.frag.start)>i.targetduration*3)return!0}return!1}class Zo{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=N.log.bind(N,`${t}:`),this.warn=N.warn.bind(N,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){clearTimeout(this.timer),this.timer=-1}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t){const i=t==null?void 0:t.renditionReports;if(i){let r=-1;for(let n=0;n<i.length;n++){const o=i[n];let a;try{a=new self.URL(o.URI,t.url).href}catch(A){N.warn(`Could not construct new URL for Rendition Report: ${A}`),a=o.URI||""}if(a===e){r=n;break}else a===e.substring(0,a.length)&&(r=n)}if(r!==-1){const n=i[r],o=parseInt(n["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let a=parseInt(n["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const A=Math.min(t.age-t.partTarget,t.targetduration);a>=0&&A>t.partTarget&&(a+=1)}return new Lc(o,a>=0?a:void 0,nr.No)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,i){const{details:r,stats:n}=t,o=self.performance.now(),a=n.loading.first?Math.max(0,o-n.loading.first):0;if(r.advancedDateTime=Date.now()-a,r.live||i!=null&&i.live){if(r.reloaded(i),i&&this.log(`live playlist ${e} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),i&&r.fragments.length>0&&j0(i,r),!this.canLoad||!r.live)return;let A,l,c;if(r.canBlockReload&&r.endSN&&r.advanced){const p=this.hls.config.lowLatencyMode,y=r.lastPartSn,B=r.endSN,Q=r.lastPartIndex,C=Q!==-1,T=y===B,b=p?0:Q;C?(l=T?B+1:y,c=T?b:Q+1):l=B+1;const L=r.age,R=L+r.ageHeader;let O=Math.min(R-r.partTarget,r.targetduration*1.5);if(O>0){if(i&&O>i.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${i.tuneInGoal} to: ${O} with playlist age: ${r.age}`),O=0;else{const k=Math.floor(O/r.targetduration);if(l+=k,c!==void 0){const W=Math.round(O%r.targetduration/r.partTarget);c+=W}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${L.toFixed(2)}s goal: ${O} skip sn ${k} to part ${c}`)}r.tuneInGoal=O}if(A=this.getDeliveryDirectives(r,t.deliveryDirectives,l,c),p||!T){this.loadPlaylist(A);return}}else(r.canBlockReload||r.canSkipUntil)&&(A=this.getDeliveryDirectives(r,t.deliveryDirectives,l,c));const h=this.hls.mainForwardBufferInfo,u=h?h.end-h.len:0,d=(r.edge-u)*1e3,g=ep(r,d);r.updated&&o>this.requestScheduled+g&&(this.requestScheduled=n.loading.start),l!==void 0&&r.canBlockReload?this.requestScheduled=n.loading.first+g-(r.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+g<o?this.requestScheduled=o:this.requestScheduled-o<=0&&(this.requestScheduled+=g);let f=this.requestScheduled-o;f=Math.max(0,f),this.log(`reload live playlist ${e} in ${Math.round(f)} ms`),this.timer=self.setTimeout(()=>this.loadPlaylist(A),f)}else this.clearTimer()}getDeliveryDirectives(e,t,i,r){let n=q0(e,i);return t!=null&&t.skip&&e.deltaUpdateFailed&&(i=t.msn,r=t.part,n=nr.No),new Lc(i,r,n)}checkRetry(e){const t=e.details,i=dn(e),r=e.errorAction,{action:n,retryCount:o=0,retryConfig:a}=r||{},A=!!r&&!!a&&(n===dt.RetryRequest||!r.resolved&&n===dt.SendAlternateToPenaltyBox);if(A){var l;if(this.requestScheduled=-1,o>=a.maxNumRetry)return!1;if(i&&(l=e.context)!=null&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${o+1}/${a.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const c=Xo(a,o);this.timer=self.setTimeout(()=>this.loadPlaylist(),c),this.warn(`Retrying playlist loading ${o+1}/${a.maxNumRetry} after "${t}" in ${c}ms`)}e.levelRetry=!0,r.resolved=!0}return A}}let ea;class lp extends Zo{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(E.LEVEL_LOADED,this.onLevelLoaded,this),e.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(E.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(E.FRAG_LOADED,this.onFragLoaded,this),e.on(E.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(E.LEVEL_LOADED,this.onLevelLoaded,this),e.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(E.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(E.FRAG_LOADED,this.onFragLoaded,this),e.off(E.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}startLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.startLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const i=[],r={};let n;t.levels.forEach(o=>{var a;const A=o.attrs;((a=o.audioCodec)==null?void 0:a.indexOf("mp4a.40.34"))!==-1&&(ea||(ea=/chrome|firefox/i.test(navigator.userAgent)),ea&&(o.audioCodec=void 0));const{AUDIO:l,CODECS:c,"FRAME-RATE":h,"PATHWAY-ID":u,RESOLUTION:d,SUBTITLES:g}=A,p=`${`${u||"."}-`}${o.bitrate}-${d}-${h}-${c}`;n=r[p],n?n.addFallback(o):(n=new or(o),r[p]=n,i.push(n)),fn(n,"audio",l),fn(n,"text",g)}),this.filterAndSortMediaOptions(i,t)}filterAndSortMediaOptions(e,t){let i=[],r=[],n=!1,o=!1,a=!1,A=e.filter(({audioCodec:d,videoCodec:g,width:f,height:p,unknownCodecs:y})=>(n||(n=!!(f&&p)),o||(o=!!g),a||(a=!!d),!(y!=null&&y.length)&&(!d||$o(d,"audio"))&&(!g||$o(g,"video"))));if((n||o)&&a&&(A=A.filter(({videoCodec:d,width:g,height:f})=>!!d||!!(g&&f))),A.length===0){Promise.resolve().then(()=>{if(this.hls){const d=new Error("no level with compatible codecs found in manifest");this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:d,reason:d.message})}});return}t.audioTracks&&(i=t.audioTracks.filter(d=>!d.audioCodec||$o(d.audioCodec,"audio")),Uc(i)),t.subtitles&&(r=t.subtitles,Uc(r));const l=A.slice(0);A.sort((d,g)=>d.attrs["HDCP-LEVEL"]!==g.attrs["HDCP-LEVEL"]?(d.attrs["HDCP-LEVEL"]||"")>(g.attrs["HDCP-LEVEL"]||"")?1:-1:d.bitrate!==g.bitrate?d.bitrate-g.bitrate:d.attrs["FRAME-RATE"]!==g.attrs["FRAME-RATE"]?d.attrs.decimalFloatingPoint("FRAME-RATE")-g.attrs.decimalFloatingPoint("FRAME-RATE"):d.attrs.SCORE!==g.attrs.SCORE?d.attrs.decimalFloatingPoint("SCORE")-g.attrs.decimalFloatingPoint("SCORE"):n&&d.height!==g.height?d.height-g.height:0);let c=l[0];if(this.steering&&(A=this.steering.filterParsedLevels(A),A.length!==l.length)){for(let d=0;d<l.length;d++)if(l[d].pathwayId===A[0].pathwayId){c=l[d];break}}this._levels=A;for(let d=0;d<A.length;d++)if(A[d]===c){this._firstLevel=d,this.log(`manifest loaded, ${A.length} level(s) found, first bitrate: ${c.bitrate}`);break}const h=a&&!o,u={levels:A,audioTracks:i,subtitleTracks:r,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:a,video:o,altAudio:!h&&i.some(d=>!!d.url)};this.hls.trigger(E.MANIFEST_PARSED,u),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const c=new Error("invalid level idx"),h=e<0;if(this.hls.trigger(E.ERROR,{type:ge.OTHER_ERROR,details:Y.LEVEL_SWITCH_ERROR,level:e,fatal:h,error:c,reason:c.message}),h)return;e=Math.min(e,t.length-1)}const i=this.currentLevelIndex,r=this.currentLevel,n=r?r.attrs["PATHWAY-ID"]:void 0,o=t[e],a=o.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=o,i===e&&o.details&&r&&n===a)return;this.log(`Switching to level ${e}${a?" with Pathway "+a:""} from level ${i}${n?" with Pathway "+n:""}`);const A=Ze({},o,{level:e,maxBitrate:o.maxBitrate,attrs:o.attrs,uri:o.uri,urlId:o.urlId});delete A._attrs,delete A._urlId,this.hls.trigger(E.LEVEL_SWITCHING,A);const l=o.details;if(!l||l.live){const c=this.switchParams(o.uri,r==null?void 0:r.details);this.loadPlaylist(c)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this._firstLevel}else return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===Re.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragLoaded(e,{frag:t}){if(t!==void 0&&t.type===pe.MAIN){const i=this._levels[t.level];i!==void 0&&(i.loadError=0)}}onLevelLoaded(e,t){var i;const{level:r,details:n}=t,o=this._levels[r];if(!o){var a;this.warn(`Invalid level index ${r}`),(a=t.deliveryDirectives)!=null&&a.skip&&(n.deltaUpdateFailed=!0);return}r===this.currentLevelIndex?(o.fragmentError===0&&(o.loadError=0),this.playlistLoaded(r,t,o.details)):(i=t.deliveryDirectives)!=null&&i.skip&&(n.deltaUpdateFailed=!0)}onAudioTrackSwitched(e,t){const i=this.currentLevel;if(!i)return;const r=this.hls.audioTracks[t.id].groupId;if(i.audioGroupIds&&i.audioGroupId!==r){let n=-1;for(let o=0;o<i.audioGroupIds.length;o++)if(i.audioGroupIds[o]===r){n=o;break}n!==-1&&n!==i.urlId&&(i.urlId=n,this.canLoad&&this.startLoad())}}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,i=this.currentLevel;if(i&&this.shouldLoadPlaylist(i)){const r=i.urlId;let n=i.uri;if(e)try{n=e.addDirectives(n)}catch(a){this.warn(`Could not construct new URL with HLS Delivery Directives: ${a}`)}const o=i.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${o?" Pathway "+o:""} URI ${r+1}/${i.url.length} ${n}`),this.clearTimer(),this.hls.trigger(E.LEVEL_LOADING,{url:n,level:t,id:r,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e,t){const i=(n,o)=>o!==t,r=this._levels.filter((n,o)=>o!==e?!0:n.url.length>1&&t!==void 0?(n.url=n.url.filter(i),n.audioGroupIds&&(n.audioGroupIds=n.audioGroupIds.filter(i)),n.textGroupIds&&(n.textGroupIds=n.textGroupIds.filter(i)),n.urlId=0,!0):(this.steering&&this.steering.removeLevel(n),!1));this.hls.trigger(E.LEVELS_UPDATED,{levels:r})}onLevelsUpdated(e,{levels:t}){t.forEach((i,r)=>{const{details:n}=i;n!=null&&n.fragments&&n.fragments.forEach(o=>{o.level=r})}),this._levels=t}}function fn(s,e,t){t&&(e==="audio"?(s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds[s.url.length-1]=t):e==="text"&&(s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds[s.url.length-1]=t))}function Uc(s){const e={};s.forEach(t=>{const i=t.groupId||"";t.id=e[i]=e[i]||0,e[i]++})}var it={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class cp{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(E.BUFFER_APPENDED,this.onBufferAppended,this),e.on(E.FRAG_BUFFERED,this.onFragBuffered,this),e.on(E.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(E.BUFFER_APPENDED,this.onBufferAppended,this),e.off(E.FRAG_BUFFERED,this.onFragBuffered,this),e.off(E.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const i=this.activePartLists[t];if(i)for(let r=i.length;r--;){const n=i[r];if(!n)break;const o=n.end;if(n.start<=e&&o!==null&&e<=o)return n}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:i}=this,r=Object.keys(i);for(let n=r.length;n--;){const o=i[r[n]];if((o==null?void 0:o.body.type)===t&&o.buffered){const a=o.body;if(a.start<=e&&e<=a.end)return a}}return null}detectEvictedFragments(e,t,i,r){this.timeRanges&&(this.timeRanges[e]=t);const n=(r==null?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach(o=>{const a=this.fragments[o];if(!a||n>=a.body.sn)return;if(!a.buffered&&!a.loaded){a.body.type===i&&this.removeFragment(a.body);return}const A=a.range[e];A&&A.time.some(l=>{const c=!this.isTimeBuffered(l.startPTS,l.endPTS,t);return c&&this.removeFragment(a.body),c})})}detectPartialFragments(e){const t=this.timeRanges,{frag:i,part:r}=e;if(!t||i.sn==="initSegment")return;const n=us(i),o=this.fragments[n];if(!o||o.buffered&&i.gap)return;const a=!i.relurl;Object.keys(t).forEach(A=>{const l=i.elementaryStreams[A];if(!l)return;const c=t[A],h=a||l.partial===!0;o.range[A]=this.getBufferedTimes(i,r,h,c)}),o.loaded=null,Object.keys(o.range).length?(o.buffered=!0,(o.body.endList=i.endList||o.body.endList)&&(this.endListFragments[o.body.type]=o),pn(o)||this.removeParts(i.sn-1,i.type)):this.removeFragment(o.body)}removeParts(e,t){const i=this.activePartLists[t];i&&(this.activePartLists[t]=i.filter(r=>r.fragment.sn>=e))}fragBuffered(e,t){const i=us(e);let r=this.fragments[i];!r&&t&&(r=this.fragments[i]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}getBufferedTimes(e,t,i,r){const n={time:[],partial:i},o=e.start,a=e.end,A=e.minEndPTS||a,l=e.maxStartPTS||o;for(let c=0;c<r.length;c++){const h=r.start(c)-this.bufferPadding,u=r.end(c)+this.bufferPadding;if(l>=h&&A<=u){n.time.push({startPTS:Math.max(o,r.start(c)),endPTS:Math.min(a,r.end(c))});break}else if(o<u&&a>h)n.partial=!0,n.time.push({startPTS:Math.max(o,r.start(c)),endPTS:Math.min(a,r.end(c))});else if(a<=h)break}return n}getPartialFragment(e){let t=null,i,r,n,o=0;const{bufferPadding:a,fragments:A}=this;return Object.keys(A).forEach(l=>{const c=A[l];c&&pn(c)&&(r=c.body.start-a,n=c.body.end+a,e>=r&&e<=n&&(i=Math.min(e-r,n-e),o<=i&&(t=c.body,o=i)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||pn(t))}getState(e){const t=us(e),i=this.fragments[t];return i?i.buffered?pn(i)?it.PARTIAL:it.OK:it.APPENDING:it.NOT_LOADED}isTimeBuffered(e,t,i){let r,n;for(let o=0;o<i.length;o++){if(r=i.start(o)-this.bufferPadding,n=i.end(o)+this.bufferPadding,e>=r&&t<=n)return!0;if(t<=r)return!1}return!1}onFragLoaded(e,t){const{frag:i,part:r}=t;if(i.sn==="initSegment"||i.bitrateTest)return;const n=r?null:t,o=us(i);this.fragments[o]={body:i,appendedPTS:null,loaded:n,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:i,part:r,timeRanges:n}=t;if(i.sn==="initSegment")return;const o=i.type;if(r){let a=this.activePartLists[o];a||(this.activePartLists[o]=a=[]),a.push(r)}this.timeRanges=n,Object.keys(n).forEach(a=>{const A=n[a];this.detectEvictedFragments(a,A,o,r)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=us(e);return!!this.fragments[t]}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,i,r,n){r&&!this.hasGaps||Object.keys(this.fragments).forEach(o=>{const a=this.fragments[o];if(!a)return;const A=a.body;A.type!==i||r&&!A.gap||A.start<t&&A.end>e&&(a.buffered||n)&&this.removeFragment(A)})}removeFragment(e){const t=us(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const i=this.activePartLists[e.type];if(i){const r=e.sn;this.activePartLists[e.type]=i.filter(n=>n.fragment.sn!==r)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function pn(s){var e,t,i;return s.buffered&&(s.body.gap||((e=s.range.video)==null?void 0:e.partial)||((t=s.range.audio)==null?void 0:t.partial)||((i=s.range.audiovideo)==null?void 0:i.partial))}function us(s){return`${s.type}_${s.level}_${s.urlId}_${s.sn}`}const Gc=Math.pow(2,17);class hp{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const i=e.url;if(!i)return Promise.reject(new li({type:ge.NETWORK_ERROR,details:Y.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${i?"part list":"url"}`),networkDetails:null}));this.abort();const r=this.config,n=r.fLoader,o=r.loader;return new Promise((a,A)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(d=>d[0]==="GAP")){A($c(e));return}else e.gap=!1;const l=this.loader=e.loader=n?new n(r):new o(r),c=Hc(e),h=Pc(r.fragLoadPolicy.default),u={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Gc};e.stats=l.stats,l.load(c,u,{onSuccess:(d,g,f,p)=>{this.resetLoader(e,l);let y=d.data;f.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(y.slice(0,16)),y=y.slice(16)),a({frag:e,part:null,payload:y,networkDetails:p})},onError:(d,g,f,p)=>{this.resetLoader(e,l),A(new li({type:ge.NETWORK_ERROR,details:Y.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:vt({url:i,data:void 0},d),error:new Error(`HTTP Error ${d.code} ${d.text}`),networkDetails:f,stats:p}))},onAbort:(d,g,f)=>{this.resetLoader(e,l),A(new li({type:ge.NETWORK_ERROR,details:Y.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:f,stats:d}))},onTimeout:(d,g,f)=>{this.resetLoader(e,l),A(new li({type:ge.NETWORK_ERROR,details:Y.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${u.timeout}ms`),networkDetails:f,stats:d}))},onProgress:(d,g,f,p)=>{t&&t({frag:e,part:null,payload:f,networkDetails:p})}})})}loadPart(e,t,i){this.abort();const r=this.config,n=r.fLoader,o=r.loader;return new Promise((a,A)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){A($c(e,t));return}const l=this.loader=e.loader=n?new n(r):new o(r),c=Hc(e,t),h=Pc(r.fragLoadPolicy.default),u={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Gc};t.stats=l.stats,l.load(c,u,{onSuccess:(d,g,f,p)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const y={frag:e,part:t,payload:d.data,networkDetails:p};i(y),a(y)},onError:(d,g,f,p)=>{this.resetLoader(e,l),A(new li({type:ge.NETWORK_ERROR,details:Y.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:vt({url:c.url,data:void 0},d),error:new Error(`HTTP Error ${d.code} ${d.text}`),networkDetails:f,stats:p}))},onAbort:(d,g,f)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),A(new li({type:ge.NETWORK_ERROR,details:Y.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:f,stats:d}))},onTimeout:(d,g,f)=>{this.resetLoader(e,l),A(new li({type:ge.NETWORK_ERROR,details:Y.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${u.timeout}ms`),networkDetails:f,stats:d}))}})})}updateStatsFromPart(e,t){const i=e.stats,r=t.stats,n=r.total;if(i.loaded+=r.loaded,n){const A=Math.round(e.duration/t.duration),l=Math.min(Math.round(i.loaded/n),A),h=(A-l)*Math.round(i.loaded/l);i.total=i.loaded+h}else i.total=Math.max(i.loaded,i.total);const o=i.loading,a=r.loading;o.start?o.first+=a.first-a.start:(o.start=a.start,o.first=a.first),o.end=a.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Hc(s,e=null){const t=e||s,i={frag:s,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},r=t.byteRangeStartOffset,n=t.byteRangeEndOffset;if(he(r)&&he(n)){var o;let a=r,A=n;if(s.sn==="initSegment"&&((o=s.decryptdata)==null?void 0:o.method)==="AES-128"){const l=n-r;l%16&&(A=n+(16-l%16)),r!==0&&(i.resetIV=!0,a=r-16)}i.rangeStart=a,i.rangeEnd=A}return i}function $c(s,e){const t=new Error(`GAP ${s.gap?"tag":"attribute"} found`),i={type:ge.MEDIA_ERROR,details:Y.FRAG_GAP,fatal:!1,frag:s,error:t,networkDetails:null};return e&&(i.part=e),(e||s).stats.aborted=!0,new li(i)}class li extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class up{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const t in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[t].loader;if(i){if(e&&e!==i.context.frag.type)return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=Y.KEY_LOAD_ERROR,i,r,n){return new li({type:ge.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:n,error:i,networkDetails:r})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:i,cc:r}=e;for(let n=0;n<t.length;n++){const o=t[n];if(r<=o.cc&&(i==="initSegment"||o.sn==="initSegment"||i<o.sn)){this.emeController.selectKeySystemFormat(o).then(a=>{o.setKeyFormat(a)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var i,r;t&&e.setKeyFormat(t);const n=e.decryptdata;if(!n){const l=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,Y.KEY_LOAD_ERROR,l))}const o=n.uri;if(!o)return Promise.reject(this.createKeyLoadError(e,Y.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${o}"`)));let a=this.keyUriToKeyInfo[o];if((i=a)!=null&&i.decryptdata.key)return n.key=a.decryptdata.key,Promise.resolve({frag:e,keyInfo:a});if((r=a)!=null&&r.keyLoadPromise){var A;switch((A=a.mediaKeySessionContext)==null?void 0:A.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return a.keyLoadPromise.then(l=>(n.key=l.keyInfo.decryptdata.key,{frag:e,keyInfo:a}))}}switch(a=this.keyUriToKeyInfo[o]={decryptdata:n,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},n.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return n.keyFormat==="identity"?this.loadKeyHTTP(a,e):this.loadKeyEME(a,e);case"AES-128":return this.loadKeyHTTP(a,e);default:return Promise.reject(this.createKeyLoadError(e,Y.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${n.method}"`)))}}loadKeyEME(e,t){const i={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const r=this.emeController.loadKey(i);if(r)return(e.keyLoadPromise=r.then(n=>(e.mediaKeySessionContext=n,i))).catch(n=>{throw e.keyLoadPromise=null,n})}return Promise.resolve(i)}loadKeyHTTP(e,t){const i=this.config,r=i.loader,n=new r(i);return t.keyLoader=e.loader=n,e.keyLoadPromise=new Promise((o,a)=>{const A={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l=i.keyLoadPolicy.default,c={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(u,d,g,f)=>{const{frag:p,keyInfo:y,url:B}=g;if(!p.decryptdata||y!==this.keyUriToKeyInfo[B])return a(this.createKeyLoadError(p,Y.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),f));y.decryptdata.key=p.decryptdata.key=new Uint8Array(u.data),p.keyLoader=null,y.loader=null,o({frag:p,keyInfo:y})},onError:(u,d,g,f)=>{this.resetLoader(d),a(this.createKeyLoadError(t,Y.KEY_LOAD_ERROR,new Error(`HTTP Error ${u.code} loading key ${u.text}`),g,vt({url:A.url,data:void 0},u)))},onTimeout:(u,d,g)=>{this.resetLoader(d),a(this.createKeyLoadError(t,Y.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),g))},onAbort:(u,d,g)=>{this.resetLoader(d),a(this.createKeyLoadError(t,Y.INTERNAL_ABORTED,new Error("key loading aborted"),g))}};n.load(A,c,h)})}resetLoader(e){const{frag:t,keyInfo:i,url:r}=e,n=i.loader;t.keyLoader===n&&(t.keyLoader=null,i.loader=null),delete this.keyUriToKeyInfo[r],n&&n.destroy()}}class dp{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}const gp={length:0,start:()=>0,end:()=>0};class Ge{static isBuffered(e,t){try{if(e){const i=Ge.getBuffered(e);for(let r=0;r<i.length;r++)if(t>=i.start(r)&&t<=i.end(r))return!0}}catch{}return!1}static bufferInfo(e,t,i){try{if(e){const r=Ge.getBuffered(e),n=[];let o;for(o=0;o<r.length;o++)n.push({start:r.start(o),end:r.end(o)});return this.bufferedInfo(n,t,i)}}catch{}return{len:0,start:t,end:t,nextStart:void 0}}static bufferedInfo(e,t,i){t=Math.max(0,t),e.sort(function(l,c){const h=l.start-c.start;return h||c.end-l.end});let r=[];if(i)for(let l=0;l<e.length;l++){const c=r.length;if(c){const h=r[c-1].end;e[l].start-h<i?e[l].end>h&&(r[c-1].end=e[l].end):r.push(e[l])}else r.push(e[l])}else r=e;let n=0,o,a=t,A=t;for(let l=0;l<r.length;l++){const c=r[l].start,h=r[l].end;if(t+i>=c&&t<h)a=c,A=h,n=A-t;else if(t+i<c){o=c;break}}return{len:n,start:a||0,end:A||0,nextStart:o}}static getBuffered(e){try{return e.buffered}catch(t){return N.log("failed to get media.buffered",t),gp}}}class ta{constructor(e,t,i,r=0,n=-1,o=!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=En(),this.buffering={audio:En(),video:En(),audiovideo:En()},this.level=e,this.sn=t,this.id=i,this.size=r,this.part=n,this.partial=o}}function En(){return{start:0,executeStart:0,executeEnd:0,end:0}}function Yc(s,e){let t=null;for(let i=0,r=s.length;i<r;i++){const n=s[i];if(n&&n.cc===e){t=n;break}}return t}function fp(s,e,t){return!!(e.details&&(t.endCC>t.startCC||s&&s.cc<t.startCC))}function pp(s,e,t=0){const i=s.fragments,r=e.fragments;if(!r.length||!i.length){N.log("No fragments to align");return}const n=Yc(i,r[0].cc);if(!n||n&&!n.startPTS){N.log("No frag in previous level to align on");return}return n}function Kc(s,e){if(s){const t=s.start+e;s.start=s.startPTS=t,s.endPTS=t+s.duration}}function ia(s,e){const t=e.fragments;for(let i=0,r=t.length;i<r;i++)Kc(t[i],s);e.fragmentHint&&Kc(e.fragmentHint,s),e.alignedSliding=!0}function Ep(s,e,t){e&&(Ip(s,t,e),!t.alignedSliding&&e.details&&mp(t,e.details),!t.alignedSliding&&e.details&&!t.skippedSegments&&kc(e.details,t))}function Ip(s,e,t){if(fp(s,t,e)){const i=pp(t.details,e);i&&he(i.start)&&(N.log(`Adjusting PTS using last level due to CC increase within current level ${e.url}`),ia(i.start,e))}}function mp(s,e){if(!e.fragments.length||!s.hasProgramDateTime||!e.hasProgramDateTime)return;const t=e.fragments[0].programDateTime,i=s.fragments[0].programDateTime,r=(i-t)/1e3+e.fragments[0].start;r&&he(r)&&(N.log(`Adjusting PTS using programDateTime delta ${i-t}ms, sliding:${r.toFixed(3)} ${s.url} `),ia(r,s))}function Vc(s,e){if(!s.hasProgramDateTime||!e.hasProgramDateTime)return;const t=s.fragments,i=e.fragments;if(!t.length||!i.length)return;const r=Math.round(i.length/2)-1,n=i[r],o=Yc(t,n.cc)||t[Math.round(t.length/2)-1],a=n.programDateTime,A=o.programDateTime;if(a===null||A===null)return;const l=(A-a)/1e3-(o.start-n.start);ia(l,s)}class Cp{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class yp{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function Bp(s){const e=s.byteLength,t=e&&new DataView(s.buffer).getUint8(e-1);return t?qi(s,0,e-t):s}class vp{constructor(){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()}uint8ArrayToUint32Array_(e){const t=new DataView(e),i=new Uint32Array(4);for(let r=0;r<4;r++)i[r]=t.getUint32(r*4);return i}initTable(){const e=this.sBox,t=this.invSBox,i=this.subMix,r=i[0],n=i[1],o=i[2],a=i[3],A=this.invSubMix,l=A[0],c=A[1],h=A[2],u=A[3],d=new Uint32Array(256);let g=0,f=0,p=0;for(p=0;p<256;p++)p<128?d[p]=p<<1:d[p]=p<<1^283;for(p=0;p<256;p++){let y=f^f<<1^f<<2^f<<3^f<<4;y=y>>>8^y&255^99,e[g]=y,t[y]=g;const B=d[g],Q=d[B],C=d[Q];let T=d[y]*257^y*16843008;r[g]=T<<24|T>>>8,n[g]=T<<16|T>>>16,o[g]=T<<8|T>>>24,a[g]=T,T=C*16843009^Q*65537^B*257^g*16843008,l[y]=T<<24|T>>>8,c[y]=T<<16|T>>>16,h[y]=T<<8|T>>>24,u[y]=T,g?(g=B^d[d[d[C^B]]],f^=d[d[f]]):g=f=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let i=!0,r=0;for(;r<t.length&&i;)i=t[r]===this.key[r],r++;if(i)return;this.key=t;const n=this.keySize=t.length;if(n!==4&&n!==6&&n!==8)throw new Error("Invalid aes key size="+n);const o=this.ksRows=(n+6+1)*4;let a,A;const l=this.keySchedule=new Uint32Array(o),c=this.invKeySchedule=new Uint32Array(o),h=this.sBox,u=this.rcon,d=this.invSubMix,g=d[0],f=d[1],p=d[2],y=d[3];let B,Q;for(a=0;a<o;a++){if(a<n){B=l[a]=t[a];continue}Q=B,a%n===0?(Q=Q<<8|Q>>>24,Q=h[Q>>>24]<<24|h[Q>>>16&255]<<16|h[Q>>>8&255]<<8|h[Q&255],Q^=u[a/n|0]<<24):n>6&&a%n===4&&(Q=h[Q>>>24]<<24|h[Q>>>16&255]<<16|h[Q>>>8&255]<<8|h[Q&255]),l[a]=B=(l[a-n]^Q)>>>0}for(A=0;A<o;A++)a=o-A,A&3?Q=l[a]:Q=l[a-4],A<4||a<=4?c[A]=Q:c[A]=g[h[Q>>>24]]^f[h[Q>>>16&255]]^p[h[Q>>>8&255]]^y[h[Q&255]],c[A]=c[A]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,i){const r=this.keySize+6,n=this.invKeySchedule,o=this.invSBox,a=this.invSubMix,A=a[0],l=a[1],c=a[2],h=a[3],u=this.uint8ArrayToUint32Array_(i);let d=u[0],g=u[1],f=u[2],p=u[3];const y=new Int32Array(e),B=new Int32Array(y.length);let Q,C,T,b,L,R,O,k,W,$,te,Z,S,D;const U=this.networkToHostOrderSwap;for(;t<y.length;){for(W=U(y[t]),$=U(y[t+1]),te=U(y[t+2]),Z=U(y[t+3]),L=W^n[0],R=Z^n[1],O=te^n[2],k=$^n[3],S=4,D=1;D<r;D++)Q=A[L>>>24]^l[R>>16&255]^c[O>>8&255]^h[k&255]^n[S],C=A[R>>>24]^l[O>>16&255]^c[k>>8&255]^h[L&255]^n[S+1],T=A[O>>>24]^l[k>>16&255]^c[L>>8&255]^h[R&255]^n[S+2],b=A[k>>>24]^l[L>>16&255]^c[R>>8&255]^h[O&255]^n[S+3],L=Q,R=C,O=T,k=b,S=S+4;Q=o[L>>>24]<<24^o[R>>16&255]<<16^o[O>>8&255]<<8^o[k&255]^n[S],C=o[R>>>24]<<24^o[O>>16&255]<<16^o[k>>8&255]<<8^o[L&255]^n[S+1],T=o[O>>>24]<<24^o[k>>16&255]<<16^o[L>>8&255]<<8^o[R&255]^n[S+2],b=o[k>>>24]<<24^o[L>>16&255]<<16^o[R>>8&255]<<8^o[O&255]^n[S+3],B[t]=U(Q^d),B[t+1]=U(b^g),B[t+2]=U(T^f),B[t+3]=U(C^p),d=W,g=$,f=te,p=Z,t=t+4}return B.buffer}}const Qp=16;class sa{constructor(e,{removePKCS7Padding:t=!0}={}){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=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch{}this.subtle===null&&(this.useSoftware=!0)}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const i=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?Bp(i):i}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,i){return this.useSoftware?new Promise((r,n)=>{this.softwareDecrypt(new Uint8Array(e),t,i);const o=this.flush();o?r(o.buffer):n(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,i)}softwareDecrypt(e,t,i){const{currentIV:r,currentResult:n,remainderData:o}=this;this.logOnce("JS AES decrypt"),o&&(e=ji(o,e),this.remainderData=null);const a=this.getValidChunk(e);if(!a.length)return null;r&&(i=r);let A=this.softwareDecrypter;A||(A=this.softwareDecrypter=new vp),A.expandKey(t);const l=n;return this.currentResult=A.decrypt(a.buffer,0,i),this.currentIV=qi(a,-16).buffer,l||null}webCryptoDecrypt(e,t,i){const r=this.subtle;return(this.key!==t||!this.fastAesKey)&&(this.key=t,this.fastAesKey=new yp(r,t)),this.fastAesKey.expandKey().then(n=>r?(this.logOnce("WebCrypto AES decrypt"),new Cp(r,new Uint8Array(i)).decrypt(e.buffer,n)):Promise.reject(new Error("web crypto not initialized"))).catch(n=>(N.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${n.name}: ${n.message}`),this.onWebCryptoError(e,t,i)))}onWebCryptoError(e,t,i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,i);const r=this.flush();if(r)return r.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const i=e.length-e.length%Qp;return i!==e.length&&(t=qi(e,0,i),this.remainderData=qi(e,i)),t}logOnce(e){this.logEnabled&&(N.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const bp={toString:function(s){let e="";const t=s.length;for(let i=0;i<t;i++)e+=`[${s.start(i).toFixed(3)}-${s.end(i).toFixed(3)}]`;return e}},J={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"};class ra extends dp{constructor(e,t,i,r,n){super(),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=J.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.loadedmetadata=!1,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.onvseeking=null,this.onvended=null,this.logPrefix="",this.log=void 0,this.warn=void 0,this.playlistType=n,this.logPrefix=r,this.log=N.log.bind(N,`${r}:`),this.warn=N.warn.bind(N,`${r}:`),this.hls=e,this.fragmentLoader=new hp(e.config),this.keyLoader=i,this.fragmentTracker=t,this.config=e.config,this.decrypter=new sa(e.config),e.on(E.MANIFEST_LOADED,this.onManifestLoaded,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=J.STOPPED}_streamEnded(e,t){if(t.live||e.nextStart||!e.end||!this.media)return!1;const i=t.partList;if(i!=null&&i.length){const n=i[i.length-1];return Ge.isBuffered(this.media,n.start+n.duration/2)}const r=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(r)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levels[this.levelLastLoaded])==null?void 0:e.details}}onMediaAttached(e,t){const i=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),i.addEventListener("seeking",this.onvseeking),i.addEventListener("ended",this.onvended);const r=this.config;this.levels&&r.autoStartLoad&&this.state===J.STOPPED&&this.startLoad(r.startPosition)}onMediaDetaching(){const e=this.media;e!=null&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.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()}onMediaSeeking(){const{config:e,fragCurrent:t,media:i,mediaBuffer:r,state:n}=this,o=i?i.currentTime:0,a=Ge.bufferInfo(r||i,o,e.maxBufferHole);if(this.log(`media seeking to ${he(o)?o.toFixed(3):o}, state: ${n}`),this.state===J.ENDED)this.resetLoadingState();else if(t){const A=e.maxFragLookUpTolerance,l=t.start-A,c=t.start+t.duration+A;if(!a.len||c<a.start||l>a.end){const h=o>c;(o<l||h)&&(h&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}i&&(this.fragmentTracker.removeFragmentsInRange(o,1/0,this.playlistType,!0),this.lastCurrentTime=o),!this.loadedmetadata&&!a.len&&(this.nextLoadPosition=this.startPosition=o),this.tickImmediate()}onMediaEnded(){this.startPosition=this.lastCurrentTime=0}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]}onHandlerDestroying(){this.stopLoad(),super.onHandlerDestroying()}onHandlerDestroyed(){this.state=J.STOPPED,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,super.onHandlerDestroyed()}loadFragment(e,t,i){this._loadFragForPlayback(e,t,i)}_loadFragForPlayback(e,t,i){const r=n=>{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${n.part?" p: "+n.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(n)};this._doFragLoad(e,t,i,r).then(n=>{if(!n)return;const o=this.state;if(this.fragContextChanged(e)){(o===J.FRAG_LOADING||!this.fragCurrent&&o===J.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=J.IDLE);return}"payload"in n&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(E.FRAG_LOADED,n)),this._handleFragmentLoadComplete(n)}).catch(n=>{this.state===J.STOPPED||this.state===J.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:i}=this;if(i.getState(e)===it.APPENDING){const n=e.type,o=this.getFwdBufferInfo(this.mediaBuffer,n),a=Math.max(e.duration,o?o.len:this.config.maxBufferLength);this.reduceMaxBufferLength(a)&&i.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?i.removeAllFragments():i.hasParts(e.type)&&(i.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),i.getState(e)===it.PARTIAL&&i.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,i=null){if(!(e-t))return;const r={startOffset:e,endOffset:t,type:i};this.hls.trigger(E.BUFFER_FLUSHING,r)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(i=>{if(!i||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return i}).then(i=>{const{hls:r}=this,{payload:n}=i,o=e.decryptdata;if(n&&n.byteLength>0&&o&&o.key&&o.iv&&o.method==="AES-128"){const a=self.performance.now();return this.decrypter.decrypt(new Uint8Array(n),o.key.buffer,o.iv.buffer).catch(A=>{throw r.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_DECRYPT_ERROR,fatal:!1,error:A,reason:A.message,frag:e}),A}).then(A=>{const l=self.performance.now();return r.trigger(E.FRAG_DECRYPTED,{frag:e,payload:A,stats:{tstart:a,tdecrypt:l}}),i.payload=A,i})}return i}).then(i=>{const{fragCurrent:r,hls:n,levels:o}=this;if(!o)throw new Error("init load aborted, missing levels");const a=e.stats;this.state=J.IDLE,t.fragmentError=0,e.data=new Uint8Array(i.payload),a.parsing.start=a.buffering.start=self.performance.now(),a.parsing.end=a.buffering.end=self.performance.now(),i.frag===r&&n.trigger(E.FRAG_BUFFERED,{stats:a,frag:r,part:null,id:e.type}),this.tick()}).catch(i=>{this.state===J.STOPPED||this.state===J.ERROR||(this.warn(i),this.resetFragmentLoading(e))})}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId}fragBufferedComplete(e,t){var i,r,n,o;const a=this.mediaBuffer?this.mediaBuffer:this.media;this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===pe.MAIN?"level":"track"} ${e.level} (frag:[${((i=e.startPTS)!=null?i:NaN).toFixed(3)}-${((r=e.endPTS)!=null?r:NaN).toFixed(3)}] > buffer:${a?bp.toString(Ge.getBuffered(a)):"(detached)"})`),this.state=J.IDLE,a&&(!this.loadedmetadata&&e.type==pe.MAIN&&a.buffered.length&&((n=this.fragCurrent)==null?void 0:n.sn)===((o=this.fragPrevious)==null?void 0:o.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:i,part:r,partsLoaded:n}=e,o=!n||n.length===0||n.some(A=>!A),a=new ta(i.level,i.sn,i.stats.chunkCount+1,0,r?r.index:-1,!o);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,i=null,r){var n;const o=t==null?void 0:t.details;if(!this.levels||!o)throw new Error(`frag load aborted, missing level${o?"":" detail"}s`);let a=null;if(e.encrypted&&!((n=e.decryptdata)!=null&&n.key)?(this.log(`Loading key for ${e.sn} of [${o.startSN}-${o.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=J.KEY_LOADING,this.fragCurrent=e,a=this.keyLoader.load(e).then(c=>{if(!this.fragContextChanged(c.frag))return this.hls.trigger(E.KEY_LOADED,c),this.state===J.KEY_LOADING&&(this.state=J.IDLE),c}),this.hls.trigger(E.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(a=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&o.encryptedFragments.length&&this.keyLoader.loadClear(e,o.encryptedFragments),i=Math.max(e.start,i||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const c=o.partList;if(c&&r){i>e.end&&o.fragmentHint&&(e=o.fragmentHint);const h=this.getNextPart(c,e,i);if(h>-1){const u=c[h];this.log(`Loading part sn: ${e.sn} p: ${u.index} cc: ${e.cc} of playlist [${o.startSN}-${o.endSN}] parts [0-${h}-${c.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(i.toFixed(3))}`),this.nextLoadPosition=u.start+u.duration,this.state=J.FRAG_LOADING;let d;return a?d=a.then(g=>!g||this.fragContextChanged(g.frag)?null:this.doFragPartsLoad(e,u,t,r)).catch(g=>this.handleFragLoadError(g)):d=this.doFragPartsLoad(e,u,t,r).catch(g=>this.handleFragLoadError(g)),this.hls.trigger(E.FRAG_LOADING,{frag:e,part:u,targetBufferTime:i}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):d}else if(!e.url||this.loadedEndOfParts(c,i))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${o?"of ["+o.startSN+"-"+o.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(i.toFixed(3))}`),he(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=J.FRAG_LOADING;const A=this.config.progressive;let l;return A&&a?l=a.then(c=>!c||this.fragContextChanged(c==null?void 0:c.frag)?null:this.fragmentLoader.load(e,r)).catch(c=>this.handleFragLoadError(c)):l=Promise.all([this.fragmentLoader.load(e,A?r:void 0),a]).then(([c])=>(!A&&c&&r&&r(c),c)).catch(c=>this.handleFragLoadError(c)),this.hls.trigger(E.FRAG_LOADING,{frag:e,targetBufferTime:i}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):l}doFragPartsLoad(e,t,i,r){return new Promise((n,o)=>{var a;const A=[],l=(a=i.details)==null?void 0:a.partList,c=h=>{this.fragmentLoader.loadPart(e,h,r).then(u=>{A[h.index]=u;const d=u.part;this.hls.trigger(E.FRAG_LOADED,u);const g=Nc(i,e.sn,h.index+1)||Fc(l,e.sn,h.index+1);if(g)c(g);else return n({frag:e,part:d,partsLoaded:A})}).catch(o)};c(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===Y.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(E.ERROR,t)}else this.hls.trigger(E.ERROR,{type:ge.OTHER_ERROR,details:Y.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==J.PARSING){!this.fragCurrent&&this.state!==J.STOPPED&&this.state!==J.ERROR&&(this.state=J.IDLE);return}const{frag:i,part:r,level:n}=t,o=self.performance.now();i.stats.parsing.end=o,r&&(r.stats.parsing.end=o),this.updateLevelTiming(i,r,n,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:i}=this,{level:r,sn:n,part:o}=e;if(!(t!=null&&t[r]))return this.warn(`Levels object was unset while buffering fragment ${n} of level ${r}. The current chunk will not be buffered.`),null;const a=t[r],A=o>-1?Nc(a,n,o):null,l=A?A.fragment:tp(a,n,i);return l?(i&&i!==l&&(l.stats=i.stats),{frag:l,part:A,level:a}):null}bufferFragmentData(e,t,i,r,n){var o;if(!e||this.state!==J.PARSING)return;const{data1:a,data2:A}=e;let l=a;if(a&&A&&(l=ji(a,A)),!((o=l)!=null&&o.length))return;const c={type:e.type,frag:t,part:i,chunkMeta:r,parent:t.type,data:l};if(this.hls.trigger(E.BUFFER_APPENDING,c),e.dropped&&e.independent&&!i){if(n)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Ge.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const i=t.currentTime,r=Ge.bufferInfo(t,i,0),n=e.duration,o=Math.min(this.config.maxFragLookUpTolerance*2,n*.25),a=Math.max(Math.min(e.start-o,r.end-o),i+o);e.start-a>o&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){const i=this.getLoadPosition();return he(i)?this.getFwdBufferInfoAtPos(e,i,t):null}getFwdBufferInfoAtPos(e,t,i){const{config:{maxBufferHole:r}}=this,n=Ge.bufferInfo(e,t,r);if(n.len===0&&n.nextStart!==void 0){const o=this.fragmentTracker.getBufferedFrag(t,i);if(o&&n.nextStart<o.end)return Ge.bufferInfo(e,t,Math.max(n.nextStart,r))}return n}getMaxBufferLength(e){const{config:t}=this;let i;return e?i=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):i=t.maxBufferLength,Math.min(i,t.maxMaxBufferLength)}reduceMaxBufferLength(e){const t=this.config,i=e||t.maxBufferLength;return t.maxMaxBufferLength>=i?(t.maxMaxBufferLength/=2,this.warn(`Reduce max buffer length to ${t.maxMaxBufferLength}s`),!0):!1}getAppendedFrag(e,t=pe.MAIN){const i=this.fragmentTracker.getAppendedFrag(e,pe.MAIN);return i&&"fragment"in i?i.fragment:i}getNextFragment(e,t){const i=t.fragments,r=i.length;if(!r)return null;const{config:n}=this,o=i[0].start;let a;if(t.live){const A=n.initialLiveManifestSize;if(r<A)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${A})`),null;!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(a=this.getInitialLiveFragment(t,i),this.startPosition=a?this.hls.liveSyncPosition||a.start:e)}else e<=o&&(a=i[0]);if(!a){const A=n.lowLatencyMode?t.partEnd:t.fragmentEnd;a=this.getFragmentAtPosition(e,A,t)}return this.mapToInitFragWhenRequired(a)}isLoopLoading(e,t){const i=this.fragmentTracker.getState(e);return(i===it.OK||i===it.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,i,r,n){const o=e.gap,a=this.getNextFragment(this.nextLoadPosition,t);if(a===null)return a;if(e=a,o&&e&&!e.gap&&i.nextStart){const A=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,i.nextStart,r);if(A!==null&&i.len+A.len>=n)return this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,i){let r=-1,n=!1,o=!0;for(let a=0,A=e.length;a<A;a++){const l=e[a];if(o=o&&!l.independent,r>-1&&i<l.start)break;const c=l.loaded;c?r=-1:(n||l.independent||o)&&l.fragment===t&&(r=a),n=c}return r}loadedEndOfParts(e,t){const i=e[e.length-1];return i&&t>i.start&&i.loaded}getInitialLiveFragment(e,t){const i=this.fragPrevious;let r=null;if(i){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${i.programDateTime}`),r=sp(t,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){const n=i.sn+1;if(n>=e.startSN&&n<=e.endSN){const o=t[n-e.startSN];i.cc===o.cc&&(r=o,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=np(t,i.cc),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const n=this.hls.liveSyncPosition;n!==null&&(r=this.getFragmentAtPosition(n,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,i){const{config:r}=this;let{fragPrevious:n}=this,{fragments:o,endSN:a}=i;const{fragmentHint:A}=i,l=r.maxFragLookUpTolerance,c=i.partList,h=!!(r.lowLatencyMode&&c!=null&&c.length&&A);h&&A&&!this.bitrateTest&&(o=o.concat(A),a=A.sn);let u;if(e<t){const d=e>t-l?0:l;u=ar(n,o,e,d)}else u=o[o.length-1];if(u){const d=u.sn-i.startSN,g=this.fragmentTracker.getState(u);if((g===it.OK||g===it.PARTIAL&&u.gap)&&(n=u),n&&u.sn===n.sn&&(!h||c[0].fragment.sn>u.sn)&&n&&u.level===n.level){const p=o[d+1];u.sn<a&&this.fragmentTracker.getState(p)!==it.OK?u=p:u=null}}return u}synchronizeToLiveEdge(e){const{config:t,media:i}=this;if(!i)return;const r=this.hls.liveSyncPosition,n=i.currentTime,o=e.fragments[0].start,a=e.edge,A=n>=o-t.maxFragLookUpTolerance&&n<=a;if(r!==null&&i.duration>r&&(n<r||!A)){const l=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!A&&i.readyState<4||n<a-l)&&(this.loadedmetadata||(this.nextLoadPosition=r),i.readyState&&(this.warn(`Playback: ${n.toFixed(3)} is located too far from the end of live sliding playlist: ${a}, reset currentTime to : ${r.toFixed(3)}`),i.currentTime=r))}}alignPlaylists(e,t){const{levels:i,levelLastLoaded:r,fragPrevious:n}=this,o=r!==null?i[r]:null,a=e.fragments.length;if(!a)return this.warn("No fragments in live playlist"),0;const A=e.fragments[0].start,l=!t,c=e.alignedSliding&&he(A);if(l||!c&&!A){Ep(n,o,e);const h=e.fragments[0].start;return this.log(`Live playlist sliding: ${h.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} prev-sn: ${n?n.sn:"na"} fragments: ${a}`),h}return A}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let i=this.startPosition;if(i<t&&(i=-1),i===-1||this.lastCurrentTime===-1){const r=this.startTimeOffset!==null,n=r?this.startTimeOffset:e.startTimeOffset;n!==null&&he(n)?(i=t+n,n<0&&(i+=e.totalduration),i=Math.min(Math.max(t,i),t+e.totalduration),this.log(`Start time offset ${n} found in ${r?"multivariant":"media"} playlist, adjust startPosition to ${i}`),this.startPosition=i):e.live?i=this.hls.liveSyncPosition||t:this.startPosition=i=0,this.lastCurrentTime=i}this.nextLoadPosition=i}getLoadPosition(){const{media:e}=this;let t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t}handleFragLoadAborted(e,t){this.transmuxer&&e.sn!=="initSegment"&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==J.FRAG_LOADING_WAITING_RETRY)&&(this.state=J.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const h=this.getCurrentContext(t.chunkMeta);h&&(t.frag=h.frag)}const i=t.frag;if(!i||i.type!==e||!this.levels)return;if(this.fragContextChanged(i)){var r;this.warn(`Frag load error must match current frag to retry ${i.url} > ${(r=this.fragCurrent)==null?void 0:r.url}`);return}const n=t.details===Y.FRAG_GAP;n&&this.fragmentTracker.fragBuffered(i,!0);const o=t.errorAction,{action:a,retryCount:A=0,retryConfig:l}=o||{};if(o&&a===dt.RetryRequest&&l){var c;this.resetStartWhenNotLoaded((c=this.levelLastLoaded)!=null?c:i.level);const h=Xo(l,A);this.warn(`Fragment ${i.sn} of ${e} ${i.level} errored with ${t.details}, retrying loading ${A+1}/${l.maxNumRetry} in ${h}ms`),o.resolved=!0,this.retryDate=self.performance.now()+h,this.state=J.FRAG_LOADING_WAITING_RETRY}else l&&o?(this.resetFragmentErrors(e),A<l.maxNumRetry?n||(o.resolved=!0):N.warn(`${t.details} reached or exceeded max retry (${A})`)):(o==null?void 0:o.action)===dt.SendAlternateToPenaltyBox?this.state=J.WAITING_LEVEL:this.state=J.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===J.PARSING||this.state===J.PARSED){const t=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,t),r=i&&i.len>.5;r&&this.reduceMaxBufferLength(i.len);const n=!r;return n&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${t} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),n}return!1}resetFragmentErrors(e){e===pe.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==J.STOPPED&&(this.state=J.IDLE)}afterBufferFlushed(e,t,i){if(!e)return;const r=Ge.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,i),this.state===J.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=J.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=this.levels?this.levels[e].details:null;t!=null&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){var t;this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded((t=this.levelLastLoaded)!=null?t:e.level),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,i,r){var n;const o=i.details;if(!o){this.warn("level.details undefined");return}if(Object.keys(e.elementaryStreams).reduce((A,l)=>{const c=e.elementaryStreams[l];if(c){const h=c.endPTS-c.startPTS;if(h<=0)return this.warn(`Could not parse fragment ${e.sn} ${l} duration reliably (${h})`),A||!1;const u=r?0:_c(o,e,c.startPTS,c.endPTS,c.startDTS,c.endDTS);return this.hls.trigger(E.LEVEL_PTS_UPDATED,{details:o,level:i,drift:u,type:l,frag:e,start:c.startPTS,end:c.endPTS}),!0}return A},!1))i.fragmentError=0;else if(((n=this.transmuxer)==null?void 0:n.error)===null){const A=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(i.fragmentError===0&&(i.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(A.message),this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!1,error:A,frag:e,reason:`Found no media in msn ${e.sn} of level "${i.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=J.PARSED,this.hls.trigger(E.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){if(e.event==="demuxerWorker"){var t,i,r;this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded((t=(i=this.levelLastLoaded)!=null?i:(r=this.fragCurrent)==null?void 0:r.level)!=null?t:0),this.resetLoadingState()}}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Jc(){return self.SourceBuffer||self.WebKitSourceBuffer}function Sp(){const s=hn();if(!s)return!1;const e=Jc(),t=s&&typeof s.isTypeSupported=="function"&&s.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),i=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!t&&!!i}function wp(){var s;const e=Jc();return typeof(e==null||(s=e.prototype)==null?void 0:s.changeType)=="function"}function Tp(){return typeof __HLS_WORKER_BUNDLE__=="function"}function xp(){const s=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),e=self.URL.createObjectURL(s);return{worker:new self.Worker(e),objectURL:e}}function Dp(s){const e=new self.URL(s,self.location.href).href;return{worker:new self.Worker(e),scriptURL:e}}function Wt(s="",e=9e4){return{type:s,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Wc{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,i,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,i){}demux(e,t){this.cachedData&&(e=ji(this.cachedData,e),this.cachedData=null);let i=an(e,0),r=i?i.length:0,n;const o=this._audioTrack,a=this._id3Track,A=i?u0(i):void 0,l=e.length;for((this.basePTS===null||this.frameIndex===0&&he(A))&&(this.basePTS=Rp(A,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),i&&i.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:Ot.audioId3,duration:Number.POSITIVE_INFINITY});r<l;){if(this.canParse(e,r)){const c=this.appendFrame(o,e,r);c?(this.frameIndex++,this.lastPTS=c.sample.pts,r+=c.length,n=r):r=l}else h0(e,r)?(i=an(e,r),a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:Ot.audioId3,duration:Number.POSITIVE_INFINITY}),r+=i.length,n=r):r++;if(r===l&&n!==l){const c=qi(e,n);this.cachedData?this.cachedData=ji(this.cachedData,c):this.cachedData=c}}return{audioTrack:o,videoTrack:Wt(),id3Track:a,textTrack:Wt()}}demuxSampleAes(e,t,i){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Wt(),id3Track:this._id3Track,textTrack:Wt()}}destroy(){}}const Rp=(s,e,t)=>{if(he(s))return s*90;const i=t?t.baseTime*9e4/t.timescale:0;return e*9e4+i};function Lp(s,e,t,i){let r,n,o,a;const A=navigator.userAgent.toLowerCase(),l=i,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];r=((e[t+2]&192)>>>6)+1;const h=(e[t+2]&60)>>>2;if(h>c.length-1){s.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!0,reason:`invalid ADTS sampling index:${h}`});return}return o=(e[t+2]&1)<<2,o|=(e[t+3]&192)>>>6,N.log(`manifest codec:${i}, ADTS type:${r}, samplingIndex:${h}`),/firefox/i.test(A)?h>=6?(r=5,a=new Array(4),n=h-3):(r=2,a=new Array(2),n=h):A.indexOf("android")!==-1?(r=2,a=new Array(2),n=h):(r=5,a=new Array(4),i&&(i.indexOf("mp4a.40.29")!==-1||i.indexOf("mp4a.40.5")!==-1)||!i&&h>=6?n=h-3:((i&&i.indexOf("mp4a.40.2")!==-1&&(h>=6&&o===1||/vivaldi/i.test(A))||!i&&o===1)&&(r=2,a=new Array(2)),n=h)),a[0]=r<<3,a[0]|=(h&14)>>1,a[1]|=(h&1)<<7,a[1]|=o<<3,r===5&&(a[1]|=(n&14)>>1,a[2]=(n&1)<<7,a[2]|=8,a[3]=0),{config:a,samplerate:c[h],channelCount:o,codec:"mp4a.40."+r,manifestCodec:l}}function qc(s,e){return s[e]===255&&(s[e+1]&246)===240}function jc(s,e){return s[e+1]&1?7:9}function na(s,e){return(s[e+3]&3)<<11|s[e+4]<<3|(s[e+5]&224)>>>5}function _p(s,e){return e+5<s.length}function In(s,e){return e+1<s.length&&qc(s,e)}function kp(s,e){return _p(s,e)&&qc(s,e)&&na(s,e)<=s.length-e}function Np(s,e){if(In(s,e)){const t=jc(s,e);if(e+t>=s.length)return!1;const i=na(s,e);if(i<=t)return!1;const r=e+i;return r===s.length||In(s,r)}return!1}function Xc(s,e,t,i,r){if(!s.samplerate){const n=Lp(e,t,i,r);if(!n)return;s.config=n.config,s.samplerate=n.samplerate,s.channelCount=n.channelCount,s.codec=n.codec,s.manifestCodec=n.manifestCodec,N.log(`parsed codec:${s.codec}, rate:${n.samplerate}, channels:${n.channelCount}`)}}function zc(s){return 9216e4/s}function Fp(s,e){const t=jc(s,e);if(e+t<=s.length){const i=na(s,e)-t;if(i>0)return{headerLength:t,frameLength:i}}}function Zc(s,e,t,i,r){const n=zc(s.samplerate),o=i+r*n,a=Fp(e,t);let A;if(a){const{frameLength:h,headerLength:u}=a,d=u+h,g=Math.max(0,t+d-e.length);g?(A=new Uint8Array(d-u),A.set(e.subarray(t+u,e.length),0)):A=e.subarray(t+u,t+d);const f={unit:A,pts:o};return g||s.samples.push(f),{sample:f,length:d,missing:g}}const l=e.length-t;return A=new Uint8Array(l),A.set(e.subarray(t,e.length),0),{sample:{unit:A,pts:o},length:l,missing:-1}}class Mp extends Wc{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,i,r){super.resetInitSegment(e,t,i,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;let i=(an(e,0)||[]).length;for(let r=e.length;i<r;i++)if(Np(e,i))return N.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return kp(e,t)}appendFrame(e,t,i){Xc(e,this.observer,t,i,e.manifestCodec);const r=Zc(e,t,i,this.basePTS,this.frameIndex);if(r&&r.missing===0)return r}}const Pp=/\/emsg[-/]ID3/i;class Op{constructor(e,t){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=t}resetTimeStamp(){}resetInitSegment(e,t,i,r){const n=this.videoTrack=Wt("video",1),o=this.audioTrack=Wt("audio",1),a=this.txtTrack=Wt("text",1);if(this.id3Track=Wt("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const A=hc(e);if(A.video){const{id:l,timescale:c,codec:h}=A.video;n.id=l,n.timescale=a.timescale=c,n.codec=h}if(A.audio){const{id:l,timescale:c,codec:h}=A.audio;o.id=l,o.timescale=c,o.codec=h}a.id=Ac.text,n.sampleDuration=0,n.duration=o.duration=r}resetContiguity(){this.remainderData=null}static probe(e){return e=e.length>16384?e.subarray(0,16384):e,xe(e,["moof"]).length>0}demux(e,t){this.timeOffset=t;let i=e;const r=this.videoTrack,n=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=ji(this.remainderData,e));const a=w0(i);this.remainderData=a.remainder,r.samples=a.valid||new Uint8Array}else r.samples=i;const o=this.extractID3Track(r,t);return n.samples=dc(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:o,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,i=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const r=this.extractID3Track(t,this.timeOffset);return i.samples=dc(e,t),{videoTrack:t,audioTrack:Wt(),id3Track:r,textTrack:Wt()}}extractID3Track(e,t){const i=this.id3Track;if(e.samples.length){const r=xe(e.samples,["emsg"]);r&&r.forEach(n=>{const o=D0(n);if(Pp.test(o.schemeIdUri)){const a=he(o.presentationTime)?o.presentationTime/o.timeScale:t+o.presentationTimeDelta/o.timeScale;let A=o.eventDuration===4294967295?Number.POSITIVE_INFINITY:o.eventDuration/o.timeScale;A<=.001&&(A=Number.POSITIVE_INFINITY);const l=o.payload;i.samples.push({data:l,len:l.byteLength,dts:a,pts:a,type:Ot.emsg,duration:A})}})}return i}demuxSampleAes(e,t,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}let mn=null;const Up=[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],Gp=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Hp=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],$p=[0,1,1,4];function eh(s,e,t,i,r){if(t+24>e.length)return;const n=th(e,t);if(n&&t+n.frameLength<=e.length){const o=n.samplesPerFrame*9e4/n.sampleRate,a=i+r*o,A={unit:e.subarray(t,t+n.frameLength),pts:a,dts:a};return s.config=[],s.channelCount=n.channelCount,s.samplerate=n.sampleRate,s.samples.push(A),{sample:A,length:n.frameLength,missing:0}}}function th(s,e){const t=s[e+1]>>3&3,i=s[e+1]>>1&3,r=s[e+2]>>4&15,n=s[e+2]>>2&3;if(t!==1&&r!==0&&r!==15&&n!==3){const o=s[e+2]>>1&1,a=s[e+3]>>6,A=t===3?3-i:i===3?3:4,l=Up[A*14+r-1]*1e3,h=Gp[(t===3?0:t===2?1:2)*3+n],u=a===3?1:2,d=Hp[t][i],g=$p[i],f=d*8*g,p=Math.floor(d*l/h+o)*g;if(mn===null){const Q=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);mn=Q?parseInt(Q[1]):0}return!!mn&&mn<=87&&i===2&&l>=224e3&&a===0&&(s[e+3]=s[e+3]|128),{sampleRate:h,channelCount:u,frameLength:p,samplesPerFrame:f}}}function oa(s,e){return s[e]===255&&(s[e+1]&224)===224&&(s[e+1]&6)!==0}function ih(s,e){return e+1<s.length&&oa(s,e)}function Yp(s,e){return oa(s,e)&&4<=s.length-e}function Kp(s,e){if(e+1<s.length&&oa(s,e)){const i=th(s,e);let r=4;i!=null&&i.frameLength&&(r=i.frameLength);const n=e+r;return n===s.length||ih(s,n)}return!1}class sh{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,i=e.byteLength-t,r=new Uint8Array(4),n=Math.min(4,t);if(n===0)throw new Error("no bytes available");r.set(e.subarray(i,i+n)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=n*8,this.bytesAvailable-=n}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const i=this.word>>>32-t;if(e>32&&N.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?i<<t|this.readBits(t):i}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t=8,i=8,r;for(let n=0;n<e;n++)i!==0&&(r=this.readEG(),i=(t+r+256)%256),t=i===0?t:i}readSPS(){let e=0,t=0,i=0,r=0,n,o,a;const A=this.readUByte.bind(this),l=this.readBits.bind(this),c=this.readUEG.bind(this),h=this.readBoolean.bind(this),u=this.skipBits.bind(this),d=this.skipEG.bind(this),g=this.skipUEG.bind(this),f=this.skipScalingList.bind(this);A();const p=A();if(l(5),u(3),A(),g(),p===100||p===110||p===122||p===244||p===44||p===83||p===86||p===118||p===128){const b=c();if(b===3&&u(1),g(),g(),u(1),h())for(o=b!==3?8:12,a=0;a<o;a++)h()&&(a<6?f(16):f(64))}g();const y=c();if(y===0)c();else if(y===1)for(u(1),d(),d(),n=c(),a=0;a<n;a++)d();g(),u(1);const B=c(),Q=c(),C=l(1);C===0&&u(1),u(1),h()&&(e=c(),t=c(),i=c(),r=c());let T=[1,1];if(h()&&h())switch(A()){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:{T=[A()<<8|A(),A()<<8|A()];break}}return{width:Math.ceil((B+1)*16-e*2-t*2),height:(2-C)*(Q+1)*16-(C?2:4)*(i+r),pixelRatio:T}}readSliceType(){return this.readUByte(),this.readUEG(),this.readUEG()}}class Vp{constructor(e,t,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new sa(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,i){const r=e[t].unit;if(r.length<=16)return;const n=r.subarray(16,r.length-r.length%16),o=n.buffer.slice(n.byteOffset,n.byteOffset+n.length);this.decryptBuffer(o).then(a=>{const A=new Uint8Array(a);r.set(A,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,i)})}decryptAacSamples(e,t,i){for(;;t++){if(t>=e.length){i();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,i),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,i=new Int8Array(t);let r=0;for(let n=32;n<e.length-16;n+=160,r+=16)i.set(e.subarray(n,n+16),r);return i}getAvcDecryptedUnit(e,t){const i=new Uint8Array(t);let r=0;for(let n=32;n<e.length-16;n+=160,r+=16)e.set(i.subarray(r,r+16),n);return e}decryptAvcSample(e,t,i,r,n){const o=fc(n.data),a=this.getAvcEncryptedData(o);this.decryptBuffer(a.buffer).then(A=>{n.data=this.getAvcDecryptedUnit(o,A),this.decrypter.isSync()||this.decryptAvcSamples(e,t,i+1,r)})}decryptAvcSamples(e,t,i,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,i=0){if(t>=e.length){r();return}const n=e[t].units;for(;!(i>=n.length);i++){const o=n[i];if(!(o.data.length<=48||o.type!==1&&o.type!==5)&&(this.decryptAvcSample(e,t,i,r,o),!this.decrypter.isSync()))return}}}}const gt=188;class wi{constructor(e,t,i){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=e,this.config=t,this.typeSupported=i}static probe(e){const t=wi.syncOffset(e);return t>0&&N.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let i=Math.min(gt*5,e.length-gt)+1,r=0;for(;r<i;){let n=!1,o=-1,a=0;for(let A=r;A<t;A+=gt)if(e[A]===71){if(a++,o===-1&&(o=A,o!==0&&(i=Math.min(o+gt*99,e.length-gt)+1)),n||(n=aa(e,A)===0),n&&a>1&&(o===0&&a>2||A+gt>i))return o}else{if(a)return-1;break}r++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Ac[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,i,r){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=wi.createTrack("video"),this._audioTrack=wi.createTrack("audio",r),this._id3Track=wi.createTrack("id3"),this._txtTrack=wi.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=i,this._duration=r}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_avcTrack:t,_id3Track:i}=this;e&&(e.pesData=null),t&&(t.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null}demux(e,t,i=!1,r=!1){i||(this.sampleAes=null);let n;const o=this._avcTrack,a=this._audioTrack,A=this._id3Track,l=this._txtTrack;let c=o.pid,h=o.pesData,u=a.pid,d=A.pid,g=a.pesData,f=A.pesData,p=null,y=this.pmtParsed,B=this._pmtId,Q=e.length;if(this.remainderData&&(e=ji(this.remainderData,e),Q=e.length,this.remainderData=null),Q<gt&&!r)return this.remainderData=e,{audioTrack:a,videoTrack:o,id3Track:A,textTrack:l};const C=Math.max(0,wi.syncOffset(e));Q-=(Q-C)%gt,Q<e.byteLength&&!r&&(this.remainderData=new Uint8Array(e.buffer,Q,e.buffer.byteLength-Q));let T=0;for(let L=C;L<Q;L+=gt)if(e[L]===71){const R=!!(e[L+1]&64),O=aa(e,L),k=(e[L+3]&48)>>4;let W;if(k>1){if(W=L+5+e[L+4],W===L+gt)continue}else W=L+4;switch(O){case c:R&&(h&&(n=ds(h))&&this.parseAVCPES(o,l,n,!1),h={data:[],size:0}),h&&(h.data.push(e.subarray(W,L+gt)),h.size+=L+gt-W);break;case u:if(R){if(g&&(n=ds(g)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,n);break;case"mp3":this.parseMPEGPES(a,n);break}g={data:[],size:0}}g&&(g.data.push(e.subarray(W,L+gt)),g.size+=L+gt-W);break;case d:R&&(f&&(n=ds(f))&&this.parseID3PES(A,n),f={data:[],size:0}),f&&(f.data.push(e.subarray(W,L+gt)),f.size+=L+gt-W);break;case 0:R&&(W+=e[W]+1),B=this._pmtId=Jp(e,W);break;case B:{R&&(W+=e[W]+1);const $=Wp(e,W,this.typeSupported,i);c=$.avc,c>0&&(o.pid=c),u=$.audio,u>0&&(a.pid=u,a.segmentCodec=$.segmentCodec),d=$.id3,d>0&&(A.pid=d),p!==null&&!y&&(N.warn(`MPEG-TS PMT found at ${L} after unknown PID '${p}'. Backtracking to sync byte @${C} to parse all TS packets.`),p=null,L=C-188),y=this.pmtParsed=!0;break}case 17:case 8191:break;default:p=O;break}}else T++;if(T>0){const L=new Error(`Found ${T} TS packet/s that do not start with 0x47`);this.observer.emit(E.ERROR,E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!1,error:L,reason:L.message})}o.pesData=h,a.pesData=g,A.pesData=f;const b={audioTrack:a,videoTrack:o,id3Track:A,textTrack:l};return r&&this.extractRemainingSamples(b),b}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:i,id3Track:r,textTrack:n}=e,o=i.pesData,a=t.pesData,A=r.pesData;let l;if(o&&(l=ds(o))?(this.parseAVCPES(i,n,l,!0),i.pesData=null):i.pesData=o,a&&(l=ds(a))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break}t.pesData=null}else a!=null&&a.size&&N.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=a;A&&(l=ds(A))?(this.parseID3PES(r,l),r.pesData=null):r.pesData=A}demuxSampleAes(e,t,i){const r=this.demux(e,i,!0,!this.config.progressive),n=this.sampleAes=new Vp(this.observer,this.config,t);return this.decrypt(r,n)}decrypt(e,t){return new Promise(i=>{const{audioTrack:r,videoTrack:n}=e;r.samples&&r.segmentCodec==="aac"?t.decryptAacSamples(r.samples,0,()=>{n.samples?t.decryptAvcSamples(n.samples,0,0,()=>{i(e)}):i(e)}):n.samples&&t.decryptAvcSamples(n.samples,0,0,()=>{i(e)})})}destroy(){this._duration=0}parseAVCPES(e,t,i,r){const n=this.parseAVCNALu(e,i.data);let o=this.avcSample,a,A=!1;i.data=null,o&&n.length&&!e.audFound&&(Ar(o,e),o=this.avcSample=Cn(!1,i.pts,i.dts,"")),n.forEach(l=>{var c;switch(l.type){case 1:{let u=!1;a=!0;const d=l.data;if(A&&d.length>4){const g=new sh(d).readSliceType();(g===2||g===4||g===7||g===9)&&(u=!0)}if(u){var h;(h=o)!=null&&h.frame&&!o.key&&(Ar(o,e),o=this.avcSample=null)}o||(o=this.avcSample=Cn(!0,i.pts,i.dts,"")),o.frame=!0,o.key=u;break}case 5:a=!0,(c=o)!=null&&c.frame&&!o.key&&(Ar(o,e),o=this.avcSample=null),o||(o=this.avcSample=Cn(!0,i.pts,i.dts,"")),o.key=!0,o.frame=!0;break;case 6:{a=!0,gc(l.data,1,i.pts,t.samples);break}case 7:if(a=!0,A=!0,!e.sps){const u=l.data,g=new sh(u).readSPS();e.width=g.width,e.height=g.height,e.pixelRatio=g.pixelRatio,e.sps=[u],e.duration=this._duration;const f=u.subarray(1,4);let p="avc1.";for(let y=0;y<3;y++){let B=f[y].toString(16);B.length<2&&(B="0"+B),p+=B}e.codec=p}break;case 8:a=!0,e.pps||(e.pps=[l.data]);break;case 9:a=!1,e.audFound=!0,o&&Ar(o,e),o=this.avcSample=Cn(!1,i.pts,i.dts,"");break;case 12:a=!0;break;default:a=!1,o&&(o.debug+="unknown NAL "+l.type+" ");break}o&&a&&o.units.push(l)}),r&&o&&(Ar(o,e),this.avcSample=null)}getLastNalUnit(e){var t;let i=this.avcSample,r;if((!i||i.units.length===0)&&(i=e[e.length-1]),(t=i)!=null&&t.units){const n=i.units;r=n[n.length-1]}return r}parseAVCNALu(e,t){const i=t.byteLength;let r=e.naluState||0;const n=r,o=[];let a=0,A,l,c,h=-1,u=0;for(r===-1&&(h=0,u=t[0]&31,r=0,a=1);a<i;){if(A=t[a++],!r){r=A?0:1;continue}if(r===1){r=A?0:2;continue}if(!A)r=3;else if(A===1){if(h>=0){const d={data:t.subarray(h,a-r-1),type:u};o.push(d)}else{const d=this.getLastNalUnit(e.samples);if(d&&(n&&a<=4-n&&d.state&&(d.data=d.data.subarray(0,d.data.byteLength-n)),l=a-r-1,l>0)){const g=new Uint8Array(d.data.byteLength+l);g.set(d.data,0),g.set(t.subarray(0,l),d.data.byteLength),d.data=g,d.state=0}}a<i?(c=t[a]&31,h=a,u=c,r=0):r=-1}else r=0}if(h>=0&&r>=0){const d={data:t.subarray(h,i),type:u,state:r};o.push(d)}if(o.length===0){const d=this.getLastNalUnit(e.samples);if(d){const g=new Uint8Array(d.data.byteLength+t.byteLength);g.set(d.data,0),g.set(t,d.data.byteLength),d.data=g}}return e.naluState=r,o}parseAACPES(e,t){let i=0;const r=this.aacOverFlow;let n=t.data;if(r){this.aacOverFlow=null;const h=r.missing,u=r.sample.unit.byteLength;if(h===-1){const d=new Uint8Array(u+n.byteLength);d.set(r.sample.unit,0),d.set(n,u),n=d}else{const d=u-h;r.sample.unit.set(n.subarray(0,h),d),e.samples.push(r.sample),i=r.missing}}let o,a;for(o=i,a=n.length;o<a-1&&!In(n,o);o++);if(o!==i){let h;const u=o<a-1;u?h=`AAC PES did not start with ADTS header,offset:${o}`:h="No ADTS header found in AAC PES";const d=new Error(h);if(N.warn(`parsing error: ${h}`),this.observer.emit(E.ERROR,E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!1,levelRetry:u,error:d,reason:h}),!u)return}Xc(e,this.observer,n,o,this.audioCodec);let A;if(t.pts!==void 0)A=t.pts;else if(r){const h=zc(e.samplerate);A=r.sample.pts+h}else{N.warn("[tsdemuxer]: AAC PES unknown PTS");return}let l=0,c;for(;o<a;)if(c=Zc(e,n,o,A,l),o+=c.length,c.missing){this.aacOverFlow=c;break}else for(l++;o<a-1&&!In(n,o);o++);}parseMPEGPES(e,t){const i=t.data,r=i.length;let n=0,o=0;const a=t.pts;if(a===void 0){N.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<r;)if(ih(i,o)){const A=eh(e,i,o,a,n);if(A)o+=A.length,n++;else break}else o++}parseID3PES(e,t){if(t.pts===void 0){N.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const i=Ze({},t,{type:this._avcTrack?Ot.emsg:Ot.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(i)}}function Cn(s,e,t,i){return{key:s,frame:!1,pts:e,dts:t,units:[],debug:i,length:0}}function aa(s,e){return((s[e+1]&31)<<8)+s[e+2]}function Jp(s,e){return(s[e+10]&31)<<8|s[e+11]}function Wp(s,e,t,i){const r={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},n=(s[e+1]&15)<<8|s[e+2],o=e+3+n-4,a=(s[e+10]&15)<<8|s[e+11];for(e+=12+a;e<o;){const A=aa(s,e);switch(s[e]){case 207:if(!i){N.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:r.audio===-1&&(r.audio=A);break;case 21:r.id3===-1&&(r.id3=A);break;case 219:if(!i){N.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:r.avc===-1&&(r.avc=A);break;case 3:case 4:t.mpeg!==!0&&t.mp3!==!0?N.log("MPEG audio found, not supported in this browser"):r.audio===-1&&(r.audio=A,r.segmentCodec="mp3");break;case 36:N.warn("Unsupported HEVC stream type found");break}e+=((s[e+3]&15)<<8|s[e+4])+5}return r}function ds(s){let e=0,t,i,r,n,o;const a=s.data;if(!s||s.size===0)return null;for(;a[0].length<19&&a.length>1;){const l=new Uint8Array(a[0].length+a[1].length);l.set(a[0]),l.set(a[1],a[0].length),a[0]=l,a.splice(1,1)}if(t=a[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(i=(t[4]<<8)+t[5],i&&i>s.size-6)return null;const l=t[7];l&192&&(n=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,l&64?(o=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,n-o>54e5&&(N.warn(`${Math.round((n-o)/9e4)}s delta between PTS and DTS, align them`),n=o)):o=n),r=t[8];let c=r+9;if(s.size<=c)return null;s.size-=c;const h=new Uint8Array(s.size);for(let u=0,d=a.length;u<d;u++){t=a[u];let g=t.byteLength;if(c)if(c>g){c-=g;continue}else t=t.subarray(c),g-=c,c=0;h.set(t,e),e+=g}return i&&(i-=r+3),{data:h,pts:n,dts:o,len:i}}return null}function Ar(s,e){if(s.units.length&&s.frame){if(s.pts===void 0){const t=e.samples,i=t.length;if(i){const r=t[i-1];s.pts=r.pts,s.dts=r.dts}else{e.dropped++;return}}e.samples.push(s)}s.debug.length&&N.log(s.pts+"/"+s.dts+":"+s.debug)}class qp extends Wc{resetInitSegment(e,t,i,r){super.resetInitSegment(e,t,i,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;let i=(an(e,0)||[]).length;for(let r=e.length;i<r;i++)if(Kp(e,i))return N.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return Yp(e,t)}appendFrame(e,t,i){if(this.basePTS!==null)return eh(e,t,i,this.basePTS,this.frameIndex)}}class rh{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===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(t===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(t===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(t===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(t===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}}}const Ti=Math.pow(2,32)-1;class P{static init(){P.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:[]};let e;for(e in P.types)P.types.hasOwnProperty(e)&&(P.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=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]),i=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]);P.HDLR_TYPES={video:t,audio:i};const r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n=new Uint8Array([0,0,0,0,0,0,0,0]);P.STTS=P.STSC=P.STCO=n,P.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),P.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),P.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),P.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const o=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),A=new Uint8Array([0,0,0,1]);P.FTYP=P.box(P.types.ftyp,o,A,o,a),P.DINF=P.box(P.types.dinf,P.box(P.types.dref,r))}static box(e,...t){let i=8,r=t.length;const n=r;for(;r--;)i+=t[r].byteLength;const o=new Uint8Array(i);for(o[0]=i>>24&255,o[1]=i>>16&255,o[2]=i>>8&255,o[3]=i&255,o.set(e,4),r=0,i=8;r<n;r++)o.set(t[r],i),i+=t[r].byteLength;return o}static hdlr(e){return P.box(P.types.hdlr,P.HDLR_TYPES[e])}static mdat(e){return P.box(P.types.mdat,e)}static mdhd(e,t){t*=e;const i=Math.floor(t/(Ti+1)),r=Math.floor(t%(Ti+1));return P.box(P.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,i>>24,i>>16&255,i>>8&255,i&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))}static mdia(e){return P.box(P.types.mdia,P.mdhd(e.timescale,e.duration),P.hdlr(e.type),P.minf(e))}static mfhd(e){return P.box(P.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?P.box(P.types.minf,P.box(P.types.smhd,P.SMHD),P.DINF,P.stbl(e)):P.box(P.types.minf,P.box(P.types.vmhd,P.VMHD),P.DINF,P.stbl(e))}static moof(e,t,i){return P.box(P.types.moof,P.mfhd(e),P.traf(i,t))}static moov(e){let t=e.length;const i=[];for(;t--;)i[t]=P.trak(e[t]);return P.box.apply(null,[P.types.moov,P.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(P.mvex(e)))}static mvex(e){let t=e.length;const i=[];for(;t--;)i[t]=P.trex(e[t]);return P.box.apply(null,[P.types.mvex,...i])}static mvhd(e,t){t*=e;const i=Math.floor(t/(Ti+1)),r=Math.floor(t%(Ti+1)),n=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,i>>24,i>>16&255,i>>8&255,i&255,r>>24,r>>16&255,r>>8&255,r&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 P.box(P.types.mvhd,n)}static sdtp(e){const t=e.samples||[],i=new Uint8Array(4+t.length);let r,n;for(r=0;r<t.length;r++)n=t[r].flags,i[r+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return P.box(P.types.sdtp,i)}static stbl(e){return P.box(P.types.stbl,P.stsd(e),P.box(P.types.stts,P.STTS),P.box(P.types.stsc,P.STSC),P.box(P.types.stsz,P.STSZ),P.box(P.types.stco,P.STCO))}static avc1(e){let t=[],i=[],r,n,o;for(r=0;r<e.sps.length;r++)n=e.sps[r],o=n.byteLength,t.push(o>>>8&255),t.push(o&255),t=t.concat(Array.prototype.slice.call(n));for(r=0;r<e.pps.length;r++)n=e.pps[r],o=n.byteLength,i.push(o>>>8&255),i.push(o&255),i=i.concat(Array.prototype.slice.call(n));const a=P.box(P.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(i))),A=e.width,l=e.height,c=e.pixelRatio[0],h=e.pixelRatio[1];return P.box(P.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,A>>8&255,A&255,l>>8&255,l&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]),a,P.box(P.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),P.box(P.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,h>>24,h>>16&255,h>>8&255,h&255])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static mp4a(e){const t=e.samplerate;return P.box(P.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,t&255,0,0]),P.box(P.types.esds,P.esds(e)))}static mp3(e){const t=e.samplerate;return P.box(P.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,t&255,0,0]))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?P.box(P.types.stsd,P.STSD,P.mp3(e)):P.box(P.types.stsd,P.STSD,P.mp4a(e)):P.box(P.types.stsd,P.STSD,P.avc1(e))}static tkhd(e){const t=e.id,i=e.duration*e.timescale,r=e.width,n=e.height,o=Math.floor(i/(Ti+1)),a=Math.floor(i%(Ti+1));return P.box(P.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,a>>24,a>>16&255,a>>8&255,a&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,r>>8&255,r&255,0,0,n>>8&255,n&255,0,0]))}static traf(e,t){const i=P.sdtp(e),r=e.id,n=Math.floor(t/(Ti+1)),o=Math.floor(t%(Ti+1));return P.box(P.types.traf,P.box(P.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),P.box(P.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,o>>24,o>>16&255,o>>8&255,o&255])),P.trun(e,i.length+16+20+8+16+8+8),i)}static trak(e){return e.duration=e.duration||4294967295,P.box(P.types.trak,P.tkhd(e),P.mdia(e))}static trex(e){const t=e.id;return P.box(P.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const i=e.samples||[],r=i.length,n=12+16*r,o=new Uint8Array(n);let a,A,l,c,h,u;for(t+=8+n,o.set([e.type==="video"?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),a=0;a<r;a++)A=i[a],l=A.duration,c=A.size,h=A.flags,u=A.cts,o.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,h.degradPrio&61440,h.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*a);return P.box(P.types.trun,o)}static initSegment(e){P.types||P.init();const t=P.moov(e),i=new Uint8Array(P.FTYP.byteLength+t.byteLength);return i.set(P.FTYP),i.set(t,P.FTYP.byteLength),i}}P.types=void 0,P.HDLR_TYPES=void 0,P.STTS=void 0,P.STSC=void 0,P.STCO=void 0,P.STSZ=void 0,P.VMHD=void 0,P.SMHD=void 0,P.STSD=void 0,P.FTYP=void 0,P.DINF=void 0;const nh=9e4;function Aa(s,e,t=1,i=!1){const r=s*e*t;return i?Math.round(r):r}function jp(s,e,t=1,i=!1){return Aa(s,e,1/t,i)}function lr(s,e=!1){return Aa(s,1e3,1/nh,e)}function Xp(s,e=1){return Aa(s,nh,1/e)}const zp=10*1e3,oh=1024,Zp=1152;let yn=null,la=null;class ca{constructor(e,t,i,r=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=e,this.config=t,this.typeSupported=i,this.ISGenerated=!1,yn===null){const o=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);yn=o?parseInt(o[1]):0}if(la===null){const n=navigator.userAgent.match(/Safari\/(\d+)/i);la=n?parseInt(n[1]):0}}destroy(){}resetTimeStamp(e){N.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){N.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){N.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1}getVideoStartPts(e){let t=!1;const i=e.reduce((r,n)=>{const o=n.pts-r;return o<-4294967296?(t=!0,_t(r,n.pts)):o>0?r:n.pts},e[0].pts);return t&&N.debug("PTS rollover detected"),i}remux(e,t,i,r,n,o,a,A){let l,c,h,u,d,g,f=n,p=n;const y=e.pid>-1,B=t.pid>-1,Q=t.samples.length,C=e.samples.length>0,T=a&&Q>0||Q>1;if((!y||C)&&(!B||T)||this.ISGenerated||a){this.ISGenerated||(h=this.generateIS(e,t,n,o));const L=this.isVideoContiguous;let R=-1,O;if(T&&(R=eE(t.samples),!L&&this.config.forceKeyFrameOnDiscontinuity))if(g=!0,R>0){N.warn(`[mp4-remuxer]: Dropped ${R} out of ${Q} video samples due to a missing keyframe`);const k=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(R),t.dropped+=R,p+=(t.samples[0].pts-k)/t.inputTimeScale,O=p}else R===-1&&(N.warn(`[mp4-remuxer]: No keyframe found out of ${Q} video samples`),g=!1);if(this.ISGenerated){if(C&&T){const k=this.getVideoStartPts(t.samples),$=(_t(e.samples[0].pts,k)-k)/t.inputTimeScale;f+=Math.max(0,$),p+=Math.max(0,-$)}if(C){if(e.samplerate||(N.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),h=this.generateIS(e,t,n,o)),c=this.remuxAudio(e,f,this.isAudioContiguous,o,B||T||A===pe.AUDIO?p:void 0),T){const k=c?c.endPTS-c.startPTS:0;t.inputTimeScale||(N.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),h=this.generateIS(e,t,n,o)),l=this.remuxVideo(t,p,L,k)}}else T&&(l=this.remuxVideo(t,p,L,0));l&&(l.firstKeyFrame=R,l.independent=R!==-1,l.firstKeyFramePTS=O)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(i.samples.length&&(d=ah(i,n,this._initPTS,this._initDTS)),r.samples.length&&(u=Ah(r,n,this._initPTS))),{audio:c,video:l,initSegment:h,independent:g,text:u,id3:d}}generateIS(e,t,i,r){const n=e.samples,o=t.samples,a=this.typeSupported,A={},l=this._initPTS;let c=!l||r,h="audio/mp4",u,d,g;if(c&&(u=d=1/0),e.config&&n.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":a.mpeg?(h="audio/mpeg",e.codec=""):a.mp3&&(e.codec="mp3");break}A.audio={id:"audio",container:h,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&a.mpeg?new Uint8Array(0):P.initSegment([e]),metadata:{channelCount:e.channelCount}},c&&(g=e.inputTimeScale,!l||g!==l.timescale?u=d=n[0].pts-Math.round(g*i):c=!1)}if(t.sps&&t.pps&&o.length&&(t.timescale=t.inputTimeScale,A.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:P.initSegment([t]),metadata:{width:t.width,height:t.height}},c))if(g=t.inputTimeScale,!l||g!==l.timescale){const f=this.getVideoStartPts(o),p=Math.round(g*i);d=Math.min(d,_t(o[0].dts,f)-p),u=Math.min(u,f-p)}else c=!1;if(Object.keys(A).length)return this.ISGenerated=!0,c?(this._initPTS={baseTime:u,timescale:g},this._initDTS={baseTime:d,timescale:g}):u=g=void 0,{tracks:A,initPTS:u,timescale:g}}remuxVideo(e,t,i,r){const n=e.inputTimeScale,o=e.samples,a=[],A=o.length,l=this._initPTS;let c=this.nextAvcDts,h=8,u=this.videoSampleDuration,d,g,f=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY,y=!1;if(!i||c===null){const v=t*n,w=o[0].pts-_t(o[0].dts,o[0].pts);c=v-w}const B=l.baseTime*n/l.timescale;for(let v=0;v<A;v++){const w=o[v];w.pts=_t(w.pts-B,c),w.dts=_t(w.dts-B,c),w.dts<o[v>0?v-1:v].dts&&(y=!0)}y&&o.sort(function(v,w){const F=v.dts-w.dts,H=v.pts-w.pts;return F||H}),d=o[0].dts,g=o[o.length-1].dts;const Q=g-d,C=Q?Math.round(Q/(A-1)):u||e.inputTimeScale/30;if(i){const v=d-c,w=v>C,F=v<-1;if((w||F)&&(w?N.warn(`AVC: ${lr(v,!0)} ms (${v}dts) hole between fragments detected, filling it`):N.warn(`AVC: ${lr(-v,!0)} ms (${v}dts) overlapping between fragments detected`),!F||c>=o[0].pts)){d=c;const H=o[0].pts-v;o[0].dts=d,o[0].pts=H,N.log(`Video: First PTS/DTS adjusted: ${lr(H,!0)}/${lr(d,!0)}, delta: ${lr(v,!0)} ms`)}}d=Math.max(0,d);let T=0,b=0;for(let v=0;v<A;v++){const w=o[v],F=w.units,H=F.length;let K=0;for(let j=0;j<H;j++)K+=F[j].data.length;b+=K,T+=H,w.length=K,w.dts=Math.max(w.dts,d),f=Math.min(w.pts,f),p=Math.max(w.pts,p)}g=o[A-1].dts;const L=b+4*T+8;let R;try{R=new Uint8Array(L)}catch(v){this.observer.emit(E.ERROR,E.ERROR,{type:ge.MUX_ERROR,details:Y.REMUX_ALLOC_ERROR,fatal:!1,error:v,bytes:L,reason:`fail allocating video mdat ${L}`});return}const O=new DataView(R.buffer);O.setUint32(0,L),R.set(P.types.mdat,4);let k=!1,W=Number.POSITIVE_INFINITY,$=Number.POSITIVE_INFINITY,te=Number.NEGATIVE_INFINITY,Z=Number.NEGATIVE_INFINITY;for(let v=0;v<A;v++){const w=o[v],F=w.units;let H=0;for(let se=0,ue=F.length;se<ue;se++){const le=F[se],Ce=le.data,Se=le.data.byteLength;O.setUint32(h,Se),h+=4,R.set(Ce,h),h+=Se,H+=4+Se}let K;if(v<A-1)u=o[v+1].dts-w.dts,K=o[v+1].pts-w.pts;else{const se=this.config,ue=v>0?w.dts-o[v-1].dts:C;if(K=v>0?w.pts-o[v-1].pts:C,se.stretchShortVideoTrack&&this.nextAudioPts!==null){const le=Math.floor(se.maxBufferHole*n),Ce=(r?f+r*n:this.nextAudioPts)-w.pts;Ce>le?(u=Ce-ue,u<0?u=ue:k=!0,N.log(`[mp4-remuxer]: It is approximately ${Ce/90} ms to the next segment; using duration ${u/90} ms for the last video frame.`)):u=ue}else u=ue}const j=Math.round(w.pts-w.dts);W=Math.min(W,u),te=Math.max(te,u),$=Math.min($,K),Z=Math.max(Z,K),a.push(new lh(w.key,u,H,j))}if(a.length){if(yn){if(yn<70){const v=a[0].flags;v.dependsOn=2,v.isNonSync=0}}else if(la&&Z-$<te-W&&C/te<.025&&a[0].cts===0){N.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let v=d;for(let w=0,F=a.length;w<F;w++){const H=v+a[w].duration,K=v+a[w].cts;if(w<F-1){const j=H+a[w+1].cts;a[w].duration=j-K}else a[w].duration=w?a[w-1].duration:C;a[w].cts=0,v=H}}}u=k||!u?C:u,this.nextAvcDts=c=g+u,this.videoSampleDuration=u,this.isVideoContiguous=!0;const S=P.moof(e.sequenceNumber++,d,Ze({},e,{samples:a})),D="video",U={data1:S,data2:R,startPTS:f/n,endPTS:(p+u)/n,startDTS:d/n,endDTS:c/n,type:D,hasAudio:!1,hasVideo:!0,nb:a.length,dropped:e.dropped};return e.samples=[],e.dropped=0,U}remuxAudio(e,t,i,r,n){const o=e.inputTimeScale,a=e.samplerate?e.samplerate:o,A=o/a,l=e.segmentCodec==="aac"?oh:Zp,c=l*A,h=this._initPTS,u=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,d=[],g=n!==void 0;let f=e.samples,p=u?0:8,y=this.nextAudioPts||-1;const B=t*o,Q=h.baseTime*o/h.timescale;if(this.isAudioContiguous=i=i||f.length&&y>0&&(r&&Math.abs(B-y)<9e3||Math.abs(_t(f[0].pts-Q,B)-y)<20*c),f.forEach(function(D){D.pts=_t(D.pts-Q,B)}),!i||y<0){if(f=f.filter(D=>D.pts>=0),!f.length)return;n===0?y=0:r&&!g?y=Math.max(0,B):y=f[0].pts}if(e.segmentCodec==="aac"){const D=this.config.maxAudioFramesDrift;for(let U=0,v=y;U<f.length;U++){const w=f[U],F=w.pts,H=F-v,K=Math.abs(1e3*H/o);if(H<=-D*c&&g)U===0&&(N.warn(`Audio frame @ ${(F/o).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*H/o)} ms.`),this.nextAudioPts=y=v=F);else if(H>=D*c&&K<zp&&g){let j=Math.round(H/c);v=F-j*c,v<0&&(j--,v+=c),U===0&&(this.nextAudioPts=y=v),N.warn(`[mp4-remuxer]: Injecting ${j} audio frame @ ${(v/o).toFixed(3)}s due to ${Math.round(1e3*H/o)} ms gap.`);for(let se=0;se<j;se++){const ue=Math.max(v,0);let le=rh.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);le||(N.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),le=w.unit.subarray()),f.splice(U,0,{unit:le,pts:ue}),v+=c,U++}}w.pts=v,v+=c}}let C=null,T=null,b,L=0,R=f.length;for(;R--;)L+=f[R].unit.byteLength;for(let D=0,U=f.length;D<U;D++){const v=f[D],w=v.unit;let F=v.pts;if(T!==null){const K=d[D-1];K.duration=Math.round((F-T)/A)}else if(i&&e.segmentCodec==="aac"&&(F=y),C=F,L>0){L+=p;try{b=new Uint8Array(L)}catch(K){this.observer.emit(E.ERROR,E.ERROR,{type:ge.MUX_ERROR,details:Y.REMUX_ALLOC_ERROR,fatal:!1,error:K,bytes:L,reason:`fail allocating audio mdat ${L}`});return}u||(new DataView(b.buffer).setUint32(0,L),b.set(P.types.mdat,4))}else return;b.set(w,p);const H=w.byteLength;p+=H,d.push(new lh(!0,l,H,0)),T=F}const O=d.length;if(!O)return;const k=d[d.length-1];this.nextAudioPts=y=T+A*k.duration;const W=u?new Uint8Array(0):P.moof(e.sequenceNumber++,C/A,Ze({},e,{samples:d}));e.samples=[];const $=C/o,te=y/o,S={data1:W,data2:b,startPTS:$,endPTS:te,startDTS:$,endDTS:te,type:"audio",hasAudio:!0,hasVideo:!1,nb:O};return this.isAudioContiguous=!0,S}remuxEmptyAudio(e,t,i,r){const n=e.inputTimeScale,o=e.samplerate?e.samplerate:n,a=n/o,A=this.nextAudioPts,l=this._initDTS,c=l.baseTime*9e4/l.timescale,h=(A!==null?A:r.startDTS*n)+c,u=r.endDTS*n+c,d=a*oh,g=Math.ceil((u-h)/d),f=rh.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(N.warn("[mp4-remuxer]: remux empty Audio"),!f){N.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const p=[];for(let y=0;y<g;y++){const B=h+y*d;p.push({unit:f,pts:B,dts:B})}return e.samples=p,this.remuxAudio(e,t,i,!1)}}function _t(s,e){let t;if(e===null)return s;for(e<s?t=-8589934592:t=8589934592;Math.abs(s-e)>4294967296;)s+=t;return s}function eE(s){for(let e=0;e<s.length;e++)if(s[e].key)return e;return-1}function ah(s,e,t,i){const r=s.samples.length;if(!r)return;const n=s.inputTimeScale;for(let a=0;a<r;a++){const A=s.samples[a];A.pts=_t(A.pts-t.baseTime*n/t.timescale,e*n)/n,A.dts=_t(A.dts-i.baseTime*n/i.timescale,e*n)/n}const o=s.samples;return s.samples=[],{samples:o}}function Ah(s,e,t){const i=s.samples.length;if(!i)return;const r=s.inputTimeScale;for(let o=0;o<i;o++){const a=s.samples[o];a.pts=_t(a.pts-t.baseTime*r/t.timescale,e*r)/r}s.samples.sort((o,a)=>o.pts-a.pts);const n=s.samples;return s.samples=[],{samples:n}}class lh{constructor(e,t,i,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=i,this.cts=r,this.flags=new tE(e)}}class tE{constructor(e){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=e?2:1,this.isNonSync=e?0:1}}class iE{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,i,r){this.audioCodec=t,this.videoCodec=i,this.generateInitSegment(B0(e,r)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:i}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const r=this.initData=hc(e);t||(t=ch(r.audio,Me.AUDIO)),i||(i=ch(r.video,Me.VIDEO));const n={};r.audio&&r.video?n.audiovideo={container:"video/mp4",codec:t+","+i,initSegment:e,id:"main"}:r.audio?n.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?n.video={container:"video/mp4",codec:i,initSegment:e,id:"main"}:N.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n}remux(e,t,i,r,n,o){var a,A;let{initPTS:l,lastEndTime:c}=this;const h={audio:void 0,video:void 0,text:r,id3:i,initSegment:void 0};he(c)||(c=this.lastEndTime=n||0);const u=t.samples;if(!(u!=null&&u.length))return h;const d={initPTS:void 0,timescale:1};let g=this.initData;if((a=g)!=null&&a.length||(this.generateInitSegment(u),g=this.initData),!((A=g)!=null&&A.length))return N.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),h;this.emitInitSegment&&(d.tracks=this.initTracks,this.emitInitSegment=!1);const f=Q0(u,g),p=v0(g,u),y=p===null?n:p;(sE(l,y,n,f)||d.timescale!==l.timescale&&o)&&(d.initPTS=y-n,l&&l.timescale===1&&N.warn(`Adjusting initPTS by ${d.initPTS-l.baseTime}`),this.initPTS=l={baseTime:d.initPTS,timescale:1});const B=e?y-l.baseTime/l.timescale:c,Q=B+f;S0(g,u,l.baseTime/l.timescale),f>0?this.lastEndTime=Q:(N.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const C=!!g.audio,T=!!g.video;let b="";C&&(b+="audio"),T&&(b+="video");const L={data1:u,startPTS:B,startDTS:B,endPTS:Q,endDTS:Q,type:b,hasAudio:C,hasVideo:T,nb:1,dropped:0};return h.audio=L.type==="audio"?L:void 0,h.video=L.type!=="audio"?L:void 0,h.initSegment=d,h.id3=ah(i,n,l,l),r.samples.length&&(h.text=Ah(r,n,l)),h}}function sE(s,e,t,i){if(s===null)return!0;const r=Math.max(i,1),n=e-s.baseTime/s.timescale;return Math.abs(n-t)>r}function ch(s,e){const t=s==null?void 0:s.codec;return t&&t.length>4?t:t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":t==="avc1"||e===Me.VIDEO?"avc1.42e01e":"mp4a.40.5"}let ci;try{ci=self.performance.now.bind(self.performance)}catch{N.debug("Unable to use Performance API on this environment"),ci=typeof self<"u"&&self.Date.now}const ha=[{demux:Op,remux:iE},{demux:wi,remux:ca},{demux:Mp,remux:ca},{demux:qp,remux:ca}];class hh{constructor(e,t,i,r,n){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=e,this.typeSupported=t,this.config=i,this.vendor=r,this.id=n}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,i,r){const n=i.transmuxing;n.executeStart=ci();let o=new Uint8Array(e);const{currentTransmuxState:a,transmuxConfig:A}=this;r&&(this.currentTransmuxState=r);const{contiguous:l,discontinuity:c,trackSwitch:h,accurateTimeOffset:u,timeOffset:d,initSegmentChange:g}=r||a,{audioCodec:f,videoCodec:p,defaultInitPts:y,duration:B,initSegmentData:Q}=A,C=rE(o,t);if(C&&C.method==="AES-128"){const R=this.getDecrypter();if(R.isSync()){let O=R.softwareDecrypt(o,C.key.buffer,C.iv.buffer);if(i.part>-1&&(O=R.flush()),!O)return n.executeEnd=ci(),ua(i);o=new Uint8Array(O)}else return this.decryptionPromise=R.webCryptoDecrypt(o,C.key.buffer,C.iv.buffer).then(O=>{const k=this.push(O,null,i);return this.decryptionPromise=null,k}),this.decryptionPromise}const T=this.needsProbing(c,h);if(T){const R=this.configureTransmuxer(o);if(R)return N.warn(`[transmuxer] ${R.message}`),this.observer.emit(E.ERROR,E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,fatal:!1,error:R,reason:R.message}),n.executeEnd=ci(),ua(i)}(c||h||g||T)&&this.resetInitSegment(Q,f,p,B,t),(c||g||T)&&this.resetInitialTimestamp(y),l||this.resetContiguity();const b=this.transmux(o,C,d,u,i),L=this.currentTransmuxState;return L.contiguous=!0,L.discontinuity=!1,L.trackSwitch=!1,n.executeEnd=ci(),b}flush(e){const t=e.transmuxing;t.executeStart=ci();const{decrypter:i,currentTransmuxState:r,decryptionPromise:n}=this;if(n)return n.then(()=>this.flush(e));const o=[],{timeOffset:a}=r;if(i){const h=i.flush();h&&o.push(this.push(h,null,e))}const{demuxer:A,remuxer:l}=this;if(!A||!l)return t.executeEnd=ci(),[ua(e)];const c=A.flush(a);return Bn(c)?c.then(h=>(this.flushRemux(o,h,e),o)):(this.flushRemux(o,c,e),o)}flushRemux(e,t,i){const{audioTrack:r,videoTrack:n,id3Track:o,textTrack:a}=t,{accurateTimeOffset:A,timeOffset:l}=this.currentTransmuxState;N.log(`[transmuxer.ts]: Flushed fragment ${i.sn}${i.part>-1?" p: "+i.part:""} of level ${i.level}`);const c=this.remuxer.remux(r,n,o,a,l,A,!0,this.id);e.push({remuxResult:c,chunkMeta:i}),i.transmuxing.executeEnd=ci()}resetInitialTimestamp(e){const{demuxer:t,remuxer:i}=this;!t||!i||(t.resetTimeStamp(e),i.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,i,r,n){const{demuxer:o,remuxer:a}=this;!o||!a||(o.resetInitSegment(e,t,i,r),a.resetInitSegment(e,t,i,n))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,i,r,n){let o;return t&&t.method==="SAMPLE-AES"?o=this.transmuxSampleAes(e,t,i,r,n):o=this.transmuxUnencrypted(e,i,r,n),o}transmuxUnencrypted(e,t,i,r){const{audioTrack:n,videoTrack:o,id3Track:a,textTrack:A}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(n,o,a,A,t,i,!1,this.id),chunkMeta:r}}transmuxSampleAes(e,t,i,r,n){return this.demuxer.demuxSampleAes(e,t,i).then(o=>({remuxResult:this.remuxer.remux(o.audioTrack,o.videoTrack,o.id3Track,o.textTrack,i,r,!1,this.id),chunkMeta:n}))}configureTransmuxer(e){const{config:t,observer:i,typeSupported:r,vendor:n}=this;let o;for(let h=0,u=ha.length;h<u;h++)if(ha[h].demux.probe(e)){o=ha[h];break}if(!o)return new Error("Failed to find demuxer by probing fragment data");const a=this.demuxer,A=this.remuxer,l=o.remux,c=o.demux;(!A||!(A instanceof l))&&(this.remuxer=new l(i,t,r,n)),(!a||!(a instanceof c))&&(this.demuxer=new c(i,t,r),this.probe=c.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new sa(this.config)),e}}function rE(s,e){let t=null;return s.byteLength>0&&e!=null&&e.key!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const ua=s=>({remuxResult:{},chunkMeta:s});function Bn(s){return"then"in s&&s.then instanceof Function}class nE{constructor(e,t,i,r,n){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=i,this.duration=r,this.defaultInitPts=n||null}}class oE{constructor(e,t,i,r,n,o){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=e,this.contiguous=t,this.accurateTimeOffset=i,this.trackSwitch=r,this.timeOffset=n,this.initSegmentChange=o}}var uh={exports:{}};(function(s){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function r(A,l,c){this.fn=A,this.context=l,this.once=c||!1}function n(A,l,c,h,u){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new r(c,h||A,u),g=t?t+l:l;return A._events[g]?A._events[g].fn?A._events[g]=[A._events[g],d]:A._events[g].push(d):(A._events[g]=d,A._eventsCount++),A}function o(A,l){--A._eventsCount===0?A._events=new i:delete A._events[l]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,h;if(this._eventsCount===0)return l;for(h in c=this._events)e.call(c,h)&&l.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=t?t+l:l,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var u=0,d=h.length,g=new Array(d);u<d;u++)g[u]=h[u].fn;return g},a.prototype.listenerCount=function(l){var c=t?t+l:l,h=this._events[c];return h?h.fn?1:h.length:0},a.prototype.emit=function(l,c,h,u,d,g){var f=t?t+l:l;if(!this._events[f])return!1;var p=this._events[f],y=arguments.length,B,Q;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),y){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,h),!0;case 4:return p.fn.call(p.context,c,h,u),!0;case 5:return p.fn.call(p.context,c,h,u,d),!0;case 6:return p.fn.call(p.context,c,h,u,d,g),!0}for(Q=1,B=new Array(y-1);Q<y;Q++)B[Q-1]=arguments[Q];p.fn.apply(p.context,B)}else{var C=p.length,T;for(Q=0;Q<C;Q++)switch(p[Q].once&&this.removeListener(l,p[Q].fn,void 0,!0),y){case 1:p[Q].fn.call(p[Q].context);break;case 2:p[Q].fn.call(p[Q].context,c);break;case 3:p[Q].fn.call(p[Q].context,c,h);break;case 4:p[Q].fn.call(p[Q].context,c,h,u);break;default:if(!B)for(T=1,B=new Array(y-1);T<y;T++)B[T-1]=arguments[T];p[Q].fn.apply(p[Q].context,B)}}return!0},a.prototype.on=function(l,c,h){return n(this,l,c,h,!1)},a.prototype.once=function(l,c,h){return n(this,l,c,h,!0)},a.prototype.removeListener=function(l,c,h,u){var d=t?t+l:l;if(!this._events[d])return this;if(!c)return o(this,d),this;var g=this._events[d];if(g.fn)g.fn===c&&(!u||g.once)&&(!h||g.context===h)&&o(this,d);else{for(var f=0,p=[],y=g.length;f<y;f++)(g[f].fn!==c||u&&!g[f].once||h&&g[f].context!==h)&&p.push(g[f]);p.length?this._events[d]=p.length===1?p[0]:p:o(this,d)}return this},a.prototype.removeAllListeners=function(l){var c;return l?(c=t?t+l:l,this._events[c]&&o(this,c)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,s.exports=a})(uh);var aE=uh.exports,da=Vf(aE);const ga=hn()||{isTypeSupported:()=>!1};class dh{constructor(e,t,i,r){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const n=e.config;this.hls=e,this.id=t,this.useWorker=!!n.enableWorker,this.onTransmuxComplete=i,this.onFlush=r;const o=(l,c)=>{c=c||{},c.frag=this.frag,c.id=this.id,l===E.ERROR&&(this.error=c.error),this.hls.trigger(l,c)};this.observer=new da,this.observer.on(E.FRAG_DECRYPTED,o),this.observer.on(E.ERROR,o);const a={mp4:ga.isTypeSupported("video/mp4"),mpeg:ga.isTypeSupported("audio/mpeg"),mp3:ga.isTypeSupported('audio/mp4; codecs="mp3"')},A=navigator.vendor;if(this.useWorker&&typeof Worker<"u"&&(n.workerPath||Tp())){try{n.workerPath?(N.log(`loading Web Worker ${n.workerPath} for "${t}"`),this.workerContext=Dp(n.workerPath)):(N.log(`injecting Web Worker for "${t}"`),this.workerContext=xp()),this.onwmsg=h=>this.onWorkerMessage(h);const{worker:c}=this.workerContext;c.addEventListener("message",this.onwmsg),c.onerror=h=>{const u=new Error(`${h.message} (${h.filename}:${h.lineno})`);n.enableWorker=!1,N.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(E.ERROR,{type:ge.OTHER_ERROR,details:Y.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:u})},c.postMessage({cmd:"init",typeSupported:a,vendor:A,id:t,config:JSON.stringify(n)})}catch(c){N.warn(`Error setting up "${t}" Web Worker, fallback to inline`,c),this.resetWorker(),this.error=null,this.transmuxer=new hh(this.observer,a,n,A,t)}return}this.transmuxer=new hh(this.observer,a,n,A,t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,i,r,n,o,a,A,l,c){var h,u;l.transmuxing.start=self.performance.now();const{transmuxer:d}=this,g=o?o.start:n.start,f=n.decryptdata,p=this.frag,y=!(p&&n.cc===p.cc),B=!(p&&l.level===p.level),Q=p?l.sn-p.sn:-1,C=this.part?l.part-this.part.index:-1,T=Q===0&&l.id>1&&l.id===(p==null?void 0:p.stats.chunkCount),b=!B&&(Q===1||Q===0&&(C===1||T&&C<=0)),L=self.performance.now();(B||Q||n.stats.parsing.start===0)&&(n.stats.parsing.start=L),o&&(C||!b)&&(o.stats.parsing.start=L);const R=!(p&&((h=n.initSegment)==null?void 0:h.url)===((u=p.initSegment)==null?void 0:u.url)),O=new oE(y,b,A,B,g,R);if(!b||y||R){N.log(`[transmuxer-interface, ${n.type}]: Starting new transmux session for sn: ${l.sn} p: ${l.part} level: ${l.level} id: ${l.id}
|
180
180
|
discontinuity: ${y}
|
181
181
|
trackSwitch: ${B}
|
182
182
|
contiguous: ${b}
|
183
183
|
accurateTimeOffset: ${A}
|
184
184
|
timeOffset: ${g}
|
185
|
-
initSegmentChange: ${R}`);const k=new rE(i,r,t,a,c);this.configureTransmuxer(k)}if(this.frag=n,this.part=o,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:f,chunkMeta:l,state:O},e instanceof ArrayBuffer?[e]:[]);else if(d){const k=d.push(e,f,l,O);Bn(k)?(d.async=!0,k.then(W=>{this.handleTransmuxComplete(W)}).catch(W=>{this.transmuxerError(W,l,"transmuxer-interface push error")})):(d.async=!1,this.handleTransmuxComplete(k))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let i=t.flush(e);Bn(i)||t.async?(Bn(i)||(i=Promise.resolve(i)),i.then(n=>{this.handleFlushResult(n,e)}).catch(n=>{this.transmuxerError(n,e,"transmuxer-interface flush error")})):this.handleFlushResult(i,e)}}transmuxerError(e,t,i){this.hls&&(this.error=e,this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:i}))}handleFlushResult(e,t){e.forEach(i=>{this.handleTransmuxComplete(i)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data,i=this.hls;switch(t.event){case"init":{var r;const n=(r=this.workerContext)==null?void 0:r.objectURL;n&&self.URL.revokeObjectURL(n);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":N[t.data.logType]&&N[t.data.logType](t.data.message);break;default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,i.trigger(t.event,t.data);break}}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const aE=250,fa=2,AE=.1,lE=.05;class cE{constructor(e,t,i,r){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=e,this.media=t,this.fragmentTracker=i,this.hls=r}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:i,media:r,stalled:n}=this;if(r===null)return;const{currentTime:o,seeking:a}=r,A=this.seeking&&!a,l=!this.seeking&&a;if(this.seeking=a,o!==e){if(this.moved=!0,n!==null){if(this.stallReported){const y=self.performance.now()-n;N.warn(`playback not stuck anymore @${o}, after ${Math.round(y)}ms`),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if(l||A){this.stalled=null;return}if(r.paused&&!a||r.ended||r.playbackRate===0||!Ge.getBuffered(r).length)return;const c=Ge.bufferInfo(r,o,0),h=c.len>0,u=c.nextStart||0;if(!h&&!u)return;if(a){const y=c.len>fa,B=!u||t&&t.start<=o||u-o>fa&&!this.fragmentTracker.getPartialFragment(o);if(y||B)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var d;const y=Math.max(u,c.start||0)-o,B=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,C=(B==null||(d=B.details)==null?void 0:d.live)?B.details.targetduration*2:fa,T=this.fragmentTracker.getPartialFragment(o);if(y>0&&(y<=C||T)){this._trySkipBufferHole(T);return}}const g=self.performance.now();if(n===null){this.stalled=g;return}const f=g-n;if(!a&&f>=aE&&(this._reportStall(c),!this.media))return;const p=Ge.bufferInfo(r,o,i.maxBufferHole);this._tryFixBufferStall(p,f)}_tryFixBufferStall(e,t){const{config:i,fragmentTracker:r,media:n}=this;if(n===null)return;const o=n.currentTime,a=r.getPartialFragment(o);a&&(this._trySkipBufferHole(a)||!this.media)||(e.len>i.maxBufferHole||e.nextStart&&e.nextStart-o<i.maxBufferHole)&&t>i.highBufferWatchdogPeriod*1e3&&(N.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:i,stallReported:r}=this;if(!r&&i){this.stallReported=!0;const n=new Error(`Playback stalling at @${i.currentTime} due to low buffer (${JSON.stringify(e)})`);N.warn(n.message),t.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_STALLED_ERROR,fatal:!1,error:n,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:i,media:r}=this;if(r===null)return 0;const n=r.currentTime,o=Ge.bufferInfo(r,n,0),a=n<o.start?o.start:o.nextStart;if(a){const A=o.len<=t.maxBufferHole,l=o.len>0&&o.len<1&&r.readyState<3,c=a-n;if(c>0&&(A||l)){if(c>t.maxBufferHole){const{fragmentTracker:u}=this;let d=!1;if(n===0){const g=u.getAppendedFrag(0,pe.MAIN);g&&a<g.end&&(d=!0)}if(!d){const g=e||u.getAppendedFrag(n,pe.MAIN);if(g){let f=!1,p=g.end;for(;p<a;){const y=u.getPartialFragment(p);if(y)p+=y.duration;else{f=!0;break}}if(f)return 0}}}const h=Math.max(a+lE,n+AE);if(N.warn(`skipping hole, adjusting currentTime from ${n} to ${h}`),this.moved=!0,this.stalled=null,r.currentTime=h,e&&!e.gap){const u=new Error(`fragment loaded with buffer holes, seeking from ${n} to ${h}`);i.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:u,reason:u.message,frag:e})}return h}}return 0}_tryNudgeBuffer(){const{config:e,hls:t,media:i,nudgeRetry:r}=this;if(i===null)return;const n=i.currentTime;if(this.nudgeRetry++,r<e.nudgeMaxRetry){const o=n+(r+1)*e.nudgeOffset,a=new Error(`Nudging 'currentTime' from ${n} to ${o}`);N.warn(a.message),i.currentTime=o,t.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_NUDGE_ON_STALL,error:a,fatal:!1})}else{const o=new Error(`Playhead still not moving while enough data buffered @${n} after ${e.nudgeMaxRetry} nudges`);N.error(o.message),t.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_STALLED_ERROR,error:o,fatal:!0})}}}const hE=100;class uE extends ra{constructor(e,t,i){super(e,t,i,"[stream-controller]",pe.MAIN),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_PARSED,this.onManifestParsed,this),e.on(E.LEVEL_LOADING,this.onLevelLoading,this),e.on(E.LEVEL_LOADED,this.onLevelLoaded,this),e.on(E.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(E.ERROR,this.onError,this),e.on(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(E.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(E.BUFFER_CREATED,this.onBufferCreated,this),e.on(E.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(E.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_PARSED,this.onManifestParsed,this),e.off(E.LEVEL_LOADED,this.onLevelLoaded,this),e.off(E.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(E.ERROR,this.onError,this),e.off(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(E.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(E.BUFFER_CREATED,this.onBufferCreated,this),e.off(E.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(E.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),this.onMediaDetaching()}startLoad(e){if(this.levels){const{lastCurrentTime:t,hls:i}=this;if(this.stopLoad(),this.setInterval(hE),this.level=-1,!this.startFragRequested){let r=i.startLevel;r===-1&&(i.config.testBandwidth&&this.levels.length>1?(r=0,this.bitrateTest=!0):r=i.nextAutoLevel),this.level=i.nextLoadLevel=r,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=J.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=J.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case J.WAITING_LEVEL:{var e;const{levels:i,level:r}=this,n=i==null||(e=i[r])==null?void 0:e.details;if(n&&(!n.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(n))break;this.state=J.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=J.IDLE;break}break}case J.FRAG_LOADING_WAITING_RETRY:{var t;const i=self.performance.now(),r=this.retryDate;(!r||i>=r||(t=this.media)!=null&&t.seeking)&&(this.resetStartWhenNotLoaded(this.level),this.state=J.IDLE)}break}this.state===J.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:i,media:r}=this,{config:n,nextLoadLevel:o}=e;if(t===null||!r&&(this.startFragRequested||!n.startFragPrefetch)||this.altAudio&&this.audioOnly||!(i!=null&&i[o]))return;const a=i[o],A=this.getMainFwdBufferInfo();if(A===null)return;const l=this.getLevelDetails();if(l&&this._streamEnded(A,l)){const p={};this.altAudio&&(p.type="video"),this.hls.trigger(E.BUFFER_EOS,p),this.state=J.ENDED;return}e.loadLevel!==o&&e.manualLevel===-1&&this.log(`Adapting to level ${o} from level ${this.level}`),this.level=e.nextLoadLevel=o;const c=a.details;if(!c||this.state===J.WAITING_LEVEL||c.live&&this.levelLastLoaded!==o){this.level=o,this.state=J.WAITING_LEVEL;return}const h=A.len,u=this.getMaxBufferLength(a.maxBitrate);if(h>=u)return;this.backtrackFragment&&this.backtrackFragment.start>A.end&&(this.backtrackFragment=null);const d=this.backtrackFragment?this.backtrackFragment.start:A.end;let g=this.getNextFragment(d,c);if(this.couldBacktrack&&!this.fragPrevious&&g&&g.sn!=="initSegment"&&this.fragmentTracker.getState(g)!==it.OK){var f;const y=((f=this.backtrackFragment)!=null?f:g).sn-c.startSN,B=c.fragments[y-1];B&&g.cc===B.cc&&(g=B,this.fragmentTracker.removeFragment(B))}else this.backtrackFragment&&A.len&&(this.backtrackFragment=null);if(g&&this.isLoopLoading(g,d)){if(!g.gap){const y=this.audioOnly&&!this.altAudio?Fe.AUDIO:Fe.VIDEO,B=(y===Fe.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;B&&this.afterBufferFlushed(B,y,pe.MAIN)}g=this.getNextFragmentLoopLoading(g,c,A,pe.MAIN,u)}g&&(g.initSegment&&!g.initSegment.data&&!this.bitrateTest&&(g=g.initSegment),this.loadFragment(g,a,d))}loadFragment(e,t,i){const r=this.fragmentTracker.getState(e);this.fragCurrent=e,r===it.NOT_LOADED||r===it.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,i)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,pe.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let i;const r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const n=this.getLevelDetails();if(n!=null&&n.live){const a=this.getMainFwdBufferInfo();if(!a||a.len<n.targetduration*2)return}if(!t.paused&&e){const a=this.hls.nextLoadLevel,A=e[a],l=this.fragLastKbps;l&&this.fragCurrent?i=this.fragCurrent.duration*A.maxBitrate/(1e3*l)+1:i=0}else i=0;const o=this.getBufferedFrag(t.currentTime+i);if(o){const a=this.followingBufferedFrag(o);if(a){this.abortCurrentFrag();const A=a.maxStartPTS?a.maxStartPTS:a.start,l=a.duration,c=Math.max(o.end,A+Math.min(Math.max(l-this.config.maxFragLookUpTolerance,l*.5),l*.75));this.flushMainBuffer(c,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case J.KEY_LOADING:case J.FRAG_LOADING:case J.FRAG_LOADING_WAITING_RETRY:case J.PARSING:case J.PARSED:this.state=J.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const i=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new cE(this.config,i,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;ce(t)&&this.log(`Media seeked to ${t.toFixed(3)}`);const i=this.getMainFwdBufferInfo();if(i===null||i.len===0){this.warn(`Main forward buffer length on "seeked" event ${i?i.len:"empty"})`);return}this.tick()}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(E.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.levels=this.fragPlaying=this.backtrackFragment=null,this.altAudio=this.audioOnly=!1}onManifestParsed(e,t){let i=!1,r=!1,n;t.levels.forEach(o=>{n=o.audioCodec,n&&(n.indexOf("mp4a.40.2")!==-1&&(i=!0),n.indexOf("mp4a.40.5")!==-1&&(r=!0))}),this.audioCodecSwitch=i&&r&&!Sp(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:i}=this;if(!i||this.state!==J.IDLE)return;const r=i[t.level];(!r.details||r.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(r.details))&&(this.state=J.WAITING_LEVEL)}onLevelLoaded(e,t){var i;const{levels:r}=this,n=t.level,o=t.details,a=o.totalduration;if(!r){this.warn(`Levels were reset while loading level ${n}`);return}this.log(`Level ${n} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${a}`);const A=r[n],l=this.fragCurrent;l&&(this.state===J.FRAG_LOADING||this.state===J.FRAG_LOADING_WAITING_RETRY)&&(l.level!==t.level||l.urlId!==A.urlId)&&l.loader&&this.abortCurrentFrag();let c=0;if(o.live||(i=A.details)!=null&&i.live){if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;c=this.alignPlaylists(o,A.details)}if(A.details=o,this.levelLastLoaded=n,this.hls.trigger(E.LEVEL_UPDATED,{details:o,level:n}),this.state===J.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=J.IDLE}this.startFragRequested?o.live&&this.synchronizeToLiveEdge(o):this.setStartPosition(o,c),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:i,part:r,payload:n}=e,{levels:o}=this;if(!o){this.warn(`Levels were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);return}const a=o[i.level],A=a.details;if(!A){this.warn(`Dropping fragment ${i.sn} of level ${i.level} after level details were reset`),this.fragmentTracker.removeFragment(i);return}const l=a.videoCodec,c=A.PTSKnown||!A.live,h=(t=i.initSegment)==null?void 0:t.data,u=this._getAudioCodec(a),d=this.transmuxer=this.transmuxer||new uh(this.hls,pe.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),g=r?r.index:-1,f=g!==-1,p=new ta(i.level,i.sn,i.stats.chunkCount,n.byteLength,g,f),y=this.initPTS[i.cc];d.push(n,h,u,l,i,r,A.totalduration,c,p,y)}onAudioTrackSwitching(e,t){const i=this.altAudio;if(!!!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const o=this.fragCurrent;o&&(this.log("Switching to main audio track, cancel main fragment load"),o.abortRequests(),this.fragmentTracker.removeFragment(o)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const n=this.hls;i&&(n.trigger(E.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),n.trigger(E.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const i=t.id,r=!!this.hls.audioTracks[i].url;if(r){const n=this.videoBuffer;n&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=r,this.tick()}onBufferCreated(e,t){const i=t.tracks;let r,n,o=!1;for(const a in i){const A=i[a];if(A.id==="main"){if(n=a,r=A,a==="video"){const l=i[a];l&&(this.videoBuffer=l.buffer)}}else o=!0}o&&r?(this.log(`Alternate track found, use ${n}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:i,part:r}=t;if(i&&i.type!==pe.MAIN)return;if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${r?" p: "+r.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}`),this.state===J.PARSED&&(this.state=J.IDLE);return}const n=r?r.stats:i.stats;this.fragLastKbps=Math.round(8*n.total/(n.buffering.end-n.loading.first)),i.sn!=="initSegment"&&(this.fragPrevious=i),this.fragBufferedComplete(i,r)}onError(e,t){var i;if(t.fatal){this.state=J.ERROR;return}switch(t.details){case Y.FRAG_GAP:case Y.FRAG_PARSING_ERROR:case Y.FRAG_DECRYPT_ERROR:case Y.FRAG_LOAD_ERROR:case Y.FRAG_LOAD_TIMEOUT:case Y.KEY_LOAD_ERROR:case Y.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(pe.MAIN,t);break;case Y.LEVEL_LOAD_ERROR:case Y.LEVEL_LOAD_TIMEOUT:case Y.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===J.WAITING_LEVEL&&((i=t.context)==null?void 0:i.type)===De.LEVEL&&(this.state=J.IDLE);break;case Y.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case Y.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!Ge.getBuffered(e).length){const i=this.state!==J.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,i)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=J.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==Fe.AUDIO||this.audioOnly&&!this.altAudio){const i=(t===Fe.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(i,t,pe.MAIN)}}onLevelsUpdated(e,t){this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let i=this.startPosition;if(i>=0&&t<i){if(e.seeking){this.log(`could not seek to ${i}, already seeking at ${t}`);return}const r=Ge.getBuffered(e),o=(r.length?r.start(0):0)-i;o>0&&(o<this.config.maxBufferHole||o<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${o} to match buffer start`),i+=o,this.startPosition=i),this.log(`seek to target start position ${i} from current time ${t}`),e.currentTime=i}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(i=>{const{hls:r}=this;if(!i||this.fragContextChanged(e))return;t.fragmentError=0,this.state=J.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const n=e.stats;n.parsing.start=n.parsing.end=n.buffering.start=n.buffering.end=self.performance.now(),r.trigger(E.FRAG_LOADED,i),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const i="main",{hls:r}=this,{remuxResult:n,chunkMeta:o}=e,a=this.getCurrentContext(o);if(!a){this.resetWhenMissingContext(o);return}const{frag:A,part:l,level:c}=a,{video:h,text:u,id3:d,initSegment:g}=n,{details:f}=c,p=this.altAudio?void 0:n.audio;if(this.fragContextChanged(A)){this.fragmentTracker.removeFragment(A);return}if(this.state=J.PARSING,g){if(g!=null&&g.tracks){const Q=A.initSegment||A;this._bufferInitSegment(c,g.tracks,Q,o),r.trigger(E.FRAG_PARSING_INIT_SEGMENT,{frag:Q,id:i,tracks:g.tracks})}const y=g.initPTS,B=g.timescale;ce(y)&&(this.initPTS[A.cc]={baseTime:y,timescale:B},r.trigger(E.INIT_PTS_FOUND,{frag:A,id:i,initPTS:y,timescale:B}))}if(h&&f&&A.sn!=="initSegment"){const y=f.fragments[A.sn-1-f.startSN],B=A.sn===f.startSN,Q=!y||A.cc>y.cc;if(n.independent!==!1){const{startPTS:C,endPTS:T,startDTS:b,endDTS:L}=h;if(l)l.elementaryStreams[h.type]={startPTS:C,endPTS:T,startDTS:b,endDTS:L};else if(h.firstKeyFrame&&h.independent&&o.id===1&&!Q&&(this.couldBacktrack=!0),h.dropped&&h.independent){const R=this.getMainFwdBufferInfo(),O=(R?R.end:this.getLoadPosition())+this.config.maxBufferHole,k=h.firstKeyFramePTS?h.firstKeyFramePTS:C;if(!B&&O<k-this.config.maxBufferHole&&!Q){this.backtrack(A);return}else Q&&(A.gap=!0);A.setElementaryStreamInfo(h.type,A.start,T,A.start,L,!0)}A.setElementaryStreamInfo(h.type,C,T,b,L),this.backtrackFragment&&(this.backtrackFragment=A),this.bufferFragmentData(h,A,l,o,B||Q)}else if(B||Q)A.gap=!0;else{this.backtrack(A);return}}if(p){const{startPTS:y,endPTS:B,startDTS:Q,endDTS:C}=p;l&&(l.elementaryStreams[Fe.AUDIO]={startPTS:y,endPTS:B,startDTS:Q,endDTS:C}),A.setElementaryStreamInfo(Fe.AUDIO,y,B,Q,C),this.bufferFragmentData(p,A,l,o)}if(f&&d!=null&&(t=d.samples)!=null&&t.length){const y={id:i,frag:A,details:f,samples:d.samples};r.trigger(E.FRAG_PARSING_METADATA,y)}if(f&&u){const y={id:i,frag:A,details:f,samples:u.samples};r.trigger(E.FRAG_PARSING_USERDATA,y)}}_bufferInitSegment(e,t,i,r){if(this.state!==J.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:n,video:o,audiovideo:a}=t;if(n){let A=e.audioCodec;const l=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),n.metadata.channelCount!==1&&l.indexOf("firefox")===-1&&(A="mp4a.40.5")),l.indexOf("android")!==-1&&n.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log(`Android: force audio codec to ${A}`)),e.audioCodec&&e.audioCodec!==A&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${A}"`),n.levelCodec=A,n.id="main",this.log(`Init audio buffer, container:${n.container}, codecs[selected/level/parsed]=[${A||""}/${e.audioCodec||""}/${n.codec}]`)}o&&(o.levelCodec=e.videoCodec,o.id="main",this.log(`Init video buffer, container:${o.container}, codecs[level/parsed]=[${e.videoCodec||""}/${o.codec}]`)),a&&this.log(`Init audiovideo buffer, container:${a.container}, codecs[level/parsed]=[${e.attrs.CODECS||""}/${a.codec}]`),this.hls.trigger(E.BUFFER_CODECS,t),Object.keys(t).forEach(A=>{const c=t[A].initSegment;c!=null&&c.byteLength&&this.hls.trigger(E.BUFFER_APPENDING,{type:A,data:c,frag:i,part:null,chunkMeta:r,parent:i.type})}),this.tick()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,pe.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=J.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const i=e.currentTime;if(Ge.isBuffered(e,i)?t=this.getAppendedFrag(i):Ge.isBuffered(e,i+.1)&&(t=this.getAppendedFrag(i+.1)),t){this.backtrackFragment=null;const r=this.fragPlaying,n=t.level;(!r||t.sn!==r.sn||r.level!==n||t.urlId!==r.urlId)&&(this.fragPlaying=t,this.hls.trigger(E.FRAG_CHANGED,{frag:t}),(!r||r.level!==n)&&this.hls.trigger(E.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,i=this.currentFrag;if(i&&ce(t)&&ce(i.programDateTime)){const r=i.programDateTime+(t-i.start)*1e3;return new Date(r)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class gs{constructor(e,t=0,i=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=i}sample(e,t){const i=Math.pow(this.alpha_,e);this.estimate_=t*(1-i)+i*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class dE{constructor(e,t,i,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new gs(e),this.fast_=new gs(t),this.defaultTTFB_=r,this.ttfb_=new gs(e)}update(e,t){const{slow_:i,fast_:r,ttfb_:n}=this;i.halfLife!==e&&(this.slow_=new gs(e,i.getEstimate(),i.getTotalWeight())),r.halfLife!==t&&(this.fast_=new gs(t,r.getEstimate(),r.getTotalWeight())),n.halfLife!==e&&(this.ttfb_=new gs(e,n.getEstimate(),n.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const i=8*t,r=e/1e3,n=i/r;this.fast_.sample(r,n),this.slow_.sample(r,n)}sampleTTFB(e){const t=e/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(i,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}class gE{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=e;const t=e.config;this.bwEstimator=new dE(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(E.FRAG_LOADING,this.onFragLoading,this),e.on(E.FRAG_LOADED,this.onFragLoaded,this),e.on(E.FRAG_BUFFERED,this.onFragBuffered,this),e.on(E.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(E.LEVEL_LOADED,this.onLevelLoaded,this)}unregisterListeners(){const{hls:e}=this;e.off(E.FRAG_LOADING,this.onFragLoading,this),e.off(E.FRAG_LOADED,this.onFragLoaded,this),e.off(E.FRAG_BUFFERED,this.onFragBuffered,this),e.off(E.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(E.LEVEL_LOADED,this.onLevelLoaded,this)}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null}onFragLoading(e,t){var i;const r=t.frag;this.ignoreFragment(r)||(this.fragCurrent=r,this.partCurrent=(i=t.part)!=null?i:null,this.clearTimer(),this.timer=self.setInterval(this.onCheck,100))}onLevelSwitching(e,t){this.clearTimer()}getTimeToLoadFrag(e,t,i,r){const n=e+i/t,o=r?this.lastLevelLoadSec:0;return n+o}onLevelLoaded(e,t){const i=this.hls.config,{total:r,bwEstimate:n}=t.stats;ce(r)&&ce(n)&&(this.lastLevelLoadSec=8*r/n),t.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)}_abandonRulesCheck(){const{fragCurrent:e,partCurrent:t,hls:i}=this,{autoLevelEnabled:r,media:n}=i;if(!e||!n)return;const o=performance.now(),a=t?t.stats:e.stats,A=t?t.duration:e.duration,l=o-a.loading.start;if(a.aborted||a.loaded&&a.loaded===a.total||e.level===0){this.clearTimer(),this._nextAutoLevel=-1;return}if(!r||n.paused||!n.playbackRate||!n.readyState)return;const c=i.mainForwardBufferInfo;if(c===null)return;const h=this.bwEstimator.getEstimateTTFB(),u=Math.abs(n.playbackRate);if(l<=Math.max(h,1e3*(A/(u*2))))return;const d=c.len/u;if(d>=2*A/u)return;const g=a.loading.first?a.loading.first-a.loading.start:-1,f=a.loaded&&g>-1,p=this.bwEstimator.getEstimate(),{levels:y,minAutoLevel:B}=i,Q=y[e.level],C=a.total||Math.max(a.loaded,Math.round(A*Q.maxBitrate/8));let T=l-g;T<1&&f&&(T=Math.min(l,a.loaded*8/p));const b=f?a.loaded*1e3/T:0,L=b?(C-a.loaded)/b:C*8/p+h/1e3;if(L<=d)return;const R=b?b*8:p;let O=Number.POSITIVE_INFINITY,k;for(k=e.level-1;k>B;k--){const W=y[k].maxBitrate;if(O=this.getTimeToLoadFrag(h/1e3,R,A*W,!y[k].details),O<d)break}O>=L||O>A*10||(i.nextLoadLevel=k,f?this.bwEstimator.sample(l-Math.min(h,g),a.loaded):this.bwEstimator.sampleTTFB(l),this.clearTimer(),N.warn(`[abr] Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} is loading too slowly;
|
185
|
+
initSegmentChange: ${R}`);const k=new nE(i,r,t,a,c);this.configureTransmuxer(k)}if(this.frag=n,this.part=o,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:f,chunkMeta:l,state:O},e instanceof ArrayBuffer?[e]:[]);else if(d){const k=d.push(e,f,l,O);Bn(k)?(d.async=!0,k.then(W=>{this.handleTransmuxComplete(W)}).catch(W=>{this.transmuxerError(W,l,"transmuxer-interface push error")})):(d.async=!1,this.handleTransmuxComplete(k))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let i=t.flush(e);Bn(i)||t.async?(Bn(i)||(i=Promise.resolve(i)),i.then(n=>{this.handleFlushResult(n,e)}).catch(n=>{this.transmuxerError(n,e,"transmuxer-interface flush error")})):this.handleFlushResult(i,e)}}transmuxerError(e,t,i){this.hls&&(this.error=e,this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:i}))}handleFlushResult(e,t){e.forEach(i=>{this.handleTransmuxComplete(i)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data,i=this.hls;switch(t.event){case"init":{var r;const n=(r=this.workerContext)==null?void 0:r.objectURL;n&&self.URL.revokeObjectURL(n);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":N[t.data.logType]&&N[t.data.logType](t.data.message);break;default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,i.trigger(t.event,t.data);break}}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const AE=250,fa=2,lE=.1,cE=.05;class hE{constructor(e,t,i,r){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=e,this.media=t,this.fragmentTracker=i,this.hls=r}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:i,media:r,stalled:n}=this;if(r===null)return;const{currentTime:o,seeking:a}=r,A=this.seeking&&!a,l=!this.seeking&&a;if(this.seeking=a,o!==e){if(this.moved=!0,n!==null){if(this.stallReported){const y=self.performance.now()-n;N.warn(`playback not stuck anymore @${o}, after ${Math.round(y)}ms`),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if(l||A){this.stalled=null;return}if(r.paused&&!a||r.ended||r.playbackRate===0||!Ge.getBuffered(r).length)return;const c=Ge.bufferInfo(r,o,0),h=c.len>0,u=c.nextStart||0;if(!h&&!u)return;if(a){const y=c.len>fa,B=!u||t&&t.start<=o||u-o>fa&&!this.fragmentTracker.getPartialFragment(o);if(y||B)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var d;const y=Math.max(u,c.start||0)-o,B=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,C=(B==null||(d=B.details)==null?void 0:d.live)?B.details.targetduration*2:fa,T=this.fragmentTracker.getPartialFragment(o);if(y>0&&(y<=C||T)){this._trySkipBufferHole(T);return}}const g=self.performance.now();if(n===null){this.stalled=g;return}const f=g-n;if(!a&&f>=AE&&(this._reportStall(c),!this.media))return;const p=Ge.bufferInfo(r,o,i.maxBufferHole);this._tryFixBufferStall(p,f)}_tryFixBufferStall(e,t){const{config:i,fragmentTracker:r,media:n}=this;if(n===null)return;const o=n.currentTime,a=r.getPartialFragment(o);a&&(this._trySkipBufferHole(a)||!this.media)||(e.len>i.maxBufferHole||e.nextStart&&e.nextStart-o<i.maxBufferHole)&&t>i.highBufferWatchdogPeriod*1e3&&(N.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:i,stallReported:r}=this;if(!r&&i){this.stallReported=!0;const n=new Error(`Playback stalling at @${i.currentTime} due to low buffer (${JSON.stringify(e)})`);N.warn(n.message),t.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_STALLED_ERROR,fatal:!1,error:n,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:i,media:r}=this;if(r===null)return 0;const n=r.currentTime,o=Ge.bufferInfo(r,n,0),a=n<o.start?o.start:o.nextStart;if(a){const A=o.len<=t.maxBufferHole,l=o.len>0&&o.len<1&&r.readyState<3,c=a-n;if(c>0&&(A||l)){if(c>t.maxBufferHole){const{fragmentTracker:u}=this;let d=!1;if(n===0){const g=u.getAppendedFrag(0,pe.MAIN);g&&a<g.end&&(d=!0)}if(!d){const g=e||u.getAppendedFrag(n,pe.MAIN);if(g){let f=!1,p=g.end;for(;p<a;){const y=u.getPartialFragment(p);if(y)p+=y.duration;else{f=!0;break}}if(f)return 0}}}const h=Math.max(a+cE,n+lE);if(N.warn(`skipping hole, adjusting currentTime from ${n} to ${h}`),this.moved=!0,this.stalled=null,r.currentTime=h,e&&!e.gap){const u=new Error(`fragment loaded with buffer holes, seeking from ${n} to ${h}`);i.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:u,reason:u.message,frag:e})}return h}}return 0}_tryNudgeBuffer(){const{config:e,hls:t,media:i,nudgeRetry:r}=this;if(i===null)return;const n=i.currentTime;if(this.nudgeRetry++,r<e.nudgeMaxRetry){const o=n+(r+1)*e.nudgeOffset,a=new Error(`Nudging 'currentTime' from ${n} to ${o}`);N.warn(a.message),i.currentTime=o,t.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_NUDGE_ON_STALL,error:a,fatal:!1})}else{const o=new Error(`Playhead still not moving while enough data buffered @${n} after ${e.nudgeMaxRetry} nudges`);N.error(o.message),t.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_STALLED_ERROR,error:o,fatal:!0})}}}const uE=100;class dE extends ra{constructor(e,t,i){super(e,t,i,"[stream-controller]",pe.MAIN),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_PARSED,this.onManifestParsed,this),e.on(E.LEVEL_LOADING,this.onLevelLoading,this),e.on(E.LEVEL_LOADED,this.onLevelLoaded,this),e.on(E.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(E.ERROR,this.onError,this),e.on(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(E.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(E.BUFFER_CREATED,this.onBufferCreated,this),e.on(E.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(E.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_PARSED,this.onManifestParsed,this),e.off(E.LEVEL_LOADED,this.onLevelLoaded,this),e.off(E.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(E.ERROR,this.onError,this),e.off(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(E.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(E.BUFFER_CREATED,this.onBufferCreated,this),e.off(E.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(E.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),this.onMediaDetaching()}startLoad(e){if(this.levels){const{lastCurrentTime:t,hls:i}=this;if(this.stopLoad(),this.setInterval(uE),this.level=-1,!this.startFragRequested){let r=i.startLevel;r===-1&&(i.config.testBandwidth&&this.levels.length>1?(r=0,this.bitrateTest=!0):r=i.nextAutoLevel),this.level=i.nextLoadLevel=r,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=J.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=J.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case J.WAITING_LEVEL:{var e;const{levels:i,level:r}=this,n=i==null||(e=i[r])==null?void 0:e.details;if(n&&(!n.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(n))break;this.state=J.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=J.IDLE;break}break}case J.FRAG_LOADING_WAITING_RETRY:{var t;const i=self.performance.now(),r=this.retryDate;(!r||i>=r||(t=this.media)!=null&&t.seeking)&&(this.resetStartWhenNotLoaded(this.level),this.state=J.IDLE)}break}this.state===J.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:i,media:r}=this,{config:n,nextLoadLevel:o}=e;if(t===null||!r&&(this.startFragRequested||!n.startFragPrefetch)||this.altAudio&&this.audioOnly||!(i!=null&&i[o]))return;const a=i[o],A=this.getMainFwdBufferInfo();if(A===null)return;const l=this.getLevelDetails();if(l&&this._streamEnded(A,l)){const p={};this.altAudio&&(p.type="video"),this.hls.trigger(E.BUFFER_EOS,p),this.state=J.ENDED;return}e.loadLevel!==o&&e.manualLevel===-1&&this.log(`Adapting to level ${o} from level ${this.level}`),this.level=e.nextLoadLevel=o;const c=a.details;if(!c||this.state===J.WAITING_LEVEL||c.live&&this.levelLastLoaded!==o){this.level=o,this.state=J.WAITING_LEVEL;return}const h=A.len,u=this.getMaxBufferLength(a.maxBitrate);if(h>=u)return;this.backtrackFragment&&this.backtrackFragment.start>A.end&&(this.backtrackFragment=null);const d=this.backtrackFragment?this.backtrackFragment.start:A.end;let g=this.getNextFragment(d,c);if(this.couldBacktrack&&!this.fragPrevious&&g&&g.sn!=="initSegment"&&this.fragmentTracker.getState(g)!==it.OK){var f;const y=((f=this.backtrackFragment)!=null?f:g).sn-c.startSN,B=c.fragments[y-1];B&&g.cc===B.cc&&(g=B,this.fragmentTracker.removeFragment(B))}else this.backtrackFragment&&A.len&&(this.backtrackFragment=null);if(g&&this.isLoopLoading(g,d)){if(!g.gap){const y=this.audioOnly&&!this.altAudio?Me.AUDIO:Me.VIDEO,B=(y===Me.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;B&&this.afterBufferFlushed(B,y,pe.MAIN)}g=this.getNextFragmentLoopLoading(g,c,A,pe.MAIN,u)}g&&(g.initSegment&&!g.initSegment.data&&!this.bitrateTest&&(g=g.initSegment),this.loadFragment(g,a,d))}loadFragment(e,t,i){const r=this.fragmentTracker.getState(e);this.fragCurrent=e,r===it.NOT_LOADED||r===it.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,i)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,pe.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let i;const r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const n=this.getLevelDetails();if(n!=null&&n.live){const a=this.getMainFwdBufferInfo();if(!a||a.len<n.targetduration*2)return}if(!t.paused&&e){const a=this.hls.nextLoadLevel,A=e[a],l=this.fragLastKbps;l&&this.fragCurrent?i=this.fragCurrent.duration*A.maxBitrate/(1e3*l)+1:i=0}else i=0;const o=this.getBufferedFrag(t.currentTime+i);if(o){const a=this.followingBufferedFrag(o);if(a){this.abortCurrentFrag();const A=a.maxStartPTS?a.maxStartPTS:a.start,l=a.duration,c=Math.max(o.end,A+Math.min(Math.max(l-this.config.maxFragLookUpTolerance,l*.5),l*.75));this.flushMainBuffer(c,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case J.KEY_LOADING:case J.FRAG_LOADING:case J.FRAG_LOADING_WAITING_RETRY:case J.PARSING:case J.PARSED:this.state=J.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const i=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new hE(this.config,i,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;he(t)&&this.log(`Media seeked to ${t.toFixed(3)}`);const i=this.getMainFwdBufferInfo();if(i===null||i.len===0){this.warn(`Main forward buffer length on "seeked" event ${i?i.len:"empty"})`);return}this.tick()}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(E.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.levels=this.fragPlaying=this.backtrackFragment=null,this.altAudio=this.audioOnly=!1}onManifestParsed(e,t){let i=!1,r=!1,n;t.levels.forEach(o=>{n=o.audioCodec,n&&(n.indexOf("mp4a.40.2")!==-1&&(i=!0),n.indexOf("mp4a.40.5")!==-1&&(r=!0))}),this.audioCodecSwitch=i&&r&&!wp(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:i}=this;if(!i||this.state!==J.IDLE)return;const r=i[t.level];(!r.details||r.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(r.details))&&(this.state=J.WAITING_LEVEL)}onLevelLoaded(e,t){var i;const{levels:r}=this,n=t.level,o=t.details,a=o.totalduration;if(!r){this.warn(`Levels were reset while loading level ${n}`);return}this.log(`Level ${n} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${a}`);const A=r[n],l=this.fragCurrent;l&&(this.state===J.FRAG_LOADING||this.state===J.FRAG_LOADING_WAITING_RETRY)&&(l.level!==t.level||l.urlId!==A.urlId)&&l.loader&&this.abortCurrentFrag();let c=0;if(o.live||(i=A.details)!=null&&i.live){if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;c=this.alignPlaylists(o,A.details)}if(A.details=o,this.levelLastLoaded=n,this.hls.trigger(E.LEVEL_UPDATED,{details:o,level:n}),this.state===J.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=J.IDLE}this.startFragRequested?o.live&&this.synchronizeToLiveEdge(o):this.setStartPosition(o,c),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:i,part:r,payload:n}=e,{levels:o}=this;if(!o){this.warn(`Levels were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);return}const a=o[i.level],A=a.details;if(!A){this.warn(`Dropping fragment ${i.sn} of level ${i.level} after level details were reset`),this.fragmentTracker.removeFragment(i);return}const l=a.videoCodec,c=A.PTSKnown||!A.live,h=(t=i.initSegment)==null?void 0:t.data,u=this._getAudioCodec(a),d=this.transmuxer=this.transmuxer||new dh(this.hls,pe.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),g=r?r.index:-1,f=g!==-1,p=new ta(i.level,i.sn,i.stats.chunkCount,n.byteLength,g,f),y=this.initPTS[i.cc];d.push(n,h,u,l,i,r,A.totalduration,c,p,y)}onAudioTrackSwitching(e,t){const i=this.altAudio;if(!!!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const o=this.fragCurrent;o&&(this.log("Switching to main audio track, cancel main fragment load"),o.abortRequests(),this.fragmentTracker.removeFragment(o)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const n=this.hls;i&&(n.trigger(E.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),n.trigger(E.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const i=t.id,r=!!this.hls.audioTracks[i].url;if(r){const n=this.videoBuffer;n&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=r,this.tick()}onBufferCreated(e,t){const i=t.tracks;let r,n,o=!1;for(const a in i){const A=i[a];if(A.id==="main"){if(n=a,r=A,a==="video"){const l=i[a];l&&(this.videoBuffer=l.buffer)}}else o=!0}o&&r?(this.log(`Alternate track found, use ${n}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:i,part:r}=t;if(i&&i.type!==pe.MAIN)return;if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${r?" p: "+r.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}`),this.state===J.PARSED&&(this.state=J.IDLE);return}const n=r?r.stats:i.stats;this.fragLastKbps=Math.round(8*n.total/(n.buffering.end-n.loading.first)),i.sn!=="initSegment"&&(this.fragPrevious=i),this.fragBufferedComplete(i,r)}onError(e,t){var i;if(t.fatal){this.state=J.ERROR;return}switch(t.details){case Y.FRAG_GAP:case Y.FRAG_PARSING_ERROR:case Y.FRAG_DECRYPT_ERROR:case Y.FRAG_LOAD_ERROR:case Y.FRAG_LOAD_TIMEOUT:case Y.KEY_LOAD_ERROR:case Y.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(pe.MAIN,t);break;case Y.LEVEL_LOAD_ERROR:case Y.LEVEL_LOAD_TIMEOUT:case Y.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===J.WAITING_LEVEL&&((i=t.context)==null?void 0:i.type)===Re.LEVEL&&(this.state=J.IDLE);break;case Y.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case Y.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!Ge.getBuffered(e).length){const i=this.state!==J.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,i)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=J.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==Me.AUDIO||this.audioOnly&&!this.altAudio){const i=(t===Me.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(i,t,pe.MAIN)}}onLevelsUpdated(e,t){this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let i=this.startPosition;if(i>=0&&t<i){if(e.seeking){this.log(`could not seek to ${i}, already seeking at ${t}`);return}const r=Ge.getBuffered(e),o=(r.length?r.start(0):0)-i;o>0&&(o<this.config.maxBufferHole||o<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${o} to match buffer start`),i+=o,this.startPosition=i),this.log(`seek to target start position ${i} from current time ${t}`),e.currentTime=i}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(i=>{const{hls:r}=this;if(!i||this.fragContextChanged(e))return;t.fragmentError=0,this.state=J.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const n=e.stats;n.parsing.start=n.parsing.end=n.buffering.start=n.buffering.end=self.performance.now(),r.trigger(E.FRAG_LOADED,i),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const i="main",{hls:r}=this,{remuxResult:n,chunkMeta:o}=e,a=this.getCurrentContext(o);if(!a){this.resetWhenMissingContext(o);return}const{frag:A,part:l,level:c}=a,{video:h,text:u,id3:d,initSegment:g}=n,{details:f}=c,p=this.altAudio?void 0:n.audio;if(this.fragContextChanged(A)){this.fragmentTracker.removeFragment(A);return}if(this.state=J.PARSING,g){if(g!=null&&g.tracks){const Q=A.initSegment||A;this._bufferInitSegment(c,g.tracks,Q,o),r.trigger(E.FRAG_PARSING_INIT_SEGMENT,{frag:Q,id:i,tracks:g.tracks})}const y=g.initPTS,B=g.timescale;he(y)&&(this.initPTS[A.cc]={baseTime:y,timescale:B},r.trigger(E.INIT_PTS_FOUND,{frag:A,id:i,initPTS:y,timescale:B}))}if(h&&f&&A.sn!=="initSegment"){const y=f.fragments[A.sn-1-f.startSN],B=A.sn===f.startSN,Q=!y||A.cc>y.cc;if(n.independent!==!1){const{startPTS:C,endPTS:T,startDTS:b,endDTS:L}=h;if(l)l.elementaryStreams[h.type]={startPTS:C,endPTS:T,startDTS:b,endDTS:L};else if(h.firstKeyFrame&&h.independent&&o.id===1&&!Q&&(this.couldBacktrack=!0),h.dropped&&h.independent){const R=this.getMainFwdBufferInfo(),O=(R?R.end:this.getLoadPosition())+this.config.maxBufferHole,k=h.firstKeyFramePTS?h.firstKeyFramePTS:C;if(!B&&O<k-this.config.maxBufferHole&&!Q){this.backtrack(A);return}else Q&&(A.gap=!0);A.setElementaryStreamInfo(h.type,A.start,T,A.start,L,!0)}A.setElementaryStreamInfo(h.type,C,T,b,L),this.backtrackFragment&&(this.backtrackFragment=A),this.bufferFragmentData(h,A,l,o,B||Q)}else if(B||Q)A.gap=!0;else{this.backtrack(A);return}}if(p){const{startPTS:y,endPTS:B,startDTS:Q,endDTS:C}=p;l&&(l.elementaryStreams[Me.AUDIO]={startPTS:y,endPTS:B,startDTS:Q,endDTS:C}),A.setElementaryStreamInfo(Me.AUDIO,y,B,Q,C),this.bufferFragmentData(p,A,l,o)}if(f&&d!=null&&(t=d.samples)!=null&&t.length){const y={id:i,frag:A,details:f,samples:d.samples};r.trigger(E.FRAG_PARSING_METADATA,y)}if(f&&u){const y={id:i,frag:A,details:f,samples:u.samples};r.trigger(E.FRAG_PARSING_USERDATA,y)}}_bufferInitSegment(e,t,i,r){if(this.state!==J.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:n,video:o,audiovideo:a}=t;if(n){let A=e.audioCodec;const l=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),n.metadata.channelCount!==1&&l.indexOf("firefox")===-1&&(A="mp4a.40.5")),l.indexOf("android")!==-1&&n.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log(`Android: force audio codec to ${A}`)),e.audioCodec&&e.audioCodec!==A&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${A}"`),n.levelCodec=A,n.id="main",this.log(`Init audio buffer, container:${n.container}, codecs[selected/level/parsed]=[${A||""}/${e.audioCodec||""}/${n.codec}]`)}o&&(o.levelCodec=e.videoCodec,o.id="main",this.log(`Init video buffer, container:${o.container}, codecs[level/parsed]=[${e.videoCodec||""}/${o.codec}]`)),a&&this.log(`Init audiovideo buffer, container:${a.container}, codecs[level/parsed]=[${e.attrs.CODECS||""}/${a.codec}]`),this.hls.trigger(E.BUFFER_CODECS,t),Object.keys(t).forEach(A=>{const c=t[A].initSegment;c!=null&&c.byteLength&&this.hls.trigger(E.BUFFER_APPENDING,{type:A,data:c,frag:i,part:null,chunkMeta:r,parent:i.type})}),this.tick()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,pe.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=J.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const i=e.currentTime;if(Ge.isBuffered(e,i)?t=this.getAppendedFrag(i):Ge.isBuffered(e,i+.1)&&(t=this.getAppendedFrag(i+.1)),t){this.backtrackFragment=null;const r=this.fragPlaying,n=t.level;(!r||t.sn!==r.sn||r.level!==n||t.urlId!==r.urlId)&&(this.fragPlaying=t,this.hls.trigger(E.FRAG_CHANGED,{frag:t}),(!r||r.level!==n)&&this.hls.trigger(E.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,i=this.currentFrag;if(i&&he(t)&&he(i.programDateTime)){const r=i.programDateTime+(t-i.start)*1e3;return new Date(r)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class gs{constructor(e,t=0,i=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=i}sample(e,t){const i=Math.pow(this.alpha_,e);this.estimate_=t*(1-i)+i*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class gE{constructor(e,t,i,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new gs(e),this.fast_=new gs(t),this.defaultTTFB_=r,this.ttfb_=new gs(e)}update(e,t){const{slow_:i,fast_:r,ttfb_:n}=this;i.halfLife!==e&&(this.slow_=new gs(e,i.getEstimate(),i.getTotalWeight())),r.halfLife!==t&&(this.fast_=new gs(t,r.getEstimate(),r.getTotalWeight())),n.halfLife!==e&&(this.ttfb_=new gs(e,n.getEstimate(),n.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const i=8*t,r=e/1e3,n=i/r;this.fast_.sample(r,n),this.slow_.sample(r,n)}sampleTTFB(e){const t=e/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(i,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}class fE{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=e;const t=e.config;this.bwEstimator=new gE(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(E.FRAG_LOADING,this.onFragLoading,this),e.on(E.FRAG_LOADED,this.onFragLoaded,this),e.on(E.FRAG_BUFFERED,this.onFragBuffered,this),e.on(E.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(E.LEVEL_LOADED,this.onLevelLoaded,this)}unregisterListeners(){const{hls:e}=this;e.off(E.FRAG_LOADING,this.onFragLoading,this),e.off(E.FRAG_LOADED,this.onFragLoaded,this),e.off(E.FRAG_BUFFERED,this.onFragBuffered,this),e.off(E.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(E.LEVEL_LOADED,this.onLevelLoaded,this)}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null}onFragLoading(e,t){var i;const r=t.frag;this.ignoreFragment(r)||(this.fragCurrent=r,this.partCurrent=(i=t.part)!=null?i:null,this.clearTimer(),this.timer=self.setInterval(this.onCheck,100))}onLevelSwitching(e,t){this.clearTimer()}getTimeToLoadFrag(e,t,i,r){const n=e+i/t,o=r?this.lastLevelLoadSec:0;return n+o}onLevelLoaded(e,t){const i=this.hls.config,{total:r,bwEstimate:n}=t.stats;he(r)&&he(n)&&(this.lastLevelLoadSec=8*r/n),t.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)}_abandonRulesCheck(){const{fragCurrent:e,partCurrent:t,hls:i}=this,{autoLevelEnabled:r,media:n}=i;if(!e||!n)return;const o=performance.now(),a=t?t.stats:e.stats,A=t?t.duration:e.duration,l=o-a.loading.start;if(a.aborted||a.loaded&&a.loaded===a.total||e.level===0){this.clearTimer(),this._nextAutoLevel=-1;return}if(!r||n.paused||!n.playbackRate||!n.readyState)return;const c=i.mainForwardBufferInfo;if(c===null)return;const h=this.bwEstimator.getEstimateTTFB(),u=Math.abs(n.playbackRate);if(l<=Math.max(h,1e3*(A/(u*2))))return;const d=c.len/u;if(d>=2*A/u)return;const g=a.loading.first?a.loading.first-a.loading.start:-1,f=a.loaded&&g>-1,p=this.bwEstimator.getEstimate(),{levels:y,minAutoLevel:B}=i,Q=y[e.level],C=a.total||Math.max(a.loaded,Math.round(A*Q.maxBitrate/8));let T=l-g;T<1&&f&&(T=Math.min(l,a.loaded*8/p));const b=f?a.loaded*1e3/T:0,L=b?(C-a.loaded)/b:C*8/p+h/1e3;if(L<=d)return;const R=b?b*8:p;let O=Number.POSITIVE_INFINITY,k;for(k=e.level-1;k>B;k--){const W=y[k].maxBitrate;if(O=this.getTimeToLoadFrag(h/1e3,R,A*W,!y[k].details),O<d)break}O>=L||O>A*10||(i.nextLoadLevel=k,f?this.bwEstimator.sample(l-Math.min(h,g),a.loaded):this.bwEstimator.sampleTTFB(l),this.clearTimer(),N.warn(`[abr] Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} is loading too slowly;
|
186
186
|
Time to underbuffer: ${d.toFixed(3)} s
|
187
187
|
Estimated load time for current fragment: ${L.toFixed(3)} s
|
188
188
|
Estimated load time for down switch fragment: ${O.toFixed(3)} s
|
189
189
|
TTFB estimate: ${g}
|
190
|
-
Current BW estimate: ${
|
190
|
+
Current BW estimate: ${he(p)?(p/1024).toFixed(3):"Unknown"} Kb/s
|
191
191
|
New BW estimate: ${(this.bwEstimator.getEstimate()/1024).toFixed(3)} Kb/s
|
192
|
-
Aborting and switching to level ${k}`),e.loader&&(this.fragCurrent=this.partCurrent=null,e.abortRequests()),i.trigger(E.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:a}))}onFragLoaded(e,{frag:t,part:i}){const r=i?i.stats:t.stats;if(t.type===pe.MAIN&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){const n=i?i.duration:t.duration,o=this.hls.levels[t.level],a=(o.loaded?o.loaded.bytes:0)+r.loaded,A=(o.loaded?o.loaded.duration:0)+n;o.loaded={bytes:a,duration:A},o.realBitrate=Math.round(8*a/A)}if(t.bitrateTest){const n={stats:r,frag:t,part:i,id:t.type};this.onFragBuffered(E.FRAG_BUFFERED,n),t.bitrateTest=!1}}}onFragBuffered(e,t){const{frag:i,part:r}=t,n=r!=null&&r.stats.loaded?r.stats:i.stats;if(n.aborted||this.ignoreFragment(i))return;const o=n.parsing.end-n.loading.start-Math.min(n.loading.first-n.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(o,n.loaded),n.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=o/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==pe.MAIN||e.sn==="initSegment"}clearTimer(){self.clearInterval(this.timer)}get nextAutoLevel(){const e=this._nextAutoLevel,t=this.bwEstimator;if(e!==-1&&!t.canEstimate())return e;let i=this.getNextABRAutoLevel();if(e!==-1){const r=this.hls.levels;if(r.length>Math.max(e,i)&&r[e].loadError<=r[i].loadError)return e}return e!==-1&&(i=Math.min(e,i)),i}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:i}=this,{maxAutoLevel:r,config:n,minAutoLevel:o,media:a}=i,A=t?t.duration:e?e.duration:0,l=a&&a.playbackRate!==0?Math.abs(a.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,h=i.mainForwardBufferInfo,u=(h?h.len:0)/l;let d=this.findBestLevel(c,o,r,u,n.abrBandWidthFactor,n.abrBandWidthUpFactor);if(d>=0)return d;N.trace(`[abr] ${u?"rebuffering expected":"buffer is empty"}, finding optimal quality level`);let g=A?Math.min(A,n.maxStarvationDelay):n.maxStarvationDelay,f=n.abrBandWidthFactor,p=n.abrBandWidthUpFactor;if(!u){const y=this.bitrateTestDelay;y&&(g=(A?Math.min(A,n.maxLoadingDelay):n.maxLoadingDelay)-y,N.trace(`[abr] bitrate test took ${Math.round(1e3*y)}ms, set first fragment max fetchDuration to ${Math.round(1e3*g)} ms`),f=p=1)}return d=this.findBestLevel(c,o,r,u+g,f,p),Math.max(d,0)}findBestLevel(e,t,i,r,n,o){var a;const{fragCurrent:A,partCurrent:l,lastLoadedFragLevel:c}=this,{levels:h}=this.hls,u=h[c],d=!!(u!=null&&(a=u.details)!=null&&a.live),g=u==null?void 0:u.codecSet,f=l?l.duration:A?A.duration:0,p=this.bwEstimator.getEstimateTTFB()/1e3;let y=t,B=-1;for(let Q=i;Q>=t;Q--){const C=h[Q];if(!C||g&&C.codecSet!==g){C&&(y=Math.min(Q,y),B=Math.max(Q,B));continue}B!==-1&&N.trace(`[abr] Skipped level(s) ${y}-${B} with CODECS:"${h[B].attrs.CODECS}"; not compatible with "${u.attrs.CODECS}"`);const T=C.details,b=(l?T==null?void 0:T.partTarget:T==null?void 0:T.averagetargetduration)||f;let L;Q<=c?L=n*e:L=o*e;const R=h[Q].maxBitrate,O=this.getTimeToLoadFrag(p,L,R*b,T===void 0);if(N.trace(`[abr] level:${Q} adjustedbw-bitrate:${Math.round(L-R)} avgDuration:${b.toFixed(1)} maxFetchDuration:${r.toFixed(1)} fetchDuration:${O.toFixed(1)}`),L>R&&(O===0||!ce(O)||d&&!this.bitrateTestDelay||O<r))return Q}return-1}set nextAutoLevel(e){this._nextAutoLevel=e}}class dh{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let i;if(e.length)e.length===1?i=e[0]:i=fE(e,t);else return new Uint8Array(0);return this.reset(),i}reset(){this.chunks.length=0,this.dataLength=0}}function fE(s,e){const t=new Uint8Array(e);let i=0;for(let r=0;r<s.length;r++){const n=s[r];t.set(n,i),i+=n.length}return t}const gh=100;class pE extends ra{constructor(e,t,i){super(e,t,i,"[audio-stream-controller]",pe.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.LEVEL_LOADED,this.onLevelLoaded,this),e.on(E.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(E.ERROR,this.onError,this),e.on(E.BUFFER_RESET,this.onBufferReset,this),e.on(E.BUFFER_CREATED,this.onBufferCreated,this),e.on(E.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(E.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(E.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.LEVEL_LOADED,this.onLevelLoaded,this),e.off(E.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(E.ERROR,this.onError,this),e.off(E.BUFFER_RESET,this.onBufferReset,this),e.off(E.BUFFER_CREATED,this.onBufferCreated,this),e.off(E.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(E.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(E.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:i,initPTS:r,timescale:n}){if(i==="main"){const o=t.cc;this.initPTS[t.cc]={baseTime:r,timescale:n},this.log(`InitPTS for cc: ${o} found from main: ${r}`),this.videoTrackCC=o,this.state===J.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=J.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(gh),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=J.IDLE):(this.loadedmetadata=!1,this.state=J.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case J.IDLE:this.doTickIdle();break;case J.WAITING_TRACK:{var e;const{levels:i,trackId:r}=this,n=i==null||(e=i[r])==null?void 0:e.details;if(n){if(this.waitForCdnTuneIn(n))break;this.state=J.WAITING_INIT_PTS}break}case J.FRAG_LOADING_WAITING_RETRY:{var t;const i=performance.now(),r=this.retryDate;(!r||i>=r||(t=this.media)!=null&&t.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=J.IDLE);break}case J.WAITING_INIT_PTS:{const i=this.waitingData;if(i){const{frag:r,part:n,cache:o,complete:a}=i;if(this.initPTS[r.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=J.FRAG_LOADING;const A=o.flush(),l={frag:r,part:n,payload:A,networkDetails:null};this._handleFragmentLoadProgress(l),a&&super._handleFragmentLoadComplete(l)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${r.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const A=this.getLoadPosition(),l=Ge.bufferInfo(this.mediaBuffer,A,this.config.maxBufferHole);zo(l.end,this.config.maxFragLookUpTolerance,r)<0&&(this.log(`Waiting fragment cc (${r.cc}) @ ${r.start} cancelled because another fragment at ${l.end} is needed`),this.clearWaitingFragment())}}else this.state=J.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=J.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:i,trackId:r}=this,n=e.config;if(!(t!=null&&t[r])||!i&&(this.startFragRequested||!n.startFragPrefetch))return;const o=t[r],a=o.details;if(!a||a.live&&this.levelLastLoaded!==r||this.waitForCdnTuneIn(a)){this.state=J.WAITING_TRACK;return}const A=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&A&&(this.bufferFlushed=!1,this.afterBufferFlushed(A,Fe.AUDIO,pe.AUDIO));const l=this.getFwdBufferInfo(A,pe.AUDIO);if(l===null)return;const{bufferedTrack:c,switchingTrack:h}=this;if(!h&&this._streamEnded(l,a)){e.trigger(E.BUFFER_EOS,{type:"audio"}),this.state=J.ENDED;return}const u=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,pe.MAIN),d=l.len,g=this.getMaxBufferLength(u==null?void 0:u.len);if(d>=g&&!h)return;const p=a.fragments[0].start;let y=l.end;if(h&&i){const T=this.getLoadPosition();c&&h.attrs!==c.attrs&&(y=T),a.PTSKnown&&T<p&&(l.end>p||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=p+.05)}let B=this.getNextFragment(y,a),Q=!1;if(B&&this.isLoopLoading(B,y)&&(Q=!!B.gap,B=this.getNextFragmentLoopLoading(B,a,l,pe.MAIN,g)),!B){this.bufferFlushed=!0;return}const C=u&&B.start>u.end+a.targetduration;if(C||!(u!=null&&u.len)&&l.len){const T=this.getAppendedFrag(B.start,pe.MAIN);if(T===null||(Q||(Q=!!T.gap||!!C&&u.len===0),C&&!Q||Q&&l.nextStart&&l.nextStart<T.end))return}this.loadFragment(B,o,y)}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.min(Math.max(t,e),this.config.maxMaxBufferLength):t}onMediaDetaching(){this.videoBuffer=null,super.onMediaDetaching()}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(i=>new or(i))}onAudioTrackSwitching(e,t){const i=!!t.url;this.trackId=t.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),i?this.setInterval(gh):this.resetTransmuxer(),i?(this.switchingTrack=t,this.state=J.IDLE):(this.switchingTrack=null,this.bufferedTrack=t,this.state=J.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(E.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var i;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:r}=this,{details:n,id:o}=t;if(!r){this.warn(`Audio tracks were reset while loading level ${o}`);return}this.log(`Track ${o} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""},duration:${n.totalduration}`);const a=r[o];let A=0;if(n.live||(i=a.details)!=null&&i.live){this.checkLiveUpdate(n);const l=this.mainDetails;if(n.deltaUpdateFailed||!l)return;!a.details&&n.hasProgramDateTime&&l.hasProgramDateTime?(Kc(n,l),A=n.fragments[0].start):A=this.alignPlaylists(n,a.details)}a.details=n,this.levelLastLoaded=o,!this.startFragRequested&&(this.mainDetails||!n.live)&&this.setStartPosition(a.details,A),this.state===J.WAITING_TRACK&&!this.waitForCdnTuneIn(n)&&(this.state=J.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:i,part:r,payload:n}=e,{config:o,trackId:a,levels:A}=this;if(!A){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);return}const l=A[a];if(!l){this.warn("Audio track is undefined on fragment load progress");return}const c=l.details;if(!c){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(i.start);return}const h=o.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let u=this.transmuxer;u||(u=this.transmuxer=new uh(this.hls,pe.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const d=this.initPTS[i.cc],g=(t=i.initSegment)==null?void 0:t.data;if(d!==void 0){const p=r?r.index:-1,y=p!==-1,B=new ta(i.level,i.sn,i.stats.chunkCount,n.byteLength,p,y);u.push(n,g,h,"",i,r,c.totalduration,!1,B,d)}else{this.log(`Unknown video PTS for cc ${i.cc}, waiting for video PTS before demuxing audio frag ${i.sn} of [${c.startSN} ,${c.endSN}],track ${a}`);const{cache:f}=this.waitingData=this.waitingData||{frag:i,part:r,cache:new dh,complete:!1};f.push(new Uint8Array(n)),this.waitingVideoCC=this.videoTrackCC,this.state=J.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const i=t.tracks.audio;i&&(this.mediaBuffer=i.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:i,part:r}=t;if(i.type!==pe.AUDIO){if(!this.loadedmetadata&&i.type===pe.MAIN){const n=this.videoBuffer||this.media;n&&Ge.getBuffered(n).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${r?" p: "+r.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(i.sn!=="initSegment"){this.fragPrevious=i;const n=this.switchingTrack;n&&(this.bufferedTrack=n,this.switchingTrack=null,this.hls.trigger(E.AUDIO_TRACK_SWITCHED,vt({},n)))}this.fragBufferedComplete(i,r)}onError(e,t){var i;if(t.fatal){this.state=J.ERROR;return}switch(t.details){case Y.FRAG_GAP:case Y.FRAG_PARSING_ERROR:case Y.FRAG_DECRYPT_ERROR:case Y.FRAG_LOAD_ERROR:case Y.FRAG_LOAD_TIMEOUT:case Y.KEY_LOAD_ERROR:case Y.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(pe.AUDIO,t);break;case Y.AUDIO_TRACK_LOAD_ERROR:case Y.AUDIO_TRACK_LOAD_TIMEOUT:case Y.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===J.WAITING_TRACK&&((i=t.context)==null?void 0:i.type)===De.AUDIO_TRACK&&(this.state=J.IDLE);break;case Y.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case Y.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushed(e,{type:t}){t===Fe.AUDIO&&(this.bufferFlushed=!0,this.state===J.ENDED&&(this.state=J.IDLE))}_handleTransmuxComplete(e){var t;const i="audio",{hls:r}=this,{remuxResult:n,chunkMeta:o}=e,a=this.getCurrentContext(o);if(!a){this.resetWhenMissingContext(o);return}const{frag:A,part:l,level:c}=a,{details:h}=c,{audio:u,text:d,id3:g,initSegment:f}=n;if(this.fragContextChanged(A)||!h){this.fragmentTracker.removeFragment(A);return}if(this.state=J.PARSING,this.switchingTrack&&u&&this.completeAudioSwitch(this.switchingTrack),f!=null&&f.tracks){const p=A.initSegment||A;this._bufferInitSegment(f.tracks,p,o),r.trigger(E.FRAG_PARSING_INIT_SEGMENT,{frag:p,id:i,tracks:f.tracks})}if(u){const{startPTS:p,endPTS:y,startDTS:B,endDTS:Q}=u;l&&(l.elementaryStreams[Fe.AUDIO]={startPTS:p,endPTS:y,startDTS:B,endDTS:Q}),A.setElementaryStreamInfo(Fe.AUDIO,p,y,B,Q),this.bufferFragmentData(u,A,l,o)}if(g!=null&&(t=g.samples)!=null&&t.length){const p=Ze({id:i,frag:A,details:h},g);r.trigger(E.FRAG_PARSING_METADATA,p)}if(d){const p=Ze({id:i,frag:A,details:h},d);r.trigger(E.FRAG_PARSING_USERDATA,p)}}_bufferInitSegment(e,t,i){if(this.state!==J.PARSING)return;e.video&&delete e.video;const r=e.audio;if(!r)return;r.levelCodec=r.codec,r.id="audio",this.log(`Init audio buffer, container:${r.container}, codecs[parsed]=[${r.codec}]`),this.hls.trigger(E.BUFFER_CODECS,e);const n=r.initSegment;if(n!=null&&n.byteLength){const o={type:"audio",frag:t,part:null,chunkMeta:i,parent:t.type,data:n};this.hls.trigger(E.BUFFER_APPENDING,o)}this.tick()}loadFragment(e,t,i){const r=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||r===it.NOT_LOADED||r===it.PARTIAL){var n;e.sn==="initSegment"?this._loadInitSegment(e,t):(n=t.details)!=null&&n.live&&!this.initPTS[e.cc]?(this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=J.WAITING_INIT_PTS):(this.startFragRequested=!0,super.loadFragment(e,t,i))}else this.clearTrackerIfNeeded(e)}completeAudioSwitch(e){const{hls:t,media:i,bufferedTrack:r}=this,n=r==null?void 0:r.attrs,o=e.attrs;i&&n&&(n.CHANNELS!==o.CHANNELS||n.NAME!==o.NAME||n.LANGUAGE!==o.LANGUAGE)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(E.AUDIO_TRACK_SWITCHED,vt({},e))}}class EE extends Zo{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_PARSED,this.onManifestParsed,this),e.on(E.LEVEL_LOADING,this.onLevelLoading,this),e.on(E.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_PARSED,this.onManifestParsed,this),e.off(E.LEVEL_LOADING,this.onLevelLoading,this),e.off(E.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(E.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:i,groupId:r,details:n}=t,o=this.tracksInGroup[i];if(!o||o.groupId!==r){this.warn(`Track with id:${i} and group:${r} not found in active group ${o.groupId}`);return}const a=o.details;o.details=t.details,this.log(`audio-track ${i} "${o.name}" lang:${o.lang} group:${r} loaded [${n.startSN}-${n.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!(t!=null&&t.audioGroupIds))return;const i=t.audioGroupIds[t.urlId];if(this.groupId!==i){this.groupId=i||null;const r=this.tracks.filter(o=>!i||o.groupId===i);this.selectDefaultTrack&&!r.some(o=>o.default)&&(this.selectDefaultTrack=!1),this.tracksInGroup=r;const n={audioTracks:r};this.log(`Updating audio tracks, ${r.length} track(s) found in group:${i}`),this.hls.trigger(E.AUDIO_TRACKS_UPDATED,n),this.selectInitialTrack()}else this.shouldReloadPlaylist(this.currentTrack)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===De.AUDIO_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&(this.requestScheduled=-1,this.checkRetry(t))}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();const i=this.currentTrack;t[this.trackId];const r=t[e],{groupId:n,name:o}=r;if(this.log(`Switching to audio-track ${e} "${o}" lang:${r.lang} group:${n}`),this.trackId=e,this.currentTrack=r,this.selectDefaultTrack=!1,this.hls.trigger(E.AUDIO_TRACK_SWITCHING,vt({},r)),r.details&&!r.details.live)return;const a=this.switchParams(r.url,i==null?void 0:i.details);this.loadPlaylist(a)}selectInitialTrack(){const e=this.tracksInGroup,t=this.findTrackId(this.currentTrack)|this.findTrackId(null);if(t!==-1)this.setAudioTrack(t);else{const i=new Error(`No track found for running audio group-ID: ${this.groupId} track count: ${e.length}`);this.warn(i.message),this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:i})}}findTrackId(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const r=t[i];if((!this.selectDefaultTrack||r.default)&&(!e||e.attrs["STABLE-RENDITION-ID"]!==void 0&&e.attrs["STABLE-RENDITION-ID"]===r.attrs["STABLE-RENDITION-ID"]||e.name===r.name&&e.lang===r.lang))return r.id}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.tracksInGroup[this.trackId];if(this.shouldLoadPlaylist(t)){const i=t.id,r=t.groupId;let n=t.url;if(e)try{n=e.addDirectives(n)}catch(o){this.warn(`Could not construct new URL with HLS Delivery Directives: ${o}`)}this.log(`loading audio-track playlist ${i} "${t.name}" lang:${t.lang} group:${r}`),this.clearTimer(),this.hls.trigger(E.AUDIO_TRACK_LOADING,{url:n,id:i,groupId:r,deliveryDirectives:e||null})}}}function fh(s,e){if(s.length!==e.length)return!1;for(let t=0;t<s.length;t++)if(!IE(s[t].attrs,e[t].attrs))return!1;return!0}function IE(s,e){const t=s["STABLE-RENDITION-ID"];return t?t===e["STABLE-RENDITION-ID"]:!["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED"].some(i=>s[i]!==e[i])}const ph=500;class mE extends ra{constructor(e,t,i){super(e,t,i,"[subtitle-stream-controller]",pe.SUBTITLE),this.levels=[],this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.LEVEL_LOADED,this.onLevelLoaded,this),e.on(E.ERROR,this.onError,this),e.on(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(E.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(E.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(E.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.LEVEL_LOADED,this.onLevelLoaded,this),e.off(E.ERROR,this.onError,this),e.off(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(E.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(E.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(E.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=J.IDLE,this.setInterval(ph),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:i,success:r}=t;if(this.fragPrevious=i,this.state=J.IDLE,!r)return;const n=this.tracksBuffered[this.currentTrackId];if(!n)return;let o;const a=i.start;for(let l=0;l<n.length;l++)if(a>=n[l].start&&a<=n[l].end){o=n[l];break}const A=i.start+i.duration;o?o.end=A:(o={start:a,end:A},n.push(o)),this.fragmentTracker.fragBuffered(i)}onBufferFlushing(e,t){const{startOffset:i,endOffset:r}=t;if(i===0&&r!==Number.POSITIVE_INFINITY){const n=r-1;if(n<=0)return;t.endOffsetSubtitles=Math.max(0,n),this.tracksBuffered.forEach(o=>{for(let a=0;a<o.length;){if(o[a].end<=n){o.shift();continue}else if(o[a].start<n)o[a].start=n;else break;a++}}),this.fragmentTracker.removeFragmentsInRange(i,n,pe.SUBTITLE)}}onFragBuffered(e,t){if(!this.loadedmetadata&&t.frag.type===pe.MAIN){var i;(i=this.media)!=null&&i.buffered.length&&(this.loadedmetadata=!0)}}onError(e,t){const i=t.frag;(i==null?void 0:i.type)===pe.SUBTITLE&&(this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==J.STOPPED&&(this.state=J.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(fh(this.levels,t)){this.levels=t.map(i=>new or(i));return}this.tracksBuffered=[],this.levels=t.map(i=>{const r=new or(i);return this.tracksBuffered[r.id]=[],r}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,pe.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){if(this.currentTrackId=t.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(ph)}onSubtitleTrackLoaded(e,t){var i;const{details:r,id:n}=t,{currentTrackId:o,levels:a}=this;if(!a.length)return;const A=a[o];if(n>=a.length||n!==o||!A)return;this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(r.live||(i=A.details)!=null&&i.live){const c=this.mainDetails;if(r.deltaUpdateFailed||!c)return;const h=c.fragments[0];A.details?(l=this.alignPlaylists(r,A.details),l===0&&h&&(l=h.start,jo(r,l))):r.hasProgramDateTime&&c.hasProgramDateTime?(Kc(r,c),l=r.fragments[0].start):h&&(l=h.start,jo(r,l))}A.details=r,this.levelLastLoaded=n,!this.startFragRequested&&(this.mainDetails||!r.live)&&this.setStartPosition(A.details,l),this.tick(),r.live&&!this.fragCurrent&&this.media&&this.state===J.IDLE&&(ar(null,r.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),A.details=void 0))}_handleFragmentLoadComplete(e){const{frag:t,payload:i}=e,r=t.decryptdata,n=this.hls;if(!this.fragContextChanged(t)&&i&&i.byteLength>0&&r&&r.key&&r.iv&&r.method==="AES-128"){const o=performance.now();this.decrypter.decrypt(new Uint8Array(i),r.key.buffer,r.iv.buffer).catch(a=>{throw n.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_DECRYPT_ERROR,fatal:!1,error:a,reason:a.message,frag:t}),a}).then(a=>{const A=performance.now();n.trigger(E.FRAG_DECRYPTED,{frag:t,payload:a,stats:{tstart:o,tdecrypt:A}})}).catch(a=>{this.warn(`${a.name}: ${a.message}`),this.state=J.IDLE})}}doTick(){if(!this.media){this.state=J.IDLE;return}if(this.state===J.IDLE){const{currentTrackId:e,levels:t}=this,i=t[e];if(!t.length||!i||!i.details)return;const{config:r}=this,n=this.getLoadPosition(),o=Ge.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],n,r.maxBufferHole),{end:a,len:A}=o,l=this.getFwdBufferInfo(this.media,pe.MAIN),c=i.details,h=this.getMaxBufferLength(l==null?void 0:l.len)+c.levelTargetDuration;if(A>h)return;const u=c.fragments,d=u.length,g=c.edge;let f=null;const p=this.fragPrevious;if(a<g){const y=r.maxFragLookUpTolerance,B=a>g-y?0:y;f=ar(p,u,Math.max(u[0].start,a),B),!f&&p&&p.start<u[0].start&&(f=u[0])}else f=u[d-1];if(!f)return;if(f=this.mapToInitFragWhenRequired(f),f.sn!=="initSegment"){const y=f.sn-c.startSN,B=u[y-1];B&&B.cc===f.cc&&this.fragmentTracker.getState(B)===it.NOT_LOADED&&(f=B)}this.fragmentTracker.getState(f)===it.NOT_LOADED&&this.loadFragment(f,i,a)}}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.max(t,e):t}loadFragment(e,t,i){this.fragCurrent=e,e.sn==="initSegment"?this._loadInitSegment(e,t):(this.startFragRequested=!0,super.loadFragment(e,t,i))}get mediaBufferTimeRanges(){return new CE(this.tracksBuffered[this.currentTrackId]||[])}}class CE{constructor(e){this.buffered=void 0;const t=(i,r,n)=>{if(r=r>>>0,r>n-1)throw new DOMException(`Failed to execute '${i}' on 'TimeRanges': The index provided (${r}) is greater than the maximum bound (${n})`);return e[r][i]};this.buffered={get length(){return e.length},end(i){return t("end",i,e.length)},start(i){return t("start",i,e.length)}}}}class yE extends Zo{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.trackChangeListener=()=>this.onTextTracksChanged(),this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes(this.trackId)}registerListeners(){const{hls:e}=this;e.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_PARSED,this.onManifestParsed,this),e.on(E.LEVEL_LOADING,this.onLevelLoading,this),e.on(E.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_PARSED,this.onManifestParsed,this),e.off(E.LEVEL_LOADING,this.onLevelLoading,this),e.off(E.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(E.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.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))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),pa(this.media.textTracks).forEach(t=>{hs(t)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:i,details:r}=t,{trackId:n}=this,o=this.tracksInGroup[n];if(!o){this.warn(`Invalid subtitle track id ${i}`);return}const a=o.details;o.details=t.details,this.log(`subtitle track ${i} loaded [${r.startSN}-${r.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!(t!=null&&t.textGroupIds))return;const i=t.textGroupIds[t.urlId],r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;if(this.groupId!==i){const n=this.tracks.filter(A=>!i||A.groupId===i);this.tracksInGroup=n;const o=this.findTrackId(r==null?void 0:r.name)||this.findTrackId();this.groupId=i||null;const a={subtitleTracks:n};this.log(`Updating subtitle tracks, ${n.length} track(s) found in "${i}" group-id`),this.hls.trigger(E.SUBTITLE_TRACKS_UPDATED,a),o!==-1&&this.setSubtitleTrack(o,r)}else this.shouldReloadPlaylist(r)&&this.setSubtitleTrack(this.trackId,r)}findTrackId(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const r=t[i];if((!this.selectDefaultTrack||r.default)&&(!e||e===r.name))return r.id}return-1}onError(e,t){t.fatal||!t.context||t.context.type===De.SUBTITLE_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.checkRetry(t)}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1;const t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}loadPlaylist(e){super.loadPlaylist();const t=this.tracksInGroup[this.trackId];if(this.shouldLoadPlaylist(t)){const i=t.id,r=t.groupId;let n=t.url;if(e)try{n=e.addDirectives(n)}catch(o){this.warn(`Could not construct new URL with HLS Delivery Directives: ${o}`)}this.log(`Loading subtitle playlist for id ${i}`),this.hls.trigger(E.SUBTITLE_TRACK_LOADING,{url:n,id:i,groupId:r,deliveryDirectives:e||null})}}toggleTrackModes(e){const{media:t,trackId:i}=this;if(!t)return;const r=pa(t.textTracks),n=r.filter(a=>a.groupId===this.groupId);if(e===-1)[].slice.call(r).forEach(a=>{a.mode="disabled"});else{const a=n[i];a&&(a.mode="disabled")}const o=n[e];o&&(o.mode=this.subtitleDisplay?"showing":"hidden")}setSubtitleTrack(e,t){var i;const r=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(e===-1||(i=r[e])!=null&&i.details)||e<-1||e>=r.length)return;this.clearTimer();const n=r[e];if(this.log(`Switching to subtitle-track ${e}`+(n?` "${n.name}" lang:${n.lang} group:${n.groupId}`:"")),this.trackId=e,n){const{id:o,groupId:a="",name:A,type:l,url:c}=n;this.hls.trigger(E.SUBTITLE_TRACK_SWITCH,{id:o,groupId:a,name:A,type:l,url:c});const h=this.switchParams(n.url,t==null?void 0:t.details);this.loadPlaylist(h)}else this.hls.trigger(E.SUBTITLE_TRACK_SWITCH,{id:e})}onTextTracksChanged(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=-1;const t=pa(this.media.textTracks);for(let i=0;i<t.length;i++)if(t[i].mode==="hidden")e=i;else if(t[i].mode==="showing"){e=i;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)}}function pa(s){const e=[];for(let t=0;t<s.length;t++){const i=s[t];(i.kind==="subtitles"||i.kind==="captions")&&i.label&&e.push(s[t])}return e}class BE{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t){const i=this.queues[t];i.push(e),i.length===1&&this.buffers[t]&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const i=new Promise(n=>{t=n}),r={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(r,e),i}executeNext(e){const{buffers:t,queues:i}=this,r=t[e],n=i[e];if(n.length){const o=n[0];try{o.execute()}catch(a){N.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),o.onError(a),r!=null&&r.updating||(n.shift(),this.executeNext(e))}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const Eh=hn(),Ih=/([ha]vc.)(?:\.[^.,]+)+/;class vE{constructor(e){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=()=>{const{media:t,mediaSource:i}=this;N.log("[buffer-controller]: Media source opened"),t&&(t.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(E.MEDIA_ATTACHED,{media:t})),i&&i.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{N.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=()=>{N.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=()=>{const{media:t,_objectUrl:i}=this;t&&t.src!==i&&N.error(`Media element src was set while attaching MediaSource (${i} > ${t.src})`)},this.hls=e,this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null}registerListeners(){const{hls:e}=this;e.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_PARSED,this.onManifestParsed,this),e.on(E.BUFFER_RESET,this.onBufferReset,this),e.on(E.BUFFER_APPENDING,this.onBufferAppending,this),e.on(E.BUFFER_CODECS,this.onBufferCodecs,this),e.on(E.BUFFER_EOS,this.onBufferEos,this),e.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(E.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(E.FRAG_PARSED,this.onFragParsed,this),e.on(E.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_PARSED,this.onManifestParsed,this),e.off(E.BUFFER_RESET,this.onBufferReset,this),e.off(E.BUFFER_APPENDING,this.onBufferAppending,this),e.off(E.BUFFER_CODECS,this.onBufferCodecs,this),e.off(E.BUFFER_EOS,this.onBufferEos,this),e.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(E.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(E.FRAG_PARSED,this.onFragParsed,this),e.off(E.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new BE(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,N.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const i=this.media=t.media;if(i&&Eh){const r=this.mediaSource=new Eh;r.addEventListener("sourceopen",this._onMediaSourceOpen),r.addEventListener("sourceended",this._onMediaSourceEnded),r.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(r),this._objectUrl=i.src,i.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:i}=this;if(t){if(N.log("[buffer-controller]: media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(r){N.warn(`[buffer-controller]: onMediaDetaching: ${r.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(e.removeEventListener("emptied",this._onMediaEmptied),i&&self.URL.revokeObjectURL(i),e.src===i?(e.removeAttribute("src"),e.load()):N.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(E.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{const t=this.sourceBuffer[e];try{t&&(this.removeBufferListeners(e),this.mediaSource&&this.mediaSource.removeSourceBuffer(t),this.sourceBuffer[e]=void 0)}catch(i){N.warn(`[buffer-controller]: Failed to reset the ${e} buffer`,i)}}),this._initSourceBuffer()}onBufferCodecs(e,t){const i=this.getSourceBufferTypes().length;Object.keys(t).forEach(r=>{if(i){const n=this.tracks[r];if(n&&typeof n.buffer.changeType=="function"){const{id:o,codec:a,levelCodec:A,container:l,metadata:c}=t[r],h=(n.levelCodec||n.codec).replace(Ih,"$1"),u=(A||a).replace(Ih,"$1");if(h!==u){const d=`${l};codecs=${A||a}`;this.appendChangeType(r,d),N.log(`[buffer-controller]: switching codec ${h} to ${u}`),this.tracks[r]={buffer:n.buffer,codec:a,container:l,levelCodec:A,metadata:c,id:o}}}}else this.pendingTracks[r]=t[r]}),!i&&(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())}appendChangeType(e,t){const{operationQueue:i}=this,r={execute:()=>{const n=this.sourceBuffer[e];n&&(N.log(`[buffer-controller]: changing ${e} sourceBuffer type to ${t}`),n.changeType(t)),i.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:n=>{N.warn(`[buffer-controller]: Failed to change ${e} SourceBuffer type`,n)}};i.append(r,e)}onBufferAppending(e,t){const{hls:i,operationQueue:r,tracks:n}=this,{data:o,type:a,frag:A,part:l,chunkMeta:c}=t,h=c.buffering[a],u=self.performance.now();h.start=u;const d=A.stats.buffering,g=l?l.stats.buffering:null;d.start===0&&(d.start=u),g&&g.start===0&&(g.start=u);const f=n.audio;let p=!1;a==="audio"&&(f==null?void 0:f.container)==="audio/mpeg"&&(p=!this.lastMpegAudioChunk||c.id===1||this.lastMpegAudioChunk.sn!==c.sn,this.lastMpegAudioChunk=c);const y=A.start,B={execute:()=>{if(h.executeStart=self.performance.now(),p){const Q=this.sourceBuffer[a];if(Q){const C=y-Q.timestampOffset;Math.abs(C)>=.1&&(N.log(`[buffer-controller]: Updating audio SourceBuffer timestampOffset to ${y} (delta: ${C}) sn: ${A.sn})`),Q.timestampOffset=y)}}this.appendExecutor(o,a)},onStart:()=>{},onComplete:()=>{const Q=self.performance.now();h.executeEnd=h.end=Q,d.first===0&&(d.first=Q),g&&g.first===0&&(g.first=Q);const{sourceBuffer:C}=this,T={};for(const b in C)T[b]=Ge.getBuffered(C[b]);this.appendError=0,this.hls.trigger(E.BUFFER_APPENDED,{type:a,frag:A,part:l,chunkMeta:c,parent:A.type,timeRanges:T})},onError:Q=>{N.error(`[buffer-controller]: Error encountered while trying to append to the ${a} SourceBuffer`,Q);const C={type:ge.MEDIA_ERROR,parent:A.type,details:Y.BUFFER_APPEND_ERROR,frag:A,part:l,chunkMeta:c,error:Q,err:Q,fatal:!1};Q.code===DOMException.QUOTA_EXCEEDED_ERR?C.details=Y.BUFFER_FULL_ERROR:(this.appendError++,C.details=Y.BUFFER_APPEND_ERROR,this.appendError>i.config.appendErrorMaxRetry&&(N.error(`[buffer-controller]: Failed ${i.config.appendErrorMaxRetry} times to append segment in sourceBuffer`),C.fatal=!0)),i.trigger(E.ERROR,C)}};r.append(B,a)}onBufferFlushing(e,t){const{operationQueue:i}=this,r=n=>({execute:this.removeExecutor.bind(this,n,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(E.BUFFER_FLUSHED,{type:n})},onError:o=>{N.warn(`[buffer-controller]: Failed to remove from ${n} SourceBuffer`,o)}});t.type?i.append(r(t.type),t.type):this.getSourceBufferTypes().forEach(n=>{i.append(r(n),n)})}onFragParsed(e,t){const{frag:i,part:r}=t,n=[],o=r?r.elementaryStreams:i.elementaryStreams;o[Fe.AUDIOVIDEO]?n.push("audiovideo"):(o[Fe.AUDIO]&&n.push("audio"),o[Fe.VIDEO]&&n.push("video"));const a=()=>{const A=self.performance.now();i.stats.buffering.end=A,r&&(r.stats.buffering.end=A);const l=r?r.stats:i.stats;this.hls.trigger(E.FRAG_BUFFERED,{frag:i,part:r,stats:l,id:i.type})};n.length===0&&N.warn(`Fragments must have at least one ElementaryStreamType set. type: ${i.type} level: ${i.level} sn: ${i.sn}`),this.blockBuffers(a,n)}onFragChanged(e,t){this.flushBackBuffer()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((r,n)=>{const o=this.sourceBuffer[n];return o&&(!t.type||t.type===n)&&(o.ending=!0,o.ended||(o.ended=!0,N.log(`[buffer-controller]: ${n} sourceBuffer now EOS`))),r&&!!(!o||o.ended)},!0)&&(N.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(n=>{const o=this.sourceBuffer[n];o&&(o.ending=!1)});const{mediaSource:r}=this;if(!r||r.readyState!=="open"){r&&N.info(`[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: ${r.readyState}`);return}N.log("[buffer-controller]: Calling mediaSource.endOfStream()"),r.endOfStream()}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}flushBackBuffer(){const{hls:e,details:t,media:i,sourceBuffer:r}=this;if(!i||t===null)return;const n=this.getSourceBufferTypes();if(!n.length)return;const o=t.live&&e.config.liveBackBufferLength!==null?e.config.liveBackBufferLength:e.config.backBufferLength;if(!ce(o)||o<0)return;const a=i.currentTime,A=t.levelTargetDuration,l=Math.max(o,A),c=Math.floor(a/A)*A-l;n.forEach(h=>{const u=r[h];if(u){const d=Ge.getBuffered(u);if(d.length>0&&c>d.start(0)){if(e.trigger(E.BACK_BUFFER_REACHED,{bufferEnd:c}),t.live)e.trigger(E.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c});else if(u.ended&&d.end(d.length-1)-a<A*2){N.info(`[buffer-controller]: Cannot flush ${h} back buffer while SourceBuffer is in ended state`);return}e.trigger(E.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:h})}}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:t,media:i,mediaSource:r}=this,n=e.fragments[0].start+e.totalduration,o=i.duration,a=ce(r.duration)?r.duration:0;e.live&&t.config.liveDurationInfinity?(N.log("[buffer-controller]: Media Source duration is set to Infinity"),r.duration=1/0,this.updateSeekableRange(e)):(n>a&&n>o||!ce(o))&&(N.log(`[buffer-controller]: Updating Media Source duration to ${n.toFixed(3)}`),r.duration=n)}updateSeekableRange(e){const t=this.mediaSource,i=e.fragments;if(i.length&&e.live&&t!=null&&t.setLiveSeekableRange){const n=Math.max(0,i[0].start),o=Math.max(n,n+e.totalduration);t.setLiveSeekableRange(n,o)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:i}=this,r=Object.keys(i).length;if(r&&!e||r===2){this.createSourceBuffers(i),this.pendingTracks={};const n=this.getSourceBufferTypes();if(n.length)this.hls.trigger(E.BUFFER_CREATED,{tracks:this.tracks}),n.forEach(o=>{t.executeNext(o)});else{const o=new Error("could not create source buffer for media codec(s)");this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:o,reason:o.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:i}=this;if(!i)throw Error("createSourceBuffers called when mediaSource was null");for(const r in e)if(!t[r]){const n=e[r];if(!n)throw Error(`source buffer exists for track ${r}, however track does not`);const o=n.levelCodec||n.codec,a=`${n.container};codecs=${o}`;N.log(`[buffer-controller]: creating sourceBuffer(${a})`);try{const A=t[r]=i.addSourceBuffer(a),l=r;this.addBufferListener(l,"updatestart",this._onSBUpdateStart),this.addBufferListener(l,"updateend",this._onSBUpdateEnd),this.addBufferListener(l,"error",this._onSBUpdateError),this.tracks[r]={buffer:A,codec:o,container:n.container,levelCodec:n.levelCodec,metadata:n.metadata,id:n.id}}catch(A){N.error(`[buffer-controller]: error while trying to add sourceBuffer: ${A.message}`),this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:A,mimeType:a})}}}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){const{operationQueue:t}=this;t.current(e).onComplete(),t.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){const i=new Error(`${e} SourceBuffer error`);N.error(`[buffer-controller]: ${i}`,t),this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_APPENDING_ERROR,error:i,fatal:!1});const r=this.operationQueue.current(e);r&&r.onError(t)}removeExecutor(e,t,i){const{media:r,mediaSource:n,operationQueue:o,sourceBuffer:a}=this,A=a[e];if(!r||!n||!A){N.warn(`[buffer-controller]: Attempting to remove from the ${e} SourceBuffer, but it does not exist`),o.shiftAndExecuteNext(e);return}const l=ce(r.duration)?r.duration:1/0,c=ce(n.duration)?n.duration:1/0,h=Math.max(0,t),u=Math.min(i,l,c);u>h&&!A.ending?(A.ended=!1,N.log(`[buffer-controller]: Removing [${h},${u}] from the ${e} SourceBuffer`),A.remove(h,u)):o.shiftAndExecuteNext(e)}appendExecutor(e,t){const{operationQueue:i,sourceBuffer:r}=this,n=r[t];if(!n){N.warn(`[buffer-controller]: Attempting to append to the ${t} SourceBuffer, but it does not exist`),i.shiftAndExecuteNext(t);return}n.ended=!1,n.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length){N.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:i}=this,r=t.map(n=>i.appendBlocker(n));Promise.all(r).then(()=>{e(),t.forEach(n=>{const o=this.sourceBuffer[n];o!=null&&o.updating||i.shiftAndExecuteNext(n)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,i){const r=this.sourceBuffer[e];if(!r)return;const n=i.bind(this,e);this.listeners[e].push({event:t,listener:n}),r.addEventListener(t,n)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(i=>{t.removeEventListener(i.event,i.listener)})}}const mh={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},Ch=function(e){let t=e;return mh.hasOwnProperty(e)&&(t=mh[e]),String.fromCharCode(t)},Ut=15,ci=100,QE={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},bE={17:2,18:4,21:6,22:8,23:10,19:13,20:15},SE={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},wE={25:2,26:4,29:6,30:8,31:10,27:13,28:15},TE=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class xE{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const i=typeof t=="function"?t():t;N.log(`${this.time} [${e}] ${i}`)}}}const Xi=function(e){const t=[];for(let i=0;i<e.length;i++)t.push(e[i].toString(16));return t};class yh{constructor(e,t,i,r,n){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=e||"white",this.underline=t||!1,this.italics=i||!1,this.background=r||"black",this.flash=n||!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let i=0;i<t.length;i++){const r=t[i];e.hasOwnProperty(r)&&(this[r]=e[r])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class DE{constructor(e,t,i,r,n,o){this.uchar=void 0,this.penState=void 0,this.uchar=e||" ",this.penState=new yh(t,i,r,n,o)}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class RE{constructor(e){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(let t=0;t<ci;t++)this.chars.push(new DE);this.logger=e,this.pos=0,this.currPenState=new yh}equals(e){let t=!0;for(let i=0;i<ci;i++)if(!this.chars[i].equals(e.chars[i])){t=!1;break}return t}copy(e){for(let t=0;t<ci;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<ci;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>ci&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=ci)}moveCursor(e){const t=this.pos+e;if(e>1)for(let i=this.pos+1;i<t+1;i++)this.chars[i].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=Ch(e);if(this.pos>=ci){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<ci;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let i=0;i<ci;i++){const r=this.chars[i].uchar;r!==" "&&(t=!1),e.push(r)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class Ea{constructor(e){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(let t=0;t<Ut;t++)this.rows.push(new RE(e));this.logger=e,this.currRow=Ut-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}reset(){for(let e=0;e<Ut;e++)this.rows[e].clear();this.currRow=Ut-1}equals(e){let t=!0;for(let i=0;i<Ut;i++)if(!this.rows[i].equals(e.rows[i])){t=!1;break}return t}copy(e){for(let t=0;t<Ut;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<Ut;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let a=0;a<Ut;a++)this.rows[a].clear();const n=this.currRow+1-this.nrRollUpRows,o=this.lastOutputScreen;if(o){const a=o.rows[n].cueStartTime,A=this.logger.time;if(a&&A!==null&&a<A)for(let l=0;l<this.nrRollUpRows;l++)this.rows[t-this.nrRollUpRows+l+1].copy(o.rows[n+l])}}this.currRow=t;const i=this.rows[this.currRow];if(e.indent!==null){const n=e.indent,o=Math.max(n-1,0);i.setCursor(e.indent),e.color=i.chars[o].penState.foreground}const r={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(r)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let i="",r=-1;for(let n=0;n<Ut;n++){const o=this.rows[n].getTextString();o&&(r=n+1,e?t.push("Row "+r+": '"+o+"'"):t.push(o.trim()))}return t.length>0&&(e?i="["+t.join(" | ")+"]":i=t.join(`
|
193
|
-
`)),i}getTextAndFormat(){return this.rows}}class Bh{constructor(e,t,i){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=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Ea(i),this.nonDisplayedMemory=new Ea(i),this.lastOutputScreen=new Ea(i),this.currRollUpRow=this.displayedMemory.rows[Ut-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=i}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Ut-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),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=e)}insertChars(e){for(let i=0;i<e.length;i++)this.writeScreen.insertChar(e[i]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const i=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[i]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class vh{constructor(e,t,i){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;const r=new xE;this.channels=[null,new Bh(e,t,r),new Bh(e+1,i,r)],this.cmdHistory=bh(),this.logger=r}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){let i,r,n,o=!1;this.logger.time=e;for(let a=0;a<t.length;a+=2)if(r=t[a]&127,n=t[a+1]&127,!(r===0&&n===0)){if(this.logger.log(3,"["+Xi([t[a],t[a+1]])+"] -> ("+Xi([r,n])+")"),i=this.parseCmd(r,n),i||(i=this.parseMidrow(r,n)),i||(i=this.parsePAC(r,n)),i||(i=this.parseBackgroundAttributes(r,n)),!i&&(o=this.parseChars(r,n),o)){const A=this.currentChannel;A&&A>0?this.channels[A].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!i&&!o&&this.logger.log(2,"Couldn't parse cleaned data "+Xi([r,n])+" orig: "+Xi([t[a],t[a+1]]))}}parseCmd(e,t){const{cmdHistory:i}=this,r=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,n=(e===23||e===31)&&t>=33&&t<=35;if(!(r||n))return!1;if(Qh(e,t,i))return fs(null,null,i),this.logger.log(3,"Repeated command ("+Xi([e,t])+") is dropped"),!0;const o=e===20||e===21||e===23?1:2,a=this.channels[o];return e===20||e===21||e===28||e===29?t===32?a.ccRCL():t===33?a.ccBS():t===34?a.ccAOF():t===35?a.ccAON():t===36?a.ccDER():t===37?a.ccRU(2):t===38?a.ccRU(3):t===39?a.ccRU(4):t===40?a.ccFON():t===41?a.ccRDC():t===42?a.ccTR():t===43?a.ccRTD():t===44?a.ccEDM():t===45?a.ccCR():t===46?a.ccENM():t===47&&a.ccEOC():a.ccTO(t-32),fs(e,t,i),this.currentChannel=o,!0}parseMidrow(e,t){let i=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?i=1:i=2,i!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[i];return r?(r.ccMIDROW(t),this.logger.log(3,"MIDROW ("+Xi([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let i;const r=this.cmdHistory,n=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,o=(e===16||e===24)&&t>=64&&t<=95;if(!(n||o))return!1;if(Qh(e,t,r))return fs(null,null,r),!0;const a=e<=23?1:2;t>=64&&t<=95?i=a===1?QE[e]:SE[e]:i=a===1?bE[e]:wE[e];const A=this.channels[a];return A?(A.setPAC(this.interpretPAC(i,t)),fs(e,t,r),this.currentChannel=a,!0):!1}interpretPAC(e,t){let i;const r={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?i=t-96:i=t-64,r.underline=(i&1)===1,i<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(r.italics=!0,r.color="white"):r.indent=Math.floor((i-16)/2)*4,r}parseChars(e,t){let i,r=null,n=null;if(e>=25?(i=2,n=e-8):(i=1,n=e),n>=17&&n<=19){let o;n===17?o=t+80:n===18?o=t+112:o=t+144,this.logger.log(2,"Special char '"+Ch(o)+"' in channel "+i),r=[o]}else e>=32&&e<=127&&(r=t===0?[e]:[e,t]);if(r){const o=Xi(r);this.logger.log(3,"Char codes = "+o.join(",")),fs(e,t,this.cmdHistory)}return r}parseBackgroundAttributes(e,t){const i=(e===16||e===24)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=45&&t<=47;if(!(i||r))return!1;let n;const o={};e===16||e===24?(n=Math.floor((t-32)/2),o.background=TE[n],t%2===1&&(o.background=o.background+"_semi")):t===45?o.background="transparent":(o.foreground="black",t===47&&(o.underline=!0));const a=e<=23?1:2;return this.channels[a].setBkgData(o),fs(e,t,this.cmdHistory),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}this.cmdHistory=bh()}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const i=this.channels[t];i&&i.cueSplitAtTime(e)}}}function fs(s,e,t){t.a=s,t.b=e}function Qh(s,e,t){return t.a===s&&t.b===e}function bh(){return{a:null,b:null}}class vn{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,i){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Ia=function(){if(typeof self<"u"&&self.VTTCue)return self.VTTCue;const s=["","lr","rl"],e=["start","middle","end","left","right"];function t(a,A){if(typeof A!="string"||!Array.isArray(a))return!1;const l=A.toLowerCase();return~a.indexOf(l)?l:!1}function i(a){return t(s,a)}function r(a){return t(e,a)}function n(a,...A){let l=1;for(;l<arguments.length;l++){const c=arguments[l];for(const h in c)a[h]=c[h]}return a}function o(a,A,l){const c=this,h={enumerable:!0};c.hasBeenReset=!1;let u="",d=!1,g=a,f=A,p=l,y=null,B="",Q=!0,C="auto",T="start",b=50,L="middle",R=50,O="middle";Object.defineProperty(c,"id",n({},h,{get:function(){return u},set:function(k){u=""+k}})),Object.defineProperty(c,"pauseOnExit",n({},h,{get:function(){return d},set:function(k){d=!!k}})),Object.defineProperty(c,"startTime",n({},h,{get:function(){return g},set:function(k){if(typeof k!="number")throw new TypeError("Start time must be set to a number.");g=k,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",n({},h,{get:function(){return f},set:function(k){if(typeof k!="number")throw new TypeError("End time must be set to a number.");f=k,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",n({},h,{get:function(){return p},set:function(k){p=""+k,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},h,{get:function(){return y},set:function(k){y=k,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},h,{get:function(){return B},set:function(k){const W=i(k);if(W===!1)throw new SyntaxError("An invalid or illegal string was specified.");B=W,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",n({},h,{get:function(){return Q},set:function(k){Q=!!k,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},h,{get:function(){return C},set:function(k){if(typeof k!="number"&&k!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");C=k,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",n({},h,{get:function(){return T},set:function(k){const W=r(k);if(!W)throw new SyntaxError("An invalid or illegal string was specified.");T=W,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},h,{get:function(){return b},set:function(k){if(k<0||k>100)throw new Error("Position must be between 0 and 100.");b=k,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",n({},h,{get:function(){return L},set:function(k){const W=r(k);if(!W)throw new SyntaxError("An invalid or illegal string was specified.");L=W,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",n({},h,{get:function(){return R},set:function(k){if(k<0||k>100)throw new Error("Size must be between 0 and 100.");R=k,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",n({},h,{get:function(){return O},set:function(k){const W=r(k);if(!W)throw new SyntaxError("An invalid or illegal string was specified.");O=W,this.hasBeenReset=!0}})),c.displayState=void 0}return o.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},o}();class LE{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Sh(s){function e(i,r,n,o){return(i|0)*3600+(r|0)*60+(n|0)+parseFloat(o||0)}const t=s.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class _E{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,i){for(let r=0;r<i.length;++r)if(t===i[r]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const i=parseFloat(t);if(i>=0&&i<=100)return this.set(e,i),!0}return!1}}function wh(s,e,t,i){const r=i?s.split(i):[s];for(const n in r){if(typeof r[n]!="string")continue;const o=r[n].split(t);if(o.length!==2)continue;const a=o[0],A=o[1];e(a,A)}}const ma=new Ia(0,0,""),Qn=ma.align==="middle"?"middle":"center";function kE(s,e,t){const i=s;function r(){const a=Sh(s);if(a===null)throw new Error("Malformed timestamp: "+i);return s=s.replace(/^[^\sa-zA-Z-]+/,""),a}function n(a,A){const l=new _E;wh(a,function(u,d){let g;switch(u){case"region":for(let f=t.length-1;f>=0;f--)if(t[f].id===d){l.set(u,t[f].region);break}break;case"vertical":l.alt(u,d,["rl","lr"]);break;case"line":g=d.split(","),l.integer(u,g[0]),l.percent(u,g[0])&&l.set("snapToLines",!1),l.alt(u,g[0],["auto"]),g.length===2&&l.alt("lineAlign",g[1],["start",Qn,"end"]);break;case"position":g=d.split(","),l.percent(u,g[0]),g.length===2&&l.alt("positionAlign",g[1],["start",Qn,"end","line-left","line-right","auto"]);break;case"size":l.percent(u,d);break;case"align":l.alt(u,d,["start",Qn,"end","left","right"]);break}},/:/,/\s/),A.region=l.get("region",null),A.vertical=l.get("vertical","");let c=l.get("line","auto");c==="auto"&&ma.line===-1&&(c=-1),A.line=c,A.lineAlign=l.get("lineAlign","start"),A.snapToLines=l.get("snapToLines",!0),A.size=l.get("size",100),A.align=l.get("align",Qn);let h=l.get("position","auto");h==="auto"&&ma.position===50&&(h=A.align==="start"||A.align==="left"?0:A.align==="end"||A.align==="right"?100:50),A.position=h}function o(){s=s.replace(/^\s+/,"")}if(o(),e.startTime=r(),o(),s.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);s=s.slice(3),o(),e.endTime=r(),o(),n(s,e)}function Th(s){return s.replace(/<br(?: \/)?>/gi,`
|
194
|
-
`)}class
|
192
|
+
Aborting and switching to level ${k}`),e.loader&&(this.fragCurrent=this.partCurrent=null,e.abortRequests()),i.trigger(E.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:a}))}onFragLoaded(e,{frag:t,part:i}){const r=i?i.stats:t.stats;if(t.type===pe.MAIN&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){const n=i?i.duration:t.duration,o=this.hls.levels[t.level],a=(o.loaded?o.loaded.bytes:0)+r.loaded,A=(o.loaded?o.loaded.duration:0)+n;o.loaded={bytes:a,duration:A},o.realBitrate=Math.round(8*a/A)}if(t.bitrateTest){const n={stats:r,frag:t,part:i,id:t.type};this.onFragBuffered(E.FRAG_BUFFERED,n),t.bitrateTest=!1}}}onFragBuffered(e,t){const{frag:i,part:r}=t,n=r!=null&&r.stats.loaded?r.stats:i.stats;if(n.aborted||this.ignoreFragment(i))return;const o=n.parsing.end-n.loading.start-Math.min(n.loading.first-n.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(o,n.loaded),n.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=o/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==pe.MAIN||e.sn==="initSegment"}clearTimer(){self.clearInterval(this.timer)}get nextAutoLevel(){const e=this._nextAutoLevel,t=this.bwEstimator;if(e!==-1&&!t.canEstimate())return e;let i=this.getNextABRAutoLevel();if(e!==-1){const r=this.hls.levels;if(r.length>Math.max(e,i)&&r[e].loadError<=r[i].loadError)return e}return e!==-1&&(i=Math.min(e,i)),i}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:i}=this,{maxAutoLevel:r,config:n,minAutoLevel:o,media:a}=i,A=t?t.duration:e?e.duration:0,l=a&&a.playbackRate!==0?Math.abs(a.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,h=i.mainForwardBufferInfo,u=(h?h.len:0)/l;let d=this.findBestLevel(c,o,r,u,n.abrBandWidthFactor,n.abrBandWidthUpFactor);if(d>=0)return d;N.trace(`[abr] ${u?"rebuffering expected":"buffer is empty"}, finding optimal quality level`);let g=A?Math.min(A,n.maxStarvationDelay):n.maxStarvationDelay,f=n.abrBandWidthFactor,p=n.abrBandWidthUpFactor;if(!u){const y=this.bitrateTestDelay;y&&(g=(A?Math.min(A,n.maxLoadingDelay):n.maxLoadingDelay)-y,N.trace(`[abr] bitrate test took ${Math.round(1e3*y)}ms, set first fragment max fetchDuration to ${Math.round(1e3*g)} ms`),f=p=1)}return d=this.findBestLevel(c,o,r,u+g,f,p),Math.max(d,0)}findBestLevel(e,t,i,r,n,o){var a;const{fragCurrent:A,partCurrent:l,lastLoadedFragLevel:c}=this,{levels:h}=this.hls,u=h[c],d=!!(u!=null&&(a=u.details)!=null&&a.live),g=u==null?void 0:u.codecSet,f=l?l.duration:A?A.duration:0,p=this.bwEstimator.getEstimateTTFB()/1e3;let y=t,B=-1;for(let Q=i;Q>=t;Q--){const C=h[Q];if(!C||g&&C.codecSet!==g){C&&(y=Math.min(Q,y),B=Math.max(Q,B));continue}B!==-1&&N.trace(`[abr] Skipped level(s) ${y}-${B} with CODECS:"${h[B].attrs.CODECS}"; not compatible with "${u.attrs.CODECS}"`);const T=C.details,b=(l?T==null?void 0:T.partTarget:T==null?void 0:T.averagetargetduration)||f;let L;Q<=c?L=n*e:L=o*e;const R=h[Q].maxBitrate,O=this.getTimeToLoadFrag(p,L,R*b,T===void 0);if(N.trace(`[abr] level:${Q} adjustedbw-bitrate:${Math.round(L-R)} avgDuration:${b.toFixed(1)} maxFetchDuration:${r.toFixed(1)} fetchDuration:${O.toFixed(1)}`),L>R&&(O===0||!he(O)||d&&!this.bitrateTestDelay||O<r))return Q}return-1}set nextAutoLevel(e){this._nextAutoLevel=e}}class gh{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let i;if(e.length)e.length===1?i=e[0]:i=pE(e,t);else return new Uint8Array(0);return this.reset(),i}reset(){this.chunks.length=0,this.dataLength=0}}function pE(s,e){const t=new Uint8Array(e);let i=0;for(let r=0;r<s.length;r++){const n=s[r];t.set(n,i),i+=n.length}return t}const fh=100;class EE extends ra{constructor(e,t,i){super(e,t,i,"[audio-stream-controller]",pe.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.LEVEL_LOADED,this.onLevelLoaded,this),e.on(E.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(E.ERROR,this.onError,this),e.on(E.BUFFER_RESET,this.onBufferReset,this),e.on(E.BUFFER_CREATED,this.onBufferCreated,this),e.on(E.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(E.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(E.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.LEVEL_LOADED,this.onLevelLoaded,this),e.off(E.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(E.ERROR,this.onError,this),e.off(E.BUFFER_RESET,this.onBufferReset,this),e.off(E.BUFFER_CREATED,this.onBufferCreated,this),e.off(E.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(E.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(E.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:i,initPTS:r,timescale:n}){if(i==="main"){const o=t.cc;this.initPTS[t.cc]={baseTime:r,timescale:n},this.log(`InitPTS for cc: ${o} found from main: ${r}`),this.videoTrackCC=o,this.state===J.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=J.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(fh),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=J.IDLE):(this.loadedmetadata=!1,this.state=J.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case J.IDLE:this.doTickIdle();break;case J.WAITING_TRACK:{var e;const{levels:i,trackId:r}=this,n=i==null||(e=i[r])==null?void 0:e.details;if(n){if(this.waitForCdnTuneIn(n))break;this.state=J.WAITING_INIT_PTS}break}case J.FRAG_LOADING_WAITING_RETRY:{var t;const i=performance.now(),r=this.retryDate;(!r||i>=r||(t=this.media)!=null&&t.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=J.IDLE);break}case J.WAITING_INIT_PTS:{const i=this.waitingData;if(i){const{frag:r,part:n,cache:o,complete:a}=i;if(this.initPTS[r.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=J.FRAG_LOADING;const A=o.flush(),l={frag:r,part:n,payload:A,networkDetails:null};this._handleFragmentLoadProgress(l),a&&super._handleFragmentLoadComplete(l)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${r.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const A=this.getLoadPosition(),l=Ge.bufferInfo(this.mediaBuffer,A,this.config.maxBufferHole);zo(l.end,this.config.maxFragLookUpTolerance,r)<0&&(this.log(`Waiting fragment cc (${r.cc}) @ ${r.start} cancelled because another fragment at ${l.end} is needed`),this.clearWaitingFragment())}}else this.state=J.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=J.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:i,trackId:r}=this,n=e.config;if(!(t!=null&&t[r])||!i&&(this.startFragRequested||!n.startFragPrefetch))return;const o=t[r],a=o.details;if(!a||a.live&&this.levelLastLoaded!==r||this.waitForCdnTuneIn(a)){this.state=J.WAITING_TRACK;return}const A=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&A&&(this.bufferFlushed=!1,this.afterBufferFlushed(A,Me.AUDIO,pe.AUDIO));const l=this.getFwdBufferInfo(A,pe.AUDIO);if(l===null)return;const{bufferedTrack:c,switchingTrack:h}=this;if(!h&&this._streamEnded(l,a)){e.trigger(E.BUFFER_EOS,{type:"audio"}),this.state=J.ENDED;return}const u=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,pe.MAIN),d=l.len,g=this.getMaxBufferLength(u==null?void 0:u.len);if(d>=g&&!h)return;const p=a.fragments[0].start;let y=l.end;if(h&&i){const T=this.getLoadPosition();c&&h.attrs!==c.attrs&&(y=T),a.PTSKnown&&T<p&&(l.end>p||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=p+.05)}let B=this.getNextFragment(y,a),Q=!1;if(B&&this.isLoopLoading(B,y)&&(Q=!!B.gap,B=this.getNextFragmentLoopLoading(B,a,l,pe.MAIN,g)),!B){this.bufferFlushed=!0;return}const C=u&&B.start>u.end+a.targetduration;if(C||!(u!=null&&u.len)&&l.len){const T=this.getAppendedFrag(B.start,pe.MAIN);if(T===null||(Q||(Q=!!T.gap||!!C&&u.len===0),C&&!Q||Q&&l.nextStart&&l.nextStart<T.end))return}this.loadFragment(B,o,y)}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.min(Math.max(t,e),this.config.maxMaxBufferLength):t}onMediaDetaching(){this.videoBuffer=null,super.onMediaDetaching()}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(i=>new or(i))}onAudioTrackSwitching(e,t){const i=!!t.url;this.trackId=t.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),i?this.setInterval(fh):this.resetTransmuxer(),i?(this.switchingTrack=t,this.state=J.IDLE):(this.switchingTrack=null,this.bufferedTrack=t,this.state=J.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(E.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var i;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:r}=this,{details:n,id:o}=t;if(!r){this.warn(`Audio tracks were reset while loading level ${o}`);return}this.log(`Track ${o} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""},duration:${n.totalduration}`);const a=r[o];let A=0;if(n.live||(i=a.details)!=null&&i.live){this.checkLiveUpdate(n);const l=this.mainDetails;if(n.deltaUpdateFailed||!l)return;!a.details&&n.hasProgramDateTime&&l.hasProgramDateTime?(Vc(n,l),A=n.fragments[0].start):A=this.alignPlaylists(n,a.details)}a.details=n,this.levelLastLoaded=o,!this.startFragRequested&&(this.mainDetails||!n.live)&&this.setStartPosition(a.details,A),this.state===J.WAITING_TRACK&&!this.waitForCdnTuneIn(n)&&(this.state=J.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:i,part:r,payload:n}=e,{config:o,trackId:a,levels:A}=this;if(!A){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);return}const l=A[a];if(!l){this.warn("Audio track is undefined on fragment load progress");return}const c=l.details;if(!c){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(i.start);return}const h=o.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let u=this.transmuxer;u||(u=this.transmuxer=new dh(this.hls,pe.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const d=this.initPTS[i.cc],g=(t=i.initSegment)==null?void 0:t.data;if(d!==void 0){const p=r?r.index:-1,y=p!==-1,B=new ta(i.level,i.sn,i.stats.chunkCount,n.byteLength,p,y);u.push(n,g,h,"",i,r,c.totalduration,!1,B,d)}else{this.log(`Unknown video PTS for cc ${i.cc}, waiting for video PTS before demuxing audio frag ${i.sn} of [${c.startSN} ,${c.endSN}],track ${a}`);const{cache:f}=this.waitingData=this.waitingData||{frag:i,part:r,cache:new gh,complete:!1};f.push(new Uint8Array(n)),this.waitingVideoCC=this.videoTrackCC,this.state=J.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const i=t.tracks.audio;i&&(this.mediaBuffer=i.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:i,part:r}=t;if(i.type!==pe.AUDIO){if(!this.loadedmetadata&&i.type===pe.MAIN){const n=this.videoBuffer||this.media;n&&Ge.getBuffered(n).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${r?" p: "+r.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(i.sn!=="initSegment"){this.fragPrevious=i;const n=this.switchingTrack;n&&(this.bufferedTrack=n,this.switchingTrack=null,this.hls.trigger(E.AUDIO_TRACK_SWITCHED,vt({},n)))}this.fragBufferedComplete(i,r)}onError(e,t){var i;if(t.fatal){this.state=J.ERROR;return}switch(t.details){case Y.FRAG_GAP:case Y.FRAG_PARSING_ERROR:case Y.FRAG_DECRYPT_ERROR:case Y.FRAG_LOAD_ERROR:case Y.FRAG_LOAD_TIMEOUT:case Y.KEY_LOAD_ERROR:case Y.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(pe.AUDIO,t);break;case Y.AUDIO_TRACK_LOAD_ERROR:case Y.AUDIO_TRACK_LOAD_TIMEOUT:case Y.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===J.WAITING_TRACK&&((i=t.context)==null?void 0:i.type)===Re.AUDIO_TRACK&&(this.state=J.IDLE);break;case Y.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case Y.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushed(e,{type:t}){t===Me.AUDIO&&(this.bufferFlushed=!0,this.state===J.ENDED&&(this.state=J.IDLE))}_handleTransmuxComplete(e){var t;const i="audio",{hls:r}=this,{remuxResult:n,chunkMeta:o}=e,a=this.getCurrentContext(o);if(!a){this.resetWhenMissingContext(o);return}const{frag:A,part:l,level:c}=a,{details:h}=c,{audio:u,text:d,id3:g,initSegment:f}=n;if(this.fragContextChanged(A)||!h){this.fragmentTracker.removeFragment(A);return}if(this.state=J.PARSING,this.switchingTrack&&u&&this.completeAudioSwitch(this.switchingTrack),f!=null&&f.tracks){const p=A.initSegment||A;this._bufferInitSegment(f.tracks,p,o),r.trigger(E.FRAG_PARSING_INIT_SEGMENT,{frag:p,id:i,tracks:f.tracks})}if(u){const{startPTS:p,endPTS:y,startDTS:B,endDTS:Q}=u;l&&(l.elementaryStreams[Me.AUDIO]={startPTS:p,endPTS:y,startDTS:B,endDTS:Q}),A.setElementaryStreamInfo(Me.AUDIO,p,y,B,Q),this.bufferFragmentData(u,A,l,o)}if(g!=null&&(t=g.samples)!=null&&t.length){const p=Ze({id:i,frag:A,details:h},g);r.trigger(E.FRAG_PARSING_METADATA,p)}if(d){const p=Ze({id:i,frag:A,details:h},d);r.trigger(E.FRAG_PARSING_USERDATA,p)}}_bufferInitSegment(e,t,i){if(this.state!==J.PARSING)return;e.video&&delete e.video;const r=e.audio;if(!r)return;r.levelCodec=r.codec,r.id="audio",this.log(`Init audio buffer, container:${r.container}, codecs[parsed]=[${r.codec}]`),this.hls.trigger(E.BUFFER_CODECS,e);const n=r.initSegment;if(n!=null&&n.byteLength){const o={type:"audio",frag:t,part:null,chunkMeta:i,parent:t.type,data:n};this.hls.trigger(E.BUFFER_APPENDING,o)}this.tick()}loadFragment(e,t,i){const r=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||r===it.NOT_LOADED||r===it.PARTIAL){var n;e.sn==="initSegment"?this._loadInitSegment(e,t):(n=t.details)!=null&&n.live&&!this.initPTS[e.cc]?(this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=J.WAITING_INIT_PTS):(this.startFragRequested=!0,super.loadFragment(e,t,i))}else this.clearTrackerIfNeeded(e)}completeAudioSwitch(e){const{hls:t,media:i,bufferedTrack:r}=this,n=r==null?void 0:r.attrs,o=e.attrs;i&&n&&(n.CHANNELS!==o.CHANNELS||n.NAME!==o.NAME||n.LANGUAGE!==o.LANGUAGE)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(E.AUDIO_TRACK_SWITCHED,vt({},e))}}class IE extends Zo{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_PARSED,this.onManifestParsed,this),e.on(E.LEVEL_LOADING,this.onLevelLoading,this),e.on(E.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_PARSED,this.onManifestParsed,this),e.off(E.LEVEL_LOADING,this.onLevelLoading,this),e.off(E.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(E.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:i,groupId:r,details:n}=t,o=this.tracksInGroup[i];if(!o||o.groupId!==r){this.warn(`Track with id:${i} and group:${r} not found in active group ${o.groupId}`);return}const a=o.details;o.details=t.details,this.log(`audio-track ${i} "${o.name}" lang:${o.lang} group:${r} loaded [${n.startSN}-${n.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!(t!=null&&t.audioGroupIds))return;const i=t.audioGroupIds[t.urlId];if(this.groupId!==i){this.groupId=i||null;const r=this.tracks.filter(o=>!i||o.groupId===i);this.selectDefaultTrack&&!r.some(o=>o.default)&&(this.selectDefaultTrack=!1),this.tracksInGroup=r;const n={audioTracks:r};this.log(`Updating audio tracks, ${r.length} track(s) found in group:${i}`),this.hls.trigger(E.AUDIO_TRACKS_UPDATED,n),this.selectInitialTrack()}else this.shouldReloadPlaylist(this.currentTrack)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===Re.AUDIO_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&(this.requestScheduled=-1,this.checkRetry(t))}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();const i=this.currentTrack;t[this.trackId];const r=t[e],{groupId:n,name:o}=r;if(this.log(`Switching to audio-track ${e} "${o}" lang:${r.lang} group:${n}`),this.trackId=e,this.currentTrack=r,this.selectDefaultTrack=!1,this.hls.trigger(E.AUDIO_TRACK_SWITCHING,vt({},r)),r.details&&!r.details.live)return;const a=this.switchParams(r.url,i==null?void 0:i.details);this.loadPlaylist(a)}selectInitialTrack(){const e=this.tracksInGroup,t=this.findTrackId(this.currentTrack)|this.findTrackId(null);if(t!==-1)this.setAudioTrack(t);else{const i=new Error(`No track found for running audio group-ID: ${this.groupId} track count: ${e.length}`);this.warn(i.message),this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:i})}}findTrackId(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const r=t[i];if((!this.selectDefaultTrack||r.default)&&(!e||e.attrs["STABLE-RENDITION-ID"]!==void 0&&e.attrs["STABLE-RENDITION-ID"]===r.attrs["STABLE-RENDITION-ID"]||e.name===r.name&&e.lang===r.lang))return r.id}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.tracksInGroup[this.trackId];if(this.shouldLoadPlaylist(t)){const i=t.id,r=t.groupId;let n=t.url;if(e)try{n=e.addDirectives(n)}catch(o){this.warn(`Could not construct new URL with HLS Delivery Directives: ${o}`)}this.log(`loading audio-track playlist ${i} "${t.name}" lang:${t.lang} group:${r}`),this.clearTimer(),this.hls.trigger(E.AUDIO_TRACK_LOADING,{url:n,id:i,groupId:r,deliveryDirectives:e||null})}}}function ph(s,e){if(s.length!==e.length)return!1;for(let t=0;t<s.length;t++)if(!mE(s[t].attrs,e[t].attrs))return!1;return!0}function mE(s,e){const t=s["STABLE-RENDITION-ID"];return t?t===e["STABLE-RENDITION-ID"]:!["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED"].some(i=>s[i]!==e[i])}const Eh=500;class CE extends ra{constructor(e,t,i){super(e,t,i,"[subtitle-stream-controller]",pe.SUBTITLE),this.levels=[],this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.LEVEL_LOADED,this.onLevelLoaded,this),e.on(E.ERROR,this.onError,this),e.on(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(E.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(E.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(E.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.LEVEL_LOADED,this.onLevelLoaded,this),e.off(E.ERROR,this.onError,this),e.off(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(E.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(E.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(E.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=J.IDLE,this.setInterval(Eh),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:i,success:r}=t;if(this.fragPrevious=i,this.state=J.IDLE,!r)return;const n=this.tracksBuffered[this.currentTrackId];if(!n)return;let o;const a=i.start;for(let l=0;l<n.length;l++)if(a>=n[l].start&&a<=n[l].end){o=n[l];break}const A=i.start+i.duration;o?o.end=A:(o={start:a,end:A},n.push(o)),this.fragmentTracker.fragBuffered(i)}onBufferFlushing(e,t){const{startOffset:i,endOffset:r}=t;if(i===0&&r!==Number.POSITIVE_INFINITY){const n=r-1;if(n<=0)return;t.endOffsetSubtitles=Math.max(0,n),this.tracksBuffered.forEach(o=>{for(let a=0;a<o.length;){if(o[a].end<=n){o.shift();continue}else if(o[a].start<n)o[a].start=n;else break;a++}}),this.fragmentTracker.removeFragmentsInRange(i,n,pe.SUBTITLE)}}onFragBuffered(e,t){if(!this.loadedmetadata&&t.frag.type===pe.MAIN){var i;(i=this.media)!=null&&i.buffered.length&&(this.loadedmetadata=!0)}}onError(e,t){const i=t.frag;(i==null?void 0:i.type)===pe.SUBTITLE&&(this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==J.STOPPED&&(this.state=J.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(ph(this.levels,t)){this.levels=t.map(i=>new or(i));return}this.tracksBuffered=[],this.levels=t.map(i=>{const r=new or(i);return this.tracksBuffered[r.id]=[],r}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,pe.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){if(this.currentTrackId=t.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(Eh)}onSubtitleTrackLoaded(e,t){var i;const{details:r,id:n}=t,{currentTrackId:o,levels:a}=this;if(!a.length)return;const A=a[o];if(n>=a.length||n!==o||!A)return;this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(r.live||(i=A.details)!=null&&i.live){const c=this.mainDetails;if(r.deltaUpdateFailed||!c)return;const h=c.fragments[0];A.details?(l=this.alignPlaylists(r,A.details),l===0&&h&&(l=h.start,jo(r,l))):r.hasProgramDateTime&&c.hasProgramDateTime?(Vc(r,c),l=r.fragments[0].start):h&&(l=h.start,jo(r,l))}A.details=r,this.levelLastLoaded=n,!this.startFragRequested&&(this.mainDetails||!r.live)&&this.setStartPosition(A.details,l),this.tick(),r.live&&!this.fragCurrent&&this.media&&this.state===J.IDLE&&(ar(null,r.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),A.details=void 0))}_handleFragmentLoadComplete(e){const{frag:t,payload:i}=e,r=t.decryptdata,n=this.hls;if(!this.fragContextChanged(t)&&i&&i.byteLength>0&&r&&r.key&&r.iv&&r.method==="AES-128"){const o=performance.now();this.decrypter.decrypt(new Uint8Array(i),r.key.buffer,r.iv.buffer).catch(a=>{throw n.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.FRAG_DECRYPT_ERROR,fatal:!1,error:a,reason:a.message,frag:t}),a}).then(a=>{const A=performance.now();n.trigger(E.FRAG_DECRYPTED,{frag:t,payload:a,stats:{tstart:o,tdecrypt:A}})}).catch(a=>{this.warn(`${a.name}: ${a.message}`),this.state=J.IDLE})}}doTick(){if(!this.media){this.state=J.IDLE;return}if(this.state===J.IDLE){const{currentTrackId:e,levels:t}=this,i=t[e];if(!t.length||!i||!i.details)return;const{config:r}=this,n=this.getLoadPosition(),o=Ge.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],n,r.maxBufferHole),{end:a,len:A}=o,l=this.getFwdBufferInfo(this.media,pe.MAIN),c=i.details,h=this.getMaxBufferLength(l==null?void 0:l.len)+c.levelTargetDuration;if(A>h)return;const u=c.fragments,d=u.length,g=c.edge;let f=null;const p=this.fragPrevious;if(a<g){const y=r.maxFragLookUpTolerance,B=a>g-y?0:y;f=ar(p,u,Math.max(u[0].start,a),B),!f&&p&&p.start<u[0].start&&(f=u[0])}else f=u[d-1];if(!f)return;if(f=this.mapToInitFragWhenRequired(f),f.sn!=="initSegment"){const y=f.sn-c.startSN,B=u[y-1];B&&B.cc===f.cc&&this.fragmentTracker.getState(B)===it.NOT_LOADED&&(f=B)}this.fragmentTracker.getState(f)===it.NOT_LOADED&&this.loadFragment(f,i,a)}}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.max(t,e):t}loadFragment(e,t,i){this.fragCurrent=e,e.sn==="initSegment"?this._loadInitSegment(e,t):(this.startFragRequested=!0,super.loadFragment(e,t,i))}get mediaBufferTimeRanges(){return new yE(this.tracksBuffered[this.currentTrackId]||[])}}class yE{constructor(e){this.buffered=void 0;const t=(i,r,n)=>{if(r=r>>>0,r>n-1)throw new DOMException(`Failed to execute '${i}' on 'TimeRanges': The index provided (${r}) is greater than the maximum bound (${n})`);return e[r][i]};this.buffered={get length(){return e.length},end(i){return t("end",i,e.length)},start(i){return t("start",i,e.length)}}}}class BE extends Zo{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.trackChangeListener=()=>this.onTextTracksChanged(),this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes(this.trackId)}registerListeners(){const{hls:e}=this;e.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_PARSED,this.onManifestParsed,this),e.on(E.LEVEL_LOADING,this.onLevelLoading,this),e.on(E.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_PARSED,this.onManifestParsed,this),e.off(E.LEVEL_LOADING,this.onLevelLoading,this),e.off(E.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(E.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.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))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),pa(this.media.textTracks).forEach(t=>{hs(t)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:i,details:r}=t,{trackId:n}=this,o=this.tracksInGroup[n];if(!o){this.warn(`Invalid subtitle track id ${i}`);return}const a=o.details;o.details=t.details,this.log(`subtitle track ${i} loaded [${r.startSN}-${r.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!(t!=null&&t.textGroupIds))return;const i=t.textGroupIds[t.urlId],r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;if(this.groupId!==i){const n=this.tracks.filter(A=>!i||A.groupId===i);this.tracksInGroup=n;const o=this.findTrackId(r==null?void 0:r.name)||this.findTrackId();this.groupId=i||null;const a={subtitleTracks:n};this.log(`Updating subtitle tracks, ${n.length} track(s) found in "${i}" group-id`),this.hls.trigger(E.SUBTITLE_TRACKS_UPDATED,a),o!==-1&&this.setSubtitleTrack(o,r)}else this.shouldReloadPlaylist(r)&&this.setSubtitleTrack(this.trackId,r)}findTrackId(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const r=t[i];if((!this.selectDefaultTrack||r.default)&&(!e||e===r.name))return r.id}return-1}onError(e,t){t.fatal||!t.context||t.context.type===Re.SUBTITLE_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.checkRetry(t)}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1;const t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}loadPlaylist(e){super.loadPlaylist();const t=this.tracksInGroup[this.trackId];if(this.shouldLoadPlaylist(t)){const i=t.id,r=t.groupId;let n=t.url;if(e)try{n=e.addDirectives(n)}catch(o){this.warn(`Could not construct new URL with HLS Delivery Directives: ${o}`)}this.log(`Loading subtitle playlist for id ${i}`),this.hls.trigger(E.SUBTITLE_TRACK_LOADING,{url:n,id:i,groupId:r,deliveryDirectives:e||null})}}toggleTrackModes(e){const{media:t,trackId:i}=this;if(!t)return;const r=pa(t.textTracks),n=r.filter(a=>a.groupId===this.groupId);if(e===-1)[].slice.call(r).forEach(a=>{a.mode="disabled"});else{const a=n[i];a&&(a.mode="disabled")}const o=n[e];o&&(o.mode=this.subtitleDisplay?"showing":"hidden")}setSubtitleTrack(e,t){var i;const r=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(e===-1||(i=r[e])!=null&&i.details)||e<-1||e>=r.length)return;this.clearTimer();const n=r[e];if(this.log(`Switching to subtitle-track ${e}`+(n?` "${n.name}" lang:${n.lang} group:${n.groupId}`:"")),this.trackId=e,n){const{id:o,groupId:a="",name:A,type:l,url:c}=n;this.hls.trigger(E.SUBTITLE_TRACK_SWITCH,{id:o,groupId:a,name:A,type:l,url:c});const h=this.switchParams(n.url,t==null?void 0:t.details);this.loadPlaylist(h)}else this.hls.trigger(E.SUBTITLE_TRACK_SWITCH,{id:e})}onTextTracksChanged(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=-1;const t=pa(this.media.textTracks);for(let i=0;i<t.length;i++)if(t[i].mode==="hidden")e=i;else if(t[i].mode==="showing"){e=i;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)}}function pa(s){const e=[];for(let t=0;t<s.length;t++){const i=s[t];(i.kind==="subtitles"||i.kind==="captions")&&i.label&&e.push(s[t])}return e}class vE{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t){const i=this.queues[t];i.push(e),i.length===1&&this.buffers[t]&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const i=new Promise(n=>{t=n}),r={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(r,e),i}executeNext(e){const{buffers:t,queues:i}=this,r=t[e],n=i[e];if(n.length){const o=n[0];try{o.execute()}catch(a){N.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),o.onError(a),r!=null&&r.updating||(n.shift(),this.executeNext(e))}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const Ih=hn(),mh=/([ha]vc.)(?:\.[^.,]+)+/;class QE{constructor(e){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=()=>{const{media:t,mediaSource:i}=this;N.log("[buffer-controller]: Media source opened"),t&&(t.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(E.MEDIA_ATTACHED,{media:t})),i&&i.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{N.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=()=>{N.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=()=>{const{media:t,_objectUrl:i}=this;t&&t.src!==i&&N.error(`Media element src was set while attaching MediaSource (${i} > ${t.src})`)},this.hls=e,this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null}registerListeners(){const{hls:e}=this;e.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_PARSED,this.onManifestParsed,this),e.on(E.BUFFER_RESET,this.onBufferReset,this),e.on(E.BUFFER_APPENDING,this.onBufferAppending,this),e.on(E.BUFFER_CODECS,this.onBufferCodecs,this),e.on(E.BUFFER_EOS,this.onBufferEos,this),e.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(E.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(E.FRAG_PARSED,this.onFragParsed,this),e.on(E.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_PARSED,this.onManifestParsed,this),e.off(E.BUFFER_RESET,this.onBufferReset,this),e.off(E.BUFFER_APPENDING,this.onBufferAppending,this),e.off(E.BUFFER_CODECS,this.onBufferCodecs,this),e.off(E.BUFFER_EOS,this.onBufferEos,this),e.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(E.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(E.FRAG_PARSED,this.onFragParsed,this),e.off(E.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new vE(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,N.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const i=this.media=t.media;if(i&&Ih){const r=this.mediaSource=new Ih;r.addEventListener("sourceopen",this._onMediaSourceOpen),r.addEventListener("sourceended",this._onMediaSourceEnded),r.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(r),this._objectUrl=i.src,i.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:i}=this;if(t){if(N.log("[buffer-controller]: media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(r){N.warn(`[buffer-controller]: onMediaDetaching: ${r.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(e.removeEventListener("emptied",this._onMediaEmptied),i&&self.URL.revokeObjectURL(i),e.src===i?(e.removeAttribute("src"),e.load()):N.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(E.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{const t=this.sourceBuffer[e];try{t&&(this.removeBufferListeners(e),this.mediaSource&&this.mediaSource.removeSourceBuffer(t),this.sourceBuffer[e]=void 0)}catch(i){N.warn(`[buffer-controller]: Failed to reset the ${e} buffer`,i)}}),this._initSourceBuffer()}onBufferCodecs(e,t){const i=this.getSourceBufferTypes().length;Object.keys(t).forEach(r=>{if(i){const n=this.tracks[r];if(n&&typeof n.buffer.changeType=="function"){const{id:o,codec:a,levelCodec:A,container:l,metadata:c}=t[r],h=(n.levelCodec||n.codec).replace(mh,"$1"),u=(A||a).replace(mh,"$1");if(h!==u){const d=`${l};codecs=${A||a}`;this.appendChangeType(r,d),N.log(`[buffer-controller]: switching codec ${h} to ${u}`),this.tracks[r]={buffer:n.buffer,codec:a,container:l,levelCodec:A,metadata:c,id:o}}}}else this.pendingTracks[r]=t[r]}),!i&&(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())}appendChangeType(e,t){const{operationQueue:i}=this,r={execute:()=>{const n=this.sourceBuffer[e];n&&(N.log(`[buffer-controller]: changing ${e} sourceBuffer type to ${t}`),n.changeType(t)),i.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:n=>{N.warn(`[buffer-controller]: Failed to change ${e} SourceBuffer type`,n)}};i.append(r,e)}onBufferAppending(e,t){const{hls:i,operationQueue:r,tracks:n}=this,{data:o,type:a,frag:A,part:l,chunkMeta:c}=t,h=c.buffering[a],u=self.performance.now();h.start=u;const d=A.stats.buffering,g=l?l.stats.buffering:null;d.start===0&&(d.start=u),g&&g.start===0&&(g.start=u);const f=n.audio;let p=!1;a==="audio"&&(f==null?void 0:f.container)==="audio/mpeg"&&(p=!this.lastMpegAudioChunk||c.id===1||this.lastMpegAudioChunk.sn!==c.sn,this.lastMpegAudioChunk=c);const y=A.start,B={execute:()=>{if(h.executeStart=self.performance.now(),p){const Q=this.sourceBuffer[a];if(Q){const C=y-Q.timestampOffset;Math.abs(C)>=.1&&(N.log(`[buffer-controller]: Updating audio SourceBuffer timestampOffset to ${y} (delta: ${C}) sn: ${A.sn})`),Q.timestampOffset=y)}}this.appendExecutor(o,a)},onStart:()=>{},onComplete:()=>{const Q=self.performance.now();h.executeEnd=h.end=Q,d.first===0&&(d.first=Q),g&&g.first===0&&(g.first=Q);const{sourceBuffer:C}=this,T={};for(const b in C)T[b]=Ge.getBuffered(C[b]);this.appendError=0,this.hls.trigger(E.BUFFER_APPENDED,{type:a,frag:A,part:l,chunkMeta:c,parent:A.type,timeRanges:T})},onError:Q=>{N.error(`[buffer-controller]: Error encountered while trying to append to the ${a} SourceBuffer`,Q);const C={type:ge.MEDIA_ERROR,parent:A.type,details:Y.BUFFER_APPEND_ERROR,frag:A,part:l,chunkMeta:c,error:Q,err:Q,fatal:!1};Q.code===DOMException.QUOTA_EXCEEDED_ERR?C.details=Y.BUFFER_FULL_ERROR:(this.appendError++,C.details=Y.BUFFER_APPEND_ERROR,this.appendError>i.config.appendErrorMaxRetry&&(N.error(`[buffer-controller]: Failed ${i.config.appendErrorMaxRetry} times to append segment in sourceBuffer`),C.fatal=!0)),i.trigger(E.ERROR,C)}};r.append(B,a)}onBufferFlushing(e,t){const{operationQueue:i}=this,r=n=>({execute:this.removeExecutor.bind(this,n,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(E.BUFFER_FLUSHED,{type:n})},onError:o=>{N.warn(`[buffer-controller]: Failed to remove from ${n} SourceBuffer`,o)}});t.type?i.append(r(t.type),t.type):this.getSourceBufferTypes().forEach(n=>{i.append(r(n),n)})}onFragParsed(e,t){const{frag:i,part:r}=t,n=[],o=r?r.elementaryStreams:i.elementaryStreams;o[Me.AUDIOVIDEO]?n.push("audiovideo"):(o[Me.AUDIO]&&n.push("audio"),o[Me.VIDEO]&&n.push("video"));const a=()=>{const A=self.performance.now();i.stats.buffering.end=A,r&&(r.stats.buffering.end=A);const l=r?r.stats:i.stats;this.hls.trigger(E.FRAG_BUFFERED,{frag:i,part:r,stats:l,id:i.type})};n.length===0&&N.warn(`Fragments must have at least one ElementaryStreamType set. type: ${i.type} level: ${i.level} sn: ${i.sn}`),this.blockBuffers(a,n)}onFragChanged(e,t){this.flushBackBuffer()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((r,n)=>{const o=this.sourceBuffer[n];return o&&(!t.type||t.type===n)&&(o.ending=!0,o.ended||(o.ended=!0,N.log(`[buffer-controller]: ${n} sourceBuffer now EOS`))),r&&!!(!o||o.ended)},!0)&&(N.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(n=>{const o=this.sourceBuffer[n];o&&(o.ending=!1)});const{mediaSource:r}=this;if(!r||r.readyState!=="open"){r&&N.info(`[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: ${r.readyState}`);return}N.log("[buffer-controller]: Calling mediaSource.endOfStream()"),r.endOfStream()}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}flushBackBuffer(){const{hls:e,details:t,media:i,sourceBuffer:r}=this;if(!i||t===null)return;const n=this.getSourceBufferTypes();if(!n.length)return;const o=t.live&&e.config.liveBackBufferLength!==null?e.config.liveBackBufferLength:e.config.backBufferLength;if(!he(o)||o<0)return;const a=i.currentTime,A=t.levelTargetDuration,l=Math.max(o,A),c=Math.floor(a/A)*A-l;n.forEach(h=>{const u=r[h];if(u){const d=Ge.getBuffered(u);if(d.length>0&&c>d.start(0)){if(e.trigger(E.BACK_BUFFER_REACHED,{bufferEnd:c}),t.live)e.trigger(E.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c});else if(u.ended&&d.end(d.length-1)-a<A*2){N.info(`[buffer-controller]: Cannot flush ${h} back buffer while SourceBuffer is in ended state`);return}e.trigger(E.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:h})}}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:t,media:i,mediaSource:r}=this,n=e.fragments[0].start+e.totalduration,o=i.duration,a=he(r.duration)?r.duration:0;e.live&&t.config.liveDurationInfinity?(N.log("[buffer-controller]: Media Source duration is set to Infinity"),r.duration=1/0,this.updateSeekableRange(e)):(n>a&&n>o||!he(o))&&(N.log(`[buffer-controller]: Updating Media Source duration to ${n.toFixed(3)}`),r.duration=n)}updateSeekableRange(e){const t=this.mediaSource,i=e.fragments;if(i.length&&e.live&&t!=null&&t.setLiveSeekableRange){const n=Math.max(0,i[0].start),o=Math.max(n,n+e.totalduration);t.setLiveSeekableRange(n,o)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:i}=this,r=Object.keys(i).length;if(r&&!e||r===2){this.createSourceBuffers(i),this.pendingTracks={};const n=this.getSourceBufferTypes();if(n.length)this.hls.trigger(E.BUFFER_CREATED,{tracks:this.tracks}),n.forEach(o=>{t.executeNext(o)});else{const o=new Error("could not create source buffer for media codec(s)");this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:o,reason:o.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:i}=this;if(!i)throw Error("createSourceBuffers called when mediaSource was null");for(const r in e)if(!t[r]){const n=e[r];if(!n)throw Error(`source buffer exists for track ${r}, however track does not`);const o=n.levelCodec||n.codec,a=`${n.container};codecs=${o}`;N.log(`[buffer-controller]: creating sourceBuffer(${a})`);try{const A=t[r]=i.addSourceBuffer(a),l=r;this.addBufferListener(l,"updatestart",this._onSBUpdateStart),this.addBufferListener(l,"updateend",this._onSBUpdateEnd),this.addBufferListener(l,"error",this._onSBUpdateError),this.tracks[r]={buffer:A,codec:o,container:n.container,levelCodec:n.levelCodec,metadata:n.metadata,id:n.id}}catch(A){N.error(`[buffer-controller]: error while trying to add sourceBuffer: ${A.message}`),this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:A,mimeType:a})}}}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){const{operationQueue:t}=this;t.current(e).onComplete(),t.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){const i=new Error(`${e} SourceBuffer error`);N.error(`[buffer-controller]: ${i}`,t),this.hls.trigger(E.ERROR,{type:ge.MEDIA_ERROR,details:Y.BUFFER_APPENDING_ERROR,error:i,fatal:!1});const r=this.operationQueue.current(e);r&&r.onError(t)}removeExecutor(e,t,i){const{media:r,mediaSource:n,operationQueue:o,sourceBuffer:a}=this,A=a[e];if(!r||!n||!A){N.warn(`[buffer-controller]: Attempting to remove from the ${e} SourceBuffer, but it does not exist`),o.shiftAndExecuteNext(e);return}const l=he(r.duration)?r.duration:1/0,c=he(n.duration)?n.duration:1/0,h=Math.max(0,t),u=Math.min(i,l,c);u>h&&!A.ending?(A.ended=!1,N.log(`[buffer-controller]: Removing [${h},${u}] from the ${e} SourceBuffer`),A.remove(h,u)):o.shiftAndExecuteNext(e)}appendExecutor(e,t){const{operationQueue:i,sourceBuffer:r}=this,n=r[t];if(!n){N.warn(`[buffer-controller]: Attempting to append to the ${t} SourceBuffer, but it does not exist`),i.shiftAndExecuteNext(t);return}n.ended=!1,n.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length){N.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:i}=this,r=t.map(n=>i.appendBlocker(n));Promise.all(r).then(()=>{e(),t.forEach(n=>{const o=this.sourceBuffer[n];o!=null&&o.updating||i.shiftAndExecuteNext(n)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,i){const r=this.sourceBuffer[e];if(!r)return;const n=i.bind(this,e);this.listeners[e].push({event:t,listener:n}),r.addEventListener(t,n)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(i=>{t.removeEventListener(i.event,i.listener)})}}const Ch={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},yh=function(e){let t=e;return Ch.hasOwnProperty(e)&&(t=Ch[e]),String.fromCharCode(t)},Ut=15,hi=100,bE={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},SE={17:2,18:4,21:6,22:8,23:10,19:13,20:15},wE={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},TE={25:2,26:4,29:6,30:8,31:10,27:13,28:15},xE=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class DE{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const i=typeof t=="function"?t():t;N.log(`${this.time} [${e}] ${i}`)}}}const Xi=function(e){const t=[];for(let i=0;i<e.length;i++)t.push(e[i].toString(16));return t};class Bh{constructor(e,t,i,r,n){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=e||"white",this.underline=t||!1,this.italics=i||!1,this.background=r||"black",this.flash=n||!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let i=0;i<t.length;i++){const r=t[i];e.hasOwnProperty(r)&&(this[r]=e[r])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class RE{constructor(e,t,i,r,n,o){this.uchar=void 0,this.penState=void 0,this.uchar=e||" ",this.penState=new Bh(t,i,r,n,o)}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class LE{constructor(e){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(let t=0;t<hi;t++)this.chars.push(new RE);this.logger=e,this.pos=0,this.currPenState=new Bh}equals(e){let t=!0;for(let i=0;i<hi;i++)if(!this.chars[i].equals(e.chars[i])){t=!1;break}return t}copy(e){for(let t=0;t<hi;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<hi;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>hi&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=hi)}moveCursor(e){const t=this.pos+e;if(e>1)for(let i=this.pos+1;i<t+1;i++)this.chars[i].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=yh(e);if(this.pos>=hi){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<hi;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let i=0;i<hi;i++){const r=this.chars[i].uchar;r!==" "&&(t=!1),e.push(r)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class Ea{constructor(e){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(let t=0;t<Ut;t++)this.rows.push(new LE(e));this.logger=e,this.currRow=Ut-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}reset(){for(let e=0;e<Ut;e++)this.rows[e].clear();this.currRow=Ut-1}equals(e){let t=!0;for(let i=0;i<Ut;i++)if(!this.rows[i].equals(e.rows[i])){t=!1;break}return t}copy(e){for(let t=0;t<Ut;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<Ut;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let a=0;a<Ut;a++)this.rows[a].clear();const n=this.currRow+1-this.nrRollUpRows,o=this.lastOutputScreen;if(o){const a=o.rows[n].cueStartTime,A=this.logger.time;if(a&&A!==null&&a<A)for(let l=0;l<this.nrRollUpRows;l++)this.rows[t-this.nrRollUpRows+l+1].copy(o.rows[n+l])}}this.currRow=t;const i=this.rows[this.currRow];if(e.indent!==null){const n=e.indent,o=Math.max(n-1,0);i.setCursor(e.indent),e.color=i.chars[o].penState.foreground}const r={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(r)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let i="",r=-1;for(let n=0;n<Ut;n++){const o=this.rows[n].getTextString();o&&(r=n+1,e?t.push("Row "+r+": '"+o+"'"):t.push(o.trim()))}return t.length>0&&(e?i="["+t.join(" | ")+"]":i=t.join(`
|
193
|
+
`)),i}getTextAndFormat(){return this.rows}}class vh{constructor(e,t,i){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=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Ea(i),this.nonDisplayedMemory=new Ea(i),this.lastOutputScreen=new Ea(i),this.currRollUpRow=this.displayedMemory.rows[Ut-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=i}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Ut-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),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=e)}insertChars(e){for(let i=0;i<e.length;i++)this.writeScreen.insertChar(e[i]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const i=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[i]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class Qh{constructor(e,t,i){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;const r=new DE;this.channels=[null,new vh(e,t,r),new vh(e+1,i,r)],this.cmdHistory=Sh(),this.logger=r}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){let i,r,n,o=!1;this.logger.time=e;for(let a=0;a<t.length;a+=2)if(r=t[a]&127,n=t[a+1]&127,!(r===0&&n===0)){if(this.logger.log(3,"["+Xi([t[a],t[a+1]])+"] -> ("+Xi([r,n])+")"),i=this.parseCmd(r,n),i||(i=this.parseMidrow(r,n)),i||(i=this.parsePAC(r,n)),i||(i=this.parseBackgroundAttributes(r,n)),!i&&(o=this.parseChars(r,n),o)){const A=this.currentChannel;A&&A>0?this.channels[A].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!i&&!o&&this.logger.log(2,"Couldn't parse cleaned data "+Xi([r,n])+" orig: "+Xi([t[a],t[a+1]]))}}parseCmd(e,t){const{cmdHistory:i}=this,r=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,n=(e===23||e===31)&&t>=33&&t<=35;if(!(r||n))return!1;if(bh(e,t,i))return fs(null,null,i),this.logger.log(3,"Repeated command ("+Xi([e,t])+") is dropped"),!0;const o=e===20||e===21||e===23?1:2,a=this.channels[o];return e===20||e===21||e===28||e===29?t===32?a.ccRCL():t===33?a.ccBS():t===34?a.ccAOF():t===35?a.ccAON():t===36?a.ccDER():t===37?a.ccRU(2):t===38?a.ccRU(3):t===39?a.ccRU(4):t===40?a.ccFON():t===41?a.ccRDC():t===42?a.ccTR():t===43?a.ccRTD():t===44?a.ccEDM():t===45?a.ccCR():t===46?a.ccENM():t===47&&a.ccEOC():a.ccTO(t-32),fs(e,t,i),this.currentChannel=o,!0}parseMidrow(e,t){let i=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?i=1:i=2,i!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[i];return r?(r.ccMIDROW(t),this.logger.log(3,"MIDROW ("+Xi([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let i;const r=this.cmdHistory,n=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,o=(e===16||e===24)&&t>=64&&t<=95;if(!(n||o))return!1;if(bh(e,t,r))return fs(null,null,r),!0;const a=e<=23?1:2;t>=64&&t<=95?i=a===1?bE[e]:wE[e]:i=a===1?SE[e]:TE[e];const A=this.channels[a];return A?(A.setPAC(this.interpretPAC(i,t)),fs(e,t,r),this.currentChannel=a,!0):!1}interpretPAC(e,t){let i;const r={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?i=t-96:i=t-64,r.underline=(i&1)===1,i<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(r.italics=!0,r.color="white"):r.indent=Math.floor((i-16)/2)*4,r}parseChars(e,t){let i,r=null,n=null;if(e>=25?(i=2,n=e-8):(i=1,n=e),n>=17&&n<=19){let o;n===17?o=t+80:n===18?o=t+112:o=t+144,this.logger.log(2,"Special char '"+yh(o)+"' in channel "+i),r=[o]}else e>=32&&e<=127&&(r=t===0?[e]:[e,t]);if(r){const o=Xi(r);this.logger.log(3,"Char codes = "+o.join(",")),fs(e,t,this.cmdHistory)}return r}parseBackgroundAttributes(e,t){const i=(e===16||e===24)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=45&&t<=47;if(!(i||r))return!1;let n;const o={};e===16||e===24?(n=Math.floor((t-32)/2),o.background=xE[n],t%2===1&&(o.background=o.background+"_semi")):t===45?o.background="transparent":(o.foreground="black",t===47&&(o.underline=!0));const a=e<=23?1:2;return this.channels[a].setBkgData(o),fs(e,t,this.cmdHistory),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}this.cmdHistory=Sh()}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const i=this.channels[t];i&&i.cueSplitAtTime(e)}}}function fs(s,e,t){t.a=s,t.b=e}function bh(s,e,t){return t.a===s&&t.b===e}function Sh(){return{a:null,b:null}}class vn{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,i){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Ia=function(){if(typeof self<"u"&&self.VTTCue)return self.VTTCue;const s=["","lr","rl"],e=["start","middle","end","left","right"];function t(a,A){if(typeof A!="string"||!Array.isArray(a))return!1;const l=A.toLowerCase();return~a.indexOf(l)?l:!1}function i(a){return t(s,a)}function r(a){return t(e,a)}function n(a,...A){let l=1;for(;l<arguments.length;l++){const c=arguments[l];for(const h in c)a[h]=c[h]}return a}function o(a,A,l){const c=this,h={enumerable:!0};c.hasBeenReset=!1;let u="",d=!1,g=a,f=A,p=l,y=null,B="",Q=!0,C="auto",T="start",b=50,L="middle",R=50,O="middle";Object.defineProperty(c,"id",n({},h,{get:function(){return u},set:function(k){u=""+k}})),Object.defineProperty(c,"pauseOnExit",n({},h,{get:function(){return d},set:function(k){d=!!k}})),Object.defineProperty(c,"startTime",n({},h,{get:function(){return g},set:function(k){if(typeof k!="number")throw new TypeError("Start time must be set to a number.");g=k,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",n({},h,{get:function(){return f},set:function(k){if(typeof k!="number")throw new TypeError("End time must be set to a number.");f=k,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",n({},h,{get:function(){return p},set:function(k){p=""+k,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},h,{get:function(){return y},set:function(k){y=k,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},h,{get:function(){return B},set:function(k){const W=i(k);if(W===!1)throw new SyntaxError("An invalid or illegal string was specified.");B=W,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",n({},h,{get:function(){return Q},set:function(k){Q=!!k,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},h,{get:function(){return C},set:function(k){if(typeof k!="number"&&k!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");C=k,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",n({},h,{get:function(){return T},set:function(k){const W=r(k);if(!W)throw new SyntaxError("An invalid or illegal string was specified.");T=W,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},h,{get:function(){return b},set:function(k){if(k<0||k>100)throw new Error("Position must be between 0 and 100.");b=k,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",n({},h,{get:function(){return L},set:function(k){const W=r(k);if(!W)throw new SyntaxError("An invalid or illegal string was specified.");L=W,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",n({},h,{get:function(){return R},set:function(k){if(k<0||k>100)throw new Error("Size must be between 0 and 100.");R=k,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",n({},h,{get:function(){return O},set:function(k){const W=r(k);if(!W)throw new SyntaxError("An invalid or illegal string was specified.");O=W,this.hasBeenReset=!0}})),c.displayState=void 0}return o.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},o}();class _E{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function wh(s){function e(i,r,n,o){return(i|0)*3600+(r|0)*60+(n|0)+parseFloat(o||0)}const t=s.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class kE{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,i){for(let r=0;r<i.length;++r)if(t===i[r]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const i=parseFloat(t);if(i>=0&&i<=100)return this.set(e,i),!0}return!1}}function Th(s,e,t,i){const r=i?s.split(i):[s];for(const n in r){if(typeof r[n]!="string")continue;const o=r[n].split(t);if(o.length!==2)continue;const a=o[0],A=o[1];e(a,A)}}const ma=new Ia(0,0,""),Qn=ma.align==="middle"?"middle":"center";function NE(s,e,t){const i=s;function r(){const a=wh(s);if(a===null)throw new Error("Malformed timestamp: "+i);return s=s.replace(/^[^\sa-zA-Z-]+/,""),a}function n(a,A){const l=new kE;Th(a,function(u,d){let g;switch(u){case"region":for(let f=t.length-1;f>=0;f--)if(t[f].id===d){l.set(u,t[f].region);break}break;case"vertical":l.alt(u,d,["rl","lr"]);break;case"line":g=d.split(","),l.integer(u,g[0]),l.percent(u,g[0])&&l.set("snapToLines",!1),l.alt(u,g[0],["auto"]),g.length===2&&l.alt("lineAlign",g[1],["start",Qn,"end"]);break;case"position":g=d.split(","),l.percent(u,g[0]),g.length===2&&l.alt("positionAlign",g[1],["start",Qn,"end","line-left","line-right","auto"]);break;case"size":l.percent(u,d);break;case"align":l.alt(u,d,["start",Qn,"end","left","right"]);break}},/:/,/\s/),A.region=l.get("region",null),A.vertical=l.get("vertical","");let c=l.get("line","auto");c==="auto"&&ma.line===-1&&(c=-1),A.line=c,A.lineAlign=l.get("lineAlign","start"),A.snapToLines=l.get("snapToLines",!0),A.size=l.get("size",100),A.align=l.get("align",Qn);let h=l.get("position","auto");h==="auto"&&ma.position===50&&(h=A.align==="start"||A.align==="left"?0:A.align==="end"||A.align==="right"?100:50),A.position=h}function o(){s=s.replace(/^\s+/,"")}if(o(),e.startTime=r(),o(),s.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);s=s.slice(3),o(),e.endTime=r(),o(),n(s,e)}function xh(s){return s.replace(/<br(?: \/)?>/gi,`
|
194
|
+
`)}class FE{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new _E,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function i(){let n=t.buffer,o=0;for(n=xh(n);o<n.length&&n[o]!=="\r"&&n[o]!==`
|
195
195
|
`;)++o;const a=n.slice(0,o);return n[o]==="\r"&&++o,n[o]===`
|
196
|
-
`&&++o,t.buffer=n.slice(o),a}function r(n){
|
196
|
+
`&&++o,t.buffer=n.slice(o),a}function r(n){Th(n,function(o,a){},/:/)}try{let n="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;n=i();const a=n.match(/^()?WEBVTT([ \t].*)?$/);if(!(a!=null&&a[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let o=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(o?o=!1:n=i(),t.state){case"HEADER":/:/.test(n)?r(n):n||(t.state="ID");continue;case"NOTE":n||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){t.state="NOTE";break}if(!n)continue;if(t.cue=new Ia(0,0,""),t.state="CUE",n.indexOf("-->")===-1){t.cue.id=n;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{NE(n,t.cue,t.regionList)}catch{t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const a=n.indexOf("-->")!==-1;if(!n||a&&(o=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
197
197
|
`),t.cue.text+=n}continue;case"BADCUE":n||(t.state="ID")}}}catch{t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
|
198
198
|
|
199
|
-
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const
|
199
|
+
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const ME=/\r\n|\n\r|\n|\r/g,Ca=function(e,t,i=0){return e.slice(i,i+t.length)===t},PE=function(e){let t=parseInt(e.slice(-3));const i=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),n=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!he(t)||!he(i)||!he(r)||!he(n))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*i,t+=60*1e3*r,t+=60*60*1e3*n,t},ya=function(e){let t=5381,i=e.length;for(;i;)t=t*33^e.charCodeAt(--i);return(t>>>0).toString()};function Ba(s,e,t){return ya(s.toString())+ya(e.toString())+ya(t)}const OE=function(e,t,i){let r=e[t],n=e[r.prevCC];if(!n||!n.new&&r.new){e.ccOffset=e.presentationOffset=r.start,r.new=!1;return}for(;(o=n)!=null&&o.new;){var o;e.ccOffset+=r.start-n.start,r.new=!1,r=n,n=e[r.prevCC]}e.presentationOffset=i};function UE(s,e,t,i,r,n,o){const a=new FE,A=Vt(new Uint8Array(s)).trim().replace(ME,`
|
200
200
|
`).split(`
|
201
|
-
`),l=[],c=e?
|
202
|
-
`)}),a.flush()}const va="stpp.ttml.im1t",
|
203
|
-
`:(n=i.childNodes)!=null&&n.length?_h(i,e):e?t+i.textContent.trim().replace(/\s+/g," "):t+i.textContent},"")}function HE(s,e,t){const i="http://www.w3.org/ns/ttml#styling";let r=null;const n=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],o=s!=null&&s.hasAttribute("style")?s.getAttribute("style"):null;return o&&t.hasOwnProperty(o)&&(r=t[o]),n.reduce((a,A)=>{const l=ba(e,i,A)||ba(s,i,A)||ba(r,i,A);return l&&(a[A]=l),a},{})}function ba(s,e,t){return s&&s.hasAttributeNS(e,t)?s.getAttributeNS(e,t):null}function kh(s){return new Error(`Could not parse ttml timestamp ${s}`)}function Sa(s,e){if(!s)return null;let t=Sh(s);return t===null&&(xh.test(s)?t=$E(s,e):Dh.test(s)&&(t=YE(s,e))),t}function $E(s,e){const t=xh.exec(s),i=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+i/e.frameRate}function YE(s,e){const t=Dh.exec(s),i=Number(t[1]);switch(t[2]){case"h":return i*3600;case"m":return i*60;case"ms":return i*1e3;case"f":return i/e.frameRate;case"t":return i/e.tickRate}return i}class KE{constructor(e){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.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Nh(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.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){const t=new vn(this,"textTrack1"),i=new vn(this,"textTrack2"),r=new vn(this,"textTrack3"),n=new vn(this,"textTrack4");this.cea608Parser1=new vh(1,t,i),this.cea608Parser2=new vh(3,r,n)}e.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(E.FRAG_LOADING,this.onFragLoading,this),e.on(E.FRAG_LOADED,this.onFragLoaded,this),e.on(E.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(E.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(E.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(E.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(E.FRAG_LOADING,this.onFragLoading,this),e.off(E.FRAG_LOADED,this.onFragLoaded,this),e.off(E.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(E.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(E.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(E.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null}addCues(e,t,i,r,n){let o=!1;for(let a=n.length;a--;){const A=n[a],l=JE(A[0],A[1],t,i);if(l>=0&&(A[0]=Math.min(A[0],t),A[1]=Math.max(A[1],i),o=!0,l/(i-t)>.5))return}if(o||n.push([t,i]),this.config.renderTextTracksNatively){const a=this.captionsTracks[e];this.Cues.newCue(a,t,i,r)}else{const a=this.Cues.newCue(null,t,i,r);this.hls.trigger(E.CUES_PARSED,{type:"captions",cues:a,track:e})}}onInitPtsFound(e,{frag:t,id:i,initPTS:r,timescale:n}){const{unparsedVttFrags:o}=this;i==="main"&&(this.initPTS[t.cc]={baseTime:r,timescale:n}),o.length&&(this.unparsedVttFrags=[],o.forEach(a=>{this.onFragLoaded(E.FRAG_LOADED,a)}))}getExistingTrack(e){const{media:t}=this;if(t)for(let i=0;i<t.textTracks.length;i++){const r=t.textTracks[i];if(r[e])return r}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:i,media:r}=this,{label:n,languageCode:o}=t[e],a=this.getExistingTrack(e);if(a)i[e]=a,hs(i[e]),xc(i[e],r);else{const A=this.createTextTrack("captions",n,o);A&&(A[e]=!0,i[e]=A)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const i=t.label,r={_id:e,label:i,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=r,this.hls.trigger(E.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[r]})}createTextTrack(e,t,i){const r=this.media;if(r)return r.addTextTrack(e,t,i)}onMediaAttaching(e,t){this.media=t.media,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:e}=this;Object.keys(e).forEach(t=>{hs(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Nh(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let i=0;i<t.length;i++)hs(t[i])}onSubtitleTracksUpdated(e,t){const i=t.subtitleTracks||[],r=i.some(n=>n.textCodec===va);if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(fh(this.tracks,i)){this.tracks=i;return}if(this.textTracks=[],this.tracks=i,this.config.renderTextTracksNatively){const o=this.media?this.media.textTracks:null;this.tracks.forEach((a,A)=>{let l;if(o&&A<o.length){let c=null;for(let h=0;h<o.length;h++)if(VE(o[h],a)){c=o[h];break}c&&(l=c)}if(l)hs(l);else{const c=this._captionsOrSubtitlesFromCharacteristics(a);l=this.createTextTrack(c,a.name,a.lang),l&&(l.mode="disabled")}l&&(l.groupId=a.groupId,this.textTracks.push(l))})}else if(this.tracks.length){const o=this.tracks.map(a=>({label:a.name,kind:a.type.toLowerCase(),default:a.default,subtitleTrack:a}));this.hls.trigger(E.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:o})}}}_captionsOrSubtitlesFromCharacteristics(e){if(e.attrs.CHARACTERISTICS){const t=/transcribes-spoken-dialog/gi.test(e.attrs.CHARACTERISTICS),i=/describes-music-and-sound/gi.test(e.attrs.CHARACTERISTICS);if(t&&i)return"captions"}return"subtitles"}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(i=>{const r=/(?:CC|SERVICE)([1-4])/.exec(i.instreamId);if(!r)return;const n=`textTrack${r[1]}`,o=this.captionsProperties[n];o&&(o.label=i.name,i.lang&&(o.languageCode=i.lang),o.media=i)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){const{cea608Parser1:i,cea608Parser2:r,lastSn:n,lastPartIndex:o}=this;if(!(!this.enabled||!(i&&r))&&t.frag.type===pe.MAIN){var a,A;const l=t.frag.sn,c=(a=t==null||(A=t.part)==null?void 0:A.index)!=null?a:-1;l===n+1||l===n&&c===o+1||(i.reset(),r.reset()),this.lastSn=l,this.lastPartIndex=c}}onFragLoaded(e,t){const{frag:i,payload:r}=t;if(i.type===pe.SUBTITLE)if(r.byteLength){const n=i.decryptdata,o="stats"in t;if(n==null||!n.encrypted||o){const a=this.tracks[i.level],A=this.vttCCs;A[i.cc]||(A[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),a&&a.textCodec===va?this._parseIMSC1(i,r):this._parseVTTs(t)}}else this.hls.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const i=this.hls;Rh(t,this.initPTS[e.cc],r=>{this._appendCues(r,e.level),i.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},r=>{N.log(`Failed to parse IMSC1: ${r}`),i.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:r})})}_parseVTTs(e){var t;const{frag:i,payload:r}=e,{initPTS:n,unparsedVttFrags:o}=this,a=n.length-1;if(!n[i.cc]&&a===-1){o.push(e);return}const A=this.hls,l=(t=i.initSegment)!=null&&t.data?ji(i.initSegment.data,new Uint8Array(r)):r;OE(l,this.initPTS[i.cc],this.vttCCs,i.cc,i.start,c=>{this._appendCues(c,i.level),A.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},c=>{const h=c.message==="Missing initPTS for VTT MPEGTS";h?o.push(e):this._fallbackToIMSC1(i,r),N.log(`Failed to parse VTT cue: ${c}`),!(h&&a>i.cc)&&A.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:c})})}_fallbackToIMSC1(e,t){const i=this.tracks[e.level];i.textCodec||Rh(t,this.initPTS[e.cc],()=>{i.textCodec=va,this._parseIMSC1(e,t)},()=>{i.textCodec="wvtt"})}_appendCues(e,t){const i=this.hls;if(this.config.renderTextTracksNatively){const r=this.textTracks[t];if(!r||r.mode==="disabled")return;e.forEach(n=>Dc(r,n))}else{const r=this.tracks[t];if(!r)return;const n=r.default?"default":"subtitles"+t;i.trigger(E.CUES_PARSED,{type:"subtitles",cues:e,track:n})}}onFragDecrypted(e,t){const{frag:i}=t;i.type===pe.SUBTITLE&&this.onFragLoaded(E.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){const{cea608Parser1:i,cea608Parser2:r}=this;if(!this.enabled||!(i&&r))return;const{frag:n,samples:o}=t;if(!(n.type===pe.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let a=0;a<o.length;a++){const A=o[a].bytes;if(A){const l=this.extractCea608Data(A);i.addData(o[a].pts,l[0]),r.addData(o[a].pts,l[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:i,endOffsetSubtitles:r,type:n}){const{media:o}=this;if(!(!o||o.currentTime<i)){if(!n||n==="video"){const{captionsTracks:a}=this;Object.keys(a).forEach(A=>Ko(a[A],t,i))}if(this.config.renderTextTracksNatively&&t===0&&r!==void 0){const{textTracks:a}=this;Object.keys(a).forEach(A=>Ko(a[A],t,r))}}}extractCea608Data(e){const t=[[],[]],i=e[0]&31;let r=2;for(let n=0;n<i;n++){const o=e[r++],a=127&e[r++],A=127&e[r++];if(a===0&&A===0)continue;if((4&o)!==0){const c=3&o;(c===0||c===1)&&(t[c].push(a),t[c].push(A))}}return t}}function VE(s,e){return!!s&&s.label===e.name&&!(s.textTrack1||s.textTrack2)}function JE(s,e,t,i){return Math.min(e,i)-Math.max(s,t)}function Nh(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}class wa{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(E.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(E.MANIFEST_PARSED,this.onManifestParsed,this),e.on(E.BUFFER_CODECS,this.onBufferCodecs,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(E.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(E.MANIFEST_PARSED,this.onManifestParsed,this),e.off(E.BUFFER_CODECS,this.onBufferCodecs,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const i=this.hls.levels[t.droppedLevel];this.isLevelAllowed(i)&&this.restrictedLevels.push({bitrate:i.bitrate,height:i.height,width:i.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null}onManifestParsed(e,t){const i=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,i.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){const e=this.hls.levels;if(e.length){const t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const i=t.filter((r,n)=>this.isLevelAllowed(r)&&n<=e);return this.clientRect=null,wa.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)}startCapping(){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())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const i=e.getBoundingClientRect();t.width=i.width,t.height=i.height,!t.width&&!t.height&&(t.width=i.right-i.left||e.width||0,t.height=i.bottom-i.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return e}isLevelAllowed(e){return!this.restrictedLevels.some(i=>e.bitrate===i.bitrate&&e.width===i.width&&e.height===i.height)}static getMaxLevelByMediaSize(e,t,i){if(!(e!=null&&e.length))return-1;const r=(o,a)=>a?o.width!==a.width||o.height!==a.height:!0;let n=e.length-1;for(let o=0;o<e.length;o+=1){const a=e[o];if((a.width>=t||a.height>=i)&&r(a,e[o+1])){n=o;break}}return n}}class WE{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const i=this.hls.config;if(i.capLevelOnFPSDrop){const r=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=r,r&&typeof r.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,i){const r=performance.now();if(t){if(this.lastTime){const n=r-this.lastTime,o=i-this.lastDroppedFrames,a=t-this.lastDecodedFrames,A=1e3*o/n,l=this.hls;if(l.trigger(E.FPS_DROP,{currentDropped:o,currentDecoded:a,totalDroppedFrames:i}),A>0&&o>l.config.fpsDroppedMonitoringThreshold*a){let c=l.currentLevel;N.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=c)&&(c=c-1,l.trigger(E.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:l.currentLevel}),l.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=i,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const bn="[eme]";class ps{constructor(e){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=ps.CDMCleanupPromise?[ps.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=N.debug.bind(N,bn),this.log=N.log.bind(N,bn),this.warn=N.warn.bind(N,bn),this.error=N.error.bind(N,bn),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(E.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(E.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(E.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(E.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(E.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(E.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:i}=this.config,r=t[e];if(r)return r.licenseUrl;if(e===Ve.WIDEVINE&&i)return i;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,i=t[e];if(i)return i.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,i=(o,a,A)=>!!o&&A.indexOf(o)===a,r=t.map(o=>o.audioCodec).filter(i),n=t.map(o=>o.videoCodec).filter(i);return r.length+n.length===0&&n.push("avc1.42e01e"),new Promise((o,a)=>{const A=l=>{const c=l.shift();this.getMediaKeysPromise(c,r,n).then(h=>o({keySystem:c,mediaKeys:h})).catch(h=>{l.length?A(l):h instanceof kt?a(h):a(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_NO_ACCESS,error:h,fatal:!0},h.message))})};A(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:i}=this.config;if(typeof i!="function"){let r=`Configured requestMediaKeySystemAccess is not a function ${i}`;return sc===null&&self.location.protocol==="http:"&&(r=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(r))}return i(e,t)}getMediaKeysPromise(e,t,i){const r=A0(e,t,i,this.config.drmSystemOptions),n=this.keySystemAccessPromises[e];let o=n==null?void 0:n.keySystemAccess;if(!o){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(r)}`),o=this.requestMediaKeySystemAccess(e,r);const a=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch(A=>{this.log(`Failed to obtain access to key-system "${e}": ${A}`)}),o.then(A=>{this.log(`Access for key-system "${A.keySystem}" obtained`);const l=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),a.mediaKeys=A.createMediaKeys().then(c=>(this.log(`Media-keys created for "${e}"`),l.then(h=>h?this.setMediaKeysServerCertificate(c,e,h):c))),a.mediaKeys.catch(c=>{this.error(`Failed to create media-keys for "${e}"}: ${c}`)}),a.mediaKeys})}return o.then(()=>n.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:i}){this.log(`Creating key-system session "${t}" keyId: ${Jt.hexDump(e.keyId||[])}`);const r=i.createSession(),n={decryptdata:e,keySystem:t,mediaKeys:i,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(n),n}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const i=this.createMediaKeySessionContext(e),r=this.getKeyIdString(t),n="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(i,n,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Jt.hexDump(e.keyId)}updateKeySession(e,t){var i;const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyID ${Jt.hexDump(((i=e.decryptdata)==null?void 0:i.keyId)||[])}
|
204
|
-
} (data length: ${t&&t.byteLength})`),r.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,i)=>{const r=Po(this.config),n=e.map(ec).filter(o=>!!o&&r.indexOf(o)!==-1);return this.getKeySystemSelectionPromise(n).then(({keySystem:o})=>{const a=ic(o);a?t(a):i(new Error(`Unable to find format for key-system "${o}"`))}).catch(i)})}loadKey(e){const t=e.keyInfo.decryptdata,i=this.getKeyIdString(t),r=`(keyId: ${i} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);let n=this.keyIdToKeySessionPromise[i];return n||(n=this.keyIdToKeySessionPromise[i]=this.getKeySystemForKeyPromise(t).then(({keySystem:o,mediaKeys:a})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(o,a).then(()=>{this.throwIfDestroyed();const A=this.createMediaKeySessionContext({keySystem:o,mediaKeys:a,decryptdata:t}),l="cenc";return this.generateRequestWithPreferredKeySession(A,l,t.pssh,"playlist-key")}))),n.catch(o=>this.handleError(o))),n}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof kt?this.hls.trigger(E.ERROR,e.data):this.hls.trigger(E.ERROR,{type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),i=this.keyIdToKeySessionPromise[t];if(!i){const r=ec(e.keyFormat),n=r?[r]:Po(this.config);return this.attemptKeySystemAccess(n)}return i}getKeySystemSelectionPromise(e){if(e.length||(e=Po(this.config)),e.length===0)throw new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:i}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),i===null)return;let r,n;if(t==="sinf"&&this.config.drmSystems[Ve.FAIRPLAY]){const c=At(new Uint8Array(i));try{const h=Mo(JSON.parse(c).sinf),u=hc(new Uint8Array(h));if(!u)return;r=u.subarray(8,24),n=Ve.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const c=L0(i);if(c===null)return;c.version===0&&c.systemId===tc.WIDEVINE&&c.data&&(r=c.data.subarray(8,24)),n=a0(c.systemId)}if(!n||!r)return;const o=Jt.hexDump(r),{keyIdToKeySessionPromise:a,mediaKeySessions:A}=this;let l=a[o];for(let c=0;c<A.length;c++){const h=A[c],u=h.decryptdata;if(u.pssh||!u.keyId)continue;const d=Jt.hexDump(u.keyId);if(o===d||u.uri.replace(/-/g,"").indexOf(o)!==-1){l=a[d],delete a[d],u.pssh=new Uint8Array(i),u.keyId=r,l=a[o]=l.then(()=>this.generateRequestWithPreferredKeySession(h,t,i,"encrypted-event-key-match"));break}}l||(l=a[o]=this.getKeySystemSelectionPromise([n]).then(({keySystem:c,mediaKeys:h})=>{var u;this.throwIfDestroyed();const d=new rr("ISO-23001-7",o,(u=ic(c))!=null?u:"");return d.pssh=new Uint8Array(i),d.keyId=r,this.attemptSetMediaKeys(c,h).then(()=>{this.throwIfDestroyed();const g=this.createMediaKeySessionContext({decryptdata:d,keySystem:c,mediaKeys:h});return this.generateRequestWithPreferredKeySession(g,t,i,"encrypted-event-no-match")})})),l.catch(c=>this.handleError(c))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const i=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const r=Promise.all(i).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(r),r.then(()=>{this.log(`Media-keys set for "${e}"`),i.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(n=>i.indexOf(n)===-1)})}generateRequestWithPreferredKeySession(e,t,i,r){var n,o;const a=(n=this.config.drmSystems)==null||(o=n[e.keySystem])==null?void 0:o.generateRequest;if(a)try{const u=a.call(this.hls,t,i,e);if(!u)throw new Error("Invalid response from configured generateRequest filter");t=u.initDataType,i=e.decryptdata.pssh=u.initData?new Uint8Array(u.initData):null}catch(u){var A;if(this.warn(u.message),(A=this.hls)!=null&&A.config.debug)throw u}if(i===null)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(e);const l=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${r}": ${l} (init data type: ${t} length: ${i?i.byteLength:null})`);const c=new da;e.mediaKeysSession.onmessage=u=>{const d=e.mediaKeysSession;if(!d){c.emit("error",new Error("invalid state"));return}const{messageType:g,message:f}=u;this.log(`"${g}" message event for session "${d.sessionId}" message size: ${f.byteLength}`),g==="license-request"||g==="license-renewal"?this.renewLicense(e,f).catch(p=>{this.handleError(p),c.emit("error",p)}):g==="license-release"?e.keySystem===Ve.FAIRPLAY&&(this.updateKeySession(e,Zl("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${g}"`)},e.mediaKeysSession.onkeystatuseschange=u=>{if(!e.mediaKeysSession){c.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const g=e.keyStatus;c.emit("keyStatus",g),g==="expired"&&(this.warn(`${e.keySystem} expired for key ${l}`),this.renewKeySession(e))};const h=new Promise((u,d)=>{c.on("error",d),c.on("keyStatus",g=>{g.startsWith("usable")?u():g==="output-restricted"?d(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):g==="internal-error"?d(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${g}"`)):g==="expired"?d(new Error("key expired while generating request")):this.warn(`unhandled key status change "${g}"`)})});return e.mediaKeysSession.generateRequest(t,i).then(()=>{var u;this.log(`Request generated for key-session "${(u=e.mediaKeysSession)==null?void 0:u.sessionId}" keyId: ${l}`)}).catch(u=>{throw new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_NO_SESSION,error:u,fatal:!1},`Error generating key-session request: ${u}`)}).then(()=>h).catch(u=>{throw c.removeAllListeners(),this.removeSession(e),u}).then(()=>(c.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,i)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${Jt.hexDump("buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i))} session keyId: ${Jt.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,i=t.loader,r=new i(t),n=this.getServerCertificateUrl(e);return n?(this.log(`Fetching serverCertificate for "${e}"`),new Promise((o,a)=>{const A={responseType:"arraybuffer",url:n},l=t.certLoadPolicy.default,c={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(u,d,g,f)=>{o(u.data)},onError:(u,d,g,f)=>{a(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:g,response:vt({url:A.url,data:void 0},u)},`"${e}" certificate request failed (${n}). Status: ${u.code} (${u.text})`))},onTimeout:(u,d,g)=>{a(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:g,response:{url:A.url,data:void 0}},`"${e}" certificate request timed out (${n})`))},onAbort:(u,d,g)=>{a(new Error("aborted"))}};r.load(A,c,h)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,i){return new Promise((r,n)=>{e.setServerCertificate(i).then(o=>{this.log(`setServerCertificate ${o?"success":"not supported by CDM"} (${i==null?void 0:i.byteLength}) on "${t}"`),r(e)}).catch(o=>{n(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:o,fatal:!0},o.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(i=>this.updateKeySession(e,new Uint8Array(i)).catch(r=>{throw new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:r,fatal:!0},r.message)}))}setupLicenseXHR(e,t,i,r){const n=this.config.licenseXhrSetup;return n?Promise.resolve().then(()=>{if(!i.decryptdata)throw new Error("Key removed");return n.call(this.hls,e,t,i,r)}).catch(o=>{if(!i.decryptdata)throw o;return e.open("POST",t,!0),n.call(this.hls,e,t,i,r)}).then(o=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:o||r})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}requestLicense(e,t){const i=this.config.keyLoadPolicy.default;return new Promise((r,n)=>{const o=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${o}`);const a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return n(new Error("invalid state"));if(a.readyState===4)if(a.status===200){this._requestLicenseFailureCount=0;let A=a.response;this.log(`License received ${A instanceof ArrayBuffer?A.byteLength:A}`);const l=this.config.licenseResponseCallback;if(l)try{A=l.call(this.hls,a,o,e)}catch(c){this.error(c)}r(A)}else{const A=i.errorRetry,l=A?A.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||a.status>=400&&a.status<500)n(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:{url:o,data:void 0,code:a.status,text:a.statusText}},`License Request XHR failed (${o}). Status: ${a.status} (${a.statusText})`));else{const c=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${c} attempts left`),this.requestLicense(e,t).then(r,n)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=a,this.setupLicenseXHR(a,o,e,t).then(({xhr:A,licenseChallenge:l})=>{A.send(l)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const i=t.media;this.media=i,i.addEventListener("encrypted",this.onMediaEncrypted),i.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},rr.clearKeyUriToKeyIdMap();const i=t.length;ps.CDMCleanupPromise=Promise.all(t.map(r=>this.removeSession(r)).concat(e==null?void 0:e.setMediaKeys(null).catch(r=>{this.log(`Could not clear media keys: ${r}. media.src: ${e==null?void 0:e.src}`)}))).then(()=>{i&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(r=>{this.log(`Could not close sessions and clear media keys: ${r}. media.src: ${e==null?void 0:e.src}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const i=t.reduce((r,n)=>(r.indexOf(n.keyFormat)===-1&&r.push(n.keyFormat),r),[]);this.log(`Selecting key-system from session-keys ${i.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(i)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:i}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),t.onmessage=null,t.onkeystatuseschange=null,i&&i.readyState!==XMLHttpRequest.DONE&&i.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(e);return r>-1&&this.mediaKeySessions.splice(r,1),t.remove().catch(n=>{this.log(`Could not remove session: ${n}`)}).then(()=>t.close()).catch(n=>{this.log(`Could not close session: ${n}`)})}}}ps.CDMCleanupPromise=void 0;class kt extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}const qE=1;var St={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"};const jE="h";class xi{constructor(e){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=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=r=>{try{this.apply(r,{ot:St.MANIFEST,su:!this.initialized})}catch(n){N.warn("Could not generate manifest CMCD data.",n)}},this.applyFragmentData=r=>{try{const n=r.frag,o=this.hls.levels[n.level],a=this.getObjectType(n),A={d:n.duration*1e3,ot:a};(a===St.VIDEO||a===St.AUDIO||a==St.MUXED)&&(A.br=o.bitrate/1e3,A.tb=this.getTopBandwidth(a)/1e3,A.bl=this.getBufferLength(a)),this.apply(r,A)}catch(n){N.warn("Could not generate segment CMCD data.",n)}},this.hls=e;const t=this.config=e.config,{cmcd:i}=t;i!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||xi.uuid(),this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.registerListeners())}registerListeners(){const e=this.hls;e.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(E.MEDIA_DETACHED,this.onMediaDetached,this),e.on(E.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(E.MEDIA_DETACHED,this.onMediaDetached,this),e.off(E.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var i,r;this.audioBuffer=(i=t.tracks.audio)==null?void 0:i.buffer,this.videoBuffer=(r=t.tracks.video)==null?void 0:r.buffer}createData(){var e;return{v:qE,sf:jE,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){Ze(t,this.createData());const i=t.ot===St.INIT||t.ot===St.VIDEO||t.ot===St.MUXED;if(this.starved&&i&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering),this.useHeaders){const r=xi.toHeaders(t);if(!Object.keys(r).length)return;e.headers||(e.headers={}),Ze(e.headers,r)}else{const r=xi.toQuery(t);if(!r)return;e.url=xi.appendQueryToUri(e.url,r)}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return St.TIMED_TEXT;if(e.sn==="initSegment")return St.INIT;if(t==="audio")return St.AUDIO;if(t==="main")return this.hls.audioTracks.length?St.VIDEO:St.MUXED}getTopBandwidth(e){let t=0,i;const r=this.hls;if(e===St.AUDIO)i=r.audioTracks;else{const n=r.maxAutoLevel,o=n>-1?n+1:r.levels.length;i=r.levels.slice(0,o)}for(const n of i)n.bitrate>t&&(t=n.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,i=e===St.AUDIO?this.audioBuffer:this.videoBuffer;return!i||!t?NaN:Ge.bufferInfo(i,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,i=e||this.config.loader;return class{constructor(n){this.loader=void 0,this.loader=new i(n)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(n,o,a){t(n),this.loader.load(n,o,a)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,i=e||this.config.loader;return class{constructor(n){this.loader=void 0,this.loader=new i(n)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(n,o,a){t(n),this.loader.load(n,o,a)}}}static uuid(){const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}static serialize(e){const t=[],i=l=>!Number.isNaN(l)&&l!=null&&l!==""&&l!==!1,r=l=>Math.round(l),n=l=>r(l/100)*100,a={br:r,d:r,bl:n,dl:n,mtp:n,nor:l=>encodeURIComponent(l),rtp:n,tb:r},A=Object.keys(e||{}).sort();for(const l of A){let c=e[l];if(!i(c)||l==="v"&&c===1||l=="pr"&&c===1)continue;const h=a[l];h&&(c=h(c));const u=typeof c;let d;l==="ot"||l==="sf"||l==="st"?d=`${l}=${c}`:u==="boolean"?d=l:u==="number"?d=`${l}=${c}`:d=`${l}=${JSON.stringify(c)}`,t.push(d)}return t.join(",")}static toHeaders(e){const t=Object.keys(e),i={},r=["Object","Request","Session","Status"],n=[{},{},{},{}],o={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};for(const a of t){const A=o[a]!=null?o[a]:1;n[A][a]=e[a]}for(let a=0;a<n.length;a++){const A=xi.serialize(n[a]);A&&(i[`CMCD-${r[a]}`]=A)}return i}static toQuery(e){return`CMCD=${encodeURIComponent(xi.serialize(e))}`}static appendQueryToUri(e,t){if(!t)return e;const i=e.includes("?")?"&":"?";return`${e}${i}${t}`}}const XE=3e5;class zE{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=N.log.bind(N,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(E.MANIFEST_PARSED,this.onManifestParsed,this),e.on(E.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(E.MANIFEST_PARSED,this.onManifestParsed,this),e.off(E.ERROR,this.onError,this))}startLoad(){if(this.started=!0,self.clearTimeout(this.reloadTimer),this.enabled&&this.uri)if(this.updated){const e=Math.max(this.timeToLoad*1e3-(performance.now()-this.updated),0);this.scheduleRefresh(this.uri,e)}else this.loadSteeringManifest(this.uri)}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),self.clearTimeout(this.reloadTimer)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(i=>i!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:i}=t;i!==null&&(this.pathwayId=i.pathwayId,this.uri=i.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:i}=t;if((i==null?void 0:i.action)===dt.SendAlternateToPenaltyBox&&i.flags===Lt.MoveAllAlternatesMatchingHost){let r=this.pathwayPriority;const n=this.pathwayId;this.penalizedPathways[n]||(this.penalizedPathways[n]=performance.now()),!r&&this.levels&&(r=this.levels.reduce((o,a)=>(o.indexOf(a.pathwayId)===-1&&o.push(a.pathwayId),o),[])),r&&r.length>1&&(this.updatePathwayPriority(r),i.resolved=this.pathwayId!==n)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const i=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${i}"`),t=this.getLevelsForPathway(i),this.pathwayId=i}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let t;const i=this.penalizedPathways,r=performance.now();Object.keys(i).forEach(n=>{r-i[n]>XE&&delete i[n]});for(let n=0;n<e.length;n++){const o=e[n];if(i[o])continue;if(o===this.pathwayId)return;const a=this.hls.nextLoadLevel,A=this.hls.levels[a];if(t=this.getLevelsForPathway(o),t.length>0){this.log(`Setting Pathway to "${o}"`),this.pathwayId=o,this.hls.trigger(E.LEVELS_UPDATED,{levels:t});const l=this.hls.levels[a];A&&l&&this.levels&&(l.attrs["STABLE-VARIANT-ID"]!==A.attrs["STABLE-VARIANT-ID"]&&l.bitrate!==A.bitrate&&this.log(`Unstable Pathways change from bitrate ${A.bitrate} to ${l.bitrate}`),this.hls.nextLoadLevel=a);break}}}clonePathways(e){const t=this.levels;if(!t)return;const i={},r={};e.forEach(n=>{const{ID:o,"BASE-ID":a,"URI-REPLACEMENT":A}=n;if(t.some(c=>c.pathwayId===o))return;const l=this.getLevelsForPathway(a).map(c=>{const h=Ze({},c);h.details=void 0,h.url=Mh(c.uri,c.attrs["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",A);const u=new Ke(c.attrs);u["PATHWAY-ID"]=o;const d=u.AUDIO&&`${u.AUDIO}_clone_${o}`,g=u.SUBTITLES&&`${u.SUBTITLES}_clone_${o}`;d&&(i[u.AUDIO]=d,u.AUDIO=d),g&&(r[u.SUBTITLES]=g,u.SUBTITLES=g),h.attrs=u;const f=new or(h);return fn(f,"audio",d),fn(f,"text",g),f});t.push(...l),Fh(this.audioTracks,i,A,o),Fh(this.subtitleTracks,r,A,o)})}loadSteeringManifest(e){const t=this.hls.config,i=t.loader;this.loader&&this.loader.destroy(),this.loader=new i(t);let r;try{r=new self.URL(e)}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(r.protocol!=="data:"){const c=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;r.searchParams.set("_HLS_pathway",this.pathwayId),r.searchParams.set("_HLS_throughput",""+c)}const n={responseType:"json",url:r.href},o=t.steeringManifestLoadPolicy.default,a=o.errorRetry||o.timeoutRetry||{},A={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(c,h,u,d)=>{this.log(`Loaded steering manifest: "${r}"`);const g=c.data;if(g.VERSION!==1){this.log(`Steering VERSION ${g.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=g.TTL;const{"RELOAD-URI":f,"PATHWAY-CLONES":p,"PATHWAY-PRIORITY":y}=g;if(f)try{this.uri=new self.URL(f,r).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${f}`);return}this.scheduleRefresh(this.uri||u.url),p&&this.clonePathways(p),y&&this.updatePathwayPriority(y)},onError:(c,h,u,d)=>{if(this.log(`Error loading steering manifest: ${c.code} ${c.text} (${h.url})`),this.stopLoad(),c.code===410){this.enabled=!1,this.log(`Steering manifest ${h.url} no longer available`);return}let g=this.timeToLoad*1e3;if(c.code===429){const f=this.loader;if(typeof(f==null?void 0:f.getResponseHeader)=="function"){const p=f.getResponseHeader("Retry-After");p&&(g=parseFloat(p)*1e3)}this.log(`Steering manifest ${h.url} rate limited`);return}this.scheduleRefresh(this.uri||h.url,g)},onTimeout:(c,h,u)=>{this.log(`Timeout loading steering manifest (${h.url})`),this.scheduleRefresh(this.uri||h.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(n,A,l)}scheduleRefresh(e,t=this.timeToLoad*1e3){self.clearTimeout(this.reloadTimer),this.reloadTimer=self.setTimeout(()=>{this.loadSteeringManifest(e)},t)}}function Fh(s,e,t,i){s&&Object.keys(e).forEach(r=>{const n=s.filter(o=>o.groupId===r).map(o=>{const a=Ze({},o);return a.details=void 0,a.attrs=new Ke(a.attrs),a.url=a.attrs.URI=Mh(o.url,o.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),a.groupId=a.attrs["GROUP-ID"]=e[r],a.attrs["PATHWAY-ID"]=i,a});s.push(...n)})}function Mh(s,e,t,i){const{HOST:r,PARAMS:n,[t]:o}=i;let a;e&&(a=o==null?void 0:o[e],a&&(s=a));const A=new self.URL(s);return r&&!a&&(A.host=r),n&&Object.keys(n).sort().forEach(l=>{l&&A.searchParams.set(l,n[l])}),A.href}const ZE=/^age:\s*[\d.]+\s*$/im;class Ph{constructor(e){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=e&&e.xhrSetup||null,this.stats=new on,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=i,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e)return;const i=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const n=this.xhrSetup;n?Promise.resolve().then(()=>{if(!this.stats.aborted)return n(i,t.url)}).catch(o=>(i.open("GET",t.url,!0),n(i,t.url))).then(()=>{this.stats.aborted||this.openAndSendXhr(i,t,e)}).catch(o=>{this.callbacks.onError({code:i.status,text:o.message},t,i,r)}):this.openAndSendXhr(i,t,e)}openAndSendXhr(e,t,i){e.readyState||e.open("GET",t.url,!0);const r=this.context.headers,{maxTimeToFirstByteMs:n,maxLoadTimeMs:o}=i.loadPolicy;if(r)for(const a in r)e.setRequestHeader(a,r[a]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),i.timeout=n&&ce(n)?n:o,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:i}=this;if(!e||!t)return;const r=t.readyState,n=this.config;if(!i.aborted&&r>=2&&(i.loading.first===0&&(i.loading.first=Math.max(self.performance.now(),i.loading.start),n.timeout!==n.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),n.timeout=n.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.loadPolicy.maxLoadTimeMs-(i.loading.first-i.loading.start)))),r===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const o=t.status,a=t.responseType!=="text";if(o>=200&&o<300&&(a&&t.response||t.responseText!==null)){i.loading.end=Math.max(self.performance.now(),i.loading.first);const A=a?t.response:t.responseText,l=t.responseType==="arraybuffer"?A.byteLength:A.length;if(i.loaded=i.total=l,i.bwEstimate=i.total*8e3/(i.loading.end-i.loading.first),!this.callbacks)return;const c=this.callbacks.onProgress;if(c&&c(i,e,A,t),!this.callbacks)return;const h={url:t.responseURL,data:A,code:o};this.callbacks.onSuccess(h,i,e,t)}else{const A=n.loadPolicy.errorRetry,l=i.retry;gn(A,l,!1,o)?this.retry(A):(N.error(`${o} while loading ${e.url}`),this.callbacks.onError({code:o,text:t.statusText},e,t,i))}}}loadtimeout(){var e;const t=(e=this.config)==null?void 0:e.loadPolicy.timeoutRetry,i=this.stats.retry;if(gn(t,i,!0))this.retry(t);else{N.warn(`timeout while loading ${this.context.url}`);const r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:i}=this;this.retryDelay=Xo(e,i.retry),i.retry++,N.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t.url}, retrying ${i.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&ZE.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function eI(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const tI=/(\d+)-(\d+)\/(\d+)/;class Oh{constructor(e){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=e.fetchSetup||nI,this.controller=new self.AbortController,this.stats=new on}destroy(){this.loader=this.callbacks=null,this.abortInternal()}abortInternal(){const e=this.response;e!=null&&e.ok||(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,i){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const n=iI(e,this.controller.signal),o=i.onProgress,a=e.responseType==="arraybuffer",A=a?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=i,this.request=this.fetchSetup(e,n),self.clearTimeout(this.requestTimeout),t.timeout=l&&ce(l)?l:c,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),i.onTimeout(r,e,this.response)},t.timeout),self.fetch(this.request).then(h=>{this.response=this.loader=h;const u=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),i.onTimeout(r,e,this.response)},c-(u-r.loading.start)),!h.ok){const{status:d,statusText:g}=h;throw new oI(g||"fetch, bad network response",d,h)}return r.loading.first=u,r.total=rI(h.headers)||r.total,o&&ce(t.highWaterMark)?this.loadProgressively(h,r,e,t.highWaterMark,o):a?h.arrayBuffer():e.responseType==="json"?h.json():h.text()}).then(h=>{const{response:u}=this;self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const d=h[A];d&&(r.loaded=r.total=d);const g={url:u.url,data:h,code:u.status};o&&!ce(t.highWaterMark)&&o(r,e,h,u),i.onSuccess(g,r,e,u)}).catch(h=>{if(self.clearTimeout(this.requestTimeout),r.aborted)return;const u=h&&h.code||0,d=h?h.message:null;i.onError({code:u,text:d},e,h?h.details:null,r)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,i,r=0,n){const o=new dh,a=e.body.getReader(),A=()=>a.read().then(l=>{if(l.done)return o.dataLength&&n(t,i,o.flush(),e),Promise.resolve(new ArrayBuffer(0));const c=l.value,h=c.length;return t.loaded+=h,h<r||o.dataLength?(o.push(c),o.dataLength>=r&&n(t,i,o.flush(),e)):n(t,i,c,e),A()}).catch(()=>Promise.reject());return A()}}function iI(s,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(Ze({},s.headers))};return s.rangeEnd&&t.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),t}function sI(s){const e=tI.exec(s);if(e)return parseInt(e[2])-parseInt(e[1])+1}function rI(s){const e=s.get("Content-Range");if(e){const i=sI(e);if(ce(i))return i}const t=s.get("Content-Length");if(t)return parseInt(t)}function nI(s,e){return new self.Request(s.url,e)}class oI extends Error{constructor(e,t,i){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=i}}const aI=/\s/,AI={newCue(s,e,t,i){const r=[];let n,o,a,A,l;const c=self.VTTCue||self.TextTrackCue;for(let u=0;u<i.rows.length;u++)if(n=i.rows[u],a=!0,A=0,l="",!n.isEmpty()){var h;for(let f=0;f<n.chars.length;f++)aI.test(n.chars[f].uchar)&&a?A++:(l+=n.chars[f].uchar,a=!1);n.cueStartTime=e,e===t&&(t+=1e-4),A>=16?A--:A++;const d=Th(l.trim()),g=Ba(e,t,d);s!=null&&(h=s.cues)!=null&&h.getCueById(g)||(o=new c(e,t,d),o.id=g,o.line=u+1,o.align="left",o.position=10+Math.min(80,Math.floor(A*8/32)*10),r.push(o))}return s&&r.length&&(r.sort((u,d)=>u.line==="auto"||d.line==="auto"?0:u.line>8&&d.line>8?d.line-u.line:u.line-d.line),r.forEach(u=>Dc(s,u))),r}},lI={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},cI=vt(vt({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,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:Ph,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:gE,bufferController:vE,capLevelController:wa,errorController:op,fpsController:WE,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:sc,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,certLoadPolicy:{default:lI},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},hI()),{},{subtitleStreamController:mE,subtitleTrackController:yE,timelineController:KE,audioStreamController:pE,audioTrackController:EE,emeController:ps,cmcdController:xi,contentSteeringController:zE});function hI(){return{cueHandler:AI,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 uI(s,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const t=Ta(s),i=["manifest","level","frag"],r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(n=>{const o=`${n==="level"?"playlist":n}LoadPolicy`,a=e[o]===void 0,A=[];r.forEach(l=>{const c=`${n}Loading${l}`,h=e[c];if(h!==void 0&&a){A.push(c);const u=t[o].default;switch(e[o]={default:u},l){case"TimeOut":u.maxLoadTimeMs=h,u.maxTimeToFirstByteMs=h;break;case"MaxRetry":u.errorRetry.maxNumRetry=h,u.timeoutRetry.maxNumRetry=h;break;case"RetryDelay":u.errorRetry.retryDelayMs=h,u.timeoutRetry.retryDelayMs=h;break;case"MaxRetryTimeout":u.errorRetry.maxRetryDelayMs=h,u.timeoutRetry.maxRetryDelayMs=h;break}}}),A.length&&N.warn(`hls.js config: "${A.join('", "')}" setting(s) are deprecated, use "${o}": ${JSON.stringify(e[o])}`)}),vt(vt({},t),e)}function Ta(s){return s&&typeof s=="object"?Array.isArray(s)?s.map(Ta):Object.keys(s).reduce((e,t)=>(e[t]=Ta(s[t]),e),{}):s}function dI(s){const e=s.loader;e!==Oh&&e!==Ph?(N.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1):eI()&&(s.loader=Oh,s.progressive=!0,s.enableSoftwareAES=!0,N.log("[config]: Progressive streaming enabled, using FetchLoader"))}class hi{static get version(){return"1.4.12"}static isSupported(){return bp()}static get Events(){return E}static get ErrorTypes(){return ge}static get ErrorDetails(){return Y}static get DefaultConfig(){return hi.defaultConfig?hi.defaultConfig:cI}static set DefaultConfig(e){hi.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new da,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,Xf(e.debug||!1,"Hls instance");const t=this.config=uI(hi.DefaultConfig,e);this.userConfig=e,this._autoLevelCapping=-1,t.progressive&&dI(t);const{abrController:i,bufferController:r,capLevelController:n,errorController:o,fpsController:a}=t,A=new o(this),l=this.abrController=new i(this),c=this.bufferController=new r(this),h=this.capLevelController=new n(this),u=new a(this),d=new G0(this),g=new V0(this),f=t.contentSteeringController,p=f?new f(this):null,y=this.levelController=new Ap(this,p),B=new lp(this),Q=new hp(this.config),C=this.streamController=new uE(this,B,Q);h.setStreamController(C),u.setStreamController(C);const T=[d,y,C];p&&T.splice(1,0,p),this.networkControllers=T;const b=[l,c,h,u,g,B];this.audioTrackController=this.createController(t.audioTrackController,T);const L=t.audioStreamController;L&&T.push(new L(this,B,Q)),this.subtitleTrackController=this.createController(t.subtitleTrackController,T);const R=t.subtitleStreamController;R&&T.push(new R(this,B,Q)),this.createController(t.timelineController,b),Q.emeController=this.emeController=this.createController(t.emeController,b),this.cmcdController=this.createController(t.cmcdController,b),this.latencyController=this.createController(J0,b),this.coreComponents=b,T.push(A);const O=A.onErrorOut;typeof O=="function"&&this.on(E.ERROR,O,A)}createController(e,t){if(e){const i=new e(this);return t&&t.push(i),i}return null}on(e,t,i=this){this._emitter.on(e,t,i)}once(e,t,i=this){this._emitter.once(e,t,i)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,i=this,r){this._emitter.off(e,t,i,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,i){return this._emitter.emit(e,t,i)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(i){N.error("An internal error happened while handling event "+e+'. Error message: "'+i.message+'". Here is a stacktrace:',i),this.trigger(E.ERROR,{type:ge.OTHER_ERROR,details:Y.INTERNAL_EXCEPTION,fatal:!1,event:e,error:i})}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){N.log("destroy"),this.trigger(E.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){N.log("attachMedia"),this._media=e,this.trigger(E.MEDIA_ATTACHING,{media:e})}detachMedia(){N.log("detachMedia"),this.trigger(E.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,i=this.url,r=this.url=ko.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});N.log(`loadSource:${r}`),t&&i&&(i!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(E.MANIFEST_LOADING,{url:e})}startLoad(e=-1){N.log(`startLoad(${e})`),this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){N.log("stopLoad"),this.networkControllers.forEach(e=>{e.stopLoad()})}swapAudioCodec(){N.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){N.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e,t=0){this.levelController.removeLevel(e,t)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){N.log(`set currentLevel:${e}`),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){N.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){N.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){N.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){return this.levelController.startLevel}set startLevel(e){N.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(N.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e)}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Wo.indexOf(e)>-1&&(this._maxHdcpLevel=e)}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const i=e.length;for(let r=0;r<i;r++)if(e[r].maxBitrate>=t)return r;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:i}=this;let r;if(t===-1&&e&&e.length?r=e.length-1:r=t,i)for(let n=r;n--;){const o=e[n].attrs["HDCP-LEVEL"];if(o&&o<=i)return n}return r}get nextAutoLevel(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)}set nextAutoLevel(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}hi.defaultConfig=void 0;var gI=cr;cr.flatten=cr,cr.unflatten=Hh;function Uh(s){return s&&s.constructor&&typeof s.constructor.isBuffer=="function"&&s.constructor.isBuffer(s)}function Gh(s){return s}function cr(s,e){e=e||{};const t=e.delimiter||".",i=e.maxDepth,r=e.transformKey||Gh,n={};function o(a,A,l){l=l||1,Object.keys(a).forEach(function(c){const h=a[c],u=e.safe&&Array.isArray(h),d=Object.prototype.toString.call(h),g=Uh(h),f=d==="[object Object]"||d==="[object Array]",p=A?A+t+r(c):r(c);if(!u&&!g&&f&&Object.keys(h).length&&(!e.maxDepth||l<i))return o(h,p,l+1);n[p]=h})}return o(s),n}function Hh(s,e){e=e||{};const t=e.delimiter||".",i=e.overwrite||!1,r=e.transformKey||Gh,n={};if(Uh(s)||Object.prototype.toString.call(s)!=="[object Object]")return s;function a(c){const h=Number(c);return isNaN(h)||c.indexOf(".")!==-1||e.object?c:h}function A(c,h,u){return Object.keys(u).reduce(function(d,g){return d[c+t+g]=u[g],d},h)}function l(c){const h=Object.prototype.toString.call(c),u=h==="[object Array]",d=h==="[object Object]";if(c){if(u)return!c.length;if(d)return!Object.keys(c).length}else return!0}return s=Object.keys(s).reduce(function(c,h){const u=Object.prototype.toString.call(s[h]);return!(u==="[object Object]"||u==="[object Array]")||l(s[h])?(c[h]=s[h],c):A(h,c,cr(s[h],e))},{}),Object.keys(s).forEach(function(c){const h=c.split(t).map(r);let u=a(h.shift()),d=a(h[0]),g=n;for(;d!==void 0;){if(u==="__proto__")return;const f=Object.prototype.toString.call(g[u]),p=f==="[object Object]"||f==="[object Array]";if(!i&&!p&&typeof g[u]<"u")return;(i&&!p||!i&&g[u]==null)&&(g[u]=typeof d=="number"&&!e.object?[]:{}),g=g[u],h.length>0&&(u=a(h.shift()),d=a(h[0]))}g[u]=Hh(s[c],e)}),n}const fI=yo(gI);var $h=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function pI(s,e){return!!(s===e||$h(s)&&$h(e))}function EI(s,e){if(s.length!==e.length)return!1;for(var t=0;t<s.length;t++)if(!pI(s[t],e[t]))return!1;return!0}function II(s,e){e===void 0&&(e=EI);var t=null;function i(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t&&t.lastThis===this&&e(r,t.lastArgs))return t.lastResult;var o=s.apply(this,r);return t={lastResult:o,lastArgs:r,lastThis:this},o}return i.clear=function(){t=null},i}/**
|
201
|
+
`),l=[],c=e?Xp(e.baseTime,e.timescale):0;let h="00:00.000",u=0,d=0,g,f=!0;a.oncue=function(p){const y=t[i];let B=t.ccOffset;const Q=(u-c)/9e4;if(y!=null&&y.new&&(d!==void 0?B=t.ccOffset=y.start:OE(t,i,Q)),Q){if(!e){g=new Error("Missing initPTS for VTT MPEGTS");return}B=Q-t.presentationOffset}const C=p.endTime-p.startTime,T=_t((p.startTime+B-d)*9e4,r*9e4)/9e4;p.startTime=Math.max(T,0),p.endTime=Math.max(T+C,0);const b=p.text.trim();p.text=decodeURIComponent(encodeURIComponent(b)),p.id||(p.id=Ba(p.startTime,p.endTime,b)),p.endTime>0&&l.push(p)},a.onparsingerror=function(p){g=p},a.onflush=function(){if(g){o(g);return}n(l)},A.forEach(p=>{if(f)if(Ca(p,"X-TIMESTAMP-MAP=")){f=!1,p.slice(16).split(",").forEach(y=>{Ca(y,"LOCAL:")?h=y.slice(6):Ca(y,"MPEGTS:")&&(u=parseInt(y.slice(7)))});try{d=PE(h)/1e3}catch(y){g=y}return}else p===""&&(f=!1);a.parse(p+`
|
202
|
+
`)}),a.flush()}const va="stpp.ttml.im1t",Dh=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Rh=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,GE={left:"start",center:"center",right:"end",start:"start",end:"end"};function Lh(s,e,t,i){const r=xe(new Uint8Array(s),["mdat"]);if(r.length===0){i(new Error("Could not parse IMSC1 mdat"));return}const n=r.map(a=>Vt(a)),o=jp(e.baseTime,1,e.timescale);try{n.forEach(a=>t(HE(a,o)))}catch(a){i(a)}}function HE(s,e){const r=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");const n={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},o=Object.keys(n).reduce((h,u)=>(h[u]=r.getAttribute(`ttp:${u}`)||n[u],h),{}),a=r.getAttribute("xml:space")!=="preserve",A=_h(Qa(r,"styling","style")),l=_h(Qa(r,"layout","region")),c=Qa(r,"body","[begin]");return[].map.call(c,h=>{const u=kh(h,a);if(!u||!h.hasAttribute("begin"))return null;const d=Sa(h.getAttribute("begin"),o),g=Sa(h.getAttribute("dur"),o);let f=Sa(h.getAttribute("end"),o);if(d===null)throw Nh(h);if(f===null){if(g===null)throw Nh(h);f=d+g}const p=new Ia(d-e,f-e,u);p.id=Ba(p.startTime,p.endTime,p.text);const y=l[h.getAttribute("region")],B=A[h.getAttribute("style")],Q=$E(y,B,A),{textAlign:C}=Q;if(C){const T=GE[C];T&&(p.lineAlign=T),p.align=C}return Ze(p,Q),p}).filter(h=>h!==null)}function Qa(s,e,t){const i=s.getElementsByTagName(e)[0];return i?[].slice.call(i.querySelectorAll(t)):[]}function _h(s){return s.reduce((e,t)=>{const i=t.getAttribute("xml:id");return i&&(e[i]=t),e},{})}function kh(s,e){return[].slice.call(s.childNodes).reduce((t,i,r)=>{var n;return i.nodeName==="br"&&r?t+`
|
203
|
+
`:(n=i.childNodes)!=null&&n.length?kh(i,e):e?t+i.textContent.trim().replace(/\s+/g," "):t+i.textContent},"")}function $E(s,e,t){const i="http://www.w3.org/ns/ttml#styling";let r=null;const n=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],o=s!=null&&s.hasAttribute("style")?s.getAttribute("style"):null;return o&&t.hasOwnProperty(o)&&(r=t[o]),n.reduce((a,A)=>{const l=ba(e,i,A)||ba(s,i,A)||ba(r,i,A);return l&&(a[A]=l),a},{})}function ba(s,e,t){return s&&s.hasAttributeNS(e,t)?s.getAttributeNS(e,t):null}function Nh(s){return new Error(`Could not parse ttml timestamp ${s}`)}function Sa(s,e){if(!s)return null;let t=wh(s);return t===null&&(Dh.test(s)?t=YE(s,e):Rh.test(s)&&(t=KE(s,e))),t}function YE(s,e){const t=Dh.exec(s),i=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+i/e.frameRate}function KE(s,e){const t=Rh.exec(s),i=Number(t[1]);switch(t[2]){case"h":return i*3600;case"m":return i*60;case"ms":return i*1e3;case"f":return i/e.frameRate;case"t":return i/e.tickRate}return i}class VE{constructor(e){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.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Fh(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.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){const t=new vn(this,"textTrack1"),i=new vn(this,"textTrack2"),r=new vn(this,"textTrack3"),n=new vn(this,"textTrack4");this.cea608Parser1=new Qh(1,t,i),this.cea608Parser2=new Qh(3,r,n)}e.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(E.FRAG_LOADING,this.onFragLoading,this),e.on(E.FRAG_LOADED,this.onFragLoaded,this),e.on(E.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(E.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(E.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(E.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(E.FRAG_LOADING,this.onFragLoading,this),e.off(E.FRAG_LOADED,this.onFragLoaded,this),e.off(E.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(E.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(E.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(E.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null}addCues(e,t,i,r,n){let o=!1;for(let a=n.length;a--;){const A=n[a],l=WE(A[0],A[1],t,i);if(l>=0&&(A[0]=Math.min(A[0],t),A[1]=Math.max(A[1],i),o=!0,l/(i-t)>.5))return}if(o||n.push([t,i]),this.config.renderTextTracksNatively){const a=this.captionsTracks[e];this.Cues.newCue(a,t,i,r)}else{const a=this.Cues.newCue(null,t,i,r);this.hls.trigger(E.CUES_PARSED,{type:"captions",cues:a,track:e})}}onInitPtsFound(e,{frag:t,id:i,initPTS:r,timescale:n}){const{unparsedVttFrags:o}=this;i==="main"&&(this.initPTS[t.cc]={baseTime:r,timescale:n}),o.length&&(this.unparsedVttFrags=[],o.forEach(a=>{this.onFragLoaded(E.FRAG_LOADED,a)}))}getExistingTrack(e){const{media:t}=this;if(t)for(let i=0;i<t.textTracks.length;i++){const r=t.textTracks[i];if(r[e])return r}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:i,media:r}=this,{label:n,languageCode:o}=t[e],a=this.getExistingTrack(e);if(a)i[e]=a,hs(i[e]),Dc(i[e],r);else{const A=this.createTextTrack("captions",n,o);A&&(A[e]=!0,i[e]=A)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const i=t.label,r={_id:e,label:i,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=r,this.hls.trigger(E.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[r]})}createTextTrack(e,t,i){const r=this.media;if(r)return r.addTextTrack(e,t,i)}onMediaAttaching(e,t){this.media=t.media,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:e}=this;Object.keys(e).forEach(t=>{hs(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Fh(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let i=0;i<t.length;i++)hs(t[i])}onSubtitleTracksUpdated(e,t){const i=t.subtitleTracks||[],r=i.some(n=>n.textCodec===va);if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(ph(this.tracks,i)){this.tracks=i;return}if(this.textTracks=[],this.tracks=i,this.config.renderTextTracksNatively){const o=this.media?this.media.textTracks:null;this.tracks.forEach((a,A)=>{let l;if(o&&A<o.length){let c=null;for(let h=0;h<o.length;h++)if(JE(o[h],a)){c=o[h];break}c&&(l=c)}if(l)hs(l);else{const c=this._captionsOrSubtitlesFromCharacteristics(a);l=this.createTextTrack(c,a.name,a.lang),l&&(l.mode="disabled")}l&&(l.groupId=a.groupId,this.textTracks.push(l))})}else if(this.tracks.length){const o=this.tracks.map(a=>({label:a.name,kind:a.type.toLowerCase(),default:a.default,subtitleTrack:a}));this.hls.trigger(E.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:o})}}}_captionsOrSubtitlesFromCharacteristics(e){if(e.attrs.CHARACTERISTICS){const t=/transcribes-spoken-dialog/gi.test(e.attrs.CHARACTERISTICS),i=/describes-music-and-sound/gi.test(e.attrs.CHARACTERISTICS);if(t&&i)return"captions"}return"subtitles"}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(i=>{const r=/(?:CC|SERVICE)([1-4])/.exec(i.instreamId);if(!r)return;const n=`textTrack${r[1]}`,o=this.captionsProperties[n];o&&(o.label=i.name,i.lang&&(o.languageCode=i.lang),o.media=i)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){const{cea608Parser1:i,cea608Parser2:r,lastSn:n,lastPartIndex:o}=this;if(!(!this.enabled||!(i&&r))&&t.frag.type===pe.MAIN){var a,A;const l=t.frag.sn,c=(a=t==null||(A=t.part)==null?void 0:A.index)!=null?a:-1;l===n+1||l===n&&c===o+1||(i.reset(),r.reset()),this.lastSn=l,this.lastPartIndex=c}}onFragLoaded(e,t){const{frag:i,payload:r}=t;if(i.type===pe.SUBTITLE)if(r.byteLength){const n=i.decryptdata,o="stats"in t;if(n==null||!n.encrypted||o){const a=this.tracks[i.level],A=this.vttCCs;A[i.cc]||(A[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),a&&a.textCodec===va?this._parseIMSC1(i,r):this._parseVTTs(t)}}else this.hls.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const i=this.hls;Lh(t,this.initPTS[e.cc],r=>{this._appendCues(r,e.level),i.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},r=>{N.log(`Failed to parse IMSC1: ${r}`),i.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:r})})}_parseVTTs(e){var t;const{frag:i,payload:r}=e,{initPTS:n,unparsedVttFrags:o}=this,a=n.length-1;if(!n[i.cc]&&a===-1){o.push(e);return}const A=this.hls,l=(t=i.initSegment)!=null&&t.data?ji(i.initSegment.data,new Uint8Array(r)):r;UE(l,this.initPTS[i.cc],this.vttCCs,i.cc,i.start,c=>{this._appendCues(c,i.level),A.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},c=>{const h=c.message==="Missing initPTS for VTT MPEGTS";h?o.push(e):this._fallbackToIMSC1(i,r),N.log(`Failed to parse VTT cue: ${c}`),!(h&&a>i.cc)&&A.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:c})})}_fallbackToIMSC1(e,t){const i=this.tracks[e.level];i.textCodec||Lh(t,this.initPTS[e.cc],()=>{i.textCodec=va,this._parseIMSC1(e,t)},()=>{i.textCodec="wvtt"})}_appendCues(e,t){const i=this.hls;if(this.config.renderTextTracksNatively){const r=this.textTracks[t];if(!r||r.mode==="disabled")return;e.forEach(n=>Rc(r,n))}else{const r=this.tracks[t];if(!r)return;const n=r.default?"default":"subtitles"+t;i.trigger(E.CUES_PARSED,{type:"subtitles",cues:e,track:n})}}onFragDecrypted(e,t){const{frag:i}=t;i.type===pe.SUBTITLE&&this.onFragLoaded(E.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){const{cea608Parser1:i,cea608Parser2:r}=this;if(!this.enabled||!(i&&r))return;const{frag:n,samples:o}=t;if(!(n.type===pe.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let a=0;a<o.length;a++){const A=o[a].bytes;if(A){const l=this.extractCea608Data(A);i.addData(o[a].pts,l[0]),r.addData(o[a].pts,l[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:i,endOffsetSubtitles:r,type:n}){const{media:o}=this;if(!(!o||o.currentTime<i)){if(!n||n==="video"){const{captionsTracks:a}=this;Object.keys(a).forEach(A=>Ko(a[A],t,i))}if(this.config.renderTextTracksNatively&&t===0&&r!==void 0){const{textTracks:a}=this;Object.keys(a).forEach(A=>Ko(a[A],t,r))}}}extractCea608Data(e){const t=[[],[]],i=e[0]&31;let r=2;for(let n=0;n<i;n++){const o=e[r++],a=127&e[r++],A=127&e[r++];if(a===0&&A===0)continue;if((4&o)!==0){const c=3&o;(c===0||c===1)&&(t[c].push(a),t[c].push(A))}}return t}}function JE(s,e){return!!s&&s.label===e.name&&!(s.textTrack1||s.textTrack2)}function WE(s,e,t,i){return Math.min(e,i)-Math.max(s,t)}function Fh(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}class wa{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(E.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(E.MANIFEST_PARSED,this.onManifestParsed,this),e.on(E.BUFFER_CODECS,this.onBufferCodecs,this),e.on(E.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(E.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(E.MANIFEST_PARSED,this.onManifestParsed,this),e.off(E.BUFFER_CODECS,this.onBufferCodecs,this),e.off(E.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const i=this.hls.levels[t.droppedLevel];this.isLevelAllowed(i)&&this.restrictedLevels.push({bitrate:i.bitrate,height:i.height,width:i.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null}onManifestParsed(e,t){const i=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,i.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){const e=this.hls.levels;if(e.length){const t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const i=t.filter((r,n)=>this.isLevelAllowed(r)&&n<=e);return this.clientRect=null,wa.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)}startCapping(){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())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const i=e.getBoundingClientRect();t.width=i.width,t.height=i.height,!t.width&&!t.height&&(t.width=i.right-i.left||e.width||0,t.height=i.bottom-i.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return e}isLevelAllowed(e){return!this.restrictedLevels.some(i=>e.bitrate===i.bitrate&&e.width===i.width&&e.height===i.height)}static getMaxLevelByMediaSize(e,t,i){if(!(e!=null&&e.length))return-1;const r=(o,a)=>a?o.width!==a.width||o.height!==a.height:!0;let n=e.length-1;for(let o=0;o<e.length;o+=1){const a=e[o];if((a.width>=t||a.height>=i)&&r(a,e[o+1])){n=o;break}}return n}}class qE{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const i=this.hls.config;if(i.capLevelOnFPSDrop){const r=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=r,r&&typeof r.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,i){const r=performance.now();if(t){if(this.lastTime){const n=r-this.lastTime,o=i-this.lastDroppedFrames,a=t-this.lastDecodedFrames,A=1e3*o/n,l=this.hls;if(l.trigger(E.FPS_DROP,{currentDropped:o,currentDecoded:a,totalDroppedFrames:i}),A>0&&o>l.config.fpsDroppedMonitoringThreshold*a){let c=l.currentLevel;N.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=c)&&(c=c-1,l.trigger(E.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:l.currentLevel}),l.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=i,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const bn="[eme]";class ps{constructor(e){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=ps.CDMCleanupPromise?[ps.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=N.debug.bind(N,bn),this.log=N.log.bind(N,bn),this.warn=N.warn.bind(N,bn),this.error=N.error.bind(N,bn),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(E.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(E.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(E.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(E.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(E.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(E.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:i}=this.config,r=t[e];if(r)return r.licenseUrl;if(e===Ve.WIDEVINE&&i)return i;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,i=t[e];if(i)return i.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,i=(o,a,A)=>!!o&&A.indexOf(o)===a,r=t.map(o=>o.audioCodec).filter(i),n=t.map(o=>o.videoCodec).filter(i);return r.length+n.length===0&&n.push("avc1.42e01e"),new Promise((o,a)=>{const A=l=>{const c=l.shift();this.getMediaKeysPromise(c,r,n).then(h=>o({keySystem:c,mediaKeys:h})).catch(h=>{l.length?A(l):h instanceof kt?a(h):a(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_NO_ACCESS,error:h,fatal:!0},h.message))})};A(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:i}=this.config;if(typeof i!="function"){let r=`Configured requestMediaKeySystemAccess is not a function ${i}`;return rc===null&&self.location.protocol==="http:"&&(r=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(r))}return i(e,t)}getMediaKeysPromise(e,t,i){const r=l0(e,t,i,this.config.drmSystemOptions),n=this.keySystemAccessPromises[e];let o=n==null?void 0:n.keySystemAccess;if(!o){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(r)}`),o=this.requestMediaKeySystemAccess(e,r);const a=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch(A=>{this.log(`Failed to obtain access to key-system "${e}": ${A}`)}),o.then(A=>{this.log(`Access for key-system "${A.keySystem}" obtained`);const l=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),a.mediaKeys=A.createMediaKeys().then(c=>(this.log(`Media-keys created for "${e}"`),l.then(h=>h?this.setMediaKeysServerCertificate(c,e,h):c))),a.mediaKeys.catch(c=>{this.error(`Failed to create media-keys for "${e}"}: ${c}`)}),a.mediaKeys})}return o.then(()=>n.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:i}){this.log(`Creating key-system session "${t}" keyId: ${Jt.hexDump(e.keyId||[])}`);const r=i.createSession(),n={decryptdata:e,keySystem:t,mediaKeys:i,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(n),n}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const i=this.createMediaKeySessionContext(e),r=this.getKeyIdString(t),n="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(i,n,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Jt.hexDump(e.keyId)}updateKeySession(e,t){var i;const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyID ${Jt.hexDump(((i=e.decryptdata)==null?void 0:i.keyId)||[])}
|
204
|
+
} (data length: ${t&&t.byteLength})`),r.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,i)=>{const r=Po(this.config),n=e.map(tc).filter(o=>!!o&&r.indexOf(o)!==-1);return this.getKeySystemSelectionPromise(n).then(({keySystem:o})=>{const a=sc(o);a?t(a):i(new Error(`Unable to find format for key-system "${o}"`))}).catch(i)})}loadKey(e){const t=e.keyInfo.decryptdata,i=this.getKeyIdString(t),r=`(keyId: ${i} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);let n=this.keyIdToKeySessionPromise[i];return n||(n=this.keyIdToKeySessionPromise[i]=this.getKeySystemForKeyPromise(t).then(({keySystem:o,mediaKeys:a})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(o,a).then(()=>{this.throwIfDestroyed();const A=this.createMediaKeySessionContext({keySystem:o,mediaKeys:a,decryptdata:t}),l="cenc";return this.generateRequestWithPreferredKeySession(A,l,t.pssh,"playlist-key")}))),n.catch(o=>this.handleError(o))),n}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof kt?this.hls.trigger(E.ERROR,e.data):this.hls.trigger(E.ERROR,{type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),i=this.keyIdToKeySessionPromise[t];if(!i){const r=tc(e.keyFormat),n=r?[r]:Po(this.config);return this.attemptKeySystemAccess(n)}return i}getKeySystemSelectionPromise(e){if(e.length||(e=Po(this.config)),e.length===0)throw new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:i}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),i===null)return;let r,n;if(t==="sinf"&&this.config.drmSystems[Ve.FAIRPLAY]){const c=At(new Uint8Array(i));try{const h=Mo(JSON.parse(c).sinf),u=uc(new Uint8Array(h));if(!u)return;r=u.subarray(8,24),n=Ve.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const c=_0(i);if(c===null)return;c.version===0&&c.systemId===ic.WIDEVINE&&c.data&&(r=c.data.subarray(8,24)),n=A0(c.systemId)}if(!n||!r)return;const o=Jt.hexDump(r),{keyIdToKeySessionPromise:a,mediaKeySessions:A}=this;let l=a[o];for(let c=0;c<A.length;c++){const h=A[c],u=h.decryptdata;if(u.pssh||!u.keyId)continue;const d=Jt.hexDump(u.keyId);if(o===d||u.uri.replace(/-/g,"").indexOf(o)!==-1){l=a[d],delete a[d],u.pssh=new Uint8Array(i),u.keyId=r,l=a[o]=l.then(()=>this.generateRequestWithPreferredKeySession(h,t,i,"encrypted-event-key-match"));break}}l||(l=a[o]=this.getKeySystemSelectionPromise([n]).then(({keySystem:c,mediaKeys:h})=>{var u;this.throwIfDestroyed();const d=new rr("ISO-23001-7",o,(u=sc(c))!=null?u:"");return d.pssh=new Uint8Array(i),d.keyId=r,this.attemptSetMediaKeys(c,h).then(()=>{this.throwIfDestroyed();const g=this.createMediaKeySessionContext({decryptdata:d,keySystem:c,mediaKeys:h});return this.generateRequestWithPreferredKeySession(g,t,i,"encrypted-event-no-match")})})),l.catch(c=>this.handleError(c))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const i=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const r=Promise.all(i).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(r),r.then(()=>{this.log(`Media-keys set for "${e}"`),i.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(n=>i.indexOf(n)===-1)})}generateRequestWithPreferredKeySession(e,t,i,r){var n,o;const a=(n=this.config.drmSystems)==null||(o=n[e.keySystem])==null?void 0:o.generateRequest;if(a)try{const u=a.call(this.hls,t,i,e);if(!u)throw new Error("Invalid response from configured generateRequest filter");t=u.initDataType,i=e.decryptdata.pssh=u.initData?new Uint8Array(u.initData):null}catch(u){var A;if(this.warn(u.message),(A=this.hls)!=null&&A.config.debug)throw u}if(i===null)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(e);const l=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${r}": ${l} (init data type: ${t} length: ${i?i.byteLength:null})`);const c=new da;e.mediaKeysSession.onmessage=u=>{const d=e.mediaKeysSession;if(!d){c.emit("error",new Error("invalid state"));return}const{messageType:g,message:f}=u;this.log(`"${g}" message event for session "${d.sessionId}" message size: ${f.byteLength}`),g==="license-request"||g==="license-renewal"?this.renewLicense(e,f).catch(p=>{this.handleError(p),c.emit("error",p)}):g==="license-release"?e.keySystem===Ve.FAIRPLAY&&(this.updateKeySession(e,ec("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${g}"`)},e.mediaKeysSession.onkeystatuseschange=u=>{if(!e.mediaKeysSession){c.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const g=e.keyStatus;c.emit("keyStatus",g),g==="expired"&&(this.warn(`${e.keySystem} expired for key ${l}`),this.renewKeySession(e))};const h=new Promise((u,d)=>{c.on("error",d),c.on("keyStatus",g=>{g.startsWith("usable")?u():g==="output-restricted"?d(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):g==="internal-error"?d(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${g}"`)):g==="expired"?d(new Error("key expired while generating request")):this.warn(`unhandled key status change "${g}"`)})});return e.mediaKeysSession.generateRequest(t,i).then(()=>{var u;this.log(`Request generated for key-session "${(u=e.mediaKeysSession)==null?void 0:u.sessionId}" keyId: ${l}`)}).catch(u=>{throw new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_NO_SESSION,error:u,fatal:!1},`Error generating key-session request: ${u}`)}).then(()=>h).catch(u=>{throw c.removeAllListeners(),this.removeSession(e),u}).then(()=>(c.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,i)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${Jt.hexDump("buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i))} session keyId: ${Jt.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,i=t.loader,r=new i(t),n=this.getServerCertificateUrl(e);return n?(this.log(`Fetching serverCertificate for "${e}"`),new Promise((o,a)=>{const A={responseType:"arraybuffer",url:n},l=t.certLoadPolicy.default,c={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(u,d,g,f)=>{o(u.data)},onError:(u,d,g,f)=>{a(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:g,response:vt({url:A.url,data:void 0},u)},`"${e}" certificate request failed (${n}). Status: ${u.code} (${u.text})`))},onTimeout:(u,d,g)=>{a(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:g,response:{url:A.url,data:void 0}},`"${e}" certificate request timed out (${n})`))},onAbort:(u,d,g)=>{a(new Error("aborted"))}};r.load(A,c,h)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,i){return new Promise((r,n)=>{e.setServerCertificate(i).then(o=>{this.log(`setServerCertificate ${o?"success":"not supported by CDM"} (${i==null?void 0:i.byteLength}) on "${t}"`),r(e)}).catch(o=>{n(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:o,fatal:!0},o.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(i=>this.updateKeySession(e,new Uint8Array(i)).catch(r=>{throw new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:r,fatal:!0},r.message)}))}setupLicenseXHR(e,t,i,r){const n=this.config.licenseXhrSetup;return n?Promise.resolve().then(()=>{if(!i.decryptdata)throw new Error("Key removed");return n.call(this.hls,e,t,i,r)}).catch(o=>{if(!i.decryptdata)throw o;return e.open("POST",t,!0),n.call(this.hls,e,t,i,r)}).then(o=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:o||r})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}requestLicense(e,t){const i=this.config.keyLoadPolicy.default;return new Promise((r,n)=>{const o=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${o}`);const a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return n(new Error("invalid state"));if(a.readyState===4)if(a.status===200){this._requestLicenseFailureCount=0;let A=a.response;this.log(`License received ${A instanceof ArrayBuffer?A.byteLength:A}`);const l=this.config.licenseResponseCallback;if(l)try{A=l.call(this.hls,a,o,e)}catch(c){this.error(c)}r(A)}else{const A=i.errorRetry,l=A?A.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||a.status>=400&&a.status<500)n(new kt({type:ge.KEY_SYSTEM_ERROR,details:Y.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:{url:o,data:void 0,code:a.status,text:a.statusText}},`License Request XHR failed (${o}). Status: ${a.status} (${a.statusText})`));else{const c=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${c} attempts left`),this.requestLicense(e,t).then(r,n)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=a,this.setupLicenseXHR(a,o,e,t).then(({xhr:A,licenseChallenge:l})=>{A.send(l)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const i=t.media;this.media=i,i.addEventListener("encrypted",this.onMediaEncrypted),i.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},rr.clearKeyUriToKeyIdMap();const i=t.length;ps.CDMCleanupPromise=Promise.all(t.map(r=>this.removeSession(r)).concat(e==null?void 0:e.setMediaKeys(null).catch(r=>{this.log(`Could not clear media keys: ${r}. media.src: ${e==null?void 0:e.src}`)}))).then(()=>{i&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(r=>{this.log(`Could not close sessions and clear media keys: ${r}. media.src: ${e==null?void 0:e.src}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const i=t.reduce((r,n)=>(r.indexOf(n.keyFormat)===-1&&r.push(n.keyFormat),r),[]);this.log(`Selecting key-system from session-keys ${i.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(i)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:i}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),t.onmessage=null,t.onkeystatuseschange=null,i&&i.readyState!==XMLHttpRequest.DONE&&i.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(e);return r>-1&&this.mediaKeySessions.splice(r,1),t.remove().catch(n=>{this.log(`Could not remove session: ${n}`)}).then(()=>t.close()).catch(n=>{this.log(`Could not close session: ${n}`)})}}}ps.CDMCleanupPromise=void 0;class kt extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}const jE=1;var St={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"};const XE="h";class xi{constructor(e){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=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=r=>{try{this.apply(r,{ot:St.MANIFEST,su:!this.initialized})}catch(n){N.warn("Could not generate manifest CMCD data.",n)}},this.applyFragmentData=r=>{try{const n=r.frag,o=this.hls.levels[n.level],a=this.getObjectType(n),A={d:n.duration*1e3,ot:a};(a===St.VIDEO||a===St.AUDIO||a==St.MUXED)&&(A.br=o.bitrate/1e3,A.tb=this.getTopBandwidth(a)/1e3,A.bl=this.getBufferLength(a)),this.apply(r,A)}catch(n){N.warn("Could not generate segment CMCD data.",n)}},this.hls=e;const t=this.config=e.config,{cmcd:i}=t;i!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||xi.uuid(),this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.registerListeners())}registerListeners(){const e=this.hls;e.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(E.MEDIA_DETACHED,this.onMediaDetached,this),e.on(E.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(E.MEDIA_DETACHED,this.onMediaDetached,this),e.off(E.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var i,r;this.audioBuffer=(i=t.tracks.audio)==null?void 0:i.buffer,this.videoBuffer=(r=t.tracks.video)==null?void 0:r.buffer}createData(){var e;return{v:jE,sf:XE,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){Ze(t,this.createData());const i=t.ot===St.INIT||t.ot===St.VIDEO||t.ot===St.MUXED;if(this.starved&&i&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering),this.useHeaders){const r=xi.toHeaders(t);if(!Object.keys(r).length)return;e.headers||(e.headers={}),Ze(e.headers,r)}else{const r=xi.toQuery(t);if(!r)return;e.url=xi.appendQueryToUri(e.url,r)}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return St.TIMED_TEXT;if(e.sn==="initSegment")return St.INIT;if(t==="audio")return St.AUDIO;if(t==="main")return this.hls.audioTracks.length?St.VIDEO:St.MUXED}getTopBandwidth(e){let t=0,i;const r=this.hls;if(e===St.AUDIO)i=r.audioTracks;else{const n=r.maxAutoLevel,o=n>-1?n+1:r.levels.length;i=r.levels.slice(0,o)}for(const n of i)n.bitrate>t&&(t=n.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,i=e===St.AUDIO?this.audioBuffer:this.videoBuffer;return!i||!t?NaN:Ge.bufferInfo(i,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,i=e||this.config.loader;return class{constructor(n){this.loader=void 0,this.loader=new i(n)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(n,o,a){t(n),this.loader.load(n,o,a)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,i=e||this.config.loader;return class{constructor(n){this.loader=void 0,this.loader=new i(n)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(n,o,a){t(n),this.loader.load(n,o,a)}}}static uuid(){const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}static serialize(e){const t=[],i=l=>!Number.isNaN(l)&&l!=null&&l!==""&&l!==!1,r=l=>Math.round(l),n=l=>r(l/100)*100,a={br:r,d:r,bl:n,dl:n,mtp:n,nor:l=>encodeURIComponent(l),rtp:n,tb:r},A=Object.keys(e||{}).sort();for(const l of A){let c=e[l];if(!i(c)||l==="v"&&c===1||l=="pr"&&c===1)continue;const h=a[l];h&&(c=h(c));const u=typeof c;let d;l==="ot"||l==="sf"||l==="st"?d=`${l}=${c}`:u==="boolean"?d=l:u==="number"?d=`${l}=${c}`:d=`${l}=${JSON.stringify(c)}`,t.push(d)}return t.join(",")}static toHeaders(e){const t=Object.keys(e),i={},r=["Object","Request","Session","Status"],n=[{},{},{},{}],o={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};for(const a of t){const A=o[a]!=null?o[a]:1;n[A][a]=e[a]}for(let a=0;a<n.length;a++){const A=xi.serialize(n[a]);A&&(i[`CMCD-${r[a]}`]=A)}return i}static toQuery(e){return`CMCD=${encodeURIComponent(xi.serialize(e))}`}static appendQueryToUri(e,t){if(!t)return e;const i=e.includes("?")?"&":"?";return`${e}${i}${t}`}}const zE=3e5;class ZE{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=N.log.bind(N,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(E.MANIFEST_LOADING,this.onManifestLoading,this),e.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(E.MANIFEST_PARSED,this.onManifestParsed,this),e.on(E.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(E.MANIFEST_LOADING,this.onManifestLoading,this),e.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(E.MANIFEST_PARSED,this.onManifestParsed,this),e.off(E.ERROR,this.onError,this))}startLoad(){if(this.started=!0,self.clearTimeout(this.reloadTimer),this.enabled&&this.uri)if(this.updated){const e=Math.max(this.timeToLoad*1e3-(performance.now()-this.updated),0);this.scheduleRefresh(this.uri,e)}else this.loadSteeringManifest(this.uri)}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),self.clearTimeout(this.reloadTimer)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(i=>i!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:i}=t;i!==null&&(this.pathwayId=i.pathwayId,this.uri=i.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:i}=t;if((i==null?void 0:i.action)===dt.SendAlternateToPenaltyBox&&i.flags===Lt.MoveAllAlternatesMatchingHost){let r=this.pathwayPriority;const n=this.pathwayId;this.penalizedPathways[n]||(this.penalizedPathways[n]=performance.now()),!r&&this.levels&&(r=this.levels.reduce((o,a)=>(o.indexOf(a.pathwayId)===-1&&o.push(a.pathwayId),o),[])),r&&r.length>1&&(this.updatePathwayPriority(r),i.resolved=this.pathwayId!==n)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const i=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${i}"`),t=this.getLevelsForPathway(i),this.pathwayId=i}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let t;const i=this.penalizedPathways,r=performance.now();Object.keys(i).forEach(n=>{r-i[n]>zE&&delete i[n]});for(let n=0;n<e.length;n++){const o=e[n];if(i[o])continue;if(o===this.pathwayId)return;const a=this.hls.nextLoadLevel,A=this.hls.levels[a];if(t=this.getLevelsForPathway(o),t.length>0){this.log(`Setting Pathway to "${o}"`),this.pathwayId=o,this.hls.trigger(E.LEVELS_UPDATED,{levels:t});const l=this.hls.levels[a];A&&l&&this.levels&&(l.attrs["STABLE-VARIANT-ID"]!==A.attrs["STABLE-VARIANT-ID"]&&l.bitrate!==A.bitrate&&this.log(`Unstable Pathways change from bitrate ${A.bitrate} to ${l.bitrate}`),this.hls.nextLoadLevel=a);break}}}clonePathways(e){const t=this.levels;if(!t)return;const i={},r={};e.forEach(n=>{const{ID:o,"BASE-ID":a,"URI-REPLACEMENT":A}=n;if(t.some(c=>c.pathwayId===o))return;const l=this.getLevelsForPathway(a).map(c=>{const h=Ze({},c);h.details=void 0,h.url=Ph(c.uri,c.attrs["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",A);const u=new Ke(c.attrs);u["PATHWAY-ID"]=o;const d=u.AUDIO&&`${u.AUDIO}_clone_${o}`,g=u.SUBTITLES&&`${u.SUBTITLES}_clone_${o}`;d&&(i[u.AUDIO]=d,u.AUDIO=d),g&&(r[u.SUBTITLES]=g,u.SUBTITLES=g),h.attrs=u;const f=new or(h);return fn(f,"audio",d),fn(f,"text",g),f});t.push(...l),Mh(this.audioTracks,i,A,o),Mh(this.subtitleTracks,r,A,o)})}loadSteeringManifest(e){const t=this.hls.config,i=t.loader;this.loader&&this.loader.destroy(),this.loader=new i(t);let r;try{r=new self.URL(e)}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(r.protocol!=="data:"){const c=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;r.searchParams.set("_HLS_pathway",this.pathwayId),r.searchParams.set("_HLS_throughput",""+c)}const n={responseType:"json",url:r.href},o=t.steeringManifestLoadPolicy.default,a=o.errorRetry||o.timeoutRetry||{},A={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(c,h,u,d)=>{this.log(`Loaded steering manifest: "${r}"`);const g=c.data;if(g.VERSION!==1){this.log(`Steering VERSION ${g.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=g.TTL;const{"RELOAD-URI":f,"PATHWAY-CLONES":p,"PATHWAY-PRIORITY":y}=g;if(f)try{this.uri=new self.URL(f,r).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${f}`);return}this.scheduleRefresh(this.uri||u.url),p&&this.clonePathways(p),y&&this.updatePathwayPriority(y)},onError:(c,h,u,d)=>{if(this.log(`Error loading steering manifest: ${c.code} ${c.text} (${h.url})`),this.stopLoad(),c.code===410){this.enabled=!1,this.log(`Steering manifest ${h.url} no longer available`);return}let g=this.timeToLoad*1e3;if(c.code===429){const f=this.loader;if(typeof(f==null?void 0:f.getResponseHeader)=="function"){const p=f.getResponseHeader("Retry-After");p&&(g=parseFloat(p)*1e3)}this.log(`Steering manifest ${h.url} rate limited`);return}this.scheduleRefresh(this.uri||h.url,g)},onTimeout:(c,h,u)=>{this.log(`Timeout loading steering manifest (${h.url})`),this.scheduleRefresh(this.uri||h.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(n,A,l)}scheduleRefresh(e,t=this.timeToLoad*1e3){self.clearTimeout(this.reloadTimer),this.reloadTimer=self.setTimeout(()=>{this.loadSteeringManifest(e)},t)}}function Mh(s,e,t,i){s&&Object.keys(e).forEach(r=>{const n=s.filter(o=>o.groupId===r).map(o=>{const a=Ze({},o);return a.details=void 0,a.attrs=new Ke(a.attrs),a.url=a.attrs.URI=Ph(o.url,o.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),a.groupId=a.attrs["GROUP-ID"]=e[r],a.attrs["PATHWAY-ID"]=i,a});s.push(...n)})}function Ph(s,e,t,i){const{HOST:r,PARAMS:n,[t]:o}=i;let a;e&&(a=o==null?void 0:o[e],a&&(s=a));const A=new self.URL(s);return r&&!a&&(A.host=r),n&&Object.keys(n).sort().forEach(l=>{l&&A.searchParams.set(l,n[l])}),A.href}const eI=/^age:\s*[\d.]+\s*$/im;class Oh{constructor(e){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=e&&e.xhrSetup||null,this.stats=new on,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=i,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e)return;const i=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const n=this.xhrSetup;n?Promise.resolve().then(()=>{if(!this.stats.aborted)return n(i,t.url)}).catch(o=>(i.open("GET",t.url,!0),n(i,t.url))).then(()=>{this.stats.aborted||this.openAndSendXhr(i,t,e)}).catch(o=>{this.callbacks.onError({code:i.status,text:o.message},t,i,r)}):this.openAndSendXhr(i,t,e)}openAndSendXhr(e,t,i){e.readyState||e.open("GET",t.url,!0);const r=this.context.headers,{maxTimeToFirstByteMs:n,maxLoadTimeMs:o}=i.loadPolicy;if(r)for(const a in r)e.setRequestHeader(a,r[a]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),i.timeout=n&&he(n)?n:o,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:i}=this;if(!e||!t)return;const r=t.readyState,n=this.config;if(!i.aborted&&r>=2&&(i.loading.first===0&&(i.loading.first=Math.max(self.performance.now(),i.loading.start),n.timeout!==n.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),n.timeout=n.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.loadPolicy.maxLoadTimeMs-(i.loading.first-i.loading.start)))),r===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const o=t.status,a=t.responseType!=="text";if(o>=200&&o<300&&(a&&t.response||t.responseText!==null)){i.loading.end=Math.max(self.performance.now(),i.loading.first);const A=a?t.response:t.responseText,l=t.responseType==="arraybuffer"?A.byteLength:A.length;if(i.loaded=i.total=l,i.bwEstimate=i.total*8e3/(i.loading.end-i.loading.first),!this.callbacks)return;const c=this.callbacks.onProgress;if(c&&c(i,e,A,t),!this.callbacks)return;const h={url:t.responseURL,data:A,code:o};this.callbacks.onSuccess(h,i,e,t)}else{const A=n.loadPolicy.errorRetry,l=i.retry;gn(A,l,!1,o)?this.retry(A):(N.error(`${o} while loading ${e.url}`),this.callbacks.onError({code:o,text:t.statusText},e,t,i))}}}loadtimeout(){var e;const t=(e=this.config)==null?void 0:e.loadPolicy.timeoutRetry,i=this.stats.retry;if(gn(t,i,!0))this.retry(t);else{N.warn(`timeout while loading ${this.context.url}`);const r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:i}=this;this.retryDelay=Xo(e,i.retry),i.retry++,N.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t.url}, retrying ${i.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&eI.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function tI(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const iI=/(\d+)-(\d+)\/(\d+)/;class Uh{constructor(e){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=e.fetchSetup||oI,this.controller=new self.AbortController,this.stats=new on}destroy(){this.loader=this.callbacks=null,this.abortInternal()}abortInternal(){const e=this.response;e!=null&&e.ok||(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,i){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const n=sI(e,this.controller.signal),o=i.onProgress,a=e.responseType==="arraybuffer",A=a?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=i,this.request=this.fetchSetup(e,n),self.clearTimeout(this.requestTimeout),t.timeout=l&&he(l)?l:c,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),i.onTimeout(r,e,this.response)},t.timeout),self.fetch(this.request).then(h=>{this.response=this.loader=h;const u=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),i.onTimeout(r,e,this.response)},c-(u-r.loading.start)),!h.ok){const{status:d,statusText:g}=h;throw new aI(g||"fetch, bad network response",d,h)}return r.loading.first=u,r.total=nI(h.headers)||r.total,o&&he(t.highWaterMark)?this.loadProgressively(h,r,e,t.highWaterMark,o):a?h.arrayBuffer():e.responseType==="json"?h.json():h.text()}).then(h=>{const{response:u}=this;self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const d=h[A];d&&(r.loaded=r.total=d);const g={url:u.url,data:h,code:u.status};o&&!he(t.highWaterMark)&&o(r,e,h,u),i.onSuccess(g,r,e,u)}).catch(h=>{if(self.clearTimeout(this.requestTimeout),r.aborted)return;const u=h&&h.code||0,d=h?h.message:null;i.onError({code:u,text:d},e,h?h.details:null,r)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,i,r=0,n){const o=new gh,a=e.body.getReader(),A=()=>a.read().then(l=>{if(l.done)return o.dataLength&&n(t,i,o.flush(),e),Promise.resolve(new ArrayBuffer(0));const c=l.value,h=c.length;return t.loaded+=h,h<r||o.dataLength?(o.push(c),o.dataLength>=r&&n(t,i,o.flush(),e)):n(t,i,c,e),A()}).catch(()=>Promise.reject());return A()}}function sI(s,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(Ze({},s.headers))};return s.rangeEnd&&t.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),t}function rI(s){const e=iI.exec(s);if(e)return parseInt(e[2])-parseInt(e[1])+1}function nI(s){const e=s.get("Content-Range");if(e){const i=rI(e);if(he(i))return i}const t=s.get("Content-Length");if(t)return parseInt(t)}function oI(s,e){return new self.Request(s.url,e)}class aI extends Error{constructor(e,t,i){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=i}}const AI=/\s/,lI={newCue(s,e,t,i){const r=[];let n,o,a,A,l;const c=self.VTTCue||self.TextTrackCue;for(let u=0;u<i.rows.length;u++)if(n=i.rows[u],a=!0,A=0,l="",!n.isEmpty()){var h;for(let f=0;f<n.chars.length;f++)AI.test(n.chars[f].uchar)&&a?A++:(l+=n.chars[f].uchar,a=!1);n.cueStartTime=e,e===t&&(t+=1e-4),A>=16?A--:A++;const d=xh(l.trim()),g=Ba(e,t,d);s!=null&&(h=s.cues)!=null&&h.getCueById(g)||(o=new c(e,t,d),o.id=g,o.line=u+1,o.align="left",o.position=10+Math.min(80,Math.floor(A*8/32)*10),r.push(o))}return s&&r.length&&(r.sort((u,d)=>u.line==="auto"||d.line==="auto"?0:u.line>8&&d.line>8?d.line-u.line:u.line-d.line),r.forEach(u=>Rc(s,u))),r}},cI={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},hI=vt(vt({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,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:Oh,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:fE,bufferController:QE,capLevelController:wa,errorController:ap,fpsController:qE,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:rc,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,certLoadPolicy:{default:cI},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},uI()),{},{subtitleStreamController:CE,subtitleTrackController:BE,timelineController:VE,audioStreamController:EE,audioTrackController:IE,emeController:ps,cmcdController:xi,contentSteeringController:ZE});function uI(){return{cueHandler:lI,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 dI(s,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const t=Ta(s),i=["manifest","level","frag"],r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(n=>{const o=`${n==="level"?"playlist":n}LoadPolicy`,a=e[o]===void 0,A=[];r.forEach(l=>{const c=`${n}Loading${l}`,h=e[c];if(h!==void 0&&a){A.push(c);const u=t[o].default;switch(e[o]={default:u},l){case"TimeOut":u.maxLoadTimeMs=h,u.maxTimeToFirstByteMs=h;break;case"MaxRetry":u.errorRetry.maxNumRetry=h,u.timeoutRetry.maxNumRetry=h;break;case"RetryDelay":u.errorRetry.retryDelayMs=h,u.timeoutRetry.retryDelayMs=h;break;case"MaxRetryTimeout":u.errorRetry.maxRetryDelayMs=h,u.timeoutRetry.maxRetryDelayMs=h;break}}}),A.length&&N.warn(`hls.js config: "${A.join('", "')}" setting(s) are deprecated, use "${o}": ${JSON.stringify(e[o])}`)}),vt(vt({},t),e)}function Ta(s){return s&&typeof s=="object"?Array.isArray(s)?s.map(Ta):Object.keys(s).reduce((e,t)=>(e[t]=Ta(s[t]),e),{}):s}function gI(s){const e=s.loader;e!==Uh&&e!==Oh?(N.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1):tI()&&(s.loader=Uh,s.progressive=!0,s.enableSoftwareAES=!0,N.log("[config]: Progressive streaming enabled, using FetchLoader"))}class ui{static get version(){return"1.4.12"}static isSupported(){return Sp()}static get Events(){return E}static get ErrorTypes(){return ge}static get ErrorDetails(){return Y}static get DefaultConfig(){return ui.defaultConfig?ui.defaultConfig:hI}static set DefaultConfig(e){ui.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new da,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,zf(e.debug||!1,"Hls instance");const t=this.config=dI(ui.DefaultConfig,e);this.userConfig=e,this._autoLevelCapping=-1,t.progressive&&gI(t);const{abrController:i,bufferController:r,capLevelController:n,errorController:o,fpsController:a}=t,A=new o(this),l=this.abrController=new i(this),c=this.bufferController=new r(this),h=this.capLevelController=new n(this),u=new a(this),d=new H0(this),g=new J0(this),f=t.contentSteeringController,p=f?new f(this):null,y=this.levelController=new lp(this,p),B=new cp(this),Q=new up(this.config),C=this.streamController=new dE(this,B,Q);h.setStreamController(C),u.setStreamController(C);const T=[d,y,C];p&&T.splice(1,0,p),this.networkControllers=T;const b=[l,c,h,u,g,B];this.audioTrackController=this.createController(t.audioTrackController,T);const L=t.audioStreamController;L&&T.push(new L(this,B,Q)),this.subtitleTrackController=this.createController(t.subtitleTrackController,T);const R=t.subtitleStreamController;R&&T.push(new R(this,B,Q)),this.createController(t.timelineController,b),Q.emeController=this.emeController=this.createController(t.emeController,b),this.cmcdController=this.createController(t.cmcdController,b),this.latencyController=this.createController(W0,b),this.coreComponents=b,T.push(A);const O=A.onErrorOut;typeof O=="function"&&this.on(E.ERROR,O,A)}createController(e,t){if(e){const i=new e(this);return t&&t.push(i),i}return null}on(e,t,i=this){this._emitter.on(e,t,i)}once(e,t,i=this){this._emitter.once(e,t,i)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,i=this,r){this._emitter.off(e,t,i,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,i){return this._emitter.emit(e,t,i)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(i){N.error("An internal error happened while handling event "+e+'. Error message: "'+i.message+'". Here is a stacktrace:',i),this.trigger(E.ERROR,{type:ge.OTHER_ERROR,details:Y.INTERNAL_EXCEPTION,fatal:!1,event:e,error:i})}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){N.log("destroy"),this.trigger(E.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){N.log("attachMedia"),this._media=e,this.trigger(E.MEDIA_ATTACHING,{media:e})}detachMedia(){N.log("detachMedia"),this.trigger(E.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,i=this.url,r=this.url=ko.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});N.log(`loadSource:${r}`),t&&i&&(i!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(E.MANIFEST_LOADING,{url:e})}startLoad(e=-1){N.log(`startLoad(${e})`),this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){N.log("stopLoad"),this.networkControllers.forEach(e=>{e.stopLoad()})}swapAudioCodec(){N.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){N.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e,t=0){this.levelController.removeLevel(e,t)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){N.log(`set currentLevel:${e}`),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){N.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){N.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){N.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){return this.levelController.startLevel}set startLevel(e){N.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(N.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e)}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Wo.indexOf(e)>-1&&(this._maxHdcpLevel=e)}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const i=e.length;for(let r=0;r<i;r++)if(e[r].maxBitrate>=t)return r;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:i}=this;let r;if(t===-1&&e&&e.length?r=e.length-1:r=t,i)for(let n=r;n--;){const o=e[n].attrs["HDCP-LEVEL"];if(o&&o<=i)return n}return r}get nextAutoLevel(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)}set nextAutoLevel(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}ui.defaultConfig=void 0;var fI=cr;cr.flatten=cr,cr.unflatten=$h;function Gh(s){return s&&s.constructor&&typeof s.constructor.isBuffer=="function"&&s.constructor.isBuffer(s)}function Hh(s){return s}function cr(s,e){e=e||{};const t=e.delimiter||".",i=e.maxDepth,r=e.transformKey||Hh,n={};function o(a,A,l){l=l||1,Object.keys(a).forEach(function(c){const h=a[c],u=e.safe&&Array.isArray(h),d=Object.prototype.toString.call(h),g=Gh(h),f=d==="[object Object]"||d==="[object Array]",p=A?A+t+r(c):r(c);if(!u&&!g&&f&&Object.keys(h).length&&(!e.maxDepth||l<i))return o(h,p,l+1);n[p]=h})}return o(s),n}function $h(s,e){e=e||{};const t=e.delimiter||".",i=e.overwrite||!1,r=e.transformKey||Hh,n={};if(Gh(s)||Object.prototype.toString.call(s)!=="[object Object]")return s;function a(c){const h=Number(c);return isNaN(h)||c.indexOf(".")!==-1||e.object?c:h}function A(c,h,u){return Object.keys(u).reduce(function(d,g){return d[c+t+g]=u[g],d},h)}function l(c){const h=Object.prototype.toString.call(c),u=h==="[object Array]",d=h==="[object Object]";if(c){if(u)return!c.length;if(d)return!Object.keys(c).length}else return!0}return s=Object.keys(s).reduce(function(c,h){const u=Object.prototype.toString.call(s[h]);return!(u==="[object Object]"||u==="[object Array]")||l(s[h])?(c[h]=s[h],c):A(h,c,cr(s[h],e))},{}),Object.keys(s).forEach(function(c){const h=c.split(t).map(r);let u=a(h.shift()),d=a(h[0]),g=n;for(;d!==void 0;){if(u==="__proto__")return;const f=Object.prototype.toString.call(g[u]),p=f==="[object Object]"||f==="[object Array]";if(!i&&!p&&typeof g[u]<"u")return;(i&&!p||!i&&g[u]==null)&&(g[u]=typeof d=="number"&&!e.object?[]:{}),g=g[u],h.length>0&&(u=a(h.shift()),d=a(h[0]))}g[u]=$h(s[c],e)}),n}const pI=yo(fI);var Yh=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function EI(s,e){return!!(s===e||Yh(s)&&Yh(e))}function II(s,e){if(s.length!==e.length)return!1;for(var t=0;t<s.length;t++)if(!EI(s[t],e[t]))return!1;return!0}function mI(s,e){e===void 0&&(e=II);var t=null;function i(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t&&t.lastThis===this&&e(r,t.lastArgs))return t.lastResult;var o=s.apply(this,r);return t={lastResult:o,lastArgs:r,lastThis:this},o}return i.clear=function(){t=null},i}/**
|
205
205
|
* @license
|
206
206
|
* Copyright 2017 Google LLC
|
207
207
|
* SPDX-License-Identifier: BSD-3-Clause
|
208
|
-
*/const Yh=(s,e,t)=>{const i=new Map;for(let r=e;r<=t;r++)i.set(s[r],r);return i},Kh=ls(class extends Ys{constructor(s){if(super(s),s.type!==As.CHILD)throw Error("repeat() can only be used in text expressions")}ht(s,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const r=[],n=[];let o=0;for(const a of s)r[o]=i?i(a,o):o,n[o]=t(a,o),o++;return{values:n,keys:r}}render(s,e,t){return this.ht(s,e,t).values}update(s,[e,t,i]){const r=Pd(s),{values:n,keys:o}=this.ht(e,t,i);if(!Array.isArray(r))return this.dt=o,n;const a=this.dt??(this.dt=[]),A=[];let l,c,h=0,u=r.length-1,d=0,g=n.length-1;for(;h<=u&&d<=g;)if(r[h]===null)h++;else if(r[u]===null)u--;else if(a[h]===o[d])A[d]=$i(r[h],n[d]),h++,d++;else if(a[u]===o[g])A[g]=$i(r[u],n[g]),u--,g--;else if(a[h]===o[g])A[g]=$i(r[h],n[g]),$s(s,A[g+1],r[h]),h++,g--;else if(a[u]===o[d])A[d]=$i(r[u],n[d]),$s(s,r[h],r[u]),u--,d++;else if(l===void 0&&(l=Yh(o,d,g),c=Yh(a,h,u)),l.has(a[h]))if(l.has(a[u])){const f=c.get(o[d]),p=f!==void 0?r[f]:null;if(p===null){const y=$s(s,r[h]);$i(y,n[d]),A[d]=y}else A[d]=$i(p,n[d]),$s(s,r[h],p),r[f]=null;d++}else ro(r[u]),u--;else ro(r[h]),h++;for(;d<=g;){const f=$s(s,A[g+1]);$i(f,n[d]),A[d++]=f}for(;h<=u;){const f=r[h++];f!==null&&ro(f)}return this.dt=o,Md(s,A),mi}});var wt="top",Nt="bottom",Ft="right",Tt="left",xa="auto",hr=[wt,Nt,Ft,Tt],Es="start",ur="end",mI="clippingParents",Vh="viewport",dr="popper",CI="reference",Jh=hr.reduce(function(s,e){return s.concat([e+"-"+Es,e+"-"+ur])},[]),Wh=[].concat(hr,[xa]).reduce(function(s,e){return s.concat([e,e+"-"+Es,e+"-"+ur])},[]),yI="beforeRead",BI="read",vI="afterRead",QI="beforeMain",bI="main",SI="afterMain",wI="beforeWrite",TI="write",xI="afterWrite",DI=[yI,BI,vI,QI,bI,SI,wI,TI,xI];function qt(s){return s?(s.nodeName||"").toLowerCase():null}function Dt(s){if(s==null)return window;if(s.toString()!=="[object Window]"){var e=s.ownerDocument;return e&&e.defaultView||window}return s}function zi(s){var e=Dt(s).Element;return s instanceof e||s instanceof Element}function Mt(s){var e=Dt(s).HTMLElement;return s instanceof e||s instanceof HTMLElement}function Da(s){if(typeof ShadowRoot>"u")return!1;var e=Dt(s).ShadowRoot;return s instanceof e||s instanceof ShadowRoot}function RI(s){var e=s.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},n=e.elements[t];!Mt(n)||!qt(n)||(Object.assign(n.style,i),Object.keys(r).forEach(function(o){var a=r[o];a===!1?n.removeAttribute(o):n.setAttribute(o,a===!0?"":a)}))})}function LI(s){var e=s.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],n=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(A,l){return A[l]="",A},{});!Mt(r)||!qt(r)||(Object.assign(r.style,a),Object.keys(n).forEach(function(A){r.removeAttribute(A)}))})}}const qh={name:"applyStyles",enabled:!0,phase:"write",fn:RI,effect:LI,requires:["computeStyles"]};function jt(s){return s.split("-")[0]}var Zi=Math.max,Sn=Math.min,Is=Math.round;function Ra(){var s=navigator.userAgentData;return s!=null&&s.brands&&Array.isArray(s.brands)?s.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function jh(){return!/^((?!chrome|android).)*safari/i.test(Ra())}function ms(s,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=s.getBoundingClientRect(),r=1,n=1;e&&Mt(s)&&(r=s.offsetWidth>0&&Is(i.width)/s.offsetWidth||1,n=s.offsetHeight>0&&Is(i.height)/s.offsetHeight||1);var o=zi(s)?Dt(s):window,a=o.visualViewport,A=!jh()&&t,l=(i.left+(A&&a?a.offsetLeft:0))/r,c=(i.top+(A&&a?a.offsetTop:0))/n,h=i.width/r,u=i.height/n;return{width:h,height:u,top:c,right:l+h,bottom:c+u,left:l,x:l,y:c}}function La(s){var e=ms(s),t=s.offsetWidth,i=s.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:s.offsetLeft,y:s.offsetTop,width:t,height:i}}function Xh(s,e){var t=e.getRootNode&&e.getRootNode();if(s.contains(e))return!0;if(t&&Da(t)){var i=e;do{if(i&&s.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ui(s){return Dt(s).getComputedStyle(s)}function _I(s){return["table","td","th"].indexOf(qt(s))>=0}function Di(s){return((zi(s)?s.ownerDocument:s.document)||window.document).documentElement}function wn(s){return qt(s)==="html"?s:s.assignedSlot||s.parentNode||(Da(s)?s.host:null)||Di(s)}function zh(s){return!Mt(s)||ui(s).position==="fixed"?null:s.offsetParent}function kI(s){var e=/firefox/i.test(Ra()),t=/Trident/i.test(Ra());if(t&&Mt(s)){var i=ui(s);if(i.position==="fixed")return null}var r=wn(s);for(Da(r)&&(r=r.host);Mt(r)&&["html","body"].indexOf(qt(r))<0;){var n=ui(r);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||e&&n.willChange==="filter"||e&&n.filter&&n.filter!=="none")return r;r=r.parentNode}return null}function gr(s){for(var e=Dt(s),t=zh(s);t&&_I(t)&&ui(t).position==="static";)t=zh(t);return t&&(qt(t)==="html"||qt(t)==="body"&&ui(t).position==="static")?e:t||kI(s)||e}function _a(s){return["top","bottom"].indexOf(s)>=0?"x":"y"}function fr(s,e,t){return Zi(s,Sn(e,t))}function NI(s,e,t){var i=fr(s,e,t);return i>t?t:i}function Zh(){return{top:0,right:0,bottom:0,left:0}}function eu(s){return Object.assign({},Zh(),s)}function tu(s,e){return e.reduce(function(t,i){return t[i]=s,t},{})}var FI=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,eu(typeof e!="number"?e:tu(e,hr))};function MI(s){var e,t=s.state,i=s.name,r=s.options,n=t.elements.arrow,o=t.modifiersData.popperOffsets,a=jt(t.placement),A=_a(a),l=[Tt,Ft].indexOf(a)>=0,c=l?"height":"width";if(!(!n||!o)){var h=FI(r.padding,t),u=La(n),d=A==="y"?wt:Tt,g=A==="y"?Nt:Ft,f=t.rects.reference[c]+t.rects.reference[A]-o[A]-t.rects.popper[c],p=o[A]-t.rects.reference[A],y=gr(n),B=y?A==="y"?y.clientHeight||0:y.clientWidth||0:0,Q=f/2-p/2,C=h[d],T=B-u[c]-h[g],b=B/2-u[c]/2+Q,L=fr(C,b,T),R=A;t.modifiersData[i]=(e={},e[R]=L,e.centerOffset=L-b,e)}}function PI(s){var e=s.state,t=s.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||Xh(e.elements.popper,r)&&(e.elements.arrow=r))}const OI={name:"arrow",enabled:!0,phase:"main",fn:MI,effect:PI,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Cs(s){return s.split("-")[1]}var UI={top:"auto",right:"auto",bottom:"auto",left:"auto"};function GI(s,e){var t=s.x,i=s.y,r=e.devicePixelRatio||1;return{x:Is(t*r)/r||0,y:Is(i*r)/r||0}}function iu(s){var e,t=s.popper,i=s.popperRect,r=s.placement,n=s.variation,o=s.offsets,a=s.position,A=s.gpuAcceleration,l=s.adaptive,c=s.roundOffsets,h=s.isFixed,u=o.x,d=u===void 0?0:u,g=o.y,f=g===void 0?0:g,p=typeof c=="function"?c({x:d,y:f}):{x:d,y:f};d=p.x,f=p.y;var y=o.hasOwnProperty("x"),B=o.hasOwnProperty("y"),Q=Tt,C=wt,T=window;if(l){var b=gr(t),L="clientHeight",R="clientWidth";if(b===Dt(t)&&(b=Di(t),ui(b).position!=="static"&&a==="absolute"&&(L="scrollHeight",R="scrollWidth")),b=b,r===wt||(r===Tt||r===Ft)&&n===ur){C=Nt;var O=h&&b===T&&T.visualViewport?T.visualViewport.height:b[L];f-=O-i.height,f*=A?1:-1}if(r===Tt||(r===wt||r===Nt)&&n===ur){Q=Ft;var k=h&&b===T&&T.visualViewport?T.visualViewport.width:b[R];d-=k-i.width,d*=A?1:-1}}var W=Object.assign({position:a},l&&UI),$=c===!0?GI({x:d,y:f},Dt(t)):{x:d,y:f};if(d=$.x,f=$.y,A){var te;return Object.assign({},W,(te={},te[C]=B?"0":"",te[Q]=y?"0":"",te.transform=(T.devicePixelRatio||1)<=1?"translate("+d+"px, "+f+"px)":"translate3d("+d+"px, "+f+"px, 0)",te))}return Object.assign({},W,(e={},e[C]=B?f+"px":"",e[Q]=y?d+"px":"",e.transform="",e))}function HI(s){var e=s.state,t=s.options,i=t.gpuAcceleration,r=i===void 0?!0:i,n=t.adaptive,o=n===void 0?!0:n,a=t.roundOffsets,A=a===void 0?!0:a,l={placement:jt(e.placement),variation:Cs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,iu(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:A})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,iu(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const $I={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:HI,data:{}};var Tn={passive:!0};function YI(s){var e=s.state,t=s.instance,i=s.options,r=i.scroll,n=r===void 0?!0:r,o=i.resize,a=o===void 0?!0:o,A=Dt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&l.forEach(function(c){c.addEventListener("scroll",t.update,Tn)}),a&&A.addEventListener("resize",t.update,Tn),function(){n&&l.forEach(function(c){c.removeEventListener("scroll",t.update,Tn)}),a&&A.removeEventListener("resize",t.update,Tn)}}const KI={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:YI,data:{}};var VI={left:"right",right:"left",bottom:"top",top:"bottom"};function xn(s){return s.replace(/left|right|bottom|top/g,function(e){return VI[e]})}var JI={start:"end",end:"start"};function su(s){return s.replace(/start|end/g,function(e){return JI[e]})}function ka(s){var e=Dt(s),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Na(s){return ms(Di(s)).left+ka(s).scrollLeft}function WI(s,e){var t=Dt(s),i=Di(s),r=t.visualViewport,n=i.clientWidth,o=i.clientHeight,a=0,A=0;if(r){n=r.width,o=r.height;var l=jh();(l||!l&&e==="fixed")&&(a=r.offsetLeft,A=r.offsetTop)}return{width:n,height:o,x:a+Na(s),y:A}}function qI(s){var e,t=Di(s),i=ka(s),r=(e=s.ownerDocument)==null?void 0:e.body,n=Zi(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Zi(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Na(s),A=-i.scrollTop;return ui(r||t).direction==="rtl"&&(a+=Zi(t.clientWidth,r?r.clientWidth:0)-n),{width:n,height:o,x:a,y:A}}function Fa(s){var e=ui(s),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function ru(s){return["html","body","#document"].indexOf(qt(s))>=0?s.ownerDocument.body:Mt(s)&&Fa(s)?s:ru(wn(s))}function pr(s,e){var t;e===void 0&&(e=[]);var i=ru(s),r=i===((t=s.ownerDocument)==null?void 0:t.body),n=Dt(i),o=r?[n].concat(n.visualViewport||[],Fa(i)?i:[]):i,a=e.concat(o);return r?a:a.concat(pr(wn(o)))}function Ma(s){return Object.assign({},s,{left:s.x,top:s.y,right:s.x+s.width,bottom:s.y+s.height})}function jI(s,e){var t=ms(s,!1,e==="fixed");return t.top=t.top+s.clientTop,t.left=t.left+s.clientLeft,t.bottom=t.top+s.clientHeight,t.right=t.left+s.clientWidth,t.width=s.clientWidth,t.height=s.clientHeight,t.x=t.left,t.y=t.top,t}function nu(s,e,t){return e===Vh?Ma(WI(s,t)):zi(e)?jI(e,t):Ma(qI(Di(s)))}function XI(s){var e=pr(wn(s)),t=["absolute","fixed"].indexOf(ui(s).position)>=0,i=t&&Mt(s)?gr(s):s;return zi(i)?e.filter(function(r){return zi(r)&&Xh(r,i)&&qt(r)!=="body"}):[]}function zI(s,e,t,i){var r=e==="clippingParents"?XI(s):[].concat(e),n=[].concat(r,[t]),o=n[0],a=n.reduce(function(A,l){var c=nu(s,l,i);return A.top=Zi(c.top,A.top),A.right=Sn(c.right,A.right),A.bottom=Sn(c.bottom,A.bottom),A.left=Zi(c.left,A.left),A},nu(s,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ou(s){var e=s.reference,t=s.element,i=s.placement,r=i?jt(i):null,n=i?Cs(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,A;switch(r){case wt:A={x:o,y:e.y-t.height};break;case Nt:A={x:o,y:e.y+e.height};break;case Ft:A={x:e.x+e.width,y:a};break;case Tt:A={x:e.x-t.width,y:a};break;default:A={x:e.x,y:e.y}}var l=r?_a(r):null;if(l!=null){var c=l==="y"?"height":"width";switch(n){case Es:A[l]=A[l]-(e[c]/2-t[c]/2);break;case ur:A[l]=A[l]+(e[c]/2-t[c]/2);break}}return A}function Er(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?s.placement:i,n=t.strategy,o=n===void 0?s.strategy:n,a=t.boundary,A=a===void 0?mI:a,l=t.rootBoundary,c=l===void 0?Vh:l,h=t.elementContext,u=h===void 0?dr:h,d=t.altBoundary,g=d===void 0?!1:d,f=t.padding,p=f===void 0?0:f,y=eu(typeof p!="number"?p:tu(p,hr)),B=u===dr?CI:dr,Q=s.rects.popper,C=s.elements[g?B:u],T=zI(zi(C)?C:C.contextElement||Di(s.elements.popper),A,c,o),b=ms(s.elements.reference),L=ou({reference:b,element:Q,strategy:"absolute",placement:r}),R=Ma(Object.assign({},Q,L)),O=u===dr?R:b,k={top:T.top-O.top+y.top,bottom:O.bottom-T.bottom+y.bottom,left:T.left-O.left+y.left,right:O.right-T.right+y.right},W=s.modifiersData.offset;if(u===dr&&W){var $=W[r];Object.keys(k).forEach(function(te){var ee=[Ft,Nt].indexOf(te)>=0?1:-1,S=[wt,Nt].indexOf(te)>=0?"y":"x";k[te]+=$[S]*ee})}return k}function ZI(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,n=t.rootBoundary,o=t.padding,a=t.flipVariations,A=t.allowedAutoPlacements,l=A===void 0?Wh:A,c=Cs(i),h=c?a?Jh:Jh.filter(function(g){return Cs(g)===c}):hr,u=h.filter(function(g){return l.indexOf(g)>=0});u.length===0&&(u=h);var d=u.reduce(function(g,f){return g[f]=Er(s,{placement:f,boundary:r,rootBoundary:n,padding:o})[jt(f)],g},{});return Object.keys(d).sort(function(g,f){return d[g]-d[f]})}function em(s){if(jt(s)===xa)return[];var e=xn(s);return[su(s),e,su(e)]}function tm(s){var e=s.state,t=s.options,i=s.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!0:o,A=t.fallbackPlacements,l=t.padding,c=t.boundary,h=t.rootBoundary,u=t.altBoundary,d=t.flipVariations,g=d===void 0?!0:d,f=t.allowedAutoPlacements,p=e.options.placement,y=jt(p),B=y===p,Q=A||(B||!g?[xn(p)]:em(p)),C=[p].concat(Q).reduce(function(se,ue){return se.concat(jt(ue)===xa?ZI(e,{placement:ue,boundary:c,rootBoundary:h,padding:l,flipVariations:g,allowedAutoPlacements:f}):ue)},[]),T=e.rects.reference,b=e.rects.popper,L=new Map,R=!0,O=C[0],k=0;k<C.length;k++){var W=C[k],$=jt(W),te=Cs(W)===Es,ee=[wt,Nt].indexOf($)>=0,S=ee?"width":"height",D=Er(e,{placement:W,boundary:c,rootBoundary:h,altBoundary:u,padding:l}),U=ee?te?Ft:Tt:te?Nt:wt;T[S]>b[S]&&(U=xn(U));var v=xn(U),w=[];if(n&&w.push(D[$]<=0),a&&w.push(D[U]<=0,D[v]<=0),w.every(function(se){return se})){O=W,R=!1;break}L.set(W,w)}if(R)for(var F=g?3:1,H=function(ue){var Ae=C.find(function(Ce){var be=L.get(Ce);if(be)return be.slice(0,ue).every(function(Re){return Re})});if(Ae)return O=Ae,"break"},K=F;K>0;K--){var j=H(K);if(j==="break")break}e.placement!==O&&(e.modifiersData[i]._skip=!0,e.placement=O,e.reset=!0)}}const im={name:"flip",enabled:!0,phase:"main",fn:tm,requiresIfExists:["offset"],data:{_skip:!1}};function au(s,e,t){return t===void 0&&(t={x:0,y:0}),{top:s.top-e.height-t.y,right:s.right-e.width+t.x,bottom:s.bottom-e.height+t.y,left:s.left-e.width-t.x}}function Au(s){return[wt,Ft,Nt,Tt].some(function(e){return s[e]>=0})}function sm(s){var e=s.state,t=s.name,i=e.rects.reference,r=e.rects.popper,n=e.modifiersData.preventOverflow,o=Er(e,{elementContext:"reference"}),a=Er(e,{altBoundary:!0}),A=au(o,i),l=au(a,r,n),c=Au(A),h=Au(l);e.modifiersData[t]={referenceClippingOffsets:A,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}const rm={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:sm};function nm(s,e,t){var i=jt(s),r=[Tt,wt].indexOf(i)>=0?-1:1,n=typeof t=="function"?t(Object.assign({},e,{placement:s})):t,o=n[0],a=n[1];return o=o||0,a=(a||0)*r,[Tt,Ft].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function om(s){var e=s.state,t=s.options,i=s.name,r=t.offset,n=r===void 0?[0,0]:r,o=Wh.reduce(function(c,h){return c[h]=nm(h,e.rects,n),c},{}),a=o[e.placement],A=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=A,e.modifiersData.popperOffsets.y+=l),e.modifiersData[i]=o}const am={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:om};function Am(s){var e=s.state,t=s.name;e.modifiersData[t]=ou({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const lm={name:"popperOffsets",enabled:!0,phase:"read",fn:Am,data:{}};function cm(s){return s==="x"?"y":"x"}function hm(s){var e=s.state,t=s.options,i=s.name,r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!1:o,A=t.boundary,l=t.rootBoundary,c=t.altBoundary,h=t.padding,u=t.tether,d=u===void 0?!0:u,g=t.tetherOffset,f=g===void 0?0:g,p=Er(e,{boundary:A,rootBoundary:l,padding:h,altBoundary:c}),y=jt(e.placement),B=Cs(e.placement),Q=!B,C=_a(y),T=cm(C),b=e.modifiersData.popperOffsets,L=e.rects.reference,R=e.rects.popper,O=typeof f=="function"?f(Object.assign({},e.rects,{placement:e.placement})):f,k=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),W=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,$={x:0,y:0};if(b){if(n){var te,ee=C==="y"?wt:Tt,S=C==="y"?Nt:Ft,D=C==="y"?"height":"width",U=b[C],v=U+p[ee],w=U-p[S],F=d?-R[D]/2:0,H=B===Es?L[D]:R[D],K=B===Es?-R[D]:-L[D],j=e.elements.arrow,se=d&&j?La(j):{width:0,height:0},ue=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Zh(),Ae=ue[ee],Ce=ue[S],be=fr(0,L[D],se[D]),Re=Q?L[D]/2-F-be-Ae-k.mainAxis:H-be-Ae-k.mainAxis,ne=Q?-L[D]/2+F+be+Ce+k.mainAxis:K+be+Ce+k.mainAxis,Ie=e.elements.arrow&&gr(e.elements.arrow),ve=Ie?C==="y"?Ie.clientTop||0:Ie.clientLeft||0:0,he=(te=W==null?void 0:W[C])!=null?te:0,le=U+Re-he-ve,oe=U+ne-he,we=fr(d?Sn(v,le):v,U,d?Zi(w,oe):w);b[C]=we,$[C]=we-U}if(a){var Oe,Le=C==="x"?wt:Tt,Me=C==="x"?Nt:Ft,Ue=b[T],xe=T==="y"?"height":"width",Be=Ue+p[Le],He=Ue-p[Me],We=[wt,Tt].indexOf(y)!==-1,rt=(Oe=W==null?void 0:W[T])!=null?Oe:0,Xe=We?Be:Ue-L[xe]-R[xe]-rt+k.altAxis,pt=We?Ue+L[xe]+R[xe]-rt-k.altAxis:He,gi=d&&We?NI(Xe,Ue,pt):fr(d?Xe:Be,Ue,d?pt:He);b[T]=gi,$[T]=gi-Ue}e.modifiersData[i]=$}}const um={name:"preventOverflow",enabled:!0,phase:"main",fn:hm,requiresIfExists:["offset"]};function dm(s){return{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}}function gm(s){return s===Dt(s)||!Mt(s)?ka(s):dm(s)}function fm(s){var e=s.getBoundingClientRect(),t=Is(e.width)/s.offsetWidth||1,i=Is(e.height)/s.offsetHeight||1;return t!==1||i!==1}function pm(s,e,t){t===void 0&&(t=!1);var i=Mt(e),r=Mt(e)&&fm(e),n=Di(e),o=ms(s,r,t),a={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(i||!i&&!t)&&((qt(e)!=="body"||Fa(n))&&(a=gm(e)),Mt(e)?(A=ms(e,!0),A.x+=e.clientLeft,A.y+=e.clientTop):n&&(A.x=Na(n))),{x:o.left+a.scrollLeft-A.x,y:o.top+a.scrollTop-A.y,width:o.width,height:o.height}}function Em(s){var e=new Map,t=new Set,i=[];s.forEach(function(n){e.set(n.name,n)});function r(n){t.add(n.name);var o=[].concat(n.requires||[],n.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var A=e.get(a);A&&r(A)}}),i.push(n)}return s.forEach(function(n){t.has(n.name)||r(n)}),i}function Im(s){var e=Em(s);return DI.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function mm(s){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(s())})})),e}}function Cm(s){var e=s.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var lu={placement:"bottom",modifiers:[],strategy:"absolute"};function cu(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function ym(s){s===void 0&&(s={});var e=s,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,n=r===void 0?lu:r;return function(a,A,l){l===void 0&&(l=n);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},lu,n),modifiersData:{},elements:{reference:a,popper:A},attributes:{},styles:{}},h=[],u=!1,d={state:c,setOptions:function(y){var B=typeof y=="function"?y(c.options):y;f(),c.options=Object.assign({},n,c.options,B),c.scrollParents={reference:zi(a)?pr(a):a.contextElement?pr(a.contextElement):[],popper:pr(A)};var Q=Im(Cm([].concat(i,c.options.modifiers)));return c.orderedModifiers=Q.filter(function(C){return C.enabled}),g(),d.update()},forceUpdate:function(){if(!u){var y=c.elements,B=y.reference,Q=y.popper;if(cu(B,Q)){c.rects={reference:pm(B,gr(Q),c.options.strategy==="fixed"),popper:La(Q)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(k){return c.modifiersData[k.name]=Object.assign({},k.data)});for(var C=0;C<c.orderedModifiers.length;C++){if(c.reset===!0){c.reset=!1,C=-1;continue}var T=c.orderedModifiers[C],b=T.fn,L=T.options,R=L===void 0?{}:L,O=T.name;typeof b=="function"&&(c=b({state:c,options:R,name:O,instance:d})||c)}}}},update:mm(function(){return new Promise(function(p){d.forceUpdate(),p(c)})}),destroy:function(){f(),u=!0}};if(!cu(a,A))return d;d.setOptions(l).then(function(p){!u&&l.onFirstUpdate&&l.onFirstUpdate(p)});function g(){c.orderedModifiers.forEach(function(p){var y=p.name,B=p.options,Q=B===void 0?{}:B,C=p.effect;if(typeof C=="function"){var T=C({state:c,name:y,instance:d,options:Q}),b=function(){};h.push(T||b)}})}function f(){h.forEach(function(p){return p()}),h=[]}return d}}var Bm=[KI,lm,$I,qh,am,im,um,OI,rm],vm=ym({defaultModifiers:Bm}),Qm="tippy-box",hu="tippy-content",bm="tippy-backdrop",uu="tippy-arrow",du="tippy-svg-arrow",es={passive:!0,capture:!0},gu=function(){return document.body};function Pa(s,e,t){if(Array.isArray(s)){var i=s[e];return i??(Array.isArray(t)?t[e]:t)}return s}function Oa(s,e){var t={}.toString.call(s);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function fu(s,e){return typeof s=="function"?s.apply(void 0,e):s}function pu(s,e){if(e===0)return s;var t;return function(i){clearTimeout(t),t=setTimeout(function(){s(i)},e)}}function Sm(s){return s.split(/\s+/).filter(Boolean)}function ys(s){return[].concat(s)}function Eu(s,e){s.indexOf(e)===-1&&s.push(e)}function wm(s){return s.filter(function(e,t){return s.indexOf(e)===t})}function Tm(s){return s.split("-")[0]}function Dn(s){return[].slice.call(s)}function Iu(s){return Object.keys(s).reduce(function(e,t){return s[t]!==void 0&&(e[t]=s[t]),e},{})}function Ir(){return document.createElement("div")}function Rn(s){return["Element","Fragment"].some(function(e){return Oa(s,e)})}function xm(s){return Oa(s,"NodeList")}function Dm(s){return Oa(s,"MouseEvent")}function Rm(s){return!!(s&&s._tippy&&s._tippy.reference===s)}function Lm(s){return Rn(s)?[s]:xm(s)?Dn(s):Array.isArray(s)?s:Dn(document.querySelectorAll(s))}function Ua(s,e){s.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function mu(s,e){s.forEach(function(t){t&&t.setAttribute("data-state",e)})}function _m(s){var e,t=ys(s),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function km(s,e){var t=e.clientX,i=e.clientY;return s.every(function(r){var n=r.popperRect,o=r.popperState,a=r.props,A=a.interactiveBorder,l=Tm(o.placement),c=o.modifiersData.offset;if(!c)return!0;var h=l==="bottom"?c.top.y:0,u=l==="top"?c.bottom.y:0,d=l==="right"?c.left.x:0,g=l==="left"?c.right.x:0,f=n.top-i+h>A,p=i-n.bottom-u>A,y=n.left-t+d>A,B=t-n.right-g>A;return f||p||y||B})}function Ga(s,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){s[i](r,t)})}function Cu(s,e){for(var t=e;t;){var i;if(s.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var Xt={isTouch:!1},yu=0;function Nm(){Xt.isTouch||(Xt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Bu))}function Bu(){var s=performance.now();s-yu<20&&(Xt.isTouch=!1,document.removeEventListener("mousemove",Bu)),yu=s}function Fm(){var s=document.activeElement;if(Rm(s)){var e=s._tippy;s.blur&&!e.state.isVisible&&s.blur()}}function Mm(){document.addEventListener("touchstart",Nm,es),window.addEventListener("blur",Fm)}var Pm=typeof window<"u"&&typeof document<"u",Om=Pm?!!window.msCrypto:!1,Um={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Gm={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Gt=Object.assign({appendTo:gu,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Um,Gm),Hm=Object.keys(Gt),$m=function(e){var t=Object.keys(e);t.forEach(function(i){Gt[i]=e[i]})};function vu(s){var e=s.plugins||[],t=e.reduce(function(i,r){var n=r.name,o=r.defaultValue;if(n){var a;i[n]=s[n]!==void 0?s[n]:(a=Gt[n])!=null?a:o}return i},{});return Object.assign({},s,t)}function Ym(s,e){var t=e?Object.keys(vu(Object.assign({},Gt,{plugins:e}))):Hm,i=t.reduce(function(r,n){var o=(s.getAttribute("data-tippy-"+n)||"").trim();if(!o)return r;if(n==="content")r[n]=o;else try{r[n]=JSON.parse(o)}catch{r[n]=o}return r},{});return i}function Qu(s,e){var t=Object.assign({},e,{content:fu(e.content,[s])},e.ignoreAttributes?{}:Ym(s,e.plugins));return t.aria=Object.assign({},Gt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var Km=function(){return"innerHTML"};function Ha(s,e){s[Km()]=e}function bu(s){var e=Ir();return s===!0?e.className=uu:(e.className=du,Rn(s)?e.appendChild(s):Ha(e,s)),e}function Su(s,e){Rn(e.content)?(Ha(s,""),s.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Ha(s,e.content):s.textContent=e.content)}function $a(s){var e=s.firstElementChild,t=Dn(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(hu)}),arrow:t.find(function(i){return i.classList.contains(uu)||i.classList.contains(du)}),backdrop:t.find(function(i){return i.classList.contains(bm)})}}function wu(s){var e=Ir(),t=Ir();t.className=Qm,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=Ir();i.className=hu,i.setAttribute("data-state","hidden"),Su(i,s.props),e.appendChild(t),t.appendChild(i),r(s.props,s.props);function r(n,o){var a=$a(e),A=a.box,l=a.content,c=a.arrow;o.theme?A.setAttribute("data-theme",o.theme):A.removeAttribute("data-theme"),typeof o.animation=="string"?A.setAttribute("data-animation",o.animation):A.removeAttribute("data-animation"),o.inertia?A.setAttribute("data-inertia",""):A.removeAttribute("data-inertia"),A.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?A.setAttribute("role",o.role):A.removeAttribute("role"),(n.content!==o.content||n.allowHTML!==o.allowHTML)&&Su(l,s.props),o.arrow?c?n.arrow!==o.arrow&&(A.removeChild(c),A.appendChild(bu(o.arrow))):A.appendChild(bu(o.arrow)):c&&A.removeChild(c)}return{popper:e,onUpdate:r}}wu.$$tippy=!0;var Vm=1,Ln=[],Ya=[];function Jm(s,e){var t=Qu(s,Object.assign({},Gt,vu(Iu(e)))),i,r,n,o=!1,a=!1,A=!1,l=!1,c,h,u,d=[],g=pu(le,t.interactiveDebounce),f,p=Vm++,y=null,B=wm(t.plugins),Q={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:p,reference:s,popper:Ir(),popperInstance:y,props:t,state:Q,plugins:B,clearDelayTimeouts:Xe,setProps:pt,setContent:gi,show:Et,hide:ti,hideWithInteractivity:ii,enable:We,disable:rt,unmount:si,destroy:ct};if(!t.render)return C;var T=t.render(C),b=T.popper,L=T.onUpdate;b.setAttribute("data-tippy-root",""),b.id="tippy-"+C.id,C.popper=b,s._tippy=C,b._tippy=C;var R=B.map(function(G){return G.fn(C)}),O=s.hasAttribute("aria-expanded");return Ie(),F(),U(),v("onCreate",[C]),t.showOnCreate&&Be(),b.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),b.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&ee().addEventListener("mousemove",g)}),C;function k(){var G=C.props.touch;return Array.isArray(G)?G:[G,0]}function W(){return k()[0]==="hold"}function $(){var G;return!!((G=C.props.render)!=null&&G.$$tippy)}function te(){return f||s}function ee(){var G=te().parentNode;return G?_m(G):document}function S(){return $a(b)}function D(G){return C.state.isMounted&&!C.state.isVisible||Xt.isTouch||c&&c.type==="focus"?0:Pa(C.props.delay,G?0:1,Gt.delay)}function U(G){G===void 0&&(G=!1),b.style.pointerEvents=C.props.interactive&&!G?"":"none",b.style.zIndex=""+C.props.zIndex}function v(G,ae,de){if(de===void 0&&(de=!0),R.forEach(function(Qe){Qe[G]&&Qe[G].apply(Qe,ae)}),de){var Se;(Se=C.props)[G].apply(Se,ae)}}function w(){var G=C.props.aria;if(G.content){var ae="aria-"+G.content,de=b.id,Se=ys(C.props.triggerTarget||s);Se.forEach(function(Qe){var $e=Qe.getAttribute(ae);if(C.state.isVisible)Qe.setAttribute(ae,$e?$e+" "+de:de);else{var It=$e&&$e.replace(de,"").trim();It?Qe.setAttribute(ae,It):Qe.removeAttribute(ae)}})}}function F(){if(!(O||!C.props.aria.expanded)){var G=ys(C.props.triggerTarget||s);G.forEach(function(ae){C.props.interactive?ae.setAttribute("aria-expanded",C.state.isVisible&&ae===te()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function H(){ee().removeEventListener("mousemove",g),Ln=Ln.filter(function(G){return G!==g})}function K(G){if(!(Xt.isTouch&&(A||G.type==="mousedown"))){var ae=G.composedPath&&G.composedPath()[0]||G.target;if(!(C.props.interactive&&Cu(b,ae))){if(ys(C.props.triggerTarget||s).some(function(de){return Cu(de,ae)})){if(Xt.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else v("onClickOutside",[C,G]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||Ae())}}}function j(){A=!0}function se(){A=!1}function ue(){var G=ee();G.addEventListener("mousedown",K,!0),G.addEventListener("touchend",K,es),G.addEventListener("touchstart",se,es),G.addEventListener("touchmove",j,es)}function Ae(){var G=ee();G.removeEventListener("mousedown",K,!0),G.removeEventListener("touchend",K,es),G.removeEventListener("touchstart",se,es),G.removeEventListener("touchmove",j,es)}function Ce(G,ae){Re(G,function(){!C.state.isVisible&&b.parentNode&&b.parentNode.contains(b)&&ae()})}function be(G,ae){Re(G,ae)}function Re(G,ae){var de=S().box;function Se(Qe){Qe.target===de&&(Ga(de,"remove",Se),ae())}if(G===0)return ae();Ga(de,"remove",h),Ga(de,"add",Se),h=Se}function ne(G,ae,de){de===void 0&&(de=!1);var Se=ys(C.props.triggerTarget||s);Se.forEach(function(Qe){Qe.addEventListener(G,ae,de),d.push({node:Qe,eventType:G,handler:ae,options:de})})}function Ie(){W()&&(ne("touchstart",he,{passive:!0}),ne("touchend",oe,{passive:!0})),Sm(C.props.trigger).forEach(function(G){if(G!=="manual")switch(ne(G,he),G){case"mouseenter":ne("mouseleave",oe);break;case"focus":ne(Om?"focusout":"blur",we);break;case"focusin":ne("focusout",we);break}})}function ve(){d.forEach(function(G){var ae=G.node,de=G.eventType,Se=G.handler,Qe=G.options;ae.removeEventListener(de,Se,Qe)}),d=[]}function he(G){var ae,de=!1;if(!(!C.state.isEnabled||Oe(G)||a)){var Se=((ae=c)==null?void 0:ae.type)==="focus";c=G,f=G.currentTarget,F(),!C.state.isVisible&&Dm(G)&&Ln.forEach(function(Qe){return Qe(G)}),G.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?de=!0:Be(G),G.type==="click"&&(o=!de),de&&!Se&&He(G)}}function le(G){var ae=G.target,de=te().contains(ae)||b.contains(ae);if(!(G.type==="mousemove"&&de)){var Se=xe().concat(b).map(function(Qe){var $e,It=Qe._tippy,mt=($e=It.popperInstance)==null?void 0:$e.state;return mt?{popperRect:Qe.getBoundingClientRect(),popperState:mt,props:t}:null}).filter(Boolean);km(Se,G)&&(H(),He(G))}}function oe(G){var ae=Oe(G)||C.props.trigger.indexOf("click")>=0&&o;if(!ae){if(C.props.interactive){C.hideWithInteractivity(G);return}He(G)}}function we(G){C.props.trigger.indexOf("focusin")<0&&G.target!==te()||C.props.interactive&&G.relatedTarget&&b.contains(G.relatedTarget)||He(G)}function Oe(G){return Xt.isTouch?W()!==G.type.indexOf("touch")>=0:!1}function Le(){Me();var G=C.props,ae=G.popperOptions,de=G.placement,Se=G.offset,Qe=G.getReferenceClientRect,$e=G.moveTransition,It=$()?$a(b).arrow:null,mt=Qe?{getBoundingClientRect:Qe,contextElement:Qe.contextElement||te()}:s,Ss={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(ws){var ki=ws.state;if($()){var vr=S(),Qr=vr.box;["placement","reference-hidden","escaped"].forEach(function(Ts){Ts==="placement"?Qr.setAttribute("data-placement",ki.placement):ki.attributes.popper["data-popper-"+Ts]?Qr.setAttribute("data-"+Ts,""):Qr.removeAttribute("data-"+Ts)}),ki.attributes.popper={}}}},Ct=[{name:"offset",options:{offset:Se}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!$e}},Ss];$()&&It&&Ct.push({name:"arrow",options:{element:It,padding:3}}),Ct.push.apply(Ct,(ae==null?void 0:ae.modifiers)||[]),C.popperInstance=vm(mt,b,Object.assign({},ae,{placement:de,onFirstUpdate:u,modifiers:Ct}))}function Me(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function Ue(){var G=C.props.appendTo,ae,de=te();C.props.interactive&&G===gu||G==="parent"?ae=de.parentNode:ae=fu(G,[de]),ae.contains(b)||ae.appendChild(b),C.state.isMounted=!0,Le()}function xe(){return Dn(b.querySelectorAll("[data-tippy-root]"))}function Be(G){C.clearDelayTimeouts(),G&&v("onTrigger",[C,G]),ue();var ae=D(!0),de=k(),Se=de[0],Qe=de[1];Xt.isTouch&&Se==="hold"&&Qe&&(ae=Qe),ae?i=setTimeout(function(){C.show()},ae):C.show()}function He(G){if(C.clearDelayTimeouts(),v("onUntrigger",[C,G]),!C.state.isVisible){Ae();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(G.type)>=0&&o)){var ae=D(!1);ae?r=setTimeout(function(){C.state.isVisible&&C.hide()},ae):n=requestAnimationFrame(function(){C.hide()})}}function We(){C.state.isEnabled=!0}function rt(){C.hide(),C.state.isEnabled=!1}function Xe(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(n)}function pt(G){if(!C.state.isDestroyed){v("onBeforeUpdate",[C,G]),ve();var ae=C.props,de=Qu(s,Object.assign({},ae,Iu(G),{ignoreAttributes:!0}));C.props=de,Ie(),ae.interactiveDebounce!==de.interactiveDebounce&&(H(),g=pu(le,de.interactiveDebounce)),ae.triggerTarget&&!de.triggerTarget?ys(ae.triggerTarget).forEach(function(Se){Se.removeAttribute("aria-expanded")}):de.triggerTarget&&s.removeAttribute("aria-expanded"),F(),U(),L&&L(ae,de),C.popperInstance&&(Le(),xe().forEach(function(Se){requestAnimationFrame(Se._tippy.popperInstance.forceUpdate)})),v("onAfterUpdate",[C,G])}}function gi(G){C.setProps({content:G})}function Et(){var G=C.state.isVisible,ae=C.state.isDestroyed,de=!C.state.isEnabled,Se=Xt.isTouch&&!C.props.touch,Qe=Pa(C.props.duration,0,Gt.duration);if(!(G||ae||de||Se)&&!te().hasAttribute("disabled")&&(v("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,$()&&(b.style.visibility="visible"),U(),ue(),C.state.isMounted||(b.style.transition="none"),$()){var $e=S(),It=$e.box,mt=$e.content;Ua([It,mt],0)}u=function(){var Ct;if(!(!C.state.isVisible||l)){if(l=!0,b.offsetHeight,b.style.transition=C.props.moveTransition,$()&&C.props.animation){var rs=S(),ws=rs.box,ki=rs.content;Ua([ws,ki],Qe),mu([ws,ki],"visible")}w(),F(),Eu(Ya,C),(Ct=C.popperInstance)==null||Ct.forceUpdate(),v("onMount",[C]),C.props.animation&&$()&&be(Qe,function(){C.state.isShown=!0,v("onShown",[C])})}},Ue()}}function ti(){var G=!C.state.isVisible,ae=C.state.isDestroyed,de=!C.state.isEnabled,Se=Pa(C.props.duration,1,Gt.duration);if(!(G||ae||de)&&(v("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,l=!1,o=!1,$()&&(b.style.visibility="hidden"),H(),Ae(),U(!0),$()){var Qe=S(),$e=Qe.box,It=Qe.content;C.props.animation&&(Ua([$e,It],Se),mu([$e,It],"hidden"))}w(),F(),C.props.animation?$()&&Ce(Se,C.unmount):C.unmount()}}function ii(G){ee().addEventListener("mousemove",g),Eu(Ln,g),g(G)}function si(){C.state.isVisible&&C.hide(),C.state.isMounted&&(Me(),xe().forEach(function(G){G._tippy.unmount()}),b.parentNode&&b.parentNode.removeChild(b),Ya=Ya.filter(function(G){return G!==C}),C.state.isMounted=!1,v("onHidden",[C]))}function ct(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),ve(),delete s._tippy,C.state.isDestroyed=!0,v("onDestroy",[C]))}}function ts(s,e){e===void 0&&(e={});var t=Gt.plugins.concat(e.plugins||[]);Mm();var i=Object.assign({},e,{plugins:t}),r=Lm(s),n=r.reduce(function(o,a){var A=a&&Jm(a,i);return A&&o.push(A),o},[]);return Rn(s)?n[0]:n}ts.defaultProps=Gt,ts.setDefaultProps=$m,ts.currentInput=Xt,Object.assign({},qh,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),ts.setDefaultProps({render:wu});class zt extends Error{constructor(e,t=new Error,i=!1){super(),this.fatal=!1,this.fatal=i,this.stack=t.stack,this.message=[e,t.message].filter(Boolean).join(" - ")}}const Wm=5;class qm{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=ht(),this._controls=ht(),this.host=e}set activeScenes(e){if(e!==this._activeScenes){const t=e[0],i=this._activeScenes[0];this._activeScenes=e,t!==i&&(this.host.dispatchEvent(new CustomEvent("scenechange",{detail:e[0]})),this.host.requestUpdate())}}get activeScenes(){return this._activeScenes}set currentTime(e){var t,i,r,n,o;const a=Math.min(this.host.duration,Math.max(0,e));this._currentTime=a,this.activeScenes=((t=this.host.scenes)==null?void 0:t.filter(({start:c,duration:h})=>a>=c&&a<c+h))??[],this._upcomingScenes=((i=this.host.scenes)==null?void 0:i.filter(({start:c})=>a>=c-Wm&&a<c))??[],this.loadScenes(),this.syncVideoState(),(r=this._controls.value)==null||r.setAttribute("currentTime",a.toString());const A=this.activeScenes[0],l=Yl((n=A==null?void 0:A.videoMeta)==null?void 0:n.captions);this.caption=((o=l.find(({start:c,end:h})=>{var u;const d=a-A.start+(((u=A.videoMeta)==null?void 0:u.start)??0);return c&&h&&d>=sn(c)&&d<=sn(h)}))==null?void 0:o.text)??"",this.draw(a),!this.host.paused&&!this.host.loading&&!this.host.processing&&!this.host.waiting&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:a}))}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return ut(this._canvas)}controls(){return ut(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{var t,i,r;const{start:n,duration:o,video:a,videoMeta:A}=e,l=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused;if(a&&A){const{key:c,hls:h,node:u}=a,{start:d,duration:g}=A,f=this.host.videoState[c];u&&f&&(u.currentTime>=d+g||u.ended||l&&(h?(t=h.startLoadOnce)==null||t.call(h,u.currentTime):f.initialised||(i=u.startLoadOnce)==null||i.call(u)))}else if(l){const c=`${n}-${o}`,h=this.host._sceneController.videoState[c];this.host.duration&&!((r=h==null?void 0:h.buffered)!=null&&r.length)&&(this.host._sceneController.videoState={...this.host._sceneController.videoState,[c]:{...h,buffered:[{start:Math.max(0,n/this.host.duration*100),end:Math.min((n+o)/this.host.duration*100,100)}]}})}})}syncVideoState(){var e;(e=this.host.scenes)==null||e.forEach(t=>{if(t.video){const{key:i,node:r}=t.video,n=this.host.videoState[i],o=this.activeScenes.includes(t);if(r&&n)if(o&&!this.host.waiting&&!this.host.loading&&!this.host.paused){if(r.paused&&n.initialised)try{return r.play()}catch(a){throw new zt("Video play error",a,!0)}}else r.paused||r.pause()}})}draw(e=this.currentTime){var t,i;this.host.sceneConfig&&this._canvas.value&&((i=(t=this.host).compilation)==null||i.call(t,{currentTime:e,scenes:this.host.sceneConfig,canvas:this._canvas.value}))}clear(){var e;const t=this._canvas.value;(e=t==null?void 0:t.getContext("2d"))==null||e.clearRect(0,0,t.width,t.height)}}function jm(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Xm(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ka(s){const{id:e,key:t,src:i,playlist:r,duration:n}=s;return new Promise(o=>{let a=null;const A=document.createElement("video");if(A.playsInline=!0,A.muted=!0,A.loop=!1,r&&!jm()&&hi.isSupported()){let l=!1;a=new hi({autoStartLoad:!0,xhrSetup:c=>{const{open:h}=c,u=r.split("?")[1];c.open=function(d,g,f){g.toString().includes("?")||(g+="?"+u),h.apply(this,[d,g,f])}}}),a.loadSource(r),a.attachMedia(A),a.startLoadOnce=(c=-1,h)=>{if(a&&!l){const u=a==null?void 0:a.levels.findIndex(d=>Math.min(d.height,d.width)===h);a.startLevel=a.firstLevel,a.startLoad(c),l=!0,a.currentLevel=u!==-1?u:a.firstLevel}},a.on(hi.Events.LEVEL_LOADED,async()=>{l||a==null||a.stopLoad(),o({id:e,key:t,hls:a,config:s,node:A})})}else{A.src=i;let l=!1;if(A.startLoadOnce=()=>{l||(A.preload="auto",A.load(),l=!0)},n)A.preload="none",o({id:e,key:t,hls:a,config:s,node:A});else{A.preload="metadata";const c=async()=>{o({id:e,key:t,hls:a,config:s,node:A}),A.removeEventListener("loadedmetadata",c)};A.addEventListener("loadedmetadata",c)}}})}async function Tu(s){return s.duration===1/0?new Promise(e=>{s.currentTime=Number.MAX_SAFE_INTEGER,s.ontimeupdate=()=>{s.ontimeupdate=null,e(s.duration),s.currentTime=0}}):s.duration}const zm=bi(async function(e){return new FontFace(e.name,`url(${e.woff2??e.url})`,{style:e.style,weight:e.weight}).load()},{cacheKey:([s])=>JSON.stringify(s)});let Zm=class{constructor(e){this._hasPlayed=!1,this._memoKey=null,this._lastDeps=null,this._duration=0,this._scenes=null,this._videos={},this._videoMeta={},this._videoState={},this._resolveVideo=bi(async t=>{const{id:i,key:r}=t,n=await Ka(t);n.node.volume=this.host.volume,n.node.playbackRate=this.host.playbackRate;const o={loadeddata:this._handleLoadedData,waiting:this._handleWaiting,canplay:this._handleCanPlay,progress:this._handleProgress,seeking:this._handleSeeking,seeked:this._handleSeeked,play:this._handlePlay,playing:this._handlePlaying,pause:this._handlePause,stalled:this._handleStalled,timeupdate:this._handleTimeUpdate,ended:this._handleEnded,error:this._handleError},a=Object.keys(o).reduce((A,l)=>{const c=l,h=o[c]({id:i,key:r,node:n.node});return A[c]=h,n.node.addEventListener(l,h),A},{});return{...n,listeners:a}},{cacheKey:([{id:t,key:i,src:r,playlist:n}])=>JSON.stringify({id:t,key:i,src:r==null?void 0:r.split("?")[0],playlist:n==null?void 0:n.split("?")[0]})}),this._resolveVideoMeta=bi(async(t,i)=>{const{id:r,captions:n,duration:o,startOffset:a,endOffset:A}=t,l=o??await Tu(i),c=(a??0)*l,h=(1-(A??0))*l;return{id:r,captions:n,start:c,duration:h-c}},{cacheKey:([{id:t,key:i,captions:r,duration:n,startOffset:o,endOffset:a}])=>JSON.stringify({id:t,key:i,captions:r,duration:n,startOffset:o,endOffset:a})}),this._handleLoadedData=({id:t,key:i,node:r})=>()=>{var n,o;const a=this.videoState[i];if(!(a!=null&&a.initialised)){this.videoState={...this.videoState,[i]:{...a,initialised:!0,waiting:!1,buffered:(a==null?void 0:a.buffered)??[]}};const A=(o=(n=this.scenes)==null?void 0:n.scenes)==null?void 0:o.find(({video:l})=>{l==null||l.key});A&&this._setVideoCurrentTime({scene:A,time:this.host.currentTime}),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:i,node:r}}))}},this._handleWaiting=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&!(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!0}})},this._handleCanPlay=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=({key:t,node:i})=>()=>{const r=this.videoState[t],n=this._getBufferSegments({key:t,node:i,duration:this.host.duration});this.videoState={...this.videoState,[t]:{...r,buffered:n}}},this._handleSeeking=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:i,node:r}}))},this._handleSeeked=({id:t,key:i,node:r})=>()=>{const n=this.videoState[i];n!=null&&n.initialised&&(this.host.draw(),this.host.dispatchEvent(new CustomEvent("video:seeked",{detail:{id:t,key:i,node:r}})))},this._handlePlay=({id:t,key:i,node:r})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:i,node:r}}))},this._handlePlaying=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:i,node:r}}))},this._handlePause=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:i,node:r}}))},this._handleStalled=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:i,node:r}}))},this._handleTimeUpdate=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:i,node:r}}))},this._handleEnded=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:i,node:r}}))},this._handleError=({id:t,key:i,node:r})=>()=>{const n=new zt(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:n,message:n.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:i,node:r}}))},this._cleanupVideo=t=>{var i;const r=this.videos[t];r&&(r.node.pause(),r.node.src="",(i=r.hls)==null||i.destroy(),Object.keys(r.listeners??{}).forEach(n=>{var o,a;if((o=this.videos)!=null&&o[t]){const A=(a=r.listeners)==null?void 0:a[n];A&&r.node.removeEventListener(n,A)}}),delete this.videos[t])},this.host=e,this.host.addController(this)}set hasPlayed(e){e!==this._hasPlayed&&(this._hasPlayed=e,this.host.requestUpdate())}get hasPlayed(){return this._hasPlayed}set duration(e){!isNaN(e)&&e!==this._duration&&(this._duration=e,this.host.requestUpdate(),this.host.dispatchEvent(new CustomEvent("durationchange",{detail:this._duration})))}get duration(){return this._duration}set scenes(e){e!==this._scenes&&(this._scenes=e,this.host.requestUpdate())}get scenes(){return this._scenes}set videos(e){e!==this._videos&&(this._videos=e,this.host.requestUpdate())}get videos(){return this._videos}set videoMeta(e){e!==this._videoMeta&&(this._videoMeta=e,this.host.requestUpdate())}get videoMeta(){return this._videoMeta}set videoState(e){e!==this._videoState&&(this._videoState=e,this.host.requestUpdate())}get videoState(){return this._videoState}_getBufferSegments({key:e,node:t,duration:i}){var r;const n=t==null?void 0:t.buffered,o=[],{start:a,video:A,videoMeta:l}=((r=this.scenes)==null?void 0:r.scenes.find(({video:c})=>e===(c==null?void 0:c.key)))??{};if(t&&n&&A&&l&&typeof a<"u")for(let c=0;c<n.length;c++){const h=n.start(c),u=n.end(c);Math.max(h,l.start)<=Math.min(u,l.start+l.duration)&&o.push({start:Math.max(0,(Math.max(h-l.start,0)+a)/i*100),end:Math.min((Math.min(u-l.start,l.duration)+a)/i*100,100)})}return o}_setupTask(){new kr(this.host,async([e,t,i,r,n,o])=>{try{let a=null;if(this.host._errors=[],i||e){if(this.host._processing=!0,i){let c=null;if(r)try{c=await(await fetch(r,{method:"GET"})).text()}catch(d){const g=new zt("Track failed to fetch",d);this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:g,message:g.message}))}const u={questions:{items:[{answer:{id:"source",media:{[i.includes(".m3u8")?"playlist":"video"]:i},captions:{current:c}}}]}};try{this.scenes=await cs({data:u,template:t,burnCaptions:n,debug:o},this._resolveVideo,this._resolveVideoMeta)}catch(d){try{this.scenes=await cs({data:u,burnCaptions:n,debug:o},this._resolveVideo,this._resolveVideoMeta)}catch(g){throw new zt("Fatal source template error",g,!0)}a=new zt("Source template error",d)}}else try{this.scenes=await cs({data:e,template:t,burnCaptions:n,debug:o},this._resolveVideo,this._resolveVideoMeta)}catch(c){try{this.scenes=await cs({data:e,burnCaptions:n,debug:o},this._resolveVideo,this._resolveVideoMeta)}catch(h){throw new zt("Fatal data template error",h,!0)}a=new zt("Data template error",c)}Object.keys(this.videos).forEach(c=>{this.scenes.scenes.find(({video:h})=>c===(h==null?void 0:h.key))||this._videos[c].node.pause()});const A=this.scenes.scenes.reduce((c,{video:h})=>(h&&(c[h.key]=h),c),{});Object.keys(this.videos).join("|")!==Object.keys(A).join("|")&&this.host.reset(0,!1),this.videos=A,this.videoState={...this.videoState,...this.scenes.scenes.reduce((c,{video:h,start:u,duration:d})=>{var g;const f=(h==null?void 0:h.key)??`${u}-${d}`,p=this._getBufferSegments({key:f,node:h==null?void 0:h.node,duration:this.scenes.duration});return c[f]={initialised:!h,waiting:!!h,...this.videoState[f],buffered:h?p:(g=this.videoState[f])==null?void 0:g.buffered},c},{})},this.videoMeta=this.scenes.scenes.reduce((c,{video:h,videoMeta:u})=>(h&&u&&(c[h.key]=u),c),{}),(await Promise.all(this.scenes.fonts.map(c=>zm(c)))).forEach(c=>{document.fonts.add(c)}),this.duration=this.scenes.duration,this.host.paused&&this.host.reset(this.host.currentTime,!this.host.paused)}a&&this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:a,message:a.message}))}catch(a){this.scenes=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:a,message:a.message}))}finally{this.host._processing=!1}},()=>{const e=JSON.stringify({data:this.host.data,template:this.host.template,src:this.host.src,track:this.host.track,burnCaptions:this.host.burnCaptions,debug:this.host.debug});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.data,this.host.template,this.host.src,this.host.track,this.host.burnCaptions,this.host.debug];return this._memoKey=e,this._lastDeps=t,t})}_setVideoCurrentTime({time:e,scene:t}){const{start:i,video:r,videoMeta:n}=t;if(r&&r.node&&n&&typeof i<"u"){const o=e-i;r.node.currentTime=Math.max(n.start,Math.min(n.start+n.duration,o+n.start))}}setVideosCurrentTime(e){var t;(t=this.scenes)==null||t.scenes.forEach(i=>{this._setVideoCurrentTime({time:e,scene:i})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.videos).forEach(e=>{this._cleanupVideo(e)}),this.videos={}}};function eC(s){s.requestFullscreen?s.requestFullscreen():s.mozRequestFullScreen?s.mozRequestFullScreen():s.webkitRequestFullscreen?s.webkitRequestFullscreen():s.msRequestFullscreen&&s.msRequestFullscreen()}function tC(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const Va=["progress","play-large","navigation","play","volume","current-time","duration","speed","captions","fullscreen","preview"],iC={id:"captions",event:"captions:click",label:"Closed Captions"},sC={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},xu={title:"Playback Speed",items:[{id:"playback-rate-0.5",event:"playbackRate:click",label:"0.5x",value:.5},{id:"playback-rate-1",event:"playbackRate:click",label:"1.0x",value:1},{id:"playback-rate-1.5",event:"playbackRate:click",label:"1.5x",value:1.5},{id:"playback-rate-2",event:"playbackRate:click",label:"2.0x",value:2}]},rC={id:"playbackRate",label:"Playback playbackRate",subItems:xu};class nC extends jA{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==As.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}disconnected(){var e;(e=this.observer)==null||e.disconnect(),this.observer=void 0}reconnected(){var e;this.element&&((e=this.observer)==null||e.observe(this.element))}update(e,[t]){return this.isConnected&&!this.observer&&(this.observer=new ResizeObserver(t),this.element=e.element,this.observer.observe(this.element)),Bi}}const Ja=ls(nC),oC=II(()=>{const s=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),e=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-SemiBold.woff2)",{style:"normal",weight:"600"}),t=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),i=Gl.map(r=>({load:!1,font:new FontFace(r.family,`url(${r.url})`,{style:r.style})}));return[{load:!0,font:s},{load:!0,font:e},{load:!0,font:t},...i]}),Zt={"red-120":"#feeded","red-130":"#fcd5d0","red-400":"#e84a4a","red-500":"#c51c3a","red-700":"#a21c39","red-800":"#850231","red-900":"#580A2D","teal-80":"#f3fafa","teal-100":"#d6f1f1","teal-200":"#ace3e3","teal-300":"#7acace","teal-400":"#4faab2","teal-500":"#358f97","teal-600":"#287179","teal-700":"#22555c","teal-800":"#21484e","teal-900":"#1f3d42","teal-950":"#0d2126","purple-100":"#d7cfff","purple-700":"#5f2fe9","green-200":"#a4d7aa","green-500":"#38b319","green-800":"#2b3c2f","grey-100":"#f0f0f0","light-50":"rgba(255, 255, 255, .05)","light-100":"rgba(255, 255, 255, .1)","light-200":"rgba(255, 255, 255, .2)","light-400":"rgba(255, 255, 255, .4)","light-500":"rgba(255, 255, 255, .5)","light-640":"rgba(255, 255, 255, .64)","light-800":"rgba(255, 255, 255, .8)","light-1000":"#fff","dark-50":"rgba(0, 0, 0, .05)","dark-80":"rgba(0, 0, 0, .08)","dark-100":"rgba(0, 0, 0, .1)","dark-200":"rgba(0, 0, 0, .2)","dark-250":"rgba(0, 0, 0, .25)","dark-400":"rgba(0, 0, 0, .4)","dark-500":"rgba(0, 0, 0, .5)","dark-640":"rgba(0, 0, 0, .64)","dark-800":"rgba(0, 0, 0, .8)","dark-900":"rgba(0, 0, 0, .9)","dark-1000":"#000"},aC={colors:Zt,space:{xxs:".25rem",xs:".5rem",small:".75rem",medium:"1rem",large:"1.5rem",xl:"2.5rem"},sizes:{xxs:"1rem",xs:"1.5rem",small:"2rem",medium:"2.5rem",large:"3rem"},fontWeights:{regular:400,semibold:600},lineHeights:{small:1.1,medium:1.25,large:1.4},letterSpacings:{xxs:"-.04rem",xs:"-.03rem",small:"-.02rem",medium:"-.01rem",large:0},fontSizes:{micro:".625rem",small:".75rem",medium:".875rem",large:"1rem",xl:"1.25rem",xxl:"1.5rem",xxxl:"2rem",huge:"2.75rem"},fontFamilies:{sans:'Roobert, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,"Noto Sans", "Noto Color Emoji", sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji"',mono:'"Maison Neue Mono", Menlo, Monaco, Consolas, Liberation Mono, "Courier New", monospace'},borderWidths:{thin:".0625rem"},radii:{small:".25rem",medium:".5rem",large:".75rem",xl:"1rem"},shadows:{small:`.25rem .25rem .25rem ${Zt["dark-100"]}`,medium:`0 .125rem .625rem ${Zt["dark-100"]}`,large:`0 .25rem 1rem ${Zt["dark-50"]}`,xl:`.25rem .25rem 1rem ${Zt["dark-250"]}`,xxl:`0 .25rem 2rem ${Zt["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${Zt["dark-250"]}`,toolbar:`0 -.625rem .625rem ${Zt["dark-50"]}`,text:`0 0 .25rem ${Zt["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:Zt["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},Du=fI.flatten(aC,{delimiter:"-"}),AC=Object.keys(Du).map(s=>Ns(`:host { --${s}: ${Du[s]}; }`)),ke=(s=>{class e extends s{firstUpdated(){oC().forEach(({load:r,font:n})=>{document.fonts.add(n),r&&n.load()})}}return e.styles=[(s==null?void 0:s.styles)??[],AC,nt`
|
208
|
+
*/const Kh=(s,e,t)=>{const i=new Map;for(let r=e;r<=t;r++)i.set(s[r],r);return i},Vh=ls(class extends Ys{constructor(s){if(super(s),s.type!==As.CHILD)throw Error("repeat() can only be used in text expressions")}ht(s,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const r=[],n=[];let o=0;for(const a of s)r[o]=i?i(a,o):o,n[o]=t(a,o),o++;return{values:n,keys:r}}render(s,e,t){return this.ht(s,e,t).values}update(s,[e,t,i]){const r=Od(s),{values:n,keys:o}=this.ht(e,t,i);if(!Array.isArray(r))return this.dt=o,n;const a=this.dt??(this.dt=[]),A=[];let l,c,h=0,u=r.length-1,d=0,g=n.length-1;for(;h<=u&&d<=g;)if(r[h]===null)h++;else if(r[u]===null)u--;else if(a[h]===o[d])A[d]=$i(r[h],n[d]),h++,d++;else if(a[u]===o[g])A[g]=$i(r[u],n[g]),u--,g--;else if(a[h]===o[g])A[g]=$i(r[h],n[g]),$s(s,A[g+1],r[h]),h++,g--;else if(a[u]===o[d])A[d]=$i(r[u],n[d]),$s(s,r[h],r[u]),u--,d++;else if(l===void 0&&(l=Kh(o,d,g),c=Kh(a,h,u)),l.has(a[h]))if(l.has(a[u])){const f=c.get(o[d]),p=f!==void 0?r[f]:null;if(p===null){const y=$s(s,r[h]);$i(y,n[d]),A[d]=y}else A[d]=$i(p,n[d]),$s(s,r[h],p),r[f]=null;d++}else ro(r[u]),u--;else ro(r[h]),h++;for(;d<=g;){const f=$s(s,A[g+1]);$i(f,n[d]),A[d++]=f}for(;h<=u;){const f=r[h++];f!==null&&ro(f)}return this.dt=o,Pd(s,A),Ci}});var wt="top",Nt="bottom",Ft="right",Tt="left",xa="auto",hr=[wt,Nt,Ft,Tt],Es="start",ur="end",CI="clippingParents",Jh="viewport",dr="popper",yI="reference",Wh=hr.reduce(function(s,e){return s.concat([e+"-"+Es,e+"-"+ur])},[]),qh=[].concat(hr,[xa]).reduce(function(s,e){return s.concat([e,e+"-"+Es,e+"-"+ur])},[]),BI="beforeRead",vI="read",QI="afterRead",bI="beforeMain",SI="main",wI="afterMain",TI="beforeWrite",xI="write",DI="afterWrite",RI=[BI,vI,QI,bI,SI,wI,TI,xI,DI];function qt(s){return s?(s.nodeName||"").toLowerCase():null}function Dt(s){if(s==null)return window;if(s.toString()!=="[object Window]"){var e=s.ownerDocument;return e&&e.defaultView||window}return s}function zi(s){var e=Dt(s).Element;return s instanceof e||s instanceof Element}function Mt(s){var e=Dt(s).HTMLElement;return s instanceof e||s instanceof HTMLElement}function Da(s){if(typeof ShadowRoot>"u")return!1;var e=Dt(s).ShadowRoot;return s instanceof e||s instanceof ShadowRoot}function LI(s){var e=s.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},n=e.elements[t];!Mt(n)||!qt(n)||(Object.assign(n.style,i),Object.keys(r).forEach(function(o){var a=r[o];a===!1?n.removeAttribute(o):n.setAttribute(o,a===!0?"":a)}))})}function _I(s){var e=s.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],n=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(A,l){return A[l]="",A},{});!Mt(r)||!qt(r)||(Object.assign(r.style,a),Object.keys(n).forEach(function(A){r.removeAttribute(A)}))})}}const jh={name:"applyStyles",enabled:!0,phase:"write",fn:LI,effect:_I,requires:["computeStyles"]};function jt(s){return s.split("-")[0]}var Zi=Math.max,Sn=Math.min,Is=Math.round;function Ra(){var s=navigator.userAgentData;return s!=null&&s.brands&&Array.isArray(s.brands)?s.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Xh(){return!/^((?!chrome|android).)*safari/i.test(Ra())}function ms(s,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=s.getBoundingClientRect(),r=1,n=1;e&&Mt(s)&&(r=s.offsetWidth>0&&Is(i.width)/s.offsetWidth||1,n=s.offsetHeight>0&&Is(i.height)/s.offsetHeight||1);var o=zi(s)?Dt(s):window,a=o.visualViewport,A=!Xh()&&t,l=(i.left+(A&&a?a.offsetLeft:0))/r,c=(i.top+(A&&a?a.offsetTop:0))/n,h=i.width/r,u=i.height/n;return{width:h,height:u,top:c,right:l+h,bottom:c+u,left:l,x:l,y:c}}function La(s){var e=ms(s),t=s.offsetWidth,i=s.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:s.offsetLeft,y:s.offsetTop,width:t,height:i}}function zh(s,e){var t=e.getRootNode&&e.getRootNode();if(s.contains(e))return!0;if(t&&Da(t)){var i=e;do{if(i&&s.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function di(s){return Dt(s).getComputedStyle(s)}function kI(s){return["table","td","th"].indexOf(qt(s))>=0}function Di(s){return((zi(s)?s.ownerDocument:s.document)||window.document).documentElement}function wn(s){return qt(s)==="html"?s:s.assignedSlot||s.parentNode||(Da(s)?s.host:null)||Di(s)}function Zh(s){return!Mt(s)||di(s).position==="fixed"?null:s.offsetParent}function NI(s){var e=/firefox/i.test(Ra()),t=/Trident/i.test(Ra());if(t&&Mt(s)){var i=di(s);if(i.position==="fixed")return null}var r=wn(s);for(Da(r)&&(r=r.host);Mt(r)&&["html","body"].indexOf(qt(r))<0;){var n=di(r);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||e&&n.willChange==="filter"||e&&n.filter&&n.filter!=="none")return r;r=r.parentNode}return null}function gr(s){for(var e=Dt(s),t=Zh(s);t&&kI(t)&&di(t).position==="static";)t=Zh(t);return t&&(qt(t)==="html"||qt(t)==="body"&&di(t).position==="static")?e:t||NI(s)||e}function _a(s){return["top","bottom"].indexOf(s)>=0?"x":"y"}function fr(s,e,t){return Zi(s,Sn(e,t))}function FI(s,e,t){var i=fr(s,e,t);return i>t?t:i}function eu(){return{top:0,right:0,bottom:0,left:0}}function tu(s){return Object.assign({},eu(),s)}function iu(s,e){return e.reduce(function(t,i){return t[i]=s,t},{})}var MI=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,tu(typeof e!="number"?e:iu(e,hr))};function PI(s){var e,t=s.state,i=s.name,r=s.options,n=t.elements.arrow,o=t.modifiersData.popperOffsets,a=jt(t.placement),A=_a(a),l=[Tt,Ft].indexOf(a)>=0,c=l?"height":"width";if(!(!n||!o)){var h=MI(r.padding,t),u=La(n),d=A==="y"?wt:Tt,g=A==="y"?Nt:Ft,f=t.rects.reference[c]+t.rects.reference[A]-o[A]-t.rects.popper[c],p=o[A]-t.rects.reference[A],y=gr(n),B=y?A==="y"?y.clientHeight||0:y.clientWidth||0:0,Q=f/2-p/2,C=h[d],T=B-u[c]-h[g],b=B/2-u[c]/2+Q,L=fr(C,b,T),R=A;t.modifiersData[i]=(e={},e[R]=L,e.centerOffset=L-b,e)}}function OI(s){var e=s.state,t=s.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||zh(e.elements.popper,r)&&(e.elements.arrow=r))}const UI={name:"arrow",enabled:!0,phase:"main",fn:PI,effect:OI,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Cs(s){return s.split("-")[1]}var GI={top:"auto",right:"auto",bottom:"auto",left:"auto"};function HI(s,e){var t=s.x,i=s.y,r=e.devicePixelRatio||1;return{x:Is(t*r)/r||0,y:Is(i*r)/r||0}}function su(s){var e,t=s.popper,i=s.popperRect,r=s.placement,n=s.variation,o=s.offsets,a=s.position,A=s.gpuAcceleration,l=s.adaptive,c=s.roundOffsets,h=s.isFixed,u=o.x,d=u===void 0?0:u,g=o.y,f=g===void 0?0:g,p=typeof c=="function"?c({x:d,y:f}):{x:d,y:f};d=p.x,f=p.y;var y=o.hasOwnProperty("x"),B=o.hasOwnProperty("y"),Q=Tt,C=wt,T=window;if(l){var b=gr(t),L="clientHeight",R="clientWidth";if(b===Dt(t)&&(b=Di(t),di(b).position!=="static"&&a==="absolute"&&(L="scrollHeight",R="scrollWidth")),b=b,r===wt||(r===Tt||r===Ft)&&n===ur){C=Nt;var O=h&&b===T&&T.visualViewport?T.visualViewport.height:b[L];f-=O-i.height,f*=A?1:-1}if(r===Tt||(r===wt||r===Nt)&&n===ur){Q=Ft;var k=h&&b===T&&T.visualViewport?T.visualViewport.width:b[R];d-=k-i.width,d*=A?1:-1}}var W=Object.assign({position:a},l&&GI),$=c===!0?HI({x:d,y:f},Dt(t)):{x:d,y:f};if(d=$.x,f=$.y,A){var te;return Object.assign({},W,(te={},te[C]=B?"0":"",te[Q]=y?"0":"",te.transform=(T.devicePixelRatio||1)<=1?"translate("+d+"px, "+f+"px)":"translate3d("+d+"px, "+f+"px, 0)",te))}return Object.assign({},W,(e={},e[C]=B?f+"px":"",e[Q]=y?d+"px":"",e.transform="",e))}function $I(s){var e=s.state,t=s.options,i=t.gpuAcceleration,r=i===void 0?!0:i,n=t.adaptive,o=n===void 0?!0:n,a=t.roundOffsets,A=a===void 0?!0:a,l={placement:jt(e.placement),variation:Cs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,su(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:A})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,su(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const YI={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:$I,data:{}};var Tn={passive:!0};function KI(s){var e=s.state,t=s.instance,i=s.options,r=i.scroll,n=r===void 0?!0:r,o=i.resize,a=o===void 0?!0:o,A=Dt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&l.forEach(function(c){c.addEventListener("scroll",t.update,Tn)}),a&&A.addEventListener("resize",t.update,Tn),function(){n&&l.forEach(function(c){c.removeEventListener("scroll",t.update,Tn)}),a&&A.removeEventListener("resize",t.update,Tn)}}const VI={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:KI,data:{}};var JI={left:"right",right:"left",bottom:"top",top:"bottom"};function xn(s){return s.replace(/left|right|bottom|top/g,function(e){return JI[e]})}var WI={start:"end",end:"start"};function ru(s){return s.replace(/start|end/g,function(e){return WI[e]})}function ka(s){var e=Dt(s),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Na(s){return ms(Di(s)).left+ka(s).scrollLeft}function qI(s,e){var t=Dt(s),i=Di(s),r=t.visualViewport,n=i.clientWidth,o=i.clientHeight,a=0,A=0;if(r){n=r.width,o=r.height;var l=Xh();(l||!l&&e==="fixed")&&(a=r.offsetLeft,A=r.offsetTop)}return{width:n,height:o,x:a+Na(s),y:A}}function jI(s){var e,t=Di(s),i=ka(s),r=(e=s.ownerDocument)==null?void 0:e.body,n=Zi(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Zi(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Na(s),A=-i.scrollTop;return di(r||t).direction==="rtl"&&(a+=Zi(t.clientWidth,r?r.clientWidth:0)-n),{width:n,height:o,x:a,y:A}}function Fa(s){var e=di(s),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function nu(s){return["html","body","#document"].indexOf(qt(s))>=0?s.ownerDocument.body:Mt(s)&&Fa(s)?s:nu(wn(s))}function pr(s,e){var t;e===void 0&&(e=[]);var i=nu(s),r=i===((t=s.ownerDocument)==null?void 0:t.body),n=Dt(i),o=r?[n].concat(n.visualViewport||[],Fa(i)?i:[]):i,a=e.concat(o);return r?a:a.concat(pr(wn(o)))}function Ma(s){return Object.assign({},s,{left:s.x,top:s.y,right:s.x+s.width,bottom:s.y+s.height})}function XI(s,e){var t=ms(s,!1,e==="fixed");return t.top=t.top+s.clientTop,t.left=t.left+s.clientLeft,t.bottom=t.top+s.clientHeight,t.right=t.left+s.clientWidth,t.width=s.clientWidth,t.height=s.clientHeight,t.x=t.left,t.y=t.top,t}function ou(s,e,t){return e===Jh?Ma(qI(s,t)):zi(e)?XI(e,t):Ma(jI(Di(s)))}function zI(s){var e=pr(wn(s)),t=["absolute","fixed"].indexOf(di(s).position)>=0,i=t&&Mt(s)?gr(s):s;return zi(i)?e.filter(function(r){return zi(r)&&zh(r,i)&&qt(r)!=="body"}):[]}function ZI(s,e,t,i){var r=e==="clippingParents"?zI(s):[].concat(e),n=[].concat(r,[t]),o=n[0],a=n.reduce(function(A,l){var c=ou(s,l,i);return A.top=Zi(c.top,A.top),A.right=Sn(c.right,A.right),A.bottom=Sn(c.bottom,A.bottom),A.left=Zi(c.left,A.left),A},ou(s,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function au(s){var e=s.reference,t=s.element,i=s.placement,r=i?jt(i):null,n=i?Cs(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,A;switch(r){case wt:A={x:o,y:e.y-t.height};break;case Nt:A={x:o,y:e.y+e.height};break;case Ft:A={x:e.x+e.width,y:a};break;case Tt:A={x:e.x-t.width,y:a};break;default:A={x:e.x,y:e.y}}var l=r?_a(r):null;if(l!=null){var c=l==="y"?"height":"width";switch(n){case Es:A[l]=A[l]-(e[c]/2-t[c]/2);break;case ur:A[l]=A[l]+(e[c]/2-t[c]/2);break}}return A}function Er(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?s.placement:i,n=t.strategy,o=n===void 0?s.strategy:n,a=t.boundary,A=a===void 0?CI:a,l=t.rootBoundary,c=l===void 0?Jh:l,h=t.elementContext,u=h===void 0?dr:h,d=t.altBoundary,g=d===void 0?!1:d,f=t.padding,p=f===void 0?0:f,y=tu(typeof p!="number"?p:iu(p,hr)),B=u===dr?yI:dr,Q=s.rects.popper,C=s.elements[g?B:u],T=ZI(zi(C)?C:C.contextElement||Di(s.elements.popper),A,c,o),b=ms(s.elements.reference),L=au({reference:b,element:Q,strategy:"absolute",placement:r}),R=Ma(Object.assign({},Q,L)),O=u===dr?R:b,k={top:T.top-O.top+y.top,bottom:O.bottom-T.bottom+y.bottom,left:T.left-O.left+y.left,right:O.right-T.right+y.right},W=s.modifiersData.offset;if(u===dr&&W){var $=W[r];Object.keys(k).forEach(function(te){var Z=[Ft,Nt].indexOf(te)>=0?1:-1,S=[wt,Nt].indexOf(te)>=0?"y":"x";k[te]+=$[S]*Z})}return k}function em(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,n=t.rootBoundary,o=t.padding,a=t.flipVariations,A=t.allowedAutoPlacements,l=A===void 0?qh:A,c=Cs(i),h=c?a?Wh:Wh.filter(function(g){return Cs(g)===c}):hr,u=h.filter(function(g){return l.indexOf(g)>=0});u.length===0&&(u=h);var d=u.reduce(function(g,f){return g[f]=Er(s,{placement:f,boundary:r,rootBoundary:n,padding:o})[jt(f)],g},{});return Object.keys(d).sort(function(g,f){return d[g]-d[f]})}function tm(s){if(jt(s)===xa)return[];var e=xn(s);return[ru(s),e,ru(e)]}function im(s){var e=s.state,t=s.options,i=s.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!0:o,A=t.fallbackPlacements,l=t.padding,c=t.boundary,h=t.rootBoundary,u=t.altBoundary,d=t.flipVariations,g=d===void 0?!0:d,f=t.allowedAutoPlacements,p=e.options.placement,y=jt(p),B=y===p,Q=A||(B||!g?[xn(p)]:tm(p)),C=[p].concat(Q).reduce(function(se,ue){return se.concat(jt(ue)===xa?em(e,{placement:ue,boundary:c,rootBoundary:h,padding:l,flipVariations:g,allowedAutoPlacements:f}):ue)},[]),T=e.rects.reference,b=e.rects.popper,L=new Map,R=!0,O=C[0],k=0;k<C.length;k++){var W=C[k],$=jt(W),te=Cs(W)===Es,Z=[wt,Nt].indexOf($)>=0,S=Z?"width":"height",D=Er(e,{placement:W,boundary:c,rootBoundary:h,altBoundary:u,padding:l}),U=Z?te?Ft:Tt:te?Nt:wt;T[S]>b[S]&&(U=xn(U));var v=xn(U),w=[];if(n&&w.push(D[$]<=0),a&&w.push(D[U]<=0,D[v]<=0),w.every(function(se){return se})){O=W,R=!1;break}L.set(W,w)}if(R)for(var F=g?3:1,H=function(ue){var le=C.find(function(Ce){var Se=L.get(Ce);if(Se)return Se.slice(0,ue).every(function(Le){return Le})});if(le)return O=le,"break"},K=F;K>0;K--){var j=H(K);if(j==="break")break}e.placement!==O&&(e.modifiersData[i]._skip=!0,e.placement=O,e.reset=!0)}}const sm={name:"flip",enabled:!0,phase:"main",fn:im,requiresIfExists:["offset"],data:{_skip:!1}};function Au(s,e,t){return t===void 0&&(t={x:0,y:0}),{top:s.top-e.height-t.y,right:s.right-e.width+t.x,bottom:s.bottom-e.height+t.y,left:s.left-e.width-t.x}}function lu(s){return[wt,Ft,Nt,Tt].some(function(e){return s[e]>=0})}function rm(s){var e=s.state,t=s.name,i=e.rects.reference,r=e.rects.popper,n=e.modifiersData.preventOverflow,o=Er(e,{elementContext:"reference"}),a=Er(e,{altBoundary:!0}),A=Au(o,i),l=Au(a,r,n),c=lu(A),h=lu(l);e.modifiersData[t]={referenceClippingOffsets:A,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}const nm={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:rm};function om(s,e,t){var i=jt(s),r=[Tt,wt].indexOf(i)>=0?-1:1,n=typeof t=="function"?t(Object.assign({},e,{placement:s})):t,o=n[0],a=n[1];return o=o||0,a=(a||0)*r,[Tt,Ft].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function am(s){var e=s.state,t=s.options,i=s.name,r=t.offset,n=r===void 0?[0,0]:r,o=qh.reduce(function(c,h){return c[h]=om(h,e.rects,n),c},{}),a=o[e.placement],A=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=A,e.modifiersData.popperOffsets.y+=l),e.modifiersData[i]=o}const Am={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:am};function lm(s){var e=s.state,t=s.name;e.modifiersData[t]=au({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const cm={name:"popperOffsets",enabled:!0,phase:"read",fn:lm,data:{}};function hm(s){return s==="x"?"y":"x"}function um(s){var e=s.state,t=s.options,i=s.name,r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!1:o,A=t.boundary,l=t.rootBoundary,c=t.altBoundary,h=t.padding,u=t.tether,d=u===void 0?!0:u,g=t.tetherOffset,f=g===void 0?0:g,p=Er(e,{boundary:A,rootBoundary:l,padding:h,altBoundary:c}),y=jt(e.placement),B=Cs(e.placement),Q=!B,C=_a(y),T=hm(C),b=e.modifiersData.popperOffsets,L=e.rects.reference,R=e.rects.popper,O=typeof f=="function"?f(Object.assign({},e.rects,{placement:e.placement})):f,k=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),W=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,$={x:0,y:0};if(b){if(n){var te,Z=C==="y"?wt:Tt,S=C==="y"?Nt:Ft,D=C==="y"?"height":"width",U=b[C],v=U+p[Z],w=U-p[S],F=d?-R[D]/2:0,H=B===Es?L[D]:R[D],K=B===Es?-R[D]:-L[D],j=e.elements.arrow,se=d&&j?La(j):{width:0,height:0},ue=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:eu(),le=ue[Z],Ce=ue[S],Se=fr(0,L[D],se[D]),Le=Q?L[D]/2-F-Se-le-k.mainAxis:H-Se-le-k.mainAxis,oe=Q?-L[D]/2+F+Se+Ce+k.mainAxis:K+Se+Ce+k.mainAxis,Ie=e.elements.arrow&&gr(e.elements.arrow),Be=Ie?C==="y"?Ie.clientTop||0:Ie.clientLeft||0:0,ce=(te=W==null?void 0:W[C])!=null?te:0,Ae=U+Le-ce-Be,ne=U+oe-ce,be=fr(d?Sn(v,Ae):v,U,d?Zi(w,ne):w);b[C]=be,$[C]=be-U}if(a){var Pe,Te=C==="x"?wt:Tt,ke=C==="x"?Nt:Ft,Oe=b[T],De=T==="y"?"height":"width",ve=Oe+p[Te],He=Oe-p[ke],We=[wt,Tt].indexOf(y)!==-1,rt=(Pe=W==null?void 0:W[T])!=null?Pe:0,Xe=We?ve:Oe-L[De]-R[De]-rt+k.altAxis,pt=We?Oe+L[De]+R[De]-rt-k.altAxis:He,fi=d&&We?FI(Xe,Oe,pt):fr(d?Xe:ve,Oe,d?pt:He);b[T]=fi,$[T]=fi-Oe}e.modifiersData[i]=$}}const dm={name:"preventOverflow",enabled:!0,phase:"main",fn:um,requiresIfExists:["offset"]};function gm(s){return{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}}function fm(s){return s===Dt(s)||!Mt(s)?ka(s):gm(s)}function pm(s){var e=s.getBoundingClientRect(),t=Is(e.width)/s.offsetWidth||1,i=Is(e.height)/s.offsetHeight||1;return t!==1||i!==1}function Em(s,e,t){t===void 0&&(t=!1);var i=Mt(e),r=Mt(e)&&pm(e),n=Di(e),o=ms(s,r,t),a={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(i||!i&&!t)&&((qt(e)!=="body"||Fa(n))&&(a=fm(e)),Mt(e)?(A=ms(e,!0),A.x+=e.clientLeft,A.y+=e.clientTop):n&&(A.x=Na(n))),{x:o.left+a.scrollLeft-A.x,y:o.top+a.scrollTop-A.y,width:o.width,height:o.height}}function Im(s){var e=new Map,t=new Set,i=[];s.forEach(function(n){e.set(n.name,n)});function r(n){t.add(n.name);var o=[].concat(n.requires||[],n.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var A=e.get(a);A&&r(A)}}),i.push(n)}return s.forEach(function(n){t.has(n.name)||r(n)}),i}function mm(s){var e=Im(s);return RI.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function Cm(s){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(s())})})),e}}function ym(s){var e=s.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var cu={placement:"bottom",modifiers:[],strategy:"absolute"};function hu(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Bm(s){s===void 0&&(s={});var e=s,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,n=r===void 0?cu:r;return function(a,A,l){l===void 0&&(l=n);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},cu,n),modifiersData:{},elements:{reference:a,popper:A},attributes:{},styles:{}},h=[],u=!1,d={state:c,setOptions:function(y){var B=typeof y=="function"?y(c.options):y;f(),c.options=Object.assign({},n,c.options,B),c.scrollParents={reference:zi(a)?pr(a):a.contextElement?pr(a.contextElement):[],popper:pr(A)};var Q=mm(ym([].concat(i,c.options.modifiers)));return c.orderedModifiers=Q.filter(function(C){return C.enabled}),g(),d.update()},forceUpdate:function(){if(!u){var y=c.elements,B=y.reference,Q=y.popper;if(hu(B,Q)){c.rects={reference:Em(B,gr(Q),c.options.strategy==="fixed"),popper:La(Q)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(k){return c.modifiersData[k.name]=Object.assign({},k.data)});for(var C=0;C<c.orderedModifiers.length;C++){if(c.reset===!0){c.reset=!1,C=-1;continue}var T=c.orderedModifiers[C],b=T.fn,L=T.options,R=L===void 0?{}:L,O=T.name;typeof b=="function"&&(c=b({state:c,options:R,name:O,instance:d})||c)}}}},update:Cm(function(){return new Promise(function(p){d.forceUpdate(),p(c)})}),destroy:function(){f(),u=!0}};if(!hu(a,A))return d;d.setOptions(l).then(function(p){!u&&l.onFirstUpdate&&l.onFirstUpdate(p)});function g(){c.orderedModifiers.forEach(function(p){var y=p.name,B=p.options,Q=B===void 0?{}:B,C=p.effect;if(typeof C=="function"){var T=C({state:c,name:y,instance:d,options:Q}),b=function(){};h.push(T||b)}})}function f(){h.forEach(function(p){return p()}),h=[]}return d}}var vm=[VI,cm,YI,jh,Am,sm,dm,UI,nm],Qm=Bm({defaultModifiers:vm}),bm="tippy-box",uu="tippy-content",Sm="tippy-backdrop",du="tippy-arrow",gu="tippy-svg-arrow",es={passive:!0,capture:!0},fu=function(){return document.body};function Pa(s,e,t){if(Array.isArray(s)){var i=s[e];return i??(Array.isArray(t)?t[e]:t)}return s}function Oa(s,e){var t={}.toString.call(s);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function pu(s,e){return typeof s=="function"?s.apply(void 0,e):s}function Eu(s,e){if(e===0)return s;var t;return function(i){clearTimeout(t),t=setTimeout(function(){s(i)},e)}}function wm(s){return s.split(/\s+/).filter(Boolean)}function ys(s){return[].concat(s)}function Iu(s,e){s.indexOf(e)===-1&&s.push(e)}function Tm(s){return s.filter(function(e,t){return s.indexOf(e)===t})}function xm(s){return s.split("-")[0]}function Dn(s){return[].slice.call(s)}function mu(s){return Object.keys(s).reduce(function(e,t){return s[t]!==void 0&&(e[t]=s[t]),e},{})}function Ir(){return document.createElement("div")}function Rn(s){return["Element","Fragment"].some(function(e){return Oa(s,e)})}function Dm(s){return Oa(s,"NodeList")}function Rm(s){return Oa(s,"MouseEvent")}function Lm(s){return!!(s&&s._tippy&&s._tippy.reference===s)}function _m(s){return Rn(s)?[s]:Dm(s)?Dn(s):Array.isArray(s)?s:Dn(document.querySelectorAll(s))}function Ua(s,e){s.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Cu(s,e){s.forEach(function(t){t&&t.setAttribute("data-state",e)})}function km(s){var e,t=ys(s),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function Nm(s,e){var t=e.clientX,i=e.clientY;return s.every(function(r){var n=r.popperRect,o=r.popperState,a=r.props,A=a.interactiveBorder,l=xm(o.placement),c=o.modifiersData.offset;if(!c)return!0;var h=l==="bottom"?c.top.y:0,u=l==="top"?c.bottom.y:0,d=l==="right"?c.left.x:0,g=l==="left"?c.right.x:0,f=n.top-i+h>A,p=i-n.bottom-u>A,y=n.left-t+d>A,B=t-n.right-g>A;return f||p||y||B})}function Ga(s,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){s[i](r,t)})}function yu(s,e){for(var t=e;t;){var i;if(s.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var Xt={isTouch:!1},Bu=0;function Fm(){Xt.isTouch||(Xt.isTouch=!0,window.performance&&document.addEventListener("mousemove",vu))}function vu(){var s=performance.now();s-Bu<20&&(Xt.isTouch=!1,document.removeEventListener("mousemove",vu)),Bu=s}function Mm(){var s=document.activeElement;if(Lm(s)){var e=s._tippy;s.blur&&!e.state.isVisible&&s.blur()}}function Pm(){document.addEventListener("touchstart",Fm,es),window.addEventListener("blur",Mm)}var Om=typeof window<"u"&&typeof document<"u",Um=Om?!!window.msCrypto:!1,Gm={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Hm={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Gt=Object.assign({appendTo:fu,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Gm,Hm),$m=Object.keys(Gt),Ym=function(e){var t=Object.keys(e);t.forEach(function(i){Gt[i]=e[i]})};function Qu(s){var e=s.plugins||[],t=e.reduce(function(i,r){var n=r.name,o=r.defaultValue;if(n){var a;i[n]=s[n]!==void 0?s[n]:(a=Gt[n])!=null?a:o}return i},{});return Object.assign({},s,t)}function Km(s,e){var t=e?Object.keys(Qu(Object.assign({},Gt,{plugins:e}))):$m,i=t.reduce(function(r,n){var o=(s.getAttribute("data-tippy-"+n)||"").trim();if(!o)return r;if(n==="content")r[n]=o;else try{r[n]=JSON.parse(o)}catch{r[n]=o}return r},{});return i}function bu(s,e){var t=Object.assign({},e,{content:pu(e.content,[s])},e.ignoreAttributes?{}:Km(s,e.plugins));return t.aria=Object.assign({},Gt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var Vm=function(){return"innerHTML"};function Ha(s,e){s[Vm()]=e}function Su(s){var e=Ir();return s===!0?e.className=du:(e.className=gu,Rn(s)?e.appendChild(s):Ha(e,s)),e}function wu(s,e){Rn(e.content)?(Ha(s,""),s.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Ha(s,e.content):s.textContent=e.content)}function $a(s){var e=s.firstElementChild,t=Dn(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(uu)}),arrow:t.find(function(i){return i.classList.contains(du)||i.classList.contains(gu)}),backdrop:t.find(function(i){return i.classList.contains(Sm)})}}function Tu(s){var e=Ir(),t=Ir();t.className=bm,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=Ir();i.className=uu,i.setAttribute("data-state","hidden"),wu(i,s.props),e.appendChild(t),t.appendChild(i),r(s.props,s.props);function r(n,o){var a=$a(e),A=a.box,l=a.content,c=a.arrow;o.theme?A.setAttribute("data-theme",o.theme):A.removeAttribute("data-theme"),typeof o.animation=="string"?A.setAttribute("data-animation",o.animation):A.removeAttribute("data-animation"),o.inertia?A.setAttribute("data-inertia",""):A.removeAttribute("data-inertia"),A.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?A.setAttribute("role",o.role):A.removeAttribute("role"),(n.content!==o.content||n.allowHTML!==o.allowHTML)&&wu(l,s.props),o.arrow?c?n.arrow!==o.arrow&&(A.removeChild(c),A.appendChild(Su(o.arrow))):A.appendChild(Su(o.arrow)):c&&A.removeChild(c)}return{popper:e,onUpdate:r}}Tu.$$tippy=!0;var Jm=1,Ln=[],Ya=[];function Wm(s,e){var t=bu(s,Object.assign({},Gt,Qu(mu(e)))),i,r,n,o=!1,a=!1,A=!1,l=!1,c,h,u,d=[],g=Eu(Ae,t.interactiveDebounce),f,p=Jm++,y=null,B=Tm(t.plugins),Q={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:p,reference:s,popper:Ir(),popperInstance:y,props:t,state:Q,plugins:B,clearDelayTimeouts:Xe,setProps:pt,setContent:fi,show:Et,hide:ti,hideWithInteractivity:ii,enable:We,disable:rt,unmount:si,destroy:ct};if(!t.render)return C;var T=t.render(C),b=T.popper,L=T.onUpdate;b.setAttribute("data-tippy-root",""),b.id="tippy-"+C.id,C.popper=b,s._tippy=C,b._tippy=C;var R=B.map(function(G){return G.fn(C)}),O=s.hasAttribute("aria-expanded");return Ie(),F(),U(),v("onCreate",[C]),t.showOnCreate&&ve(),b.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),b.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&Z().addEventListener("mousemove",g)}),C;function k(){var G=C.props.touch;return Array.isArray(G)?G:[G,0]}function W(){return k()[0]==="hold"}function $(){var G;return!!((G=C.props.render)!=null&&G.$$tippy)}function te(){return f||s}function Z(){var G=te().parentNode;return G?km(G):document}function S(){return $a(b)}function D(G){return C.state.isMounted&&!C.state.isVisible||Xt.isTouch||c&&c.type==="focus"?0:Pa(C.props.delay,G?0:1,Gt.delay)}function U(G){G===void 0&&(G=!1),b.style.pointerEvents=C.props.interactive&&!G?"":"none",b.style.zIndex=""+C.props.zIndex}function v(G,ae,de){if(de===void 0&&(de=!0),R.forEach(function(Qe){Qe[G]&&Qe[G].apply(Qe,ae)}),de){var we;(we=C.props)[G].apply(we,ae)}}function w(){var G=C.props.aria;if(G.content){var ae="aria-"+G.content,de=b.id,we=ys(C.props.triggerTarget||s);we.forEach(function(Qe){var $e=Qe.getAttribute(ae);if(C.state.isVisible)Qe.setAttribute(ae,$e?$e+" "+de:de);else{var It=$e&&$e.replace(de,"").trim();It?Qe.setAttribute(ae,It):Qe.removeAttribute(ae)}})}}function F(){if(!(O||!C.props.aria.expanded)){var G=ys(C.props.triggerTarget||s);G.forEach(function(ae){C.props.interactive?ae.setAttribute("aria-expanded",C.state.isVisible&&ae===te()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function H(){Z().removeEventListener("mousemove",g),Ln=Ln.filter(function(G){return G!==g})}function K(G){if(!(Xt.isTouch&&(A||G.type==="mousedown"))){var ae=G.composedPath&&G.composedPath()[0]||G.target;if(!(C.props.interactive&&yu(b,ae))){if(ys(C.props.triggerTarget||s).some(function(de){return yu(de,ae)})){if(Xt.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else v("onClickOutside",[C,G]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||le())}}}function j(){A=!0}function se(){A=!1}function ue(){var G=Z();G.addEventListener("mousedown",K,!0),G.addEventListener("touchend",K,es),G.addEventListener("touchstart",se,es),G.addEventListener("touchmove",j,es)}function le(){var G=Z();G.removeEventListener("mousedown",K,!0),G.removeEventListener("touchend",K,es),G.removeEventListener("touchstart",se,es),G.removeEventListener("touchmove",j,es)}function Ce(G,ae){Le(G,function(){!C.state.isVisible&&b.parentNode&&b.parentNode.contains(b)&&ae()})}function Se(G,ae){Le(G,ae)}function Le(G,ae){var de=S().box;function we(Qe){Qe.target===de&&(Ga(de,"remove",we),ae())}if(G===0)return ae();Ga(de,"remove",h),Ga(de,"add",we),h=we}function oe(G,ae,de){de===void 0&&(de=!1);var we=ys(C.props.triggerTarget||s);we.forEach(function(Qe){Qe.addEventListener(G,ae,de),d.push({node:Qe,eventType:G,handler:ae,options:de})})}function Ie(){W()&&(oe("touchstart",ce,{passive:!0}),oe("touchend",ne,{passive:!0})),wm(C.props.trigger).forEach(function(G){if(G!=="manual")switch(oe(G,ce),G){case"mouseenter":oe("mouseleave",ne);break;case"focus":oe(Um?"focusout":"blur",be);break;case"focusin":oe("focusout",be);break}})}function Be(){d.forEach(function(G){var ae=G.node,de=G.eventType,we=G.handler,Qe=G.options;ae.removeEventListener(de,we,Qe)}),d=[]}function ce(G){var ae,de=!1;if(!(!C.state.isEnabled||Pe(G)||a)){var we=((ae=c)==null?void 0:ae.type)==="focus";c=G,f=G.currentTarget,F(),!C.state.isVisible&&Rm(G)&&Ln.forEach(function(Qe){return Qe(G)}),G.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?de=!0:ve(G),G.type==="click"&&(o=!de),de&&!we&&He(G)}}function Ae(G){var ae=G.target,de=te().contains(ae)||b.contains(ae);if(!(G.type==="mousemove"&&de)){var we=De().concat(b).map(function(Qe){var $e,It=Qe._tippy,mt=($e=It.popperInstance)==null?void 0:$e.state;return mt?{popperRect:Qe.getBoundingClientRect(),popperState:mt,props:t}:null}).filter(Boolean);Nm(we,G)&&(H(),He(G))}}function ne(G){var ae=Pe(G)||C.props.trigger.indexOf("click")>=0&&o;if(!ae){if(C.props.interactive){C.hideWithInteractivity(G);return}He(G)}}function be(G){C.props.trigger.indexOf("focusin")<0&&G.target!==te()||C.props.interactive&&G.relatedTarget&&b.contains(G.relatedTarget)||He(G)}function Pe(G){return Xt.isTouch?W()!==G.type.indexOf("touch")>=0:!1}function Te(){ke();var G=C.props,ae=G.popperOptions,de=G.placement,we=G.offset,Qe=G.getReferenceClientRect,$e=G.moveTransition,It=$()?$a(b).arrow:null,mt=Qe?{getBoundingClientRect:Qe,contextElement:Qe.contextElement||te()}:s,Ss={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(ws){var ki=ws.state;if($()){var vr=S(),Qr=vr.box;["placement","reference-hidden","escaped"].forEach(function(Ts){Ts==="placement"?Qr.setAttribute("data-placement",ki.placement):ki.attributes.popper["data-popper-"+Ts]?Qr.setAttribute("data-"+Ts,""):Qr.removeAttribute("data-"+Ts)}),ki.attributes.popper={}}}},Ct=[{name:"offset",options:{offset:we}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!$e}},Ss];$()&&It&&Ct.push({name:"arrow",options:{element:It,padding:3}}),Ct.push.apply(Ct,(ae==null?void 0:ae.modifiers)||[]),C.popperInstance=Qm(mt,b,Object.assign({},ae,{placement:de,onFirstUpdate:u,modifiers:Ct}))}function ke(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function Oe(){var G=C.props.appendTo,ae,de=te();C.props.interactive&&G===fu||G==="parent"?ae=de.parentNode:ae=pu(G,[de]),ae.contains(b)||ae.appendChild(b),C.state.isMounted=!0,Te()}function De(){return Dn(b.querySelectorAll("[data-tippy-root]"))}function ve(G){C.clearDelayTimeouts(),G&&v("onTrigger",[C,G]),ue();var ae=D(!0),de=k(),we=de[0],Qe=de[1];Xt.isTouch&&we==="hold"&&Qe&&(ae=Qe),ae?i=setTimeout(function(){C.show()},ae):C.show()}function He(G){if(C.clearDelayTimeouts(),v("onUntrigger",[C,G]),!C.state.isVisible){le();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(G.type)>=0&&o)){var ae=D(!1);ae?r=setTimeout(function(){C.state.isVisible&&C.hide()},ae):n=requestAnimationFrame(function(){C.hide()})}}function We(){C.state.isEnabled=!0}function rt(){C.hide(),C.state.isEnabled=!1}function Xe(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(n)}function pt(G){if(!C.state.isDestroyed){v("onBeforeUpdate",[C,G]),Be();var ae=C.props,de=bu(s,Object.assign({},ae,mu(G),{ignoreAttributes:!0}));C.props=de,Ie(),ae.interactiveDebounce!==de.interactiveDebounce&&(H(),g=Eu(Ae,de.interactiveDebounce)),ae.triggerTarget&&!de.triggerTarget?ys(ae.triggerTarget).forEach(function(we){we.removeAttribute("aria-expanded")}):de.triggerTarget&&s.removeAttribute("aria-expanded"),F(),U(),L&&L(ae,de),C.popperInstance&&(Te(),De().forEach(function(we){requestAnimationFrame(we._tippy.popperInstance.forceUpdate)})),v("onAfterUpdate",[C,G])}}function fi(G){C.setProps({content:G})}function Et(){var G=C.state.isVisible,ae=C.state.isDestroyed,de=!C.state.isEnabled,we=Xt.isTouch&&!C.props.touch,Qe=Pa(C.props.duration,0,Gt.duration);if(!(G||ae||de||we)&&!te().hasAttribute("disabled")&&(v("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,$()&&(b.style.visibility="visible"),U(),ue(),C.state.isMounted||(b.style.transition="none"),$()){var $e=S(),It=$e.box,mt=$e.content;Ua([It,mt],0)}u=function(){var Ct;if(!(!C.state.isVisible||l)){if(l=!0,b.offsetHeight,b.style.transition=C.props.moveTransition,$()&&C.props.animation){var rs=S(),ws=rs.box,ki=rs.content;Ua([ws,ki],Qe),Cu([ws,ki],"visible")}w(),F(),Iu(Ya,C),(Ct=C.popperInstance)==null||Ct.forceUpdate(),v("onMount",[C]),C.props.animation&&$()&&Se(Qe,function(){C.state.isShown=!0,v("onShown",[C])})}},Oe()}}function ti(){var G=!C.state.isVisible,ae=C.state.isDestroyed,de=!C.state.isEnabled,we=Pa(C.props.duration,1,Gt.duration);if(!(G||ae||de)&&(v("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,l=!1,o=!1,$()&&(b.style.visibility="hidden"),H(),le(),U(!0),$()){var Qe=S(),$e=Qe.box,It=Qe.content;C.props.animation&&(Ua([$e,It],we),Cu([$e,It],"hidden"))}w(),F(),C.props.animation?$()&&Ce(we,C.unmount):C.unmount()}}function ii(G){Z().addEventListener("mousemove",g),Iu(Ln,g),g(G)}function si(){C.state.isVisible&&C.hide(),C.state.isMounted&&(ke(),De().forEach(function(G){G._tippy.unmount()}),b.parentNode&&b.parentNode.removeChild(b),Ya=Ya.filter(function(G){return G!==C}),C.state.isMounted=!1,v("onHidden",[C]))}function ct(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),Be(),delete s._tippy,C.state.isDestroyed=!0,v("onDestroy",[C]))}}function ts(s,e){e===void 0&&(e={});var t=Gt.plugins.concat(e.plugins||[]);Pm();var i=Object.assign({},e,{plugins:t}),r=_m(s),n=r.reduce(function(o,a){var A=a&&Wm(a,i);return A&&o.push(A),o},[]);return Rn(s)?n[0]:n}ts.defaultProps=Gt,ts.setDefaultProps=Ym,ts.currentInput=Xt,Object.assign({},jh,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),ts.setDefaultProps({render:Tu});class zt extends Error{constructor(e,t=new Error,i=!1){super(),this.fatal=!1,this.fatal=i,this.stack=t.stack,this.message=[e,t.message].filter(Boolean).join(" - ")}}const qm=5;class jm{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=ht(),this._controls=ht(),this.host=e}set activeScenes(e){if(e!==this._activeScenes){const t=e[0],i=this._activeScenes[0];this._activeScenes=e,t!==i&&(this.host.dispatchEvent(new CustomEvent("scenechange",{detail:e[0]})),this.host.requestUpdate())}}get activeScenes(){return this._activeScenes}set currentTime(e){var t,i,r,n,o;const a=Math.min(this.host.duration,Math.max(0,e));this._currentTime=a,this.activeScenes=((t=this.host.scenes)==null?void 0:t.filter(({start:c,duration:h})=>a>=c&&a<c+h))??[],this._upcomingScenes=((i=this.host.scenes)==null?void 0:i.filter(({start:c})=>a>=c-qm&&a<c))??[],this.loadScenes(),this.syncVideoState(),(r=this._controls.value)==null||r.setAttribute("currentTime",a.toString());const A=this.activeScenes[0],l=Kl((n=A==null?void 0:A.videoMeta)==null?void 0:n.captions);this.caption=((o=l.find(({start:c,end:h})=>{var u;const d=a-A.start+(((u=A.videoMeta)==null?void 0:u.start)??0);return c&&h&&d>=sn(c)&&d<=sn(h)}))==null?void 0:o.text)??"",this.draw(a),!this.host.paused&&!this.host.loading&&!this.host.processing&&!this.host.waiting&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:a}))}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return ut(this._canvas)}controls(){return ut(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{var t,i,r;const{start:n,duration:o,video:a,videoMeta:A}=e,l=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused;if(a&&A){const{key:c,hls:h,node:u}=a,{start:d,duration:g}=A,f=this.host.videoState[c];u&&f&&(u.currentTime>=d+g||u.ended||l&&(h?(t=h.startLoadOnce)==null||t.call(h,u.currentTime):f.initialised||(i=u.startLoadOnce)==null||i.call(u)))}else if(l){const c=`${n}-${o}`,h=this.host._sceneController.videoState[c];this.host.duration&&!((r=h==null?void 0:h.buffered)!=null&&r.length)&&(this.host._sceneController.videoState={...this.host._sceneController.videoState,[c]:{...h,buffered:[{start:Math.max(0,n/this.host.duration*100),end:Math.min((n+o)/this.host.duration*100,100)}]}})}})}syncVideoState(){var e;(e=this.host.scenes)==null||e.forEach(t=>{if(t.video){const{key:i,node:r}=t.video,n=this.host.videoState[i],o=this.activeScenes.includes(t);if(r&&n)if(o&&!this.host.waiting&&!this.host.loading&&!this.host.paused){if(r.paused&&n.initialised)try{return r.play()}catch(a){throw new zt("Video play error",a,!0)}}else r.paused||r.pause()}})}draw(e=this.currentTime){var t,i;this.host.sceneConfig&&this._canvas.value&&((i=(t=this.host).compilation)==null||i.call(t,{currentTime:e,scenes:this.host.sceneConfig,canvas:this._canvas.value}))}clear(){var e;const t=this._canvas.value;(e=t==null?void 0:t.getContext("2d"))==null||e.clearRect(0,0,t.width,t.height)}}function Xm(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function zm(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ka(s){const{id:e,key:t,src:i,playlist:r,duration:n}=s;return new Promise(o=>{let a=null;const A=document.createElement("video");if(A.playsInline=!0,A.muted=!0,A.loop=!1,r&&!Xm()&&ui.isSupported()){let l=!1;a=new ui({autoStartLoad:!0,xhrSetup:c=>{const{open:h}=c,u=r.split("?")[1];c.open=function(d,g,f){g.toString().includes("?")||(g+="?"+u),h.apply(this,[d,g,f])}}}),a.loadSource(r),a.attachMedia(A),a.startLoadOnce=(c=-1,h)=>{if(a&&!l){const u=a==null?void 0:a.levels.findIndex(d=>Math.min(d.height,d.width)===h);a.startLevel=a.firstLevel,a.startLoad(c),l=!0,a.currentLevel=u!==-1?u:a.firstLevel}},a.on(ui.Events.LEVEL_LOADED,async()=>{l||a==null||a.stopLoad(),o({id:e,key:t,hls:a,config:s,node:A})})}else{A.src=i;let l=!1;if(A.startLoadOnce=()=>{l||(A.preload="auto",A.load(),l=!0)},n)A.preload="none",o({id:e,key:t,hls:a,config:s,node:A});else{A.preload="metadata";const c=async()=>{o({id:e,key:t,hls:a,config:s,node:A}),A.removeEventListener("loadedmetadata",c)};A.addEventListener("loadedmetadata",c)}}})}async function xu(s){return s.duration===1/0?new Promise(e=>{s.currentTime=Number.MAX_SAFE_INTEGER,s.ontimeupdate=()=>{s.ontimeupdate=null,e(s.duration),s.currentTime=0}}):s.duration}const Zm=oi(async function(e){return new FontFace(e.name,`url(${e.woff2??e.url})`,{style:e.style,weight:e.weight}).load()},{cacheKey:([s])=>JSON.stringify(s)});let eC=class{constructor(e){this._hasPlayed=!1,this._memoKey=null,this._lastDeps=null,this._duration=0,this._scenes=null,this._videos={},this._videoMeta={},this._videoState={},this._resolveVideo=oi(async t=>{const{id:i,key:r}=t,n=await Ka(t);n.node.volume=this.host.volume,n.node.playbackRate=this.host.playbackRate;const o={loadeddata:this._handleLoadedData,waiting:this._handleWaiting,canplay:this._handleCanPlay,progress:this._handleProgress,seeking:this._handleSeeking,seeked:this._handleSeeked,play:this._handlePlay,playing:this._handlePlaying,pause:this._handlePause,stalled:this._handleStalled,timeupdate:this._handleTimeUpdate,ended:this._handleEnded,error:this._handleError},a=Object.keys(o).reduce((A,l)=>{const c=l,h=o[c]({id:i,key:r,node:n.node});return A[c]=h,n.node.addEventListener(l,h),A},{});return{...n,listeners:a}},{cacheKey:([{id:t,key:i,src:r,playlist:n}])=>JSON.stringify({id:t,key:i,src:r==null?void 0:r.split("?")[0],playlist:n==null?void 0:n.split("?")[0]})}),this._resolveVideoMeta=oi(async(t,i)=>{const{id:r,captions:n,duration:o,startOffset:a,endOffset:A}=t,l=o??await xu(i),c=(a??0)*l,h=(1-(A??0))*l;return{id:r,captions:n,start:c,duration:h-c}},{cacheKey:([{id:t,key:i,captions:r,duration:n,startOffset:o,endOffset:a}])=>JSON.stringify({id:t,key:i,captions:r,duration:n,startOffset:o,endOffset:a})}),this._handleLoadedData=({id:t,key:i,node:r})=>()=>{var n,o;const a=this.videoState[i];if(!(a!=null&&a.initialised)){this.videoState={...this.videoState,[i]:{...a,initialised:!0,waiting:!1,buffered:(a==null?void 0:a.buffered)??[]}};const A=(o=(n=this.scenes)==null?void 0:n.scenes)==null?void 0:o.find(({video:l})=>{l==null||l.key});A&&this._setVideoCurrentTime({scene:A,time:this.host.currentTime}),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:i,node:r}}))}},this._handleWaiting=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&!(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!0}})},this._handleCanPlay=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=({key:t,node:i})=>()=>{const r=this.videoState[t],n=this._getBufferSegments({key:t,node:i,duration:this.host.duration});this.videoState={...this.videoState,[t]:{...r,buffered:n}}},this._handleSeeking=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:i,node:r}}))},this._handleSeeked=({id:t,key:i,node:r})=>()=>{const n=this.videoState[i];n!=null&&n.initialised&&(this.host.draw(),this.host.dispatchEvent(new CustomEvent("video:seeked",{detail:{id:t,key:i,node:r}})))},this._handlePlay=({id:t,key:i,node:r})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:i,node:r}}))},this._handlePlaying=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:i,node:r}}))},this._handlePause=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:i,node:r}}))},this._handleStalled=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:i,node:r}}))},this._handleTimeUpdate=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:i,node:r}}))},this._handleEnded=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:i,node:r}}))},this._handleError=({id:t,key:i,node:r})=>()=>{const n=new zt(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:n,message:n.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:i,node:r}}))},this._cleanupVideo=t=>{var i;const r=this.videos[t];r&&(r.node.pause(),r.node.src="",(i=r.hls)==null||i.destroy(),Object.keys(r.listeners??{}).forEach(n=>{var o,a;if((o=this.videos)!=null&&o[t]){const A=(a=r.listeners)==null?void 0:a[n];A&&r.node.removeEventListener(n,A)}}),delete this.videos[t])},this.host=e,this.host.addController(this)}set hasPlayed(e){e!==this._hasPlayed&&(this._hasPlayed=e,this.host.requestUpdate())}get hasPlayed(){return this._hasPlayed}set duration(e){!isNaN(e)&&e!==this._duration&&(this._duration=e,this.host.requestUpdate(),this.host.dispatchEvent(new CustomEvent("durationchange",{detail:this._duration})))}get duration(){return this._duration}set scenes(e){e!==this._scenes&&(this._scenes=e,this.host.requestUpdate())}get scenes(){return this._scenes}set videos(e){e!==this._videos&&(this._videos=e,this.host.requestUpdate())}get videos(){return this._videos}set videoMeta(e){e!==this._videoMeta&&(this._videoMeta=e,this.host.requestUpdate())}get videoMeta(){return this._videoMeta}set videoState(e){e!==this._videoState&&(this._videoState=e,this.host.requestUpdate())}get videoState(){return this._videoState}_getBufferSegments({key:e,node:t,duration:i}){var r;const n=t==null?void 0:t.buffered,o=[],{start:a,video:A,videoMeta:l}=((r=this.scenes)==null?void 0:r.scenes.find(({video:c})=>e===(c==null?void 0:c.key)))??{};if(t&&n&&A&&l&&typeof a<"u")for(let c=0;c<n.length;c++){const h=n.start(c),u=n.end(c);Math.max(h,l.start)<=Math.min(u,l.start+l.duration)&&o.push({start:Math.max(0,(Math.max(h-l.start,0)+a)/i*100),end:Math.min((Math.min(u-l.start,l.duration)+a)/i*100,100)})}return o}_setupTask(){new kr(this.host,async([e,t,i,r,n,o])=>{try{let a=null;if(this.host._errors=[],i||e){if(this.host._processing=!0,i){let c=null;if(r)try{c=await(await fetch(r,{method:"GET"})).text()}catch(d){const g=new zt("Track failed to fetch",d);this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:g,message:g.message}))}const u={questions:{items:[{answer:{id:"source",media:{[i.includes(".m3u8")?"playlist":"video"]:i},captions:{current:c}}}]}};try{this.scenes=await cs({data:u,template:t,burnCaptions:n,debug:o},this._resolveVideo,this._resolveVideoMeta)}catch(d){try{this.scenes=await cs({data:u,burnCaptions:n,debug:o},this._resolveVideo,this._resolveVideoMeta)}catch(g){throw new zt("Fatal source template error",g,!0)}a=new zt("Source template error",d)}}else try{this.scenes=await cs({data:e,template:t,burnCaptions:n,debug:o},this._resolveVideo,this._resolveVideoMeta)}catch(c){try{this.scenes=await cs({data:e,burnCaptions:n,debug:o},this._resolveVideo,this._resolveVideoMeta)}catch(h){throw new zt("Fatal data template error",h,!0)}a=new zt("Data template error",c)}Object.keys(this.videos).forEach(c=>{this.scenes.scenes.find(({video:h})=>c===(h==null?void 0:h.key))||this._videos[c].node.pause()});const A=this.scenes.scenes.reduce((c,{video:h})=>(h&&(c[h.key]=h),c),{});Object.keys(this.videos).join("|")!==Object.keys(A).join("|")&&this.host.reset(0,!1),this.videos=A,this.videoState={...this.videoState,...this.scenes.scenes.reduce((c,{video:h,start:u,duration:d})=>{var g;const f=(h==null?void 0:h.key)??`${u}-${d}`,p=this._getBufferSegments({key:f,node:h==null?void 0:h.node,duration:this.scenes.duration});return c[f]={initialised:!h,waiting:!!h,...this.videoState[f],buffered:h?p:(g=this.videoState[f])==null?void 0:g.buffered},c},{})},this.videoMeta=this.scenes.scenes.reduce((c,{video:h,videoMeta:u})=>(h&&u&&(c[h.key]=u),c),{}),(await Promise.all(this.scenes.fonts.map(c=>Zm(c)))).forEach(c=>{document.fonts.add(c)}),this.duration=this.scenes.duration,this.host.paused&&this.host.reset(this.host.currentTime,!this.host.paused)}a&&this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:a,message:a.message}))}catch(a){this.scenes=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:a,message:a.message}))}finally{this.host._processing=!1}},()=>{const e=JSON.stringify({data:this.host.data,template:this.host.template,src:this.host.src,track:this.host.track,burnCaptions:this.host.burnCaptions,debug:this.host.debug});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.data,this.host.template,this.host.src,this.host.track,this.host.burnCaptions,this.host.debug];return this._memoKey=e,this._lastDeps=t,t})}_setVideoCurrentTime({time:e,scene:t}){const{start:i,video:r,videoMeta:n}=t;if(r&&r.node&&n&&typeof i<"u"){const o=e-i;r.node.currentTime=Math.max(n.start,Math.min(n.start+n.duration,o+n.start))}}setVideosCurrentTime(e){var t;(t=this.scenes)==null||t.scenes.forEach(i=>{this._setVideoCurrentTime({time:e,scene:i})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.videos).forEach(e=>{this._cleanupVideo(e)}),this.videos={}}};function tC(s){s.requestFullscreen?s.requestFullscreen():s.mozRequestFullScreen?s.mozRequestFullScreen():s.webkitRequestFullscreen?s.webkitRequestFullscreen():s.msRequestFullscreen&&s.msRequestFullscreen()}function iC(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const Va=["progress","play-large","navigation","play","volume","current-time","duration","speed","captions","fullscreen","preview"],sC={id:"captions",event:"captions:click",label:"Closed Captions"},rC={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},Du={title:"Playback Speed",items:[{id:"playback-rate-0.5",event:"playbackRate:click",label:"0.5x",value:.5},{id:"playback-rate-1",event:"playbackRate:click",label:"1.0x",value:1},{id:"playback-rate-1.5",event:"playbackRate:click",label:"1.5x",value:1.5},{id:"playback-rate-2",event:"playbackRate:click",label:"2.0x",value:2}]},nC={id:"playbackRate",label:"Playback playbackRate",subItems:Du};class oC extends jA{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==As.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}disconnected(){var e;(e=this.observer)==null||e.disconnect(),this.observer=void 0}reconnected(){var e;this.element&&((e=this.observer)==null||e.observe(this.element))}update(e,[t]){return this.isConnected&&!this.observer&&(this.observer=new ResizeObserver(t),this.element=e.element,this.observer.observe(this.element)),vi}}const Ja=ls(oC),aC=mI(()=>{const s=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),e=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-SemiBold.woff2)",{style:"normal",weight:"600"}),t=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),i=Gl.map(r=>({load:!1,font:new FontFace(r.family,`url(${r.url})`,{style:r.style})}));return[{load:!0,font:s},{load:!0,font:e},{load:!0,font:t},...i]}),Zt={"red-120":"#feeded","red-130":"#fcd5d0","red-400":"#e84a4a","red-500":"#c51c3a","red-700":"#a21c39","red-800":"#850231","red-900":"#580A2D","teal-80":"#f3fafa","teal-100":"#d6f1f1","teal-200":"#ace3e3","teal-300":"#7acace","teal-400":"#4faab2","teal-500":"#358f97","teal-600":"#287179","teal-700":"#22555c","teal-800":"#21484e","teal-900":"#1f3d42","teal-950":"#0d2126","purple-100":"#d7cfff","purple-700":"#5f2fe9","green-200":"#a4d7aa","green-500":"#38b319","green-800":"#2b3c2f","grey-100":"#f0f0f0","light-50":"rgba(255, 255, 255, .05)","light-100":"rgba(255, 255, 255, .1)","light-200":"rgba(255, 255, 255, .2)","light-400":"rgba(255, 255, 255, .4)","light-500":"rgba(255, 255, 255, .5)","light-640":"rgba(255, 255, 255, .64)","light-800":"rgba(255, 255, 255, .8)","light-1000":"#fff","dark-50":"rgba(0, 0, 0, .05)","dark-80":"rgba(0, 0, 0, .08)","dark-100":"rgba(0, 0, 0, .1)","dark-200":"rgba(0, 0, 0, .2)","dark-250":"rgba(0, 0, 0, .25)","dark-400":"rgba(0, 0, 0, .4)","dark-500":"rgba(0, 0, 0, .5)","dark-640":"rgba(0, 0, 0, .64)","dark-800":"rgba(0, 0, 0, .8)","dark-900":"rgba(0, 0, 0, .9)","dark-1000":"#000"},AC={colors:Zt,space:{xxs:".25rem",xs:".5rem",small:".75rem",medium:"1rem",large:"1.5rem",xl:"2.5rem"},sizes:{xxs:"1rem",xs:"1.5rem",small:"2rem",medium:"2.5rem",large:"3rem"},fontWeights:{regular:400,semibold:600},lineHeights:{small:1.1,medium:1.25,large:1.4},letterSpacings:{xxs:"-.04rem",xs:"-.03rem",small:"-.02rem",medium:"-.01rem",large:0},fontSizes:{micro:".625rem",small:".75rem",medium:".875rem",large:"1rem",xl:"1.25rem",xxl:"1.5rem",xxxl:"2rem",huge:"2.75rem"},fontFamilies:{sans:'Roobert, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,"Noto Sans", "Noto Color Emoji", sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji"',mono:'"Maison Neue Mono", Menlo, Monaco, Consolas, Liberation Mono, "Courier New", monospace'},borderWidths:{thin:".0625rem"},radii:{small:".25rem",medium:".5rem",large:".75rem",xl:"1rem"},shadows:{small:`.25rem .25rem .25rem ${Zt["dark-100"]}`,medium:`0 .125rem .625rem ${Zt["dark-100"]}`,large:`0 .25rem 1rem ${Zt["dark-50"]}`,xl:`.25rem .25rem 1rem ${Zt["dark-250"]}`,xxl:`0 .25rem 2rem ${Zt["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${Zt["dark-250"]}`,toolbar:`0 -.625rem .625rem ${Zt["dark-50"]}`,text:`0 0 .25rem ${Zt["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:Zt["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},Ru=pI.flatten(AC,{delimiter:"-"}),lC=Object.keys(Ru).map(s=>Ns(`:host { --${s}: ${Ru[s]}; }`)),Ne=(s=>{class e extends s{firstUpdated(){aC().forEach(({load:r,font:n})=>{document.fonts.add(n),r&&n.load()})}}return e.styles=[(s==null?void 0:s.styles)??[],lC,nt`
|
209
209
|
:host {
|
210
210
|
font-family: var(--fontFamilies-sans);
|
211
211
|
font-size: var(--fontSizes-medium);
|
@@ -286,12 +286,12 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
286
286
|
scroll-behavior: auto !important;
|
287
287
|
}
|
288
288
|
}
|
289
|
-
`],e})(as),
|
289
|
+
`],e})(as),cC=(s,e)=>(typeof window<"u"&&(window.customElements.get(s)??window.customElements.define(s,e)),e),hC=(s,e)=>{const{kind:t,elements:i}=e;return{kind:t,elements:i,finisher(r){typeof window<"u"&&(window.customElements.get(s)??window.customElements.define(s,r))}}},yt=s=>e=>typeof e=="function"?cC(s,e):hC(s,e);class uC{constructor(e){this._memoKey=null,this._lastDeps=null,this._scenes=null,this._video=null,this._handleSeeked=()=>{this.host._draw()},this._resolveVideo=oi(async t=>{const i=await Ka(t);return i.node.play=async()=>{},i.node.addEventListener("seeked",this._handleSeeked),i},{cacheKey:([{id:t,src:i,playlist:r}])=>JSON.stringify({id:t,src:i==null?void 0:i.split("?")[0],playlist:r==null?void 0:r.split("?")[0]})}),this._resolveAnswer=oi(async t=>{const{id:i,key:r,poster:n}=t,{node:o}=await Ka(t),a=new Image;return{id:i,key:r,config:t,node:o,getSource:()=>(n&&a.src!==n&&(a.onload=()=>{this.host._draw()},a.src=n),a)}},{cacheKey:([{id:t,src:i,playlist:r,poster:n}])=>JSON.stringify({id:t,src:i==null?void 0:i.split("?")[0],playlist:r==null?void 0:r.split("?")[0],poster:n==null?void 0:n.split("?")[0]})}),this._resolveVideoMeta=oi(async(t,i)=>{const{id:r,duration:n,startOffset:o,endOffset:a}=t,A=n??await xu(i),l=(o??0)*A,c=(1-(a??0))*A;return{id:r,start:l,duration:c-l}},{cacheKey:([{id:t,duration:i,startOffset:r,endOffset:n}])=>JSON.stringify({id:t,duration:i,startOffset:r,endOffset:n})}),this.host=e,this.host.addController(this)}set scenes(e){e!==this._scenes&&(this._scenes=e,this.host.requestUpdate())}get scenes(){return this._scenes}_setupTask(){new kr(this.host,async([e,t,i])=>{var r,n;try{if(e){const o=e.includes(".m3u8")?"playlist":"video";try{this.scenes=await cs({data:{questions:{items:[{answer:{id:"source",media:{[o]:e}}}]}},template:i},this._resolveVideo,this._resolveVideoMeta)}catch(a){throw new zt("Video preview source template error",a)}this._video=((n=(r=this.scenes.scenes[0])==null?void 0:r.video)==null?void 0:n.node)??null}else if(t)try{this.scenes=await cs({data:t,template:i},this._resolveAnswer,this._resolveVideoMeta)}catch(o){throw new zt("Video preview data template error",o)}}catch(o){this.scenes=null,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:o,message:o.message}))}},()=>{const e=JSON.stringify({data:this.host.data,template:this.host.template});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.src,this.host.data,this.host.template];return this._memoKey=e,this._lastDeps=t,t})}hostConnected(){this._setupTask()}hostDisconnected(){this._video&&(this._video.pause(),this._video.removeEventListener("seeked",this._handleSeeked),this._video.src="",this._video=null)}}function Lu(s,e,t){return Math.min(Math.max(e,s),t)}function Wa(s,e={}){const t=Math.max(0,s||0),i=Math.floor(t/3600),r=Math.floor(t%3600/60),n=Math.floor(t%3600%60),o=Math.floor(t%1*1e3);let a=i?`${i}:${`${r}`.padStart(2,"0")}:${`${n}`.padStart(2,"0")}`:`${r}:${`${n}`.padStart(2,"0")}`;return e.includeMs&&(a+=`:${`${o}`.padStart(3,"0")}`),a}var dC=Object.defineProperty,gC=Object.getOwnPropertyDescriptor,Bs=(s,e,t,i)=>{for(var r=i>1?void 0:i?gC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&dC(e,t,r),r};let Ri=class extends Ne{constructor(){super(...arguments),this.active=!1,this.size="small",this.rounded="medium",this.weight="light"}render(){return Ee`<button
|
290
290
|
class=${Ye({active:this.active,"size-tiny":this.size==="tiny","size-small":this.size==="small","size-large":this.size==="large","radius-medium":this.rounded==="medium","radius-full":this.rounded==="full","weight-light":this.weight==="light","weight-heavy":this.weight==="heavy"})}
|
291
291
|
>
|
292
292
|
<slot></slot>
|
293
293
|
${this.icon&&Ee`<vmp-icon icon=${this.icon}></vmp-icon>`}
|
294
|
-
</button>`}};Ri.styles=[
|
294
|
+
</button>`}};Ri.styles=[Ne.styles??[],nt`
|
295
295
|
:host {
|
296
296
|
--button-padding: var(--vu-button-padding, var(--space-s));
|
297
297
|
--button-color: var(--vu-button-color, var(--colors-dark-640));
|
@@ -367,7 +367,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
367
367
|
.weight-light:focus {
|
368
368
|
--button-background: var(--vu-button-background-hover, #9d9d9d);
|
369
369
|
}
|
370
|
-
`],Bs([z({type:Boolean})],Ri.prototype,"active",2),Bs([z({type:String})],Ri.prototype,"size",2),Bs([z({type:String})],Ri.prototype,"rounded",2),Bs([z({type:String})],Ri.prototype,"weight",2),Bs([z({type:String})],Ri.prototype,"icon",2),Ri=Bs([yt("vmp-button")],Ri);const
|
370
|
+
`],Bs([z({type:Boolean})],Ri.prototype,"active",2),Bs([z({type:String})],Ri.prototype,"size",2),Bs([z({type:String})],Ri.prototype,"rounded",2),Bs([z({type:String})],Ri.prototype,"weight",2),Bs([z({type:String})],Ri.prototype,"icon",2),Ri=Bs([yt("vmp-button")],Ri);const _u={"arrow-left":()=>Ee`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" part="svg">
|
371
371
|
<path
|
372
372
|
d="M16.6666 9.21875H6.52492L11.1833 4.85156L9.99992 3.75L3.33325 10L9.99992 16.25L11.1749 15.1484L6.52492 10.7812H16.6666V9.21875Z"
|
373
373
|
fill="currentColor"
|
@@ -528,14 +528,14 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
528
528
|
<path
|
529
529
|
d="M9.853 23.246L4.86 7.688H0L7 27.42h5.52l7.265-19.733h-4.65L9.854 23.246zM95.12 7.08a8.905 8.905 0 00-4.648 1.294V0H86.14v27.419h4.332V16.087a4.656 4.656 0 014.649-4.65 4.656 4.656 0 014.649 4.65v11.332h4.332V16.087c.026-4.966-4.015-9.008-8.981-9.008zM57.188 19.02a4.656 4.656 0 01-4.649 4.649 4.656 4.656 0 01-4.649-4.65V7.689h-4.332V19.02c0 4.966 4.041 8.98 8.981 8.98 4.94 0 8.981-4.04 8.981-8.98V7.688h-4.332V19.02zM30.483 7.133c-5.732 0-10.408 4.675-10.408 10.407s4.676 10.408 10.408 10.408c5.732 0 10.408-4.676 10.408-10.408 0-5.732-4.676-10.407-10.408-10.407zm0 16.483a6.076 6.076 0 116.075-6.076c0 3.355-2.747 6.076-6.075 6.076zM74.517 23.616a6.076 6.076 0 010-12.151 6.132 6.132 0 015.045 2.668l3.592-2.43a10.473 10.473 0 00-8.637-4.57c-5.732 0-10.408 4.675-10.408 10.407s4.676 10.408 10.408 10.408a10.35 10.35 0 008.611-4.596l-3.593-2.43a5.975 5.975 0 01-5.018 2.694z"
|
530
530
|
/>
|
531
|
-
</svg>`};var
|
531
|
+
</svg>`};var fC=Object.defineProperty,pC=Object.getOwnPropertyDescriptor,ku=(s,e,t,i)=>{for(var r=i>1?void 0:i?pC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&fC(e,t,r),r};let _n=class extends Ne{render(){return!this.icon||!Object.keys(_u).includes(this.icon)?null:_u[this.icon]()}};_n.styles=[Ne.styles??[],nt`
|
532
532
|
:host {
|
533
533
|
display: flex;
|
534
534
|
align-items: center;
|
535
535
|
justify-content: center;
|
536
536
|
flex-shrink: 0;
|
537
537
|
}
|
538
|
-
`],
|
538
|
+
`],ku([z({type:String})],_n.prototype,"icon",2),_n=ku([yt("vmp-icon")],_n);var EC=Object.defineProperty,IC=Object.getOwnPropertyDescriptor,vs=(s,e,t,i)=>{for(var r=i>1?void 0:i?IC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&EC(e,t,r),r};let Li=class extends Ne{constructor(){super(...arguments),this.active=!1,this.size="small",this.rounded="medium",this.weight="light"}render(){return Ee`
|
539
539
|
<vmp-button
|
540
540
|
?active=${this.active}
|
541
541
|
size=${Hi(this.size)}
|
@@ -547,7 +547,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
547
547
|
icon=${Hi(this.icon)}
|
548
548
|
></vmp-icon>
|
549
549
|
</vmp-button>
|
550
|
-
`}};Li.styles=[
|
550
|
+
`}};Li.styles=[Ne.styles??[],nt`
|
551
551
|
.tiny::part(svg) {
|
552
552
|
height: 12px;
|
553
553
|
width: 12px;
|
@@ -562,7 +562,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
562
562
|
height: 32px;
|
563
563
|
width: 32px;
|
564
564
|
}
|
565
|
-
`],vs([z({type:Boolean})],Li.prototype,"active",2),vs([z({type:String})],Li.prototype,"size",2),vs([z({type:String})],Li.prototype,"rounded",2),vs([z({type:String})],Li.prototype,"weight",2),vs([z({type:String})],Li.prototype,"icon",2),Li=vs([yt("vmp-icon-button")],Li);var
|
565
|
+
`],vs([z({type:Boolean})],Li.prototype,"active",2),vs([z({type:String})],Li.prototype,"size",2),vs([z({type:String})],Li.prototype,"rounded",2),vs([z({type:String})],Li.prototype,"weight",2),vs([z({type:String})],Li.prototype,"icon",2),Li=vs([yt("vmp-icon-button")],Li);var mC=Object.defineProperty,CC=Object.getOwnPropertyDescriptor,xt=(s,e,t,i)=>{for(var r=i>1?void 0:i?CC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&mC(e,t,r),r};let gi=class extends Ne{constructor(){super(...arguments),this.disabled=!1,this.aspectRatio=1,this.compilation=To,this._currentTime=0,this._sceneController=new uC(this),this._canvasRef=ht(),this._previewRef=ht(),this._previewTimeRef=ht(),this._handleScrubberMouseEnter=({detail:{x:s,y:e,elementLeft:t,elementRight:i}})=>{var r,n;if((r=this._previewRef)!=null&&r.value){const o=this._previewRef.value.getBoundingClientRect(),a=(n=this._previewRef.value.getRootNode().host)==null?void 0:n.getBoundingClientRect();o&&a&&(this._previewRef.value.style.opacity="1",this._previewRef.value.style.transform=`translate3d(${Lu(t-a.left,s-a.left-o.width/2,i-a.left-o.width)}px, ${e-a.top-o.height-28}px, 0)`)}},this._handleScrubberMouseMove=({detail:{time:s,x:e,elementLeft:t,elementRight:i}})=>{var r,n,o,a,A,l,c,h;if(this._currentTime=s,(r=this._sceneController.scenes)!=null&&r.scenes.length){const u=(A=(a=(o=(n=this._sceneController.scenes)==null?void 0:n.scenes)==null?void 0:o.find(({start:d,duration:g,video:f})=>f&&s>=d&&s<=d+g))==null?void 0:a.video)==null?void 0:A.node;if(u&&(u.currentTime=s),this._draw(),(l=this._previewRef)!=null&&l.value){const d=this._previewRef.value.getBoundingClientRect(),g=(c=this._previewRef.value.getRootNode().host)==null?void 0:c.getBoundingClientRect();if(d&&g){const f=this._previewRef.value.style.transform||"translate3d(0px, 0px, 0px)",[,p]=Array.from(f.matchAll(/([+-]?([0-9]*[.])?[0-9]+)(?=px)\w+/g));this._previewRef.value.style.transform=`translate3d(${Lu(t-g.left,e-g.left-d.width/2,i-g.left-d.width)}px, ${p[1]}px, 0)`}}this._previewTimeRef.value&&this._previewTimeRef.value.setAttribute("content",Wa(Math.max(0,Math.min(this._currentTime,(h=this._sceneController.scenes)==null?void 0:h.duration))))}},this._handleScrubberMouseLeave=()=>{var s;(s=this._previewRef)!=null&&s.value&&(this._previewRef.value.style.opacity="0")},this._handleScrubberResize=({detail:{y:s}})=>{var e,t;if((e=this._previewRef)!=null&&e.value){const i=this._previewRef.value.getBoundingClientRect(),r=(t=this._previewRef.value.getRootNode().host)==null?void 0:t.getBoundingClientRect();if(i&&r){const n=this._previewRef.value.style.transform||"translate3d(0px, 0px, 0px)",[o]=Array.from(n.matchAll(/([+-]?([0-9]*[.])?[0-9]+)(?=px)\w+/g));this._previewRef.value.style.transform=`translate3d(${o[1]}px, ${s-r.top-i.height-28}px, 0)`}}}}_draw(s=this._currentTime){var e,t;this._sceneController.scenes&&this._canvasRef.value&&((t=this.compilation)==null||t.call(this,{currentTime:Math.max(0,Math.min(s,(e=this._sceneController.scenes)==null?void 0:e.duration)),scenes:this._sceneController.scenes,canvas:this._canvasRef.value}))}connectedCallback(){super.connectedCallback(),document.addEventListener("scrubber:resize",this._handleScrubberResize),document.addEventListener("scrubber:mouseenter",this._handleScrubberMouseEnter),document.addEventListener("scrubber:mousemove",this._handleScrubberMouseMove),document.addEventListener("scrubber:mouseleave",this._handleScrubberMouseLeave)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("scrubber:resize",this._handleScrubberResize),document.removeEventListener("scrubber:mouseenter",this._handleScrubberMouseEnter),document.removeEventListener("scrubber:mousemove",this._handleScrubberMouseMove),document.removeEventListener("scrubber:mouseleave",this._handleScrubberMouseLeave)}render(){var s;const{height:e,width:t}=xo({resolution:180,aspectRatio:this.aspectRatio}),i=((s=this._sceneController.scenes)==null?void 0:s.scenes.length)??0;return!this.disabled&&(this.src||i>1)?Ee`
|
566
566
|
<div
|
567
567
|
${ut(this._previewRef)}
|
568
568
|
class="preview"
|
@@ -571,7 +571,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
571
571
|
<canvas ${ut(this._canvasRef)} class="preview-canvas" width=${t} height=${e}></canvas>
|
572
572
|
<vmp-text ${ut(this._previewTimeRef)} class="preview-text" size="small"></vmp-text>
|
573
573
|
</div>
|
574
|
-
`:null}};
|
574
|
+
`:null}};gi.styles=[Ne.styles??[],nt`
|
575
575
|
.preview {
|
576
576
|
position: absolute;
|
577
577
|
display: flex;
|
@@ -602,7 +602,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
602
602
|
color: var(--colors-light-1000);
|
603
603
|
font-variant-numeric: tabular-nums;
|
604
604
|
}
|
605
|
-
`],xt([z({type:String})],
|
605
|
+
`],xt([z({type:String})],gi.prototype,"src",2),xt([z({type:Object})],gi.prototype,"data",2),xt([z({type:Object})],gi.prototype,"template",2),xt([z({type:Boolean})],gi.prototype,"disabled",2),xt([z({type:Number})],gi.prototype,"aspectRatio",2),xt([z({attribute:!1})],gi.prototype,"compilation",2),gi=xt([yt("vmp-video-preview-content")],gi);let _i=class extends Ne{constructor(){super(...arguments),this.disabled=!1,this.aspectRatio=1,this.compilation=To}render(){return Ee`
|
606
606
|
<vmp-video-preview-content
|
607
607
|
?disabled=${this.disabled}
|
608
608
|
.src=${this.src}
|
@@ -611,7 +611,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
611
611
|
.aspectRatio=${this.aspectRatio}
|
612
612
|
.compilation=${this.compilation}
|
613
613
|
></vmp-video-preview-content>
|
614
|
-
`}};xt([z({type:String})],_i.prototype,"src",2),xt([z({type:Object})],_i.prototype,"data",2),xt([z({type:Object})],_i.prototype,"template",2),xt([z({type:Boolean})],_i.prototype,"disabled",2),xt([z({type:Number})],_i.prototype,"aspectRatio",2),xt([z({attribute:!1})],_i.prototype,"compilation",2),_i=xt([yt("vmp-video-preview")],_i);class
|
614
|
+
`}};xt([z({type:String})],_i.prototype,"src",2),xt([z({type:Object})],_i.prototype,"data",2),xt([z({type:Object})],_i.prototype,"template",2),xt([z({type:Boolean})],_i.prototype,"disabled",2),xt([z({type:Number})],_i.prototype,"aspectRatio",2),xt([z({attribute:!1})],_i.prototype,"compilation",2),_i=xt([yt("vmp-video-preview")],_i);class yC extends Ys{constructor(e){if(super(e),e.type!==As.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}update(e,[t]){return t==null||t(e.element),vi}}const Nu=ls(yC);class BC{constructor(e){this.hiddenControls=[],this._measureRef=ht(),this._prevControlsWidth=0,this._hideables={},this._showables={},this._onResize=t=>{var i,r,n;const o=this._measureRef.value,a=(n=(r=(i=t==null?void 0:t[0])==null?void 0:i.borderBoxSize)==null?void 0:r[0])==null?void 0:n.inlineSize;if(o&&a&&a!==this._prevControlsWidth){Object.keys(this._hideables).forEach(l=>{this._hideables[l].element.style.display=""}),Object.keys(this._showables).forEach(l=>{this._showables[l].element.style.display="none"});const A=[];for(;o.scrollWidth>o.offsetWidth;){const l=Object.keys(this._hideables).find(h=>this._hideables[h].hideIndex===A.length);if(!l)break;const c=this._hideables[l].element;c&&(c.style.display="none"),A.push(l),Object.keys(this._showables).forEach(h=>{this._showables[h].showOn.some(u=>A.includes(u))&&(this._showables[h].element.style.display="flex")})}this.hiddenControls=A,this._prevControlsWidth=a,this.host.requestUpdate()}},this.host=e}measure(){return ut(this._measureRef)}contain(){return Ja(this._onResize)}hide(e,t){return Nu(i=>{this._hideables[e]={element:i,hideIndex:t}})}show(e,t){return Nu(i=>{this._showables[e]={element:i,showOn:t}})}}const qa=".tippy-box[data-animation=shift-away-subtle][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=top]{transform:translateY(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=bottom]{transform:translateY(-5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=left]{transform:translateX(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=right]{transform:translateX(-5px)}";var vC=Object.defineProperty,QC=Object.getOwnPropertyDescriptor,mr=(s,e,t,i)=>{for(var r=i>1?void 0:i?QC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&vC(e,t,r),r};let is=class extends Ne{constructor(){super(...arguments),this.semibold=!1,this.truncate=!1,this.size="medium",this.content=""}render(){return Ee`
|
615
615
|
<div
|
616
616
|
part="content"
|
617
617
|
class=${Ye({semibold:this.semibold,truncate:this.truncate,[this.size]:!0})}
|
@@ -619,7 +619,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
619
619
|
>
|
620
620
|
${this.content}
|
621
621
|
</div>
|
622
|
-
`}};is.styles=[
|
622
|
+
`}};is.styles=[Ne.styles??[],nt`
|
623
623
|
:host {
|
624
624
|
--text-size: var(--fontSizes-medium);
|
625
625
|
--text-line-height: var(--lineHeights-medium);
|
@@ -656,7 +656,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
656
656
|
text-overflow: ellipsis;
|
657
657
|
overflow: hidden;
|
658
658
|
}
|
659
|
-
`],mr([z({type:Boolean})],is.prototype,"semibold",2),mr([z({type:Boolean})],is.prototype,"truncate",2),mr([z({type:String})],is.prototype,"size",2),mr([z({type:String})],is.prototype,"content",2),is=mr([yt("vmp-text")],is);var
|
659
|
+
`],mr([z({type:Boolean})],is.prototype,"semibold",2),mr([z({type:Boolean})],is.prototype,"truncate",2),mr([z({type:String})],is.prototype,"size",2),mr([z({type:String})],is.prototype,"content",2),is=mr([yt("vmp-text")],is);var bC=Object.defineProperty,SC=Object.getOwnPropertyDescriptor,Cr=(s,e,t,i)=>{for(var r=i>1?void 0:i?SC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&bC(e,t,r),r};let ss=class extends Ne{constructor(){super(...arguments),this.activeItems=[],this.visibleItems=null,this.subItemsActive=null,this.tippy=null,this._contentRef=ht()}_handleBackClick(){this.subItemsActive=null,this.visibleItems=this.items??null}willUpdate(){this.visibleItems=this.visibleItems??this.items??null}updated(){var s,e;const t=(e=(s=this.items)==null?void 0:s.items.find(({id:i})=>this.subItemsActive===i))==null?void 0:e.subItems;this.visibleItems=t??this.items??null,t||(this.subItemsActive=null)}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{var s;const e=(s=this.shadowRoot)==null?void 0:s.querySelector("slot"),t=e==null?void 0:e.assignedElements()[0];t&&this._contentRef.value&&(this.tippy=ts(t,{content:this._contentRef.value,allowHTML:!0,arrow:!1,animation:"shift-away-subtle",interactive:!0,placement:"top",trigger:"click",onShow:()=>{this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!0}))},onHide:()=>{this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!1}))},appendTo:()=>this.shadowRoot}))})}disconnectedCallback(){var s;super.disconnectedCallback(),(s=this.tippy)==null||s.destroy()}render(){var s,e;return Ee`
|
660
660
|
<slot></slot>
|
661
661
|
<div ${ut(this._contentRef)} class="content">
|
662
662
|
<div class="title">
|
@@ -672,7 +672,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
672
672
|
.content=${((s=this.visibleItems)==null?void 0:s.title)??"Sub Menu"}
|
673
673
|
></vmp-text>
|
674
674
|
</div>
|
675
|
-
${
|
675
|
+
${Vh(((e=this.visibleItems)==null?void 0:e.items)??[],({id:t})=>t,t=>Ee`
|
676
676
|
<button
|
677
677
|
class="item"
|
678
678
|
@click=${()=>{t.subItems&&(this.subItemsActive=t.id,this.visibleItems=t.subItems),t.event&&this.dispatchEvent(new CustomEvent(t.event,{detail:t,bubbles:!0,composed:!0}))}}
|
@@ -682,7 +682,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
682
682
|
</button>
|
683
683
|
`)}
|
684
684
|
</div>
|
685
|
-
`}};ss.styles=[
|
685
|
+
`}};ss.styles=[Ne.styles??[],Ns(qa),nt`
|
686
686
|
:host {
|
687
687
|
display: flex;
|
688
688
|
}
|
@@ -744,12 +744,12 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
744
744
|
height: 20px;
|
745
745
|
width: 20px;
|
746
746
|
}
|
747
|
-
`],Cr([z({type:Object})],ss.prototype,"items",2),Cr([z({type:Array})],ss.prototype,"activeItems",2),Cr([ot()],ss.prototype,"visibleItems",2),Cr([ot()],ss.prototype,"subItemsActive",2),ss=Cr([yt("vmp-menu")],ss);var
|
747
|
+
`],Cr([z({type:Object})],ss.prototype,"items",2),Cr([z({type:Array})],ss.prototype,"activeItems",2),Cr([ot()],ss.prototype,"visibleItems",2),Cr([ot()],ss.prototype,"subItemsActive",2),ss=Cr([yt("vmp-menu")],ss);var wC=Object.defineProperty,TC=Object.getOwnPropertyDescriptor,ja=(s,e,t,i)=>{for(var r=i>1?void 0:i?TC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&wC(e,t,r),r};let yr=class extends Ne{constructor(){super(...arguments),this.content="",this.disabled=!1,this.tippy=null,this._contentRef=ht()}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{var s;const e=(s=this.shadowRoot)==null?void 0:s.querySelector("slot"),t=e==null?void 0:e.assignedElements()[0];t&&this._contentRef.value&&(this.tippy=ts(t,{content:this._contentRef.value,allowHTML:!0,arrow:!1,animation:"shift-away-subtle",interactive:!1,placement:"top",zIndex:1e4,appendTo:()=>this.shadowRoot}))})}disconnectedCallback(){var s;super.disconnectedCallback(),(s=this.tippy)==null||s.destroy()}updated(){var s,e;this.disabled?(s=this.tippy)==null||s.disable():(e=this.tippy)==null||e.enable()}render(){return Ee`
|
748
748
|
<slot></slot>
|
749
749
|
<div ${ut(this._contentRef)} class="content">
|
750
750
|
<vmp-text content=${this.content}></vmp-text>
|
751
751
|
</div>
|
752
|
-
`}};yr.styles=[
|
752
|
+
`}};yr.styles=[Ne.styles??[],Ns(qa),nt`
|
753
753
|
:host {
|
754
754
|
display: flex;
|
755
755
|
}
|
@@ -763,7 +763,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
763
763
|
background: var(--colors-dark-800);
|
764
764
|
border-radius: var(--radii-medium);
|
765
765
|
}
|
766
|
-
`],ja([z({type:String})],yr.prototype,"content",2),ja([z({type:Boolean})],yr.prototype,"disabled",2),yr=ja([yt("vmp-tooltip")],yr);var
|
766
|
+
`],ja([z({type:String})],yr.prototype,"content",2),ja([z({type:Boolean})],yr.prototype,"disabled",2),yr=ja([yt("vmp-tooltip")],yr);var xC=Object.defineProperty,DC=Object.getOwnPropertyDescriptor,Xa=(s,e,t,i)=>{for(var r=i>1?void 0:i?DC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&xC(e,t,r),r};let Br=class extends Ne{constructor(){super(...arguments),this.volume=1,this.muted=!1,this.tippy=null,this._contentRef=ht(),this._anchorRef=ht(),this._menuOpen=!1}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{this._anchorRef.value&&this._contentRef.value&&(this.tippy=ts(this._anchorRef.value,{content:this._contentRef.value,allowHTML:!0,arrow:!1,animation:"shift-away-subtle",interactive:!0,placement:"top",interactiveBorder:20,onShow:()=>{this._menuOpen=!0,this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!0}))},onHide:()=>{this._menuOpen=!1,this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!1}))},appendTo:()=>this.shadowRoot}))})}disconnectedCallback(){var s;super.disconnectedCallback(),(s=this.tippy)==null||s.destroy()}render(){return Ee`
|
767
767
|
<vmp-icon-button
|
768
768
|
${ut(this._anchorRef)}
|
769
769
|
icon=${this.muted||this.volume===0?"muted":this.volume<1/3?"volume-low":this.volume<2/3?"volume-medium":"volume-high"}
|
@@ -783,7 +783,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
783
783
|
@blur=${()=>{var s;return(s=this.tippy)==null?void 0:s.hide()}}
|
784
784
|
/>
|
785
785
|
</div>
|
786
|
-
`}};Br.styles=[
|
786
|
+
`}};Br.styles=[Ne.styles??[],Ns(qa),nt`
|
787
787
|
.content {
|
788
788
|
--volume-slider-height: 4px;
|
789
789
|
--volume-slider-width: 78px;
|
@@ -911,7 +911,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
911
911
|
--volume-slider-height: 8px;
|
912
912
|
color: var(--colors-light-800);
|
913
913
|
}
|
914
|
-
`],Xa([z({type:Number})],Br.prototype,"volume",2),Xa([z({type:Boolean})],Br.prototype,"muted",2),Br=Xa([yt("vmp-volume-button")],Br);var
|
914
|
+
`],Xa([z({type:Number})],Br.prototype,"volume",2),Xa([z({type:Boolean})],Br.prototype,"muted",2),Br=Xa([yt("vmp-volume-button")],Br);var RC=Object.defineProperty,LC=Object.getOwnPropertyDescriptor,kn=(s,e,t,i)=>{for(var r=i>1?void 0:i?LC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&RC(e,t,r),r};let Qs=class extends Ne{constructor(){super(...arguments),this.duration=0,this.currentTime=0,this.buffer=[],this._containerRef=ht(),this._handleContainerResize=()=>{var s;const e=(s=this._containerRef.value)==null?void 0:s.getBoundingClientRect();this.dispatchEvent(new CustomEvent("scrubber:resize",{detail:e,bubbles:!0,composed:!0}))},this._handleMouseEnter=s=>{var e;const t=(e=this._containerRef.value)==null?void 0:e.getBoundingClientRect();this.dispatchEvent(new CustomEvent("scrubber:mouseenter",{detail:{x:s.clientX,y:s.clientY,elementLeft:(t==null?void 0:t.left)??0,elementRight:(t==null?void 0:t.right)??document.body.offsetWidth},bubbles:!0,composed:!0}))},this._handleMouseMove=s=>{var e;const t=(e=this._containerRef.value)==null?void 0:e.getBoundingClientRect(),r=(s.clientX-((t==null?void 0:t.left)??0))/((t==null?void 0:t.width)??1);this.dispatchEvent(new CustomEvent("scrubber:mousemove",{detail:{x:s.clientX,y:s.clientY,time:r*this.duration,elementLeft:(t==null?void 0:t.left)??0,elementRight:(t==null?void 0:t.right)??document.body.offsetWidth},bubbles:!0,composed:!0}))},this._handleMouseLeave=s=>{this.dispatchEvent(new CustomEvent("scrubber:mouseleave",{detail:{x:s.clientX,y:s.clientY},bubbles:!0,composed:!0}))}}render(){var s;const e=((s=this.buffer)==null?void 0:s.sort((t,i)=>t.start<i.start?-1:i.start<t.start?1:0).reduce((t,{start:i,end:r},n)=>{const o=t[n-1],a=Math.floor(i),A=Math.ceil(r);return t.push({id:i,start:Math.max(0,a),end:Math.min(A,100)}),o&&o.end>=i-1&&(t[n].start=o.end),t},[]))??[];return Ee`
|
915
915
|
<div
|
916
916
|
class="container"
|
917
917
|
${ut(this._containerRef)}
|
@@ -930,11 +930,11 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
930
930
|
.value=${this.currentTime.toString()}
|
931
931
|
data-testid="scrubber"
|
932
932
|
/>
|
933
|
-
${
|
933
|
+
${Vh(e,({id:t})=>t,t=>Ee`
|
934
934
|
<div class="buffer" style=${`left: ${t.start}%; width: ${t.end-t.start}%`}></div>
|
935
935
|
`)}
|
936
936
|
</div>
|
937
|
-
`}};Qs.styles=[
|
937
|
+
`}};Qs.styles=[Ne.styles??[],nt`
|
938
938
|
:host {
|
939
939
|
--player-scrubber-height: 8px;
|
940
940
|
--player-scrubber-shadow-width: 4000px;
|
@@ -1067,7 +1067,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
1067
1067
|
--player-scrubber-height: 16px;
|
1068
1068
|
color: var(--colors-light-800);
|
1069
1069
|
}
|
1070
|
-
`],kn([z({type:Number})],Qs.prototype,"duration",2),kn([z({type:Number})],Qs.prototype,"currentTime",2),kn([z({type:Array})],Qs.prototype,"buffer",2),Qs=kn([yt("vmp-progress-scrubber")],Qs);var
|
1070
|
+
`],kn([z({type:Number})],Qs.prototype,"duration",2),kn([z({type:Number})],Qs.prototype,"currentTime",2),kn([z({type:Array})],Qs.prototype,"buffer",2),Qs=kn([yt("vmp-progress-scrubber")],Qs);var _C=Object.defineProperty,kC=Object.getOwnPropertyDescriptor,lt=(s,e,t,i)=>{for(var r=i>1?void 0:i?kC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&_C(e,t,r),r};let et=class extends Ne{constructor(){super(...arguments),this.resizeHider=new BC(this),this.playing=!1,this.volume=1,this.muted=!1,this.currentTime=0,this.duration=0,this.level=-1,this.playbackRate=1,this.buffer=[],this.levels=[],this.captions=!1,this.fullscreen=!1,this.controls=Va,this.volumeMenuOpen=!1,this.levelsMenuOpen=!1,this.playbackRateMenuOpen=!1,this.settingsMenuOpen=!1}_handleNavigateBackClick(){this.dispatchEvent(new CustomEvent("navigate:back",{bubbles:!0,composed:!0}))}_handleNavigateForwardClick(){this.dispatchEvent(new CustomEvent("navigate:forward",{bubbles:!0,composed:!0}))}_handlePlayClick(){this.dispatchEvent(new CustomEvent("play:click",{bubbles:!0,composed:!0,detail:this.playing}))}_handleCaptionsClick(){this.dispatchEvent(new CustomEvent("captions:click",{bubbles:!0,composed:!0,detail:this.captions}))}_handleFullscreenClick(){this.dispatchEvent(new CustomEvent("fullscreen:click",{bubbles:!0,composed:!0,detail:this.fullscreen}))}_handleVolumeMenuToggle({detail:s}){this.volumeMenuOpen=s}_handleLevelsMenuOpen({detail:s}){this.levelsMenuOpen=s}_handlePlaybackMenuToggle({detail:s}){this.playbackRateMenuOpen=s}_handleSettingsMenuToggle({detail:s}){this.settingsMenuOpen=s}hideMenus(){var s,e;(e=Array.from((s=this.shadowRoot)==null?void 0:s.querySelectorAll("vmp-menu, vmp-tooltip, vmp-volume-button")))==null||e.forEach(t=>{var i;(i=t.tippy)==null||i.hide()})}render(){var s,e,t,i,r,n,o,a,A,l,c,h,u;const d=((s=this.levels)==null?void 0:s.map((S,D)=>{const U=Math.min(S.width,S.height);return{id:`level-${D.toString()}`,event:"level:click",label:`${U}p`,value:{resolution:U,level:D}}}))??[],g={title:"Quality",items:[...d.reverse(),{id:"level--1",event:"level:click",label:"Auto",value:{level:-1,resolution:"auto"}}]},f={id:"levels",label:"Quality",subItems:g},p=(e=g.items)==null?void 0:e.find(({value:S})=>S.level===this.level),y=["levels","playback-rate","captions","fullscreen"].filter(S=>{var D;return(D=this.controls)==null?void 0:D.includes(S)}),B={title:"Settings",items:[sC,rC,f,nC].filter(({id:S})=>y.includes(S)&&this.resizeHider.hiddenControls.includes(S))},Q=(t=this.controls)==null?void 0:t.includes("progress"),C=(i=this.controls)==null?void 0:i.includes("navigation"),T=(r=this.controls)==null?void 0:r.includes("play"),b=(n=this.controls)==null?void 0:n.includes("volume"),L=(o=this.controls)==null?void 0:o.includes("current-time"),R=(a=this.controls)==null?void 0:a.includes("duration"),O=(A=this.controls)==null?void 0:A.includes("levels"),k=(l=this.controls)==null?void 0:l.includes("speed"),W=(c=this.controls)==null?void 0:c.includes("captions"),$=(h=this.controls)==null?void 0:h.includes("fullscreen"),te=T||b||L||R||O||k||W||$,Z=[`level-${(u=this.level)==null?void 0:u.toString()}`,`playback-rate-${this.playbackRate.toString()}`,this.captions&&"captions",this.fullscreen&&"fullscreen"].filter(Boolean);return Ee`
|
1071
1071
|
<div
|
1072
1072
|
${this.resizeHider.measure()}
|
1073
1073
|
${this.resizeHider.contain()}
|
@@ -1139,7 +1139,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
1139
1139
|
${this.resizeHider.hide("levels",0)}
|
1140
1140
|
class=${Ye({hidden:!O||d.length<=0})}
|
1141
1141
|
.items=${g}
|
1142
|
-
.activeItems=${
|
1142
|
+
.activeItems=${Z}
|
1143
1143
|
@menu:toggle=${this._handleLevelsMenuOpen}
|
1144
1144
|
>
|
1145
1145
|
<vmp-tooltip content="Quality" ?disabled=${this.levelsMenuOpen}>
|
@@ -1149,8 +1149,8 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
1149
1149
|
<vmp-menu
|
1150
1150
|
${this.resizeHider.hide("playback-rate",4)}
|
1151
1151
|
class=${Ye({hidden:!k})}
|
1152
|
-
.items=${
|
1153
|
-
.activeItems=${
|
1152
|
+
.items=${Du}
|
1153
|
+
.activeItems=${Z}
|
1154
1154
|
@menu:toggle=${this._handlePlaybackMenuToggle}
|
1155
1155
|
>
|
1156
1156
|
<vmp-tooltip content="Playback speed" ?disabled=${this.playbackRateMenuOpen}>
|
@@ -1187,7 +1187,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
1187
1187
|
<vmp-menu
|
1188
1188
|
${this.resizeHider.show("settings",["levels","playback-rate","captions","fullscreen"])}
|
1189
1189
|
.items=${B}
|
1190
|
-
.activeItems=${
|
1190
|
+
.activeItems=${Z}
|
1191
1191
|
@menu:toggle=${this._handleSettingsMenuToggle}
|
1192
1192
|
>
|
1193
1193
|
<vmp-tooltip content="Settings" ?disabled=${this.settingsMenuOpen}>
|
@@ -1197,7 +1197,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
1197
1197
|
</div>
|
1198
1198
|
</div>
|
1199
1199
|
</div>
|
1200
|
-
`}};et.styles=[
|
1200
|
+
`}};et.styles=[Ne.styles??[],nt`
|
1201
1201
|
:host {
|
1202
1202
|
--controls-border-radius: var(--player-border-radius, 0px);
|
1203
1203
|
|
@@ -1268,17 +1268,17 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
1268
1268
|
.hidden {
|
1269
1269
|
display: none;
|
1270
1270
|
}
|
1271
|
-
`],lt([z({type:Boolean})],et.prototype,"playing",2),lt([z({type:Number})],et.prototype,"volume",2),lt([z({type:Boolean})],et.prototype,"muted",2),lt([z({type:Number})],et.prototype,"currentTime",2),lt([z({type:Number})],et.prototype,"duration",2),lt([z({type:Number})],et.prototype,"level",2),lt([z({type:Number})],et.prototype,"playbackRate",2),lt([z({type:Array})],et.prototype,"buffer",2),lt([z({type:Array,attribute:!1})],et.prototype,"levels",2),lt([z({type:Boolean})],et.prototype,"captions",2),lt([z({type:Boolean})],et.prototype,"fullscreen",2),lt([z({type:Array})],et.prototype,"controls",2),lt([ot()],et.prototype,"volumeMenuOpen",2),lt([ot()],et.prototype,"levelsMenuOpen",2),lt([ot()],et.prototype,"playbackRateMenuOpen",2),lt([ot()],et.prototype,"settingsMenuOpen",2),et=lt([yt("vmp-player-controls")],et);var
|
1271
|
+
`],lt([z({type:Boolean})],et.prototype,"playing",2),lt([z({type:Number})],et.prototype,"volume",2),lt([z({type:Boolean})],et.prototype,"muted",2),lt([z({type:Number})],et.prototype,"currentTime",2),lt([z({type:Number})],et.prototype,"duration",2),lt([z({type:Number})],et.prototype,"level",2),lt([z({type:Number})],et.prototype,"playbackRate",2),lt([z({type:Array})],et.prototype,"buffer",2),lt([z({type:Array,attribute:!1})],et.prototype,"levels",2),lt([z({type:Boolean})],et.prototype,"captions",2),lt([z({type:Boolean})],et.prototype,"fullscreen",2),lt([z({type:Array})],et.prototype,"controls",2),lt([ot()],et.prototype,"volumeMenuOpen",2),lt([ot()],et.prototype,"levelsMenuOpen",2),lt([ot()],et.prototype,"playbackRateMenuOpen",2),lt([ot()],et.prototype,"settingsMenuOpen",2),et=lt([yt("vmp-player-controls")],et);var NC=Object.defineProperty,FC=Object.getOwnPropertyDescriptor,MC=(s,e,t,i)=>{for(var r=i>1?void 0:i?FC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&NC(e,t,r),r};let za=class extends Ne{render(){return Ee`<vmp-icon icon="loading"></vmp-icon>`}};za.styles=[Ne.styles??[],nt`
|
1272
1272
|
:host {
|
1273
1273
|
display: flex;
|
1274
1274
|
align-items: center;
|
1275
1275
|
justify-content: center;
|
1276
1276
|
}
|
1277
|
-
`],za=
|
1277
|
+
`],za=MC([yt("vmp-loading-spinner")],za);var PC=Object.defineProperty,OC=Object.getOwnPropertyDescriptor,Fu=(s,e,t,i)=>{for(var r=i>1?void 0:i?OC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&PC(e,t,r),r};let Nn=class extends Ne{constructor(){super(...arguments),this.caption=""}render(){return Ee`
|
1278
1278
|
<div class="container">
|
1279
1279
|
<vmp-text content=${this.caption} size="large"></vmp-text>
|
1280
1280
|
</div>
|
1281
|
-
`}};Nn.styles=[
|
1281
|
+
`}};Nn.styles=[Ne.styles??[],nt`
|
1282
1282
|
.container {
|
1283
1283
|
display: block;
|
1284
1284
|
margin: 0 var(--space-small);
|
@@ -1297,7 +1297,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
1297
1297
|
/* Line height controls the spacing between the cloned boxes so has to override the default */
|
1298
1298
|
line-height: 2.2;
|
1299
1299
|
}
|
1300
|
-
`],
|
1300
|
+
`],Fu([z({type:String})],Nn.prototype,"caption",2),Nn=Fu([yt("vmp-captions")],Nn);var UC=Object.defineProperty,GC=Object.getOwnPropertyDescriptor,ft=(s,e,t,i)=>{for(var r=i>1?void 0:i?GC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&UC(e,t,r),r};const HC=3e3;let st=class extends Ne{constructor(){super(...arguments),this.loading=!1,this.playing=!1,this.volume=1,this.muted=!1,this.currentTime=0,this.duration=0,this.levels=[],this.level=-1,this.playbackRate=1,this.caption="",this.buffer=[],this.captions=!1,this.fullscreen=!1,this.controls=Va,this.showControls=!0,this._hasTouched=!1,this._playerControlsRef=ht()}_startHideControls(){clearTimeout(this._controlHideTimeout),this._controlHideTimeout=setTimeout(()=>{this.showControls=!1,this._hasTouched=!1},HC)}_immediateShowControls(){this.showControls=!0,clearTimeout(this._controlHideTimeout)}_immediateHideControls(){this.showControls=!1,this._hasTouched=!1,clearTimeout(this._controlHideTimeout)}willUpdate(s){var e;s.has("playing")&&this.playing&&this._startHideControls(),s.has("showControls")&&this.playing&&!this.showControls&&((e=this._playerControlsRef.value)==null||e.hideMenus())}render(){var s;const e=(s=this.controls)==null?void 0:s.includes("play-large"),t=this.playing&&!this.showControls,i=!!(e&&!this.playing);return Ee`
|
1301
1301
|
<div
|
1302
1302
|
class=${Ye({container:!0,hide:t})}
|
1303
1303
|
@mousemove=${()=>{this._immediateShowControls(),this._startHideControls()}}
|
@@ -1343,7 +1343,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
1343
1343
|
></vmp-player-controls>
|
1344
1344
|
</div>
|
1345
1345
|
</div>
|
1346
|
-
`}};st.styles=[
|
1346
|
+
`}};st.styles=[Ne.styles??[],nt`
|
1347
1347
|
:host {
|
1348
1348
|
--overlay-border-radius: var(--player-border-radius, 0px);
|
1349
1349
|
}
|
@@ -1415,7 +1415,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
1415
1415
|
vmp-captions.hiddenControls {
|
1416
1416
|
transform: translateY(calc(var(--space-small) * -1));
|
1417
1417
|
}
|
1418
|
-
`],ft([z({type:Boolean})],st.prototype,"loading",2),ft([z({type:Boolean})],st.prototype,"playing",2),ft([z({type:Number})],st.prototype,"volume",2),ft([z({type:Boolean})],st.prototype,"muted",2),ft([z({type:Number})],st.prototype,"currentTime",2),ft([z({type:Number})],st.prototype,"duration",2),ft([z({type:Array,attribute:!1})],st.prototype,"levels",2),ft([z({type:Number})],st.prototype,"level",2),ft([z({type:Number})],st.prototype,"playbackRate",2),ft([z({type:String})],st.prototype,"caption",2),ft([z({type:Array})],st.prototype,"buffer",2),ft([z({type:Boolean})],st.prototype,"captions",2),ft([z({type:Boolean})],st.prototype,"fullscreen",2),ft([z({type:Array})],st.prototype,"controls",2),ft([ot()],st.prototype,"showControls",2),st=ft([yt("vmp-player-overlay")],st);var
|
1418
|
+
`],ft([z({type:Boolean})],st.prototype,"loading",2),ft([z({type:Boolean})],st.prototype,"playing",2),ft([z({type:Number})],st.prototype,"volume",2),ft([z({type:Boolean})],st.prototype,"muted",2),ft([z({type:Number})],st.prototype,"currentTime",2),ft([z({type:Number})],st.prototype,"duration",2),ft([z({type:Array,attribute:!1})],st.prototype,"levels",2),ft([z({type:Number})],st.prototype,"level",2),ft([z({type:Number})],st.prototype,"playbackRate",2),ft([z({type:String})],st.prototype,"caption",2),ft([z({type:Array})],st.prototype,"buffer",2),ft([z({type:Boolean})],st.prototype,"captions",2),ft([z({type:Boolean})],st.prototype,"fullscreen",2),ft([z({type:Array})],st.prototype,"controls",2),ft([ot()],st.prototype,"showControls",2),st=ft([yt("vmp-player-overlay")],st);var $C=Object.defineProperty,YC=Object.getOwnPropertyDescriptor,je=(s,e,t,i)=>{for(var r=i>1?void 0:i?YC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&$C(e,t,r),r};const KC=1e3/60;let Je=class extends Ne{constructor(){super(...arguments),this.burnCaptions=!1,this.debug=!1,this.propAspectRatio=0,this.preload="auto",this.autoplay=!1,this.loading=!1,this.compilation=To,this._sceneController=new eC(this),this._drawController=new jm(this),this._observer=null,this._wasPlaying=!1,this._manualMute=this.muted,this._seekerRAF=null,this._seekerTimeout=null,this._lastWaiting=!1,this._lastTimestamp=null,this._playerRef=ht(),this._canvasRef=ht(),this._pageHidden=document.visibilityState==="hidden",this._aspectRatio=this.propAspectRatio,this._processing=!1,this._waiting=!1,this._errors=[],this._seeking=!1,this._captions=!1,this._fullscreen=!1,this._initialised=null,this._paused=!0,this._playbackRate=1,this._volume=null,this._muted=null,this._videoResolution=-1,this._handleContainerResize=()=>{var s;(s=this.shadowRoot)!=null&&s.host&&!this.propAspectRatio&&(this._aspectRatio=this.shadowRoot.host.clientWidth/this.shadowRoot.host.clientHeight)},this._handleCanvasResize=()=>{this.draw()},this._loop=()=>{this._endLoop(),this._pageHidden?this._seekerTimeout=setTimeout(this._seeker,KC):this._seekerRAF=requestAnimationFrame(this._seeker)},this._endLoop=()=>{this._seekerRAF&&cancelAnimationFrame(this._seekerRAF),this._seekerTimeout&&clearTimeout(this._seekerTimeout),this._seekerRAF=null,this._seekerTimeout=null},this._seeker=(s=performance.now())=>{this.sceneConfig&&this.scenes.length>0&&(this._waiting=this._drawController.activeScenes.some(({video:e})=>{if(e){const{key:t}=e,i=this.videoState[t];return!i||!i.initialised||i.waiting||e.node.readyState<3}}),this.waiting?(this._lastTimestamp=null,this._lastWaiting||this.dispatchEvent(new CustomEvent("waiting"))):this._lastWaiting&&this.dispatchEvent(new CustomEvent("playing")),s-(this._lastTimestamp??0)>1e3/this.sceneConfig.frameRate&&(this._drawController.currentTime=this._drawController.currentTime+(s-(this._lastTimestamp??s))/1e3*this.playbackRate,this._lastTimestamp=s),this._lastWaiting=this._waiting,this._drawController.currentTime>=this.duration&&(this.pause(),this.dispatchEvent(new CustomEvent("ended")))),this.paused||this._loop()},this._handleError=s=>{this._errors=[...this.errors,s.error],s.error.fatal&&this.pause()},this._handleFullscreenChange=()=>{document.fullscreenElement?this._fullscreen=!0:this._fullscreen=!1},this._handleVisibilityChange=()=>{this._pageHidden=document.visibilityState==="hidden",this.paused||this._loop()}}get aspectRatio(){return this._aspectRatio}get processing(){return this._processing}get waiting(){return!this.paused&&this._waiting}get errors(){return this._errors}get seeking(){return this._seeking}get captions(){return this._captions}get fullscreen(){return this._fullscreen}get initialised(){return this._initialised=this._initialised??new Promise(s=>{const e=setInterval(()=>{!!this.errors.find(i=>i.fatal)&&s(!1),!this.loading&&!this.processing&&this.scenes.length>0&&s(!0)},500);setTimeout(()=>{clearInterval(e),s(!1)},60*1e3)}),this._initialised}get duration(){return this._sceneController.duration}get scene(){return this._drawController.activeScenes[this._drawController.activeScenes.length-1]}get scenes(){var s;return((s=this._sceneController.scenes)==null?void 0:s.scenes)??[]}get sceneConfig(){return this._sceneController.scenes}get videos(){return this._sceneController.videos??{}}get videoState(){return this._sceneController.videoState}get sceneVideoState(){return this.scenes.reduce((s,{video:e,start:t,duration:i})=>{const r=(e==null?void 0:e.key)??`${t}-${i}`;return s[r]=this.videoState[r],s},{})}set paused(s){s!==this._paused&&(this._paused=s,this.requestUpdate(),this.dispatchEvent(new CustomEvent(s?"pause":"play")))}get paused(){return this._paused}set playbackRate(s){s!==this._playbackRate&&(this._playbackRate=s,this.scenes.forEach(({video:e})=>{e&&(e.node.playbackRate=s)}),this.requestUpdate(),this.dispatchEvent(new CustomEvent("ratechange",{detail:s})))}get playbackRate(){return this._playbackRate}set volume(s){const e=Math.min(1,Math.max(0,s));e!==this._volume&&(this.scenes.forEach(({video:t})=>{t&&(t.node.volume=e)}),localStorage.setItem("vmp-player-volume",e.toString()),this._volume=e,e>0&&(this.muted=!1),this.requestUpdate(),this.dispatchEvent(new CustomEvent("volumechange",{detail:s})))}get volume(){return this._volume??(this._volume=parseFloat(localStorage.getItem("vmp-player-volume")??"1"))}set muted(s){this.scenes.forEach(({video:e})=>{e&&(e.node.muted=s)}),s!==this._muted&&(this._muted=s,localStorage.setItem("vmp-player-muted",s.toString()),this.requestUpdate(),this.dispatchEvent(new CustomEvent("volumechange",{detail:s?0:this.volume})))}get muted(){return this._muted??(this._muted=this.autoplay||localStorage.getItem("vmp-player-muted")==="true")}set videoResolution(s){s!==this._videoResolution&&(this._videoResolution=s,this.scenes.forEach(({video:e})=>{if(e!=null&&e.hls){const t=e.hls.levels.findIndex(i=>Math.min(i.height,i.width)===s);e.hls.currentLevel=t??-1}}),this.requestUpdate())}get videoResolution(){return this._videoResolution}set currentTime(s){s!==this._drawController.currentTime&&(this._drawController.currentTime=s,this._sceneController.setVideosCurrentTime(s))}get currentTime(){return this._drawController.currentTime}reset(s=0,e=!1){this._lastTimestamp=null,this._drawController.currentTime=s,this._sceneController.setVideosCurrentTime(s),e?this.play():this.pause()}clear(){this._drawController.clear()}play(){this.paused=!1,this._lastTimestamp=null,this.duration>0&&this._drawController.currentTime>=this.duration&&this.reset(0,!0),this._loop()}pause(){this._endLoop(),this.paused=!0,this.scenes.forEach(({video:s})=>{s&&s.node.pause()})}draw(s){return this._drawController.draw(s)}setScene(s){var e,t;if((e=this._sceneController)!=null&&e.scenes){const i=(t=this.scenes)==null?void 0:t[s];if(!i){const r=new zt(`No scene at index: ${s}`);return this.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:r,message:r.message}))}this.reset(i.start+this._sceneController.scenes.transitionDuration,!this.paused)}}toggleFullscreen(s){s??this.fullscreen?iC():this._playerRef.value&&tC(this._playerRef.value)}connectedCallback(){var s;super.connectedCallback(),this.addEventListener("error",this._handleError),document.addEventListener("fullscreenchange",this._handleFullscreenChange),document.addEventListener("visibilitychange",this._handleVisibilityChange),(s=this.shadowRoot)!=null&&s.host&&(this._observer=new ResizeObserver(this._handleContainerResize),this._observer.observe(this.shadowRoot.host))}willUpdate(){this.propAspectRatio&&(this._aspectRatio=this.propAspectRatio)}updated(s){s.has("propAspectRatio")&&!this.propAspectRatio&&this._handleContainerResize(),this.autoplay&&!this.processing&&!this._sceneController.hasPlayed&&s.has("_processing")&&this.play()}disconnectedCallback(){var s;super.disconnectedCallback(),(s=this._observer)==null||s.disconnect(),document.removeEventListener("fullscreenchange",this._handleFullscreenChange),document.removeEventListener("visibilitychange",this._handleVisibilityChange)}_renderStyles(){return this.propAspectRatio?typeof this.propAspectRatio=="number"?Ee`
|
1419
1419
|
<style>
|
1420
1420
|
:host {
|
1421
1421
|
aspect-ratio: ${this.propAspectRatio};
|
@@ -1436,7 +1436,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
1436
1436
|
<vmp-text semibold content="An error has occurred when attempting to play this video."></vmp-text>
|
1437
1437
|
<vmp-text semibold content="Please try again later."></vmp-text>
|
1438
1438
|
</div>
|
1439
|
-
</div>`}render(){var s,e,t,i,r,n;const o=this.loading||this.processing||!this.scenes||this.duration<=0,{height:a,width:A}=xo({resolution:((s=this.sceneConfig)==null?void 0:s.resolution)??720,aspectRatio:this.aspectRatio}),l=Object.keys(this.sceneVideoState).reduce((B,Q)=>B.concat(this.sceneVideoState[Q].buffered??[]),[]),c=o?[]:(e=this.controls??Va)==null?void 0:e.filter(B=>!(B==="fullscreen"&&
|
1439
|
+
</div>`}render(){var s,e,t,i,r,n;const o=this.loading||this.processing||!this.scenes||this.duration<=0,{height:a,width:A}=xo({resolution:((s=this.sceneConfig)==null?void 0:s.resolution)??720,aspectRatio:this.aspectRatio}),l=Object.keys(this.sceneVideoState).reduce((B,Q)=>B.concat(this.sceneVideoState[Q].buffered??[]),[]),c=o?[]:(e=this.controls??Va)==null?void 0:e.filter(B=>!(B==="fullscreen"&&zm()||B==="navigation"&&(!this.scenes||this.scenes.length<=1))),h=!(c!=null&&c.includes("preview")),u=(((t=this.scenes)==null?void 0:t.length)??0)-1,d=((i=this.scenes)==null?void 0:i.findIndex(B=>B===this._drawController.activeScenes[0]))??0,g=(n=(r=this._drawController.activeScenes[0])==null?void 0:r.video)==null?void 0:n.hls,f=this.loading||this.waiting||this.processing,p=!this.src&&!this.data,y=!!this.errors.find(B=>B.fatal);return Ee`
|
1440
1440
|
${this._renderStyles()}
|
1441
1441
|
<div
|
1442
1442
|
${ut(this._playerRef)}
|
@@ -1489,7 +1489,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
1489
1489
|
.compilation=${this.compilation}
|
1490
1490
|
></vmp-video-preview>`}
|
1491
1491
|
</div>
|
1492
|
-
`}};Je.styles=[
|
1492
|
+
`}};Je.styles=[Ne.styles??[],nt`
|
1493
1493
|
:host {
|
1494
1494
|
--player-border-radius: var(--vouch-media-player-border-radius, 0px);
|
1495
1495
|
|
@@ -1550,7 +1550,7 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
1550
1550
|
top: 0;
|
1551
1551
|
left: 0;
|
1552
1552
|
}
|
1553
|
-
`],je([z({type:Object})],Je.prototype,"data",2),je([z({type:Object})],Je.prototype,"template",2),je([z({type:Boolean})],Je.prototype,"burnCaptions",2),je([z({type:Boolean})],Je.prototype,"debug",2),je([z({type:String})],Je.prototype,"src",2),je([z({type:String})],Je.prototype,"track",2),je([z({type:Number,attribute:"aspectratio"})],Je.prototype,"propAspectRatio",2),je([z({type:String})],Je.prototype,"preload",2),je([z({type:Boolean})],Je.prototype,"autoplay",2),je([z({type:Boolean})],Je.prototype,"loading",2),je([z({type:Array})],Je.prototype,"controls",2),je([z({attribute:!1})],Je.prototype,"compilation",2),je([ot()],Je.prototype,"_pageHidden",2),je([ot()],Je.prototype,"_aspectRatio",2),je([ot()],Je.prototype,"_processing",2),je([ot()],Je.prototype,"_waiting",2),je([ot()],Je.prototype,"_errors",2),je([ot()],Je.prototype,"_seeking",2),je([ot()],Je.prototype,"_captions",2),je([ot()],Je.prototype,"_fullscreen",2),Je=je([yt("vmp-media-player")],Je);var
|
1553
|
+
`],je([z({type:Object})],Je.prototype,"data",2),je([z({type:Object})],Je.prototype,"template",2),je([z({type:Boolean})],Je.prototype,"burnCaptions",2),je([z({type:Boolean})],Je.prototype,"debug",2),je([z({type:String})],Je.prototype,"src",2),je([z({type:String})],Je.prototype,"track",2),je([z({type:Number,attribute:"aspectratio"})],Je.prototype,"propAspectRatio",2),je([z({type:String})],Je.prototype,"preload",2),je([z({type:Boolean})],Je.prototype,"autoplay",2),je([z({type:Boolean})],Je.prototype,"loading",2),je([z({type:Array})],Je.prototype,"controls",2),je([z({attribute:!1})],Je.prototype,"compilation",2),je([ot()],Je.prototype,"_pageHidden",2),je([ot()],Je.prototype,"_aspectRatio",2),je([ot()],Je.prototype,"_processing",2),je([ot()],Je.prototype,"_waiting",2),je([ot()],Je.prototype,"_errors",2),je([ot()],Je.prototype,"_seeking",2),je([ot()],Je.prototype,"_captions",2),je([ot()],Je.prototype,"_fullscreen",2),Je=je([yt("vmp-media-player")],Je);var VC=Object.defineProperty,JC=Object.getOwnPropertyDescriptor,Bt=(s,e,t,i)=>{for(var r=i>1?void 0:i?JC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&VC(e,t,r),r};Ue.PlayerEmbed=class extends as{constructor(){super(...arguments),this.env="prod",this.apiKey="",this.disableTracking=!1,this.trackingSource="embedded_player",this.preload="auto",this.autoplay=!1,this.aspectRatio=0,this.eventController=new Kd(this,["durationchange","ended","error","loadeddata","pause","stalled","play","playing","ratechange","scenechange","seeking","seeked","timeupdate","volumechange","waiting","video:loadeddata","video:seeking","video:seeked","video:play","video:playing","video:pause","video:stalled","video:timeupdate","video:ended","video:error"]),this._fetcherController=new fg(this),this._trackingController=new Yf(this),this._mediaPlayerRef=ht()}get fetching(){return this._fetcherController.fetching}get waiting(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.waiting}get initialised(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.initialised}get seeking(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.seeking}get paused(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.paused}get captions(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.captions}get fullscreen(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.fullscreen}get duration(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.duration}set currentTime(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.currentTime=e)}get currentTime(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.currentTime)??0}set playbackRate(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.playbackRate=e)}get playbackRate(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.playbackRate)??1}set volume(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.volume=e)}get volume(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.volume)??1}set muted(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.muted=e)}get muted(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.muted)??!1}get scene(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.scene)??null}get scenes(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.scenes)??[]}get sceneConfig(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.sceneConfig)??null}get videoState(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.videoState}get mediaPlayer(){return this._mediaPlayerRef.value}play(){var e;(e=this._mediaPlayerRef.value)==null||e.play()}pause(){var e;(e=this._mediaPlayerRef.value)==null||e.pause()}reset(e=0,t=!1){var i;(i=this._mediaPlayerRef.value)==null||i.reset(e,t)}setScene(e){var t;(t=this._mediaPlayerRef.value)==null||t.setScene(e)}_renderStyles(){return this.aspectRatio?typeof this.aspectRatio=="number"?Ee`
|
1554
1554
|
<style>
|
1555
1555
|
:host {
|
1556
1556
|
aspect-ratio: ${this.aspectRatio};
|
@@ -1576,9 +1576,9 @@ ${e}`,cf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),hf=Objec
|
|
1576
1576
|
preload=${Hi(this.preload)}
|
1577
1577
|
.controls=${this.controls}
|
1578
1578
|
></vmp-media-player>
|
1579
|
-
`}},
|
1579
|
+
`}},Ue.PlayerEmbed.styles=[nt`
|
1580
1580
|
:host {
|
1581
1581
|
display: flex;
|
1582
1582
|
}
|
1583
|
-
`],Bt([z({type:Object})],Pe.PlayerEmbed.prototype,"data",2),Bt([z({type:String})],Pe.PlayerEmbed.prototype,"vouchId",2),Bt([z({type:String})],Pe.PlayerEmbed.prototype,"templateId",2),Bt([z({type:Array})],Pe.PlayerEmbed.prototype,"questions",2),Bt([z({type:String})],Pe.PlayerEmbed.prototype,"env",2),Bt([z({type:String})],Pe.PlayerEmbed.prototype,"apiKey",2),Bt([z({type:Boolean})],Pe.PlayerEmbed.prototype,"disableTracking",2),Bt([z({type:String})],Pe.PlayerEmbed.prototype,"trackingSource",2),Bt([z({type:Array})],Pe.PlayerEmbed.prototype,"controls",2),Bt([z({type:String})],Pe.PlayerEmbed.prototype,"preload",2),Bt([z({type:Boolean})],Pe.PlayerEmbed.prototype,"autoplay",2),Bt([z({type:Number})],Pe.PlayerEmbed.prototype,"aspectRatio",2),Bt([ot()],Pe.PlayerEmbed.prototype,"vouch",2),Bt([ot()],Pe.PlayerEmbed.prototype,"template",2),Pe.PlayerEmbed=Bt([Rd("vouch-embed-player")],Pe.PlayerEmbed);function ei(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function Fu(s,e){for(var t="",i=0,r=-1,n=0,o,a=0;a<=s.length;++a){if(a<s.length)o=s.charCodeAt(a);else{if(o===47)break;o=47}if(o===47){if(!(r===a-1||n===1))if(r!==a-1&&n===2){if(t.length<2||i!==2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){var A=t.lastIndexOf("/");if(A!==t.length-1){A===-1?(t="",i=0):(t=t.slice(0,A),i=t.length-1-t.lastIndexOf("/")),r=a,n=0;continue}}else if(t.length===2||t.length===1){t="",i=0,r=a,n=0;continue}}e&&(t.length>0?t+="/..":t="..",i=2)}else t.length>0?t+="/"+s.slice(r+1,a):t=s.slice(r+1,a),i=a-r-1;r=a,n=0}else o===46&&n!==-1?++n:n=-1}return t}function JC(s,e){var t=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return t?t===e.root?t+i:t+s+i:i}var bs={resolve:function(){for(var e="",t=!1,i,r=arguments.length-1;r>=-1&&!t;r--){var n;r>=0?n=arguments[r]:(i===void 0&&(i=process.cwd()),n=i),ei(n),n.length!==0&&(e=n+"/"+e,t=n.charCodeAt(0)===47)}return e=Fu(e,!t),t?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(ei(e),e.length===0)return".";var t=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=Fu(e,!t),e.length===0&&!t&&(e="."),e.length>0&&i&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return ei(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,t=0;t<arguments.length;++t){var i=arguments[t];ei(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":bs.normalize(e)},relative:function(e,t){if(ei(e),ei(t),e===t||(e=bs.resolve(e),t=bs.resolve(t),e===t))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var r=e.length,n=r-i,o=1;o<t.length&&t.charCodeAt(o)===47;++o);for(var a=t.length,A=a-o,l=n<A?n:A,c=-1,h=0;h<=l;++h){if(h===l){if(A>l){if(t.charCodeAt(o+h)===47)return t.slice(o+h+1);if(h===0)return t.slice(o+h)}else n>l&&(e.charCodeAt(i+h)===47?c=h:h===0&&(c=0));break}var u=e.charCodeAt(i+h),d=t.charCodeAt(o+h);if(u!==d)break;u===47&&(c=h)}var g="";for(h=i+c+1;h<=r;++h)(h===r||e.charCodeAt(h)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+t.slice(o+c):(o+=c,t.charCodeAt(o)===47&&++o,t.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(ei(e),e.length===0)return".";for(var t=e.charCodeAt(0),i=t===47,r=-1,n=!0,o=e.length-1;o>=1;--o)if(t=e.charCodeAt(o),t===47){if(!n){r=o;break}}else n=!1;return r===-1?i?"/":".":i&&r===1?"//":e.slice(0,r)},basename:function(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ei(e);var i=0,r=-1,n=!0,o;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,A=-1;for(o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(l===47){if(!n){i=o+1;break}}else A===-1&&(n=!1,A=o+1),a>=0&&(l===t.charCodeAt(a)?--a===-1&&(r=o):(a=-1,r=A))}return i===r?r=A:r===-1&&(r=e.length),e.slice(i,r)}else{for(o=e.length-1;o>=0;--o)if(e.charCodeAt(o)===47){if(!n){i=o+1;break}}else r===-1&&(n=!1,r=o+1);return r===-1?"":e.slice(i,r)}},extname:function(e){ei(e);for(var t=-1,i=0,r=-1,n=!0,o=0,a=e.length-1;a>=0;--a){var A=e.charCodeAt(a);if(A===47){if(!n){i=a+1;break}continue}r===-1&&(n=!1,r=a+1),A===46?t===-1?t=a:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||r===-1||o===0||o===1&&t===r-1&&t===i+1?"":e.slice(t,r)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return JC("/",e)},parse:function(e){ei(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;var i=e.charCodeAt(0),r=i===47,n;r?(t.root="/",n=1):n=0;for(var o=-1,a=0,A=-1,l=!0,c=e.length-1,h=0;c>=n;--c){if(i=e.charCodeAt(c),i===47){if(!l){a=c+1;break}continue}A===-1&&(l=!1,A=c+1),i===46?o===-1?o=c:h!==1&&(h=1):o!==-1&&(h=-1)}return o===-1||A===-1||h===0||h===1&&o===A-1&&o===a+1?A!==-1&&(a===0&&r?t.base=t.name=e.slice(1,A):t.base=t.name=e.slice(a,A)):(a===0&&r?(t.name=e.slice(1,o),t.base=e.slice(1,A)):(t.name=e.slice(a,o),t.base=e.slice(a,A)),t.ext=e.slice(o,A)),a>0?t.dir=e.slice(0,a-1):r&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};bs.posix=bs;var WC=bs;const{basename:Mu,extname:qC}=WC;class jC{constructor(){let e=(()=>typeof Hr>"u")(),t="image/png",i="image/jpeg",r="image/jpeg",n="image/webp",o="application/pdf",a="image/svg+xml";Object.assign(this,{toMime:this.toMime.bind(this),fromMime:this.fromMime.bind(this),expected:e?'"png", "jpg", or "webp"':'"png", "jpg", "pdf", or "svg"',formats:e?{png:t,jpg:i,jpeg:r,webp:n}:{png:t,jpg:i,jpeg:r,pdf:o,svg:a},mimes:e?{[t]:"png",[i]:"jpg",[n]:"webp"}:{[t]:"png",[i]:"jpg",[o]:"pdf",[a]:"svg"}})}toMime(e){return this.formats[(e||"").replace(/^\./,"").toLowerCase()]}fromMime(e){return this.mimes[e]}}function XC(s,{filename:e="",extension:t="",format:f,page:r,quality:n,matte:o,density:a,outline:A,archive:d}={}){var{fromMime:c,toMime:h,expected:u}=new jC,d=d||"canvas",g=f||t.replace(/@\d+x$/i,"")||qC(e),f=c(h(g)||g),p=h(f),y=s.length;if(!g)throw new Error("Cannot determine image format (use a filename extension or 'format' argument)");if(!f)throw new Error(`Unsupported file format "${g}" (expected ${u})`);if(!y)throw new RangeError("Canvas has no associated contexts (try calling getContext or newPage first)");let B,Q,C=e.replace(/{(\d*)}/g,(b,L)=>(Q=!0,L=parseInt(L,10),B=isFinite(L)?L:isFinite(B)?B:-1,"{}")),T=r>0?r-1:r<0?y+r:void 0;if(isFinite(T)&&T<0||T>=y)throw new RangeError(y==1?`Canvas only has a ‘page 1’ (${T} is out of bounds)`:`Canvas has pages 1–${y} (${T} is out of bounds)`);if(s=isFinite(T)?[s[T]]:Q||f=="pdf"?s:s.slice(-1),n===void 0)n=.92;else if(typeof n!="number"||!isFinite(n)||n<0||n>1)throw new TypeError("The quality option must be an number in the 0.0–1.0 range");if(a===void 0){let b=(t||Mu(e,g)).match(/@(\d+)x$/i);a=b?parseInt(b[1],10):1}else if(typeof a!="number"||!Number.isInteger(a)||a<1)throw new TypeError("The density option must be a non-negative integer");return A===void 0?A=!0:f=="svg"&&(A=!!A),{filename:e,pattern:C,format:f,mime:p,pages:s,padding:B,quality:n,matte:o,density:a,outline:A,archive:d}}class Fn{static for(e){return new Fn().append(e).get()}constructor(){this.crc=-1}get(){return~this.crc}append(e){for(var t=this.crc|0,i=this.table,r=0,n=e.length|0;r<n;r++)t=t>>>8^i[(t^e[r])&255];return this.crc=t,this}}Fn.prototype.table=(()=>{var s,e,t,i=[];for(s=0;s<256;s++){for(t=s,e=0;e<8;e++)t=t&1?t>>>1^3988292384:t>>>1;i[s]=t}return i})();function Za(s){let e=new Uint8Array(s),t=new DataView(e.buffer),i={array:e,view:t,size:s,set8(r,n){return t.setUint8(r,n),i},set16(r,n){return t.setUint16(r,n,!0),i},set32(r,n){return t.setUint32(r,n,!0),i},bytes(r,n){return e.set(n,r),i}};return i}const Mn=class Mn{constructor(e){let t=new Date;Object.assign(this,{directory:e,offset:0,files:[],time:(t.getHours()<<6|t.getMinutes())<<5|t.getSeconds()/2,date:(t.getFullYear()-1980<<4|t.getMonth()+1)<<5|t.getDate()}),this.add(e)}async add(e,t){let i=!t,r=Mn.encoder.encode(`${this.directory}/${i?"":e}`),n=new Uint8Array(i?0:await t.arrayBuffer()),o=30+r.length,a=o+n.length,A=16,{offset:l}=this,c=Za(26).set32(0,134742036).set16(6,this.time).set16(8,this.date).set32(10,Fn.for(n)).set32(14,n.length).set32(18,n.length).set16(22,r.length);l+=o;let h=Za(o+n.length+A).set32(0,67324752).bytes(4,c.array).bytes(30,r).bytes(o,n);l+=n.length,h.set32(a,134695760).bytes(a+4,c.array.slice(10,22)),l+=A,this.files.push({offset:l,folder:i,name:r,header:c,payload:h}),this.offset=l}toBuffer(){let e=this.files.reduce((h,{name:u})=>46+u.length+h,0),t=Za(e+22),i=0;for(var{offset:r,name:n,header:o,folder:a}of this.files)t.set32(i,33639248).set16(i+4,20).bytes(i+6,o.array).set8(i+38,a?16:0).set32(i+42,r).bytes(i+46,n),i+=46+n.length;t.set32(i,101010256).set16(i+8,this.files.length).set16(i+10,this.files.length).set32(i+12,e).set32(i+16,this.offset);let A=new Uint8Array(this.offset+t.size),l=0;for(var{payload:c}of this.files)A.set(c.array,l),l+=c.size;return A.set(t.array,l),A}get blob(){return new Blob([this.toBuffer()],{type:"application/zip"})}};zu(Mn,"encoder",new TextEncoder);let eA=Mn;const tA=(s,e,t,i)=>{if(i){let{width:r,height:n}=s,o=Object.assign(document.createElement("canvas"),{width:r,height:n}),a=o.getContext("2d");a.fillStyle=i,a.fillRect(0,0,r,n),a.drawImage(s,0,0),s=o}return new Promise((r,n)=>s.toBlob(r,e,t))},zC=(...s)=>tA(...s).then(e=>e.arrayBuffer()),ZC=async(s,e,t,i,r)=>{Pu(r,await tA(s,e,t,i))},ey=async(s,e,t,i,r,n,o)=>{let a=c=>n.replace("{}",String(c+1).padStart(o,"0")),A=Mu(r,".zip")||"archive",l=new eA(A);await Promise.all(s.map(async(c,h)=>{let u=a(h);await l.add(u,await tA(c,e,t,i))})),Pu(`${A}.zip`,l.blob)},Pu=(s,e)=>{const t=window.URL.createObjectURL(e),i=document.createElement("a");i.style.display="none",i.href=t,i.setAttribute("download",s),typeof i.download>"u"&&i.setAttribute("target","_blank"),document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(()=>window.URL.revokeObjectURL(t),100)};var ty={asBuffer:zC,asDownload:ZC,asZipDownload:ey,atScale:(s,e,t)=>s.map(i=>{if(e==1&&!t)return i.canvas;let r=document.createElement("canvas"),n=r.getContext("2d"),o=i.canvas?i.canvas:i;return r.width=o.width*e,r.height=o.height*e,t&&(n.fillStyle=t,n.fillRect(0,0,r.width,r.height)),n.scale(e,e),n.drawImage(o,0,0),r}),options:XC};const{asBuffer:iA,asDownload:iy,asZipDownload:sy,atScale:sA,options:rA}=ty,Ou=Symbol.for("toDataURL"),ry=s=>{let e=Object.assign(new Uu,{crossOrigin:"Anonymous",src:s});return e.decode().then(()=>e)};class ny{constructor(e,t){let i=document.createElement("canvas"),r=[];Object.defineProperty(i,"async",{value:!0,writable:!1,enumerable:!0});for(var[n,o]of Object.entries({png:()=>iA(i,"image/png"),jpg:()=>iA(i,"image/jpeg"),pages:()=>r.concat(i).map(a=>a.getContext("2d"))}))Object.defineProperty(i,n,{get:o});return Object.assign(i,{width:e,height:t,newPage(...a){var{width:l,height:c}=i,A=Object.assign(document.createElement("canvas"),{width:l,height:c});A.getContext("2d").drawImage(i,0,0),r.push(A);var[l,c]=a.length?a:[l,c];return Object.assign(i,{width:l,height:c}).getContext("2d")},saveAs(a,A){A=typeof A=="number"?{quality:A}:A;let l=rA(this.pages,{filename:a,...A}),{pattern:c,padding:h,mime:u,quality:d,matte:g,density:f,archive:p}=l,y=sA(l.pages,f);return h==null?iy(y[0],u,d,g,a):sy(y,u,d,g,p,c,h)},toBuffer(a="png",A={}){A=typeof A=="number"?{quality:A}:A;let l=rA(this.pages,{extension:a,...A}),{mime:c,quality:h,matte:u,pages:d,density:g}=l,f=sA(d,g,u)[0];return iA(f,c,h,u)},[Ou]:i.toDataURL.bind(i),toDataURL(a="png",A={}){A=typeof A=="number"?{quality:A}:A;let l=rA(this.pages,{extension:a,...A}),{mime:c,quality:h,matte:u,pages:d,density:g}=l,f=sA(d,g,u)[0],p=f[f===i?Ou:"toDataURL"](c,h);return Promise.resolve(p)}})}}const{CanvasRenderingContext2D:oy,CanvasGradient:ay,CanvasPattern:Ay,Image:Uu,ImageData:ly,Path2D:cy,DOMMatrix:hy,DOMRect:uy,DOMPoint:dy}=window;var Gu={Canvas:ny,loadImage:ry,CanvasRenderingContext2D:oy,CanvasGradient:ay,CanvasPattern:Ay,Image:Uu,ImageData:ly,Path2D:cy,DOMMatrix:hy,DOMRect:uy,DOMPoint:dy};const Hu=ri({__proto__:null,default:yo(Gu)},[Gu]);return Object.defineProperty(Pe,Symbol.toStringTag,{value:"Module"}),Pe}({});
|
1583
|
+
`],Bt([z({type:Object})],Ue.PlayerEmbed.prototype,"data",2),Bt([z({type:String})],Ue.PlayerEmbed.prototype,"vouchId",2),Bt([z({type:String})],Ue.PlayerEmbed.prototype,"templateId",2),Bt([z({type:Array})],Ue.PlayerEmbed.prototype,"questions",2),Bt([z({type:String})],Ue.PlayerEmbed.prototype,"env",2),Bt([z({type:String})],Ue.PlayerEmbed.prototype,"apiKey",2),Bt([z({type:Boolean})],Ue.PlayerEmbed.prototype,"disableTracking",2),Bt([z({type:String})],Ue.PlayerEmbed.prototype,"trackingSource",2),Bt([z({type:Array})],Ue.PlayerEmbed.prototype,"controls",2),Bt([z({type:String})],Ue.PlayerEmbed.prototype,"preload",2),Bt([z({type:Boolean})],Ue.PlayerEmbed.prototype,"autoplay",2),Bt([z({type:Number})],Ue.PlayerEmbed.prototype,"aspectRatio",2),Bt([ot()],Ue.PlayerEmbed.prototype,"vouch",2),Bt([ot()],Ue.PlayerEmbed.prototype,"template",2),Ue.PlayerEmbed=Bt([Ld("vouch-embed-player")],Ue.PlayerEmbed);function ei(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function Mu(s,e){for(var t="",i=0,r=-1,n=0,o,a=0;a<=s.length;++a){if(a<s.length)o=s.charCodeAt(a);else{if(o===47)break;o=47}if(o===47){if(!(r===a-1||n===1))if(r!==a-1&&n===2){if(t.length<2||i!==2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){var A=t.lastIndexOf("/");if(A!==t.length-1){A===-1?(t="",i=0):(t=t.slice(0,A),i=t.length-1-t.lastIndexOf("/")),r=a,n=0;continue}}else if(t.length===2||t.length===1){t="",i=0,r=a,n=0;continue}}e&&(t.length>0?t+="/..":t="..",i=2)}else t.length>0?t+="/"+s.slice(r+1,a):t=s.slice(r+1,a),i=a-r-1;r=a,n=0}else o===46&&n!==-1?++n:n=-1}return t}function WC(s,e){var t=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return t?t===e.root?t+i:t+s+i:i}var bs={resolve:function(){for(var e="",t=!1,i,r=arguments.length-1;r>=-1&&!t;r--){var n;r>=0?n=arguments[r]:(i===void 0&&(i=process.cwd()),n=i),ei(n),n.length!==0&&(e=n+"/"+e,t=n.charCodeAt(0)===47)}return e=Mu(e,!t),t?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(ei(e),e.length===0)return".";var t=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=Mu(e,!t),e.length===0&&!t&&(e="."),e.length>0&&i&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return ei(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,t=0;t<arguments.length;++t){var i=arguments[t];ei(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":bs.normalize(e)},relative:function(e,t){if(ei(e),ei(t),e===t||(e=bs.resolve(e),t=bs.resolve(t),e===t))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var r=e.length,n=r-i,o=1;o<t.length&&t.charCodeAt(o)===47;++o);for(var a=t.length,A=a-o,l=n<A?n:A,c=-1,h=0;h<=l;++h){if(h===l){if(A>l){if(t.charCodeAt(o+h)===47)return t.slice(o+h+1);if(h===0)return t.slice(o+h)}else n>l&&(e.charCodeAt(i+h)===47?c=h:h===0&&(c=0));break}var u=e.charCodeAt(i+h),d=t.charCodeAt(o+h);if(u!==d)break;u===47&&(c=h)}var g="";for(h=i+c+1;h<=r;++h)(h===r||e.charCodeAt(h)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+t.slice(o+c):(o+=c,t.charCodeAt(o)===47&&++o,t.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(ei(e),e.length===0)return".";for(var t=e.charCodeAt(0),i=t===47,r=-1,n=!0,o=e.length-1;o>=1;--o)if(t=e.charCodeAt(o),t===47){if(!n){r=o;break}}else n=!1;return r===-1?i?"/":".":i&&r===1?"//":e.slice(0,r)},basename:function(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ei(e);var i=0,r=-1,n=!0,o;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,A=-1;for(o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(l===47){if(!n){i=o+1;break}}else A===-1&&(n=!1,A=o+1),a>=0&&(l===t.charCodeAt(a)?--a===-1&&(r=o):(a=-1,r=A))}return i===r?r=A:r===-1&&(r=e.length),e.slice(i,r)}else{for(o=e.length-1;o>=0;--o)if(e.charCodeAt(o)===47){if(!n){i=o+1;break}}else r===-1&&(n=!1,r=o+1);return r===-1?"":e.slice(i,r)}},extname:function(e){ei(e);for(var t=-1,i=0,r=-1,n=!0,o=0,a=e.length-1;a>=0;--a){var A=e.charCodeAt(a);if(A===47){if(!n){i=a+1;break}continue}r===-1&&(n=!1,r=a+1),A===46?t===-1?t=a:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||r===-1||o===0||o===1&&t===r-1&&t===i+1?"":e.slice(t,r)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return WC("/",e)},parse:function(e){ei(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;var i=e.charCodeAt(0),r=i===47,n;r?(t.root="/",n=1):n=0;for(var o=-1,a=0,A=-1,l=!0,c=e.length-1,h=0;c>=n;--c){if(i=e.charCodeAt(c),i===47){if(!l){a=c+1;break}continue}A===-1&&(l=!1,A=c+1),i===46?o===-1?o=c:h!==1&&(h=1):o!==-1&&(h=-1)}return o===-1||A===-1||h===0||h===1&&o===A-1&&o===a+1?A!==-1&&(a===0&&r?t.base=t.name=e.slice(1,A):t.base=t.name=e.slice(a,A)):(a===0&&r?(t.name=e.slice(1,o),t.base=e.slice(1,A)):(t.name=e.slice(a,o),t.base=e.slice(a,A)),t.ext=e.slice(o,A)),a>0?t.dir=e.slice(0,a-1):r&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};bs.posix=bs;var qC=bs;const{basename:Pu,extname:jC}=qC;class XC{constructor(){let e=(()=>typeof Hr>"u")(),t="image/png",i="image/jpeg",r="image/jpeg",n="image/webp",o="application/pdf",a="image/svg+xml";Object.assign(this,{toMime:this.toMime.bind(this),fromMime:this.fromMime.bind(this),expected:e?'"png", "jpg", or "webp"':'"png", "jpg", "pdf", or "svg"',formats:e?{png:t,jpg:i,jpeg:r,webp:n}:{png:t,jpg:i,jpeg:r,pdf:o,svg:a},mimes:e?{[t]:"png",[i]:"jpg",[n]:"webp"}:{[t]:"png",[i]:"jpg",[o]:"pdf",[a]:"svg"}})}toMime(e){return this.formats[(e||"").replace(/^\./,"").toLowerCase()]}fromMime(e){return this.mimes[e]}}function zC(s,{filename:e="",extension:t="",format:f,page:r,quality:n,matte:o,density:a,outline:A,archive:d}={}){var{fromMime:c,toMime:h,expected:u}=new XC,d=d||"canvas",g=f||t.replace(/@\d+x$/i,"")||jC(e),f=c(h(g)||g),p=h(f),y=s.length;if(!g)throw new Error("Cannot determine image format (use a filename extension or 'format' argument)");if(!f)throw new Error(`Unsupported file format "${g}" (expected ${u})`);if(!y)throw new RangeError("Canvas has no associated contexts (try calling getContext or newPage first)");let B,Q,C=e.replace(/{(\d*)}/g,(b,L)=>(Q=!0,L=parseInt(L,10),B=isFinite(L)?L:isFinite(B)?B:-1,"{}")),T=r>0?r-1:r<0?y+r:void 0;if(isFinite(T)&&T<0||T>=y)throw new RangeError(y==1?`Canvas only has a ‘page 1’ (${T} is out of bounds)`:`Canvas has pages 1–${y} (${T} is out of bounds)`);if(s=isFinite(T)?[s[T]]:Q||f=="pdf"?s:s.slice(-1),n===void 0)n=.92;else if(typeof n!="number"||!isFinite(n)||n<0||n>1)throw new TypeError("The quality option must be an number in the 0.0–1.0 range");if(a===void 0){let b=(t||Pu(e,g)).match(/@(\d+)x$/i);a=b?parseInt(b[1],10):1}else if(typeof a!="number"||!Number.isInteger(a)||a<1)throw new TypeError("The density option must be a non-negative integer");return A===void 0?A=!0:f=="svg"&&(A=!!A),{filename:e,pattern:C,format:f,mime:p,pages:s,padding:B,quality:n,matte:o,density:a,outline:A,archive:d}}class Fn{static for(e){return new Fn().append(e).get()}constructor(){this.crc=-1}get(){return~this.crc}append(e){for(var t=this.crc|0,i=this.table,r=0,n=e.length|0;r<n;r++)t=t>>>8^i[(t^e[r])&255];return this.crc=t,this}}Fn.prototype.table=(()=>{var s,e,t,i=[];for(s=0;s<256;s++){for(t=s,e=0;e<8;e++)t=t&1?t>>>1^3988292384:t>>>1;i[s]=t}return i})();function Za(s){let e=new Uint8Array(s),t=new DataView(e.buffer),i={array:e,view:t,size:s,set8(r,n){return t.setUint8(r,n),i},set16(r,n){return t.setUint16(r,n,!0),i},set32(r,n){return t.setUint32(r,n,!0),i},bytes(r,n){return e.set(n,r),i}};return i}const Mn=class Mn{constructor(e){let t=new Date;Object.assign(this,{directory:e,offset:0,files:[],time:(t.getHours()<<6|t.getMinutes())<<5|t.getSeconds()/2,date:(t.getFullYear()-1980<<4|t.getMonth()+1)<<5|t.getDate()}),this.add(e)}async add(e,t){let i=!t,r=Mn.encoder.encode(`${this.directory}/${i?"":e}`),n=new Uint8Array(i?0:await t.arrayBuffer()),o=30+r.length,a=o+n.length,A=16,{offset:l}=this,c=Za(26).set32(0,134742036).set16(6,this.time).set16(8,this.date).set32(10,Fn.for(n)).set32(14,n.length).set32(18,n.length).set16(22,r.length);l+=o;let h=Za(o+n.length+A).set32(0,67324752).bytes(4,c.array).bytes(30,r).bytes(o,n);l+=n.length,h.set32(a,134695760).bytes(a+4,c.array.slice(10,22)),l+=A,this.files.push({offset:l,folder:i,name:r,header:c,payload:h}),this.offset=l}toBuffer(){let e=this.files.reduce((h,{name:u})=>46+u.length+h,0),t=Za(e+22),i=0;for(var{offset:r,name:n,header:o,folder:a}of this.files)t.set32(i,33639248).set16(i+4,20).bytes(i+6,o.array).set8(i+38,a?16:0).set32(i+42,r).bytes(i+46,n),i+=46+n.length;t.set32(i,101010256).set16(i+8,this.files.length).set16(i+10,this.files.length).set32(i+12,e).set32(i+16,this.offset);let A=new Uint8Array(this.offset+t.size),l=0;for(var{payload:c}of this.files)A.set(c.array,l),l+=c.size;return A.set(t.array,l),A}get blob(){return new Blob([this.toBuffer()],{type:"application/zip"})}};Zu(Mn,"encoder",new TextEncoder);let eA=Mn;const tA=(s,e,t,i)=>{if(i){let{width:r,height:n}=s,o=Object.assign(document.createElement("canvas"),{width:r,height:n}),a=o.getContext("2d");a.fillStyle=i,a.fillRect(0,0,r,n),a.drawImage(s,0,0),s=o}return new Promise((r,n)=>s.toBlob(r,e,t))},ZC=(...s)=>tA(...s).then(e=>e.arrayBuffer()),ey=async(s,e,t,i,r)=>{Ou(r,await tA(s,e,t,i))},ty=async(s,e,t,i,r,n,o)=>{let a=c=>n.replace("{}",String(c+1).padStart(o,"0")),A=Pu(r,".zip")||"archive",l=new eA(A);await Promise.all(s.map(async(c,h)=>{let u=a(h);await l.add(u,await tA(c,e,t,i))})),Ou(`${A}.zip`,l.blob)},Ou=(s,e)=>{const t=window.URL.createObjectURL(e),i=document.createElement("a");i.style.display="none",i.href=t,i.setAttribute("download",s),typeof i.download>"u"&&i.setAttribute("target","_blank"),document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(()=>window.URL.revokeObjectURL(t),100)};var iy={asBuffer:ZC,asDownload:ey,asZipDownload:ty,atScale:(s,e,t)=>s.map(i=>{if(e==1&&!t)return i.canvas;let r=document.createElement("canvas"),n=r.getContext("2d"),o=i.canvas?i.canvas:i;return r.width=o.width*e,r.height=o.height*e,t&&(n.fillStyle=t,n.fillRect(0,0,r.width,r.height)),n.scale(e,e),n.drawImage(o,0,0),r}),options:zC};const{asBuffer:iA,asDownload:sy,asZipDownload:ry,atScale:sA,options:rA}=iy,Uu=Symbol.for("toDataURL"),ny=s=>{let e=Object.assign(new Gu,{crossOrigin:"Anonymous",src:s});return e.decode().then(()=>e)};class oy{constructor(e,t){let i=document.createElement("canvas"),r=[];Object.defineProperty(i,"async",{value:!0,writable:!1,enumerable:!0});for(var[n,o]of Object.entries({png:()=>iA(i,"image/png"),jpg:()=>iA(i,"image/jpeg"),pages:()=>r.concat(i).map(a=>a.getContext("2d"))}))Object.defineProperty(i,n,{get:o});return Object.assign(i,{width:e,height:t,newPage(...a){var{width:l,height:c}=i,A=Object.assign(document.createElement("canvas"),{width:l,height:c});A.getContext("2d").drawImage(i,0,0),r.push(A);var[l,c]=a.length?a:[l,c];return Object.assign(i,{width:l,height:c}).getContext("2d")},saveAs(a,A){A=typeof A=="number"?{quality:A}:A;let l=rA(this.pages,{filename:a,...A}),{pattern:c,padding:h,mime:u,quality:d,matte:g,density:f,archive:p}=l,y=sA(l.pages,f);return h==null?sy(y[0],u,d,g,a):ry(y,u,d,g,p,c,h)},toBuffer(a="png",A={}){A=typeof A=="number"?{quality:A}:A;let l=rA(this.pages,{extension:a,...A}),{mime:c,quality:h,matte:u,pages:d,density:g}=l,f=sA(d,g,u)[0];return iA(f,c,h,u)},[Uu]:i.toDataURL.bind(i),toDataURL(a="png",A={}){A=typeof A=="number"?{quality:A}:A;let l=rA(this.pages,{extension:a,...A}),{mime:c,quality:h,matte:u,pages:d,density:g}=l,f=sA(d,g,u)[0],p=f[f===i?Uu:"toDataURL"](c,h);return Promise.resolve(p)}})}}const{CanvasRenderingContext2D:ay,CanvasGradient:Ay,CanvasPattern:ly,Image:Gu,ImageData:cy,Path2D:hy,DOMMatrix:uy,DOMRect:dy,DOMPoint:gy}=window;var Hu={Canvas:oy,loadImage:ny,CanvasRenderingContext2D:ay,CanvasGradient:Ay,CanvasPattern:ly,Image:Gu,ImageData:cy,Path2D:hy,DOMMatrix:uy,DOMRect:dy,DOMPoint:gy};const $u=ri({__proto__:null,default:yo(Hu)},[Hu]);return Object.defineProperty(Ue,Symbol.toStringTag,{value:"Module"}),Ue}({});
|
1584
1584
|
//# sourceMappingURL=embed.iife.js.map
|