@mux/mux-player 1.1.3 → 1.2.0

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.mjs CHANGED
@@ -1,17 +1,17 @@
1
- var et=(e,a,t)=>{if(!a.has(e))throw TypeError("Cannot "+t)};var d=(e,a,t)=>(et(e,a,"read from private field"),t?t.call(e):a.get(e)),h=(e,a,t)=>{if(a.has(e))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(e):a.set(e,t)},A=(e,a,t,r)=>(et(e,a,"write to private field"),r?r.call(e,t):a.set(e,t),t);var p=(e,a,t)=>(et(e,a,"access private method"),t);var ie=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class e extends ie{}globalThis.DocumentFragment=e}var ge=class extends ie{},tt=class extends ie{},li={get(e){},define(e,a,t){},upgrade(e){},whenDefined(e){return Promise.resolve(ge)}},fe,at=class{constructor(a,t={}){h(this,fe,void 0);A(this,fe,t==null?void 0:t.detail)}get detail(){return d(this,fe)}initCustomEvent(){}};fe=new WeakMap;function di(e,a){return new ge}var Bt={document:{createElement:di},DocumentFragment,customElements:li,CustomEvent:at,EventTarget:ie,HTMLElement:ge,HTMLVideoElement:tt},Kt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",g=Kt?Bt:globalThis,S=Kt?Bt.document:globalThis.document;import{MediaController as hr}from"media-chrome";import br,{MediaError as gt,Attributes as u}from"@mux/mux-video";import{StreamTypes as B,PlaybackTypes as Ye,addTextTrack as pr,removeTextTrack as gr}from"@mux/playback-core";import{VideoEvents as vi}from"@mux/mux-video";var mi="en",W={code:mi};var Ut="en";function c(e,a=!0){var i,n;let t=a&&(n=(i=W)==null?void 0:i[e])!=null?n:e,r=a?W.code:Ut;return new it(t,r)}var it=class{constructor(a,t=(r=>(r=W.code)!=null?r:Ut)()){this.message=a,this.locale=t}format(a){return this.message.replace(/\{(\w+)\}/g,(t,r)=>{var i;return(i=a[r])!=null?i:""})}toString(){return this.message}};function Ft(e){let a="";return Object.entries(e).forEach(([t,r])=>{r!=null&&(a+=`${ci(t)}: ${r}; `)}),a?a.trim():void 0}function ci(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Yt(e){return e.replace(/[-_]([a-z])/g,(a,t)=>t.toUpperCase())}function z(e){if(e==null)return;let a=+e;return Number.isNaN(a)?void 0:a}function Ce(e){let a=ui(e).toString();return a?"?"+a:""}function ui(e){let a={};for(let t in e)e[t]!=null&&(a[t]=e[t]);return new URLSearchParams(a)}function ve(e){let a=(e!=null?e:"").split(".")[1];if(!a)return{};let t=a.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(atob(t).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(r)}var rt=(e,a)=>!e||!a?!1:e.contains(a)?!0:rt(e,a.getRootNode().host);import{StreamTypes as Me}from"@mux/playback-core";var nt="mux.com",hi=()=>{try{return"1.1.3"}catch{}return"UNKNOWN"},bi=hi(),Re=()=>bi,ot=(e,{token:a,domain:t=nt}={})=>`https://stream.${t}/${e}.m3u8${Ce(!!a?{token:a}:{redundant_streams:!0})}`,zt=(e,{token:a,thumbnailTime:t,domain:r=nt}={})=>{let i=a==null?t:void 0;return`https://image.${r}/${e}/thumbnail.jpg${Ce({token:a,time:i})}`},qt=(e,{token:a,domain:t=nt}={})=>`https://image.${t}/${e}/storyboard.vtt${Ce({token:a})}`;function st(e){if(e&&/^media-theme-[\w-]+$/.test(e))return e}var pi={crossorigin:"crossOrigin",playsinline:"playsInline"};function jt(e){var a;return(a=pi[e])!=null?a:Yt(e)}var Gt=e=>{var t,r;let{media:a}=e;return(r=(t=a==null?void 0:a._hls)==null?void 0:t.liveSyncPosition)!=null?r:a!=null&&a.seekable.length?a==null?void 0:a.seekable.end(a.seekable.length-1):void 0},lt=e=>{let a=Gt(e);if(a==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}e.currentTime=a},gi=1,fi=5,Zt=3,Wt=.5,Xt=e=>{var n;let{streamType:a}=e,t=Gt(e),r=(n=e.media)==null?void 0:n.currentTime;if(t==null||r==null)return!1;let i=t-r;return a===Me.LL_LIVE||a===Me.LL_DVR?i<=gi*(Zt+Wt):a===Me.LIVE||a===Me.DVR?i<=fi*(Zt+Wt):!1},q,j,x,Pe=class{constructor(a,t){h(this,q,void 0);h(this,j,void 0);h(this,x,[]);A(this,q,a),A(this,j,t)}[Symbol.iterator](){return d(this,x).values()}get length(){return d(this,x).length}get value(){var a;return(a=d(this,x).join(" "))!=null?a:""}set value(a){var t;a!==this.value&&(A(this,x,[]),this.add(...(t=a==null?void 0:a.split(" "))!=null?t:[]))}toString(){return this.value}item(a){return d(this,x)[a]}values(){return d(this,x).values()}keys(){return d(this,x).keys()}forEach(a){d(this,x).forEach(a)}add(...a){var t,r;a.forEach(i=>{this.contains(i)||d(this,x).push(i)}),!(this.value===""&&!((t=d(this,q))!=null&&t.hasAttribute(`${d(this,j)}`)))&&((r=d(this,q))==null||r.setAttribute(`${d(this,j)}`,`${this.value}`))}remove(...a){var t;a.forEach(r=>{d(this,x).splice(d(this,x).indexOf(r),1)}),(t=d(this,q))==null||t.setAttribute(`${d(this,j)}`,`${this.value}`)}contains(a){return d(this,x).includes(a)}toggle(a,t){return typeof t!="undefined"?t?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,t){this.remove(a),this.add(t)}};q=new WeakMap,j=new WeakMap,x=new WeakMap;var Jt=`[mux-player ${Re()}]`;function G(...e){console.warn(Jt,...e)}function O(...e){console.error(Jt,...e)}function Ie(e){var t;let a=(t=e.message)!=null?t:"";if(e.file){let r="https://github.com/muxinc/elements/blob/main/errors/";a+=` ${c("Read more: ")}
2
- ${r}${e.file}`}G(a)}var T={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},X={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},yi=Object.freeze({length:0,start(e){let a=e>>>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(e){let a=e>>>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}}),ki=vi.filter(e=>e!=="error"),Ei=Object.values(T).filter(e=>![T.PLAYSINLINE].includes(e)),Ti=Object.values(X);function ea(e){e.querySelectorAll(":scope > track").forEach(a=>{var t;(t=e.media)==null||t.append(a.cloneNode())}),ki.forEach(a=>{var t;(t=e.media)==null||t.addEventListener(a,r=>{e.dispatchEvent(new Event(r.type))})})}var dt=class extends g.HTMLElement{static get observedAttributes(){return[...Ei,...Ti]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(r=>{var i;(i=this.media)==null||i.append(r.cloneNode())});let a=r=>{for(let i of r)i.type==="childList"&&(i.removedNodes.forEach(n=>{var m,b;let o=(m=this.media)==null?void 0:m.querySelector(`track[src="${n.src}"]`);o&&((b=this.media)==null||b.removeChild(o))}),i.addedNodes.forEach(n=>{var o;(o=this.media)==null||o.append(n.cloneNode())}))};new MutationObserver(a).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(a,t,r){switch(a){case X.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case X.VOLUME:{let i=+r;this.media&&!Number.isNaN(i)&&(this.media.volume=i);return}case X.PLAYBACKRATE:{let i=+r;this.media&&!Number.isNaN(i)&&(this.media.playbackRate=i,this.media.defaultPlaybackRate=i);return}}}play(){var a,t;return(t=(a=this.media)==null?void 0:a.play())!=null?t:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}requestCast(a){var t;return(t=this.media)==null?void 0:t.requestCast(a)}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get paused(){var a,t;return(t=(a=this.media)==null?void 0:a.paused)!=null?t:!0}get duration(){var a,t;return(t=(a=this.media)==null?void 0:a.duration)!=null?t:NaN}get ended(){var a,t;return(t=(a=this.media)==null?void 0:a.ended)!=null?t:!1}get buffered(){var a,t;return(t=(a=this.media)==null?void 0:a.buffered)!=null?t:yi}get readyState(){var a,t;return(t=(a=this.media)==null?void 0:a.readyState)!=null?t:0}get videoWidth(){var a,t;return(t=(a=this.media)==null?void 0:a.videoWidth)!=null?t:0}get videoHeight(){var a,t;return(t=(a=this.media)==null?void 0:a.videoHeight)!=null?t:0}get currentTime(){var a,t;return(t=(a=this.media)==null?void 0:a.currentTime)!=null?t:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,t;return(t=(a=this.media)==null?void 0:a.volume)!=null?t:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,t;return(t=(a=this.media)==null?void 0:a.playbackRate)!=null?t:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=z(this.getAttribute(X.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(X.PLAYBACKRATE,`${a}`):this.removeAttribute(X.PLAYBACKRATE)}get crossOrigin(){return ye(this,T.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(T.CROSSORIGIN,`${a}`)}get autoplay(){return ye(this,T.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(T.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(T.AUTOPLAY)}get loop(){return ye(this,T.LOOP)!=null}set loop(a){a?this.setAttribute(T.LOOP,""):this.removeAttribute(T.LOOP)}get muted(){var a,t;return(t=(a=this.media)==null?void 0:a.muted)!=null?t:!1}set muted(a){this.media&&(this.media.muted=Boolean(a))}get defaultMuted(){return ye(this,T.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(T.MUTED,""):this.removeAttribute(T.MUTED)}get playsInline(){return ye(this,T.PLAYSINLINE)!=null}set playsInline(a){O("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(T.PRELOAD,a):this.removeAttribute(T.PRELOAD)}};function ye(e,a){return e.media?e.media.getAttribute(a):e.getAttribute(a)}var mt=dt;import{MediaTheme as Xi}from"media-chrome";import{TemplateInstance as ra,NodeTemplatePart as De,createProcessor as Ai,AttributeTemplatePart as ut}from"@github/template-parts";var ke=new WeakMap,Ee=class{constructor(a,t){this.element=a;this.type=t;this.element.addEventListener(this.type,this);let r=ke.get(this.element);r&&r.set(this.type,this)}set(a){if(typeof a=="function")this.handleEvent=a.bind(this.element);else if(typeof a=="object"&&typeof a.handleEvent=="function")this.handleEvent=a.handleEvent.bind(a);else{this.element.removeEventListener(this.type,this);let t=ke.get(this.element);t&&t.delete(this.type)}}static for(a){ke.has(a.element)||ke.set(a.element,new Map);let t=a.attributeName.slice(2),r=ke.get(a.element);return r&&r.has(t)?r.get(t):new Ee(a.element,t)}};function xi(e,a){return e instanceof ut&&e.attributeName.startsWith("on")?(Ee.for(e).set(a),e.element.removeAttributeNS(e.attributeNamespace,e.attributeName),!0):!1}function wi(e,a){return a instanceof Te&&e instanceof De?(a.renderInto(e),!0):!1}function Li(e,a){return a instanceof DocumentFragment&&e instanceof De?(a.childNodes.length&&e.replace(...a.childNodes),!0):!1}function $i(e,a){if(e instanceof ut){let t=e.attributeNamespace,r=e.element.getAttributeNS(t,e.attributeName);return String(a)!==r&&(e.value=String(a)),!0}return e.value=String(a),!0}function Si(e,a){if(typeof a=="boolean"&&e instanceof ut){let t=e.attributeNamespace,r=e.element.hasAttributeNS(t,e.attributeName);return a!==r&&(e.booleanValue=a),!0}return!1}function Oi(e,a){return a===!1&&e instanceof De?(e.replace(""),!0):!1}function Ci(e,a){Si(e,a)||xi(e,a)||Oi(e,a)||wi(e,a)||Li(e,a)||$i(e,a)}var ct=new WeakMap,ta=new WeakMap,aa=new WeakMap,Te=class{constructor(a,t,r){this.strings=a;this.values=t;this.processor=r}get template(){if(ct.has(this.strings))return ct.get(this.strings);{let a=document.createElement("template"),t=this.strings.length-1;return a.innerHTML=this.strings.reduce((r,i,n)=>r+i+(n<t?`{{ ${n} }}`:""),""),ct.set(this.strings,a),a}}renderInto(a){let t=this.template;if(ta.get(a)!==t){ta.set(a,t);let i=new ra(t,this.values,this.processor);aa.set(a,i),a instanceof De?a.replace(...i.children):a.appendChild(i);return}let r=aa.get(a);r&&r.update(this.values)}},ia=new Map,Mi=Ai(Ci);function l(e,...a){let t=[""],r=[],i,n=!1,o=(m,b=[])=>{t[t.length-1]=t[t.length-1]+m[0],b.forEach((f,v)=>{(i=f==null?void 0:f.$static$)!==void 0?(i.forEach($=>{o($.strings,$.values)}),t[t.length-1]=t[t.length-1]+m[v+1],n=!0):(r.push(f),t.push(m[v+1]))})};if(o(e,a),n){let m=t.join("$$html$$");e=ia.get(m),e===void 0&&(t.raw=t,ia.set(m,e=t)),a=r}return new Te(e,a,Mi)}function _e(e,a){e.renderInto(a)}function y(e,a){let t=document.createElement("template");return t.innerHTML=e,new ra(t,a)}var ht=(...e)=>({$static$:e.map(a=>a instanceof Te?a:/\w-/.test(a)?{strings:[a]}:{strings:[]})});var oa=`
1
+ var et=(e,a,t)=>{if(!a.has(e))throw TypeError("Cannot "+t)};var d=(e,a,t)=>(et(e,a,"read from private field"),t?t.call(e):a.get(e)),h=(e,a,t)=>{if(a.has(e))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(e):a.set(e,t)},A=(e,a,t,i)=>(et(e,a,"write to private field"),i?i.call(e,t):a.set(e,t),t);var p=(e,a,t)=>(et(e,a,"access private method"),t);var ie=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class e extends ie{}globalThis.DocumentFragment=e}var ge=class extends ie{},tt=class extends ie{},di={get(e){},define(e,a,t){},upgrade(e){},whenDefined(e){return Promise.resolve(ge)}},fe,at=class{constructor(a,t={}){h(this,fe,void 0);A(this,fe,t==null?void 0:t.detail)}get detail(){return d(this,fe)}initCustomEvent(){}};fe=new WeakMap;function mi(e,a){return new ge}var Bt={document:{createElement:mi},DocumentFragment,customElements:di,CustomEvent:at,EventTarget:ie,HTMLElement:ge,HTMLVideoElement:tt},Kt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",g=Kt?Bt:globalThis,S=Kt?Bt.document:globalThis.document;import{MediaController as hr}from"media-chrome";import br,{MediaError as gt,Attributes as c}from"@mux/mux-video";import{StreamTypes as K,PlaybackTypes as Ye,addTextTrack as pr,removeTextTrack as gr}from"@mux/playback-core";import{VideoEvents as yi}from"@mux/mux-video";var ui="en",z={code:ui};var Ut="en";function u(e,a=!0){var r,n;let t=a&&(n=(r=z)==null?void 0:r[e])!=null?n:e,i=a?z.code:Ut;return new it(t,i)}var it=class{constructor(a,t=(i=>(i=z.code)!=null?i:Ut)()){this.message=a,this.locale=t}format(a){return this.message.replace(/\{(\w+)\}/g,(t,i)=>{var r;return(r=a[i])!=null?r:""})}toString(){return this.message}};function Ft(e){let a="";return Object.entries(e).forEach(([t,i])=>{i!=null&&(a+=`${ci(t)}: ${i}; `)}),a?a.trim():void 0}function ci(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Yt(e){return e.replace(/[-_]([a-z])/g,(a,t)=>t.toUpperCase())}function N(e){if(e==null)return;let a=+e;return Number.isNaN(a)?void 0:a}function Ce(e){let a=hi(e).toString();return a?"?"+a:""}function hi(e){let a={};for(let t in e)e[t]!=null&&(a[t]=e[t]);return new URLSearchParams(a)}function ve(e){let a=(e!=null?e:"").split(".")[1];if(!a)return{};let t=a.replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}var rt=(e,a)=>!e||!a?!1:e.contains(a)?!0:rt(e,a.getRootNode().host);import{StreamTypes as Me}from"@mux/playback-core";var nt="mux.com",bi=()=>{try{return"1.2.0"}catch{}return"UNKNOWN"},pi=bi(),Re=()=>pi,ot=(e,{token:a,domain:t=nt}={})=>`https://stream.${t}/${e}.m3u8${Ce(!!a?{token:a}:{redundant_streams:!0})}`,zt=(e,{token:a,thumbnailTime:t,domain:i=nt}={})=>{let r=a==null?t:void 0;return`https://image.${i}/${e}/thumbnail.jpg${Ce({token:a,time:r})}`},qt=(e,{token:a,domain:t=nt}={})=>`https://image.${t}/${e}/storyboard.vtt${Ce({token:a})}`;function st(e){if(e&&/^media-theme-[\w-]+$/.test(e))return e}var gi={crossorigin:"crossOrigin",playsinline:"playsInline"};function jt(e){var a;return(a=gi[e])!=null?a:Yt(e)}var Gt=e=>{var t,i;let{media:a}=e;return(i=(t=a==null?void 0:a._hls)==null?void 0:t.liveSyncPosition)!=null?i:a!=null&&a.seekable.length?a==null?void 0:a.seekable.end(a.seekable.length-1):void 0},lt=e=>{let a=Gt(e);if(a==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}e.currentTime=a},fi=1,vi=5,Zt=3,Wt=.5,Xt=e=>{var n;let{streamType:a}=e,t=Gt(e),i=(n=e.media)==null?void 0:n.currentTime;if(t==null||i==null)return!1;let r=t-i;return a===Me.LL_LIVE||a===Me.LL_DVR?r<=fi*(Zt+Wt):a===Me.LIVE||a===Me.DVR?r<=vi*(Zt+Wt):!1},q,j,x,Pe=class{constructor(a,t){h(this,q,void 0);h(this,j,void 0);h(this,x,[]);A(this,q,a),A(this,j,t)}[Symbol.iterator](){return d(this,x).values()}get length(){return d(this,x).length}get value(){var a;return(a=d(this,x).join(" "))!=null?a:""}set value(a){var t;a!==this.value&&(A(this,x,[]),this.add(...(t=a==null?void 0:a.split(" "))!=null?t:[]))}toString(){return this.value}item(a){return d(this,x)[a]}values(){return d(this,x).values()}keys(){return d(this,x).keys()}forEach(a){d(this,x).forEach(a)}add(...a){var t,i;a.forEach(r=>{this.contains(r)||d(this,x).push(r)}),!(this.value===""&&!((t=d(this,q))!=null&&t.hasAttribute(`${d(this,j)}`)))&&((i=d(this,q))==null||i.setAttribute(`${d(this,j)}`,`${this.value}`))}remove(...a){var t;a.forEach(i=>{d(this,x).splice(d(this,x).indexOf(i),1)}),(t=d(this,q))==null||t.setAttribute(`${d(this,j)}`,`${this.value}`)}contains(a){return d(this,x).includes(a)}toggle(a,t){return typeof t!="undefined"?t?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,t){this.remove(a),this.add(t)}};q=new WeakMap,j=new WeakMap,x=new WeakMap;var Jt=`[mux-player ${Re()}]`;function G(...e){console.warn(Jt,...e)}function O(...e){console.error(Jt,...e)}function Ie(e){var t;let a=(t=e.message)!=null?t:"";if(e.file){let i="https://github.com/muxinc/elements/blob/main/errors/";a+=` ${u("Read more: ")}
2
+ ${i}${e.file}`}G(a)}var T={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},X={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},ea=Object.freeze({length:0,start(e){let a=e>>>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(e){let a=e>>>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}}),Ei=yi.filter(e=>e!=="error"),ki=Object.values(T).filter(e=>![T.PLAYSINLINE].includes(e)),Ti=Object.values(X);function ta(e){e.querySelectorAll(":scope > track").forEach(a=>{var t;(t=e.media)==null||t.append(a.cloneNode())}),Ei.forEach(a=>{var t;(t=e.media)==null||t.addEventListener(a,i=>{e.dispatchEvent(new Event(i.type))})})}var dt=class extends g.HTMLElement{static get observedAttributes(){return[...ki,...Ti]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(i=>{var r;(r=this.media)==null||r.append(i.cloneNode())});let a=i=>{for(let r of i)r.type==="childList"&&(r.removedNodes.forEach(n=>{var m,b;let o=(m=this.media)==null?void 0:m.querySelector(`track[src="${n.src}"]`);o&&((b=this.media)==null||b.removeChild(o))}),r.addedNodes.forEach(n=>{var o;(o=this.media)==null||o.append(n.cloneNode())}))};new MutationObserver(a).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(a,t,i){var r,n;switch(a){case X.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case X.VOLUME:{let o=(r=N(i))!=null?r:1;this.media&&(this.media.volume=o);return}case X.PLAYBACKRATE:{let o=(n=N(i))!=null?n:1;this.media&&(this.media.playbackRate=o,this.media.defaultPlaybackRate=o);return}}}play(){var a,t;return(t=(a=this.media)==null?void 0:a.play())!=null?t:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}requestCast(a){var t;return(t=this.media)==null?void 0:t.requestCast(a)}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get paused(){var a,t;return(t=(a=this.media)==null?void 0:a.paused)!=null?t:!0}get duration(){var a,t;return(t=(a=this.media)==null?void 0:a.duration)!=null?t:NaN}get ended(){var a,t;return(t=(a=this.media)==null?void 0:a.ended)!=null?t:!1}get buffered(){var a,t;return(t=(a=this.media)==null?void 0:a.buffered)!=null?t:ea}get seekable(){var a,t;return(t=(a=this.media)==null?void 0:a.seekable)!=null?t:ea}get readyState(){var a,t;return(t=(a=this.media)==null?void 0:a.readyState)!=null?t:0}get videoWidth(){var a,t;return(t=(a=this.media)==null?void 0:a.videoWidth)!=null?t:0}get videoHeight(){var a,t;return(t=(a=this.media)==null?void 0:a.videoHeight)!=null?t:0}get currentTime(){var a,t;return(t=(a=this.media)==null?void 0:a.currentTime)!=null?t:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,t;return(t=(a=this.media)==null?void 0:a.volume)!=null?t:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,t;return(t=(a=this.media)==null?void 0:a.playbackRate)!=null?t:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=N(this.getAttribute(X.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(X.PLAYBACKRATE,`${a}`):this.removeAttribute(X.PLAYBACKRATE)}get crossOrigin(){return ye(this,T.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(T.CROSSORIGIN,`${a}`)}get autoplay(){return ye(this,T.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(T.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(T.AUTOPLAY)}get loop(){return ye(this,T.LOOP)!=null}set loop(a){a?this.setAttribute(T.LOOP,""):this.removeAttribute(T.LOOP)}get muted(){var a,t;return(t=(a=this.media)==null?void 0:a.muted)!=null?t:!1}set muted(a){this.media&&(this.media.muted=Boolean(a))}get defaultMuted(){return ye(this,T.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(T.MUTED,""):this.removeAttribute(T.MUTED)}get playsInline(){return ye(this,T.PLAYSINLINE)!=null}set playsInline(a){O("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(T.PRELOAD,a):this.removeAttribute(T.PRELOAD)}};function ye(e,a){return e.media?e.media.getAttribute(a):e.getAttribute(a)}var mt=dt;import{MediaTheme as Xi}from"media-chrome";import{TemplateInstance as na,NodeTemplatePart as De,createProcessor as Ai,AttributeTemplatePart as ct}from"@github/template-parts";var Ee=new WeakMap,ke=class{constructor(a,t){this.element=a;this.type=t;this.element.addEventListener(this.type,this);let i=Ee.get(this.element);i&&i.set(this.type,this)}set(a){if(typeof a=="function")this.handleEvent=a.bind(this.element);else if(typeof a=="object"&&typeof a.handleEvent=="function")this.handleEvent=a.handleEvent.bind(a);else{this.element.removeEventListener(this.type,this);let t=Ee.get(this.element);t&&t.delete(this.type)}}static for(a){Ee.has(a.element)||Ee.set(a.element,new Map);let t=a.attributeName.slice(2),i=Ee.get(a.element);return i&&i.has(t)?i.get(t):new ke(a.element,t)}};function xi(e,a){return e instanceof ct&&e.attributeName.startsWith("on")?(ke.for(e).set(a),e.element.removeAttributeNS(e.attributeNamespace,e.attributeName),!0):!1}function wi(e,a){return a instanceof Te&&e instanceof De?(a.renderInto(e),!0):!1}function Li(e,a){return a instanceof DocumentFragment&&e instanceof De?(a.childNodes.length&&e.replace(...a.childNodes),!0):!1}function $i(e,a){if(e instanceof ct){let t=e.attributeNamespace,i=e.element.getAttributeNS(t,e.attributeName);return String(a)!==i&&(e.value=String(a)),!0}return e.value=String(a),!0}function Si(e,a){if(typeof a=="boolean"&&e instanceof ct){let t=e.attributeNamespace,i=e.element.hasAttributeNS(t,e.attributeName);return a!==i&&(e.booleanValue=a),!0}return!1}function Oi(e,a){return a===!1&&e instanceof De?(e.replace(""),!0):!1}function Ci(e,a){Si(e,a)||xi(e,a)||Oi(e,a)||wi(e,a)||Li(e,a)||$i(e,a)}var ut=new WeakMap,aa=new WeakMap,ia=new WeakMap,Te=class{constructor(a,t,i){this.strings=a;this.values=t;this.processor=i}get template(){if(ut.has(this.strings))return ut.get(this.strings);{let a=document.createElement("template"),t=this.strings.length-1;return a.innerHTML=this.strings.reduce((i,r,n)=>i+r+(n<t?`{{ ${n} }}`:""),""),ut.set(this.strings,a),a}}renderInto(a){let t=this.template;if(aa.get(a)!==t){aa.set(a,t);let r=new na(t,this.values,this.processor);ia.set(a,r),a instanceof De?a.replace(...r.children):a.appendChild(r);return}let i=ia.get(a);i&&i.update(this.values)}},ra=new Map,Mi=Ai(Ci);function l(e,...a){let t=[""],i=[],r,n=!1,o=(m,b=[])=>{t[t.length-1]=t[t.length-1]+m[0],b.forEach((f,v)=>{(r=f==null?void 0:f.$static$)!==void 0?(r.forEach($=>{o($.strings,$.values)}),t[t.length-1]=t[t.length-1]+m[v+1],n=!0):(i.push(f),t.push(m[v+1]))})};if(o(e,a),n){let m=t.join("$$html$$");e=ra.get(m),e===void 0&&(t.raw=t,ra.set(m,e=t)),a=i}return new Te(e,a,Mi)}function _e(e,a){e.renderInto(a)}function y(e,a){let t=document.createElement("template");return t.innerHTML=e,new na(t,a)}var ht=(...e)=>({$static$:e.map(a=>a instanceof Te?a:/\w-/.test(a)?{strings:[a]}:{strings:[]})});var sa=`
3
3
  :host {
4
4
  cursor: pointer;
5
5
  }
6
6
  media-time-display {
7
7
  color: inherit;
8
8
  }
9
- `,sa=S.createElement("template");sa.innerHTML=`
9
+ `,la=S.createElement("template");la.innerHTML=`
10
10
  <style>
11
- ${oa}
11
+ ${sa}
12
12
  </style>
13
13
  <media-time-display show-duration></media-time-display>
14
- `;var na=["Enter"," "],Ae,ne,Ne,re=class extends g.HTMLElement{constructor(){var t,r;super();h(this,ne);h(this,Ae,void 0);this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(r=this.shadowRoot)==null?void 0:r.querySelector("media-time-display")}static get observedAttributes(){return["hide-duration","remaining","disabled","aria-disabled"]}toggleTimeDisplay(){var t,r,i;(t=this.timeDisplayEl)!=null&&t.hasAttribute("remaining")?(r=this.timeDisplayEl)==null||r.removeAttribute("remaining"):(i=this.timeDisplayEl)==null||i.setAttribute("remaining","")}connectedCallback(){let t=r=>{let{key:i}=r;if(!na.includes(i)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:i,altKey:n,key:o}=r;if(i||n||!na.includes(o)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),A(this,Ae,setInterval(p(this,ne,Ne).bind(this),200)),requestAnimationFrame(()=>p(this,ne,Ne).call(this))}disconnectedCallback(){clearInterval(d(this,Ae))}attributeChangedCallback(t,r,i){var n,o;t==="hide-duration"&&p(this,ne,Ne).call(this),["remaining","disabled","aria-disabled"].includes(t)&&r!==i&&(i==null?(n=this.timeDisplayEl)==null||n.removeAttribute(t):(o=this.timeDisplayEl)==null||o.setAttribute(t,i))}};Ae=new WeakMap,ne=new WeakSet,Ne=function(){var r,i,n,o;getComputedStyle(this).getPropertyValue("--media-duration-display").trim()==="none"||this.getAttribute("hide-duration")!=null?(r=this.timeDisplayEl)!=null&&r.hasAttribute("show-duration")&&((i=this.timeDisplayEl)==null||i.removeAttribute("show-duration")):(n=this.timeDisplayEl)!=null&&n.hasAttribute("show-duration")||(o=this.timeDisplayEl)==null||o.setAttribute("show-duration","")},re.styles=oa,re.template=sa;g.customElements.get("mxp-time-display")||(g.customElements.define("mxp-time-display",re),g.MxpTimeDisplay=re);var la=`:host(:not([audio])) {
14
+ `;var oa=["Enter"," "],Ae,ne,Ne,re=class extends g.HTMLElement{constructor(){var t,i;super();h(this,ne);h(this,Ae,void 0);this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(i=this.shadowRoot)==null?void 0:i.querySelector("media-time-display")}static get observedAttributes(){return["hide-duration","remaining","disabled","aria-disabled"]}toggleTimeDisplay(){var t,i,r;(t=this.timeDisplayEl)!=null&&t.hasAttribute("remaining")?(i=this.timeDisplayEl)==null||i.removeAttribute("remaining"):(r=this.timeDisplayEl)==null||r.setAttribute("remaining","")}connectedCallback(){let t=i=>{let{key:r}=i;if(!oa.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",i=>{let{metaKey:r,altKey:n,key:o}=i;if(r||n||!oa.includes(o)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),A(this,Ae,setInterval(p(this,ne,Ne).bind(this),200)),requestAnimationFrame(()=>p(this,ne,Ne).call(this))}disconnectedCallback(){clearInterval(d(this,Ae))}attributeChangedCallback(t,i,r){var n,o;t==="hide-duration"&&p(this,ne,Ne).call(this),["remaining","disabled","aria-disabled"].includes(t)&&i!==r&&(r==null?(n=this.timeDisplayEl)==null||n.removeAttribute(t):(o=this.timeDisplayEl)==null||o.setAttribute(t,r))}};Ae=new WeakMap,ne=new WeakSet,Ne=function(){var i,r,n,o;getComputedStyle(this).getPropertyValue("--media-duration-display").trim()==="none"||this.getAttribute("hide-duration")!=null?(i=this.timeDisplayEl)!=null&&i.hasAttribute("show-duration")&&((r=this.timeDisplayEl)==null||r.removeAttribute("show-duration")):(n=this.timeDisplayEl)!=null&&n.hasAttribute("show-duration")||(o=this.timeDisplayEl)==null||o.setAttribute("show-duration","")},re.styles=sa,re.template=la;g.customElements.get("mxp-time-display")||(g.customElements.define("mxp-time-display",re),g.MxpTimeDisplay=re);var da=`:host(:not([audio])) {
15
15
  --secondary-color: transparent;
16
16
  }
17
17
 
@@ -237,43 +237,43 @@ media-time-display {
237
237
  flex-grow: 1;
238
238
  font-size: 21px;
239
239
  }
240
- `;var da=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
240
+ `;var ma=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
241
241
  <path d="M13.19 14.22a.25.25 0 0 0-.38 0l-5.46 6.37a.25.25 0 0 0 .19.41h10.92a.25.25 0 0 0 .19-.41l-5.46-6.37Z"/>
242
242
  <path d="M22 3H4a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h2.94L8 16.75H4.25V4.25h17.5v12.5H18L19.06 18H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
243
243
  </svg>
244
- `;var ma=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
244
+ `;var ua=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
245
245
  <path d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-1.81-.12-4.67-.18-7.53-.18-2.86 0-5.72.06-7.53.18a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c1.81.12 4.67.18 7.53.18 2.86 0 5.72-.06 7.53-.18a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.137-.21-8.283 0-12.42a1.11 1.11 0 0 1 .91-1.11c1.67-.11 4.43-.18 7.43-.18s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.137.21 8.283 0 12.42ZM10.843 14a1.55 1.55 0 0 1-.76.18 1.57 1.57 0 0 1-.71-.18 1.69 1.69 0 0 1-.57-.42 2.099 2.099 0 0 1-.38-.58 2.47 2.47 0 0 1 0-1.64 2 2 0 0 1 .39-.66 1.73 1.73 0 0 1 .58-.42c.23-.103.479-.158.73-.16.241-.004.48.044.7.14.199.088.373.222.51.39l1.08-.89a2.179 2.179 0 0 0-.47-.44 2.81 2.81 0 0 0-.54-.32 2.91 2.91 0 0 0-.58-.15 2.71 2.71 0 0 0-.56 0 4.08 4.08 0 0 0-1.38.15 3.27 3.27 0 0 0-1.09.67 3.14 3.14 0 0 0-.71 1.06 3.62 3.62 0 0 0-.26 1.39 3.57 3.57 0 0 0 .26 1.38 3 3 0 0 0 .71 1.06c.316.293.687.52 1.09.67.443.16.91.238 1.38.23a3.2 3.2 0 0 0 1.28-.27c.401-.183.747-.47 1-.83l-1.17-.88a1.42 1.42 0 0 1-.53.52Zm6.62 0a1.58 1.58 0 0 1-.76.18 1.54 1.54 0 0 1-.7-.18 1.69 1.69 0 0 1-.57-.42 2.12 2.12 0 0 1-.43-.58 2.29 2.29 0 0 1 .39-2.3 1.84 1.84 0 0 1 1.32-.58c.241-.003.48.045.7.14.199.088.373.222.51.39l1.08-.92a2.43 2.43 0 0 0-.47-.44 3.22 3.22 0 0 0-.53-.29 2.999 2.999 0 0 0-.57-.15 2.87 2.87 0 0 0-.57 0 4.06 4.06 0 0 0-1.36.15 3.17 3.17 0 0 0-1.09.67 3 3 0 0 0-.72 1.06 3.62 3.62 0 0 0-.25 1.39 3.57 3.57 0 0 0 .25 1.38c.16.402.405.764.72 1.06a3.17 3.17 0 0 0 1.09.67c.44.16.904.237 1.37.23.441 0 .877-.092 1.28-.27a2.45 2.45 0 0 0 1-.83l-1.15-.85a1.49 1.49 0 0 1-.54.49Z"/>
246
246
  </svg>
247
247
  `;var ca=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
248
248
  <path d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.41 10.1a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 4 4 0 0 1-1.28-.83 3.67 3.67 0 0 1-.84-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.53 3.53 0 0 1 .84-1.21 3.89 3.89 0 0 1 1.29-.8 4.76 4.76 0 0 1 1.63-.27 4.06 4.06 0 0 1 1.35.24c.225.091.44.205.64.34a2.7 2.7 0 0 1 .55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.35 2.35 0 0 0-.46.77 2.78 2.78 0 0 0-.16 1c-.009.34.046.68.16 1 .104.283.26.545.46.77.188.21.415.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.88 2.88 0 0 1-1.22 1.01Zm7.52 0a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 3.89 3.89 0 0 1-1.28-.83 3.55 3.55 0 0 1-.85-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.43 3.43 0 0 1 .85-1.25 3.75 3.75 0 0 1 1.28-.8 4.76 4.76 0 0 1 1.63-.27 4 4 0 0 1 1.35.24c.225.091.44.205.64.34.21.144.395.32.55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.352 2.352 0 0 0-.46.77 3.01 3.01 0 0 0-.16 1c-.003.34.05.678.16 1 .108.282.263.542.46.77.188.21.416.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.82 2.82 0 0 1-1.21 1.05Z"/>
249
249
  </svg>
250
- `;var ua=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
250
+ `;var ha=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
251
251
  <path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z"/>
252
252
  <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
253
253
  <path d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
254
254
  </svg>
255
- `;var ha=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
255
+ `;var ba=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
256
256
  <path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z"/>
257
257
  <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
258
258
  <path d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
259
259
  <path d="M20.5 5.5h-15v5.811c3.52.906 6.283 3.67 7.189 7.19H20.5V5.5Z"/>
260
260
  </svg>
261
- `;var ba=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
261
+ `;var pa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
262
262
  <path d="M20.25 14.5a.76.76 0 0 0-.75.75v4.25h-4.25a.75.75 0 1 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5a.76.76 0 0 0-.75-.75Zm0-11.5h-5a.76.76 0 0 0-.75.75.76.76 0 0 0 .75.75h4.25v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75ZM8.75 19.5H4.5v-4.25a.76.76 0 0 0-.75-.75.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75h5a.75.75 0 1 0 0-1.5Zm0-16.5h-5a.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75.76.76 0 0 0 .75-.75V4.5h4.25a.76.76 0 0 0 .75-.75.76.76 0 0 0-.75-.75Z"/>
263
263
  </svg>
264
- `;var pa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
264
+ `;var ga=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
265
265
  <path d="M20.25 14.5h-5a.76.76 0 0 0-.75.75v5a.75.75 0 1 0 1.5 0V16h4.25a.75.75 0 1 0 0-1.5Zm-5-5h5a.75.75 0 1 0 0-1.5H16V3.75a.75.75 0 1 0-1.5 0v5a.76.76 0 0 0 .75.75Zm-6.5 5h-5a.75.75 0 1 0 0 1.5H8v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75Zm0-11.5a.76.76 0 0 0-.75.75V8H3.75a.75.75 0 0 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5A.76.76 0 0 0 8.75 3Z"/>
266
266
  </svg>
267
- `;var ga=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
267
+ `;var fa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
268
268
  <path d="M6 19.5a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v15ZM14.5 4a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3Z"/>
269
269
  </svg>
270
- `;var fa=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
270
+ `;var va=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
271
271
  <path d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"/>
272
272
  </svg>
273
- `;var va=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
273
+ `;var ya=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
274
274
  <path d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"/>
275
275
  </svg>
276
- `;var ya=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
276
+ `;var Ea=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
277
277
  <path d="m6.73 20.93 14.05-8.54a.46.46 0 0 0 0-.78L6.73 3.07a.48.48 0 0 0-.73.39v17.07a.48.48 0 0 0 .73.4Z"/>
278
278
  </svg>
279
279
  `;var ka=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
@@ -286,7 +286,7 @@ media-time-display {
286
286
  {{value}}
287
287
  </text>
288
288
  </svg>
289
- `;var Ea=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
289
+ `;var Ta=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
290
290
  <path d="M11 6V3l5.61 4L11 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 11 6Z"/>
291
291
  <text
292
292
  class="value"
@@ -296,21 +296,21 @@ media-time-display {
296
296
  {{value}}
297
297
  </text>
298
298
  </svg>
299
- `;var Ta=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
299
+ `;var Aa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
300
300
  <path d="m11.14 4.86-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.21a.5.5 0 0 0-.86-.35Zm2.74-1.56v1.52A7.52 7.52 0 0 1 19.47 12a7.52 7.52 0 0 1-5.59 7.18v1.52A9 9 0 0 0 21 12a9 9 0 0 0-7.12-8.7Zm3.56 8.7a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
301
301
  </svg>
302
- `;var Aa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
302
+ `;var xa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
303
303
  <path d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
304
304
  </svg>
305
- `;var xa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
305
+ `;var wa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
306
306
  <path d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
307
307
  </svg>
308
- `;var wa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
308
+ `;var La=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
309
309
  <path d="m3 4.05 4.48 4.47-.33.33a.49.49 0 0 1-.36.15H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.48.48 0 0 0 .36.15.5.5 0 0 0 .5-.5v-5.75l4.67 4.66a7.71 7.71 0 0 1-2.79 1.47v1.52a9.32 9.32 0 0 0 3.87-1.91L20 21l1-1L4.06 3 3 4.05Zm5.36 5.36 2.39 2.39V17L8 14.26a1.74 1.74 0 0 0-1.24-.51H4.25v-3.5h2.54A1.74 1.74 0 0 0 8 9.74l.36-.33ZM19.47 12a7.19 7.19 0 0 1-.89 3.47l1.11 1.1A8.64 8.64 0 0 0 21 12a9 9 0 0 0-7.12-8.7v1.52A7.52 7.52 0 0 1 19.47 12ZM12 8.88V5.21a.5.5 0 0 0-.5-.5.48.48 0 0 0-.36.15L9.56 6.44 12 8.88ZM15.91 12a4.284 4.284 0 0 1-.07.72l1.22 1.22a5.2 5.2 0 0 0 .38-1.94 5.49 5.49 0 0 0-3.56-5.1v1.66A4 4 0 0 1 15.91 12Z"/>
310
310
  </svg>
311
- `;var La=()=>y(da),$a=()=>y(ma),Sa=()=>y(ca),Oa=()=>y(ua),Ca=()=>y(ha),Ma=()=>y(ba),Pa=()=>y(pa),Ra=()=>y(ga),Ia=()=>y(fa),Da=()=>y(va),_a=()=>y(ya),Na=e=>y(ka,e),Va=e=>y(Ea,e),Ha=()=>y(Ta),Ba=()=>y(Aa),Ka=()=>y(xa),Ua=()=>y(wa);import{StreamTypes as w}from"@mux/playback-core";var N={LG:"large",SM:"small",XS:"extra-small"},He,Fa,Ve=class extends Xi{constructor(){super();h(this,He);p(this,He,Fa).call(this)}static get observedAttributes(){return["audio","has-open-dialog","has-src","nohotkeys","hotkeys","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset","playbackrates","default-show-remaining-time","poster","placeholder","title"]}attributeChangedCallback(){this.render()}render(){var r,i,n;let t={hasSrc:this.hasAttribute("has-src"),isDialogOpen:this.hasAttribute("has-open-dialog"),audio:this.hasAttribute("audio"),nohotkeys:this.hasAttribute("nohotkeys"),hotkeys:this.getAttribute("hotkeys"),streamType:this.getAttribute("stream-type"),playerSize:this.getAttribute("player-size"),defaultHiddenCaptions:this.hasAttribute("default-hidden-captions"),forwardSeekOffset:this.getAttribute("forward-seek-offset"),backwardSeekOffset:this.getAttribute("backward-seek-offset"),playbackRates:this.getAttribute("playbackrates"),defaultShowRemainingTime:this.hasAttribute("default-show-remaining-time"),poster:this.getAttribute("poster"),placeholder:this.getAttribute("placeholder"),title:this.getAttribute("title")};t.nohotkeys=t.nohotkeys||!t.hasSrc||t.isDialogOpen,[w.LIVE,w.LL_LIVE,w.DVR,w.LL_DVR].includes(t.streamType)&&(t.hotkeys=t.hotkeys||"",t.hotkeys+=" noarrowleft noarrowright"),_e(l`
311
+ `;var $a=()=>y(ma),Sa=()=>y(ua),Oa=()=>y(ca),Ca=()=>y(ha),Ma=()=>y(ba),Pa=()=>y(pa),Ra=()=>y(ga),Ia=()=>y(fa),Da=()=>y(va),_a=()=>y(ya),Na=()=>y(Ea),Va=e=>y(ka,e),Ha=e=>y(Ta,e),Ba=()=>y(Aa),Ka=()=>y(xa),Ua=()=>y(wa),Fa=()=>y(La);import{StreamTypes as w}from"@mux/playback-core";var V={LG:"large",SM:"small",XS:"extra-small"},He,Ya,Ve=class extends Xi{constructor(){super();h(this,He);p(this,He,Ya).call(this)}static get observedAttributes(){return["audio","has-open-dialog","has-src","nohotkeys","hotkeys","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset","playbackrates","default-show-remaining-time","poster","placeholder","title"]}attributeChangedCallback(){this.render()}render(){var i,r,n;let t={hasSrc:this.hasAttribute("has-src"),isDialogOpen:this.hasAttribute("has-open-dialog"),audio:this.hasAttribute("audio"),nohotkeys:this.hasAttribute("nohotkeys"),hotkeys:this.getAttribute("hotkeys"),streamType:this.getAttribute("stream-type"),playerSize:this.getAttribute("player-size"),defaultHiddenCaptions:this.hasAttribute("default-hidden-captions"),forwardSeekOffset:this.getAttribute("forward-seek-offset"),backwardSeekOffset:this.getAttribute("backward-seek-offset"),playbackRates:this.getAttribute("playbackrates"),defaultShowRemainingTime:this.hasAttribute("default-show-remaining-time"),poster:this.getAttribute("poster"),placeholder:this.getAttribute("placeholder"),title:this.getAttribute("title")};t.nohotkeys=t.nohotkeys||!t.hasSrc||t.isDialogOpen,[w.LIVE,w.LL_LIVE,w.DVR,w.LL_DVR].includes(t.streamType)&&(t.hotkeys=t.hotkeys||"",t.hotkeys+=" noarrowleft noarrowright"),_e(l`
312
312
  <style>
313
- ${la}
313
+ ${da}
314
314
  </style>
315
315
  <media-controller
316
316
  gestures-disabled="${!t.hasSrc||t.isDialogOpen}"
@@ -324,59 +324,59 @@ media-time-display {
324
324
  <media-poster-image
325
325
  slot="poster"
326
326
  part="poster"
327
- src="${(r=t.poster)!=null?r:!1}"
328
- placeholder-src="${(i=t.placeholder)!=null?i:!1}"
327
+ src="${(i=t.poster)!=null?i:!1}"
328
+ placeholder-src="${(r=t.placeholder)!=null?r:!1}"
329
329
  ></media-poster-image>
330
330
  <media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
331
331
  ${Ji(t)}
332
332
  <slot></slot>
333
333
  </media-controller>
334
- `,this.shadowRoot),(n=this.shadowRoot)==null||n.querySelectorAll("*").forEach(o=>{if(!o.localName.includes("-"))return;let m=o.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!m)return;let[,,b,f]=m;b==="text"&&o.classList.contains("title-display")&&(b="title");let v=o.closest('[slot="top-chrome"]')?"top":o.closest('[slot="centered-chrome"]')?"center":"bottom";o.setAttribute("part",`${v} ${b} ${f}`)})}};He=new WeakSet,Fa=function(){var t,r,i;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--primary-color",syntax:"<color>",inherits:!0,initialValue:"white"}),(r=window==null?void 0:window.CSS)==null||r.registerProperty({name:"--secondary-color",syntax:"<color>",inherits:!0,initialValue:"transparent"}),(i=window==null?void 0:window.CSS)==null||i.registerProperty({name:"--controls-backdrop-color",syntax:"<color>",inherits:!0,initialValue:"rgba(0, 0, 0, 0.6)"})}catch{}};g.customElements.get("media-theme-mux")||g.customElements.define("media-theme-mux",Ve);var Ji=e=>{let{streamType:a,playerSize:t,audio:r}=e;if(r)switch(a){case w.LIVE:case w.LL_LIVE:return tr(e);case w.DVR:case w.LL_DVR:return er(e);case w.ON_DEMAND:default:return Qi(e)}switch(a){case w.LIVE:case w.LL_LIVE:switch(t){case N.LG:return or(e);case N.SM:return nr(e);case N.XS:return rr(e)}case w.DVR:case w.LL_DVR:switch(t){case N.LG:return dr(e);case N.SM:return lr(e);case N.XS:return sr(e)}case w.ON_DEMAND:default:switch(t){case N.LG:return ir(e);case N.SM:return ar(e);case N.XS:return bt(e)}}},L=e=>l`
334
+ `,this.shadowRoot),(n=this.shadowRoot)==null||n.querySelectorAll("*").forEach(o=>{if(!o.localName.includes("-"))return;let m=o.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!m)return;let[,,b,f]=m;b==="text"&&o.classList.contains("title-display")&&(b="title");let v=o.closest('[slot="top-chrome"]')?"top":o.closest('[slot="centered-chrome"]')?"center":"bottom";o.setAttribute("part",`${v} ${b} ${f}`)})}};He=new WeakSet,Ya=function(){var t,i,r;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--primary-color",syntax:"<color>",inherits:!0,initialValue:"white"}),(i=window==null?void 0:window.CSS)==null||i.registerProperty({name:"--secondary-color",syntax:"<color>",inherits:!0,initialValue:"transparent"}),(r=window==null?void 0:window.CSS)==null||r.registerProperty({name:"--controls-backdrop-color",syntax:"<color>",inherits:!0,initialValue:"rgba(0, 0, 0, 0.6)"})}catch{}};g.customElements.get("media-theme-mux")||g.customElements.define("media-theme-mux",Ve);var Ji=e=>{let{streamType:a,playerSize:t,audio:i}=e;if(i)switch(a){case w.LIVE:case w.LL_LIVE:return tr(e);case w.DVR:case w.LL_DVR:return er(e);case w.ON_DEMAND:default:return Qi(e)}switch(a){case w.LIVE:case w.LL_LIVE:switch(t){case V.LG:return or(e);case V.SM:return nr(e);case V.XS:return rr(e)}case w.DVR:case w.LL_DVR:switch(t){case V.LG:return dr(e);case V.SM:return lr(e);case V.XS:return sr(e)}case w.ON_DEMAND:default:switch(t){case V.LG:return ir(e);case V.SM:return ar(e);case V.XS:return bt(e)}}},L=e=>l`
335
335
  <media-play-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
336
- ${_a()}
337
- ${Ra()}
336
+ ${Na()}
337
+ ${Ia()}
338
338
  </media-play-button>`,oe=({backwardSeekOffset:e,hasSrc:a,isDialogOpen:t})=>l`
339
339
  <media-seek-backward-button seek-offset="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
340
- ${Na({value:e})}
340
+ ${Va({value:e})}
341
341
  </media-seek-backward-button>`,se=({forwardSeekOffset:e,hasSrc:a,isDialogOpen:t})=>l`
342
342
  <media-seek-forward-button seek-offset="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
343
- ${Va({value:e})}
343
+ ${Ha({value:e})}
344
344
  </media-seek-forward-button>`,C=({isDialogOpen:e})=>l`
345
345
  <media-mute-button disabled="${e}" aria-disabled="${e&&"true"}">
346
- ${Ha()}
347
- ${Ka()}
348
346
  ${Ba()}
349
347
  ${Ua()}
348
+ ${Ka()}
349
+ ${Fa()}
350
350
  </media-mute-button>`,J=({defaultHiddenCaptions:e,isDialogOpen:a})=>l`
351
351
  <media-captions-button default-showing="${!e}" disabled="${a}" aria-disabled="${a&&"true"}">
352
- ${$a()}
353
352
  ${Sa()}
353
+ ${Oa()}
354
354
  </media-captions-button>`,M=e=>l`
355
355
  <media-airplay-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
356
- ${La()}
356
+ ${$a()}
357
357
  </media-airplay-button>`,Q=e=>l`
358
358
  <media-pip-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
359
- ${Ia()}
360
359
  ${Da()}
360
+ ${_a()}
361
361
  </media-pip-button>`,ee=e=>l`
362
362
  <media-fullscreen-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
363
- ${Ma()}
364
363
  ${Pa()}
364
+ ${Ra()}
365
365
  </media-fullscreen-button>`,P=e=>l`
366
366
  <media-cast-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
367
- ${Oa()}
368
367
  ${Ca()}
368
+ ${Ma()}
369
369
  </media-cast-button>`,Be=({playbackRates:e,isDialogOpen:a})=>l`
370
370
  <media-playback-rate-button rates="${e!=null?e:!1}" disabled="${a}" aria-disabled="${a&&"true"}">
371
- </media-playback-rate-button>`,V=({isDialogOpen:e})=>l`
371
+ </media-playback-rate-button>`,H=({isDialogOpen:e})=>l`
372
372
  <media-volume-range disabled="${e}" aria-disabled="${e&&"true"}">
373
373
  </media-volume-range>`,le=e=>l`
374
374
  <media-time-range disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
375
375
  </media-time-range>`,Ke=({defaultShowRemainingTime:e,hasSrc:a,isDialogOpen:t})=>l`
376
376
  <mxp-time-display remaining="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
377
- </mxp-time-display>`,H=({title:e})=>l`
377
+ </mxp-time-display>`,B=({title:e})=>l`
378
378
  <media-text-display part="title" class="title-display">${e}</media-text-display>`,Qi=e=>l`
379
- ${e.title?`<media-control-bar>${H(e)}</media-control-bar>`:l``}
379
+ ${e.title?`<media-control-bar>${B(e)}</media-control-bar>`:l``}
380
380
  <media-control-bar>
381
381
  ${L(e)}
382
382
  ${oe(e)}
@@ -384,13 +384,13 @@ media-time-display {
384
384
  ${Ke(e)}
385
385
  ${le(e)}
386
386
  ${C(e)}
387
- ${V(e)}
387
+ ${H(e)}
388
388
  ${Be(e)}
389
389
  ${M(e)}
390
390
  ${P(e)}
391
391
  </media-control-bar>
392
392
  `,er=e=>l`
393
- ${e.title?`<media-control-bar>${H(e)}</media-control-bar>`:l``}
393
+ ${e.title?`<media-control-bar>${B(e)}</media-control-bar>`:l``}
394
394
  <media-control-bar>
395
395
  ${L(e)}
396
396
  <slot name="seek-live"></slot>
@@ -399,18 +399,18 @@ media-time-display {
399
399
  ${Ke(e)}
400
400
  ${le(e)}
401
401
  ${C(e)}
402
- ${V(e)}
402
+ ${H(e)}
403
403
  ${Be(e)}
404
404
  ${M(e)}
405
405
  ${P(e)}
406
406
  </media-control-bar>
407
407
  `,tr=e=>l`
408
- ${e.title?`<media-control-bar>${H(e)}</media-control-bar>`:l``}
408
+ ${e.title?`<media-control-bar>${B(e)}</media-control-bar>`:l``}
409
409
  <media-control-bar>
410
410
  ${L(e)}
411
411
  <slot name="seek-live"></slot>
412
412
  ${C(e)}
413
- ${V(e)}
413
+ ${H(e)}
414
414
  ${M(e)}
415
415
  ${P(e)}
416
416
  </media-control-bar>
@@ -432,7 +432,7 @@ media-time-display {
432
432
  </media-control-bar>
433
433
  `,ar=e=>l`
434
434
  <media-control-bar slot="top-chrome">
435
- ${e.title?H(e):l``}
435
+ ${e.title?B(e):l``}
436
436
  <div class="spacer"></div>
437
437
  ${J(e)}
438
438
  ${M(e)}
@@ -448,7 +448,7 @@ media-time-display {
448
448
  <media-control-bar>
449
449
  ${Ke(e)}
450
450
  ${C(e)}
451
- ${V(e)}
451
+ ${H(e)}
452
452
  <div class="spacer"></div>
453
453
  ${Be(e)}
454
454
  ${ee(e)}
@@ -456,7 +456,7 @@ media-time-display {
456
456
  </media-control-bar>
457
457
  `,ir=e=>l`
458
458
  <media-control-bar slot="top-chrome">
459
- ${e.title?H(e):l``}
459
+ ${e.title?B(e):l``}
460
460
  </media-control-bar>
461
461
  <div slot="centered-chrome" class="center-controls">
462
462
  ${L(e)}
@@ -468,7 +468,7 @@ media-time-display {
468
468
  ${se(e)}
469
469
  ${Ke(e)}
470
470
  ${C(e)}
471
- ${V(e)}
471
+ ${H(e)}
472
472
  <div class="spacer"></div>
473
473
  ${Be(e)}
474
474
  ${J(e)}
@@ -480,7 +480,7 @@ media-time-display {
480
480
  </media-control-bar>
481
481
  `,rr=bt,nr=e=>l`
482
482
  <media-control-bar slot="top-chrome">
483
- ${e.title?H(e):l``}
483
+ ${e.title?B(e):l``}
484
484
  <div class="spacer"></div>
485
485
  ${J(e)}
486
486
  ${M(e)}
@@ -492,21 +492,21 @@ media-time-display {
492
492
  </div>
493
493
  <media-control-bar>
494
494
  ${C(e)}
495
- ${V(e)}
495
+ ${H(e)}
496
496
  <slot name="seek-live"></slot>
497
497
  <div class="spacer"></div>
498
498
  ${ee(e)}
499
499
  </media-control-bar>
500
500
  `,or=e=>l`
501
501
  <media-control-bar slot="top-chrome">
502
- ${e.title?H(e):l``}
502
+ ${e.title?B(e):l``}
503
503
  </media-control-bar>
504
504
  <div slot="centered-chrome" class="center-controls">
505
505
  ${L(e)}
506
506
  </div>
507
507
  <media-control-bar>
508
508
  ${C(e)}
509
- ${V(e)}
509
+ ${H(e)}
510
510
  <slot name="seek-live"></slot>
511
511
  <div class="spacer"></div>
512
512
  ${J(e)}
@@ -517,7 +517,7 @@ media-time-display {
517
517
  </media-control-bar>
518
518
  `,sr=bt,lr=e=>l`
519
519
  <media-control-bar slot="top-chrome">
520
- ${e.title?H(e):l``}
520
+ ${e.title?B(e):l``}
521
521
  <div class="spacer"></div>
522
522
  ${J(e)}
523
523
  ${M(e)}
@@ -532,7 +532,7 @@ media-time-display {
532
532
  ${le(e)}
533
533
  <media-control-bar>
534
534
  ${C(e)}
535
- ${V(e)}
535
+ ${H(e)}
536
536
  <slot name="seek-live"></slot>
537
537
  <div class="spacer"></div>
538
538
  ${ee(e)}
@@ -540,7 +540,7 @@ media-time-display {
540
540
  </media-control-bar>
541
541
  `,dr=e=>l`
542
542
  <media-control-bar slot="top-chrome">
543
- ${e.title?H(e):l``}
543
+ ${e.title?B(e):l``}
544
544
  </media-control-bar>
545
545
  <div slot="centered-chrome" class="center-controls">
546
546
  ${L(e)}
@@ -551,7 +551,7 @@ media-time-display {
551
551
  ${oe(e)}
552
552
  ${se(e)}
553
553
  ${C(e)}
554
- ${V(e)}
554
+ ${H(e)}
555
555
  <slot name="seek-live"></slot>
556
556
  <div class="spacer"></div>
557
557
  ${J(e)}
@@ -561,7 +561,7 @@ media-time-display {
561
561
  ${ee(e)}
562
562
  <div class="padding-2"></div>
563
563
  </media-control-bar>
564
- `;var Za=`
564
+ `;var Wa=`
565
565
  :host {
566
566
  z-index: 100;
567
567
  display: flex;
@@ -597,13 +597,7 @@ media-time-display {
597
597
  pointer-events: none !important;
598
598
  }
599
599
 
600
- /*
601
- Only show outline when keyboard focusing.
602
- https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo
603
- :host-context support is bad https://caniuse.com/mdn-css_selectors_host-context
604
- */
605
- :host-context([media-keyboard-control]) ::slotted(:focus),
606
- :host-context([media-keyboard-control]) :focus {
600
+ :focus-visible {
607
601
  box-shadow: 0 0 0 2px rgba(27, 127, 204, 0.9);
608
602
  }
609
603
 
@@ -619,15 +613,15 @@ media-time-display {
619
613
  text-align: center;
620
614
  line-height: 1.4;
621
615
  }
622
- `,Wa=S.createElement("template");Wa.innerHTML=`
616
+ `,za=S.createElement("template");za.innerHTML=`
623
617
  <style>
624
- ${Za}
618
+ ${Wa}
625
619
  </style>
626
620
 
627
621
  <div class="dialog">
628
622
  <slot></slot>
629
623
  </div>
630
- `;var Y=class extends g.HTMLElement{constructor(){var t;super();this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),Ya(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),mr(this))}attributeChangedCallback(t,r,i){t==="open"&&r!==i&&(i!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&Ya(this)}};Y.styles=Za,Y.template=Wa,Y.observedAttributes=["open"];function Ya(e){let a=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(e.dispatchEvent(a),a.defaultPrevented)return;let t=e.querySelector("[autofocus]:not([disabled])");!t&&e.tabIndex>=0&&(t=e),t||(t=za(e.shadowRoot)),e._previouslyFocusedElement=S.activeElement,S.activeElement instanceof HTMLElement&&S.activeElement.blur(),e.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function za(e){let t=["button","input","keygen","select","textarea"].map(function(i){return i+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let r=e==null?void 0:e.querySelector(t.join(", "));if(!r&&"attachShadow"in Element.prototype){let i=(e==null?void 0:e.querySelectorAll("*"))||[];for(let n=0;n<i.length&&!(i[n].tagName&&i[n].shadowRoot&&(r=za(i[n].shadowRoot),r));n++);}return r}function mr(e){e._previouslyFocusedElement instanceof HTMLElement&&e._previouslyFocusedElement.focus()}g.customElements.get("media-dialog")||(g.customElements.define("media-dialog",Y),g.MediaDialog=Y);var pt=Y;var qa=S.createElement("template");qa.innerHTML=`
624
+ `;var Z=class extends g.HTMLElement{constructor(){var t;super();this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),Za(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),mr(this))}attributeChangedCallback(t,i,r){t==="open"&&i!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&Za(this)}};Z.styles=Wa,Z.template=za,Z.observedAttributes=["open"];function Za(e){let a=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(e.dispatchEvent(a),a.defaultPrevented)return;let t=e.querySelector("[autofocus]:not([disabled])");!t&&e.tabIndex>=0&&(t=e),t||(t=qa(e.shadowRoot)),e._previouslyFocusedElement=S.activeElement,S.activeElement instanceof HTMLElement&&S.activeElement.blur(),e.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function qa(e){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let i=e==null?void 0:e.querySelector(t.join(", "));if(!i&&"attachShadow"in Element.prototype){let r=(e==null?void 0:e.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(i=qa(r[n].shadowRoot),i));n++);}return i}function mr(e){e._previouslyFocusedElement instanceof HTMLElement&&e._previouslyFocusedElement.focus()}g.customElements.get("media-dialog")||(g.customElements.define("media-dialog",Z),g.MediaDialog=Z);var pt=Z;var ja=S.createElement("template");ja.innerHTML=`
631
625
  <style>
632
626
  ${pt.styles}
633
627
 
@@ -658,7 +652,7 @@ media-time-display {
658
652
  </svg>
659
653
  </button>
660
654
  </slot>
661
- `;var xe=class extends pt{constructor(){var a,t;super(),(t=(a=this.shadowRoot)==null?void 0:a.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};xe.template=qa;g.customElements.get("mxp-dialog")||(g.customElements.define("mxp-dialog",xe),g.MxpDialog=xe);var ja=`:host {
655
+ `;var xe=class extends pt{constructor(){var a,t;super(),(t=(a=this.shadowRoot)==null?void 0:a.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};xe.template=ja;g.customElements.get("mxp-dialog")||(g.customElements.define("mxp-dialog",xe),g.MxpDialog=xe);var Ga=`:host {
662
656
  display: inline-block;
663
657
  width: 100%;
664
658
  }
@@ -809,16 +803,16 @@ a {
809
803
  ::part(title display) {
810
804
  display: var(--media-controls, var(--media-title-display));
811
805
  }
812
- `;import{StreamTypes as de}from"@mux/playback-core";var Ja=e=>l`
806
+ `;import{StreamTypes as de}from"@mux/playback-core";var Qa=e=>l`
813
807
  <style>
814
- ${ja}
808
+ ${Ga}
815
809
  </style>
816
- ${ur(e)}
817
- `,Ga=e=>[de.LIVE,de.LL_LIVE].includes(e.streamType),Xa=e=>[de.LIVE,de.LL_LIVE,de.DVR,de.LL_DVR].includes(e.streamType),ur=e=>{var a,t,r,i,n,o,m,b,f,v,$,F,k,I,D,_,E,Oe,pe,ae,yt,kt,Et,Tt,At,xt,wt,Lt,$t,St,Ot,Ct,Mt,Pt,Rt,It,Dt,_t,Nt,Vt;return l`
810
+ ${cr(e)}
811
+ `,Xa=e=>[de.LIVE,de.LL_LIVE].includes(e.streamType),Ja=e=>[de.LIVE,de.LL_LIVE,de.DVR,de.LL_DVR].includes(e.streamType),cr=e=>{var a,t,i,r,n,o,m,b,f,v,$,Y,E,I,D,_,k,Oe,pe,ae,yt,Et,kt,Tt,At,xt,wt,Lt,$t,St,Ot,Ct,Mt,Pt,Rt,It,Dt,_t,Nt,Vt;return l`
818
812
  <${ht((a=st(e.theme))!=null?a:"media-theme-mux")}
819
813
  has-src="${(t=e.hasSrc)!=null?t:!1}"
820
- has-open-dialog="${(r=e.isDialogOpen)!=null?r:!1}"
821
- nohotkeys="${(i=e.noHotKeys)!=null?i:!1}"
814
+ has-open-dialog="${(i=e.isDialogOpen)!=null?i:!1}"
815
+ nohotkeys="${(r=e.noHotKeys)!=null?r:!1}"
822
816
  audio="${(n=e.audio)!=null?n:!1}"
823
817
  style="${(o=Ft({"--primary-color":e.primaryColor,"--secondary-color":e.secondaryColor}))!=null?o:!1}"
824
818
  class="size-${e.playerSize}${e.secondaryColor?" two-tone":""}"
@@ -827,12 +821,12 @@ a {
827
821
  default-hidden-captions="${(f=e.defaultHiddenCaptions)!=null?f:!1}"
828
822
  forward-seek-offset="${(v=e.forwardSeekOffset)!=null?v:!1}"
829
823
  backward-seek-offset="${($=e.backwardSeekOffset)!=null?$:!1}"
830
- playbackrates="${(F=e.playbackRates)!=null?F:!1}"
831
- default-show-remaining-time="${(k=e.defaultShowRemainingTime)!=null?k:!1}"
824
+ playbackrates="${(Y=e.playbackRates)!=null?Y:!1}"
825
+ default-show-remaining-time="${(E=e.defaultShowRemainingTime)!=null?E:!1}"
832
826
  title="${(I=e.title)!=null?I:!1}"
833
827
  hotkeys="${(D=e.hotKeys)!=null?D:!1}"
834
828
  poster="${e.poster===""?!1:(_=e.poster)!=null?_:!1}"
835
- placeholder="${(E=e.placeholder)!=null?E:!1}"
829
+ placeholder="${(k=e.placeholder)!=null?k:!1}"
836
830
  exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, poster, seek-live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
837
831
  >
838
832
  <mux-video
@@ -842,8 +836,8 @@ a {
842
836
  autoplay="${(pe=e.autoplay)!=null?pe:!1}"
843
837
  muted="${(ae=e.muted)!=null?ae:!1}"
844
838
  loop="${(yt=e.loop)!=null?yt:!1}"
845
- preload="${(kt=e.preload)!=null?kt:!1}"
846
- debug="${(Et=e.debug)!=null?Et:!1}"
839
+ preload="${(Et=e.preload)!=null?Et:!1}"
840
+ debug="${(kt=e.debug)!=null?kt:!1}"
847
841
  prefer-playback="${(Tt=e.preferPlayback)!=null?Tt:!1}"
848
842
  start-time="${e.startTime!=null?e.startTime:!1}"
849
843
  metadata-video-id="${(At=e.metadataVideoId)!=null?At:!1}"
@@ -857,23 +851,23 @@ a {
857
851
  custom-domain="${(Mt=e.customDomain)!=null?Mt:!1}"
858
852
  src="${e.src?e.src:e.playbackId?ot(e.playbackId,{domain:e.customDomain,token:e.tokens.playback}):!1}"
859
853
  cast-src="${e.src?e.src:e.playbackId?ot(e.playbackId,{domain:e.customDomain,token:e.tokens.playback}):!1}"
860
- cast-stream-type="${Ga(e)?"live":!1}"
854
+ cast-stream-type="${Xa(e)?"live":!1}"
861
855
  exportparts="video"
862
856
  >
863
- ${e.playbackId&&!e.audio&&!Xa(e)?l`<track
857
+ ${e.playbackId&&!e.audio&&!Ja(e)?l`<track
864
858
  label="thumbnails"
865
859
  default
866
860
  kind="metadata"
867
861
  src="${qt(e.playbackId,{domain:e.customDomain,token:e.tokens.storyboard})}"
868
862
  />`:l``}
869
863
  </mux-video>
870
- ${Xa(e)?l`<button
864
+ ${Ja(e)?l`<button
871
865
  slot="seek-live"
872
- part="${Ga(e)?"top":"bottom"} seek-live button"
866
+ part="${Xa(e)?"top":"bottom"} seek-live button"
873
867
  disabled="${e.inLiveWindow||!e.hasSrc||e.isDialogOpen}"
874
868
  aria-disabled="${(e.inLiveWindow||!e.hasSrc||e.isDialogOpen)&&"true"}"
875
869
  in-live-window="${e.inLiveWindow}"
876
- onclick="${function(oi){var Ht;if((Ht=e.onSeekToLive)==null||Ht.call(e,oi),e.paused){let si=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(si)}}}"
870
+ onclick="${function(si){var Ht;if((Ht=e.onSeekToLive)==null||Ht.call(e,si),e.paused){let li=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(li)}}}"
877
871
  >
878
872
  Live
879
873
  </button>`:l``}
@@ -890,11 +884,11 @@ a {
890
884
  href="${e.dialog.linkUrl}"
891
885
  target="_blank"
892
886
  rel="external noopener"
893
- aria-label="${(_t=e.dialog.linkText)!=null?_t:""} ${c("(opens in a new window)")}"
887
+ aria-label="${(_t=e.dialog.linkText)!=null?_t:""} ${u("(opens in a new window)")}"
894
888
  >${(Nt=e.dialog.linkText)!=null?Nt:e.dialog.linkUrl}</a
895
889
  >`:l``}
896
890
  </p>
897
891
  </mxp-dialog>
898
892
  </${ht((Vt=st(e.theme))!=null?Vt:"media-theme-mux")}>
899
- `};import{MediaError as Ue}from"@mux/mux-video";function Fe(e,a,t,r,i){var m,b,f;let n={},o={};switch(e.code){case Ue.MEDIA_ERR_NETWORK:{switch(n.title=c("Network Error",i),n.message=e.message,(m=e.data)==null?void 0:m.response.code){case 412:{n.title=c("Video is not currently available",i),n.message=c("The live stream or video file are not yet ready.",i),o.message=c("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",i),o.file="412-not-playable.md";break}case 404:{n.title=c("Video does not exist",i),n.message="",o.message=c("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",i),o.file="404-not-found.md";break}case 403:{if(n.title=c("Invalid playback URL",i),n.message=c("The video URL or playback-token are formatted with incorrect or incomplete information.",i),o.message=c("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",i),o.file="missing-signed-tokens.md",!r)break;let{exp:v,aud:$,sub:F}=ve(r),k=Date.now()>v*1e3,I=F!==t,D=$!=="v",_={timeStyle:"medium",dateStyle:"medium"};if(k){n.title=c("Video URL has expired",i),n.message=c("The video\u2019s secured playback-token has expired.",i),o.message=c("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",i).format({expiredDate:new Intl.DateTimeFormat(W.code,_).format(v*1e3),currentDate:new Intl.DateTimeFormat(W.code,_).format(Date.now())}),o.file="403-expired-token.md";break}if(I){n.title=c("Video URL is formatted incorrectly",i),n.message=c("The video\u2019s playback ID does not match the one encoded in the playback-token.",i),o.message=c("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",i).format({playbackId:t,tokenPlaybackId:F}),o.file="403-playback-id-mismatch.md";break}if(D){n.title=c("Video URL is formatted incorrectly",i),n.message=c("The playback-token is formatted with incorrect information.",i),o.message=c("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",i).format({tokenType:$}),o.file="403-incorrect-aud-value.md";break}o.message=c("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",i),o.file="403-malformatted-token.md";break}}break}case Ue.MEDIA_ERR_DECODE:{let{message:v}=e;n={title:c("Media Error",i),message:v},o.file="media-decode-error.md";break}case Ue.MEDIA_ERR_SRC_NOT_SUPPORTED:{let v=(f=(b=e.data)==null?void 0:b.response)==null?void 0:f.code;if(v>=400&&v<500){e.code=Ue.MEDIA_ERR_NETWORK,e.data={response:{code:v}},{dialog:n,devlog:o}=Fe(e,a,t,r);break}n={title:c("Source Not Supported",i),message:e.message},o.file="media-src-not-supported.md";break}default:n={title:c("Error",i),message:e.message};break}return a&&(n={title:c("Your device appears to be offline",i),message:c("Check your internet connection and try reloading this video.",i)}),{dialog:n,devlog:o}}var fr=Object.values(B),vr=700,yr=300,ft={LG:"large",SM:"small",XS:"extra-small"};function Ze(e){let a=e.getBoundingClientRect();return a.width<yr?ft.XS:a.width<vr?ft.SM:ft.LG}var K={SRC:"src",POSTER:"poster"},s={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder"};function kr(e,a){var t,r;return{src:!e.playbackId&&e.src,playbackId:e.playbackId,hasSrc:!!e.playbackId||!!e.src,poster:e.poster,placeholder:e.getAttribute("placeholder"),theme:e.getAttribute("theme"),thumbnailTime:!e.tokens.thumbnail&&e.thumbnailTime,autoplay:e.autoplay,crossOrigin:e.crossOrigin,loop:e.loop,noHotKeys:e.hasAttribute(s.NOHOTKEYS),hotKeys:e.getAttribute(s.HOTKEYS),muted:e.muted,paused:e.paused,preload:e.preload,envKey:e.envKey,debug:e.debug,tokens:e.tokens,beaconCollectionDomain:e.beaconCollectionDomain,metadata:e.metadata,playerSoftwareName:e.playerSoftwareName,playerSoftwareVersion:e.playerSoftwareVersion,startTime:e.startTime,preferPlayback:e.preferPlayback,audio:e.audio,streamType:e.streamType,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,forwardSeekOffset:e.forwardSeekOffset,backwardSeekOffset:e.backwardSeekOffset,defaultHiddenCaptions:e.defaultHiddenCaptions,defaultShowRemainingTime:e.defaultShowRemainingTime,playbackRates:e.getAttribute(s.PLAYBACK_RATES),customDomain:(t=e.getAttribute(u.CUSTOM_DOMAIN))!=null?t:void 0,playerSize:Ze((r=e.mediaController)!=null?r:e),metadataVideoId:e.getAttribute(u.METADATA_VIDEO_ID),metadataVideoTitle:e.getAttribute(u.METADATA_VIDEO_TITLE),metadataViewerUserId:e.getAttribute(u.METADATA_VIEWER_USER_ID),title:e.getAttribute(s.TITLE),...a}}var Er=Object.values(u),Tr=Object.values(K),Ar=Object.values(s),xr=Re(),wr="mux-player",Qa={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},te,Le,U,$e,ue,R,he,We,Z,ce,be,ze,Se,vt,qe,ei,je,ti,Ge,ai,Xe,ii,Je,ri,Qe,ni,we=class extends mt{constructor(){super();h(this,he);h(this,Z);h(this,be);h(this,Se);h(this,qe);h(this,je);h(this,Ge);h(this,Xe);h(this,Je);h(this,Qe);h(this,te,!1);h(this,Le,{});h(this,U,!0);h(this,$e,new Pe(this,"hotkeys"));h(this,ue,void 0);h(this,R,{...Qa,onCloseErrorDialog:()=>p(this,Z,ce).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{rt(this,S.activeElement)||t.preventDefault()},onSeekToLive:()=>lt(this)});this.attachShadow({mode:"open"}),this.isConnected&&p(this,he,We).call(this)}static get observedAttributes(){var t;return[...(t=mt.observedAttributes)!=null?t:[],...Tr,...Er,...Ar]}get theme(){var t,r;return Array.from((r=(t=this.shadowRoot)==null?void 0:t.children)!=null?r:[]).find(({localName:i})=>i.startsWith("media-theme-"))}get mediaController(){var t,r;return(r=(t=this.theme)==null?void 0:t.shadowRoot)==null?void 0:r.querySelector("media-controller")}connectedCallback(){p(this,Se,vt).call(this),p(this,qe,ei).call(this)}disconnectedCallback(){p(this,je,ti).call(this)}attributeChangedCallback(t,r,i){switch(d(this,te)||p(this,he,We).call(this),super.attributeChangedCallback(t,r,i),t){case s.HOTKEYS:d(this,$e).value=i;break;case s.THUMBNAIL_TIME:{i!=null&&this.tokens.thumbnail&&G(c("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case s.THUMBNAIL_TOKEN:{let{aud:o}=ve(i);i&&o!=="t"&&G(c("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case s.STORYBOARD_TOKEN:{let{aud:o}=ve(i);i&&o!=="s"&&G(c("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case u.PLAYBACK_ID:{i!=null&&i.includes("?token")&&O(c("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:i})),this.streamType?this.streamType!=null&&!fr.includes(this.streamType)&&Ie({file:"invalid-stream-type.md",message:c("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):Ie({file:"invalid-stream-type.md",message:String(c("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[u.PLAYBACK_ID,K.SRC,s.PLAYBACK_TOKEN].includes(t)&&r!==i&&A(this,R,{...d(this,R),...Qa}),p(this,be,ze).call(this,{[jt(t)]:i})}get hasPlayed(){var t,r;return(r=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?r:!1}get inLiveWindow(){return d(this,R).inLiveWindow}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get playbackId(){var t;return(t=this.getAttribute(u.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(u.PLAYBACK_ID,t):this.removeAttribute(u.PLAYBACK_ID)}get src(){var t,r;return this.playbackId?(t=me(this,K.SRC))!=null?t:void 0:(r=this.getAttribute(K.SRC))!=null?r:void 0}set src(t){t?this.setAttribute(K.SRC,t):this.removeAttribute(K.SRC)}get poster(){var r;let t=this.getAttribute(K.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return zt(this.playbackId,{domain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(K.POSTER,t):this.removeAttribute(K.POSTER)}get audio(){return this.hasAttribute(s.AUDIO)}set audio(t){if(!t){this.removeAttribute(s.AUDIO);return}this.setAttribute(s.AUDIO,"")}get hotkeys(){return d(this,$e)}get nohotkeys(){return this.hasAttribute(s.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(s.NOHOTKEYS);return}this.setAttribute(s.NOHOTKEYS,"")}get thumbnailTime(){return z(this.getAttribute(s.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(s.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(s.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(s.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=me(this,s.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(s.PLACEHOLDER,`${t}`)}get primaryColor(){var t;return(t=this.getAttribute(s.PRIMARY_COLOR))!=null?t:void 0}set primaryColor(t){this.setAttribute(s.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var t;return(t=this.getAttribute(s.SECONDARY_COLOR))!=null?t:void 0}set secondaryColor(t){this.setAttribute(s.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(s.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(s.PLAYBACK_RATES))return this.getAttribute(s.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,r)=>t-r)}set playbackRates(t){if(!t){this.removeAttribute(s.PLAYBACK_RATES);return}this.setAttribute(s.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=z(this.getAttribute(s.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(s.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=z(this.getAttribute(s.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(s.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(s.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(u.PLAYER_SOFTWARE_NAME))!=null?t:wr}get playerSoftwareVersion(){var t;return(t=this.getAttribute(u.PLAYER_SOFTWARE_VERSION))!=null?t:xr}get beaconCollectionDomain(){var t;return(t=this.getAttribute(u.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(u.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(u.BEACON_COLLECTION_DOMAIN))}get customDomain(){var t;return(t=this.getAttribute(u.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(u.CUSTOM_DOMAIN,t):this.removeAttribute(u.CUSTOM_DOMAIN))}get envKey(){var t;return(t=me(this,u.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(u.ENV_KEY,`${t}`)}get debug(){return me(this,u.DEBUG)!=null}set debug(t){t?this.setAttribute(u.DEBUG,""):this.removeAttribute(u.DEBUG)}get streamType(){return me(this,u.STREAM_TYPE)}set streamType(t){this.setAttribute(u.STREAM_TYPE,`${t}`)}get startTime(){return z(me(this,u.START_TIME))}set startTime(t){this.setAttribute(u.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(u.PREFER_PLAYBACK);if(t===Ye.MSE||t===Ye.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===Ye.MSE||t===Ye.NATIVE?this.setAttribute(u.PREFER_PLAYBACK,t):this.removeAttribute(u.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(d(this,te)||p(this,he,We).call(this),!this.media){O("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=t}get tokens(){let t=this.getAttribute(s.PLAYBACK_TOKEN),r=this.getAttribute(s.THUMBNAIL_TOKEN),i=this.getAttribute(s.STORYBOARD_TOKEN);return{...d(this,Le),...t!=null?{playback:t}:{},...r!=null?{thumbnail:r}:{},...i!=null?{storyboard:i}:{}}}set tokens(t){A(this,Le,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(s.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(s.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(s.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(s.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(s.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(s.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,r,i,n){var m;let o=(m=this.media)==null?void 0:m.nativeEl;if(!!o)return pr(o,t,r,i,n)}removeTextTrack(t){var i;let r=(i=this.media)==null?void 0:i.nativeEl;if(!!r)return gr(r,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};te=new WeakMap,Le=new WeakMap,U=new WeakMap,$e=new WeakMap,ue=new WeakMap,R=new WeakMap,he=new WeakSet,We=function(){var t,r,i;if(!d(this,te)){A(this,te,!0),p(this,Z,ce).call(this,{playerSize:Ze(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof g.HTMLElement))throw""}catch{O(`<${(t=this.theme)==null?void 0:t.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof br))throw""}catch{O("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof hr))throw""}catch{O("<media-controller> failed to upgrade!")}ea(this),p(this,Xe,ii).call(this),p(this,Je,ri).call(this),p(this,Ge,ai).call(this),A(this,U,(i=(r=this.mediaController)==null?void 0:r.hasAttribute("user-inactive"))!=null?i:!0),p(this,Qe,ni).call(this)}},Z=new WeakSet,ce=function(t){Object.assign(d(this,R),t),p(this,be,ze).call(this)},be=new WeakSet,ze=function(t={}){_e(Ja(kr(this,{...d(this,R),...t})),this.shadowRoot)},Se=new WeakSet,vt=function(){var t,r;d(this,R).playerSize!=Ze((t=this.mediaController)!=null?t:this)&&p(this,Z,ce).call(this,{playerSize:Ze((r=this.mediaController)!=null?r:this)})},qe=new WeakSet,ei=function(){var t;A(this,ue,new ResizeObserver(()=>p(this,Se,vt).call(this))),d(this,ue).observe((t=this.mediaController)!=null?t:this)},je=new WeakSet,ti=function(){var t;(t=d(this,ue))==null||t.disconnect()},Ge=new WeakSet,ai=function(){var r,i,n,o,m;(r=this.mediaController)==null||r.addEventListener("mediaplayrequest",b=>{var f;((f=b.target)==null?void 0:f.localName)==="media-play-button"&&this.streamType&&[B.LIVE,B.LL_LIVE,B.DVR,B.LL_DVR].includes(this.streamType)&&this.hasPlayed&&lt(this)});let t=()=>{let b=Xt(this),f=d(this,R).inLiveWindow;b!==f&&(p(this,Z,ce).call(this,{inLiveWindow:b}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(i=this.media)==null||i.addEventListener("progress",t),(n=this.media)==null||n.addEventListener("waiting",t),(o=this.media)==null||o.addEventListener("timeupdate",t),(m=this.media)==null||m.addEventListener("emptied",t)},Xe=new WeakSet,ii=function(){var r;let t=i=>{let{detail:n}=i;if(n instanceof gt||(n=new gt(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){G(n),n.data&&G(`${n.name} data:`,n.data);return}let{dialog:o,devlog:m}=Fe(n,!window.navigator.onLine,this.playbackId,this.playbackToken);m.message&&Ie(m),O(n),n.data&&O(`${n.name} data:`,n.data),p(this,Z,ce).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(i={})=>{var o,m,b;if(!((o=this.media)!=null&&o.error))return i;let{devlog:n}=Fe((m=this.media)==null?void 0:m.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(b=this.media)==null?void 0:b.error.code,player_error_message:n.message?String(n.message):i.player_error_message}}),(r=this.media)==null||r.addEventListener("error",i=>{var o,m;let{detail:n}=i;if(!n){let{message:b,code:f}=(m=(o=this.media)==null?void 0:o.error)!=null?m:{};n=new gt(b,f)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Je=new WeakSet,ri=function(){var r,i,n,o;let t=()=>p(this,be,ze).call(this);(i=(r=this.media)==null?void 0:r.textTracks)==null||i.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Qe=new WeakSet,ni=function(){var v,$,F;let t=this.mediaController,r=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(r)return;let i,n=new WeakMap,o=()=>this.streamType&&[B.LIVE,B.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,m=(k,I,D=!1)=>{if(o())return;Array.from(k&&k.activeCues||[]).forEach(E=>{if(!(!E.snapToLines||E.line<-5||E.line>=0&&E.line<10))if(!I||this.paused){let Oe=E.text.split(`
900
- `).length,pe=r?-2:-3;this.streamType&&[B.LIVE,B.LL_LIVE].includes(this.streamType)&&(pe=r?-1:-2);let ae=pe-Oe;if(E.line===ae&&!D)return;n.has(E)||n.set(E,E.line),E.line=ae-1,E.line=ae}else setTimeout(()=>{E.line=n.get(E)||"auto"},500)})},b=()=>{var k;m(i,(k=t==null?void 0:t.hasAttribute("user-inactive"))!=null?k:!1)},f=()=>{var D;let I=Array.from(((D=t==null?void 0:t.media)==null?void 0:D.textTracks)||[]).filter(_=>["subtitles","captions"].includes(_.kind)&&_.mode==="showing")[0];I!==i&&(i==null||i.removeEventListener("cuechange",b)),i=I,i==null||i.addEventListener("cuechange",b),m(i,d(this,U))};if(f(),(v=t==null?void 0:t.media)==null||v.textTracks.addEventListener("change",f),($=t==null?void 0:t.media)==null||$.textTracks.addEventListener("addtrack",f),navigator.userAgent.includes("Chrome/")){let k=()=>{m(i,d(this,U),!0),this.paused||window.requestAnimationFrame(k)};(F=t==null?void 0:t.media)==null||F.addEventListener("playing",()=>{k()})}t==null||t.addEventListener("userinactivechange",()=>{let k=t==null?void 0:t.hasAttribute("user-inactive");d(this,U)!==k&&(A(this,U,k),m(i,d(this,U)))})};function me(e,a){return e.media?e.media.getAttribute(a):e.getAttribute(a)}g.customElements.get("mux-player")||(g.customElements.define("mux-player",we),g.MuxPlayerElement=we);var uo=we;export{gt as MediaError,uo as default,me as getVideoAttribute};
893
+ `};import{MediaError as Ue}from"@mux/mux-video";function Fe(e,a,t,i,r){var m,b,f;let n={},o={};switch(e.code){case Ue.MEDIA_ERR_NETWORK:{switch(n.title=u("Network Error",r),n.message=e.message,(m=e.data)==null?void 0:m.response.code){case 412:{n.title=u("Video is not currently available",r),n.message=u("The live stream or video file are not yet ready.",r),o.message=u("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),o.file="412-not-playable.md";break}case 404:{n.title=u("Video does not exist",r),n.message="",o.message=u("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),o.file="404-not-found.md";break}case 403:{if(n.title=u("Invalid playback URL",r),n.message=u("The video URL or playback-token are formatted with incorrect or incomplete information.",r),o.message=u("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),o.file="missing-signed-tokens.md",!i)break;let{exp:v,aud:$,sub:Y}=ve(i),E=Date.now()>v*1e3,I=Y!==t,D=$!=="v",_={timeStyle:"medium",dateStyle:"medium"};if(E){n.title=u("Video URL has expired",r),n.message=u("The video\u2019s secured playback-token has expired.",r),o.message=u("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(z.code,_).format(v*1e3),currentDate:new Intl.DateTimeFormat(z.code,_).format(Date.now())}),o.file="403-expired-token.md";break}if(I){n.title=u("Video URL is formatted incorrectly",r),n.message=u("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),o.message=u("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:t,tokenPlaybackId:Y}),o.file="403-playback-id-mismatch.md";break}if(D){n.title=u("Video URL is formatted incorrectly",r),n.message=u("The playback-token is formatted with incorrect information.",r),o.message=u("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:$}),o.file="403-incorrect-aud-value.md";break}o.message=u("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),o.file="403-malformatted-token.md";break}}break}case Ue.MEDIA_ERR_DECODE:{let{message:v}=e;n={title:u("Media Error",r),message:v},o.file="media-decode-error.md";break}case Ue.MEDIA_ERR_SRC_NOT_SUPPORTED:{let v=(f=(b=e.data)==null?void 0:b.response)==null?void 0:f.code;if(v>=400&&v<500){e.code=Ue.MEDIA_ERR_NETWORK,e.data={response:{code:v}},{dialog:n,devlog:o}=Fe(e,a,t,i);break}n={title:u("Source Not Supported",r),message:e.message},o.file="media-src-not-supported.md";break}default:n={title:u("Error",r),message:e.message};break}return a&&(n={title:u("Your device appears to be offline",r),message:u("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:o}}var fr=Object.values(K),vr=700,yr=300,ft={LG:"large",SM:"small",XS:"extra-small"};function Ze(e){let a=e.getBoundingClientRect();return a.width<yr?ft.XS:a.width<vr?ft.SM:ft.LG}var U={SRC:"src",POSTER:"poster"},s={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder"};function Er(e,a){var t,i;return{src:!e.playbackId&&e.src,playbackId:e.playbackId,hasSrc:!!e.playbackId||!!e.src,poster:e.poster,placeholder:e.getAttribute("placeholder"),theme:e.getAttribute("theme"),thumbnailTime:!e.tokens.thumbnail&&e.thumbnailTime,autoplay:e.autoplay,crossOrigin:e.crossOrigin,loop:e.loop,noHotKeys:e.hasAttribute(s.NOHOTKEYS),hotKeys:e.getAttribute(s.HOTKEYS),muted:e.muted,paused:e.paused,preload:e.preload,envKey:e.envKey,debug:e.debug,tokens:e.tokens,beaconCollectionDomain:e.beaconCollectionDomain,metadata:e.metadata,playerSoftwareName:e.playerSoftwareName,playerSoftwareVersion:e.playerSoftwareVersion,startTime:e.startTime,preferPlayback:e.preferPlayback,audio:e.audio,streamType:e.streamType,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,forwardSeekOffset:e.forwardSeekOffset,backwardSeekOffset:e.backwardSeekOffset,defaultHiddenCaptions:e.defaultHiddenCaptions,defaultShowRemainingTime:e.defaultShowRemainingTime,playbackRates:e.getAttribute(s.PLAYBACK_RATES),customDomain:(t=e.getAttribute(c.CUSTOM_DOMAIN))!=null?t:void 0,playerSize:Ze((i=e.mediaController)!=null?i:e),metadataVideoId:e.getAttribute(c.METADATA_VIDEO_ID),metadataVideoTitle:e.getAttribute(c.METADATA_VIDEO_TITLE),metadataViewerUserId:e.getAttribute(c.METADATA_VIEWER_USER_ID),title:e.getAttribute(s.TITLE),...a}}var kr=Object.values(c),Tr=Object.values(U),Ar=Object.values(s),xr=Re(),wr="mux-player",ei={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},te,Le,F,$e,ce,R,he,We,W,ue,be,ze,Se,vt,qe,ti,je,ai,Ge,ii,Xe,ri,Je,ni,Qe,oi,we=class extends mt{constructor(){super();h(this,he);h(this,W);h(this,be);h(this,Se);h(this,qe);h(this,je);h(this,Ge);h(this,Xe);h(this,Je);h(this,Qe);h(this,te,!1);h(this,Le,{});h(this,F,!0);h(this,$e,new Pe(this,"hotkeys"));h(this,ce,void 0);h(this,R,{...ei,onCloseErrorDialog:()=>p(this,W,ue).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{rt(this,S.activeElement)||t.preventDefault()},onSeekToLive:()=>lt(this)});this.attachShadow({mode:"open"}),this.isConnected&&p(this,he,We).call(this)}static get observedAttributes(){var t;return[...(t=mt.observedAttributes)!=null?t:[],...Tr,...kr,...Ar]}get theme(){var t,i;return Array.from((i=(t=this.shadowRoot)==null?void 0:t.children)!=null?i:[]).find(({localName:r})=>r.startsWith("media-theme-"))}get mediaController(){var t,i;return(i=(t=this.theme)==null?void 0:t.shadowRoot)==null?void 0:i.querySelector("media-controller")}connectedCallback(){p(this,Se,vt).call(this),p(this,qe,ti).call(this)}disconnectedCallback(){p(this,je,ai).call(this)}attributeChangedCallback(t,i,r){switch(d(this,te)||p(this,he,We).call(this),super.attributeChangedCallback(t,i,r),t){case s.HOTKEYS:d(this,$e).value=r;break;case s.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&G(u("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case s.THUMBNAIL_TOKEN:{let{aud:o}=ve(r);r&&o!=="t"&&G(u("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case s.STORYBOARD_TOKEN:{let{aud:o}=ve(r);r&&o!=="s"&&G(u("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case c.PLAYBACK_ID:{r!=null&&r.includes("?token")&&O(u("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r})),this.streamType?this.streamType!=null&&!fr.includes(this.streamType)&&Ie({file:"invalid-stream-type.md",message:u("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):Ie({file:"invalid-stream-type.md",message:String(u("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[c.PLAYBACK_ID,U.SRC,s.PLAYBACK_TOKEN].includes(t)&&i!==r&&A(this,R,{...d(this,R),...ei}),p(this,be,ze).call(this,{[jt(t)]:r})}get hasPlayed(){var t,i;return(i=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?i:!1}get inLiveWindow(){return d(this,R).inLiveWindow}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get playbackId(){var t;return(t=this.getAttribute(c.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(c.PLAYBACK_ID,t):this.removeAttribute(c.PLAYBACK_ID)}get src(){var t,i;return this.playbackId?(t=me(this,U.SRC))!=null?t:void 0:(i=this.getAttribute(U.SRC))!=null?i:void 0}set src(t){t?this.setAttribute(U.SRC,t):this.removeAttribute(U.SRC)}get poster(){var i;let t=this.getAttribute(U.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return zt(this.playbackId,{domain:this.customDomain,thumbnailTime:(i=this.thumbnailTime)!=null?i:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(U.POSTER,t):this.removeAttribute(U.POSTER)}get audio(){return this.hasAttribute(s.AUDIO)}set audio(t){if(!t){this.removeAttribute(s.AUDIO);return}this.setAttribute(s.AUDIO,"")}get hotkeys(){return d(this,$e)}get nohotkeys(){return this.hasAttribute(s.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(s.NOHOTKEYS);return}this.setAttribute(s.NOHOTKEYS,"")}get thumbnailTime(){return N(this.getAttribute(s.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(s.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(s.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(s.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=me(this,s.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(s.PLACEHOLDER,`${t}`)}get primaryColor(){var t;return(t=this.getAttribute(s.PRIMARY_COLOR))!=null?t:void 0}set primaryColor(t){this.setAttribute(s.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var t;return(t=this.getAttribute(s.SECONDARY_COLOR))!=null?t:void 0}set secondaryColor(t){this.setAttribute(s.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(s.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(s.PLAYBACK_RATES))return this.getAttribute(s.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,i)=>t-i)}set playbackRates(t){if(!t){this.removeAttribute(s.PLAYBACK_RATES);return}this.setAttribute(s.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=N(this.getAttribute(s.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(s.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=N(this.getAttribute(s.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(s.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(s.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(c.PLAYER_SOFTWARE_NAME))!=null?t:wr}get playerSoftwareVersion(){var t;return(t=this.getAttribute(c.PLAYER_SOFTWARE_VERSION))!=null?t:xr}get beaconCollectionDomain(){var t;return(t=this.getAttribute(c.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(c.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(c.BEACON_COLLECTION_DOMAIN))}get customDomain(){var t;return(t=this.getAttribute(c.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(c.CUSTOM_DOMAIN,t):this.removeAttribute(c.CUSTOM_DOMAIN))}get envKey(){var t;return(t=me(this,c.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(c.ENV_KEY,`${t}`)}get debug(){return me(this,c.DEBUG)!=null}set debug(t){t?this.setAttribute(c.DEBUG,""):this.removeAttribute(c.DEBUG)}get streamType(){return me(this,c.STREAM_TYPE)}set streamType(t){this.setAttribute(c.STREAM_TYPE,`${t}`)}get startTime(){return N(me(this,c.START_TIME))}set startTime(t){this.setAttribute(c.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(c.PREFER_PLAYBACK);if(t===Ye.MSE||t===Ye.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===Ye.MSE||t===Ye.NATIVE?this.setAttribute(c.PREFER_PLAYBACK,t):this.removeAttribute(c.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(d(this,te)||p(this,he,We).call(this),!this.media){O("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=t}get tokens(){let t=this.getAttribute(s.PLAYBACK_TOKEN),i=this.getAttribute(s.THUMBNAIL_TOKEN),r=this.getAttribute(s.STORYBOARD_TOKEN);return{...d(this,Le),...t!=null?{playback:t}:{},...i!=null?{thumbnail:i}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){A(this,Le,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(s.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(s.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(s.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(s.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(s.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(s.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,i,r,n){var m;let o=(m=this.media)==null?void 0:m.nativeEl;if(!!o)return pr(o,t,i,r,n)}removeTextTrack(t){var r;let i=(r=this.media)==null?void 0:r.nativeEl;if(!!i)return gr(i,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};te=new WeakMap,Le=new WeakMap,F=new WeakMap,$e=new WeakMap,ce=new WeakMap,R=new WeakMap,he=new WeakSet,We=function(){var t,i,r;if(!d(this,te)){A(this,te,!0),p(this,W,ue).call(this,{playerSize:Ze(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof g.HTMLElement))throw""}catch{O(`<${(t=this.theme)==null?void 0:t.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof br))throw""}catch{O("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof hr))throw""}catch{O("<media-controller> failed to upgrade!")}ta(this),p(this,Xe,ri).call(this),p(this,Je,ni).call(this),p(this,Ge,ii).call(this),A(this,F,(r=(i=this.mediaController)==null?void 0:i.hasAttribute("user-inactive"))!=null?r:!0),p(this,Qe,oi).call(this)}},W=new WeakSet,ue=function(t){Object.assign(d(this,R),t),p(this,be,ze).call(this)},be=new WeakSet,ze=function(t={}){_e(Qa(Er(this,{...d(this,R),...t})),this.shadowRoot)},Se=new WeakSet,vt=function(){var t,i;d(this,R).playerSize!=Ze((t=this.mediaController)!=null?t:this)&&p(this,W,ue).call(this,{playerSize:Ze((i=this.mediaController)!=null?i:this)})},qe=new WeakSet,ti=function(){var t;A(this,ce,new ResizeObserver(()=>p(this,Se,vt).call(this))),d(this,ce).observe((t=this.mediaController)!=null?t:this)},je=new WeakSet,ai=function(){var t;(t=d(this,ce))==null||t.disconnect()},Ge=new WeakSet,ii=function(){var i,r,n,o,m;(i=this.mediaController)==null||i.addEventListener("mediaplayrequest",b=>{var f;((f=b.target)==null?void 0:f.localName)==="media-play-button"&&this.streamType&&[K.LIVE,K.LL_LIVE,K.DVR,K.LL_DVR].includes(this.streamType)&&this.hasPlayed&&lt(this)});let t=()=>{let b=Xt(this),f=d(this,R).inLiveWindow;b!==f&&(p(this,W,ue).call(this,{inLiveWindow:b}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(r=this.media)==null||r.addEventListener("progress",t),(n=this.media)==null||n.addEventListener("waiting",t),(o=this.media)==null||o.addEventListener("timeupdate",t),(m=this.media)==null||m.addEventListener("emptied",t)},Xe=new WeakSet,ri=function(){var i;let t=r=>{let{detail:n}=r;if(n instanceof gt||(n=new gt(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){G(n),n.data&&G(`${n.name} data:`,n.data);return}let{dialog:o,devlog:m}=Fe(n,!window.navigator.onLine,this.playbackId,this.playbackToken);m.message&&Ie(m),O(n),n.data&&O(`${n.name} data:`,n.data),p(this,W,ue).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var o,m,b;if(!((o=this.media)!=null&&o.error))return r;let{devlog:n}=Fe((m=this.media)==null?void 0:m.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(b=this.media)==null?void 0:b.error.code,player_error_message:n.message?String(n.message):r.player_error_message}}),(i=this.media)==null||i.addEventListener("error",r=>{var o,m;let{detail:n}=r;if(!n){let{message:b,code:f}=(m=(o=this.media)==null?void 0:o.error)!=null?m:{};n=new gt(b,f)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Je=new WeakSet,ni=function(){var i,r,n,o;let t=()=>p(this,be,ze).call(this);(r=(i=this.media)==null?void 0:i.textTracks)==null||r.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Qe=new WeakSet,oi=function(){var v,$,Y;let t=this.mediaController,i=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(i)return;let r,n=new WeakMap,o=()=>this.streamType&&[K.LIVE,K.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,m=(E,I,D=!1)=>{if(o())return;Array.from(E&&E.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!I||this.paused){let Oe=k.text.split(`
894
+ `).length,pe=i?-2:-3;this.streamType&&[K.LIVE,K.LL_LIVE].includes(this.streamType)&&(pe=i?-1:-2);let ae=pe-Oe;if(k.line===ae&&!D)return;n.has(k)||n.set(k,k.line),k.line=ae-1,k.line=ae}else setTimeout(()=>{k.line=n.get(k)||"auto"},500)})},b=()=>{var E;m(r,(E=t==null?void 0:t.hasAttribute("user-inactive"))!=null?E:!1)},f=()=>{var D;let I=Array.from(((D=t==null?void 0:t.media)==null?void 0:D.textTracks)||[]).filter(_=>["subtitles","captions"].includes(_.kind)&&_.mode==="showing")[0];I!==r&&(r==null||r.removeEventListener("cuechange",b)),r=I,r==null||r.addEventListener("cuechange",b),m(r,d(this,F))};if(f(),(v=t==null?void 0:t.media)==null||v.textTracks.addEventListener("change",f),($=t==null?void 0:t.media)==null||$.textTracks.addEventListener("addtrack",f),navigator.userAgent.includes("Chrome/")){let E=()=>{m(r,d(this,F),!0),this.paused||window.requestAnimationFrame(E)};(Y=t==null?void 0:t.media)==null||Y.addEventListener("playing",()=>{E()})}t==null||t.addEventListener("userinactivechange",()=>{let E=t==null?void 0:t.hasAttribute("user-inactive");d(this,F)!==E&&(A(this,F,E),m(r,d(this,F)))})};function me(e,a){return e.media?e.media.getAttribute(a):e.getAttribute(a)}g.customElements.get("mux-player")||(g.customElements.define("mux-player",we),g.MuxPlayerElement=we);var co=we;export{gt as MediaError,co as default,me as getVideoAttribute};