@mux/mux-player 3.11.8-canary.0 → 3.11.8

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/base.cjs.js CHANGED
@@ -1408,7 +1408,7 @@
1408
1408
  <path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
1409
1409
  </svg>
1410
1410
  </div>
1411
- `}function Tv(){return c("Loop")}var Kr=class extends B{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=c("Loop"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return M(this,n.MEDIA_LOOP)}set mediaLoop(e){L(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(h.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Kr.getSlotTemplateHTML=Av;Kr.getTooltipContentHTML=Tv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",Kr);var b=require("@mux/mux-video/base"),O=require("@mux/playback-core");var km=require("@mux/playback-core");var Ti=require("@mux/playback-core");function gm(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${is(i)}: ${a}; `)}),e?e.trim():void 0}function is(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function as(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function fe(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function ld(t){let e=yv(t).toString();return e?"?"+e:""}function yv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var dd=(t,e)=>!t||!e?!1:t.contains(e)?!0:dd(t,e.getRootNode().host);var _m="mux.com",kv=()=>{try{return"3.11.7"}catch{}return"UNKNOWN"},Sv=kv(),os=()=>Sv,Am=(t,{token:e,customDomain:i=_m,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,Ti.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${ld({token:e,time:o,program_time:r})}`},Tm=(t,{token:e,customDomain:i=_m,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,Ti.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${ld({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Gr=t=>{if(t){if([Ti.StreamTypes.LIVE,Ti.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Ti.StreamTypes.LIVE}};var Iv={crossorigin:"crossOrigin",playsinline:"playsInline"};function ym(t){var e;return(e=Iv[t])!=null?e:as(t)}var _i,Ai,ve,rs=class{constructor(e,i){ae(this,_i);ae(this,Ai);ae(this,ve,[]);de(this,_i,e),de(this,Ai,i)}[Symbol.iterator](){return R(this,ve).values()}get length(){return R(this,ve).length}get value(){var e;return(e=R(this,ve).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(de(this,ve,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return R(this,ve)[e]}values(){return R(this,ve).values()}keys(){return R(this,ve).keys()}forEach(e){R(this,ve).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||R(this,ve).push(r)}),!(this.value===""&&!((i=R(this,_i))!=null&&i.hasAttribute(`${R(this,Ai)}`)))&&((a=R(this,_i))==null||a.setAttribute(`${R(this,Ai)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{R(this,ve).splice(R(this,ve).indexOf(a),1)}),(i=R(this,_i))==null||i.setAttribute(`${R(this,Ai)}`,`${this.value}`)}contains(e){return R(this,ve).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};_i=new WeakMap,Ai=new WeakMap,ve=new WeakMap;var Sm=`[mux-player ${os()}]`;function ct(...t){console.warn(Sm,...t)}function Ee(...t){console.error(Sm,...t)}function ud(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,km.i18n)("Read more: ")}
1411
+ `}function Tv(){return c("Loop")}var Kr=class extends B{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=c("Loop"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return M(this,n.MEDIA_LOOP)}set mediaLoop(e){L(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(h.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Kr.getSlotTemplateHTML=Av;Kr.getTooltipContentHTML=Tv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",Kr);var b=require("@mux/mux-video/base"),O=require("@mux/playback-core");var km=require("@mux/playback-core");var Ti=require("@mux/playback-core");function gm(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${is(i)}: ${a}; `)}),e?e.trim():void 0}function is(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function as(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function fe(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function ld(t){let e=yv(t).toString();return e?"?"+e:""}function yv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var dd=(t,e)=>!t||!e?!1:t.contains(e)?!0:dd(t,e.getRootNode().host);var _m="mux.com",kv=()=>{try{return"3.11.8"}catch{}return"UNKNOWN"},Sv=kv(),os=()=>Sv,Am=(t,{token:e,customDomain:i=_m,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,Ti.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${ld({token:e,time:o,program_time:r})}`},Tm=(t,{token:e,customDomain:i=_m,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,Ti.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${ld({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Gr=t=>{if(t){if([Ti.StreamTypes.LIVE,Ti.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Ti.StreamTypes.LIVE}};var Iv={crossorigin:"crossOrigin",playsinline:"playsInline"};function ym(t){var e;return(e=Iv[t])!=null?e:as(t)}var _i,Ai,ve,rs=class{constructor(e,i){ae(this,_i);ae(this,Ai);ae(this,ve,[]);de(this,_i,e),de(this,Ai,i)}[Symbol.iterator](){return R(this,ve).values()}get length(){return R(this,ve).length}get value(){var e;return(e=R(this,ve).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(de(this,ve,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return R(this,ve)[e]}values(){return R(this,ve).values()}keys(){return R(this,ve).keys()}forEach(e){R(this,ve).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||R(this,ve).push(r)}),!(this.value===""&&!((i=R(this,_i))!=null&&i.hasAttribute(`${R(this,Ai)}`)))&&((a=R(this,_i))==null||a.setAttribute(`${R(this,Ai)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{R(this,ve).splice(R(this,ve).indexOf(a),1)}),(i=R(this,_i))==null||i.setAttribute(`${R(this,Ai)}`,`${this.value}`)}contains(e){return R(this,ve).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};_i=new WeakMap,Ai=new WeakMap,ve=new WeakMap;var Sm=`[mux-player ${os()}]`;function ct(...t){console.warn(Sm,...t)}function Ee(...t){console.error(Sm,...t)}function ud(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,km.i18n)("Read more: ")}
1412
1412
  https://github.com/muxinc/elements/blob/main/errors/${t.file}`),ct(e)}var me={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Zt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},RA={...me,...Zt},Mm=Object.freeze({length:0,start(t){let e=t>>>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(t){let e=t>>>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}}),Mv=Object.values(me).filter(t=>me.PLAYSINLINE!==t),Lv=Object.values(Zt),Cv=[...Mv,...Lv],cd=class extends Se.HTMLElement{static get observedAttributes(){return Cv}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case Zt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Zt.VOLUME:{let s=(r=fe(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Zt.PLAYBACKRATE:{let s=(o=fe(a))!=null?o:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,i;return(i=(e=this.media)==null?void 0:e.play())!=null?i:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}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,i;return(i=(e=this.media)==null?void 0:e.paused)!=null?i:!0}get duration(){var e,i;return(i=(e=this.media)==null?void 0:e.duration)!=null?i:NaN}get ended(){var e,i;return(i=(e=this.media)==null?void 0:e.ended)!=null?i:!1}get buffered(){var e,i;return(i=(e=this.media)==null?void 0:e.buffered)!=null?i:Mm}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Mm}get readyState(){var e,i;return(i=(e=this.media)==null?void 0:e.readyState)!=null?i:0}get videoWidth(){var e,i;return(i=(e=this.media)==null?void 0:e.videoWidth)!=null?i:0}get videoHeight(){var e,i;return(i=(e=this.media)==null?void 0:e.videoHeight)!=null?i:0}get currentSrc(){var e,i;return(i=(e=this.media)==null?void 0:e.currentSrc)!=null?i:""}get currentTime(){var e,i;return(i=(e=this.media)==null?void 0:e.currentTime)!=null?i:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,i;return(i=(e=this.media)==null?void 0:e.volume)!=null?i:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,i;return(i=(e=this.media)==null?void 0:e.playbackRate)!=null?i:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=fe(this.getAttribute(Zt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Zt.PLAYBACKRATE,`${e}`):this.removeAttribute(Zt.PLAYBACKRATE)}get crossOrigin(){return Yr(this,me.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(me.CROSSORIGIN,`${e}`)}get autoplay(){return Yr(this,me.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(me.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(me.AUTOPLAY)}get loop(){return Yr(this,me.LOOP)!=null}set loop(e){e?this.setAttribute(me.LOOP,""):this.removeAttribute(me.LOOP)}get muted(){var e,i;return(i=(e=this.media)==null?void 0:e.muted)!=null?i:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return Yr(this,me.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(me.MUTED,""):this.removeAttribute(me.MUTED)}get playsInline(){return Yr(this,me.PLAYSINLINE)!=null}set playsInline(e){Ee("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(me.PRELOAD,e):this.removeAttribute(me.PRELOAD)}};function Yr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var md=cd;var xm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},N=(t,e,i)=>(xm(t,e,"read from private field"),i?i.call(t):e.get(t)),mt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},It=(t,e,i,a)=>(xm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),pa,ns,yi,qr,zt,Qt,Xt,ki,fa,ss,Ze,Lm=1,Cm=0,wv=1,Rv={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let o=i[a];typeof o=="boolean"&&r instanceof be&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof be?r.element[r.attributeName]=o:r.value=o}}}},Mt=class extends l.DocumentFragment{constructor(e,i,a=Rv){var r;super(),mt(this,pa,void 0),mt(this,ns,void 0),this.append(e.content.cloneNode(!0)),It(this,pa,Dm(this)),It(this,ns,a),(r=a.createCallback)==null||r.call(a,this,N(this,pa),i),a.processCallback(this,N(this,pa),i)}update(e){N(this,ns).processCallback(this,N(this,pa),e)}};pa=new WeakMap;ns=new WeakMap;var Dm=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new hd;for([i,a]of Rm(r.value))if(!i)o.append(a);else{let s=new be(t,r.name,r.namespaceURI);o.append(s),e.push([a,s])}r.value=o.toString()}for(let r of t.childNodes)if(r.nodeType===Lm&&!(r instanceof HTMLTemplateElement))Dm(r,e);else{let o=r.data;if(r.nodeType===Lm||o.includes("{{")){let s=[];if(o)for([i,a]of Rm(o))if(!i)s.push(new Text(a));else{let d=new Lt(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new Zr(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},wm={},Rm=t=>{let e="",i=0,a=wm[t],r=0,o;if(a)return a;for(a=[];o=t[r];r++)o==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([Cm,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([wv,e.trim()]),e="",r++):e+=o||"";return e&&a.push([Cm,(i>0?"{{":"")+e]),wm[t]=a},xv=11,ls=class{get value(){return""}set value(e){}toString(){return this.value}},Om=new WeakMap,hd=class{constructor(){mt(this,yi,[])}[Symbol.iterator](){return N(this,yi).values()}get length(){return N(this,yi).length}item(e){return N(this,yi)[e]}append(...e){for(let i of e)i instanceof be&&Om.set(i,this),N(this,yi).push(i)}toString(){return N(this,yi).join("")}};yi=new WeakMap;var be=class extends ls{constructor(e,i,a){super(),mt(this,ki),mt(this,qr,""),mt(this,zt,void 0),mt(this,Qt,void 0),mt(this,Xt,void 0),It(this,zt,e),It(this,Qt,i),It(this,Xt,a)}get attributeName(){return N(this,Qt)}get attributeNamespace(){return N(this,Xt)}get element(){return N(this,zt)}get value(){return N(this,qr)}set value(e){N(this,qr)!==e&&(It(this,qr,e),!N(this,ki,fa)||N(this,ki,fa).length===1?e==null?N(this,zt).removeAttributeNS(N(this,Xt),N(this,Qt)):N(this,zt).setAttributeNS(N(this,Xt),N(this,Qt),e):N(this,zt).setAttributeNS(N(this,Xt),N(this,Qt),N(this,ki,fa).toString()))}get booleanValue(){return N(this,zt).hasAttributeNS(N(this,Xt),N(this,Qt))}set booleanValue(e){if(!N(this,ki,fa)||N(this,ki,fa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};qr=new WeakMap;zt=new WeakMap;Qt=new WeakMap;Xt=new WeakMap;ki=new WeakSet;fa=function(){return Om.get(this)};var Lt=class extends ls{constructor(e,i){super(),mt(this,ss,void 0),mt(this,Ze,void 0),It(this,ss,e),It(this,Ze,i?[...i]:[new Text])}get replacementNodes(){return N(this,Ze)}get parentNode(){return N(this,ss)}get nextSibling(){return N(this,Ze)[N(this,Ze).length-1].nextSibling}get previousSibling(){return N(this,Ze)[0].previousSibling}get value(){return N(this,Ze).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let i=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===xv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),It(this,Ze,Dv(N(this,Ze)[0].parentNode,N(this,Ze),i,this.nextSibling))}};ss=new WeakMap;Ze=new WeakMap;var Zr=class extends Lt{constructor(e,i){let a=i.getAttribute("directive")||i.getAttribute("type"),r=i.getAttribute("expression")||i.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=i,this.directive=a}};function Dv(t,e,i,a=null){let r=0,o,s,d,u=i.length,f=e.length;for(;r<u&&r<f&&e[r]==i[r];)r++;for(;r<u&&r<f&&i[u-1]==e[f-1];)a=i[--f,--u];if(r==f)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<f;)t.removeChild(e[r++]);else{for(o=e[r];r<u;)d=i[r++],s=o?o.nextSibling:a,o==d?o=s:r<u&&i[r]==s?(t.replaceChild(d,o),o=s):t.insertBefore(d,o);for(;o!=a;)s=o.nextSibling,t.removeChild(o),o=s}return i}var Pm={string:t=>String(t)},us=class{constructor(e){this.template=e,this.state=void 0}},Si=new WeakMap,Ii=new WeakMap,pd={partial:(t,e)=>{e[t.expression]=new us(t.template)},if:(t,e)=>{var i;if(Um(t.expression,e))if(Si.get(t)!==t.template){Si.set(t,t.template);let a=new Mt(t.template,e,cs);t.replace(a),Ii.set(t,a)}else(i=Ii.get(t))==null||i.update(e);else t.replace(""),Si.delete(t),Ii.delete(t)}},Ov=Object.keys(pd),cs={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof Zr){if(!s.directive){let u=Ov.find(f=>s.template.hasAttribute(f));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=pd[s.directive])==null||a.call(pd,s,i);continue}let d=Um(o,i);if(d instanceof us){Si.get(s)!==d.template?(Si.set(s,d.template),d=new Mt(d.template,d.state,cs),s.value=d,Ii.set(s,d)):(r=Ii.get(s))==null||r.update(d.state);continue}d?(s instanceof be&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof be?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,Si.delete(s),Ii.delete(s))):s instanceof be?s.value=void 0:(s.value=void 0,Si.delete(s),Ii.delete(s))}}},Nm={"!":t=>!t,"!!":t=>!!t,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,"??":(t,e)=>t!=null?t:e,"|":(t,e)=>{var i;return(i=Pm[e])==null?void 0:i.call(Pm,t)}};function Pv(t){return Nv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Um(t,e={}){var i,a,r,o,s,d,u;let f=Pv(t);if(f.length===0||f.some(({type:y})=>!y))return zr(t);if(((i=f[0])==null?void 0:i.token)===">"){let y=e[(a=f[1])==null?void 0:a.token];if(!y)return zr(t);let A={...e};y.state=A;let E=f.slice(2);for(let p=0;p<E.length;p+=3){let k=(r=E[p])==null?void 0:r.token,g=(o=E[p+1])==null?void 0:o.token,S=(s=E[p+2])==null?void 0:s.token;k&&g==="="&&(A[k]=Qr(S,e))}return y}if(f.length===1)return ds(f[0])?Qr(f[0].token,e):zr(t);if(f.length===2){let y=(d=f[0])==null?void 0:d.token,A=Nm[y];if(!A||!ds(f[1]))return zr(t);let E=Qr(f[1].token,e);return A(E)}if(f.length===3){let y=(u=f[1])==null?void 0:u.token,A=Nm[y];if(!A||!ds(f[0])||!ds(f[2]))return zr(t);let E=Qr(f[0].token,e);if(y==="|")return A(E,f[2].token);let p=Qr(f[2].token,e);return A(E,p)}}function zr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function ds({type:t}){return["number","boolean","string","param"].includes(t)}function Qr(t,e){let i=t[0],a=t.slice(-1);return t==="true"||t==="false"?t==="true":i===a&&["'",'"'].includes(i)?t.slice(1,-1):Lo(t)?parseFloat(t):e[t]}function Nv(t,e){let i,a,r,o=[];for(;t;){r=null,i=t.length;for(let s in e)a=e[s].exec(t),a&&a.index<i&&(r={token:a[0],type:s,matches:a.slice(1)},i=a.index);i&&o.push({token:t.substr(0,i),type:void 0}),r&&o.push(r),t=t.substr(i+(r?r.token.length:0))}return o}var gd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Jt=(t,e,i)=>(gd(t,e,"read from private field"),i?i.call(t):e.get(t)),Mi=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ct=(t,e,i,a)=>(gd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),fd=(t,e,i)=>(gd(t,e,"access private method"),i),Ea,ms,ba,va,Ed,Hm,hs,bd,Xr,vd={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Bm=V.createElement("template");Bm.innerHTML=`
1413
1413
  <style>
1414
1414
  :host {
package/dist/base.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var lt=t=>{throw TypeError(t)};var Ae=(t,a,e)=>a.has(t)||lt("Cannot "+e);var l=(t,a,e)=>(Ae(t,a,"read from private field"),e?e.call(t):a.get(t)),h=(t,a,e)=>a.has(t)?lt("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),f=(t,a,e,i)=>(Ae(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),p=(t,a,e)=>(Ae(t,a,"access private method"),e);var Y=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Y{}globalThis.DocumentFragment=t}var Q=class extends Y{},Ce=class extends Y{},Gt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Q)}},J,ke=class{constructor(a,e={}){h(this,J);f(this,J,e==null?void 0:e.detail)}get detail(){return l(this,J)}initCustomEvent(){}};J=new WeakMap;function jt(t,a){return new Q}var ut={document:{createElement:jt},DocumentFragment,customElements:Gt,CustomEvent:ke,EventTarget:Y,HTMLElement:Q,HTMLVideoElement:Ce},mt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",_=mt?ut:globalThis,w=mt?ut.document:globalThis.document;import{MediaController as _a,MediaErrorDialog as Kt}from"media-chrome";import{Attributes as we}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as Pt,MediaUIAttributes as ve,MediaUIEvents as wt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as Ee,Attributes as s}from"@mux/mux-video/base";import{StreamTypes as L,PlaybackTypes as Te,addTextTrack as Ra,removeTextTrack as xa,CmcdTypeValues as Dt,i18n as B,parseJwt as De,MuxJWTAud as Ue,generatePlayerInitTime as Oa}from"@mux/playback-core";import{i18n as Jt}from"@mux/playback-core";import{StreamTypes as xe,parseJwt as pt}from"@mux/playback-core";function ct(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${me(e)}: ${i}; `)}),a?a.trim():void 0}function me(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ce(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function A(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function _e(t){let a=zt(t).toString();return a?"?"+a:""}function zt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Re=(t,a)=>!t||!a?!1:t.contains(a)?!0:Re(t,a.getRootNode().host);var bt="mux.com",Xt=()=>{try{return"3.11.7"}catch{}return"UNKNOWN"},qt=Xt(),be=()=>qt,ht=(t,{token:a,customDomain:e=bt,thumbnailTime:i,programTime:r}={})=>{var u;let n=a==null?i:void 0,{aud:d}=(u=pt(a))!=null?u:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${_e({token:a,time:n,program_time:r})}`},gt=(t,{token:a,customDomain:e=bt,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=pt(a))!=null?d:{};if(!(a&&n!=="s"))return`https://image.${e}/${t}/storyboard.vtt${_e({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},ee=t=>{if(t){if([xe.LIVE,xe.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return xe.LIVE}};var Qt={crossorigin:"crossOrigin",playsinline:"playsInline"};function ft(t){var a;return(a=Qt[t])!=null?a:ce(t)}var D,U,C,pe=class{constructor(a,e){h(this,D);h(this,U);h(this,C,[]);f(this,D,a),f(this,U,e)}[Symbol.iterator](){return l(this,C).values()}get length(){return l(this,C).length}get value(){var a;return(a=l(this,C).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(f(this,C,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return l(this,C)[a]}values(){return l(this,C).values()}keys(){return l(this,C).keys()}forEach(a){l(this,C).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||l(this,C).push(r)}),!(this.value===""&&!((e=l(this,D))!=null&&e.hasAttribute(`${l(this,U)}`)))&&((i=l(this,D))==null||i.setAttribute(`${l(this,U)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{l(this,C).splice(l(this,C).indexOf(i),1)}),(e=l(this,D))==null||e.setAttribute(`${l(this,U)}`,`${this.value}`)}contains(a){return l(this,C).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)}};D=new WeakMap,U=new WeakMap,C=new WeakMap;var yt=`[mux-player ${be()}]`;function O(...t){console.warn(yt,...t)}function k(...t){console.error(yt,...t)}function Oe(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Jt("Read more: ")}
1
+ var lt=t=>{throw TypeError(t)};var Ae=(t,a,e)=>a.has(t)||lt("Cannot "+e);var l=(t,a,e)=>(Ae(t,a,"read from private field"),e?e.call(t):a.get(t)),h=(t,a,e)=>a.has(t)?lt("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),f=(t,a,e,i)=>(Ae(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),p=(t,a,e)=>(Ae(t,a,"access private method"),e);var Y=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Y{}globalThis.DocumentFragment=t}var Q=class extends Y{},Ce=class extends Y{},Gt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Q)}},J,ke=class{constructor(a,e={}){h(this,J);f(this,J,e==null?void 0:e.detail)}get detail(){return l(this,J)}initCustomEvent(){}};J=new WeakMap;function jt(t,a){return new Q}var ut={document:{createElement:jt},DocumentFragment,customElements:Gt,CustomEvent:ke,EventTarget:Y,HTMLElement:Q,HTMLVideoElement:Ce},mt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",_=mt?ut:globalThis,w=mt?ut.document:globalThis.document;import{MediaController as _a,MediaErrorDialog as Kt}from"media-chrome";import{Attributes as we}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as Pt,MediaUIAttributes as ve,MediaUIEvents as wt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as Ee,Attributes as s}from"@mux/mux-video/base";import{StreamTypes as L,PlaybackTypes as Te,addTextTrack as Ra,removeTextTrack as xa,CmcdTypeValues as Dt,i18n as B,parseJwt as De,MuxJWTAud as Ue,generatePlayerInitTime as Oa}from"@mux/playback-core";import{i18n as Jt}from"@mux/playback-core";import{StreamTypes as xe,parseJwt as pt}from"@mux/playback-core";function ct(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${me(e)}: ${i}; `)}),a?a.trim():void 0}function me(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ce(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function A(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function _e(t){let a=zt(t).toString();return a?"?"+a:""}function zt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Re=(t,a)=>!t||!a?!1:t.contains(a)?!0:Re(t,a.getRootNode().host);var bt="mux.com",Xt=()=>{try{return"3.11.8"}catch{}return"UNKNOWN"},qt=Xt(),be=()=>qt,ht=(t,{token:a,customDomain:e=bt,thumbnailTime:i,programTime:r}={})=>{var u;let n=a==null?i:void 0,{aud:d}=(u=pt(a))!=null?u:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${_e({token:a,time:n,program_time:r})}`},gt=(t,{token:a,customDomain:e=bt,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=pt(a))!=null?d:{};if(!(a&&n!=="s"))return`https://image.${e}/${t}/storyboard.vtt${_e({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},ee=t=>{if(t){if([xe.LIVE,xe.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return xe.LIVE}};var Qt={crossorigin:"crossOrigin",playsinline:"playsInline"};function ft(t){var a;return(a=Qt[t])!=null?a:ce(t)}var D,U,C,pe=class{constructor(a,e){h(this,D);h(this,U);h(this,C,[]);f(this,D,a),f(this,U,e)}[Symbol.iterator](){return l(this,C).values()}get length(){return l(this,C).length}get value(){var a;return(a=l(this,C).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(f(this,C,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return l(this,C)[a]}values(){return l(this,C).values()}keys(){return l(this,C).keys()}forEach(a){l(this,C).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||l(this,C).push(r)}),!(this.value===""&&!((e=l(this,D))!=null&&e.hasAttribute(`${l(this,U)}`)))&&((i=l(this,D))==null||i.setAttribute(`${l(this,U)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{l(this,C).splice(l(this,C).indexOf(i),1)}),(e=l(this,D))==null||e.setAttribute(`${l(this,U)}`,`${this.value}`)}contains(a){return l(this,C).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)}};D=new WeakMap,U=new WeakMap,C=new WeakMap;var yt=`[mux-player ${be()}]`;function O(...t){console.warn(yt,...t)}function k(...t){console.error(yt,...t)}function Oe(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Jt("Read more: ")}
2
2
  https://github.com/muxinc/elements/blob/main/errors/${t.file}`),O(a)}var y={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},I={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Xa={...y,...I},Tt=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}}),ea=Object.values(y).filter(t=>y.PLAYSINLINE!==t),ta=Object.values(I),aa=[...ea,...ta],Le=class extends _.HTMLElement{static get observedAttributes(){return aa}constructor(){super()}attributeChangedCallback(a,e,i){var r,n;switch(a){case I.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case I.VOLUME:{let d=(r=A(i))!=null?r:1;this.media&&(this.media.volume=d);return}case I.PLAYBACKRATE:{let d=(n=A(i))!=null?n:1;this.media&&(this.media.playbackRate=d,this.media.defaultPlaybackRate=d);return}}}play(){var a,e;return(e=(a=this.media)==null?void 0:a.play())!=null?e:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}load(){var a;(a=this.media)==null||a.load()}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:Tt}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:Tt}get readyState(){var a,e;return(e=(a=this.media)==null?void 0:a.readyState)!=null?e:0}get videoWidth(){var a,e;return(e=(a=this.media)==null?void 0:a.videoWidth)!=null?e:0}get videoHeight(){var a,e;return(e=(a=this.media)==null?void 0:a.videoHeight)!=null?e:0}get currentSrc(){var a,e;return(e=(a=this.media)==null?void 0:a.currentSrc)!=null?e:""}get currentTime(){var a,e;return(e=(a=this.media)==null?void 0:a.currentTime)!=null?e:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,e;return(e=(a=this.media)==null?void 0:a.volume)!=null?e:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,e;return(e=(a=this.media)==null?void 0:a.playbackRate)!=null?e:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=A(this.getAttribute(I.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(I.PLAYBACKRATE,`${a}`):this.removeAttribute(I.PLAYBACKRATE)}get crossOrigin(){return te(this,y.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(y.CROSSORIGIN,`${a}`)}get autoplay(){return te(this,y.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(y.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(y.AUTOPLAY)}get loop(){return te(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 te(this,y.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(y.MUTED,""):this.removeAttribute(y.MUTED)}get playsInline(){return te(this,y.PLAYSINLINE)!=null}set playsInline(a){k("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 te(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Me=Le;import"media-chrome/dist/media-theme-element.js";var Et=`:host {
3
3
  --media-control-display: var(--controls);
4
4
  --media-loading-indicator-display: var(--loading-indicator);