@mux/mux-player 3.13.1-canary.3 → 3.13.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 +143 -144
- package/dist/base.mjs +57 -58
- package/dist/mux-player.js +188 -189
- package/dist/mux-player.mjs +188 -189
- package/dist/themes/gerwig/index.cjs.js +1 -1
- package/dist/themes/gerwig/index.js +1 -1
- package/dist/themes/gerwig/index.mjs +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/base.d.ts +4 -0
- package/dist/types/types.d.ts +0 -2
- package/dist/types-ts3.4/base.d.ts +3 -0
- package/dist/types-ts3.4/types.d.ts +0 -2
- package/package.json +3 -3
package/dist/base.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),O(
|
|
1
|
+
var bt=t=>{throw TypeError(t)};var Re=(t,i,e)=>i.has(t)||bt("Cannot "+e);var l=(t,i,e)=>(Re(t,i,"read from private field"),e?e.call(t):i.get(t)),b=(t,i,e)=>i.has(t)?bt("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,e),E=(t,i,e,a)=>(Re(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),h=(t,i,e)=>(Re(t,i,"access private method"),e);var Z=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Z{}globalThis.DocumentFragment=t}var Q=class extends Z{},xe=class extends Z{},qt={get(t){},define(t,i,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Q)}},J,Oe=class{constructor(i,e={}){b(this,J);E(this,J,e==null?void 0:e.detail)}get detail(){return l(this,J)}initCustomEvent(){}};J=new WeakMap;function Qt(t,i){return new Q}var ht={document:{createElement:Qt},DocumentFragment,customElements:qt,CustomEvent:Oe,EventTarget:Z,HTMLElement:Q,HTMLVideoElement:xe},gt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",_=gt?ht:globalThis,B=gt?ht.document:globalThis.document;import{MediaController as Li,MediaErrorDialog as Wt}from"media-chrome";import{Attributes as Ke}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as Kt,MediaUIAttributes as Ce,MediaUIEvents as Vt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as _e,Attributes as s}from"@mux/mux-video/base";import{StreamTypes as L,PlaybackTypes as ke,addTextTrack as Mi,removeTextTrack as Si,CmcdTypeValues as Ht,i18n as H,parseJwt as Ve,MuxJWTAud as He,generatePlayerInitTime as Ni}from"@mux/playback-core";import{i18n as ai}from"@mux/playback-core";import{StreamTypes as Se,parseJwt as yt}from"@mux/playback-core";function ft(t){let i="";return Object.entries(t).forEach(([e,a])=>{a!=null&&(i+=`${he(e)}: ${a}; `)}),i?i.trim():void 0}function he(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ge(t){return t.replace(/[-_]([a-z])/g,(i,e)=>e.toUpperCase())}function f(t){if(t==null)return;let i=+t;return Number.isNaN(i)?void 0:i}function Le(t){let i=Jt(t).toString();return i?"?"+i:""}function Jt(t){let i={};for(let e in t)t[e]!=null&&(i[e]=t[e]);return new URLSearchParams(i)}var Me=(t,i)=>!t||!i?!1:t.contains(i)?!0:Me(t,i.getRootNode().host);var Et="mux.com",ei=()=>{try{return"3.13.2"}catch{}return"UNKNOWN"},ti=ei(),ye=()=>ti,Tt=(t,{token:i,customDomain:e=Et,thumbnailTime:a,programTime:r}={})=>{var u;let o=i==null?a:void 0,{aud:d}=(u=yt(i))!=null?u:{};if(!(i&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${Le({token:i,time:o,program_time:r})}`},vt=(t,{token:i,customDomain:e=Et,programStartTime:a,programEndTime:r}={})=>{var d;let{aud:o}=(d=yt(i))!=null?d:{};if(!(i&&o!=="s"))return`https://image.${e}/${t}/storyboard.vtt${Le({token:i,format:"webp",program_start_time:a,program_end_time:r})}`},ee=t=>{if(t){if([Se.LIVE,Se.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Se.LIVE}};var ii={crossorigin:"crossOrigin",playsinline:"playsInline"};function At(t){var i;return(i=ii[t])!=null?i:ge(t)}var K,V,k,fe=class{constructor(i,e){b(this,K);b(this,V);b(this,k,[]);E(this,K,i),E(this,V,e)}[Symbol.iterator](){return l(this,k).values()}get length(){return l(this,k).length}get value(){var i;return(i=l(this,k).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(E(this,k,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return l(this,k)[i]}values(){return l(this,k).values()}keys(){return l(this,k).keys()}forEach(i){l(this,k).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||l(this,k).push(r)}),!(this.value===""&&!((e=l(this,K))!=null&&e.hasAttribute(`${l(this,V)}`)))&&((a=l(this,K))==null||a.setAttribute(`${l(this,V)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{l(this,k).splice(l(this,k).indexOf(a),1)}),(e=l(this,K))==null||e.setAttribute(`${l(this,V)}`,`${this.value}`)}contains(i){return l(this,k).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};K=new WeakMap,V=new WeakMap,k=new WeakMap;var Ct=`[mux-player ${ye()}]`;function O(...t){console.warn(Ct,...t)}function A(...t){console.error(Ct,...t)}function Ne(t){var e;let i=(e=t.message)!=null?e:"";t.context&&(i+=` ${t.context}`),t.file&&(i+=` ${ai("Read more: ")}
|
|
2
|
+
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),O(i)}var T={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},D={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},ea={...T,...D},_t=Object.freeze({length:0,start(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),ri=Object.values(T).filter(t=>T.PLAYSINLINE!==t),ni=Object.values(D),oi=[...ri,...ni],Ie=class extends _.HTMLElement{static get observedAttributes(){return oi}constructor(){super()}attributeChangedCallback(i,e,a){var r,o;switch(i){case D.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case D.VOLUME:{let d=(r=f(a))!=null?r:1;this.media&&(this.media.volume=d);return}case D.PLAYBACKRATE:{let d=(o=f(a))!=null?o:1;this.media&&(this.media.playbackRate=d,this.media.defaultPlaybackRate=d);return}}}play(){var i,e;return(e=(i=this.media)==null?void 0:i.play())!=null?e:Promise.reject()}pause(){var i;(i=this.media)==null||i.pause()}load(){var i;(i=this.media)==null||i.load()}get media(){var i;return(i=this.shadowRoot)==null?void 0:i.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 i,e;return(e=(i=this.media)==null?void 0:i.paused)!=null?e:!0}get duration(){var i,e;return(e=(i=this.media)==null?void 0:i.duration)!=null?e:NaN}get ended(){var i,e;return(e=(i=this.media)==null?void 0:i.ended)!=null?e:!1}get buffered(){var i,e;return(e=(i=this.media)==null?void 0:i.buffered)!=null?e:_t}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:_t}get readyState(){var i,e;return(e=(i=this.media)==null?void 0:i.readyState)!=null?e:0}get videoWidth(){var i,e;return(e=(i=this.media)==null?void 0:i.videoWidth)!=null?e:0}get videoHeight(){var i,e;return(e=(i=this.media)==null?void 0:i.videoHeight)!=null?e:0}get currentSrc(){var i,e;return(e=(i=this.media)==null?void 0:i.currentSrc)!=null?e:""}get currentTime(){var i,e;return(e=(i=this.media)==null?void 0:i.currentTime)!=null?e:0}set currentTime(i){this.media&&(this.media.currentTime=Number(i))}get volume(){var i,e;return(e=(i=this.media)==null?void 0:i.volume)!=null?e:1}set volume(i){this.media&&(this.media.volume=Number(i))}get playbackRate(){var i,e;return(e=(i=this.media)==null?void 0:i.playbackRate)!=null?e:1}set playbackRate(i){this.media&&(this.media.playbackRate=Number(i))}get defaultPlaybackRate(){var i;return(i=f(this.getAttribute(D.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(D.PLAYBACKRATE,`${i}`):this.removeAttribute(D.PLAYBACKRATE)}get crossOrigin(){return te(this,T.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(T.CROSSORIGIN,`${i}`)}get autoplay(){return te(this,T.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(T.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(T.AUTOPLAY)}get loop(){return te(this,T.LOOP)!=null}set loop(i){i?this.setAttribute(T.LOOP,""):this.removeAttribute(T.LOOP)}get muted(){var i,e;return(e=(i=this.media)==null?void 0:i.muted)!=null?e:!1}set muted(i){this.media&&(this.media.muted=!!i)}get defaultMuted(){return te(this,T.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(T.MUTED,""):this.removeAttribute(T.MUTED)}get playsInline(){return te(this,T.PLAYSINLINE)!=null}set playsInline(i){A("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(i){["","none","metadata","auto"].includes(i)?this.setAttribute(T.PRELOAD,i):this.removeAttribute(T.PRELOAD)}};function te(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}var Pe=Ie;import"media-chrome/dist/media-theme-element.js";var Rt=`:host {
|
|
3
3
|
--media-control-display: var(--controls);
|
|
4
4
|
--media-loading-indicator-display: var(--loading-indicator);
|
|
5
5
|
--media-dialog-display: var(--dialog);
|
|
@@ -149,75 +149,74 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
149
149
|
:host([no-tooltips]) {
|
|
150
150
|
--media-tooltip-display: none;
|
|
151
151
|
}
|
|
152
|
-
`;import{TemplateInstance as
|
|
152
|
+
`;import{TemplateInstance as di,ChildNodePart as Te,AttrPart as ve}from"media-chrome/dist/media-theme-element.js";var ie=new WeakMap,De=class t{constructor(i,e){this.element=i;this.type=e;this.element.addEventListener(this.type,this);let a=ie.get(this.element);a&&a.set(this.type,this)}set(i){if(typeof i=="function")this.handleEvent=i.bind(this.element);else if(typeof i=="object"&&typeof i.handleEvent=="function")this.handleEvent=i.handleEvent.bind(i);else{this.element.removeEventListener(this.type,this);let e=ie.get(this.element);e&&e.delete(this.type)}}static for(i){ie.has(i.element)||ie.set(i.element,new Map);let e=i.attributeName.slice(2),a=ie.get(i.element);return a&&a.has(e)?a.get(e):new t(i.element,e)}};function li(t,i){return t instanceof ve&&t.attributeName.startsWith("on")?(De.for(t).set(i),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function ui(t,i){return i instanceof Ee&&t instanceof Te?(i.renderInto(t),!0):!1}function mi(t,i){return i instanceof DocumentFragment&&t instanceof Te?(i.childNodes.length&&t.replace(...i.childNodes),!0):!1}function ci(t,i){if(t instanceof ve){let e=t.attributeNamespace,a=t.element.getAttributeNS(e,t.attributeName);return String(i)!==a&&(t.value=String(i)),!0}return t.value=String(i),!0}function pi(t,i){if(t instanceof ve&&i instanceof Element){let e=t.element;return e[t.attributeName]!==i&&(t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),e[t.attributeName]=i),!0}return!1}function bi(t,i){if(typeof i=="boolean"&&t instanceof ve){let e=t.attributeNamespace,a=t.element.hasAttributeNS(e,t.attributeName);return i!==a&&(t.booleanValue=i),!0}return!1}function hi(t,i){return i===!1&&t instanceof Te?(t.replace(""),!0):!1}function gi(t,i){pi(t,i)||bi(t,i)||li(t,i)||hi(t,i)||ui(t,i)||mi(t,i)||ci(t,i)}var we=new Map,xt=new WeakMap,Ot=new WeakMap,Ee=class{constructor(i,e,a){this.strings=i;this.values=e;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(we.has(this.stringsKey))return we.get(this.stringsKey);{let i=B.createElement("template"),e=this.strings.length-1;return i.innerHTML=this.strings.reduce((a,r,o)=>a+r+(o<e?`{{ ${o} }}`:""),""),we.set(this.stringsKey,i),i}}renderInto(i){var r;let e=this.template;if(xt.get(i)!==e){xt.set(i,e);let o=new di(e,this.values,this.processor);Ot.set(i,o),i instanceof Te?i.replace(...o.children):i.appendChild(o);return}let a=Ot.get(i);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},fi={processCallback(t,i,e){var a;if(e){for(let[r,o]of i)if(r in e){let d=(a=e[r])!=null?a:"";gi(o,d)}}}};function ae(t,...i){return new Ee(t,i,fi)}function Lt(t,i){t.renderInto(i)}import{StreamTypes as yi,toMuxVideoURL as Mt}from"@mux/playback-core";var Ei=t=>{let{tokens:i}=t;return i.drm?":host(:not([cast-receiver])) { --_cast-button-drm-display: none; }":""},St=t=>ae`
|
|
153
153
|
<style>
|
|
154
|
-
${
|
|
155
|
-
${
|
|
154
|
+
${Ei(t)}
|
|
155
|
+
${Rt}
|
|
156
156
|
</style>
|
|
157
|
-
${
|
|
158
|
-
`,
|
|
157
|
+
${Ci(t)}
|
|
158
|
+
`,Ti=t=>{let i=t.hotKeys?`${t.hotKeys}`:"";return ee(t.streamType)==="live"&&(i+=" noarrowleft noarrowright"),i},vi={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",THUMB:"thumb",DISPLAY:"display",CONTROL_BAR:"control-bar",MENU_BUTTON:"menu-button",MENU:"menu",MENU_ITEM:"menu-item",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},Ai=Object.values(vi).join(", "),Ci=t=>{var i,e,a,r,o,d,u,p,R,P,w,C,v,x,W,g,be,X,q,We,Ze,Ge,je,ze,Xe,qe,Qe,Je,et,tt,it,at,rt,nt,ot,st,dt,lt,ut,mt,ct,pt;return ae`
|
|
159
159
|
<media-theme
|
|
160
160
|
template="${t.themeTemplate||!1}"
|
|
161
|
-
defaultstreamtype="${(
|
|
162
|
-
hotkeys="${
|
|
161
|
+
defaultstreamtype="${(i=t.defaultStreamType)!=null?i:!1}"
|
|
162
|
+
hotkeys="${Ti(t)||!1}"
|
|
163
163
|
nohotkeys="${t.noHotKeys||!t.hasSrc||!1}"
|
|
164
|
-
noautoseektolive="${!!((e=t.streamType)!=null&&e.includes(
|
|
164
|
+
noautoseektolive="${!!((e=t.streamType)!=null&&e.includes(yi.LIVE))&&t.targetLiveWindow!==0}"
|
|
165
165
|
novolumepref="${t.novolumepref||!1}"
|
|
166
166
|
nomutedpref="${t.nomutedpref||!1}"
|
|
167
167
|
disabled="${!t.hasSrc||t.isDialogOpen}"
|
|
168
|
-
audio="${(
|
|
169
|
-
style="${(r=
|
|
168
|
+
audio="${(a=t.audio)!=null?a:!1}"
|
|
169
|
+
style="${(r=ft({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor,"--media-accent-color":t.accentColor}))!=null?r:!1}"
|
|
170
170
|
defaultsubtitles="${!t.defaultHiddenCaptions}"
|
|
171
|
-
forwardseekoffset="${(
|
|
171
|
+
forwardseekoffset="${(o=t.forwardSeekOffset)!=null?o:!1}"
|
|
172
172
|
backwardseekoffset="${(d=t.backwardSeekOffset)!=null?d:!1}"
|
|
173
173
|
playbackrates="${(u=t.playbackRates)!=null?u:!1}"
|
|
174
|
-
defaultshowremainingtime="${(
|
|
174
|
+
defaultshowremainingtime="${(p=t.defaultShowRemainingTime)!=null?p:!1}"
|
|
175
175
|
defaultduration="${(R=t.defaultDuration)!=null?R:!1}"
|
|
176
|
-
hideduration="${(
|
|
177
|
-
title="${(
|
|
178
|
-
videotitle="${(
|
|
179
|
-
proudlydisplaymuxbadge="${(
|
|
180
|
-
exportparts="${
|
|
181
|
-
onclose="${t.onCloseErrorDialog}"
|
|
182
|
-
onfocusin="${t.onFocusInErrorDialog}"
|
|
176
|
+
hideduration="${(P=t.hideDuration)!=null?P:!1}"
|
|
177
|
+
title="${(w=t.title)!=null?w:!1}"
|
|
178
|
+
videotitle="${(C=t.videoTitle)!=null?C:!1}"
|
|
179
|
+
proudlydisplaymuxbadge="${(v=t.proudlyDisplayMuxBadge)!=null?v:!1}"
|
|
180
|
+
exportparts="${Ai}"
|
|
183
181
|
>
|
|
184
182
|
<mux-video
|
|
185
183
|
slot="media"
|
|
186
184
|
inert="${(x=t.noHotKeys)!=null?x:!1}"
|
|
187
|
-
target-live-window="${(
|
|
185
|
+
target-live-window="${(W=t.targetLiveWindow)!=null?W:!1}"
|
|
188
186
|
stream-type="${(g=ee(t.streamType))!=null?g:!1}"
|
|
189
|
-
crossorigin="${(
|
|
187
|
+
crossorigin="${(be=t.crossOrigin)!=null?be:""}"
|
|
190
188
|
playsinline
|
|
191
189
|
autoplay="${(X=t.autoplay)!=null?X:!1}"
|
|
192
190
|
muted="${(q=t.muted)!=null?q:!1}"
|
|
193
|
-
loop="${(
|
|
194
|
-
preload="${(
|
|
195
|
-
debug="${(
|
|
196
|
-
prefer-cmcd="${(
|
|
197
|
-
disable-tracking="${(
|
|
198
|
-
disable-cookies="${(
|
|
199
|
-
prefer-playback="${(
|
|
191
|
+
loop="${(We=t.loop)!=null?We:!1}"
|
|
192
|
+
preload="${(Ze=t.preload)!=null?Ze:!1}"
|
|
193
|
+
debug="${(Ge=t.debug)!=null?Ge:!1}"
|
|
194
|
+
prefer-cmcd="${(je=t.preferCmcd)!=null?je:!1}"
|
|
195
|
+
disable-tracking="${(ze=t.disableTracking)!=null?ze:!1}"
|
|
196
|
+
disable-cookies="${(Xe=t.disableCookies)!=null?Xe:!1}"
|
|
197
|
+
prefer-playback="${(qe=t.preferPlayback)!=null?qe:!1}"
|
|
200
198
|
start-time="${t.startTime!=null?t.startTime:!1}"
|
|
201
199
|
initial-bandwidth-estimate-kbps="${t.initialBandwidthEstimateKbps!=null?t.initialBandwidthEstimateKbps:!1}"
|
|
202
200
|
initial-estimate-segments="${t.initialEstimateSegments!=null?t.initialEstimateSegments:!1}"
|
|
203
201
|
min-preload-segments="${t.minPreloadSegments!=null?t.minPreloadSegments:!1}"
|
|
204
|
-
beacon-collection-domain="${(
|
|
205
|
-
player-init-time="${(
|
|
206
|
-
player-software-name="${(
|
|
207
|
-
player-software-version="${(
|
|
208
|
-
env-key="${(
|
|
209
|
-
custom-domain="${(
|
|
210
|
-
src="${t.src?t.src:t.playbackId?
|
|
211
|
-
cast-src="${t.src?t.src:t.playbackId?
|
|
212
|
-
cast-receiver="${(
|
|
213
|
-
drm-token="${(
|
|
214
|
-
playback-token="${(
|
|
202
|
+
beacon-collection-domain="${(Qe=t.beaconCollectionDomain)!=null?Qe:!1}"
|
|
203
|
+
player-init-time="${(Je=t.playerInitTime)!=null?Je:!1}"
|
|
204
|
+
player-software-name="${(et=t.playerSoftwareName)!=null?et:!1}"
|
|
205
|
+
player-software-version="${(tt=t.playerSoftwareVersion)!=null?tt:!1}"
|
|
206
|
+
env-key="${(it=t.envKey)!=null?it:!1}"
|
|
207
|
+
custom-domain="${(at=t.customDomain)!=null?at:!1}"
|
|
208
|
+
src="${t.src?t.src:t.playbackId?Mt(t):!1}"
|
|
209
|
+
cast-src="${t.src?t.src:t.playbackId?Mt(t):!1}"
|
|
210
|
+
cast-receiver="${(rt=t.castReceiver)!=null?rt:!1}"
|
|
211
|
+
drm-token="${(ot=(nt=t.tokens)==null?void 0:nt.drm)!=null?ot:!1}"
|
|
212
|
+
playback-token="${(dt=(st=t.tokens)==null?void 0:st.playback)!=null?dt:!1}"
|
|
215
213
|
exportparts="video"
|
|
216
|
-
disable-pseudo-ended="${(
|
|
217
|
-
max-
|
|
218
|
-
|
|
214
|
+
disable-pseudo-ended="${(lt=t.disablePseudoEnded)!=null?lt:!1}"
|
|
215
|
+
max-reconnect-retries="${(ut=t.maxReconnectRetries)!=null?ut:!1}"
|
|
216
|
+
max-auto-resolution="${(mt=t.maxAutoResolution)!=null?mt:!1}"
|
|
217
|
+
cap-rendition-to-player-size="${(ct=t.capRenditionToPlayerSize)!=null?ct:!1}"
|
|
219
218
|
>
|
|
220
|
-
${t.storyboard?
|
|
219
|
+
${t.storyboard?ae`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:ae``}
|
|
221
220
|
<slot></slot>
|
|
222
221
|
</mux-video>
|
|
223
222
|
<slot name="poster" slot="poster">
|
|
@@ -225,11 +224,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
225
224
|
part="poster"
|
|
226
225
|
exportparts="poster, img"
|
|
227
226
|
src="${t.poster?t.poster:!1}"
|
|
228
|
-
placeholdersrc="${(
|
|
227
|
+
placeholdersrc="${(pt=t.placeholder)!=null?pt:!1}"
|
|
229
228
|
></media-poster-image>
|
|
230
229
|
</slot>
|
|
231
230
|
</media-theme>
|
|
232
|
-
`};import{errorCategoryToTokenNameOrPrefix as
|
|
231
|
+
`};import{errorCategoryToTokenNameOrPrefix as Nt,i18n as y,MediaError as S,MuxErrorCategory as It,MuxErrorCode as c}from"@mux/playback-core";var Pt=t=>t.charAt(0).toUpperCase()+t.slice(1),ki=(t,i=!1)=>{var e,a;if(t.muxCode){let r=Pt((e=t.errorCategory)!=null?e:"video"),o=Nt((a=t.errorCategory)!=null?a:It.VIDEO);if(t.muxCode===c.NETWORK_OFFLINE)return y("Your device appears to be offline",i);if(t.muxCode===c.NETWORK_RECONNECTING)return y("Reconnecting...",i);if(t.muxCode===c.NETWORK_TOKEN_EXPIRED)return y("{category} URL has expired",i).format({category:r});if([c.NETWORK_TOKEN_SUB_MISMATCH,c.NETWORK_TOKEN_AUD_MISMATCH,c.NETWORK_TOKEN_AUD_MISSING,c.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return y("{category} URL is formatted incorrectly",i).format({category:r});if(t.muxCode===c.NETWORK_TOKEN_MISSING)return y("Invalid {categoryName} URL",i).format({categoryName:o});if(t.muxCode===c.NETWORK_NOT_FOUND)return y("{category} does not exist",i).format({category:r});if(t.muxCode===c.NETWORK_NOT_READY){let d=t.streamType==="live"?"Live stream":"Video";return y("{mediaType} is not currently available",i).format({mediaType:d})}}if(t.code){if(t.code===S.MEDIA_ERR_NETWORK)return y("Network Error",i);if(t.code===S.MEDIA_ERR_DECODE)return y("Media Error",i);if(t.code===S.MEDIA_ERR_SRC_NOT_SUPPORTED)return y("Source Not Supported",i)}return y("Error",i)},_i=(t,i=!1)=>{var e,a;if(t.reload)return'Try again later or <a href="#" data-mux-reload style="color: #4a90e2;">click here to retry</a>';if(t.muxCode){let r=Pt((e=t.errorCategory)!=null?e:"video"),o=Nt((a=t.errorCategory)!=null?a:It.VIDEO);return t.muxCode===c.NETWORK_OFFLINE?y("Check your internet connection and try reloading this video.",i):t.muxCode===c.NETWORK_RECONNECTING?y("Your connection was interrupted. Attempting to resume playback...",i):t.muxCode===c.NETWORK_TOKEN_EXPIRED?y("The video\u2019s secured {tokenNamePrefix}-token has expired.",i).format({tokenNamePrefix:o}):t.muxCode===c.NETWORK_TOKEN_SUB_MISMATCH?y("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",i).format({tokenNamePrefix:o}):t.muxCode===c.NETWORK_TOKEN_MALFORMED?y("{category} URL is formatted incorrectly",i).format({category:r}):[c.NETWORK_TOKEN_AUD_MISMATCH,c.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?y("The {tokenNamePrefix}-token is formatted with incorrect information.",i).format({tokenNamePrefix:o}):[c.NETWORK_TOKEN_MISSING,c.NETWORK_INVALID_URL].includes(t.muxCode)?y("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",i).format({tokenNamePrefix:o}):t.muxCode===c.NETWORK_NOT_FOUND?"":t.message}return t.code&&(t.code===S.MEDIA_ERR_NETWORK||t.code===S.MEDIA_ERR_DECODE||t.code===S.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},wt=(t,i=!1)=>{let e=ki(t,i).toString(),a=_i(t,i).toString();return{title:e,message:a}},Ri=t=>{if(t.muxCode){if(t.muxCode===c.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===c.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([c.NETWORK_TOKEN_AUD_MISMATCH,c.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===c.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===c.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===c.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===c.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===S.MEDIA_ERR_NETWORK)return"";if(t.code===S.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===S.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},Ue=(t,i)=>{let e=Ri(t);return{message:t.message,context:t.context,file:e}};var Dt=`<template id="media-theme-gerwig">
|
|
233
232
|
<style>
|
|
234
233
|
@keyframes pre-play-hide {
|
|
235
234
|
0% {
|
|
@@ -529,6 +528,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
529
528
|
text-shadow:
|
|
530
529
|
0 0 2px rgb(0 0 0 / 0.25),
|
|
531
530
|
0 0 6px rgb(0 0 0 / 0.25);
|
|
531
|
+
filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.25)) drop-shadow(0 0 6px rgb(0 0 0 / 0.25));
|
|
532
532
|
}
|
|
533
533
|
|
|
534
534
|
.center-controls media-play-button {
|
|
@@ -536,7 +536,6 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
536
536
|
--media-control-hover-background: transparent;
|
|
537
537
|
--media-control-padding: 0;
|
|
538
538
|
width: 40px;
|
|
539
|
-
filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.25)) drop-shadow(0 0 6px rgb(0 0 0 / 0.25));
|
|
540
539
|
}
|
|
541
540
|
|
|
542
541
|
[breakpointsm] .center-controls media-play-button {
|
|
@@ -1361,17 +1360,17 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1361
1360
|
<slot></slot>
|
|
1362
1361
|
</media-controller>
|
|
1363
1362
|
</template>
|
|
1364
|
-
`;import{MediaThemeElement as
|
|
1365
|
-
${
|
|
1366
|
-
${
|
|
1367
|
-
${
|
|
1368
|
-
${
|
|
1369
|
-
href="${
|
|
1363
|
+
`;import{MediaThemeElement as Oi}from"media-chrome/dist/media-theme-element.js";import"media-chrome/dist/menu";var Be=B.createElement("template");"innerHTML"in Be&&(Be.innerHTML=Dt);var Ut,Bt,Ae=class extends Oi{};Ae.template=(Bt=(Ut=Be.content)==null?void 0:Ut.children)==null?void 0:Bt[0];_.customElements.get("media-theme-gerwig")||_.customElements.define("media-theme-gerwig",Ae);var Ii="gerwig",N={SRC:"src",POSTER:"poster"},n={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"},$e=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","videotitle","novolumepref","nomutedpref","proudlydisplaymuxbadge"];function Pi(t,i){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(n.STORYBOARD_SRC),fullscreenElement:t.getAttribute(n.FULLSCREEN_ELEMENT),placeholder:t.getAttribute("placeholder"),themeTemplate:Di(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(n.NOHOTKEYS),hotKeys:t.getAttribute(n.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,initialBandwidthEstimateKbps:t.initialBandwidthEstimateKbps,initialEstimateSegments:t.initialEstimateSegments,minPreloadSegments:t.minPreloadSegments,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(s.TARGET_LIVE_WINDOW),streamType:ee(t.getAttribute(s.STREAM_TYPE)),primaryColor:t.getAttribute(n.PRIMARY_COLOR),secondaryColor:t.getAttribute(n.SECONDARY_COLOR),accentColor:t.getAttribute(n.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:Ui(t),playbackRates:t.getAttribute(n.PLAYBACK_RATES),customDomain:(r=t.getAttribute(s.CUSTOM_DOMAIN))!=null?r:void 0,title:t.getAttribute(n.TITLE),videoTitle:(o=t.getAttribute(n.VIDEO_TITLE))!=null?o:t.getAttribute(n.TITLE),novolumepref:t.hasAttribute(n.NO_VOLUME_PREF),nomutedpref:t.hasAttribute(n.NO_MUTED_PREF),proudlyDisplayMuxBadge:t.hasAttribute(n.PROUDLY_DISPLAY_MUX_BADGE),castReceiver:t.castReceiver,disablePseudoEnded:t.hasAttribute(n.DISABLE_PSEUDO_ENDED),maxReconnectRetries:t.maxReconnectRetries,capRenditionToPlayerSize:t.capRenditionToPlayerSize,...i,extraSourceParams:t.extraSourceParams}}var wi=Wt.formatErrorMessage;Wt.formatErrorMessage=t=>{var i,e;if(t instanceof _e){let a=wt(t,!1);return`
|
|
1364
|
+
${a!=null&&a.title?`<h3>${a.title}</h3>`:""}
|
|
1365
|
+
${a!=null&&a.message||a!=null&&a.linkUrl?`<p>
|
|
1366
|
+
${a==null?void 0:a.message}
|
|
1367
|
+
${a!=null&&a.linkUrl?`<a
|
|
1368
|
+
href="${a.linkUrl}"
|
|
1370
1369
|
target="_blank"
|
|
1371
1370
|
rel="external noopener"
|
|
1372
|
-
aria-label="${(a
|
|
1373
|
-
>${(e=
|
|
1371
|
+
aria-label="${(i=a.linkText)!=null?i:""} ${H("(opens in a new window)")}"
|
|
1372
|
+
>${(e=a.linkText)!=null?e:a.linkUrl}</a
|
|
1374
1373
|
>`:""}
|
|
1375
1374
|
</p>`:""}
|
|
1376
|
-
`}return Sa(t)};function Na(t){var e,i;let a=t.theme;if(a){let r=(i=(e=t.getRootNode())==null?void 0:e.getElementById)==null?void 0:i.call(e,a);if(r&&r instanceof HTMLTemplateElement)return r;a.startsWith("media-theme-")||(a=`media-theme-${a}`);let s=_.customElements.get(a);if(s!=null&&s.template)return s.template}}function Ia(t){var e;let a=(e=t.mediaController)==null?void 0:e.querySelector("media-time-display");return a&&getComputedStyle(a).getPropertyValue("--media-duration-display-display").trim()==="none"}function Ut(t){let a=t.videoTitle?{video_title:t.videoTitle}:{};return t.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,i)=>{let r=t.getAttribute(i);return r!==null&&(e[i.replace(/^metadata-/,"").replace(/-/g,"_")]=r),e},a)}var Pa=Object.values(n),wa=Object.values(N),Da=Object.values(o),Bt=be(),Vt="mux-player",Kt={isDialogOpen:!1},Ua={redundant_streams:!0},re,W,oe,w,ne,Z,se,de,H,G,$,le,m,I,$t,Ke,K,Ft,Yt,Wt,Zt,Ve=class extends Me{constructor(){super();h(this,m);h(this,re);h(this,W,!1);h(this,oe,{});h(this,w,!0);h(this,ne,new pe(this,"hotkeys"));h(this,Z);h(this,se,()=>p(this,m,K).call(this));h(this,de,()=>p(this,m,K).call(this));h(this,H,()=>p(this,m,K).call(this));h(this,G);h(this,$,{...Kt,onCloseErrorDialog:e=>{var r;((r=e.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&p(this,m,Ke).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:e=>{var s;if(((s=e.composedPath()[0])==null?void 0:s.localName)!=="media-error-dialog")return;Re(this,D.activeElement)||e.preventDefault()}});h(this,le,e=>{var s;let i=(s=this.media)==null?void 0:s.error;if(!(i instanceof ve)){let{message:d,code:u}=i!=null?i:{};i=new ve(d,u)}if(!(i!=null&&i.fatal)){O(i),i.data&&O(`${i.name} data:`,i.data);return}let r=Ie(i,!1);r.message&&Oe(r),k(i),i.data&&k(`${i.name} data:`,i.data),p(this,m,Ke).call(this,{isDialogOpen:!0})});y(this,re,Oa()),this.attachShadow({mode:"open"}),p(this,m,$t).call(this),this.isConnected&&p(this,m,I).call(this)}static get NAME(){return Vt}static get VERSION(){return Bt}static get observedAttributes(){var e;return[...(e=Me.observedAttributes)!=null?e:[],...wa,...Pa,...Da]}get mediaTheme(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("media-theme")}get mediaController(){var e,i;return(i=(e=this.mediaTheme)==null?void 0:e.shadowRoot)==null?void 0:i.querySelector("media-controller")}connectedCallback(){p(this,m,I).call(this);let e=this.media;e&&(e.metadata=Ut(this))}disconnectedCallback(){var e,i,r,s,d,u,b,R;(e=l(this,Z))==null||e.disconnect(),(i=this.media)==null||i.removeEventListener("streamtypechange",l(this,se)),(r=this.media)==null||r.removeEventListener("loadstart",l(this,de)),this.removeEventListener("error",l(this,le)),this.media&&(this.media.errorTranslator=void 0),(d=(s=this.media)==null?void 0:s.textTracks)==null||d.removeEventListener("addtrack",l(this,H)),(b=(u=this.media)==null?void 0:u.textTracks)==null||b.removeEventListener("removetrack",l(this,H)),(R=l(this,G))==null||R.call(this),y(this,G,void 0),y(this,W,!1)}attributeChangedCallback(e,i,r){switch(p(this,m,I).call(this),super.attributeChangedCallback(e,i,r),e){case o.HOTKEYS:l(this,ne).value=r;break;case o.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&O(V("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case o.THUMBNAIL_TOKEN:{if(r){let d=De(r);if(d){let{aud:u}=d,b=Ue.THUMBNAIL;u!==b&&O(V("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:u,expectedAud:b,tokenNamePrefix:"thumbnail"}))}}break}case o.STORYBOARD_TOKEN:{if(r){let d=De(r);if(d){let{aud:u}=d,b=Ue.STORYBOARD;u!==b&&O(V("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:u,expectedAud:b,tokenNamePrefix:"storyboard"}))}}break}case o.DRM_TOKEN:{if(r){let d=De(r);if(d){let{aud:u}=d,b=Ue.DRM;u!==b&&O(V("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:u,expectedAud:b,tokenNamePrefix:"drm"}))}}break}case n.PLAYBACK_ID:{r!=null&&r.includes("?token")&&k(V("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case n.STREAM_TYPE:{r&&![L.LIVE,L.ON_DEMAND,L.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Oe({file:"invalid-stream-type.md",message:V("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===L.LIVE?this.getAttribute(o.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case o.FULLSCREEN_ELEMENT:{if(r!=null||r!==i){let d=D.getElementById(r),u=d==null?void 0:d.querySelector("mux-player");this.mediaController&&d&&u&&(this.mediaController.fullscreenElement=d)}break}case n.CAP_RENDITION_TO_PLAYER_SIZE:{(r==null||r!==i)&&(this.capRenditionToPlayerSize=r!=null?!0:void 0);break}}[n.PLAYBACK_ID,N.SRC,o.PLAYBACK_TOKEN].includes(e)&&i!==r&&y(this,$,{...l(this,$),...Kt}),p(this,m,K).call(this,{[ft(e)]:r})}async requestFullscreen(e){var i;if(!(!this.mediaController||this.mediaController.hasAttribute(Ee.MEDIA_IS_FULLSCREEN)))return(i=this.mediaController)==null||i.dispatchEvent(new _.CustomEvent(wt.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,s)=>{var d;(d=this.mediaController)==null||d.addEventListener(Pt.MEDIA_IS_FULLSCREEN,()=>r(),{once:!0})})}async exitFullscreen(){var e;if(!(!this.mediaController||!this.mediaController.hasAttribute(Ee.MEDIA_IS_FULLSCREEN)))return(e=this.mediaController)==null||e.dispatchEvent(new _.CustomEvent(wt.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((i,r)=>{var s;(s=this.mediaController)==null||s.addEventListener(Pt.MEDIA_IS_FULLSCREEN,()=>i(),{once:!0})})}get preferCmcd(){var e;return(e=this.getAttribute(n.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?Dt.includes(e)?this.setAttribute(n.PREFER_CMCD,e):O(`Invalid value for preferCmcd. Must be one of ${Dt.join()}`):this.removeAttribute(n.PREFER_CMCD))}get hasPlayed(){var e,i;return(i=(e=this.mediaController)==null?void 0:e.hasAttribute(Ee.MEDIA_HAS_PLAYED))!=null?i:!1}get inLiveWindow(){var e;return(e=this.mediaController)==null?void 0:e.hasAttribute(Ee.MEDIA_TIME_IS_LIVE)}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get theme(){var e;return(e=this.getAttribute(o.THEME))!=null?e:La}set theme(e){this.setAttribute(o.THEME,`${e}`)}get themeProps(){let e=this.mediaTheme;if(!e)return;let i={};for(let r of e.getAttributeNames()){if(Be.includes(r))continue;let s=e.getAttribute(r);i[ce(r)]=s===""?!0:s}return i}set themeProps(e){var r,s;p(this,m,I).call(this);let i={...this.themeProps,...e};for(let d in i){if(Be.includes(d))continue;let u=e==null?void 0:e[d];typeof u=="boolean"||u==null?(r=this.mediaTheme)==null||r.toggleAttribute(me(d),!!u):(s=this.mediaTheme)==null||s.setAttribute(me(d),u)}}get playbackId(){var e;return(e=this.getAttribute(n.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(n.PLAYBACK_ID,e):this.removeAttribute(n.PLAYBACK_ID)}get src(){var e,i;return this.playbackId?(e=M(this,N.SRC))!=null?e:void 0:(i=this.getAttribute(N.SRC))!=null?i:void 0}set src(e){e?this.setAttribute(N.SRC,e):this.removeAttribute(N.SRC)}get poster(){var r;let e=this.getAttribute(N.POSTER);if(e!=null)return e;let{tokens:i}=this;if(i.playback&&!i.thumbnail){O("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return ht(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:i.thumbnail})}set poster(e){e||e===""?this.setAttribute(N.POSTER,e):this.removeAttribute(N.POSTER)}get storyboardSrc(){var e;return(e=this.getAttribute(o.STORYBOARD_SRC))!=null?e:void 0}set storyboardSrc(e){e?this.setAttribute(o.STORYBOARD_SRC,e):this.removeAttribute(o.STORYBOARD_SRC)}get storyboard(){let{tokens:e}=this;if(this.storyboardSrc&&!e.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[L.LIVE,L.UNKNOWN].includes(this.streamType)||e.playback&&!e.storyboard))return gt(this.playbackId,{customDomain:this.customDomain,token:e.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(o.AUDIO)}set audio(e){if(!e){this.removeAttribute(o.AUDIO);return}this.setAttribute(o.AUDIO,"")}get hotkeys(){return l(this,ne)}get nohotkeys(){return this.hasAttribute(o.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(o.NOHOTKEYS);return}this.setAttribute(o.NOHOTKEYS,"")}get thumbnailTime(){return f(this.getAttribute(o.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(o.THUMBNAIL_TIME,`${e}`)}get videoTitle(){var e,i;return(i=(e=this.getAttribute(o.VIDEO_TITLE))!=null?e:this.getAttribute(o.TITLE))!=null?i:""}set videoTitle(e){e!==this.videoTitle&&(e?this.setAttribute(o.VIDEO_TITLE,e):this.removeAttribute(o.VIDEO_TITLE))}get placeholder(){var e;return(e=M(this,o.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(o.PLACEHOLDER,`${e}`)}get primaryColor(){var i,r;let e=this.getAttribute(o.PRIMARY_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(i=_.getComputedStyle(this.mediaTheme))==null?void 0:i.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),e))return e}set primaryColor(e){this.setAttribute(o.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var i,r;let e=this.getAttribute(o.SECONDARY_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(i=_.getComputedStyle(this.mediaTheme))==null?void 0:i.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),e))return e}set secondaryColor(e){this.setAttribute(o.SECONDARY_COLOR,`${e}`)}get accentColor(){var i,r;let e=this.getAttribute(o.ACCENT_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(i=_.getComputedStyle(this.mediaTheme))==null?void 0:i.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),e))return e}set accentColor(e){this.setAttribute(o.ACCENT_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(o.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(o.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(o.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(o.PLAYBACK_RATES))return this.getAttribute(o.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,i)=>e-i)}set playbackRates(e){if(!e){this.removeAttribute(o.PLAYBACK_RATES);return}this.setAttribute(o.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=f(this.getAttribute(o.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(o.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=f(this.getAttribute(o.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(o.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(o.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(o.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(o.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return f(this.getAttribute(o.DEFAULT_DURATION))}set defaultDuration(e){e==null?this.removeAttribute(o.DEFAULT_DURATION):this.setAttribute(o.DEFAULT_DURATION,`${e}`)}get playerInitTime(){return this.hasAttribute(n.PLAYER_INIT_TIME)?f(this.getAttribute(n.PLAYER_INIT_TIME)):l(this,re)}set playerInitTime(e){e!=this.playerInitTime&&(e==null?this.removeAttribute(n.PLAYER_INIT_TIME):this.setAttribute(n.PLAYER_INIT_TIME,`${+e}`))}get playerSoftwareName(){var e;return(e=this.getAttribute(n.PLAYER_SOFTWARE_NAME))!=null?e:Vt}get playerSoftwareVersion(){var e;return(e=this.getAttribute(n.PLAYER_SOFTWARE_VERSION))!=null?e:Bt}get beaconCollectionDomain(){var e;return(e=this.getAttribute(n.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(n.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(n.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var e;return(e=this.getAttribute(n.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(n.MAX_RESOLUTION,e):this.removeAttribute(n.MAX_RESOLUTION))}get minResolution(){var e;return(e=this.getAttribute(n.MIN_RESOLUTION))!=null?e:void 0}set minResolution(e){e!==this.minResolution&&(e?this.setAttribute(n.MIN_RESOLUTION,e):this.removeAttribute(n.MIN_RESOLUTION))}get maxAutoResolution(){var e;return(e=this.getAttribute(n.MAX_AUTO_RESOLUTION))!=null?e:void 0}set maxAutoResolution(e){e==null?this.removeAttribute(n.MAX_AUTO_RESOLUTION):this.setAttribute(n.MAX_AUTO_RESOLUTION,e)}get renditionOrder(){var e;return(e=this.getAttribute(n.RENDITION_ORDER))!=null?e:void 0}set renditionOrder(e){e!==this.renditionOrder&&(e?this.setAttribute(n.RENDITION_ORDER,e):this.removeAttribute(n.RENDITION_ORDER))}get programStartTime(){return f(this.getAttribute(n.PROGRAM_START_TIME))}set programStartTime(e){e==null?this.removeAttribute(n.PROGRAM_START_TIME):this.setAttribute(n.PROGRAM_START_TIME,`${e}`)}get programEndTime(){return f(this.getAttribute(n.PROGRAM_END_TIME))}set programEndTime(e){e==null?this.removeAttribute(n.PROGRAM_END_TIME):this.setAttribute(n.PROGRAM_END_TIME,`${e}`)}get assetStartTime(){return f(this.getAttribute(n.ASSET_START_TIME))}set assetStartTime(e){e==null?this.removeAttribute(n.ASSET_START_TIME):this.setAttribute(n.ASSET_START_TIME,`${e}`)}get assetEndTime(){return f(this.getAttribute(n.ASSET_END_TIME))}set assetEndTime(e){e==null?this.removeAttribute(n.ASSET_END_TIME):this.setAttribute(n.ASSET_END_TIME,`${e}`)}get extraSourceParams(){return this.hasAttribute(o.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(o.EXTRA_SOURCE_PARAMS)).entries()].reduce((e,[i,r])=>(e[i]=r,e),{}):Ua}set extraSourceParams(e){e==null?this.removeAttribute(o.EXTRA_SOURCE_PARAMS):this.setAttribute(o.EXTRA_SOURCE_PARAMS,new URLSearchParams(e).toString())}get customDomain(){var e;return(e=this.getAttribute(n.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(n.CUSTOM_DOMAIN,e):this.removeAttribute(n.CUSTOM_DOMAIN))}get envKey(){var e;return(e=M(this,n.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(n.ENV_KEY,`${e}`)}get noVolumePref(){return this.hasAttribute(o.NO_VOLUME_PREF)}set noVolumePref(e){e?this.setAttribute(o.NO_VOLUME_PREF,""):this.removeAttribute(o.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(o.NO_MUTED_PREF)}set noMutedPref(e){e?this.setAttribute(o.NO_MUTED_PREF,""):this.removeAttribute(o.NO_MUTED_PREF)}get debug(){return M(this,n.DEBUG)!=null}set debug(e){e?this.setAttribute(n.DEBUG,""):this.removeAttribute(n.DEBUG)}get disableTracking(){return M(this,n.DISABLE_TRACKING)!=null}set disableTracking(e){this.toggleAttribute(n.DISABLE_TRACKING,!!e)}get disableCookies(){return M(this,n.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(n.DISABLE_COOKIES,""):this.removeAttribute(n.DISABLE_COOKIES)}get streamType(){var e,i,r;return(r=(i=this.getAttribute(n.STREAM_TYPE))!=null?i:(e=this.media)==null?void 0:e.streamType)!=null?r:L.UNKNOWN}set streamType(e){this.setAttribute(n.STREAM_TYPE,`${e}`)}get defaultStreamType(){var e,i,r;return(r=(i=this.getAttribute(o.DEFAULT_STREAM_TYPE))!=null?i:(e=this.mediaController)==null?void 0:e.getAttribute(o.DEFAULT_STREAM_TYPE))!=null?r:L.ON_DEMAND}set defaultStreamType(e){e?this.setAttribute(o.DEFAULT_STREAM_TYPE,e):this.removeAttribute(o.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var e,i;return this.hasAttribute(o.TARGET_LIVE_WINDOW)?+this.getAttribute(o.TARGET_LIVE_WINDOW):(i=(e=this.media)==null?void 0:e.targetLiveWindow)!=null?i:Number.NaN}set targetLiveWindow(e){e==this.targetLiveWindow||Number.isNaN(e)&&Number.isNaN(this.targetLiveWindow)||(e==null?this.removeAttribute(o.TARGET_LIVE_WINDOW):this.setAttribute(o.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e;return(e=this.media)==null?void 0:e.liveEdgeStart}get startTime(){return f(M(this,n.START_TIME))}set startTime(e){this.setAttribute(n.START_TIME,`${e}`)}get initialBandwidthEstimateKbps(){return f(M(this,n.INITIAL_BANDWIDTH_ESTIMATE_KBPS))}set initialBandwidthEstimateKbps(e){e==null?this.removeAttribute(n.INITIAL_BANDWIDTH_ESTIMATE_KBPS):this.setAttribute(n.INITIAL_BANDWIDTH_ESTIMATE_KBPS,`${e}`)}get initialEstimateSegments(){return f(M(this,n.INITIAL_ESTIMATE_SEGMENTS))}set initialEstimateSegments(e){e==null?this.removeAttribute(n.INITIAL_ESTIMATE_SEGMENTS):this.setAttribute(n.INITIAL_ESTIMATE_SEGMENTS,`${e}`)}get minPreloadSegments(){return f(M(this,n.MIN_PRELOAD_SEGMENTS))}set minPreloadSegments(e){e==null?this.removeAttribute(n.MIN_PRELOAD_SEGMENTS):this.setAttribute(n.MIN_PRELOAD_SEGMENTS,`${e}`)}get preferPlayback(){let e=this.getAttribute(n.PREFER_PLAYBACK);if(e===Te.MSE||e===Te.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===Te.MSE||e===Te.NATIVE?this.setAttribute(n.PREFER_PLAYBACK,e):this.removeAttribute(n.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(p(this,m,I).call(this),!this.media){k("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Ut(this),...e}}get _hlsConfig(){var e;return(e=this.media)==null?void 0:e._hlsConfig}set _hlsConfig(e){if(p(this,m,I).call(this),!this.media){k("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=e}async addCuePoints(e){var i;if(p(this,m,I).call(this),!this.media){k("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(i=this.media)==null?void 0:i.addCuePoints(e)}get activeCuePoint(){var e;return(e=this.media)==null?void 0:e.activeCuePoint}get cuePoints(){var e,i;return(i=(e=this.media)==null?void 0:e.cuePoints)!=null?i:[]}addChapters(e){var i;if(p(this,m,I).call(this),!this.media){k("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(i=this.media)==null?void 0:i.addChapters(e)}get activeChapter(){var e;return(e=this.media)==null?void 0:e.activeChapter}get chapters(){var e,i;return(i=(e=this.media)==null?void 0:e.chapters)!=null?i:[]}getStartDate(){var e;return(e=this.media)==null?void 0:e.getStartDate()}get currentPdt(){var e;return(e=this.media)==null?void 0:e.currentPdt}get tokens(){let e=this.getAttribute(o.PLAYBACK_TOKEN),i=this.getAttribute(o.DRM_TOKEN),r=this.getAttribute(o.THUMBNAIL_TOKEN),s=this.getAttribute(o.STORYBOARD_TOKEN);return{...l(this,oe),...e!=null?{playback:e}:{},...i!=null?{drm:i}:{},...r!=null?{thumbnail:r}:{},...s!=null?{storyboard:s}:{}}}set tokens(e){y(this,oe,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(o.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(o.PLAYBACK_TOKEN,`${e}`)}get drmToken(){var e;return(e=this.getAttribute(o.DRM_TOKEN))!=null?e:void 0}set drmToken(e){this.setAttribute(o.DRM_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(o.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(o.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(o.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(o.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,i,r,s){var u;let d=(u=this.media)==null?void 0:u.nativeEl;if(d)return Ra(d,e,i,r,s)}removeTextTrack(e){var r;let i=(r=this.media)==null?void 0:r.nativeEl;if(i)return xa(i,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}get castReceiver(){var e;return(e=this.getAttribute(o.CAST_RECEIVER))!=null?e:void 0}set castReceiver(e){e!==this.castReceiver&&(e?this.setAttribute(o.CAST_RECEIVER,e):this.removeAttribute(o.CAST_RECEIVER))}get castCustomData(){var e;return(e=this.media)==null?void 0:e.castCustomData}set castCustomData(e){if(!this.media){k("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=e}get noTooltips(){return this.hasAttribute(o.NO_TOOLTIPS)}set noTooltips(e){if(!e){this.removeAttribute(o.NO_TOOLTIPS);return}this.setAttribute(o.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(o.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(e){e?this.setAttribute(o.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(o.PROUDLY_DISPLAY_MUX_BADGE)}get capRenditionToPlayerSize(){var e;return(e=this.media)==null?void 0:e.capRenditionToPlayerSize}set capRenditionToPlayerSize(e){if(!this.media){k("underlying media element missing when trying to set capRenditionToPlayerSize");return}this.media.capRenditionToPlayerSize=e}};re=new WeakMap,W=new WeakMap,oe=new WeakMap,w=new WeakMap,ne=new WeakMap,Z=new WeakMap,se=new WeakMap,de=new WeakMap,H=new WeakMap,G=new WeakMap,$=new WeakMap,le=new WeakMap,m=new WeakSet,I=function(){var e,i,r,s;if(!l(this,W)){y(this,W,!0),p(this,m,K).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof _.HTMLElement))throw""}catch{k("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{k("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof _a))throw""}catch{k("<media-controller> failed to upgrade!")}p(this,m,Ft).call(this),p(this,m,Yt).call(this),p(this,m,Wt).call(this),y(this,w,(i=(e=this.mediaController)==null?void 0:e.hasAttribute(we.USER_INACTIVE))!=null?i:!0),p(this,m,Zt).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",l(this,se)),(s=this.media)==null||s.addEventListener("loadstart",l(this,de))}},$t=function(){var e,i;try{(e=window==null?void 0:window.CSS)==null||e.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(i=window==null?void 0:window.CSS)==null||i.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Ke=function(e){Object.assign(l(this,$),e),p(this,m,K).call(this)},K=function(e={}){kt(Rt(Ma(this,{...l(this,$),...e})),this.shadowRoot)},Ft=function(){let e=i=>{var d,u;if(!(i!=null&&i.startsWith("theme-")))return;let r=i.replace(/^theme-/,"");if(Be.includes(r))return;let s=this.getAttribute(i);s!=null?(d=this.mediaTheme)==null||d.setAttribute(r,s):(u=this.mediaTheme)==null||u.removeAttribute(r)};y(this,Z,new MutationObserver(i=>{for(let{attributeName:r}of i)e(r)})),l(this,Z).observe(this,{attributes:!0}),this.getAttributeNames().forEach(e)},Yt=function(){this.addEventListener("error",l(this,le)),this.media&&(this.media.errorTranslator=(e={})=>{var r,s,d;if(!(((r=this.media)==null?void 0:r.error)instanceof ve))return e;let i=Ie((s=this.media)==null?void 0:s.error,!1);return{player_error_code:(d=this.media)==null?void 0:d.error.code,player_error_message:i.message?String(i.message):e.player_error_message,player_error_context:i.context?String(i.context):e.player_error_context}})},Wt=function(){var e,i,r,s;(i=(e=this.media)==null?void 0:e.textTracks)==null||i.addEventListener("addtrack",l(this,H)),(s=(r=this.media)==null?void 0:r.textTracks)==null||s.addEventListener("removetrack",l(this,H))},Zt=function(){var j,z;if(!/Firefox/i.test(navigator.userAgent))return;let i,r=new WeakMap,s=()=>this.streamType===L.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,d=(A,T,x=!1)=>{if(s())return;Array.from(A&&A.activeCues||[]).forEach(g=>{if(!(!g.snapToLines||g.line<-5||g.line>=0&&g.line<10))if(!T||this.paused){let ue=g.text.split(`
|
|
1377
|
-
`).length,X=-3;this.streamType===L.LIVE&&(X=-2);let q=X-
|
|
1375
|
+
`}return wi(t)};function Di(t){var e,a;let i=t.theme;if(i){let r=(a=(e=t.getRootNode())==null?void 0:e.getElementById)==null?void 0:a.call(e,i);if(r&&r instanceof HTMLTemplateElement)return r;i.startsWith("media-theme-")||(i=`media-theme-${i}`);let o=_.customElements.get(i);if(o!=null&&o.template)return o.template}}function Ui(t){var e;let i=(e=t.mediaController)==null?void 0:e.querySelector("media-time-display");return i&&getComputedStyle(i).getPropertyValue("--media-duration-display-display").trim()==="none"}function re(t){let i=t.videoTitle?{video_title:t.videoTitle}:{};return t.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,a)=>{let r=t.getAttribute(a);return r!==null&&(e[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),e},i)}var Bi=Object.values(s),Ki=Object.values(N),Vi=Object.values(n),$t=ye(),Ft="mux-player",Yt={isDialogOpen:!1},Hi={redundant_streams:!0},ne,G,oe,U,se,j,de,le,F,ue,me,ce,z,Y,pe,m,I,Zt,Ye,$,Gt,jt,zt,Xt,Fe=class extends Pe{constructor(){super();b(this,m);b(this,ne);b(this,G,!1);b(this,oe,{});b(this,U,!0);b(this,se,new fe(this,"hotkeys"));b(this,j);b(this,de,()=>h(this,m,$).call(this));b(this,le,()=>h(this,m,$).call(this));b(this,F,()=>h(this,m,$).call(this));b(this,ue,e=>{e.composedPath().find(r=>{var o;return(o=r==null?void 0:r.hasAttribute)==null?void 0:o.call(r,"data-mux-reload")})&&(e.preventDefault(),window.location.reload())});b(this,me,e=>{var r;((r=e.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&h(this,m,Ye).call(this,{isDialogOpen:!1})});b(this,ce,e=>{var o;if(((o=e.composedPath()[0])==null?void 0:o.localName)!=="media-error-dialog")return;Me(this,B.activeElement)||e.preventDefault()});b(this,z);b(this,Y,{...Yt});b(this,pe,e=>{var o;let a=(o=this.media)==null?void 0:o.error;if(!(a instanceof _e)){let{message:d,code:u}=a!=null?a:{};a=new _e(d,u)}if(!(a!=null&&a.fatal)){O(a),a.data&&O(`${a.name} data:`,a.data);return}let r=Ue(a,!1);r.message&&Ne(r),A(a),a.data&&A(`${a.name} data:`,a.data),h(this,m,Ye).call(this,{isDialogOpen:!0})});E(this,ne,Ni()),this.attachShadow({mode:"open"}),h(this,m,Zt).call(this),this.isConnected&&h(this,m,I).call(this)}static get NAME(){return Ft}static get VERSION(){return $t}static get observedAttributes(){var e;return[...(e=Pe.observedAttributes)!=null?e:[],...Ki,...Bi,...Vi]}setAttribute(e,a){super.setAttribute(e,a),e.startsWith("metadata-")&&this.media&&(this.media.metadata=re(this))}removeAttribute(e){super.removeAttribute(e),e.startsWith("metadata-")&&this.media&&(this.media.metadata=re(this))}get mediaTheme(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("media-theme")}get mediaController(){var e,a;return(a=(e=this.mediaTheme)==null?void 0:e.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){h(this,m,I).call(this);let e=this.media;e&&(e.metadata=re(this))}disconnectedCallback(){var e,a,r,o,d,u,p,R,P,w;(e=l(this,j))==null||e.disconnect(),(a=this.media)==null||a.removeEventListener("streamtypechange",l(this,de)),(r=this.media)==null||r.removeEventListener("loadstart",l(this,le)),this.removeEventListener("error",l(this,pe)),this.removeEventListener("click",l(this,ue)),(o=this.mediaTheme)==null||o.removeEventListener("close",l(this,me)),(d=this.mediaTheme)==null||d.removeEventListener("focusin",l(this,ce)),this.media&&(this.media.errorTranslator=void 0),(p=(u=this.media)==null?void 0:u.textTracks)==null||p.removeEventListener("addtrack",l(this,F)),(P=(R=this.media)==null?void 0:R.textTracks)==null||P.removeEventListener("removetrack",l(this,F)),(w=l(this,z))==null||w.call(this),E(this,z,void 0),E(this,G,!1)}attributeChangedCallback(e,a,r){switch(h(this,m,I).call(this),super.attributeChangedCallback(e,a,r),e){case n.HOTKEYS:l(this,se).value=r;break;case n.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&O(H("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case n.THUMBNAIL_TOKEN:{if(r){let d=Ve(r);if(d){let{aud:u}=d,p=He.THUMBNAIL;u!==p&&O(H("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:u,expectedAud:p,tokenNamePrefix:"thumbnail"}))}}break}case n.STORYBOARD_TOKEN:{if(r){let d=Ve(r);if(d){let{aud:u}=d,p=He.STORYBOARD;u!==p&&O(H("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:u,expectedAud:p,tokenNamePrefix:"storyboard"}))}}break}case n.DRM_TOKEN:{if(r){let d=Ve(r);if(d){let{aud:u}=d,p=He.DRM;u!==p&&O(H("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:u,expectedAud:p,tokenNamePrefix:"drm"}))}}break}case s.PLAYBACK_ID:{r!=null&&r.includes("?token")&&A(H("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case s.STREAM_TYPE:{r&&![L.LIVE,L.ON_DEMAND,L.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Ne({file:"invalid-stream-type.md",message:H("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===L.LIVE?this.getAttribute(n.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case n.FULLSCREEN_ELEMENT:{if(r!=null||r!==a){let d=B.getElementById(r),u=d==null?void 0:d.querySelector("mux-player");this.mediaController&&d&&u&&(this.mediaController.fullscreenElement=d)}break}case s.CAP_RENDITION_TO_PLAYER_SIZE:{(r==null||r!==a)&&(this.capRenditionToPlayerSize=r!=null?!0:void 0);break}case s.MAX_RECONNECT_RETRIES:{(r==null||r!==a)&&(this.maxReconnectRetries=Number(r));break}}[s.PLAYBACK_ID,N.SRC,n.PLAYBACK_TOKEN].includes(e)&&a!==r&&E(this,Y,{...l(this,Y),...Yt}),h(this,m,$).call(this,{[At(e)]:r})}async requestFullscreen(e){var a;if(!(!this.mediaController||this.mediaController.hasAttribute(Ce.MEDIA_IS_FULLSCREEN)))return(a=this.mediaController)==null||a.dispatchEvent(new _.CustomEvent(Vt.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,o)=>{var d;(d=this.mediaController)==null||d.addEventListener(Kt.MEDIA_IS_FULLSCREEN,()=>r(),{once:!0})})}async exitFullscreen(){var e;if(!(!this.mediaController||!this.mediaController.hasAttribute(Ce.MEDIA_IS_FULLSCREEN)))return(e=this.mediaController)==null||e.dispatchEvent(new _.CustomEvent(Vt.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((a,r)=>{var o;(o=this.mediaController)==null||o.addEventListener(Kt.MEDIA_IS_FULLSCREEN,()=>a(),{once:!0})})}get preferCmcd(){var e;return(e=this.getAttribute(s.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?Ht.includes(e)?this.setAttribute(s.PREFER_CMCD,e):O(`Invalid value for preferCmcd. Must be one of ${Ht.join()}`):this.removeAttribute(s.PREFER_CMCD))}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute(Ce.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var e;return(e=this.mediaController)==null?void 0:e.hasAttribute(Ce.MEDIA_TIME_IS_LIVE)}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get theme(){var e;return(e=this.getAttribute(n.THEME))!=null?e:Ii}set theme(e){this.setAttribute(n.THEME,`${e}`)}get themeProps(){let e=this.mediaTheme;if(!e)return;let a={};for(let r of e.getAttributeNames()){if($e.includes(r))continue;let o=e.getAttribute(r);a[ge(r)]=o===""?!0:o}return a}set themeProps(e){var r,o;h(this,m,I).call(this);let a={...this.themeProps,...e};for(let d in a){if($e.includes(d))continue;let u=e==null?void 0:e[d];typeof u=="boolean"||u==null?(r=this.mediaTheme)==null||r.toggleAttribute(he(d),!!u):(o=this.mediaTheme)==null||o.setAttribute(he(d),u)}}get playbackId(){var e;return(e=this.getAttribute(s.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(s.PLAYBACK_ID,e):this.removeAttribute(s.PLAYBACK_ID)}get src(){var e,a;return this.playbackId?(e=M(this,N.SRC))!=null?e:void 0:(a=this.getAttribute(N.SRC))!=null?a:void 0}set src(e){e?this.setAttribute(N.SRC,e):this.removeAttribute(N.SRC)}get poster(){var r;let e=this.getAttribute(N.POSTER);if(e!=null)return e;let{tokens:a}=this;if(a.playback&&!a.thumbnail){O("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return Tt(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(e){e||e===""?this.setAttribute(N.POSTER,e):this.removeAttribute(N.POSTER)}get storyboardSrc(){var e;return(e=this.getAttribute(n.STORYBOARD_SRC))!=null?e:void 0}set storyboardSrc(e){e?this.setAttribute(n.STORYBOARD_SRC,e):this.removeAttribute(n.STORYBOARD_SRC)}get storyboard(){let{tokens:e}=this;if(this.storyboardSrc&&!e.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[L.LIVE,L.UNKNOWN].includes(this.streamType)||e.playback&&!e.storyboard))return vt(this.playbackId,{customDomain:this.customDomain,token:e.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(n.AUDIO)}set audio(e){if(!e){this.removeAttribute(n.AUDIO);return}this.setAttribute(n.AUDIO,"")}get hotkeys(){return l(this,se)}get nohotkeys(){return this.hasAttribute(n.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(n.NOHOTKEYS);return}this.setAttribute(n.NOHOTKEYS,"")}get thumbnailTime(){return f(this.getAttribute(n.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(n.THUMBNAIL_TIME,`${e}`)}get videoTitle(){var e,a;return(a=(e=this.getAttribute(n.VIDEO_TITLE))!=null?e:this.getAttribute(n.TITLE))!=null?a:""}set videoTitle(e){e!==this.videoTitle&&(e?this.setAttribute(n.VIDEO_TITLE,e):this.removeAttribute(n.VIDEO_TITLE))}get placeholder(){var e;return(e=M(this,n.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(n.PLACEHOLDER,`${e}`)}get primaryColor(){var a,r;let e=this.getAttribute(n.PRIMARY_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(a=_.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),e))return e}set primaryColor(e){this.setAttribute(n.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var a,r;let e=this.getAttribute(n.SECONDARY_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(a=_.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),e))return e}set secondaryColor(e){this.setAttribute(n.SECONDARY_COLOR,`${e}`)}get accentColor(){var a,r;let e=this.getAttribute(n.ACCENT_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(a=_.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),e))return e}set accentColor(e){this.setAttribute(n.ACCENT_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(n.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(n.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(n.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(n.PLAYBACK_RATES))return this.getAttribute(n.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,a)=>e-a)}set playbackRates(e){if(!e){this.removeAttribute(n.PLAYBACK_RATES);return}this.setAttribute(n.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=f(this.getAttribute(n.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(n.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=f(this.getAttribute(n.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(n.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(n.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(n.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(n.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return f(this.getAttribute(n.DEFAULT_DURATION))}set defaultDuration(e){e==null?this.removeAttribute(n.DEFAULT_DURATION):this.setAttribute(n.DEFAULT_DURATION,`${e}`)}get playerInitTime(){return this.hasAttribute(s.PLAYER_INIT_TIME)?f(this.getAttribute(s.PLAYER_INIT_TIME)):l(this,ne)}set playerInitTime(e){e!=this.playerInitTime&&(e==null?this.removeAttribute(s.PLAYER_INIT_TIME):this.setAttribute(s.PLAYER_INIT_TIME,`${+e}`))}get playerSoftwareName(){var e;return(e=this.getAttribute(s.PLAYER_SOFTWARE_NAME))!=null?e:Ft}get playerSoftwareVersion(){var e;return(e=this.getAttribute(s.PLAYER_SOFTWARE_VERSION))!=null?e:$t}get beaconCollectionDomain(){var e;return(e=this.getAttribute(s.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(s.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(s.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var e;return(e=this.getAttribute(s.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(s.MAX_RESOLUTION,e):this.removeAttribute(s.MAX_RESOLUTION))}get minResolution(){var e;return(e=this.getAttribute(s.MIN_RESOLUTION))!=null?e:void 0}set minResolution(e){e!==this.minResolution&&(e?this.setAttribute(s.MIN_RESOLUTION,e):this.removeAttribute(s.MIN_RESOLUTION))}get maxAutoResolution(){var e;return(e=this.getAttribute(s.MAX_AUTO_RESOLUTION))!=null?e:void 0}set maxAutoResolution(e){e==null?this.removeAttribute(s.MAX_AUTO_RESOLUTION):this.setAttribute(s.MAX_AUTO_RESOLUTION,e)}get renditionOrder(){var e;return(e=this.getAttribute(s.RENDITION_ORDER))!=null?e:void 0}set renditionOrder(e){e!==this.renditionOrder&&(e?this.setAttribute(s.RENDITION_ORDER,e):this.removeAttribute(s.RENDITION_ORDER))}get programStartTime(){return f(this.getAttribute(s.PROGRAM_START_TIME))}set programStartTime(e){e==null?this.removeAttribute(s.PROGRAM_START_TIME):this.setAttribute(s.PROGRAM_START_TIME,`${e}`)}get programEndTime(){return f(this.getAttribute(s.PROGRAM_END_TIME))}set programEndTime(e){e==null?this.removeAttribute(s.PROGRAM_END_TIME):this.setAttribute(s.PROGRAM_END_TIME,`${e}`)}get assetStartTime(){return f(this.getAttribute(s.ASSET_START_TIME))}set assetStartTime(e){e==null?this.removeAttribute(s.ASSET_START_TIME):this.setAttribute(s.ASSET_START_TIME,`${e}`)}get assetEndTime(){return f(this.getAttribute(s.ASSET_END_TIME))}set assetEndTime(e){e==null?this.removeAttribute(s.ASSET_END_TIME):this.setAttribute(s.ASSET_END_TIME,`${e}`)}get extraSourceParams(){return this.hasAttribute(n.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(n.EXTRA_SOURCE_PARAMS)).entries()].reduce((e,[a,r])=>(e[a]=r,e),{}):Hi}set extraSourceParams(e){e==null?this.removeAttribute(n.EXTRA_SOURCE_PARAMS):this.setAttribute(n.EXTRA_SOURCE_PARAMS,new URLSearchParams(e).toString())}get customDomain(){var e;return(e=this.getAttribute(s.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(s.CUSTOM_DOMAIN,e):this.removeAttribute(s.CUSTOM_DOMAIN))}get envKey(){var e;return(e=M(this,s.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(s.ENV_KEY,`${e}`)}get noVolumePref(){return this.hasAttribute(n.NO_VOLUME_PREF)}set noVolumePref(e){e?this.setAttribute(n.NO_VOLUME_PREF,""):this.removeAttribute(n.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(n.NO_MUTED_PREF)}set noMutedPref(e){e?this.setAttribute(n.NO_MUTED_PREF,""):this.removeAttribute(n.NO_MUTED_PREF)}get debug(){return M(this,s.DEBUG)!=null}set debug(e){e?this.setAttribute(s.DEBUG,""):this.removeAttribute(s.DEBUG)}get disableTracking(){return M(this,s.DISABLE_TRACKING)!=null}set disableTracking(e){this.toggleAttribute(s.DISABLE_TRACKING,!!e)}get disableCookies(){return M(this,s.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(s.DISABLE_COOKIES,""):this.removeAttribute(s.DISABLE_COOKIES)}get streamType(){var e,a,r;return(r=(a=this.getAttribute(s.STREAM_TYPE))!=null?a:(e=this.media)==null?void 0:e.streamType)!=null?r:L.UNKNOWN}set streamType(e){this.setAttribute(s.STREAM_TYPE,`${e}`)}get defaultStreamType(){var e,a,r;return(r=(a=this.getAttribute(n.DEFAULT_STREAM_TYPE))!=null?a:(e=this.mediaController)==null?void 0:e.getAttribute(n.DEFAULT_STREAM_TYPE))!=null?r:L.ON_DEMAND}set defaultStreamType(e){e?this.setAttribute(n.DEFAULT_STREAM_TYPE,e):this.removeAttribute(n.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var e,a;return this.hasAttribute(n.TARGET_LIVE_WINDOW)?+this.getAttribute(n.TARGET_LIVE_WINDOW):(a=(e=this.media)==null?void 0:e.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(e){e==this.targetLiveWindow||Number.isNaN(e)&&Number.isNaN(this.targetLiveWindow)||(e==null?this.removeAttribute(n.TARGET_LIVE_WINDOW):this.setAttribute(n.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e;return(e=this.media)==null?void 0:e.liveEdgeStart}get startTime(){return f(M(this,s.START_TIME))}set startTime(e){this.setAttribute(s.START_TIME,`${e}`)}get initialBandwidthEstimateKbps(){return f(M(this,s.INITIAL_BANDWIDTH_ESTIMATE_KBPS))}set initialBandwidthEstimateKbps(e){e==null?this.removeAttribute(s.INITIAL_BANDWIDTH_ESTIMATE_KBPS):this.setAttribute(s.INITIAL_BANDWIDTH_ESTIMATE_KBPS,`${e}`)}get initialEstimateSegments(){return f(M(this,s.INITIAL_ESTIMATE_SEGMENTS))}set initialEstimateSegments(e){e==null?this.removeAttribute(s.INITIAL_ESTIMATE_SEGMENTS):this.setAttribute(s.INITIAL_ESTIMATE_SEGMENTS,`${e}`)}get minPreloadSegments(){return f(M(this,s.MIN_PRELOAD_SEGMENTS))}set minPreloadSegments(e){e==null?this.removeAttribute(s.MIN_PRELOAD_SEGMENTS):this.setAttribute(s.MIN_PRELOAD_SEGMENTS,`${e}`)}get preferPlayback(){let e=this.getAttribute(s.PREFER_PLAYBACK);if(e===ke.MSE||e===ke.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===ke.MSE||e===ke.NATIVE?this.setAttribute(s.PREFER_PLAYBACK,e):this.removeAttribute(s.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(h(this,m,I).call(this),!this.media){A("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...re(this),...e}}get _hlsConfig(){var e;return(e=this.media)==null?void 0:e._hlsConfig}set _hlsConfig(e){if(h(this,m,I).call(this),!this.media){A("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=e}async addCuePoints(e){var a;if(h(this,m,I).call(this),!this.media){A("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(e)}get activeCuePoint(){var e;return(e=this.media)==null?void 0:e.activeCuePoint}get cuePoints(){var e,a;return(a=(e=this.media)==null?void 0:e.cuePoints)!=null?a:[]}addChapters(e){var a;if(h(this,m,I).call(this),!this.media){A("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(e)}get activeChapter(){var e;return(e=this.media)==null?void 0:e.activeChapter}get chapters(){var e,a;return(a=(e=this.media)==null?void 0:e.chapters)!=null?a:[]}getStartDate(){var e;return(e=this.media)==null?void 0:e.getStartDate()}get currentPdt(){var e;return(e=this.media)==null?void 0:e.currentPdt}get tokens(){let e=this.getAttribute(n.PLAYBACK_TOKEN),a=this.getAttribute(n.DRM_TOKEN),r=this.getAttribute(n.THUMBNAIL_TOKEN),o=this.getAttribute(n.STORYBOARD_TOKEN);return{...l(this,oe),...e!=null?{playback:e}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(e){E(this,oe,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(n.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(n.PLAYBACK_TOKEN,`${e}`)}get drmToken(){var e;return(e=this.getAttribute(n.DRM_TOKEN))!=null?e:void 0}set drmToken(e){this.setAttribute(n.DRM_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(n.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(n.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(n.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(n.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,r,o){var u;let d=(u=this.media)==null?void 0:u.nativeEl;if(d)return Mi(d,e,a,r,o)}removeTextTrack(e){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return Si(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}get castReceiver(){var e;return(e=this.getAttribute(n.CAST_RECEIVER))!=null?e:void 0}set castReceiver(e){e!==this.castReceiver&&(e?this.setAttribute(n.CAST_RECEIVER,e):this.removeAttribute(n.CAST_RECEIVER))}get castCustomData(){var e;return(e=this.media)==null?void 0:e.castCustomData}set castCustomData(e){if(!this.media){A("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=e}get noTooltips(){return this.hasAttribute(n.NO_TOOLTIPS)}set noTooltips(e){if(!e){this.removeAttribute(n.NO_TOOLTIPS);return}this.setAttribute(n.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(n.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(e){e?this.setAttribute(n.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(n.PROUDLY_DISPLAY_MUX_BADGE)}get capRenditionToPlayerSize(){var e;return(e=this.media)==null?void 0:e.capRenditionToPlayerSize}set capRenditionToPlayerSize(e){if(!this.media){A("underlying media element missing when trying to set capRenditionToPlayerSize");return}this.media.capRenditionToPlayerSize=e}get maxReconnectRetries(){var e;return(e=this.media)==null?void 0:e.maxReconnectRetries}set maxReconnectRetries(e){if(!this.media){A("underlying media element missing when trying to set maxReconnectRetries");return}this.media.maxReconnectRetries=e}};ne=new WeakMap,G=new WeakMap,oe=new WeakMap,U=new WeakMap,se=new WeakMap,j=new WeakMap,de=new WeakMap,le=new WeakMap,F=new WeakMap,ue=new WeakMap,me=new WeakMap,ce=new WeakMap,z=new WeakMap,Y=new WeakMap,pe=new WeakMap,m=new WeakSet,I=function(){var e,a,r,o;if(!l(this,G)){E(this,G,!0),h(this,m,$).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof _.HTMLElement))throw""}catch{A("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{A("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Li))throw""}catch{A("<media-controller> failed to upgrade!")}h(this,m,Gt).call(this),h(this,m,jt).call(this),h(this,m,zt).call(this),E(this,U,(a=(e=this.mediaController)==null?void 0:e.hasAttribute(Ke.USER_INACTIVE))!=null?a:!0),h(this,m,Xt).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",l(this,de)),(o=this.media)==null||o.addEventListener("loadstart",l(this,le)),this.media&&(this.media.metadata=re(this))}},Zt=function(){var e,a;try{(e=window==null?void 0:window.CSS)==null||e.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Ye=function(e){Object.assign(l(this,Y),e),h(this,m,$).call(this)},$=function(e={}){Lt(St(Pi(this,{...l(this,Y),...e})),this.shadowRoot)},Gt=function(){let e=a=>{var d,u;if(!(a!=null&&a.startsWith("theme-")))return;let r=a.replace(/^theme-/,"");if($e.includes(r))return;let o=this.getAttribute(a);o!=null?(d=this.mediaTheme)==null||d.setAttribute(r,o):(u=this.mediaTheme)==null||u.removeAttribute(r)};E(this,j,new MutationObserver(a=>{for(let{attributeName:r}of a)e(r)})),l(this,j).observe(this,{attributes:!0}),this.getAttributeNames().forEach(e)},jt=function(){var e,a;this.addEventListener("error",l(this,pe)),this.addEventListener("click",l(this,ue)),(e=this.mediaTheme)==null||e.addEventListener("close",l(this,me)),(a=this.mediaTheme)==null||a.addEventListener("focusin",l(this,ce)),this.media&&(this.media.errorTranslator=(r={})=>{var d,u,p;if(!(((d=this.media)==null?void 0:d.error)instanceof _e))return r;let o=Ue((u=this.media)==null?void 0:u.error,!1);return{player_error_code:(p=this.media)==null?void 0:p.error.code,player_error_message:o.message?String(o.message):r.player_error_message,player_error_context:o.context?String(o.context):r.player_error_context}})},zt=function(){var e,a,r,o;(a=(e=this.media)==null?void 0:e.textTracks)==null||a.addEventListener("addtrack",l(this,F)),(o=(r=this.media)==null?void 0:r.textTracks)==null||o.addEventListener("removetrack",l(this,F))},Xt=function(){var P,w;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===L.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,d=(C,v,x=!1)=>{if(o())return;Array.from(C&&C.activeCues||[]).forEach(g=>{if(!(!g.snapToLines||g.line<-5||g.line>=0&&g.line<10))if(!v||this.paused){let be=g.text.split(`
|
|
1376
|
+
`).length,X=-3;this.streamType===L.LIVE&&(X=-2);let q=X-be;if(g.line===q&&!x)return;r.has(g)||r.set(g,g.line),g.line=q}else setTimeout(()=>{g.line=r.get(g)||"auto"},500)})},u=()=>{var C,v;d(a,(v=(C=this.mediaController)==null?void 0:C.hasAttribute(Ke.USER_INACTIVE))!=null?v:!1)},p=()=>{var x,W;let v=Array.from(((W=(x=this.mediaController)==null?void 0:x.media)==null?void 0:W.textTracks)||[]).filter(g=>["subtitles","captions"].includes(g.kind)&&g.mode==="showing")[0];v!==a&&(a==null||a.removeEventListener("cuechange",u)),a=v,a==null||a.addEventListener("cuechange",u),d(a,l(this,U))};p(),(P=this.textTracks)==null||P.addEventListener("change",p),(w=this.textTracks)==null||w.addEventListener("addtrack",p);let R=()=>{var v,x;let C=(x=(v=this.mediaController)==null?void 0:v.hasAttribute(Ke.USER_INACTIVE))!=null?x:!0;l(this,U)!==C&&(E(this,U,C),d(a,l(this,U)))};this.addEventListener("userinactivechange",R),E(this,z,()=>{var C,v;a==null||a.removeEventListener("cuechange",u),(C=this.textTracks)==null||C.removeEventListener("change",p),(v=this.textTracks)==null||v.removeEventListener("addtrack",p),this.removeEventListener("userinactivechange",R)})};function M(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}var Ua=Fe;export{_e as MediaError,Ua as default,Ni as generatePlayerInitTime,M as getVideoAttribute,Ft as playerSoftwareName,$t as playerSoftwareVersion};
|