@mux/mux-player 1.2.0 → 1.3.0-canary.0-a2befb5

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,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=`
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 oe=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class e extends oe{}globalThis.DocumentFragment=e}var fe=class extends oe{},tt=class extends oe{},mi={get(e){},define(e,a,t){},upgrade(e){},whenDefined(e){return Promise.resolve(fe)}},ve,at=class{constructor(a,t={}){h(this,ve,void 0);A(this,ve,t==null?void 0:t.detail)}get detail(){return d(this,ve)}initCustomEvent(){}};ve=new WeakMap;function ci(e,a){return new fe}var Ut={document:{createElement:ci},DocumentFragment,customElements:mi,CustomEvent:at,EventTarget:oe,HTMLElement:fe,HTMLVideoElement:tt},Ft=typeof window=="undefined"||typeof globalThis.customElements=="undefined",g=Ft?Ut:globalThis,O=Ft?Ut.document:globalThis.document;import{MediaController as gr}from"media-chrome";import fr,{MediaError as pt,Attributes as u}from"@mux/mux-video";import{StreamTypes as $,PlaybackTypes as Ye,addTextTrack as vr,removeTextTrack as yr}from"@mux/playback-core";import{VideoEvents as Ei}from"@mux/mux-video";var ui="en",X={code:ui};var Yt="en";function c(e,a=!0){var r,o;let t=a&&(o=(r=X)==null?void 0:r[e])!=null?o:e,i=a?X.code:Yt;return new it(t,i)}var it=class{constructor(a,t=(i=>(i=X.code)!=null?i:Yt)()){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 Zt(e){let a="";return Object.entries(e).forEach(([t,i])=>{i!=null&&(a+=`${hi(t)}: ${i}; `)}),a?a.trim():void 0}function hi(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Wt(e){return e.replace(/[-_]([a-z])/g,(a,t)=>t.toUpperCase())}function _(e){if(e==null)return;let a=+e;return Number.isNaN(a)?void 0:a}function Oe(e){let a=bi(e).toString();return a?"?"+a:""}function bi(e){let a={};for(let t in e)e[t]!=null&&(a[t]=e[t]);return new URLSearchParams(a)}function z(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 ot="mux.com",pi=()=>{try{return"1.3.0"}catch{}return"UNKNOWN"},gi=pi(),Ie=()=>gi,nt=(e,{token:a,domain:t=ot}={})=>`https://stream.${t}/${e}.m3u8${Oe(!!a?{token:a}:{redundant_streams:!0})}`,jt=(e,{token:a,thumbnailTime:t,domain:i=ot}={})=>{let r=a==null?t:void 0,{aud:o}=z(a);if(!(a&&o!=="t"))return`https://image.${i}/${e}/thumbnail.jpg${Oe({token:a,time:r})}`},Gt=(e,{token:a,domain:t=ot}={})=>{let{aud:i}=z(a);if(!(a&&i!=="s"))return`https://image.${t}/${e}/storyboard.vtt${Oe({token:a})}`};function st(e){if(e&&/^media-theme-[\w-]+$/.test(e))return e}var fi={crossorigin:"crossOrigin",playsinline:"playsInline"};function Xt(e){var a;return(a=fi[e])!=null?a:Wt(e)}var Jt=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=Jt(e);if(a==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}e.currentTime=a},vi=1,yi=5,zt=3,qt=.5,Qt=e=>{var o;let{streamType:a}=e,t=Jt(e),i=(o=e.media)==null?void 0:o.currentTime;if(t==null||i==null)return!1;let r=t-i;return a===Me.LL_LIVE||a===Me.LL_DVR?r<=vi*(zt+qt):a===Me.LIVE||a===Me.DVR?r<=yi*(zt+qt):!1},J,Q,x,Pe=class{constructor(a,t){h(this,J,void 0);h(this,Q,void 0);h(this,x,[]);A(this,J,a),A(this,Q,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,J))!=null&&t.hasAttribute(`${d(this,Q)}`)))&&((i=d(this,J))==null||i.setAttribute(`${d(this,Q)}`,`${this.value}`))}remove(...a){var t;a.forEach(i=>{d(this,x).splice(d(this,x).indexOf(i),1)}),(t=d(this,J))==null||t.setAttribute(`${d(this,Q)}`,`${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)}};J=new WeakMap,Q=new WeakMap,x=new WeakMap;var ea=`[mux-player ${Ie()}]`;function ee(...e){console.warn(ea,...e)}function M(...e){console.error(ea,...e)}function Re(e){var t;let a=(t=e.message)!=null?t:"";if(e.file){let i="https://github.com/muxinc/elements/blob/main/errors/";a+=` ${c("Read more: ")}
2
+ ${i}${e.file}`}ee(a)}var T={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},te={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},aa=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=Ei.filter(e=>e!=="error"),Ti=Object.values(T).filter(e=>![T.PLAYSINLINE].includes(e)),Ai=Object.values(te);function ia(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,i=>{e.dispatchEvent(new Event(i.type))})})}var dt=class extends g.HTMLElement{static get observedAttributes(){return[...Ti,...Ai]}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(o=>{var m,b;let n=(m=this.media)==null?void 0:m.querySelector(`track[src="${o.src}"]`);n&&((b=this.media)==null||b.removeChild(n))}),r.addedNodes.forEach(o=>{var n;(n=this.media)==null||n.append(o.cloneNode())}))};new MutationObserver(a).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(a,t,i){var r,o;switch(a){case te.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case te.VOLUME:{let n=(r=_(i))!=null?r:1;this.media&&(this.media.volume=n);return}case te.PLAYBACKRATE:{let n=(o=_(i))!=null?o:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);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:aa}get seekable(){var a,t;return(t=(a=this.media)==null?void 0:a.seekable)!=null?t:aa}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=_(this.getAttribute(te.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(te.PLAYBACKRATE,`${a}`):this.removeAttribute(te.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){M("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 Ji}from"media-chrome";import{TemplateInstance as sa,NodeTemplatePart as De,createProcessor as xi,AttributeTemplatePart as ut}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 Li(e,a){return e instanceof ut&&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 $i(e,a){return a instanceof DocumentFragment&&e instanceof De?(a.childNodes.length&&e.replace(...a.childNodes),!0):!1}function Si(e,a){if(e instanceof ut){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 Ci(e,a){if(typeof a=="boolean"&&e instanceof ut){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 Mi(e,a){Ci(e,a)||Li(e,a)||Oi(e,a)||wi(e,a)||$i(e,a)||Si(e,a)}var ct=new WeakMap,ra=new WeakMap,oa=new WeakMap,Te=class{constructor(a,t,i){this.strings=a;this.values=t;this.processor=i}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((i,r,o)=>i+r+(o<t?`{{ ${o} }}`:""),""),ct.set(this.strings,a),a}}renderInto(a){let t=this.template;if(ra.get(a)!==t){ra.set(a,t);let r=new sa(t,this.values,this.processor);oa.set(a,r),a instanceof De?a.replace(...r.children):a.appendChild(r);return}let i=oa.get(a);i&&i.update(this.values)}},na=new Map,Pi=xi(Mi);function s(e,...a){let t=[""],i=[],r,o=!1,n=(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(C=>{n(C.strings,C.values)}),t[t.length-1]=t[t.length-1]+m[v+1],o=!0):(i.push(f),t.push(m[v+1]))})};if(n(e,a),o){let m=t.join("$$html$$");e=na.get(m),e===void 0&&(t.raw=t,na.set(m,e=t)),a=i}return new Te(e,a,Pi)}function _e(e,a){e.renderInto(a)}function y(e,a){let t=document.createElement("template");return t.innerHTML=e,new sa(t,a)}var ht=(...e)=>({$static$:e.map(a=>a instanceof Te?a:/\w-/.test(a)?{strings:[a]}:{strings:[]})});var da=`
3
3
  :host {
4
4
  cursor: pointer;
5
5
  }
6
6
  media-time-display {
7
7
  color: inherit;
8
8
  }
9
- `,la=S.createElement("template");la.innerHTML=`
9
+ `,ma=O.createElement("template");ma.innerHTML=`
10
10
  <style>
11
- ${sa}
11
+ ${da}
12
12
  </style>
13
13
  <media-time-display show-duration></media-time-display>
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])) {
14
+ `;var la=["Enter"," "],Ae,se,Ne,ne=class extends g.HTMLElement{constructor(){var t,i;super();h(this,se);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(!la.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",i=>{let{metaKey:r,altKey:o,key:n}=i;if(r||o||!la.includes(n)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),A(this,Ae,setInterval(p(this,se,Ne).bind(this),200)),requestAnimationFrame(()=>p(this,se,Ne).call(this))}disconnectedCallback(){clearInterval(d(this,Ae))}attributeChangedCallback(t,i,r){var o,n;t==="hide-duration"&&p(this,se,Ne).call(this),["remaining","disabled","aria-disabled"].includes(t)&&i!==r&&(r==null?(o=this.timeDisplayEl)==null||o.removeAttribute(t):(n=this.timeDisplayEl)==null||n.setAttribute(t,r))}};Ae=new WeakMap,se=new WeakSet,Ne=function(){var i,r,o,n;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")):(o=this.timeDisplayEl)!=null&&o.hasAttribute("show-duration")||(n=this.timeDisplayEl)==null||n.setAttribute("show-duration","")},ne.styles=da,ne.template=ma;g.customElements.get("mxp-time-display")||(g.customElements.define("mxp-time-display",ne),g.MxpTimeDisplay=ne);var ca=`:host(:not([audio])) {
15
15
  --secondary-color: transparent;
16
16
  }
17
17
 
@@ -111,57 +111,87 @@ media-controller {
111
111
 
112
112
  :host media-time-range {
113
113
  color: var(--_primary-color);
114
+ --media-range-thumb-opacity: 0;
114
115
  }
115
116
 
116
117
  :host(:not([audio])) media-time-range {
117
118
  --media-range-padding-left: var(--mux-time-range-padding, 10px);
118
119
  --media-range-padding-right: var(--mux-time-range-padding, 10px);
119
- width: 100%;
120
+ --media-range-padding: 0;
120
121
  z-index: 10;
121
122
  height: 10px;
122
- bottom: -2px;
123
+ bottom: -3px;
123
124
  background: linear-gradient(
124
125
  180deg,
125
126
  transparent,
126
127
  transparent 3px,
127
- var(--media-control-background) 3px,
128
- var(--media-control-background) 8px,
129
- transparent 8px,
128
+ var(--media-control-background, rgba(20, 20, 30, 0.7)) 3px,
129
+ var(--media-control-background, rgba(20, 20, 30, 0.7)) 7px,
130
+ transparent 7px,
130
131
  transparent
131
132
  );
133
+ width: 100%;
134
+ }
135
+
136
+ media-control-bar {
137
+ --media-control-padding: 9px 7px;
138
+ }
139
+
140
+ .size-small media-control-bar {
141
+ --media-control-padding: 9px 5px;
142
+ }
143
+
144
+ .size-extra-small media-control-bar {
145
+ --media-control-padding: 4px 3px;
132
146
  }
133
147
 
134
148
  media-control-bar :is([role='button'], [role='switch'], button) {
135
149
  line-height: 0;
136
- --media-control-padding: 10px 7px;
137
150
  }
138
151
 
139
- .size-extra-small media-control-bar [role='button'],
140
- .size-extra-small media-control-bar [role='switch'] {
141
- height: auto;
142
- padding: 4.4% 3.2%;
152
+ media-control-bar :is(media-text-display, mxp-time-display):first-child {
153
+ --media-control-padding: 9px 5px 9px 10px;
143
154
  }
144
155
 
145
156
  .spacer {
146
157
  flex-grow: 1;
147
- height: 100%;
148
158
  background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
149
159
  }
150
160
 
151
161
  /* Add a small space on the right to have the play button and
152
162
  * fullscreen button aligned in relation to the progress bar. */
153
- .size-large .padding-2 {
163
+ media-control-bar:not([slot])::after {
164
+ content: '';
154
165
  width: 2px;
155
166
  height: 100%;
156
167
  background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
157
168
  }
158
169
 
170
+ media-control-bar[slot='top-chrome'] {
171
+ min-height: 42px;
172
+ pointer-events: none;
173
+ }
174
+
175
+ :host([title]) media-control-bar[slot='top-chrome']::before {
176
+ content: '';
177
+ position: absolute;
178
+ width: 100%;
179
+ padding-bottom: min(160px, 25%);
180
+ background: linear-gradient(rgb(0 0 0 / 0.4), transparent);
181
+ }
182
+
183
+ media-control-bar[slot='top-chrome'] > * {
184
+ --media-control-background: transparent;
185
+ --media-control-hover-background: transparent;
186
+ position: relative;
187
+ }
188
+
159
189
  media-controller::part(vertical-layer) {
160
190
  transition: background-color 1s;
161
191
  }
162
192
 
163
193
  media-controller:is([media-paused], :not([user-inactive]))::part(vertical-layer) {
164
- background-color: var(--controls-backdrop-color, var(--controls, rgba(0, 0, 0, 0.6)));
194
+ background-color: var(--controls-backdrop-color, var(--controls, transparent));
165
195
  transition: background-color 0.25s;
166
196
  }
167
197
 
@@ -174,13 +204,18 @@ media-controller:is([media-paused], :not([user-inactive]))::part(vertical-layer)
174
204
  flex-flow: row;
175
205
  align-items: center;
176
206
  justify-content: center;
207
+ filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.25)) drop-shadow(0 0 6px rgb(0 0 0 / 0.25));
208
+ paint-order: stroke;
209
+ stroke: rgba(102, 102, 102, 1);
210
+ stroke-width: 0.3px;
211
+ text-shadow: 0 0 2px rgb(0 0 0 / 0.25), 0 0 6px rgb(0 0 0 / 0.25);
177
212
  }
178
213
 
179
214
  .center-controls media-play-button {
180
215
  --media-control-background: transparent;
181
216
  --media-control-hover-background: transparent;
182
217
  padding: 0;
183
- width: max(30px, min(11%, 100px));
218
+ width: max(43px, min(10%, 55px));
184
219
  }
185
220
 
186
221
  .center-controls media-seek-backward-button,
@@ -188,8 +223,16 @@ media-controller:is([media-paused], :not([user-inactive]))::part(vertical-layer)
188
223
  --media-control-background: transparent;
189
224
  --media-control-hover-background: transparent;
190
225
  padding: 0;
191
- margin: 0 4%;
192
- width: min(7%, 70px);
226
+ margin: 0 2%;
227
+ width: max(33px, min(8%, 40px));
228
+ }
229
+
230
+ media-control-bar:not([slot]) media-seek-backward-button {
231
+ padding-right: 5px;
232
+ }
233
+
234
+ media-control-bar:not([slot]) media-seek-forward-button {
235
+ padding-left: 5px;
193
236
  }
194
237
 
195
238
  media-loading-indicator {
@@ -231,52 +274,53 @@ media-time-display {
231
274
 
232
275
  .title-display {
233
276
  font-size: 16px;
277
+ text-shadow: 0 0 2px rgb(0 0 0 / 0.6);
234
278
  }
235
279
 
236
280
  :host([audio]) .title-display {
237
281
  flex-grow: 1;
238
282
  font-size: 21px;
239
283
  }
240
- `;var ma=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
284
+ `;var ua=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
241
285
  <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
286
  <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
287
  </svg>
244
- `;var ua=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
288
+ `;var ha=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
245
289
  <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
290
  </svg>
247
- `;var ca=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
291
+ `;var ba=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
248
292
  <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
293
  </svg>
250
- `;var ha=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
294
+ `;var pa=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
251
295
  <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
296
  <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
253
297
  <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
298
  </svg>
255
- `;var ba=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
299
+ `;var ga=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
256
300
  <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
301
  <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
258
302
  <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
303
  <path d="M20.5 5.5h-15v5.811c3.52.906 6.283 3.67 7.189 7.19H20.5V5.5Z"/>
260
304
  </svg>
261
- `;var pa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
305
+ `;var fa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
262
306
  <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
307
  </svg>
264
- `;var ga=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
308
+ `;var va=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
265
309
  <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
310
  </svg>
267
- `;var fa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
311
+ `;var ya=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
268
312
  <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
313
  </svg>
270
- `;var va=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
314
+ `;var Ea=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
271
315
  <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
316
  </svg>
273
- `;var ya=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
317
+ `;var ka=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
274
318
  <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
319
  </svg>
276
- `;var Ea=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
320
+ `;var Ta=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
277
321
  <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
322
  </svg>
279
- `;var ka=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
323
+ `;var Aa=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
280
324
  <path d="M11 6V3L5.37 7 11 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 11 6Z"/>
281
325
  <text
282
326
  class="value"
@@ -286,7 +330,7 @@ media-time-display {
286
330
  {{value}}
287
331
  </text>
288
332
  </svg>
289
- `;var Ta=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
333
+ `;var xa=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
290
334
  <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
335
  <text
292
336
  class="value"
@@ -296,21 +340,21 @@ media-time-display {
296
340
  {{value}}
297
341
  </text>
298
342
  </svg>
299
- `;var Aa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
343
+ `;var La=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
300
344
  <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
345
  </svg>
302
- `;var xa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
346
+ `;var wa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
303
347
  <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
348
  </svg>
305
- `;var wa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
349
+ `;var $a=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
306
350
  <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
351
  </svg>
308
- `;var La=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
352
+ `;var Sa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
309
353
  <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
354
  </svg>
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`
355
+ `;var Ca=()=>y(ua),Oa=()=>y(ha),Ma=()=>y(ba),Pa=()=>y(pa),Ia=()=>y(ga),Ra=()=>y(fa),Da=()=>y(va),_a=()=>y(ya),Na=()=>y(Ea),Va=()=>y(ka),Ha=()=>y(Ta),Ba=e=>y(Aa,e),Ka=e=>y(xa,e),Ua=()=>y(La),Fa=()=>y(wa),Ya=()=>y($a),Za=()=>y(Sa);import{StreamTypes as w}from"@mux/playback-core";var N={LG:"large",SM:"small",XS:"extra-small"},He,Wa,Ve=class extends Ji{constructor(){super();h(this,He);p(this,He,Wa).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,o;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(s`
312
356
  <style>
313
- ${da}
357
+ ${ca}
314
358
  </style>
315
359
  <media-controller
316
360
  gestures-disabled="${!t.hasSrc||t.isDialogOpen}"
@@ -328,240 +372,251 @@ media-time-display {
328
372
  placeholder-src="${(r=t.placeholder)!=null?r:!1}"
329
373
  ></media-poster-image>
330
374
  <media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
331
- ${Ji(t)}
375
+ ${Qi(t)}
332
376
  <slot></slot>
333
377
  </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,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`
378
+ `,this.shadowRoot),(o=this.shadowRoot)==null||o.querySelectorAll("*").forEach(n=>{if(!n.localName.includes("-"))return;let m=n.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!m)return;let[,,b,f]=m;b==="text"&&n.classList.contains("title-display")&&(b="title");let v=n.closest('[slot="top-chrome"]')?"top":n.closest('[slot="centered-chrome"]')?"center":"bottom";n.setAttribute("part",`${v} ${b} ${f}`)})}};He=new WeakSet,Wa=function(){var t,i;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"})}catch{}};g.customElements.get("media-theme-mux")||g.customElements.define("media-theme-mux",Ve);var Qi=e=>{let{streamType:a,playerSize:t,audio:i}=e;if(i)switch(a){case w.LIVE:case w.LL_LIVE:return ar(e);case w.DVR:case w.LL_DVR:return tr(e);case w.ON_DEMAND:default:return er(e)}switch(a){case w.LIVE:case w.LL_LIVE:switch(t){case N.LG:return lr(e);case N.SM:return sr(e);case N.XS:return nr(e)}case w.DVR:case w.LL_DVR:switch(t){case N.LG:return cr(e);case N.SM:return mr(e);case N.XS:return dr(e)}case w.ON_DEMAND:default:switch(t){case N.LG:return or(e);case N.SM:return rr(e);case N.XS:return ir(e)}}},L=e=>s`
335
379
  <media-play-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
336
- ${Na()}
337
- ${Ia()}
338
- </media-play-button>`,oe=({backwardSeekOffset:e,hasSrc:a,isDialogOpen:t})=>l`
380
+ ${Ha()}
381
+ ${_a()}
382
+ </media-play-button>`,le=({backwardSeekOffset:e,hasSrc:a,isDialogOpen:t})=>s`
339
383
  <media-seek-backward-button seek-offset="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
340
- ${Va({value:e})}
341
- </media-seek-backward-button>`,se=({forwardSeekOffset:e,hasSrc:a,isDialogOpen:t})=>l`
384
+ ${Ba({value:e})}
385
+ </media-seek-backward-button>`,de=({forwardSeekOffset:e,hasSrc:a,isDialogOpen:t})=>s`
342
386
  <media-seek-forward-button seek-offset="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
343
- ${Ha({value:e})}
344
- </media-seek-forward-button>`,C=({isDialogOpen:e})=>l`
387
+ ${Ka({value:e})}
388
+ </media-seek-forward-button>`,S=({isDialogOpen:e})=>s`
345
389
  <media-mute-button disabled="${e}" aria-disabled="${e&&"true"}">
346
- ${Ba()}
347
390
  ${Ua()}
348
- ${Ka()}
391
+ ${Ya()}
349
392
  ${Fa()}
350
- </media-mute-button>`,J=({defaultHiddenCaptions:e,isDialogOpen:a})=>l`
393
+ ${Za()}
394
+ </media-mute-button>`,V=({defaultHiddenCaptions:e,isDialogOpen:a})=>s`
351
395
  <media-captions-button default-showing="${!e}" disabled="${a}" aria-disabled="${a&&"true"}">
352
- ${Sa()}
353
396
  ${Oa()}
354
- </media-captions-button>`,M=e=>l`
397
+ ${Ma()}
398
+ </media-captions-button>`,H=e=>s`
355
399
  <media-airplay-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
356
- ${$a()}
357
- </media-airplay-button>`,Q=e=>l`
400
+ ${Ca()}
401
+ </media-airplay-button>`,me=e=>s`
358
402
  <media-pip-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
359
- ${Da()}
360
- ${_a()}
361
- </media-pip-button>`,ee=e=>l`
403
+ ${Na()}
404
+ ${Va()}
405
+ </media-pip-button>`,B=e=>s`
362
406
  <media-fullscreen-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
363
- ${Pa()}
364
407
  ${Ra()}
365
- </media-fullscreen-button>`,P=e=>l`
408
+ ${Da()}
409
+ </media-fullscreen-button>`,K=e=>s`
366
410
  <media-cast-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
367
- ${Ca()}
368
- ${Ma()}
369
- </media-cast-button>`,Be=({playbackRates:e,isDialogOpen:a})=>l`
411
+ ${Pa()}
412
+ ${Ia()}
413
+ </media-cast-button>`,Be=({playbackRates:e,isDialogOpen:a})=>s`
370
414
  <media-playback-rate-button rates="${e!=null?e:!1}" disabled="${a}" aria-disabled="${a&&"true"}">
371
- </media-playback-rate-button>`,H=({isDialogOpen:e})=>l`
415
+ </media-playback-rate-button>`,U=({isDialogOpen:e})=>s`
372
416
  <media-volume-range disabled="${e}" aria-disabled="${e&&"true"}">
373
- </media-volume-range>`,le=e=>l`
417
+ </media-volume-range>`,q=e=>s`
374
418
  <media-time-range disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
375
- </media-time-range>`,Ke=({defaultShowRemainingTime:e,hasSrc:a,isDialogOpen:t})=>l`
419
+ </media-time-range>`,Ke=({defaultShowRemainingTime:e,hasSrc:a,isDialogOpen:t})=>s`
376
420
  <mxp-time-display remaining="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
377
- </mxp-time-display>`,B=({title:e})=>l`
378
- <media-text-display part="title" class="title-display">${e}</media-text-display>`,Qi=e=>l`
379
- ${e.title?`<media-control-bar>${B(e)}</media-control-bar>`:l``}
421
+ </mxp-time-display>`,F=({title:e})=>s`
422
+ <media-text-display part="title" class="title-display">${e}</media-text-display>`,er=e=>s`
423
+ ${e.title?s`<media-control-bar>${F(e)}</media-control-bar>`:s``}
380
424
  <media-control-bar>
381
425
  ${L(e)}
382
- ${oe(e)}
383
- ${se(e)}
384
- ${Ke(e)}
385
426
  ${le(e)}
386
- ${C(e)}
387
- ${H(e)}
427
+ ${de(e)}
428
+ ${Ke(e)}
429
+ ${q(e)}
430
+ ${S(e)}
431
+ ${U(e)}
388
432
  ${Be(e)}
389
- ${M(e)}
390
- ${P(e)}
433
+ ${H(e)}
434
+ ${K(e)}
391
435
  </media-control-bar>
392
- `,er=e=>l`
393
- ${e.title?`<media-control-bar>${B(e)}</media-control-bar>`:l``}
436
+ `,tr=e=>s`
437
+ ${e.title?s`<media-control-bar>${F(e)}</media-control-bar>`:s``}
394
438
  <media-control-bar>
395
439
  ${L(e)}
396
440
  <slot name="seek-live"></slot>
397
- ${oe(e)}
398
- ${se(e)}
399
- ${Ke(e)}
400
441
  ${le(e)}
401
- ${C(e)}
402
- ${H(e)}
442
+ ${de(e)}
443
+ ${Ke(e)}
444
+ ${q(e)}
445
+ ${S(e)}
446
+ ${U(e)}
403
447
  ${Be(e)}
404
- ${M(e)}
405
- ${P(e)}
448
+ ${H(e)}
449
+ ${K(e)}
406
450
  </media-control-bar>
407
- `,tr=e=>l`
408
- ${e.title?`<media-control-bar>${B(e)}</media-control-bar>`:l``}
451
+ `,ar=e=>s`
452
+ ${e.title?s`<media-control-bar>${F(e)}</media-control-bar>`:s``}
409
453
  <media-control-bar>
410
454
  ${L(e)}
411
455
  <slot name="seek-live"></slot>
412
- ${C(e)}
413
- ${H(e)}
414
- ${M(e)}
415
- ${P(e)}
416
- </media-control-bar>
417
- `,bt=e=>l`
418
- <media-control-bar slot="top-chrome">
419
- ${J(e)}
456
+ ${S(e)}
457
+ ${U(e)}
420
458
  <div class="spacer"></div>
421
- ${M(e)}
422
- ${P(e)}
423
- ${Q(e)}
459
+ ${H(e)}
460
+ ${K(e)}
424
461
  </media-control-bar>
425
- <div slot="centered-chrome" class="center-controls">
426
- ${L(e)}
427
- </div>
462
+ `,ir=e=>s`
463
+ ${q(e)}
428
464
  <media-control-bar>
429
- ${C(e)}
465
+ ${L(e)}
466
+ ${S(e)}
430
467
  <div class="spacer"></div>
431
- ${ee(e)}
468
+ ${V(e)}
469
+ ${B(e)}
432
470
  </media-control-bar>
433
- `,ar=e=>l`
471
+ `,rr=e=>s`
434
472
  <media-control-bar slot="top-chrome">
435
- ${e.title?B(e):l``}
436
- <div class="spacer"></div>
437
- ${J(e)}
438
- ${M(e)}
439
- ${P(e)}
440
- ${Q(e)}
473
+ ${e.title?F(e):s``}
441
474
  </media-control-bar>
442
475
  <div slot="centered-chrome" class="center-controls">
443
- ${oe(e)}
476
+ ${le(e)}
444
477
  ${L(e)}
445
- ${se(e)}
478
+ ${de(e)}
446
479
  </div>
447
- ${le(e)}
480
+ ${q(e)}
448
481
  <media-control-bar>
449
482
  ${Ke(e)}
450
- ${C(e)}
451
- ${H(e)}
483
+ ${S(e)}
484
+ ${U(e)}
452
485
  <div class="spacer"></div>
453
486
  ${Be(e)}
454
- ${ee(e)}
455
- <div class="padding-2"></div>
487
+ ${V(e)}
488
+ ${H(e)}
489
+ ${K(e)}
490
+ ${me(e)}
491
+ ${B(e)}
456
492
  </media-control-bar>
457
- `,ir=e=>l`
493
+ `,or=e=>s`
458
494
  <media-control-bar slot="top-chrome">
459
- ${e.title?B(e):l``}
495
+ ${e.title?F(e):s``}
460
496
  </media-control-bar>
461
497
  <div slot="centered-chrome" class="center-controls">
462
498
  ${L(e)}
463
499
  </div>
464
- ${le(e)}
500
+ ${q(e)}
465
501
  <media-control-bar>
466
502
  ${L(e)}
467
- ${oe(e)}
468
- ${se(e)}
503
+ ${le(e)}
504
+ ${de(e)}
469
505
  ${Ke(e)}
470
- ${C(e)}
471
- ${H(e)}
506
+ ${S(e)}
507
+ ${U(e)}
472
508
  <div class="spacer"></div>
473
509
  ${Be(e)}
474
- ${J(e)}
475
- ${M(e)}
476
- ${P(e)}
477
- ${Q(e)}
478
- ${ee(e)}
479
- <div class="padding-2"></div>
510
+ ${V(e)}
511
+ ${H(e)}
512
+ ${K(e)}
513
+ ${me(e)}
514
+ ${B(e)}
480
515
  </media-control-bar>
481
- `,rr=bt,nr=e=>l`
516
+ `,nr=e=>s`
482
517
  <media-control-bar slot="top-chrome">
483
- ${e.title?B(e):l``}
518
+ <slot name="seek-live"></slot>
519
+ </media-control-bar>
520
+ <media-control-bar>
521
+ ${L(e)}
522
+ ${S(e)}
484
523
  <div class="spacer"></div>
485
- ${J(e)}
486
- ${M(e)}
487
- ${P(e)}
488
- ${Q(e)}
524
+ ${V(e)}
525
+ ${B(e)}
526
+ </media-control-bar>
527
+ `,sr=e=>s`
528
+ <media-control-bar slot="top-chrome">
529
+ <slot name="seek-live"></slot>
530
+ ${e.title?F(e):s``}
489
531
  </media-control-bar>
490
532
  <div slot="centered-chrome" class="center-controls">
491
533
  ${L(e)}
492
534
  </div>
493
535
  <media-control-bar>
494
- ${C(e)}
495
- ${H(e)}
496
- <slot name="seek-live"></slot>
536
+ ${S(e)}
537
+ ${U(e)}
497
538
  <div class="spacer"></div>
498
- ${ee(e)}
539
+ ${V(e)}
540
+ ${H(e)}
541
+ ${K(e)}
542
+ ${me(e)}
543
+ ${B(e)}
499
544
  </media-control-bar>
500
- `,or=e=>l`
545
+ `,lr=e=>s`
501
546
  <media-control-bar slot="top-chrome">
502
- ${e.title?B(e):l``}
547
+ <slot name="seek-live"></slot>
548
+ ${e.title?F(e):s``}
503
549
  </media-control-bar>
504
550
  <div slot="centered-chrome" class="center-controls">
505
551
  ${L(e)}
506
552
  </div>
507
553
  <media-control-bar>
508
- ${C(e)}
554
+ ${L(e)}
555
+ ${S(e)}
556
+ ${U(e)}
557
+ <div class="spacer"></div>
558
+ ${V(e)}
509
559
  ${H(e)}
560
+ ${K(e)}
561
+ ${me(e)}
562
+ ${B(e)}
563
+ </media-control-bar>
564
+ `,dr=e=>s`
565
+ <media-control-bar slot="top-chrome">
510
566
  <slot name="seek-live"></slot>
567
+ </media-control-bar>
568
+ ${q(e)}
569
+ <media-control-bar>
570
+ ${L(e)}
571
+ ${S(e)}
511
572
  <div class="spacer"></div>
512
- ${J(e)}
513
- ${M(e)}
514
- ${P(e)}
515
- ${Q(e)}
516
- ${ee(e)}
573
+ ${V(e)}
574
+ ${B(e)}
517
575
  </media-control-bar>
518
- `,sr=bt,lr=e=>l`
576
+ `,mr=e=>s`
519
577
  <media-control-bar slot="top-chrome">
520
- ${e.title?B(e):l``}
521
- <div class="spacer"></div>
522
- ${J(e)}
523
- ${M(e)}
524
- ${P(e)}
525
- ${Q(e)}
578
+ <slot name="seek-live"></slot>
579
+ ${e.title?F(e):s``}
526
580
  </media-control-bar>
527
581
  <div slot="centered-chrome" class="center-controls">
528
- ${oe(e)}
582
+ ${le(e)}
529
583
  ${L(e)}
530
- ${se(e)}
584
+ ${de(e)}
531
585
  </div>
532
- ${le(e)}
586
+ ${q(e)}
533
587
  <media-control-bar>
534
- ${C(e)}
535
- ${H(e)}
536
- <slot name="seek-live"></slot>
588
+ ${S(e)}
589
+ ${U(e)}
537
590
  <div class="spacer"></div>
538
- ${ee(e)}
539
- <div class="padding-2"></div>
591
+ ${V(e)}
592
+ ${H(e)}
593
+ ${K(e)}
594
+ ${me(e)}
595
+ ${B(e)}
540
596
  </media-control-bar>
541
- `,dr=e=>l`
597
+ `,cr=e=>s`
542
598
  <media-control-bar slot="top-chrome">
543
- ${e.title?B(e):l``}
599
+ <slot name="seek-live"></slot>
600
+ ${e.title?F(e):s``}
544
601
  </media-control-bar>
545
602
  <div slot="centered-chrome" class="center-controls">
546
603
  ${L(e)}
547
604
  </div>
548
- ${le(e)}
605
+ ${q(e)}
549
606
  <media-control-bar>
550
607
  ${L(e)}
551
- ${oe(e)}
552
- ${se(e)}
553
- ${C(e)}
554
- ${H(e)}
555
- <slot name="seek-live"></slot>
608
+ ${le(e)}
609
+ ${de(e)}
610
+ ${S(e)}
611
+ ${U(e)}
556
612
  <div class="spacer"></div>
557
- ${J(e)}
558
- ${M(e)}
559
- ${P(e)}
560
- ${Q(e)}
561
- ${ee(e)}
562
- <div class="padding-2"></div>
613
+ ${V(e)}
614
+ ${H(e)}
615
+ ${K(e)}
616
+ ${me(e)}
617
+ ${B(e)}
563
618
  </media-control-bar>
564
- `;var Wa=`
619
+ `;var qa=`
565
620
  :host {
566
621
  z-index: 100;
567
622
  display: flex;
@@ -613,17 +668,17 @@ media-time-display {
613
668
  text-align: center;
614
669
  line-height: 1.4;
615
670
  }
616
- `,za=S.createElement("template");za.innerHTML=`
671
+ `,ja=O.createElement("template");ja.innerHTML=`
617
672
  <style>
618
- ${Wa}
673
+ ${qa}
619
674
  </style>
620
675
 
621
676
  <div class="dialog">
622
677
  <slot></slot>
623
678
  </div>
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=`
679
+ `;var j=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})),ur(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)}};j.styles=qa,j.template=ja,j.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=Ga(e.shadowRoot)),e._previouslyFocusedElement=O.activeElement,O.activeElement instanceof HTMLElement&&O.activeElement.blur(),e.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function Ga(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 o=0;o<r.length&&!(r[o].tagName&&r[o].shadowRoot&&(i=Ga(r[o].shadowRoot),i));o++);}return i}function ur(e){e._previouslyFocusedElement instanceof HTMLElement&&e._previouslyFocusedElement.focus()}g.customElements.get("media-dialog")||(g.customElements.define("media-dialog",j),g.MediaDialog=j);var bt=j;var Xa=O.createElement("template");Xa.innerHTML=`
625
680
  <style>
626
- ${pt.styles}
681
+ ${bt.styles}
627
682
 
628
683
  .close {
629
684
  background: none;
@@ -652,7 +707,7 @@ media-time-display {
652
707
  </svg>
653
708
  </button>
654
709
  </slot>
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 {
710
+ `;var xe=class extends bt{constructor(){var a,t;super(),(t=(a=this.shadowRoot)==null?void 0:a.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};xe.template=Xa;g.customElements.get("mxp-dialog")||(g.customElements.define("mxp-dialog",xe),g.MxpDialog=xe);var Ja=`:host {
656
711
  display: inline-block;
657
712
  width: 100%;
658
713
  }
@@ -667,21 +722,36 @@ a {
667
722
  font-size: 0.9em;
668
723
  text-decoration: underline;
669
724
  }
670
- [part~='seek-live'] {
671
- height: 44px;
725
+
726
+ [audio] [part~='seek-live'] {
727
+ margin: 0;
728
+ height: 42px;
729
+ border-radius: 0;
672
730
  background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
673
- color: white;
731
+ }
732
+
733
+ [part~='seek-live'] {
734
+ margin-left: 10px;
735
+ margin-right: 5px;
736
+ align-self: center;
737
+ position: relative;
738
+ box-sizing: border-box;
739
+ padding: 4px 6px;
740
+ border-radius: 12px;
741
+ background-color: rgba(20, 20, 30, 0.7);
742
+ font-size: 0.75rem;
743
+ line-height: 1;
744
+ color: #fff;
674
745
  border: none;
675
746
  cursor: pointer;
676
747
  }
677
748
 
678
- [part~='seek-live']::before {
679
- content: '\u25CF ';
680
- color: rgb(118, 118, 118);
681
- padding-right: 5px;
749
+ [part~='seek-live'] svg {
750
+ width: 8px;
751
+ fill: rgb(118, 118, 118);
682
752
  }
683
- [part~='seek-live'][in-live-window]::before {
684
- color: #fb3c4d;
753
+ [part~='seek-live'][in-live-window] svg {
754
+ fill: #fb3c4d;
685
755
  }
686
756
 
687
757
  [part~='seek-live'][disabled] {
@@ -803,92 +873,90 @@ a {
803
873
  ::part(title display) {
804
874
  display: var(--media-controls, var(--media-title-display));
805
875
  }
806
- `;import{StreamTypes as de}from"@mux/playback-core";var Qa=e=>l`
876
+ `;import{StreamTypes as ce}from"@mux/playback-core";var ei=e=>s`
807
877
  <style>
808
- ${Ga}
878
+ ${Ja}
809
879
  </style>
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`
880
+ ${pr(e)}
881
+ `,Qa=e=>[ce.LIVE,ce.LL_LIVE].includes(e.streamType),br=e=>[ce.LIVE,ce.LL_LIVE,ce.DVR,ce.LL_DVR].includes(e.streamType),pr=e=>{var a,t,i,r,o,n,m,b,f,v,C,W,E,I,R,D,k,Ce,ge,re,vt,yt,Et,kt,Tt,At,xt,Lt,wt,$t,St,Ct,Ot,Mt,Pt,It,Rt,Dt,_t,Nt,Vt,Ht,Bt;return s`
812
882
  <${ht((a=st(e.theme))!=null?a:"media-theme-mux")}
813
883
  has-src="${(t=e.hasSrc)!=null?t:!1}"
814
884
  has-open-dialog="${(i=e.isDialogOpen)!=null?i:!1}"
815
885
  nohotkeys="${(r=e.noHotKeys)!=null?r:!1}"
816
- audio="${(n=e.audio)!=null?n:!1}"
817
- style="${(o=Ft({"--primary-color":e.primaryColor,"--secondary-color":e.secondaryColor}))!=null?o:!1}"
886
+ audio="${(o=e.audio)!=null?o:!1}"
887
+ style="${(n=Zt({"--primary-color":e.primaryColor,"--secondary-color":e.secondaryColor}))!=null?n:!1}"
818
888
  class="size-${e.playerSize}${e.secondaryColor?" two-tone":""}"
819
889
  stream-type="${(m=e.streamType)!=null?m:!1}"
820
890
  player-size="${(b=e.playerSize)!=null?b:!1}"
821
891
  default-hidden-captions="${(f=e.defaultHiddenCaptions)!=null?f:!1}"
822
892
  forward-seek-offset="${(v=e.forwardSeekOffset)!=null?v:!1}"
823
- backward-seek-offset="${($=e.backwardSeekOffset)!=null?$:!1}"
824
- playbackrates="${(Y=e.playbackRates)!=null?Y:!1}"
893
+ backward-seek-offset="${(C=e.backwardSeekOffset)!=null?C:!1}"
894
+ playbackrates="${(W=e.playbackRates)!=null?W:!1}"
825
895
  default-show-remaining-time="${(E=e.defaultShowRemainingTime)!=null?E:!1}"
826
896
  title="${(I=e.title)!=null?I:!1}"
827
- hotkeys="${(D=e.hotKeys)!=null?D:!1}"
828
- poster="${e.poster===""?!1:(_=e.poster)!=null?_:!1}"
897
+ hotkeys="${(R=e.hotKeys)!=null?R:!1}"
898
+ poster="${e.poster===""?!1:(D=e.poster)!=null?D:!1}"
829
899
  placeholder="${(k=e.placeholder)!=null?k:!1}"
830
900
  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"
831
901
  >
832
902
  <mux-video
833
903
  slot="media"
834
- crossorigin="${(Oe=e.crossOrigin)!=null?Oe:""}"
904
+ crossorigin="${(Ce=e.crossOrigin)!=null?Ce:""}"
835
905
  playsinline
836
- autoplay="${(pe=e.autoplay)!=null?pe:!1}"
837
- muted="${(ae=e.muted)!=null?ae:!1}"
838
- loop="${(yt=e.loop)!=null?yt:!1}"
839
- preload="${(Et=e.preload)!=null?Et:!1}"
840
- debug="${(kt=e.debug)!=null?kt:!1}"
841
- prefer-playback="${(Tt=e.preferPlayback)!=null?Tt:!1}"
906
+ autoplay="${(ge=e.autoplay)!=null?ge:!1}"
907
+ muted="${(re=e.muted)!=null?re:!1}"
908
+ loop="${(vt=e.loop)!=null?vt:!1}"
909
+ preload="${(yt=e.preload)!=null?yt:!1}"
910
+ debug="${(Et=e.debug)!=null?Et:!1}"
911
+ experimental-cmcd="${(kt=e.experimentalCmcd)!=null?kt:!1}"
912
+ disable-cookies="${(Tt=e.disableCookies)!=null?Tt:!1}"
913
+ prefer-playback="${(At=e.preferPlayback)!=null?At:!1}"
842
914
  start-time="${e.startTime!=null?e.startTime:!1}"
843
- metadata-video-id="${(At=e.metadataVideoId)!=null?At:!1}"
844
- metadata-video-title="${(xt=e.metadataVideoTitle)!=null?xt:!1}"
845
- metadata-viewer-user-id="${(wt=e.metadataViewerUserId)!=null?wt:!1}"
846
- beacon-collection-domain="${(Lt=e.beaconCollectionDomain)!=null?Lt:!1}"
847
- player-software-name="${($t=e.playerSoftwareName)!=null?$t:!1}"
848
- player-software-version="${(St=e.playerSoftwareVersion)!=null?St:!1}"
849
- env-key="${(Ot=e.envKey)!=null?Ot:!1}"
850
- stream-type="${(Ct=e.streamType)!=null?Ct:!1}"
851
- custom-domain="${(Mt=e.customDomain)!=null?Mt:!1}"
852
- src="${e.src?e.src:e.playbackId?ot(e.playbackId,{domain:e.customDomain,token:e.tokens.playback}):!1}"
853
- cast-src="${e.src?e.src:e.playbackId?ot(e.playbackId,{domain:e.customDomain,token:e.tokens.playback}):!1}"
854
- cast-stream-type="${Xa(e)?"live":!1}"
915
+ metadata-video-id="${(xt=e.metadataVideoId)!=null?xt:!1}"
916
+ metadata-video-title="${(wt=(Lt=e.metadataVideoTitle)!=null?Lt:e.title)!=null?wt:!1}"
917
+ metadata-viewer-user-id="${($t=e.metadataViewerUserId)!=null?$t:!1}"
918
+ beacon-collection-domain="${(St=e.beaconCollectionDomain)!=null?St:!1}"
919
+ player-software-name="${(Ct=e.playerSoftwareName)!=null?Ct:!1}"
920
+ player-software-version="${(Ot=e.playerSoftwareVersion)!=null?Ot:!1}"
921
+ env-key="${(Mt=e.envKey)!=null?Mt:!1}"
922
+ stream-type="${(Pt=e.streamType)!=null?Pt:!1}"
923
+ custom-domain="${(It=e.customDomain)!=null?It:!1}"
924
+ src="${e.src?e.src:e.playbackId?nt(e.playbackId,{domain:e.customDomain,token:e.tokens.playback}):!1}"
925
+ cast-src="${e.src?e.src:e.playbackId?nt(e.playbackId,{domain:e.customDomain,token:e.tokens.playback}):!1}"
926
+ cast-stream-type="${Qa(e)?"live":!1}"
855
927
  exportparts="video"
856
928
  >
857
- ${e.playbackId&&!e.audio&&!Ja(e)?l`<track
858
- label="thumbnails"
859
- default
860
- kind="metadata"
861
- src="${qt(e.playbackId,{domain:e.customDomain,token:e.tokens.storyboard})}"
862
- />`:l``}
929
+ ${e.storyboard?s`<track label="thumbnails" default kind="metadata" src="${e.storyboard}" />`:s``}
863
930
  </mux-video>
864
- ${Ja(e)?l`<button
931
+ ${br(e)?s`<button
865
932
  slot="seek-live"
866
- part="${Xa(e)?"top":"bottom"} seek-live button"
933
+ part="${Qa(e)?"top":"bottom"} seek-live button"
867
934
  disabled="${e.inLiveWindow||!e.hasSrc||e.isDialogOpen}"
868
935
  aria-disabled="${(e.inLiveWindow||!e.hasSrc||e.isDialogOpen)&&"true"}"
869
936
  in-live-window="${e.inLiveWindow}"
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)}}}"
937
+ onclick="${function(li){var Kt;if((Kt=e.onSeekToLive)==null||Kt.call(e,li),e.paused){let di=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(di)}}}"
871
938
  >
939
+ <svg viewBox="0 0 8 8"><circle cx="4" cy="4" r="4"></circle></svg>
872
940
  Live
873
- </button>`:l``}
941
+ </button>`:s``}
874
942
  <mxp-dialog
875
943
  no-auto-hide
876
- open="${(Pt=e.isDialogOpen)!=null?Pt:!1}"
944
+ open="${(Rt=e.isDialogOpen)!=null?Rt:!1}"
877
945
  onclose="${e.onCloseErrorDialog}"
878
946
  oninitfocus="${e.onInitFocusDialog}"
879
947
  >
880
- ${(Rt=e.dialog)!=null&&Rt.title?l`<h3>${e.dialog.title}</h3>`:l``}
948
+ ${(Dt=e.dialog)!=null&&Dt.title?s`<h3>${e.dialog.title}</h3>`:s``}
881
949
  <p>
882
- ${(It=e.dialog)==null?void 0:It.message}
883
- ${(Dt=e.dialog)!=null&&Dt.linkUrl?l`<a
950
+ ${(_t=e.dialog)==null?void 0:_t.message}
951
+ ${(Nt=e.dialog)!=null&&Nt.linkUrl?s`<a
884
952
  href="${e.dialog.linkUrl}"
885
953
  target="_blank"
886
954
  rel="external noopener"
887
- aria-label="${(_t=e.dialog.linkText)!=null?_t:""} ${u("(opens in a new window)")}"
888
- >${(Nt=e.dialog.linkText)!=null?Nt:e.dialog.linkUrl}</a
889
- >`:l``}
955
+ aria-label="${(Vt=e.dialog.linkText)!=null?Vt:""} ${c("(opens in a new window)")}"
956
+ >${(Ht=e.dialog.linkText)!=null?Ht:e.dialog.linkUrl}</a
957
+ >`:s``}
890
958
  </p>
891
959
  </mxp-dialog>
892
- </${ht((Vt=st(e.theme))!=null?Vt:"media-theme-mux")}>
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};
960
+ </${ht((Bt=st(e.theme))!=null?Bt:"media-theme-mux")}>
961
+ `};import{MediaError as Ue}from"@mux/mux-video";function Fe(e,a,t,i,r){var m,b,f;let o={},n={};switch(e.code){case Ue.MEDIA_ERR_NETWORK:{switch(o.title=c("Network Error",r),o.message=e.message,(m=e.data)==null?void 0:m.response.code){case 412:{o.title=c("Video is not currently available",r),o.message=c("The live stream or video file are not yet ready.",r),n.message=c("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),n.file="412-not-playable.md";break}case 404:{o.title=c("Video does not exist",r),o.message="",n.message=c("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),n.file="404-not-found.md";break}case 403:{if(o.title=c("Invalid playback URL",r),o.message=c("The video URL or playback-token are formatted with incorrect or incomplete information.",r),n.message=c("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),n.file="missing-signed-tokens.md",!i)break;let{exp:v,aud:C,sub:W}=z(i),E=Date.now()>v*1e3,I=W!==t,R=C!=="v",D={timeStyle:"medium",dateStyle:"medium"};if(E){o.title=c("Video URL has expired",r),o.message=c("The video\u2019s secured playback-token has expired.",r),n.message=c("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(X.code,D).format(v*1e3),currentDate:new Intl.DateTimeFormat(X.code,D).format(Date.now())}),n.file="403-expired-token.md";break}if(I){o.title=c("Video URL is formatted incorrectly",r),o.message=c("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),n.message=c("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:t,tokenPlaybackId:W}),n.file="403-playback-id-mismatch.md";break}if(R){o.title=c("Video URL is formatted incorrectly",r),o.message=c("The playback-token is formatted with incorrect information.",r),n.message=c("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:C}),n.file="403-incorrect-aud-value.md";break}n.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.",r),n.file="403-malformatted-token.md";break}}break}case Ue.MEDIA_ERR_DECODE:{let{message:v}=e;o={title:c("Media Error",r),message:v},n.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:o,devlog:n}=Fe(e,a,t,i);break}o={title:c("Source Not Supported",r),message:e.message},n.file="media-src-not-supported.md";break}default:o={title:c("Error",r),message:e.message};break}return a&&(o={title:c("Your device appears to be offline",r),message:c("Check your internet connection and try reloading this video.",r)}),{dialog:o,devlog:n}}var Er=Object.values($),kr=700,Tr=300,gt={LG:"large",SM:"small",XS:"extra-small"};function Ze(e){let a=e.getBoundingClientRect();return a.width<Tr?gt.XS:a.width<kr?gt.SM:gt.LG}var Y={SRC:"src",POSTER:"poster"},l={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 Ar(e,a){var i,r;return{src:!e.playbackId&&e.src,playbackId:e.playbackId,hasSrc:!!e.playbackId||!!e.src,poster:e.poster,storyboard:e.storyboard,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(l.NOHOTKEYS),hotKeys:e.getAttribute(l.HOTKEYS),muted:e.muted,paused:e.paused,preload:e.preload,envKey:e.envKey,experimentalCmcd:e.experimentalCmcd,debug:e.debug,disableCookies:e.disableCookies,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(l.PLAYBACK_RATES),customDomain:(i=e.getAttribute(u.CUSTOM_DOMAIN))!=null?i: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(l.TITLE),...a}}var xr=Object.values(u),Lr=Object.values(Y),wr=Object.values(l),$r=Ie(),Sr="mux-player",ti={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},ie,we,Z,$e,he,P,be,We,G,ue,pe,ze,Se,ft,qe,ai,je,ii,Ge,ri,Xe,oi,Je,ni,Qe,si,Le=class extends mt{constructor(){super();h(this,be);h(this,G);h(this,pe);h(this,Se);h(this,qe);h(this,je);h(this,Ge);h(this,Xe);h(this,Je);h(this,Qe);h(this,ie,!1);h(this,we,{});h(this,Z,!0);h(this,$e,new Pe(this,"hotkeys"));h(this,he,void 0);h(this,P,{...ti,onCloseErrorDialog:()=>p(this,G,ue).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{rt(this,O.activeElement)||t.preventDefault()},onSeekToLive:()=>lt(this)});this.attachShadow({mode:"open"}),this.isConnected&&p(this,be,We).call(this)}static get observedAttributes(){var t;return[...(t=mt.observedAttributes)!=null?t:[],...Lr,...xr,...wr]}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,ft).call(this),p(this,qe,ai).call(this)}disconnectedCallback(){p(this,je,ii).call(this)}attributeChangedCallback(t,i,r){switch(d(this,ie)||p(this,be,We).call(this),super.attributeChangedCallback(t,i,r),t){case l.HOTKEYS:d(this,$e).value=r;break;case l.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&ee(c("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case l.THUMBNAIL_TOKEN:{let{aud:n}=z(r);r&&n!=="t"&&ee(c("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:n}));break}case l.STORYBOARD_TOKEN:{let{aud:n}=z(r);r&&n!=="s"&&ee(c("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:n}));break}case u.PLAYBACK_ID:{r!=null&&r.includes("?token")&&M(c("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&&!Er.includes(this.streamType)&&Re({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})}):Re({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,Y.SRC,l.PLAYBACK_TOKEN].includes(t)&&i!==r&&A(this,P,{...d(this,P),...ti}),p(this,pe,ze).call(this,{[Xt(t)]:r})}get experimentalCmcd(){return this.hasAttribute(u.EXPERIMENTAL_CMCD)}set experimentalCmcd(t){!!t!==this.experimentalCmcd&&(t?this.setAttribute(u.EXPERIMENTAL_CMCD,""):this.removeAttribute(u.EXPERIMENTAL_CMCD))}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,P).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,i;return this.playbackId?(t=ae(this,Y.SRC))!=null?t:void 0:(i=this.getAttribute(Y.SRC))!=null?i:void 0}set src(t){t?this.setAttribute(Y.SRC,t):this.removeAttribute(Y.SRC)}get poster(){var i;let t=this.getAttribute(Y.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return jt(this.playbackId,{domain:this.customDomain,thumbnailTime:(i=this.thumbnailTime)!=null?i:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Y.POSTER,t):this.removeAttribute(Y.POSTER)}get storyboard(){if(this.playbackId&&!this.audio&&(!this.streamType||![$.LIVE,$.LL_LIVE,$.DVR,$.LL_DVR].includes(this.streamType)))return Gt(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(l.AUDIO)}set audio(t){if(!t){this.removeAttribute(l.AUDIO);return}this.setAttribute(l.AUDIO,"")}get hotkeys(){return d(this,$e)}get nohotkeys(){return this.hasAttribute(l.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(l.NOHOTKEYS);return}this.setAttribute(l.NOHOTKEYS,"")}get thumbnailTime(){return _(this.getAttribute(l.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(l.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(l.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(l.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=ae(this,l.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(l.PLACEHOLDER,`${t}`)}get primaryColor(){var t;return(t=this.getAttribute(l.PRIMARY_COLOR))!=null?t:void 0}set primaryColor(t){this.setAttribute(l.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var t;return(t=this.getAttribute(l.SECONDARY_COLOR))!=null?t:"rgb(0 0 0 / .65)"}set secondaryColor(t){this.setAttribute(l.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(l.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(l.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(l.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(l.PLAYBACK_RATES))return this.getAttribute(l.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(l.PLAYBACK_RATES);return}this.setAttribute(l.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=_(this.getAttribute(l.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(l.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=_(this.getAttribute(l.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(l.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(l.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(l.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(l.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(u.PLAYER_SOFTWARE_NAME))!=null?t:Sr}get playerSoftwareVersion(){var t;return(t=this.getAttribute(u.PLAYER_SOFTWARE_VERSION))!=null?t:$r}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=ae(this,u.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(u.ENV_KEY,`${t}`)}get debug(){return ae(this,u.DEBUG)!=null}set debug(t){t?this.setAttribute(u.DEBUG,""):this.removeAttribute(u.DEBUG)}get disableCookies(){return ae(this,u.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(u.DISABLE_COOKIES,""):this.removeAttribute(u.DISABLE_COOKIES)}get streamType(){return ae(this,u.STREAM_TYPE)}set streamType(t){this.setAttribute(u.STREAM_TYPE,`${t}`)}get startTime(){return _(ae(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,ie)||p(this,be,We).call(this),!this.media){M("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(l.PLAYBACK_TOKEN),i=this.getAttribute(l.THUMBNAIL_TOKEN),r=this.getAttribute(l.STORYBOARD_TOKEN);return{...d(this,we),...t!=null?{playback:t}:{},...i!=null?{thumbnail:i}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){A(this,we,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(l.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(l.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(l.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(l.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(l.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(l.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,i,r,o){var m;let n=(m=this.media)==null?void 0:m.nativeEl;if(!!n)return vr(n,t,i,r,o)}removeTextTrack(t){var r;let i=(r=this.media)==null?void 0:r.nativeEl;if(!!i)return yr(i,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};ie=new WeakMap,we=new WeakMap,Z=new WeakMap,$e=new WeakMap,he=new WeakMap,P=new WeakMap,be=new WeakSet,We=function(){var t,i,r;if(!d(this,ie)){A(this,ie,!0),p(this,G,ue).call(this,{playerSize:Ze(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof g.HTMLElement))throw""}catch{M(`<${(t=this.theme)==null?void 0:t.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof fr))throw""}catch{M("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof gr))throw""}catch{M("<media-controller> failed to upgrade!")}ia(this),p(this,Xe,oi).call(this),p(this,Je,ni).call(this),p(this,Ge,ri).call(this),A(this,Z,(r=(i=this.mediaController)==null?void 0:i.hasAttribute("user-inactive"))!=null?r:!0),p(this,Qe,si).call(this)}},G=new WeakSet,ue=function(t){Object.assign(d(this,P),t),p(this,pe,ze).call(this)},pe=new WeakSet,ze=function(t={}){_e(ei(Ar(this,{...d(this,P),...t})),this.shadowRoot)},Se=new WeakSet,ft=function(){var t,i;d(this,P).playerSize!=Ze((t=this.mediaController)!=null?t:this)&&p(this,G,ue).call(this,{playerSize:Ze((i=this.mediaController)!=null?i:this)})},qe=new WeakSet,ai=function(){var t;A(this,he,new ResizeObserver(()=>p(this,Se,ft).call(this))),d(this,he).observe((t=this.mediaController)!=null?t:this)},je=new WeakSet,ii=function(){var t;(t=d(this,he))==null||t.disconnect()},Ge=new WeakSet,ri=function(){var i,r,o,n,m;(i=this.mediaController)==null||i.addEventListener("mediaplayrequest",b=>{var f;((f=b.target)==null?void 0:f.localName)==="media-play-button"&&this.streamType&&[$.LIVE,$.LL_LIVE,$.DVR,$.LL_DVR].includes(this.streamType)&&this.hasPlayed&&lt(this)});let t=()=>{let b=Qt(this),f=d(this,P).inLiveWindow;b!==f&&(p(this,G,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),(o=this.media)==null||o.addEventListener("waiting",t),(n=this.media)==null||n.addEventListener("timeupdate",t),(m=this.media)==null||m.addEventListener("emptied",t)},Xe=new WeakSet,oi=function(){var i;let t=r=>{let{detail:o}=r;if(o instanceof pt||(o=new pt(o.message,o.code,o.fatal)),!(o!=null&&o.fatal)){ee(o),o.data&&ee(`${o.name} data:`,o.data);return}let{dialog:n,devlog:m}=Fe(o,!window.navigator.onLine,this.playbackId,this.playbackToken);m.message&&Re(m),M(o),o.data&&M(`${o.name} data:`,o.data),p(this,G,ue).call(this,{isDialogOpen:!0,dialog:n})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var n,m,b;if(!((n=this.media)!=null&&n.error))return r;let{devlog:o}=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:o.message?String(o.message):r.player_error_message}}),(i=this.media)==null||i.addEventListener("error",r=>{var n,m;let{detail:o}=r;if(!o){let{message:b,code:f}=(m=(n=this.media)==null?void 0:n.error)!=null?m:{};o=new pt(b,f)}!(o!=null&&o.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:o}))})},Je=new WeakSet,ni=function(){var i,r,o,n;let t=()=>p(this,pe,ze).call(this);(r=(i=this.media)==null?void 0:i.textTracks)==null||r.addEventListener("addtrack",t),(n=(o=this.media)==null?void 0:o.textTracks)==null||n.addEventListener("removetrack",t)},Qe=new WeakSet,si=function(){var v,C,W;let t=this.mediaController,i=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(i)return;let r,o=new WeakMap,n=()=>this.streamType&&[$.LIVE,$.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,m=(E,I,R=!1)=>{if(n())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 Ce=k.text.split(`
962
+ `).length,ge=i?-2:-3;this.streamType&&[$.LIVE,$.LL_LIVE].includes(this.streamType)&&(ge=i?-1:-2);let re=ge-Ce;if(k.line===re&&!R)return;o.has(k)||o.set(k,k.line),k.line=re-1,k.line=re}else setTimeout(()=>{k.line=o.get(k)||"auto"},500)})},b=()=>{var E;m(r,(E=t==null?void 0:t.hasAttribute("user-inactive"))!=null?E:!1)},f=()=>{var R;let I=Array.from(((R=t==null?void 0:t.media)==null?void 0:R.textTracks)||[]).filter(D=>["subtitles","captions"].includes(D.kind)&&D.mode==="showing")[0];I!==r&&(r==null||r.removeEventListener("cuechange",b)),r=I,r==null||r.addEventListener("cuechange",b),m(r,d(this,Z))};if(f(),(v=t==null?void 0:t.media)==null||v.textTracks.addEventListener("change",f),(C=t==null?void 0:t.media)==null||C.textTracks.addEventListener("addtrack",f),navigator.userAgent.includes("Chrome/")){let E=()=>{m(r,d(this,Z),!0),this.paused||window.requestAnimationFrame(E)};(W=t==null?void 0:t.media)==null||W.addEventListener("playing",()=>{E()})}t==null||t.addEventListener("userinactivechange",()=>{let E=t==null?void 0:t.hasAttribute("user-inactive");d(this,Z)!==E&&(A(this,Z,E),m(r,d(this,Z)))})};function ae(e,a){return e.media?e.media.getAttribute(a):e.getAttribute(a)}g.customElements.get("mux-player")||(g.customElements.define("mux-player",Le),g.MuxPlayerElement=Le);var pn=Le;export{pt as MediaError,pn as default,ae as getVideoAttribute};