@mux/mux-player 2.3.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Wu=Object.create;var Ea=Object.defineProperty;var Fu=Object.getOwnPropertyDescriptor;var Ku=Object.getOwnPropertyNames;var Yu=Object.getPrototypeOf,Gu=Object.prototype.hasOwnProperty;var Zu=(i,e)=>{for(var t in e)Ea(i,t,{get:e[t],enumerable:!0})},Zs=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ku(e))!Gu.call(i,r)&&r!==t&&Ea(i,r,{get:()=>e[r],enumerable:!(a=Fu(e,r))||a.enumerable});return i};var qu=(i,e,t)=>(t=i!=null?Wu(Yu(i)):{},Zs(e||!i||!i.__esModule?Ea(t,"default",{value:i,enumerable:!0}):t,i)),Qu=i=>Zs(Ea({},"__esModule",{value:!0}),i);var Tn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var S=(i,e,t)=>(Tn(i,e,"read from private field"),t?t.call(i):e.get(i)),W=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ce=(i,e,t,a)=>(Tn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var F=(i,e,t)=>(Tn(i,e,"access private method"),t);var _h={};Zu(_h,{MediaError:()=>g.MediaError,default:()=>Ah,getVideoAttribute:()=>Ht});module.exports=Qu(_h);var Ft=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Ft{}globalThis.DocumentFragment=i}var Ii=class extends Ft{},In=class extends Ft{},zu={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(Ii)}},ki,kn=class{constructor(e,t={}){W(this,ki,void 0);ce(this,ki,t==null?void 0:t.detail)}get detail(){return S(this,ki)}initCustomEvent(){}};ki=new WeakMap;function Xu(i,e){return new Ii}var qs={document:{createElement:Xu},DocumentFragment,customElements:zu,CustomEvent:kn,EventTarget:Ft,HTMLElement:Ii,HTMLVideoElement:In},Qs=typeof window=="undefined"||typeof globalThis.customElements=="undefined",U=Qs?qs:globalThis,ne=Qs?qs.document:globalThis.document;var f={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"},A={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},vt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_PAUSED:"mediaPaused",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_ENDED:"mediaEnded",MEDIA_MUTED:"mediaMuted",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_IS_PIP:"mediaIsPip",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_LOADING:"mediaLoading",MEDIA_BUFFERED:"mediaBuffered",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled"},zs=Object.entries(vt),o=zs.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{}),Fe=zs.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"}),kh=Object.entries(Fe).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),Xs=Object.entries(o).reduce((i,[e,t])=>{let a=Fe[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),Kt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Yt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Sn={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},oe={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},fe={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var q={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},D={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},ju={...q,...D};function Js(i){return i==null?void 0:i.map(ec).join(" ")}function js(i){return i==null?void 0:i.split(/\s+/).map(tc)}function ec(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function tc(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:t,height:a}}}function el(i){return i==null?void 0:i.map(ic).join(" ")}function tl(i){return i==null?void 0:i.split(/\s+/).map(ac)}function ic(i){if(i){let{id:e,kind:t,language:a,label:r}=i;return[e,t,a,r].filter(n=>n!=null).join(":")}}function ac(i){if(i){let[e,t,a,r]=i.split(":");return{id:e,kind:t,language:a,label:r}}}function fa(i,e=!1){return i.split("_").map(function(t,a){return(a||e?t[0].toUpperCase():t[0].toLowerCase())+t.slice(1).toLowerCase()}).join("")}function il(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function al(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function va(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var ga=i=>new Promise(e=>setTimeout(e,i));var rl=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],rc=(i,e)=>{let t=i===1?rl[e].singular:rl[e].plural;return`${i} ${t}`},gt=i=>{if(!al(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&rc(d,u)).filter(d=>d).join(", ")}${t?" remaining":""}`};function Se(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||d>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Lh=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var Aa=(i,e,t=".value")=>{let a=i.querySelector(t);a&&(a.textContent=e)},oc=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},_a=(i,e)=>oc(i,e)[0],et=(i,e)=>!i||!e?!1:i.contains(e)?!0:et(i,e.getRootNode().host),tt=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||tt(i.getRootNode().host,e)};function Mn(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=Mn(t.shadowRoot))!=null?e:t:null}function nl(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function ol(i,e=3){if(i.checkVisibility)return i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});let t=i;for(;t&&e>0;){let a=getComputedStyle(t);if(a.opacity==="0"||a.visibility==="hidden"||a.display==="none")return!1;t=t.parentElement,e--}return!0}function sl(i,e,t,a){let r=Cn(t,a),n=Cn(t,{x:i,y:e}),s=Cn(a,{x:i,y:e});return n>r||s>r?n>s?1:0:n/r}function Cn(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function N(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===e)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{},removeProperty:()=>{}}}}function M(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function O(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}M(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function L(i,e){return i.hasAttribute(e)}function C(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}L(i,e)!=t&&i.toggleAttribute(e,t)}function x(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function R(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;x(i,e,void 0)!==a&&i.setAttribute(e,a)}var ya=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Ln=class{observe(){}unobserve(){}disconnect(){}},ll={createElement:function(){return new Rn.HTMLElement},addEventListener(){},removeEventListener(){}},Rn={ResizeObserver:Ln,document:ll,HTMLElement:class extends ya{},DocumentFragment:class extends ya{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[]}},dl=typeof window=="undefined"||typeof window.customElements=="undefined",ul=Object.keys(Rn).every(i=>i in globalThis),l=dl&&!ul?Rn:globalThis,c=dl&&!ul?ll:globalThis.document;var sc=Object.defineProperty,lc=(i,e,t)=>e in i?sc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,dc=(i,e,t)=>(lc(i,typeof e!="symbol"?e+"":e,t),t),cl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},me=(i,e,t)=>(cl(i,e,"read from private field"),t?t.call(i):e.get(i)),Ta=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ia=(i,e,t,a)=>(cl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ce,ka,Gt,Sa,ml=c.createElement("template");ml.innerHTML=`
1
+ "use strict";var Wu=Object.create;var Ea=Object.defineProperty;var Fu=Object.getOwnPropertyDescriptor;var Ku=Object.getOwnPropertyNames;var Yu=Object.getPrototypeOf,Gu=Object.prototype.hasOwnProperty;var Zu=(i,e)=>{for(var t in e)Ea(i,t,{get:e[t],enumerable:!0})},Zs=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ku(e))!Gu.call(i,r)&&r!==t&&Ea(i,r,{get:()=>e[r],enumerable:!(a=Fu(e,r))||a.enumerable});return i};var qu=(i,e,t)=>(t=i!=null?Wu(Yu(i)):{},Zs(e||!i||!i.__esModule?Ea(t,"default",{value:i,enumerable:!0}):t,i)),Qu=i=>Zs(Ea({},"__esModule",{value:!0}),i);var Tn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var S=(i,e,t)=>(Tn(i,e,"read from private field"),t?t.call(i):e.get(i)),W=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ce=(i,e,t,a)=>(Tn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var F=(i,e,t)=>(Tn(i,e,"access private method"),t);var _h={};Zu(_h,{MediaError:()=>g.MediaError,default:()=>Ah,getVideoAttribute:()=>Wt});module.exports=Qu(_h);var Yt=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Yt{}globalThis.DocumentFragment=i}var ki=class extends Yt{},In=class extends Yt{},zu={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(ki)}},Si,kn=class{constructor(e,t={}){W(this,Si,void 0);ce(this,Si,t==null?void 0:t.detail)}get detail(){return S(this,Si)}initCustomEvent(){}};Si=new WeakMap;function Xu(i,e){return new ki}var qs={document:{createElement:Xu},DocumentFragment,customElements:zu,CustomEvent:kn,EventTarget:Yt,HTMLElement:ki,HTMLVideoElement:In},Qs=typeof window=="undefined"||typeof globalThis.customElements=="undefined",U=Qs?qs:globalThis,ne=Qs?qs.document:globalThis.document;var f={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"},A={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},gt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_PAUSED:"mediaPaused",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_ENDED:"mediaEnded",MEDIA_MUTED:"mediaMuted",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_IS_PIP:"mediaIsPip",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_LOADING:"mediaLoading",MEDIA_BUFFERED:"mediaBuffered",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled"},zs=Object.entries(gt),o=zs.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{}),Fe=zs.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"}),kh=Object.entries(Fe).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),Xs=Object.entries(o).reduce((i,[e,t])=>{let a=Fe[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),et={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},At={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Sn={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},oe={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},fe={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var q={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},D={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},ju={...q,...D};function Js(i){return i==null?void 0:i.map(ec).join(" ")}function js(i){return i==null?void 0:i.split(/\s+/).map(tc)}function ec(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function tc(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:t,height:a}}}function el(i){return i==null?void 0:i.map(ic).join(" ")}function tl(i){return i==null?void 0:i.split(/\s+/).map(ac)}function ic(i){if(i){let{id:e,kind:t,language:a,label:r}=i;return[e,t,a,r].filter(n=>n!=null).join(":")}}function ac(i){if(i){let[e,t,a,r]=i.split(":");return{id:e,kind:t,language:a,label:r}}}function fa(i,e=!1){return i.split("_").map(function(t,a){return(a||e?t[0].toUpperCase():t[0].toLowerCase())+t.slice(1).toLowerCase()}).join("")}function il(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function al(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function va(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var ga=i=>new Promise(e=>setTimeout(e,i));var rl=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],rc=(i,e)=>{let t=i===1?rl[e].singular:rl[e].plural;return`${i} ${t}`},_t=i=>{if(!al(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&rc(d,u)).filter(d=>d).join(", ")}${t?" remaining":""}`};function Se(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||d>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Lh=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var Aa=(i,e,t=".value")=>{let a=i.querySelector(t);a&&(a.textContent=e)},oc=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},_a=(i,e)=>oc(i,e)[0],tt=(i,e)=>!i||!e?!1:i.contains(e)?!0:tt(i,e.getRootNode().host),it=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||it(i.getRootNode().host,e)};function Mn(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=Mn(t.shadowRoot))!=null?e:t:null}function nl(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function ol(i,e=3){if(i.checkVisibility)return i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});let t=i;for(;t&&e>0;){let a=getComputedStyle(t);if(a.opacity==="0"||a.visibility==="hidden"||a.display==="none")return!1;t=t.parentElement,e--}return!0}function sl(i,e,t,a){let r=Cn(t,a),n=Cn(t,{x:i,y:e}),s=Cn(a,{x:i,y:e});return n>r||s>r?n>s?1:0:n/r}function Cn(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function N(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===e)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{},removeProperty:()=>{},getPropertyValue:()=>""}}}function M(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function O(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}M(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function L(i,e){return i.hasAttribute(e)}function C(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}L(i,e)!=t&&i.toggleAttribute(e,t)}function x(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function R(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;x(i,e,void 0)!==a&&i.setAttribute(e,a)}var ya=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Ln=class{observe(){}unobserve(){}disconnect(){}},ll={createElement:function(){return new Rn.HTMLElement},addEventListener(){},removeEventListener(){}},Rn={ResizeObserver:Ln,document:ll,HTMLElement:class extends ya{},DocumentFragment:class extends ya{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[]}},dl=typeof window=="undefined"||typeof window.customElements=="undefined",ul=Object.keys(Rn).every(i=>i in globalThis),l=dl&&!ul?Rn:globalThis,c=dl&&!ul?ll:globalThis.document;var sc=Object.defineProperty,lc=(i,e,t)=>e in i?sc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,dc=(i,e,t)=>(lc(i,typeof e!="symbol"?e+"":e,t),t),cl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},me=(i,e,t)=>(cl(i,e,"read from private field"),t?t.call(i):e.get(i)),Ta=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ia=(i,e,t,a)=>(cl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ce,ka,Gt,Sa,ml=c.createElement("template");ml.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  font: var(--media-font,
@@ -8,10 +8,10 @@
8
8
  var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
9
9
  color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
10
10
  background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
11
- padding: var(--media-control-padding, 10px);
11
+ padding: var(--media-button-padding, var(--media-control-padding, 10px));
12
+ justify-content: var(--media-button-justify-content, center);
12
13
  display: inline-flex;
13
14
  align-items: center;
14
- justify-content: center;
15
15
  vertical-align: middle;
16
16
  box-sizing: border-box;
17
17
  transition: background .15s linear;
@@ -82,14 +82,14 @@
82
82
  <slot name="enter">${uc}</slot>
83
83
  <slot name="exit">${cc}</slot>
84
84
  </slot>
85
- `;var El=i=>{let e=i.mediaIsCasting?D.EXIT_CAST():D.ENTER_CAST();i.setAttribute("aria-label",e)},xn=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:fl,...e})}connectedCallback(){super.connectedCallback(),El(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_CASTING&&El(this)}get mediaIsCasting(){return L(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){C(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return x(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){R(this,o.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?f.MEDIA_EXIT_CAST_REQUEST:f.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",xn);var vl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},it=(i,e,t)=>(vl(i,e,"read from private field"),t?t.call(i):e.get(i)),mc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ca=(i,e,t,a)=>(vl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),te,gl=c.createElement("template");gl.innerHTML=`
85
+ `;var El=i=>{let e=i.mediaIsCasting?D.EXIT_CAST():D.ENTER_CAST();i.setAttribute("aria-label",e)},xn=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:fl,...e})}connectedCallback(){super.connectedCallback(),El(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_CASTING&&El(this)}get mediaIsCasting(){return L(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){C(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return x(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){R(this,o.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?f.MEDIA_EXIT_CAST_REQUEST:f.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",xn);var vl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},at=(i,e,t)=>(vl(i,e,"read from private field"),t?t.call(i):e.get(i)),mc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ca=(i,e,t,a)=>(vl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),te,gl=c.createElement("template");gl.innerHTML=`
86
86
  <style>
87
87
  :host {
88
88
  display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
89
89
  box-sizing: border-box;
90
90
  }
91
91
  </style>
92
- `;var Dn=class extends l.HTMLElement{constructor(e={}){if(super(),mc(this,te,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=gl.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=c.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=it(this,te))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ca(this,te,null)),a&&this.isConnected&&(Ca(this,te,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=it(this,te))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Ca(this,te,hc(this)),this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=it(this,te))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=it(this,te))==null||a.addEventListener("pointerdown",this),(r=it(this,te))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=it(this,te))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=it(this,te))==null||a.removeEventListener("pointerdown",this),(r=it(this,te))==null||r.removeEventListener("click",this),Ca(this,te,null)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[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:n,clientY:s}=e,{left:d,top:u,width:h,height:m}=this.getBoundingClientRect(),b=n-d,E=s-u;if(b<0||E<0||b>h||E>m||h===0&&m===0)return;let{pointerType:I=this._pointerType}=e;if(this._pointerType=void 0,I===Sn.TOUCH){this.handleTap(e);return}else if(I===Sn.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}};te=new WeakMap;function hc(i){var e;let t=i.getAttribute(A.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):tt(i,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Dn);var Al=new WeakMap,On=i=>{let e=Al.get(i);return e||Al.set(i,e=new Set),e},_l=new l.ResizeObserver(i=>{for(let e of i)for(let t of On(e.target))t(e)});function Si(i,e){On(i).add(e),_l.observe(i)}function Nn(i,e){let t=On(i);t.delete(e),t.size||_l.unobserve(i)}var pc=Object.defineProperty,bc=(i,e,t)=>e in i?pc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ec=(i,e,t)=>(bc(i,typeof e!="symbol"?e+"":e,t),t),Vn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Zt=(i,e,t)=>(Vn(i,e,"read from private field"),t?t.call(i):e.get(i)),At=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Un=(i,e,t,a)=>(Vn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ve=(i,e,t)=>(Vn(i,e,"access private method"),t),Ma,Ke,Pn,yl,Bn,Tl,Ci,Ra,wa,Hn,qt,Mi,T={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},Il=c.createElement("template");Il.innerHTML=`
92
+ `;var Dn=class extends l.HTMLElement{constructor(e={}){if(super(),mc(this,te,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=gl.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=c.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=at(this,te))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ca(this,te,null)),a&&this.isConnected&&(Ca(this,te,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=at(this,te))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Ca(this,te,hc(this)),this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=at(this,te))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=at(this,te))==null||a.addEventListener("pointerdown",this),(r=at(this,te))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=at(this,te))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=at(this,te))==null||a.removeEventListener("pointerdown",this),(r=at(this,te))==null||r.removeEventListener("click",this),Ca(this,te,null)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[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:n,clientY:s}=e,{left:d,top:u,width:h,height:m}=this.getBoundingClientRect(),b=n-d,E=s-u;if(b<0||E<0||b>h||E>m||h===0&&m===0)return;let{pointerType:I=this._pointerType}=e;if(this._pointerType=void 0,I===Sn.TOUCH){this.handleTap(e);return}else if(I===Sn.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}};te=new WeakMap;function hc(i){var e;let t=i.getAttribute(A.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):it(i,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Dn);var Al=new WeakMap,On=i=>{let e=Al.get(i);return e||Al.set(i,e=new Set),e},_l=new l.ResizeObserver(i=>{for(let e of i)for(let t of On(e.target))t(e)});function Ci(i,e){On(i).add(e),_l.observe(i)}function Nn(i,e){let t=On(i);t.delete(e),t.size||_l.unobserve(i)}var pc=Object.defineProperty,bc=(i,e,t)=>e in i?pc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ec=(i,e,t)=>(bc(i,typeof e!="symbol"?e+"":e,t),t),Vn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Zt=(i,e,t)=>(Vn(i,e,"read from private field"),t?t.call(i):e.get(i)),yt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Un=(i,e,t,a)=>(Vn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ve=(i,e,t)=>(Vn(i,e,"access private method"),t),Ma,Ke,Pn,yl,Bn,Tl,Mi,Ra,wa,Hn,qt,Li,T={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},Il=c.createElement("template");Il.innerHTML=`
93
93
  <style>
94
94
 
95
95
  :host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -181,7 +181,7 @@
181
181
  }
182
182
 
183
183
 
184
- ::slotted(:not([slot=media]):not([${T.NO_AUTOHIDE}])) {
184
+ ::slotted(:not([slot=media]):not([${T.NO_AUTOHIDE}]):not([hidden])) {
185
185
  opacity: 1;
186
186
  transition: opacity 0.25s;
187
187
  }
@@ -204,6 +204,10 @@
204
204
  :host(:not([${T.AUDIO}])[${o.MEDIA_HAS_PLAYED}]) slot[name=poster] {
205
205
  display: none;
206
206
  }
207
+
208
+ ::slotted([role=menu]) {
209
+ align-self: end;
210
+ }
207
211
  </style>
208
212
 
209
213
  <slot name="media" part="layer media-layer"></slot>
@@ -218,7 +222,7 @@
218
222
 
219
223
  <slot part="bottom chrome"></slot>
220
224
  </span>
221
- `;var fc=Object.values(o),vc="sm:384 md:576 lg:768 xl:960";function gc(i){Ac(i.target,i.contentRect.width)}function Ac(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(T.BREAKPOINTS))!=null?t:vc,r=_c(a),n=yc(r,e),s=!1;if(Object.keys(r).forEach(d=>{if(n.includes(d)){i.hasAttribute(`breakpoint${d}`)||(i.setAttribute(`breakpoint${d}`,""),s=!0);return}i.hasAttribute(`breakpoint${d}`)&&(i.removeAttribute(`breakpoint${d}`),s=!0)}),s){let d=new CustomEvent(Fe.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(d)}}function _c(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function yc(i,e){return Object.keys(i).filter(t=>e>=i[t])}var La=class extends l.HTMLElement{constructor(){super(),At(this,Pn),At(this,Bn),At(this,Ci),At(this,wa),At(this,qt),At(this,Ma,0),At(this,Ke,void 0),Ec(this,"breakpointsComputed",!1),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Il.content.cloneNode(!0)));let e=s=>{let d=this.media;for(let u of s)u.type==="childList"&&(u.removedNodes.forEach(h=>{if(h.slot=="media"&&u.target==this){let m=u.previousSibling&&u.previousSibling.previousElementSibling;if(!m||!d)this.mediaUnsetCallback(h);else{let b=m.slot!=="media";for(;(m=m.previousSibling)!==null;)m.slot=="media"&&(b=!1);b&&this.mediaUnsetCallback(h)}}}),d&&u.addedNodes.forEach(h=>{h===d&&d!==Zt(this,Ke)&&this.handleMediaUpdated(d).then(m=>this.mediaSetCallback(m))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1;Si(this,s=>{a||(setTimeout(()=>{gc(s),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(Fe.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))},0),a=!0)});let n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){Zt(this,Ke)&&this.mediaUnsetCallback(Zt(this,Ke));return}this.media&&this.media!==Zt(this,Ke)&&this.handleMediaUpdated(this.media).then(d=>this.mediaSetCallback(d))})}static get observedAttributes(){return[T.AUTOHIDE,T.GESTURES_DISABLED].concat(fc).filter(e=>![o.MEDIA_RENDITION_LIST,o.MEDIA_AUDIO_TRACK_LIST].includes(e))}attributeChangedCallback(e,t,a){e.toLowerCase()==T.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){Un(this,Ke,e);let t=a=>(Un(this,Ke,null),console.error('Media Chrome: Media element set with slot="media" does not appear to be compatible.',a),Promise.reject(a));return e?(e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),e):t(e)}connectedCallback(){var e;let a=this.getAttribute(T.AUDIO)!=null?q.AUDIO_PLAYER():q.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.media&&this.media!==Zt(this,Ke)&&this.handleMediaUpdated(this.media).then(r=>this.mediaSetCallback(r)),this.setAttribute(T.USER_INACTIVE,""),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=l.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){}handleEvent(e){switch(e.type){case"pointerdown":Un(this,Ma,e.timeStamp);break;case"pointermove":ve(this,Pn,yl).call(this,e);break;case"pointerup":ve(this,Bn,Tl).call(this,e);break;case"mouseleave":ve(this,Ci,Ra).call(this);break;case"mouseup":this.removeAttribute(T.KEYBOARD_CONTROL);break;case"keyup":ve(this,qt,Mi).call(this),this.setAttribute(T.KEYBOARD_CONTROL,"");break}}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};Ma=new WeakMap;Ke=new WeakMap;Pn=new WeakSet;yl=function(i){i.pointerType!=="mouse"&&i.timeStamp-Zt(this,Ma)<250||(ve(this,wa,Hn).call(this),clearTimeout(this._inactiveTimeout),[this,this.media].includes(i.target)&&ve(this,qt,Mi).call(this))};Bn=new WeakSet;Tl=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(T.USER_INACTIVE);[this,this.media].includes(i.target)&&e?ve(this,Ci,Ra).call(this):ve(this,qt,Mi).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&ve(this,qt,Mi).call(this)};Ci=new WeakSet;Ra=function(){if(this.autohide<0||this.hasAttribute(T.USER_INACTIVE))return;this.setAttribute(T.USER_INACTIVE,"");let i=new l.CustomEvent(Fe.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};wa=new WeakSet;Hn=function(){if(!this.hasAttribute(T.USER_INACTIVE))return;this.removeAttribute(T.USER_INACTIVE);let i=new l.CustomEvent(Fe.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};qt=new WeakSet;Mi=function(){ve(this,wa,Hn).call(this),clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=setTimeout(()=>{ve(this,Ci,Ra).call(this)},this.autohide*1e3))};var kl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},K=(i,e,t)=>(kl(i,e,"read from private field"),t?t.call(i):e.get(i)),Li=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},xa=(i,e,t,a)=>(kl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Qt,zt,Da,_t,Ye,at,rt=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){Li(this,Ye),Li(this,Qt,void 0),Li(this,zt,void 0),Li(this,Da,void 0),Li(this,_t,new Set),xa(this,Qt,e),xa(this,zt,t),xa(this,Da,new Set(a))}[Symbol.iterator](){return K(this,Ye,at).values()}get length(){return K(this,Ye,at).size}get value(){var e;return(e=[...K(this,Ye,at)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(xa(this,_t,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...K(this,Ye,at)][e]}values(){return K(this,Ye,at).values()}forEach(e){K(this,Ye,at).forEach(e)}add(...e){var t,a;e.forEach(r=>K(this,_t).add(r)),!(this.value===""&&!((t=K(this,Qt))!=null&&t.hasAttribute(`${K(this,zt)}`)))&&((a=K(this,Qt))==null||a.setAttribute(`${K(this,zt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>K(this,_t).delete(a)),(t=K(this,Qt))==null||t.setAttribute(`${K(this,zt)}`,`${this.value}`)}contains(e){return K(this,Ye,at).has(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};Qt=new WeakMap;zt=new WeakMap;Da=new WeakMap;_t=new WeakMap;Ye=new WeakSet;at=function(){return K(this,_t).size?K(this,_t):K(this,Da)};var Tc=(i="")=>i.split(/\s+/),Sl=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return e=e==="cc"?"captions":"subtitles",{kind:e,language:t,label:r}},Ri=(i="",e={})=>Tc(i).map(t=>{let a=Sl(t);return{...e,...a}}),$n=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?Sl(e):e):typeof i=="string"?Ri(i):[i],Oa=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,yt=(i=[])=>Array.prototype.map.call(i,Oa).join(" "),Ic=(i,e)=>t=>t[i]===e,Cl=i=>{let e=Object.entries(i).map(([t,a])=>Ic(t,a));return t=>e.every(a=>a(t))},wi=(i,e=[],t=[])=>{let a=$n(t).map(Cl),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},Na=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Cl(e);return Array.from(i.textTracks).filter(t)},Ml=i=>!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);var B={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};c.fullscreenElement===void 0&&(B.enter="webkitRequestFullScreen",B.exit=c.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",B.rootEvents=["webkitfullscreenchange"],B.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],B.element="webkitFullscreenElement",B.error="webkitfullscreenerror",B.enabled="webkitFullscreenEnabled");var Ua,Wn=()=>{var i,e;return Ua||(Ua=(e=(i=c)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Ua)},Ll=async(i=Wn())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await ga(0),i.volume!==e},kc=(i=Wn())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",Sc=(i=Wn())=>{let e=c[B.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Fn=Sc(),Rl=kc(),wl=!!l.WebKitPlaybackTargetAvailabilityEvent,xl=!!l.chrome;var Ba,Dl=Ll().then(i=>(Ba=i,Ba)),Cc=Object.values(fe),Pa=i=>Na(i.media,e=>[Kt.SUBTITLES,Kt.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Ol=i=>Na(i.media,e=>e.mode===Yt.SHOWING&&[Kt.SUBTITLES,Kt.CAPTIONS].includes(e.kind)),ie={MEDIA_PAUSED:{get:function(i){let{media:e}=i;return e?e.paused:!0},mediaEvents:["play","playing","pause","emptied"]},MEDIA_HAS_PLAYED:{get:function(i){let{media:e}=i;return e?!e.paused:!1},mediaEvents:["playing","emptied"]},MEDIA_ENDED:{get:function(i){let{media:e}=i;return e?e.ended:!1},mediaEvents:["seeked","ended","emptied"]},MEDIA_PLAYBACK_RATE:{get:function(i){let{media:e}=i;return!e||typeof e.playbackRate=="undefined"?1:e.playbackRate},mediaEvents:["ratechange","loadstart"]},MEDIA_MUTED:{get:function(i){let{media:e}=i;return!e||typeof e.muted=="undefined"?!1:e.muted},mediaEvents:["volumechange"]},MEDIA_VOLUME:{get:function(i){let{media:e}=i;return!e||typeof e.volume=="undefined"?1:Number(e.volume)},mediaEvents:["volumechange"]},MEDIA_VOLUME_LEVEL:{get:function(i){let{media:e}=i,t="high";if(!e||typeof e.volume=="undefined")return t;let{muted:a,volume:r}=e;return r===0||a?t="off":r<.5?t="low":r<.75&&(t="medium"),t},mediaEvents:["volumechange"]},MEDIA_CURRENT_TIME:{get:function(i){let{media:e}=i;return!e||typeof e.currentTime=="undefined"?0:e.currentTime},mediaEvents:["playing","pause","timeupdate","loadedmetadata"]},MEDIA_DURATION:{get:function(i){let{media:e}=i;return i.hasAttribute("defaultduration")&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?+i.getAttribute("defaultduration"):!e||!Number.isFinite(e.duration)?Number.NaN:e.duration},mediaEvents:["durationchange","loadedmetadata","emptied"]},MEDIA_SEEKABLE:{get:function(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress"]},MEDIA_LOADING:{get:function(i){var e;return((e=i.media)==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},MEDIA_BUFFERED:{get:function(i){var e,t,a;let r=(e=i.media)==null?void 0:e.buffered;return Array.from((a=(t=i.media)==null?void 0:t.buffered)!=null?a:[]).map((n,s)=>[Number(r.start(s)).toFixed(3),Number(r.end(s)).toFixed(3)])},mediaEvents:["progress","emptied"]},MEDIA_STREAM_TYPE:{get:function(i){let{media:e}=i;if(!e)return;let{streamType:t}=e;if(Cc.includes(t)){if(t===fe.UNKNOWN){let r=i.getAttribute("defaultstreamtype");return[fe.LIVE,fe.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return fe.LIVE;if(Number.isFinite(a))return fe.ON_DEMAND;{let r=i.getAttribute("defaultstreamtype");if([fe.LIVE,fe.ON_DEMAND].includes(r))return r}},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},MEDIA_TARGET_LIVE_WINDOW:{get:function(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=ie.MEDIA_STREAM_TYPE.get(i);return(t==null||Number.isNaN(t))&&a===fe.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},MEDIA_TIME_IS_LIVE:{get:function(i){let{media:e}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(ie.MEDIA_STREAM_TYPE.get(i)==="live"))return!1;let a=e.seekable;if(!a)return!0;if(!a.length)return!1;let r=i.hasAttribute("liveedgeoffset")?Number(i.getAttribute("liveedgeoffset")):10,n=a.end(a.length-1)-r;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},MEDIA_IS_FULLSCREEN:{get:function(i,e){var t,a;let r=i.media;if(r&&c[B.element]===void 0&&"webkitDisplayingFullscreen"in r)return r.webkitDisplayingFullscreen&&r.webkitPresentationMode==="fullscreen";let n;return e?n=c[B.element]?e.target:null:n=(a=(t=nl(i))==null?void 0:t.fullscreenElement)!=null?a:c[B.element],et(i.fullscreenElement,n)},rootEvents:B.rootEvents,mediaEvents:B.mediaEvents},MEDIA_IS_PIP:{get:function(i,e){var t;let a=i.media;if(!a)return!1;if(e)return e.type=="enterpictureinpicture";{let r=(t=i.getRootNode().pictureInPictureElement)!=null?t:c.pictureInPictureElement;return et(a,r)}},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},MEDIA_IS_AIRPLAYING:{get:function(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:t.remote.state},remoteEvents:["playing","connect","connecting","disconnect"]},MEDIA_IS_CASTING:{get:function(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:t.remote.state},remoteEvents:["connect","connecting","disconnect"]},MEDIA_AIRPLAY_UNAVAILABLE:{get:function(i,{availability:e=!1}={}){if(!wl)return oe.UNSUPPORTED;if(!(e==null||e===!0))return oe.UNAVAILABLE},mediaSetCallback(i,e){var t;(t=i.remote)==null||t.watchAvailability(a=>e({availability:a}))},mediaUnsetCallback(i){var e;(e=i.remote)==null||e.cancelWatchAvailability()}},MEDIA_CAST_UNAVAILABLE:{get:function(i,{availability:e=!1}={}){var t;let{media:a}=i;if(!xl||!((t=a==null?void 0:a.remote)!=null&&t.state))return oe.UNSUPPORTED;if(!(e==null||e===!0))return oe.UNAVAILABLE},mediaSetCallback(i,e){var t;(t=i.remote)==null||t.watchAvailability(a=>e({availability:a}))},mediaUnsetCallback(i){var e;(e=i.remote)==null||e.cancelWatchAvailability()}},MEDIA_FULLSCREEN_UNAVAILABLE:{get:function(){return Fn?void 0:oe.UNAVAILABLE}},MEDIA_PIP_UNAVAILABLE:{get:function(){return Rl?void 0:oe.UNSUPPORTED}},MEDIA_RENDITION_UNAVAILABLE:{get:function(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return oe.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_AUDIO_TRACK_UNAVAILABLE:{get:function(i){var e,t;let{media:a}=i;if(!(a!=null&&a.audioTracks))return oe.UNSUPPORTED;if(((t=(e=a.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_VOLUME_UNAVAILABLE:{get:function(i){if(Ba!==void 0&&!Ba)return oe.UNSUPPORTED;let{media:e}=i;if(e&&typeof e.volume=="undefined")return oe.UNAVAILABLE},mediaEvents:["loadstart"]},MEDIA_SUBTITLES_LIST:{get:function(i){return Pa(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},MEDIA_SUBTITLES_SHOWING:{get:function(i){return i.hasAttribute("defaultsubtitles")&&!i.hasAttribute(o.MEDIA_HAS_PLAYED)&&!i.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)&&xi.MEDIA_TOGGLE_SUBTITLES_REQUEST(void 0,void 0,i),Ol(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"]},MEDIA_RENDITION_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]]},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_RENDITION_SELECTED:{get:function(i){var e,t,a;let{media:r}=i;return(a=(t=r==null?void 0:r.videoRenditions)==null?void 0:t[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},MEDIA_AUDIO_TRACK_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_AUDIO_TRACK_ENABLED:{get:function(i){var e,t;let{media:a}=i;return(t=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:t.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]}},xi={MEDIA_PLAY_REQUEST:(i,e,t)=>{var a;let r=ie.MEDIA_STREAM_TYPE.get(t),n=t.getAttribute("noautoseektolive")===null;r==fe.LIVE&&n&&xi.MEDIA_SEEK_TO_LIVE_REQUEST(i),(a=i.play())==null||a.catch(()=>{})},MEDIA_PAUSE_REQUEST:i=>i.pause(),MEDIA_MUTE_REQUEST:i=>i.muted=!0,MEDIA_UNMUTE_REQUEST:i=>{i.muted=!1,i.volume===0&&(i.volume=.25)},MEDIA_VOLUME_REQUEST:(i,e,t)=>{let a=e.detail;if(i.volume=a,a>0&&i.muted&&(i.muted=!1),!t.hasAttribute("novolumepref"))try{l.localStorage.setItem("media-chrome-pref-volume",a.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:(i,e,t)=>{if(!Fn){console.warn("MediaChrome: Fullscreen support is unavailable; not entering fullscreen");return}c.pictureInPictureElement&&c.exitPictureInPicture(),t[B.enter]?t.fullscreenElement[B.enter]():i.webkitEnterFullscreen?i.webkitEnterFullscreen():i.requestFullscreen?i.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{c[B.exit]()},MEDIA_ENTER_PIP_REQUEST:i=>{if(!c.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}c[B.element]&&c[B.exit]();let e=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(t=>{if(t.code===11)if(i.readyState===0&&i.preload==="none"){let a=()=>{i.removeEventListener("loadedmetadata",r),i.preload="none"},r=()=>{i.requestPictureInPicture().catch(e),a()};i.addEventListener("loadedmetadata",r),i.preload="metadata",setTimeout(()=>{i.readyState===0&&e(),a()},1e3)}else throw t;else throw t})},MEDIA_EXIT_PIP_REQUEST:()=>{c.pictureInPictureElement&&c.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:async i=>{var e;if(((e=i.remote)==null?void 0:e.state)==="disconnected"){if(c[B.element]&&c[B.exit](),!i.remote.prompt){console.warn("MediaChrome: Casting is not supported in this environment");return}try{await i.remote.prompt()}catch{}}},MEDIA_EXIT_CAST_REQUEST:i=>{var e;((e=i.remote)==null?void 0:e.state)==="connected"&&i.remote.prompt()},MEDIA_SEEK_REQUEST:(i,e)=>{let t=e.detail;(i.readyState>0||i.readyState===void 0)&&(i.currentTime=t)},MEDIA_PLAYBACK_RATE_REQUEST:(i,e)=>{i.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:(i,e,t)=>{var a;if(!i)return;let r=e.detail;r===null&&t.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_TIME,r);let[n]=Na(i,{kind:Kt.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;if(r===null){t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let s=Array.prototype.find.call(n.cues,m=>m.startTime>=r);if(!s)return;let d=/'^(?:[a-z]+:)?\/\//i.test(s.text)||(a=i.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,u=new URL(s.text,d),h=new URLSearchParams(u.hash).get("#xywh");t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,u.href),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,h.split(","))},MEDIA_SHOW_SUBTITLES_REQUEST:(i,e,t)=>{var a;let r=Pa(t),{detail:n=[]}=e,s=$n(n),d=(a=s[0])==null?void 0:a.language;d&&!(t!=null&&t.hasAttribute("nosubtitleslangpref"))&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),wi(Yt.SHOWING,r,s)},MEDIA_DISABLE_SUBTITLES_REQUEST:(i,e,t)=>{let a=Pa(t),{detail:r=[]}=e;wi(Yt.DISABLED,a,r)},MEDIA_TOGGLE_SUBTITLES_REQUEST:(i,e,t)=>{let{detail:a}=e!=null?e:{},r=Pa(t),n=Ol(t),s=!!n.length;if(!(!r.length||s&&a||!s&&a===!1))if(s)wi(Yt.DISABLED,r,n);else{let d=r[0];if(!(t!=null&&t.hasAttribute("nosubtitleslangpref"))){let b=l.localStorage.getItem("media-chrome-pref-subtitles-lang"),E=b?[b,...l.navigator.languages]:l.navigator.languages,I=r.filter(H=>E.some(k=>H.language.toLowerCase().startsWith(k.split("-")[0]))).sort((H,k)=>{let $=E.findIndex(ee=>H.language.toLowerCase().startsWith(ee.split("-")[0])),Z=E.findIndex(ee=>k.language.toLowerCase().startsWith(ee.split("-")[0]));return $-Z});I[0]&&(d=I[0])}let{language:u,label:h,kind:m}=d;wi(Yt.SHOWING,r,[{language:u,label:h,kind:m}])}},MEDIA_AIRPLAY_REQUEST:async i=>{if(i!=null&&i.remote){if(!i.remote.prompt){console.warn("MediaChrome: AirPlay is not supported in this environment");return}try{await i.remote.prompt()}catch{}}},MEDIA_SEEK_TO_LIVE_REQUEST:i=>{let e=i.seekable;if(!e){console.warn("MediaChrome: Media element does not support seeking to live.");return}if(!e.length){console.warn("MediaChrome: Media is unable to seek to live.");return}i.currentTime=e.end(e.length-1)},MEDIA_RENDITION_REQUEST:(i,e)=>{if(!(i!=null&&i.videoRenditions)){console.warn("MediaChrome: Rendition selection not supported by this media.");return}let t=e.detail,a=[...i.videoRenditions].findIndex(r=>r.id==t);i.videoRenditions.selectedIndex!=a&&(i.videoRenditions.selectedIndex=a)},MEDIA_AUDIO_TRACK_REQUEST:(i,e)=>{if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let t=e.detail;for(let a of i.audioTracks)a.enabled=t==a.id}};var Zn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Me=(i,e,t)=>(Zn(i,e,"read from private field"),t?t.call(i):e.get(i)),Di=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Kn=(i,e,t,a)=>(Zn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Jt=(i,e,t)=>(Zn(i,e,"access private method"),t),nt,Oi,Xt,jt,Ni,Va,Yn,Hl=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],Mc=10,Nl=0,X={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys"},Ha=class extends La{constructor(){super(),Di(this,jt),Di(this,Va),Di(this,nt,new rt(this,X.HOTKEYS)),Di(this,Oi,void 0),Di(this,Xt,void 0),ie.MEDIA_VOLUME_UNAVAILABLE.get(this)===void 0&&Dl.then(()=>{this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,ie.MEDIA_VOLUME_UNAVAILABLE.get(this))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this),Object.keys(xi).forEach(e=>{let t=`_handle${fa(e,!0)}`;this[t]=a=>{if(a.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}xi[e](this.media,a,this)},this.addEventListener(f[e],this[t])}),this._mediaStatePropagators={},Object.keys(ie).forEach(e=>{this._mediaStatePropagators[e]=t=>{this.propagateMediaState(vt[e],ie[e].get(this,t))}})}static get observedAttributes(){return super.observedAttributes.concat(X.NO_HOTKEYS,X.HOTKEYS,X.DEFAULT_STREAM_TYPE,X.DEFAULT_SUBTITLES,X.DEFAULT_DURATION)}get fullscreenElement(){var e;return(e=Me(this,Oi))!=null?e:this}set fullscreenElement(e){this.hasAttribute(X.FULLSCREEN_ELEMENT)&&this.removeAttribute(X.FULLSCREEN_ELEMENT),Kn(this,Oi,e)}attributeChangedCallback(e,t,a){var r;if(super.attributeChangedCallback(e,t,a),e===X.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(X.HOTKEYS)&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e===X.HOTKEYS)Me(this,nt).value=a;else if(e===X.DEFAULT_SUBTITLES&&a!==t&&a==="")this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:!0}));else if(e===X.DEFAULT_STREAM_TYPE)this.propagateMediaState(vt.MEDIA_STREAM_TYPE);else if(e===X.FULLSCREEN_ELEMENT){let n=a?(r=Me(this,Xt))==null?void 0:r.getElementById(a):void 0;Kn(this,Oi,n)}}connectedCallback(){super.connectedCallback(),Kn(this,Xt,this.getRootNode()),this.enableHotkeys()}disconnectedCallback(){super.disconnectedCallback(),this.disableHotkeys(),this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:!1}))}mediaSetCallback(e){if(super.mediaSetCallback(e),e.hasAttribute("tabindex")||(e.tabIndex=-1),Object.keys(ie).forEach(t=>{let{mediaSetCallback:a,mediaEvents:r,rootEvents:n,textTracksEvents:s,videoRenditionsEvents:d,audioTracksEvents:u,remoteEvents:h}=ie[t],m=this._mediaStatePropagators[t];a&&(a(e,m),m()),r==null||r.forEach(b=>{e.addEventListener(b,m),m()}),n==null||n.forEach(b=>{var E;(E=Me(this,Xt))==null||E.addEventListener(b,m),m()}),s==null||s.forEach(b=>{var E;(E=e.textTracks)==null||E.addEventListener(b,m),m()}),d==null||d.forEach(b=>{var E;(E=e.videoRenditions)==null||E.addEventListener(b,m),m()}),u==null||u.forEach(b=>{var E;(E=e.audioTracks)==null||E.addEventListener(b,m),m()}),h==null||h.forEach(b=>{var E;(E=e.remote)==null||E.addEventListener(b,m),m()})}),!this.hasAttribute("novolumepref"))try{let t=l.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(ie).forEach(t=>{let{mediaUnsetCallback:a,mediaEvents:r,rootEvents:n,textTracksEvents:s,videoRenditionsEvents:d,audioTracksEvents:u,remoteEvents:h}=ie[t],m=this._mediaStatePropagators[t];r==null||r.forEach(b=>{e.removeEventListener(b,m)}),n==null||n.forEach(b=>{var E;(E=Me(this,Xt))==null||E.removeEventListener(b,m)}),s==null||s.forEach(b=>{var E;(E=e.textTracks)==null||E.removeEventListener(b,m)}),d==null||d.forEach(b=>{var E;(E=e.videoRenditions)==null||E.removeEventListener(b,m),m()}),u==null||u.forEach(b=>{var E;(E=e.audioTracks)==null||E.removeEventListener(b,m),m()}),h==null||h.forEach(b=>{var E;(E=e.remote)==null||E.removeEventListener(b,m),m()}),a&&(a(e,m),m())}),this.propagateMediaState(vt.MEDIA_PAUSED,!0)}propagateMediaState(e,t){let a=Vl(this.mediaStateReceivers,e);if(Bl(this.mediaStateReceivers,e,t),a===Vl(this.mediaStateReceivers,e))return;let r=e.toLowerCase(),n=new l.CustomEvent(Xs[r],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(n)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=Oc(e,a,r);Object.keys(f).forEach(s=>{e.addEventListener(f[s],this[`_handle${fa(s,!0)}`])}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(f).forEach(r=>{e.removeEventListener(f[r],this[`_handle${fa(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Object.keys(ie).forEach(r=>{let n=ie[r];Bl([e],vt[r],n.get(this))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Jt(this,Va,Yn))}disableHotkeys(){this.removeEventListener("keydown",Jt(this,Va,Yn)),this.removeEventListener("keyup",Jt(this,jt,Ni))}get hotkeys(){return Me(this,nt)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute(X.KEYS_USED))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(I=>I==="Space"?" ":I).filter(Boolean).includes(e.key))return;let d,u,h,m,b,E=Mc;if(!Me(this,nt).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&Me(this,nt).contains("nospace")))switch(e.key){case" ":case"k":d=this.getAttribute(o.MEDIA_PAUSED)!=null?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"m":d=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?f.MEDIA_UNMUTE_REQUEST:f.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"f":d=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?f.MEDIA_EXIT_FULLSCREEN_REQUEST:f.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":u=this.getAttribute(o.MEDIA_CURRENT_TIME),h=u&&!Number.isNaN(+u)?+u:Nl,m=Math.max(h-E,0),b=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(b);break;case"ArrowRight":u=this.getAttribute(o.MEDIA_CURRENT_TIME),h=u&&!Number.isNaN(+u)?+u:Nl,m=Math.max(h+E,0),b=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(b);break;default:break}}};nt=new WeakMap;Oi=new WeakMap;Xt=new WeakMap;jt=new WeakSet;Ni=function(i){let{key:e}=i;if(!Hl.includes(e)){this.removeEventListener("keyup",Jt(this,jt,Ni));return}this.keyboardShortcutHandler(i)};Va=new WeakSet;Yn=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Hl.includes(a)){this.removeEventListener("keyup",Jt(this,jt,Ni));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Me(this,nt).contains(`no${a.toLowerCase()}`)||a===" "&&Me(this,nt).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",Jt(this,jt,Ni),{once:!0})};var Lc=Object.values(o),Rc=Object.values(vt),qn=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,A.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(d=>Lc.includes(d)):[]},wc=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&l.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof l.customElements.get(i.nodeName.toLowerCase()))&&l.customElements.upgrade(i),Rc.some(a=>a in i)},Gn=i=>wc(i)||!!qn(i).length,Ul=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Pl={[o.MEDIA_SUBTITLES_LIST]:yt,[o.MEDIA_SUBTITLES_SHOWING]:yt,[o.MEDIA_SEEKABLE]:Ul,[o.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Ul).join(" "),[o.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[o.MEDIA_RENDITION_LIST]:Js,[o.MEDIA_AUDIO_TRACK_LIST]:el},xc=async(i,e,t)=>{var a,r;if(i.isConnected||await ga(0),typeof t=="boolean"||t==null)return C(i,e,t);if(typeof t=="number")return O(i,e,t);if(typeof t=="string")return R(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=Pl[e])==null?void 0:a.call(Pl,t))!=null?r:t;return i.setAttribute(e,n)},Dc=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Tt=(i,e)=>{if(Dc(i))return;let t=(r,n)=>{var s,d;Gn(r)&&n(r);let{children:u=[]}=r!=null?r:{},h=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...u,...h].forEach(b=>Tt(b,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Gn(i)){l.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Bl=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=qn(a),n=e.toLowerCase();r.includes(n)&&xc(a,n,t)})},Vl=(i,e)=>{for(let t of i){if(e in t)return t[e];let a=qn(t),r=e.toLowerCase();if(a.includes(r))return t.getAttribute(r)}},Oc=(i,e,t)=>{Tt(i,e);let a=m=>{var b;let E=(b=m==null?void 0:m.composedPath()[0])!=null?b:m.target;e(E)},r=m=>{var b;let E=(b=m==null?void 0:m.composedPath()[0])!=null?b:m.target;t(E)};i.addEventListener(f.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(f.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=m=>{m.forEach(b=>{let{addedNodes:E=[],removedNodes:I=[],type:H,target:k,attributeName:$}=b;H==="childList"?(Array.prototype.forEach.call(E,Z=>Tt(Z,e)),Array.prototype.forEach.call(I,Z=>Tt(Z,t))):H==="attributes"&&$===A.MEDIA_CHROME_ATTRIBUTES&&(Gn(k)?e(k):t(k))})},s=[],d=m=>{let b=m.target;b.name!=="media"&&(s.forEach(E=>Tt(E,t)),s=[...b.assignedElements({flatten:!0})],s.forEach(E=>Tt(E,e)))};i.addEventListener("slotchange",d);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Tt(i,t),i.removeEventListener("slotchange",d),u.disconnect(),i.removeEventListener(f.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(f.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",Ha);var Qn=Ha;var io=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(io(i,e,"read from private field"),t?t.call(i):e.get(i)),se=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},It=(i,e,t,a)=>(io(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Le=(i,e,t)=>(io(i,e,"access private method"),t),Re,qa,Ya,Ga,$a,Wa,Fa,zn,Ka,Xn,Za,ao,Jn,$l,jn,Wl,eo,Fl,to,Kl,Yl=c.createElement("template");Yl.innerHTML=`
225
+ `;var fc=Object.values(o),vc="sm:384 md:576 lg:768 xl:960";function gc(i){Ac(i.target,i.contentRect.width)}function Ac(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(T.BREAKPOINTS))!=null?t:vc,r=_c(a),n=yc(r,e),s=!1;if(Object.keys(r).forEach(d=>{if(n.includes(d)){i.hasAttribute(`breakpoint${d}`)||(i.setAttribute(`breakpoint${d}`,""),s=!0);return}i.hasAttribute(`breakpoint${d}`)&&(i.removeAttribute(`breakpoint${d}`),s=!0)}),s){let d=new CustomEvent(Fe.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(d)}}function _c(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function yc(i,e){return Object.keys(i).filter(t=>e>=i[t])}var La=class extends l.HTMLElement{constructor(){super(),yt(this,Pn),yt(this,Bn),yt(this,Mi),yt(this,wa),yt(this,qt),yt(this,Ma,0),yt(this,Ke,void 0),Ec(this,"breakpointsComputed",!1),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Il.content.cloneNode(!0)));let e=s=>{let d=this.media;for(let u of s)u.type==="childList"&&(u.removedNodes.forEach(h=>{if(h.slot=="media"&&u.target==this){let m=u.previousSibling&&u.previousSibling.previousElementSibling;if(!m||!d)this.mediaUnsetCallback(h);else{let b=m.slot!=="media";for(;(m=m.previousSibling)!==null;)m.slot=="media"&&(b=!1);b&&this.mediaUnsetCallback(h)}}}),d&&u.addedNodes.forEach(h=>{h===d&&d!==Zt(this,Ke)&&this.handleMediaUpdated(d).then(m=>this.mediaSetCallback(m))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1;Ci(this,s=>{a||(setTimeout(()=>{gc(s),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(Fe.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))},0),a=!0)});let n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){Zt(this,Ke)&&this.mediaUnsetCallback(Zt(this,Ke));return}this.media&&this.media!==Zt(this,Ke)&&this.handleMediaUpdated(this.media).then(d=>this.mediaSetCallback(d))})}static get observedAttributes(){return[T.AUTOHIDE,T.GESTURES_DISABLED].concat(fc).filter(e=>![o.MEDIA_RENDITION_LIST,o.MEDIA_AUDIO_TRACK_LIST].includes(e))}attributeChangedCallback(e,t,a){e.toLowerCase()==T.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){Un(this,Ke,e);let t=a=>(Un(this,Ke,null),console.error('Media Chrome: Media element set with slot="media" does not appear to be compatible.',a),Promise.reject(a));return e?(e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),e):t(e)}connectedCallback(){var e;let a=this.getAttribute(T.AUDIO)!=null?q.AUDIO_PLAYER():q.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.media&&this.media!==Zt(this,Ke)&&this.handleMediaUpdated(this.media).then(r=>this.mediaSetCallback(r)),this.setAttribute(T.USER_INACTIVE,""),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=l.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){}handleEvent(e){switch(e.type){case"pointerdown":Un(this,Ma,e.timeStamp);break;case"pointermove":ve(this,Pn,yl).call(this,e);break;case"pointerup":ve(this,Bn,Tl).call(this,e);break;case"mouseleave":ve(this,Mi,Ra).call(this);break;case"mouseup":this.removeAttribute(T.KEYBOARD_CONTROL);break;case"keyup":ve(this,qt,Li).call(this),this.setAttribute(T.KEYBOARD_CONTROL,"");break}}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};Ma=new WeakMap;Ke=new WeakMap;Pn=new WeakSet;yl=function(i){i.pointerType!=="mouse"&&i.timeStamp-Zt(this,Ma)<250||(ve(this,wa,Hn).call(this),clearTimeout(this._inactiveTimeout),[this,this.media].includes(i.target)&&ve(this,qt,Li).call(this))};Bn=new WeakSet;Tl=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(T.USER_INACTIVE);[this,this.media].includes(i.target)&&e?ve(this,Mi,Ra).call(this):ve(this,qt,Li).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&ve(this,qt,Li).call(this)};Mi=new WeakSet;Ra=function(){if(this.autohide<0||this.hasAttribute(T.USER_INACTIVE))return;this.setAttribute(T.USER_INACTIVE,"");let i=new l.CustomEvent(Fe.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};wa=new WeakSet;Hn=function(){if(!this.hasAttribute(T.USER_INACTIVE))return;this.removeAttribute(T.USER_INACTIVE);let i=new l.CustomEvent(Fe.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};qt=new WeakSet;Li=function(){ve(this,wa,Hn).call(this),clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=setTimeout(()=>{ve(this,Mi,Ra).call(this)},this.autohide*1e3))};var kl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},K=(i,e,t)=>(kl(i,e,"read from private field"),t?t.call(i):e.get(i)),Ri=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},xa=(i,e,t,a)=>(kl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Qt,zt,Da,Tt,Ye,rt,nt=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){Ri(this,Ye),Ri(this,Qt,void 0),Ri(this,zt,void 0),Ri(this,Da,void 0),Ri(this,Tt,new Set),xa(this,Qt,e),xa(this,zt,t),xa(this,Da,new Set(a))}[Symbol.iterator](){return K(this,Ye,rt).values()}get length(){return K(this,Ye,rt).size}get value(){var e;return(e=[...K(this,Ye,rt)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(xa(this,Tt,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...K(this,Ye,rt)][e]}values(){return K(this,Ye,rt).values()}forEach(e){K(this,Ye,rt).forEach(e)}add(...e){var t,a;e.forEach(r=>K(this,Tt).add(r)),!(this.value===""&&!((t=K(this,Qt))!=null&&t.hasAttribute(`${K(this,zt)}`)))&&((a=K(this,Qt))==null||a.setAttribute(`${K(this,zt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>K(this,Tt).delete(a)),(t=K(this,Qt))==null||t.setAttribute(`${K(this,zt)}`,`${this.value}`)}contains(e){return K(this,Ye,rt).has(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};Qt=new WeakMap;zt=new WeakMap;Da=new WeakMap;Tt=new WeakMap;Ye=new WeakSet;rt=function(){return K(this,Tt).size?K(this,Tt):K(this,Da)};var Tc=(i="")=>i.split(/\s+/),Sl=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return e=e==="cc"?"captions":"subtitles",{kind:e,language:t,label:r}},wi=(i="",e={})=>Tc(i).map(t=>{let a=Sl(t);return{...e,...a}}),$n=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?Sl(e):e):typeof i=="string"?wi(i):[i],Oa=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,It=(i=[])=>Array.prototype.map.call(i,Oa).join(" "),Ic=(i,e)=>t=>t[i]===e,Cl=i=>{let e=Object.entries(i).map(([t,a])=>Ic(t,a));return t=>e.every(a=>a(t))},Xt=(i,e=[],t=[])=>{let a=$n(t).map(Cl),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},Na=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Cl(e);return Array.from(i.textTracks).filter(t)},Ml=i=>!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);var B={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};c.fullscreenElement===void 0&&(B.enter="webkitRequestFullScreen",B.exit=c.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",B.rootEvents=["webkitfullscreenchange"],B.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],B.element="webkitFullscreenElement",B.error="webkitfullscreenerror",B.enabled="webkitFullscreenEnabled");var Ua,Wn=()=>{var i,e;return Ua||(Ua=(e=(i=c)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Ua)},Ll=async(i=Wn())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await ga(0),i.volume!==e},kc=(i=Wn())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",Sc=(i=Wn())=>{let e=c[B.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Fn=Sc(),Rl=kc(),wl=!!l.WebKitPlaybackTargetAvailabilityEvent,xl=!!l.chrome;var Ba,Dl=Ll().then(i=>(Ba=i,Ba)),Cc=Object.values(fe),Pa=i=>Na(i.media,e=>[et.SUBTITLES,et.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Ol=i=>Na(i.media,e=>e.mode===At.SHOWING&&[et.SUBTITLES,et.CAPTIONS].includes(e.kind)),ie={MEDIA_PAUSED:{get:function(i){let{media:e}=i;return e?e.paused:!0},mediaEvents:["play","playing","pause","emptied"]},MEDIA_HAS_PLAYED:{get:function(i){let{media:e}=i;return e?!e.paused:!1},mediaEvents:["playing","emptied"]},MEDIA_ENDED:{get:function(i){let{media:e}=i;return e?e.ended:!1},mediaEvents:["seeked","ended","emptied"]},MEDIA_PLAYBACK_RATE:{get:function(i){let{media:e}=i;return!e||typeof e.playbackRate=="undefined"?1:e.playbackRate},mediaEvents:["ratechange","loadstart"]},MEDIA_MUTED:{get:function(i){let{media:e}=i;return!e||typeof e.muted=="undefined"?!1:e.muted},mediaEvents:["volumechange"]},MEDIA_VOLUME:{get:function(i){let{media:e}=i;return!e||typeof e.volume=="undefined"?1:Number(e.volume)},mediaEvents:["volumechange"]},MEDIA_VOLUME_LEVEL:{get:function(i){let{media:e}=i,t="high";if(!e||typeof e.volume=="undefined")return t;let{muted:a,volume:r}=e;return r===0||a?t="off":r<.5?t="low":r<.75&&(t="medium"),t},mediaEvents:["volumechange"]},MEDIA_CURRENT_TIME:{get:function(i){let{media:e}=i;return!e||typeof e.currentTime=="undefined"?0:e.currentTime},mediaEvents:["playing","pause","timeupdate","loadedmetadata"]},MEDIA_DURATION:{get:function(i){let{media:e}=i;return i.hasAttribute("defaultduration")&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?+i.getAttribute("defaultduration"):!e||!Number.isFinite(e.duration)?Number.NaN:e.duration},mediaEvents:["durationchange","loadedmetadata","emptied"]},MEDIA_SEEKABLE:{get:function(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress"]},MEDIA_LOADING:{get:function(i){var e;return((e=i.media)==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},MEDIA_BUFFERED:{get:function(i){var e,t,a;let r=(e=i.media)==null?void 0:e.buffered;return Array.from((a=(t=i.media)==null?void 0:t.buffered)!=null?a:[]).map((n,s)=>[Number(r.start(s)).toFixed(3),Number(r.end(s)).toFixed(3)])},mediaEvents:["progress","emptied"]},MEDIA_STREAM_TYPE:{get:function(i){let{media:e}=i;if(!e)return;let{streamType:t}=e;if(Cc.includes(t)){if(t===fe.UNKNOWN){let r=i.getAttribute("defaultstreamtype");return[fe.LIVE,fe.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return fe.LIVE;if(Number.isFinite(a))return fe.ON_DEMAND;{let r=i.getAttribute("defaultstreamtype");if([fe.LIVE,fe.ON_DEMAND].includes(r))return r}},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},MEDIA_TARGET_LIVE_WINDOW:{get:function(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=ie.MEDIA_STREAM_TYPE.get(i);return(t==null||Number.isNaN(t))&&a===fe.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},MEDIA_TIME_IS_LIVE:{get:function(i){let{media:e}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(ie.MEDIA_STREAM_TYPE.get(i)==="live"))return!1;let a=e.seekable;if(!a)return!0;if(!a.length)return!1;let r=i.hasAttribute("liveedgeoffset")?Number(i.getAttribute("liveedgeoffset")):10,n=a.end(a.length-1)-r;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},MEDIA_IS_FULLSCREEN:{get:function(i,e){var t,a;let r=i.media;if(r&&c[B.element]===void 0&&"webkitDisplayingFullscreen"in r)return r.webkitDisplayingFullscreen&&r.webkitPresentationMode==="fullscreen";let n;return e?n=c[B.element]?e.target:null:n=(a=(t=nl(i))==null?void 0:t.fullscreenElement)!=null?a:c[B.element],tt(i.fullscreenElement,n)},rootEvents:B.rootEvents,mediaEvents:B.mediaEvents},MEDIA_IS_PIP:{get:function(i,e){var t;let a=i.media;if(!a)return!1;if(e)return e.type=="enterpictureinpicture";{let r=(t=i.getRootNode().pictureInPictureElement)!=null?t:c.pictureInPictureElement;return tt(a,r)}},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},MEDIA_IS_AIRPLAYING:{get:function(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:t.remote.state},remoteEvents:["playing","connect","connecting","disconnect"]},MEDIA_IS_CASTING:{get:function(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:t.remote.state},remoteEvents:["connect","connecting","disconnect"]},MEDIA_AIRPLAY_UNAVAILABLE:{get:function(i,{availability:e=!1}={}){if(!wl)return oe.UNSUPPORTED;if(!(e==null||e===!0))return oe.UNAVAILABLE},mediaSetCallback(i,e){var t;(t=i.remote)==null||t.watchAvailability(a=>e({availability:a}))},mediaUnsetCallback(i){var e;(e=i.remote)==null||e.cancelWatchAvailability()}},MEDIA_CAST_UNAVAILABLE:{get:function(i,{availability:e=!1}={}){var t;let{media:a}=i;if(!xl||!((t=a==null?void 0:a.remote)!=null&&t.state))return oe.UNSUPPORTED;if(!(e==null||e===!0))return oe.UNAVAILABLE},mediaSetCallback(i,e){var t;(t=i.remote)==null||t.watchAvailability(a=>e({availability:a}))},mediaUnsetCallback(i){var e;(e=i.remote)==null||e.cancelWatchAvailability()}},MEDIA_FULLSCREEN_UNAVAILABLE:{get:function(){return Fn?void 0:oe.UNAVAILABLE}},MEDIA_PIP_UNAVAILABLE:{get:function(){return Rl?void 0:oe.UNSUPPORTED}},MEDIA_RENDITION_UNAVAILABLE:{get:function(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return oe.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_AUDIO_TRACK_UNAVAILABLE:{get:function(i){var e,t;let{media:a}=i;if(!(a!=null&&a.audioTracks))return oe.UNSUPPORTED;if(((t=(e=a.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_VOLUME_UNAVAILABLE:{get:function(i){if(Ba!==void 0&&!Ba)return oe.UNSUPPORTED;let{media:e}=i;if(e&&typeof e.volume=="undefined")return oe.UNAVAILABLE},mediaEvents:["loadstart"]},MEDIA_SUBTITLES_LIST:{get:function(i){return Pa(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},MEDIA_SUBTITLES_SHOWING:{get:function(i,e){var t;return i.hasAttribute("defaultsubtitles")&&["addtrack","removetrack"].includes(e==null?void 0:e.type)&&[et.CAPTIONS,et.SUBTITLES].includes((t=e==null?void 0:e.track)==null?void 0:t.kind)&&xi.MEDIA_TOGGLE_SUBTITLES_REQUEST(void 0,{detail:!0},i),Ol(i).map(({kind:a,label:r,language:n})=>({kind:a,label:r,language:n}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"]},MEDIA_RENDITION_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]]},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_RENDITION_SELECTED:{get:function(i){var e,t,a;let{media:r}=i;return(a=(t=r==null?void 0:r.videoRenditions)==null?void 0:t[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},MEDIA_AUDIO_TRACK_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_AUDIO_TRACK_ENABLED:{get:function(i){var e,t;let{media:a}=i;return(t=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:t.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]}},xi={MEDIA_PLAY_REQUEST:(i,e,t)=>{var a;let r=ie.MEDIA_STREAM_TYPE.get(t),n=t.getAttribute("noautoseektolive")===null;r==fe.LIVE&&n&&xi.MEDIA_SEEK_TO_LIVE_REQUEST(i),(a=i.play())==null||a.catch(()=>{})},MEDIA_PAUSE_REQUEST:i=>i.pause(),MEDIA_MUTE_REQUEST:i=>i.muted=!0,MEDIA_UNMUTE_REQUEST:i=>{i.muted=!1,i.volume===0&&(i.volume=.25)},MEDIA_VOLUME_REQUEST:(i,e,t)=>{let a=e.detail;if(i.volume=a,a>0&&i.muted&&(i.muted=!1),!t.hasAttribute("novolumepref"))try{l.localStorage.setItem("media-chrome-pref-volume",a.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:(i,e,t)=>{if(!Fn){console.warn("MediaChrome: Fullscreen support is unavailable; not entering fullscreen");return}c.pictureInPictureElement&&c.exitPictureInPicture(),t[B.enter]?t.fullscreenElement[B.enter]():i.webkitEnterFullscreen?i.webkitEnterFullscreen():i.requestFullscreen?i.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{c[B.exit]()},MEDIA_ENTER_PIP_REQUEST:i=>{if(!c.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}c[B.element]&&c[B.exit]();let e=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(t=>{if(t.code===11)if(i.readyState===0&&i.preload==="none"){let a=()=>{i.removeEventListener("loadedmetadata",r),i.preload="none"},r=()=>{i.requestPictureInPicture().catch(e),a()};i.addEventListener("loadedmetadata",r),i.preload="metadata",setTimeout(()=>{i.readyState===0&&e(),a()},1e3)}else throw t;else throw t})},MEDIA_EXIT_PIP_REQUEST:()=>{c.pictureInPictureElement&&c.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:async i=>{var e;if(((e=i.remote)==null?void 0:e.state)==="disconnected"){if(c[B.element]&&c[B.exit](),!i.remote.prompt){console.warn("MediaChrome: Casting is not supported in this environment");return}try{await i.remote.prompt()}catch{}}},MEDIA_EXIT_CAST_REQUEST:i=>{var e;((e=i.remote)==null?void 0:e.state)==="connected"&&i.remote.prompt()},MEDIA_SEEK_REQUEST:(i,e)=>{let t=e.detail;(i.readyState>0||i.readyState===void 0)&&(i.currentTime=t)},MEDIA_PLAYBACK_RATE_REQUEST:(i,e)=>{i.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:(i,e,t)=>{var a;if(!i)return;let r=e.detail;r===null&&t.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_TIME,r);let[n]=Na(i,{kind:et.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;if(r===null){t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let s=Array.prototype.find.call(n.cues,m=>m.startTime>=r);if(!s)return;let d=/'^(?:[a-z]+:)?\/\//i.test(s.text)||(a=i.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,u=new URL(s.text,d),h=new URLSearchParams(u.hash).get("#xywh");t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,u.href),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,h.split(","))},MEDIA_SHOW_SUBTITLES_REQUEST:(i,e,t)=>{var a;let r=Pa(t),{detail:n=[]}=e,s=$n(n),d=(a=s[0])==null?void 0:a.language;d&&!(t!=null&&t.hasAttribute("nosubtitleslangpref"))&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),Xt(At.SHOWING,r,s)},MEDIA_DISABLE_SUBTITLES_REQUEST:(i,e,t)=>{let a=Pa(t),{detail:r=[]}=e;Xt(At.DISABLED,a,r)},MEDIA_TOGGLE_SUBTITLES_REQUEST:(i,e,t)=>{let{detail:a}=e!=null?e:{},r=Pa(t),n=Ol(t),s=!!n.length;if(r.length){if(a===!1||s&&a!==!0)Xt(At.DISABLED,r,n);else if(a===!0||!s&&a!==!1){let d=r[0];if(!(t!=null&&t.hasAttribute("nosubtitleslangpref"))){let b=l.localStorage.getItem("media-chrome-pref-subtitles-lang"),E=b?[b,...l.navigator.languages]:l.navigator.languages,I=r.filter(H=>E.some(k=>H.language.toLowerCase().startsWith(k.split("-")[0]))).sort((H,k)=>{let $=E.findIndex(ee=>H.language.toLowerCase().startsWith(ee.split("-")[0])),Z=E.findIndex(ee=>k.language.toLowerCase().startsWith(ee.split("-")[0]));return $-Z});I[0]&&(d=I[0])}let{language:u,label:h,kind:m}=d;Xt(At.DISABLED,r,n),Xt(At.SHOWING,r,[{language:u,label:h,kind:m}])}}},MEDIA_AIRPLAY_REQUEST:async i=>{if(i!=null&&i.remote){if(!i.remote.prompt){console.warn("MediaChrome: AirPlay is not supported in this environment");return}try{await i.remote.prompt()}catch{}}},MEDIA_SEEK_TO_LIVE_REQUEST:i=>{let e=i.seekable;if(!e){console.warn("MediaChrome: Media element does not support seeking to live.");return}if(!e.length){console.warn("MediaChrome: Media is unable to seek to live.");return}i.currentTime=e.end(e.length-1)},MEDIA_RENDITION_REQUEST:(i,e)=>{if(!(i!=null&&i.videoRenditions)){console.warn("MediaChrome: Rendition selection not supported by this media.");return}let t=e.detail,a=[...i.videoRenditions].findIndex(r=>r.id==t);i.videoRenditions.selectedIndex!=a&&(i.videoRenditions.selectedIndex=a)},MEDIA_AUDIO_TRACK_REQUEST:(i,e)=>{if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let t=e.detail;for(let a of i.audioTracks)a.enabled=t==a.id}};var Zn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Me=(i,e,t)=>(Zn(i,e,"read from private field"),t?t.call(i):e.get(i)),Di=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Kn=(i,e,t,a)=>(Zn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),jt=(i,e,t)=>(Zn(i,e,"access private method"),t),ot,Oi,Jt,ei,Ni,Va,Yn,Hl=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],Mc=10,Nl=0,X={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys"},Ha=class extends La{constructor(){super(),Di(this,ei),Di(this,Va),Di(this,ot,new nt(this,X.HOTKEYS)),Di(this,Oi,void 0),Di(this,Jt,void 0),ie.MEDIA_VOLUME_UNAVAILABLE.get(this)===void 0&&Dl.then(()=>{this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,ie.MEDIA_VOLUME_UNAVAILABLE.get(this))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this),Object.keys(xi).forEach(e=>{let t=`_handle${fa(e,!0)}`;this[t]=a=>{if(a.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}xi[e](this.media,a,this)},this.addEventListener(f[e],this[t])}),this._mediaStatePropagators={},Object.keys(ie).forEach(e=>{this._mediaStatePropagators[e]=t=>{this.propagateMediaState(gt[e],ie[e].get(this,t))}})}static get observedAttributes(){return super.observedAttributes.concat(X.NO_HOTKEYS,X.HOTKEYS,X.DEFAULT_STREAM_TYPE,X.DEFAULT_SUBTITLES,X.DEFAULT_DURATION)}get fullscreenElement(){var e;return(e=Me(this,Oi))!=null?e:this}set fullscreenElement(e){this.hasAttribute(X.FULLSCREEN_ELEMENT)&&this.removeAttribute(X.FULLSCREEN_ELEMENT),Kn(this,Oi,e)}attributeChangedCallback(e,t,a){var r;if(super.attributeChangedCallback(e,t,a),e===X.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(X.HOTKEYS)&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e===X.HOTKEYS)Me(this,ot).value=a;else if(e===X.DEFAULT_SUBTITLES&&a!==t&&a==="")this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:!0}));else if(e===X.DEFAULT_STREAM_TYPE)this.propagateMediaState(gt.MEDIA_STREAM_TYPE);else if(e===X.FULLSCREEN_ELEMENT){let n=a?(r=Me(this,Jt))==null?void 0:r.getElementById(a):void 0;Kn(this,Oi,n)}}connectedCallback(){super.connectedCallback(),Kn(this,Jt,this.getRootNode()),this.enableHotkeys()}disconnectedCallback(){super.disconnectedCallback(),this.disableHotkeys(),this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:!1}))}mediaSetCallback(e){if(super.mediaSetCallback(e),e.hasAttribute("tabindex")||(e.tabIndex=-1),Object.keys(ie).forEach(t=>{let{mediaSetCallback:a,mediaEvents:r,rootEvents:n,textTracksEvents:s,videoRenditionsEvents:d,audioTracksEvents:u,remoteEvents:h}=ie[t],m=this._mediaStatePropagators[t];a&&(a(e,m),m()),r==null||r.forEach(b=>{e.addEventListener(b,m),m()}),n==null||n.forEach(b=>{var E;(E=Me(this,Jt))==null||E.addEventListener(b,m),m()}),s==null||s.forEach(b=>{var E;(E=e.textTracks)==null||E.addEventListener(b,m),m()}),d==null||d.forEach(b=>{var E;(E=e.videoRenditions)==null||E.addEventListener(b,m),m()}),u==null||u.forEach(b=>{var E;(E=e.audioTracks)==null||E.addEventListener(b,m),m()}),h==null||h.forEach(b=>{var E;(E=e.remote)==null||E.addEventListener(b,m),m()})}),!this.hasAttribute("novolumepref"))try{let t=l.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(ie).forEach(t=>{let{mediaUnsetCallback:a,mediaEvents:r,rootEvents:n,textTracksEvents:s,videoRenditionsEvents:d,audioTracksEvents:u,remoteEvents:h}=ie[t],m=this._mediaStatePropagators[t];r==null||r.forEach(b=>{e.removeEventListener(b,m)}),n==null||n.forEach(b=>{var E;(E=Me(this,Jt))==null||E.removeEventListener(b,m)}),s==null||s.forEach(b=>{var E;(E=e.textTracks)==null||E.removeEventListener(b,m)}),d==null||d.forEach(b=>{var E;(E=e.videoRenditions)==null||E.removeEventListener(b,m),m()}),u==null||u.forEach(b=>{var E;(E=e.audioTracks)==null||E.removeEventListener(b,m),m()}),h==null||h.forEach(b=>{var E;(E=e.remote)==null||E.removeEventListener(b,m),m()}),a&&(a(e,m),m())}),this.propagateMediaState(gt.MEDIA_PAUSED,!0)}propagateMediaState(e,t){let a=Vl(this.mediaStateReceivers,e);if(Bl(this.mediaStateReceivers,e,t),a===Vl(this.mediaStateReceivers,e))return;let r=e.toLowerCase(),n=new l.CustomEvent(Xs[r],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(n)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=Oc(e,a,r);Object.keys(f).forEach(s=>{e.addEventListener(f[s],this[`_handle${fa(s,!0)}`])}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(f).forEach(r=>{e.removeEventListener(f[r],this[`_handle${fa(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Object.keys(ie).forEach(r=>{let n=ie[r];Bl([e],gt[r],n.get(this))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",jt(this,Va,Yn))}disableHotkeys(){this.removeEventListener("keydown",jt(this,Va,Yn)),this.removeEventListener("keyup",jt(this,ei,Ni))}get hotkeys(){return Me(this,ot)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute(X.KEYS_USED))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(I=>I==="Space"?" ":I).filter(Boolean).includes(e.key))return;let d,u,h,m,b,E=Mc;if(!Me(this,ot).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&Me(this,ot).contains("nospace")))switch(e.key){case" ":case"k":d=this.getAttribute(o.MEDIA_PAUSED)!=null?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"m":d=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?f.MEDIA_UNMUTE_REQUEST:f.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"f":d=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?f.MEDIA_EXIT_FULLSCREEN_REQUEST:f.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":u=this.getAttribute(o.MEDIA_CURRENT_TIME),h=u&&!Number.isNaN(+u)?+u:Nl,m=Math.max(h-E,0),b=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(b);break;case"ArrowRight":u=this.getAttribute(o.MEDIA_CURRENT_TIME),h=u&&!Number.isNaN(+u)?+u:Nl,m=Math.max(h+E,0),b=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(b);break;default:break}}};ot=new WeakMap;Oi=new WeakMap;Jt=new WeakMap;ei=new WeakSet;Ni=function(i){let{key:e}=i;if(!Hl.includes(e)){this.removeEventListener("keyup",jt(this,ei,Ni));return}this.keyboardShortcutHandler(i)};Va=new WeakSet;Yn=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Hl.includes(a)){this.removeEventListener("keyup",jt(this,ei,Ni));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Me(this,ot).contains(`no${a.toLowerCase()}`)||a===" "&&Me(this,ot).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",jt(this,ei,Ni),{once:!0})};var Lc=Object.values(o),Rc=Object.values(gt),qn=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,A.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(d=>Lc.includes(d)):[]},wc=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&l.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof l.customElements.get(i.nodeName.toLowerCase()))&&l.customElements.upgrade(i),Rc.some(a=>a in i)},Gn=i=>wc(i)||!!qn(i).length,Ul=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Pl={[o.MEDIA_SUBTITLES_LIST]:It,[o.MEDIA_SUBTITLES_SHOWING]:It,[o.MEDIA_SEEKABLE]:Ul,[o.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Ul).join(" "),[o.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[o.MEDIA_RENDITION_LIST]:Js,[o.MEDIA_AUDIO_TRACK_LIST]:el},xc=async(i,e,t)=>{var a,r;if(i.isConnected||await ga(0),typeof t=="boolean"||t==null)return C(i,e,t);if(typeof t=="number")return O(i,e,t);if(typeof t=="string")return R(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=Pl[e])==null?void 0:a.call(Pl,t))!=null?r:t;return i.setAttribute(e,n)},Dc=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},kt=(i,e)=>{if(Dc(i))return;let t=(r,n)=>{var s,d;Gn(r)&&n(r);let{children:u=[]}=r!=null?r:{},h=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...u,...h].forEach(b=>kt(b,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Gn(i)){l.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Bl=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=qn(a),n=e.toLowerCase();r.includes(n)&&xc(a,n,t)})},Vl=(i,e)=>{for(let t of i){if(e in t)return t[e];let a=qn(t),r=e.toLowerCase();if(a.includes(r))return t.getAttribute(r)}},Oc=(i,e,t)=>{kt(i,e);let a=m=>{var b;let E=(b=m==null?void 0:m.composedPath()[0])!=null?b:m.target;e(E)},r=m=>{var b;let E=(b=m==null?void 0:m.composedPath()[0])!=null?b:m.target;t(E)};i.addEventListener(f.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(f.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=m=>{m.forEach(b=>{let{addedNodes:E=[],removedNodes:I=[],type:H,target:k,attributeName:$}=b;H==="childList"?(Array.prototype.forEach.call(E,Z=>kt(Z,e)),Array.prototype.forEach.call(I,Z=>kt(Z,t))):H==="attributes"&&$===A.MEDIA_CHROME_ATTRIBUTES&&(Gn(k)?e(k):t(k))})},s=[],d=m=>{let b=m.target;b.name!=="media"&&(s.forEach(E=>kt(E,t)),s=[...b.assignedElements({flatten:!0})],s.forEach(E=>kt(E,e)))};i.addEventListener("slotchange",d);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{kt(i,t),i.removeEventListener("slotchange",d),u.disconnect(),i.removeEventListener(f.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(f.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",Ha);var Qn=Ha;var io=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(io(i,e,"read from private field"),t?t.call(i):e.get(i)),se=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},St=(i,e,t,a)=>(io(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Le=(i,e,t)=>(io(i,e,"access private method"),t),Re,qa,Ya,Ga,$a,Wa,Fa,zn,Ka,Xn,Za,ao,Jn,$l,jn,Wl,eo,Fl,to,Kl,Yl=c.createElement("template");Yl.innerHTML=`
222
226
  <style>
223
227
  :host {
224
228
  --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
@@ -421,7 +425,7 @@
421
425
  <input id="range" type="range" min="0" max="1" step="any" value="0">
422
426
  </div>
423
427
  <div id="rightgap"></div>
424
- `;var kt=class extends l.HTMLElement{constructor(){super(),se(this,Fa),se(this,Ka),se(this,Za),se(this,Jn),se(this,jn),se(this,eo),se(this,to),se(this,Re,void 0),se(this,qa,void 0),se(this,Ya,void 0),se(this,Ga,void 0),se(this,$a,()=>{if(this.range.matches(":focus-visible")){let{style:t}=N(this.shadowRoot,":host");t.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),se(this,Wa,()=>{let{style:t}=N(this.shadowRoot,":host");t.removeProperty("--_focus-visible-box-shadow")}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Yl.content.cloneNode(!0)));let{style:e}=N(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.container=this.shadowRoot.querySelector("#container"),It(this,Ya,this.shadowRoot.querySelector("#startpoint")),It(this,Ga,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range")}static get observedAttributes(){return["disabled","aria-disabled",A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=ge(this,Re))==null?void 0:r.unassociateElement)==null||n.call(r,this),It(this,Re,null)),a&&this.isConnected&&(It(this,Re,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=ge(this,Re))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?(this.range.removeAttribute(e),Le(this,Fa,zn).call(this)):(this.range.setAttribute(e,a),Le(this,Ka,Xn).call(this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(It(this,Re,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ge(this,Re))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",ge(this,$a)),this.shadowRoot.addEventListener("focusout",ge(this,Wa)),Le(this,Fa,zn).call(this)}disconnectedCallback(){var e,t;Le(this,Ka,Xn).call(this),(t=(e=ge(this,Re))==null?void 0:e.unassociateElement)==null||t.call(e,this),It(this,Re,null),this.shadowRoot.removeEventListener("focusin",ge(this,$a)),this.shadowRoot.removeEventListener("focusout",ge(this,Wa))}updatePointerBar(e){let t=this.range.getBoundingClientRect(),a=(e.clientX-t.left)/t.width;a=Math.max(0,Math.min(1,a))*100;let{style:r}=N(this.shadowRoot,"#pointer");r.setProperty("width",`${a}%`)}updateBar(){let e=this.range.valueAsNumber*100,t=N(this.shadowRoot,"#progress"),a=N(this.shadowRoot,"#thumb");t.style.setProperty("width",`${e}%`),a.style.setProperty("left",`${e}%`)}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"input":this.updateBar();break;case"pointerenter":Le(this,Jn,$l).call(this,e);break;case"pointerdown":Le(this,Za,ao).call(this,e);break;case"pointermove":Le(this,to,Kl).call(this,e);break;case"pointerup":Le(this,jn,Wl).call(this);break;case"pointerleave":Le(this,eo,Fl).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};Re=new WeakMap;qa=new WeakMap;Ya=new WeakMap;Ga=new WeakMap;$a=new WeakMap;Wa=new WeakMap;Fa=new WeakSet;zn=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Ka=new WeakSet;Xn=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=l.window)==null||i.removeEventListener("pointerup",this),(e=l.window)==null||e.removeEventListener("pointermove",this)};Za=new WeakSet;ao=function(i){var e;It(this,qa,i.composedPath().includes(this.range)),(e=l.window)==null||e.addEventListener("pointerup",this)};Jn=new WeakSet;$l=function(i){var e;i.pointerType!=="mouse"&&Le(this,Za,ao).call(this,i),this.addEventListener("pointerleave",this),(e=l.window)==null||e.addEventListener("pointermove",this)};jn=new WeakSet;Wl=function(){var i;(i=l.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};eo=new WeakSet;Fl=function(){var i;this.removeEventListener("pointerleave",this),(i=l.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};to=new WeakSet;Kl=function(i){if(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),this.dragging&&(i.pointerType!=="mouse"||!ge(this,qa))){this.range.disabled=!0;let e=sl(i.clientX,i.clientY,ge(this,Ya).getBoundingClientRect(),ge(this,Ga).getBoundingClientRect());e=Math.max(0,Math.min(1,e)),this.range.valueAsNumber=e,this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}};l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",kt);var Gl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qa=(i,e,t)=>(Gl(i,e,"read from private field"),t?t.call(i):e.get(i)),Nc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},za=(i,e,t,a)=>(Gl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),we,Zl=c.createElement("template");Zl.innerHTML=`
428
+ `;var Ct=class extends l.HTMLElement{constructor(){super(),se(this,Fa),se(this,Ka),se(this,Za),se(this,Jn),se(this,jn),se(this,eo),se(this,to),se(this,Re,void 0),se(this,qa,void 0),se(this,Ya,void 0),se(this,Ga,void 0),se(this,$a,()=>{if(this.range.matches(":focus-visible")){let{style:t}=N(this.shadowRoot,":host");t.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),se(this,Wa,()=>{let{style:t}=N(this.shadowRoot,":host");t.removeProperty("--_focus-visible-box-shadow")}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Yl.content.cloneNode(!0)));let{style:e}=N(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.container=this.shadowRoot.querySelector("#container"),St(this,Ya,this.shadowRoot.querySelector("#startpoint")),St(this,Ga,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range")}static get observedAttributes(){return["disabled","aria-disabled",A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=ge(this,Re))==null?void 0:r.unassociateElement)==null||n.call(r,this),St(this,Re,null)),a&&this.isConnected&&(St(this,Re,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=ge(this,Re))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?(this.range.removeAttribute(e),Le(this,Fa,zn).call(this)):(this.range.setAttribute(e,a),Le(this,Ka,Xn).call(this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(St(this,Re,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ge(this,Re))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",ge(this,$a)),this.shadowRoot.addEventListener("focusout",ge(this,Wa)),Le(this,Fa,zn).call(this)}disconnectedCallback(){var e,t;Le(this,Ka,Xn).call(this),(t=(e=ge(this,Re))==null?void 0:e.unassociateElement)==null||t.call(e,this),St(this,Re,null),this.shadowRoot.removeEventListener("focusin",ge(this,$a)),this.shadowRoot.removeEventListener("focusout",ge(this,Wa))}updatePointerBar(e){let t=this.range.getBoundingClientRect(),a=(e.clientX-t.left)/t.width;a=Math.max(0,Math.min(1,a))*100;let{style:r}=N(this.shadowRoot,"#pointer");r.setProperty("width",`${a}%`)}updateBar(){let e=this.range.valueAsNumber*100,t=N(this.shadowRoot,"#progress"),a=N(this.shadowRoot,"#thumb");t.style.setProperty("width",`${e}%`),a.style.setProperty("left",`${e}%`)}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"input":this.updateBar();break;case"pointerenter":Le(this,Jn,$l).call(this,e);break;case"pointerdown":Le(this,Za,ao).call(this,e);break;case"pointermove":Le(this,to,Kl).call(this,e);break;case"pointerup":Le(this,jn,Wl).call(this);break;case"pointerleave":Le(this,eo,Fl).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};Re=new WeakMap;qa=new WeakMap;Ya=new WeakMap;Ga=new WeakMap;$a=new WeakMap;Wa=new WeakMap;Fa=new WeakSet;zn=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Ka=new WeakSet;Xn=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=l.window)==null||i.removeEventListener("pointerup",this),(e=l.window)==null||e.removeEventListener("pointermove",this)};Za=new WeakSet;ao=function(i){var e;St(this,qa,i.composedPath().includes(this.range)),(e=l.window)==null||e.addEventListener("pointerup",this)};Jn=new WeakSet;$l=function(i){var e;i.pointerType!=="mouse"&&Le(this,Za,ao).call(this,i),this.addEventListener("pointerleave",this),(e=l.window)==null||e.addEventListener("pointermove",this)};jn=new WeakSet;Wl=function(){var i;(i=l.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};eo=new WeakSet;Fl=function(){var i;this.removeEventListener("pointerleave",this),(i=l.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};to=new WeakSet;Kl=function(i){if(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),this.dragging&&(i.pointerType!=="mouse"||!ge(this,qa))){this.range.disabled=!0;let e=sl(i.clientX,i.clientY,ge(this,Ya).getBoundingClientRect(),ge(this,Ga).getBoundingClientRect());e=Math.max(0,Math.min(1,e)),this.range.valueAsNumber=e,this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}};l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",Ct);var Gl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qa=(i,e,t)=>(Gl(i,e,"read from private field"),t?t.call(i):e.get(i)),Nc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},za=(i,e,t,a)=>(Gl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),we,Zl=c.createElement("template");Zl.innerHTML=`
425
429
  <style>
426
430
  :host {
427
431
 
@@ -476,7 +480,7 @@
476
480
  }
477
481
  </style>
478
482
  <slot></slot>
479
- `;var Ge=class extends l.HTMLElement{constructor(){super(),Uc(this,xe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ql.content.cloneNode(!0)));let{style:e}=N(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return[A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Xa(this,xe))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ja(this,xe,null)),a&&this.isConnected&&(Ja(this,xe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=Xa(this,xe))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ja(this,xe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Xa(this,xe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Xa(this,xe))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ja(this,xe,null)}};xe=new WeakMap;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",Ge);var Xl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},zl=(i,e,t)=>(Xl(i,e,"read from private field"),t?t.call(i):e.get(i)),Pc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Bc=(i,e,t,a)=>(Xl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ui,no=class extends Ge{constructor(){super(),Pc(this,Ui,void 0),Bc(this,Ui,this.shadowRoot.querySelector("slot")),zl(this,Ui).textContent=Se(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&(zl(this,Ui).textContent=Se(a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}};Ui=new WeakMap;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",no);var td=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oo=(i,e,t)=>(td(i,e,"read from private field"),t?t.call(i):e.get(i)),Vc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Hc=(i,e,t,a)=>(td(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ei,Ae={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Jl=[...Object.values(Ae),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],jl=["Enter"," "],$c="&nbsp;/&nbsp;",ed=(i,{timesSep:e=$c}={})=>{var t,a,r,n;let s=i.hasAttribute(Ae.REMAINING),d=i.hasAttribute(Ae.SHOW_DURATION),u=(t=i.mediaCurrentTime)!=null?t:0,[,h]=(a=i.mediaSeekable)!=null?a:[],m=(n=(r=i.mediaDuration)!=null?r:h)!=null?n:0,b=s?Se(0-(m-u)):Se(u);return d?`${b}${e}${Se(m)}`:b},Wc="video not loaded, unknown time.",Fc=i=>{var e;let t=i.mediaCurrentTime,[,a]=(e=i.mediaSeekable)!=null?e:[],r=i.mediaDuration||a;if(t==null||r==null){i.setAttribute("aria-valuetext",Wc);return}let n=i.hasAttribute(Ae.REMAINING),s=i.hasAttribute(Ae.SHOW_DURATION),d=n?gt(0-(r-t)):gt(t);if(!s){i.setAttribute("aria-valuetext",d);return}let u=gt(r),h=`${d} of ${u}`;i.setAttribute("aria-valuetext",h)},so=class extends Ge{constructor(){super(),Vc(this,ei,void 0),Hc(this,ei,this.shadowRoot.querySelector("slot")),oo(this,ei).innerHTML=`${ed(this)}`;let{style:e}=N(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","pointer"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))")}static get observedAttributes(){return[...super.observedAttributes,...Jl,"disabled"]}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",q.PLAYBACK_TIME());let e=t=>{let{key:a}=t;if(!jl.includes(a)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!jl.includes(n)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),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,t,a){Jl.includes(e)?this.update():e==="disabled"&&a!==t&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return L(this,Ae.REMAINING)}set remaining(e){C(this,Ae.REMAINING,e)}get showDuration(){return L(this,Ae.SHOW_DURATION)}set showDuration(e){C(this,Ae.SHOW_DURATION,e)}get noToggle(){return L(this,Ae.NO_TOGGLE)}set noToggle(e){C(this,Ae.NO_TOGGLE,e)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}update(){let e=ed(this);Fc(this),e!==oo(this,ei).innerHTML&&(oo(this,ei).innerHTML=e)}};ei=new WeakMap;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",so);var Kc=`<svg aria-hidden="true" viewBox="0 0 26 24">
483
+ `;var Ge=class extends l.HTMLElement{constructor(){super(),Uc(this,xe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ql.content.cloneNode(!0)));let{style:e}=N(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return[A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Xa(this,xe))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ja(this,xe,null)),a&&this.isConnected&&(Ja(this,xe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=Xa(this,xe))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ja(this,xe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Xa(this,xe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Xa(this,xe))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ja(this,xe,null)}};xe=new WeakMap;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",Ge);var Xl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},zl=(i,e,t)=>(Xl(i,e,"read from private field"),t?t.call(i):e.get(i)),Pc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Bc=(i,e,t,a)=>(Xl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ui,no=class extends Ge{constructor(){super(),Pc(this,Ui,void 0),Bc(this,Ui,this.shadowRoot.querySelector("slot")),zl(this,Ui).textContent=Se(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&(zl(this,Ui).textContent=Se(a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}};Ui=new WeakMap;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",no);var td=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oo=(i,e,t)=>(td(i,e,"read from private field"),t?t.call(i):e.get(i)),Vc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Hc=(i,e,t,a)=>(td(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ti,Ae={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Jl=[...Object.values(Ae),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],jl=["Enter"," "],$c="&nbsp;/&nbsp;",ed=(i,{timesSep:e=$c}={})=>{var t,a,r,n;let s=i.hasAttribute(Ae.REMAINING),d=i.hasAttribute(Ae.SHOW_DURATION),u=(t=i.mediaCurrentTime)!=null?t:0,[,h]=(a=i.mediaSeekable)!=null?a:[],m=(n=(r=i.mediaDuration)!=null?r:h)!=null?n:0,b=s?Se(0-(m-u)):Se(u);return d?`${b}${e}${Se(m)}`:b},Wc="video not loaded, unknown time.",Fc=i=>{var e;let t=i.mediaCurrentTime,[,a]=(e=i.mediaSeekable)!=null?e:[],r=i.mediaDuration||a;if(t==null||r==null){i.setAttribute("aria-valuetext",Wc);return}let n=i.hasAttribute(Ae.REMAINING),s=i.hasAttribute(Ae.SHOW_DURATION),d=n?_t(0-(r-t)):_t(t);if(!s){i.setAttribute("aria-valuetext",d);return}let u=_t(r),h=`${d} of ${u}`;i.setAttribute("aria-valuetext",h)},so=class extends Ge{constructor(){super(),Vc(this,ti,void 0),Hc(this,ti,this.shadowRoot.querySelector("slot")),oo(this,ti).innerHTML=`${ed(this)}`;let{style:e}=N(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","pointer"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))")}static get observedAttributes(){return[...super.observedAttributes,...Jl,"disabled"]}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",q.PLAYBACK_TIME());let e=t=>{let{key:a}=t;if(!jl.includes(a)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!jl.includes(n)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),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,t,a){Jl.includes(e)?this.update():e==="disabled"&&a!==t&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return L(this,Ae.REMAINING)}set remaining(e){C(this,Ae.REMAINING,e)}get showDuration(){return L(this,Ae.SHOW_DURATION)}set showDuration(e){C(this,Ae.SHOW_DURATION,e)}get noToggle(){return L(this,Ae.NO_TOGGLE)}set noToggle(e){C(this,Ae.NO_TOGGLE,e)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}update(){let e=ed(this);Fc(this),e!==oo(this,ti).innerHTML&&(oo(this,ti).innerHTML=e)}};ti=new WeakMap;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",so);var Kc=`<svg aria-hidden="true" viewBox="0 0 26 24">
480
484
  <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"/>
481
485
  </svg>`,Yc=`<svg aria-hidden="true" viewBox="0 0 26 24">
482
486
  <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"/>
@@ -496,9 +500,9 @@
496
500
  <slot name="on">${Kc}</slot>
497
501
  <slot name="off">${Yc}</slot>
498
502
  </slot>
499
- `;var id=i=>{i.setAttribute("aria-checked",Ml(i))},lo=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:nd,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",q.CLOSED_CAPTIONS()),id(this)}attributeChangedCallback(e,t,a){e===o.MEDIA_SUBTITLES_SHOWING&&id(this),super.attributeChangedCallback(e,t,a)}get mediaSubtitlesList(){return ad(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){rd(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return ad(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){rd(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},ad=(i,e)=>{let t=i.getAttribute(e);return t?Ri(t):[]},rd=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=yt(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",lo);var ti={SEEK_OFFSET:"seekoffset"},ja=30,Gc=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${ja}</text><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"/></svg>`,od=c.createElement("template");od.innerHTML=`
503
+ `;var id=i=>{i.setAttribute("aria-checked",Ml(i))},lo=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:nd,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",q.CLOSED_CAPTIONS()),id(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_SHOWING&&id(this)}get mediaSubtitlesList(){return ad(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){rd(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return ad(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){rd(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},ad=(i,e)=>{let t=i.getAttribute(e);return t?wi(t):[]},rd=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=It(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",lo);var ii={SEEK_OFFSET:"seekoffset"},ja=30,Gc=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${ja}</text><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"/></svg>`,od=c.createElement("template");od.innerHTML=`
500
504
  <slot name="icon">${Gc}</slot>
501
- `;var Zc=0,uo=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,ti.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:od,...e})}connectedCallback(){this.seekOffset=M(this,ti.SEEK_OFFSET,ja),super.connectedCallback()}attributeChangedCallback(e,t,a){e===ti.SEEK_OFFSET&&(this.seekOffset=M(this,ti.SEEK_OFFSET,ja)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return M(this,ti.SEEK_OFFSET,ja)}set seekOffset(e){O(this,ti.SEEK_OFFSET,e),this.setAttribute("aria-label",D.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),Aa(_a(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,Zc)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",uo);var qc=`<svg aria-hidden="true" viewBox="0 0 26 24">
505
+ `;var Zc=0,uo=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,ii.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:od,...e})}connectedCallback(){this.seekOffset=M(this,ii.SEEK_OFFSET,ja),super.connectedCallback()}attributeChangedCallback(e,t,a){e===ii.SEEK_OFFSET&&(this.seekOffset=M(this,ii.SEEK_OFFSET,ja)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return M(this,ii.SEEK_OFFSET,ja)}set seekOffset(e){O(this,ii.SEEK_OFFSET,e),this.setAttribute("aria-label",D.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),Aa(_a(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,Zc)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",uo);var qc=`<svg aria-hidden="true" viewBox="0 0 26 24">
502
506
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
503
507
  </svg>`,Qc=`<svg aria-hidden="true" viewBox="0 0 26 24">
504
508
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
@@ -614,15 +618,15 @@
614
618
  <slot name="play">${tm}</slot>
615
619
  <slot name="pause">${im}</slot>
616
620
  </slot>
617
- `;var fd=i=>{let e=i.mediaPaused?D.PLAY():D.PAUSE();i.setAttribute("aria-label",e)},bo=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:vd,...e})}connectedCallback(){fd(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&fd(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-play-button")||l.customElements.define("media-play-button",bo);var am=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tr=(i,e,t)=>(am(i,e,"read from private field"),t?t.call(i):e.get(i)),rm=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ii,Eo={RATES:"rates"},vo=[1,1.2,1.5,1.7,2],ai=1,gd=c.createElement("template");gd.innerHTML=`
621
+ `;var fd=i=>{let e=i.mediaPaused?D.PLAY():D.PAUSE();i.setAttribute("aria-label",e)},bo=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:vd,...e})}connectedCallback(){fd(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&fd(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-play-button")||l.customElements.define("media-play-button",bo);var am=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tr=(i,e,t)=>(am(i,e,"read from private field"),t?t.call(i):e.get(i)),rm=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ai,Eo={RATES:"rates"},vo=[1,1.2,1.5,1.7,2],ri=1,gd=c.createElement("template");gd.innerHTML=`
618
622
  <style>
619
623
  :host {
620
624
  min-width: 5ch;
621
- padding: var(--media-control-padding, 10px 5px);
625
+ padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
622
626
  }
623
627
  </style>
624
- <span id="container"></span>
625
- `;var fo=class extends w{constructor(e={}){super({slotTemplate:gd,...e}),rm(this,ii,new rt(this,Eo.RATES,{defaultValue:vo})),this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${ai}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Eo.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===Eo.RATES&&(tr(this,ii).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?ai:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",q.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return tr(this,ii)}set rates(e){e?Array.isArray(e)&&(tr(this,ii).value=e.join(" ")):tr(this,ii).value=""}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,ai)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),s=>+s).sort((s,d)=>s-d),r=(t=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:ai,n=new l.CustomEvent(f.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};ii=new WeakMap;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",fo);var De={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},Ad=c.createElement("template");Ad.innerHTML=`
628
+ <slot name="icon"></slot>
629
+ `;var fo=class extends w{constructor(e={}){super({slotTemplate:gd,...e}),rm(this,ai,new nt(this,Eo.RATES,{defaultValue:vo})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${ri}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Eo.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===Eo.RATES&&(tr(this,ai).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?ri:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",q.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return tr(this,ai)}set rates(e){e?Array.isArray(e)&&(tr(this,ai).value=e.join(" ")):tr(this,ai).value=""}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,ri)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),s=>+s).sort((s,d)=>s-d),r=(t=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:ri,n=new l.CustomEvent(f.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};ai=new WeakMap;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",fo);var De={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},Ad=c.createElement("template");Ad.innerHTML=`
626
630
  <style>
627
631
  :host {
628
632
  pointer-events: none;
@@ -644,9 +648,9 @@
644
648
  </style>
645
649
 
646
650
  <img part="poster img" aria-hidden="true" id="image"/>
647
- `;var nm=i=>{i.style.removeProperty("background-image")},om=(i,e)=>{i.style["background-image"]=`url('${e}')`},go=class extends l.HTMLElement{static get observedAttributes(){return[De.PLACEHOLDER_SRC,De.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ad.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===De.SRC&&(a==null?this.image.removeAttribute(De.SRC):this.image.setAttribute(De.SRC,a)),e===De.PLACEHOLDER_SRC&&(a==null?nm(this.image):om(this.image,a))}get placeholderSrc(){return x(this,De.PLACEHOLDER_SRC)}set placeholderSrc(e){R(this,De.SRC,e)}get src(){return x(this,De.SRC)}set src(e){R(this,De.SRC,e)}};l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",go);var ri={SEEK_OFFSET:"seekoffset"},ir=30,sm=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${ir}</text><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"/></svg>`,_d=c.createElement("template");_d.innerHTML=`
651
+ `;var nm=i=>{i.style.removeProperty("background-image")},om=(i,e)=>{i.style["background-image"]=`url('${e}')`},go=class extends l.HTMLElement{static get observedAttributes(){return[De.PLACEHOLDER_SRC,De.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ad.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===De.SRC&&(a==null?this.image.removeAttribute(De.SRC):this.image.setAttribute(De.SRC,a)),e===De.PLACEHOLDER_SRC&&(a==null?nm(this.image):om(this.image,a))}get placeholderSrc(){return x(this,De.PLACEHOLDER_SRC)}set placeholderSrc(e){R(this,De.SRC,e)}get src(){return x(this,De.SRC)}set src(e){R(this,De.SRC,e)}};l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",go);var ni={SEEK_OFFSET:"seekoffset"},ir=30,sm=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${ir}</text><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"/></svg>`,_d=c.createElement("template");_d.innerHTML=`
648
652
  <slot name="icon">${sm}</slot>
649
- `;var lm=0,Ao=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,ri.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:_d,...e})}connectedCallback(){this.seekOffset=M(this,ri.SEEK_OFFSET,ir),super.connectedCallback()}attributeChangedCallback(e,t,a){e===ri.SEEK_OFFSET&&(this.seekOffset=M(this,ri.SEEK_OFFSET,ir)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return M(this,ri.SEEK_OFFSET,ir)}set seekOffset(e){O(this,ri.SEEK_OFFSET,e),this.setAttribute("aria-label",D.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),Aa(_a(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,lm)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",Ao);var Td=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},yd=(i,e,t)=>(Td(i,e,"read from private field"),t?t.call(i):e.get(i)),dm=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},um=(i,e,t,a)=>(Td(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Vi,_o=class extends Ge{constructor(){super(),dm(this,Vi,void 0),um(this,Vi,this.shadowRoot.querySelector("slot")),yd(this,Vi).textContent=Se(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_PREVIEW_TIME&&a!=null&&(yd(this,Vi).textContent=Se(a)),super.attributeChangedCallback(e,t,a)}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}};Vi=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",_o);var Id=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ar=(i,e,t)=>(Id(i,e,"read from private field"),t?t.call(i):e.get(i)),cm=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},rr=(i,e,t,a)=>(Id(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Oe,kd=c.createElement("template");kd.innerHTML=`
653
+ `;var lm=0,Ao=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,ni.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:_d,...e})}connectedCallback(){this.seekOffset=M(this,ni.SEEK_OFFSET,ir),super.connectedCallback()}attributeChangedCallback(e,t,a){e===ni.SEEK_OFFSET&&(this.seekOffset=M(this,ni.SEEK_OFFSET,ir)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return M(this,ni.SEEK_OFFSET,ir)}set seekOffset(e){O(this,ni.SEEK_OFFSET,e),this.setAttribute("aria-label",D.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),Aa(_a(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,lm)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",Ao);var Td=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},yd=(i,e,t)=>(Td(i,e,"read from private field"),t?t.call(i):e.get(i)),dm=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},um=(i,e,t,a)=>(Td(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Vi,_o=class extends Ge{constructor(){super(),dm(this,Vi,void 0),um(this,Vi,this.shadowRoot.querySelector("slot")),yd(this,Vi).textContent=Se(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_PREVIEW_TIME&&a!=null&&(yd(this,Vi).textContent=Se(a)),super.attributeChangedCallback(e,t,a)}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}};Vi=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",_o);var Id=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ar=(i,e,t)=>(Id(i,e,"read from private field"),t?t.call(i):e.get(i)),cm=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},rr=(i,e,t,a)=>(Id(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Oe,kd=c.createElement("template");kd.innerHTML=`
650
654
  <style>
651
655
  :host {
652
656
  box-sizing: border-box;
@@ -660,7 +664,7 @@
660
664
  }
661
665
  </style>
662
666
  <img crossorigin loading="eager" decoding="async">
663
- `;var yo=class extends l.HTMLElement{constructor(){super(),cm(this,Oe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(kd.content.cloneNode(!0)))}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(rr(this,Oe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ar(this,Oe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ar(this,Oe))==null?void 0:e.unassociateElement)==null||t.call(e,this),rr(this,Oe,null)}attributeChangedCallback(e,t,a){var r,n,s,d,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===A.MEDIA_CONTROLLER&&(t&&((n=(r=ar(this,Oe))==null?void 0:r.unassociateElement)==null||n.call(r,this),rr(this,Oe,null)),a&&this.isConnected&&(rr(this,Oe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=ar(this,Oe))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return x(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(o.MEDIA_PREVIEW_COORDS);return}this.setAttribute(o.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,s]=e,d=t.split("#")[0],u=getComputedStyle(this),{maxWidth:h,maxHeight:m,minWidth:b,minHeight:E}=u,I=Math.min(parseInt(h)/n,parseInt(m)/s),H=Math.max(parseInt(b)/n,parseInt(E)/s),k=I<1,$=k?I:H>1?H:1,{style:Z}=N(this.shadowRoot,":host"),ee=N(this.shadowRoot,"img").style,je=this.shadowRoot.querySelector("img"),Ti=k?"min":"max";Z.setProperty(`${Ti}-width`,"initial","important"),Z.setProperty(`${Ti}-height`,"initial","important"),Z.width=`${n*$}px`,Z.height=`${s*$}px`;let Wt=()=>{ee.width=`${this.imgWidth*$}px`,ee.height=`${this.imgHeight*$}px`,ee.display="block"};je.src!==d&&(je.onload=()=>{this.imgWidth=je.naturalWidth,this.imgHeight=je.naturalHeight,Wt()},je.src=d,Wt()),Wt(),ee.transform=`translate(-${a*$}px, -${r*$}px)`}};Oe=new WeakMap;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",yo);var Sd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Y=(i,e,t)=>(Sd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ne=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},le=(i,e,t,a)=>(Sd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),mm=(i,e,t,a)=>({set _(r){le(i,e,r,t)},get _(){return Y(i,e,a)}}),ni,nr,oi,Hi,or,sr,lr,si,St,dr,ur=class{constructor(e,t,a){Ne(this,ni,void 0),Ne(this,nr,void 0),Ne(this,oi,void 0),Ne(this,Hi,void 0),Ne(this,or,void 0),Ne(this,sr,void 0),Ne(this,lr,void 0),Ne(this,si,void 0),Ne(this,St,0),Ne(this,dr,(r=performance.now())=>{le(this,St,requestAnimationFrame(Y(this,dr))),le(this,Hi,performance.now()-Y(this,oi));let n=1e3/this.fps;if(Y(this,Hi)>n){le(this,oi,r-Y(this,Hi)%n);let s=1e3/((r-Y(this,nr))/++mm(this,or)._),d=(r-Y(this,sr))/1e3/this.duration,u=Y(this,lr)+d*this.playbackRate;u-Y(this,ni).valueAsNumber>0?le(this,si,this.playbackRate/this.duration/s):(le(this,si,.995*Y(this,si)),u=Y(this,ni).valueAsNumber+Y(this,si)),this.callback(u)}}),le(this,ni,e),this.callback=t,this.fps=a}start(){Y(this,St)===0&&(le(this,oi,performance.now()),le(this,nr,Y(this,oi)),le(this,or,0),Y(this,dr).call(this))}stop(){Y(this,St)!==0&&(cancelAnimationFrame(Y(this,St)),le(this,St,0))}update({start:e,duration:t,playbackRate:a}){let r=e-Y(this,ni).valueAsNumber;(r>0||r<-.03)&&this.callback(e),le(this,lr,e),le(this,sr,performance.now()),this.duration=t,this.playbackRate=a}};ni=new WeakMap;nr=new WeakMap;oi=new WeakMap;Hi=new WeakMap;or=new WeakMap;sr=new WeakMap;lr=new WeakMap;si=new WeakMap;St=new WeakMap;dr=new WeakMap;var Co=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(Co(i,e,"read from private field"),t?t.call(i):e.get(i)),ae=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ot=(i,e,t,a)=>(Co(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),he=(i,e,t)=>(Co(i,e,"access private method"),t),li,Ct,cr,mr,$i,hr,pr,di,Wi,Mo,Md,To,br,Lo,Io,Ld,Fi,Er,ko,Rd,hm="video not loaded, unknown time.",pm=i=>{let e=i.range,t=gt(+xd(i)),a=gt(+i.mediaSeekableEnd),r=t&&a?`${t} of ${a}`:hm;e.setAttribute("aria-valuetext",r)},wd=c.createElement("template");wd.innerHTML=`
667
+ `;var yo=class extends l.HTMLElement{constructor(){super(),cm(this,Oe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(kd.content.cloneNode(!0)))}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(rr(this,Oe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ar(this,Oe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ar(this,Oe))==null?void 0:e.unassociateElement)==null||t.call(e,this),rr(this,Oe,null)}attributeChangedCallback(e,t,a){var r,n,s,d,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===A.MEDIA_CONTROLLER&&(t&&((n=(r=ar(this,Oe))==null?void 0:r.unassociateElement)==null||n.call(r,this),rr(this,Oe,null)),a&&this.isConnected&&(rr(this,Oe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=ar(this,Oe))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return x(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(o.MEDIA_PREVIEW_COORDS);return}this.setAttribute(o.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,s]=e,d=t.split("#")[0],u=getComputedStyle(this),{maxWidth:h,maxHeight:m,minWidth:b,minHeight:E}=u,I=Math.min(parseInt(h)/n,parseInt(m)/s),H=Math.max(parseInt(b)/n,parseInt(E)/s),k=I<1,$=k?I:H>1?H:1,{style:Z}=N(this.shadowRoot,":host"),ee=N(this.shadowRoot,"img").style,je=this.shadowRoot.querySelector("img"),Ii=k?"min":"max";Z.setProperty(`${Ii}-width`,"initial","important"),Z.setProperty(`${Ii}-height`,"initial","important"),Z.width=`${n*$}px`,Z.height=`${s*$}px`;let Kt=()=>{ee.width=`${this.imgWidth*$}px`,ee.height=`${this.imgHeight*$}px`,ee.display="block"};je.src!==d&&(je.onload=()=>{this.imgWidth=je.naturalWidth,this.imgHeight=je.naturalHeight,Kt()},je.src=d,Kt()),Kt(),ee.transform=`translate(-${a*$}px, -${r*$}px)`}};Oe=new WeakMap;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",yo);var Sd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Y=(i,e,t)=>(Sd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ne=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},le=(i,e,t,a)=>(Sd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),mm=(i,e,t,a)=>({set _(r){le(i,e,r,t)},get _(){return Y(i,e,a)}}),oi,nr,si,Hi,or,sr,lr,li,Mt,dr,ur=class{constructor(e,t,a){Ne(this,oi,void 0),Ne(this,nr,void 0),Ne(this,si,void 0),Ne(this,Hi,void 0),Ne(this,or,void 0),Ne(this,sr,void 0),Ne(this,lr,void 0),Ne(this,li,void 0),Ne(this,Mt,0),Ne(this,dr,(r=performance.now())=>{le(this,Mt,requestAnimationFrame(Y(this,dr))),le(this,Hi,performance.now()-Y(this,si));let n=1e3/this.fps;if(Y(this,Hi)>n){le(this,si,r-Y(this,Hi)%n);let s=1e3/((r-Y(this,nr))/++mm(this,or)._),d=(r-Y(this,sr))/1e3/this.duration,u=Y(this,lr)+d*this.playbackRate;u-Y(this,oi).valueAsNumber>0?le(this,li,this.playbackRate/this.duration/s):(le(this,li,.995*Y(this,li)),u=Y(this,oi).valueAsNumber+Y(this,li)),this.callback(u)}}),le(this,oi,e),this.callback=t,this.fps=a}start(){Y(this,Mt)===0&&(le(this,si,performance.now()),le(this,nr,Y(this,si)),le(this,or,0),Y(this,dr).call(this))}stop(){Y(this,Mt)!==0&&(cancelAnimationFrame(Y(this,Mt)),le(this,Mt,0))}update({start:e,duration:t,playbackRate:a}){let r=e-Y(this,oi).valueAsNumber;(r>0||r<-.03)&&this.callback(e),le(this,lr,e),le(this,sr,performance.now()),this.duration=t,this.playbackRate=a}};oi=new WeakMap;nr=new WeakMap;si=new WeakMap;Hi=new WeakMap;or=new WeakMap;sr=new WeakMap;lr=new WeakMap;li=new WeakMap;Mt=new WeakMap;dr=new WeakMap;var Co=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(Co(i,e,"read from private field"),t?t.call(i):e.get(i)),ae=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},st=(i,e,t,a)=>(Co(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),he=(i,e,t)=>(Co(i,e,"access private method"),t),di,Lt,cr,mr,$i,hr,pr,ui,Wi,Mo,Md,To,br,Lo,Io,Ld,Fi,Er,ko,Rd,hm="video not loaded, unknown time.",pm=i=>{let e=i.range,t=_t(+xd(i)),a=_t(+i.mediaSeekableEnd),r=t&&a?`${t} of ${a}`:hm;e.setAttribute("aria-valuetext",r)},wd=c.createElement("template");wd.innerHTML=`
664
668
  <style>
665
669
  :host {
666
670
  --media-preview-border-radius: 3px;
@@ -785,7 +789,7 @@
785
789
 
786
790
  </slot>
787
791
  </div>
788
- `;var Cd=(i,e=i.mediaCurrentTime)=>{if(Number.isNaN(i.mediaSeekableEnd))return 0;let t=(e-i.mediaSeekableStart)/(i.mediaSeekableEnd-i.mediaSeekableStart);return Math.max(0,Math.min(t,1))},xd=(i,e=i.range.valueAsNumber)=>Number.isNaN(i.mediaSeekableEnd)?0:e*(i.mediaSeekableEnd-i.mediaSeekableStart)+i.mediaSeekableStart,So=class extends kt{constructor(){super(),ae(this,di),ae(this,Mo),ae(this,br),ae(this,Io),ae(this,Fi),ae(this,ko),ae(this,li,void 0),ae(this,Ct,void 0),ae(this,cr,void 0),ae(this,mr,void 0),ae(this,$i,void 0),ae(this,hr,void 0),ae(this,pr,void 0),ae(this,To,t=>{this.dragging||(this.range.valueAsNumber=t,this.updateBar())}),this.container.appendChild(wd.content.cloneNode(!0)),ot(this,cr,this.shadowRoot.querySelectorAll('[part~="box"]')),ot(this,mr,this.shadowRoot.querySelector('[part~="preview-box"]')),ot(this,$i,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);ot(this,hr,parseInt(e.getPropertyValue("--media-box-padding-left"))),ot(this,pr,parseInt(e.getPropertyValue("--media-box-padding-right"))),ot(this,Ct,new ur(this.range,de(this,To),60))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING,o.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",q.SEEK()),he(this,di,Wi).call(this),ot(this,li,this.getRootNode()),(e=de(this,li))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),he(this,di,Wi).call(this),(e=de(this,li))==null||e.removeEventListener("transitionstart",this),ot(this,li,null)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),t!=a&&(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_ENDED||e===o.MEDIA_LOADING||e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE?(de(this,Ct).update({start:Cd(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),he(this,di,Wi).call(this),pm(this)):e===o.MEDIA_BUFFERED&&this.updateBufferedBar())}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return L(this,o.MEDIA_LOADING)}set mediaLoading(e){C(this,o.MEDIA_LOADING,e)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(o.MEDIA_BUFFERED);return}let t=e.map(a=>a.join(":")).join(" ");this.setAttribute(o.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return x(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return L(this,o.MEDIA_ENDED)}set mediaEnded(e){C(this,o.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let a;if(this.mediaEnded)a=1;else{let n=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=t.find(([d,u])=>d<=n&&n<=u))!=null?e:[];a=Cd(this,s)}let{style:r}=N(this.shadowRoot,"#highlight");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!de(this,$i).assignedElements().length)return;let e=he(this,br,Lo).call(this,de(this,$i),this.range.valueAsNumber),{style:t}=N(this.shadowRoot,"#current-rail");t.transform=`translateX(${e})`}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":he(this,ko,Rd).call(this);break;case"pointermove":he(this,Io,Ld).call(this,e);break;case"pointerup":case"pointerleave":he(this,Fi,Er).call(this,null);break;case"transitionstart":et(e.target,this)&&setTimeout(()=>he(this,di,Wi).call(this),0);break}}};li=new WeakMap;Ct=new WeakMap;cr=new WeakMap;mr=new WeakMap;$i=new WeakMap;hr=new WeakMap;pr=new WeakMap;di=new WeakSet;Wi=function(){he(this,Mo,Md).call(this)?de(this,Ct).start():de(this,Ct).stop()};Mo=new WeakSet;Md=function(){return this.isConnected&&ol(this)&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded};To=new WeakMap;br=new WeakSet;Lo=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let n=(t=this.getAttribute("bounds")?tt(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,s=this.range.getBoundingClientRect(),d=n.getBoundingClientRect(),u=(de(this,hr)-(s.left-d.left-r/2))/s.width*100,h=(d.right-s.left-r/2-de(this,pr))/s.width*100;return Number.isNaN(u)||(a=`max(${u*100}%, ${a})`),Number.isNaN(h)||(a=`min(${a}, ${h*100}%)`),a};Io=new WeakSet;Ld=function(i){let e=[...de(this,cr)].some(d=>i.composedPath().includes(d));if(!this.dragging&&(e||!i.composedPath().includes(this))){he(this,Fi,Er).call(this,null);return}let t=this.mediaDuration;if(!t)return;let a=this.range.getBoundingClientRect(),r=(i.clientX-a.left)/a.width;r=Math.max(0,Math.min(1,r));let n=he(this,br,Lo).call(this,de(this,mr),r),{style:s}=N(this.shadowRoot,"#preview-rail");s.transform=`translateX(${n})`,he(this,Fi,Er).call(this,r*t)};Fi=new WeakSet;Er=function(i){this.dispatchEvent(new l.CustomEvent(f.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};ko=new WeakSet;Rd=function(){de(this,Ct).stop();let i=xd(this);this.dispatchEvent(new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};l.customElements.get("media-time-range")||l.customElements.define("media-time-range",So);var Od=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ui=(i,e,t)=>(Od(i,e,"read from private field"),t?t.call(i):e.get(i)),Ro=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ci=(i,e,t,a)=>(Od(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ue,fr,vr,Dd={LOADING_DELAY:"loadingdelay"},Nd=500,Ud=c.createElement("template"),bm=`
792
+ `;var Cd=(i,e=i.mediaCurrentTime)=>{if(Number.isNaN(i.mediaSeekableEnd))return 0;let t=(e-i.mediaSeekableStart)/(i.mediaSeekableEnd-i.mediaSeekableStart);return Math.max(0,Math.min(t,1))},xd=(i,e=i.range.valueAsNumber)=>Number.isNaN(i.mediaSeekableEnd)?0:e*(i.mediaSeekableEnd-i.mediaSeekableStart)+i.mediaSeekableStart,So=class extends Ct{constructor(){super(),ae(this,ui),ae(this,Mo),ae(this,br),ae(this,Io),ae(this,Fi),ae(this,ko),ae(this,di,void 0),ae(this,Lt,void 0),ae(this,cr,void 0),ae(this,mr,void 0),ae(this,$i,void 0),ae(this,hr,void 0),ae(this,pr,void 0),ae(this,To,t=>{this.dragging||(this.range.valueAsNumber=t,this.updateBar())}),this.container.appendChild(wd.content.cloneNode(!0)),st(this,cr,this.shadowRoot.querySelectorAll('[part~="box"]')),st(this,mr,this.shadowRoot.querySelector('[part~="preview-box"]')),st(this,$i,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);st(this,hr,parseInt(e.getPropertyValue("--media-box-padding-left"))),st(this,pr,parseInt(e.getPropertyValue("--media-box-padding-right"))),st(this,Lt,new ur(this.range,de(this,To),60))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING,o.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",q.SEEK()),he(this,ui,Wi).call(this),st(this,di,this.getRootNode()),(e=de(this,di))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),he(this,ui,Wi).call(this),(e=de(this,di))==null||e.removeEventListener("transitionstart",this),st(this,di,null)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),t!=a&&(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_ENDED||e===o.MEDIA_LOADING||e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE?(de(this,Lt).update({start:Cd(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),he(this,ui,Wi).call(this),pm(this)):e===o.MEDIA_BUFFERED&&this.updateBufferedBar())}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return L(this,o.MEDIA_LOADING)}set mediaLoading(e){C(this,o.MEDIA_LOADING,e)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(o.MEDIA_BUFFERED);return}let t=e.map(a=>a.join(":")).join(" ");this.setAttribute(o.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return x(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return L(this,o.MEDIA_ENDED)}set mediaEnded(e){C(this,o.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let a;if(this.mediaEnded)a=1;else{let n=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=t.find(([d,u])=>d<=n&&n<=u))!=null?e:[];a=Cd(this,s)}let{style:r}=N(this.shadowRoot,"#highlight");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!de(this,$i).assignedElements().length)return;let e=he(this,br,Lo).call(this,de(this,$i),this.range.valueAsNumber),{style:t}=N(this.shadowRoot,"#current-rail");t.transform=`translateX(${e})`}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":he(this,ko,Rd).call(this);break;case"pointermove":he(this,Io,Ld).call(this,e);break;case"pointerup":case"pointerleave":he(this,Fi,Er).call(this,null);break;case"transitionstart":tt(e.target,this)&&setTimeout(()=>he(this,ui,Wi).call(this),0);break}}};di=new WeakMap;Lt=new WeakMap;cr=new WeakMap;mr=new WeakMap;$i=new WeakMap;hr=new WeakMap;pr=new WeakMap;ui=new WeakSet;Wi=function(){he(this,Mo,Md).call(this)?de(this,Lt).start():de(this,Lt).stop()};Mo=new WeakSet;Md=function(){return this.isConnected&&ol(this)&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded};To=new WeakMap;br=new WeakSet;Lo=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let n=(t=this.getAttribute("bounds")?it(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,s=this.range.getBoundingClientRect(),d=n.getBoundingClientRect(),u=(de(this,hr)-(s.left-d.left-r/2))/s.width*100,h=(d.right-s.left-r/2-de(this,pr))/s.width*100;return Number.isNaN(u)||(a=`max(${u*100}%, ${a})`),Number.isNaN(h)||(a=`min(${a}, ${h*100}%)`),a};Io=new WeakSet;Ld=function(i){let e=[...de(this,cr)].some(d=>i.composedPath().includes(d));if(!this.dragging&&(e||!i.composedPath().includes(this))){he(this,Fi,Er).call(this,null);return}let t=this.mediaDuration;if(!t)return;let a=this.range.getBoundingClientRect(),r=(i.clientX-a.left)/a.width;r=Math.max(0,Math.min(1,r));let n=he(this,br,Lo).call(this,de(this,mr),r),{style:s}=N(this.shadowRoot,"#preview-rail");s.transform=`translateX(${n})`,he(this,Fi,Er).call(this,r*t)};Fi=new WeakSet;Er=function(i){this.dispatchEvent(new l.CustomEvent(f.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};ko=new WeakSet;Rd=function(){de(this,Lt).stop();let i=xd(this);this.dispatchEvent(new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};l.customElements.get("media-time-range")||l.customElements.define("media-time-range",So);var Od=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ci=(i,e,t)=>(Od(i,e,"read from private field"),t?t.call(i):e.get(i)),Ro=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},mi=(i,e,t,a)=>(Od(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ue,fr,vr,Dd={LOADING_DELAY:"loadingdelay"},Nd=500,Ud=c.createElement("template"),bm=`
789
793
  <svg aria-hidden="true" viewBox="0 0 100 100">
790
794
  <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">
791
795
  <animateTransform
@@ -845,7 +849,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
845
849
 
846
850
  <slot name="icon">${bm}</slot>
847
851
  <div id="status" role="status" aria-live="polite">${q.MEDIA_LOADING()}</div>
848
- `;var wo=class extends l.HTMLElement{constructor(){if(super(),Ro(this,Ue,void 0),Ro(this,fr,Nd),Ro(this,vr,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Ud.content.cloneNode(!0);t.appendChild(a)}let{style:e}=N(this.shadowRoot,":host");ci(this,vr,e)}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,Dd.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===Dd.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===A.MEDIA_CONTROLLER&&(t&&((n=(r=ui(this,Ue))==null?void 0:r.unassociateElement)==null||n.call(r,this),ci(this,Ue,null)),a&&this.isConnected&&(ci(this,Ue,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=ui(this,Ue))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(ci(this,Ue,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ui(this,Ue))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ui(this,Ue))==null?void 0:e.unassociateElement)==null||t.call(e,this),ci(this,Ue,null)}get loadingDelay(){return ui(this,fr)}set loadingDelay(e){ci(this,fr,e),ui(this,vr).setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return L(this,o.MEDIA_LOADING)}set mediaLoading(e){C(this,o.MEDIA_LOADING,e)}};Ue=new WeakMap;fr=new WeakMap;vr=new WeakMap;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",wo);var Em=1,fm=i=>i.mediaMuted?0:i.mediaVolume,vm=({value:i})=>`${Math.round(i*100)}%`,xo=class extends kt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new l.CustomEvent(f.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",q.VOLUME())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=fm(this),this.range.setAttribute("aria-valuetext",vm(this.range)),this.updateBar())}get mediaVolume(){return M(this,o.MEDIA_VOLUME,Em)}set mediaVolume(e){O(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return L(this,o.MEDIA_MUTED)}set mediaMuted(e){C(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return x(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){R(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",xo);var Bo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},G=(i,e,t)=>(Bo(i,e,"read from private field"),t?t.call(i):e.get(i)),ue=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ye=(i,e,t,a)=>(Bo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_e=(i,e,t)=>(Bo(i,e,"access private method"),t),Pe,st,hi,Ki,gr,Ar,Do,mi,Oo,_r,No,Yi,yr,Tr,Uo,Po,Pd,Vo,Bd,gm=`
852
+ `;var wo=class extends l.HTMLElement{constructor(){if(super(),Ro(this,Ue,void 0),Ro(this,fr,Nd),Ro(this,vr,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Ud.content.cloneNode(!0);t.appendChild(a)}let{style:e}=N(this.shadowRoot,":host");mi(this,vr,e)}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,Dd.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===Dd.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===A.MEDIA_CONTROLLER&&(t&&((n=(r=ci(this,Ue))==null?void 0:r.unassociateElement)==null||n.call(r,this),mi(this,Ue,null)),a&&this.isConnected&&(mi(this,Ue,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=ci(this,Ue))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(mi(this,Ue,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ci(this,Ue))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ci(this,Ue))==null?void 0:e.unassociateElement)==null||t.call(e,this),mi(this,Ue,null)}get loadingDelay(){return ci(this,fr)}set loadingDelay(e){mi(this,fr,e),ci(this,vr).setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return L(this,o.MEDIA_LOADING)}set mediaLoading(e){C(this,o.MEDIA_LOADING,e)}};Ue=new WeakMap;fr=new WeakMap;vr=new WeakMap;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",wo);var Em=1,fm=i=>i.mediaMuted?0:i.mediaVolume,vm=({value:i})=>`${Math.round(i*100)}%`,xo=class extends Ct{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new l.CustomEvent(f.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",q.VOLUME())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=fm(this),this.range.setAttribute("aria-valuetext",vm(this.range)),this.updateBar())}get mediaVolume(){return M(this,o.MEDIA_VOLUME,Em)}set mediaVolume(e){O(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return L(this,o.MEDIA_MUTED)}set mediaMuted(e){C(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return x(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){R(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",xo);var Bo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},G=(i,e,t)=>(Bo(i,e,"read from private field"),t?t.call(i):e.get(i)),ue=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ye=(i,e,t,a)=>(Bo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_e=(i,e,t)=>(Bo(i,e,"access private method"),t),Pe,lt,pi,Ki,gr,Ar,Do,hi,Oo,_r,No,Yi,yr,Tr,Uo,Po,Pd,Vo,Bd,gm=`
849
853
  <svg aria-hidden="true" viewBox="0 1 24 24" part="select-indicator indicator">
850
854
  <path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
851
855
  </svg>`;function Be(i,e,t){let a=c.createElement("media-chrome-option");a.part.add("option"),a.value=e,a.selected=t;let r=c.createElement("span");return r.textContent=i,a.append(r),a}function Te(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);return(t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t?(t=t.cloneNode(!0),t.removeAttribute("slot"),t):i.shadowRoot.querySelector(`[name="${e}"] > svg`).cloneNode(!0)}var Vd=c.createElement("template");Vd.innerHTML=`
@@ -928,7 +932,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
928
932
  <slot name="header"></slot>
929
933
  <slot id="container"></slot>
930
934
  <slot name="select-indicator" hidden>${gm}</slot>
931
- `;var pe=class extends l.HTMLElement{constructor(e={}){super(),ue(this,Ar),ue(this,_r),ue(this,Yi),ue(this,Tr),ue(this,Po),ue(this,Vo),ue(this,Pe,void 0),ue(this,st,""),ue(this,hi,null),ue(this,Ki,!1),ue(this,gr,t=>{this.handleClick(t)}),ue(this,mi,t=>{let{key:a}=t;if(a==="Escape"){this.removeEventListener("keyup",G(this,mi));return}if(a==="Meta"){ye(this,Ki,!1);return}_e(this,Ar,Do).call(this,t)}),ue(this,Oo,t=>{let{key:a,altKey:r}=t;if(r){this.removeEventListener("keyup",G(this,mi));return}if(a==="Meta"){ye(this,Ki,!0);return}if(this.keysUsed.includes(a)&&t.preventDefault(),G(this,Ki)&&this.keysUsed.includes(a)){_e(this,Ar,Do).call(this,t);return}this.addEventListener("keyup",G(this,mi),{once:!0})}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=Vd.content.cloneNode(!0),e.slotTemplate&&this.nativeEl.append(e.slotTemplate.content.cloneNode(!0)),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.container.addEventListener("slotchange",t=>{for(let a of t.target.assignedNodes({flatten:!0}))a.nodeType===3&&a.textContent.trim()===""&&a.remove()})}static get observedAttributes(){return["disabled","style",A.MEDIA_CONTROLLER]}static formatOptionText(e){return e}formatOptionText(e,t){return this.constructor.formatOptionText(e,t)}get options(){var e;let t=this.querySelectorAll("media-chrome-option");return t.length||(t=(e=this.container)==null?void 0:e.querySelectorAll("media-chrome-option")),Array.from(t)}get selectedOptions(){return this.options.filter(e=>e.selected)}get value(){var e,t;return(t=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.options.find(a=>a.value===e);t&&_e(this,Tr,Uo).call(this,t)}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",G(this,gr)),this.addEventListener("keydown",G(this,Oo))}disable(){this.removeEventListener("click",G(this,gr)),this.removeEventListener("keyup",G(this,mi))}attributeChangedCallback(e,t,a){var r,n,s,d,u;e==="style"&&a!==t?_e(this,_r,No).call(this):e===A.MEDIA_CONTROLLER?(t&&((n=(r=G(this,Pe))==null?void 0:r.unassociateElement)==null||n.call(r,this),ye(this,Pe,null)),a&&this.isConnected&&(ye(this,Pe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=G(this,Pe))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;_e(this,_r,No).call(this),this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(ye(this,Pe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=G(this,Pe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=G(this,Pe))==null?void 0:e.unassociateElement)==null||t.call(e,this),ye(this,Pe,null)}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e,t){let a=_e(this,Yi,yr).call(this,e);a&&_e(this,Tr,Uo).call(this,a,t)}handleMovement(e){let{key:t}=e,a=this.options,r=_e(this,Yi,yr).call(this,e);r||(r=a.filter(s=>s.getAttribute("tabindex")==="0")[0]);let n;switch(t){case"ArrowDown":n=r.nextElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.nextElementSibling);break;case"ArrowUp":n=r.previousElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.previousElementSibling);break;case"Home":n=a[0];break;case"End":n=a[a.length-1];break;default:n=_e(this,Po,Pd).call(this,t);break}n&&(a.forEach(s=>s.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=_e(this,Yi,yr).call(this,e);!t||t.hasAttribute("disabled")||(this.options.forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"))}};Pe=new WeakMap;st=new WeakMap;hi=new WeakMap;Ki=new WeakMap;gr=new WeakMap;Ar=new WeakSet;Do=function(i){let{key:e}=i;e==="Enter"||e===" "?this.handleSelection(i,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"):this.handleMovement(i)};mi=new WeakMap;Oo=new WeakMap;_r=new WeakSet;No=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=((i=getComputedStyle(this).getPropertyValue("--media-listbox-layout"))==null?void 0:i.trim())==="row";e.setAttribute("media",t?"":"width:0")};Yi=new WeakSet;yr=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-OPTION");return e[t]};Tr=new WeakSet;Uo=function(i,e){let t=[...this.selectedOptions];(!this.hasAttribute("aria-multiselectable")||this.getAttribute("aria-multiselectable")!=="true")&&this.options.forEach(a=>a.selected=!1),e?i.selected=!i.selected:i.selected=!0,this.selectedOptions.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};Po=new WeakSet;Pd=function(i){_e(this,Vo,Bd).call(this);let e=this.options,t=e.findIndex(h=>h.getAttribute("tabindex")==="0");ye(this,st,G(this,st)+i);let a=G(this,st).split("").every(h=>h===i),r=e.slice(t+(a?1:0)).filter(h=>h.textContent.toLowerCase().startsWith(G(this,st))),n=e.slice(0,t-(a?1:0)).filter(h=>h.textContent.toLowerCase().startsWith(G(this,st))),s=[],d=[];return a&&(s=e.slice(t+(a?1:0)).filter(h=>h.textContent.startsWith(i)),d=e.slice(0,t-(a?1:0)).filter(h=>h.textContent.startsWith(i))),[...r,...n,...s,...d][0]};Vo=new WeakSet;Bd=function(){clearTimeout(G(this,hi)),ye(this,hi,null),ye(this,hi,setTimeout(()=>{ye(this,st,""),ye(this,hi,null)},500))};l.customElements.get("media-chrome-listbox")||l.customElements.define("media-chrome-listbox",pe);var Yo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Wo=(i,e,t)=>(Yo(i,e,"read from private field"),t?t.call(i):e.get(i)),Ho=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},$o=(i,e,t,a)=>(Yo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Hd=(i,e,t)=>(Yo(i,e,"access private method"),t),Ir,pi,kr,Fo,$d=c.createElement("template");$d.innerHTML=`
935
+ `;var pe=class extends l.HTMLElement{constructor(e={}){super(),ue(this,Ar),ue(this,_r),ue(this,Yi),ue(this,Tr),ue(this,Po),ue(this,Vo),ue(this,Pe,void 0),ue(this,lt,""),ue(this,pi,null),ue(this,Ki,!1),ue(this,gr,t=>{this.handleClick(t)}),ue(this,hi,t=>{let{key:a}=t;if(a==="Escape"){this.removeEventListener("keyup",G(this,hi));return}if(a==="Meta"){ye(this,Ki,!1);return}_e(this,Ar,Do).call(this,t)}),ue(this,Oo,t=>{let{key:a,altKey:r}=t;if(r){this.removeEventListener("keyup",G(this,hi));return}if(a==="Meta"){ye(this,Ki,!0);return}if(this.keysUsed.includes(a)&&t.preventDefault(),G(this,Ki)&&this.keysUsed.includes(a)){_e(this,Ar,Do).call(this,t);return}this.addEventListener("keyup",G(this,hi),{once:!0})}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=Vd.content.cloneNode(!0),e.slotTemplate&&this.nativeEl.append(e.slotTemplate.content.cloneNode(!0)),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.container.addEventListener("slotchange",t=>{for(let a of t.target.assignedNodes({flatten:!0}))a.nodeType===3&&a.textContent.trim()===""&&a.remove()})}static get observedAttributes(){return["disabled","style",A.MEDIA_CONTROLLER]}static formatOptionText(e){return e}formatOptionText(e,t){return this.constructor.formatOptionText(e,t)}get options(){var e;let t=this.querySelectorAll("media-chrome-option");return t.length||(t=(e=this.container)==null?void 0:e.querySelectorAll("media-chrome-option")),Array.from(t)}get selectedOptions(){return this.options.filter(e=>e.selected)}get value(){var e,t;return(t=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.options.find(a=>a.value===e);t&&_e(this,Tr,Uo).call(this,t)}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",G(this,gr)),this.addEventListener("keydown",G(this,Oo))}disable(){this.removeEventListener("click",G(this,gr)),this.removeEventListener("keyup",G(this,hi))}attributeChangedCallback(e,t,a){var r,n,s,d,u;e==="style"&&a!==t?_e(this,_r,No).call(this):e===A.MEDIA_CONTROLLER?(t&&((n=(r=G(this,Pe))==null?void 0:r.unassociateElement)==null||n.call(r,this),ye(this,Pe,null)),a&&this.isConnected&&(ye(this,Pe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=G(this,Pe))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;_e(this,_r,No).call(this),this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(ye(this,Pe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=G(this,Pe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=G(this,Pe))==null?void 0:e.unassociateElement)==null||t.call(e,this),ye(this,Pe,null)}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e,t){let a=_e(this,Yi,yr).call(this,e);a&&_e(this,Tr,Uo).call(this,a,t)}handleMovement(e){let{key:t}=e,a=this.options,r=_e(this,Yi,yr).call(this,e);r||(r=a.filter(s=>s.getAttribute("tabindex")==="0")[0]);let n;switch(t){case"ArrowDown":n=r.nextElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.nextElementSibling);break;case"ArrowUp":n=r.previousElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.previousElementSibling);break;case"Home":n=a[0];break;case"End":n=a[a.length-1];break;default:n=_e(this,Po,Pd).call(this,t);break}n&&(a.forEach(s=>s.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=_e(this,Yi,yr).call(this,e);!t||t.hasAttribute("disabled")||(this.options.forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"))}};Pe=new WeakMap;lt=new WeakMap;pi=new WeakMap;Ki=new WeakMap;gr=new WeakMap;Ar=new WeakSet;Do=function(i){let{key:e}=i;e==="Enter"||e===" "?this.handleSelection(i,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"):this.handleMovement(i)};hi=new WeakMap;Oo=new WeakMap;_r=new WeakSet;No=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=((i=getComputedStyle(this).getPropertyValue("--media-listbox-layout"))==null?void 0:i.trim())==="row";e.setAttribute("media",t?"":"width:0")};Yi=new WeakSet;yr=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-OPTION");return e[t]};Tr=new WeakSet;Uo=function(i,e){let t=[...this.selectedOptions];(!this.hasAttribute("aria-multiselectable")||this.getAttribute("aria-multiselectable")!=="true")&&this.options.forEach(a=>a.selected=!1),e?i.selected=!i.selected:i.selected=!0,this.selectedOptions.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};Po=new WeakSet;Pd=function(i){_e(this,Vo,Bd).call(this);let e=this.options,t=e.findIndex(h=>h.getAttribute("tabindex")==="0");ye(this,lt,G(this,lt)+i);let a=G(this,lt).split("").every(h=>h===i),r=e.slice(t+(a?1:0)).filter(h=>h.textContent.toLowerCase().startsWith(G(this,lt))),n=e.slice(0,t-(a?1:0)).filter(h=>h.textContent.toLowerCase().startsWith(G(this,lt))),s=[],d=[];return a&&(s=e.slice(t+(a?1:0)).filter(h=>h.textContent.startsWith(i)),d=e.slice(0,t-(a?1:0)).filter(h=>h.textContent.startsWith(i))),[...r,...n,...s,...d][0]};Vo=new WeakSet;Bd=function(){clearTimeout(G(this,pi)),ye(this,pi,null),ye(this,pi,setTimeout(()=>{ye(this,lt,""),ye(this,pi,null)},500))};l.customElements.get("media-chrome-listbox")||l.customElements.define("media-chrome-listbox",pe);var Yo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Wo=(i,e,t)=>(Yo(i,e,"read from private field"),t?t.call(i):e.get(i)),Ho=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},$o=(i,e,t,a)=>(Yo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Hd=(i,e,t)=>(Yo(i,e,"access private method"),t),Ir,bi,kr,Fo,$d=c.createElement("template");$d.innerHTML=`
932
936
  <style>
933
937
  :host {
934
938
  cursor: pointer;
@@ -966,7 +970,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
966
970
  }
967
971
  </style>
968
972
  <slot></slot>
969
- `;var lt={VALUE:"value",SELECTED:"selected",DISABLED:"disabled"},Sr=class extends l.HTMLElement{constructor(){super(),Ho(this,kr),Ho(this,Ir,!1),Ho(this,pi,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild($d.content.cloneNode(!0)))}static get observedAttributes(){return[lt.DISABLED,lt.SELECTED,lt.VALUE]}get value(){var e;return(e=this.getAttribute(lt.VALUE))!=null?e:this.text}set value(e){this.setAttribute(lt.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get selected(){return this.getAttribute("aria-selected")==="true"}set selected(e){$o(this,Ir,!0),this.setAttribute("aria-selected",e?"true":"false"),e?this.part.add("option-selected"):this.part.remove("option-selected")}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex",-1),this.hasAttribute("aria-selected")||this.setAttribute("aria-selected","false")}disable(){this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){e===lt.SELECTED&&!Wo(this,Ir)?this.setAttribute("aria-selected",a!=null?"true":"false"):e===lt.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(lt.DISABLED)||this.enable(),this.setAttribute("role","option"),$o(this,pi,Ko(this,this.parentNode)),Hd(this,kr,Fo).call(this)}disconnectedCallback(){this.disable(),Hd(this,kr,Fo).call(this),$o(this,pi,null)}handleClick(){}};Ir=new WeakMap;pi=new WeakMap;kr=new WeakSet;Fo=function(){var i;let e=(i=Wo(this,pi))==null?void 0:i.options;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-selected")==="true").pop();t||(t=e[0]),Wo(this,pi).getAttribute("aria-multiselectable")!=="true"&&e.forEach(a=>{a.setAttribute("tabindex","-1"),a.setAttribute("aria-selected","false")}),t==null||t.setAttribute("tabindex","0"),t==null||t.setAttribute("aria-selected","true")};function Ko(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Ko(i,t):e!=null&&e.options?e:Ko(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-option")||l.customElements.define("media-chrome-option",Sr);var Zo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},v=(i,e,t)=>(Zo(i,e,"read from private field"),t?t.call(i):e.get(i)),re=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ve=(i,e,t,a)=>(Zo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Mt=(i,e,t)=>(Zo(i,e,"access private method"),t),He,Q,Gi,V,Ie,bi,Cr,Mr,Lr,Rr,wr,Go,qo,Wd,Ei,Zi,Lt,Fd=c.createElement("template");Fd.innerHTML=`
973
+ `;var dt={VALUE:"value",SELECTED:"selected",DISABLED:"disabled"},Sr=class extends l.HTMLElement{constructor(){super(),Ho(this,kr),Ho(this,Ir,!1),Ho(this,bi,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild($d.content.cloneNode(!0)))}static get observedAttributes(){return[dt.DISABLED,dt.SELECTED,dt.VALUE]}get value(){var e;return(e=this.getAttribute(dt.VALUE))!=null?e:this.text}set value(e){this.setAttribute(dt.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get selected(){return this.getAttribute("aria-selected")==="true"}set selected(e){$o(this,Ir,!0),this.setAttribute("aria-selected",e?"true":"false"),e?this.part.add("option-selected"):this.part.remove("option-selected")}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex",-1),this.hasAttribute("aria-selected")||this.setAttribute("aria-selected","false")}disable(){this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){e===dt.SELECTED&&!Wo(this,Ir)?this.setAttribute("aria-selected",a!=null?"true":"false"):e===dt.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(dt.DISABLED)||this.enable(),this.setAttribute("role","option"),$o(this,bi,Ko(this,this.parentNode)),Hd(this,kr,Fo).call(this)}disconnectedCallback(){this.disable(),Hd(this,kr,Fo).call(this),$o(this,bi,null)}handleClick(){}};Ir=new WeakMap;bi=new WeakMap;kr=new WeakSet;Fo=function(){var i;let e=(i=Wo(this,bi))==null?void 0:i.options;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-selected")==="true").pop();t||(t=e[0]),Wo(this,bi).getAttribute("aria-multiselectable")!=="true"&&e.forEach(a=>{a.setAttribute("tabindex","-1"),a.setAttribute("aria-selected","false")}),t==null||t.setAttribute("tabindex","0"),t==null||t.setAttribute("aria-selected","true")};function Ko(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Ko(i,t):e!=null&&e.options?e:Ko(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-option")||l.customElements.define("media-chrome-option",Sr);var Zo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},v=(i,e,t)=>(Zo(i,e,"read from private field"),t?t.call(i):e.get(i)),re=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ve=(i,e,t,a)=>(Zo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Rt=(i,e,t)=>(Zo(i,e,"access private method"),t),He,Q,Gi,V,Ie,Ei,Cr,Mr,Lr,Rr,wr,Go,qo,Wd,fi,Zi,wt,Fd=c.createElement("template");Fd.innerHTML=`
970
974
  <style>
971
975
  :host {
972
976
  font: var(--media-font,
@@ -1017,12 +1021,12 @@ svg, img, ::slotted(svg), ::slotted(img) {
1017
1021
  <slot></slot>
1018
1022
  </media-chrome-listbox>
1019
1023
  </slot>
1020
- `;var be=class extends l.HTMLElement{constructor(){var e;super(),re(this,wr),re(this,qo),re(this,Ei),re(this,He,void 0),re(this,Q,void 0),re(this,Gi,void 0),re(this,V,void 0),re(this,Ie,void 0),re(this,bi,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",v(this,bi));return}a.composedPath().includes(v(this,Q))&&(r==="Enter"||r===" ")?Mt(this,wr,Go).call(this):r==="Escape"&&Mt(this,Ei,Zi).call(this)}),re(this,Cr,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",v(this,bi));return}a.preventDefault(),this.addEventListener("keyup",v(this,bi),{once:!0})}),re(this,Mr,a=>{a.composedPath().includes(this)||Mt(this,Ei,Zi).call(this)}),re(this,Lr,a=>{a.composedPath().includes(v(this,Q))&&Mt(this,wr,Go).call(this)}),re(this,Rr,()=>{Mt(this,Ei,Zi).call(this)}),re(this,Lt,()=>{if(v(this,V).offsetWidth===0)return;let a=v(this,V).offsetWidth,r=v(this,Q).getBoundingClientRect();if(this.hasAttribute("mediacontroller")||v(this,Q).hasAttribute("mediacontroller")||v(this,V).hasAttribute("mediacontroller")){v(this,V).style.zIndex="1",v(this,V).style.bottom="unset",v(this,V).style.right=null,v(this,V).style.left="0",v(this,V).style.top=`${r.height}px`;return}let s=qi(this).getBoundingClientRect(),d=r.x+a,u=Math.max(r.right-d,r.right-s.right);v(this,V).style.left=null,v(this,V).style.right=`${u}px`,v(this,V).style.maxHeight=`${s.height-r.height}px`}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Fd.content.cloneNode(!0)));let{style:t}=N(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),(e=this.init)==null||e.call(this),Ve(this,Q,this.shadowRoot.querySelector("[part=button]")),Ve(this,V,this.shadowRoot.querySelector("[part=listbox]")),Ve(this,Gi,this.shadowRoot.querySelector("slot[name=button]")),v(this,Gi).addEventListener("slotchange",()=>{let a=v(this,Gi).assignedElements()[0];if(!a)return;Ve(this,Q,a),v(this,Q).preventClick=!0,this.hasAttribute("disabled")||v(this,Q).hasAttribute("disabled")?this.disable():(this.enable(),v(this,Q).setAttribute("aria-haspopup","listbox"))}),Ve(this,Ie,this.shadowRoot.querySelector("slot[name=listbox]")),v(this,Ie).addEventListener("slotchange",()=>{Ve(this,V,v(this,Ie).assignedElements()[0]||v(this,V))})}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}enable(){v(this,Q).toggleAttribute("disabled",!1),this.addEventListener("change",v(this,Rr)),this.addEventListener("keydown",v(this,Cr)),this.addEventListener("click",v(this,Lr)),c.addEventListener("click",v(this,Mr))}disable(){v(this,Q).toggleAttribute("disabled",!0),this.removeEventListener("change",v(this,Rr)),this.removeEventListener("keydown",v(this,Cr)),this.removeEventListener("keyup",v(this,bi)),this.removeEventListener("click",v(this,Lr)),c.removeEventListener("click",v(this,Mr))}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=v(this,He))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ve(this,He,null),v(this,V).removeAttribute(A.MEDIA_CONTROLLER)),a&&this.isConnected&&(Ve(this,He,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=v(this,He))==null?void 0:d.associateElement)==null||u.call(d,this),v(this,V).setAttribute(A.MEDIA_CONTROLLER,a))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ve(this,He,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=v(this,He))==null?void 0:t.associateElement)==null||a.call(t,this),v(this,V).setAttribute(A.MEDIA_CONTROLLER,r)),this.hasAttribute("disabled")||this.enable(),v(this,Ie).hidden||Si(qi(this),v(this,Lt))}disconnectedCallback(){var e,t;Nn(qi(this),v(this,Lt)),this.disable(),(t=(e=v(this,He))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ve(this,He,null),v(this,V).removeAttribute(A.MEDIA_CONTROLLER)}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};He=new WeakMap;Q=new WeakMap;Gi=new WeakMap;V=new WeakMap;Ie=new WeakMap;bi=new WeakMap;Cr=new WeakMap;Mr=new WeakMap;Lr=new WeakMap;Rr=new WeakMap;wr=new WeakSet;Go=function(){v(this,Ie).hidden?Mt(this,qo,Wd).call(this):Mt(this,Ei,Zi).call(this)};qo=new WeakSet;Wd=function(){v(this,Ie).hidden&&(v(this,Ie).hidden=!1,v(this,Q).setAttribute("aria-expanded","true"),v(this,Lt).call(this),v(this,V).focus(),Si(qi(this),v(this,Lt)))};Ei=new WeakSet;Zi=function(){if(v(this,Ie).hidden)return;Nn(qi(this),v(this,Lt));let i=Mn();v(this,Ie).hidden=!0,v(this,Q).setAttribute("aria-expanded","false"),et(v(this,V),i)&&v(this,Q).focus()};Lt=new WeakMap;function qi(i){var e;return(e=i.getAttribute("bounds")?tt(i,`#${i.getAttribute("bounds")}`):Am(i)||i.parentElement)!=null?e:i}function Am(i){var e;let t=i.getAttribute(A.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):tt(i,"media-controller")}l.customElements.get("media-chrome-selectmenu")||l.customElements.define("media-chrome-selectmenu",be);var jo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_m=(i,e,t)=>(jo(i,e,"read from private field"),t?t.call(i):e.get(i)),Qo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ym=(i,e,t,a)=>(jo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),zo=(i,e,t)=>(jo(i,e,"access private method"),t),Dr,Xo,Gd,xr,Jo,Tm=`
1024
+ `;var be=class extends l.HTMLElement{constructor(){var e;super(),re(this,wr),re(this,qo),re(this,fi),re(this,He,void 0),re(this,Q,void 0),re(this,Gi,void 0),re(this,V,void 0),re(this,Ie,void 0),re(this,Ei,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",v(this,Ei));return}a.composedPath().includes(v(this,Q))&&(r==="Enter"||r===" ")?Rt(this,wr,Go).call(this):r==="Escape"&&Rt(this,fi,Zi).call(this)}),re(this,Cr,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",v(this,Ei));return}a.preventDefault(),this.addEventListener("keyup",v(this,Ei),{once:!0})}),re(this,Mr,a=>{a.composedPath().includes(this)||Rt(this,fi,Zi).call(this)}),re(this,Lr,a=>{a.composedPath().includes(v(this,Q))&&Rt(this,wr,Go).call(this)}),re(this,Rr,()=>{Rt(this,fi,Zi).call(this)}),re(this,wt,()=>{if(v(this,V).offsetWidth===0)return;let a=v(this,V).offsetWidth,r=v(this,Q).getBoundingClientRect();if(this.hasAttribute("mediacontroller")||v(this,Q).hasAttribute("mediacontroller")||v(this,V).hasAttribute("mediacontroller")){v(this,V).style.zIndex="1",v(this,V).style.bottom="unset",v(this,V).style.right=null,v(this,V).style.left="0",v(this,V).style.top=`${r.height}px`;return}let s=qi(this).getBoundingClientRect(),d=r.x+a,u=Math.max(r.right-d,r.right-s.right);v(this,V).style.left=null,v(this,V).style.right=`${u}px`,v(this,V).style.maxHeight=`${s.height-r.height}px`}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Fd.content.cloneNode(!0)));let{style:t}=N(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),(e=this.init)==null||e.call(this),Ve(this,Q,this.shadowRoot.querySelector("[part=button]")),Ve(this,V,this.shadowRoot.querySelector("[part=listbox]")),Ve(this,Gi,this.shadowRoot.querySelector("slot[name=button]")),v(this,Gi).addEventListener("slotchange",()=>{let a=v(this,Gi).assignedElements()[0];if(!a)return;Ve(this,Q,a),v(this,Q).preventClick=!0,this.hasAttribute("disabled")||v(this,Q).hasAttribute("disabled")?this.disable():(this.enable(),v(this,Q).setAttribute("aria-haspopup","listbox"))}),Ve(this,Ie,this.shadowRoot.querySelector("slot[name=listbox]")),v(this,Ie).addEventListener("slotchange",()=>{Ve(this,V,v(this,Ie).assignedElements()[0]||v(this,V))})}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}enable(){v(this,Q).toggleAttribute("disabled",!1),this.addEventListener("change",v(this,Rr)),this.addEventListener("keydown",v(this,Cr)),this.addEventListener("click",v(this,Lr)),c.addEventListener("click",v(this,Mr))}disable(){v(this,Q).toggleAttribute("disabled",!0),this.removeEventListener("change",v(this,Rr)),this.removeEventListener("keydown",v(this,Cr)),this.removeEventListener("keyup",v(this,Ei)),this.removeEventListener("click",v(this,Lr)),c.removeEventListener("click",v(this,Mr))}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=v(this,He))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ve(this,He,null),v(this,V).removeAttribute(A.MEDIA_CONTROLLER)),a&&this.isConnected&&(Ve(this,He,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=v(this,He))==null?void 0:d.associateElement)==null||u.call(d,this),v(this,V).setAttribute(A.MEDIA_CONTROLLER,a))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ve(this,He,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=v(this,He))==null?void 0:t.associateElement)==null||a.call(t,this),v(this,V).setAttribute(A.MEDIA_CONTROLLER,r)),this.hasAttribute("disabled")||this.enable(),v(this,Ie).hidden||Ci(qi(this),v(this,wt))}disconnectedCallback(){var e,t;Nn(qi(this),v(this,wt)),this.disable(),(t=(e=v(this,He))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ve(this,He,null),v(this,V).removeAttribute(A.MEDIA_CONTROLLER)}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};He=new WeakMap;Q=new WeakMap;Gi=new WeakMap;V=new WeakMap;Ie=new WeakMap;Ei=new WeakMap;Cr=new WeakMap;Mr=new WeakMap;Lr=new WeakMap;Rr=new WeakMap;wr=new WeakSet;Go=function(){v(this,Ie).hidden?Rt(this,qo,Wd).call(this):Rt(this,fi,Zi).call(this)};qo=new WeakSet;Wd=function(){v(this,Ie).hidden&&(v(this,Ie).hidden=!1,v(this,Q).setAttribute("aria-expanded","true"),v(this,wt).call(this),v(this,V).focus(),Ci(qi(this),v(this,wt)))};fi=new WeakSet;Zi=function(){if(v(this,Ie).hidden)return;Nn(qi(this),v(this,wt));let i=Mn();v(this,Ie).hidden=!0,v(this,Q).setAttribute("aria-expanded","false"),tt(v(this,V),i)&&v(this,Q).focus()};wt=new WeakMap;function qi(i){var e;return(e=i.getAttribute("bounds")?it(i,`#${i.getAttribute("bounds")}`):Am(i)||i.parentElement)!=null?e:i}function Am(i){var e;let t=i.getAttribute(A.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):it(i,"media-controller")}l.customElements.get("media-chrome-selectmenu")||l.customElements.define("media-chrome-selectmenu",be);var jo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_m=(i,e,t)=>(jo(i,e,"read from private field"),t?t.call(i):e.get(i)),Qo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ym=(i,e,t,a)=>(jo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),zo=(i,e,t)=>(jo(i,e,"access private method"),t),Dr,Xo,Gd,xr,Jo,Tm=`
1021
1025
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
1022
1026
  <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"/>
1023
1027
  </svg>`,Zd=c.createElement("template");Zd.innerHTML=`
1024
1028
  <slot name="captions-indicator" hidden>${Tm}</slot>
1025
- `;var Or=class extends pe{constructor(){super({slotTemplate:Zd}),Qo(this,Xo),Qo(this,xr),Qo(this,Dr,void 0)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_LIST&&t!==a?zo(this,Xo,Gd).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&t!==a?this.value=a:e==="aria-multiselectable"&&(this.removeAttribute("aria-multiselectable"),console.warn("Captions List doesn't currently support multiple selections. You can enable multiple items via the media.textTracks API."))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",zo(this,xr,Jo))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",zo(this,xr,Jo))}get mediaSubtitlesList(){return Kd(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Yd(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Kd(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Yd(this,o.MEDIA_SUBTITLES_SHOWING,e)}};Dr=new WeakMap;Xo=new WeakSet;Gd=function(){var i;if(_m(this,Dr)===JSON.stringify(this.mediaSubtitlesList))return;ym(this,Dr,JSON.stringify(this.mediaSubtitlesList));let e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.value,a=Be(this.formatOptionText("Off"),"off",t);a.prepend(Te(this,"select-indicator")),e.append(a);let r=this.mediaSubtitlesList;for(let n of r){let s=Be(this.formatOptionText(n.label,n),Oa(n),this.value==Oa(n));s.prepend(Te(this,"select-indicator")),((i=n.kind)!=null?i:"subs")==="captions"&&s.append(Te(this,"captions-indicator")),e.append(s)}};xr=new WeakSet;Jo=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(o.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new l.CustomEvent(f.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let a=new l.CustomEvent(f.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};var Kd=(i,e)=>{let t=i.getAttribute(e);return t?Ri(t):[]},Yd=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=yt(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-listbox")||l.customElements.define("media-captions-listbox",Or);var Nr=class extends be{init(){let e=c.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-captions-selectmenu")||l.customElements.define("media-captions-selectmenu",Nr);var qd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ur=(i,e,t)=>(qd(i,e,"read from private field"),t?t.call(i):e.get(i)),es=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Qi=(i,e,t)=>(qd(i,e,"access private method"),t),fi,zi,Pr,Br,is,ts={RATES:"rates"},Vr=class extends pe{constructor(){super(),es(this,zi),es(this,Br),es(this,fi,new rt(this,ts.RATES,{defaultValue:vo})),Qi(this,zi,Pr).call(this)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_PLAYBACK_RATE,ts.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===ts.RATES&&t!=a&&(Ur(this,fi).value=a,Qi(this,zi,Pr).call(this))}get rates(){return Ur(this,fi)}set rates(e){e?Array.isArray(e)&&(Ur(this,fi).value=e.join(" ")):Ur(this,fi).value="",Qi(this,zi,Pr).call(this)}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,ai)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Qi(this,Br,is))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Qi(this,Br,is))}};fi=new WeakMap;zi=new WeakSet;Pr=function(){let i=this.shadowRoot.querySelector("#container");i.textContent="";for(let e of this.rates){let t=Be(this.formatOptionText(`${e}x`,e),e,this.mediaPlaybackRate==e);t.prepend(Te(this,"select-indicator")),i.append(t)}};Br=new WeakSet;is=function(){if(!this.value)return;let i=new l.CustomEvent(f.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-playback-rate-listbox")||l.customElements.define("media-playback-rate-listbox",Vr);var Hr=class extends be{init(){let e=c.createElement("media-playback-rate-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-playback-rate-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-playback-rate-selectmenu")||l.customElements.define("media-playback-rate-selectmenu",Hr);var os=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qd=(i,e,t)=>(os(i,e,"read from private field"),t?t.call(i):e.get(i)),$r=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},as=(i,e,t,a)=>(os(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Wr=(i,e,t)=>(os(i,e,"access private method"),t),Xi,Yr,Fr,rs,Kr,ns,Gr=class extends pe{constructor(){super(...arguments),$r(this,Fr),$r(this,Kr),$r(this,Xi,[]),$r(this,Yr,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_LIST,o.MEDIA_RENDITION_SELECTED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===o.MEDIA_RENDITION_LIST&&t!==a&&(as(this,Xi,js(a)),Wr(this,Fr,rs).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Wr(this,Kr,ns))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Wr(this,Kr,ns))}get mediaRenditionList(){return Qd(this,Xi)}set mediaRenditionList(e){as(this,Xi,e),Wr(this,Fr,rs).call(this)}get mediaRenditionSelected(){return x(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){R(this,o.MEDIA_RENDITION_SELECTED,e)}};Xi=new WeakMap;Yr=new WeakMap;Fr=new WeakSet;rs=function(){if(Qd(this,Yr)===JSON.stringify(this.mediaRenditionList))return;as(this,Yr,JSON.stringify(this.mediaRenditionList));let i=this.mediaRenditionList.sort((r,n)=>n.height-r.height),e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.mediaRenditionSelected;for(let r of i){let n=this.formatOptionText(`${Math.min(r.width,r.height)}p`,r),s=Be(n,`${r.id}`,r.selected&&!t);s.prepend(Te(this,"select-indicator")),e.append(s)}let a=Be(this.formatOptionText("Auto"),"auto",t);a.prepend(Te(this,"select-indicator")),e.append(a)};Kr=new WeakSet;ns=function(){if(this.value==null)return;let i=new l.CustomEvent(f.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-rendition-listbox")||l.customElements.define("media-rendition-listbox",Gr);var Im=`<svg aria-hidden="true" viewBox="0 0 24 24">
1029
+ `;var Or=class extends pe{constructor(){super({slotTemplate:Zd}),Qo(this,Xo),Qo(this,xr),Qo(this,Dr,void 0)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_LIST&&t!==a?zo(this,Xo,Gd).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&t!==a?this.value=a:e==="aria-multiselectable"&&(this.removeAttribute("aria-multiselectable"),console.warn("Captions List doesn't currently support multiple selections. You can enable multiple items via the media.textTracks API."))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",zo(this,xr,Jo))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",zo(this,xr,Jo))}get mediaSubtitlesList(){return Kd(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Yd(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Kd(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Yd(this,o.MEDIA_SUBTITLES_SHOWING,e)}};Dr=new WeakMap;Xo=new WeakSet;Gd=function(){var i;if(_m(this,Dr)===JSON.stringify(this.mediaSubtitlesList))return;ym(this,Dr,JSON.stringify(this.mediaSubtitlesList));let e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.value,a=Be(this.formatOptionText("Off"),"off",t);a.prepend(Te(this,"select-indicator")),e.append(a);let r=this.mediaSubtitlesList;for(let n of r){let s=Be(this.formatOptionText(n.label,n),Oa(n),this.value==Oa(n));s.prepend(Te(this,"select-indicator")),((i=n.kind)!=null?i:"subs")==="captions"&&s.append(Te(this,"captions-indicator")),e.append(s)}};xr=new WeakSet;Jo=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(o.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new l.CustomEvent(f.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let a=new l.CustomEvent(f.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};var Kd=(i,e)=>{let t=i.getAttribute(e);return t?wi(t):[]},Yd=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=It(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-listbox")||l.customElements.define("media-captions-listbox",Or);var Nr=class extends be{init(){let e=c.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-captions-selectmenu")||l.customElements.define("media-captions-selectmenu",Nr);var qd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ur=(i,e,t)=>(qd(i,e,"read from private field"),t?t.call(i):e.get(i)),es=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Qi=(i,e,t)=>(qd(i,e,"access private method"),t),vi,zi,Pr,Br,is,ts={RATES:"rates"},Vr=class extends pe{constructor(){super(),es(this,zi),es(this,Br),es(this,vi,new nt(this,ts.RATES,{defaultValue:vo})),Qi(this,zi,Pr).call(this)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_PLAYBACK_RATE,ts.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===ts.RATES&&t!=a&&(Ur(this,vi).value=a,Qi(this,zi,Pr).call(this))}get rates(){return Ur(this,vi)}set rates(e){e?Array.isArray(e)&&(Ur(this,vi).value=e.join(" ")):Ur(this,vi).value="",Qi(this,zi,Pr).call(this)}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,ri)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Qi(this,Br,is))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Qi(this,Br,is))}};vi=new WeakMap;zi=new WeakSet;Pr=function(){let i=this.shadowRoot.querySelector("#container");i.textContent="";for(let e of this.rates){let t=Be(this.formatOptionText(`${e}x`,e),e,this.mediaPlaybackRate==e);t.prepend(Te(this,"select-indicator")),i.append(t)}};Br=new WeakSet;is=function(){if(!this.value)return;let i=new l.CustomEvent(f.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-playback-rate-listbox")||l.customElements.define("media-playback-rate-listbox",Vr);var Hr=class extends be{init(){let e=c.createElement("media-playback-rate-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-playback-rate-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-playback-rate-selectmenu")||l.customElements.define("media-playback-rate-selectmenu",Hr);var os=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qd=(i,e,t)=>(os(i,e,"read from private field"),t?t.call(i):e.get(i)),$r=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},as=(i,e,t,a)=>(os(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Wr=(i,e,t)=>(os(i,e,"access private method"),t),Xi,Yr,Fr,rs,Kr,ns,Gr=class extends pe{constructor(){super(...arguments),$r(this,Fr),$r(this,Kr),$r(this,Xi,[]),$r(this,Yr,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_LIST,o.MEDIA_RENDITION_SELECTED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===o.MEDIA_RENDITION_LIST&&t!==a&&(as(this,Xi,js(a)),Wr(this,Fr,rs).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Wr(this,Kr,ns))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Wr(this,Kr,ns))}get mediaRenditionList(){return Qd(this,Xi)}set mediaRenditionList(e){as(this,Xi,e),Wr(this,Fr,rs).call(this)}get mediaRenditionSelected(){return x(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){R(this,o.MEDIA_RENDITION_SELECTED,e)}};Xi=new WeakMap;Yr=new WeakMap;Fr=new WeakSet;rs=function(){if(Qd(this,Yr)===JSON.stringify(this.mediaRenditionList))return;as(this,Yr,JSON.stringify(this.mediaRenditionList));let i=this.mediaRenditionList.sort((r,n)=>n.height-r.height),e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.mediaRenditionSelected;for(let r of i){let n=this.formatOptionText(`${Math.min(r.width,r.height)}p`,r),s=Be(n,`${r.id}`,r.selected&&!t);s.prepend(Te(this,"select-indicator")),e.append(s)}let a=Be(this.formatOptionText("Auto"),"auto",t);a.prepend(Te(this,"select-indicator")),e.append(a)};Kr=new WeakSet;ns=function(){if(this.value==null)return;let i=new l.CustomEvent(f.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-rendition-listbox")||l.customElements.define("media-rendition-listbox",Gr);var Im=`<svg aria-hidden="true" viewBox="0 0 24 24">
1026
1030
  <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" />
1027
1031
  </svg>`,zd=c.createElement("template");zd.innerHTML=`
1028
1032
  <slot name="icon">${Im}</slot>
@@ -1031,8 +1035,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
1031
1035
  <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"/>
1032
1036
  </svg>`,Jd=c.createElement("template");Jd.innerHTML=`
1033
1037
  <slot name="icon">${km}</slot>
1034
- `;var ms=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Jd})}get mediaAudioTrackEnabled(){return x(this,o.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){R(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-button")||l.customElements.define("media-audio-track-button",ms);var en=class extends be{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}init(){let e=c.createElement("media-audio-track-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-audio-track-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-audio-track-selectmenu")||l.customElements.define("media-audio-track-selectmenu",en);var g=qu(require("@mux/mux-video")),P=require("@mux/playback-core");var lu=require("@mux/mux-video");var Sm="en",Rt={code:Sm};var jd="en";function y(i,e=!0){var r,n;let t=e&&(n=(r=Rt)==null?void 0:r[i])!=null?n:i,a=e?Rt.code:jd;return new hs(t,a)}var hs=class{constructor(e,t=(a=>(a=Rt.code)!=null?a:jd)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function eu(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${tn(t)}: ${a}; `)}),e?e.trim():void 0}function tn(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function an(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function $e(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function ps(i){let e=Cm(i).toString();return e?"?"+e:""}function Cm(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function dt(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var bs=(i,e)=>!i||!e?!1:i.contains(e)?!0:bs(i,e.getRootNode().host);var rn=require("@mux/playback-core");var tu="mux.com",Mm=()=>{try{return"2.3.1"}catch{}return"UNKNOWN"},Lm=Mm(),on=()=>Lm,iu=(i,{token:e,customDomain:t=tu,thumbnailTime:a}={})=>{let r=e==null?a:void 0,{aud:n}=dt(e);if(!(e&&n!=="t"))return`https://image.${t}/${i}/thumbnail.webp${ps({token:e,time:r})}`},au=(i,{token:e,customDomain:t=tu}={})=>{let{aud:a}=dt(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${ps({token:e,format:"webp"})}`},ji=i=>{if(i){if([rn.StreamTypes.LIVE,rn.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return rn.StreamTypes.LIVE}};var Rm={crossorigin:"crossOrigin",playsinline:"playsInline"};function ru(i){var e;return(e=Rm[i])!=null?e:an(i)}var wt,xt,J,nn=class{constructor(e,t){W(this,wt,void 0);W(this,xt,void 0);W(this,J,[]);ce(this,wt,e),ce(this,xt,t)}[Symbol.iterator](){return S(this,J).values()}get length(){return S(this,J).length}get value(){var e;return(e=S(this,J).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(ce(this,J,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return S(this,J)[e]}values(){return S(this,J).values()}keys(){return S(this,J).keys()}forEach(e){S(this,J).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||S(this,J).push(r)}),!(this.value===""&&!((t=S(this,wt))!=null&&t.hasAttribute(`${S(this,xt)}`)))&&((a=S(this,wt))==null||a.setAttribute(`${S(this,xt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{S(this,J).splice(S(this,J).indexOf(a),1)}),(t=S(this,wt))==null||t.setAttribute(`${S(this,xt)}`,`${this.value}`)}contains(e){return S(this,J).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};wt=new WeakMap,xt=new WeakMap,J=new WeakMap;var nu=`[mux-player ${on()}]`;function ut(...i){console.warn(nu,...i)}function Ee(...i){console.error(nu,...i)}function Es(i){var t;let e=(t=i.message)!=null?t:"";if(i.context&&(e+=` ${i.context}`),i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${y("Read more: ")}
1035
- ${a}${i.file}`}ut(e)}var z={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Dt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},su=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),wm=lu.VideoEvents.filter(i=>i!=="error"),xm=Object.values(z).filter(i=>![z.PLAYSINLINE].includes(i)),Dm=Object.values(Dt);function du(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),wm.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var fs=class extends U.HTMLElement{static get observedAttributes(){return[...xm,...Dm]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var d,u;let s=(d=this.media)==null?void 0:d.querySelector(`track[src="${n.src}"]`);s&&((u=this.media)==null||u.removeChild(s))}),r.addedNodes.forEach(n=>{var s;(s=this.media)==null||s.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case Dt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Dt.VOLUME:{let s=(r=$e(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Dt.PLAYBACKRATE:{let s=(n=$e(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:su}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:su}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=$e(this.getAttribute(Dt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Dt.PLAYBACKRATE,`${e}`):this.removeAttribute(Dt.PLAYBACKRATE)}get crossOrigin(){return ea(this,z.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(z.CROSSORIGIN,`${e}`)}get autoplay(){return ea(this,z.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(z.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(z.AUTOPLAY)}get loop(){return ea(this,z.LOOP)!=null}set loop(e){e?this.setAttribute(z.LOOP,""):this.removeAttribute(z.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return ea(this,z.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(z.MUTED,""):this.removeAttribute(z.MUTED)}get playsInline(){return ea(this,z.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(z.PRELOAD,e):this.removeAttribute(z.PRELOAD)}};function ea(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var vs=fs;var Om=Object.defineProperty,Nm=(i,e,t)=>e in i?Om(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Um=(i,e,t)=>(Nm(i,typeof e!="symbol"?e+"":e,t),t),pu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(pu(i,e,"read from private field"),t?t.call(i):e.get(i)),We=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ze=(i,e,t,a)=>(pu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),vi,sn,Ot,ta,ct,mt,ht,Nt,gi,ln,ke,uu=1,cu=0,Pm=1,Bm={processCallback(i,e,t){if(t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof j&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof j?r.element[r.attributeName]=n:r.value=n}}}},qe=class extends l.DocumentFragment{constructor(e,t,a=Bm){var r;super(),We(this,vi,void 0),We(this,sn,void 0),this.append(e.content.cloneNode(!0)),Ze(this,vi,bu(this)),Ze(this,sn,a),(r=a.createCallback)==null||r.call(a,this,_(this,vi),t),a.processCallback(this,_(this,vi),t)}update(e){_(this,sn).processCallback(this,_(this,vi),e)}};vi=new WeakMap;sn=new WeakMap;var bu=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new gs;for([t,a]of hu(r.value))if(!t)n.append(a);else{let s=new j(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===uu&&!(r instanceof HTMLTemplateElement))bu(r,e);else if(r.nodeType===uu||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of hu(r.data))if(!t)n.push(new Text(a));else{let s=new Qe(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new ia(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},mu={},hu=i=>{let e="",t=0,a=mu[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([cu,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Pm,e.trim()]),e="",r++):e+=n||"";return e&&a.push([cu,(t>0?"{{":"")+e]),mu[i]=a},Vm=11,dn=class{get value(){return""}set value(e){}toString(){return this.value}},Eu=new WeakMap,gs=class{constructor(){We(this,Ot,[])}[Symbol.iterator](){return _(this,Ot).values()}get length(){return _(this,Ot).length}item(e){return _(this,Ot)[e]}append(...e){for(let t of e)t instanceof j&&Eu.set(t,this),_(this,Ot).push(t)}toString(){return _(this,Ot).join("")}};Ot=new WeakMap;var j=class extends dn{constructor(e,t,a){super(),We(this,Nt),We(this,ta,""),We(this,ct,void 0),We(this,mt,void 0),We(this,ht,void 0),Ze(this,ct,e),Ze(this,mt,t),Ze(this,ht,a)}get attributeName(){return _(this,mt)}get attributeNamespace(){return _(this,ht)}get element(){return _(this,ct)}get value(){return _(this,ta)}set value(e){_(this,ta)!==e&&(Ze(this,ta,e),!_(this,Nt,gi)||_(this,Nt,gi).length===1?e==null?_(this,ct).removeAttributeNS(_(this,ht),_(this,mt)):_(this,ct).setAttributeNS(_(this,ht),_(this,mt),e):_(this,ct).setAttributeNS(_(this,ht),_(this,mt),_(this,Nt,gi)))}get booleanValue(){return _(this,ct).hasAttributeNS(_(this,ht),_(this,mt))}set booleanValue(e){if(!_(this,Nt,gi)||_(this,Nt,gi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};ta=new WeakMap;ct=new WeakMap;mt=new WeakMap;ht=new WeakMap;Nt=new WeakSet;gi=function(){return Eu.get(this)};var Qe=class extends dn{constructor(e,t){super(),We(this,ln,void 0),We(this,ke,void 0),Ze(this,ln,e),Ze(this,ke,t?[...t]:[new Text])}get replacementNodes(){return _(this,ke)}get parentNode(){return _(this,ln)}get nextSibling(){return _(this,ke)[_(this,ke).length-1].nextSibling}get previousSibling(){return _(this,ke)[0].previousSibling}get value(){return _(this,ke).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===Vm?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Ze(this,ke,Hm(_(this,ke)[0].parentNode,_(this,ke),t,this.nextSibling))}};ln=new WeakMap;ke=new WeakMap;var ia=class extends Qe{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),Um(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Hm(i,e,t,a=null){let r=0,n,s,d,u=t.length,h=e.length;for(;r<u&&r<h&&e[r]==t[r];)r++;for(;r<u&&r<h&&t[u-1]==e[h-1];)a=t[--h,--u];if(r==h)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<h;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)d=t[r++],s=n?n.nextSibling:a,n==d?n=s:r<u&&t[r]==s?(i.replaceChild(d,n),n=s):i.insertBefore(d,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var fu={string:i=>String(i)},cn=class{constructor(e){this.template=e,this.state=void 0}},Ut=new WeakMap,Pt=new WeakMap,As={partial:(i,e)=>{e[i.expression]=new cn(i.template)},if:(i,e)=>{var t;if(gu(i.expression,e))if(Ut.get(i)!==i.template){Ut.set(i,i.template);let a=new qe(i.template,e,mn);i.replace(a),Pt.set(i,a)}else(t=Pt.get(i))==null||t.update(e);else i.replace(""),Ut.delete(i),Pt.delete(i)}},$m=Object.keys(As),mn={processCallback(i,e,t){var a,r;if(t)for(let[n,s]of e){if(s instanceof ia){if(!s.directive){let u=$m.find(h=>s.template.hasAttribute(h));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=As[s.directive])==null||a.call(As,s,t);continue}let d=gu(n,t);if(d instanceof cn){Ut.get(s)!==d.template?(Ut.set(s,d.template),d=new qe(d.template,d.state,mn),s.value=d,Pt.set(s,d)):(r=Pt.get(s))==null||r.update(d.state);continue}d?(s instanceof j&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof j?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,Ut.delete(s),Pt.delete(s))):s instanceof j?s.value=void 0:(s.value=void 0,Ut.delete(s),Pt.delete(s))}}},vu={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=fu[e])==null?void 0:t.call(fu,i)}};function Wm(i){return Fm(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function gu(i,e={}){var t,a,r,n,s,d,u;let h=Wm(i);if(h.length===0||h.some(({type:m})=>!m))return aa(i);if(((t=h[0])==null?void 0:t.token)===">"){let m=e[(a=h[1])==null?void 0:a.token];if(!m)return aa(i);let b={...e};m.state=b;let E=h.slice(2);for(let I=0;I<E.length;I+=3){let H=(r=E[I])==null?void 0:r.token,k=(n=E[I+1])==null?void 0:n.token,$=(s=E[I+2])==null?void 0:s.token;H&&k==="="&&(b[H]=ra($,e))}return m}if(h.length===1)return un(h[0])?ra(h[0].token,e):aa(i);if(h.length===2){let m=(d=h[0])==null?void 0:d.token,b=vu[m];if(!b||!un(h[1]))return aa(i);let E=ra(h[1].token,e);return b(E)}if(h.length===3){let m=(u=h[1])==null?void 0:u.token,b=vu[m];if(!b||!un(h[0])||!un(h[2]))return aa(i);let E=ra(h[0].token,e);if(m==="|")return b(E,h[2].token);let I=ra(h[2].token,e);return b(E,I)}}function aa(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function un({type:i}){return["number","boolean","string","param"].includes(i)}function ra(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):va(i)?parseFloat(i):e[i]}function Fm(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var Km=Object.defineProperty,Ym=(i,e,t)=>e in i?Km(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,oa=(i,e,t)=>(Ym(i,typeof e!="symbol"?e+"":e,t),t),Ss=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ts=(i,e,t)=>(Ss(i,e,"read from private field"),t?t.call(i):e.get(i)),na=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Bt=(i,e,t,a)=>(Ss(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_s=(i,e,t)=>(Ss(i,e,"access private method"),t),Ai,hn,_i,Is,Au,pn,ks,ys={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},_u=c.createElement("template");_u.innerHTML=`
1038
+ `;var ms=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Jd})}get mediaAudioTrackEnabled(){return x(this,o.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){R(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-button")||l.customElements.define("media-audio-track-button",ms);var en=class extends be{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}init(){let e=c.createElement("media-audio-track-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-audio-track-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-audio-track-selectmenu")||l.customElements.define("media-audio-track-selectmenu",en);var g=qu(require("@mux/mux-video")),P=require("@mux/playback-core");var lu=require("@mux/mux-video");var Sm="en",xt={code:Sm};var jd="en";function y(i,e=!0){var r,n;let t=e&&(n=(r=xt)==null?void 0:r[i])!=null?n:i,a=e?xt.code:jd;return new hs(t,a)}var hs=class{constructor(e,t=(a=>(a=xt.code)!=null?a:jd)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function eu(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${tn(t)}: ${a}; `)}),e?e.trim():void 0}function tn(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function an(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function $e(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function ps(i){let e=Cm(i).toString();return e?"?"+e:""}function Cm(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function ut(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var bs=(i,e)=>!i||!e?!1:i.contains(e)?!0:bs(i,e.getRootNode().host);var rn=require("@mux/playback-core");var tu="mux.com",Mm=()=>{try{return"2.3.2"}catch{}return"UNKNOWN"},Lm=Mm(),on=()=>Lm,iu=(i,{token:e,customDomain:t=tu,thumbnailTime:a}={})=>{let r=e==null?a:void 0,{aud:n}=ut(e);if(!(e&&n!=="t"))return`https://image.${t}/${i}/thumbnail.webp${ps({token:e,time:r})}`},au=(i,{token:e,customDomain:t=tu}={})=>{let{aud:a}=ut(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${ps({token:e,format:"webp"})}`},ji=i=>{if(i){if([rn.StreamTypes.LIVE,rn.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return rn.StreamTypes.LIVE}};var Rm={crossorigin:"crossOrigin",playsinline:"playsInline"};function ru(i){var e;return(e=Rm[i])!=null?e:an(i)}var Dt,Ot,J,nn=class{constructor(e,t){W(this,Dt,void 0);W(this,Ot,void 0);W(this,J,[]);ce(this,Dt,e),ce(this,Ot,t)}[Symbol.iterator](){return S(this,J).values()}get length(){return S(this,J).length}get value(){var e;return(e=S(this,J).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(ce(this,J,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return S(this,J)[e]}values(){return S(this,J).values()}keys(){return S(this,J).keys()}forEach(e){S(this,J).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||S(this,J).push(r)}),!(this.value===""&&!((t=S(this,Dt))!=null&&t.hasAttribute(`${S(this,Ot)}`)))&&((a=S(this,Dt))==null||a.setAttribute(`${S(this,Ot)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{S(this,J).splice(S(this,J).indexOf(a),1)}),(t=S(this,Dt))==null||t.setAttribute(`${S(this,Ot)}`,`${this.value}`)}contains(e){return S(this,J).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};Dt=new WeakMap,Ot=new WeakMap,J=new WeakMap;var nu=`[mux-player ${on()}]`;function ct(...i){console.warn(nu,...i)}function Ee(...i){console.error(nu,...i)}function Es(i){var t;let e=(t=i.message)!=null?t:"";if(i.context&&(e+=` ${i.context}`),i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${y("Read more: ")}
1039
+ ${a}${i.file}`}ct(e)}var z={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Nt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},su=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),wm=lu.VideoEvents.filter(i=>i!=="error"),xm=Object.values(z).filter(i=>![z.PLAYSINLINE].includes(i)),Dm=Object.values(Nt);function du(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),wm.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var fs=class extends U.HTMLElement{static get observedAttributes(){return[...xm,...Dm]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var d,u;let s=(d=this.media)==null?void 0:d.querySelector(`track[src="${n.src}"]`);s&&((u=this.media)==null||u.removeChild(s))}),r.addedNodes.forEach(n=>{var s;(s=this.media)==null||s.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case Nt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Nt.VOLUME:{let s=(r=$e(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Nt.PLAYBACKRATE:{let s=(n=$e(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:su}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:su}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=$e(this.getAttribute(Nt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Nt.PLAYBACKRATE,`${e}`):this.removeAttribute(Nt.PLAYBACKRATE)}get crossOrigin(){return ea(this,z.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(z.CROSSORIGIN,`${e}`)}get autoplay(){return ea(this,z.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(z.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(z.AUTOPLAY)}get loop(){return ea(this,z.LOOP)!=null}set loop(e){e?this.setAttribute(z.LOOP,""):this.removeAttribute(z.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return ea(this,z.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(z.MUTED,""):this.removeAttribute(z.MUTED)}get playsInline(){return ea(this,z.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(z.PRELOAD,e):this.removeAttribute(z.PRELOAD)}};function ea(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var vs=fs;var Om=Object.defineProperty,Nm=(i,e,t)=>e in i?Om(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Um=(i,e,t)=>(Nm(i,typeof e!="symbol"?e+"":e,t),t),pu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(pu(i,e,"read from private field"),t?t.call(i):e.get(i)),We=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ze=(i,e,t,a)=>(pu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),gi,sn,Ut,ta,mt,ht,pt,Pt,Ai,ln,ke,uu=1,cu=0,Pm=1,Bm={processCallback(i,e,t){if(t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof j&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof j?r.element[r.attributeName]=n:r.value=n}}}},qe=class extends l.DocumentFragment{constructor(e,t,a=Bm){var r;super(),We(this,gi,void 0),We(this,sn,void 0),this.append(e.content.cloneNode(!0)),Ze(this,gi,bu(this)),Ze(this,sn,a),(r=a.createCallback)==null||r.call(a,this,_(this,gi),t),a.processCallback(this,_(this,gi),t)}update(e){_(this,sn).processCallback(this,_(this,gi),e)}};gi=new WeakMap;sn=new WeakMap;var bu=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new gs;for([t,a]of hu(r.value))if(!t)n.append(a);else{let s=new j(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===uu&&!(r instanceof HTMLTemplateElement))bu(r,e);else if(r.nodeType===uu||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of hu(r.data))if(!t)n.push(new Text(a));else{let s=new Qe(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new ia(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},mu={},hu=i=>{let e="",t=0,a=mu[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([cu,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Pm,e.trim()]),e="",r++):e+=n||"";return e&&a.push([cu,(t>0?"{{":"")+e]),mu[i]=a},Vm=11,dn=class{get value(){return""}set value(e){}toString(){return this.value}},Eu=new WeakMap,gs=class{constructor(){We(this,Ut,[])}[Symbol.iterator](){return _(this,Ut).values()}get length(){return _(this,Ut).length}item(e){return _(this,Ut)[e]}append(...e){for(let t of e)t instanceof j&&Eu.set(t,this),_(this,Ut).push(t)}toString(){return _(this,Ut).join("")}};Ut=new WeakMap;var j=class extends dn{constructor(e,t,a){super(),We(this,Pt),We(this,ta,""),We(this,mt,void 0),We(this,ht,void 0),We(this,pt,void 0),Ze(this,mt,e),Ze(this,ht,t),Ze(this,pt,a)}get attributeName(){return _(this,ht)}get attributeNamespace(){return _(this,pt)}get element(){return _(this,mt)}get value(){return _(this,ta)}set value(e){_(this,ta)!==e&&(Ze(this,ta,e),!_(this,Pt,Ai)||_(this,Pt,Ai).length===1?e==null?_(this,mt).removeAttributeNS(_(this,pt),_(this,ht)):_(this,mt).setAttributeNS(_(this,pt),_(this,ht),e):_(this,mt).setAttributeNS(_(this,pt),_(this,ht),_(this,Pt,Ai)))}get booleanValue(){return _(this,mt).hasAttributeNS(_(this,pt),_(this,ht))}set booleanValue(e){if(!_(this,Pt,Ai)||_(this,Pt,Ai).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};ta=new WeakMap;mt=new WeakMap;ht=new WeakMap;pt=new WeakMap;Pt=new WeakSet;Ai=function(){return Eu.get(this)};var Qe=class extends dn{constructor(e,t){super(),We(this,ln,void 0),We(this,ke,void 0),Ze(this,ln,e),Ze(this,ke,t?[...t]:[new Text])}get replacementNodes(){return _(this,ke)}get parentNode(){return _(this,ln)}get nextSibling(){return _(this,ke)[_(this,ke).length-1].nextSibling}get previousSibling(){return _(this,ke)[0].previousSibling}get value(){return _(this,ke).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===Vm?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Ze(this,ke,Hm(_(this,ke)[0].parentNode,_(this,ke),t,this.nextSibling))}};ln=new WeakMap;ke=new WeakMap;var ia=class extends Qe{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),Um(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Hm(i,e,t,a=null){let r=0,n,s,d,u=t.length,h=e.length;for(;r<u&&r<h&&e[r]==t[r];)r++;for(;r<u&&r<h&&t[u-1]==e[h-1];)a=t[--h,--u];if(r==h)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<h;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)d=t[r++],s=n?n.nextSibling:a,n==d?n=s:r<u&&t[r]==s?(i.replaceChild(d,n),n=s):i.insertBefore(d,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var fu={string:i=>String(i)},cn=class{constructor(e){this.template=e,this.state=void 0}},Bt=new WeakMap,Vt=new WeakMap,As={partial:(i,e)=>{e[i.expression]=new cn(i.template)},if:(i,e)=>{var t;if(gu(i.expression,e))if(Bt.get(i)!==i.template){Bt.set(i,i.template);let a=new qe(i.template,e,mn);i.replace(a),Vt.set(i,a)}else(t=Vt.get(i))==null||t.update(e);else i.replace(""),Bt.delete(i),Vt.delete(i)}},$m=Object.keys(As),mn={processCallback(i,e,t){var a,r;if(t)for(let[n,s]of e){if(s instanceof ia){if(!s.directive){let u=$m.find(h=>s.template.hasAttribute(h));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=As[s.directive])==null||a.call(As,s,t);continue}let d=gu(n,t);if(d instanceof cn){Bt.get(s)!==d.template?(Bt.set(s,d.template),d=new qe(d.template,d.state,mn),s.value=d,Vt.set(s,d)):(r=Vt.get(s))==null||r.update(d.state);continue}d?(s instanceof j&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof j?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,Bt.delete(s),Vt.delete(s))):s instanceof j?s.value=void 0:(s.value=void 0,Bt.delete(s),Vt.delete(s))}}},vu={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=fu[e])==null?void 0:t.call(fu,i)}};function Wm(i){return Fm(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function gu(i,e={}){var t,a,r,n,s,d,u;let h=Wm(i);if(h.length===0||h.some(({type:m})=>!m))return aa(i);if(((t=h[0])==null?void 0:t.token)===">"){let m=e[(a=h[1])==null?void 0:a.token];if(!m)return aa(i);let b={...e};m.state=b;let E=h.slice(2);for(let I=0;I<E.length;I+=3){let H=(r=E[I])==null?void 0:r.token,k=(n=E[I+1])==null?void 0:n.token,$=(s=E[I+2])==null?void 0:s.token;H&&k==="="&&(b[H]=ra($,e))}return m}if(h.length===1)return un(h[0])?ra(h[0].token,e):aa(i);if(h.length===2){let m=(d=h[0])==null?void 0:d.token,b=vu[m];if(!b||!un(h[1]))return aa(i);let E=ra(h[1].token,e);return b(E)}if(h.length===3){let m=(u=h[1])==null?void 0:u.token,b=vu[m];if(!b||!un(h[0])||!un(h[2]))return aa(i);let E=ra(h[0].token,e);if(m==="|")return b(E,h[2].token);let I=ra(h[2].token,e);return b(E,I)}}function aa(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function un({type:i}){return["number","boolean","string","param"].includes(i)}function ra(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):va(i)?parseFloat(i):e[i]}function Fm(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var Km=Object.defineProperty,Ym=(i,e,t)=>e in i?Km(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,oa=(i,e,t)=>(Ym(i,typeof e!="symbol"?e+"":e,t),t),Ss=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ts=(i,e,t)=>(Ss(i,e,"read from private field"),t?t.call(i):e.get(i)),na=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ht=(i,e,t,a)=>(Ss(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_s=(i,e,t)=>(Ss(i,e,"access private method"),t),_i,hn,yi,Is,Au,pn,ks,ys={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},_u=c.createElement("template");_u.innerHTML=`
1036
1040
  <style>
1037
1041
  :host {
1038
1042
  display: inline-block;
@@ -1056,7 +1060,7 @@ ${a}${i.file}`}ut(e)}var z={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"
1056
1060
  display: none;
1057
1061
  }
1058
1062
  </style>
1059
- `;var pt=class extends l.HTMLElement{constructor(){super(),na(this,Is),na(this,pn),oa(this,"renderRoot"),oa(this,"renderer"),na(this,Ai,void 0),na(this,hn,void 0),na(this,_i,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(t=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||t.some(r=>{let n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(ys[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(Fe.BREAKPOINTS_COMPUTED,this.render),_s(this,Is,Au).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Ts(this,Ai))!=null?e:this.constructor.template}set template(e){Bt(this,_i,null),Bt(this,Ai,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:s})=>ys[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let d=(a=ys[s.name])!=null?a:il(s.name),{value:u}=s;u!=null?(va(u)&&(u=parseFloat(u)),n[d]=u===""?!0:u):n[d]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&_s(this,pn,ks).call(this)}connectedCallback(){_s(this,pn,ks).call(this)}createRenderer(){this.template&&this.template!==Ts(this,hn)&&(Bt(this,hn,this.template),this.renderer=new qe(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(_u.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Ai=new WeakMap;hn=new WeakMap;_i=new WeakMap;Is=new WeakSet;Au=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};pn=new WeakSet;ks=function(){var i;let e=this.getAttribute("template");if(!e||e===Ts(this,_i))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){Bt(this,_i,e),Bt(this,Ai,a),this.createRenderer();return}Gm(e)&&(Bt(this,_i,e),Zm(e).then(r=>{let n=c.createElement("template");n.innerHTML=r,Bt(this,Ai,n),this.createRenderer()}).catch(console.error))};oa(pt,"template");oa(pt,"observedAttributes",["template"]);oa(pt,"processor",mn);function Gm(i){if(!/^(\/|\.\/|https?:\/\/)/.test(i))return!1;let e=/^https?:\/\//.test(i)?void 0:location.origin;try{new URL(i,e)}catch{return!1}return!0}async function Zm(i){let e=await fetch(i);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}l.customElements.get("media-theme")||l.customElements.define("media-theme",pt);var yu=`:host {
1063
+ `;var bt=class extends l.HTMLElement{constructor(){super(),na(this,Is),na(this,pn),oa(this,"renderRoot"),oa(this,"renderer"),na(this,_i,void 0),na(this,hn,void 0),na(this,yi,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(t=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||t.some(r=>{let n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(ys[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(Fe.BREAKPOINTS_COMPUTED,this.render),_s(this,Is,Au).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Ts(this,_i))!=null?e:this.constructor.template}set template(e){Ht(this,yi,null),Ht(this,_i,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:s})=>ys[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let d=(a=ys[s.name])!=null?a:il(s.name),{value:u}=s;u!=null?(va(u)&&(u=parseFloat(u)),n[d]=u===""?!0:u):n[d]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&_s(this,pn,ks).call(this)}connectedCallback(){_s(this,pn,ks).call(this)}createRenderer(){this.template&&this.template!==Ts(this,hn)&&(Ht(this,hn,this.template),this.renderer=new qe(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(_u.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};_i=new WeakMap;hn=new WeakMap;yi=new WeakMap;Is=new WeakSet;Au=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};pn=new WeakSet;ks=function(){var i;let e=this.getAttribute("template");if(!e||e===Ts(this,yi))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){Ht(this,yi,e),Ht(this,_i,a),this.createRenderer();return}Gm(e)&&(Ht(this,yi,e),Zm(e).then(r=>{let n=c.createElement("template");n.innerHTML=r,Ht(this,_i,n),this.createRenderer()}).catch(console.error))};oa(bt,"template");oa(bt,"observedAttributes",["template"]);oa(bt,"processor",mn);function Gm(i){if(!/^(\/|\.\/|https?:\/\/)/.test(i))return!1;let e=/^https?:\/\//.test(i)?void 0:location.origin;try{new URL(i,e)}catch{return!1}return!0}async function Zm(i){let e=await fetch(i);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}l.customElements.get("media-theme")||l.customElements.define("media-theme",bt);var yu=`:host {
1060
1064
  --media-control-display: var(--controls);
1061
1065
  --media-loading-indicator-display: var(--loading-indicator);
1062
1066
  --media-dialog-display: var(--dialog);
@@ -1263,7 +1267,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1263
1267
  <div class="dialog">
1264
1268
  <slot></slot>
1265
1269
  </div>
1266
- `;var bt=class extends U.HTMLElement{constructor(){var t;super();this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),Tu(this)}close(){this.hasAttribute("open")&&(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Qm(this))}attributeChangedCallback(t,a,r){t==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&Tu(this)}};bt.styles=Iu,bt.template=ku,bt.observedAttributes=["open"];function Tu(i){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(i.dispatchEvent(e),e.defaultPrevented)return;let t=i.querySelector("[autofocus]:not([disabled])");!t&&i.tabIndex>=0&&(t=i),t||(t=Su(i.shadowRoot)),i._previouslyFocusedElement=ne.activeElement,ne.activeElement instanceof HTMLElement&&ne.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function Su(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=Su(r[n].shadowRoot),a));n++);}return a}function Qm(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}U.customElements.get("media-dialog")||(U.customElements.define("media-dialog",bt),U.MediaDialog=bt);var Cs=bt;var Cu=ne.createElement("template");Cu.innerHTML=`
1270
+ `;var Et=class extends U.HTMLElement{constructor(){var t;super();this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),Tu(this)}close(){this.hasAttribute("open")&&(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Qm(this))}attributeChangedCallback(t,a,r){t==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&Tu(this)}};Et.styles=Iu,Et.template=ku,Et.observedAttributes=["open"];function Tu(i){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(i.dispatchEvent(e),e.defaultPrevented)return;let t=i.querySelector("[autofocus]:not([disabled])");!t&&i.tabIndex>=0&&(t=i),t||(t=Su(i.shadowRoot)),i._previouslyFocusedElement=ne.activeElement,ne.activeElement instanceof HTMLElement&&ne.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function Su(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=Su(r[n].shadowRoot),a));n++);}return a}function Qm(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}U.customElements.get("media-dialog")||(U.customElements.define("media-dialog",Et),U.MediaDialog=Et);var Cs=Et;var Cu=ne.createElement("template");Cu.innerHTML=`
1267
1271
  <style>
1268
1272
  ${Cs.styles}
1269
1273
 
@@ -1299,7 +1303,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1299
1303
  ${yu}
1300
1304
  </style>
1301
1305
  ${lh(i)}
1302
- `,nh=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return ji(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},oh={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",SELECTMENU:"selectmenu",LISTBOX:"listbox",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"},sh=Object.values(oh).join(", "),lh=i=>{var e,t,a,r,n,s,d,u,h,m,b,E,I,H,k,$,Z,ee,je,Ti,Wt,Ds,Os,Ns,Us,Ps,Bs,Vs,Hs,$s,Ws,Fs,Ks,Ys,Gs;return ze`
1306
+ `,nh=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return ji(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},oh={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",SELECTMENU:"selectmenu",LISTBOX:"listbox",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"},sh=Object.values(oh).join(", "),lh=i=>{var e,t,a,r,n,s,d,u,h,m,b,E,I,H,k,$,Z,ee,je,Ii,Kt,Ds,Os,Ns,Us,Ps,Bs,Vs,Hs,$s,Ws,Fs,Ks,Ys,Gs;return ze`
1303
1307
  <media-theme
1304
1308
  template="${i.themeTemplate||!1}"
1305
1309
  defaultstreamtype="${(e=i.defaultStreamType)!=null?e:!1}"
@@ -1331,8 +1335,8 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1331
1335
  loop="${(Z=i.loop)!=null?Z:!1}"
1332
1336
  preload="${(ee=i.preload)!=null?ee:!1}"
1333
1337
  debug="${(je=i.debug)!=null?je:!1}"
1334
- prefer-cmcd="${(Ti=i.preferCmcd)!=null?Ti:!1}"
1335
- disable-cookies="${(Wt=i.disableCookies)!=null?Wt:!1}"
1338
+ prefer-cmcd="${(Ii=i.preferCmcd)!=null?Ii:!1}"
1339
+ disable-cookies="${(Kt=i.disableCookies)!=null?Kt:!1}"
1336
1340
  prefer-playback="${(Ds=i.preferPlayback)!=null?Ds:!1}"
1337
1341
  start-time="${i.startTime!=null?i.startTime:!1}"
1338
1342
  beacon-collection-domain="${(Os=i.beaconCollectionDomain)!=null?Os:!1}"
@@ -1373,7 +1377,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1373
1377
  </p>
1374
1378
  </mxp-dialog>
1375
1379
  </media-theme>
1376
- `};var ua=require("@mux/mux-video");function En(i,e,t,a,r){var d,u,h;let n={},s={};switch(i.code){case ua.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=y("Network Error",r),n.message=i.message,(d=i.data)==null?void 0:d.response.code){case 412:{n.title=y("Video is not currently available",r),n.message=y("The live stream or video file are not yet ready.",r),s.message=y("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),s.file="412-not-playable.md";break}case 404:{n.title=y("Video does not exist",r),n.message="",s.message=y("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),s.file="404-not-found.md";break}case 403:{if(n.title=y("Invalid playback URL",r),n.message=y("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=y("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),s.file="missing-signed-tokens.md",!a)break;let{exp:m,aud:b,sub:E}=dt(a),I=Date.now()>m*1e3,H=E!==t,k=b!=="v",$={timeStyle:"medium",dateStyle:"medium"};if(I){n.title=y("Video URL has expired",r),n.message=y("The video\u2019s secured playback-token has expired.",r),s.message=y("The video\u2019s secured playback-token has expired.",r),s.context=y("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(Rt.code,$).format(m*1e3),currentDate:new Intl.DateTimeFormat(Rt.code,$).format(Date.now())}),s.file="403-expired-token.md";break}if(H){n.title=y("Video URL is formatted incorrectly",r),n.message=y("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=y("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.context=y("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:t,tokenPlaybackId:E}),s.file="403-playback-id-mismatch.md";break}if(k){n.title=y("Video URL is formatted incorrectly",r),n.message=y("The playback-token is formatted with incorrect information.",r),s.message=y("The playback-token is formatted with incorrect information.",r),s.context=y("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:b}),s.file="403-incorrect-aud-value.md";break}s.message=y("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),s.file="403-malformatted-token.md";break}}break}case ua.MediaError.MEDIA_ERR_DECODE:{let{message:m}=i;n={title:y("Media Error",r),message:m},s.file="media-decode-error.md";break}case ua.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let m=(h=(u=i.data)==null?void 0:u.response)==null?void 0:h.code;if(m>=400&&m<500){i.code=ua.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:m}},{dialog:n,devlog:s}=En(i,e,t,a);break}n={title:y("Source Not Supported",r),message:i.message},s.file="media-src-not-supported.md";break}default:n={title:y("Error",r),message:i.message};break}return e&&(n={title:y("Your device appears to be offline",r),message:y("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var xu=`<template id="media-theme-gerwig">
1380
+ `};var ua=require("@mux/mux-video");function En(i,e,t,a,r){var d,u,h;let n={},s={};switch(i.code){case ua.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=y("Network Error",r),n.message=i.message,(d=i.data)==null?void 0:d.response.code){case 412:{n.title=y("Video is not currently available",r),n.message=y("The live stream or video file are not yet ready.",r),s.message=y("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),s.file="412-not-playable.md";break}case 404:{n.title=y("Video does not exist",r),n.message="",s.message=y("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),s.file="404-not-found.md";break}case 403:{if(n.title=y("Invalid playback URL",r),n.message=y("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=y("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),s.file="missing-signed-tokens.md",!a)break;let{exp:m,aud:b,sub:E}=ut(a),I=Date.now()>m*1e3,H=E!==t,k=b!=="v",$={timeStyle:"medium",dateStyle:"medium"};if(I){n.title=y("Video URL has expired",r),n.message=y("The video\u2019s secured playback-token has expired.",r),s.message=y("The video\u2019s secured playback-token has expired.",r),s.context=y("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(xt.code,$).format(m*1e3),currentDate:new Intl.DateTimeFormat(xt.code,$).format(Date.now())}),s.file="403-expired-token.md";break}if(H){n.title=y("Video URL is formatted incorrectly",r),n.message=y("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=y("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.context=y("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:t,tokenPlaybackId:E}),s.file="403-playback-id-mismatch.md";break}if(k){n.title=y("Video URL is formatted incorrectly",r),n.message=y("The playback-token is formatted with incorrect information.",r),s.message=y("The playback-token is formatted with incorrect information.",r),s.context=y("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:b}),s.file="403-incorrect-aud-value.md";break}s.message=y("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),s.file="403-malformatted-token.md";break}}break}case ua.MediaError.MEDIA_ERR_DECODE:{let{message:m}=i;n={title:y("Media Error",r),message:m},s.file="media-decode-error.md";break}case ua.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let m=(h=(u=i.data)==null?void 0:u.response)==null?void 0:h.code;if(m>=400&&m<500){i.code=ua.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:m}},{dialog:n,devlog:s}=En(i,e,t,a);break}n={title:y("Source Not Supported",r),message:i.message},s.file="media-src-not-supported.md";break}default:n={title:y("Error",r),message:i.message};break}return e&&(n={title:y("Your device appears to be offline",r),message:y("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var xu=`<template id="media-theme-gerwig">
1377
1381
  <style>
1378
1382
  @keyframes pre-play-hide {
1379
1383
  0% {
@@ -2367,5 +2371,5 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2367
2371
  <slot></slot>
2368
2372
  </media-controller>
2369
2373
  </template>
2370
- `;var Rs=ne.createElement("template");"innerHTML"in Rs&&(Rs.innerHTML=xu);var Du,Ou,fn=class extends pt{};fn.template=(Ou=(Du=Rs.content)==null?void 0:Du.children)==null?void 0:Ou[0];U.customElements.get("media-theme-gerwig")||U.customElements.define("media-theme-gerwig",fn);var uh="gerwig";var Xe={SRC:"src",POSTER:"poster"},p={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",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",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"},ws=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function ch(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(p.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:mh(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(p.NOHOTKEYS),hotKeys:i.getAttribute(p.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,minResolution:i.minResolution,renditionOrder:i.renditionOrder,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:ji(i.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:i.getAttribute(p.PRIMARY_COLOR),secondaryColor:i.getAttribute(p.SECONDARY_COLOR),accentColor:i.getAttribute(p.ACCENT_COLOR),forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultDuration:i.defaultDuration,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:hh(i),playbackRates:i.getAttribute(p.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(p.TITLE),novolumepref:i.hasAttribute(p.NO_VOLUME_PREF),...e,extraSourceParams:i.extraSourceParams}}function mh(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=U.customElements.get(e);if(n!=null&&n.template)return n.template}}function hh(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function Nu(i){let e=i.hasAttribute(p.TITLE)?{video_title:i.getAttribute(p.TITLE)}:{};return i.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=i.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},e)}var ph=Object.values(g.Attributes),bh=Object.values(Xe),Eh=Object.values(p),fh=on(),vh="mux-player",Uu={dialog:void 0,isDialogOpen:!1},gh={redundant_streams:!0},ma,ha,Et,pa,$t,Je,Vt,vn,Pu,ba,xs,ft,yi,gn,Bu,An,Vu,_n,Hu,yn,$u,ca=class extends vs{constructor(){super();W(this,Je);W(this,vn);W(this,ba);W(this,ft);W(this,gn);W(this,An);W(this,_n);W(this,yn);W(this,ma,!1);W(this,ha,{});W(this,Et,!0);W(this,pa,new nn(this,"hotkeys"));W(this,$t,{...Uu,onCloseErrorDialog:()=>F(this,ba,xs).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{bs(this,ne.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),F(this,vn,Pu).call(this),this.isConnected&&F(this,Je,Vt).call(this)}static get observedAttributes(){var t;return[...(t=vs.observedAttributes)!=null?t:[],...bh,...ph,...Eh]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=Nu(this))}attributeChangedCallback(t,a,r){switch(F(this,Je,Vt).call(this),super.attributeChangedCallback(t,a,r),t){case p.HOTKEYS:S(this,pa).value=r;break;case p.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&ut(y("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case p.THUMBNAIL_TOKEN:{let{aud:s}=dt(r);r&&s!=="t"&&ut(y("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case p.STORYBOARD_TOKEN:{let{aud:s}=dt(r);r&&s!=="s"&&ut(y("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&Ee(y("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:r&&![P.StreamTypes.LIVE,P.StreamTypes.ON_DEMAND,P.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Es({file:"invalid-stream-type.md",message:y("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===P.StreamTypes.LIVE?this.getAttribute(p.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[g.Attributes.PLAYBACK_ID,Xe.SRC,p.PLAYBACK_TOKEN].includes(t)&&a!==r&&ce(this,$t,{...S(this,$t),...Uu}),F(this,ft,yi).call(this,{[ru(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?P.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):ut(`Invalid value for preferCmcd. Must be one of ${P.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute(o.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute(o.MEDIA_TIME_IS_LIVE)}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(p.THEME))!=null?t:uh}set theme(t){this.setAttribute(p.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(ws.includes(r))continue;let n=t.getAttribute(r);a[an(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;F(this,Je,Vt).call(this);let a={...this.themeProps,...t};for(let s in a){if(ws.includes(s))continue;let d=t==null?void 0:t[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(tn(s),!!d):(n=this.mediaTheme)==null||n.setAttribute(tn(s),d)}}get playbackId(){var t;return(t=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(g.Attributes.PLAYBACK_ID,t):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=Ht(this,Xe.SRC))!=null?t:void 0:(a=this.getAttribute(Xe.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Xe.SRC,t):this.removeAttribute(Xe.SRC)}get poster(){var a;let t=this.getAttribute(Xe.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return iu(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Xe.POSTER,t):this.removeAttribute(Xe.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(p.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(p.STORYBOARD_SRC,t):this.removeAttribute(p.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[P.StreamTypes.LIVE,P.StreamTypes.UNKNOWN].includes(this.streamType)))return au(this.playbackId,{customDomain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(p.AUDIO)}set audio(t){if(!t){this.removeAttribute(p.AUDIO);return}this.setAttribute(p.AUDIO,"")}get hotkeys(){return S(this,pa)}get nohotkeys(){return this.hasAttribute(p.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(p.NOHOTKEYS);return}this.setAttribute(p.NOHOTKEYS,"")}get thumbnailTime(){return $e(this.getAttribute(p.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(p.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(p.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(p.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=Ht(this,p.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(p.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(p.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(p.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(p.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(p.SECONDARY_COLOR,`${t}`)}get accentColor(){var a,r;let t=this.getAttribute(p.ACCENT_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),t))return t}set accentColor(t){this.setAttribute(p.ACCENT_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(p.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(p.PLAYBACK_RATES))return this.getAttribute(p.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(p.PLAYBACK_RATES);return}this.setAttribute(p.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=$e(this.getAttribute(p.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(p.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=$e(this.getAttribute(p.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(p.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(p.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return $e(this.getAttribute(p.DEFAULT_DURATION))}set defaultDuration(t){t==null?this.removeAttribute(p.DEFAULT_DURATION):this.setAttribute(p.DEFAULT_DURATION,`${t}`)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:vh}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:fh}get beaconCollectionDomain(){var t;return(t=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(g.Attributes.MAX_RESOLUTION,t):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(g.Attributes.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(g.Attributes.MIN_RESOLUTION,t):this.removeAttribute(g.Attributes.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(g.Attributes.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(g.Attributes.RENDITION_ORDER,t):this.removeAttribute(g.Attributes.RENDITION_ORDER))}get extraSourceParams(){return this.hasAttribute(p.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(p.EXTRA_SOURCE_PARAMS)).entries()].reduce((t,[a,r])=>(t[a]=r,t),{}):gh}set extraSourceParams(t){t==null?this.removeAttribute(p.EXTRA_SOURCE_PARAMS):this.setAttribute(p.EXTRA_SOURCE_PARAMS,new URLSearchParams(t).toString())}get customDomain(){var t;return(t=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=Ht(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(p.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(p.NO_VOLUME_PREF,""):this.removeAttribute(p.NO_VOLUME_PREF)}get debug(){return Ht(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return Ht(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:P.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?r:P.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(p.DEFAULT_STREAM_TYPE,t):this.removeAttribute(p.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(p.TARGET_LIVE_WINDOW)?+this.getAttribute(p.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t==this.targetLiveWindow||Number.isNaN(t)&&Number.isNaN(this.targetLiveWindow)||(t==null?this.removeAttribute(p.TARGET_LIVE_WINDOW):this.setAttribute(p.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return $e(Ht(this,g.Attributes.START_TIME))}set startTime(t){this.setAttribute(g.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(F(this,Je,Vt).call(this),!this.media){Ee("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Nu(this),...t}}get _hlsConfig(){var t;return(t=this.media)==null?void 0:t._hlsConfig}set _hlsConfig(t){if(F(this,Je,Vt).call(this),!this.media){Ee("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=t}async addCuePoints(t){var a;if(F(this,Je,Vt).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(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(p.PLAYBACK_TOKEN),a=this.getAttribute(p.THUMBNAIL_TOKEN),r=this.getAttribute(p.STORYBOARD_TOKEN);return{...S(this,ha),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){ce(this,ha,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(p.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(p.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(p.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(p.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(p.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(p.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,P.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,P.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};ma=new WeakMap,ha=new WeakMap,Et=new WeakMap,pa=new WeakMap,$t=new WeakMap,Je=new WeakSet,Vt=function(){var t,a,r;if(!S(this,ma)){ce(this,ma,!0),F(this,ft,yi).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof U.HTMLElement))throw""}catch{Ee("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{Ee("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Qn))throw""}catch{Ee("<media-controller> failed to upgrade!")}du(this),F(this,gn,Bu).call(this),F(this,An,Vu).call(this),F(this,_n,Hu).call(this),ce(this,Et,(a=(t=this.mediaController)==null?void 0:t.hasAttribute(T.USER_INACTIVE))!=null?a:!0),F(this,yn,$u).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{F(this,ft,yi).call(this)})}},vn=new WeakSet,Pu=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.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{}},ba=new WeakSet,xs=function(t){Object.assign(S(this,$t),t),F(this,ft,yi).call(this)},ft=new WeakSet,yi=function(t={}){Ru(wu(ch(this,{...S(this,$t),...t})),this.shadowRoot)},gn=new WeakSet,Bu=function(){let t=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(ws.includes(n))return;let s=this.getAttribute(r);s!=null?(d=this.mediaTheme)==null||d.setAttribute(n,s):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},An=new WeakSet,Vu=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){ut(n),n.data&&ut(`${n.name} data:`,n.data);return}let{dialog:s,devlog:d}=En(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&Es(d),Ee(n),n.data&&Ee(`${n.name} data:`,n.data),F(this,ba,xs).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,d,u;if(!(((s=this.media)==null?void 0:s.error)instanceof g.MediaError))return r;let{devlog:n}=En((d=this.media)==null?void 0:d.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,d;let{detail:n}=r;if(!n){let{message:u,code:h}=(d=(s=this.media)==null?void 0:s.error)!=null?d:{};n=new g.MediaError(u,h)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},_n=new WeakSet,Hu=function(){var a,r,n,s;let t=()=>F(this,ft,yi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},yn=new WeakSet,$u=function(){var h,m;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===P.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(b,E,I=!1)=>{if(n())return;Array.from(b&&b.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!E||this.paused){let $=k.text.split(`
2371
- `).length,Z=-3;this.streamType===P.StreamTypes.LIVE&&(Z=-2);let ee=Z-$;if(k.line===ee&&!I)return;r.has(k)||r.set(k,k.line),k.line=ee}else setTimeout(()=>{k.line=r.get(k)||"auto"},500)})},d=()=>{var b,E;s(a,(E=(b=this.mediaController)==null?void 0:b.hasAttribute(T.USER_INACTIVE))!=null?E:!1)},u=()=>{var I,H;let E=Array.from(((H=(I=this.mediaController)==null?void 0:I.media)==null?void 0:H.textTracks)||[]).filter(k=>["subtitles","captions"].includes(k.kind)&&k.mode==="showing")[0];E!==a&&(a==null||a.removeEventListener("cuechange",d)),a=E,a==null||a.addEventListener("cuechange",d),s(a,S(this,Et))};u(),(h=this.textTracks)==null||h.addEventListener("change",u),(m=this.textTracks)==null||m.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var E,I;let b=(I=(E=this.mediaController)==null?void 0:E.hasAttribute(T.USER_INACTIVE))!=null?I:!0;S(this,Et)!==b&&(ce(this,Et,b),s(a,S(this,Et)))})};function Ht(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}U.customElements.get("mux-player")||(U.customElements.define("mux-player",ca),U.MuxPlayerElement=ca);var Ah=ca;
2374
+ `;var Rs=ne.createElement("template");"innerHTML"in Rs&&(Rs.innerHTML=xu);var Du,Ou,fn=class extends bt{};fn.template=(Ou=(Du=Rs.content)==null?void 0:Du.children)==null?void 0:Ou[0];U.customElements.get("media-theme-gerwig")||U.customElements.define("media-theme-gerwig",fn);var uh="gerwig";var Xe={SRC:"src",POSTER:"poster"},p={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",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",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"},ws=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function ch(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(p.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:mh(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(p.NOHOTKEYS),hotKeys:i.getAttribute(p.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,minResolution:i.minResolution,renditionOrder:i.renditionOrder,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:ji(i.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:i.getAttribute(p.PRIMARY_COLOR),secondaryColor:i.getAttribute(p.SECONDARY_COLOR),accentColor:i.getAttribute(p.ACCENT_COLOR),forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultDuration:i.defaultDuration,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:hh(i),playbackRates:i.getAttribute(p.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(p.TITLE),novolumepref:i.hasAttribute(p.NO_VOLUME_PREF),...e,extraSourceParams:i.extraSourceParams}}function mh(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=U.customElements.get(e);if(n!=null&&n.template)return n.template}}function hh(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function Nu(i){let e=i.hasAttribute(p.TITLE)?{video_title:i.getAttribute(p.TITLE)}:{};return i.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=i.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},e)}var ph=Object.values(g.Attributes),bh=Object.values(Xe),Eh=Object.values(p),fh=on(),vh="mux-player",Uu={dialog:void 0,isDialogOpen:!1},gh={redundant_streams:!0},ma,ha,ft,pa,Ft,Je,$t,vn,Pu,ba,xs,vt,Ti,gn,Bu,An,Vu,_n,Hu,yn,$u,ca=class extends vs{constructor(){super();W(this,Je);W(this,vn);W(this,ba);W(this,vt);W(this,gn);W(this,An);W(this,_n);W(this,yn);W(this,ma,!1);W(this,ha,{});W(this,ft,!0);W(this,pa,new nn(this,"hotkeys"));W(this,Ft,{...Uu,onCloseErrorDialog:()=>F(this,ba,xs).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{bs(this,ne.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),F(this,vn,Pu).call(this),this.isConnected&&F(this,Je,$t).call(this)}static get observedAttributes(){var t;return[...(t=vs.observedAttributes)!=null?t:[],...bh,...ph,...Eh]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=Nu(this))}attributeChangedCallback(t,a,r){switch(F(this,Je,$t).call(this),super.attributeChangedCallback(t,a,r),t){case p.HOTKEYS:S(this,pa).value=r;break;case p.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&ct(y("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case p.THUMBNAIL_TOKEN:{let{aud:s}=ut(r);r&&s!=="t"&&ct(y("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case p.STORYBOARD_TOKEN:{let{aud:s}=ut(r);r&&s!=="s"&&ct(y("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&Ee(y("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:r&&![P.StreamTypes.LIVE,P.StreamTypes.ON_DEMAND,P.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Es({file:"invalid-stream-type.md",message:y("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===P.StreamTypes.LIVE?this.getAttribute(p.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[g.Attributes.PLAYBACK_ID,Xe.SRC,p.PLAYBACK_TOKEN].includes(t)&&a!==r&&ce(this,Ft,{...S(this,Ft),...Uu}),F(this,vt,Ti).call(this,{[ru(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?P.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):ct(`Invalid value for preferCmcd. Must be one of ${P.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute(o.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute(o.MEDIA_TIME_IS_LIVE)}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(p.THEME))!=null?t:uh}set theme(t){this.setAttribute(p.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(ws.includes(r))continue;let n=t.getAttribute(r);a[an(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;F(this,Je,$t).call(this);let a={...this.themeProps,...t};for(let s in a){if(ws.includes(s))continue;let d=t==null?void 0:t[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(tn(s),!!d):(n=this.mediaTheme)==null||n.setAttribute(tn(s),d)}}get playbackId(){var t;return(t=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(g.Attributes.PLAYBACK_ID,t):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=Wt(this,Xe.SRC))!=null?t:void 0:(a=this.getAttribute(Xe.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Xe.SRC,t):this.removeAttribute(Xe.SRC)}get poster(){var a;let t=this.getAttribute(Xe.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return iu(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Xe.POSTER,t):this.removeAttribute(Xe.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(p.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(p.STORYBOARD_SRC,t):this.removeAttribute(p.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[P.StreamTypes.LIVE,P.StreamTypes.UNKNOWN].includes(this.streamType)))return au(this.playbackId,{customDomain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(p.AUDIO)}set audio(t){if(!t){this.removeAttribute(p.AUDIO);return}this.setAttribute(p.AUDIO,"")}get hotkeys(){return S(this,pa)}get nohotkeys(){return this.hasAttribute(p.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(p.NOHOTKEYS);return}this.setAttribute(p.NOHOTKEYS,"")}get thumbnailTime(){return $e(this.getAttribute(p.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(p.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(p.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(p.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=Wt(this,p.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(p.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(p.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(p.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(p.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(p.SECONDARY_COLOR,`${t}`)}get accentColor(){var a,r;let t=this.getAttribute(p.ACCENT_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),t))return t}set accentColor(t){this.setAttribute(p.ACCENT_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(p.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(p.PLAYBACK_RATES))return this.getAttribute(p.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(p.PLAYBACK_RATES);return}this.setAttribute(p.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=$e(this.getAttribute(p.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(p.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=$e(this.getAttribute(p.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(p.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(p.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return $e(this.getAttribute(p.DEFAULT_DURATION))}set defaultDuration(t){t==null?this.removeAttribute(p.DEFAULT_DURATION):this.setAttribute(p.DEFAULT_DURATION,`${t}`)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:vh}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:fh}get beaconCollectionDomain(){var t;return(t=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(g.Attributes.MAX_RESOLUTION,t):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(g.Attributes.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(g.Attributes.MIN_RESOLUTION,t):this.removeAttribute(g.Attributes.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(g.Attributes.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(g.Attributes.RENDITION_ORDER,t):this.removeAttribute(g.Attributes.RENDITION_ORDER))}get extraSourceParams(){return this.hasAttribute(p.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(p.EXTRA_SOURCE_PARAMS)).entries()].reduce((t,[a,r])=>(t[a]=r,t),{}):gh}set extraSourceParams(t){t==null?this.removeAttribute(p.EXTRA_SOURCE_PARAMS):this.setAttribute(p.EXTRA_SOURCE_PARAMS,new URLSearchParams(t).toString())}get customDomain(){var t;return(t=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=Wt(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(p.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(p.NO_VOLUME_PREF,""):this.removeAttribute(p.NO_VOLUME_PREF)}get debug(){return Wt(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return Wt(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:P.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?r:P.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(p.DEFAULT_STREAM_TYPE,t):this.removeAttribute(p.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(p.TARGET_LIVE_WINDOW)?+this.getAttribute(p.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t==this.targetLiveWindow||Number.isNaN(t)&&Number.isNaN(this.targetLiveWindow)||(t==null?this.removeAttribute(p.TARGET_LIVE_WINDOW):this.setAttribute(p.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return $e(Wt(this,g.Attributes.START_TIME))}set startTime(t){this.setAttribute(g.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(F(this,Je,$t).call(this),!this.media){Ee("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Nu(this),...t}}get _hlsConfig(){var t;return(t=this.media)==null?void 0:t._hlsConfig}set _hlsConfig(t){if(F(this,Je,$t).call(this),!this.media){Ee("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=t}async addCuePoints(t){var a;if(F(this,Je,$t).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(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(p.PLAYBACK_TOKEN),a=this.getAttribute(p.THUMBNAIL_TOKEN),r=this.getAttribute(p.STORYBOARD_TOKEN);return{...S(this,ha),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){ce(this,ha,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(p.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(p.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(p.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(p.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(p.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(p.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,P.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,P.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};ma=new WeakMap,ha=new WeakMap,ft=new WeakMap,pa=new WeakMap,Ft=new WeakMap,Je=new WeakSet,$t=function(){var t,a,r;if(!S(this,ma)){ce(this,ma,!0),F(this,vt,Ti).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof U.HTMLElement))throw""}catch{Ee("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{Ee("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Qn))throw""}catch{Ee("<media-controller> failed to upgrade!")}du(this),F(this,gn,Bu).call(this),F(this,An,Vu).call(this),F(this,_n,Hu).call(this),ce(this,ft,(a=(t=this.mediaController)==null?void 0:t.hasAttribute(T.USER_INACTIVE))!=null?a:!0),F(this,yn,$u).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{F(this,vt,Ti).call(this)})}},vn=new WeakSet,Pu=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.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{}},ba=new WeakSet,xs=function(t){Object.assign(S(this,Ft),t),F(this,vt,Ti).call(this)},vt=new WeakSet,Ti=function(t={}){Ru(wu(ch(this,{...S(this,Ft),...t})),this.shadowRoot)},gn=new WeakSet,Bu=function(){let t=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(ws.includes(n))return;let s=this.getAttribute(r);s!=null?(d=this.mediaTheme)==null||d.setAttribute(n,s):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},An=new WeakSet,Vu=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){ct(n),n.data&&ct(`${n.name} data:`,n.data);return}let{dialog:s,devlog:d}=En(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&Es(d),Ee(n),n.data&&Ee(`${n.name} data:`,n.data),F(this,ba,xs).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,d,u;if(!(((s=this.media)==null?void 0:s.error)instanceof g.MediaError))return r;let{devlog:n}=En((d=this.media)==null?void 0:d.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,d;let{detail:n}=r;if(!n){let{message:u,code:h}=(d=(s=this.media)==null?void 0:s.error)!=null?d:{};n=new g.MediaError(u,h)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},_n=new WeakSet,Hu=function(){var a,r,n,s;let t=()=>F(this,vt,Ti).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},yn=new WeakSet,$u=function(){var h,m;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===P.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(b,E,I=!1)=>{if(n())return;Array.from(b&&b.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!E||this.paused){let $=k.text.split(`
2375
+ `).length,Z=-3;this.streamType===P.StreamTypes.LIVE&&(Z=-2);let ee=Z-$;if(k.line===ee&&!I)return;r.has(k)||r.set(k,k.line),k.line=ee}else setTimeout(()=>{k.line=r.get(k)||"auto"},500)})},d=()=>{var b,E;s(a,(E=(b=this.mediaController)==null?void 0:b.hasAttribute(T.USER_INACTIVE))!=null?E:!1)},u=()=>{var I,H;let E=Array.from(((H=(I=this.mediaController)==null?void 0:I.media)==null?void 0:H.textTracks)||[]).filter(k=>["subtitles","captions"].includes(k.kind)&&k.mode==="showing")[0];E!==a&&(a==null||a.removeEventListener("cuechange",d)),a=E,a==null||a.addEventListener("cuechange",d),s(a,S(this,ft))};u(),(h=this.textTracks)==null||h.addEventListener("change",u),(m=this.textTracks)==null||m.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var E,I;let b=(I=(E=this.mediaController)==null?void 0:E.hasAttribute(T.USER_INACTIVE))!=null?I:!0;S(this,ft)!==b&&(ce(this,ft,b),s(a,S(this,ft)))})};function Wt(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}U.customElements.get("mux-player")||(U.customElements.define("mux-player",ca),U.MuxPlayerElement=ca);var Ah=ca;