@mux/mux-player 3.5.3 → 3.5.4-canary.0
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 +81 -80
- package/dist/base.mjs +39 -38
- package/dist/mux-player.js +39 -38
- package/dist/mux-player.mjs +39 -38
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/base.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var Zn=Object.defineProperty;var Rm=Object.getOwnPropertyDescriptor;var xm=Object.getOwnPropertyNames;var Dm=Object.prototype.hasOwnProperty;var Cd=t=>{throw TypeError(t)};var Om=(t,e)=>{for(var i in e)Zn(t,i,{get:e[i],enumerable:!0})},Nm=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of xm(e))!Dm.call(t,r)&&r!==i&&Zn(t,r,{get:()=>e[r],enumerable:!(a=Rm(e,r))||a.enumerable});return t};var Pm=t=>Nm(Zn({},"__esModule",{value:!0}),t);var zn=(t,e,i)=>e.has(t)||Cd("Cannot "+i);var U=(t,e,i)=>(zn(t,e,"read from private field"),i?i.call(t):e.get(t)),he=(t,e,i)=>e.has(t)?Cd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Te=(t,e,i,a)=>(zn(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),X=(t,e,i)=>(zn(t,e,"access private method"),i);var kv={};Om(kv,{MediaError:()=>b.MediaError,default:()=>yv,generatePlayerInitTime:()=>w.generatePlayerInitTime,getVideoAttribute:()=>Ht,playerSoftwareName:()=>od,playerSoftwareVersion:()=>rd});module.exports=Pm(kv);var gi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends gi{}globalThis.DocumentFragment=t}var ka=class extends gi{},Qn=class extends gi{},Um={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(ka)}},Sa,Xn=class{constructor(e,i={}){he(this,Sa);Te(this,Sa,i==null?void 0:i.detail)}get detail(){return U(this,Sa)}initCustomEvent(){}};Sa=new WeakMap;function Hm(t,e){return new ka}var Ld={document:{createElement:Hm},DocumentFragment,customElements:Um,CustomEvent:Xn,EventTarget:gi,HTMLElement:ka,HTMLVideoElement:Qn},wd=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ye=wd?Ld:globalThis,_i=wd?Ld.document:globalThis.document;var p={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},L={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Jn={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_WIDTH:"mediaWidth"},Rd=Object.entries(Jn),n=Rd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Bm={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Ce=Rd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Bm}),Lv=Object.entries(Ce).reduce((t,[e,i])=>{let a=n[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),xd=Object.entries(n).reduce((t,[e,i])=>{let a=Ce[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),pe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},gt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var jn={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ke={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},xe={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Dd={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Od(t){return t==null?void 0:t.map(Wm).join(" ")}function Nd(t){return t==null?void 0:t.split(/\s+/).map(Fm)}function Wm(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function Fm(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function Pd(t){return t==null?void 0:t.map(Vm).join(" ")}function Ud(t){return t==null?void 0:t.split(/\s+/).map(Km)}function Vm(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(o=>o!=null).join(":")}}function Km(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function Hd(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function Ai(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function Wr(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var Fr=t=>new Promise(e=>setTimeout(e,t));var Bd=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Gm=(t,e)=>{let i=t===1?Bd[e].singular:Bd[e].plural;return`${t} ${i}`},$t=t=>{if(!Ai(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,u)=>l&&Gm(l,u)).filter(l=>l).join(", ")}${i?" remaining":""}`};function De(t,e){let i=!1;t<0&&(i=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),o=Math.floor(t/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(o=r=a="0"),o=o>0||l>0?o+":":"",r=((o||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(i?"-":"")+o+r+a}var xv=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}});var $d={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var Wd,es={en:$d},ts=((Wd=globalThis.navigator)==null?void 0:Wd.language)||"en",Fd=t=>{ts=t};var qm=t=>{var e,i,a;let[r]=ts.split("-");return((e=es[ts])==null?void 0:e[t])||((i=es[r])==null?void 0:i[t])||((a=es.en)==null?void 0:a[t])||t},h=(t,e={})=>qm(t).replace(/\{(\w+)\}/g,(i,a)=>a in e?String(e[a]):`{${a}}`);var Vr=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Kr=class extends Vr{},Gr=class extends Kr{constructor(){super(...arguments),this.role=null}},is=class{observe(){}unobserve(){}disconnect(){}},Vd={createElement:function(){return new Ia.HTMLElement},createElementNS:function(){return new Ia.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},Ia={ResizeObserver:is,document:Vd,Node:Kr,Element:Gr,HTMLElement:class extends Gr{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Ia.DocumentFragment}},DocumentFragment:class extends Vr{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(t){return null},setItem(t,e){},removeItem(t){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(t){return{matches:!1,media:t}},DOMParser:class{parseFromString(e,i){return{body:{textContent:e}}}}},Kd=typeof window=="undefined"||typeof window.customElements=="undefined",Gd=Object.keys(Ia).every(t=>t in globalThis),d=Kd&&!Gd?Ia:globalThis,V=Kd&&!Gd?Vd:globalThis.document;var Yd=new WeakMap,as=t=>{let e=Yd.get(t);return e||Yd.set(t,e=new Set),e},qd=new d.ResizeObserver(t=>{for(let e of t)for(let i of as(e.target))i(e)});function st(t,e){as(t).add(e),qd.observe(t)}function lt(t,e){let i=as(t);i.delete(e),i.size||qd.unobserve(t)}function Y(t){let e={};for(let i of t)e[i.name]=i.value;return e}function Z(t){var e;return(e=Yr(t))!=null?e:He(t,"media-controller")}function Yr(t){var e;let{MEDIA_CONTROLLER:i}=L,a=t.getAttribute(i);if(a)return(e=Wt(t))==null?void 0:e.getElementById(a)}var qr=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},Zm=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},Zr=(t,e)=>Zm(t,e)[0],de=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:de(t,e.getRootNode().host),He=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||He(t.getRootNode().host,e)};function Ma(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=Ma(i.shadowRoot))!=null?e:i:null}function Wt(t){var e;let i=(e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t);return i instanceof ShadowRoot||i instanceof Document?i:null}function zr(t,{depth:e=3,checkOpacity:i=!0,checkVisibilityCSS:a=!0}={}){if(t.checkVisibility)return t.checkVisibility({checkOpacity:i,checkVisibilityCSS:a});let r=t;for(;r&&e>0;){let o=getComputedStyle(r);if(i&&o.opacity==="0"||a&&o.visibility==="hidden"||o.display==="none")return!1;r=r.parentElement,e--}return!0}function Zd(t,e,i,a){let r=a.x-i.x,o=a.y-i.y,s=r*r+o*o;if(s===0)return 0;let l=((t-i.x)*r+(e-i.y)*o)/s;return Math.max(0,Math.min(1,l))}function W(t,e){let i=zm(t,a=>a===e);return i||rs(t,e)}function zm(t,e){var i,a;let r;for(r of(i=t.querySelectorAll("style:not([media])"))!=null?i:[]){let o;try{o=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of o!=null?o:[])if(e(s.selectorText))return s}}function rs(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],o=r==null?void 0:r[r.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(a=o.sheet.cssRules)==null?void 0:a[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function R(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function O(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}R(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function k(t,e){return t.hasAttribute(e)}function S(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}k(t,e)!=i&&t.toggleAttribute(e,i)}function I(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function M(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;I(t,e,void 0)!==a&&t.setAttribute(e,a)}var zd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_t=(t,e,i)=>(zd(t,e,"read from private field"),i?i.call(t):e.get(t)),Qm=(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)},Qr=(t,e,i,a)=>(zd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),fe;function Xm(t){return`
|
|
1
|
+
"use strict";var zn=Object.defineProperty;var Rm=Object.getOwnPropertyDescriptor;var xm=Object.getOwnPropertyNames;var Dm=Object.prototype.hasOwnProperty;var Cd=t=>{throw TypeError(t)};var Om=(t,e)=>{for(var i in e)zn(t,i,{get:e[i],enumerable:!0})},Nm=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of xm(e))!Dm.call(t,r)&&r!==i&&zn(t,r,{get:()=>e[r],enumerable:!(a=Rm(e,r))||a.enumerable});return t};var Pm=t=>Nm(zn({},"__esModule",{value:!0}),t);var Qn=(t,e,i)=>e.has(t)||Cd("Cannot "+i);var U=(t,e,i)=>(Qn(t,e,"read from private field"),i?i.call(t):e.get(t)),he=(t,e,i)=>e.has(t)?Cd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Te=(t,e,i,a)=>(Qn(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),X=(t,e,i)=>(Qn(t,e,"access private method"),i);var kv={};Om(kv,{MediaError:()=>b.MediaError,default:()=>yv,generatePlayerInitTime:()=>w.generatePlayerInitTime,getVideoAttribute:()=>Ht,playerSoftwareName:()=>nd,playerSoftwareVersion:()=>od});module.exports=Pm(kv);var gi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends gi{}globalThis.DocumentFragment=t}var Sa=class extends gi{},Xn=class extends gi{},Um={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Sa)}},Ia,Jn=class{constructor(e,i={}){he(this,Ia);Te(this,Ia,i==null?void 0:i.detail)}get detail(){return U(this,Ia)}initCustomEvent(){}};Ia=new WeakMap;function Hm(t,e){return new Sa}var Ld={document:{createElement:Hm},DocumentFragment,customElements:Um,CustomEvent:Jn,EventTarget:gi,HTMLElement:Sa,HTMLVideoElement:Xn},wd=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ye=wd?Ld:globalThis,_i=wd?Ld.document:globalThis.document;var p={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},L={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},jn={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_WIDTH:"mediaWidth"},Rd=Object.entries(jn),n=Rd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Bm={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Ce=Rd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Bm}),Lv=Object.entries(Ce).reduce((t,[e,i])=>{let a=n[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),xd=Object.entries(n).reduce((t,[e,i])=>{let a=Ce[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),pe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},gt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var es={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ke={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},xe={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Dd={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Od(t){return t==null?void 0:t.map(Wm).join(" ")}function Nd(t){return t==null?void 0:t.split(/\s+/).map(Fm)}function Wm(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function Fm(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function Pd(t){return t==null?void 0:t.map(Vm).join(" ")}function Ud(t){return t==null?void 0:t.split(/\s+/).map(Km)}function Vm(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(o=>o!=null).join(":")}}function Km(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function Hd(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function Ai(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function Fr(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var Vr=t=>new Promise(e=>setTimeout(e,t));var Bd=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Gm=(t,e)=>{let i=t===1?Bd[e].singular:Bd[e].plural;return`${t} ${i}`},$t=t=>{if(!Ai(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,u)=>l&&Gm(l,u)).filter(l=>l).join(", ")}${i?" remaining":""}`};function De(t,e){let i=!1;t<0&&(i=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),o=Math.floor(t/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(o=r=a="0"),o=o>0||l>0?o+":":"",r=((o||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(i?"-":"")+o+r+a}var xv=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}});var $d={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var Wd,ts={en:$d},is=((Wd=globalThis.navigator)==null?void 0:Wd.language)||"en",Fd=t=>{is=t};var qm=t=>{var e,i,a;let[r]=is.split("-");return((e=ts[is])==null?void 0:e[t])||((i=ts[r])==null?void 0:i[t])||((a=ts.en)==null?void 0:a[t])||t},h=(t,e={})=>qm(t).replace(/\{(\w+)\}/g,(i,a)=>a in e?String(e[a]):`{${a}}`);var Kr=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Gr=class extends Kr{},Yr=class extends Gr{constructor(){super(...arguments),this.role=null}},as=class{observe(){}unobserve(){}disconnect(){}},Vd={createElement:function(){return new Ma.HTMLElement},createElementNS:function(){return new Ma.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},Ma={ResizeObserver:as,document:Vd,Node:Gr,Element:Yr,HTMLElement:class extends Yr{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Ma.DocumentFragment}},DocumentFragment:class extends Kr{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(t){return null},setItem(t,e){},removeItem(t){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(t){return{matches:!1,media:t}},DOMParser:class{parseFromString(e,i){return{body:{textContent:e}}}}},Kd=typeof window=="undefined"||typeof window.customElements=="undefined",Gd=Object.keys(Ma).every(t=>t in globalThis),d=Kd&&!Gd?Ma:globalThis,V=Kd&&!Gd?Vd:globalThis.document;var Yd=new WeakMap,rs=t=>{let e=Yd.get(t);return e||Yd.set(t,e=new Set),e},qd=new d.ResizeObserver(t=>{for(let e of t)for(let i of rs(e.target))i(e)});function st(t,e){rs(t).add(e),qd.observe(t)}function lt(t,e){let i=rs(t);i.delete(e),i.size||qd.unobserve(t)}function Y(t){let e={};for(let i of t)e[i.name]=i.value;return e}function Z(t){var e;return(e=qr(t))!=null?e:He(t,"media-controller")}function qr(t){var e;let{MEDIA_CONTROLLER:i}=L,a=t.getAttribute(i);if(a)return(e=Wt(t))==null?void 0:e.getElementById(a)}var Zr=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},Zm=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},zr=(t,e)=>Zm(t,e)[0],de=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:de(t,e.getRootNode().host),He=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||He(t.getRootNode().host,e)};function Ca(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=Ca(i.shadowRoot))!=null?e:i:null}function Wt(t){var e;let i=(e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t);return i instanceof ShadowRoot||i instanceof Document?i:null}function Qr(t,{depth:e=3,checkOpacity:i=!0,checkVisibilityCSS:a=!0}={}){if(t.checkVisibility)return t.checkVisibility({checkOpacity:i,checkVisibilityCSS:a});let r=t;for(;r&&e>0;){let o=getComputedStyle(r);if(i&&o.opacity==="0"||a&&o.visibility==="hidden"||o.display==="none")return!1;r=r.parentElement,e--}return!0}function Zd(t,e,i,a){let r=a.x-i.x,o=a.y-i.y,s=r*r+o*o;if(s===0)return 0;let l=((t-i.x)*r+(e-i.y)*o)/s;return Math.max(0,Math.min(1,l))}function W(t,e){let i=zm(t,a=>a===e);return i||os(t,e)}function zm(t,e){var i,a;let r;for(r of(i=t.querySelectorAll("style:not([media])"))!=null?i:[]){let o;try{o=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of o!=null?o:[])if(e(s.selectorText))return s}}function os(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],o=r==null?void 0:r[r.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(a=o.sheet.cssRules)==null?void 0:a[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function R(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function O(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}R(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function k(t,e){return t.hasAttribute(e)}function S(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}k(t,e)!=i&&t.toggleAttribute(e,i)}function I(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function M(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;I(t,e,void 0)!==a&&t.setAttribute(e,a)}var zd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_t=(t,e,i)=>(zd(t,e,"read from private field"),i?i.call(t):e.get(t)),Qm=(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)},Xr=(t,e,i,a)=>(zd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),fe;function Xm(t){return`
|
|
2
2
|
<style>
|
|
3
3
|
:host {
|
|
4
4
|
display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
|
|
5
5
|
box-sizing: border-box;
|
|
6
6
|
}
|
|
7
7
|
</style>
|
|
8
|
-
`}var Ti=class extends d.HTMLElement{constructor(){if(super(),Qm(this,fe,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[L.MEDIA_CONTROLLER,n.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,o,s,l,u;e===L.MEDIA_CONTROLLER&&(i&&((o=(r=_t(this,fe))==null?void 0:r.unassociateElement)==null||o.call(r,this),
|
|
8
|
+
`}var Ti=class extends d.HTMLElement{constructor(){if(super(),Qm(this,fe,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[L.MEDIA_CONTROLLER,n.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,o,s,l,u;e===L.MEDIA_CONTROLLER&&(i&&((o=(r=_t(this,fe))==null?void 0:r.unassociateElement)==null||o.call(r,this),Xr(this,fe,null)),a&&this.isConnected&&(Xr(this,fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=_t(this,fe))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Xr(this,fe,Jm(this)),this.getAttribute(L.MEDIA_CONTROLLER)&&((i=(e=_t(this,fe))==null?void 0:e.associateElement)==null||i.call(e,this)),(a=_t(this,fe))==null||a.addEventListener("pointerdown",this),(r=_t(this,fe))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,i,a,r;this.getAttribute(L.MEDIA_CONTROLLER)&&((i=(e=_t(this,fe))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=_t(this,fe))==null||a.removeEventListener("pointerdown",this),(r=_t(this,fe))==null||r.removeEventListener("click",this),Xr(this,fe,null)}handleEvent(e){var i;let a=(i=e.composedPath())==null?void 0:i[0];if(["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:o,clientY:s}=e,{left:l,top:u,width:m,height:_}=this.getBoundingClientRect(),g=o-l,f=s-u;if(g<0||f<0||g>m||f>_||m===0&&_===0)return;let{pointerType:v=this._pointerType}=e;if(this._pointerType=void 0,v===es.TOUCH){this.handleTap(e);return}else if(v===es.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let i=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(i,{composed:!0,bubbles:!0}))}};fe=new WeakMap;Ti.shadowRootOptions={mode:"open"};Ti.getTemplateHTML=Xm;function Jm(t){var e;let i=t.getAttribute(L.MEDIA_CONTROLLER);return i?(e=t.getRootNode())==null?void 0:e.getElementById(i):He(t,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",Ti);var Jr=Ti;var ds=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ie=(t,e,i)=>(ds(t,e,"read from private field"),i?i.call(t):e.get(t)),Se=(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)},Ft=(t,e,i,a)=>(ds(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Le=(t,e,i)=>(ds(t,e,"access private method"),i),to,yi,wa,ki,jr,ns,Qd,La,eo,ss,Xd,ls,Jd,Ra,io,ao,us,Si,xa,y={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function jm(t){return`
|
|
9
9
|
<style>
|
|
10
10
|
|
|
11
11
|
:host([${n.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
|
|
@@ -142,8 +142,8 @@
|
|
|
142
142
|
<slot name="poster" part="layer poster-layer"></slot>
|
|
143
143
|
<slot name="gestures-chrome" part="layer gesture-layer">
|
|
144
144
|
<media-gesture-receiver slot="gestures-chrome">
|
|
145
|
-
<template shadowrootmode="${
|
|
146
|
-
${
|
|
145
|
+
<template shadowrootmode="${Jr.shadowRootOptions.mode}">
|
|
146
|
+
${Jr.getTemplateHTML({})}
|
|
147
147
|
</template>
|
|
148
148
|
</media-gesture-receiver>
|
|
149
149
|
</slot>
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
<slot part="bottom chrome"></slot>
|
|
156
156
|
</span>
|
|
157
157
|
<slot name="dialog" part="layer dialog-layer"></slot>
|
|
158
|
-
`}var eh=Object.values(n),th="sm:384 md:576 lg:768 xl:960";function ih(t){jd(t.target,t.contentRect.width)}function jd(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(y.BREAKPOINTS))!=null?i:th,r=ah(a),o=rh(r,e),s=!1;if(Object.keys(r).forEach(l=>{if(o.includes(l)){t.hasAttribute(`breakpoint${l}`)||(t.setAttribute(`breakpoint${l}`,""),s=!0);return}t.hasAttribute(`breakpoint${l}`)&&(t.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(Ce.BREAKPOINTS_CHANGE,{detail:o});t.dispatchEvent(l)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(Ce.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function ah(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function rh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var Vt=class extends d.HTMLElement{constructor(){if(super(),Se(this,os),Se(this,ns),Se(this,ss),Se(this,wa),Se(this,io),Se(this,Si),Se(this,eo,0),Se(this,yi,null),Se(this,La,null),Se(this,ki,void 0),this.breakpointsComputed=!1,Se(this,Jr,new MutationObserver(Le(this,os,Qd).bind(this))),Se(this,Ca,!1),Se(this,jr,i=>{Ie(this,Ca)||(setTimeout(()=>{ih(i),Ft(this,Ca,!1)},0),Ft(this,Ca,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let i=Y(this.attributes),a=this.constructor.getTemplateHTML(i);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(a):this.shadowRoot.innerHTML=a}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){Ie(this,yi)&&this.mediaUnsetCallback(Ie(this,yi));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[y.AUTOHIDE,y.GESTURES_DISABLED].concat(eh).filter(e=>![n.MEDIA_RENDITION_LIST,n.MEDIA_AUDIO_TRACK_LIST,n.MEDIA_CHAPTERS_CUES,n.MEDIA_WIDTH,n.MEDIA_HEIGHT,n.MEDIA_ERROR,n.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,i,a){e.toLowerCase()==y.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Ft(this,yi,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Ie(this,Jr).observe(this,{childList:!0,subtree:!0}),st(this,Ie(this,jr));let a=this.getAttribute(y.AUDIO)!=null?h("audio player"):h("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(y.USER_INACTIVE,""),jd(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Ie(this,Jr).disconnect(),lt(this,Ie(this,jr)),this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ft(this,yi,null)}handleEvent(e){switch(e.type){case"pointerdown":Ft(this,eo,e.timeStamp);break;case"pointermove":Le(this,ns,Xd).call(this,e);break;case"pointerup":Le(this,ss,Jd).call(this,e);break;case"mouseleave":Le(this,wa,to).call(this);break;case"mouseup":this.removeAttribute(y.KEYBOARD_CONTROL);break;case"keyup":Le(this,Si,Ra).call(this),this.setAttribute(y.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Ft(this,ki,isNaN(i)?0:i)}get autohide(){return(Ie(this,ki)===void 0?2:Ie(this,ki)).toString()}get breakpoints(){return I(this,y.BREAKPOINTS)}set breakpoints(e){M(this,y.BREAKPOINTS,e)}get audio(){return k(this,y.AUDIO)}set audio(e){S(this,y.AUDIO,e)}get gesturesDisabled(){return k(this,y.GESTURES_DISABLED)}set gesturesDisabled(e){S(this,y.GESTURES_DISABLED,e)}get keyboardControl(){return k(this,y.KEYBOARD_CONTROL)}set keyboardControl(e){S(this,y.KEYBOARD_CONTROL,e)}get noAutohide(){return k(this,y.NO_AUTOHIDE)}set noAutohide(e){S(this,y.NO_AUTOHIDE,e)}get autohideOverControls(){return k(this,y.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){S(this,y.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return k(this,y.USER_INACTIVE)}set userInteractive(e){S(this,y.USER_INACTIVE,e)}};eo=new WeakMap;yi=new WeakMap;La=new WeakMap;ki=new WeakMap;Jr=new WeakMap;os=new WeakSet;Qd=function(t){let e=this.media;for(let i of t){if(i.type!=="childList")continue;let a=i.removedNodes;for(let r of a){if(r.slot!="media"||i.target!=this)continue;let o=i.previousSibling&&i.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(r);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(r)}}if(e)for(let r of i.addedNodes)r===e&&this.handleMediaUpdated(e)}};Ca=new WeakMap;jr=new WeakMap;ns=new WeakSet;Xd=function(t){if(t.pointerType!=="mouse"&&t.timeStamp-Ie(this,eo)<250)return;Le(this,io,ds).call(this),clearTimeout(Ie(this,La));let e=this.hasAttribute(y.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(t.target)||e)&&Le(this,Si,Ra).call(this)};ss=new WeakSet;Jd=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(y.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Le(this,wa,to).call(this):Le(this,Si,Ra).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Le(this,Si,Ra).call(this)};wa=new WeakSet;to=function(){if(Ie(this,ki)<0||this.hasAttribute(y.USER_INACTIVE))return;this.setAttribute(y.USER_INACTIVE,"");let t=new d.CustomEvent(Ce.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};io=new WeakSet;ds=function(){if(!this.hasAttribute(y.USER_INACTIVE))return;this.removeAttribute(y.USER_INACTIVE);let t=new d.CustomEvent(Ce.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};Si=new WeakSet;Ra=function(){Le(this,io,ds).call(this),clearTimeout(Ie(this,La));let t=parseInt(this.autohide);t<0||Ft(this,La,setTimeout(()=>{Le(this,wa,to).call(this)},t*1e3))};Vt.shadowRootOptions={mode:"open"};Vt.getTemplateHTML=jm;d.customElements.get("media-container")||d.customElements.define("media-container",Vt);var eu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ie=(t,e,i)=>(eu(t,e,"read from private field"),i?i.call(t):e.get(t)),xa=(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)},ao=(t,e,i,a)=>(eu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ii,Mi,ro,Kt,dt,At,Tt=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){xa(this,dt),xa(this,Ii,void 0),xa(this,Mi,void 0),xa(this,ro,void 0),xa(this,Kt,new Set),ao(this,Ii,e),ao(this,Mi,i),ao(this,ro,new Set(a))}[Symbol.iterator](){return ie(this,dt,At).values()}get length(){return ie(this,dt,At).size}get value(){var e;return(e=[...ie(this,dt,At)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ao(this,Kt,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...ie(this,dt,At)][e]}values(){return ie(this,dt,At).values()}forEach(e,i){ie(this,dt,At).forEach(e,i)}add(...e){var i,a;e.forEach(r=>ie(this,Kt).add(r)),!(this.value===""&&!((i=ie(this,Ii))!=null&&i.hasAttribute(`${ie(this,Mi)}`)))&&((a=ie(this,Ii))==null||a.setAttribute(`${ie(this,Mi)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>ie(this,Kt).delete(a)),(i=ie(this,Ii))==null||i.setAttribute(`${ie(this,Mi)}`,`${this.value}`)}contains(e){return ie(this,dt,At).has(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){return this.remove(e),this.add(i),e===i}};Ii=new WeakMap;Mi=new WeakMap;ro=new WeakMap;Kt=new WeakMap;dt=new WeakSet;At=function(){return ie(this,Kt).size?ie(this,Kt):ie(this,ro)};var oh=(t="")=>t.split(/\s+/),tu=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?pe.CAPTIONS:pe.SUBTITLES,language:i,label:r}},Gt=(t="",e={})=>oh(t).map(i=>{let a=tu(i);return{...e,...a}}),us=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?tu(e):e):typeof t=="string"?Gt(t):[t]:[],oo=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,ut=(t=[])=>Array.prototype.map.call(t,oo).join(" "),nh=(t,e)=>i=>i[t]===e,iu=t=>{let e=Object.entries(t).map(([i,a])=>nh(i,a));return i=>e.every(a=>a(i))},Yt=(t,e=[],i=[])=>{let a=us(i).map(iu),r=o=>a.some(s=>s(o));Array.from(e).filter(r).forEach(o=>{o.mode=t})},qt=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:iu(e);return Array.from(t.textTracks).filter(i)},no=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(n.MEDIA_SUBTITLES_SHOWING)};var ru=t=>{var e;let{media:i,fullscreenElement:a}=t;try{let r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let o=(e=a[r])==null?void 0:e.call(a);if(o instanceof Promise)return o.catch(()=>{})}else i!=null&&i.webkitEnterFullscreen?i.webkitEnterFullscreen():i!=null&&i.requestFullscreen&&i.requestFullscreen()}catch(r){console.error(r)}},au="exitFullscreen"in V?"exitFullscreen":"webkitExitFullscreen"in V?"webkitExitFullscreen":"webkitCancelFullScreen"in V?"webkitCancelFullScreen":void 0,ou=t=>{var e;let{documentElement:i}=t;if(au){let a=(e=i==null?void 0:i[au])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},Da="fullscreenElement"in V?"fullscreenElement":"webkitFullscreenElement"in V?"webkitFullscreenElement":void 0,sh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[Da];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===Dd.FULLSCREEN?i:a},nu=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let o=sh(t);if(!o)return!1;if(o===r||o===i)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(Da in s))return de(o,r);for(;s!=null&&s[Da];){if(s[Da]===r)return!0;s=(e=s[Da])==null?void 0:e.shadowRoot}}return!1},lh="fullscreenEnabled"in V?"fullscreenEnabled":"webkitFullscreenEnabled"in V?"webkitFullscreenEnabled":void 0,su=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[lh])||i&&"webkitSupportsFullscreen"in i};var so,cs=()=>{var t,e;return so||(so=(e=(t=V)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),so)},lu=async(t=cs())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([dh(t,i.signal),uh(t,e)]);return i.abort(),a},dh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),uh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await Fr(10)}return t.volume!==e},ch=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),ms=(t=cs())=>d.matchMedia("(display-mode: standalone)").matches&&ch?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",hs=(t=cs())=>su({documentElement:V,media:t}),du=hs(),uu=ms(),cu=!!d.WebKitPlaybackTargetAvailabilityEvent,mu=!!d.chrome;var Ci=t=>qt(t.media,e=>[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),ps=t=>qt(t.media,e=>e.mode===gt.SHOWING&&[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)),lo=(t,e)=>{let i=Ci(t),a=ps(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)Yt(gt.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let o=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let _=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=_?[_,...globalThis.navigator.languages]:globalThis.navigator.languages,f=i.filter(v=>g.some(N=>v.language.toLowerCase().startsWith(N.split("-")[0]))).sort((v,N)=>{let T=g.findIndex(P=>v.language.toLowerCase().startsWith(P.split("-")[0])),C=g.findIndex(P=>N.language.toLowerCase().startsWith(P.split("-")[0]));return T-C});f[0]&&(o=f[0])}let{language:l,label:u,kind:m}=o;Yt(gt.DISABLED,i,a),Yt(gt.SHOWING,i,[{language:l,label:u,kind:m}])}}},uo=(t,e)=>t===e?!0:t==null||e==null||typeof t!=typeof e?!1:typeof t=="number"&&Number.isNaN(t)&&Number.isNaN(e)?!0:typeof t!="object"?!1:Array.isArray(t)?mh(t,e):Object.entries(t).every(([i,a])=>i in e&&uo(a,e[i])),mh=(t,e)=>{let i=Array.isArray(t),a=Array.isArray(e);return i!==a?!1:i||a?t.length!==e.length?!1:t.every((r,o)=>uo(r,e[o])):!0};var hh=Object.values(xe),co,ph=lu().then(t=>(co=t,co)),hu=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=d.customElements.get(i);a&&e instanceof a||(await d.customElements.whenDefined(i),d.customElements.upgrade(e))}))},fh=new d.DOMParser,vh=t=>t&&(fh.parseFromString(t,"text/html").body.textContent||t),Li={mediaError:{get(t,e){let{media:i}=t;if((e==null?void 0:e.type)!=="playing")return i==null?void 0:i.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(t,e){var i;let{media:a}=t;if((e==null?void 0:e.type)!=="playing")return(i=a==null?void 0:a.error)==null?void 0:i.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(t,e){var i,a;let{media:r}=t;if((e==null?void 0:e.type)!=="playing")return(a=(i=r==null?void 0:r.error)==null?void 0:i.message)!=null?a:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.paused)!=null?e:!0},set(t,e){var i;let{media:a}=e;a&&(t?a.pause():(i=a.play())==null||i.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(t,e){let{media:i}=t;return i?e?e.type==="playing":!i.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.playbackRate)!=null?e:1},set(t,e){let{media:i}=e;i&&Number.isFinite(+t)&&(i.playbackRate=+t)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.muted)!=null?e:!1},set(t,e){let{media:i}=e;if(i){try{d.localStorage.setItem("media-chrome-pref-muted",t?"true":"false")}catch(a){console.debug("Error setting muted pref",a)}i.muted=t}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noMutedPref:i}}=e,{media:a}=e;if(!(!a||a.muted||i))try{let r=d.localStorage.getItem("media-chrome-pref-muted")==="true";Li.mediaMuted.set(r,e),t(r)}catch(r){console.debug("Error getting muted pref",r)}}]},mediaVolume:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.volume)!=null?e:1},set(t,e){let{media:i}=e;if(i){try{t==null?d.localStorage.removeItem("media-chrome-pref-volume"):d.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch(a){console.debug("Error setting volume pref",a)}Number.isFinite(+t)&&(i.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noVolumePref:i}}=e;if(!i)try{let{media:a}=e;if(!a)return;let r=d.localStorage.getItem("media-chrome-pref-volume");if(r==null)return;Li.mediaVolume.set(+r,e),t(+r)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(t){let{media:e}=t;return typeof(e==null?void 0:e.volume)=="undefined"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.currentTime)!=null?e:0},set(t,e){let{media:i}=e;!i||!Ai(t)||(i.currentTime=t)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(t){let{media:e,options:{defaultDuration:i}={}}=t;return i&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?i:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(t){let{media:e}=t;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(t){var e;let{media:i}=t;if(!((e=i==null?void 0:i.seekable)!=null&&e.length))return;let a=i.seekable.start(0),r=i.seekable.end(i.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(t){var e;let{media:i}=t,a=(e=i==null?void 0:i.buffered)!=null?e:[];return Array.from(a).map((r,o)=>[Number(a.start(o).toFixed(3)),Number(a.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(t){let{media:e,options:{defaultStreamType:i}={}}=t,a=[xe.LIVE,xe.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(hh.includes(r))return r===xe.UNKNOWN?a:r;let o=e.duration;return o===1/0?xe.LIVE:Number.isFinite(o)?xe.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(t){let{media:e}=t;if(!e)return Number.NaN;let{targetLiveWindow:i}=e,a=Li.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===xe.LIVE?0:i},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(t){let{media:e,options:{liveEdgeOffset:i=10}={}}=t;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Li.mediaStreamType.get(t)===xe.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let o=r.end(r.length-1)-i;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(t){return Ci(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return ps(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i,a;let{media:r,options:o}=e;if(!r)return;let s=l=>{var u;!o.defaultSubtitles||l&&![pe.CAPTIONS,pe.SUBTITLES].includes((u=l==null?void 0:l.track)==null?void 0:u.kind)||lo(e,!0)};return r.addEventListener("loadstart",s),(i=r.textTracks)==null||i.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),()=>{var l,u;r.removeEventListener("loadstart",s),(l=r.textTracks)==null||l.removeEventListener("addtrack",s),(u=r.textTracks)==null||u.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(t){var e;let{media:i}=t;if(!i)return[];let[a]=qt(i,{kind:pe.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:o,endTime:s})=>({text:vh(r),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;if(!a)return;let r=a.querySelector('track[kind="chapters"][default][src]'),o=(i=a.shadowRoot)==null?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",t),o==null||o.addEventListener("load",t),()=>{r==null||r.removeEventListener("load",t),o==null||o.removeEventListener("load",t)}}]},mediaIsPip:{get(t){var e,i;let{media:a,documentElement:r}=t;if(!a||!r||!r.pictureInPictureElement)return!1;if(r.pictureInPictureElement===a)return!0;if(r.pictureInPictureElement instanceof HTMLMediaElement)return(e=a.localName)!=null&&e.includes("-")?de(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let o=r.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===a)return!0;o=(i=o.pictureInPictureElement)==null?void 0:i.shadowRoot}}return!1},set(t,e){let{media:i}=e;if(i)if(t){if(!V.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(r=>{if(r.code===11){if(!i.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(i.readyState===0&&i.preload==="none"){let o=()=>{i.removeEventListener("loadedmetadata",s),i.preload="none"},s=()=>{i.requestPictureInPicture().catch(a),o()};i.addEventListener("loadedmetadata",s),i.preload="metadata",setTimeout(()=>{i.readyState===0&&a(),o()},1e3)}else throw r}else throw r})}else V.pictureInPictureElement&&V.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(t){var e,i,a;let{media:r}=t;return(a=(i=r==null?void 0:r.videoRenditions)==null?void 0:i[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=t,r=Array.prototype.findIndex.call(i.videoRenditions,o=>o.id==a);i.videoRenditions.selectedIndex!=r&&(i.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(t){var e,i;let{media:a}=t;return(i=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:i.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=t;for(let r of i.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(t){return nu(t)},set(t,e){t?ru(e):ou(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(t){var e;let{media:i}=t;return!(i!=null&&i.remote)||((e=i.remote)==null?void 0:e.state)==="disconnected"?!1:!!i.remote.state},set(t,e){var i,a;let{media:r}=e;if(r&&!(t&&((i=r.remote)==null?void 0:i.state)!=="disconnected")&&!(!t&&((a=r.remote)==null?void 0:a.state)!=="connected")){if(typeof r.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}r.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(t,e){let{media:i}=e;if(i){if(!(i.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(t){let{media:e}=t;if(!du||!hs(e))return ke.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!uu||!ms(e))return ke.UNSUPPORTED}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(co===!1||(e==null?void 0:e.volume)==null)return ke.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{co==null&&ph.then(e=>t(e?void 0:ke.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!mu||!((i=a==null?void 0:a.remote)!=null&&i.state))return ke.UNSUPPORTED;if(!(e==null||e==="available"))return ke.UNAVAILABLE},stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(t,e){if(!cu)return ke.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return ke.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(t){var e;let{media:i}=t;if(!(i!=null&&i.videoRenditions))return ke.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return ke.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return ke.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return ke.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}};var pu={[p.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,o;let{media:s}=e,l=i!=null?i:void 0,u,m;if(s&&l!=null){let[v]=qt(s,{kind:pe.METADATA,label:"thumbnails"}),N=Array.prototype.find.call((a=v==null?void 0:v.cues)!=null?a:[],(T,C,P)=>C===0?T.endTime>l:C===P.length-1?T.startTime<=l:T.startTime<=l&&T.endTime>l);if(N){let T=/'^(?:[a-z]+:)?\/\//i.test(N.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,C=new URL(N.text,T);m=new URLSearchParams(C.hash).get("#xywh").split(",").map(j=>+j),u=C.href}}let _=t.mediaDuration.get(e),f=(o=t.mediaChaptersCues.get(e).find((v,N,T)=>N===T.length-1&&_===v.endTime?v.startTime<=l&&v.endTime>=l:v.startTime<=l&&v.endTime>l))==null?void 0:o.text;return i!=null&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:u,mediaPreviewCoords:m,mediaPreviewChapter:f}},[p.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[p.MEDIA_PLAY_REQUEST](t,e){var i,a,r,o;let s="mediaPaused",u=t.mediaStreamType.get(e)===xe.LIVE,m=!((i=e.options)!=null&&i.noAutoSeekToLive),_=t.mediaTargetLiveWindow.get(e)>0;if(u&&m&&!_){let g=(a=t.mediaSeekable.get(e))==null?void 0:a[1];if(g){let f=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,v=g-f;t.mediaCurrentTime.set(v,e)}}t[s].set(!1,e)},[p.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[p.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[p.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[p.MEDIA_VOLUME_REQUEST](t,e,{detail:i}){let a="mediaVolume",r=i;r&&t.mediaMuted.get(e)&&t.mediaMuted.set(!1,e),t[a].set(r,e)},[p.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[p.MEDIA_SEEK_TO_LIVE_REQUEST](t,e){var i,a,r;let o="mediaCurrentTime",s=(i=t.mediaSeekable.get(e))==null?void 0:i[1];if(Number.isNaN(Number(s)))return;let l=(r=(a=e.options)==null?void 0:a.seekToLiveOffset)!=null?r:0,u=s-l;t[o].set(u,e)},[p.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,o=Ci(e),s=us(i),l=(a=s[0])==null?void 0:a.language;l&&!r.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Yt(gt.SHOWING,o,s)},[p.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=Ci(e),r=i!=null?i:[];Yt(gt.DISABLED,a,r)},[p.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){lo(e,i)},[p.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[p.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[p.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[p.MEDIA_ENTER_FULLSCREEN_REQUEST](t,e){let i="mediaIsFullscreen";t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[p.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[p.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var fu=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Li,requestMap:r=pu,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],u={options:{...o}},m=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),_=T=>{T!=null&&(uo(T,m)||(m=Object.freeze({...m,...T}),l.forEach(C=>C(m))))},g=()=>{let T=Object.entries(a).reduce((C,[P,{get:j}])=>(C[P]=j(u),C),{});_(T)},f={},v,N=async(T,C)=>{var P,j,ge,bt,ot,ca,ma,ha,pa,fa,va,Ea,ba,ga,_a,Aa;let $r=!!v;if(v={...u,...v!=null?v:{},...T},$r)return;await hu(...Object.values(T));let nt=l.length>0&&C===0&&s,Ta=u.media!==v.media,ld=((P=u.media)==null?void 0:P.textTracks)!==((j=v.media)==null?void 0:j.textTracks),dd=((ge=u.media)==null?void 0:ge.videoRenditions)!==((bt=v.media)==null?void 0:bt.videoRenditions),ud=((ot=u.media)==null?void 0:ot.audioTracks)!==((ca=v.media)==null?void 0:ca.audioTracks),cd=((ma=u.media)==null?void 0:ma.remote)!==((ha=v.media)==null?void 0:ha.remote),md=u.documentElement!==v.documentElement,hd=!!u.media&&(Ta||nt),pd=!!((pa=u.media)!=null&&pa.textTracks)&&(ld||nt),fd=!!((fa=u.media)!=null&&fa.videoRenditions)&&(dd||nt),vd=!!((va=u.media)!=null&&va.audioTracks)&&(ud||nt),Ed=!!((Ea=u.media)!=null&&Ea.remote)&&(cd||nt),bd=!!u.documentElement&&(md||nt),gd=hd||pd||fd||vd||Ed||bd,bi=l.length===0&&C===1&&s,_d=!!v.media&&(Ta||bi),Ad=!!((ba=v.media)!=null&&ba.textTracks)&&(ld||bi),Td=!!((ga=v.media)!=null&&ga.videoRenditions)&&(dd||bi),yd=!!((_a=v.media)!=null&&_a.audioTracks)&&(ud||bi),kd=!!((Aa=v.media)!=null&&Aa.remote)&&(cd||bi),Sd=!!v.documentElement&&(md||bi),Id=_d||Ad||Td||yd||kd||Sd;if(!(gd||Id)){Object.entries(v).forEach(([F,ya])=>{u[F]=ya}),g(),v=void 0;return}Object.entries(a).forEach(([F,{get:ya,mediaEvents:km=[],textTracksEvents:Sm=[],videoRenditionsEvents:Im=[],audioTracksEvents:Mm=[],remoteEvents:Cm=[],rootEvents:Lm=[],stateOwnersUpdateHandlers:wm=[]}])=>{f[F]||(f[F]={});let _e=Q=>{let Ae=ya(u,Q);_({[F]:Ae})},te;te=f[F].mediaEvents,km.forEach(Q=>{te&&hd&&(u.media.removeEventListener(Q,te),f[F].mediaEvents=void 0),_d&&(v.media.addEventListener(Q,_e),f[F].mediaEvents=_e)}),te=f[F].textTracksEvents,Sm.forEach(Q=>{var Ae,Re;te&&pd&&((Ae=u.media.textTracks)==null||Ae.removeEventListener(Q,te),f[F].textTracksEvents=void 0),Ad&&((Re=v.media.textTracks)==null||Re.addEventListener(Q,_e),f[F].textTracksEvents=_e)}),te=f[F].videoRenditionsEvents,Im.forEach(Q=>{var Ae,Re;te&&fd&&((Ae=u.media.videoRenditions)==null||Ae.removeEventListener(Q,te),f[F].videoRenditionsEvents=void 0),Td&&((Re=v.media.videoRenditions)==null||Re.addEventListener(Q,_e),f[F].videoRenditionsEvents=_e)}),te=f[F].audioTracksEvents,Mm.forEach(Q=>{var Ae,Re;te&&vd&&((Ae=u.media.audioTracks)==null||Ae.removeEventListener(Q,te),f[F].audioTracksEvents=void 0),yd&&((Re=v.media.audioTracks)==null||Re.addEventListener(Q,_e),f[F].audioTracksEvents=_e)}),te=f[F].remoteEvents,Cm.forEach(Q=>{var Ae,Re;te&&Ed&&((Ae=u.media.remote)==null||Ae.removeEventListener(Q,te),f[F].remoteEvents=void 0),kd&&((Re=v.media.remote)==null||Re.addEventListener(Q,_e),f[F].remoteEvents=_e)}),te=f[F].rootEvents,Lm.forEach(Q=>{te&&bd&&(u.documentElement.removeEventListener(Q,te),f[F].rootEvents=void 0),Sd&&(v.documentElement.addEventListener(Q,_e),f[F].rootEvents=_e)});let Md=f[F].stateOwnersUpdateHandlers;wm.forEach(Q=>{Md&&gd&&Md(),Id&&(f[F].stateOwnersUpdateHandlers=Q(_e,v))})}),Object.entries(v).forEach(([F,ya])=>{u[F]=ya}),g(),v=void 0};return N({media:t,fullscreenElement:e,documentElement:i,options:o}),{dispatch(T){let{type:C,detail:P}=T;if(r[C]&&m.mediaErrorCode==null){_(r[C](a,u,T));return}C==="mediaelementchangerequest"?N({media:P}):C==="fullscreenelementchangerequest"?N({fullscreenElement:P}):C==="documentelementchangerequest"?N({documentElement:P}):C==="optionschangerequest"&&Object.entries(P!=null?P:{}).forEach(([j,ge])=>{u.options[j]=ge})},getState(){return m},subscribe(T){return N({},l.length+1),l.push(T),T(m),()=>{let C=l.indexOf(T);C>=0&&(N({},l.length-1),l.splice(C,1))}}}};var bs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},D=(t,e,i)=>(bs(t,e,"read from private field"),i?i.call(t):e.get(t)),ct=(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)},yt=(t,e,i,a)=>(bs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),kt=(t,e,i)=>(bs(t,e,"access private method"),i),zt,Oa,K,Na,Be,mo,ho,fs,wi,Pa,po,vs,_u=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],vu=10,E={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",SEEK_TO_LIVE_OFFSET:"seektoliveoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys",NO_VOLUME_PREF:"novolumepref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_DEFAULT_STORE:"nodefaultstore",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",LANG:"lang"},fo=class extends Vt{constructor(){super(),ct(this,ho),ct(this,wi),ct(this,po),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,ct(this,zt,new Tt(this,E.HOTKEYS)),ct(this,Oa,void 0),ct(this,K,void 0),ct(this,Na,void 0),ct(this,Be,void 0),ct(this,mo,i=>{var a;(a=D(this,K))==null||a.dispatch(i)}),this.associateElement(this);let e={};yt(this,Na,i=>{Object.entries(i).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let o=a.toLowerCase(),s=new d.CustomEvent(xd[o],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(E.NO_HOTKEYS,E.HOTKEYS,E.DEFAULT_STREAM_TYPE,E.DEFAULT_SUBTITLES,E.DEFAULT_DURATION,E.LANG)}get mediaStore(){return D(this,K)}set mediaStore(e){var i,a;if(D(this,K)&&((i=D(this,Be))==null||i.call(this),yt(this,Be,void 0)),yt(this,K,e),!D(this,K)&&!this.hasAttribute(E.NO_DEFAULT_STORE)){kt(this,ho,fs).call(this);return}yt(this,Be,(a=D(this,K))==null?void 0:a.subscribe(D(this,Na)))}get fullscreenElement(){var e;return(e=D(this,Oa))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(E.FULLSCREEN_ELEMENT)&&this.removeAttribute(E.FULLSCREEN_ELEMENT),yt(this,Oa,e),(i=D(this,K))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return k(this,E.DEFAULT_SUBTITLES)}set defaultSubtitles(e){S(this,E.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return I(this,E.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){M(this,E.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return R(this,E.DEFAULT_DURATION)}set defaultDuration(e){O(this,E.DEFAULT_DURATION,e)}get noHotkeys(){return k(this,E.NO_HOTKEYS)}set noHotkeys(e){S(this,E.NO_HOTKEYS,e)}get keysUsed(){return I(this,E.KEYS_USED)}set keysUsed(e){M(this,E.KEYS_USED,e)}get liveEdgeOffset(){return R(this,E.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){O(this,E.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return k(this,E.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){S(this,E.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return k(this,E.NO_VOLUME_PREF)}set noVolumePref(e){S(this,E.NO_VOLUME_PREF,e)}get noSubtitlesLangPref(){return k(this,E.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){S(this,E.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return k(this,E.NO_DEFAULT_STORE)}set noDefaultStore(e){S(this,E.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,o,s,l,u,m,_,g;if(super.attributeChangedCallback(e,i,a),e===E.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(E.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==i&&a===null&&this.enableHotkeys();else if(e===E.HOTKEYS)D(this,zt).value=a;else if(e===E.DEFAULT_SUBTITLES&&a!==i)(r=D(this,K))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(E.DEFAULT_SUBTITLES)}});else if(e===E.DEFAULT_STREAM_TYPE)(s=D(this,K))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(E.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===E.LIVE_EDGE_OFFSET)(l=D(this,K))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(E.LIVE_EDGE_OFFSET)?+this.getAttribute(E.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(E.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(E.LIVE_EDGE_OFFSET)}});else if(e===E.SEEK_TO_LIVE_OFFSET)(u=D(this,K))==null||u.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(E.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(E.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===E.NO_AUTO_SEEK_TO_LIVE)(m=D(this,K))==null||m.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(E.NO_AUTO_SEEK_TO_LIVE)}});else if(e===E.FULLSCREEN_ELEMENT){let f=a?(_=this.getRootNode())==null?void 0:_.getElementById(a):void 0;yt(this,Oa,f),(g=D(this,K))==null||g.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===E.LANG&&a!==i&&Fd(a)}connectedCallback(){var e,i;!D(this,K)&&!this.hasAttribute(E.NO_DEFAULT_STORE)&&kt(this,ho,fs).call(this),(e=D(this,K))==null||e.dispatch({type:"documentelementchangerequest",detail:V}),super.connectedCallback(),D(this,K)&&!D(this,Be)&&yt(this,Be,(i=D(this,K))==null?void 0:i.subscribe(D(this,Na))),this.enableHotkeys()}disconnectedCallback(){var e,i,a,r;(e=super.disconnectedCallback)==null||e.call(this),D(this,K)&&((i=D(this,K))==null||i.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=D(this,K))==null||a.dispatch({type:p.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),D(this,Be)&&((r=D(this,Be))==null||r.call(this),yt(this,Be,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=D(this,K))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=D(this,K))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){gu(this.mediaStateReceivers,e,i)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(i.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),o=Th(e,a,r);Object.values(p).forEach(s=>{e.addEventListener(s,D(this,mo))}),i.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(!i.has(e))return;i.get(e)(),i.delete(e),Object.values(p).forEach(r=>{e.removeEventListener(r,D(this,mo))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),D(this,K)&&Object.entries(D(this,K).getState()).forEach(([r,o])=>{gu([e],r,o)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",kt(this,po,vs))}disableHotkeys(){this.removeEventListener("keydown",kt(this,po,vs)),this.removeEventListener("keyup",kt(this,wi,Pa))}get hotkeys(){return I(this,E.HOTKEYS)}set hotkeys(e){M(this,E.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,o,s;let l=e.target;if(((r=(a=(i=l.getAttribute(E.KEYS_USED))==null?void 0:i.split(" "))!=null?a:l==null?void 0:l.keysUsed)!=null?r:[]).map(f=>f==="Space"?" ":f).filter(Boolean).includes(e.key))return;let m,_,g;if(!D(this,zt).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&D(this,zt).contains("nospace")))switch(e.key){case" ":case"k":m=D(this,K).getState().mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"m":m=this.mediaStore.getState().mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"f":m=this.mediaStore.getState().mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{let f=this.hasAttribute(E.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(E.KEYBOARD_BACKWARD_SEEK_OFFSET):vu;_=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-f,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowRight":{let f=this.hasAttribute(E.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(E.KEYBOARD_FORWARD_SEEK_OFFSET):vu;_=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+f,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}default:break}}};zt=new WeakMap;Oa=new WeakMap;K=new WeakMap;Na=new WeakMap;Be=new WeakMap;mo=new WeakMap;ho=new WeakSet;fs=function(){var t;this.mediaStore=fu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(E.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(E.DEFAULT_DURATION)?+this.getAttribute(E.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(E.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(E.LIVE_EDGE_OFFSET)?+this.getAttribute(E.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(E.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(E.SEEK_TO_LIVE_OFFSET):this.hasAttribute(E.LIVE_EDGE_OFFSET)?+this.getAttribute(E.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(E.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(E.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(E.NO_SUBTITLES_LANG_PREF)}})};wi=new WeakSet;Pa=function(t){let{key:e}=t;if(!_u.includes(e)){this.removeEventListener("keyup",kt(this,wi,Pa));return}this.keyboardShortcutHandler(t)};po=new WeakSet;vs=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!_u.includes(a)){this.removeEventListener("keyup",kt(this,wi,Pa));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(D(this,zt).contains(`no${a.toLowerCase()}`)||a===" "&&D(this,zt).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",kt(this,wi,Pa),{once:!0})};var Eh=Object.values(n),bh=Object.values(Jn),Au=t=>{var e,i,a,r;let{observedAttributes:o}=t.constructor;!o&&((e=t.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(t),{observedAttributes:o}=t.constructor);let s=(r=(a=(i=t==null?void 0:t.getAttribute)==null?void 0:i.call(t,L.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(o||s)?(o||s).filter(l=>Eh.includes(l)):[]},gh=t=>{var e,i;return(e=t.nodeName)!=null&&e.includes("-")&&d.customElements.get((i=t.nodeName)==null?void 0:i.toLowerCase())&&!(t instanceof d.customElements.get(t.nodeName.toLowerCase()))&&d.customElements.upgrade(t),bh.some(a=>a in t)},Es=t=>gh(t)||!!Au(t).length,Eu=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},bu={[n.MEDIA_SUBTITLES_LIST]:ut,[n.MEDIA_SUBTITLES_SHOWING]:ut,[n.MEDIA_SEEKABLE]:Eu,[n.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(Eu).join(" "),[n.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[n.MEDIA_RENDITION_LIST]:Od,[n.MEDIA_AUDIO_TRACK_LIST]:Pd},_h=async(t,e,i)=>{var a,r;if(t.isConnected||await Fr(0),typeof i=="boolean"||i==null)return S(t,e,i);if(typeof i=="number")return O(t,e,i);if(typeof i=="string")return M(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let o=(r=(a=bu[e])==null?void 0:a.call(bu,i))!=null?r:i;return t.setAttribute(e,o)},Ah=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},Zt=(t,e)=>{if(Ah(t))return;let i=(r,o)=>{var s,l;Es(r)&&o(r);let{children:u=[]}=r!=null?r:{},m=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...u,...m].forEach(g=>Zt(g,o))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Es(t)){d.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},gu=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=Au(a),o=e.toLowerCase();r.includes(o)&&_h(a,o,i)})},Th=(t,e,i)=>{Zt(t,e);let a=_=>{var g;let f=(g=_==null?void 0:_.composedPath()[0])!=null?g:_.target;e(f)},r=_=>{var g;let f=(g=_==null?void 0:_.composedPath()[0])!=null?g:_.target;i(f)};t.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let o=_=>{_.forEach(g=>{let{addedNodes:f=[],removedNodes:v=[],type:N,target:T,attributeName:C}=g;N==="childList"?(Array.prototype.forEach.call(f,P=>Zt(P,e)),Array.prototype.forEach.call(v,P=>Zt(P,i))):N==="attributes"&&C===L.MEDIA_CHROME_ATTRIBUTES&&(Es(T)?e(T):i(T))})},s=[],l=_=>{let g=_.target;g.name!=="media"&&(s.forEach(f=>Zt(f,i)),s=[...g.assignedElements({flatten:!0})],s.forEach(f=>Zt(f,e)))};t.addEventListener("slotchange",l);let u=new MutationObserver(o);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{Zt(t,i),t.removeEventListener("slotchange",l),u.disconnect(),t.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",fo);var gs=fo;var Ri={PLACEMENT:"placement",BOUNDS:"bounds"};function yh(t){return`
|
|
158
|
+
`}var eh=Object.values(n),th="sm:384 md:576 lg:768 xl:960";function ih(t){jd(t.target,t.contentRect.width)}function jd(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(y.BREAKPOINTS))!=null?i:th,r=ah(a),o=rh(r,e),s=!1;if(Object.keys(r).forEach(l=>{if(o.includes(l)){t.hasAttribute(`breakpoint${l}`)||(t.setAttribute(`breakpoint${l}`,""),s=!0);return}t.hasAttribute(`breakpoint${l}`)&&(t.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(Ce.BREAKPOINTS_CHANGE,{detail:o});t.dispatchEvent(l)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(Ce.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function ah(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function rh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var Vt=class extends d.HTMLElement{constructor(){if(super(),Se(this,ns),Se(this,ss),Se(this,ls),Se(this,Ra),Se(this,ao),Se(this,Si),Se(this,to,0),Se(this,yi,null),Se(this,wa,null),Se(this,ki,void 0),this.breakpointsComputed=!1,Se(this,jr,new MutationObserver(Le(this,ns,Qd).bind(this))),Se(this,La,!1),Se(this,eo,i=>{Ie(this,La)||(setTimeout(()=>{ih(i),Ft(this,La,!1)},0),Ft(this,La,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let i=Y(this.attributes),a=this.constructor.getTemplateHTML(i);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(a):this.shadowRoot.innerHTML=a}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){Ie(this,yi)&&this.mediaUnsetCallback(Ie(this,yi));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[y.AUTOHIDE,y.GESTURES_DISABLED].concat(eh).filter(e=>![n.MEDIA_RENDITION_LIST,n.MEDIA_AUDIO_TRACK_LIST,n.MEDIA_CHAPTERS_CUES,n.MEDIA_WIDTH,n.MEDIA_HEIGHT,n.MEDIA_ERROR,n.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,i,a){e.toLowerCase()==y.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Ft(this,yi,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Ie(this,jr).observe(this,{childList:!0,subtree:!0}),st(this,Ie(this,eo));let a=this.getAttribute(y.AUDIO)!=null?h("audio player"):h("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(y.USER_INACTIVE,""),jd(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Ie(this,jr).disconnect(),lt(this,Ie(this,eo)),this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ft(this,yi,null)}handleEvent(e){switch(e.type){case"pointerdown":Ft(this,to,e.timeStamp);break;case"pointermove":Le(this,ss,Xd).call(this,e);break;case"pointerup":Le(this,ls,Jd).call(this,e);break;case"mouseleave":Le(this,Ra,io).call(this);break;case"mouseup":this.removeAttribute(y.KEYBOARD_CONTROL);break;case"keyup":Le(this,Si,xa).call(this),this.setAttribute(y.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Ft(this,ki,isNaN(i)?0:i)}get autohide(){return(Ie(this,ki)===void 0?2:Ie(this,ki)).toString()}get breakpoints(){return I(this,y.BREAKPOINTS)}set breakpoints(e){M(this,y.BREAKPOINTS,e)}get audio(){return k(this,y.AUDIO)}set audio(e){S(this,y.AUDIO,e)}get gesturesDisabled(){return k(this,y.GESTURES_DISABLED)}set gesturesDisabled(e){S(this,y.GESTURES_DISABLED,e)}get keyboardControl(){return k(this,y.KEYBOARD_CONTROL)}set keyboardControl(e){S(this,y.KEYBOARD_CONTROL,e)}get noAutohide(){return k(this,y.NO_AUTOHIDE)}set noAutohide(e){S(this,y.NO_AUTOHIDE,e)}get autohideOverControls(){return k(this,y.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){S(this,y.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return k(this,y.USER_INACTIVE)}set userInteractive(e){S(this,y.USER_INACTIVE,e)}};to=new WeakMap;yi=new WeakMap;wa=new WeakMap;ki=new WeakMap;jr=new WeakMap;ns=new WeakSet;Qd=function(t){let e=this.media;for(let i of t){if(i.type!=="childList")continue;let a=i.removedNodes;for(let r of a){if(r.slot!="media"||i.target!=this)continue;let o=i.previousSibling&&i.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(r);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(r)}}if(e)for(let r of i.addedNodes)r===e&&this.handleMediaUpdated(e)}};La=new WeakMap;eo=new WeakMap;ss=new WeakSet;Xd=function(t){if(t.pointerType!=="mouse"&&t.timeStamp-Ie(this,to)<250)return;Le(this,ao,us).call(this),clearTimeout(Ie(this,wa));let e=this.hasAttribute(y.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(t.target)||e)&&Le(this,Si,xa).call(this)};ls=new WeakSet;Jd=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(y.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Le(this,Ra,io).call(this):Le(this,Si,xa).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Le(this,Si,xa).call(this)};Ra=new WeakSet;io=function(){if(Ie(this,ki)<0||this.hasAttribute(y.USER_INACTIVE))return;this.setAttribute(y.USER_INACTIVE,"");let t=new d.CustomEvent(Ce.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};ao=new WeakSet;us=function(){if(!this.hasAttribute(y.USER_INACTIVE))return;this.removeAttribute(y.USER_INACTIVE);let t=new d.CustomEvent(Ce.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};Si=new WeakSet;xa=function(){Le(this,ao,us).call(this),clearTimeout(Ie(this,wa));let t=parseInt(this.autohide);t<0||Ft(this,wa,setTimeout(()=>{Le(this,Ra,io).call(this)},t*1e3))};Vt.shadowRootOptions={mode:"open"};Vt.getTemplateHTML=jm;d.customElements.get("media-container")||d.customElements.define("media-container",Vt);var eu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ie=(t,e,i)=>(eu(t,e,"read from private field"),i?i.call(t):e.get(t)),Da=(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)},ro=(t,e,i,a)=>(eu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ii,Mi,oo,Kt,dt,At,Tt=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){Da(this,dt),Da(this,Ii,void 0),Da(this,Mi,void 0),Da(this,oo,void 0),Da(this,Kt,new Set),ro(this,Ii,e),ro(this,Mi,i),ro(this,oo,new Set(a))}[Symbol.iterator](){return ie(this,dt,At).values()}get length(){return ie(this,dt,At).size}get value(){var e;return(e=[...ie(this,dt,At)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ro(this,Kt,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...ie(this,dt,At)][e]}values(){return ie(this,dt,At).values()}forEach(e,i){ie(this,dt,At).forEach(e,i)}add(...e){var i,a;e.forEach(r=>ie(this,Kt).add(r)),!(this.value===""&&!((i=ie(this,Ii))!=null&&i.hasAttribute(`${ie(this,Mi)}`)))&&((a=ie(this,Ii))==null||a.setAttribute(`${ie(this,Mi)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>ie(this,Kt).delete(a)),(i=ie(this,Ii))==null||i.setAttribute(`${ie(this,Mi)}`,`${this.value}`)}contains(e){return ie(this,dt,At).has(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){return this.remove(e),this.add(i),e===i}};Ii=new WeakMap;Mi=new WeakMap;oo=new WeakMap;Kt=new WeakMap;dt=new WeakSet;At=function(){return ie(this,Kt).size?ie(this,Kt):ie(this,oo)};var oh=(t="")=>t.split(/\s+/),tu=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?pe.CAPTIONS:pe.SUBTITLES,language:i,label:r}},Gt=(t="",e={})=>oh(t).map(i=>{let a=tu(i);return{...e,...a}}),cs=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?tu(e):e):typeof t=="string"?Gt(t):[t]:[],no=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,ut=(t=[])=>Array.prototype.map.call(t,no).join(" "),nh=(t,e)=>i=>i[t]===e,iu=t=>{let e=Object.entries(t).map(([i,a])=>nh(i,a));return i=>e.every(a=>a(i))},Yt=(t,e=[],i=[])=>{let a=cs(i).map(iu),r=o=>a.some(s=>s(o));Array.from(e).filter(r).forEach(o=>{o.mode=t})},qt=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:iu(e);return Array.from(t.textTracks).filter(i)},so=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(n.MEDIA_SUBTITLES_SHOWING)};var ru=t=>{var e;let{media:i,fullscreenElement:a}=t;try{let r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let o=(e=a[r])==null?void 0:e.call(a);if(o instanceof Promise)return o.catch(()=>{})}else i!=null&&i.webkitEnterFullscreen?i.webkitEnterFullscreen():i!=null&&i.requestFullscreen&&i.requestFullscreen()}catch(r){console.error(r)}},au="exitFullscreen"in V?"exitFullscreen":"webkitExitFullscreen"in V?"webkitExitFullscreen":"webkitCancelFullScreen"in V?"webkitCancelFullScreen":void 0,ou=t=>{var e;let{documentElement:i}=t;if(au){let a=(e=i==null?void 0:i[au])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},Oa="fullscreenElement"in V?"fullscreenElement":"webkitFullscreenElement"in V?"webkitFullscreenElement":void 0,sh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[Oa];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===Dd.FULLSCREEN?i:a},nu=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let o=sh(t);if(!o)return!1;if(o===r||o===i)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(Oa in s))return de(o,r);for(;s!=null&&s[Oa];){if(s[Oa]===r)return!0;s=(e=s[Oa])==null?void 0:e.shadowRoot}}return!1},lh="fullscreenEnabled"in V?"fullscreenEnabled":"webkitFullscreenEnabled"in V?"webkitFullscreenEnabled":void 0,su=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[lh])||i&&"webkitSupportsFullscreen"in i};var lo,ms=()=>{var t,e;return lo||(lo=(e=(t=V)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),lo)},lu=async(t=ms())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([dh(t,i.signal),uh(t,e)]);return i.abort(),a},dh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),uh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await Vr(10)}return t.volume!==e},ch=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),hs=(t=ms())=>d.matchMedia("(display-mode: standalone)").matches&&ch?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",ps=(t=ms())=>su({documentElement:V,media:t}),du=ps(),uu=hs(),cu=!!d.WebKitPlaybackTargetAvailabilityEvent,mu=!!d.chrome;var Ci=t=>qt(t.media,e=>[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),fs=t=>qt(t.media,e=>e.mode===gt.SHOWING&&[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)),uo=(t,e)=>{let i=Ci(t),a=fs(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)Yt(gt.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let o=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let _=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=_?[_,...globalThis.navigator.languages]:globalThis.navigator.languages,f=i.filter(v=>g.some(N=>v.language.toLowerCase().startsWith(N.split("-")[0]))).sort((v,N)=>{let T=g.findIndex(P=>v.language.toLowerCase().startsWith(P.split("-")[0])),C=g.findIndex(P=>N.language.toLowerCase().startsWith(P.split("-")[0]));return T-C});f[0]&&(o=f[0])}let{language:l,label:u,kind:m}=o;Yt(gt.DISABLED,i,a),Yt(gt.SHOWING,i,[{language:l,label:u,kind:m}])}}},co=(t,e)=>t===e?!0:t==null||e==null||typeof t!=typeof e?!1:typeof t=="number"&&Number.isNaN(t)&&Number.isNaN(e)?!0:typeof t!="object"?!1:Array.isArray(t)?mh(t,e):Object.entries(t).every(([i,a])=>i in e&&co(a,e[i])),mh=(t,e)=>{let i=Array.isArray(t),a=Array.isArray(e);return i!==a?!1:i||a?t.length!==e.length?!1:t.every((r,o)=>co(r,e[o])):!0};var hh=Object.values(xe),mo,ph=lu().then(t=>(mo=t,mo)),hu=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=d.customElements.get(i);a&&e instanceof a||(await d.customElements.whenDefined(i),d.customElements.upgrade(e))}))},fh=new d.DOMParser,vh=t=>t&&(fh.parseFromString(t,"text/html").body.textContent||t),Li={mediaError:{get(t,e){let{media:i}=t;if((e==null?void 0:e.type)!=="playing")return i==null?void 0:i.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(t,e){var i;let{media:a}=t;if((e==null?void 0:e.type)!=="playing")return(i=a==null?void 0:a.error)==null?void 0:i.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(t,e){var i,a;let{media:r}=t;if((e==null?void 0:e.type)!=="playing")return(a=(i=r==null?void 0:r.error)==null?void 0:i.message)!=null?a:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.paused)!=null?e:!0},set(t,e){var i;let{media:a}=e;a&&(t?a.pause():(i=a.play())==null||i.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(t,e){let{media:i}=t;return i?e?e.type==="playing":!i.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.playbackRate)!=null?e:1},set(t,e){let{media:i}=e;i&&Number.isFinite(+t)&&(i.playbackRate=+t)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.muted)!=null?e:!1},set(t,e){let{media:i}=e;if(i){try{d.localStorage.setItem("media-chrome-pref-muted",t?"true":"false")}catch(a){console.debug("Error setting muted pref",a)}i.muted=t}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noMutedPref:i}}=e,{media:a}=e;if(!(!a||a.muted||i))try{let r=d.localStorage.getItem("media-chrome-pref-muted")==="true";Li.mediaMuted.set(r,e),t(r)}catch(r){console.debug("Error getting muted pref",r)}}]},mediaVolume:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.volume)!=null?e:1},set(t,e){let{media:i}=e;if(i){try{t==null?d.localStorage.removeItem("media-chrome-pref-volume"):d.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch(a){console.debug("Error setting volume pref",a)}Number.isFinite(+t)&&(i.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noVolumePref:i}}=e;if(!i)try{let{media:a}=e;if(!a)return;let r=d.localStorage.getItem("media-chrome-pref-volume");if(r==null)return;Li.mediaVolume.set(+r,e),t(+r)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(t){let{media:e}=t;return typeof(e==null?void 0:e.volume)=="undefined"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.currentTime)!=null?e:0},set(t,e){let{media:i}=e;!i||!Ai(t)||(i.currentTime=t)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(t){let{media:e,options:{defaultDuration:i}={}}=t;return i&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?i:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(t){let{media:e}=t;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(t){var e;let{media:i}=t;if(!((e=i==null?void 0:i.seekable)!=null&&e.length))return;let a=i.seekable.start(0),r=i.seekable.end(i.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(t){var e;let{media:i}=t,a=(e=i==null?void 0:i.buffered)!=null?e:[];return Array.from(a).map((r,o)=>[Number(a.start(o).toFixed(3)),Number(a.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(t){let{media:e,options:{defaultStreamType:i}={}}=t,a=[xe.LIVE,xe.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(hh.includes(r))return r===xe.UNKNOWN?a:r;let o=e.duration;return o===1/0?xe.LIVE:Number.isFinite(o)?xe.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(t){let{media:e}=t;if(!e)return Number.NaN;let{targetLiveWindow:i}=e,a=Li.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===xe.LIVE?0:i},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(t){let{media:e,options:{liveEdgeOffset:i=10}={}}=t;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Li.mediaStreamType.get(t)===xe.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let o=r.end(r.length-1)-i;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(t){return Ci(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return fs(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i,a;let{media:r,options:o}=e;if(!r)return;let s=l=>{var u;!o.defaultSubtitles||l&&![pe.CAPTIONS,pe.SUBTITLES].includes((u=l==null?void 0:l.track)==null?void 0:u.kind)||uo(e,!0)};return r.addEventListener("loadstart",s),(i=r.textTracks)==null||i.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),()=>{var l,u;r.removeEventListener("loadstart",s),(l=r.textTracks)==null||l.removeEventListener("addtrack",s),(u=r.textTracks)==null||u.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(t){var e;let{media:i}=t;if(!i)return[];let[a]=qt(i,{kind:pe.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:o,endTime:s})=>({text:vh(r),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;if(!a)return;let r=a.querySelector('track[kind="chapters"][default][src]'),o=(i=a.shadowRoot)==null?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",t),o==null||o.addEventListener("load",t),()=>{r==null||r.removeEventListener("load",t),o==null||o.removeEventListener("load",t)}}]},mediaIsPip:{get(t){var e,i;let{media:a,documentElement:r}=t;if(!a||!r||!r.pictureInPictureElement)return!1;if(r.pictureInPictureElement===a)return!0;if(r.pictureInPictureElement instanceof HTMLMediaElement)return(e=a.localName)!=null&&e.includes("-")?de(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let o=r.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===a)return!0;o=(i=o.pictureInPictureElement)==null?void 0:i.shadowRoot}}return!1},set(t,e){let{media:i}=e;if(i)if(t){if(!V.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(r=>{if(r.code===11){if(!i.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(i.readyState===0&&i.preload==="none"){let o=()=>{i.removeEventListener("loadedmetadata",s),i.preload="none"},s=()=>{i.requestPictureInPicture().catch(a),o()};i.addEventListener("loadedmetadata",s),i.preload="metadata",setTimeout(()=>{i.readyState===0&&a(),o()},1e3)}else throw r}else throw r})}else V.pictureInPictureElement&&V.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(t){var e,i,a;let{media:r}=t;return(a=(i=r==null?void 0:r.videoRenditions)==null?void 0:i[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=t,r=Array.prototype.findIndex.call(i.videoRenditions,o=>o.id==a);i.videoRenditions.selectedIndex!=r&&(i.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(t){var e,i;let{media:a}=t;return(i=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:i.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=t;for(let r of i.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(t){return nu(t)},set(t,e){t?ru(e):ou(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(t){var e;let{media:i}=t;return!(i!=null&&i.remote)||((e=i.remote)==null?void 0:e.state)==="disconnected"?!1:!!i.remote.state},set(t,e){var i,a;let{media:r}=e;if(r&&!(t&&((i=r.remote)==null?void 0:i.state)!=="disconnected")&&!(!t&&((a=r.remote)==null?void 0:a.state)!=="connected")){if(typeof r.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}r.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(t,e){let{media:i}=e;if(i){if(!(i.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(t){let{media:e}=t;if(!du||!ps(e))return ke.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!uu||!hs(e))return ke.UNSUPPORTED}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(mo===!1||(e==null?void 0:e.volume)==null)return ke.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{mo==null&&ph.then(e=>t(e?void 0:ke.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!mu||!((i=a==null?void 0:a.remote)!=null&&i.state))return ke.UNSUPPORTED;if(!(e==null||e==="available"))return ke.UNAVAILABLE},stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(t,e){if(!cu)return ke.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return ke.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(t){var e;let{media:i}=t;if(!(i!=null&&i.videoRenditions))return ke.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return ke.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return ke.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return ke.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}};var pu={[p.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,o;let{media:s}=e,l=i!=null?i:void 0,u,m;if(s&&l!=null){let[v]=qt(s,{kind:pe.METADATA,label:"thumbnails"}),N=Array.prototype.find.call((a=v==null?void 0:v.cues)!=null?a:[],(T,C,P)=>C===0?T.endTime>l:C===P.length-1?T.startTime<=l:T.startTime<=l&&T.endTime>l);if(N){let T=/'^(?:[a-z]+:)?\/\//i.test(N.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,C=new URL(N.text,T);m=new URLSearchParams(C.hash).get("#xywh").split(",").map(j=>+j),u=C.href}}let _=t.mediaDuration.get(e),f=(o=t.mediaChaptersCues.get(e).find((v,N,T)=>N===T.length-1&&_===v.endTime?v.startTime<=l&&v.endTime>=l:v.startTime<=l&&v.endTime>l))==null?void 0:o.text;return i!=null&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:u,mediaPreviewCoords:m,mediaPreviewChapter:f}},[p.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[p.MEDIA_PLAY_REQUEST](t,e){var i,a,r,o;let s="mediaPaused",u=t.mediaStreamType.get(e)===xe.LIVE,m=!((i=e.options)!=null&&i.noAutoSeekToLive),_=t.mediaTargetLiveWindow.get(e)>0;if(u&&m&&!_){let g=(a=t.mediaSeekable.get(e))==null?void 0:a[1];if(g){let f=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,v=g-f;t.mediaCurrentTime.set(v,e)}}t[s].set(!1,e)},[p.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[p.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[p.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[p.MEDIA_VOLUME_REQUEST](t,e,{detail:i}){let a="mediaVolume",r=i;r&&t.mediaMuted.get(e)&&t.mediaMuted.set(!1,e),t[a].set(r,e)},[p.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[p.MEDIA_SEEK_TO_LIVE_REQUEST](t,e){var i,a,r;let o="mediaCurrentTime",s=(i=t.mediaSeekable.get(e))==null?void 0:i[1];if(Number.isNaN(Number(s)))return;let l=(r=(a=e.options)==null?void 0:a.seekToLiveOffset)!=null?r:0,u=s-l;t[o].set(u,e)},[p.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,o=Ci(e),s=cs(i),l=(a=s[0])==null?void 0:a.language;l&&!r.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Yt(gt.SHOWING,o,s)},[p.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=Ci(e),r=i!=null?i:[];Yt(gt.DISABLED,a,r)},[p.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){uo(e,i)},[p.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[p.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[p.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[p.MEDIA_ENTER_FULLSCREEN_REQUEST](t,e){let i="mediaIsFullscreen";t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[p.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[p.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var fu=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Li,requestMap:r=pu,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],u={options:{...o}},m=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),_=T=>{T!=null&&(co(T,m)||(m=Object.freeze({...m,...T}),l.forEach(C=>C(m))))},g=()=>{let T=Object.entries(a).reduce((C,[P,{get:j}])=>(C[P]=j(u),C),{});_(T)},f={},v,N=async(T,C)=>{var P,j,ge,bt,ot,ca,ma,ha,pa,fa,va,Ea,ba,ga,_a,Aa;let Wr=!!v;if(v={...u,...v!=null?v:{},...T},Wr)return;await hu(...Object.values(T));let nt=l.length>0&&C===0&&s,Ta=u.media!==v.media,ya=((P=u.media)==null?void 0:P.textTracks)!==((j=v.media)==null?void 0:j.textTracks),dd=((ge=u.media)==null?void 0:ge.videoRenditions)!==((bt=v.media)==null?void 0:bt.videoRenditions),ud=((ot=u.media)==null?void 0:ot.audioTracks)!==((ca=v.media)==null?void 0:ca.audioTracks),cd=((ma=u.media)==null?void 0:ma.remote)!==((ha=v.media)==null?void 0:ha.remote),md=u.documentElement!==v.documentElement,hd=!!u.media&&(Ta||nt),pd=!!((pa=u.media)!=null&&pa.textTracks)&&(ya||nt),fd=!!((fa=u.media)!=null&&fa.videoRenditions)&&(dd||nt),vd=!!((va=u.media)!=null&&va.audioTracks)&&(ud||nt),Ed=!!((Ea=u.media)!=null&&Ea.remote)&&(cd||nt),bd=!!u.documentElement&&(md||nt),gd=hd||pd||fd||vd||Ed||bd,bi=l.length===0&&C===1&&s,_d=!!v.media&&(Ta||bi),Ad=!!((ba=v.media)!=null&&ba.textTracks)&&(ya||bi),Td=!!((ga=v.media)!=null&&ga.videoRenditions)&&(dd||bi),yd=!!((_a=v.media)!=null&&_a.audioTracks)&&(ud||bi),kd=!!((Aa=v.media)!=null&&Aa.remote)&&(cd||bi),Sd=!!v.documentElement&&(md||bi),Id=_d||Ad||Td||yd||kd||Sd;if(!(gd||Id)){Object.entries(v).forEach(([F,ka])=>{u[F]=ka}),g(),v=void 0;return}Object.entries(a).forEach(([F,{get:ka,mediaEvents:km=[],textTracksEvents:Sm=[],videoRenditionsEvents:Im=[],audioTracksEvents:Mm=[],remoteEvents:Cm=[],rootEvents:Lm=[],stateOwnersUpdateHandlers:wm=[]}])=>{f[F]||(f[F]={});let _e=Q=>{let Ae=ka(u,Q);_({[F]:Ae})},te;te=f[F].mediaEvents,km.forEach(Q=>{te&&hd&&(u.media.removeEventListener(Q,te),f[F].mediaEvents=void 0),_d&&(v.media.addEventListener(Q,_e),f[F].mediaEvents=_e)}),te=f[F].textTracksEvents,Sm.forEach(Q=>{var Ae,Re;te&&pd&&((Ae=u.media.textTracks)==null||Ae.removeEventListener(Q,te),f[F].textTracksEvents=void 0),Ad&&((Re=v.media.textTracks)==null||Re.addEventListener(Q,_e),f[F].textTracksEvents=_e)}),te=f[F].videoRenditionsEvents,Im.forEach(Q=>{var Ae,Re;te&&fd&&((Ae=u.media.videoRenditions)==null||Ae.removeEventListener(Q,te),f[F].videoRenditionsEvents=void 0),Td&&((Re=v.media.videoRenditions)==null||Re.addEventListener(Q,_e),f[F].videoRenditionsEvents=_e)}),te=f[F].audioTracksEvents,Mm.forEach(Q=>{var Ae,Re;te&&vd&&((Ae=u.media.audioTracks)==null||Ae.removeEventListener(Q,te),f[F].audioTracksEvents=void 0),yd&&((Re=v.media.audioTracks)==null||Re.addEventListener(Q,_e),f[F].audioTracksEvents=_e)}),te=f[F].remoteEvents,Cm.forEach(Q=>{var Ae,Re;te&&Ed&&((Ae=u.media.remote)==null||Ae.removeEventListener(Q,te),f[F].remoteEvents=void 0),kd&&((Re=v.media.remote)==null||Re.addEventListener(Q,_e),f[F].remoteEvents=_e)}),te=f[F].rootEvents,Lm.forEach(Q=>{te&&bd&&(u.documentElement.removeEventListener(Q,te),f[F].rootEvents=void 0),Sd&&(v.documentElement.addEventListener(Q,_e),f[F].rootEvents=_e)});let Md=f[F].stateOwnersUpdateHandlers;wm.forEach(Q=>{Md&&gd&&Md(),Id&&(f[F].stateOwnersUpdateHandlers=Q(_e,v))})}),Object.entries(v).forEach(([F,ka])=>{u[F]=ka}),g(),v=void 0};return N({media:t,fullscreenElement:e,documentElement:i,options:o}),{dispatch(T){let{type:C,detail:P}=T;if(r[C]&&m.mediaErrorCode==null){_(r[C](a,u,T));return}C==="mediaelementchangerequest"?N({media:P}):C==="fullscreenelementchangerequest"?N({fullscreenElement:P}):C==="documentelementchangerequest"?N({documentElement:P}):C==="optionschangerequest"&&Object.entries(P!=null?P:{}).forEach(([j,ge])=>{u.options[j]=ge})},getState(){return m},subscribe(T){return N({},l.length+1),l.push(T),T(m),()=>{let C=l.indexOf(T);C>=0&&(N({},l.length-1),l.splice(C,1))}}}};var gs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},D=(t,e,i)=>(gs(t,e,"read from private field"),i?i.call(t):e.get(t)),ct=(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)},yt=(t,e,i,a)=>(gs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),kt=(t,e,i)=>(gs(t,e,"access private method"),i),zt,Na,K,Pa,Be,ho,po,vs,wi,Ua,fo,Es,_u=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],vu=10,E={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",SEEK_TO_LIVE_OFFSET:"seektoliveoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys",NO_VOLUME_PREF:"novolumepref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_DEFAULT_STORE:"nodefaultstore",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",LANG:"lang"},vo=class extends Vt{constructor(){super(),ct(this,po),ct(this,wi),ct(this,fo),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,ct(this,zt,new Tt(this,E.HOTKEYS)),ct(this,Na,void 0),ct(this,K,void 0),ct(this,Pa,void 0),ct(this,Be,void 0),ct(this,ho,i=>{var a;(a=D(this,K))==null||a.dispatch(i)}),this.associateElement(this);let e={};yt(this,Pa,i=>{Object.entries(i).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let o=a.toLowerCase(),s=new d.CustomEvent(xd[o],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(E.NO_HOTKEYS,E.HOTKEYS,E.DEFAULT_STREAM_TYPE,E.DEFAULT_SUBTITLES,E.DEFAULT_DURATION,E.LANG)}get mediaStore(){return D(this,K)}set mediaStore(e){var i,a;if(D(this,K)&&((i=D(this,Be))==null||i.call(this),yt(this,Be,void 0)),yt(this,K,e),!D(this,K)&&!this.hasAttribute(E.NO_DEFAULT_STORE)){kt(this,po,vs).call(this);return}yt(this,Be,(a=D(this,K))==null?void 0:a.subscribe(D(this,Pa)))}get fullscreenElement(){var e;return(e=D(this,Na))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(E.FULLSCREEN_ELEMENT)&&this.removeAttribute(E.FULLSCREEN_ELEMENT),yt(this,Na,e),(i=D(this,K))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return k(this,E.DEFAULT_SUBTITLES)}set defaultSubtitles(e){S(this,E.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return I(this,E.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){M(this,E.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return R(this,E.DEFAULT_DURATION)}set defaultDuration(e){O(this,E.DEFAULT_DURATION,e)}get noHotkeys(){return k(this,E.NO_HOTKEYS)}set noHotkeys(e){S(this,E.NO_HOTKEYS,e)}get keysUsed(){return I(this,E.KEYS_USED)}set keysUsed(e){M(this,E.KEYS_USED,e)}get liveEdgeOffset(){return R(this,E.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){O(this,E.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return k(this,E.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){S(this,E.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return k(this,E.NO_VOLUME_PREF)}set noVolumePref(e){S(this,E.NO_VOLUME_PREF,e)}get noSubtitlesLangPref(){return k(this,E.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){S(this,E.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return k(this,E.NO_DEFAULT_STORE)}set noDefaultStore(e){S(this,E.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,o,s,l,u,m,_,g;if(super.attributeChangedCallback(e,i,a),e===E.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(E.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==i&&a===null&&this.enableHotkeys();else if(e===E.HOTKEYS)D(this,zt).value=a;else if(e===E.DEFAULT_SUBTITLES&&a!==i)(r=D(this,K))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(E.DEFAULT_SUBTITLES)}});else if(e===E.DEFAULT_STREAM_TYPE)(s=D(this,K))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(E.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===E.LIVE_EDGE_OFFSET)(l=D(this,K))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(E.LIVE_EDGE_OFFSET)?+this.getAttribute(E.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(E.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(E.LIVE_EDGE_OFFSET)}});else if(e===E.SEEK_TO_LIVE_OFFSET)(u=D(this,K))==null||u.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(E.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(E.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===E.NO_AUTO_SEEK_TO_LIVE)(m=D(this,K))==null||m.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(E.NO_AUTO_SEEK_TO_LIVE)}});else if(e===E.FULLSCREEN_ELEMENT){let f=a?(_=this.getRootNode())==null?void 0:_.getElementById(a):void 0;yt(this,Na,f),(g=D(this,K))==null||g.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===E.LANG&&a!==i&&Fd(a)}connectedCallback(){var e,i;!D(this,K)&&!this.hasAttribute(E.NO_DEFAULT_STORE)&&kt(this,po,vs).call(this),(e=D(this,K))==null||e.dispatch({type:"documentelementchangerequest",detail:V}),super.connectedCallback(),D(this,K)&&!D(this,Be)&&yt(this,Be,(i=D(this,K))==null?void 0:i.subscribe(D(this,Pa))),this.enableHotkeys()}disconnectedCallback(){var e,i,a,r;(e=super.disconnectedCallback)==null||e.call(this),D(this,K)&&((i=D(this,K))==null||i.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=D(this,K))==null||a.dispatch({type:p.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),D(this,Be)&&((r=D(this,Be))==null||r.call(this),yt(this,Be,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=D(this,K))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=D(this,K))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){gu(this.mediaStateReceivers,e,i)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(i.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),o=Th(e,a,r);Object.values(p).forEach(s=>{e.addEventListener(s,D(this,ho))}),i.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(!i.has(e))return;i.get(e)(),i.delete(e),Object.values(p).forEach(r=>{e.removeEventListener(r,D(this,ho))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),D(this,K)&&Object.entries(D(this,K).getState()).forEach(([r,o])=>{gu([e],r,o)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",kt(this,fo,Es))}disableHotkeys(){this.removeEventListener("keydown",kt(this,fo,Es)),this.removeEventListener("keyup",kt(this,wi,Ua))}get hotkeys(){return I(this,E.HOTKEYS)}set hotkeys(e){M(this,E.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,o,s;let l=e.target;if(((r=(a=(i=l.getAttribute(E.KEYS_USED))==null?void 0:i.split(" "))!=null?a:l==null?void 0:l.keysUsed)!=null?r:[]).map(f=>f==="Space"?" ":f).filter(Boolean).includes(e.key))return;let m,_,g;if(!D(this,zt).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&D(this,zt).contains("nospace")))switch(e.key){case" ":case"k":m=D(this,K).getState().mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"m":m=this.mediaStore.getState().mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"f":m=this.mediaStore.getState().mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{let f=this.hasAttribute(E.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(E.KEYBOARD_BACKWARD_SEEK_OFFSET):vu;_=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-f,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowRight":{let f=this.hasAttribute(E.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(E.KEYBOARD_FORWARD_SEEK_OFFSET):vu;_=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+f,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}default:break}}};zt=new WeakMap;Na=new WeakMap;K=new WeakMap;Pa=new WeakMap;Be=new WeakMap;ho=new WeakMap;po=new WeakSet;vs=function(){var t;this.mediaStore=fu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(E.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(E.DEFAULT_DURATION)?+this.getAttribute(E.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(E.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(E.LIVE_EDGE_OFFSET)?+this.getAttribute(E.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(E.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(E.SEEK_TO_LIVE_OFFSET):this.hasAttribute(E.LIVE_EDGE_OFFSET)?+this.getAttribute(E.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(E.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(E.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(E.NO_SUBTITLES_LANG_PREF)}})};wi=new WeakSet;Ua=function(t){let{key:e}=t;if(!_u.includes(e)){this.removeEventListener("keyup",kt(this,wi,Ua));return}this.keyboardShortcutHandler(t)};fo=new WeakSet;Es=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!_u.includes(a)){this.removeEventListener("keyup",kt(this,wi,Ua));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(D(this,zt).contains(`no${a.toLowerCase()}`)||a===" "&&D(this,zt).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",kt(this,wi,Ua),{once:!0})};var Eh=Object.values(n),bh=Object.values(jn),Au=t=>{var e,i,a,r;let{observedAttributes:o}=t.constructor;!o&&((e=t.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(t),{observedAttributes:o}=t.constructor);let s=(r=(a=(i=t==null?void 0:t.getAttribute)==null?void 0:i.call(t,L.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(o||s)?(o||s).filter(l=>Eh.includes(l)):[]},gh=t=>{var e,i;return(e=t.nodeName)!=null&&e.includes("-")&&d.customElements.get((i=t.nodeName)==null?void 0:i.toLowerCase())&&!(t instanceof d.customElements.get(t.nodeName.toLowerCase()))&&d.customElements.upgrade(t),bh.some(a=>a in t)},bs=t=>gh(t)||!!Au(t).length,Eu=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},bu={[n.MEDIA_SUBTITLES_LIST]:ut,[n.MEDIA_SUBTITLES_SHOWING]:ut,[n.MEDIA_SEEKABLE]:Eu,[n.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(Eu).join(" "),[n.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[n.MEDIA_RENDITION_LIST]:Od,[n.MEDIA_AUDIO_TRACK_LIST]:Pd},_h=async(t,e,i)=>{var a,r;if(t.isConnected||await Vr(0),typeof i=="boolean"||i==null)return S(t,e,i);if(typeof i=="number")return O(t,e,i);if(typeof i=="string")return M(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let o=(r=(a=bu[e])==null?void 0:a.call(bu,i))!=null?r:i;return t.setAttribute(e,o)},Ah=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},Zt=(t,e)=>{if(Ah(t))return;let i=(r,o)=>{var s,l;bs(r)&&o(r);let{children:u=[]}=r!=null?r:{},m=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...u,...m].forEach(g=>Zt(g,o))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!bs(t)){d.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},gu=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=Au(a),o=e.toLowerCase();r.includes(o)&&_h(a,o,i)})},Th=(t,e,i)=>{Zt(t,e);let a=_=>{var g;let f=(g=_==null?void 0:_.composedPath()[0])!=null?g:_.target;e(f)},r=_=>{var g;let f=(g=_==null?void 0:_.composedPath()[0])!=null?g:_.target;i(f)};t.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let o=_=>{_.forEach(g=>{let{addedNodes:f=[],removedNodes:v=[],type:N,target:T,attributeName:C}=g;N==="childList"?(Array.prototype.forEach.call(f,P=>Zt(P,e)),Array.prototype.forEach.call(v,P=>Zt(P,i))):N==="attributes"&&C===L.MEDIA_CHROME_ATTRIBUTES&&(bs(T)?e(T):i(T))})},s=[],l=_=>{let g=_.target;g.name!=="media"&&(s.forEach(f=>Zt(f,i)),s=[...g.assignedElements({flatten:!0})],s.forEach(f=>Zt(f,e)))};t.addEventListener("slotchange",l);let u=new MutationObserver(o);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{Zt(t,i),t.removeEventListener("slotchange",l),u.disconnect(),t.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",vo);var _s=vo;var Ri={PLACEMENT:"placement",BOUNDS:"bounds"};function yh(t){return`
|
|
159
159
|
<style>
|
|
160
160
|
:host {
|
|
161
161
|
--_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
</style>
|
|
265
265
|
<slot></slot>
|
|
266
266
|
<div id="arrow"></div>
|
|
267
|
-
`}var xi=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!
|
|
267
|
+
`}var xi=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Qr(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let i=this.placement;if(i==="left"||i==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=He(this,"#"+this.bounds))!=null?e:Z(this);if(!r)return;let{x:o,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),m=l+u,_=o+s,g=a.getPropertyValue("--media-tooltip-offset-x"),f=g?parseFloat(g.replace("px","")):0,v=a.getPropertyValue("--media-tooltip-container-margin"),N=v?parseFloat(v.replace("px","")):0,T=l-o+f-N,C=m-_+f+N;if(T<0){this.style.setProperty("--media-tooltip-offset-x",`${T}px`);return}if(C>0){this.style.setProperty("--media-tooltip-offset-x",`${C}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Ri.PLACEMENT,Ri.BOUNDS]}get placement(){return I(this,Ri.PLACEMENT)}set placement(e){M(this,Ri.PLACEMENT,e)}get bounds(){return I(this,Ri.BOUNDS)}set bounds(e){M(this,Ri.BOUNDS,e)}};xi.shadowRootOptions={mode:"open"};xi.getTemplateHTML=yh;d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",xi);var Eo=xi;var Ts=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},J=(t,e,i)=>(Ts(t,e,"read from private field"),i?i.call(t):e.get(t)),Di=(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)},bo=(t,e,i,a)=>(Ts(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),kh=(t,e,i)=>(Ts(t,e,"access private method"),i),$e,Ni,It,Oi,go,As,Tu,St={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Sh(t,e={}){return`
|
|
268
268
|
<style>
|
|
269
269
|
:host {
|
|
270
270
|
position: relative;
|
|
@@ -338,8 +338,8 @@
|
|
|
338
338
|
|
|
339
339
|
<slot name="tooltip">
|
|
340
340
|
<media-tooltip part="tooltip" aria-hidden="true">
|
|
341
|
-
<template shadowrootmode="${
|
|
342
|
-
${
|
|
341
|
+
<template shadowrootmode="${Eo.shadowRootOptions.mode}">
|
|
342
|
+
${Eo.getTemplateHTML({})}
|
|
343
343
|
</template>
|
|
344
344
|
<slot name="tooltip-content">
|
|
345
345
|
${this.getTooltipContentHTML(t)}
|
|
@@ -348,7 +348,7 @@
|
|
|
348
348
|
</slot>
|
|
349
349
|
`}function Ih(t,e){return`
|
|
350
350
|
<slot></slot>
|
|
351
|
-
`}function Mh(){return""}var B=class extends d.HTMLElement{constructor(){if(super(),Di(this,
|
|
351
|
+
`}function Mh(){return""}var B=class extends d.HTMLElement{constructor(){if(super(),Di(this,As),Di(this,$e,void 0),this.preventClick=!1,this.tooltipEl=null,Di(this,Ni,e=>{this.preventClick||this.handleClick(e),setTimeout(J(this,It),0)}),Di(this,It,()=>{var e,i;(i=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||i.call(e)}),Di(this,Oi,e=>{let{key:i}=e;if(!this.keysUsed.includes(i)){this.removeEventListener("keyup",J(this,Oi));return}this.preventClick||this.handleClick(e)}),Di(this,go,e=>{let{metaKey:i,altKey:a,key:r}=e;if(i||a||!this.keysUsed.includes(r)){this.removeEventListener("keyup",J(this,Oi));return}this.addEventListener("keyup",J(this,Oi),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes),i=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(i):this.shadowRoot.innerHTML=i}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",St.TOOLTIP_PLACEMENT,L.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",J(this,Ni)),this.addEventListener("keydown",J(this,go)),this.tabIndex=0}disable(){this.removeEventListener("click",J(this,Ni)),this.removeEventListener("keydown",J(this,go)),this.removeEventListener("keyup",J(this,Oi)),this.tabIndex=-1}attributeChangedCallback(e,i,a){var r,o,s,l,u;e===L.MEDIA_CONTROLLER?(i&&((o=(r=J(this,$e))==null?void 0:r.unassociateElement)==null||o.call(r,this),bo(this,$e,null)),a&&this.isConnected&&(bo(this,$e,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=J(this,$e))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===St.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==i&&(this.tooltipEl.placement=a),J(this,It).call(this)}connectedCallback(){var e,i,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let o=this.getAttribute(L.MEDIA_CONTROLLER);o&&(bo(this,$e,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=J(this,$e))==null?void 0:i.associateElement)==null||a.call(i,this)),d.customElements.whenDefined("media-tooltip").then(()=>kh(this,As,Tu).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=J(this,$e))==null?void 0:e.unassociateElement)==null||i.call(e,this),bo(this,$e,null),this.removeEventListener("mouseenter",J(this,It)),this.removeEventListener("focus",J(this,It)),this.removeEventListener("click",J(this,Ni))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return I(this,St.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){M(this,St.TOOLTIP_PLACEMENT,e)}get mediaController(){return I(this,L.MEDIA_CONTROLLER)}set mediaController(e){M(this,L.MEDIA_CONTROLLER,e)}get disabled(){return k(this,St.DISABLED)}set disabled(e){S(this,St.DISABLED,e)}get noTooltip(){return k(this,St.NO_TOOLTIP)}set noTooltip(e){S(this,St.NO_TOOLTIP,e)}handleClick(e){}};$e=new WeakMap;Ni=new WeakMap;It=new WeakMap;Oi=new WeakMap;go=new WeakMap;As=new WeakSet;Tu=function(){this.addEventListener("mouseenter",J(this,It)),this.addEventListener("focus",J(this,It)),this.addEventListener("click",J(this,Ni));let t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)};B.shadowRootOptions={mode:"open"};B.getTemplateHTML=Sh;B.getSlotTemplateHTML=Ih;B.getTooltipContentHTML=Mh;d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",B);var yu=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
352
352
|
<path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
|
|
353
353
|
</svg>
|
|
354
354
|
`;function Ch(t){return`
|
|
@@ -375,7 +375,7 @@
|
|
|
375
375
|
`}function Lh(){return`
|
|
376
376
|
<slot name="tooltip-enter">${h("start airplay")}</slot>
|
|
377
377
|
<slot name="tooltip-exit">${h("stop airplay")}</slot>
|
|
378
|
-
`}var ku=t=>{let e=t.mediaIsAirplaying?h("stop airplay"):h("start airplay");t.setAttribute("aria-label",e)},
|
|
378
|
+
`}var ku=t=>{let e=t.mediaIsAirplaying?h("stop airplay"):h("start airplay");t.setAttribute("aria-label",e)},Ha=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_AIRPLAYING,n.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),ku(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_AIRPLAYING&&ku(this)}get mediaIsAirplaying(){return k(this,n.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){S(this,n.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return I(this,n.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){M(this,n.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(p.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};Ha.getSlotTemplateHTML=Ch;Ha.getTooltipContentHTML=Lh;d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",Ha);var wh=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
379
379
|
<path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
|
|
380
380
|
</svg>`,Rh=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
381
381
|
<path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
|
|
@@ -403,7 +403,7 @@
|
|
|
403
403
|
`}function Dh(){return`
|
|
404
404
|
<slot name="tooltip-enable">${h("Enable captions")}</slot>
|
|
405
405
|
<slot name="tooltip-disable">${h("Disable captions")}</slot>
|
|
406
|
-
`}var Su=t=>{t.setAttribute("aria-checked",
|
|
406
|
+
`}var Su=t=>{t.setAttribute("aria-checked",so(t).toString())},Ba=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",h("closed captions")),Su(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING&&Su(this)}get mediaSubtitlesList(){return Iu(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Mu(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Iu(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Mu(this,n.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};Ba.getSlotTemplateHTML=xh;Ba.getTooltipContentHTML=Dh;var Iu=(t,e)=>{let i=t.getAttribute(e);return i?Gt(i):[]},Mu=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=ut(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",Ba);var Oh='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',Nh='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>';function Ph(t){return`
|
|
407
407
|
<style>
|
|
408
408
|
:host([${n.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
|
|
409
409
|
display: none !important;
|
|
@@ -427,7 +427,7 @@
|
|
|
427
427
|
`}function Uh(){return`
|
|
428
428
|
<slot name="tooltip-enter">${h("Start casting")}</slot>
|
|
429
429
|
<slot name="tooltip-exit">${h("Stop casting")}</slot>
|
|
430
|
-
`}var Cu=t=>{let e=t.mediaIsCasting?h("stop casting"):h("start casting");t.setAttribute("aria-label",e)}
|
|
430
|
+
`}var Cu=t=>{let e=t.mediaIsCasting?h("stop casting"):h("start casting");t.setAttribute("aria-label",e)},$a=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_CASTING,n.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Cu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_CASTING&&Cu(this)}get mediaIsCasting(){return k(this,n.MEDIA_IS_CASTING)}set mediaIsCasting(e){S(this,n.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return I(this,n.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){M(this,n.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?p.MEDIA_EXIT_CAST_REQUEST:p.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};$a.getSlotTemplateHTML=Ph;$a.getTooltipContentHTML=Uh;d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",$a);var Ls=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Xt=(t,e,i)=>(Ls(t,e,"read from private field"),i?i.call(t):e.get(t)),mt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ws=(t,e,i,a)=>(Ls(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Qt=(t,e,i)=>(Ls(t,e,"access private method"),i),Ao,Fa,Jt,_o,ys,ks,Lu,Ss,wu,Is,Ru,Ms,xu,Cs,Du;function Hh(t){return`
|
|
431
431
|
<style>
|
|
432
432
|
:host {
|
|
433
433
|
font: var(--media-font,
|
|
@@ -470,7 +470,7 @@
|
|
|
470
470
|
${this.getSlotTemplateHTML(t)}
|
|
471
471
|
`}function Bh(t){return`
|
|
472
472
|
<slot id="content"></slot>
|
|
473
|
-
`}var
|
|
473
|
+
`}var Wa={OPEN:"open",ANCHOR:"anchor"},Mt=class extends d.HTMLElement{constructor(){super(),mt(this,_o),mt(this,ks),mt(this,Ss),mt(this,Is),mt(this,Ms),mt(this,Cs),mt(this,Ao,!1),mt(this,Fa,null),mt(this,Jt,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Wa.OPEN,Wa.ANCHOR]}get open(){return k(this,Wa.OPEN)}set open(e){S(this,Wa.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":Qt(this,Is,Ru).call(this,e);break;case"focusout":Qt(this,Ms,xu).call(this,e);break;case"keydown":Qt(this,Cs,Du).call(this,e);break}}connectedCallback(){Qt(this,_o,ys).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,i,a){Qt(this,_o,ys).call(this),e===Wa.OPEN&&a!==i&&(this.open?Qt(this,ks,Lu).call(this):Qt(this,Ss,wu).call(this))}focus(){ws(this,Fa,Ca());let e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),i=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||i)return;let a=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');a==null||a.focus()}get keysUsed(){return["Escape","Tab"]}};Ao=new WeakMap;Fa=new WeakMap;Jt=new WeakMap;_o=new WeakSet;ys=function(){if(!Xt(this,Ao)&&(ws(this,Ao,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let t=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(t),queueMicrotask(()=>{let{style:e}=W(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};ks=new WeakSet;Lu=function(){var t;(t=Xt(this,Jt))==null||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};Ss=new WeakSet;wu=function(){var t;(t=Xt(this,Jt))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};Is=new WeakSet;Ru=function(t){ws(this,Jt,t.relatedTarget),de(this,t.relatedTarget)||(this.open=!this.open)};Ms=new WeakSet;xu=function(t){var e;de(this,t.relatedTarget)||((e=Xt(this,Fa))==null||e.focus(),Xt(this,Jt)&&Xt(this,Jt)!==t.relatedTarget&&this.open&&(this.open=!1))};Cs=new WeakSet;Du=function(t){var e,i,a,r,o;let{key:s,ctrlKey:l,altKey:u,metaKey:m}=t;l||u||m||this.keysUsed.includes(s)&&(t.preventDefault(),t.stopPropagation(),s==="Tab"?(t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()):s==="Escape"&&((o=Xt(this,Fa))==null||o.focus(),this.open=!1))};Mt.shadowRootOptions={mode:"open"};Mt.getTemplateHTML=Hh;Mt.getSlotTemplateHTML=Bh;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",Mt);var Us=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},z=(t,e,i)=>(Us(t,e,"read from private field"),i?i.call(t):e.get(t)),ne=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ct=(t,e,i,a)=>(Us(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Oe=(t,e,i)=>(Us(t,e,"access private method"),i),We,Ro,To,yo,Ne,Lo,ko,So,Io,Hs,Ou,Mo,Rs,Co,xs,wo,Bs,Ds,Nu,Os,Pu,Ns,Uu,Ps,Hu;function $h(t){return`
|
|
474
474
|
<style>
|
|
475
475
|
:host {
|
|
476
476
|
--_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
@@ -698,7 +698,7 @@
|
|
|
698
698
|
<input id="range" type="range" min="0" max="1" step="any" value="0">
|
|
699
699
|
</div>
|
|
700
700
|
<div id="rightgap"></div>
|
|
701
|
-
`}var Fe=class extends d.HTMLElement{constructor(){if(super(),ne(this,
|
|
701
|
+
`}var Fe=class extends d.HTMLElement{constructor(){if(super(),ne(this,Hs),ne(this,Mo),ne(this,Co),ne(this,wo),ne(this,Ds),ne(this,Os),ne(this,Ns),ne(this,Ps),ne(this,We,void 0),ne(this,Ro,void 0),ne(this,To,void 0),ne(this,yo,void 0),ne(this,Ne,{}),ne(this,Lo,[]),ne(this,ko,()=>{if(this.range.matches(":focus-visible")){let{style:e}=W(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),ne(this,So,()=>{let{style:e}=W(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),ne(this,Io,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes),i=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(i):this.shadowRoot.innerHTML=i}this.container=this.shadowRoot.querySelector("#container"),Ct(this,To,this.shadowRoot.querySelector("#startpoint")),Ct(this,yo,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",L.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,l,u;e===L.MEDIA_CONTROLLER?(i&&((o=(r=z(this,We))==null?void 0:r.unassociateElement)==null||o.call(r,this),Ct(this,We,null)),a&&this.isConnected&&(Ct(this,We,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=z(this,We))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),Oe(this,Mo,Rs).call(this)):(this.range.setAttribute(e,a),Oe(this,Co,xs).call(this)))}connectedCallback(){var e,i,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),z(this,Ne).pointer=W(this.shadowRoot,"#pointer"),z(this,Ne).progress=W(this.shadowRoot,"#progress"),z(this,Ne).thumb=W(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),z(this,Ne).activeSegment=W(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(L.MEDIA_CONTROLLER);o&&(Ct(this,We,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=z(this,We))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",z(this,ko)),this.shadowRoot.addEventListener("focusout",z(this,So)),Oe(this,Mo,Rs).call(this),st(this.container,z(this,Io))}disconnectedCallback(){var e,i;Oe(this,Co,xs).call(this),(i=(e=z(this,We))==null?void 0:e.unassociateElement)==null||i.call(e,this),Ct(this,We,null),this.shadowRoot.removeEventListener("focusin",z(this,ko)),this.shadowRoot.removeEventListener("focusout",z(this,So)),lt(this.container,z(this,Io))}updatePointerBar(e){var i;(i=z(this,Ne).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=z(this,Ne).progress)==null||e.style.setProperty("width",`${a}%`),(i=z(this,Ne).thumb)==null||i.style.setProperty("left",`${a}%`)}updateSegments(e){let i=this.shadowRoot.querySelector("#segments-clipping");if(i.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let a=[...new Set([+this.range.min,...e.flatMap(o=>[o.start,o.end]),+this.range.max])];Ct(this,Lo,[...a]);let r=a.pop();for(let[o,s]of a.entries()){let[l,u]=[o===0,o===a.length-1],m=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,g=`calc(${((u?r:a[o+1])-s)*100}%${l||u?"":" - var(--segments-gap)"})`,f=V.createElementNS("http://www.w3.org/2000/svg","rect"),v=W(this.shadowRoot,`#segments-clipping rect:nth-child(${o+1})`);v.style.setProperty("x",m),v.style.setProperty("width",g),i.append(f)}}getPointerRatio(e){return Zd(e.clientX,e.clientY,z(this,To).getBoundingClientRect(),z(this,yo).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Oe(this,Ps,Hu).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Oe(this,Ds,Nu).call(this,e);break;case"pointerdown":Oe(this,wo,Bs).call(this,e);break;case"pointerup":Oe(this,Os,Pu).call(this);break;case"pointerleave":Oe(this,Ns,Uu).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};We=new WeakMap;Ro=new WeakMap;To=new WeakMap;yo=new WeakMap;Ne=new WeakMap;Lo=new WeakMap;ko=new WeakMap;So=new WeakMap;Io=new WeakMap;Hs=new WeakSet;Ou=function(t){let e=z(this,Ne).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${z(this,Lo).findIndex((o,s,l)=>{let u=l[s+1];return u!=null&&i>=o&&i<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Mo=new WeakSet;Rs=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Co=new WeakSet;xs=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(t=d.window)==null||t.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};wo=new WeakSet;Bs=function(t){var e;Ct(this,Ro,t.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};Ds=new WeakSet;Nu=function(t){var e;t.pointerType!=="mouse"&&Oe(this,wo,Bs).call(this,t),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};Os=new WeakSet;Pu=function(){var t;(t=d.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};Ns=new WeakSet;Uu=function(){var t,e;this.removeEventListener("pointerleave",this),(t=d.window)==null||t.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=z(this,Ne).activeSegment)==null||e.style.removeProperty("transform")};Ps=new WeakSet;Hu=function(t){this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),Oe(this,Hs,Ou).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!z(this,Ro))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};Fe.shadowRootOptions={mode:"open"};Fe.getTemplateHTML=$h;d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",Fe);var Bu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},xo=(t,e,i)=>(Bu(t,e,"read from private field"),i?i.call(t):e.get(t)),Wh=(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)},Do=(t,e,i,a)=>(Bu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ve;function Fh(t){return`
|
|
702
702
|
<style>
|
|
703
703
|
:host {
|
|
704
704
|
|
|
@@ -724,7 +724,7 @@
|
|
|
724
724
|
</style>
|
|
725
725
|
|
|
726
726
|
<slot></slot>
|
|
727
|
-
`}var
|
|
727
|
+
`}var Va=class extends d.HTMLElement{constructor(){if(super(),Wh(this,Ve,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[L.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,l,u;e===L.MEDIA_CONTROLLER&&(i&&((o=(r=xo(this,Ve))==null?void 0:r.unassociateElement)==null||o.call(r,this),Do(this,Ve,null)),a&&this.isConnected&&(Do(this,Ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=xo(this,Ve))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(L.MEDIA_CONTROLLER);r&&(Do(this,Ve,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=xo(this,Ve))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=xo(this,Ve))==null?void 0:e.unassociateElement)==null||i.call(e,this),Do(this,Ve,null)}};Ve=new WeakMap;Va.shadowRootOptions={mode:"open"};Va.getTemplateHTML=Fh;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",Va);var $u=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Oo=(t,e,i)=>($u(t,e,"read from private field"),i?i.call(t):e.get(t)),Vh=(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)},No=(t,e,i,a)=>($u(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ke;function Kh(t,e={}){return`
|
|
728
728
|
<style>
|
|
729
729
|
:host {
|
|
730
730
|
font: var(--media-font,
|
|
@@ -760,9 +760,9 @@
|
|
|
760
760
|
${this.getSlotTemplateHTML(t,e)}
|
|
761
761
|
`}function Gh(t,e){return`
|
|
762
762
|
<slot></slot>
|
|
763
|
-
`}var ve=class extends d.HTMLElement{constructor(){if(super(),Vh(this,Ke,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[L.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,l,u;e===L.MEDIA_CONTROLLER&&(i&&((o=(r=
|
|
763
|
+
`}var ve=class extends d.HTMLElement{constructor(){if(super(),Vh(this,Ke,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[L.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,l,u;e===L.MEDIA_CONTROLLER&&(i&&((o=(r=Oo(this,Ke))==null?void 0:r.unassociateElement)==null||o.call(r,this),No(this,Ke,null)),a&&this.isConnected&&(No(this,Ke,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Oo(this,Ke))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let o=this.getAttribute(L.MEDIA_CONTROLLER);o&&(No(this,Ke,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=Oo(this,Ke))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=Oo(this,Ke))==null?void 0:e.unassociateElement)==null||i.call(e,this),No(this,Ke,null)}};Ke=new WeakMap;ve.shadowRootOptions={mode:"open"};ve.getTemplateHTML=Kh;ve.getSlotTemplateHTML=Gh;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",ve);var Fu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Wu=(t,e,i)=>(Fu(t,e,"read from private field"),i?i.call(t):e.get(t)),Yh=(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)},qh=(t,e,i,a)=>(Fu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ka;function Zh(t,e){return`
|
|
764
764
|
<slot>${De(e.mediaDuration)}</slot>
|
|
765
|
-
`}var
|
|
765
|
+
`}var Po=class extends ve{constructor(){var e;super(),Yh(this,Ka,void 0),qh(this,Ka,this.shadowRoot.querySelector("slot")),Wu(this,Ka).textContent=De((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===n.MEDIA_DURATION&&(Wu(this,Ka).textContent=De(+a)),super.attributeChangedCallback(e,i,a)}get mediaDuration(){return R(this,n.MEDIA_DURATION)}set mediaDuration(e){O(this,n.MEDIA_DURATION,e)}};Ka=new WeakMap;Po.getSlotTemplateHTML=Zh;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",Po);var zh={2:h("Network Error"),3:h("Decode Error"),4:h("Source Not Supported"),5:h("Encryption Error")},Qh={2:h("A network error caused the media download to fail."),3:h("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:h("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:h("The media is encrypted and there are no keys to decrypt it.")},$s=t=>{var e,i;return t.code===1?null:{title:(e=zh[t.code])!=null?e:`Error ${t.code}`,message:(i=Qh[t.code])!=null?i:t.message}};var Ku=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Xh=(t,e,i)=>(Ku(t,e,"read from private field"),i?i.call(t):e.get(t)),Jh=(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)},jh=(t,e,i,a)=>(Ku(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Uo;function ep(t){return`
|
|
766
766
|
<style>
|
|
767
767
|
:host {
|
|
768
768
|
background: rgb(20 20 30 / .8);
|
|
@@ -781,7 +781,7 @@
|
|
|
781
781
|
<slot name="error-${t.mediaerrorcode}" id="content">
|
|
782
782
|
${Gu({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
|
|
783
783
|
</slot>
|
|
784
|
-
`}function tp(t){return t.code
|
|
784
|
+
`}function tp(t){return t.code&&$s(t)!==null}function Gu(t){var e;let{title:i,message:a}=(e=$s(t))!=null?e:{},r="";return i&&(r+=`<slot name="error-${t.code}-title"><h3>${i}</h3></slot>`),a&&(r+=`<slot name="error-${t.code}-message"><p>${a}</p></slot>`),r}var Vu=[n.MEDIA_ERROR_CODE,n.MEDIA_ERROR_MESSAGE],Pi=class extends Mt{constructor(){super(...arguments),Jh(this,Uo,null)}static get observedAttributes(){return[...super.observedAttributes,...Vu]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,i,a){var r;if(super.attributeChangedCallback(e,i,a),!Vu.includes(e))return;let o=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=tp(o),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(o))}get mediaError(){return Xh(this,Uo)}set mediaError(e){jh(this,Uo,e)}get mediaErrorCode(){return R(this,"mediaerrorcode")}set mediaErrorCode(e){O(this,"mediaerrorcode",e)}get mediaErrorMessage(){return I(this,"mediaerrormessage")}set mediaErrorMessage(e){M(this,"mediaerrormessage",e)}};Uo=new WeakMap;Pi.getSlotTemplateHTML=ep;Pi.formatErrorMessage=Gu;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",Pi);var Ho=Pi;var ip=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
785
785
|
<path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
|
|
786
786
|
</svg>`,ap=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
787
787
|
<path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
|
|
@@ -809,7 +809,7 @@
|
|
|
809
809
|
`}function op(){return`
|
|
810
810
|
<slot name="tooltip-enter">${h("Enter fullscreen mode")}</slot>
|
|
811
811
|
<slot name="tooltip-exit">${h("Exit fullscreen mode")}</slot>
|
|
812
|
-
`}var Yu=t=>{let e=t.mediaIsFullscreen?h("exit fullscreen mode"):h("enter fullscreen mode");t.setAttribute("aria-label",e)},
|
|
812
|
+
`}var Yu=t=>{let e=t.mediaIsFullscreen?h("exit fullscreen mode"):h("enter fullscreen mode");t.setAttribute("aria-label",e)},Ga=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_FULLSCREEN,n.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Yu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_FULLSCREEN&&Yu(this)}get mediaFullscreenUnavailable(){return I(this,n.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){M(this,n.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return k(this,n.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){S(this,n.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};Ga.getSlotTemplateHTML=rp;Ga.getTooltipContentHTML=op;d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",Ga);var{MEDIA_TIME_IS_LIVE:Bo,MEDIA_PAUSED:Ya}=n,{MEDIA_SEEK_TO_LIVE_REQUEST:np,MEDIA_PLAY_REQUEST:sp}=p,lp='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function dp(t){return`
|
|
813
813
|
<style>
|
|
814
814
|
:host { --media-tooltip-display: none; }
|
|
815
815
|
|
|
@@ -821,13 +821,13 @@
|
|
|
821
821
|
color: var(--media-live-button-icon-color, rgb(140, 140, 140));
|
|
822
822
|
}
|
|
823
823
|
|
|
824
|
-
:host([${
|
|
825
|
-
:host([${
|
|
824
|
+
:host([${Bo}]:not([${Ya}])) slot[name=indicator] > *,
|
|
825
|
+
:host([${Bo}]:not([${Ya}])) ::slotted([slot=indicator]) {
|
|
826
826
|
fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
827
827
|
color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
828
828
|
}
|
|
829
829
|
|
|
830
|
-
:host([${
|
|
830
|
+
:host([${Bo}]:not([${Ya}])) {
|
|
831
831
|
cursor: var(--media-cursor, not-allowed);
|
|
832
832
|
}
|
|
833
833
|
|
|
@@ -840,7 +840,7 @@
|
|
|
840
840
|
<slot name="indicator">${lp}</slot>
|
|
841
841
|
|
|
842
842
|
<slot name="spacer"> </slot><slot name="text">${h("live")}</slot>
|
|
843
|
-
`}var qu=t=>{let e=t.mediaPaused||!t.mediaTimeIsLive,i=e?h("seek to live"):h("playing live");t.setAttribute("aria-label",i),e?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")}
|
|
843
|
+
`}var qu=t=>{let e=t.mediaPaused||!t.mediaTimeIsLive,i=e?h("seek to live"):h("playing live");t.setAttribute("aria-label",i),e?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},$o=class extends B{static get observedAttributes(){return[...super.observedAttributes,Bo,Ya]}connectedCallback(){super.connectedCallback(),qu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),qu(this)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return k(this,n.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){S(this,n.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(np,{composed:!0,bubbles:!0})),this.hasAttribute(Ya)&&this.dispatchEvent(new d.CustomEvent(sp,{composed:!0,bubbles:!0})))}};$o.getSlotTemplateHTML=dp;d.customElements.get("media-live-button")||d.customElements.define("media-live-button",$o);var zu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},qa=(t,e,i)=>(zu(t,e,"read from private field"),i?i.call(t):e.get(t)),Zu=(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)},Za=(t,e,i,a)=>(zu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ge,Fo,Wo={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},Qu=500,up=`
|
|
844
844
|
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
845
845
|
<path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
|
|
846
846
|
<animateTransform
|
|
@@ -900,7 +900,7 @@
|
|
|
900
900
|
|
|
901
901
|
<slot name="icon">${up}</slot>
|
|
902
902
|
<div id="status" role="status" aria-live="polite">${h("media loading")}</div>
|
|
903
|
-
`}var
|
|
903
|
+
`}var za=class extends d.HTMLElement{constructor(){if(super(),Zu(this,Ge,void 0),Zu(this,Fo,Qu),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[L.MEDIA_CONTROLLER,n.MEDIA_PAUSED,n.MEDIA_LOADING,Wo.LOADING_DELAY]}attributeChangedCallback(e,i,a){var r,o,s,l,u;e===Wo.LOADING_DELAY&&i!==a?this.loadingDelay=Number(a):e===L.MEDIA_CONTROLLER&&(i&&((o=(r=qa(this,Ge))==null?void 0:r.unassociateElement)==null||o.call(r,this),Za(this,Ge,null)),a&&this.isConnected&&(Za(this,Ge,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=qa(this,Ge))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(L.MEDIA_CONTROLLER);r&&(Za(this,Ge,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=qa(this,Ge))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=qa(this,Ge))==null?void 0:e.unassociateElement)==null||i.call(e,this),Za(this,Ge,null)}get loadingDelay(){return qa(this,Fo)}set loadingDelay(e){Za(this,Fo,e);let{style:i}=W(this.shadowRoot,":host");i.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaController(){return I(this,L.MEDIA_CONTROLLER)}set mediaController(e){M(this,L.MEDIA_CONTROLLER,e)}get noAutohide(){return k(this,Wo.NO_AUTOHIDE)}set noAutohide(e){S(this,Wo.NO_AUTOHIDE,e)}};Ge=new WeakMap;Fo=new WeakMap;za.shadowRootOptions={mode:"open"};za.getTemplateHTML=cp;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",za);var mp=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
904
904
|
<path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
|
|
905
905
|
</svg>`,Xu=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
906
906
|
<path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
|
|
@@ -940,7 +940,7 @@
|
|
|
940
940
|
`}function fp(){return`
|
|
941
941
|
<slot name="tooltip-mute">${h("Mute")}</slot>
|
|
942
942
|
<slot name="tooltip-unmute">${h("Unmute")}</slot>
|
|
943
|
-
`}var Ju=t=>{let i=t.mediaVolumeLevel==="off"?h("unmute"):h("mute");t.setAttribute("aria-label",i)},
|
|
943
|
+
`}var Ju=t=>{let i=t.mediaVolumeLevel==="off"?h("unmute"):h("mute");t.setAttribute("aria-label",i)},Qa=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),Ju(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_VOLUME_LEVEL&&Ju(this)}get mediaVolumeLevel(){return I(this,n.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){M(this,n.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};Qa.getSlotTemplateHTML=pp;Qa.getTooltipContentHTML=fp;d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",Qa);var ju=`<svg aria-hidden="true" viewBox="0 0 28 24">
|
|
944
944
|
<path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
|
|
945
945
|
</svg>`;function vp(t){return`
|
|
946
946
|
<style>
|
|
@@ -965,7 +965,7 @@
|
|
|
965
965
|
`}function Ep(){return`
|
|
966
966
|
<slot name="tooltip-enter">${h("Enter picture in picture mode")}</slot>
|
|
967
967
|
<slot name="tooltip-exit">${h("Exit picture in picture mode")}</slot>
|
|
968
|
-
`}var ec=t=>{let e=t.mediaIsPip?h("exit picture in picture mode"):h("enter picture in picture mode");t.setAttribute("aria-label",e)},
|
|
968
|
+
`}var ec=t=>{let e=t.mediaIsPip?h("exit picture in picture mode"):h("enter picture in picture mode");t.setAttribute("aria-label",e)},Xa=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_PIP,n.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),ec(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_PIP&&ec(this)}get mediaPipUnavailable(){return I(this,n.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){M(this,n.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return k(this,n.MEDIA_IS_PIP)}set mediaIsPip(e){S(this,n.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?p.MEDIA_EXIT_PIP_REQUEST:p.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};Xa.getSlotTemplateHTML=vp;Xa.getTooltipContentHTML=Ep;d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",Xa);var bp=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ui=(t,e,i)=>(bp(t,e,"read from private field"),i?i.call(t):e.get(t)),gp=(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)},Lt,Ws={RATES:"rates"},Fs=[1,1.2,1.5,1.7,2],jt=1;function _p(t){return`
|
|
969
969
|
<style>
|
|
970
970
|
:host {
|
|
971
971
|
min-width: 5ch;
|
|
@@ -973,7 +973,7 @@
|
|
|
973
973
|
}
|
|
974
974
|
</style>
|
|
975
975
|
<slot name="icon">${t.mediaplaybackrate||jt}x</slot>
|
|
976
|
-
`}function Ap(){return h("Playback rate")}var
|
|
976
|
+
`}function Ap(){return h("Playback rate")}var Ja=class extends B{constructor(){var e;super(),gp(this,Lt,new Tt(this,Ws.RATES,{defaultValue:Fs})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:jt}x`}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,Ws.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===Ws.RATES&&(Ui(this,Lt).value=a),e===n.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,o=Number.isNaN(r)?jt:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",h("Playback rate {playbackRate}",{playbackRate:o}))}}get rates(){return Ui(this,Lt)}set rates(e){e?Array.isArray(e)?Ui(this,Lt).value=e.join(" "):typeof e=="string"&&(Ui(this,Lt).value=e):Ui(this,Lt).value=""}get mediaPlaybackRate(){return R(this,n.MEDIA_PLAYBACK_RATE,jt)}set mediaPlaybackRate(e){O(this,n.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,i;let a=Array.from(Ui(this,Lt).values(),s=>+s).sort((s,l)=>s-l),r=(i=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?i:jt,o=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(o)}};Lt=new WeakMap;Ja.getSlotTemplateHTML=_p;Ja.getTooltipContentHTML=Ap;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",Ja);var Tp=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
977
977
|
<path d="m6 21 15-9L6 3v18Z"/>
|
|
978
978
|
</svg>`,yp=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
979
979
|
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
@@ -997,7 +997,7 @@
|
|
|
997
997
|
`}function Sp(){return`
|
|
998
998
|
<slot name="tooltip-play">${h("Play")}</slot>
|
|
999
999
|
<slot name="tooltip-pause">${h("Pause")}</slot>
|
|
1000
|
-
`}var tc=t=>{let e=t.mediaPaused?h("play"):h("pause");t.setAttribute("aria-label",e)},
|
|
1000
|
+
`}var tc=t=>{let e=t.mediaPaused?h("play"):h("pause");t.setAttribute("aria-label",e)},ja=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),tc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PAUSED&&tc(this)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};ja.getSlotTemplateHTML=kp;ja.getTooltipContentHTML=Sp;d.customElements.get("media-play-button")||d.customElements.define("media-play-button",ja);var Ye={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function Ip(t){return`
|
|
1001
1001
|
<style>
|
|
1002
1002
|
:host {
|
|
1003
1003
|
pointer-events: none;
|
|
@@ -1019,7 +1019,7 @@
|
|
|
1019
1019
|
</style>
|
|
1020
1020
|
|
|
1021
1021
|
<img part="poster img" aria-hidden="true" id="image"/>
|
|
1022
|
-
`}var Mp=t=>{t.style.removeProperty("background-image")},Cp=(t,e)=>{t.style["background-image"]=`url('${e}')`},
|
|
1022
|
+
`}var Mp=t=>{t.style.removeProperty("background-image")},Cp=(t,e)=>{t.style["background-image"]=`url('${e}')`},er=class extends d.HTMLElement{static get observedAttributes(){return[Ye.PLACEHOLDER_SRC,Ye.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,i,a){e===Ye.SRC&&(a==null?this.image.removeAttribute(Ye.SRC):this.image.setAttribute(Ye.SRC,a)),e===Ye.PLACEHOLDER_SRC&&(a==null?Mp(this.image):Cp(this.image,a))}get placeholderSrc(){return I(this,Ye.PLACEHOLDER_SRC)}set placeholderSrc(e){M(this,Ye.SRC,e)}get src(){return I(this,Ye.SRC)}set src(e){M(this,Ye.SRC,e)}};er.shadowRootOptions={mode:"open"};er.getTemplateHTML=Ip;d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",er);var ic=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Lp=(t,e,i)=>(ic(t,e,"read from private field"),i?i.call(t):e.get(t)),wp=(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)},Rp=(t,e,i,a)=>(ic(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Vo,Vs=class extends ve{constructor(){super(),wp(this,Vo,void 0),Rp(this,Vo,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PREVIEW_CHAPTER&&a!==i&&a!=null&&(Lp(this,Vo).textContent=a,a!==""?this.setAttribute("aria-valuetext",`chapter: ${a}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return I(this,n.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){M(this,n.MEDIA_PREVIEW_CHAPTER,e)}};Vo=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",Vs);var ac=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ko=(t,e,i)=>(ac(t,e,"read from private field"),i?i.call(t):e.get(t)),xp=(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)},Go=(t,e,i,a)=>(ac(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),qe;function Dp(t){return`
|
|
1023
1023
|
<style>
|
|
1024
1024
|
:host {
|
|
1025
1025
|
box-sizing: border-box;
|
|
@@ -1033,7 +1033,7 @@
|
|
|
1033
1033
|
}
|
|
1034
1034
|
</style>
|
|
1035
1035
|
<img crossorigin loading="eager" decoding="async">
|
|
1036
|
-
`}var Hi=class extends d.HTMLElement{constructor(){if(super(),xp(this,qe,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[L.MEDIA_CONTROLLER,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(L.MEDIA_CONTROLLER);r&&(
|
|
1036
|
+
`}var Hi=class extends d.HTMLElement{constructor(){if(super(),xp(this,qe,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[L.MEDIA_CONTROLLER,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(L.MEDIA_CONTROLLER);r&&(Go(this,qe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=Ko(this,qe))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=Ko(this,qe))==null?void 0:e.unassociateElement)==null||i.call(e,this),Go(this,qe,null)}attributeChangedCallback(e,i,a){var r,o,s,l,u;[n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===L.MEDIA_CONTROLLER&&(i&&((o=(r=Ko(this,qe))==null?void 0:r.unassociateElement)==null||o.call(r,this),Go(this,qe,null)),a&&this.isConnected&&(Go(this,qe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Ko(this,qe))==null?void 0:l.associateElement)==null||u.call(l,this)))}get mediaPreviewImage(){return I(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(n.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(i=>+i)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(n.MEDIA_PREVIEW_COORDS);return}this.setAttribute(n.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,i=this.mediaPreviewImage;if(!(e&&i))return;let[a,r,o,s]=e,l=i.split("#")[0],u=getComputedStyle(this),{maxWidth:m,maxHeight:_,minWidth:g,minHeight:f}=u,v=Math.min(parseInt(m)/o,parseInt(_)/s),N=Math.max(parseInt(g)/o,parseInt(f)/s),T=v<1,C=T?v:N>1?N:1,{style:P}=W(this.shadowRoot,":host"),j=W(this.shadowRoot,"img").style,ge=this.shadowRoot.querySelector("img"),bt=T?"min":"max";P.setProperty(`${bt}-width`,"initial","important"),P.setProperty(`${bt}-height`,"initial","important"),P.width=`${o*C}px`,P.height=`${s*C}px`;let ot=()=>{j.width=`${this.imgWidth*C}px`,j.height=`${this.imgHeight*C}px`,j.display="block"};ge.src!==l&&(ge.onload=()=>{this.imgWidth=ge.naturalWidth,this.imgHeight=ge.naturalHeight,ot()},ge.src=l,ot()),ot(),j.transform=`translate(-${a*C}px, -${r*C}px)`}};qe=new WeakMap;Hi.shadowRootOptions={mode:"open"};Hi.getTemplateHTML=Dp;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Hi);var Yo=Hi;var oc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},rc=(t,e,i)=>(oc(t,e,"read from private field"),i?i.call(t):e.get(t)),Op=(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)},Np=(t,e,i,a)=>(oc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),tr,Ks=class extends ve{constructor(){super(),Op(this,tr,void 0),Np(this,tr,this.shadowRoot.querySelector("slot")),rc(this,tr).textContent=De(0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PREVIEW_TIME&&a!=null&&(rc(this,tr).textContent=De(parseFloat(a)))}get mediaPreviewTime(){return R(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,n.MEDIA_PREVIEW_TIME,e)}};tr=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Ks);var Bi={SEEK_OFFSET:"seekoffset"},Gs=30,Pp=t=>`
|
|
1037
1037
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1038
1038
|
<defs>
|
|
1039
1039
|
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
@@ -1042,7 +1042,7 @@
|
|
|
1042
1042
|
<path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/>
|
|
1043
1043
|
</svg>`;function Up(t,e){return`
|
|
1044
1044
|
<slot name="icon">${Pp(e.seekOffset)}</slot>
|
|
1045
|
-
`}function Hp(){return h("Seek backward")}var Bp=0,
|
|
1045
|
+
`}function Hp(){return h("Seek backward")}var Bp=0,ir=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,Bi.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=R(this,Bi.SEEK_OFFSET,Gs)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===Bi.SEEK_OFFSET&&(this.seekOffset=R(this,Bi.SEEK_OFFSET,Gs))}get seekOffset(){return R(this,Bi.SEEK_OFFSET,Gs)}set seekOffset(e){O(this,Bi.SEEK_OFFSET,e),this.setAttribute("aria-label",h("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Zr(zr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return R(this,n.MEDIA_CURRENT_TIME,Bp)}set mediaCurrentTime(e){O(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),i=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};ir.getSlotTemplateHTML=Up;ir.getTooltipContentHTML=Hp;d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",ir);var $i={SEEK_OFFSET:"seekoffset"},Ys=30,$p=t=>`
|
|
1046
1046
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1047
1047
|
<defs>
|
|
1048
1048
|
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
@@ -1051,9 +1051,9 @@
|
|
|
1051
1051
|
<path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/>
|
|
1052
1052
|
</svg>`;function Wp(t,e){return`
|
|
1053
1053
|
<slot name="icon">${$p(e.seekOffset)}</slot>
|
|
1054
|
-
`}function Fp(){return h("Seek forward")}var Vp=0,
|
|
1055
|
-
<slot>${
|
|
1056
|
-
`}var
|
|
1054
|
+
`}function Fp(){return h("Seek forward")}var Vp=0,ar=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,$i.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=R(this,$i.SEEK_OFFSET,Ys)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===$i.SEEK_OFFSET&&(this.seekOffset=R(this,$i.SEEK_OFFSET,Ys))}get seekOffset(){return R(this,$i.SEEK_OFFSET,Ys)}set seekOffset(e){O(this,$i.SEEK_OFFSET,e),this.setAttribute("aria-label",h("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Zr(zr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return R(this,n.MEDIA_CURRENT_TIME,Vp)}set mediaCurrentTime(e){O(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,i=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};ar.getSlotTemplateHTML=Wp;ar.getTooltipContentHTML=Fp;d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",ar);var lc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},qs=(t,e,i)=>(lc(t,e,"read from private field"),i?i.call(t):e.get(t)),Kp=(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)},Gp=(t,e,i,a)=>(lc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Wi,ei={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},nc=[...Object.values(ei),n.MEDIA_CURRENT_TIME,n.MEDIA_DURATION,n.MEDIA_SEEKABLE],sc=["Enter"," "],Yp=" / ",Zs=(t,{timesSep:e=Yp}={})=>{var i,a;let r=(i=t.mediaCurrentTime)!=null?i:0,[,o]=(a=t.mediaSeekable)!=null?a:[],s=0;Number.isFinite(t.mediaDuration)?s=t.mediaDuration:Number.isFinite(o)&&(s=o);let l=t.remaining?De(0-(s-r)):De(r);return t.showDuration?`${l}${e}${De(s)}`:l},qp="video not loaded, unknown time.",Zp=t=>{var e;let i=t.mediaCurrentTime,[,a]=(e=t.mediaSeekable)!=null?e:[],r=null;if(Number.isFinite(t.mediaDuration)?r=t.mediaDuration:Number.isFinite(a)&&(r=a),i==null||r===null){t.setAttribute("aria-valuetext",qp);return}let o=t.remaining?$t(0-(r-i)):$t(i);if(!t.showDuration){t.setAttribute("aria-valuetext",o);return}let s=$t(r),l=`${o} of ${s}`;t.setAttribute("aria-valuetext",l)};function zp(t,e){return`
|
|
1055
|
+
<slot>${Zs(e)}</slot>
|
|
1056
|
+
`}var qo=class extends ve{constructor(){super(),Kp(this,Wi,void 0),Gp(this,Wi,this.shadowRoot.querySelector("slot")),qs(this,Wi).innerHTML=`${Zs(this)}`}static get observedAttributes(){return[...super.observedAttributes,...nc,"disabled"]}connectedCallback(){let{style:e}=W(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",h("playback time"));let i=a=>{let{key:r}=a;if(!sc.includes(r)){this.removeEventListener("keyup",i);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:o,key:s}=a;if(r||o||!sc.includes(s)){this.removeEventListener("keyup",i);return}this.addEventListener("keyup",i)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,i,a){nc.includes(e)?this.update():e==="disabled"&&a!==i&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,i,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return k(this,ei.REMAINING)}set remaining(e){S(this,ei.REMAINING,e)}get showDuration(){return k(this,ei.SHOW_DURATION)}set showDuration(e){S(this,ei.SHOW_DURATION,e)}get noToggle(){return k(this,ei.NO_TOGGLE)}set noToggle(e){S(this,ei.NO_TOGGLE,e)}get mediaDuration(){return R(this,n.MEDIA_DURATION)}set mediaDuration(e){O(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return R(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,n.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Zs(this);Zp(this),e!==qs(this,Wi).innerHTML&&(qs(this,Wi).innerHTML=e)}};Wi=new WeakMap;qo.getSlotTemplateHTML=zp;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",qo);var dc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ae=(t,e,i)=>(dc(t,e,"read from private field"),i?i.call(t):e.get(t)),Ze=(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)},Me=(t,e,i,a)=>(dc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Qp=(t,e,i,a)=>({set _(r){Me(t,e,r,i)},get _(){return ae(t,e,a)}}),Fi,Zo,Vi,rr,zo,Qo,Xo,Ki,ti,Jo,jo=class{constructor(e,i,a){Ze(this,Fi,void 0),Ze(this,Zo,void 0),Ze(this,Vi,void 0),Ze(this,rr,void 0),Ze(this,zo,void 0),Ze(this,Qo,void 0),Ze(this,Xo,void 0),Ze(this,Ki,void 0),Ze(this,ti,0),Ze(this,Jo,(r=performance.now())=>{Me(this,ti,requestAnimationFrame(ae(this,Jo))),Me(this,rr,performance.now()-ae(this,Vi));let o=1e3/this.fps;if(ae(this,rr)>o){Me(this,Vi,r-ae(this,rr)%o);let s=1e3/((r-ae(this,Zo))/++Qp(this,zo)._),l=(r-ae(this,Qo))/1e3/this.duration,u=ae(this,Xo)+l*this.playbackRate;u-ae(this,Fi).valueAsNumber>0?Me(this,Ki,this.playbackRate/this.duration/s):(Me(this,Ki,.995*ae(this,Ki)),u=ae(this,Fi).valueAsNumber+ae(this,Ki)),this.callback(u)}}),Me(this,Fi,e),this.callback=i,this.fps=a}start(){ae(this,ti)===0&&(Me(this,Vi,performance.now()),Me(this,Zo,ae(this,Vi)),Me(this,zo,0),ae(this,Jo).call(this))}stop(){ae(this,ti)!==0&&(cancelAnimationFrame(ae(this,ti)),Me(this,ti,0))}update({start:e,duration:i,playbackRate:a}){let r=e-ae(this,Fi).valueAsNumber,o=Math.abs(i-this.duration);(r>0||r<-.03||o>=.5)&&this.callback(e),Me(this,Xo,e),Me(this,Qo,performance.now()),this.duration=i,this.playbackRate=a}};Fi=new WeakMap;Zo=new WeakMap;Vi=new WeakMap;rr=new WeakMap;zo=new WeakMap;Qo=new WeakMap;Xo=new WeakMap;Ki=new WeakMap;ti=new WeakMap;Jo=new WeakMap;var Js=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ee=(t,e,i)=>(Js(t,e,"read from private field"),i?i.call(t):e.get(t)),re=(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)},ze=(t,e,i,a)=>(Js(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),le=(t,e,i)=>(Js(t,e,"access private method"),i),Gi,ii,an,nr,rn,tn,sr,lr,Yi,qi,or,js,uc,zs,on,el,nn,tl,sn,il,Qs,cc,dr,ln,Xs,mc,Xp="video not loaded, unknown time.",Jp=t=>{let e=t.range,i=$t(+hc(t)),a=$t(+t.mediaSeekableEnd),r=i&&a?`${i} of ${a}`:Xp;e.setAttribute("aria-valuetext",r)};function jp(t){return`
|
|
1057
1057
|
${Fe.getTemplateHTML(t)}
|
|
1058
1058
|
<style>
|
|
1059
1059
|
:host {
|
|
@@ -1257,8 +1257,8 @@
|
|
|
1257
1257
|
<div id="preview-rail">
|
|
1258
1258
|
<slot name="preview" part="box preview-box">
|
|
1259
1259
|
<media-preview-thumbnail>
|
|
1260
|
-
<template shadowrootmode="${
|
|
1261
|
-
${
|
|
1260
|
+
<template shadowrootmode="${Yo.shadowRootOptions.mode}">
|
|
1261
|
+
${Yo.getTemplateHTML({})}
|
|
1262
1262
|
</template>
|
|
1263
1263
|
</media-preview-thumbnail>
|
|
1264
1264
|
<media-preview-chapter-display></media-preview-chapter-display>
|
|
@@ -1271,8 +1271,8 @@
|
|
|
1271
1271
|
|
|
1272
1272
|
</slot>
|
|
1273
1273
|
</div>
|
|
1274
|
-
`}var jo=(t,e=t.mediaCurrentTime)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-i)/(a-i);return Math.max(0,Math.min(r,1))},hc=(t,e=t.range.valueAsNumber)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-i)+i},dr=class extends Fe{constructor(){super(),re(this,qi),re(this,Js),re(this,rn),re(this,on),re(this,nn),re(this,zs),re(this,lr),re(this,Qs),re(this,Gi,void 0),re(this,ii,void 0),re(this,tn,void 0),re(this,or,void 0),re(this,an,void 0),re(this,en,void 0),re(this,nr,void 0),re(this,sr,void 0),re(this,Yi,void 0),re(this,Zs,a=>{this.dragging||(Ai(a)&&(this.range.valueAsNumber=a),this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),ze(this,tn,this.shadowRoot.querySelectorAll('[part~="box"]')),ze(this,an,this.shadowRoot.querySelector('[part~="preview-box"]')),ze(this,en,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);ze(this,nr,parseInt(i.getPropertyValue("--media-box-padding-left"))),ze(this,sr,parseInt(i.getPropertyValue("--media-box-padding-right"))),ze(this,ii,new Jo(this.range,ee(this,Zs),60))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_DURATION,n.MEDIA_SEEKABLE,n.MEDIA_CURRENT_TIME,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_TIME,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_BUFFERED,n.MEDIA_PLAYBACK_RATE,n.MEDIA_LOADING,n.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",h("seek")),le(this,qi,rr).call(this),ze(this,Gi,this.getRootNode()),(e=ee(this,Gi))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),le(this,qi,rr).call(this),(e=ee(this,Gi))==null||e.removeEventListener("transitionstart",this),ze(this,Gi,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===n.MEDIA_CURRENT_TIME||e===n.MEDIA_PAUSED||e===n.MEDIA_ENDED||e===n.MEDIA_LOADING||e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE?(ee(this,ii).update({start:jo(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),le(this,qi,rr).call(this),Jp(this)):e===n.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=ee(this,Yi),this.updateBar()))}get mediaChaptersCues(){return ee(this,Yi)}set mediaChaptersCues(e){var i;ze(this,Yi,e),this.updateSegments((i=ee(this,Yi))==null?void 0:i.map(a=>({start:jo(this,a.startTime),end:jo(this,a.endTime)})))}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaDuration(){return R(this,n.MEDIA_DURATION)}set mediaDuration(e){O(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return R(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,n.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return R(this,n.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){O(this,n.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(n.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(n.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(n.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,i=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaSeekableStart(){var e;let[i=0]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaPreviewImage(){return I(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return R(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,n.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return k(this,n.MEDIA_ENDED)}set mediaEnded(e){S(this,n.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let i=this.mediaBuffered;if(!i.length)return;let a;if(this.mediaEnded)a=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([l,u])=>l<=o&&o<=u))!=null?e:[];a=jo(this,s)}let{style:r}=W(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=W(this.shadowRoot,"#current-rail"),a=W(this.shadowRoot,'[part~="current-box"]'),r=le(this,rn,js).call(this,ee(this,en)),o=le(this,on,el).call(this,r,this.range.valueAsNumber),s=le(this,nn,tl).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${o})`,i.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":le(this,Qs,mc).call(this);break;case"pointermove":le(this,zs,cc).call(this,e);break;case"pointerup":case"pointerleave":le(this,lr,sn).call(this,null);break;case"transitionstart":de(e.target,this)&&setTimeout(()=>le(this,qi,rr).call(this),0);break}}};Gi=new WeakMap;ii=new WeakMap;tn=new WeakMap;or=new WeakMap;an=new WeakMap;en=new WeakMap;nr=new WeakMap;sr=new WeakMap;Yi=new WeakMap;qi=new WeakSet;rr=function(){le(this,Js,uc).call(this)?ee(this,ii).start():ee(this,ii).stop()};Js=new WeakSet;uc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&zr(this)};Zs=new WeakMap;rn=new WeakSet;js=function(t){var e;let a=((e=this.getAttribute("bounds")?He(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),o=t.offsetWidth,s=-(r.left-a.left-o/2),l=a.right-r.left-o/2;return{box:{width:o,min:s,max:l},bounds:a,range:r}};on=new WeakSet;el=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:o}=t.box;if(!a)return i;if(Number.isNaN(r)||(i=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${i})`),!Number.isNaN(o)){let l=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;i=`min(${i}, ${l})`}return i};nn=new WeakSet;tl=function(t,e){let{width:i,min:a,max:r}=t.box,o=e*t.range.width;if(o<a+ee(this,nr)){let s=t.range.left-t.bounds.left-ee(this,nr);return`${o-i/2+s}px`}if(o>r-ee(this,sr)){let s=t.bounds.right-t.range.right-ee(this,sr);return`${o+i/2-s-t.range.width}px`}return 0};zs=new WeakSet;cc=function(t){let e=[...ee(this,tn)].some(_=>t.composedPath().includes(_));if(!this.dragging&&(e||!t.composedPath().includes(this))){le(this,lr,sn).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=W(this.shadowRoot,"#preview-rail"),r=W(this.shadowRoot,'[part~="preview-box"]'),o=le(this,rn,js).call(this,ee(this,an)),s=(t.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let l=le(this,on,el).call(this,o,s),u=le(this,nn,tl).call(this,o,s);a.style.transform=`translateX(${l})`,a.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${o.box.width}px`);let m=Math.round(ee(this,or))-Math.round(s*i);Math.abs(m)<1&&s>.01&&s<.99||(ze(this,or,s*i),le(this,lr,sn).call(this,ee(this,or)))};lr=new WeakSet;sn=function(t){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Qs=new WeakSet;mc=function(){ee(this,ii).stop();let t=hc(this);this.dispatchEvent(new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};dr.shadowRootOptions={mode:"open"};dr.getTemplateHTML=jp;d.customElements.get("media-time-range")||d.customElements.define("media-time-range",dr);var ef=1,tf=t=>t.mediaMuted?0:t.mediaVolume,af=t=>`${Math.round(t*100)}%`,il=class extends Fe{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME,n.MEDIA_MUTED,n.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",h("volume"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_VOLUME||e===n.MEDIA_MUTED)&&(this.range.valueAsNumber=tf(this),this.range.setAttribute("aria-valuetext",af(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return R(this,n.MEDIA_VOLUME,ef)}set mediaVolume(e){O(this,n.MEDIA_VOLUME,e)}get mediaMuted(){return k(this,n.MEDIA_MUTED)}set mediaMuted(e){S(this,n.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return I(this,n.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,n.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",il);var b=require("@mux/mux-video/base"),w=require("@mux/playback-core");var gc=require("@mux/playback-core");var oi=require("@mux/playback-core");function pc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${ln(i)}: ${a}; `)}),e?e.trim():void 0}function ln(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function dn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ue(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function al(t){let e=rf(t).toString();return e?"?"+e:""}function rf(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var rl=(t,e)=>!t||!e?!1:t.contains(e)?!0:rl(t,e.getRootNode().host);var fc="mux.com",of=()=>{try{return"3.5.3"}catch{}return"UNKNOWN"},nf=of(),cn=()=>nf,vc=(t,{token:e,customDomain:i=fc,thumbnailTime:a,programTime:r}={})=>{var l;let o=e==null?a:void 0,{aud:s}=(l=(0,oi.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${al({token:e,time:o,program_time:r})}`},Ec=(t,{token:e,customDomain:i=fc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,oi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${al({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},ur=t=>{if(t){if([oi.StreamTypes.LIVE,oi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return oi.StreamTypes.LIVE}};var sf={crossorigin:"crossOrigin",playsinline:"playsInline"};function bc(t){var e;return(e=sf[t])!=null?e:dn(t)}var ai,ri,ce,un=class{constructor(e,i){he(this,ai);he(this,ri);he(this,ce,[]);Te(this,ai,e),Te(this,ri,i)}[Symbol.iterator](){return U(this,ce).values()}get length(){return U(this,ce).length}get value(){var e;return(e=U(this,ce).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Te(this,ce,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return U(this,ce)[e]}values(){return U(this,ce).values()}keys(){return U(this,ce).keys()}forEach(e){U(this,ce).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||U(this,ce).push(r)}),!(this.value===""&&!((i=U(this,ai))!=null&&i.hasAttribute(`${U(this,ri)}`)))&&((a=U(this,ai))==null||a.setAttribute(`${U(this,ri)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{U(this,ce).splice(U(this,ce).indexOf(a),1)}),(i=U(this,ai))==null||i.setAttribute(`${U(this,ri)}`,`${this.value}`)}contains(e){return U(this,ce).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)}};ai=new WeakMap,ri=new WeakMap,ce=new WeakMap;var _c=`[mux-player ${cn()}]`;function Qe(...t){console.warn(_c,...t)}function Ee(...t){console.error(_c,...t)}function ol(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,gc.i18n)("Read more: ")}
|
|
1275
|
-
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),Qe(e)}var se={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},wt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Z1={...se,...wt},Tc=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}}),lf=Object.values(se).filter(t=>se.PLAYSINLINE!==t),df=Object.values(wt),uf=[...lf,...df],nl=class extends ye.HTMLElement{static get observedAttributes(){return uf}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case wt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case wt.VOLUME:{let s=(r=ue(a))!=null?r:1;this.media&&(this.media.volume=s);return}case wt.PLAYBACKRATE:{let s=(o=ue(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:Tc}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Tc}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=ue(this.getAttribute(wt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(wt.PLAYBACKRATE,`${e}`):this.removeAttribute(wt.PLAYBACKRATE)}get crossOrigin(){return cr(this,se.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(se.CROSSORIGIN,`${e}`)}get autoplay(){return cr(this,se.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(se.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(se.AUTOPLAY)}get loop(){return cr(this,se.LOOP)!=null}set loop(e){e?this.setAttribute(se.LOOP,""):this.removeAttribute(se.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 cr(this,se.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(se.MUTED,""):this.removeAttribute(se.MUTED)}get playsInline(){return cr(this,se.PLAYSINLINE)!=null}set playsInline(e){Ee("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(se.PRELOAD,e):this.removeAttribute(se.PRELOAD)}};function cr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var sl=nl;var Mc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},x=(t,e,i)=>(Mc(t,e,"read from private field"),i?i.call(t):e.get(t)),Xe=(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)},ht=(t,e,i,a)=>(Mc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Zi,mn,ni,mr,Rt,xt,Dt,si,zi,hn,Pe,yc=1,kc=0,cf=1,mf={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 me&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof me?r.element[r.attributeName]=o:r.value=o}}}},pt=class extends d.DocumentFragment{constructor(e,i,a=mf){var r;super(),Xe(this,Zi,void 0),Xe(this,mn,void 0),this.append(e.content.cloneNode(!0)),ht(this,Zi,Cc(this)),ht(this,mn,a),(r=a.createCallback)==null||r.call(a,this,x(this,Zi),i),a.processCallback(this,x(this,Zi),i)}update(e){x(this,mn).processCallback(this,x(this,Zi),e)}};Zi=new WeakMap;mn=new WeakMap;var Cc=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new ll;for([i,a]of Ic(r.value))if(!i)o.append(a);else{let s=new me(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===yc&&!(r instanceof HTMLTemplateElement))Cc(r,e);else{let o=r.data;if(r.nodeType===yc||o.includes("{{")){let s=[];if(o)for([i,a]of Ic(o))if(!i)s.push(new Text(a));else{let l=new ft(t);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new hr(t,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},Sc={},Ic=t=>{let e="",i=0,a=Sc[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([kc,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([cf,e.trim()]),e="",r++):e+=o||"";return e&&a.push([kc,(i>0?"{{":"")+e]),Sc[t]=a},hf=11,pn=class{get value(){return""}set value(e){}toString(){return this.value}},Lc=new WeakMap,ll=class{constructor(){Xe(this,ni,[])}[Symbol.iterator](){return x(this,ni).values()}get length(){return x(this,ni).length}item(e){return x(this,ni)[e]}append(...e){for(let i of e)i instanceof me&&Lc.set(i,this),x(this,ni).push(i)}toString(){return x(this,ni).join("")}};ni=new WeakMap;var me=class extends pn{constructor(e,i,a){super(),Xe(this,si),Xe(this,mr,""),Xe(this,Rt,void 0),Xe(this,xt,void 0),Xe(this,Dt,void 0),ht(this,Rt,e),ht(this,xt,i),ht(this,Dt,a)}get attributeName(){return x(this,xt)}get attributeNamespace(){return x(this,Dt)}get element(){return x(this,Rt)}get value(){return x(this,mr)}set value(e){x(this,mr)!==e&&(ht(this,mr,e),!x(this,si,zi)||x(this,si,zi).length===1?e==null?x(this,Rt).removeAttributeNS(x(this,Dt),x(this,xt)):x(this,Rt).setAttributeNS(x(this,Dt),x(this,xt),e):x(this,Rt).setAttributeNS(x(this,Dt),x(this,xt),x(this,si,zi).toString()))}get booleanValue(){return x(this,Rt).hasAttributeNS(x(this,Dt),x(this,xt))}set booleanValue(e){if(!x(this,si,zi)||x(this,si,zi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};mr=new WeakMap;Rt=new WeakMap;xt=new WeakMap;Dt=new WeakMap;si=new WeakSet;zi=function(){return Lc.get(this)};var ft=class extends pn{constructor(e,i){super(),Xe(this,hn,void 0),Xe(this,Pe,void 0),ht(this,hn,e),ht(this,Pe,i?[...i]:[new Text])}get replacementNodes(){return x(this,Pe)}get parentNode(){return x(this,hn)}get nextSibling(){return x(this,Pe)[x(this,Pe).length-1].nextSibling}get previousSibling(){return x(this,Pe)[0].previousSibling}get value(){return x(this,Pe).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===hf?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),ht(this,Pe,pf(x(this,Pe)[0].parentNode,x(this,Pe),i,this.nextSibling))}};hn=new WeakMap;Pe=new WeakMap;var hr=class extends ft{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 pf(t,e,i,a=null){let r=0,o,s,l,u=i.length,m=e.length;for(;r<u&&r<m&&e[r]==i[r];)r++;for(;r<u&&r<m&&i[u-1]==e[m-1];)a=i[--m,--u];if(r==m)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<m;)t.removeChild(e[r++]);else{for(o=e[r];r<u;)l=i[r++],s=o?o.nextSibling:a,o==l?o=s:r<u&&i[r]==s?(t.replaceChild(l,o),o=s):t.insertBefore(l,o);for(;o!=a;)s=o.nextSibling,t.removeChild(o),o=s}return i}var wc={string:t=>String(t)},vn=class{constructor(e){this.template=e,this.state=void 0}},li=new WeakMap,di=new WeakMap,dl={partial:(t,e)=>{e[t.expression]=new vn(t.template)},if:(t,e)=>{var i;if(xc(t.expression,e))if(li.get(t)!==t.template){li.set(t,t.template);let a=new pt(t.template,e,En);t.replace(a),di.set(t,a)}else(i=di.get(t))==null||i.update(e);else t.replace(""),li.delete(t),di.delete(t)}},ff=Object.keys(dl),En={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof hr){if(!s.directive){let u=ff.find(m=>s.template.hasAttribute(m));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=dl[s.directive])==null||a.call(dl,s,i);continue}let l=xc(o,i);if(l instanceof vn){li.get(s)!==l.template?(li.set(s,l.template),l=new pt(l.template,l.state,En),s.value=l,di.set(s,l)):(r=di.get(s))==null||r.update(l.state);continue}l?(s instanceof me&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof me?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,li.delete(s),di.delete(s))):s instanceof me?s.value=void 0:(s.value=void 0,li.delete(s),di.delete(s))}}},Rc={"!":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=wc[e])==null?void 0:i.call(wc,t)}};function vf(t){return Ef(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function xc(t,e={}){var i,a,r,o,s,l,u;let m=vf(t);if(m.length===0||m.some(({type:_})=>!_))return pr(t);if(((i=m[0])==null?void 0:i.token)===">"){let _=e[(a=m[1])==null?void 0:a.token];if(!_)return pr(t);let g={...e};_.state=g;let f=m.slice(2);for(let v=0;v<f.length;v+=3){let N=(r=f[v])==null?void 0:r.token,T=(o=f[v+1])==null?void 0:o.token,C=(s=f[v+2])==null?void 0:s.token;N&&T==="="&&(g[N]=fr(C,e))}return _}if(m.length===1)return fn(m[0])?fr(m[0].token,e):pr(t);if(m.length===2){let _=(l=m[0])==null?void 0:l.token,g=Rc[_];if(!g||!fn(m[1]))return pr(t);let f=fr(m[1].token,e);return g(f)}if(m.length===3){let _=(u=m[1])==null?void 0:u.token,g=Rc[_];if(!g||!fn(m[0])||!fn(m[2]))return pr(t);let f=fr(m[0].token,e);if(_==="|")return g(f,m[2].token);let v=fr(m[2].token,e);return g(f,v)}}function pr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function fn({type:t}){return["number","boolean","string","param"].includes(t)}function fr(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):Wr(t)?parseFloat(t):e[t]}function Ef(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 fl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ml=(t,e,i)=>(fl(t,e,"read from private field"),i?i.call(t):e.get(t)),vr=(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)},ui=(t,e,i,a)=>(fl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ul=(t,e,i)=>(fl(t,e,"access private method"),i),Qi,bn,Xi,hl,Dc,gn,pl,cl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Oc=V.createElement("template");Oc.innerHTML=`
|
|
1274
|
+
`}var en=(t,e=t.mediaCurrentTime)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-i)/(a-i);return Math.max(0,Math.min(r,1))},hc=(t,e=t.range.valueAsNumber)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-i)+i},ur=class extends Fe{constructor(){super(),re(this,qi),re(this,js),re(this,on),re(this,nn),re(this,sn),re(this,Qs),re(this,dr),re(this,Xs),re(this,Gi,void 0),re(this,ii,void 0),re(this,an,void 0),re(this,nr,void 0),re(this,rn,void 0),re(this,tn,void 0),re(this,sr,void 0),re(this,lr,void 0),re(this,Yi,void 0),re(this,zs,a=>{this.dragging||(Ai(a)&&(this.range.valueAsNumber=a),this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),ze(this,an,this.shadowRoot.querySelectorAll('[part~="box"]')),ze(this,rn,this.shadowRoot.querySelector('[part~="preview-box"]')),ze(this,tn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);ze(this,sr,parseInt(i.getPropertyValue("--media-box-padding-left"))),ze(this,lr,parseInt(i.getPropertyValue("--media-box-padding-right"))),ze(this,ii,new jo(this.range,ee(this,zs),60))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_DURATION,n.MEDIA_SEEKABLE,n.MEDIA_CURRENT_TIME,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_TIME,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_BUFFERED,n.MEDIA_PLAYBACK_RATE,n.MEDIA_LOADING,n.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",h("seek")),le(this,qi,or).call(this),ze(this,Gi,this.getRootNode()),(e=ee(this,Gi))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),le(this,qi,or).call(this),(e=ee(this,Gi))==null||e.removeEventListener("transitionstart",this),ze(this,Gi,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===n.MEDIA_CURRENT_TIME||e===n.MEDIA_PAUSED||e===n.MEDIA_ENDED||e===n.MEDIA_LOADING||e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE?(ee(this,ii).update({start:en(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),le(this,qi,or).call(this),Jp(this)):e===n.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=ee(this,Yi),this.updateBar()))}get mediaChaptersCues(){return ee(this,Yi)}set mediaChaptersCues(e){var i;ze(this,Yi,e),this.updateSegments((i=ee(this,Yi))==null?void 0:i.map(a=>({start:en(this,a.startTime),end:en(this,a.endTime)})))}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaDuration(){return R(this,n.MEDIA_DURATION)}set mediaDuration(e){O(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return R(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,n.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return R(this,n.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){O(this,n.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(n.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(n.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(n.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,i=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaSeekableStart(){var e;let[i=0]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaPreviewImage(){return I(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return R(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,n.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return k(this,n.MEDIA_ENDED)}set mediaEnded(e){S(this,n.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let i=this.mediaBuffered;if(!i.length)return;let a;if(this.mediaEnded)a=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([l,u])=>l<=o&&o<=u))!=null?e:[];a=en(this,s)}let{style:r}=W(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=W(this.shadowRoot,"#current-rail"),a=W(this.shadowRoot,'[part~="current-box"]'),r=le(this,on,el).call(this,ee(this,tn)),o=le(this,nn,tl).call(this,r,this.range.valueAsNumber),s=le(this,sn,il).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${o})`,i.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":le(this,Xs,mc).call(this);break;case"pointermove":le(this,Qs,cc).call(this,e);break;case"pointerup":case"pointerleave":le(this,dr,ln).call(this,null);break;case"transitionstart":de(e.target,this)&&setTimeout(()=>le(this,qi,or).call(this),0);break}}};Gi=new WeakMap;ii=new WeakMap;an=new WeakMap;nr=new WeakMap;rn=new WeakMap;tn=new WeakMap;sr=new WeakMap;lr=new WeakMap;Yi=new WeakMap;qi=new WeakSet;or=function(){le(this,js,uc).call(this)?ee(this,ii).start():ee(this,ii).stop()};js=new WeakSet;uc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Qr(this)};zs=new WeakMap;on=new WeakSet;el=function(t){var e;let a=((e=this.getAttribute("bounds")?He(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),o=t.offsetWidth,s=-(r.left-a.left-o/2),l=a.right-r.left-o/2;return{box:{width:o,min:s,max:l},bounds:a,range:r}};nn=new WeakSet;tl=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:o}=t.box;if(!a)return i;if(Number.isNaN(r)||(i=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${i})`),!Number.isNaN(o)){let l=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;i=`min(${i}, ${l})`}return i};sn=new WeakSet;il=function(t,e){let{width:i,min:a,max:r}=t.box,o=e*t.range.width;if(o<a+ee(this,sr)){let s=t.range.left-t.bounds.left-ee(this,sr);return`${o-i/2+s}px`}if(o>r-ee(this,lr)){let s=t.bounds.right-t.range.right-ee(this,lr);return`${o+i/2-s-t.range.width}px`}return 0};Qs=new WeakSet;cc=function(t){let e=[...ee(this,an)].some(_=>t.composedPath().includes(_));if(!this.dragging&&(e||!t.composedPath().includes(this))){le(this,dr,ln).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=W(this.shadowRoot,"#preview-rail"),r=W(this.shadowRoot,'[part~="preview-box"]'),o=le(this,on,el).call(this,ee(this,rn)),s=(t.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let l=le(this,nn,tl).call(this,o,s),u=le(this,sn,il).call(this,o,s);a.style.transform=`translateX(${l})`,a.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${o.box.width}px`);let m=Math.round(ee(this,nr))-Math.round(s*i);Math.abs(m)<1&&s>.01&&s<.99||(ze(this,nr,s*i),le(this,dr,ln).call(this,ee(this,nr)))};dr=new WeakSet;ln=function(t){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Xs=new WeakSet;mc=function(){ee(this,ii).stop();let t=hc(this);this.dispatchEvent(new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};ur.shadowRootOptions={mode:"open"};ur.getTemplateHTML=jp;d.customElements.get("media-time-range")||d.customElements.define("media-time-range",ur);var ef=1,tf=t=>t.mediaMuted?0:t.mediaVolume,af=t=>`${Math.round(t*100)}%`,al=class extends Fe{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME,n.MEDIA_MUTED,n.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",h("volume"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_VOLUME||e===n.MEDIA_MUTED)&&(this.range.valueAsNumber=tf(this),this.range.setAttribute("aria-valuetext",af(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return R(this,n.MEDIA_VOLUME,ef)}set mediaVolume(e){O(this,n.MEDIA_VOLUME,e)}get mediaMuted(){return k(this,n.MEDIA_MUTED)}set mediaMuted(e){S(this,n.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return I(this,n.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,n.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",al);var b=require("@mux/mux-video/base"),w=require("@mux/playback-core");var gc=require("@mux/playback-core");var oi=require("@mux/playback-core");function pc(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 un(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ue(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function rl(t){let e=rf(t).toString();return e?"?"+e:""}function rf(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var ol=(t,e)=>!t||!e?!1:t.contains(e)?!0:ol(t,e.getRootNode().host);var fc="mux.com",of=()=>{try{return"3.5.3"}catch{}return"UNKNOWN"},nf=of(),mn=()=>nf,vc=(t,{token:e,customDomain:i=fc,thumbnailTime:a,programTime:r}={})=>{var l;let o=e==null?a:void 0,{aud:s}=(l=(0,oi.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${rl({token:e,time:o,program_time:r})}`},Ec=(t,{token:e,customDomain:i=fc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,oi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${rl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},cr=t=>{if(t){if([oi.StreamTypes.LIVE,oi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return oi.StreamTypes.LIVE}};var sf={crossorigin:"crossOrigin",playsinline:"playsInline"};function bc(t){var e;return(e=sf[t])!=null?e:un(t)}var ai,ri,ce,cn=class{constructor(e,i){he(this,ai);he(this,ri);he(this,ce,[]);Te(this,ai,e),Te(this,ri,i)}[Symbol.iterator](){return U(this,ce).values()}get length(){return U(this,ce).length}get value(){var e;return(e=U(this,ce).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Te(this,ce,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return U(this,ce)[e]}values(){return U(this,ce).values()}keys(){return U(this,ce).keys()}forEach(e){U(this,ce).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||U(this,ce).push(r)}),!(this.value===""&&!((i=U(this,ai))!=null&&i.hasAttribute(`${U(this,ri)}`)))&&((a=U(this,ai))==null||a.setAttribute(`${U(this,ri)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{U(this,ce).splice(U(this,ce).indexOf(a),1)}),(i=U(this,ai))==null||i.setAttribute(`${U(this,ri)}`,`${this.value}`)}contains(e){return U(this,ce).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)}};ai=new WeakMap,ri=new WeakMap,ce=new WeakMap;var _c=`[mux-player ${mn()}]`;function Qe(...t){console.warn(_c,...t)}function Ee(...t){console.error(_c,...t)}function nl(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,gc.i18n)("Read more: ")}
|
|
1275
|
+
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),Qe(e)}var se={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},wt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Z1={...se,...wt},Tc=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}}),lf=Object.values(se).filter(t=>se.PLAYSINLINE!==t),df=Object.values(wt),uf=[...lf,...df],sl=class extends ye.HTMLElement{static get observedAttributes(){return uf}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case wt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case wt.VOLUME:{let s=(r=ue(a))!=null?r:1;this.media&&(this.media.volume=s);return}case wt.PLAYBACKRATE:{let s=(o=ue(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:Tc}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Tc}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=ue(this.getAttribute(wt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(wt.PLAYBACKRATE,`${e}`):this.removeAttribute(wt.PLAYBACKRATE)}get crossOrigin(){return mr(this,se.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(se.CROSSORIGIN,`${e}`)}get autoplay(){return mr(this,se.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(se.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(se.AUTOPLAY)}get loop(){return mr(this,se.LOOP)!=null}set loop(e){e?this.setAttribute(se.LOOP,""):this.removeAttribute(se.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 mr(this,se.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(se.MUTED,""):this.removeAttribute(se.MUTED)}get playsInline(){return mr(this,se.PLAYSINLINE)!=null}set playsInline(e){Ee("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(se.PRELOAD,e):this.removeAttribute(se.PRELOAD)}};function mr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var ll=sl;var Mc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},x=(t,e,i)=>(Mc(t,e,"read from private field"),i?i.call(t):e.get(t)),Xe=(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)},ht=(t,e,i,a)=>(Mc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Zi,hn,ni,hr,Rt,xt,Dt,si,zi,pn,Pe,yc=1,kc=0,cf=1,mf={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 me&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof me?r.element[r.attributeName]=o:r.value=o}}}},pt=class extends d.DocumentFragment{constructor(e,i,a=mf){var r;super(),Xe(this,Zi,void 0),Xe(this,hn,void 0),this.append(e.content.cloneNode(!0)),ht(this,Zi,Cc(this)),ht(this,hn,a),(r=a.createCallback)==null||r.call(a,this,x(this,Zi),i),a.processCallback(this,x(this,Zi),i)}update(e){x(this,hn).processCallback(this,x(this,Zi),e)}};Zi=new WeakMap;hn=new WeakMap;var Cc=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new dl;for([i,a]of Ic(r.value))if(!i)o.append(a);else{let s=new me(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===yc&&!(r instanceof HTMLTemplateElement))Cc(r,e);else{let o=r.data;if(r.nodeType===yc||o.includes("{{")){let s=[];if(o)for([i,a]of Ic(o))if(!i)s.push(new Text(a));else{let l=new ft(t);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new pr(t,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},Sc={},Ic=t=>{let e="",i=0,a=Sc[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([kc,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([cf,e.trim()]),e="",r++):e+=o||"";return e&&a.push([kc,(i>0?"{{":"")+e]),Sc[t]=a},hf=11,fn=class{get value(){return""}set value(e){}toString(){return this.value}},Lc=new WeakMap,dl=class{constructor(){Xe(this,ni,[])}[Symbol.iterator](){return x(this,ni).values()}get length(){return x(this,ni).length}item(e){return x(this,ni)[e]}append(...e){for(let i of e)i instanceof me&&Lc.set(i,this),x(this,ni).push(i)}toString(){return x(this,ni).join("")}};ni=new WeakMap;var me=class extends fn{constructor(e,i,a){super(),Xe(this,si),Xe(this,hr,""),Xe(this,Rt,void 0),Xe(this,xt,void 0),Xe(this,Dt,void 0),ht(this,Rt,e),ht(this,xt,i),ht(this,Dt,a)}get attributeName(){return x(this,xt)}get attributeNamespace(){return x(this,Dt)}get element(){return x(this,Rt)}get value(){return x(this,hr)}set value(e){x(this,hr)!==e&&(ht(this,hr,e),!x(this,si,zi)||x(this,si,zi).length===1?e==null?x(this,Rt).removeAttributeNS(x(this,Dt),x(this,xt)):x(this,Rt).setAttributeNS(x(this,Dt),x(this,xt),e):x(this,Rt).setAttributeNS(x(this,Dt),x(this,xt),x(this,si,zi).toString()))}get booleanValue(){return x(this,Rt).hasAttributeNS(x(this,Dt),x(this,xt))}set booleanValue(e){if(!x(this,si,zi)||x(this,si,zi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};hr=new WeakMap;Rt=new WeakMap;xt=new WeakMap;Dt=new WeakMap;si=new WeakSet;zi=function(){return Lc.get(this)};var ft=class extends fn{constructor(e,i){super(),Xe(this,pn,void 0),Xe(this,Pe,void 0),ht(this,pn,e),ht(this,Pe,i?[...i]:[new Text])}get replacementNodes(){return x(this,Pe)}get parentNode(){return x(this,pn)}get nextSibling(){return x(this,Pe)[x(this,Pe).length-1].nextSibling}get previousSibling(){return x(this,Pe)[0].previousSibling}get value(){return x(this,Pe).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===hf?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),ht(this,Pe,pf(x(this,Pe)[0].parentNode,x(this,Pe),i,this.nextSibling))}};pn=new WeakMap;Pe=new WeakMap;var pr=class extends ft{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 pf(t,e,i,a=null){let r=0,o,s,l,u=i.length,m=e.length;for(;r<u&&r<m&&e[r]==i[r];)r++;for(;r<u&&r<m&&i[u-1]==e[m-1];)a=i[--m,--u];if(r==m)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<m;)t.removeChild(e[r++]);else{for(o=e[r];r<u;)l=i[r++],s=o?o.nextSibling:a,o==l?o=s:r<u&&i[r]==s?(t.replaceChild(l,o),o=s):t.insertBefore(l,o);for(;o!=a;)s=o.nextSibling,t.removeChild(o),o=s}return i}var wc={string:t=>String(t)},En=class{constructor(e){this.template=e,this.state=void 0}},li=new WeakMap,di=new WeakMap,ul={partial:(t,e)=>{e[t.expression]=new En(t.template)},if:(t,e)=>{var i;if(xc(t.expression,e))if(li.get(t)!==t.template){li.set(t,t.template);let a=new pt(t.template,e,bn);t.replace(a),di.set(t,a)}else(i=di.get(t))==null||i.update(e);else t.replace(""),li.delete(t),di.delete(t)}},ff=Object.keys(ul),bn={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof pr){if(!s.directive){let u=ff.find(m=>s.template.hasAttribute(m));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=ul[s.directive])==null||a.call(ul,s,i);continue}let l=xc(o,i);if(l instanceof En){li.get(s)!==l.template?(li.set(s,l.template),l=new pt(l.template,l.state,bn),s.value=l,di.set(s,l)):(r=di.get(s))==null||r.update(l.state);continue}l?(s instanceof me&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof me?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,li.delete(s),di.delete(s))):s instanceof me?s.value=void 0:(s.value=void 0,li.delete(s),di.delete(s))}}},Rc={"!":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=wc[e])==null?void 0:i.call(wc,t)}};function vf(t){return Ef(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function xc(t,e={}){var i,a,r,o,s,l,u;let m=vf(t);if(m.length===0||m.some(({type:_})=>!_))return fr(t);if(((i=m[0])==null?void 0:i.token)===">"){let _=e[(a=m[1])==null?void 0:a.token];if(!_)return fr(t);let g={...e};_.state=g;let f=m.slice(2);for(let v=0;v<f.length;v+=3){let N=(r=f[v])==null?void 0:r.token,T=(o=f[v+1])==null?void 0:o.token,C=(s=f[v+2])==null?void 0:s.token;N&&T==="="&&(g[N]=vr(C,e))}return _}if(m.length===1)return vn(m[0])?vr(m[0].token,e):fr(t);if(m.length===2){let _=(l=m[0])==null?void 0:l.token,g=Rc[_];if(!g||!vn(m[1]))return fr(t);let f=vr(m[1].token,e);return g(f)}if(m.length===3){let _=(u=m[1])==null?void 0:u.token,g=Rc[_];if(!g||!vn(m[0])||!vn(m[2]))return fr(t);let f=vr(m[0].token,e);if(_==="|")return g(f,m[2].token);let v=vr(m[2].token,e);return g(f,v)}}function fr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function vn({type:t}){return["number","boolean","string","param"].includes(t)}function vr(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):Fr(t)?parseFloat(t):e[t]}function Ef(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 vl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},hl=(t,e,i)=>(vl(t,e,"read from private field"),i?i.call(t):e.get(t)),Er=(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)},ui=(t,e,i,a)=>(vl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),cl=(t,e,i)=>(vl(t,e,"access private method"),i),Qi,gn,Xi,pl,Dc,_n,fl,ml={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Oc=V.createElement("template");Oc.innerHTML=`
|
|
1276
1276
|
<style>
|
|
1277
1277
|
:host {
|
|
1278
1278
|
display: inline-block;
|
|
@@ -1299,7 +1299,7 @@ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),Qe(e)}var se={AU
|
|
|
1299
1299
|
display: none;
|
|
1300
1300
|
}
|
|
1301
1301
|
</style>
|
|
1302
|
-
`;var ci=class extends d.HTMLElement{constructor(){super(),
|
|
1302
|
+
`;var ci=class extends d.HTMLElement{constructor(){super(),Er(this,pl),Er(this,_n),Er(this,Qi,void 0),Er(this,gn,void 0),Er(this,Xi,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(i=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||i.some(r=>{let o=r.target;return o===this?!0:o.localName!=="media-controller"?!1:!!(ml[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(Ce.BREAKPOINTS_COMPUTED,this.render),cl(this,pl,Dc).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=hl(this,Qi))!=null?e:this.constructor.template}set template(e){ui(this,Xi,null),ui(this,Qi,e),this.createRenderer()}get props(){var e,i,a;let r=[...Array.from((i=(e=this.mediaController)==null?void 0:e.attributes)!=null?i:[]).filter(({name:s})=>ml[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],o={};for(let s of r){let l=(a=ml[s.name])!=null?a:Hd(s.name),{value:u}=s;u!=null?(Fr(u)&&(u=parseFloat(u)),o[l]=u===""?!0:u):o[l]=!1}return o}attributeChangedCallback(e,i,a){e==="template"&&i!=a&&cl(this,_n,fl).call(this)}connectedCallback(){cl(this,_n,fl).call(this)}createRenderer(){this.template&&this.template!==hl(this,gn)&&(ui(this,gn,this.template),this.renderer=new pt(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Oc.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Qi=new WeakMap;gn=new WeakMap;Xi=new WeakMap;pl=new WeakSet;Dc=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}};_n=new WeakSet;fl=function(){var t;let e=this.getAttribute("template");if(!e||e===hl(this,Xi))return;let i=this.getRootNode(),a=(t=i==null?void 0:i.getElementById)==null?void 0:t.call(i,e);if(a){ui(this,Xi,e),ui(this,Qi,a),this.createRenderer();return}bf(e)&&(ui(this,Xi,e),gf(e).then(r=>{let o=V.createElement("template");o.innerHTML=r,ui(this,Qi,o),this.createRenderer()}).catch(console.error))};ci.observedAttributes=["template"];ci.processor=bn;function bf(t){if(!/^(\/|\.\/|https?:\/\/)/.test(t))return!1;let e=/^https?:\/\//.test(t)?void 0:location.origin;try{new URL(t,e)}catch{return!1}return!0}async function gf(t){let e=await fetch(t);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}d.customElements.get("media-theme")||d.customElements.define("media-theme",ci);var Nc=`:host {
|
|
1303
1303
|
--media-control-display: var(--controls);
|
|
1304
1304
|
--media-loading-indicator-display: var(--loading-indicator);
|
|
1305
1305
|
--media-dialog-display: var(--dialog);
|
|
@@ -1449,19 +1449,19 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1449
1449
|
:host([no-tooltips]) {
|
|
1450
1450
|
--media-tooltip-display: none;
|
|
1451
1451
|
}
|
|
1452
|
-
`;var
|
|
1452
|
+
`;var br=new WeakMap,bl=class t{constructor(e,i){this.element=e;this.type=i;this.element.addEventListener(this.type,this);let a=br.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let i=br.get(this.element);i&&i.delete(this.type)}}static for(e){br.has(e.element)||br.set(e.element,new Map);let i=e.attributeName.slice(2),a=br.get(e.element);return a&&a.has(i)?a.get(i):new t(e.element,i)}};function Af(t,e){return t instanceof me&&t.attributeName.startsWith("on")?(bl.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function Tf(t,e){return e instanceof An&&t instanceof ft?(e.renderInto(t),!0):!1}function yf(t,e){return e instanceof DocumentFragment&&t instanceof ft?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function kf(t,e){if(t instanceof me){let i=t.attributeNamespace,a=t.element.getAttributeNS(i,t.attributeName);return String(e)!==a&&(t.value=String(e)),!0}return t.value=String(e),!0}function Sf(t,e){if(t instanceof me&&e instanceof Element){let i=t.element;return i[t.attributeName]!==e&&(t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),i[t.attributeName]=e),!0}return!1}function If(t,e){if(typeof e=="boolean"&&t instanceof me){let i=t.attributeNamespace,a=t.element.hasAttributeNS(i,t.attributeName);return e!==a&&(t.booleanValue=e),!0}return!1}function Mf(t,e){return e===!1&&t instanceof ft?(t.replace(""),!0):!1}function Cf(t,e){Sf(t,e)||If(t,e)||Af(t,e)||Mf(t,e)||Tf(t,e)||yf(t,e)||kf(t,e)}var El=new Map,Pc=new WeakMap,Uc=new WeakMap,An=class{constructor(e,i,a){this.strings=e;this.values=i;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(El.has(this.stringsKey))return El.get(this.stringsKey);{let e=_i.createElement("template"),i=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,o)=>a+r+(o<i?`{{ ${o} }}`:""),""),El.set(this.stringsKey,e),e}}renderInto(e){var r;let i=this.template;if(Pc.get(e)!==i){Pc.set(e,i);let o=new pt(i,this.values,this.processor);Uc.set(e,o),e instanceof ft?e.replace(...o.children):e.appendChild(o);return}let a=Uc.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Lf={processCallback(t,e,i){var a;if(i){for(let[r,o]of e)if(r in i){let s=(a=i[r])!=null?a:"";Cf(o,s)}}}};function gr(t,...e){return new An(t,e,Lf)}function Hc(t,e){t.renderInto(e)}var _r=require("@mux/playback-core"),wf=t=>{let{tokens:e}=t;return e.drm?":host(:not([cast-receiver])) { --_cast-button-drm-display: none; }":""},Bc=t=>gr`
|
|
1453
1453
|
<style>
|
|
1454
1454
|
${wf(t)}
|
|
1455
1455
|
${Nc}
|
|
1456
1456
|
</style>
|
|
1457
1457
|
${Of(t)}
|
|
1458
|
-
`,Rf=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return
|
|
1458
|
+
`,Rf=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return cr(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},xf={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",DISPLAY:"display",CONTROL_BAR:"control-bar",MENU_BUTTON:"menu-button",MENU:"menu",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"},Df=Object.values(xf).join(", "),Of=t=>{var e,i,a,r,o,s,l,u,m,_,g,f,v,N,T,C,P,j,ge,bt,ot,ca,ma,ha,pa,fa,va,Ea,ba,ga,_a,Aa,Wr,nt,Ta,ya;return gr`
|
|
1459
1459
|
<media-theme
|
|
1460
1460
|
template="${t.themeTemplate||!1}"
|
|
1461
1461
|
defaultstreamtype="${(e=t.defaultStreamType)!=null?e:!1}"
|
|
1462
1462
|
hotkeys="${Rf(t)||!1}"
|
|
1463
1463
|
nohotkeys="${t.noHotKeys||!t.hasSrc||!1}"
|
|
1464
|
-
noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(
|
|
1464
|
+
noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(_r.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
|
|
1465
1465
|
novolumepref="${t.novolumepref||!1}"
|
|
1466
1466
|
disabled="${!t.hasSrc||t.isDialogOpen}"
|
|
1467
1467
|
audio="${(a=t.audio)!=null?a:!1}"
|
|
@@ -1482,33 +1482,34 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1482
1482
|
>
|
|
1483
1483
|
<mux-video
|
|
1484
1484
|
slot="media"
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1485
|
+
inert="${(N=t.noHotKeys)!=null?N:!1}"
|
|
1486
|
+
target-live-window="${(T=t.targetLiveWindow)!=null?T:!1}"
|
|
1487
|
+
stream-type="${(C=cr(t.streamType))!=null?C:!1}"
|
|
1488
|
+
crossorigin="${(P=t.crossOrigin)!=null?P:""}"
|
|
1488
1489
|
playsinline
|
|
1489
|
-
autoplay="${(
|
|
1490
|
-
muted="${(
|
|
1491
|
-
loop="${(
|
|
1492
|
-
preload="${(
|
|
1493
|
-
debug="${(
|
|
1494
|
-
prefer-cmcd="${(
|
|
1495
|
-
disable-tracking="${(
|
|
1496
|
-
disable-cookies="${(
|
|
1497
|
-
prefer-playback="${(
|
|
1490
|
+
autoplay="${(j=t.autoplay)!=null?j:!1}"
|
|
1491
|
+
muted="${(ge=t.muted)!=null?ge:!1}"
|
|
1492
|
+
loop="${(bt=t.loop)!=null?bt:!1}"
|
|
1493
|
+
preload="${(ot=t.preload)!=null?ot:!1}"
|
|
1494
|
+
debug="${(ca=t.debug)!=null?ca:!1}"
|
|
1495
|
+
prefer-cmcd="${(ma=t.preferCmcd)!=null?ma:!1}"
|
|
1496
|
+
disable-tracking="${(ha=t.disableTracking)!=null?ha:!1}"
|
|
1497
|
+
disable-cookies="${(pa=t.disableCookies)!=null?pa:!1}"
|
|
1498
|
+
prefer-playback="${(fa=t.preferPlayback)!=null?fa:!1}"
|
|
1498
1499
|
start-time="${t.startTime!=null?t.startTime:!1}"
|
|
1499
|
-
beacon-collection-domain="${(
|
|
1500
|
-
player-init-time="${(
|
|
1501
|
-
player-software-name="${(
|
|
1502
|
-
player-software-version="${(
|
|
1503
|
-
env-key="${(
|
|
1504
|
-
custom-domain="${(
|
|
1505
|
-
src="${t.src?t.src:t.playbackId?(0,
|
|
1506
|
-
cast-src="${t.src?t.src:t.playbackId?(0,
|
|
1507
|
-
cast-receiver="${(
|
|
1508
|
-
drm-token="${(
|
|
1500
|
+
beacon-collection-domain="${(va=t.beaconCollectionDomain)!=null?va:!1}"
|
|
1501
|
+
player-init-time="${(Ea=t.playerInitTime)!=null?Ea:!1}"
|
|
1502
|
+
player-software-name="${(ba=t.playerSoftwareName)!=null?ba:!1}"
|
|
1503
|
+
player-software-version="${(ga=t.playerSoftwareVersion)!=null?ga:!1}"
|
|
1504
|
+
env-key="${(_a=t.envKey)!=null?_a:!1}"
|
|
1505
|
+
custom-domain="${(Aa=t.customDomain)!=null?Aa:!1}"
|
|
1506
|
+
src="${t.src?t.src:t.playbackId?(0,_r.toMuxVideoURL)(t):!1}"
|
|
1507
|
+
cast-src="${t.src?t.src:t.playbackId?(0,_r.toMuxVideoURL)(t):!1}"
|
|
1508
|
+
cast-receiver="${(Wr=t.castReceiver)!=null?Wr:!1}"
|
|
1509
|
+
drm-token="${(Ta=(nt=t.tokens)==null?void 0:nt.drm)!=null?Ta:!1}"
|
|
1509
1510
|
exportparts="video"
|
|
1510
1511
|
>
|
|
1511
|
-
${t.storyboard?
|
|
1512
|
+
${t.storyboard?gr`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:gr``}
|
|
1512
1513
|
<slot></slot>
|
|
1513
1514
|
</mux-video>
|
|
1514
1515
|
<slot name="poster" slot="poster">
|
|
@@ -1516,11 +1517,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1516
1517
|
part="poster"
|
|
1517
1518
|
exportparts="poster, img"
|
|
1518
1519
|
src="${t.poster?t.poster:!1}"
|
|
1519
|
-
placeholdersrc="${(
|
|
1520
|
+
placeholdersrc="${(ya=t.placeholder)!=null?ya:!1}"
|
|
1520
1521
|
></media-poster-image>
|
|
1521
1522
|
</slot>
|
|
1522
1523
|
</media-theme>
|
|
1523
|
-
`};var A=require("@mux/playback-core"),$c=t=>t.charAt(0).toUpperCase()+t.slice(1),Nf=(t,e=!1)=>{var i,a;if(t.muxCode){let r=$c((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);if(t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE)return(0,A.i18n)("Your device appears to be offline",e);if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,A.i18n)("{category} URL has expired",e).format({category:r});if([A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,A.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,A.i18n)("Invalid {categoryName} URL",e).format({categoryName:o});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return(0,A.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_READY){let s=t.streamType==="live"?"Live stream":"Video";return(0,A.i18n)("{mediaType} is not currently available",e).format({mediaType:s})}}if(t.code){if(t.code===A.MediaError.MEDIA_ERR_NETWORK)return(0,A.i18n)("Network Error",e);if(t.code===A.MediaError.MEDIA_ERR_DECODE)return(0,A.i18n)("Media Error",e);if(t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,A.i18n)("Source Not Supported",e)}return(0,A.i18n)("Error",e)},Pf=(t,e=!1)=>{var i,a;if(t.muxCode){let r=$c((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);return t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE?(0,A.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,A.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,A.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,A.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:o}):[A.MuxErrorCode.NETWORK_TOKEN_MISSING,A.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,A.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND?"":t.message}return t.code&&(t.code===A.MediaError.MEDIA_ERR_NETWORK||t.code===A.MediaError.MEDIA_ERR_DECODE||t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},Wc=(t,e=!1)=>{let i=Nf(t,e).toString(),a=Pf(t,e).toString();return{title:i,message:a}},Uf=t=>{if(t.muxCode){if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===A.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===A.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},
|
|
1524
|
+
`};var A=require("@mux/playback-core"),$c=t=>t.charAt(0).toUpperCase()+t.slice(1),Nf=(t,e=!1)=>{var i,a;if(t.muxCode){let r=$c((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);if(t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE)return(0,A.i18n)("Your device appears to be offline",e);if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,A.i18n)("{category} URL has expired",e).format({category:r});if([A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,A.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,A.i18n)("Invalid {categoryName} URL",e).format({categoryName:o});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return(0,A.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_READY){let s=t.streamType==="live"?"Live stream":"Video";return(0,A.i18n)("{mediaType} is not currently available",e).format({mediaType:s})}}if(t.code){if(t.code===A.MediaError.MEDIA_ERR_NETWORK)return(0,A.i18n)("Network Error",e);if(t.code===A.MediaError.MEDIA_ERR_DECODE)return(0,A.i18n)("Media Error",e);if(t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,A.i18n)("Source Not Supported",e)}return(0,A.i18n)("Error",e)},Pf=(t,e=!1)=>{var i,a;if(t.muxCode){let r=$c((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);return t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE?(0,A.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,A.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,A.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,A.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:o}):[A.MuxErrorCode.NETWORK_TOKEN_MISSING,A.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,A.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND?"":t.message}return t.code&&(t.code===A.MediaError.MEDIA_ERR_NETWORK||t.code===A.MediaError.MEDIA_ERR_DECODE||t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},Wc=(t,e=!1)=>{let i=Nf(t,e).toString(),a=Pf(t,e).toString();return{title:i,message:a}},Uf=t=>{if(t.muxCode){if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===A.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===A.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},gl=(t,e)=>{let i=Uf(t);return{message:t.message,context:t.context,file:i}};var Fc=`<template id="media-theme-gerwig">
|
|
1524
1525
|
<style>
|
|
1525
1526
|
@keyframes pre-play-hide {
|
|
1526
1527
|
0% {
|
|
@@ -2648,7 +2649,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2648
2649
|
<slot></slot>
|
|
2649
2650
|
</media-controller>
|
|
2650
2651
|
</template>
|
|
2651
|
-
`;function Vc({anchor:t,floating:e,placement:i}){let a=Bf({anchor:t,floating:e}),{x:r,y:o}=Wf(a,i);return{x:r,y:o}}function Bf({anchor:t,floating:e}){return{anchor:$f(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function $f(t,e){var i;let a=t.getBoundingClientRect(),r=(i=e==null?void 0:e.getBoundingClientRect())!=null?i:{x:0,y:0};return{x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}function Wf({anchor:t,floating:e},i){let a=Ff(i)==="x"?"y":"x",r=a==="y"?"height":"width",o=Kc(i),s=t.x+t.width/2-e.width/2,l=t.y+t.height/2-e.height/2,u=t[r]/2-e[r]/2,m;switch(o){case"top":m={x:s,y:t.y-e.height};break;case"bottom":m={x:s,y:t.y+t.height};break;case"right":m={x:t.x+t.width,y:l};break;case"left":m={x:t.x-e.width,y:l};break;default:m={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":m[a]-=u;break;case"end":m[a]+=u;break}return m}function Kc(t){return t.split("-")[0]}function Ff(t){return["top","bottom"].includes(Kc(t))?"y":"x"}var Ot=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},
|
|
2652
|
+
`;function Vc({anchor:t,floating:e,placement:i}){let a=Bf({anchor:t,floating:e}),{x:r,y:o}=Wf(a,i);return{x:r,y:o}}function Bf({anchor:t,floating:e}){return{anchor:$f(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function $f(t,e){var i;let a=t.getBoundingClientRect(),r=(i=e==null?void 0:e.getBoundingClientRect())!=null?i:{x:0,y:0};return{x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}function Wf({anchor:t,floating:e},i){let a=Ff(i)==="x"?"y":"x",r=a==="y"?"height":"width",o=Kc(i),s=t.x+t.width/2-e.width/2,l=t.y+t.height/2-e.height/2,u=t[r]/2-e[r]/2,m;switch(o){case"top":m={x:s,y:t.y-e.height};break;case"bottom":m={x:s,y:t.y+t.height};break;case"right":m={x:t.x+t.width,y:l};break;case"left":m={x:t.x-e.width,y:l};break;default:m={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":m[a]-=u;break;case"end":m[a]+=u;break}return m}function Kc(t){return t.split("-")[0]}function Ff(t){return["top","bottom"].includes(Kc(t))?"y":"x"}var Ot=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},Tn=class extends Event{constructor({newState:e,oldState:i,...a}){super("toggle",a),this.newState=e,this.oldState=i}};var Rl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},H=(t,e,i)=>(Rl(t,e,"read from private field"),i?i.call(t):e.get(t)),G=(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)},Je=(t,e,i,a)=>(Rl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),q=(t,e,i)=>(Rl(t,e,"access private method"),i),je,hi,Nt,yn,kn,pi,yr,_l,Gc,Mn,Sn,Al,Tl,Yc,yl,qc,kl,Zc,Ji,ji,ea,kr,Cn,xl,Sl,zc,Dl,Qc,Il,Xc,Ol,Jc,Ml,jc,Cl,em,Ar,Ln,Ll,tm,Tr,wn,In,wl;function et({type:t,text:e,value:i,checked:a}){let r=V.createElement("media-chrome-menu-item");r.type=t!=null?t:"",r.part.add("menu-item"),t&&r.part.add(t),r.value=i,r.checked=a;let o=V.createElement("span");return o.textContent=e,r.append(o),r}function Ue(t,e){let i=t.querySelector(`:scope > [slot="${e}"]`);if((i==null?void 0:i.nodeName)=="SLOT"&&(i=i.assignedElements({flatten:!0})[0]),i)return i=i.cloneNode(!0),i;let a=t.shadowRoot.querySelector(`[name="${e}"] > svg`);return a?a.cloneNode(!0):""}function Vf(t){return`
|
|
2652
2653
|
<style>
|
|
2653
2654
|
:host {
|
|
2654
2655
|
font: var(--media-font,
|
|
@@ -2822,7 +2823,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2822
2823
|
<slot></slot>
|
|
2823
2824
|
</div>
|
|
2824
2825
|
<slot name="checked-indicator" hidden></slot>
|
|
2825
|
-
`}var mi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},oe=class extends d.HTMLElement{constructor(){if(super(),G(this,gl),G(this,kn),G(this,Al),G(this,Tl),G(this,yl),G(this,ea),G(this,Mn),G(this,kl),G(this,xl),G(this,Sl),G(this,Dl),G(this,Il),G(this,Ml),G(this,_r),G(this,Cl),G(this,Ar),G(this,Sn),G(this,je,null),G(this,hi,null),G(this,Nt,null),G(this,Tn,new Set),G(this,yn,void 0),G(this,pi,!1),G(this,Tr,null),G(this,In,()=>{let e=H(this,Tn),i=new Set(this.items);for(let a of e)i.has(a)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:a}));for(let a of i)e.has(a)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:a}));Je(this,Tn,i)}),G(this,Ji,()=>{q(this,ea,yr).call(this),q(this,Mn,Rl).call(this,!1)}),G(this,ji,()=>{q(this,ea,yr).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),Je(this,yn,new MutationObserver(H(this,In))),H(this,yn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[mi.DISABLED,mi.HIDDEN,mi.STYLE,mi.ANCHOR,L.MEDIA_CONTROLLER]}static formatMenuItemText(e,i){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":q(this,gl,Gc).call(this,e);break;case"invoke":q(this,Al,Yc).call(this,e);break;case"click":q(this,kl,zc).call(this,e);break;case"toggle":q(this,Sl,Xc).call(this,e);break;case"focusout":q(this,Il,jc).call(this,e);break;case"keydown":q(this,Ml,em).call(this,e);break}}connectedCallback(){var e,i;Je(this,Tr,rs(this.shadowRoot,":host")),q(this,kn,_l).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Je(this,je,Yr(this)),(i=(e=H(this,je))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(st(kr(this),H(this,Ji)),st(this,H(this,ji)))}disconnectedCallback(){var e,i;lt(kr(this),H(this,Ji)),lt(this,H(this,ji)),this.disable(),(i=(e=H(this,je))==null?void 0:e.unassociateElement)==null||i.call(e,this),Je(this,je,null)}attributeChangedCallback(e,i,a){var r,o,s,l;e===mi.HIDDEN&&a!==i?(H(this,pi)||Je(this,pi,!0),this.hidden?q(this,yl,Zc).call(this):q(this,Tl,qc).call(this),this.dispatchEvent(new An({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===L.MEDIA_CONTROLLER?(i&&((o=(r=H(this,je))==null?void 0:r.unassociateElement)==null||o.call(r,this),Je(this,je,null)),a&&this.isConnected&&(Je(this,je,Yr(this)),(l=(s=H(this,je))==null?void 0:s.associateElement)==null||l.call(s,this))):e===mi.DISABLED&&a!==i?a==null?this.enable():this.disable():e===mi.STYLE&&a!==i&&q(this,kn,_l).call(this)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=Wt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Kf)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,i;return(i=(e=this.checkedItems[0])==null?void 0:e.value)!=null?i:""}set value(e){let i=this.items.find(a=>a.value===e);i&&q(this,Sn,Ll).call(this,i)}focus(){if(Je(this,hi,Ma()),this.items.length){q(this,Ar,Ln).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var i;let a=q(this,_r,Cn).call(this,e);a&&(q(this,Sn,Ll).call(this,a,a.type==="checkbox"),H(this,Nt)&&!this.hidden&&((i=H(this,hi))==null||i.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var i,a;let{key:r}=e,o=this.items,s=(a=(i=q(this,_r,Cn).call(this,e))!=null?i:q(this,Cl,tm).call(this))!=null?a:o[0],l=o.indexOf(s),u=Math.max(0,l);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=o.length-1),u<0&&(u=o.length-1),u>o.length-1&&(u=0),q(this,Ar,Ln).call(this,o[u]),o[u].focus()}};je=new WeakMap;hi=new WeakMap;Nt=new WeakMap;Tn=new WeakMap;yn=new WeakMap;pi=new WeakMap;Tr=new WeakMap;gl=new WeakSet;Gc=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:!0}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();if(["header","title"].includes(e.name)){let i=this.shadowRoot.querySelector('slot[name="header"]');i.hidden=e.assignedNodes().length===0}e.name||H(this,In).call(this)};In=new WeakMap;kn=new WeakSet;_l=function(){var t;let e=this.shadowRoot.querySelector("#layout-row"),i=(t=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:t.trim();e.setAttribute("media",i==="row"?"":"width:0")};Al=new WeakSet;Yc=function(t){Je(this,Nt,t.relatedTarget),de(this,t.relatedTarget)||(this.hidden=!this.hidden)};Tl=new WeakSet;qc=function(){var t;(t=H(this,Nt))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),st(kr(this),H(this,Ji)),st(this,H(this,ji))};yl=new WeakSet;Zc=function(){var t;(t=H(this,Nt))==null||t.setAttribute("aria-expanded","false"),lt(kr(this),H(this,Ji)),lt(this,H(this,ji))};Ji=new WeakMap;ji=new WeakMap;ea=new WeakSet;yr=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=Vc({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=kr(this).getBoundingClientRect(),o=r.width-e-t,s=r.height-i-this.offsetHeight,{style:l}=H(this,Tr);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,o)}px`),l.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),_=l.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),g=r.height-_-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};Mn=new WeakSet;Rl=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=H(this,Tr);if(t||a.setProperty("--media-menu-transition-in","none"),i){let r=i.offsetHeight,o=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${r}px`),q(this,ea,yr).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),q(this,ea,yr).call(this);a.removeProperty("--media-menu-transition-in")};kl=new WeakSet;zc=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(H(this,xl,Qc))){(e=H(this,hi))==null||e.focus(),this.hidden=!0;return}let i=q(this,_r,Cn).call(this,t);!i||i.hasAttribute("disabled")||(q(this,Ar,Ln).call(this,i),this.handleSelect(t))};xl=new WeakSet;Qc=function(){var t;return(t=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:t.find(i=>i.matches('button[part~="back"]'))};Sl=new WeakSet;Xc=function(t){if(t.target===this)return;q(this,Dl,Jc).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let i of e)i.invokeTargetElement!=t.target&&t.newState=="open"&&i.getAttribute("aria-expanded")=="true"&&!i.invokeTargetElement.hidden&&i.invokeTargetElement.dispatchEvent(new Ot({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);q(this,Mn,Rl).call(this,!0)};Dl=new WeakSet;Jc=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Il=new WeakSet;jc=function(t){var e;de(this,t.relatedTarget)||(H(this,pi)&&((e=H(this,hi))==null||e.focus()),H(this,Nt)&&H(this,Nt)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};Ml=new WeakSet;em=function(t){var e,i,a,r,o;let{key:s,ctrlKey:l,altKey:u,metaKey:m}=t;if(!(l||u||m)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if(H(this,pi)){this.hidden=!0;return}t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else s==="Escape"?((o=H(this,hi))==null||o.focus(),H(this,pi)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};_r=new WeakSet;Cn=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Cl=new WeakSet;tm=function(){return this.items.find(t=>t.tabIndex===0)};Ar=new WeakSet;Ln=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};Sn=new WeakSet;Ll=function(t,e){let i=[...this.checkedItems];t.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?t.checked=!t.checked:t.checked=!0,this.checkedItems.some((a,r)=>a!=i[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};oe.shadowRootOptions={mode:"open"};oe.getTemplateHTML=Vf;function Kf(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function kr(t){var e;return(e=t.getAttribute("bounds")?He(t,`#${t.getAttribute("bounds")}`):Z(t)||t.parentElement)!=null?e:t}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",oe);var Bl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},it=(t,e,i)=>(Bl(t,e,"read from private field"),i?i.call(t):e.get(t)),vt=(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)},Ol=(t,e,i,a)=>(Bl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),tt=(t,e,i)=>(Bl(t,e,"access private method"),i),wn,Ir,Nl,im,$l,am,Wl,rm,at,ta,Mr,Pl,om,Rn,Ul;function Gf(t){return`
|
|
2826
|
+
`}var mi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},oe=class extends d.HTMLElement{constructor(){if(super(),G(this,_l),G(this,Sn),G(this,Tl),G(this,yl),G(this,kl),G(this,ea),G(this,Cn),G(this,Sl),G(this,Dl),G(this,Il),G(this,Ol),G(this,Ml),G(this,Cl),G(this,Ar),G(this,Ll),G(this,Tr),G(this,In),G(this,je,null),G(this,hi,null),G(this,Nt,null),G(this,yn,new Set),G(this,kn,void 0),G(this,pi,!1),G(this,yr,null),G(this,Mn,()=>{let e=H(this,yn),i=new Set(this.items);for(let a of e)i.has(a)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:a}));for(let a of i)e.has(a)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:a}));Je(this,yn,i)}),G(this,Ji,()=>{q(this,ea,kr).call(this),q(this,Cn,xl).call(this,!1)}),G(this,ji,()=>{q(this,ea,kr).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),Je(this,kn,new MutationObserver(H(this,Mn))),H(this,kn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[mi.DISABLED,mi.HIDDEN,mi.STYLE,mi.ANCHOR,L.MEDIA_CONTROLLER]}static formatMenuItemText(e,i){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":q(this,_l,Gc).call(this,e);break;case"invoke":q(this,Tl,Yc).call(this,e);break;case"click":q(this,Sl,zc).call(this,e);break;case"toggle":q(this,Il,Xc).call(this,e);break;case"focusout":q(this,Ml,jc).call(this,e);break;case"keydown":q(this,Cl,em).call(this,e);break}}connectedCallback(){var e,i;Je(this,yr,os(this.shadowRoot,":host")),q(this,Sn,Al).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Je(this,je,qr(this)),(i=(e=H(this,je))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(st(Sr(this),H(this,Ji)),st(this,H(this,ji)))}disconnectedCallback(){var e,i;lt(Sr(this),H(this,Ji)),lt(this,H(this,ji)),this.disable(),(i=(e=H(this,je))==null?void 0:e.unassociateElement)==null||i.call(e,this),Je(this,je,null)}attributeChangedCallback(e,i,a){var r,o,s,l;e===mi.HIDDEN&&a!==i?(H(this,pi)||Je(this,pi,!0),this.hidden?q(this,kl,Zc).call(this):q(this,yl,qc).call(this),this.dispatchEvent(new Tn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===L.MEDIA_CONTROLLER?(i&&((o=(r=H(this,je))==null?void 0:r.unassociateElement)==null||o.call(r,this),Je(this,je,null)),a&&this.isConnected&&(Je(this,je,qr(this)),(l=(s=H(this,je))==null?void 0:s.associateElement)==null||l.call(s,this))):e===mi.DISABLED&&a!==i?a==null?this.enable():this.disable():e===mi.STYLE&&a!==i&&q(this,Sn,Al).call(this)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=Wt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Kf)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,i;return(i=(e=this.checkedItems[0])==null?void 0:e.value)!=null?i:""}set value(e){let i=this.items.find(a=>a.value===e);i&&q(this,In,wl).call(this,i)}focus(){if(Je(this,hi,Ca()),this.items.length){q(this,Tr,wn).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var i;let a=q(this,Ar,Ln).call(this,e);a&&(q(this,In,wl).call(this,a,a.type==="checkbox"),H(this,Nt)&&!this.hidden&&((i=H(this,hi))==null||i.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var i,a;let{key:r}=e,o=this.items,s=(a=(i=q(this,Ar,Ln).call(this,e))!=null?i:q(this,Ll,tm).call(this))!=null?a:o[0],l=o.indexOf(s),u=Math.max(0,l);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=o.length-1),u<0&&(u=o.length-1),u>o.length-1&&(u=0),q(this,Tr,wn).call(this,o[u]),o[u].focus()}};je=new WeakMap;hi=new WeakMap;Nt=new WeakMap;yn=new WeakMap;kn=new WeakMap;pi=new WeakMap;yr=new WeakMap;_l=new WeakSet;Gc=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:!0}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();if(["header","title"].includes(e.name)){let i=this.shadowRoot.querySelector('slot[name="header"]');i.hidden=e.assignedNodes().length===0}e.name||H(this,Mn).call(this)};Mn=new WeakMap;Sn=new WeakSet;Al=function(){var t;let e=this.shadowRoot.querySelector("#layout-row"),i=(t=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:t.trim();e.setAttribute("media",i==="row"?"":"width:0")};Tl=new WeakSet;Yc=function(t){Je(this,Nt,t.relatedTarget),de(this,t.relatedTarget)||(this.hidden=!this.hidden)};yl=new WeakSet;qc=function(){var t;(t=H(this,Nt))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),st(Sr(this),H(this,Ji)),st(this,H(this,ji))};kl=new WeakSet;Zc=function(){var t;(t=H(this,Nt))==null||t.setAttribute("aria-expanded","false"),lt(Sr(this),H(this,Ji)),lt(this,H(this,ji))};Ji=new WeakMap;ji=new WeakMap;ea=new WeakSet;kr=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=Vc({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=Sr(this).getBoundingClientRect(),o=r.width-e-t,s=r.height-i-this.offsetHeight,{style:l}=H(this,yr);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,o)}px`),l.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),_=l.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),g=r.height-_-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};Cn=new WeakSet;xl=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=H(this,yr);if(t||a.setProperty("--media-menu-transition-in","none"),i){let r=i.offsetHeight,o=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${r}px`),q(this,ea,kr).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),q(this,ea,kr).call(this);a.removeProperty("--media-menu-transition-in")};Sl=new WeakSet;zc=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(H(this,Dl,Qc))){(e=H(this,hi))==null||e.focus(),this.hidden=!0;return}let i=q(this,Ar,Ln).call(this,t);!i||i.hasAttribute("disabled")||(q(this,Tr,wn).call(this,i),this.handleSelect(t))};Dl=new WeakSet;Qc=function(){var t;return(t=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:t.find(i=>i.matches('button[part~="back"]'))};Il=new WeakSet;Xc=function(t){if(t.target===this)return;q(this,Ol,Jc).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let i of e)i.invokeTargetElement!=t.target&&t.newState=="open"&&i.getAttribute("aria-expanded")=="true"&&!i.invokeTargetElement.hidden&&i.invokeTargetElement.dispatchEvent(new Ot({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);q(this,Cn,xl).call(this,!0)};Ol=new WeakSet;Jc=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Ml=new WeakSet;jc=function(t){var e;de(this,t.relatedTarget)||(H(this,pi)&&((e=H(this,hi))==null||e.focus()),H(this,Nt)&&H(this,Nt)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};Cl=new WeakSet;em=function(t){var e,i,a,r,o;let{key:s,ctrlKey:l,altKey:u,metaKey:m}=t;if(!(l||u||m)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if(H(this,pi)){this.hidden=!0;return}t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else s==="Escape"?((o=H(this,hi))==null||o.focus(),H(this,pi)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};Ar=new WeakSet;Ln=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Ll=new WeakSet;tm=function(){return this.items.find(t=>t.tabIndex===0)};Tr=new WeakSet;wn=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};In=new WeakSet;wl=function(t,e){let i=[...this.checkedItems];t.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?t.checked=!t.checked:t.checked=!0,this.checkedItems.some((a,r)=>a!=i[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};oe.shadowRootOptions={mode:"open"};oe.getTemplateHTML=Vf;function Kf(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function Sr(t){var e;return(e=t.getAttribute("bounds")?He(t,`#${t.getAttribute("bounds")}`):Z(t)||t.parentElement)!=null?e:t}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",oe);var $l=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},it=(t,e,i)=>($l(t,e,"read from private field"),i?i.call(t):e.get(t)),vt=(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)},Nl=(t,e,i,a)=>($l(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),tt=(t,e,i)=>($l(t,e,"access private method"),i),Rn,Mr,Pl,im,Wl,am,Fl,rm,at,ta,Cr,Ul,om,xn,Hl;function Gf(t){return`
|
|
2826
2827
|
<style>
|
|
2827
2828
|
:host {
|
|
2828
2829
|
transition: var(--media-menu-item-transition,
|
|
@@ -2940,7 +2941,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2940
2941
|
${this.getSuffixSlotInnerHTML(t)}
|
|
2941
2942
|
</slot>
|
|
2942
2943
|
<slot name="submenu"></slot>
|
|
2943
|
-
`}function Yf(t){return""}var we={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},rt=class extends d.HTMLElement{constructor(){if(super(),vt(this,
|
|
2944
|
+
`}function Yf(t){return""}var we={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},rt=class extends d.HTMLElement{constructor(){if(super(),vt(this,Pl),vt(this,Wl),vt(this,Fl),vt(this,ta),vt(this,Ul),vt(this,xn),vt(this,Rn,!1),vt(this,Mr,void 0),vt(this,at,()=>{var e,i;this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let a=this.shadowRoot.querySelector('slot[name="description"]'),r=(e=this.submenuElement.checkedItems)==null?void 0:e[0],o=(i=r==null?void 0:r.dataset.description)!=null?i:r==null?void 0:r.text,s=V.createElement("span");s.textContent=o!=null?o:"",a.replaceChildren(s)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Y(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[we.TYPE,we.DISABLED,we.CHECKED,we.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Ir(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":tt(this,Pl,im).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":tt(this,Ul,om).call(this,e);break;case"keyup":tt(this,ta,Cr).call(this,e);break}}attributeChangedCallback(e,i,a){e===we.CHECKED&&Ir(this)&&!it(this,Rn)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===we.TYPE&&a!==i?this.role="menuitem"+a:e===we.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(we.DISABLED)||this.enable(),this.role="menuitem"+this.type,Nl(this,Mr,Bl(this,this.parentNode)),tt(this,xn,Hl).call(this)}disconnectedCallback(){this.disable(),tt(this,xn,Hl).call(this),Nl(this,Mr,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Wt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(we.TYPE))!=null?e:""}set type(e){this.setAttribute(we.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(we.VALUE))!=null?e:this.text}set value(e){this.setAttribute(we.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Ir(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Ir(this)&&(Nl(this,Rn,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Ir(this)||this.invokeTargetElement&&de(this,e.target)&&this.invokeTargetElement.dispatchEvent(new Ot({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};Rn=new WeakMap;Mr=new WeakMap;Pl=new WeakSet;im=function(t){let e=t.target;if(!(e!=null&&e.name))for(let a of e.assignedNodes({flatten:!0}))a instanceof Text&&a.textContent.trim()===""&&a.remove();e.name==="submenu"&&(this.submenuElement?tt(this,Wl,am).call(this):tt(this,Fl,rm).call(this))};Wl=new WeakSet;am=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",it(this,at)),this.submenuElement.addEventListener("addmenuitem",it(this,at)),this.submenuElement.addEventListener("removemenuitem",it(this,at)),it(this,at).call(this)};Fl=new WeakSet;rm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",it(this,at)),this.submenuElement.removeEventListener("addmenuitem",it(this,at)),this.submenuElement.removeEventListener("removemenuitem",it(this,at)),it(this,at).call(this)};at=new WeakMap;ta=new WeakSet;Cr=function(t){let{key:e}=t;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",tt(this,ta,Cr));return}this.handleClick(t)};Ul=new WeakSet;om=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!this.keysUsed.includes(a)){this.removeEventListener("keyup",tt(this,ta,Cr));return}this.addEventListener("keyup",tt(this,ta,Cr),{once:!0})};xn=new WeakSet;Hl=function(){var t;let e=(t=it(this,Mr))==null?void 0:t.radioGroupItems;if(!e)return;let i=e.filter(a=>a.getAttribute("aria-checked")==="true").pop();i||(i=e[0]);for(let a of e)a.setAttribute("aria-checked","false");i==null||i.setAttribute("aria-checked","true")};rt.shadowRootOptions={mode:"open"};rt.getTemplateHTML=Gf;rt.getSuffixSlotInnerHTML=Yf;function Ir(t){return t.type==="radio"||t.type==="checkbox"}function Bl(t,e){if(!t)return null;let{host:i}=t.getRootNode();return!e&&i?Bl(t,i):e!=null&&e.items?e:Bl(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",rt);function qf(t){return`
|
|
2944
2945
|
${oe.getTemplateHTML(t)}
|
|
2945
2946
|
<style>
|
|
2946
2947
|
:host {
|
|
@@ -2975,7 +2976,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2975
2976
|
--media-settings-menu-item-opacity: 0;
|
|
2976
2977
|
}
|
|
2977
2978
|
</style>
|
|
2978
|
-
`}var
|
|
2979
|
+
`}var Lr=class extends oe{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-settings-menu-button")}};Lr.getTemplateHTML=qf;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",Lr);function Zf(t){return`
|
|
2979
2980
|
${rt.getTemplateHTML.call(this,t)}
|
|
2980
2981
|
<style>
|
|
2981
2982
|
slot:not([name="submenu"]) {
|
|
@@ -3001,7 +3002,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3001
3002
|
<path d="M4.5 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"/>
|
|
3002
3003
|
</svg>
|
|
3003
3004
|
</slot>
|
|
3004
|
-
`}function Xf(){return h("Settings")}var ia=class extends be{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-settings-menu")}};ia.getSlotTemplateHTML=Qf;ia.getTooltipContentHTML=Xf;d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",ia);var
|
|
3005
|
+
`}function Xf(){return h("Settings")}var ia=class extends be{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-settings-menu")}};ia.getSlotTemplateHTML=Qf;ia.getTooltipContentHTML=Xf;d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",ia);var Yl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},nm=(t,e,i)=>(Yl(t,e,"read from private field"),i?i.call(t):e.get(t)),Dn=(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)},Vl=(t,e,i,a)=>(Yl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),On=(t,e,i)=>(Yl(t,e,"access private method"),i),wr,Un,Nn,Kl,Pn,Gl,Hn=class extends oe{constructor(){super(...arguments),Dn(this,Nn),Dn(this,Pn),Dn(this,wr,[]),Dn(this,Un,void 0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_LIST,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_AUDIO_TRACK_ENABLED&&i!==a?this.value=a:e===n.MEDIA_AUDIO_TRACK_LIST&&i!==a&&(Vl(this,wr,Ud(a!=null?a:"")),On(this,Nn,Kl).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",On(this,Pn,Gl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",On(this,Pn,Gl))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=Z(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return nm(this,wr)}set mediaAudioTrackList(e){Vl(this,wr,e),On(this,Nn,Kl).call(this)}get mediaAudioTrackEnabled(){var e;return(e=I(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){M(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};wr=new WeakMap;Un=new WeakMap;Nn=new WeakSet;Kl=function(){if(nm(this,Un)===JSON.stringify(this.mediaAudioTrackList))return;Vl(this,Un,JSON.stringify(this.mediaAudioTrackList));let t=this.mediaAudioTrackList;this.defaultSlot.textContent="";for(let e of t){let i=this.formatMenuItemText(e.label,e),a=et({type:"radio",text:i,value:`${e.id}`,checked:e.enabled});a.prepend(Ue(this,"checked-indicator")),this.defaultSlot.append(a)}};Pn=new WeakSet;Gl=function(){if(this.value==null)return;let t=new d.CustomEvent(p.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-audio-track-menu")||d.customElements.define("media-audio-track-menu",Hn);var Jf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
3005
3006
|
<path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
|
|
3006
3007
|
<path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>
|
|
3007
3008
|
</svg>`;function jf(){return`
|
|
@@ -3011,13 +3012,13 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3011
3012
|
}
|
|
3012
3013
|
</style>
|
|
3013
3014
|
<slot name="icon">${Jf}</slot>
|
|
3014
|
-
`}function ev(){return h("Audio")}var aa=class extends be{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("Audio"))}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Z(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=I(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){M(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};aa.getSlotTemplateHTML=jf;aa.getTooltipContentHTML=ev;d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",aa);var
|
|
3015
|
+
`}function ev(){return h("Audio")}var aa=class extends be{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("Audio"))}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Z(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=I(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){M(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};aa.getSlotTemplateHTML=jf;aa.getTooltipContentHTML=ev;d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",aa);var Xl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},tv=(t,e,i)=>(Xl(t,e,"read from private field"),i?i.call(t):e.get(t)),ql=(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)},iv=(t,e,i,a)=>(Xl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Zl=(t,e,i)=>(Xl(t,e,"access private method"),i),$n,zl,dm,Bn,Ql,av=`
|
|
3015
3016
|
<svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
|
|
3016
3017
|
<path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
|
|
3017
3018
|
</svg>`;function rv(t){return`
|
|
3018
3019
|
${oe.getTemplateHTML(t)}
|
|
3019
3020
|
<slot name="captions-indicator" hidden>${av}</slot>
|
|
3020
|
-
`}var
|
|
3021
|
+
`}var Rr=class extends oe{constructor(){super(...arguments),ql(this,zl),ql(this,Bn),ql(this,$n,void 0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_LIST&&i!==a?Zl(this,zl,dm).call(this):e===n.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Zl(this,Bn,Ql))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Zl(this,Bn,Ql))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return sm(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){lm(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return sm(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){lm(this,n.MEDIA_SUBTITLES_SHOWING,e)}};$n=new WeakMap;zl=new WeakSet;dm=function(){var t;if(tv(this,$n)===JSON.stringify(this.mediaSubtitlesList))return;iv(this,$n,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let e=!this.value,i=et({type:"radio",text:this.formatMenuItemText(h("Off")),value:"off",checked:e});i.prepend(Ue(this,"checked-indicator")),this.defaultSlot.append(i);let a=this.mediaSubtitlesList;for(let r of a){let o=et({type:"radio",text:this.formatMenuItemText(r.label,r),value:no(r),checked:this.value==no(r)});o.prepend(Ue(this,"checked-indicator")),((t=r.kind)!=null?t:"subs")==="captions"&&o.append(Ue(this,"captions-indicator")),this.defaultSlot.append(o)}};Bn=new WeakSet;Ql=function(){let t=this.mediaSubtitlesShowing,e=this.getAttribute(n.MEDIA_SUBTITLES_SHOWING),i=this.value!==e;if(t!=null&&t.length&&i&&this.dispatchEvent(new d.CustomEvent(p.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t})),!this.value||!i)return;let a=new d.CustomEvent(p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};Rr.getTemplateHTML=rv;var sm=(t,e)=>{let i=t.getAttribute(e);return i?Gt(i):[]},lm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=ut(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",Rr);var ov=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
3021
3022
|
<path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
|
|
3022
3023
|
</svg>`,nv=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
3023
3024
|
<path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
|
|
@@ -3041,7 +3042,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3041
3042
|
<slot name="on">${ov}</slot>
|
|
3042
3043
|
<slot name="off">${nv}</slot>
|
|
3043
3044
|
</slot>
|
|
3044
|
-
`}function lv(){return h("Captions")}var um=t=>{t.setAttribute("aria-checked",
|
|
3045
|
+
`}function lv(){return h("Captions")}var um=t=>{t.setAttribute("aria-checked",so(t).toString())},ra=class extends be{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("closed captions")),um(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING&&um(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Z(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return cm(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){mm(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return cm(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){mm(this,n.MEDIA_SUBTITLES_SHOWING,e)}};ra.getSlotTemplateHTML=sv;ra.getTooltipContentHTML=lv;var cm=(t,e)=>{let i=t.getAttribute(e);return i?Gt(i):[]},mm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=ut(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",ra);var hm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},oa=(t,e,i)=>(hm(t,e,"read from private field"),i?i.call(t):e.get(t)),Jl=(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)},xr=(t,e,i)=>(hm(t,e,"access private method"),i),Pt,Dr,Wn,Fn,ed,jl={RATES:"rates"},Vn=class extends oe{constructor(){super(),Jl(this,Dr),Jl(this,Fn),Jl(this,Pt,new Tt(this,jl.RATES,{defaultValue:Fs})),xr(this,Dr,Wn).call(this)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,jl.RATES]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PLAYBACK_RATE&&i!=a?this.value=a:e===jl.RATES&&i!=a&&(oa(this,Pt).value=a,xr(this,Dr,Wn).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",xr(this,Fn,ed))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",xr(this,Fn,ed))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-playback-rate-menu-button")}get rates(){return oa(this,Pt)}set rates(e){e?Array.isArray(e)?oa(this,Pt).value=e.join(" "):typeof e=="string"&&(oa(this,Pt).value=e):oa(this,Pt).value="",xr(this,Dr,Wn).call(this)}get mediaPlaybackRate(){return R(this,n.MEDIA_PLAYBACK_RATE,jt)}set mediaPlaybackRate(e){O(this,n.MEDIA_PLAYBACK_RATE,e)}};Pt=new WeakMap;Dr=new WeakSet;Wn=function(){this.defaultSlot.textContent="";for(let t of oa(this,Pt)){let e=et({type:"radio",text:this.formatMenuItemText(`${t}x`,t),value:t,checked:this.mediaPlaybackRate===Number(t)});e.prepend(Ue(this,"checked-indicator")),this.defaultSlot.append(e)}};Fn=new WeakSet;ed=function(){if(!this.value)return;let t=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-playback-rate-menu")||d.customElements.define("media-playback-rate-menu",Vn);var Kn=1;function dv(t){return`
|
|
3045
3046
|
<style>
|
|
3046
3047
|
:host {
|
|
3047
3048
|
min-width: 5ch;
|
|
@@ -3052,8 +3053,8 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3052
3053
|
display: none;
|
|
3053
3054
|
}
|
|
3054
3055
|
</style>
|
|
3055
|
-
<slot name="icon">${t.mediaplaybackrate||
|
|
3056
|
-
`}function uv(){return h("Playback rate")}var na=class extends be{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:
|
|
3056
|
+
<slot name="icon">${t.mediaplaybackrate||Kn}x</slot>
|
|
3057
|
+
`}function uv(){return h("Playback rate")}var na=class extends be{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Kn}x`}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===n.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,o=Number.isNaN(r)?Kn:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",h("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return R(this,n.MEDIA_PLAYBACK_RATE,Kn)}set mediaPlaybackRate(e){O(this,n.MEDIA_PLAYBACK_RATE,e)}};na.getSlotTemplateHTML=dv;na.getTooltipContentHTML=uv;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",na);var id=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Or=(t,e,i)=>(id(t,e,"read from private field"),i?i.call(t):e.get(t)),Gn=(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)},pm=(t,e,i,a)=>(id(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),sa=(t,e,i)=>(id(t,e,"access private method"),i),Nr,da,la,Pr,Yn,td,qn=class extends oe{constructor(){super(...arguments),Gn(this,la),Gn(this,Yn),Gn(this,Nr,[]),Gn(this,da,{})}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_LIST,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_RENDITION_SELECTED&&i!==a?(this.value=a!=null?a:"auto",sa(this,la,Pr).call(this)):e===n.MEDIA_RENDITION_LIST&&i!==a?(pm(this,Nr,Nd(a)),sa(this,la,Pr).call(this)):e===n.MEDIA_HEIGHT&&i!==a&&sa(this,la,Pr).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",sa(this,Yn,td))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",sa(this,Yn,td))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return Or(this,Nr)}set mediaRenditionList(e){pm(this,Nr,e),sa(this,la,Pr).call(this)}get mediaRenditionSelected(){return I(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return R(this,n.MEDIA_HEIGHT)}set mediaHeight(e){O(this,n.MEDIA_HEIGHT,e)}};Nr=new WeakMap;da=new WeakMap;la=new WeakSet;Pr=function(){if(Or(this,da).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&Or(this,da).mediaHeight===this.mediaHeight)return;Or(this,da).mediaRenditionList=JSON.stringify(this.mediaRenditionList),Or(this,da).mediaHeight=this.mediaHeight;let t=this.mediaRenditionList.sort((o,s)=>s.height-o.height);for(let o of t)o.selected=o.id===this.mediaRenditionSelected;this.defaultSlot.textContent="";let e=!this.mediaRenditionSelected;for(let o of t){let s=this.formatMenuItemText(`${Math.min(o.width,o.height)}p`,o),l=et({type:"radio",text:s,value:`${o.id}`,checked:o.selected&&!e});l.prepend(Ue(this,"checked-indicator")),this.defaultSlot.append(l)}let i=e?this.formatMenuItemText(`${h("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(h("Auto")),a=et({type:"radio",text:i,value:"auto",checked:e}),r=this.mediaHeight>0?`${h("Auto")} (${this.mediaHeight}p)`:h("Auto");a.dataset.description=r,a.prepend(Ue(this,"checked-indicator")),this.defaultSlot.append(a)};Yn=new WeakSet;td=function(){if(this.value==null)return;let t=new d.CustomEvent(p.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",qn);var cv=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
3057
3058
|
<path d="M13.5 2.5h2v6h-2v-2h-11v-2h11v-2Zm4 2h4v2h-4v-2Zm-12 4h2v6h-2v-2h-3v-2h3v-2Zm4 2h12v2h-12v-2Zm1 4h2v6h-2v-2h-8v-2h8v-2Zm4 2h7v2h-7v-2Z" />
|
|
3058
3059
|
</svg>`;function mv(){return`
|
|
3059
3060
|
<style>
|
|
@@ -3062,7 +3063,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3062
3063
|
}
|
|
3063
3064
|
</style>
|
|
3064
3065
|
<slot name="icon">${cv}</slot>
|
|
3065
|
-
`}function hv(){return h("Quality")}var ua=class extends be{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return I(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return R(this,n.MEDIA_HEIGHT)}set mediaHeight(e){O(this,n.MEDIA_HEIGHT,e)}};ua.getSlotTemplateHTML=mv;ua.getTooltipContentHTML=hv;d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",ua);var
|
|
3066
|
+
`}function hv(){return h("Quality")}var ua=class extends be{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return I(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return R(this,n.MEDIA_HEIGHT)}set mediaHeight(e){O(this,n.MEDIA_HEIGHT,e)}};ua.getSlotTemplateHTML=mv;ua.getTooltipContentHTML=hv;d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",ua);var ad=_i.createElement("template");"innerHTML"in ad&&(ad.innerHTML=Fc);var fm,vm,Zn=class extends ci{};Zn.template=(vm=(fm=ad.content)==null?void 0:fm.children)==null?void 0:vm[0];ye.customElements.get("media-theme-gerwig")||ye.customElements.define("media-theme-gerwig",Zn);var pv="gerwig",Et={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",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",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge"},rd=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","videotitle","novolumepref","proudlydisplaymuxbadge"];function fv(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),placeholder:t.getAttribute("placeholder"),themeTemplate:Ev(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,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(b.Attributes.TARGET_LIVE_WINDOW),streamType:cr(t.getAttribute(b.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:bv(t),playbackRates:t.getAttribute(c.PLAYBACK_RATES),customDomain:(a=t.getAttribute(b.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),proudlyDisplayMuxBadge:t.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE),castReceiver:t.castReceiver,...e,extraSourceParams:t.extraSourceParams}}var vv=Ho.formatErrorMessage;Ho.formatErrorMessage=t=>{var e,i;if(t instanceof b.MediaError){let a=Wc(t,!1);return`
|
|
3066
3067
|
${a!=null&&a.title?`<h3>${a.title}</h3>`:""}
|
|
3067
3068
|
${a!=null&&a.message||a!=null&&a.linkUrl?`<p>
|
|
3068
3069
|
${a==null?void 0:a.message}
|
|
@@ -3074,5 +3075,5 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3074
3075
|
>${(i=a.linkText)!=null?i:a.linkUrl}</a
|
|
3075
3076
|
>`:""}
|
|
3076
3077
|
</p>`:""}
|
|
3077
|
-
`}return vv(t)};function Ev(t){var i,a;let e=t.theme;if(e){let r=(a=(i=t.getRootNode())==null?void 0:i.getElementById)==null?void 0:a.call(i,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let o=ye.customElements.get(e);if(o!=null&&o.template)return o.template}}function bv(t){var i;let e=(i=t.mediaController)==null?void 0:i.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function Em(t){let e=t.videoTitle?{video_title:t.videoTitle}:{};return t.getAttributeNames().filter(i=>i.startsWith("metadata-")).reduce((i,a)=>{let r=t.getAttribute(a);return r!==null&&(i[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),i},e)}var gv=Object.values(b.Attributes),_v=Object.values(Et),Av=Object.values(c),rd=cn(),od="mux-player",bm={isDialogOpen:!1},Tv={redundant_streams:!0},Pr,Ur,Hr,Bt,Br,Ei,$,Ut,gm,sd,vi,_m,Am,Tm,ym,nd=class extends sl{constructor(){super();he(this,$);he(this,Pr);he(this,Ur,!1);he(this,Hr,{});he(this,Bt,!0);he(this,Br,new un(this,"hotkeys"));he(this,Ei,{...bm,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&X(this,$,sd).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var o;if(((o=i.composedPath()[0])==null?void 0:o.localName)!=="media-error-dialog")return;rl(this,_i.activeElement)||i.preventDefault()}});Te(this,Pr,(0,w.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),X(this,$,gm).call(this),this.isConnected&&X(this,$,Ut).call(this)}static get NAME(){return od}static get VERSION(){return rd}static get observedAttributes(){var i;return[...(i=sl.observedAttributes)!=null?i:[],..._v,...gv,...Av]}get mediaTheme(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("media-theme")}get mediaController(){var i,a;return(a=(i=this.mediaTheme)==null?void 0:i.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){let i=this.media;i&&(i.metadata=Em(this))}attributeChangedCallback(i,a,r){switch(X(this,$,Ut).call(this),super.attributeChangedCallback(i,a,r),i){case c.HOTKEYS:U(this,Br).value=r;break;case c.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Qe((0,w.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case c.THUMBNAIL_TOKEN:{if(r){let s=(0,w.parseJwt)(r);if(s){let{aud:l}=s,u=w.MuxJWTAud.THUMBNAIL;l!==u&&Qe((0,w.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case c.STORYBOARD_TOKEN:{if(r){let s=(0,w.parseJwt)(r);if(s){let{aud:l}=s,u=w.MuxJWTAud.STORYBOARD;l!==u&&Qe((0,w.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case c.DRM_TOKEN:{if(r){let s=(0,w.parseJwt)(r);if(s){let{aud:l}=s,u=w.MuxJWTAud.DRM;l!==u&&Qe((0,w.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case b.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&Ee((0,w.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case b.Attributes.STREAM_TYPE:r&&![w.StreamTypes.LIVE,w.StreamTypes.ON_DEMAND,w.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:ol({file:"invalid-stream-type.md",message:(0,w.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===w.StreamTypes.LIVE?this.getAttribute(c.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[b.Attributes.PLAYBACK_ID,Et.SRC,c.PLAYBACK_TOKEN].includes(i)&&a!==r&&Te(this,Ei,{...U(this,Ei),...bm}),X(this,$,vi).call(this,{[bc(i)]:r})}async requestFullscreen(i){var a;if(!(!this.mediaController||this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(a=this.mediaController)==null||a.dispatchEvent(new ye.CustomEvent(p.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,o)=>{var s;(s=this.mediaController)==null||s.addEventListener(Ce.MEDIA_IS_FULLSCREEN,()=>r(),{once:!0})})}async exitFullscreen(){var i;if(!(!this.mediaController||!this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(i=this.mediaController)==null||i.dispatchEvent(new ye.CustomEvent(p.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((a,r)=>{var o;(o=this.mediaController)==null||o.addEventListener(Ce.MEDIA_IS_FULLSCREEN,()=>a(),{once:!0})})}get preferCmcd(){var i;return(i=this.getAttribute(b.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?w.CmcdTypeValues.includes(i)?this.setAttribute(b.Attributes.PREFER_CMCD,i):Qe(`Invalid value for preferCmcd. Must be one of ${w.CmcdTypeValues.join()}`):this.removeAttribute(b.Attributes.PREFER_CMCD))}get hasPlayed(){var i,a;return(a=(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var i;return(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_TIME_IS_LIVE)}get _hls(){var i;return(i=this.media)==null?void 0:i._hls}get mux(){var i;return(i=this.media)==null?void 0:i.mux}get theme(){var i;return(i=this.getAttribute(c.THEME))!=null?i:pv}set theme(i){this.setAttribute(c.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(ad.includes(r))continue;let o=i.getAttribute(r);a[dn(r)]=o===""?!0:o}return a}set themeProps(i){var r,o;X(this,$,Ut).call(this);let a={...this.themeProps,...i};for(let s in a){if(ad.includes(s))continue;let l=i==null?void 0:i[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(ln(s),!!l):(o=this.mediaTheme)==null||o.setAttribute(ln(s),l)}}get playbackId(){var i;return(i=this.getAttribute(b.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(b.Attributes.PLAYBACK_ID,i):this.removeAttribute(b.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Ht(this,Et.SRC))!=null?i:void 0:(a=this.getAttribute(Et.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(Et.SRC,i):this.removeAttribute(Et.SRC)}get poster(){var r;let i=this.getAttribute(Et.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){Qe("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return vc(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(i){i||i===""?this.setAttribute(Et.POSTER,i):this.removeAttribute(Et.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(c.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(c.STORYBOARD_SRC,i):this.removeAttribute(c.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[w.StreamTypes.LIVE,w.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return Ec(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(c.AUDIO)}set audio(i){if(!i){this.removeAttribute(c.AUDIO);return}this.setAttribute(c.AUDIO,"")}get hotkeys(){return U(this,Br)}get nohotkeys(){return this.hasAttribute(c.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(c.NOHOTKEYS);return}this.setAttribute(c.NOHOTKEYS,"")}get thumbnailTime(){return ue(this.getAttribute(c.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(c.THUMBNAIL_TIME,`${i}`)}get videoTitle(){var i,a;return(a=(i=this.getAttribute(c.VIDEO_TITLE))!=null?i:this.getAttribute(c.TITLE))!=null?a:""}set videoTitle(i){i!==this.videoTitle&&(i?this.setAttribute(c.VIDEO_TITLE,i):this.removeAttribute(c.VIDEO_TITLE))}get placeholder(){var i;return(i=Ht(this,c.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(c.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(c.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ye.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(c.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(c.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ye.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(c.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(c.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ye.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(c.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(c.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(c.PLAYBACK_RATES))return this.getAttribute(c.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(i=>Number(i)).filter(i=>!Number.isNaN(i)).sort((i,a)=>i-a)}set playbackRates(i){if(!i){this.removeAttribute(c.PLAYBACK_RATES);return}this.setAttribute(c.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=ue(this.getAttribute(c.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(c.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=ue(this.getAttribute(c.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(c.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(c.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return ue(this.getAttribute(c.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(c.DEFAULT_DURATION):this.setAttribute(c.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(b.Attributes.PLAYER_INIT_TIME)?ue(this.getAttribute(b.Attributes.PLAYER_INIT_TIME)):U(this,Pr)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(b.Attributes.PLAYER_INIT_TIME):this.setAttribute(b.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:od}get playerSoftwareVersion(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:rd}get beaconCollectionDomain(){var i;return(i=this.getAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(b.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(b.Attributes.MAX_RESOLUTION,i):this.removeAttribute(b.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(b.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(b.Attributes.MIN_RESOLUTION,i):this.removeAttribute(b.Attributes.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(b.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(b.Attributes.RENDITION_ORDER,i):this.removeAttribute(b.Attributes.RENDITION_ORDER))}get programStartTime(){return ue(this.getAttribute(b.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(b.Attributes.PROGRAM_START_TIME):this.setAttribute(b.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return ue(this.getAttribute(b.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(b.Attributes.PROGRAM_END_TIME):this.setAttribute(b.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return ue(this.getAttribute(b.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(b.Attributes.ASSET_START_TIME):this.setAttribute(b.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return ue(this.getAttribute(b.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(b.Attributes.ASSET_END_TIME):this.setAttribute(b.Attributes.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(c.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(c.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):Tv}set extraSourceParams(i){i==null?this.removeAttribute(c.EXTRA_SOURCE_PARAMS):this.setAttribute(c.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(b.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(b.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(b.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Ht(this,b.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(b.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(c.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(c.NO_VOLUME_PREF,""):this.removeAttribute(c.NO_VOLUME_PREF)}get debug(){return Ht(this,b.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(b.Attributes.DEBUG,""):this.removeAttribute(b.Attributes.DEBUG)}get disableTracking(){return Ht(this,b.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(b.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Ht(this,b.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(b.Attributes.DISABLE_COOKIES,""):this.removeAttribute(b.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(b.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:w.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(b.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?r:w.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(c.DEFAULT_STREAM_TYPE,i):this.removeAttribute(c.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(c.TARGET_LIVE_WINDOW)?+this.getAttribute(c.TARGET_LIVE_WINDOW):(a=(i=this.media)==null?void 0:i.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(i){i==this.targetLiveWindow||Number.isNaN(i)&&Number.isNaN(this.targetLiveWindow)||(i==null?this.removeAttribute(c.TARGET_LIVE_WINDOW):this.setAttribute(c.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return ue(Ht(this,b.Attributes.START_TIME))}set startTime(i){this.setAttribute(b.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(b.Attributes.PREFER_PLAYBACK);if(i===w.PlaybackTypes.MSE||i===w.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===w.PlaybackTypes.MSE||i===w.PlaybackTypes.NATIVE?this.setAttribute(b.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(b.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(X(this,$,Ut).call(this),!this.media){Ee("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Em(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(X(this,$,Ut).call(this),!this.media){Ee("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=i}async addCuePoints(i){var a;if(X(this,$,Ut).call(this),!this.media){Ee("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(i)}get activeCuePoint(){var i;return(i=this.media)==null?void 0:i.activeCuePoint}get cuePoints(){var i,a;return(a=(i=this.media)==null?void 0:i.cuePoints)!=null?a:[]}addChapters(i){var a;if(X(this,$,Ut).call(this),!this.media){Ee("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(i)}get activeChapter(){var i;return(i=this.media)==null?void 0:i.activeChapter}get chapters(){var i,a;return(a=(i=this.media)==null?void 0:i.chapters)!=null?a:[]}getStartDate(){var i;return(i=this.media)==null?void 0:i.getStartDate()}get currentPdt(){var i;return(i=this.media)==null?void 0:i.currentPdt}get tokens(){let i=this.getAttribute(c.PLAYBACK_TOKEN),a=this.getAttribute(c.DRM_TOKEN),r=this.getAttribute(c.THUMBNAIL_TOKEN),o=this.getAttribute(c.STORYBOARD_TOKEN);return{...U(this,Hr),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(i){Te(this,Hr,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(c.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(c.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(c.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(c.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(c.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(c.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(c.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(c.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,o){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(s)return(0,w.addTextTrack)(s,i,a,r,o)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,w.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(c.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(c.CAST_RECEIVER,i):this.removeAttribute(c.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){Ee("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(c.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(c.NO_TOOLTIPS);return}this.setAttribute(c.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(c.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}};Pr=new WeakMap,Ur=new WeakMap,Hr=new WeakMap,Bt=new WeakMap,Br=new WeakMap,Ei=new WeakMap,$=new WeakSet,Ut=function(){var i,a,r,o;if(!U(this,Ur)){Te(this,Ur,!0),X(this,$,vi).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof ye.HTMLElement))throw""}catch{Ee("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{Ee("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof gs))throw""}catch{Ee("<media-controller> failed to upgrade!")}X(this,$,_m).call(this),X(this,$,Am).call(this),X(this,$,Tm).call(this),Te(this,Bt,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(y.USER_INACTIVE))!=null?a:!0),X(this,$,ym).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>X(this,$,vi).call(this)),(o=this.media)==null||o.addEventListener("loadstart",()=>X(this,$,vi).call(this))}},gm=function(){var i,a;try{(i=window==null?void 0:window.CSS)==null||i.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{}},sd=function(i){Object.assign(U(this,Ei),i),X(this,$,vi).call(this)},vi=function(i={}){Hc(Bc(fv(this,{...U(this,Ei),...i})),this.shadowRoot)},_m=function(){let i=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let o=r.replace(/^theme-/,"");if(ad.includes(o))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(o,s):(u=this.mediaTheme)==null||u.removeAttribute(o)};new MutationObserver(r=>{for(let{attributeName:o}of r)i(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},Am=function(){let i=a=>{var s;let r=(s=this.media)==null?void 0:s.error;if(!(r instanceof b.MediaError)){let{message:l,code:u}=r!=null?r:{};r=new b.MediaError(l,u)}if(!(r!=null&&r.fatal)){Qe(r),r.data&&Qe(`${r.name} data:`,r.data);return}let o=bl(r,!1);o.message&&ol(o),Ee(r),r.data&&Ee(`${r.name} data:`,r.data),X(this,$,sd).call(this,{isDialogOpen:!0})};this.addEventListener("error",i),this.media&&(this.media.errorTranslator=(a={})=>{var o,s,l;if(!(((o=this.media)==null?void 0:o.error)instanceof b.MediaError))return a;let r=bl((s=this.media)==null?void 0:s.error,!1);return{player_error_code:(l=this.media)==null?void 0:l.error.code,player_error_message:r.message?String(r.message):a.player_error_message,player_error_context:r.context?String(r.context):a.player_error_context}})},Tm=function(){var a,r,o,s;let i=()=>X(this,$,vi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",i),(s=(o=this.media)==null?void 0:o.textTracks)==null||s.addEventListener("removetrack",i)},ym=function(){var m,_;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===w.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(g,f,v=!1)=>{if(o())return;Array.from(g&&g.activeCues||[]).forEach(T=>{if(!(!T.snapToLines||T.line<-5||T.line>=0&&T.line<10))if(!f||this.paused){let C=T.text.split(`
|
|
3078
|
-
`).length,P=-3;this.streamType===w.StreamTypes.LIVE&&(P=-2);let j=P-C;if(T.line===j&&!v)return;r.has(T)||r.set(T,T.line),T.line=j}else setTimeout(()=>{T.line=r.get(T)||"auto"},500)})},l=()=>{var g,f;s(a,(f=(g=this.mediaController)==null?void 0:g.hasAttribute(y.USER_INACTIVE))!=null?f:!1)},u=()=>{var v,N;let f=Array.from(((N=(v=this.mediaController)==null?void 0:v.media)==null?void 0:N.textTracks)||[]).filter(T=>["subtitles","captions"].includes(T.kind)&&T.mode==="showing")[0];f!==a&&(a==null||a.removeEventListener("cuechange",l)),a=f,a==null||a.addEventListener("cuechange",l),s(a,U(this,Bt))};u(),(m=this.textTracks)==null||m.addEventListener("change",u),(_=this.textTracks)==null||_.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var f,v;let g=(v=(f=this.mediaController)==null?void 0:f.hasAttribute(y.USER_INACTIVE))!=null?v:!0;U(this,Bt)!==g&&(Te(this,Bt,g),s(a,U(this,Bt)))})};function Ht(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var yv=
|
|
3078
|
+
`}return vv(t)};function Ev(t){var i,a;let e=t.theme;if(e){let r=(a=(i=t.getRootNode())==null?void 0:i.getElementById)==null?void 0:a.call(i,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let o=ye.customElements.get(e);if(o!=null&&o.template)return o.template}}function bv(t){var i;let e=(i=t.mediaController)==null?void 0:i.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function Em(t){let e=t.videoTitle?{video_title:t.videoTitle}:{};return t.getAttributeNames().filter(i=>i.startsWith("metadata-")).reduce((i,a)=>{let r=t.getAttribute(a);return r!==null&&(i[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),i},e)}var gv=Object.values(b.Attributes),_v=Object.values(Et),Av=Object.values(c),od=mn(),nd="mux-player",bm={isDialogOpen:!1},Tv={redundant_streams:!0},Ur,Hr,Br,Bt,$r,Ei,$,Ut,gm,ld,vi,_m,Am,Tm,ym,sd=class extends ll{constructor(){super();he(this,$);he(this,Ur);he(this,Hr,!1);he(this,Br,{});he(this,Bt,!0);he(this,$r,new cn(this,"hotkeys"));he(this,Ei,{...bm,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&X(this,$,ld).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var o;if(((o=i.composedPath()[0])==null?void 0:o.localName)!=="media-error-dialog")return;ol(this,_i.activeElement)||i.preventDefault()}});Te(this,Ur,(0,w.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),X(this,$,gm).call(this),this.isConnected&&X(this,$,Ut).call(this)}static get NAME(){return nd}static get VERSION(){return od}static get observedAttributes(){var i;return[...(i=ll.observedAttributes)!=null?i:[],..._v,...gv,...Av]}get mediaTheme(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("media-theme")}get mediaController(){var i,a;return(a=(i=this.mediaTheme)==null?void 0:i.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){let i=this.media;i&&(i.metadata=Em(this))}attributeChangedCallback(i,a,r){switch(X(this,$,Ut).call(this),super.attributeChangedCallback(i,a,r),i){case c.HOTKEYS:U(this,$r).value=r;break;case c.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Qe((0,w.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case c.THUMBNAIL_TOKEN:{if(r){let s=(0,w.parseJwt)(r);if(s){let{aud:l}=s,u=w.MuxJWTAud.THUMBNAIL;l!==u&&Qe((0,w.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case c.STORYBOARD_TOKEN:{if(r){let s=(0,w.parseJwt)(r);if(s){let{aud:l}=s,u=w.MuxJWTAud.STORYBOARD;l!==u&&Qe((0,w.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case c.DRM_TOKEN:{if(r){let s=(0,w.parseJwt)(r);if(s){let{aud:l}=s,u=w.MuxJWTAud.DRM;l!==u&&Qe((0,w.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case b.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&Ee((0,w.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case b.Attributes.STREAM_TYPE:r&&![w.StreamTypes.LIVE,w.StreamTypes.ON_DEMAND,w.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:nl({file:"invalid-stream-type.md",message:(0,w.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===w.StreamTypes.LIVE?this.getAttribute(c.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[b.Attributes.PLAYBACK_ID,Et.SRC,c.PLAYBACK_TOKEN].includes(i)&&a!==r&&Te(this,Ei,{...U(this,Ei),...bm}),X(this,$,vi).call(this,{[bc(i)]:r})}async requestFullscreen(i){var a;if(!(!this.mediaController||this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(a=this.mediaController)==null||a.dispatchEvent(new ye.CustomEvent(p.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,o)=>{var s;(s=this.mediaController)==null||s.addEventListener(Ce.MEDIA_IS_FULLSCREEN,()=>r(),{once:!0})})}async exitFullscreen(){var i;if(!(!this.mediaController||!this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(i=this.mediaController)==null||i.dispatchEvent(new ye.CustomEvent(p.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((a,r)=>{var o;(o=this.mediaController)==null||o.addEventListener(Ce.MEDIA_IS_FULLSCREEN,()=>a(),{once:!0})})}get preferCmcd(){var i;return(i=this.getAttribute(b.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?w.CmcdTypeValues.includes(i)?this.setAttribute(b.Attributes.PREFER_CMCD,i):Qe(`Invalid value for preferCmcd. Must be one of ${w.CmcdTypeValues.join()}`):this.removeAttribute(b.Attributes.PREFER_CMCD))}get hasPlayed(){var i,a;return(a=(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var i;return(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_TIME_IS_LIVE)}get _hls(){var i;return(i=this.media)==null?void 0:i._hls}get mux(){var i;return(i=this.media)==null?void 0:i.mux}get theme(){var i;return(i=this.getAttribute(c.THEME))!=null?i:pv}set theme(i){this.setAttribute(c.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(rd.includes(r))continue;let o=i.getAttribute(r);a[un(r)]=o===""?!0:o}return a}set themeProps(i){var r,o;X(this,$,Ut).call(this);let a={...this.themeProps,...i};for(let s in a){if(rd.includes(s))continue;let l=i==null?void 0:i[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(dn(s),!!l):(o=this.mediaTheme)==null||o.setAttribute(dn(s),l)}}get playbackId(){var i;return(i=this.getAttribute(b.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(b.Attributes.PLAYBACK_ID,i):this.removeAttribute(b.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Ht(this,Et.SRC))!=null?i:void 0:(a=this.getAttribute(Et.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(Et.SRC,i):this.removeAttribute(Et.SRC)}get poster(){var r;let i=this.getAttribute(Et.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){Qe("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return vc(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(i){i||i===""?this.setAttribute(Et.POSTER,i):this.removeAttribute(Et.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(c.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(c.STORYBOARD_SRC,i):this.removeAttribute(c.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[w.StreamTypes.LIVE,w.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return Ec(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(c.AUDIO)}set audio(i){if(!i){this.removeAttribute(c.AUDIO);return}this.setAttribute(c.AUDIO,"")}get hotkeys(){return U(this,$r)}get nohotkeys(){return this.hasAttribute(c.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(c.NOHOTKEYS);return}this.setAttribute(c.NOHOTKEYS,"")}get thumbnailTime(){return ue(this.getAttribute(c.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(c.THUMBNAIL_TIME,`${i}`)}get videoTitle(){var i,a;return(a=(i=this.getAttribute(c.VIDEO_TITLE))!=null?i:this.getAttribute(c.TITLE))!=null?a:""}set videoTitle(i){i!==this.videoTitle&&(i?this.setAttribute(c.VIDEO_TITLE,i):this.removeAttribute(c.VIDEO_TITLE))}get placeholder(){var i;return(i=Ht(this,c.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(c.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(c.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ye.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(c.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(c.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ye.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(c.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(c.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ye.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(c.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(c.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(c.PLAYBACK_RATES))return this.getAttribute(c.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(i=>Number(i)).filter(i=>!Number.isNaN(i)).sort((i,a)=>i-a)}set playbackRates(i){if(!i){this.removeAttribute(c.PLAYBACK_RATES);return}this.setAttribute(c.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=ue(this.getAttribute(c.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(c.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=ue(this.getAttribute(c.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(c.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(c.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return ue(this.getAttribute(c.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(c.DEFAULT_DURATION):this.setAttribute(c.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(b.Attributes.PLAYER_INIT_TIME)?ue(this.getAttribute(b.Attributes.PLAYER_INIT_TIME)):U(this,Ur)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(b.Attributes.PLAYER_INIT_TIME):this.setAttribute(b.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:nd}get playerSoftwareVersion(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:od}get beaconCollectionDomain(){var i;return(i=this.getAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(b.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(b.Attributes.MAX_RESOLUTION,i):this.removeAttribute(b.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(b.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(b.Attributes.MIN_RESOLUTION,i):this.removeAttribute(b.Attributes.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(b.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(b.Attributes.RENDITION_ORDER,i):this.removeAttribute(b.Attributes.RENDITION_ORDER))}get programStartTime(){return ue(this.getAttribute(b.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(b.Attributes.PROGRAM_START_TIME):this.setAttribute(b.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return ue(this.getAttribute(b.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(b.Attributes.PROGRAM_END_TIME):this.setAttribute(b.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return ue(this.getAttribute(b.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(b.Attributes.ASSET_START_TIME):this.setAttribute(b.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return ue(this.getAttribute(b.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(b.Attributes.ASSET_END_TIME):this.setAttribute(b.Attributes.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(c.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(c.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):Tv}set extraSourceParams(i){i==null?this.removeAttribute(c.EXTRA_SOURCE_PARAMS):this.setAttribute(c.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(b.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(b.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(b.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Ht(this,b.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(b.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(c.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(c.NO_VOLUME_PREF,""):this.removeAttribute(c.NO_VOLUME_PREF)}get debug(){return Ht(this,b.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(b.Attributes.DEBUG,""):this.removeAttribute(b.Attributes.DEBUG)}get disableTracking(){return Ht(this,b.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(b.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Ht(this,b.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(b.Attributes.DISABLE_COOKIES,""):this.removeAttribute(b.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(b.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:w.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(b.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?r:w.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(c.DEFAULT_STREAM_TYPE,i):this.removeAttribute(c.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(c.TARGET_LIVE_WINDOW)?+this.getAttribute(c.TARGET_LIVE_WINDOW):(a=(i=this.media)==null?void 0:i.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(i){i==this.targetLiveWindow||Number.isNaN(i)&&Number.isNaN(this.targetLiveWindow)||(i==null?this.removeAttribute(c.TARGET_LIVE_WINDOW):this.setAttribute(c.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return ue(Ht(this,b.Attributes.START_TIME))}set startTime(i){this.setAttribute(b.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(b.Attributes.PREFER_PLAYBACK);if(i===w.PlaybackTypes.MSE||i===w.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===w.PlaybackTypes.MSE||i===w.PlaybackTypes.NATIVE?this.setAttribute(b.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(b.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(X(this,$,Ut).call(this),!this.media){Ee("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Em(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(X(this,$,Ut).call(this),!this.media){Ee("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=i}async addCuePoints(i){var a;if(X(this,$,Ut).call(this),!this.media){Ee("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(i)}get activeCuePoint(){var i;return(i=this.media)==null?void 0:i.activeCuePoint}get cuePoints(){var i,a;return(a=(i=this.media)==null?void 0:i.cuePoints)!=null?a:[]}addChapters(i){var a;if(X(this,$,Ut).call(this),!this.media){Ee("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(i)}get activeChapter(){var i;return(i=this.media)==null?void 0:i.activeChapter}get chapters(){var i,a;return(a=(i=this.media)==null?void 0:i.chapters)!=null?a:[]}getStartDate(){var i;return(i=this.media)==null?void 0:i.getStartDate()}get currentPdt(){var i;return(i=this.media)==null?void 0:i.currentPdt}get tokens(){let i=this.getAttribute(c.PLAYBACK_TOKEN),a=this.getAttribute(c.DRM_TOKEN),r=this.getAttribute(c.THUMBNAIL_TOKEN),o=this.getAttribute(c.STORYBOARD_TOKEN);return{...U(this,Br),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(i){Te(this,Br,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(c.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(c.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(c.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(c.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(c.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(c.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(c.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(c.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,o){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(s)return(0,w.addTextTrack)(s,i,a,r,o)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,w.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(c.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(c.CAST_RECEIVER,i):this.removeAttribute(c.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){Ee("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(c.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(c.NO_TOOLTIPS);return}this.setAttribute(c.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(c.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}};Ur=new WeakMap,Hr=new WeakMap,Br=new WeakMap,Bt=new WeakMap,$r=new WeakMap,Ei=new WeakMap,$=new WeakSet,Ut=function(){var i,a,r,o;if(!U(this,Hr)){Te(this,Hr,!0),X(this,$,vi).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof ye.HTMLElement))throw""}catch{Ee("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{Ee("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof _s))throw""}catch{Ee("<media-controller> failed to upgrade!")}X(this,$,_m).call(this),X(this,$,Am).call(this),X(this,$,Tm).call(this),Te(this,Bt,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(y.USER_INACTIVE))!=null?a:!0),X(this,$,ym).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>X(this,$,vi).call(this)),(o=this.media)==null||o.addEventListener("loadstart",()=>X(this,$,vi).call(this))}},gm=function(){var i,a;try{(i=window==null?void 0:window.CSS)==null||i.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{}},ld=function(i){Object.assign(U(this,Ei),i),X(this,$,vi).call(this)},vi=function(i={}){Hc(Bc(fv(this,{...U(this,Ei),...i})),this.shadowRoot)},_m=function(){let i=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let o=r.replace(/^theme-/,"");if(rd.includes(o))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(o,s):(u=this.mediaTheme)==null||u.removeAttribute(o)};new MutationObserver(r=>{for(let{attributeName:o}of r)i(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},Am=function(){let i=a=>{var s;let r=(s=this.media)==null?void 0:s.error;if(!(r instanceof b.MediaError)){let{message:l,code:u}=r!=null?r:{};r=new b.MediaError(l,u)}if(!(r!=null&&r.fatal)){Qe(r),r.data&&Qe(`${r.name} data:`,r.data);return}let o=gl(r,!1);o.message&&nl(o),Ee(r),r.data&&Ee(`${r.name} data:`,r.data),X(this,$,ld).call(this,{isDialogOpen:!0})};this.addEventListener("error",i),this.media&&(this.media.errorTranslator=(a={})=>{var o,s,l;if(!(((o=this.media)==null?void 0:o.error)instanceof b.MediaError))return a;let r=gl((s=this.media)==null?void 0:s.error,!1);return{player_error_code:(l=this.media)==null?void 0:l.error.code,player_error_message:r.message?String(r.message):a.player_error_message,player_error_context:r.context?String(r.context):a.player_error_context}})},Tm=function(){var a,r,o,s;let i=()=>X(this,$,vi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",i),(s=(o=this.media)==null?void 0:o.textTracks)==null||s.addEventListener("removetrack",i)},ym=function(){var m,_;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===w.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(g,f,v=!1)=>{if(o())return;Array.from(g&&g.activeCues||[]).forEach(T=>{if(!(!T.snapToLines||T.line<-5||T.line>=0&&T.line<10))if(!f||this.paused){let C=T.text.split(`
|
|
3079
|
+
`).length,P=-3;this.streamType===w.StreamTypes.LIVE&&(P=-2);let j=P-C;if(T.line===j&&!v)return;r.has(T)||r.set(T,T.line),T.line=j}else setTimeout(()=>{T.line=r.get(T)||"auto"},500)})},l=()=>{var g,f;s(a,(f=(g=this.mediaController)==null?void 0:g.hasAttribute(y.USER_INACTIVE))!=null?f:!1)},u=()=>{var v,N;let f=Array.from(((N=(v=this.mediaController)==null?void 0:v.media)==null?void 0:N.textTracks)||[]).filter(T=>["subtitles","captions"].includes(T.kind)&&T.mode==="showing")[0];f!==a&&(a==null||a.removeEventListener("cuechange",l)),a=f,a==null||a.addEventListener("cuechange",l),s(a,U(this,Bt))};u(),(m=this.textTracks)==null||m.addEventListener("change",u),(_=this.textTracks)==null||_.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var f,v;let g=(v=(f=this.mediaController)==null?void 0:f.hasAttribute(y.USER_INACTIVE))!=null?v:!0;U(this,Bt)!==g&&(Te(this,Bt,g),s(a,U(this,Bt)))})};function Ht(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var yv=sd;
|