@mux/mux-player 3.3.4-canary.2 → 3.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1237,7 +1237,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1237
1237
  </style>
1238
1238
  <slot></slot>
1239
1239
  <div id="arrow"></div>
1240
- `;var Js=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Cr(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ue(this,"#"+this.bounds))!=null?e:q(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,T=n+s,_=a.getPropertyValue("--media-tooltip-offset-x"),p=_?parseFloat(_.replace("px","")):0,E=a.getPropertyValue("--media-tooltip-container-margin"),P=E?parseFloat(E.replace("px","")):0,y=l-n+p-P,w=c-T+p+P;if(y<0){this.style.setProperty("--media-tooltip-offset-x",`${y}px`);return}if(w>0){this.style.setProperty("--media-tooltip-offset-x",`${w}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Bc.content.cloneNode(!0))),this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[$i.PLACEMENT,$i.BOUNDS]}get placement(){return C(this,$i.PLACEMENT)}set placement(e){M(this,$i.PLACEMENT,e)}get bounds(){return C(this,$i.BOUNDS)}set bounds(e){M(this,$i.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",Js);var sf=1,lf=i=>i.mediaMuted?0:i.mediaVolume,df=i=>`${Math.round(i*100)}%`,js=class extends Zt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new d.CustomEvent(f.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",v("volume"))}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=lf(this),this.range.setAttribute("aria-valuetext",df(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return x(this,o.MEDIA_VOLUME,sf)}set mediaVolume(e){N(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return S(this,o.MEDIA_MUTED)}set mediaMuted(e){I(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return C(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",js);var b=gh(require("@mux/mux-video")),R=require("@mux/playback-core");var Zc=require("@mux/mux-video");var Kc=require("@mux/playback-core");var ei=require("@mux/playback-core");function Hc(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${Pn(t)}: ${a}; `)}),e?e.trim():void 0}function Pn(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Un(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function de(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function el(i){let e=uf(i).toString();return e?"?"+e:""}function uf(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var tl=(i,e)=>!i||!e?!1:i.contains(e)?!0:tl(i,e.getRootNode().host);var $c="mux.com",cf=()=>{try{return"3.3.3"}catch{}return"UNKNOWN"},mf=cf(),Hn=()=>mf,Wc=(i,{token:e,customDomain:t=$c,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ei.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${t}/${i}/thumbnail.webp${el({token:e,time:n,program_time:r})}`},Fc=(i,{token:e,customDomain:t=$c,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ei.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${el({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ha=i=>{if(i){if([ei.StreamTypes.LIVE,ei.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return ei.StreamTypes.LIVE}};var hf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Vc(i){var e;return(e=hf[i])!=null?e:Un(i)}var Jt,jt,ue,Bn=class{constructor(e,t){me(this,Jt);me(this,jt);me(this,ue,[]);Ae(this,Jt,e),Ae(this,jt,t)}[Symbol.iterator](){return B(this,ue).values()}get length(){return B(this,ue).length}get value(){var e;return(e=B(this,ue).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ae(this,ue,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return B(this,ue)[e]}values(){return B(this,ue).values()}keys(){return B(this,ue).keys()}forEach(e){B(this,ue).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||B(this,ue).push(r)}),!(this.value===""&&!((t=B(this,Jt))!=null&&t.hasAttribute(`${B(this,jt)}`)))&&((a=B(this,Jt))==null||a.setAttribute(`${B(this,jt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{B(this,ue).splice(B(this,ue).indexOf(a),1)}),(t=B(this,Jt))==null||t.setAttribute(`${B(this,jt)}`,`${this.value}`)}contains(e){return B(this,ue).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};Jt=new WeakMap,jt=new WeakMap,ue=new WeakMap;var Gc=`[mux-player ${Hn()}]`;function ze(...i){console.warn(Gc,...i)}function ve(...i){console.error(Gc,...i)}function il(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${(0,Kc.i18n)("Read more: ")}
1240
+ `;var Js=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Cr(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ue(this,"#"+this.bounds))!=null?e:q(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,T=n+s,_=a.getPropertyValue("--media-tooltip-offset-x"),p=_?parseFloat(_.replace("px","")):0,E=a.getPropertyValue("--media-tooltip-container-margin"),P=E?parseFloat(E.replace("px","")):0,y=l-n+p-P,w=c-T+p+P;if(y<0){this.style.setProperty("--media-tooltip-offset-x",`${y}px`);return}if(w>0){this.style.setProperty("--media-tooltip-offset-x",`${w}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Bc.content.cloneNode(!0))),this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[$i.PLACEMENT,$i.BOUNDS]}get placement(){return C(this,$i.PLACEMENT)}set placement(e){M(this,$i.PLACEMENT,e)}get bounds(){return C(this,$i.BOUNDS)}set bounds(e){M(this,$i.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",Js);var sf=1,lf=i=>i.mediaMuted?0:i.mediaVolume,df=i=>`${Math.round(i*100)}%`,js=class extends Zt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new d.CustomEvent(f.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",v("volume"))}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=lf(this),this.range.setAttribute("aria-valuetext",df(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return x(this,o.MEDIA_VOLUME,sf)}set mediaVolume(e){N(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return S(this,o.MEDIA_MUTED)}set mediaMuted(e){I(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return C(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",js);var b=gh(require("@mux/mux-video")),R=require("@mux/playback-core");var Zc=require("@mux/mux-video");var Kc=require("@mux/playback-core");var ei=require("@mux/playback-core");function Hc(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${Pn(t)}: ${a}; `)}),e?e.trim():void 0}function Pn(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Un(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function de(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function el(i){let e=uf(i).toString();return e?"?"+e:""}function uf(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var tl=(i,e)=>!i||!e?!1:i.contains(e)?!0:tl(i,e.getRootNode().host);var $c="mux.com",cf=()=>{try{return"3.3.4"}catch{}return"UNKNOWN"},mf=cf(),Hn=()=>mf,Wc=(i,{token:e,customDomain:t=$c,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ei.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${t}/${i}/thumbnail.webp${el({token:e,time:n,program_time:r})}`},Fc=(i,{token:e,customDomain:t=$c,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ei.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${el({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ha=i=>{if(i){if([ei.StreamTypes.LIVE,ei.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return ei.StreamTypes.LIVE}};var hf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Vc(i){var e;return(e=hf[i])!=null?e:Un(i)}var Jt,jt,ue,Bn=class{constructor(e,t){me(this,Jt);me(this,jt);me(this,ue,[]);Ae(this,Jt,e),Ae(this,jt,t)}[Symbol.iterator](){return B(this,ue).values()}get length(){return B(this,ue).length}get value(){var e;return(e=B(this,ue).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ae(this,ue,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return B(this,ue)[e]}values(){return B(this,ue).values()}keys(){return B(this,ue).keys()}forEach(e){B(this,ue).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||B(this,ue).push(r)}),!(this.value===""&&!((t=B(this,Jt))!=null&&t.hasAttribute(`${B(this,jt)}`)))&&((a=B(this,Jt))==null||a.setAttribute(`${B(this,jt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{B(this,ue).splice(B(this,ue).indexOf(a),1)}),(t=B(this,Jt))==null||t.setAttribute(`${B(this,jt)}`,`${this.value}`)}contains(e){return B(this,ue).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};Jt=new WeakMap,jt=new WeakMap,ue=new WeakMap;var Gc=`[mux-player ${Hn()}]`;function ze(...i){console.warn(Gc,...i)}function ve(...i){console.error(Gc,...i)}function il(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${(0,Kc.i18n)("Read more: ")}
1241
1241
  https://github.com/muxinc/elements/blob/main/errors/${i.file}`),ze(e)}var se={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ti={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},qc=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),pf=Zc.VideoEvents.filter(i=>i!=="error"),ff=Object.values(se).filter(i=>![se.PLAYSINLINE].includes(i)),vf=Object.values(ti),al=class extends he.HTMLElement{static get observedAttributes(){return[...ff,...vf]}constructor(){super()}init(){pf.forEach(e=>{var t;(t=this.media)==null||t.addEventListener(e,a=>{this.dispatchEvent(new Event(a.type))})})}attributeChangedCallback(e,t,a){var r,n;switch(e){case ti.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ti.VOLUME:{let s=(r=de(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ti.PLAYBACKRATE:{let s=(n=de(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:qc}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:qc}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentSrc(){var e,t;return(t=(e=this.media)==null?void 0:e.currentSrc)!=null?t:""}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=de(this.getAttribute(ti.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ti.PLAYBACKRATE,`${e}`):this.removeAttribute(ti.PLAYBACKRATE)}get crossOrigin(){return $a(this,se.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(se.CROSSORIGIN,`${e}`)}get autoplay(){return $a(this,se.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(se.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(se.AUTOPLAY)}get loop(){return $a(this,se.LOOP)!=null}set loop(e){e?this.setAttribute(se.LOOP,""):this.removeAttribute(se.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return $a(this,se.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(se.MUTED,""):this.removeAttribute(se.MUTED)}get playsInline(){return $a(this,se.PLAYSINLINE)!=null}set playsInline(e){ve("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(se.PRELOAD,e):this.removeAttribute(se.PRELOAD)}};function $a(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var rl=al;var jc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},D=(i,e,t)=>(jc(i,e,"read from private field"),t?t.call(i):e.get(i)),Qe=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},mt=(i,e,t,a)=>(jc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Wi,$n,ii,Wa,It,Ct,Mt,ai,Fi,Wn,Oe,zc=1,Qc=0,Ef=1,bf={processCallback(i,e,t){if(t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof ce&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof ce?r.element[r.attributeName]=n:r.value=n}}}},ht=class extends d.DocumentFragment{constructor(e,t,a=bf){var r;super(),Qe(this,Wi,void 0),Qe(this,$n,void 0),this.append(e.content.cloneNode(!0)),mt(this,Wi,em(this)),mt(this,$n,a),(r=a.createCallback)==null||r.call(a,this,D(this,Wi),t),a.processCallback(this,D(this,Wi),t)}update(e){D(this,$n).processCallback(this,D(this,Wi),e)}};Wi=new WeakMap;$n=new WeakMap;var em=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new nl;for([t,a]of Jc(r.value))if(!t)n.append(a);else{let s=new ce(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===zc&&!(r instanceof HTMLTemplateElement))em(r,e);else{let n=r.data;if(r.nodeType===zc||n.includes("{{")){let s=[];if(n)for([t,a]of Jc(n))if(!t)s.push(new Text(a));else{let l=new pt(i);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new Fa(i,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},Xc={},Jc=i=>{let e="",t=0,a=Xc[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([Qc,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Ef,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Qc,(t>0?"{{":"")+e]),Xc[i]=a},gf=11,Fn=class{get value(){return""}set value(e){}toString(){return this.value}},tm=new WeakMap,nl=class{constructor(){Qe(this,ii,[])}[Symbol.iterator](){return D(this,ii).values()}get length(){return D(this,ii).length}item(e){return D(this,ii)[e]}append(...e){for(let t of e)t instanceof ce&&tm.set(t,this),D(this,ii).push(t)}toString(){return D(this,ii).join("")}};ii=new WeakMap;var ce=class extends Fn{constructor(e,t,a){super(),Qe(this,ai),Qe(this,Wa,""),Qe(this,It,void 0),Qe(this,Ct,void 0),Qe(this,Mt,void 0),mt(this,It,e),mt(this,Ct,t),mt(this,Mt,a)}get attributeName(){return D(this,Ct)}get attributeNamespace(){return D(this,Mt)}get element(){return D(this,It)}get value(){return D(this,Wa)}set value(e){D(this,Wa)!==e&&(mt(this,Wa,e),!D(this,ai,Fi)||D(this,ai,Fi).length===1?e==null?D(this,It).removeAttributeNS(D(this,Mt),D(this,Ct)):D(this,It).setAttributeNS(D(this,Mt),D(this,Ct),e):D(this,It).setAttributeNS(D(this,Mt),D(this,Ct),D(this,ai,Fi).toString()))}get booleanValue(){return D(this,It).hasAttributeNS(D(this,Mt),D(this,Ct))}set booleanValue(e){if(!D(this,ai,Fi)||D(this,ai,Fi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Wa=new WeakMap;It=new WeakMap;Ct=new WeakMap;Mt=new WeakMap;ai=new WeakSet;Fi=function(){return tm.get(this)};var pt=class extends Fn{constructor(e,t){super(),Qe(this,Wn,void 0),Qe(this,Oe,void 0),mt(this,Wn,e),mt(this,Oe,t?[...t]:[new Text])}get replacementNodes(){return D(this,Oe)}get parentNode(){return D(this,Wn)}get nextSibling(){return D(this,Oe)[D(this,Oe).length-1].nextSibling}get previousSibling(){return D(this,Oe)[0].previousSibling}get value(){return D(this,Oe).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===gf?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),mt(this,Oe,_f(D(this,Oe)[0].parentNode,D(this,Oe),t,this.nextSibling))}};Wn=new WeakMap;Oe=new WeakMap;var Fa=class extends pt{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=t,this.directive=a}};function _f(i,e,t,a=null){let r=0,n,s,l,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)l=t[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&t[r]==s?(i.replaceChild(l,n),n=s):i.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var im={string:i=>String(i)},Kn=class{constructor(e){this.template=e,this.state=void 0}},ri=new WeakMap,ni=new WeakMap,ol={partial:(i,e)=>{e[i.expression]=new Kn(i.template)},if:(i,e)=>{var t;if(rm(i.expression,e))if(ri.get(i)!==i.template){ri.set(i,i.template);let a=new ht(i.template,e,Gn);i.replace(a),ni.set(i,a)}else(t=ni.get(i))==null||t.update(e);else i.replace(""),ri.delete(i),ni.delete(i)}},Af=Object.keys(ol),Gn={processCallback(i,e,t){var a,r;if(t)for(let[n,s]of e){if(s instanceof Fa){if(!s.directive){let u=Af.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=ol[s.directive])==null||a.call(ol,s,t);continue}let l=rm(n,t);if(l instanceof Kn){ri.get(s)!==l.template?(ri.set(s,l.template),l=new ht(l.template,l.state,Gn),s.value=l,ni.set(s,l)):(r=ni.get(s))==null||r.update(l.state);continue}l?(s instanceof ce&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof ce?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,ri.delete(s),ni.delete(s))):s instanceof ce?s.value=void 0:(s.value=void 0,ri.delete(s),ni.delete(s))}}},am={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=im[e])==null?void 0:t.call(im,i)}};function Tf(i){return yf(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function rm(i,e={}){var t,a,r,n,s,l,u;let c=Tf(i);if(c.length===0||c.some(({type:T})=>!T))return Va(i);if(((t=c[0])==null?void 0:t.token)===">"){let T=e[(a=c[1])==null?void 0:a.token];if(!T)return Va(i);let _={...e};T.state=_;let p=c.slice(2);for(let E=0;E<p.length;E+=3){let P=(r=p[E])==null?void 0:r.token,y=(n=p[E+1])==null?void 0:n.token,w=(s=p[E+2])==null?void 0:s.token;P&&y==="="&&(_[P]=Ka(w,e))}return T}if(c.length===1)return Vn(c[0])?Ka(c[0].token,e):Va(i);if(c.length===2){let T=(l=c[0])==null?void 0:l.token,_=am[T];if(!_||!Vn(c[1]))return Va(i);let p=Ka(c[1].token,e);return _(p)}if(c.length===3){let T=(u=c[1])==null?void 0:u.token,_=am[T];if(!_||!Vn(c[0])||!Vn(c[2]))return Va(i);let p=Ka(c[0].token,e);if(T==="|")return _(p,c[2].token);let E=Ka(c[2].token,e);return _(p,E)}}function Va(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Vn({type:i}){return["number","boolean","string","param"].includes(i)}function Ka(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):gr(i)?parseFloat(i):e[i]}function yf(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var ml=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},dl=(i,e,t)=>(ml(i,e,"read from private field"),t?t.call(i):e.get(i)),Ga=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},oi=(i,e,t,a)=>(ml(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),sl=(i,e,t)=>(ml(i,e,"access private method"),t),Vi,Yn,Ki,ul,nm,qn,cl,ll={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},om=h.createElement("template");om.innerHTML=`
1242
1242
  <style>
1243
1243
  :host {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var ze=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||ze("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),T=(t,a,e)=>a.has(t)?ze("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),k=(t,a,e,i)=>(he(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),b=(t,a,e)=>(he(t,a,"access private method"),e);var $=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends ${}globalThis.DocumentFragment=t}var G=class extends ${},ge=class extends ${},St={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,fe=class{constructor(a,e={}){T(this,j);k(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function wt(t,a){return new G}var Xe={document:{createElement:wt},DocumentFragment,customElements:St,CustomEvent:fe,EventTarget:$,HTMLElement:G,HTMLVideoElement:ge},qe=typeof window=="undefined"||typeof globalThis.customElements=="undefined",E=qe?Xe:globalThis,Y=qe?Xe.document:globalThis.document;import{MediaController as ma,MediaErrorDialog as Rt}from"media-chrome";import{Attributes as Oe}from"media-chrome/dist/media-container.js";import{MediaUIAttributes as Tt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import ca,{MediaError as Q,Attributes as s}from"@mux/mux-video";import{StreamTypes as M,PlaybackTypes as be,addTextTrack as pa,removeTextTrack as ba,CmcdTypeValues as Et,i18n as U,parseJwt as Me,MuxJWTAud as Le,generatePlayerInitTime as ha}from"@mux/playback-core";import{VideoEvents as Kt}from"@mux/mux-video";import{i18n as Ut}from"@mux/playback-core";import{StreamTypes as Te,parseJwt as Qe}from"@mux/playback-core";function Je(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${ne(e)}: ${i}; `)}),a?a.trim():void 0}function ne(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function se(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function y(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function ye(t){let a=Pt(t).toString();return a?"?"+a:""}function Pt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var ve=(t,a)=>!t||!a?!1:t.contains(a)?!0:ve(t,a.getRootNode().host);var et="mux.com",It=()=>{try{return"3.3.3"}catch{}return"UNKNOWN"},Dt=It(),le=()=>Dt,tt=(t,{token:a,customDomain:e=et,thumbnailTime:i,programTime:r}={})=>{var l;let n=a==null?i:void 0,{aud:d}=(l=Qe(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${ye({token:a,time:n,program_time:r})}`},at=(t,{token:a,customDomain:e=et,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=Qe(a))!=null?d:{};if(!(a&&n!=="s"))return`https://image.${e}/${t}/storyboard.vtt${ye({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},z=t=>{if(t){if([Te.LIVE,Te.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Te.LIVE}};var Vt={crossorigin:"crossOrigin",playsinline:"playsInline"};function it(t){var a;return(a=Vt[t])!=null?a:se(t)}var P,I,v,de=class{constructor(a,e){T(this,P);T(this,I);T(this,v,[]);k(this,P,a),k(this,I,e)}[Symbol.iterator](){return u(this,v).values()}get length(){return u(this,v).length}get value(){var a;return(a=u(this,v).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(k(this,v,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,v)[a]}values(){return u(this,v).values()}keys(){return u(this,v).keys()}forEach(a){u(this,v).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,v).push(r)}),!(this.value===""&&!((e=u(this,P))!=null&&e.hasAttribute(`${u(this,I)}`)))&&((i=u(this,P))==null||i.setAttribute(`${u(this,I)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,v).splice(u(this,v).indexOf(i),1)}),(e=u(this,P))==null||e.setAttribute(`${u(this,I)}`,`${this.value}`)}contains(a){return u(this,v).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};P=new WeakMap,I=new WeakMap,v=new WeakMap;var rt=`[mux-player ${le()}]`;function O(...t){console.warn(rt,...t)}function A(...t){console.error(rt,...t)}function Ee(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Ut("Read more: ")}
1
+ var ze=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||ze("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),T=(t,a,e)=>a.has(t)?ze("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),k=(t,a,e,i)=>(he(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),b=(t,a,e)=>(he(t,a,"access private method"),e);var $=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends ${}globalThis.DocumentFragment=t}var G=class extends ${},ge=class extends ${},St={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,fe=class{constructor(a,e={}){T(this,j);k(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function wt(t,a){return new G}var Xe={document:{createElement:wt},DocumentFragment,customElements:St,CustomEvent:fe,EventTarget:$,HTMLElement:G,HTMLVideoElement:ge},qe=typeof window=="undefined"||typeof globalThis.customElements=="undefined",E=qe?Xe:globalThis,Y=qe?Xe.document:globalThis.document;import{MediaController as ma,MediaErrorDialog as Rt}from"media-chrome";import{Attributes as Oe}from"media-chrome/dist/media-container.js";import{MediaUIAttributes as Tt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import ca,{MediaError as Q,Attributes as s}from"@mux/mux-video";import{StreamTypes as M,PlaybackTypes as be,addTextTrack as pa,removeTextTrack as ba,CmcdTypeValues as Et,i18n as U,parseJwt as Me,MuxJWTAud as Le,generatePlayerInitTime as ha}from"@mux/playback-core";import{VideoEvents as Kt}from"@mux/mux-video";import{i18n as Ut}from"@mux/playback-core";import{StreamTypes as Te,parseJwt as Qe}from"@mux/playback-core";function Je(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${ne(e)}: ${i}; `)}),a?a.trim():void 0}function ne(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function se(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function y(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function ye(t){let a=Pt(t).toString();return a?"?"+a:""}function Pt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var ve=(t,a)=>!t||!a?!1:t.contains(a)?!0:ve(t,a.getRootNode().host);var et="mux.com",It=()=>{try{return"3.3.4"}catch{}return"UNKNOWN"},Dt=It(),le=()=>Dt,tt=(t,{token:a,customDomain:e=et,thumbnailTime:i,programTime:r}={})=>{var l;let n=a==null?i:void 0,{aud:d}=(l=Qe(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${ye({token:a,time:n,program_time:r})}`},at=(t,{token:a,customDomain:e=et,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=Qe(a))!=null?d:{};if(!(a&&n!=="s"))return`https://image.${e}/${t}/storyboard.vtt${ye({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},z=t=>{if(t){if([Te.LIVE,Te.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Te.LIVE}};var Vt={crossorigin:"crossOrigin",playsinline:"playsInline"};function it(t){var a;return(a=Vt[t])!=null?a:se(t)}var P,I,v,de=class{constructor(a,e){T(this,P);T(this,I);T(this,v,[]);k(this,P,a),k(this,I,e)}[Symbol.iterator](){return u(this,v).values()}get length(){return u(this,v).length}get value(){var a;return(a=u(this,v).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(k(this,v,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,v)[a]}values(){return u(this,v).values()}keys(){return u(this,v).keys()}forEach(a){u(this,v).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,v).push(r)}),!(this.value===""&&!((e=u(this,P))!=null&&e.hasAttribute(`${u(this,I)}`)))&&((i=u(this,P))==null||i.setAttribute(`${u(this,I)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,v).splice(u(this,v).indexOf(i),1)}),(e=u(this,P))==null||e.setAttribute(`${u(this,I)}`,`${this.value}`)}contains(a){return u(this,v).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};P=new WeakMap,I=new WeakMap,v=new WeakMap;var rt=`[mux-player ${le()}]`;function O(...t){console.warn(rt,...t)}function A(...t){console.error(rt,...t)}function Ee(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Ut("Read more: ")}
2
2
  https://github.com/muxinc/elements/blob/main/errors/${t.file}`),O(a)}var f={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},D={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},nt=Object.freeze({length:0,start(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Ht=Kt.filter(t=>t!=="error"),Bt=Object.values(f).filter(t=>![f.PLAYSINLINE].includes(t)),$t=Object.values(D),Ae=class extends E.HTMLElement{static get observedAttributes(){return[...Bt,...$t]}constructor(){super()}init(){Ht.forEach(a=>{var e;(e=this.media)==null||e.addEventListener(a,i=>{this.dispatchEvent(new Event(i.type))})})}attributeChangedCallback(a,e,i){var r,n;switch(a){case D.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case D.VOLUME:{let d=(r=y(i))!=null?r:1;this.media&&(this.media.volume=d);return}case D.PLAYBACKRATE:{let d=(n=y(i))!=null?n:1;this.media&&(this.media.playbackRate=d,this.media.defaultPlaybackRate=d);return}}}play(){var a,e;return(e=(a=this.media)==null?void 0:a.play())!=null?e:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}load(){var a;(a=this.media)==null||a.load()}requestCast(a){var e;return(e=this.media)==null?void 0:e.requestCast(a)}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var a,e;return(e=(a=this.media)==null?void 0:a.paused)!=null?e:!0}get duration(){var a,e;return(e=(a=this.media)==null?void 0:a.duration)!=null?e:NaN}get ended(){var a,e;return(e=(a=this.media)==null?void 0:a.ended)!=null?e:!1}get buffered(){var a,e;return(e=(a=this.media)==null?void 0:a.buffered)!=null?e:nt}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:nt}get readyState(){var a,e;return(e=(a=this.media)==null?void 0:a.readyState)!=null?e:0}get videoWidth(){var a,e;return(e=(a=this.media)==null?void 0:a.videoWidth)!=null?e:0}get videoHeight(){var a,e;return(e=(a=this.media)==null?void 0:a.videoHeight)!=null?e:0}get currentSrc(){var a,e;return(e=(a=this.media)==null?void 0:a.currentSrc)!=null?e:""}get currentTime(){var a,e;return(e=(a=this.media)==null?void 0:a.currentTime)!=null?e:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,e;return(e=(a=this.media)==null?void 0:a.volume)!=null?e:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,e;return(e=(a=this.media)==null?void 0:a.playbackRate)!=null?e:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=y(this.getAttribute(D.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(D.PLAYBACKRATE,`${a}`):this.removeAttribute(D.PLAYBACKRATE)}get crossOrigin(){return X(this,f.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(f.CROSSORIGIN,`${a}`)}get autoplay(){return X(this,f.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(f.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(f.AUTOPLAY)}get loop(){return X(this,f.LOOP)!=null}set loop(a){a?this.setAttribute(f.LOOP,""):this.removeAttribute(f.LOOP)}get muted(){var a,e;return(e=(a=this.media)==null?void 0:a.muted)!=null?e:!1}set muted(a){this.media&&(this.media.muted=!!a)}get defaultMuted(){return X(this,f.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(f.MUTED,""):this.removeAttribute(f.MUTED)}get playsInline(){return X(this,f.PLAYSINLINE)!=null}set playsInline(a){A("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(a){["","none","metadata","auto"].includes(a)?this.setAttribute(f.PRELOAD,a):this.removeAttribute(f.PRELOAD)}};function X(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Ce=Ae;import"media-chrome/dist/media-theme-element.js";var st=`:host {
3
3
  --media-control-display: var(--controls);
4
4
  --media-loading-indicator-display: var(--loading-indicator);
@@ -1288,7 +1288,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1288
1288
  `:""}${i.error?`error: ${i.error}
1289
1289
  `:""}${i.event?`event: ${i.event}
1290
1290
  `:""}${i.err?`error message: ${(s=i.err)==null?void 0:s.message}
1291
- `:""}`),l.data=i,l};var _w=Object.defineProperty,Aw=Object.getPrototypeOf,Sw=Reflect.get,fT=i=>{throw TypeError(i)},xw=(i,e,t)=>e in i?_w(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Le=(i,e,t)=>xw(i,typeof e!="symbol"?e+"":e,t),xp=(i,e,t)=>e.has(i)||fT("Cannot "+t),I=(i,e,t)=>(xp(i,e,"read from private field"),t?t.call(i):e.get(i)),ne=(i,e,t)=>e.has(i)?fT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),J=(i,e,t,r)=>(xp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Fe=(i,e,t)=>(xp(i,e,"access private method"),t),op=(i,e,t)=>Sw(Aw(i),t,e),bu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends bu{}globalThis.DocumentFragment=i}var Rp=class extends bu{},Rw=class extends bu{},Iw={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Rp)}},au,kw=class{constructor(i,e={}){ne(this,au),J(this,au,e==null?void 0:e.detail)}get detail(){return I(this,au)}initCustomEvent(){}};au=new WeakMap;function Lw(i,e){return new Rp}var mT={document:{createElement:Lw},DocumentFragment,customElements:Iw,CustomEvent:kw,EventTarget:bu,HTMLElement:Rp,HTMLVideoElement:Rw},pT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",lp=pT?mT:globalThis,zN=pT?mT.document:globalThis.document,ww=()=>{try{return"0.25.0"}catch{}return"UNKNOWN"},Dw=ww(),Cw=()=>Dw,yu=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],gT=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function Mw(i){return`
1291
+ `:""}`),l.data=i,l};var _w=Object.defineProperty,Aw=Object.getPrototypeOf,Sw=Reflect.get,fT=i=>{throw TypeError(i)},xw=(i,e,t)=>e in i?_w(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Le=(i,e,t)=>xw(i,typeof e!="symbol"?e+"":e,t),xp=(i,e,t)=>e.has(i)||fT("Cannot "+t),I=(i,e,t)=>(xp(i,e,"read from private field"),t?t.call(i):e.get(i)),ne=(i,e,t)=>e.has(i)?fT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),J=(i,e,t,r)=>(xp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Fe=(i,e,t)=>(xp(i,e,"access private method"),t),op=(i,e,t)=>Sw(Aw(i),t,e),bu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends bu{}globalThis.DocumentFragment=i}var Rp=class extends bu{},Rw=class extends bu{},Iw={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Rp)}},au,kw=class{constructor(i,e={}){ne(this,au),J(this,au,e==null?void 0:e.detail)}get detail(){return I(this,au)}initCustomEvent(){}};au=new WeakMap;function Lw(i,e){return new Rp}var mT={document:{createElement:Lw},DocumentFragment,customElements:Iw,CustomEvent:kw,EventTarget:bu,HTMLElement:Rp,HTMLVideoElement:Rw},pT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",lp=pT?mT:globalThis,zN=pT?mT.document:globalThis.document,ww=()=>{try{return"0.25.1"}catch{}return"UNKNOWN"},Dw=ww(),Cw=()=>Dw,yu=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],gT=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function Mw(i){return`
1292
1292
  <style>
1293
1293
  :host {
1294
1294
  display: inline-flex;
@@ -1358,7 +1358,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1358
1358
  `:"";return`
1359
1359
  ${e}
1360
1360
  ${n}
1361
- `}get preferCmcd(){var i;return(i=this.getAttribute(w.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?In.includes(i)?this.setAttribute(w.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${In.join()}`):this.removeAttribute(w.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(w.PLAYER_INIT_TIME)?+this.getAttribute(w.PLAYER_INIT_TIME):I(this,uu)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(w.PLAYER_INIT_TIME):this.setAttribute(w.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=I(this,mu))!=null?i:hT}set playerSoftwareName(i){J(this,mu,i)}get playerSoftwareVersion(){var i;return(i=I(this,fu))!=null?i:cT}set playerSoftwareVersion(i){J(this,fu,i)}get _hls(){var i;return(i=I(this,Pi))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=rp(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,pu)}set errorTranslator(i){J(this,pu,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(w.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(w.TYPE,i):this.removeAttribute(w.TYPE))}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(w.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(w.DEBUG,""):this.removeAttribute(w.DEBUG))}get disableTracking(){return this.hasAttribute(w.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(w.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(w.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(w.DISABLE_COOKIES,""):this.removeAttribute(w.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(w.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(w.START_TIME):this.setAttribute(w.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(w.PLAYBACK_ID)?this.getAttribute(w.PLAYBACK_ID):(i=ip(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(w.PLAYBACK_ID,i):this.removeAttribute(w.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(w.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(w.MAX_RESOLUTION,i):this.removeAttribute(w.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(w.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(w.MIN_RESOLUTION,i):this.removeAttribute(w.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(w.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(w.RENDITION_ORDER,i):this.removeAttribute(w.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(w.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(w.PROGRAM_START_TIME):this.setAttribute(w.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(w.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(w.PROGRAM_END_TIME):this.setAttribute(w.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(w.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(w.ASSET_START_TIME):this.setAttribute(w.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(w.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(w.ASSET_END_TIME):this.setAttribute(w.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(w.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(w.CUSTOM_DOMAIN,i):this.removeAttribute(w.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(w.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(w.DRM_TOKEN,i):this.removeAttribute(w.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(w.PLAYBACK_TOKEN))return(i=this.getAttribute(w.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(w.PLAYBACK_ID)){let[,s]=eu((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(s).get("token"))!=null?t:void 0}if(this.src)return(r=new URLSearchParams(this.src).get("token"))!=null?r:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(w.PLAYBACK_TOKEN,i):this.removeAttribute(w.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(w.PLAYBACK_TOKEN),e=this.getAttribute(w.DRM_TOKEN);return{...I(this,cu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){J(this,cu,i!=null?i:{})}get ended(){return np(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(w.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(w.ENV_KEY,i):this.removeAttribute(w.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(w.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(w.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(w.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(w.STREAM_TYPE))!=null?i:Jd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(w.STREAM_TYPE,i):this.removeAttribute(w.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(w.TARGET_LIVE_WINDOW)?+this.getAttribute(w.TARGET_LIVE_WINDOW):jy(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(w.TARGET_LIVE_WINDOW):this.setAttribute(w.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(w.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,r=(i=this.nativeEl.seekable.end(0))!=null?i:0,s=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(s,r-t)}return zy(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(w.LIVE_EDGE_OFFSET))return+this.getAttribute(w.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(w.LIVE_EDGE_OFFSET):this.setAttribute(w.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return nu(this.nativeEl)}async addCuePoints(i){return Qm(this.nativeEl,i)}get activeCuePoint(){return Zm(this.nativeEl)}get cuePoints(){return $y(this.nativeEl)}async addChapters(i){return ep(this.nativeEl,i)}get activeChapter(){return tp(this.nativeEl)}get chapters(){return Gy(this.nativeEl)}getStartDate(){return Ky(this.nativeEl,this._hls)}get currentPdt(){return Vy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(w.PREFER_PLAYBACK);if(i===jt.MSE||i===jt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===jt.MSE||i===jt.NATIVE?this.setAttribute(w.PREFER_PLAYBACK,i):this.removeAttribute(w.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![w.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...I(this,Za)}}set metadata(i){J(this,Za,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Za))}get _hlsConfig(){return I(this,hu)}set _hlsConfig(i){J(this,hu,i)}get logo(){return this.getAttribute(w.LOGO)}set logo(i){i?this.setAttribute(w.LOGO,i):this.removeAttribute(w.LOGO)}load(){J(this,Pi,Zy(this,this.nativeEl,I(this,Pi)))}unload(){ap(this.nativeEl,I(this,Pi)),J(this,Pi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(dp.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case w.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case w.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Fe(this,Ja,gu).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Fe(this,Ja,gu).call(this));break}case"autoplay":if(t===e)break;(r=I(this,Pi))==null||r.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(s=I(this,Pi))==null||s.setPreload(t);break;case w.PLAYBACK_ID:this.src=Va(this);break;case w.DEBUG:{let n=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=n);break}case w.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case w.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case w.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var i;(i=super.connectedCallback)==null||i.call(this),this.nativeEl&&this.src&&!I(this,Pi)&&Fe(this,Ja,gu).call(this)}disconnectedCallback(){this.unload()}};Pi=new WeakMap,Qa=new WeakMap,uu=new WeakMap,Za=new WeakMap,cu=new WeakMap,hu=new WeakMap,fu=new WeakMap,mu=new WeakMap,pu=new WeakMap,Ja=new WeakSet,gu=async function(){I(this,Qa)||(await J(this,Qa,Promise.resolve()),J(this,Qa,null),this.load())};var vu,Sp=class extends Qw(dD(mD)){constructor(){super(...arguments),ne(this,vu)}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var i;return(i=I(this,vu))!=null?i:this.muxCastCustomData}set castCustomData(i){J(this,vu,i)}};vu=new WeakMap;lp.customElements.get("mux-video")||(lp.customElements.define("mux-video",Sp),lp.MuxVideoElement=Sp);var ST=Sp;function xT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Au(t)}: ${r}; `)}),e?e.trim():void 0}function Au(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Su(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function St(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Lp(i){let e=pD(i).toString();return e?"?"+e:""}function pD(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var wp=(i,e)=>!i||!e?!1:i.contains(e)?!0:wp(i,e.getRootNode().host);var RT="mux.com",gD=()=>{try{return"3.3.3"}catch{}return"UNKNOWN"},vD=gD(),Ru=()=>vD,IT=(i,{token:e,customDomain:t=RT,thumbnailTime:r,programTime:s}={})=>{var o;let n=e==null?r:void 0,{aud:a}=(o=_r(e))!=null?o:{};if(!(e&&a!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Lp({token:e,time:n,program_time:s})}`},kT=(i,{token:e,customDomain:t=RT,programStartTime:r,programEndTime:s}={})=>{var a;let{aud:n}=(a=_r(e))!=null?a:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Lp({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},eo=i=>{if(i){if([Re.LIVE,Re.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Re.LIVE}};var ED={crossorigin:"crossOrigin",playsinline:"playsInline"};function LT(i){var e;return(e=ED[i])!=null?e:Su(i)}var xs,Rs,xt,xu=class{constructor(e,t){It(this,xs);It(this,Rs);It(this,xt,[]);Bt(this,xs,e),Bt(this,Rs,t)}[Symbol.iterator](){return Se(this,xt).values()}get length(){return Se(this,xt).length}get value(){var e;return(e=Se(this,xt).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Bt(this,xt,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return Se(this,xt)[e]}values(){return Se(this,xt).values()}keys(){return Se(this,xt).keys()}forEach(e){Se(this,xt).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||Se(this,xt).push(s)}),!(this.value===""&&!((t=Se(this,xs))!=null&&t.hasAttribute(`${Se(this,Rs)}`)))&&((r=Se(this,xs))==null||r.setAttribute(`${Se(this,Rs)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{Se(this,xt).splice(Se(this,xt).indexOf(r),1)}),(t=Se(this,xs))==null||t.setAttribute(`${Se(this,Rs)}`,`${this.value}`)}contains(e){return Se(this,xt).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};xs=new WeakMap,Rs=new WeakMap,xt=new WeakMap;var wT=`[mux-player ${Ru()}]`;function Oi(...i){console.warn(wT,...i)}function Ot(...i){console.error(wT,...i)}function Dp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${X("Read more: ")}
1361
+ `}get preferCmcd(){var i;return(i=this.getAttribute(w.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?In.includes(i)?this.setAttribute(w.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${In.join()}`):this.removeAttribute(w.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(w.PLAYER_INIT_TIME)?+this.getAttribute(w.PLAYER_INIT_TIME):I(this,uu)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(w.PLAYER_INIT_TIME):this.setAttribute(w.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=I(this,mu))!=null?i:hT}set playerSoftwareName(i){J(this,mu,i)}get playerSoftwareVersion(){var i;return(i=I(this,fu))!=null?i:cT}set playerSoftwareVersion(i){J(this,fu,i)}get _hls(){var i;return(i=I(this,Pi))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=rp(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,pu)}set errorTranslator(i){J(this,pu,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(w.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(w.TYPE,i):this.removeAttribute(w.TYPE))}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(w.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(w.DEBUG,""):this.removeAttribute(w.DEBUG))}get disableTracking(){return this.hasAttribute(w.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(w.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(w.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(w.DISABLE_COOKIES,""):this.removeAttribute(w.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(w.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(w.START_TIME):this.setAttribute(w.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(w.PLAYBACK_ID)?this.getAttribute(w.PLAYBACK_ID):(i=ip(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(w.PLAYBACK_ID,i):this.removeAttribute(w.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(w.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(w.MAX_RESOLUTION,i):this.removeAttribute(w.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(w.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(w.MIN_RESOLUTION,i):this.removeAttribute(w.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(w.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(w.RENDITION_ORDER,i):this.removeAttribute(w.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(w.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(w.PROGRAM_START_TIME):this.setAttribute(w.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(w.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(w.PROGRAM_END_TIME):this.setAttribute(w.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(w.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(w.ASSET_START_TIME):this.setAttribute(w.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(w.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(w.ASSET_END_TIME):this.setAttribute(w.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(w.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(w.CUSTOM_DOMAIN,i):this.removeAttribute(w.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(w.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(w.DRM_TOKEN,i):this.removeAttribute(w.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(w.PLAYBACK_TOKEN))return(i=this.getAttribute(w.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(w.PLAYBACK_ID)){let[,s]=eu((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(s).get("token"))!=null?t:void 0}if(this.src)return(r=new URLSearchParams(this.src).get("token"))!=null?r:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(w.PLAYBACK_TOKEN,i):this.removeAttribute(w.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(w.PLAYBACK_TOKEN),e=this.getAttribute(w.DRM_TOKEN);return{...I(this,cu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){J(this,cu,i!=null?i:{})}get ended(){return np(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(w.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(w.ENV_KEY,i):this.removeAttribute(w.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(w.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(w.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(w.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(w.STREAM_TYPE))!=null?i:Jd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(w.STREAM_TYPE,i):this.removeAttribute(w.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(w.TARGET_LIVE_WINDOW)?+this.getAttribute(w.TARGET_LIVE_WINDOW):jy(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(w.TARGET_LIVE_WINDOW):this.setAttribute(w.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(w.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,r=(i=this.nativeEl.seekable.end(0))!=null?i:0,s=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(s,r-t)}return zy(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(w.LIVE_EDGE_OFFSET))return+this.getAttribute(w.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(w.LIVE_EDGE_OFFSET):this.setAttribute(w.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return nu(this.nativeEl)}async addCuePoints(i){return Qm(this.nativeEl,i)}get activeCuePoint(){return Zm(this.nativeEl)}get cuePoints(){return $y(this.nativeEl)}async addChapters(i){return ep(this.nativeEl,i)}get activeChapter(){return tp(this.nativeEl)}get chapters(){return Gy(this.nativeEl)}getStartDate(){return Ky(this.nativeEl,this._hls)}get currentPdt(){return Vy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(w.PREFER_PLAYBACK);if(i===jt.MSE||i===jt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===jt.MSE||i===jt.NATIVE?this.setAttribute(w.PREFER_PLAYBACK,i):this.removeAttribute(w.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![w.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...I(this,Za)}}set metadata(i){J(this,Za,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Za))}get _hlsConfig(){return I(this,hu)}set _hlsConfig(i){J(this,hu,i)}get logo(){return this.getAttribute(w.LOGO)}set logo(i){i?this.setAttribute(w.LOGO,i):this.removeAttribute(w.LOGO)}load(){J(this,Pi,Zy(this,this.nativeEl,I(this,Pi)))}unload(){ap(this.nativeEl,I(this,Pi)),J(this,Pi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(dp.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case w.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case w.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Fe(this,Ja,gu).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Fe(this,Ja,gu).call(this));break}case"autoplay":if(t===e)break;(r=I(this,Pi))==null||r.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(s=I(this,Pi))==null||s.setPreload(t);break;case w.PLAYBACK_ID:this.src=Va(this);break;case w.DEBUG:{let n=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=n);break}case w.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case w.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case w.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var i;(i=super.connectedCallback)==null||i.call(this),this.nativeEl&&this.src&&!I(this,Pi)&&Fe(this,Ja,gu).call(this)}disconnectedCallback(){this.unload()}};Pi=new WeakMap,Qa=new WeakMap,uu=new WeakMap,Za=new WeakMap,cu=new WeakMap,hu=new WeakMap,fu=new WeakMap,mu=new WeakMap,pu=new WeakMap,Ja=new WeakSet,gu=async function(){I(this,Qa)||(await J(this,Qa,Promise.resolve()),J(this,Qa,null),this.load())};var vu,Sp=class extends Qw(dD(mD)){constructor(){super(...arguments),ne(this,vu)}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var i;return(i=I(this,vu))!=null?i:this.muxCastCustomData}set castCustomData(i){J(this,vu,i)}};vu=new WeakMap;lp.customElements.get("mux-video")||(lp.customElements.define("mux-video",Sp),lp.MuxVideoElement=Sp);var ST=Sp;function xT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Au(t)}: ${r}; `)}),e?e.trim():void 0}function Au(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Su(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function St(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Lp(i){let e=pD(i).toString();return e?"?"+e:""}function pD(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var wp=(i,e)=>!i||!e?!1:i.contains(e)?!0:wp(i,e.getRootNode().host);var RT="mux.com",gD=()=>{try{return"3.3.4"}catch{}return"UNKNOWN"},vD=gD(),Ru=()=>vD,IT=(i,{token:e,customDomain:t=RT,thumbnailTime:r,programTime:s}={})=>{var o;let n=e==null?r:void 0,{aud:a}=(o=_r(e))!=null?o:{};if(!(e&&a!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Lp({token:e,time:n,program_time:s})}`},kT=(i,{token:e,customDomain:t=RT,programStartTime:r,programEndTime:s}={})=>{var a;let{aud:n}=(a=_r(e))!=null?a:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Lp({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},eo=i=>{if(i){if([Re.LIVE,Re.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Re.LIVE}};var ED={crossorigin:"crossOrigin",playsinline:"playsInline"};function LT(i){var e;return(e=ED[i])!=null?e:Su(i)}var xs,Rs,xt,xu=class{constructor(e,t){It(this,xs);It(this,Rs);It(this,xt,[]);Bt(this,xs,e),Bt(this,Rs,t)}[Symbol.iterator](){return Se(this,xt).values()}get length(){return Se(this,xt).length}get value(){var e;return(e=Se(this,xt).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Bt(this,xt,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return Se(this,xt)[e]}values(){return Se(this,xt).values()}keys(){return Se(this,xt).keys()}forEach(e){Se(this,xt).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||Se(this,xt).push(s)}),!(this.value===""&&!((t=Se(this,xs))!=null&&t.hasAttribute(`${Se(this,Rs)}`)))&&((r=Se(this,xs))==null||r.setAttribute(`${Se(this,Rs)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{Se(this,xt).splice(Se(this,xt).indexOf(r),1)}),(t=Se(this,xs))==null||t.setAttribute(`${Se(this,Rs)}`,`${this.value}`)}contains(e){return Se(this,xt).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};xs=new WeakMap,Rs=new WeakMap,xt=new WeakMap;var wT=`[mux-player ${Ru()}]`;function Oi(...i){console.warn(wT,...i)}function Ot(...i){console.error(wT,...i)}function Dp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${X("Read more: ")}
1362
1362
  https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Oi(e)}var Tt={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Is={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},CT=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),bD=yu.filter(i=>i!=="error"),yD=Object.values(Tt).filter(i=>![Tt.PLAYSINLINE].includes(i)),TD=Object.values(Is),Cp=class extends kt.HTMLElement{static get observedAttributes(){return[...yD,...TD]}constructor(){super()}init(){bD.forEach(e=>{var t;(t=this.media)==null||t.addEventListener(e,r=>{this.dispatchEvent(new Event(r.type))})})}attributeChangedCallback(e,t,r){var s,n;switch(e){case Is.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case Is.VOLUME:{let a=(s=St(r))!=null?s:1;this.media&&(this.media.volume=a);return}case Is.PLAYBACKRATE:{let a=(n=St(r))!=null?n:1;this.media&&(this.media.playbackRate=a,this.media.defaultPlaybackRate=a);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:CT}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:CT}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentSrc(){var e,t;return(t=(e=this.media)==null?void 0:e.currentSrc)!=null?t:""}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=St(this.getAttribute(Is.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Is.PLAYBACKRATE,`${e}`):this.removeAttribute(Is.PLAYBACKRATE)}get crossOrigin(){return to(this,Tt.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(Tt.CROSSORIGIN,`${e}`)}get autoplay(){return to(this,Tt.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(Tt.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(Tt.AUTOPLAY)}get loop(){return to(this,Tt.LOOP)!=null}set loop(e){e?this.setAttribute(Tt.LOOP,""):this.removeAttribute(Tt.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return to(this,Tt.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(Tt.MUTED,""):this.removeAttribute(Tt.MUTED)}get playsInline(){return to(this,Tt.PLAYSINLINE)!=null}set playsInline(e){Ot("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(Tt.PRELOAD,e):this.removeAttribute(Tt.PRELOAD)}};function to(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Mp=Cp;var UT=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ee=(i,e,t)=>(UT(i,e,"read from private field"),t?t.call(i):e.get(i)),Ni=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ir=(i,e,t,r)=>(UT(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Mn,Iu,ks,io,xr,Rr,Ir,Ls,Pn,ku,ci,MT=1,PT=0,_D=1,AD={processCallback(i,e,t){if(t){for(let[r,s]of e)if(r in t){let n=t[r];typeof n=="boolean"&&s instanceof Rt&&typeof s.element[s.attributeName]=="boolean"?s.booleanValue=n:typeof n=="function"&&s instanceof Rt?s.element[s.attributeName]=n:s.value=n}}}},rr=class extends x.DocumentFragment{constructor(e,t,r=AD){var s;super(),Ni(this,Mn,void 0),Ni(this,Iu,void 0),this.append(e.content.cloneNode(!0)),ir(this,Mn,FT(this)),ir(this,Iu,r),(s=r.createCallback)==null||s.call(r,this,Ee(this,Mn),t),r.processCallback(this,Ee(this,Mn),t)}update(e){Ee(this,Iu).processCallback(this,Ee(this,Mn),e)}};Mn=new WeakMap;Iu=new WeakMap;var FT=(i,e=[])=>{let t,r;for(let s of i.attributes||[])if(s.value.includes("{{")){let n=new Pp;for([t,r]of NT(s.value))if(!t)n.append(r);else{let a=new Rt(i,s.name,s.namespaceURI);n.append(a),e.push([r,a])}s.value=n.toString()}for(let s of i.childNodes)if(s.nodeType===MT&&!(s instanceof HTMLTemplateElement))FT(s,e);else{let n=s.data;if(s.nodeType===MT||n.includes("{{")){let a=[];if(n)for([t,r]of NT(n))if(!t)a.push(new Text(r));else{let o=new sr(i);a.push(o),e.push([r,o])}else if(s instanceof HTMLTemplateElement){let o=new ro(i,s);a.push(o),e.push([o.expression,o])}s.replaceWith(...a.flatMap(o=>o.replacementNodes||[o]))}}return e},OT={},NT=i=>{let e="",t=0,r=OT[i],s=0,n;if(r)return r;for(r=[];n=i[s];s++)n==="{"&&i[s+1]==="{"&&i[s-1]!=="\\"&&i[s+2]&&++t==1?(e&&r.push([PT,e]),e="",s++):n==="}"&&i[s+1]==="}"&&i[s-1]!=="\\"&&!--t?(r.push([_D,e.trim()]),e="",s++):e+=n||"";return e&&r.push([PT,(t>0?"{{":"")+e]),OT[i]=r},SD=11,Lu=class{get value(){return""}set value(e){}toString(){return this.value}},BT=new WeakMap,Pp=class{constructor(){Ni(this,ks,[])}[Symbol.iterator](){return Ee(this,ks).values()}get length(){return Ee(this,ks).length}item(e){return Ee(this,ks)[e]}append(...e){for(let t of e)t instanceof Rt&&BT.set(t,this),Ee(this,ks).push(t)}toString(){return Ee(this,ks).join("")}};ks=new WeakMap;var Rt=class extends Lu{constructor(e,t,r){super(),Ni(this,Ls),Ni(this,io,""),Ni(this,xr,void 0),Ni(this,Rr,void 0),Ni(this,Ir,void 0),ir(this,xr,e),ir(this,Rr,t),ir(this,Ir,r)}get attributeName(){return Ee(this,Rr)}get attributeNamespace(){return Ee(this,Ir)}get element(){return Ee(this,xr)}get value(){return Ee(this,io)}set value(e){Ee(this,io)!==e&&(ir(this,io,e),!Ee(this,Ls,Pn)||Ee(this,Ls,Pn).length===1?e==null?Ee(this,xr).removeAttributeNS(Ee(this,Ir),Ee(this,Rr)):Ee(this,xr).setAttributeNS(Ee(this,Ir),Ee(this,Rr),e):Ee(this,xr).setAttributeNS(Ee(this,Ir),Ee(this,Rr),Ee(this,Ls,Pn).toString()))}get booleanValue(){return Ee(this,xr).hasAttributeNS(Ee(this,Ir),Ee(this,Rr))}set booleanValue(e){if(!Ee(this,Ls,Pn)||Ee(this,Ls,Pn).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};io=new WeakMap;xr=new WeakMap;Rr=new WeakMap;Ir=new WeakMap;Ls=new WeakSet;Pn=function(){return BT.get(this)};var sr=class extends Lu{constructor(e,t){super(),Ni(this,ku,void 0),Ni(this,ci,void 0),ir(this,ku,e),ir(this,ci,t?[...t]:[new Text])}get replacementNodes(){return Ee(this,ci)}get parentNode(){return Ee(this,ku)}get nextSibling(){return Ee(this,ci)[Ee(this,ci).length-1].nextSibling}get previousSibling(){return Ee(this,ci)[0].previousSibling}get value(){return Ee(this,ci).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(r=>r==null?[new Text]:r.forEach?[...r]:r.nodeType===SD?[...r.childNodes]:r.nodeType?[r]:[new Text(r)]);t.length||t.push(new Text),ir(this,ci,xD(Ee(this,ci)[0].parentNode,Ee(this,ci),t,this.nextSibling))}};ku=new WeakMap;ci=new WeakMap;var ro=class extends sr{constructor(e,t){let r=t.getAttribute("directive")||t.getAttribute("type"),s=t.getAttribute("expression")||t.getAttribute(r)||"";s.startsWith("{{")&&(s=s.trim().slice(2,-2).trim()),super(e),this.expression=s,this.template=t,this.directive=r}};function xD(i,e,t,r=null){let s=0,n,a,o,l=t.length,d=e.length;for(;s<l&&s<d&&e[s]==t[s];)s++;for(;s<l&&s<d&&t[l-1]==e[d-1];)r=t[--d,--l];if(s==d)for(;s<l;)i.insertBefore(t[s++],r);if(s==l)for(;s<d;)i.removeChild(e[s++]);else{for(n=e[s];s<l;)o=t[s++],a=n?n.nextSibling:r,n==o?n=a:s<l&&t[s]==a?(i.replaceChild(o,n),n=a):i.insertBefore(o,n);for(;n!=r;)a=n.nextSibling,i.removeChild(n),n=a}return t}var $T={string:i=>String(i)},Du=class{constructor(e){this.template=e,this.state=void 0}},ws=new WeakMap,Ds=new WeakMap,Op={partial:(i,e)=>{e[i.expression]=new Du(i.template)},if:(i,e)=>{var t;if(GT(i.expression,e))if(ws.get(i)!==i.template){ws.set(i,i.template);let r=new rr(i.template,e,Cu);i.replace(r),Ds.set(i,r)}else(t=Ds.get(i))==null||t.update(e);else i.replace(""),ws.delete(i),Ds.delete(i)}},RD=Object.keys(Op),Cu={processCallback(i,e,t){var r,s;if(t)for(let[n,a]of e){if(a instanceof ro){if(!a.directive){let l=RD.find(d=>a.template.hasAttribute(d));l&&(a.directive=l,a.expression=a.template.getAttribute(l))}(r=Op[a.directive])==null||r.call(Op,a,t);continue}let o=GT(n,t);if(o instanceof Du){ws.get(a)!==o.template?(ws.set(a,o.template),o=new rr(o.template,o.state,Cu),a.value=o,Ds.set(a,o)):(s=Ds.get(a))==null||s.update(o.state);continue}o?(a instanceof Rt&&a.attributeName.startsWith("aria-")&&(o=String(o)),a instanceof Rt?typeof o=="boolean"?a.booleanValue=o:typeof o=="function"?a.element[a.attributeName]=o:a.value=o:(a.value=o,ws.delete(a),Ds.delete(a))):a instanceof Rt?a.value=void 0:(a.value=void 0,ws.delete(a),Ds.delete(a))}}},HT={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=$T[e])==null?void 0:t.call($T,i)}};function ID(i){return kD(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function GT(i,e={}){var t,r,s,n,a,o,l;let d=ID(i);if(d.length===0||d.some(({type:u})=>!u))return so(i);if(((t=d[0])==null?void 0:t.token)===">"){let u=e[(r=d[1])==null?void 0:r.token];if(!u)return so(i);let c={...e};u.state=c;let h=d.slice(2);for(let f=0;f<h.length;f+=3){let m=(s=h[f])==null?void 0:s.token,p=(n=h[f+1])==null?void 0:n.token,g=(a=h[f+2])==null?void 0:a.token;m&&p==="="&&(c[m]=no(g,e))}return u}if(d.length===1)return wu(d[0])?no(d[0].token,e):so(i);if(d.length===2){let u=(o=d[0])==null?void 0:o.token,c=HT[u];if(!c||!wu(d[1]))return so(i);let h=no(d[1].token,e);return c(h)}if(d.length===3){let u=(l=d[1])==null?void 0:l.token,c=HT[u];if(!c||!wu(d[0])||!wu(d[2]))return so(i);let h=no(d[0].token,e);if(u==="|")return c(h,d[2].token);let f=no(d[2].token,e);return c(h,f)}}function so(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function wu({type:i}){return["number","boolean","string","param"].includes(i)}function no(i,e){let t=i[0],r=i.slice(-1);return i==="true"||i==="false"?i==="true":t===r&&["'",'"'].includes(t)?i.slice(1,-1):Co(i)?parseFloat(i):e[i]}function kD(i,e){let t,r,s,n=[];for(;i;){s=null,t=i.length;for(let a in e)r=e[a].exec(i),r&&r.index<t&&(s={token:r[0],type:a,matches:r.slice(1)},t=r.index);t&&n.push({token:i.substr(0,t),type:void 0}),s&&n.push(s),i=i.substr(t+(s?s.token.length:0))}return n}var Hp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fp=(i,e,t)=>(Hp(i,e,"read from private field"),t?t.call(i):e.get(i)),ao=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Cs=(i,e,t,r)=>(Hp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Np=(i,e,t)=>(Hp(i,e,"access private method"),t),On,Mu,Nn,Bp,KT,Pu,$p,Up={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},VT=F.createElement("template");VT.innerHTML=`
1363
1363
  <style>
1364
1364
  :host {
@@ -1288,7 +1288,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1288
1288
  `:""}${i.error?`error: ${i.error}
1289
1289
  `:""}${i.event?`event: ${i.event}
1290
1290
  `:""}${i.err?`error message: ${(s=i.err)==null?void 0:s.message}
1291
- `:""}`),l.data=i,l};var _w=Object.defineProperty,Aw=Object.getPrototypeOf,Sw=Reflect.get,fT=i=>{throw TypeError(i)},xw=(i,e,t)=>e in i?_w(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Le=(i,e,t)=>xw(i,typeof e!="symbol"?e+"":e,t),xp=(i,e,t)=>e.has(i)||fT("Cannot "+t),I=(i,e,t)=>(xp(i,e,"read from private field"),t?t.call(i):e.get(i)),ne=(i,e,t)=>e.has(i)?fT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),J=(i,e,t,r)=>(xp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Fe=(i,e,t)=>(xp(i,e,"access private method"),t),op=(i,e,t)=>Sw(Aw(i),t,e),bu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends bu{}globalThis.DocumentFragment=i}var Rp=class extends bu{},Rw=class extends bu{},Iw={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Rp)}},au,kw=class{constructor(i,e={}){ne(this,au),J(this,au,e==null?void 0:e.detail)}get detail(){return I(this,au)}initCustomEvent(){}};au=new WeakMap;function Lw(i,e){return new Rp}var mT={document:{createElement:Lw},DocumentFragment,customElements:Iw,CustomEvent:kw,EventTarget:bu,HTMLElement:Rp,HTMLVideoElement:Rw},pT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",lp=pT?mT:globalThis,zN=pT?mT.document:globalThis.document,ww=()=>{try{return"0.25.0"}catch{}return"UNKNOWN"},Dw=ww(),Cw=()=>Dw,yu=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],gT=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function Mw(i){return`
1291
+ `:""}`),l.data=i,l};var _w=Object.defineProperty,Aw=Object.getPrototypeOf,Sw=Reflect.get,fT=i=>{throw TypeError(i)},xw=(i,e,t)=>e in i?_w(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Le=(i,e,t)=>xw(i,typeof e!="symbol"?e+"":e,t),xp=(i,e,t)=>e.has(i)||fT("Cannot "+t),I=(i,e,t)=>(xp(i,e,"read from private field"),t?t.call(i):e.get(i)),ne=(i,e,t)=>e.has(i)?fT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),J=(i,e,t,r)=>(xp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Fe=(i,e,t)=>(xp(i,e,"access private method"),t),op=(i,e,t)=>Sw(Aw(i),t,e),bu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends bu{}globalThis.DocumentFragment=i}var Rp=class extends bu{},Rw=class extends bu{},Iw={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Rp)}},au,kw=class{constructor(i,e={}){ne(this,au),J(this,au,e==null?void 0:e.detail)}get detail(){return I(this,au)}initCustomEvent(){}};au=new WeakMap;function Lw(i,e){return new Rp}var mT={document:{createElement:Lw},DocumentFragment,customElements:Iw,CustomEvent:kw,EventTarget:bu,HTMLElement:Rp,HTMLVideoElement:Rw},pT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",lp=pT?mT:globalThis,zN=pT?mT.document:globalThis.document,ww=()=>{try{return"0.25.1"}catch{}return"UNKNOWN"},Dw=ww(),Cw=()=>Dw,yu=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],gT=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function Mw(i){return`
1292
1292
  <style>
1293
1293
  :host {
1294
1294
  display: inline-flex;
@@ -1358,7 +1358,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1358
1358
  `:"";return`
1359
1359
  ${e}
1360
1360
  ${n}
1361
- `}get preferCmcd(){var i;return(i=this.getAttribute(w.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?In.includes(i)?this.setAttribute(w.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${In.join()}`):this.removeAttribute(w.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(w.PLAYER_INIT_TIME)?+this.getAttribute(w.PLAYER_INIT_TIME):I(this,uu)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(w.PLAYER_INIT_TIME):this.setAttribute(w.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=I(this,mu))!=null?i:hT}set playerSoftwareName(i){J(this,mu,i)}get playerSoftwareVersion(){var i;return(i=I(this,fu))!=null?i:cT}set playerSoftwareVersion(i){J(this,fu,i)}get _hls(){var i;return(i=I(this,Pi))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=rp(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,pu)}set errorTranslator(i){J(this,pu,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(w.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(w.TYPE,i):this.removeAttribute(w.TYPE))}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(w.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(w.DEBUG,""):this.removeAttribute(w.DEBUG))}get disableTracking(){return this.hasAttribute(w.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(w.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(w.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(w.DISABLE_COOKIES,""):this.removeAttribute(w.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(w.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(w.START_TIME):this.setAttribute(w.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(w.PLAYBACK_ID)?this.getAttribute(w.PLAYBACK_ID):(i=ip(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(w.PLAYBACK_ID,i):this.removeAttribute(w.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(w.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(w.MAX_RESOLUTION,i):this.removeAttribute(w.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(w.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(w.MIN_RESOLUTION,i):this.removeAttribute(w.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(w.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(w.RENDITION_ORDER,i):this.removeAttribute(w.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(w.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(w.PROGRAM_START_TIME):this.setAttribute(w.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(w.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(w.PROGRAM_END_TIME):this.setAttribute(w.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(w.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(w.ASSET_START_TIME):this.setAttribute(w.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(w.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(w.ASSET_END_TIME):this.setAttribute(w.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(w.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(w.CUSTOM_DOMAIN,i):this.removeAttribute(w.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(w.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(w.DRM_TOKEN,i):this.removeAttribute(w.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(w.PLAYBACK_TOKEN))return(i=this.getAttribute(w.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(w.PLAYBACK_ID)){let[,s]=eu((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(s).get("token"))!=null?t:void 0}if(this.src)return(r=new URLSearchParams(this.src).get("token"))!=null?r:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(w.PLAYBACK_TOKEN,i):this.removeAttribute(w.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(w.PLAYBACK_TOKEN),e=this.getAttribute(w.DRM_TOKEN);return{...I(this,cu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){J(this,cu,i!=null?i:{})}get ended(){return np(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(w.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(w.ENV_KEY,i):this.removeAttribute(w.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(w.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(w.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(w.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(w.STREAM_TYPE))!=null?i:Jd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(w.STREAM_TYPE,i):this.removeAttribute(w.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(w.TARGET_LIVE_WINDOW)?+this.getAttribute(w.TARGET_LIVE_WINDOW):jy(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(w.TARGET_LIVE_WINDOW):this.setAttribute(w.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(w.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,r=(i=this.nativeEl.seekable.end(0))!=null?i:0,s=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(s,r-t)}return zy(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(w.LIVE_EDGE_OFFSET))return+this.getAttribute(w.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(w.LIVE_EDGE_OFFSET):this.setAttribute(w.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return nu(this.nativeEl)}async addCuePoints(i){return Qm(this.nativeEl,i)}get activeCuePoint(){return Zm(this.nativeEl)}get cuePoints(){return $y(this.nativeEl)}async addChapters(i){return ep(this.nativeEl,i)}get activeChapter(){return tp(this.nativeEl)}get chapters(){return Gy(this.nativeEl)}getStartDate(){return Ky(this.nativeEl,this._hls)}get currentPdt(){return Vy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(w.PREFER_PLAYBACK);if(i===jt.MSE||i===jt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===jt.MSE||i===jt.NATIVE?this.setAttribute(w.PREFER_PLAYBACK,i):this.removeAttribute(w.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![w.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...I(this,Za)}}set metadata(i){J(this,Za,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Za))}get _hlsConfig(){return I(this,hu)}set _hlsConfig(i){J(this,hu,i)}get logo(){return this.getAttribute(w.LOGO)}set logo(i){i?this.setAttribute(w.LOGO,i):this.removeAttribute(w.LOGO)}load(){J(this,Pi,Zy(this,this.nativeEl,I(this,Pi)))}unload(){ap(this.nativeEl,I(this,Pi)),J(this,Pi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(dp.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case w.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case w.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Fe(this,Ja,gu).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Fe(this,Ja,gu).call(this));break}case"autoplay":if(t===e)break;(r=I(this,Pi))==null||r.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(s=I(this,Pi))==null||s.setPreload(t);break;case w.PLAYBACK_ID:this.src=Va(this);break;case w.DEBUG:{let n=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=n);break}case w.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case w.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case w.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var i;(i=super.connectedCallback)==null||i.call(this),this.nativeEl&&this.src&&!I(this,Pi)&&Fe(this,Ja,gu).call(this)}disconnectedCallback(){this.unload()}};Pi=new WeakMap,Qa=new WeakMap,uu=new WeakMap,Za=new WeakMap,cu=new WeakMap,hu=new WeakMap,fu=new WeakMap,mu=new WeakMap,pu=new WeakMap,Ja=new WeakSet,gu=async function(){I(this,Qa)||(await J(this,Qa,Promise.resolve()),J(this,Qa,null),this.load())};var vu,Sp=class extends Qw(dD(mD)){constructor(){super(...arguments),ne(this,vu)}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var i;return(i=I(this,vu))!=null?i:this.muxCastCustomData}set castCustomData(i){J(this,vu,i)}};vu=new WeakMap;lp.customElements.get("mux-video")||(lp.customElements.define("mux-video",Sp),lp.MuxVideoElement=Sp);var ST=Sp;function xT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Au(t)}: ${r}; `)}),e?e.trim():void 0}function Au(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Su(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function St(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Lp(i){let e=pD(i).toString();return e?"?"+e:""}function pD(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var wp=(i,e)=>!i||!e?!1:i.contains(e)?!0:wp(i,e.getRootNode().host);var RT="mux.com",gD=()=>{try{return"3.3.3"}catch{}return"UNKNOWN"},vD=gD(),Ru=()=>vD,IT=(i,{token:e,customDomain:t=RT,thumbnailTime:r,programTime:s}={})=>{var o;let n=e==null?r:void 0,{aud:a}=(o=_r(e))!=null?o:{};if(!(e&&a!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Lp({token:e,time:n,program_time:s})}`},kT=(i,{token:e,customDomain:t=RT,programStartTime:r,programEndTime:s}={})=>{var a;let{aud:n}=(a=_r(e))!=null?a:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Lp({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},eo=i=>{if(i){if([Re.LIVE,Re.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Re.LIVE}};var ED={crossorigin:"crossOrigin",playsinline:"playsInline"};function LT(i){var e;return(e=ED[i])!=null?e:Su(i)}var xs,Rs,xt,xu=class{constructor(e,t){It(this,xs);It(this,Rs);It(this,xt,[]);Bt(this,xs,e),Bt(this,Rs,t)}[Symbol.iterator](){return Se(this,xt).values()}get length(){return Se(this,xt).length}get value(){var e;return(e=Se(this,xt).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Bt(this,xt,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return Se(this,xt)[e]}values(){return Se(this,xt).values()}keys(){return Se(this,xt).keys()}forEach(e){Se(this,xt).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||Se(this,xt).push(s)}),!(this.value===""&&!((t=Se(this,xs))!=null&&t.hasAttribute(`${Se(this,Rs)}`)))&&((r=Se(this,xs))==null||r.setAttribute(`${Se(this,Rs)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{Se(this,xt).splice(Se(this,xt).indexOf(r),1)}),(t=Se(this,xs))==null||t.setAttribute(`${Se(this,Rs)}`,`${this.value}`)}contains(e){return Se(this,xt).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};xs=new WeakMap,Rs=new WeakMap,xt=new WeakMap;var wT=`[mux-player ${Ru()}]`;function Oi(...i){console.warn(wT,...i)}function Ot(...i){console.error(wT,...i)}function Dp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${X("Read more: ")}
1361
+ `}get preferCmcd(){var i;return(i=this.getAttribute(w.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?In.includes(i)?this.setAttribute(w.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${In.join()}`):this.removeAttribute(w.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(w.PLAYER_INIT_TIME)?+this.getAttribute(w.PLAYER_INIT_TIME):I(this,uu)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(w.PLAYER_INIT_TIME):this.setAttribute(w.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=I(this,mu))!=null?i:hT}set playerSoftwareName(i){J(this,mu,i)}get playerSoftwareVersion(){var i;return(i=I(this,fu))!=null?i:cT}set playerSoftwareVersion(i){J(this,fu,i)}get _hls(){var i;return(i=I(this,Pi))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=rp(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,pu)}set errorTranslator(i){J(this,pu,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(w.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(w.TYPE,i):this.removeAttribute(w.TYPE))}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(w.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(w.DEBUG,""):this.removeAttribute(w.DEBUG))}get disableTracking(){return this.hasAttribute(w.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(w.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(w.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(w.DISABLE_COOKIES,""):this.removeAttribute(w.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(w.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(w.START_TIME):this.setAttribute(w.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(w.PLAYBACK_ID)?this.getAttribute(w.PLAYBACK_ID):(i=ip(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(w.PLAYBACK_ID,i):this.removeAttribute(w.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(w.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(w.MAX_RESOLUTION,i):this.removeAttribute(w.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(w.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(w.MIN_RESOLUTION,i):this.removeAttribute(w.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(w.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(w.RENDITION_ORDER,i):this.removeAttribute(w.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(w.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(w.PROGRAM_START_TIME):this.setAttribute(w.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(w.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(w.PROGRAM_END_TIME):this.setAttribute(w.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(w.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(w.ASSET_START_TIME):this.setAttribute(w.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(w.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(w.ASSET_END_TIME):this.setAttribute(w.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(w.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(w.CUSTOM_DOMAIN,i):this.removeAttribute(w.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(w.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(w.DRM_TOKEN,i):this.removeAttribute(w.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(w.PLAYBACK_TOKEN))return(i=this.getAttribute(w.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(w.PLAYBACK_ID)){let[,s]=eu((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(s).get("token"))!=null?t:void 0}if(this.src)return(r=new URLSearchParams(this.src).get("token"))!=null?r:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(w.PLAYBACK_TOKEN,i):this.removeAttribute(w.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(w.PLAYBACK_TOKEN),e=this.getAttribute(w.DRM_TOKEN);return{...I(this,cu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){J(this,cu,i!=null?i:{})}get ended(){return np(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(w.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(w.ENV_KEY,i):this.removeAttribute(w.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(w.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(w.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(w.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(w.STREAM_TYPE))!=null?i:Jd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(w.STREAM_TYPE,i):this.removeAttribute(w.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(w.TARGET_LIVE_WINDOW)?+this.getAttribute(w.TARGET_LIVE_WINDOW):jy(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(w.TARGET_LIVE_WINDOW):this.setAttribute(w.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(w.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,r=(i=this.nativeEl.seekable.end(0))!=null?i:0,s=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(s,r-t)}return zy(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(w.LIVE_EDGE_OFFSET))return+this.getAttribute(w.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(w.LIVE_EDGE_OFFSET):this.setAttribute(w.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return nu(this.nativeEl)}async addCuePoints(i){return Qm(this.nativeEl,i)}get activeCuePoint(){return Zm(this.nativeEl)}get cuePoints(){return $y(this.nativeEl)}async addChapters(i){return ep(this.nativeEl,i)}get activeChapter(){return tp(this.nativeEl)}get chapters(){return Gy(this.nativeEl)}getStartDate(){return Ky(this.nativeEl,this._hls)}get currentPdt(){return Vy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(w.PREFER_PLAYBACK);if(i===jt.MSE||i===jt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===jt.MSE||i===jt.NATIVE?this.setAttribute(w.PREFER_PLAYBACK,i):this.removeAttribute(w.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![w.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...I(this,Za)}}set metadata(i){J(this,Za,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Za))}get _hlsConfig(){return I(this,hu)}set _hlsConfig(i){J(this,hu,i)}get logo(){return this.getAttribute(w.LOGO)}set logo(i){i?this.setAttribute(w.LOGO,i):this.removeAttribute(w.LOGO)}load(){J(this,Pi,Zy(this,this.nativeEl,I(this,Pi)))}unload(){ap(this.nativeEl,I(this,Pi)),J(this,Pi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(dp.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case w.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case w.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Fe(this,Ja,gu).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Fe(this,Ja,gu).call(this));break}case"autoplay":if(t===e)break;(r=I(this,Pi))==null||r.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(s=I(this,Pi))==null||s.setPreload(t);break;case w.PLAYBACK_ID:this.src=Va(this);break;case w.DEBUG:{let n=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=n);break}case w.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case w.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case w.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var i;(i=super.connectedCallback)==null||i.call(this),this.nativeEl&&this.src&&!I(this,Pi)&&Fe(this,Ja,gu).call(this)}disconnectedCallback(){this.unload()}};Pi=new WeakMap,Qa=new WeakMap,uu=new WeakMap,Za=new WeakMap,cu=new WeakMap,hu=new WeakMap,fu=new WeakMap,mu=new WeakMap,pu=new WeakMap,Ja=new WeakSet,gu=async function(){I(this,Qa)||(await J(this,Qa,Promise.resolve()),J(this,Qa,null),this.load())};var vu,Sp=class extends Qw(dD(mD)){constructor(){super(...arguments),ne(this,vu)}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var i;return(i=I(this,vu))!=null?i:this.muxCastCustomData}set castCustomData(i){J(this,vu,i)}};vu=new WeakMap;lp.customElements.get("mux-video")||(lp.customElements.define("mux-video",Sp),lp.MuxVideoElement=Sp);var ST=Sp;function xT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Au(t)}: ${r}; `)}),e?e.trim():void 0}function Au(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Su(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function St(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Lp(i){let e=pD(i).toString();return e?"?"+e:""}function pD(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var wp=(i,e)=>!i||!e?!1:i.contains(e)?!0:wp(i,e.getRootNode().host);var RT="mux.com",gD=()=>{try{return"3.3.4"}catch{}return"UNKNOWN"},vD=gD(),Ru=()=>vD,IT=(i,{token:e,customDomain:t=RT,thumbnailTime:r,programTime:s}={})=>{var o;let n=e==null?r:void 0,{aud:a}=(o=_r(e))!=null?o:{};if(!(e&&a!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Lp({token:e,time:n,program_time:s})}`},kT=(i,{token:e,customDomain:t=RT,programStartTime:r,programEndTime:s}={})=>{var a;let{aud:n}=(a=_r(e))!=null?a:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Lp({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},eo=i=>{if(i){if([Re.LIVE,Re.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Re.LIVE}};var ED={crossorigin:"crossOrigin",playsinline:"playsInline"};function LT(i){var e;return(e=ED[i])!=null?e:Su(i)}var xs,Rs,xt,xu=class{constructor(e,t){It(this,xs);It(this,Rs);It(this,xt,[]);Bt(this,xs,e),Bt(this,Rs,t)}[Symbol.iterator](){return Se(this,xt).values()}get length(){return Se(this,xt).length}get value(){var e;return(e=Se(this,xt).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Bt(this,xt,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return Se(this,xt)[e]}values(){return Se(this,xt).values()}keys(){return Se(this,xt).keys()}forEach(e){Se(this,xt).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||Se(this,xt).push(s)}),!(this.value===""&&!((t=Se(this,xs))!=null&&t.hasAttribute(`${Se(this,Rs)}`)))&&((r=Se(this,xs))==null||r.setAttribute(`${Se(this,Rs)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{Se(this,xt).splice(Se(this,xt).indexOf(r),1)}),(t=Se(this,xs))==null||t.setAttribute(`${Se(this,Rs)}`,`${this.value}`)}contains(e){return Se(this,xt).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};xs=new WeakMap,Rs=new WeakMap,xt=new WeakMap;var wT=`[mux-player ${Ru()}]`;function Oi(...i){console.warn(wT,...i)}function Ot(...i){console.error(wT,...i)}function Dp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${X("Read more: ")}
1362
1362
  https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Oi(e)}var Tt={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Is={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},CT=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),bD=yu.filter(i=>i!=="error"),yD=Object.values(Tt).filter(i=>![Tt.PLAYSINLINE].includes(i)),TD=Object.values(Is),Cp=class extends kt.HTMLElement{static get observedAttributes(){return[...yD,...TD]}constructor(){super()}init(){bD.forEach(e=>{var t;(t=this.media)==null||t.addEventListener(e,r=>{this.dispatchEvent(new Event(r.type))})})}attributeChangedCallback(e,t,r){var s,n;switch(e){case Is.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case Is.VOLUME:{let a=(s=St(r))!=null?s:1;this.media&&(this.media.volume=a);return}case Is.PLAYBACKRATE:{let a=(n=St(r))!=null?n:1;this.media&&(this.media.playbackRate=a,this.media.defaultPlaybackRate=a);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:CT}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:CT}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentSrc(){var e,t;return(t=(e=this.media)==null?void 0:e.currentSrc)!=null?t:""}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=St(this.getAttribute(Is.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Is.PLAYBACKRATE,`${e}`):this.removeAttribute(Is.PLAYBACKRATE)}get crossOrigin(){return to(this,Tt.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(Tt.CROSSORIGIN,`${e}`)}get autoplay(){return to(this,Tt.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(Tt.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(Tt.AUTOPLAY)}get loop(){return to(this,Tt.LOOP)!=null}set loop(e){e?this.setAttribute(Tt.LOOP,""):this.removeAttribute(Tt.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return to(this,Tt.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(Tt.MUTED,""):this.removeAttribute(Tt.MUTED)}get playsInline(){return to(this,Tt.PLAYSINLINE)!=null}set playsInline(e){Ot("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(Tt.PRELOAD,e):this.removeAttribute(Tt.PRELOAD)}};function to(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Mp=Cp;var UT=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ee=(i,e,t)=>(UT(i,e,"read from private field"),t?t.call(i):e.get(i)),Ni=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ir=(i,e,t,r)=>(UT(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Mn,Iu,ks,io,xr,Rr,Ir,Ls,Pn,ku,ci,MT=1,PT=0,_D=1,AD={processCallback(i,e,t){if(t){for(let[r,s]of e)if(r in t){let n=t[r];typeof n=="boolean"&&s instanceof Rt&&typeof s.element[s.attributeName]=="boolean"?s.booleanValue=n:typeof n=="function"&&s instanceof Rt?s.element[s.attributeName]=n:s.value=n}}}},rr=class extends x.DocumentFragment{constructor(e,t,r=AD){var s;super(),Ni(this,Mn,void 0),Ni(this,Iu,void 0),this.append(e.content.cloneNode(!0)),ir(this,Mn,FT(this)),ir(this,Iu,r),(s=r.createCallback)==null||s.call(r,this,Ee(this,Mn),t),r.processCallback(this,Ee(this,Mn),t)}update(e){Ee(this,Iu).processCallback(this,Ee(this,Mn),e)}};Mn=new WeakMap;Iu=new WeakMap;var FT=(i,e=[])=>{let t,r;for(let s of i.attributes||[])if(s.value.includes("{{")){let n=new Pp;for([t,r]of NT(s.value))if(!t)n.append(r);else{let a=new Rt(i,s.name,s.namespaceURI);n.append(a),e.push([r,a])}s.value=n.toString()}for(let s of i.childNodes)if(s.nodeType===MT&&!(s instanceof HTMLTemplateElement))FT(s,e);else{let n=s.data;if(s.nodeType===MT||n.includes("{{")){let a=[];if(n)for([t,r]of NT(n))if(!t)a.push(new Text(r));else{let o=new sr(i);a.push(o),e.push([r,o])}else if(s instanceof HTMLTemplateElement){let o=new ro(i,s);a.push(o),e.push([o.expression,o])}s.replaceWith(...a.flatMap(o=>o.replacementNodes||[o]))}}return e},OT={},NT=i=>{let e="",t=0,r=OT[i],s=0,n;if(r)return r;for(r=[];n=i[s];s++)n==="{"&&i[s+1]==="{"&&i[s-1]!=="\\"&&i[s+2]&&++t==1?(e&&r.push([PT,e]),e="",s++):n==="}"&&i[s+1]==="}"&&i[s-1]!=="\\"&&!--t?(r.push([_D,e.trim()]),e="",s++):e+=n||"";return e&&r.push([PT,(t>0?"{{":"")+e]),OT[i]=r},SD=11,Lu=class{get value(){return""}set value(e){}toString(){return this.value}},BT=new WeakMap,Pp=class{constructor(){Ni(this,ks,[])}[Symbol.iterator](){return Ee(this,ks).values()}get length(){return Ee(this,ks).length}item(e){return Ee(this,ks)[e]}append(...e){for(let t of e)t instanceof Rt&&BT.set(t,this),Ee(this,ks).push(t)}toString(){return Ee(this,ks).join("")}};ks=new WeakMap;var Rt=class extends Lu{constructor(e,t,r){super(),Ni(this,Ls),Ni(this,io,""),Ni(this,xr,void 0),Ni(this,Rr,void 0),Ni(this,Ir,void 0),ir(this,xr,e),ir(this,Rr,t),ir(this,Ir,r)}get attributeName(){return Ee(this,Rr)}get attributeNamespace(){return Ee(this,Ir)}get element(){return Ee(this,xr)}get value(){return Ee(this,io)}set value(e){Ee(this,io)!==e&&(ir(this,io,e),!Ee(this,Ls,Pn)||Ee(this,Ls,Pn).length===1?e==null?Ee(this,xr).removeAttributeNS(Ee(this,Ir),Ee(this,Rr)):Ee(this,xr).setAttributeNS(Ee(this,Ir),Ee(this,Rr),e):Ee(this,xr).setAttributeNS(Ee(this,Ir),Ee(this,Rr),Ee(this,Ls,Pn).toString()))}get booleanValue(){return Ee(this,xr).hasAttributeNS(Ee(this,Ir),Ee(this,Rr))}set booleanValue(e){if(!Ee(this,Ls,Pn)||Ee(this,Ls,Pn).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};io=new WeakMap;xr=new WeakMap;Rr=new WeakMap;Ir=new WeakMap;Ls=new WeakSet;Pn=function(){return BT.get(this)};var sr=class extends Lu{constructor(e,t){super(),Ni(this,ku,void 0),Ni(this,ci,void 0),ir(this,ku,e),ir(this,ci,t?[...t]:[new Text])}get replacementNodes(){return Ee(this,ci)}get parentNode(){return Ee(this,ku)}get nextSibling(){return Ee(this,ci)[Ee(this,ci).length-1].nextSibling}get previousSibling(){return Ee(this,ci)[0].previousSibling}get value(){return Ee(this,ci).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(r=>r==null?[new Text]:r.forEach?[...r]:r.nodeType===SD?[...r.childNodes]:r.nodeType?[r]:[new Text(r)]);t.length||t.push(new Text),ir(this,ci,xD(Ee(this,ci)[0].parentNode,Ee(this,ci),t,this.nextSibling))}};ku=new WeakMap;ci=new WeakMap;var ro=class extends sr{constructor(e,t){let r=t.getAttribute("directive")||t.getAttribute("type"),s=t.getAttribute("expression")||t.getAttribute(r)||"";s.startsWith("{{")&&(s=s.trim().slice(2,-2).trim()),super(e),this.expression=s,this.template=t,this.directive=r}};function xD(i,e,t,r=null){let s=0,n,a,o,l=t.length,d=e.length;for(;s<l&&s<d&&e[s]==t[s];)s++;for(;s<l&&s<d&&t[l-1]==e[d-1];)r=t[--d,--l];if(s==d)for(;s<l;)i.insertBefore(t[s++],r);if(s==l)for(;s<d;)i.removeChild(e[s++]);else{for(n=e[s];s<l;)o=t[s++],a=n?n.nextSibling:r,n==o?n=a:s<l&&t[s]==a?(i.replaceChild(o,n),n=a):i.insertBefore(o,n);for(;n!=r;)a=n.nextSibling,i.removeChild(n),n=a}return t}var $T={string:i=>String(i)},Du=class{constructor(e){this.template=e,this.state=void 0}},ws=new WeakMap,Ds=new WeakMap,Op={partial:(i,e)=>{e[i.expression]=new Du(i.template)},if:(i,e)=>{var t;if(GT(i.expression,e))if(ws.get(i)!==i.template){ws.set(i,i.template);let r=new rr(i.template,e,Cu);i.replace(r),Ds.set(i,r)}else(t=Ds.get(i))==null||t.update(e);else i.replace(""),ws.delete(i),Ds.delete(i)}},RD=Object.keys(Op),Cu={processCallback(i,e,t){var r,s;if(t)for(let[n,a]of e){if(a instanceof ro){if(!a.directive){let l=RD.find(d=>a.template.hasAttribute(d));l&&(a.directive=l,a.expression=a.template.getAttribute(l))}(r=Op[a.directive])==null||r.call(Op,a,t);continue}let o=GT(n,t);if(o instanceof Du){ws.get(a)!==o.template?(ws.set(a,o.template),o=new rr(o.template,o.state,Cu),a.value=o,Ds.set(a,o)):(s=Ds.get(a))==null||s.update(o.state);continue}o?(a instanceof Rt&&a.attributeName.startsWith("aria-")&&(o=String(o)),a instanceof Rt?typeof o=="boolean"?a.booleanValue=o:typeof o=="function"?a.element[a.attributeName]=o:a.value=o:(a.value=o,ws.delete(a),Ds.delete(a))):a instanceof Rt?a.value=void 0:(a.value=void 0,ws.delete(a),Ds.delete(a))}}},HT={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=$T[e])==null?void 0:t.call($T,i)}};function ID(i){return kD(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function GT(i,e={}){var t,r,s,n,a,o,l;let d=ID(i);if(d.length===0||d.some(({type:u})=>!u))return so(i);if(((t=d[0])==null?void 0:t.token)===">"){let u=e[(r=d[1])==null?void 0:r.token];if(!u)return so(i);let c={...e};u.state=c;let h=d.slice(2);for(let f=0;f<h.length;f+=3){let m=(s=h[f])==null?void 0:s.token,p=(n=h[f+1])==null?void 0:n.token,g=(a=h[f+2])==null?void 0:a.token;m&&p==="="&&(c[m]=no(g,e))}return u}if(d.length===1)return wu(d[0])?no(d[0].token,e):so(i);if(d.length===2){let u=(o=d[0])==null?void 0:o.token,c=HT[u];if(!c||!wu(d[1]))return so(i);let h=no(d[1].token,e);return c(h)}if(d.length===3){let u=(l=d[1])==null?void 0:l.token,c=HT[u];if(!c||!wu(d[0])||!wu(d[2]))return so(i);let h=no(d[0].token,e);if(u==="|")return c(h,d[2].token);let f=no(d[2].token,e);return c(h,f)}}function so(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function wu({type:i}){return["number","boolean","string","param"].includes(i)}function no(i,e){let t=i[0],r=i.slice(-1);return i==="true"||i==="false"?i==="true":t===r&&["'",'"'].includes(t)?i.slice(1,-1):Co(i)?parseFloat(i):e[i]}function kD(i,e){let t,r,s,n=[];for(;i;){s=null,t=i.length;for(let a in e)r=e[a].exec(i),r&&r.index<t&&(s={token:r[0],type:a,matches:r.slice(1)},t=r.index);t&&n.push({token:i.substr(0,t),type:void 0}),s&&n.push(s),i=i.substr(t+(s?s.token.length:0))}return n}var Hp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fp=(i,e,t)=>(Hp(i,e,"read from private field"),t?t.call(i):e.get(i)),ao=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Cs=(i,e,t,r)=>(Hp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Np=(i,e,t)=>(Hp(i,e,"access private method"),t),On,Mu,Nn,Bp,KT,Pu,$p,Up={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},VT=F.createElement("template");VT.innerHTML=`
1363
1363
  <style>
1364
1364
  :host {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mux/mux-player",
3
- "version": "3.3.4-canary.2",
3
+ "version": "3.3.4",
4
4
  "description": "An open source Mux player web component that Just Works™",
5
5
  "homepage": "https://mux.com/player",
6
6
  "keywords": [
@@ -93,8 +93,8 @@
93
93
  "build": "npm-run-all --parallel 'build:esm -- --minify' 'build:iife -- --minify' 'build:cjs -- --minify' 'build:esm-module -- --minify' 'build:themes'"
94
94
  },
95
95
  "dependencies": {
96
- "@mux/mux-video": "0.25.0",
97
- "@mux/playback-core": "0.28.6",
96
+ "@mux/mux-video": "0.25.1",
97
+ "@mux/playback-core": "0.28.7",
98
98
  "media-chrome": "~4.9.0",
99
99
  "player.style": "^0.1.7"
100
100
  },