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

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
@@ -1399,7 +1399,7 @@
1399
1399
  <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"/>
1400
1400
  </svg>
1401
1401
  </div>
1402
- `}function tv(){return h("Loop")}var Lr=class extends H{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=h("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 k(this,n.MEDIA_LOOP)}set mediaLoop(e){S(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(m.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Lr.getSlotTemplateHTML=ev;Lr.getTooltipContentHTML=tv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",Lr);var g=require("@mux/mux-video/base"),D=require("@mux/playback-core");var am=require("@mux/playback-core");var mi=require("@mux/playback-core");function Jc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Dn(i)}: ${a}; `)}),e?e.trim():void 0}function Dn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function On(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function Ul(t){let e=iv(t).toString();return e?"?"+e:""}function iv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var Hl=(t,e)=>!t||!e?!1:t.contains(e)?!0:Hl(t,e.getRootNode().host);var jc="mux.com",av=()=>{try{return"3.10.1"}catch{}return"UNKNOWN"},rv=av(),Pn=()=>rv,em=(t,{token:e,customDomain:i=jc,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,mi.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${Ul({token:e,time:o,program_time:r})}`},tm=(t,{token:e,customDomain:i=jc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,mi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${Ul({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},wr=t=>{if(t){if([mi.StreamTypes.LIVE,mi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return mi.StreamTypes.LIVE}};var ov={crossorigin:"crossOrigin",playsinline:"playsInline"};function im(t){var e;return(e=ov[t])!=null?e:On(t)}var ui,ci,me,Nn=class{constructor(e,i){pe(this,ui);pe(this,ci);pe(this,me,[]);ye(this,ui,e),ye(this,ci,i)}[Symbol.iterator](){return B(this,me).values()}get length(){return B(this,me).length}get value(){var e;return(e=B(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ye(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return B(this,me)[e]}values(){return B(this,me).values()}keys(){return B(this,me).keys()}forEach(e){B(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||B(this,me).push(r)}),!(this.value===""&&!((i=B(this,ui))!=null&&i.hasAttribute(`${B(this,ci)}`)))&&((a=B(this,ui))==null||a.setAttribute(`${B(this,ci)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{B(this,me).splice(B(this,me).indexOf(a),1)}),(i=B(this,ui))==null||i.setAttribute(`${B(this,ci)}`,`${this.value}`)}contains(e){return B(this,me).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)}};ui=new WeakMap,ci=new WeakMap,me=new WeakMap;var rm=`[mux-player ${Pn()}]`;function at(...t){console.warn(rm,...t)}function ge(...t){console.error(rm,...t)}function Bl(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,am.i18n)("Read more: ")}
1402
+ `}function tv(){return h("Loop")}var Lr=class extends H{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=h("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 k(this,n.MEDIA_LOOP)}set mediaLoop(e){S(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(m.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Lr.getSlotTemplateHTML=ev;Lr.getTooltipContentHTML=tv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",Lr);var g=require("@mux/mux-video/base"),D=require("@mux/playback-core");var am=require("@mux/playback-core");var mi=require("@mux/playback-core");function Jc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Dn(i)}: ${a}; `)}),e?e.trim():void 0}function Dn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function On(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function Ul(t){let e=iv(t).toString();return e?"?"+e:""}function iv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var Hl=(t,e)=>!t||!e?!1:t.contains(e)?!0:Hl(t,e.getRootNode().host);var jc="mux.com",av=()=>{try{return"3.10.2"}catch{}return"UNKNOWN"},rv=av(),Pn=()=>rv,em=(t,{token:e,customDomain:i=jc,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,mi.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${Ul({token:e,time:o,program_time:r})}`},tm=(t,{token:e,customDomain:i=jc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,mi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${Ul({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},wr=t=>{if(t){if([mi.StreamTypes.LIVE,mi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return mi.StreamTypes.LIVE}};var ov={crossorigin:"crossOrigin",playsinline:"playsInline"};function im(t){var e;return(e=ov[t])!=null?e:On(t)}var ui,ci,me,Nn=class{constructor(e,i){pe(this,ui);pe(this,ci);pe(this,me,[]);ye(this,ui,e),ye(this,ci,i)}[Symbol.iterator](){return B(this,me).values()}get length(){return B(this,me).length}get value(){var e;return(e=B(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ye(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return B(this,me)[e]}values(){return B(this,me).values()}keys(){return B(this,me).keys()}forEach(e){B(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||B(this,me).push(r)}),!(this.value===""&&!((i=B(this,ui))!=null&&i.hasAttribute(`${B(this,ci)}`)))&&((a=B(this,ui))==null||a.setAttribute(`${B(this,ci)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{B(this,me).splice(B(this,me).indexOf(a),1)}),(i=B(this,ui))==null||i.setAttribute(`${B(this,ci)}`,`${this.value}`)}contains(e){return B(this,me).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)}};ui=new WeakMap,ci=new WeakMap,me=new WeakMap;var rm=`[mux-player ${Pn()}]`;function at(...t){console.warn(rm,...t)}function ge(...t){console.error(rm,...t)}function Bl(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,am.i18n)("Read more: ")}
1403
1403
  https://github.com/muxinc/elements/blob/main/errors/${t.file}`),at(e)}var le={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Nt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},lA={...le,...Nt},nm=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}}),nv=Object.values(le).filter(t=>le.PLAYSINLINE!==t),sv=Object.values(Nt),lv=[...nv,...sv],$l=class extends ke.HTMLElement{static get observedAttributes(){return lv}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case Nt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Nt.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Nt.PLAYBACKRATE:{let s=(o=ce(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:nm}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:nm}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=ce(this.getAttribute(Nt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Nt.PLAYBACKRATE,`${e}`):this.removeAttribute(Nt.PLAYBACKRATE)}get crossOrigin(){return Rr(this,le.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(le.CROSSORIGIN,`${e}`)}get autoplay(){return Rr(this,le.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(le.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(le.AUTOPLAY)}get loop(){return Rr(this,le.LOOP)!=null}set loop(e){e?this.setAttribute(le.LOOP,""):this.removeAttribute(le.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 Rr(this,le.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(le.MUTED,""):this.removeAttribute(le.MUTED)}get playsInline(){return Rr(this,le.PLAYSINLINE)!=null}set playsInline(e){ge("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(le.PRELOAD,e):this.removeAttribute(le.PRELOAD)}};function Rr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var Wl=$l;var cm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},N=(t,e,i)=>(cm(t,e,"read from private field"),i?i.call(t):e.get(t)),rt=(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)},gt=(t,e,i,a)=>(cm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ra,Un,hi,xr,Pt,Ut,Ht,pi,oa,Hn,$e,sm=1,lm=0,dv=1,uv={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 he&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof he?r.element[r.attributeName]=o:r.value=o}}}},_t=class extends l.DocumentFragment{constructor(e,i,a=uv){var r;super(),rt(this,ra,void 0),rt(this,Un,void 0),this.append(e.content.cloneNode(!0)),gt(this,ra,mm(this)),gt(this,Un,a),(r=a.createCallback)==null||r.call(a,this,N(this,ra),i),a.processCallback(this,N(this,ra),i)}update(e){N(this,Un).processCallback(this,N(this,ra),e)}};ra=new WeakMap;Un=new WeakMap;var mm=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new Fl;for([i,a]of um(r.value))if(!i)o.append(a);else{let s=new he(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===sm&&!(r instanceof HTMLTemplateElement))mm(r,e);else{let o=r.data;if(r.nodeType===sm||o.includes("{{")){let s=[];if(o)for([i,a]of um(o))if(!i)s.push(new Text(a));else{let d=new At(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new Dr(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},dm={},um=t=>{let e="",i=0,a=dm[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([lm,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([dv,e.trim()]),e="",r++):e+=o||"";return e&&a.push([lm,(i>0?"{{":"")+e]),dm[t]=a},cv=11,Bn=class{get value(){return""}set value(e){}toString(){return this.value}},hm=new WeakMap,Fl=class{constructor(){rt(this,hi,[])}[Symbol.iterator](){return N(this,hi).values()}get length(){return N(this,hi).length}item(e){return N(this,hi)[e]}append(...e){for(let i of e)i instanceof he&&hm.set(i,this),N(this,hi).push(i)}toString(){return N(this,hi).join("")}};hi=new WeakMap;var he=class extends Bn{constructor(e,i,a){super(),rt(this,pi),rt(this,xr,""),rt(this,Pt,void 0),rt(this,Ut,void 0),rt(this,Ht,void 0),gt(this,Pt,e),gt(this,Ut,i),gt(this,Ht,a)}get attributeName(){return N(this,Ut)}get attributeNamespace(){return N(this,Ht)}get element(){return N(this,Pt)}get value(){return N(this,xr)}set value(e){N(this,xr)!==e&&(gt(this,xr,e),!N(this,pi,oa)||N(this,pi,oa).length===1?e==null?N(this,Pt).removeAttributeNS(N(this,Ht),N(this,Ut)):N(this,Pt).setAttributeNS(N(this,Ht),N(this,Ut),e):N(this,Pt).setAttributeNS(N(this,Ht),N(this,Ut),N(this,pi,oa).toString()))}get booleanValue(){return N(this,Pt).hasAttributeNS(N(this,Ht),N(this,Ut))}set booleanValue(e){if(!N(this,pi,oa)||N(this,pi,oa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};xr=new WeakMap;Pt=new WeakMap;Ut=new WeakMap;Ht=new WeakMap;pi=new WeakSet;oa=function(){return hm.get(this)};var At=class extends Bn{constructor(e,i){super(),rt(this,Hn,void 0),rt(this,$e,void 0),gt(this,Hn,e),gt(this,$e,i?[...i]:[new Text])}get replacementNodes(){return N(this,$e)}get parentNode(){return N(this,Hn)}get nextSibling(){return N(this,$e)[N(this,$e).length-1].nextSibling}get previousSibling(){return N(this,$e)[0].previousSibling}get value(){return N(this,$e).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===cv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),gt(this,$e,mv(N(this,$e)[0].parentNode,N(this,$e),i,this.nextSibling))}};Hn=new WeakMap;$e=new WeakMap;var Dr=class extends At{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 mv(t,e,i,a=null){let r=0,o,s,d,u=i.length,p=e.length;for(;r<u&&r<p&&e[r]==i[r];)r++;for(;r<u&&r<p&&i[u-1]==e[p-1];)a=i[--p,--u];if(r==p)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<p;)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)},Wn=class{constructor(e){this.template=e,this.state=void 0}},fi=new WeakMap,vi=new WeakMap,Vl={partial:(t,e)=>{e[t.expression]=new Wn(t.template)},if:(t,e)=>{var i;if(vm(t.expression,e))if(fi.get(t)!==t.template){fi.set(t,t.template);let a=new _t(t.template,e,Fn);t.replace(a),vi.set(t,a)}else(i=vi.get(t))==null||i.update(e);else t.replace(""),fi.delete(t),vi.delete(t)}},hv=Object.keys(Vl),Fn={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof Dr){if(!s.directive){let u=hv.find(p=>s.template.hasAttribute(p));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=Vl[s.directive])==null||a.call(Vl,s,i);continue}let d=vm(o,i);if(d instanceof Wn){fi.get(s)!==d.template?(fi.set(s,d.template),d=new _t(d.template,d.state,Fn),s.value=d,vi.set(s,d)):(r=vi.get(s))==null||r.update(d.state);continue}d?(s instanceof he&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof he?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,fi.delete(s),vi.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,fi.delete(s),vi.delete(s))}}},fm={"!":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 fv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function vm(t,e={}){var i,a,r,o,s,d,u;let p=pv(t);if(p.length===0||p.some(({type:T})=>!T))return Or(t);if(((i=p[0])==null?void 0:i.token)===">"){let T=e[(a=p[1])==null?void 0:a.token];if(!T)return Or(t);let _={...e};T.state=_;let E=p.slice(2);for(let f=0;f<E.length;f+=3){let M=(r=E[f])==null?void 0:r.token,b=(o=E[f+1])==null?void 0:o.token,C=(s=E[f+2])==null?void 0:s.token;M&&b==="="&&(_[M]=Nr(C,e))}return T}if(p.length===1)return $n(p[0])?Nr(p[0].token,e):Or(t);if(p.length===2){let T=(d=p[0])==null?void 0:d.token,_=fm[T];if(!_||!$n(p[1]))return Or(t);let E=Nr(p[1].token,e);return _(E)}if(p.length===3){let T=(u=p[1])==null?void 0:u.token,_=fm[T];if(!_||!$n(p[0])||!$n(p[2]))return Or(t);let E=Nr(p[0].token,e);if(T==="|")return _(E,p[2].token);let f=Nr(p[2].token,e);return _(E,f)}}function Or(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function $n({type:t}){return["number","boolean","string","param"].includes(t)}function Nr(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):co(t)?parseFloat(t):e[t]}function fv(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 Ql=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Yl=(t,e,i)=>(Ql(t,e,"read from private field"),i?i.call(t):e.get(t)),Pr=(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)},Ei=(t,e,i,a)=>(Ql(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Kl=(t,e,i)=>(Ql(t,e,"access private method"),i),na,Vn,sa,ql,Em,Kn,Zl,Gl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},bm=V.createElement("template");bm.innerHTML=`
1404
1404
  <style>
1405
1405
  :host {
@@ -3230,7 +3230,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3230
3230
  min-height: var(--media-control-height, 24px);
3231
3231
  }
3232
3232
  </style>
3233
- `}var Sa=class extends Ce{};Sa.shadowRootOptions={mode:"open"};Sa.getTemplateHTML=hE;l.customElements.get("media-context-menu-item")||l.customElements.define("media-context-menu-item",Sa);var $d=Gt.createElement("template");"innerHTML"in $d&&($d.innerHTML=Im);var ih,ah,Ms=class extends bi{};Ms.template=(ah=(ih=$d.content)==null?void 0:ih.children)==null?void 0:ah[0];ke.customElements.get("media-theme-gerwig")||ke.customElements.define("media-theme-gerwig",Ms);var pE="gerwig",yt={SRC:"src",POSTER:"poster"},c={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-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",FULLSCREEN_ELEMENT:"fullscreen-element",DRM_TOKEN:"drm-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",VIDEO_TITLE:"video-title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref",NO_MUTED_PREF:"no-muted-pref",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge",DISABLE_PSEUDO_ENDED:"disable-pseudo-ended"},Wd=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","videotitle","novolumepref","nomutedpref","proudlydisplaymuxbadge"];function fE(t,e){var a,r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:t.storyboard,storyboardSrc:t.getAttribute(c.STORYBOARD_SRC),fullscreenElement:t.getAttribute(c.FULLSCREEN_ELEMENT),placeholder:t.getAttribute("placeholder"),themeTemplate:EE(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(c.NOHOTKEYS),hotKeys:t.getAttribute(c.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,maxAutoResolution:t.maxAutoResolution,programStartTime:t.programStartTime,programEndTime:t.programEndTime,assetStartTime:t.assetStartTime,assetEndTime:t.assetEndTime,renditionOrder:t.renditionOrder,metadata:t.metadata,playerInitTime:t.playerInitTime,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:wr(t.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:t.getAttribute(c.PRIMARY_COLOR),secondaryColor:t.getAttribute(c.SECONDARY_COLOR),accentColor:t.getAttribute(c.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:bE(t),playbackRates:t.getAttribute(c.PLAYBACK_RATES),customDomain:(a=t.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:t.getAttribute(c.TITLE),videoTitle:(r=t.getAttribute(c.VIDEO_TITLE))!=null?r:t.getAttribute(c.TITLE),novolumepref:t.hasAttribute(c.NO_VOLUME_PREF),nomutedpref:t.hasAttribute(c.NO_MUTED_PREF),proudlyDisplayMuxBadge:t.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE),castReceiver:t.castReceiver,disablePseudoEnded:t.hasAttribute(c.DISABLE_PSEUDO_ENDED),...e,extraSourceParams:t.extraSourceParams}}var vE=sn.formatErrorMessage;sn.formatErrorMessage=t=>{var e,i;if(t instanceof g.MediaError){let a=Sm(t,!1);return`
3233
+ `}var Sa=class extends Ce{};Sa.shadowRootOptions={mode:"open"};Sa.getTemplateHTML=hE;l.customElements.get("media-context-menu-item")||l.customElements.define("media-context-menu-item",Sa);var $d=Gt.createElement("template");"innerHTML"in $d&&($d.innerHTML=Im);var ih,ah,Ms=class extends bi{};Ms.template=(ah=(ih=$d.content)==null?void 0:ih.children)==null?void 0:ah[0];ke.customElements.get("media-theme-gerwig")||ke.customElements.define("media-theme-gerwig",Ms);var pE="gerwig",yt={SRC:"src",POSTER:"poster"},c={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-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",FULLSCREEN_ELEMENT:"fullscreen-element",DRM_TOKEN:"drm-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",VIDEO_TITLE:"video-title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref",NO_MUTED_PREF:"no-muted-pref",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge",DISABLE_PSEUDO_ENDED:"disable-pseudo-ended"},Wd=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","videotitle","novolumepref","nomutedpref","proudlydisplaymuxbadge"];function fE(t,e){var a,r,o;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:((a=t.media)==null?void 0:a.currentSrc)&&t.storyboard,storyboardSrc:t.getAttribute(c.STORYBOARD_SRC),fullscreenElement:t.getAttribute(c.FULLSCREEN_ELEMENT),placeholder:t.getAttribute("placeholder"),themeTemplate:EE(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(c.NOHOTKEYS),hotKeys:t.getAttribute(c.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,maxAutoResolution:t.maxAutoResolution,programStartTime:t.programStartTime,programEndTime:t.programEndTime,assetStartTime:t.assetStartTime,assetEndTime:t.assetEndTime,renditionOrder:t.renditionOrder,metadata:t.metadata,playerInitTime:t.playerInitTime,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:wr(t.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:t.getAttribute(c.PRIMARY_COLOR),secondaryColor:t.getAttribute(c.SECONDARY_COLOR),accentColor:t.getAttribute(c.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:bE(t),playbackRates:t.getAttribute(c.PLAYBACK_RATES),customDomain:(r=t.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?r:void 0,title:t.getAttribute(c.TITLE),videoTitle:(o=t.getAttribute(c.VIDEO_TITLE))!=null?o:t.getAttribute(c.TITLE),novolumepref:t.hasAttribute(c.NO_VOLUME_PREF),nomutedpref:t.hasAttribute(c.NO_MUTED_PREF),proudlyDisplayMuxBadge:t.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE),castReceiver:t.castReceiver,disablePseudoEnded:t.hasAttribute(c.DISABLE_PSEUDO_ENDED),...e,extraSourceParams:t.extraSourceParams}}var vE=sn.formatErrorMessage;sn.formatErrorMessage=t=>{var e,i;if(t instanceof g.MediaError){let a=Sm(t,!1);return`
3234
3234
  ${a!=null&&a.title?`<h3>${a.title}</h3>`:""}
3235
3235
  ${a!=null&&a.message||a!=null&&a.linkUrl?`<p>
3236
3236
  ${a==null?void 0:a.message}
package/dist/base.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var et=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||et("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),v=(t,a,e)=>a.has(t)?et("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),C=(t,a,e,i)=>(he(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),p=(t,a,e)=>(he(t,a,"access private method"),e);var F=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends F{}globalThis.DocumentFragment=t}var G=class extends F{},ge=class extends F{},Vt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,fe=class{constructor(a,e={}){v(this,j);C(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function Bt(t,a){return new G}var tt={document:{createElement:Bt},DocumentFragment,customElements:Vt,CustomEvent:fe,EventTarget:F,HTMLElement:G,HTMLVideoElement:ge},at=typeof window=="undefined"||typeof globalThis.customElements=="undefined",k=at?tt:globalThis,P=at?tt.document:globalThis.document;import{MediaController as ga,MediaErrorDialog as Nt}from"media-chrome";import{Attributes as Oe}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as _t,MediaUIAttributes as ce,MediaUIEvents as Rt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as be,Attributes as s}from"@mux/mux-video/base";import{StreamTypes as O,PlaybackTypes as pe,addTextTrack as fa,removeTextTrack as ya,CmcdTypeValues as xt,i18n as B,parseJwt as Me,MuxJWTAud as Le,generatePlayerInitTime as Ta}from"@mux/playback-core";import{i18n as Yt}from"@mux/playback-core";import{StreamTypes as ve,parseJwt as rt}from"@mux/playback-core";function it(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${re(e)}: ${i}; `)}),a?a.trim():void 0}function re(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function oe(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function y(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function ye(t){let a=Ht(t).toString();return a?"?"+a:""}function Ht(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Te=(t,a)=>!t||!a?!1:t.contains(a)?!0:Te(t,a.getRootNode().host);var ot="mux.com",Kt=()=>{try{return"3.10.1"}catch{}return"UNKNOWN"},$t=Kt(),se=()=>$t,nt=(t,{token:a,customDomain:e=ot,thumbnailTime:i,programTime:r}={})=>{var l;let n=a==null?i:void 0,{aud:d}=(l=rt(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${ye({token:a,time:n,program_time:r})}`},st=(t,{token:a,customDomain:e=ot,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=rt(a))!=null?d:{};if(!(a&&n!=="s"))return`https://image.${e}/${t}/storyboard.vtt${ye({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},X=t=>{if(t){if([ve.LIVE,ve.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return ve.LIVE}};var Ft={crossorigin:"crossOrigin",playsinline:"playsInline"};function dt(t){var a;return(a=Ft[t])!=null?a:oe(t)}var D,U,T,ne=class{constructor(a,e){v(this,D);v(this,U);v(this,T,[]);C(this,D,a),C(this,U,e)}[Symbol.iterator](){return u(this,T).values()}get length(){return u(this,T).length}get value(){var a;return(a=u(this,T).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(C(this,T,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,T)[a]}values(){return u(this,T).values()}keys(){return u(this,T).keys()}forEach(a){u(this,T).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,T).push(r)}),!(this.value===""&&!((e=u(this,D))!=null&&e.hasAttribute(`${u(this,U)}`)))&&((i=u(this,D))==null||i.setAttribute(`${u(this,U)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,T).splice(u(this,T).indexOf(i),1)}),(e=u(this,D))==null||e.setAttribute(`${u(this,U)}`,`${this.value}`)}contains(a){return u(this,T).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,T=new WeakMap;var lt=`[mux-player ${se()}]`;function x(...t){console.warn(lt,...t)}function E(...t){console.error(lt,...t)}function Ee(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Yt("Read more: ")}
1
+ var et=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||et("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),v=(t,a,e)=>a.has(t)?et("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),C=(t,a,e,i)=>(he(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),p=(t,a,e)=>(he(t,a,"access private method"),e);var F=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends F{}globalThis.DocumentFragment=t}var G=class extends F{},ge=class extends F{},Vt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,fe=class{constructor(a,e={}){v(this,j);C(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function Bt(t,a){return new G}var tt={document:{createElement:Bt},DocumentFragment,customElements:Vt,CustomEvent:fe,EventTarget:F,HTMLElement:G,HTMLVideoElement:ge},at=typeof window=="undefined"||typeof globalThis.customElements=="undefined",k=at?tt:globalThis,P=at?tt.document:globalThis.document;import{MediaController as ga,MediaErrorDialog as Nt}from"media-chrome";import{Attributes as Oe}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as _t,MediaUIAttributes as ce,MediaUIEvents as Rt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as be,Attributes as s}from"@mux/mux-video/base";import{StreamTypes as O,PlaybackTypes as pe,addTextTrack as fa,removeTextTrack as ya,CmcdTypeValues as xt,i18n as B,parseJwt as Me,MuxJWTAud as Le,generatePlayerInitTime as Ta}from"@mux/playback-core";import{i18n as Yt}from"@mux/playback-core";import{StreamTypes as ve,parseJwt as rt}from"@mux/playback-core";function it(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${re(e)}: ${i}; `)}),a?a.trim():void 0}function re(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function oe(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function y(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function ye(t){let a=Ht(t).toString();return a?"?"+a:""}function Ht(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Te=(t,a)=>!t||!a?!1:t.contains(a)?!0:Te(t,a.getRootNode().host);var ot="mux.com",Kt=()=>{try{return"3.10.2"}catch{}return"UNKNOWN"},$t=Kt(),se=()=>$t,nt=(t,{token:a,customDomain:e=ot,thumbnailTime:i,programTime:r}={})=>{var l;let n=a==null?i:void 0,{aud:d}=(l=rt(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${ye({token:a,time:n,program_time:r})}`},st=(t,{token:a,customDomain:e=ot,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=rt(a))!=null?d:{};if(!(a&&n!=="s"))return`https://image.${e}/${t}/storyboard.vtt${ye({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},X=t=>{if(t){if([ve.LIVE,ve.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return ve.LIVE}};var Ft={crossorigin:"crossOrigin",playsinline:"playsInline"};function dt(t){var a;return(a=Ft[t])!=null?a:oe(t)}var D,U,T,ne=class{constructor(a,e){v(this,D);v(this,U);v(this,T,[]);C(this,D,a),C(this,U,e)}[Symbol.iterator](){return u(this,T).values()}get length(){return u(this,T).length}get value(){var a;return(a=u(this,T).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(C(this,T,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,T)[a]}values(){return u(this,T).values()}keys(){return u(this,T).keys()}forEach(a){u(this,T).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,T).push(r)}),!(this.value===""&&!((e=u(this,D))!=null&&e.hasAttribute(`${u(this,U)}`)))&&((i=u(this,D))==null||i.setAttribute(`${u(this,U)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,T).splice(u(this,T).indexOf(i),1)}),(e=u(this,D))==null||e.setAttribute(`${u(this,U)}`,`${this.value}`)}contains(a){return u(this,T).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,T=new WeakMap;var lt=`[mux-player ${se()}]`;function x(...t){console.warn(lt,...t)}function E(...t){console.error(lt,...t)}function Ee(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Yt("Read more: ")}
2
2
  https://github.com/muxinc/elements/blob/main/errors/${t.file}`),x(a)}var g={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},N={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Ka={...g,...N},mt=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}}),Wt=Object.values(g).filter(t=>g.PLAYSINLINE!==t),Zt=Object.values(N),Gt=[...Wt,...Zt],Ae=class extends k.HTMLElement{static get observedAttributes(){return Gt}constructor(){super()}attributeChangedCallback(a,e,i){var r,n;switch(a){case N.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case N.VOLUME:{let d=(r=y(i))!=null?r:1;this.media&&(this.media.volume=d);return}case N.PLAYBACKRATE:{let d=(n=y(i))!=null?n:1;this.media&&(this.media.playbackRate=d,this.media.defaultPlaybackRate=d);return}}}play(){var a,e;return(e=(a=this.media)==null?void 0:a.play())!=null?e:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}load(){var a;(a=this.media)==null||a.load()}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:mt}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:mt}get readyState(){var a,e;return(e=(a=this.media)==null?void 0:a.readyState)!=null?e:0}get videoWidth(){var a,e;return(e=(a=this.media)==null?void 0:a.videoWidth)!=null?e:0}get videoHeight(){var a,e;return(e=(a=this.media)==null?void 0:a.videoHeight)!=null?e:0}get currentSrc(){var a,e;return(e=(a=this.media)==null?void 0:a.currentSrc)!=null?e:""}get currentTime(){var a,e;return(e=(a=this.media)==null?void 0:a.currentTime)!=null?e:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,e;return(e=(a=this.media)==null?void 0:a.volume)!=null?e:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,e;return(e=(a=this.media)==null?void 0:a.playbackRate)!=null?e:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=y(this.getAttribute(N.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(N.PLAYBACKRATE,`${a}`):this.removeAttribute(N.PLAYBACKRATE)}get crossOrigin(){return z(this,g.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(g.CROSSORIGIN,`${a}`)}get autoplay(){return z(this,g.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(g.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(g.AUTOPLAY)}get loop(){return z(this,g.LOOP)!=null}set loop(a){a?this.setAttribute(g.LOOP,""):this.removeAttribute(g.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 z(this,g.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(g.MUTED,""):this.removeAttribute(g.MUTED)}get playsInline(){return z(this,g.PLAYSINLINE)!=null}set playsInline(a){E("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(g.PRELOAD,a):this.removeAttribute(g.PRELOAD)}};function z(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Ce=Ae;import"media-chrome/dist/media-theme-element.js";var ct=`:host {
3
3
  --media-control-display: var(--controls);
4
4
  --media-loading-indicator-display: var(--loading-indicator);
@@ -1356,7 +1356,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1356
1356
  <slot></slot>
1357
1357
  </media-controller>
1358
1358
  </template>
1359
- `;import{MediaThemeElement as ha}from"media-chrome/dist/media-theme-element.js";import"media-chrome/dist/menu";var xe=P.createElement("template");"innerHTML"in xe&&(xe.innerHTML=At);var Ct,kt,me=class extends ha{};me.template=(kt=(Ct=xe.content)==null?void 0:Ct.children)==null?void 0:kt[0];k.customElements.get("media-theme-gerwig")||k.customElements.define("media-theme-gerwig",me);var va="gerwig",L={SRC:"src",POSTER:"poster"},o={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-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",FULLSCREEN_ELEMENT:"fullscreen-element",DRM_TOKEN:"drm-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",VIDEO_TITLE:"video-title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref",NO_MUTED_PREF:"no-muted-pref",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge",DISABLE_PSEUDO_ENDED:"disable-pseudo-ended"},Se=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","videotitle","novolumepref","nomutedpref","proudlydisplaymuxbadge"];function Ea(t,a){var i,r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:t.storyboard,storyboardSrc:t.getAttribute(o.STORYBOARD_SRC),fullscreenElement:t.getAttribute(o.FULLSCREEN_ELEMENT),placeholder:t.getAttribute("placeholder"),themeTemplate:Ca(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(o.NOHOTKEYS),hotKeys:t.getAttribute(o.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,maxAutoResolution:t.maxAutoResolution,programStartTime:t.programStartTime,programEndTime:t.programEndTime,assetStartTime:t.assetStartTime,assetEndTime:t.assetEndTime,renditionOrder:t.renditionOrder,metadata:t.metadata,playerInitTime:t.playerInitTime,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(s.TARGET_LIVE_WINDOW),streamType:X(t.getAttribute(s.STREAM_TYPE)),primaryColor:t.getAttribute(o.PRIMARY_COLOR),secondaryColor:t.getAttribute(o.SECONDARY_COLOR),accentColor:t.getAttribute(o.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:ka(t),playbackRates:t.getAttribute(o.PLAYBACK_RATES),customDomain:(i=t.getAttribute(s.CUSTOM_DOMAIN))!=null?i:void 0,title:t.getAttribute(o.TITLE),videoTitle:(r=t.getAttribute(o.VIDEO_TITLE))!=null?r:t.getAttribute(o.TITLE),novolumepref:t.hasAttribute(o.NO_VOLUME_PREF),nomutedpref:t.hasAttribute(o.NO_MUTED_PREF),proudlyDisplayMuxBadge:t.hasAttribute(o.PROUDLY_DISPLAY_MUX_BADGE),castReceiver:t.castReceiver,disablePseudoEnded:t.hasAttribute(o.DISABLE_PSEUDO_ENDED),...a,extraSourceParams:t.extraSourceParams}}var Aa=Nt.formatErrorMessage;Nt.formatErrorMessage=t=>{var a,e;if(t instanceof be){let i=Et(t,!1);return`
1359
+ `;import{MediaThemeElement as ha}from"media-chrome/dist/media-theme-element.js";import"media-chrome/dist/menu";var xe=P.createElement("template");"innerHTML"in xe&&(xe.innerHTML=At);var Ct,kt,me=class extends ha{};me.template=(kt=(Ct=xe.content)==null?void 0:Ct.children)==null?void 0:kt[0];k.customElements.get("media-theme-gerwig")||k.customElements.define("media-theme-gerwig",me);var va="gerwig",L={SRC:"src",POSTER:"poster"},o={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-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",FULLSCREEN_ELEMENT:"fullscreen-element",DRM_TOKEN:"drm-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",VIDEO_TITLE:"video-title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref",NO_MUTED_PREF:"no-muted-pref",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge",DISABLE_PSEUDO_ENDED:"disable-pseudo-ended"},Se=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","videotitle","novolumepref","nomutedpref","proudlydisplaymuxbadge"];function Ea(t,a){var i,r,n;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:((i=t.media)==null?void 0:i.currentSrc)&&t.storyboard,storyboardSrc:t.getAttribute(o.STORYBOARD_SRC),fullscreenElement:t.getAttribute(o.FULLSCREEN_ELEMENT),placeholder:t.getAttribute("placeholder"),themeTemplate:Ca(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(o.NOHOTKEYS),hotKeys:t.getAttribute(o.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,maxAutoResolution:t.maxAutoResolution,programStartTime:t.programStartTime,programEndTime:t.programEndTime,assetStartTime:t.assetStartTime,assetEndTime:t.assetEndTime,renditionOrder:t.renditionOrder,metadata:t.metadata,playerInitTime:t.playerInitTime,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(s.TARGET_LIVE_WINDOW),streamType:X(t.getAttribute(s.STREAM_TYPE)),primaryColor:t.getAttribute(o.PRIMARY_COLOR),secondaryColor:t.getAttribute(o.SECONDARY_COLOR),accentColor:t.getAttribute(o.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:ka(t),playbackRates:t.getAttribute(o.PLAYBACK_RATES),customDomain:(r=t.getAttribute(s.CUSTOM_DOMAIN))!=null?r:void 0,title:t.getAttribute(o.TITLE),videoTitle:(n=t.getAttribute(o.VIDEO_TITLE))!=null?n:t.getAttribute(o.TITLE),novolumepref:t.hasAttribute(o.NO_VOLUME_PREF),nomutedpref:t.hasAttribute(o.NO_MUTED_PREF),proudlyDisplayMuxBadge:t.hasAttribute(o.PROUDLY_DISPLAY_MUX_BADGE),castReceiver:t.castReceiver,disablePseudoEnded:t.hasAttribute(o.DISABLE_PSEUDO_ENDED),...a,extraSourceParams:t.extraSourceParams}}var Aa=Nt.formatErrorMessage;Nt.formatErrorMessage=t=>{var a,e;if(t instanceof be){let i=Et(t,!1);return`
1360
1360
  ${i!=null&&i.title?`<h3>${i.title}</h3>`:""}
1361
1361
  ${i!=null&&i.message||i!=null&&i.linkUrl?`<p>
1362
1362
  ${i==null?void 0:i.message}