@mux/mux-player 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1561,7 +1561,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1561
1561
  <path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>
1562
1562
  </svg>`,hp=m.createElement("template");hp.innerHTML=`
1563
1563
  <slot name="icon">${Ob}</slot>
1564
- `;var Lu=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:hp})}get mediaAudioTrackEnabled(){return I(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){k(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-button")||l.customElements.define("media-audio-track-button",Lu);var ho=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}init(){let e=m.createElement("media-audio-track-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-audio-track-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-audio-track-selectmenu")||l.customElements.define("media-audio-track-selectmenu",ho);var A=fv(require("@mux/mux-video")),z=require("@mux/playback-core");var Tp=require("@mux/mux-video");var Pb="en",Ti={code:Pb};var pp="en";function C(i,e=!0){var r,n;let t=e&&(n=(r=Ti)==null?void 0:r[i])!=null?n:i,a=e?Ti.code:pp;return new Mu(t,a)}var Mu=class{constructor(e,t=(a=>(a=Ti.code)!=null?a:pp)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function vp(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${po(t)}: ${a}; `)}),e?e.trim():void 0}function po(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function vo(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Et(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function wu(i){let e=Nb(i).toString();return e?"?"+e:""}function Nb(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function qt(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var Ru=(i,e)=>!i||!e?!1:i.contains(e)?!0:Ru(i,e.getRootNode().host);var fo=require("@mux/playback-core");var fp="mux.com",Ub=()=>{try{return"2.4.0"}catch{}return"UNKNOWN"},Bb=Ub(),Eo=()=>Bb,bp=(i,{token:e,customDomain:t=fp,thumbnailTime:a}={})=>{let r=e==null?a:void 0,{aud:n}=qt(e);if(!(e&&n!=="t"))return`https://image.${t}/${i}/thumbnail.webp${wu({token:e,time:r})}`},Ep=(i,{token:e,customDomain:t=fp}={})=>{let{aud:a}=qt(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${wu({token:e,format:"webp"})}`},Ar=i=>{if(i){if([fo.StreamTypes.LIVE,fo.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return fo.StreamTypes.LIVE}};var Wb={crossorigin:"crossOrigin",playsinline:"playsInline"};function gp(i){var e;return(e=Wb[i])!=null?e:vo(i)}var ki,Si,ve,bo=class{constructor(e,t){ee(this,ki,void 0);ee(this,Si,void 0);ee(this,ve,[]);Ce(this,ki,e),Ce(this,Si,t)}[Symbol.iterator](){return O(this,ve).values()}get length(){return O(this,ve).length}get value(){var e;return(e=O(this,ve).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ce(this,ve,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return O(this,ve)[e]}values(){return O(this,ve).values()}keys(){return O(this,ve).keys()}forEach(e){O(this,ve).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||O(this,ve).push(r)}),!(this.value===""&&!((t=O(this,ki))!=null&&t.hasAttribute(`${O(this,Si)}`)))&&((a=O(this,ki))==null||a.setAttribute(`${O(this,Si)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{O(this,ve).splice(O(this,ve).indexOf(a),1)}),(t=O(this,ki))==null||t.setAttribute(`${O(this,Si)}`,`${this.value}`)}contains(e){return O(this,ve).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};ki=new WeakMap,Si=new WeakMap,ve=new WeakMap;var _p=`[mux-player ${Eo()}]`;function Zt(...i){console.warn(_p,...i)}function Oe(...i){console.error(_p,...i)}function xu(i){var t;let e=(t=i.message)!=null?t:"";if(i.context&&(e+=` ${i.context}`),i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${C("Read more: ")}
1564
+ `;var Lu=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:hp})}get mediaAudioTrackEnabled(){return I(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){k(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-button")||l.customElements.define("media-audio-track-button",Lu);var ho=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}init(){let e=m.createElement("media-audio-track-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-audio-track-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-audio-track-selectmenu")||l.customElements.define("media-audio-track-selectmenu",ho);var A=fv(require("@mux/mux-video")),z=require("@mux/playback-core");var Tp=require("@mux/mux-video");var Pb="en",Ti={code:Pb};var pp="en";function C(i,e=!0){var r,n;let t=e&&(n=(r=Ti)==null?void 0:r[i])!=null?n:i,a=e?Ti.code:pp;return new Mu(t,a)}var Mu=class{constructor(e,t=(a=>(a=Ti.code)!=null?a:pp)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function vp(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${po(t)}: ${a}; `)}),e?e.trim():void 0}function po(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function vo(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Et(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function wu(i){let e=Nb(i).toString();return e?"?"+e:""}function Nb(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function qt(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var Ru=(i,e)=>!i||!e?!1:i.contains(e)?!0:Ru(i,e.getRootNode().host);var fo=require("@mux/playback-core");var fp="mux.com",Ub=()=>{try{return"2.4.1"}catch{}return"UNKNOWN"},Bb=Ub(),Eo=()=>Bb,bp=(i,{token:e,customDomain:t=fp,thumbnailTime:a}={})=>{let r=e==null?a:void 0,{aud:n}=qt(e);if(!(e&&n!=="t"))return`https://image.${t}/${i}/thumbnail.webp${wu({token:e,time:r})}`},Ep=(i,{token:e,customDomain:t=fp}={})=>{let{aud:a}=qt(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${wu({token:e,format:"webp"})}`},Ar=i=>{if(i){if([fo.StreamTypes.LIVE,fo.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return fo.StreamTypes.LIVE}};var Wb={crossorigin:"crossOrigin",playsinline:"playsInline"};function gp(i){var e;return(e=Wb[i])!=null?e:vo(i)}var ki,Si,ve,bo=class{constructor(e,t){ee(this,ki,void 0);ee(this,Si,void 0);ee(this,ve,[]);Ce(this,ki,e),Ce(this,Si,t)}[Symbol.iterator](){return O(this,ve).values()}get length(){return O(this,ve).length}get value(){var e;return(e=O(this,ve).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ce(this,ve,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return O(this,ve)[e]}values(){return O(this,ve).values()}keys(){return O(this,ve).keys()}forEach(e){O(this,ve).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||O(this,ve).push(r)}),!(this.value===""&&!((t=O(this,ki))!=null&&t.hasAttribute(`${O(this,Si)}`)))&&((a=O(this,ki))==null||a.setAttribute(`${O(this,Si)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{O(this,ve).splice(O(this,ve).indexOf(a),1)}),(t=O(this,ki))==null||t.setAttribute(`${O(this,Si)}`,`${this.value}`)}contains(e){return O(this,ve).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};ki=new WeakMap,Si=new WeakMap,ve=new WeakMap;var _p=`[mux-player ${Eo()}]`;function Zt(...i){console.warn(_p,...i)}function Oe(...i){console.error(_p,...i)}function xu(i){var t;let e=(t=i.message)!=null?t:"";if(i.context&&(e+=` ${i.context}`),i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${C("Read more: ")}
1565
1565
  ${a}${i.file}`}Zt(e)}var pe={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Ii={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},yp=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Hb=Tp.VideoEvents.filter(i=>i!=="error"),$b=Object.values(pe).filter(i=>![pe.PLAYSINLINE].includes(i)),Fb=Object.values(Ii);function kp(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),Hb.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var Du=class extends Z.HTMLElement{static get observedAttributes(){return[...$b,...Fb]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var d,u;let o=(d=this.media)==null?void 0:d.querySelector(`track[src="${n.src}"]`);o&&((u=this.media)==null||u.removeChild(o))}),r.addedNodes.forEach(n=>{var o;(o=this.media)==null||o.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case Ii.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Ii.VOLUME:{let o=(r=Et(a))!=null?r:1;this.media&&(this.media.volume=o);return}case Ii.PLAYBACKRATE:{let o=(n=Et(a))!=null?n:1;this.media&&(this.media.playbackRate=o,this.media.defaultPlaybackRate=o);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:yp}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:yp}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=Et(this.getAttribute(Ii.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Ii.PLAYBACKRATE,`${e}`):this.removeAttribute(Ii.PLAYBACKRATE)}get crossOrigin(){return yr(this,pe.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(pe.CROSSORIGIN,`${e}`)}get autoplay(){return yr(this,pe.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(pe.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(pe.AUTOPLAY)}get loop(){return yr(this,pe.LOOP)!=null}set loop(e){e?this.setAttribute(pe.LOOP,""):this.removeAttribute(pe.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return yr(this,pe.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(pe.MUTED,""):this.removeAttribute(pe.MUTED)}get playsInline(){return yr(this,pe.PLAYSINLINE)!=null}set playsInline(e){Oe("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(pe.PRELOAD,e):this.removeAttribute(pe.PRELOAD)}};function yr(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Ou=Du;var Vb=Object.defineProperty,Kb=(i,e,t)=>e in i?Vb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Yb=(i,e,t)=>(Kb(i,typeof e!="symbol"?e+"":e,t),t),Mp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},S=(i,e,t)=>(Mp(i,e,"read from private field"),t?t.call(i):e.get(i)),gt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Lt=(i,e,t,a)=>(Mp(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ha,go,Ci,Tr,Qt,zt,Xt,Li,pa,_o,Qe,Sp=1,Ip=0,Gb=1,qb={processCallback(i,e,t){if(t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof fe&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof fe?r.element[r.attributeName]=n:r.value=n}}}},Mt=class extends l.DocumentFragment{constructor(e,t,a=qb){var r;super(),gt(this,ha,void 0),gt(this,go,void 0),this.append(e.content.cloneNode(!0)),Lt(this,ha,wp(this)),Lt(this,go,a),(r=a.createCallback)==null||r.call(a,this,S(this,ha),t),a.processCallback(this,S(this,ha),t)}update(e){S(this,go).processCallback(this,S(this,ha),e)}};ha=new WeakMap;go=new WeakMap;var wp=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Pu;for([t,a]of Lp(r.value))if(!t)n.append(a);else{let o=new fe(i,r.name,r.namespaceURI);n.append(o),e.push([a,o])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===Sp&&!(r instanceof HTMLTemplateElement))wp(r,e);else if(r.nodeType===Sp||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of Lp(r.data))if(!t)n.push(new Text(a));else{let o=new wt(i);n.push(o),e.push([a,o])}else if(r instanceof HTMLTemplateElement){let o=new kr(i,r);n.push(o),e.push([o.expression,o])}r.replaceWith(...n.flatMap(o=>o.replacementNodes||[o]))}return e},Cp={},Lp=i=>{let e="",t=0,a=Cp[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([Ip,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Gb,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Ip,(t>0?"{{":"")+e]),Cp[i]=a},Zb=11,Ao=class{get value(){return""}set value(e){}toString(){return this.value}},Rp=new WeakMap,Pu=class{constructor(){gt(this,Ci,[])}[Symbol.iterator](){return S(this,Ci).values()}get length(){return S(this,Ci).length}item(e){return S(this,Ci)[e]}append(...e){for(let t of e)t instanceof fe&&Rp.set(t,this),S(this,Ci).push(t)}toString(){return S(this,Ci).join("")}};Ci=new WeakMap;var fe=class extends Ao{constructor(e,t,a){super(),gt(this,Li),gt(this,Tr,""),gt(this,Qt,void 0),gt(this,zt,void 0),gt(this,Xt,void 0),Lt(this,Qt,e),Lt(this,zt,t),Lt(this,Xt,a)}get attributeName(){return S(this,zt)}get attributeNamespace(){return S(this,Xt)}get element(){return S(this,Qt)}get value(){return S(this,Tr)}set value(e){S(this,Tr)!==e&&(Lt(this,Tr,e),!S(this,Li,pa)||S(this,Li,pa).length===1?e==null?S(this,Qt).removeAttributeNS(S(this,Xt),S(this,zt)):S(this,Qt).setAttributeNS(S(this,Xt),S(this,zt),e):S(this,Qt).setAttributeNS(S(this,Xt),S(this,zt),S(this,Li,pa)))}get booleanValue(){return S(this,Qt).hasAttributeNS(S(this,Xt),S(this,zt))}set booleanValue(e){if(!S(this,Li,pa)||S(this,Li,pa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Tr=new WeakMap;Qt=new WeakMap;zt=new WeakMap;Xt=new WeakMap;Li=new WeakSet;pa=function(){return Rp.get(this)};var wt=class extends Ao{constructor(e,t){super(),gt(this,_o,void 0),gt(this,Qe,void 0),Lt(this,_o,e),Lt(this,Qe,t?[...t]:[new Text])}get replacementNodes(){return S(this,Qe)}get parentNode(){return S(this,_o)}get nextSibling(){return S(this,Qe)[S(this,Qe).length-1].nextSibling}get previousSibling(){return S(this,Qe)[0].previousSibling}get value(){return S(this,Qe).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===Zb?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Lt(this,Qe,Qb(S(this,Qe)[0].parentNode,S(this,Qe),t,this.nextSibling))}};_o=new WeakMap;Qe=new WeakMap;var kr=class extends wt{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),Yb(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Qb(i,e,t,a=null){let r=0,n,o,d,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)d=t[r++],o=n?n.nextSibling:a,n==d?n=o:r<u&&t[r]==o?(i.replaceChild(d,n),n=o):i.insertBefore(d,n);for(;n!=a;)o=n.nextSibling,i.removeChild(n),n=o}return t}var xp={string:i=>String(i)},To=class{constructor(e){this.template=e,this.state=void 0}},Mi=new WeakMap,wi=new WeakMap,Nu={partial:(i,e)=>{e[i.expression]=new To(i.template)},if:(i,e)=>{var t;if(Op(i.expression,e))if(Mi.get(i)!==i.template){Mi.set(i,i.template);let a=new Mt(i.template,e,ko);i.replace(a),wi.set(i,a)}else(t=wi.get(i))==null||t.update(e);else i.replace(""),Mi.delete(i),wi.delete(i)}},zb=Object.keys(Nu),ko={processCallback(i,e,t){var a,r;if(t)for(let[n,o]of e){if(o instanceof kr){if(!o.directive){let u=zb.find(c=>o.template.hasAttribute(c));u&&(o.directive=u,o.expression=o.template.getAttribute(u))}(a=Nu[o.directive])==null||a.call(Nu,o,t);continue}let d=Op(n,t);if(d instanceof To){Mi.get(o)!==d.template?(Mi.set(o,d.template),d=new Mt(d.template,d.state,ko),o.value=d,wi.set(o,d)):(r=wi.get(o))==null||r.update(d.state);continue}d?(o instanceof fe&&o.attributeName.startsWith("aria-")&&(d=String(d)),o instanceof fe?typeof d=="boolean"?o.booleanValue=d:typeof d=="function"?o.element[o.attributeName]=d:o.value=d:(o.value=d,Mi.delete(o),wi.delete(o))):o instanceof fe?o.value=void 0:(o.value=void 0,Mi.delete(o),wi.delete(o))}}},Dp={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=xp[e])==null?void 0:t.call(xp,i)}};function Xb(i){return Jb(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Op(i,e={}){var t,a,r,n,o,d,u;let c=Xb(i);if(c.length===0||c.some(({type:f})=>!f))return Sr(i);if(((t=c[0])==null?void 0:t.token)===">"){let f=e[(a=c[1])==null?void 0:a.token];if(!f)return Sr(i);let E={...e};f.state=E;let v=c.slice(2);for(let b=0;b<v.length;b+=3){let w=(r=v[b])==null?void 0:r.token,_=(n=v[b+1])==null?void 0:n.token,T=(o=v[b+2])==null?void 0:o.token;w&&_==="="&&(E[w]=Ir(T,e))}return f}if(c.length===1)return yo(c[0])?Ir(c[0].token,e):Sr(i);if(c.length===2){let f=(d=c[0])==null?void 0:d.token,E=Dp[f];if(!E||!yo(c[1]))return Sr(i);let v=Ir(c[1].token,e);return E(v)}if(c.length===3){let f=(u=c[1])==null?void 0:u.token,E=Dp[f];if(!E||!yo(c[0])||!yo(c[2]))return Sr(i);let v=Ir(c[0].token,e);if(f==="|")return E(v,c[2].token);let b=Ir(c[2].token,e);return E(v,b)}}function Sr(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function yo({type:i}){return["number","boolean","string","param"].includes(i)}function Ir(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):Fr(i)?parseFloat(i):e[i]}function Jb(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let o in e)a=e[o].exec(i),a&&a.index<t&&(r={token:a[0],type:o,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var jb=Object.defineProperty,e0=(i,e,t)=>e in i?jb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Lr=(i,e,t)=>(e0(i,typeof e!="symbol"?e+"":e,t),t),Fu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Wu=(i,e,t)=>(Fu(i,e,"read from private field"),t?t.call(i):e.get(i)),Cr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ri=(i,e,t,a)=>(Fu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Uu=(i,e,t)=>(Fu(i,e,"access private method"),t),va,So,fa,Hu,Pp,Io,$u,Bu={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Np=m.createElement("template");Np.innerHTML=`
1566
1566
  <style>
1567
1567
  :host {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var Ce=(t,a,e)=>{if(!a.has(t))throw TypeError("Cannot "+e)};var u=(t,a,e)=>(Ce(t,a,"read from private field"),e?e.call(t):a.get(t)),h=(t,a,e)=>{if(a.has(t))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(t):a.set(t,e)},C=(t,a,e,i)=>(Ce(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e);var f=(t,a,e)=>(Ce(t,a,"access private method"),e);var W=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends W{}globalThis.DocumentFragment=t}var z=class extends W{},xe=class extends W{},Bt={get(t){},define(t,a,e){},upgrade(t){},whenDefined(t){return Promise.resolve(z)}},X,Le=class{constructor(a,e={}){h(this,X,void 0);C(this,X,e==null?void 0:e.detail)}get detail(){return u(this,X)}initCustomEvent(){}};X=new WeakMap;function Ut(t,a){return new z}var rt={document:{createElement:Ut},DocumentFragment,customElements:Bt,CustomEvent:Le,EventTarget:W,HTMLElement:z,HTMLVideoElement:xe},ot=typeof window=="undefined"||typeof globalThis.customElements=="undefined",c=ot?rt:globalThis,T=ot?rt.document:globalThis.document;import{MediaController as ha}from"media-chrome";import{Attributes as He}from"media-chrome/dist/media-container.js";import{MediaUIAttributes as Mt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import fa,{MediaError as ge,Attributes as d}from"@mux/mux-video";import{StreamTypes as w,PlaybackTypes as ye,addTextTrack as ga,removeTextTrack as ya,CmcdTypeValues as St}from"@mux/playback-core";import{VideoEvents as Zt}from"@mux/mux-video";var $t="en",B={code:$t};var nt="en";function l(t,a=!0){var r,o;let e=a&&(o=(r=B)==null?void 0:r[t])!=null?o:t,i=a?B.code:nt;return new Re(e,i)}var Re=class{constructor(a,e=(i=>(i=B.code)!=null?i:nt)()){this.message=a,this.locale=e}format(a){return this.message.replace(/\{(\w+)\}/g,(e,i)=>{var r;return(r=a[i])!=null?r:""})}toString(){return this.message}};function st(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${se(e)}: ${i}; `)}),a?a.trim():void 0}function se(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function de(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function R(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function we(t){let a=Kt(t).toString();return a?"?"+a:""}function Kt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}function P(t){let a=(t!=null?t:"").split(".")[1];if(!a)return{};let e=a.replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}var Oe=(t,a)=>!t||!a?!1:t.contains(a)?!0:Oe(t,a.getRootNode().host);import{StreamTypes as Me}from"@mux/playback-core";var dt="mux.com",Ft=()=>{try{return"2.4.0"}catch{}return"UNKNOWN"},Yt=Ft(),me=()=>Yt,lt=(t,{token:a,customDomain:e=dt,thumbnailTime:i}={})=>{let r=a==null?i:void 0,{aud:o}=P(a);if(!(a&&o!=="t"))return`https://image.${e}/${t}/thumbnail.webp${we({token:a,time:r})}`},mt=(t,{token:a,customDomain:e=dt}={})=>{let{aud:i}=P(a);if(!(a&&i!=="s"))return`https://image.${e}/${t}/storyboard.vtt${we({token:a,format:"webp"})}`},J=t=>{if(t){if([Me.LIVE,Me.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Me.LIVE}};var Wt={crossorigin:"crossOrigin",playsinline:"playsInline"};function ut(t){var a;return(a=Wt[t])!=null?a:de(t)}var U,$,E,le=class{constructor(a,e){h(this,U,void 0);h(this,$,void 0);h(this,E,[]);C(this,U,a),C(this,$,e)}[Symbol.iterator](){return u(this,E).values()}get length(){return u(this,E).length}get value(){var a;return(a=u(this,E).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(C(this,E,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,E)[a]}values(){return u(this,E).values()}keys(){return u(this,E).keys()}forEach(a){u(this,E).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,E).push(r)}),!(this.value===""&&!((e=u(this,U))!=null&&e.hasAttribute(`${u(this,$)}`)))&&((i=u(this,U))==null||i.setAttribute(`${u(this,$)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,E).splice(u(this,E).indexOf(i),1)}),(e=u(this,U))==null||e.setAttribute(`${u(this,$)}`,`${this.value}`)}contains(a){return u(this,E).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};U=new WeakMap,$=new WeakMap,E=new WeakMap;var ct=`[mux-player ${me()}]`;function N(...t){console.warn(ct,...t)}function x(...t){console.error(ct,...t)}function Se(t){var e;let a=(e=t.message)!=null?e:"";if(t.context&&(a+=` ${t.context}`),t.file){let i="https://github.com/muxinc/elements/blob/main/errors/";a+=` ${l("Read more: ")}
1
+ var Ce=(t,a,e)=>{if(!a.has(t))throw TypeError("Cannot "+e)};var u=(t,a,e)=>(Ce(t,a,"read from private field"),e?e.call(t):a.get(t)),h=(t,a,e)=>{if(a.has(t))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(t):a.set(t,e)},C=(t,a,e,i)=>(Ce(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e);var f=(t,a,e)=>(Ce(t,a,"access private method"),e);var W=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends W{}globalThis.DocumentFragment=t}var z=class extends W{},xe=class extends W{},Bt={get(t){},define(t,a,e){},upgrade(t){},whenDefined(t){return Promise.resolve(z)}},X,Le=class{constructor(a,e={}){h(this,X,void 0);C(this,X,e==null?void 0:e.detail)}get detail(){return u(this,X)}initCustomEvent(){}};X=new WeakMap;function Ut(t,a){return new z}var rt={document:{createElement:Ut},DocumentFragment,customElements:Bt,CustomEvent:Le,EventTarget:W,HTMLElement:z,HTMLVideoElement:xe},ot=typeof window=="undefined"||typeof globalThis.customElements=="undefined",c=ot?rt:globalThis,T=ot?rt.document:globalThis.document;import{MediaController as ha}from"media-chrome";import{Attributes as He}from"media-chrome/dist/media-container.js";import{MediaUIAttributes as Mt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import fa,{MediaError as ge,Attributes as d}from"@mux/mux-video";import{StreamTypes as w,PlaybackTypes as ye,addTextTrack as ga,removeTextTrack as ya,CmcdTypeValues as St}from"@mux/playback-core";import{VideoEvents as Zt}from"@mux/mux-video";var $t="en",B={code:$t};var nt="en";function l(t,a=!0){var r,o;let e=a&&(o=(r=B)==null?void 0:r[t])!=null?o:t,i=a?B.code:nt;return new Re(e,i)}var Re=class{constructor(a,e=(i=>(i=B.code)!=null?i:nt)()){this.message=a,this.locale=e}format(a){return this.message.replace(/\{(\w+)\}/g,(e,i)=>{var r;return(r=a[i])!=null?r:""})}toString(){return this.message}};function st(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${se(e)}: ${i}; `)}),a?a.trim():void 0}function se(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function de(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function R(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function we(t){let a=Kt(t).toString();return a?"?"+a:""}function Kt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}function P(t){let a=(t!=null?t:"").split(".")[1];if(!a)return{};let e=a.replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}var Oe=(t,a)=>!t||!a?!1:t.contains(a)?!0:Oe(t,a.getRootNode().host);import{StreamTypes as Me}from"@mux/playback-core";var dt="mux.com",Ft=()=>{try{return"2.4.1"}catch{}return"UNKNOWN"},Yt=Ft(),me=()=>Yt,lt=(t,{token:a,customDomain:e=dt,thumbnailTime:i}={})=>{let r=a==null?i:void 0,{aud:o}=P(a);if(!(a&&o!=="t"))return`https://image.${e}/${t}/thumbnail.webp${we({token:a,time:r})}`},mt=(t,{token:a,customDomain:e=dt}={})=>{let{aud:i}=P(a);if(!(a&&i!=="s"))return`https://image.${e}/${t}/storyboard.vtt${we({token:a,format:"webp"})}`},J=t=>{if(t){if([Me.LIVE,Me.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Me.LIVE}};var Wt={crossorigin:"crossOrigin",playsinline:"playsInline"};function ut(t){var a;return(a=Wt[t])!=null?a:de(t)}var U,$,E,le=class{constructor(a,e){h(this,U,void 0);h(this,$,void 0);h(this,E,[]);C(this,U,a),C(this,$,e)}[Symbol.iterator](){return u(this,E).values()}get length(){return u(this,E).length}get value(){var a;return(a=u(this,E).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(C(this,E,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,E)[a]}values(){return u(this,E).values()}keys(){return u(this,E).keys()}forEach(a){u(this,E).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,E).push(r)}),!(this.value===""&&!((e=u(this,U))!=null&&e.hasAttribute(`${u(this,$)}`)))&&((i=u(this,U))==null||i.setAttribute(`${u(this,$)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,E).splice(u(this,E).indexOf(i),1)}),(e=u(this,U))==null||e.setAttribute(`${u(this,$)}`,`${this.value}`)}contains(a){return u(this,E).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};U=new WeakMap,$=new WeakMap,E=new WeakMap;var ct=`[mux-player ${me()}]`;function N(...t){console.warn(ct,...t)}function x(...t){console.error(ct,...t)}function Se(t){var e;let a=(e=t.message)!=null?e:"";if(t.context&&(a+=` ${t.context}`),t.file){let i="https://github.com/muxinc/elements/blob/main/errors/";a+=` ${l("Read more: ")}
2
2
  ${i}${t.file}`}N(a)}var y={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},K={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},bt=Object.freeze({length:0,start(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),jt=Zt.filter(t=>t!=="error"),Gt=Object.values(y).filter(t=>![y.PLAYSINLINE].includes(t)),qt=Object.values(K);function ht(t){t.querySelectorAll(":scope > track").forEach(a=>{var e;(e=t.media)==null||e.append(a.cloneNode())}),jt.forEach(a=>{var e;(e=t.media)==null||e.addEventListener(a,i=>{t.dispatchEvent(new Event(i.type))})})}var _e=class extends c.HTMLElement{static get observedAttributes(){return[...Gt,...qt]}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,p;let s=(m=this.media)==null?void 0:m.querySelector(`track[src="${o.src}"]`);s&&((p=this.media)==null||p.removeChild(s))}),r.addedNodes.forEach(o=>{var s;(s=this.media)==null||s.append(o.cloneNode())}))};new MutationObserver(a).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(a,e,i){var r,o;switch(a){case K.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case K.VOLUME:{let s=(r=R(i))!=null?r:1;this.media&&(this.media.volume=s);return}case K.PLAYBACKRATE:{let s=(o=R(i))!=null?o:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var a,e;return(e=(a=this.media)==null?void 0:a.play())!=null?e:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}requestCast(a){var e;return(e=this.media)==null?void 0:e.requestCast(a)}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var a,e;return(e=(a=this.media)==null?void 0:a.paused)!=null?e:!0}get duration(){var a,e;return(e=(a=this.media)==null?void 0:a.duration)!=null?e:NaN}get ended(){var a,e;return(e=(a=this.media)==null?void 0:a.ended)!=null?e:!1}get buffered(){var a,e;return(e=(a=this.media)==null?void 0:a.buffered)!=null?e:bt}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:bt}get readyState(){var a,e;return(e=(a=this.media)==null?void 0:a.readyState)!=null?e:0}get videoWidth(){var a,e;return(e=(a=this.media)==null?void 0:a.videoWidth)!=null?e:0}get videoHeight(){var a,e;return(e=(a=this.media)==null?void 0:a.videoHeight)!=null?e:0}get currentTime(){var a,e;return(e=(a=this.media)==null?void 0:a.currentTime)!=null?e:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,e;return(e=(a=this.media)==null?void 0:a.volume)!=null?e:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,e;return(e=(a=this.media)==null?void 0:a.playbackRate)!=null?e:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=R(this.getAttribute(K.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(K.PLAYBACKRATE,`${a}`):this.removeAttribute(K.PLAYBACKRATE)}get crossOrigin(){return Q(this,y.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(y.CROSSORIGIN,`${a}`)}get autoplay(){return Q(this,y.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(y.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(y.AUTOPLAY)}get loop(){return Q(this,y.LOOP)!=null}set loop(a){a?this.setAttribute(y.LOOP,""):this.removeAttribute(y.LOOP)}get muted(){var a,e;return(e=(a=this.media)==null?void 0:a.muted)!=null?e:!1}set muted(a){this.media&&(this.media.muted=!!a)}get defaultMuted(){return Q(this,y.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(y.MUTED,""):this.removeAttribute(y.MUTED)}get playsInline(){return Q(this,y.PLAYSINLINE)!=null}set playsInline(a){x("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(y.PRELOAD,a):this.removeAttribute(y.PRELOAD)}};function Q(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Pe=_e;import"media-chrome/dist/media-theme-element.js";var ft=`:host {
3
3
  --media-control-display: var(--controls);
4
4
  --media-loading-indicator-display: var(--loading-indicator);