@mux/mux-player 1.10.0 → 1.10.1

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 Tl=Object.create;var Pi=Object.defineProperty;var Il=Object.getOwnPropertyDescriptor;var kl=Object.getOwnPropertyNames;var Ml=Object.getPrototypeOf,Sl=Object.prototype.hasOwnProperty;var wl=(i,e)=>{for(var t in e)Pi(i,t,{get:e[t],enumerable:!0})},Zs=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of kl(e))!Sl.call(i,r)&&r!==t&&Pi(i,r,{get:()=>e[r],enumerable:!(a=Il(e,r))||a.enumerable});return i};var Cl=(i,e,t)=>(t=i!=null?Tl(Ml(i)):{},Zs(e||!i||!i.__esModule?Pi(t,"default",{value:i,enumerable:!0}):t,i)),Ll=i=>Zs(Pi({},"__esModule",{value:!0}),i);var tr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var I=(i,e,t)=>(tr(i,e,"read from private field"),t?t.call(i):e.get(i)),x=(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)},J=(i,e,t,a)=>(tr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var P=(i,e,t)=>(tr(i,e,"access private method"),t);var Zc={};wl(Zc,{MediaError:()=>g.MediaError,default:()=>Gc,getVideoAttribute:()=>ct});module.exports=Ll(Zc);var ht=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends ht{}globalThis.DocumentFragment=i}var Ft=class extends ht{},ir=class extends ht{},xl={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(Ft)}},Kt,ar=class{constructor(e,t={}){x(this,Kt,void 0);J(this,Kt,t==null?void 0:t.detail)}get detail(){return I(this,Kt)}initCustomEvent(){}};Kt=new WeakMap;function Rl(i,e){return new Ft}var qs={document:{createElement:Rl},DocumentFragment,customElements:xl,CustomEvent:ar,EventTarget:ht,HTMLElement:Ft,HTMLVideoElement:ir},Qs=typeof window=="undefined"||typeof globalThis.customElements=="undefined",D=Qs?qs:globalThis,Q=Qs?qs.document:globalThis.document;var p={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_CAPTIONS_REQUEST:"mediashowcaptionsrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_CAPTIONS_REQUEST:"mediadisablecaptionsrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},Yt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaairplayunavailablechange",MEDIA_PIP_UNAVAILABLE:"mediapipunavailablechange",MEDIA_PAUSED:"mediapausedchange",MEDIA_HAS_PLAYED:"mediahasplayedchange",MEDIA_MUTED:"mediamutedchange",MEDIA_VOLUME_LEVEL:"mediavolumelevelchange",MEDIA_VOLUME:"mediavolumechange",MEDIA_VOLUME_UNAVAILABLE:"mediavolumeunavailablechange",MEDIA_IS_PIP:"mediaispipchange",MEDIA_IS_CASTING:"mediaiscastingchange",MEDIA_CAPTIONS_LIST:"mediacaptionslistchange",MEDIA_SUBTITLES_LIST:"mediasubtitleslistchange",MEDIA_CAPTIONS_SHOWING:"mediacaptionsshowingchange",MEDIA_SUBTITLES_SHOWING:"mediasubtitlesshowingchange",MEDIA_IS_FULLSCREEN:"mediaisfullscreenchange",MEDIA_PLAYBACK_RATE:"mediaplaybackratechange",MEDIA_CURRENT_TIME:"mediacurrenttimechange",MEDIA_DURATION:"mediadurationchange",MEDIA_SEEKABLE:"mediaseekablechange",MEDIA_PREVIEW_IMAGE:"mediapreviewimagechange",MEDIA_PREVIEW_COORDS:"mediapreviewcoordschange",MEDIA_LOADING:"medialoadingchange",USER_INACTIVE:"userinactivechange"},f={MEDIA_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller"},o={MEDIA_AIRPLAY_UNAVAILABLE:"media-airplay-unavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"media-fullscreen-unavailable",MEDIA_PIP_UNAVAILABLE:"media-pip-unavailable",MEDIA_CAST_UNAVAILABLE:"media-cast-unavailable",MEDIA_PAUSED:"media-paused",MEDIA_HAS_PLAYED:"media-has-played",MEDIA_MUTED:"media-muted",MEDIA_VOLUME_LEVEL:"media-volume-level",MEDIA_VOLUME:"media-volume",MEDIA_VOLUME_UNAVAILABLE:"media-volume-unavailable",MEDIA_IS_PIP:"media-is-pip",MEDIA_IS_CASTING:"media-is-casting",MEDIA_CAPTIONS_LIST:"media-captions-list",MEDIA_SUBTITLES_LIST:"media-subtitles-list",MEDIA_CAPTIONS_SHOWING:"media-captions-showing",MEDIA_SUBTITLES_SHOWING:"media-subtitles-showing",MEDIA_IS_FULLSCREEN:"media-is-fullscreen",MEDIA_PLAYBACK_RATE:"media-playback-rate",MEDIA_CURRENT_TIME:"media-current-time",MEDIA_DURATION:"media-duration",MEDIA_SEEKABLE:"media-seekable",MEDIA_PREVIEW_TIME:"media-preview-time",MEDIA_PREVIEW_IMAGE:"media-preview-image",MEDIA_PREVIEW_COORDS:"media-preview-coords",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered",MEDIA_STREAM_TYPE:"media-stream-type",MEDIA_TARGET_LIVE_WINDOW:"media-target-live-window",MEDIA_TIME_IS_LIVE:"media-time-is-live"},Xc=Object.entries(Yt).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"user-inactive"}),zs=Object.entries(o).reduce((i,[e,t])=>{let a=Yt[e];return a&&(i[t]=a),i},{"user-inactive":"userinactivechange"}),pt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Ze={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var rr={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},re={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},se={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var W={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"},C={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",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`},Ol={...W,...C};function Ui(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 Xs(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Js(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Bi(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var js=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Nl=(i,e)=>{let t=i===1?js[e].singular:js[e].plural;return`${i} ${t}`},qe=i=>{if(!Js(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((l,c)=>l&&Nl(l,c)).filter(l=>l).join(", ")}${t?" remaining":""}`};function z(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),s=Math.floor(i/3600),n=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(s=r=a="-"),s=s>0||l>0?s+":":"",r=((s||n>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+s+r+a}var $i=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},Ul=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Hi=(i,e)=>Ul(i,e)[0],Gt=(i,e)=>!i||!e?!1:i.contains(e)?!0:Gt(i,e.getRootNode().host),Qe=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Qe(i.getRootNode().host,e)};function R(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 s of r!=null?r:[])if(s.selectorText===e)return s}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{},removeProperty:()=>{}}}}var Wi=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},sr=class{observe(){}},en={ResizeObserver:sr,HTMLElement:class extends Wi{},DocumentFragment:class extends Wi{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){}},Bl={createElement:function(){return new en.HTMLElement},addEventListener(){},removeEventListener(){}},tn=typeof window=="undefined"||typeof window.customElements=="undefined",d=tn?en:window,u=tn?Bl:window.document;var $l=Object.defineProperty,Hl=(i,e,t)=>e in i?$l(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Wl=(i,e,t)=>(Hl(i,typeof e!="symbol"?e+"":e,t),t),an=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},j=(i,e,t)=>(an(i,e,"read from private field"),t?t.call(i):e.get(i)),Vi=(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)},Fi=(i,e,t,a)=>(an(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ue,Ki,bt,Yi,rn=u.createElement("template");rn.innerHTML=`
1
+ "use strict";var Tl=Object.create;var Pi=Object.defineProperty;var Il=Object.getOwnPropertyDescriptor;var kl=Object.getOwnPropertyNames;var Ml=Object.getPrototypeOf,Sl=Object.prototype.hasOwnProperty;var wl=(i,e)=>{for(var t in e)Pi(i,t,{get:e[t],enumerable:!0})},Zs=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of kl(e))!Sl.call(i,r)&&r!==t&&Pi(i,r,{get:()=>e[r],enumerable:!(a=Il(e,r))||a.enumerable});return i};var Cl=(i,e,t)=>(t=i!=null?Tl(Ml(i)):{},Zs(e||!i||!i.__esModule?Pi(t,"default",{value:i,enumerable:!0}):t,i)),Ll=i=>Zs(Pi({},"__esModule",{value:!0}),i);var tr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var I=(i,e,t)=>(tr(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)},j=(i,e,t,a)=>(tr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var U=(i,e,t)=>(tr(i,e,"access private method"),t);var Zc={};wl(Zc,{MediaError:()=>v.MediaError,default:()=>Gc,getVideoAttribute:()=>ct});module.exports=Ll(Zc);var ht=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends ht{}globalThis.DocumentFragment=i}var Ft=class extends ht{},ir=class extends ht{},xl={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(Ft)}},Kt,ar=class{constructor(e,t={}){R(this,Kt,void 0);j(this,Kt,t==null?void 0:t.detail)}get detail(){return I(this,Kt)}initCustomEvent(){}};Kt=new WeakMap;function Rl(i,e){return new Ft}var qs={document:{createElement:Rl},DocumentFragment,customElements:xl,CustomEvent:ar,EventTarget:ht,HTMLElement:Ft,HTMLVideoElement:ir},Qs=typeof window=="undefined"||typeof globalThis.customElements=="undefined",O=Qs?qs:globalThis,Q=Qs?qs.document:globalThis.document;var p={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_CAPTIONS_REQUEST:"mediashowcaptionsrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_CAPTIONS_REQUEST:"mediadisablecaptionsrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},Yt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaairplayunavailablechange",MEDIA_PIP_UNAVAILABLE:"mediapipunavailablechange",MEDIA_PAUSED:"mediapausedchange",MEDIA_HAS_PLAYED:"mediahasplayedchange",MEDIA_MUTED:"mediamutedchange",MEDIA_VOLUME_LEVEL:"mediavolumelevelchange",MEDIA_VOLUME:"mediavolumechange",MEDIA_VOLUME_UNAVAILABLE:"mediavolumeunavailablechange",MEDIA_IS_PIP:"mediaispipchange",MEDIA_IS_CASTING:"mediaiscastingchange",MEDIA_CAPTIONS_LIST:"mediacaptionslistchange",MEDIA_SUBTITLES_LIST:"mediasubtitleslistchange",MEDIA_CAPTIONS_SHOWING:"mediacaptionsshowingchange",MEDIA_SUBTITLES_SHOWING:"mediasubtitlesshowingchange",MEDIA_IS_FULLSCREEN:"mediaisfullscreenchange",MEDIA_PLAYBACK_RATE:"mediaplaybackratechange",MEDIA_CURRENT_TIME:"mediacurrenttimechange",MEDIA_DURATION:"mediadurationchange",MEDIA_SEEKABLE:"mediaseekablechange",MEDIA_PREVIEW_IMAGE:"mediapreviewimagechange",MEDIA_PREVIEW_COORDS:"mediapreviewcoordschange",MEDIA_LOADING:"medialoadingchange",USER_INACTIVE:"userinactivechange"},E={MEDIA_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller"},o={MEDIA_AIRPLAY_UNAVAILABLE:"media-airplay-unavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"media-fullscreen-unavailable",MEDIA_PIP_UNAVAILABLE:"media-pip-unavailable",MEDIA_CAST_UNAVAILABLE:"media-cast-unavailable",MEDIA_PAUSED:"media-paused",MEDIA_HAS_PLAYED:"media-has-played",MEDIA_MUTED:"media-muted",MEDIA_VOLUME_LEVEL:"media-volume-level",MEDIA_VOLUME:"media-volume",MEDIA_VOLUME_UNAVAILABLE:"media-volume-unavailable",MEDIA_IS_PIP:"media-is-pip",MEDIA_IS_CASTING:"media-is-casting",MEDIA_CAPTIONS_LIST:"media-captions-list",MEDIA_SUBTITLES_LIST:"media-subtitles-list",MEDIA_CAPTIONS_SHOWING:"media-captions-showing",MEDIA_SUBTITLES_SHOWING:"media-subtitles-showing",MEDIA_IS_FULLSCREEN:"media-is-fullscreen",MEDIA_PLAYBACK_RATE:"media-playback-rate",MEDIA_CURRENT_TIME:"media-current-time",MEDIA_DURATION:"media-duration",MEDIA_SEEKABLE:"media-seekable",MEDIA_PREVIEW_TIME:"media-preview-time",MEDIA_PREVIEW_IMAGE:"media-preview-image",MEDIA_PREVIEW_COORDS:"media-preview-coords",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered",MEDIA_STREAM_TYPE:"media-stream-type",MEDIA_TARGET_LIVE_WINDOW:"media-target-live-window",MEDIA_TIME_IS_LIVE:"media-time-is-live"},Xc=Object.entries(Yt).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"user-inactive"}),zs=Object.entries(o).reduce((i,[e,t])=>{let a=Yt[e];return a&&(i[t]=a),i},{"user-inactive":"userinactivechange"}),pt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Ze={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var rr={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},re={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},se={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var W={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"},C={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",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`},Ol={...W,...C};function Ui(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 Xs(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Js(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Bi(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var js=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Nl=(i,e)=>{let t=i===1?js[e].singular:js[e].plural;return`${i} ${t}`},qe=i=>{if(!Js(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((l,c)=>l&&Nl(l,c)).filter(l=>l).join(", ")}${t?" remaining":""}`};function z(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),s=Math.floor(i/3600),n=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(s=r=a="-"),s=s>0||l>0?s+":":"",r=((s||n>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+s+r+a}var $i=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},Ul=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Hi=(i,e)=>Ul(i,e)[0],Gt=(i,e)=>!i||!e?!1:i.contains(e)?!0:Gt(i,e.getRootNode().host),Qe=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Qe(i.getRootNode().host,e)};function D(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 s of r!=null?r:[])if(s.selectorText===e)return s}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{},removeProperty:()=>{}}}}var Wi=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},sr=class{observe(){}},en={ResizeObserver:sr,HTMLElement:class extends Wi{},DocumentFragment:class extends Wi{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){}},Bl={createElement:function(){return new en.HTMLElement},addEventListener(){},removeEventListener(){}},tn=typeof window=="undefined"||typeof window.customElements=="undefined",d=tn?en:window,u=tn?Bl:window.document;var $l=Object.defineProperty,Hl=(i,e,t)=>e in i?$l(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Wl=(i,e,t)=>(Hl(i,typeof e!="symbol"?e+"":e,t),t),an=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ee=(i,e,t)=>(an(i,e,"read from private field"),t?t.call(i):e.get(i)),Vi=(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)},Fi=(i,e,t,a)=>(an(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ue,Ki,bt,Yi,rn=u.createElement("template");rn.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  display: inline-flex;
@@ -50,7 +50,7 @@
50
50
  min-width: 100%;
51
51
  }
52
52
  </style>
53
- `;var Gi=class extends d.HTMLElement{constructor(e={}){super(),Vi(this,ue,void 0),Wl(this,"preventClick",!1),Vi(this,Ki,s=>{this.preventClick||this.handleClick(s)}),Vi(this,bt,s=>{let{key:n}=s;if(!this.keysUsed.includes(n)){this.removeEventListener("keyup",j(this,bt));return}this.preventClick||this.handleClick(s)}),Vi(this,Yi,s=>{let{metaKey:n,altKey:l,key:c}=s;if(n||l||!this.keysUsed.includes(c)){this.removeEventListener("keyup",j(this,bt));return}this.addEventListener("keyup",j(this,bt),{once:!0})}),this.attachShadow({mode:"open"});let t=rn.content.cloneNode(!0);this.nativeEl=t;let a=e.slotTemplate;a||(a=u.createElement("template"),a.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(a.content.cloneNode(!0)),this.shadowRoot.appendChild(t);let{style:r}=R(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return["disabled",f.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",j(this,Ki)),this.addEventListener("keydown",j(this,Yi)),this.setAttribute("tabindex","0")}disable(){this.removeEventListener("click",j(this,Ki)),this.removeEventListener("keydown",j(this,Yi)),this.removeEventListener("keyup",j(this,bt)),this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===f.MEDIA_CONTROLLER?(t&&((s=(r=j(this,ue))==null?void 0:r.unassociateElement)==null||s.call(r,this),Fi(this,ue,null)),a&&(Fi(this,ue,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=j(this,ue))==null?void 0:l.associateElement)==null||c.call(l,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let r=this.getAttribute(f.MEDIA_CONTROLLER);r&&(Fi(this,ue,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=j(this,ue))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=j(this,ue))==null?void 0:e.unassociateElement)==null||t.call(e,this),Fi(this,ue,null)}get keysUsed(){return["Enter"," "]}handleClick(e){}};ue=new WeakMap;Ki=new WeakMap;bt=new WeakMap;Yi=new WeakMap;d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",Gi);var S=Gi;var Vl=`<svg aria-hidden="true" viewBox="0 0 26 24">
53
+ `;var Gi=class extends d.HTMLElement{constructor(e={}){super(),Vi(this,ue,void 0),Wl(this,"preventClick",!1),Vi(this,Ki,s=>{this.preventClick||this.handleClick(s)}),Vi(this,bt,s=>{let{key:n}=s;if(!this.keysUsed.includes(n)){this.removeEventListener("keyup",ee(this,bt));return}this.preventClick||this.handleClick(s)}),Vi(this,Yi,s=>{let{metaKey:n,altKey:l,key:c}=s;if(n||l||!this.keysUsed.includes(c)){this.removeEventListener("keyup",ee(this,bt));return}this.addEventListener("keyup",ee(this,bt),{once:!0})}),this.attachShadow({mode:"open"});let t=rn.content.cloneNode(!0);this.nativeEl=t;let a=e.slotTemplate;a||(a=u.createElement("template"),a.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(a.content.cloneNode(!0)),this.shadowRoot.appendChild(t);let{style:r}=D(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return["disabled",E.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",ee(this,Ki)),this.addEventListener("keydown",ee(this,Yi)),this.setAttribute("tabindex","0")}disable(){this.removeEventListener("click",ee(this,Ki)),this.removeEventListener("keydown",ee(this,Yi)),this.removeEventListener("keyup",ee(this,bt)),this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===E.MEDIA_CONTROLLER?(t&&((s=(r=ee(this,ue))==null?void 0:r.unassociateElement)==null||s.call(r,this),Fi(this,ue,null)),a&&(Fi(this,ue,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=ee(this,ue))==null?void 0:l.associateElement)==null||c.call(l,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let r=this.getAttribute(E.MEDIA_CONTROLLER);r&&(Fi(this,ue,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ee(this,ue))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=ee(this,ue))==null?void 0:e.unassociateElement)==null||t.call(e,this),Fi(this,ue,null)}get keysUsed(){return["Enter"," "]}handleClick(e){}};ue=new WeakMap;Ki=new WeakMap;bt=new WeakMap;Yi=new WeakMap;d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",Gi);var S=Gi;var Vl=`<svg aria-hidden="true" viewBox="0 0 26 24">
54
54
  <path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
55
55
  </svg>
56
56
  `,sn=u.createElement("template");sn.innerHTML=`
@@ -78,7 +78,7 @@
78
78
  box-sizing: border-box;
79
79
  }
80
80
  </style>
81
- `;var lr=class extends d.HTMLElement{constructor(e={}){super(),Yl(this,Z,void 0);let t=this.attachShadow({mode:"open"}),a=dn.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=u.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}static get observedAttributes(){return[f.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===f.MEDIA_CONTROLLER&&(t&&((s=(r=Re(this,Z))==null?void 0:r.unassociateElement)==null||s.call(r,this),Zi(this,Z,null)),a&&(Zi(this,Z,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=Re(this,Z))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,a,r;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0),Zi(this,Z,Gl(this)),this.getAttribute(f.MEDIA_CONTROLLER)&&((t=(e=Re(this,Z))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=Re(this,Z))==null||a.addEventListener("pointerdown",this),(r=Re(this,Z))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(f.MEDIA_CONTROLLER)&&((t=(e=Re(this,Z))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=Re(this,Z))==null||a.removeEventListener("pointerdown",this),(r=Re(this,Z))==null||r.removeEventListener("click",this),Zi(this,Z,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:s,clientY:n}=e,{left:l,top:c,width:m,height:E}=this.getBoundingClientRect(),v=s-l,_=n-c;if(v<0||_<0||v>m||_>E||m===0&&E===0)return;let{pointerType:T=this._pointerType}=e;if(this._pointerType=void 0,T===rr.TOUCH){this.handleTap(e);return}else if(T===rr.MOUSE){this.handleMouseClick(e);return}}}}handleTap(e){}handleMouseClick(e){let t=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};Z=new WeakMap;function Gl(i){var e;let t=i.getAttribute(f.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):Qe(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",lr);var cn=u.createElement("template");cn.innerHTML=`
81
+ `;var lr=class extends d.HTMLElement{constructor(e={}){super(),Yl(this,Z,void 0);let t=this.attachShadow({mode:"open"}),a=dn.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=u.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}static get observedAttributes(){return[E.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===E.MEDIA_CONTROLLER&&(t&&((s=(r=Re(this,Z))==null?void 0:r.unassociateElement)==null||s.call(r,this),Zi(this,Z,null)),a&&(Zi(this,Z,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=Re(this,Z))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,a,r;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0),Zi(this,Z,Gl(this)),this.getAttribute(E.MEDIA_CONTROLLER)&&((t=(e=Re(this,Z))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=Re(this,Z))==null||a.addEventListener("pointerdown",this),(r=Re(this,Z))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(E.MEDIA_CONTROLLER)&&((t=(e=Re(this,Z))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=Re(this,Z))==null||a.removeEventListener("pointerdown",this),(r=Re(this,Z))==null||r.removeEventListener("click",this),Zi(this,Z,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:s,clientY:n}=e,{left:l,top:c,width:m,height:f}=this.getBoundingClientRect(),_=s-l,g=n-c;if(_<0||g<0||_>m||g>f||m===0&&f===0)return;let{pointerType:y=this._pointerType}=e;if(this._pointerType=void 0,y===rr.TOUCH){this.handleTap(e);return}else if(y===rr.MOUSE){this.handleMouseClick(e);return}}}}handleTap(e){}handleMouseClick(e){let t=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};Z=new WeakMap;function Gl(i){var e;let t=i.getAttribute(E.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):Qe(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",lr);var cn=u.createElement("template");cn.innerHTML=`
82
82
  <style>
83
83
 
84
84
  :host([media-is-fullscreen]) ::slotted([slot=media]) {
@@ -193,7 +193,7 @@
193
193
 
194
194
  <slot part="bottom chrome"></slot>
195
195
  </span>
196
- `;var Zl=Object.values(o),ql="sm:384 md:576 lg:768 xl:960",Ql=i=>{var e;for(let t of i){let a=t.target;if(!a.isConnected)continue;let r=(e=a.getAttribute("breakpoints"))!=null?e:ql,s=zl(r),n=Xl(s,t.contentRect);Object.keys(s).forEach(l=>{if(n.includes(l)){a.hasAttribute(`breakpoint-${l}`)||a.setAttribute(`breakpoint-${l}`,"");return}a.removeAttribute(`breakpoint-${l}`)})}};function zl(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Xl(i,e){return Object.keys(i).filter(t=>e.width>=i[t])}var qi=class extends d.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(cn.content.cloneNode(!0));let e=n=>{let l=this.media;for(let c of n)c.type==="childList"&&(c.removedNodes.forEach(m=>{if(m.slot=="media"&&c.target==this){let E=c.previousSibling&&c.previousSibling.previousElementSibling;if(!E||!l)this.mediaUnsetCallback(m);else{let v=E.slot!=="media";for(;(E=E.previousSibling)!==null;)E.slot=="media"&&(v=!1);v&&this.mediaUnsetCallback(m)}}}),l&&c.addedNodes.forEach(m=>{m==l&&this.handleMediaUpdated(l).then(E=>this.mediaSetCallback(E))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=new ResizeObserver(Ql);this.resizeObserver=a,a.observe(this);let r=this.media,s=this.querySelector(":scope > slot[slot=media]");s&&s.addEventListener("slotchange",()=>{if(!s.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(r);return}this.media&&(r=this.media,this.handleMediaUpdated(this.media).then(l=>this.mediaSetCallback(l)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(Zl)}attributeChangedCallback(e,t,a){e.toLowerCase()=="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}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{let t=e.paused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=s=>Promise.resolve(s),a=s=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',s),Promise.reject(s));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?d.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){let t=this.getAttribute("audio")!=null?W.AUDIO_PLAYER():W.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",t),this.media&&this.handleMediaUpdated(this.media).then(n=>this.mediaSetCallback(n)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0||this.hasAttribute("user-inactive"))return;this.setAttribute("user-inactive","");let n=new d.CustomEvent(Yt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(n)},r=()=>{if(!this.hasAttribute("user-inactive"))return;this.removeAttribute("user-inactive");let n=new d.CustomEvent(Yt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(n)},s=()=>{r(),d.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=d.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{s()}),this.addEventListener("pointerup",n=>{n.pointerType==="touch"?[this,this.media].includes(n.target)&&!this.hasAttribute("user-inactive")?a():s():n.composedPath().some(l=>{var c;return["media-play-button","media-fullscreen-button"].includes((c=l==null?void 0:l.nodeName)==null?void 0:c.toLowerCase())})&&s()}),this.addEventListener("pointermove",n=>{n.pointerType==="mouse"&&n.target!==this&&(r(),d.clearTimeout(this._inactiveTimeout),[this,this.media].includes(n.target)&&s())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),d.addEventListener("mouseup",()=>{this.removeAttribute("media-keyboard-control")})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};d.customElements.get("media-container-temp")||d.customElements.define("media-container-temp",qi);var un=qi;var mn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},V=(i,e,t)=>(mn(i,e,"read from private field"),t?t.call(i):e.get(i)),dr=(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)},cr=(i,e,t,a)=>(mn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Et,ft,X,Qi=class{constructor(e,t){dr(this,Et,void 0),dr(this,ft,void 0),dr(this,X,new Set),cr(this,Et,e),cr(this,ft,t)}[Symbol.iterator](){return V(this,X).values()}get length(){return V(this,X).size}get value(){var e;return(e=[...V(this,X)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(cr(this,X,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...V(this,X)][e]}values(){return V(this,X).values()}keys(){return V(this,X).keys()}forEach(e){V(this,X).forEach(e)}add(...e){var t,a;e.forEach(r=>V(this,X).add(r)),!(this.value===""&&!((t=V(this,Et))!=null&&t.hasAttribute(`${V(this,ft)}`)))&&((a=V(this,Et))==null||a.setAttribute(`${V(this,ft)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>V(this,X).delete(a)),(t=V(this,Et))==null||t.setAttribute(`${V(this,ft)}`,`${this.value}`)}contains(e){return V(this,X).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){this.remove(e),this.add(t)}};Et=new WeakMap;ft=new WeakMap;X=new WeakMap;var O={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};u.fullscreenElement===void 0&&(O.enter="webkitRequestFullScreen",O.exit=u.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",O.event="webkitfullscreenchange",O.element="webkitFullscreenElement",O.error="webkitfullscreenerror",O.enabled="webkitFullscreenEnabled");var ur=(i="")=>i.split(/\s+/),hn=(i="")=>{let[e,t]=i.split(":"),a=t?decodeURIComponent(t):void 0;return{language:e,label:a}},Zt=(i="",e={})=>ur(i).map(t=>{let a=hn(t);return{...e,...a}}),Jl=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?hn(e):e):typeof i=="string"?Zt(i):[i],mr=({label:i,language:e}={})=>i?`${e}:${encodeURIComponent(i)}`:e,ne=(i=[])=>Array.prototype.map.call(i,mr).join(" "),jl=(i,e)=>t=>t[i]===e,pn=i=>{let e=Object.entries(i).map(([t,a])=>jl(t,a));return t=>e.every(a=>a(t))},qt=(i,e=[],t=[])=>{let a=Jl(t).map(pn),r=s=>a.some(n=>n(s));Array.from(e).filter(r).forEach(s=>{s.mode=i})},vt=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:pn(e);return Array.from(i.textTracks).filter(t)},hr=i=>{let e=!!i.getAttribute(o.MEDIA_CAPTIONS_SHOWING),t=!i.hasAttribute("no-subtitles-fallback")&&!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return e||t},ze=i=>{var e,t,a,r;if(hr(i)){let n=i.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(n){let c=new window.CustomEvent(p.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(c)}let l=i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(l&&!i.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(p.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});i.dispatchEvent(c)}}else{let[n]=(t=ur((e=i.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?e:""))!=null?t:[];if(n){let l=new window.CustomEvent(p.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(l)}else if(i.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[l]=(r=ur((a=i.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?r:[];if(l){let c=new window.CustomEvent(p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});i.dispatchEvent(c)}}}};var vr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Je=(i,e,t)=>(vr(i,e,"read from private field"),t?t.call(i):e.get(i)),zi=(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)},bn=(i,e,t,a)=>(vr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),gt=(i,e,t)=>(vr(i,e,"access private method"),t),De,zt,_t,ei,Ji,pr,ed=Object.values(se),gn=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],td=10,En=0,ea=class extends un{constructor(){super(),zi(this,_t),zi(this,Ji),zi(this,De,new Qi(this,"hotkeys")),zi(this,zt,void 0),ud||(this._airplayUnavailable=re.UNSUPPORTED),vn||(this._fullscreenUnavailable=re.UNAVAILABLE),md||(this._castUnavailable=re.UNSUPPORTED),dd||(this._pipUnavailable=re.UNSUPPORTED),jt!==void 0?jt||(this._volumeUnavailable=re.UNSUPPORTED):cd.then(()=>{jt||(this._volumeUnavailable=re.UNSUPPORTED,this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this);let e={MEDIA_PLAY_REQUEST:(t,a)=>{let r=Qt[o.MEDIA_STREAM_TYPE](this),s=this.getAttribute("noautoseektolive")===null;r==se.LIVE&&s&&e.MEDIA_SEEK_TO_LIVE_REQUEST(t,a),this.media.play().catch(()=>{})},MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let t=this.media;t.muted=!1,t.volume===0&&(t.volume=.25)},MEDIA_VOLUME_REQUEST:t=>{let a=this.media,r=t.detail;a.volume=r,r>0&&a.muted&&(a.muted=!1);try{d.localStorage.setItem("media-chrome-pref-volume",r.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{if(!vn){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let t=this.media;u.pictureInPictureElement&&u.exitPictureInPicture(),super[O.enter]?this.fullscreenElement[O.enter]():t.webkitEnterFullscreen?t.webkitEnterFullscreen():t.requestFullscreen?t.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{u[O.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let t=this.media;if(!u.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}u[O.element]&&u[O.exit]();let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(r=>{if(r.code===11)if(t.readyState===0&&t.preload==="none"){let s=()=>{t.removeEventListener("loadedmetadata",n),t.preload="none"},n=()=>{t.requestPictureInPicture().catch(a),s()};t.addEventListener("loadedmetadata",n),t.preload="metadata",setTimeout(()=>{t.readyState===0&&a(),s()},1e3)}else throw r;else throw r})},MEDIA_EXIT_PIP_REQUEST:()=>{u.pictureInPictureElement&&u.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var t;let a=this.media;!((t=globalThis.CastableVideoElement)!=null&&t.castEnabled)||(u[O.element]&&u[O.exit](),a.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var t;(t=globalThis.CastableVideoElement)!=null&&t.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:t=>{let a=this.media,r=t.detail;(a.readyState>0||a.readyState===void 0)&&(a.currentTime=r)},MEDIA_PLAYBACK_RATE_REQUEST:t=>{this.media.playbackRate=t.detail},MEDIA_PREVIEW_REQUEST:t=>{var a;let r=this.media;if(!r)return;let s=t.detail;s===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,s);let[n]=vt(r,{kind:pt.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;if(s===null){this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let l=Array.prototype.find.call(n.cues,v=>v.startTime>=s);if(!l)return;let c=/'^(?:[a-z]+:)?\/\//i.test(l.text)||(a=r.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,m=new URL(l.text,c),E=new URLSearchParams(m.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,m.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,E.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:t=>{let a=ji(this),{detail:r=[]}=t;qt(Ze.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:t=>{let a=ji(this),{detail:r=[]}=t;qt(Ze.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:t=>{let a=Jt(this),{detail:r=[]}=t;qt(Ze.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:t=>{let a=Jt(this),{detail:r=[]}=t;qt(Ze.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:t}=this;if(!!t){if(!(t.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},MEDIA_SEEK_TO_LIVE_REQUEST:(t,a)=>{let r=a.seekable;if(!r){console.warn("MediaController: Media element does not support seeking to live.");return}if(!r.length){console.warn("MediaController: Media is unable to seek to live.");return}a.currentTime=r.end(r.length-1)}};if(Object.keys(e).forEach(t=>{let a=`_handle${Ui(t,!0)}`;this[a]=r=>{if(r.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}e[t](r,this.media)},this.addEventListener(p[t],this[a])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(o.MEDIA_PAUSED,_n(this))},"playing,emptied":()=>{var t;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((t=this.media)!=null&&t.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,An(this)),this.propagateMediaState(o.MEDIA_VOLUME,yn(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,Tn(this))},[O.event]:t=>{let r=!!u[O.element]&&(t==null?void 0:t.target),s=Gt(this.fullscreenElement,r);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,s)},"enterpictureinpicture,leavepictureinpicture":t=>{var a;let r;if(t)r=t.type=="enterpictureinpicture";else{let s=(a=this.getRootNode().pictureInPictureElement)!=null?a:u.pictureInPictureElement;r=this.media&&Gt(this.media,s)}this.propagateMediaState(o.MEDIA_IS_PIP,r)},"entercast,leavecast,castchange":t=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,s=this.media&&Gt(this.media,r);(t==null?void 0:t.type)==="castchange"&&(t==null?void 0:t.detail)==="CONNECTING"&&(s="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,s)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,In(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,kn(this))},"emptied,durationchange,loadedmetadata,streamtypechange":()=>{this.propagateMediaState(o.MEDIA_STREAM_TYPE)},"emptied,durationchange,loadedmetadata,streamtypechange,targetlivewindowchange":()=>{this.propagateMediaState(o.MEDIA_TARGET_LIVE_WINDOW)},"loadedmetadata,emptied,progress":()=>{var t;this.propagateMediaState(o.MEDIA_SEEKABLE,(t=Mn(this))==null?void 0:t.join(":"))},"progress,emptied":()=>{var t;this.propagateMediaState(o.MEDIA_BUFFERED,bd((t=this.media)==null?void 0:t.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Sn(this))},"waiting,playing,emptied":()=>{var t;let a=((t=this.media)==null?void 0:t.readyState)<3;this.propagateMediaState(o.MEDIA_LOADING,a)},"playing,timeupdate,progress,waiting,emptied":()=>{this.propagateMediaState(o.MEDIA_TIME_IS_LIVE)}},this._airplayUnavailable!==re.UNSUPPORTED){let t=a=>{(a==null?void 0:a.availability)==="available"?this._airplayUnavailable=void 0:(a==null?void 0:a.availability)==="not-available"&&(this._airplayUnavailable=re.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=t}if(this._castUnavailable!==re.UNSUPPORTED){let t=()=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castState;r!=null&&r.includes("CONNECT")?this._castUnavailable=void 0:this._castUnavailable=re.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=t}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,ne(ji(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,ne(Jt(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,ne(br(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,ne(fn(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,ne(br(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,ne(fn(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys","default-stream-type")}get fullscreenElement(){var e;return(e=Je(this,zt))!=null?e:this}set fullscreenElement(e){this.hasAttribute("fullscreen-element")&&this.removeAttribute("fullscreen-element"),bn(this,zt,e)}attributeChangedCallback(e,t,a){var r;if(e==="nohotkeys")a!==t&&a===""?(this.hasAttribute("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==="hotkeys")Je(this,De).value=a;else if(e==="default-stream-type")this.propagateMediaState(o.MEDIA_STREAM_TYPE);else if(e==="fullscreen-element"){let s=a?(r=this.getRootNode())==null?void 0:r.getElementById(a):void 0;bn(this,zt,s)}super.attributeChangedCallback(e,t,a)}mediaSetCallback(e){super.mediaSetCallback(e),e.hasAttribute("tabindex")||e.setAttribute("tabindex",-1),Object.keys(this._mediaStatePropagators).forEach(t=>{let a=t.split(","),r=this._mediaStatePropagators[t];a.forEach(s=>{(s==O.event?this.getRootNode():e).addEventListener(s,r)}),r()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(s=>{e.textTracks&&e.textTracks.addEventListener(s,a)}),a()});try{let t=d.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(this._mediaStatePropagators).forEach(t=>{let a=t.split(","),r=this._mediaStatePropagators[t];a.forEach(s=>{(s==O.event?this.getRootNode():e).removeEventListener(s,r)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(s=>{e.textTracks&&e.textTracks.removeEventListener(s,a)}),a()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(e,t){arguments.length===1&&(t=Qt[e](this));let a=this.getAttribute(e);if(Xe(this.mediaStateReceivers,e,t),a===this.getAttribute(e))return;let r=zs[e];if(!r)return;let s=new d.CustomEvent(r,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(s)}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),s=nd(e,a,r);Object.keys(p).forEach(n=>{e.addEventListener(p[n],this[`_handle${Ui(n,!0)}`])}),t.set(e,s)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(p).forEach(r=>{e.removeEventListener(p[r],this[`_handle${Ui(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Xe([e],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Xe([e],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Xe([e],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Xe([e],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Xe([e],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||Xe([e],o[r],Qt[o[r]]?Qt[o[r]](this):Qt.default(this,o[r]))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",gt(this,Ji,pr))}disableHotkeys(){this.removeEventListener("keydown",gt(this,Ji,pr)),this.removeEventListener("keyup",gt(this,_t,ei))}get hotkeys(){return Je(this,De)}keyboardShortcutHandler(e){var t,a,r,s;if(((s=(r=(t=e.target.getAttribute("keysused"))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?s:[]).map(T=>T==="Space"?" ":T).filter(Boolean).includes(e.key))return;let l,c,m,E,v,_=td;if(!Je(this,De).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&Je(this,De).contains("nospace")))switch(e.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":ze(this);break;case"ArrowLeft":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:En,E=Math.max(m-_,0),v=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(v);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:En,E=Math.max(m+_,0),v=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(v);break;default:break}}};De=new WeakMap;zt=new WeakMap;_t=new WeakSet;ei=function(i){let{key:e}=i;if(!gn.includes(e)){this.removeEventListener("keyup",gt(this,_t,ei));return}this.keyboardShortcutHandler(i)};Ji=new WeakSet;pr=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!gn.includes(a)){this.removeEventListener("keyup",gt(this,_t,ei));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Je(this,De).contains(`no${a.toLowerCase()}`)||a===" "&&Je(this,De).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",gt(this,_t,ei),{once:!0})};var Qt={default(i,e){return i.getAttribute(e)},[o.MEDIA_CAPTIONS_LIST](i){return ne(ji(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return ne(Jt(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return ne(Jt(i))||void 0},[o.MEDIA_CAPTIONS_SHOWING](i){return ne(br(i))||void 0},[o.MEDIA_PAUSED](i){return _n(i)},[o.MEDIA_MUTED](i){return An(i)},[o.MEDIA_VOLUME](i){return yn(i)},[o.MEDIA_VOLUME_LEVEL](i){return Tn(i)},[o.MEDIA_CURRENT_TIME](i){return In(i)},[o.MEDIA_DURATION](i){return kn(i)},[o.MEDIA_SEEKABLE](i){var e;return(e=Mn(i))==null?void 0:e.join(":")},[o.MEDIA_PLAYBACK_RATE](i){return Sn(i)},[o.MEDIA_STREAM_TYPE](i){return Er(i)},[o.MEDIA_TARGET_LIVE_WINDOW](i){return id(i)},[o.MEDIA_TIME_IS_LIVE](i){let e=i.media;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Er(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,s=a.end(a.length-1)-r;return e.currentTime>=s}},_n=i=>i.media?i.media.paused:!0,An=i=>!!(i.media&&i.media.muted),yn=i=>{let e=i.media;return e?e.volume:1},Tn=i=>{let e="high";if(!i.media)return e;let{muted:t,volume:a}=i.media;return a===0||t?e="off":a<.5?e="low":a<.75&&(e="medium"),e},In=i=>{let e=i.media;return e?e.currentTime:0},kn=i=>{let e=i==null?void 0:i.media;return Number.isFinite(e==null?void 0:e.duration)?e.duration:NaN},Mn=i=>{var e;let t=i==null?void 0:i.media;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))]},Sn=i=>{let e=i.media;return e?e.playbackRate:1},Jt=i=>vt(i.media,{kind:pt.SUBTITLES}),ji=i=>vt(i.media,{kind:pt.CAPTIONS}),fn=i=>vt(i.media,{kind:pt.SUBTITLES,mode:Ze.SHOWING}),br=i=>vt(i.media,{kind:pt.CAPTIONS,mode:Ze.SHOWING}),Er=i=>{let{media:e}=i;if(!e)return;let{streamType:t}=e;if(ed.includes(t)){if(t===se.UNKNOWN){let r=i.getAttribute("default-stream-type");return[se.LIVE,se.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return se.LIVE;if(Number.isFinite(a))return se.ON_DEMAND;{let r=i.getAttribute("default-stream-type");if([se.LIVE,se.ON_DEMAND].includes(r))return r}},id=i=>{let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e;return(t==null||Number.isNaN(t))&&Er(i)===se.LIVE?0:t},ad=Object.values(o),wn=i=>{var e,t,a,r;let{observedAttributes:s}=i.constructor;!s&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:s}=i.constructor);let n=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,f.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(s||n)?(s||n).filter(l=>ad.includes(l)):[]},fr=i=>!!wn(i).length,rd=async(i,e,t)=>(i.isConnected||await Cn(0),t==null?i.removeAttribute(e):typeof t=="boolean"?t?i.setAttribute(e,""):i.removeAttribute(e):Number.isNaN(t)?i.removeAttribute(e):i.setAttribute(e,t)),sd=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Xt=(i,e)=>{if(sd(i))return;let t=(r,s)=>{var n,l;fr(r)&&s(r);let{children:c=[]}=r!=null?r:{},m=(l=(n=r==null?void 0:r.shadowRoot)==null?void 0:n.children)!=null?l:[];[...c,...m].forEach(v=>Xt(v,s))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!fr(i)){d.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Xe=(i,e,t)=>{i.forEach(a=>{!wn(a).includes(e)||rd(a,e,t)})},nd=(i,e,t)=>{Xt(i,e);let a=c=>{var m;let E=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(E)},r=c=>{var m;let E=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;t(E)};i.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let s=c=>{c.forEach(m=>{let{addedNodes:E=[],removedNodes:v=[],type:_,target:T,attributeName:$}=m;_==="childList"?(Array.prototype.forEach.call(E,k=>Xt(k,e)),Array.prototype.forEach.call(v,k=>Xt(k,t))):_==="attributes"&&$===f.MEDIA_CHROME_ATTRIBUTES&&(fr(T)?e(T):t(T))})},n=new MutationObserver(s);return n.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Xt(i,t),n.disconnect(),i.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Xi,gr=()=>{var i,e;return Xi||(Xi=(e=(i=u)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Xi)},od=async(i=gr())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Cn(0),i.volume!==e},Cn=i=>new Promise(e=>setTimeout(e,i)),ld=(i=gr())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",dd=ld(),jt,cd=od().then(i=>(jt=i,jt)),ud=!!d.WebKitPlaybackTargetAvailabilityEvent,md=!!d.chrome,hd=(i=gr())=>{let e=u[O.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},vn=hd(),pd=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}});function bd(i=pd){return Array.from(i).map((e,t)=>[Number(i.start(t).toFixed(3)),Number(i.end(t).toFixed(3))].join(":")).join(" ")}d.customElements.get("media-controller")||d.customElements.define("media-controller",ea);var ti=ea;var xn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_e=(i,e,t)=>(xn(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)},ii=(i,e,t,a)=>(xn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ia,me,aa,ra,Rn=u.createElement("template"),Ln=`
196
+ `;var Zl=Object.values(o),ql="sm:384 md:576 lg:768 xl:960",Ql=i=>{var e;for(let t of i){let a=t.target;if(!a.isConnected)continue;let r=(e=a.getAttribute("breakpoints"))!=null?e:ql,s=zl(r),n=Xl(s,t.contentRect);Object.keys(s).forEach(l=>{if(n.includes(l)){a.hasAttribute(`breakpoint-${l}`)||a.setAttribute(`breakpoint-${l}`,"");return}a.removeAttribute(`breakpoint-${l}`)})}};function zl(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Xl(i,e){return Object.keys(i).filter(t=>e.width>=i[t])}var qi=class extends d.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(cn.content.cloneNode(!0));let e=n=>{let l=this.media;for(let c of n)c.type==="childList"&&(c.removedNodes.forEach(m=>{if(m.slot=="media"&&c.target==this){let f=c.previousSibling&&c.previousSibling.previousElementSibling;if(!f||!l)this.mediaUnsetCallback(m);else{let _=f.slot!=="media";for(;(f=f.previousSibling)!==null;)f.slot=="media"&&(_=!1);_&&this.mediaUnsetCallback(m)}}}),l&&c.addedNodes.forEach(m=>{m==l&&this.handleMediaUpdated(l).then(f=>this.mediaSetCallback(f))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=new ResizeObserver(Ql);this.resizeObserver=a,a.observe(this);let r=this.media,s=this.querySelector(":scope > slot[slot=media]");s&&s.addEventListener("slotchange",()=>{if(!s.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(r);return}this.media&&(r=this.media,this.handleMediaUpdated(this.media).then(l=>this.mediaSetCallback(l)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(Zl)}attributeChangedCallback(e,t,a){e.toLowerCase()=="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}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{let t=e.paused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=s=>Promise.resolve(s),a=s=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',s),Promise.reject(s));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?d.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){let t=this.getAttribute("audio")!=null?W.AUDIO_PLAYER():W.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",t),this.media&&this.handleMediaUpdated(this.media).then(n=>this.mediaSetCallback(n)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0||this.hasAttribute("user-inactive"))return;this.setAttribute("user-inactive","");let n=new d.CustomEvent(Yt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(n)},r=()=>{if(!this.hasAttribute("user-inactive"))return;this.removeAttribute("user-inactive");let n=new d.CustomEvent(Yt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(n)},s=()=>{r(),d.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=d.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{s()}),this.addEventListener("pointerup",n=>{n.pointerType==="touch"?[this,this.media].includes(n.target)&&!this.hasAttribute("user-inactive")?a():s():n.composedPath().some(l=>{var c;return["media-play-button","media-fullscreen-button"].includes((c=l==null?void 0:l.nodeName)==null?void 0:c.toLowerCase())})&&s()}),this.addEventListener("pointermove",n=>{n.pointerType==="mouse"&&n.target!==this&&(r(),d.clearTimeout(this._inactiveTimeout),[this,this.media].includes(n.target)&&s())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),d.addEventListener("mouseup",()=>{this.removeAttribute("media-keyboard-control")})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};d.customElements.get("media-container-temp")||d.customElements.define("media-container-temp",qi);var un=qi;var mn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},V=(i,e,t)=>(mn(i,e,"read from private field"),t?t.call(i):e.get(i)),dr=(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)},cr=(i,e,t,a)=>(mn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ft,Et,X,Qi=class{constructor(e,t){dr(this,ft,void 0),dr(this,Et,void 0),dr(this,X,new Set),cr(this,ft,e),cr(this,Et,t)}[Symbol.iterator](){return V(this,X).values()}get length(){return V(this,X).size}get value(){var e;return(e=[...V(this,X)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(cr(this,X,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...V(this,X)][e]}values(){return V(this,X).values()}keys(){return V(this,X).keys()}forEach(e){V(this,X).forEach(e)}add(...e){var t,a;e.forEach(r=>V(this,X).add(r)),!(this.value===""&&!((t=V(this,ft))!=null&&t.hasAttribute(`${V(this,Et)}`)))&&((a=V(this,ft))==null||a.setAttribute(`${V(this,Et)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>V(this,X).delete(a)),(t=V(this,ft))==null||t.setAttribute(`${V(this,Et)}`,`${this.value}`)}contains(e){return V(this,X).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){this.remove(e),this.add(t)}};ft=new WeakMap;Et=new WeakMap;X=new WeakMap;var N={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};u.fullscreenElement===void 0&&(N.enter="webkitRequestFullScreen",N.exit=u.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",N.event="webkitfullscreenchange",N.element="webkitFullscreenElement",N.error="webkitfullscreenerror",N.enabled="webkitFullscreenEnabled");var ur=(i="")=>i.split(/\s+/),hn=(i="")=>{let[e,t]=i.split(":"),a=t?decodeURIComponent(t):void 0;return{language:e,label:a}},Zt=(i="",e={})=>ur(i).map(t=>{let a=hn(t);return{...e,...a}}),Jl=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?hn(e):e):typeof i=="string"?Zt(i):[i],mr=({label:i,language:e}={})=>i?`${e}:${encodeURIComponent(i)}`:e,ne=(i=[])=>Array.prototype.map.call(i,mr).join(" "),jl=(i,e)=>t=>t[i]===e,pn=i=>{let e=Object.entries(i).map(([t,a])=>jl(t,a));return t=>e.every(a=>a(t))},qt=(i,e=[],t=[])=>{let a=Jl(t).map(pn),r=s=>a.some(n=>n(s));Array.from(e).filter(r).forEach(s=>{s.mode=i})},vt=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:pn(e);return Array.from(i.textTracks).filter(t)},hr=i=>{let e=!!i.getAttribute(o.MEDIA_CAPTIONS_SHOWING),t=!i.hasAttribute("no-subtitles-fallback")&&!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return e||t},ze=i=>{var e,t,a,r;if(hr(i)){let n=i.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(n){let c=new window.CustomEvent(p.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(c)}let l=i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(l&&!i.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(p.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});i.dispatchEvent(c)}}else{let[n]=(t=ur((e=i.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?e:""))!=null?t:[];if(n){let l=new window.CustomEvent(p.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(l)}else if(i.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[l]=(r=ur((a=i.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?r:[];if(l){let c=new window.CustomEvent(p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});i.dispatchEvent(c)}}}};var vr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Je=(i,e,t)=>(vr(i,e,"read from private field"),t?t.call(i):e.get(i)),zi=(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)},bn=(i,e,t,a)=>(vr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),gt=(i,e,t)=>(vr(i,e,"access private method"),t),De,zt,_t,ei,Ji,pr,ed=Object.values(se),gn=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],td=10,fn=0,ea=class extends un{constructor(){super(),zi(this,_t),zi(this,Ji),zi(this,De,new Qi(this,"hotkeys")),zi(this,zt,void 0),ud||(this._airplayUnavailable=re.UNSUPPORTED),vn||(this._fullscreenUnavailable=re.UNAVAILABLE),md||(this._castUnavailable=re.UNSUPPORTED),dd||(this._pipUnavailable=re.UNSUPPORTED),jt!==void 0?jt||(this._volumeUnavailable=re.UNSUPPORTED):cd.then(()=>{jt||(this._volumeUnavailable=re.UNSUPPORTED,this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this);let e={MEDIA_PLAY_REQUEST:(t,a)=>{let r=Qt[o.MEDIA_STREAM_TYPE](this),s=this.getAttribute("noautoseektolive")===null;r==se.LIVE&&s&&e.MEDIA_SEEK_TO_LIVE_REQUEST(t,a),this.media.play().catch(()=>{})},MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let t=this.media;t.muted=!1,t.volume===0&&(t.volume=.25)},MEDIA_VOLUME_REQUEST:t=>{let a=this.media,r=t.detail;a.volume=r,r>0&&a.muted&&(a.muted=!1);try{d.localStorage.setItem("media-chrome-pref-volume",r.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{if(!vn){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let t=this.media;u.pictureInPictureElement&&u.exitPictureInPicture(),super[N.enter]?this.fullscreenElement[N.enter]():t.webkitEnterFullscreen?t.webkitEnterFullscreen():t.requestFullscreen?t.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{u[N.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let t=this.media;if(!u.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}u[N.element]&&u[N.exit]();let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(r=>{if(r.code===11)if(t.readyState===0&&t.preload==="none"){let s=()=>{t.removeEventListener("loadedmetadata",n),t.preload="none"},n=()=>{t.requestPictureInPicture().catch(a),s()};t.addEventListener("loadedmetadata",n),t.preload="metadata",setTimeout(()=>{t.readyState===0&&a(),s()},1e3)}else throw r;else throw r})},MEDIA_EXIT_PIP_REQUEST:()=>{u.pictureInPictureElement&&u.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var t;let a=this.media;!((t=globalThis.CastableVideoElement)!=null&&t.castEnabled)||(u[N.element]&&u[N.exit](),a.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var t;(t=globalThis.CastableVideoElement)!=null&&t.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:t=>{let a=this.media,r=t.detail;(a.readyState>0||a.readyState===void 0)&&(a.currentTime=r)},MEDIA_PLAYBACK_RATE_REQUEST:t=>{this.media.playbackRate=t.detail},MEDIA_PREVIEW_REQUEST:t=>{var a;let r=this.media;if(!r)return;let s=t.detail;s===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,s);let[n]=vt(r,{kind:pt.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;if(s===null){this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let l=Array.prototype.find.call(n.cues,_=>_.startTime>=s);if(!l)return;let c=/'^(?:[a-z]+:)?\/\//i.test(l.text)||(a=r.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,m=new URL(l.text,c),f=new URLSearchParams(m.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,m.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,f.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:t=>{let a=ji(this),{detail:r=[]}=t;qt(Ze.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:t=>{let a=ji(this),{detail:r=[]}=t;qt(Ze.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:t=>{let a=Jt(this),{detail:r=[]}=t;qt(Ze.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:t=>{let a=Jt(this),{detail:r=[]}=t;qt(Ze.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:t}=this;if(!!t){if(!(t.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},MEDIA_SEEK_TO_LIVE_REQUEST:(t,a)=>{let r=a.seekable;if(!r){console.warn("MediaController: Media element does not support seeking to live.");return}if(!r.length){console.warn("MediaController: Media is unable to seek to live.");return}a.currentTime=r.end(r.length-1)}};if(Object.keys(e).forEach(t=>{let a=`_handle${Ui(t,!0)}`;this[a]=r=>{if(r.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}e[t](r,this.media)},this.addEventListener(p[t],this[a])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(o.MEDIA_PAUSED,_n(this))},"playing,emptied":()=>{var t;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((t=this.media)!=null&&t.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,An(this)),this.propagateMediaState(o.MEDIA_VOLUME,yn(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,Tn(this))},[N.event]:t=>{let r=!!u[N.element]&&(t==null?void 0:t.target),s=Gt(this.fullscreenElement,r);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,s)},"enterpictureinpicture,leavepictureinpicture":t=>{var a;let r;if(t)r=t.type=="enterpictureinpicture";else{let s=(a=this.getRootNode().pictureInPictureElement)!=null?a:u.pictureInPictureElement;r=this.media&&Gt(this.media,s)}this.propagateMediaState(o.MEDIA_IS_PIP,r)},"entercast,leavecast,castchange":t=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,s=this.media&&Gt(this.media,r);(t==null?void 0:t.type)==="castchange"&&(t==null?void 0:t.detail)==="CONNECTING"&&(s="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,s)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,In(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,kn(this))},"emptied,durationchange,loadedmetadata,streamtypechange":()=>{this.propagateMediaState(o.MEDIA_STREAM_TYPE)},"emptied,durationchange,loadedmetadata,streamtypechange,targetlivewindowchange":()=>{this.propagateMediaState(o.MEDIA_TARGET_LIVE_WINDOW)},"loadedmetadata,emptied,progress":()=>{var t;this.propagateMediaState(o.MEDIA_SEEKABLE,(t=Mn(this))==null?void 0:t.join(":"))},"progress,emptied":()=>{var t;this.propagateMediaState(o.MEDIA_BUFFERED,bd((t=this.media)==null?void 0:t.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Sn(this))},"waiting,playing,emptied":()=>{var t;let a=((t=this.media)==null?void 0:t.readyState)<3;this.propagateMediaState(o.MEDIA_LOADING,a)},"playing,timeupdate,progress,waiting,emptied":()=>{this.propagateMediaState(o.MEDIA_TIME_IS_LIVE)}},this._airplayUnavailable!==re.UNSUPPORTED){let t=a=>{(a==null?void 0:a.availability)==="available"?this._airplayUnavailable=void 0:(a==null?void 0:a.availability)==="not-available"&&(this._airplayUnavailable=re.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=t}if(this._castUnavailable!==re.UNSUPPORTED){let t=()=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castState;r!=null&&r.includes("CONNECT")?this._castUnavailable=void 0:this._castUnavailable=re.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=t}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,ne(ji(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,ne(Jt(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,ne(br(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,ne(En(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,ne(br(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,ne(En(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys","default-stream-type")}get fullscreenElement(){var e;return(e=Je(this,zt))!=null?e:this}set fullscreenElement(e){this.hasAttribute("fullscreen-element")&&this.removeAttribute("fullscreen-element"),bn(this,zt,e)}attributeChangedCallback(e,t,a){var r;if(e==="nohotkeys")a!==t&&a===""?(this.hasAttribute("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==="hotkeys")Je(this,De).value=a;else if(e==="default-stream-type")this.propagateMediaState(o.MEDIA_STREAM_TYPE);else if(e==="fullscreen-element"){let s=a?(r=this.getRootNode())==null?void 0:r.getElementById(a):void 0;bn(this,zt,s)}super.attributeChangedCallback(e,t,a)}mediaSetCallback(e){super.mediaSetCallback(e),e.hasAttribute("tabindex")||e.setAttribute("tabindex",-1),Object.keys(this._mediaStatePropagators).forEach(t=>{let a=t.split(","),r=this._mediaStatePropagators[t];a.forEach(s=>{(s==N.event?this.getRootNode():e).addEventListener(s,r)}),r()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(s=>{e.textTracks&&e.textTracks.addEventListener(s,a)}),a()});try{let t=d.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(this._mediaStatePropagators).forEach(t=>{let a=t.split(","),r=this._mediaStatePropagators[t];a.forEach(s=>{(s==N.event?this.getRootNode():e).removeEventListener(s,r)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(s=>{e.textTracks&&e.textTracks.removeEventListener(s,a)}),a()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(e,t){arguments.length===1&&(t=Qt[e](this));let a=this.getAttribute(e);if(Xe(this.mediaStateReceivers,e,t),a===this.getAttribute(e))return;let r=zs[e];if(!r)return;let s=new d.CustomEvent(r,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(s)}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),s=nd(e,a,r);Object.keys(p).forEach(n=>{e.addEventListener(p[n],this[`_handle${Ui(n,!0)}`])}),t.set(e,s)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(p).forEach(r=>{e.removeEventListener(p[r],this[`_handle${Ui(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Xe([e],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Xe([e],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Xe([e],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Xe([e],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Xe([e],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||Xe([e],o[r],Qt[o[r]]?Qt[o[r]](this):Qt.default(this,o[r]))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",gt(this,Ji,pr))}disableHotkeys(){this.removeEventListener("keydown",gt(this,Ji,pr)),this.removeEventListener("keyup",gt(this,_t,ei))}get hotkeys(){return Je(this,De)}keyboardShortcutHandler(e){var t,a,r,s;if(((s=(r=(t=e.target.getAttribute("keysused"))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?s:[]).map(y=>y==="Space"?" ":y).filter(Boolean).includes(e.key))return;let l,c,m,f,_,g=td;if(!Je(this,De).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&Je(this,De).contains("nospace")))switch(e.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":ze(this);break;case"ArrowLeft":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:fn,f=Math.max(m-g,0),_=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(_);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:fn,f=Math.max(m+g,0),_=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(_);break;default:break}}};De=new WeakMap;zt=new WeakMap;_t=new WeakSet;ei=function(i){let{key:e}=i;if(!gn.includes(e)){this.removeEventListener("keyup",gt(this,_t,ei));return}this.keyboardShortcutHandler(i)};Ji=new WeakSet;pr=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!gn.includes(a)){this.removeEventListener("keyup",gt(this,_t,ei));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Je(this,De).contains(`no${a.toLowerCase()}`)||a===" "&&Je(this,De).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",gt(this,_t,ei),{once:!0})};var Qt={default(i,e){return i.getAttribute(e)},[o.MEDIA_CAPTIONS_LIST](i){return ne(ji(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return ne(Jt(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return ne(Jt(i))||void 0},[o.MEDIA_CAPTIONS_SHOWING](i){return ne(br(i))||void 0},[o.MEDIA_PAUSED](i){return _n(i)},[o.MEDIA_MUTED](i){return An(i)},[o.MEDIA_VOLUME](i){return yn(i)},[o.MEDIA_VOLUME_LEVEL](i){return Tn(i)},[o.MEDIA_CURRENT_TIME](i){return In(i)},[o.MEDIA_DURATION](i){return kn(i)},[o.MEDIA_SEEKABLE](i){var e;return(e=Mn(i))==null?void 0:e.join(":")},[o.MEDIA_PLAYBACK_RATE](i){return Sn(i)},[o.MEDIA_STREAM_TYPE](i){return fr(i)},[o.MEDIA_TARGET_LIVE_WINDOW](i){return id(i)},[o.MEDIA_TIME_IS_LIVE](i){let e=i.media;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(fr(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,s=a.end(a.length-1)-r;return e.currentTime>=s}},_n=i=>i.media?i.media.paused:!0,An=i=>!!(i.media&&i.media.muted),yn=i=>{let e=i.media;return e?e.volume:1},Tn=i=>{let e="high";if(!i.media)return e;let{muted:t,volume:a}=i.media;return a===0||t?e="off":a<.5?e="low":a<.75&&(e="medium"),e},In=i=>{let e=i.media;return e?e.currentTime:0},kn=i=>{let e=i==null?void 0:i.media;return Number.isFinite(e==null?void 0:e.duration)?e.duration:NaN},Mn=i=>{var e;let t=i==null?void 0:i.media;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))]},Sn=i=>{let e=i.media;return e?e.playbackRate:1},Jt=i=>vt(i.media,{kind:pt.SUBTITLES}),ji=i=>vt(i.media,{kind:pt.CAPTIONS}),En=i=>vt(i.media,{kind:pt.SUBTITLES,mode:Ze.SHOWING}),br=i=>vt(i.media,{kind:pt.CAPTIONS,mode:Ze.SHOWING}),fr=i=>{let{media:e}=i;if(!e)return;let{streamType:t}=e;if(ed.includes(t)){if(t===se.UNKNOWN){let r=i.getAttribute("default-stream-type");return[se.LIVE,se.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return se.LIVE;if(Number.isFinite(a))return se.ON_DEMAND;{let r=i.getAttribute("default-stream-type");if([se.LIVE,se.ON_DEMAND].includes(r))return r}},id=i=>{let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e;return(t==null||Number.isNaN(t))&&fr(i)===se.LIVE?0:t},ad=Object.values(o),wn=i=>{var e,t,a,r;let{observedAttributes:s}=i.constructor;!s&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:s}=i.constructor);let n=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,E.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(s||n)?(s||n).filter(l=>ad.includes(l)):[]},Er=i=>!!wn(i).length,rd=async(i,e,t)=>(i.isConnected||await Cn(0),t==null?i.removeAttribute(e):typeof t=="boolean"?t?i.setAttribute(e,""):i.removeAttribute(e):Number.isNaN(t)?i.removeAttribute(e):i.setAttribute(e,t)),sd=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Xt=(i,e)=>{if(sd(i))return;let t=(r,s)=>{var n,l;Er(r)&&s(r);let{children:c=[]}=r!=null?r:{},m=(l=(n=r==null?void 0:r.shadowRoot)==null?void 0:n.children)!=null?l:[];[...c,...m].forEach(_=>Xt(_,s))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Er(i)){d.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Xe=(i,e,t)=>{i.forEach(a=>{!wn(a).includes(e)||rd(a,e,t)})},nd=(i,e,t)=>{Xt(i,e);let a=c=>{var m;let f=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(f)},r=c=>{var m;let f=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;t(f)};i.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let s=c=>{c.forEach(m=>{let{addedNodes:f=[],removedNodes:_=[],type:g,target:y,attributeName:x}=m;g==="childList"?(Array.prototype.forEach.call(f,$=>Xt($,e)),Array.prototype.forEach.call(_,$=>Xt($,t))):g==="attributes"&&x===E.MEDIA_CHROME_ATTRIBUTES&&(Er(y)?e(y):t(y))})},n=new MutationObserver(s);return n.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Xt(i,t),n.disconnect(),i.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Xi,gr=()=>{var i,e;return Xi||(Xi=(e=(i=u)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Xi)},od=async(i=gr())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Cn(0),i.volume!==e},Cn=i=>new Promise(e=>setTimeout(e,i)),ld=(i=gr())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",dd=ld(),jt,cd=od().then(i=>(jt=i,jt)),ud=!!d.WebKitPlaybackTargetAvailabilityEvent,md=!!d.chrome,hd=(i=gr())=>{let e=u[N.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},vn=hd(),pd=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}});function bd(i=pd){return Array.from(i).map((e,t)=>[Number(i.start(t).toFixed(3)),Number(i.end(t).toFixed(3))].join(":")).join(" ")}d.customElements.get("media-controller")||d.customElements.define("media-controller",ea);var ti=ea;var xn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ae=(i,e,t)=>(xn(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)},ii=(i,e,t,a)=>(xn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ia,me,aa,ra,Rn=u.createElement("template"),Ln=`
197
197
  height: var(--thumb-height);
198
198
  width: var(--media-range-thumb-width, 10px);
199
199
  border: var(--media-range-thumb-border, none);
@@ -356,7 +356,7 @@
356
356
  <div id="hoverzone"></div>
357
357
  <input id="range" type="range" min="0" max="1000" step="any" value="0">
358
358
  </div>
359
- `;var sa=class extends d.HTMLElement{constructor(){super(),ta(this,ia,void 0),ta(this,me,void 0),ta(this,aa,()=>{if(this.range.matches(":focus-visible")){let{style:t}=R(this.shadowRoot,":host");t.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),ta(this,ra,()=>{let{style:t}=R(this.shadowRoot,":host");t.removeProperty("--_focus-visible-box-shadow")}),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Rn.content.cloneNode(!0));let{style:e}=R(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-block))`),this.container=this.shadowRoot.querySelector("#container"),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this)),ii(this,ia,parseInt(getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10",10))}static get observedAttributes(){return["disabled","aria-disabled",f.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===f.MEDIA_CONTROLLER?(t&&((s=(r=_e(this,me))==null?void 0:r.unassociateElement)==null||s.call(r,this),ii(this,me,null)),a&&(ii(this,me,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=_e(this,me))==null?void 0:l.associateElement)==null||c.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?this.range.removeAttribute(e):this.range.setAttribute(e,a))}connectedCallback(){var e,t,a;let r=this.getAttribute(f.MEDIA_CONTROLLER);r&&(ii(this,me,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=_e(this,me))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",_e(this,aa)),this.shadowRoot.addEventListener("focusout",_e(this,ra))}disconnectedCallback(){var e,t;(t=(e=_e(this,me))==null?void 0:e.unassociateElement)==null||t.call(e,this),ii(this,me,null),this.shadowRoot.removeEventListener("focusin",_e(this,aa)),this.shadowRoot.removeEventListener("focusout",_e(this,ra))}updatePointerBar(e){let t=this.range.getBoundingClientRect(),a=(e.clientX-t.left)/t.width;a=Math.max(0,Math.min(1,a));let{style:r}=R(this.shadowRoot,"#pointer");r.setProperty("width",`${a*t.width}px`)}updateBar(){let e=this.getBarColors(),t="linear-gradient(to right, ",a=0;e.forEach(s=>{s[1]<a||(t=t+`${s[0]} ${a}%, ${s[0]} ${s[1]}%,`,a=s[1])}),t=t.slice(0,t.length-1)+")";let{style:r}=R(this.shadowRoot,"#range");r.setProperty("--media-range-track-progress-internal",t)}getBarColors(){let e=this.range,t=e.value-e.min,a=e.max-e.min,r=t/a*100,s=0;return e.value>e.min&&e.value<e.max&&(s=_e(this,ia)*(.5-r/100)/e.offsetWidth*100),[["var(--media-range-bar-color, #fff)",r+s],["var(--media-range-track-color, transparent)",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};ia=new WeakMap;me=new WeakMap;aa=new WeakMap;ra=new WeakMap;d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",sa);var ai=sa;var Dn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},na=(i,e,t)=>(Dn(i,e,"read from private field"),t?t.call(i):e.get(i)),Ed=(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)},oa=(i,e,t,a)=>(Dn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),he,On=u.createElement("template");On.innerHTML=`
359
+ `;var sa=class extends d.HTMLElement{constructor(){super(),ta(this,ia,void 0),ta(this,me,void 0),ta(this,aa,()=>{if(this.range.matches(":focus-visible")){let{style:t}=D(this.shadowRoot,":host");t.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),ta(this,ra,()=>{let{style:t}=D(this.shadowRoot,":host");t.removeProperty("--_focus-visible-box-shadow")}),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Rn.content.cloneNode(!0));let{style:e}=D(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-block))`),this.container=this.shadowRoot.querySelector("#container"),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this)),ii(this,ia,parseInt(getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10",10))}static get observedAttributes(){return["disabled","aria-disabled",E.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===E.MEDIA_CONTROLLER?(t&&((s=(r=Ae(this,me))==null?void 0:r.unassociateElement)==null||s.call(r,this),ii(this,me,null)),a&&(ii(this,me,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=Ae(this,me))==null?void 0:l.associateElement)==null||c.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?this.range.removeAttribute(e):this.range.setAttribute(e,a))}connectedCallback(){var e,t,a;let r=this.getAttribute(E.MEDIA_CONTROLLER);r&&(ii(this,me,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ae(this,me))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Ae(this,aa)),this.shadowRoot.addEventListener("focusout",Ae(this,ra))}disconnectedCallback(){var e,t;(t=(e=Ae(this,me))==null?void 0:e.unassociateElement)==null||t.call(e,this),ii(this,me,null),this.shadowRoot.removeEventListener("focusin",Ae(this,aa)),this.shadowRoot.removeEventListener("focusout",Ae(this,ra))}updatePointerBar(e){let t=this.range.getBoundingClientRect(),a=(e.clientX-t.left)/t.width;a=Math.max(0,Math.min(1,a));let{style:r}=D(this.shadowRoot,"#pointer");r.setProperty("width",`${a*t.width}px`)}updateBar(){let e=this.getBarColors(),t="linear-gradient(to right, ",a=0;e.forEach(s=>{s[1]<a||(t=t+`${s[0]} ${a}%, ${s[0]} ${s[1]}%,`,a=s[1])}),t=t.slice(0,t.length-1)+")";let{style:r}=D(this.shadowRoot,"#range");r.setProperty("--media-range-track-progress-internal",t)}getBarColors(){let e=this.range,t=e.value-e.min,a=e.max-e.min,r=t/a*100,s=0;return e.value>e.min&&e.value<e.max&&(s=Ae(this,ia)*(.5-r/100)/e.offsetWidth*100),[["var(--media-range-bar-color, #fff)",r+s],["var(--media-range-track-color, transparent)",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};ia=new WeakMap;me=new WeakMap;aa=new WeakMap;ra=new WeakMap;d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",sa);var ai=sa;var Dn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},na=(i,e,t)=>(Dn(i,e,"read from private field"),t?t.call(i):e.get(i)),fd=(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)},oa=(i,e,t,a)=>(Dn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),he,On=u.createElement("template");On.innerHTML=`
360
360
  <style>
361
361
  :host {
362
362
 
@@ -375,7 +375,7 @@
375
375
  </style>
376
376
 
377
377
  <slot></slot>
378
- `;var Ar=class extends d.HTMLElement{constructor(){super(),Ed(this,he,void 0),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(On.content.cloneNode(!0))}static get observedAttributes(){return[f.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===f.MEDIA_CONTROLLER&&(t&&((s=(r=na(this,he))==null?void 0:r.unassociateElement)==null||s.call(r,this),oa(this,he,null)),a&&(oa(this,he,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=na(this,he))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(f.MEDIA_CONTROLLER);r&&(oa(this,he,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=na(this,he))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=na(this,he))==null?void 0:e.unassociateElement)==null||t.call(e,this),oa(this,he,null)}};he=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",Ar);var Nn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},la=(i,e,t)=>(Nn(i,e,"read from private field"),t?t.call(i):e.get(i)),fd=(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)},da=(i,e,t,a)=>(Nn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),pe,Pn=u.createElement("template");Pn.innerHTML=`
378
+ `;var Ar=class extends d.HTMLElement{constructor(){super(),fd(this,he,void 0),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(On.content.cloneNode(!0))}static get observedAttributes(){return[E.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===E.MEDIA_CONTROLLER&&(t&&((s=(r=na(this,he))==null?void 0:r.unassociateElement)==null||s.call(r,this),oa(this,he,null)),a&&(oa(this,he,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=na(this,he))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(E.MEDIA_CONTROLLER);r&&(oa(this,he,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=na(this,he))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=na(this,he))==null?void 0:e.unassociateElement)==null||t.call(e,this),oa(this,he,null)}};he=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",Ar);var Nn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},la=(i,e,t)=>(Nn(i,e,"read from private field"),t?t.call(i):e.get(i)),Ed=(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)},da=(i,e,t,a)=>(Nn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),pe,Pn=u.createElement("template");Pn.innerHTML=`
379
379
  <style>
380
380
  :host {
381
381
  display: inline-flex;
@@ -408,7 +408,7 @@
408
408
  }
409
409
  </style>
410
410
  <slot></slot>
411
- `;var ca=class extends d.HTMLElement{constructor(){super(),fd(this,pe,void 0),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Pn.content.cloneNode(!0));let{style:e}=R(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return[f.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===f.MEDIA_CONTROLLER&&(t&&((s=(r=la(this,pe))==null?void 0:r.unassociateElement)==null||s.call(r,this),da(this,pe,null)),a&&(da(this,pe,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=la(this,pe))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(f.MEDIA_CONTROLLER);r&&(da(this,pe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=la(this,pe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=la(this,pe))==null?void 0:e.unassociateElement)==null||t.call(e,this),da(this,pe,null)}};pe=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",ca);var Oe=ca;var Bn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Un=(i,e,t)=>(Bn(i,e,"read from private field"),t?t.call(i):e.get(i)),vd=(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)},gd=(i,e,t,a)=>(Bn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ri,yr=class extends Oe{constructor(){super(),vd(this,ri,void 0),gd(this,ri,this.shadowRoot.querySelector("slot")),Un(this,ri).textContent=z(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_CURRENT_TIME&&(Un(this,ri).textContent=z(a)),super.attributeChangedCallback(e,t,a)}};ri=new WeakMap;d.customElements.get("media-current-time-display")||d.customElements.define("media-current-time-display",yr);var Hn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},$n=(i,e,t)=>(Hn(i,e,"read from private field"),t?t.call(i):e.get(i)),_d=(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)},Ad=(i,e,t,a)=>(Hn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),si,Tr=class extends Oe{constructor(){super(),_d(this,si,void 0),Ad(this,si,this.shadowRoot.querySelector("slot")),$n(this,si).textContent=z(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&($n(this,si).textContent=z(a)),super.attributeChangedCallback(e,t,a)}};si=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",Tr);var Fn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ir=(i,e,t)=>(Fn(i,e,"read from private field"),t?t.call(i):e.get(i)),yd=(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)},Td=(i,e,t,a)=>(Fn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),At,Wn=["Enter"," "],Id="&nbsp;/&nbsp;",Vn=(i,{timesSep:e=Id}={})=>{var t,a,r;let s=i.getAttribute("remaining")!=null,n=i.getAttribute("show-duration")!=null,l=(t=i.mediaCurrentTime)!=null?t:0,c=(r=(a=i.mediaDuration)!=null?a:i.mediaSeekableEnd)!=null?r:0,m=s?z(0-(c-l)):z(l);return n?`${m}${e}${z(c)}`:m},kd="video not loaded, unknown time.",Md=i=>{let e=i.mediaCurrentTime,t=i.mediaDuration||i.mediaSeekableEnd;if(e==null||t==null){i.setAttribute("aria-valuetext",kd);return}let a=i.hasAttribute("remaining"),r=i.hasAttribute("show-duration"),s=a?qe(0-(t-e)):qe(e);if(!r){i.setAttribute("aria-valuetext",s);return}let n=qe(t),l=`${s} of ${n}`;i.setAttribute("aria-valuetext",l)},kr=class extends Oe{constructor(){super(),yd(this,At,void 0),Td(this,At,this.shadowRoot.querySelector("slot")),Ir(this,At).innerHTML=`${Vn(this)}`;let{style:e}=R(this.shadowRoot,":host");e.setProperty("cursor","pointer")}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration","disabled"]}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",W.PLAYBACK_TIME());let e=t=>{let{key:a}=t;if(!Wn.includes(a)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",t=>{let{metaKey:a,altKey:r,key:s}=t;if(a||r||!Wn.includes(s)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining","")}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){if([o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"].includes(e)){let r=Vn(this);Md(this),r!==Ir(this,At).innerHTML&&(Ir(this,At).innerHTML=r)}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable());super.attributeChangedCallback(e,t,a)}enable(){this.setAttribute("tabindex",0)}disable(){this.removeAttribute("tabindex")}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}get mediaSeekableEnd(){var e;let[,t]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t]=(e=this.mediaSeekable)!=null?e:[];return t}};At=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",kr);var Sd=`<svg aria-hidden="true" viewBox="0 0 26 24">
411
+ `;var ca=class extends d.HTMLElement{constructor(){super(),Ed(this,pe,void 0),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Pn.content.cloneNode(!0));let{style:e}=D(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return[E.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===E.MEDIA_CONTROLLER&&(t&&((s=(r=la(this,pe))==null?void 0:r.unassociateElement)==null||s.call(r,this),da(this,pe,null)),a&&(da(this,pe,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=la(this,pe))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(E.MEDIA_CONTROLLER);r&&(da(this,pe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=la(this,pe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=la(this,pe))==null?void 0:e.unassociateElement)==null||t.call(e,this),da(this,pe,null)}};pe=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",ca);var Oe=ca;var Bn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Un=(i,e,t)=>(Bn(i,e,"read from private field"),t?t.call(i):e.get(i)),vd=(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)},gd=(i,e,t,a)=>(Bn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ri,yr=class extends Oe{constructor(){super(),vd(this,ri,void 0),gd(this,ri,this.shadowRoot.querySelector("slot")),Un(this,ri).textContent=z(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_CURRENT_TIME&&(Un(this,ri).textContent=z(a)),super.attributeChangedCallback(e,t,a)}};ri=new WeakMap;d.customElements.get("media-current-time-display")||d.customElements.define("media-current-time-display",yr);var Hn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},$n=(i,e,t)=>(Hn(i,e,"read from private field"),t?t.call(i):e.get(i)),_d=(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)},Ad=(i,e,t,a)=>(Hn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),si,Tr=class extends Oe{constructor(){super(),_d(this,si,void 0),Ad(this,si,this.shadowRoot.querySelector("slot")),$n(this,si).textContent=z(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&($n(this,si).textContent=z(a)),super.attributeChangedCallback(e,t,a)}};si=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",Tr);var Fn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ir=(i,e,t)=>(Fn(i,e,"read from private field"),t?t.call(i):e.get(i)),yd=(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)},Td=(i,e,t,a)=>(Fn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),At,Wn=["Enter"," "],Id="&nbsp;/&nbsp;",Vn=(i,{timesSep:e=Id}={})=>{var t,a,r;let s=i.getAttribute("remaining")!=null,n=i.getAttribute("show-duration")!=null,l=(t=i.mediaCurrentTime)!=null?t:0,c=(r=(a=i.mediaDuration)!=null?a:i.mediaSeekableEnd)!=null?r:0,m=s?z(0-(c-l)):z(l);return n?`${m}${e}${z(c)}`:m},kd="video not loaded, unknown time.",Md=i=>{let e=i.mediaCurrentTime,t=i.mediaDuration||i.mediaSeekableEnd;if(e==null||t==null){i.setAttribute("aria-valuetext",kd);return}let a=i.hasAttribute("remaining"),r=i.hasAttribute("show-duration"),s=a?qe(0-(t-e)):qe(e);if(!r){i.setAttribute("aria-valuetext",s);return}let n=qe(t),l=`${s} of ${n}`;i.setAttribute("aria-valuetext",l)},kr=class extends Oe{constructor(){super(),yd(this,At,void 0),Td(this,At,this.shadowRoot.querySelector("slot")),Ir(this,At).innerHTML=`${Vn(this)}`;let{style:e}=D(this.shadowRoot,":host");e.setProperty("cursor","pointer")}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration","disabled"]}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",W.PLAYBACK_TIME());let e=t=>{let{key:a}=t;if(!Wn.includes(a)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",t=>{let{metaKey:a,altKey:r,key:s}=t;if(a||r||!Wn.includes(s)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining","")}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){if([o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"].includes(e)){let r=Vn(this);Md(this),r!==Ir(this,At).innerHTML&&(Ir(this,At).innerHTML=r)}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable());super.attributeChangedCallback(e,t,a)}enable(){this.setAttribute("tabindex",0)}disable(){this.removeAttribute("tabindex")}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}get mediaSeekableEnd(){var e;let[,t]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t]=(e=this.mediaSeekable)!=null?e:[];return t}};At=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",kr);var Sd=`<svg aria-hidden="true" viewBox="0 0 26 24">
412
412
  <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"/>
413
413
  </svg>`,wd=`<svg aria-hidden="true" viewBox="0 0 26 24">
414
414
  <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"/>
@@ -573,7 +573,7 @@
573
573
  </style>
574
574
 
575
575
  <img aria-hidden="true" id="image"/>
576
- `;var Hd=i=>{i.style.removeProperty("background-image")},Wd=(i,e)=>{i.style["background-image"]=`url('${e}')`},Nr=class extends d.HTMLElement{static get observedAttributes(){return["placeholder-src","src"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(lo.content.cloneNode(!0)),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e==="src"&&(a==null?this.image.removeAttribute("src"):this.image.setAttribute("src",a)),e==="placeholder-src"&&(a==null?Hd(this.image):Wd(this.image,a))}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Nr);var Wr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},U=(i,e,t)=>(Wr(i,e,"read from private field"),t?t.call(i):e.get(i)),q=(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)},Ne=(i,e,t,a)=>(Wr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),oi=(i,e,t)=>(Wr(i,e,"access private method"),t),li,ma,di,Ea,fa,ha,Ur,pa,Tt,ci,Br,va,_a,ba,$r,Hr,co,Vd="video not loaded, unknown time.",Pr=i=>{let e=i.range,t=qe(+e.value),a=qe(+e.max),r=t&&a?`${t} of ${a}`:Vd;e.setAttribute("aria-valuetext",r)},uo=u.createElement("template");uo.innerHTML=`
576
+ `;var Hd=i=>{i.style.removeProperty("background-image")},Wd=(i,e)=>{i.style["background-image"]=`url('${e}')`},Nr=class extends d.HTMLElement{static get observedAttributes(){return["placeholder-src","src"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(lo.content.cloneNode(!0)),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e==="src"&&(a==null?this.image.removeAttribute("src"):this.image.setAttribute("src",a)),e==="placeholder-src"&&(a==null?Hd(this.image):Wd(this.image,a))}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Nr);var Wr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},B=(i,e,t)=>(Wr(i,e,"read from private field"),t?t.call(i):e.get(i)),q=(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)},Ne=(i,e,t,a)=>(Wr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),oi=(i,e,t)=>(Wr(i,e,"access private method"),t),li,ma,di,fa,Ea,ha,Ur,pa,Tt,ci,Br,va,_a,ba,$r,Hr,co,Vd="video not loaded, unknown time.",Pr=i=>{let e=i.range,t=qe(+e.value),a=qe(+e.max),r=t&&a?`${t} of ${a}`:Vd;e.setAttribute("aria-valuetext",r)},uo=u.createElement("template");uo.innerHTML=`
577
577
  <style>
578
578
  :host {
579
579
  --media-preview-background-color: rgba(20,20,30, .5);
@@ -683,9 +683,9 @@
683
683
 
684
684
  </slot>
685
685
  </div>
686
- `;var ga=class extends ai{constructor(){super(),q(this,ha),q(this,ba),q(this,Hr),q(this,li,void 0),q(this,ma,void 0),q(this,di,void 0),q(this,Ea,void 0),q(this,fa,void 0),q(this,pa,t=>{if([...U(this,li)].some(E=>t.composedPath().includes(E)))return;this.updatePointerBar(t);let a=+this.getAttribute(o.MEDIA_DURATION);if(!a)return;let r=this.range.getBoundingClientRect(),s=(t.clientX-r.left)/r.width;s=Math.max(0,Math.min(1,s));let n=oi(this,ha,Ur).call(this,U(this,ma),s),{style:l}=R(this.shadowRoot,"#preview-rail");l.transform=`translateX(${n})`;let c=s*a,m=new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:c});this.dispatchEvent(m)}),q(this,Tt,!1),q(this,ci,t=>{(!t.composedPath().includes(this)||[...U(this,li)].some(a=>t.composedPath().includes(a)))&&(d.removeEventListener("pointermove",U(this,ci)),Ne(this,Tt,!1),U(this,va).call(this))}),q(this,Br,()=>{d.addEventListener("pointermove",U(this,pa),!1)}),q(this,va,()=>{d.removeEventListener("pointermove",U(this,pa));let t=new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(t)}),q(this,_a,()=>{let t=this.getAttribute(o.MEDIA_DURATION);!U(this,Tt)&&t&&(Ne(this,Tt,!0),U(this,Br).call(this),d.addEventListener("pointermove",U(this,ci),!1))}),this.container.appendChild(uo.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let a=this.range.value,r=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(r)}),this._refreshBar=()=>{let t=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+t*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},Ne(this,li,this.shadowRoot.querySelectorAll('[part~="box"]')),Ne(this,ma,this.shadowRoot.querySelector('[part~="preview-box"]')),Ne(this,di,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);Ne(this,Ea,parseInt(e.getPropertyValue("--media-box-padding-left"))),Ne(this,fa,parseInt(e.getPropertyValue("--media-box-padding-right"))),oi(this,ba,$r).call(this)}static get observedAttributes(){return[...super.observedAttributes,"thumbnails","disabled",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]}connectedCallback(){this.range.setAttribute("aria-label",W.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(e,t,a){var r,s,n,l,c;(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,Pr(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),e===o.MEDIA_DURATION&&(this.range.max=(s=(r=this.mediaSeekableEnd)!=null?r:this.mediaDuration)!=null?s:1e3,Pr(this),this.updateBar(),this.updateCurrentBox()),e===o.MEDIA_SEEKABLE&&(this.range.min=(n=this.mediaSeekableStart)!=null?n:0,this.range.max=(c=(l=this.mediaSeekableEnd)!=null?l:this.mediaDuration)!=null?c:1e3,Pr(this),this.updateBar()),e===o.MEDIA_BUFFERED&&this.updateBar(),e==="disabled"&&(a==null?oi(this,ba,$r).call(this):oi(this,Hr,co).call(this)),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return this.hasAttribute(o.MEDIA_PAUSED)}get mediaLoading(){return this.hasAttribute(o.MEDIA_LOADING)}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaPlaybackRate(){let e=this.getAttribute(o.MEDIA_PLAYBACK_RATE);return e!=null?+e:1}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}get mediaSeekableEnd(){var e;let[,t]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t]=(e=this.mediaSeekable)!=null?e:[];return t}getBarColors(){var e;let t=super.getBarColors(),{range:a}=this,r=a.max-a.min,s=this.mediaBuffered;if(!s.length||!Number.isFinite(r)||r<=0)return t;let n=this.mediaCurrentTime,[,l=a.min]=(e=s.find(([E,v])=>E<=n&&n<=v))!=null?e:[],m=(l-a.min)/r*100;return t.splice(1,0,["var(--media-time-buffered-color, rgba(255,255,255, .4))",m]),t}updateCurrentBox(){if(!U(this,di).assignedElements().length)return;let e=this.range.value/(this.range.max-this.range.min),t=oi(this,ha,Ur).call(this,U(this,di),e),{style:a}=R(this.shadowRoot,"#current-rail");a.transform=`translateX(${t})`}};li=new WeakMap;ma=new WeakMap;di=new WeakMap;Ea=new WeakMap;fa=new WeakMap;ha=new WeakSet;Ur=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let s=(t=this.getAttribute("bounds")?Qe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,n=this.range.getBoundingClientRect(),l=s.getBoundingClientRect(),c=(U(this,Ea)-(n.left-l.left-r/2))/n.width*100,m=(l.right-n.left-r/2-U(this,fa))/n.width*100;return Number.isNaN(c)||(a=`max(${c*100}%, ${a})`),Number.isNaN(m)||(a=`min(${a}, ${m*100}%)`),a};pa=new WeakMap;Tt=new WeakMap;ci=new WeakMap;Br=new WeakMap;va=new WeakMap;_a=new WeakMap;ba=new WeakSet;$r=function(){this.addEventListener("pointermove",U(this,_a),!1)};Hr=new WeakSet;co=function(){d.removeEventListener("pointermove",U(this,ci)),this.removeEventListener("pointermove",U(this,_a)),Ne(this,Tt,!1),U(this,va).call(this)};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",ga);var Vr=ga;var Fr=class extends Vr{constructor(){super(),console.warn("MediaChrome: <media-progress-range> is deprecated. Use <media-time-range> instead.")}};d.customElements.get("media-progress-range")||d.customElements.define("media-progress-range",Fr);var Kr="30",Fd=`<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)">${Kr}</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>`,po=u.createElement("template");po.innerHTML=`
686
+ `;var ga=class extends ai{constructor(){super(),q(this,ha),q(this,ba),q(this,Hr),q(this,li,void 0),q(this,ma,void 0),q(this,di,void 0),q(this,fa,void 0),q(this,Ea,void 0),q(this,pa,t=>{if([...B(this,li)].some(f=>t.composedPath().includes(f)))return;this.updatePointerBar(t);let a=+this.getAttribute(o.MEDIA_DURATION);if(!a)return;let r=this.range.getBoundingClientRect(),s=(t.clientX-r.left)/r.width;s=Math.max(0,Math.min(1,s));let n=oi(this,ha,Ur).call(this,B(this,ma),s),{style:l}=D(this.shadowRoot,"#preview-rail");l.transform=`translateX(${n})`;let c=s*a,m=new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:c});this.dispatchEvent(m)}),q(this,Tt,!1),q(this,ci,t=>{(!t.composedPath().includes(this)||[...B(this,li)].some(a=>t.composedPath().includes(a)))&&(d.removeEventListener("pointermove",B(this,ci)),Ne(this,Tt,!1),B(this,va).call(this))}),q(this,Br,()=>{d.addEventListener("pointermove",B(this,pa),!1)}),q(this,va,()=>{d.removeEventListener("pointermove",B(this,pa));let t=new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(t)}),q(this,_a,()=>{let t=this.getAttribute(o.MEDIA_DURATION);!B(this,Tt)&&t&&(Ne(this,Tt,!0),B(this,Br).call(this),d.addEventListener("pointermove",B(this,ci),!1))}),this.container.appendChild(uo.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let a=this.range.value,r=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(r)}),this._refreshBar=()=>{let t=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+t*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},Ne(this,li,this.shadowRoot.querySelectorAll('[part~="box"]')),Ne(this,ma,this.shadowRoot.querySelector('[part~="preview-box"]')),Ne(this,di,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);Ne(this,fa,parseInt(e.getPropertyValue("--media-box-padding-left"))),Ne(this,Ea,parseInt(e.getPropertyValue("--media-box-padding-right"))),oi(this,ba,$r).call(this)}static get observedAttributes(){return[...super.observedAttributes,"thumbnails","disabled",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]}connectedCallback(){this.range.setAttribute("aria-label",W.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(e,t,a){var r,s,n,l,c;(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,Pr(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),e===o.MEDIA_DURATION&&(this.range.max=(s=(r=this.mediaSeekableEnd)!=null?r:this.mediaDuration)!=null?s:1e3,Pr(this),this.updateBar(),this.updateCurrentBox()),e===o.MEDIA_SEEKABLE&&(this.range.min=(n=this.mediaSeekableStart)!=null?n:0,this.range.max=(c=(l=this.mediaSeekableEnd)!=null?l:this.mediaDuration)!=null?c:1e3,Pr(this),this.updateBar()),e===o.MEDIA_BUFFERED&&this.updateBar(),e==="disabled"&&(a==null?oi(this,ba,$r).call(this):oi(this,Hr,co).call(this)),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return this.hasAttribute(o.MEDIA_PAUSED)}get mediaLoading(){return this.hasAttribute(o.MEDIA_LOADING)}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaPlaybackRate(){let e=this.getAttribute(o.MEDIA_PLAYBACK_RATE);return e!=null?+e:1}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}get mediaSeekableEnd(){var e;let[,t]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t]=(e=this.mediaSeekable)!=null?e:[];return t}getBarColors(){var e;let t=super.getBarColors(),{range:a}=this,r=a.max-a.min,s=this.mediaBuffered;if(!s.length||!Number.isFinite(r)||r<=0)return t;let n=this.mediaCurrentTime,[,l=a.min]=(e=s.find(([f,_])=>f<=n&&n<=_))!=null?e:[],m=(l-a.min)/r*100;return t.splice(1,0,["var(--media-time-buffered-color, rgba(255,255,255, .4))",m]),t}updateCurrentBox(){if(!B(this,di).assignedElements().length)return;let e=this.range.value/(this.range.max-this.range.min),t=oi(this,ha,Ur).call(this,B(this,di),e),{style:a}=D(this.shadowRoot,"#current-rail");a.transform=`translateX(${t})`}};li=new WeakMap;ma=new WeakMap;di=new WeakMap;fa=new WeakMap;Ea=new WeakMap;ha=new WeakSet;Ur=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let s=(t=this.getAttribute("bounds")?Qe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,n=this.range.getBoundingClientRect(),l=s.getBoundingClientRect(),c=(B(this,fa)-(n.left-l.left-r/2))/n.width*100,m=(l.right-n.left-r/2-B(this,Ea))/n.width*100;return Number.isNaN(c)||(a=`max(${c*100}%, ${a})`),Number.isNaN(m)||(a=`min(${a}, ${m*100}%)`),a};pa=new WeakMap;Tt=new WeakMap;ci=new WeakMap;Br=new WeakMap;va=new WeakMap;_a=new WeakMap;ba=new WeakSet;$r=function(){this.addEventListener("pointermove",B(this,_a),!1)};Hr=new WeakSet;co=function(){d.removeEventListener("pointermove",B(this,ci)),this.removeEventListener("pointermove",B(this,_a)),Ne(this,Tt,!1),B(this,va).call(this)};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",ga);var Vr=ga;var Fr=class extends Vr{constructor(){super(),console.warn("MediaChrome: <media-progress-range> is deprecated. Use <media-time-range> instead.")}};d.customElements.get("media-progress-range")||d.customElements.define("media-progress-range",Fr);var Kr="30",Fd=`<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)">${Kr}</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>`,po=u.createElement("template");po.innerHTML=`
687
687
  <slot name="backward">${Fd}</slot>
688
- `;var Kd=0,mo=i=>{let e=Math.abs(+i.getAttribute("seek-offset")),t=C.SEEK_BACK_N_SECS({seekOffset:e});i.setAttribute("aria-label",t)},ho=i=>{let e=Hi(i,"backward"),t=i.getAttribute("seek-offset");$i(e,t)},Yr=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(e={}){super({slotTemplate:po,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",Kr),mo(this),ho(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",Kr),ho(this),mo(this)),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),t=+this.getAttribute("seek-offset"),a=e&&!Number.isNaN(+e)?+e:Kd,r=Math.max(a-t,0),s=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(s)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",Yr);var Eo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},bo=(i,e,t)=>(Eo(i,e,"read from private field"),t?t.call(i):e.get(i)),Yd=(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)},Gd=(i,e,t,a)=>(Eo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ui,Gr=class extends Oe{constructor(){super(),Yd(this,ui,void 0),Gd(this,ui,this.shadowRoot.querySelector("slot")),bo(this,ui).textContent=z(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_PREVIEW_TIME&&a!=null&&(bo(this,ui).textContent=z(a)),super.attributeChangedCallback(e,t,a)}};ui=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Gr);var fo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Aa=(i,e,t)=>(fo(i,e,"read from private field"),t?t.call(i):e.get(i)),Zd=(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)},ya=(i,e,t,a)=>(fo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),be,vo=u.createElement("template");vo.innerHTML=`
688
+ `;var Kd=0,mo=i=>{let e=Math.abs(+i.getAttribute("seek-offset")),t=C.SEEK_BACK_N_SECS({seekOffset:e});i.setAttribute("aria-label",t)},ho=i=>{let e=Hi(i,"backward"),t=i.getAttribute("seek-offset");$i(e,t)},Yr=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(e={}){super({slotTemplate:po,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",Kr),mo(this),ho(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",Kr),ho(this),mo(this)),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),t=+this.getAttribute("seek-offset"),a=e&&!Number.isNaN(+e)?+e:Kd,r=Math.max(a-t,0),s=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(s)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",Yr);var fo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},bo=(i,e,t)=>(fo(i,e,"read from private field"),t?t.call(i):e.get(i)),Yd=(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)},Gd=(i,e,t,a)=>(fo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ui,Gr=class extends Oe{constructor(){super(),Yd(this,ui,void 0),Gd(this,ui,this.shadowRoot.querySelector("slot")),bo(this,ui).textContent=z(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_PREVIEW_TIME&&a!=null&&(bo(this,ui).textContent=z(a)),super.attributeChangedCallback(e,t,a)}};ui=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Gr);var Eo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Aa=(i,e,t)=>(Eo(i,e,"read from private field"),t?t.call(i):e.get(i)),Zd=(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)},ya=(i,e,t,a)=>(Eo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),be,vo=u.createElement("template");vo.innerHTML=`
689
689
  <style>
690
690
  :host {
691
691
  box-sizing: border-box;
@@ -699,7 +699,7 @@
699
699
  }
700
700
  </style>
701
701
  <img crossorigin loading="eager" decoding="async" />
702
- `;var Zr=class extends d.HTMLElement{constructor(){super(),Zd(this,be,void 0),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(vo.content.cloneNode(!0))}static get observedAttributes(){return[f.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(f.MEDIA_CONTROLLER);r&&(ya(this,be,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Aa(this,be))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Aa(this,be))==null?void 0:e.unassociateElement)==null||t.call(e,this),ya(this,be,null)}attributeChangedCallback(e,t,a){var r,s,n,l,c;["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===f.MEDIA_CONTROLLER&&(t&&((s=(r=Aa(this,be))==null?void 0:r.unassociateElement)==null||s.call(r,this),ya(this,be,null)),a&&(ya(this,be,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=Aa(this,be))==null?void 0:l.associateElement)==null||c.call(l,this)))}update(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS),t=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(e&&t))return;let[a,r,s,n]=e.split(/\s+/).map(Ni=>+Ni),l=t.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:E,minWidth:v,minHeight:_}=c,T=Math.min(parseInt(m)/s,parseInt(E)/n),$=Math.max(parseInt(v)/s,parseInt(_)/n),k=T<1,H=k?T:$>1?$:1,{style:ce}=R(this.shadowRoot,":host"),ae=R(this.shadowRoot,"img").style,xe=this.shadowRoot.querySelector("img"),Vt=k?"min":"max";ce.setProperty(`${Vt}-width`,"initial","important"),ce.setProperty(`${Vt}-height`,"initial","important"),ce.width=`${s*H}px`,ce.height=`${n*H}px`;let mt=()=>{ae.width=`${this.imgWidth*H}px`,ae.height=`${this.imgHeight*H}px`,ae.display="block"};xe.src!==l&&(xe.onload=()=>{this.imgWidth=xe.naturalWidth,this.imgHeight=xe.naturalHeight,mt()},xe.src=l,mt()),mt(),ae.transform=`translate(-${a*H}px, -${r*H}px)`}};be=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Zr);var go=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ta=(i,e,t)=>(go(i,e,"read from private field"),t?t.call(i):e.get(i)),qd=(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)=>(go(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ee,_o=u.createElement("template"),Qd=`
702
+ `;var Zr=class extends d.HTMLElement{constructor(){super(),Zd(this,be,void 0),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(vo.content.cloneNode(!0))}static get observedAttributes(){return[E.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(E.MEDIA_CONTROLLER);r&&(ya(this,be,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Aa(this,be))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Aa(this,be))==null?void 0:e.unassociateElement)==null||t.call(e,this),ya(this,be,null)}attributeChangedCallback(e,t,a){var r,s,n,l,c;["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===E.MEDIA_CONTROLLER&&(t&&((s=(r=Aa(this,be))==null?void 0:r.unassociateElement)==null||s.call(r,this),ya(this,be,null)),a&&(ya(this,be,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=Aa(this,be))==null?void 0:l.associateElement)==null||c.call(l,this)))}update(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS),t=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(e&&t))return;let[a,r,s,n]=e.split(/\s+/).map(Ni=>+Ni),l=t.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:f,minWidth:_,minHeight:g}=c,y=Math.min(parseInt(m)/s,parseInt(f)/n),x=Math.max(parseInt(_)/s,parseInt(g)/n),$=y<1,k=$?y:x>1?x:1,{style:_e}=D(this.shadowRoot,":host"),ce=D(this.shadowRoot,"img").style,J=this.shadowRoot.querySelector("img"),Vt=$?"min":"max";_e.setProperty(`${Vt}-width`,"initial","important"),_e.setProperty(`${Vt}-height`,"initial","important"),_e.width=`${s*k}px`,_e.height=`${n*k}px`;let mt=()=>{ce.width=`${this.imgWidth*k}px`,ce.height=`${this.imgHeight*k}px`,ce.display="block"};J.src!==l&&(J.onload=()=>{this.imgWidth=J.naturalWidth,this.imgHeight=J.naturalHeight,mt()},J.src=l,mt()),mt(),ce.transform=`translate(-${a*k}px, -${r*k}px)`}};be=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Zr);var go=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ta=(i,e,t)=>(go(i,e,"read from private field"),t?t.call(i):e.get(i)),qd=(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)=>(go(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),fe,_o=u.createElement("template"),Qd=`
703
703
  <svg aria-hidden="true" viewBox="0 0 100 100">
704
704
  <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">
705
705
  <animateTransform
@@ -751,13 +751,13 @@ svg, img, ::slotted(svg), ::slotted(img) {
751
751
 
752
752
  <slot name="loading">${Qd}</slot>
753
753
  <div id="status" role="status" aria-live="polite">${W.MEDIA_LOADING()}</div>
754
- `;var zd=500,qr=class extends d.HTMLElement{constructor(){super(),qd(this,Ee,void 0);let e=this.attachShadow({mode:"open"}),t=_o.content.cloneNode(!0);e.appendChild(t)}static get observedAttributes(){return[f.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,"loading-delay"]}attributeChangedCallback(e,t,a){var r,s,n,l,c,m;if(e===o.MEDIA_LOADING||e===o.MEDIA_PAUSED){let E=this.getAttribute(o.MEDIA_PAUSED)!=null,v=this.getAttribute(o.MEDIA_LOADING)!=null,_=!E&&v;if(!_)this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),this.removeAttribute("is-loading");else if(!this.loadingDelayHandle&&_){let T=+((r=this.getAttribute("loading-delay"))!=null?r:zd);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},T)}}else e===f.MEDIA_CONTROLLER&&(t&&((n=(s=Ta(this,Ee))==null?void 0:s.unassociateElement)==null||n.call(s,this),Ia(this,Ee,null)),a&&(Ia(this,Ee,(l=this.getRootNode())==null?void 0:l.getElementById(a)),(m=(c=Ta(this,Ee))==null?void 0:c.associateElement)==null||m.call(c,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(f.MEDIA_CONTROLLER);r&&(Ia(this,Ee,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ta(this,Ee))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),(t=(e=Ta(this,Ee))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ia(this,Ee,null)}};Ee=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",qr);var Ao=u.createElement("template");Ao.innerHTML=`
754
+ `;var zd=500,qr=class extends d.HTMLElement{constructor(){super(),qd(this,fe,void 0);let e=this.attachShadow({mode:"open"}),t=_o.content.cloneNode(!0);e.appendChild(t)}static get observedAttributes(){return[E.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,"loading-delay"]}attributeChangedCallback(e,t,a){var r,s,n,l,c,m;if(e===o.MEDIA_LOADING||e===o.MEDIA_PAUSED){let f=this.getAttribute(o.MEDIA_PAUSED)!=null,_=this.getAttribute(o.MEDIA_LOADING)!=null,g=!f&&_;if(!g)this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),this.removeAttribute("is-loading");else if(!this.loadingDelayHandle&&g){let y=+((r=this.getAttribute("loading-delay"))!=null?r:zd);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},y)}}else e===E.MEDIA_CONTROLLER&&(t&&((n=(s=Ta(this,fe))==null?void 0:s.unassociateElement)==null||n.call(s,this),Ia(this,fe,null)),a&&(Ia(this,fe,(l=this.getRootNode())==null?void 0:l.getElementById(a)),(m=(c=Ta(this,fe))==null?void 0:c.associateElement)==null||m.call(c,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(E.MEDIA_CONTROLLER);r&&(Ia(this,fe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ta(this,fe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),(t=(e=Ta(this,fe))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ia(this,fe,null)}};fe=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",qr);var Ao=u.createElement("template");Ao.innerHTML=`
755
755
  <style>
756
756
  :host {
757
757
  }
758
758
  </style>
759
759
  <slot></slot>
760
- `;var Qr=class extends d.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ao.content.cloneNode(!0))}};d.customElements.get("media-title-bar")||d.customElements.define("media-title-bar",Qr);var Xd=100,Jd=i=>{var e;if(i.getAttribute(o.MEDIA_MUTED)!=null)return 0;let a=+((e=i.getAttribute(o.MEDIA_VOLUME))!=null?e:1);return Math.round(a*i.range.max)},jd=({value:i,max:e})=>`${Math.round(i/e*100)}%`,zr=class extends ai{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=Xd,this.range.addEventListener("input",()=>{let t=this.range.value/this.range.max,a=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",W.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,t,a){if(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED){let r=Jd(this);this.range.value=r,this.range.setAttribute("aria-valuetext",jd(this.range)),this.updateBar()}super.attributeChangedCallback(e,t,a)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",zr);var Xr=class extends ti{};d.customElements.get("media-chrome")||d.customElements.define("media-chrome",Xr);var Jr=class extends ti{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};d.customElements.get("media-container")||d.customElements.define("media-container",Jr);var is=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},M=(i,e,t)=>(is(i,e,"read from private field"),t?t.call(i):e.get(i)),ee=(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)},fe=(i,e,t,a)=>(is(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),mi=(i,e,t)=>(is(i,e,"access private method"),t),Pe,kt,hi,wt,Ae,Mt,jr,je,St,ka,It,es,pi,Ma,ts,yo,as,To,Io=u.createElement("template");Io.innerHTML=`
760
+ `;var Qr=class extends d.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ao.content.cloneNode(!0))}};d.customElements.get("media-title-bar")||d.customElements.define("media-title-bar",Qr);var Xd=100,Jd=i=>{var e;if(i.getAttribute(o.MEDIA_MUTED)!=null)return 0;let a=+((e=i.getAttribute(o.MEDIA_VOLUME))!=null?e:1);return Math.round(a*i.range.max)},jd=({value:i,max:e})=>`${Math.round(i/e*100)}%`,zr=class extends ai{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=Xd,this.range.addEventListener("input",()=>{let t=this.range.value/this.range.max,a=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",W.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,t,a){if(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED){let r=Jd(this);this.range.value=r,this.range.setAttribute("aria-valuetext",jd(this.range)),this.updateBar()}super.attributeChangedCallback(e,t,a)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",zr);var Xr=class extends ti{};d.customElements.get("media-chrome")||d.customElements.define("media-chrome",Xr);var Jr=class extends ti{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};d.customElements.get("media-container")||d.customElements.define("media-container",Jr);var is=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},M=(i,e,t)=>(is(i,e,"read from private field"),t?t.call(i):e.get(i)),te=(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)},Ee=(i,e,t,a)=>(is(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),mi=(i,e,t)=>(is(i,e,"access private method"),t),Pe,kt,hi,wt,ye,Mt,jr,je,St,ka,It,es,pi,Ma,ts,yo,as,To,Io=u.createElement("template");Io.innerHTML=`
761
761
  <style>
762
762
  :host ul {
763
763
  list-style: none;
@@ -791,7 +791,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
791
791
  <ul tabindex="0">
792
792
  <slot></slot>
793
793
  </ul>
794
- `;var Sa=class extends d.HTMLElement{constructor(e={}){super(),ee(this,Ae),ee(this,je),ee(this,pi),ee(this,ts),ee(this,as),ee(this,Pe,""),ee(this,kt,null),ee(this,hi,void 0),ee(this,wt,void 0),ee(this,ka,s=>{this.handleClick(s)}),ee(this,It,s=>{let{key:n}=s;if(n==="Escape"){this.removeEventListener("keyup",M(this,It));return}n==="Enter"||n===" "?this.handleSelection(s):this.handleMovement(s)}),ee(this,es,s=>{let{metaKey:n,altKey:l}=s;if(n||l){this.removeEventListener("keyup",M(this,It));return}s.preventDefault(),this.addEventListener("keyup",M(this,It),{once:!0})});let t=this.attachShadow({mode:"open"}),a=Io.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=u.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a),fe(this,hi,this.shadowRoot.querySelector("slot")),M(this,hi).addEventListener("slotchange",()=>{fe(this,Ae,M(this,hi).assignedElements({flatten:!0}),jr),M(this,Ae,Mt).length===1&&M(this,Ae,Mt)[0].nodeName.toLowerCase()==="slot"&&fe(this,Ae,M(this,Ae,Mt)[0].assignedElements({flatten:!0}),jr);let s=M(this,je,St);if(s.some(c=>c.getAttribute("tabindex")==="0"))return;let l=s.filter(c=>c.getAttribute("aria-selected")==="true")[0];l||(l=s[0]),l&&(l.setAttribute("tabindex",0),l.setAttribute("aria-selected","true"))})}static get observedAttributes(){return["disabled",f.MEDIA_CONTROLLER]}get selectedOptions(){return M(this,je,St).filter(e=>e.getAttribute("aria-selected")==="true")}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",M(this,ka)),this.addEventListener("keydown",M(this,es))}disable(){this.removeEventListener("click",M(this,ka)),this.removeEventListener("keyup",M(this,It))}attributeChangedCallback(e,t,a){var r,s;if(e===f.MEDIA_CONTROLLER){if(t){let n=u.getElementById(t);(r=n==null?void 0:n.unassociateElement)==null||r.call(n,this)}if(a){let n=u.getElementById(a);(s=n==null?void 0:n.associateElement)==null||s.call(n,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let t=this.getAttribute(f.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(f.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e){let t=mi(this,pi,Ma).call(this,e);if(!t)return;let a=t.getAttribute("aria-selected")==="true";this.getAttribute("aria-multiselectable")!=="true"&&M(this,Ae,Mt).forEach(r=>r.setAttribute("aria-selected","false")),a?t.setAttribute("aria-selected","false"):t.setAttribute("aria-selected","true"),this.dispatchEvent(new Event("change"))}handleMovement(e){let{key:t}=e,a=M(this,je,St),r=mi(this,pi,Ma).call(this,e);r||(r=a.filter(n=>n.getAttribute("tabindex")==="0")[0]);let s;switch(t){case"ArrowDown":s=r.nextElementSibling,s!=null&&s.hasAttribute("disabled")&&(s=s.nextElementSibling);break;case"ArrowUp":s=r.previousElementSibling,s!=null&&s.hasAttribute("disabled")&&(s=s.previousElementSibling);break;case"Home":s=a[0];break;case"End":s=a[a.length-1];break;default:s=mi(this,ts,yo).call(this,t);break}s&&(a.forEach(n=>n.setAttribute("tabindex","-1")),s.setAttribute("tabindex","0"),s.focus())}handleClick(e){let t=mi(this,pi,Ma).call(this,e);!t||t.hasAttribute("disabled")||(M(this,je,St).forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e))}};Pe=new WeakMap;kt=new WeakMap;hi=new WeakMap;wt=new WeakMap;Ae=new WeakSet;Mt=function(){return M(this,wt)||fe(this,wt,Array.from(this.shadowRoot.querySelectorAll("media-chrome-listitem"))),M(this,wt)};jr=function(i){fe(this,wt,i)};je=new WeakSet;St=function(){return M(this,Ae,Mt).filter(i=>!i.hasAttribute("disabled"))};ka=new WeakMap;It=new WeakMap;es=new WeakMap;pi=new WeakSet;Ma=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-LISTITEM");return e[t]};ts=new WeakSet;yo=function(i){mi(this,as,To).call(this);let e=M(this,je,St),t=e.findIndex(m=>m.getAttribute("tabindex")==="0");fe(this,Pe,M(this,Pe)+i);let a=M(this,Pe).split("").every(m=>m===i),r=e.slice(t+(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(M(this,Pe))),s=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(M(this,Pe))),n=[],l=[];return a&&(n=e.slice(t+(a?1:0)).filter(m=>m.textContent.startsWith(i)),l=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.startsWith(i))),[...r,...s,...n,...l][0]};as=new WeakSet;To=function(){d.clearTimeout(M(this,kt)),fe(this,kt,null),fe(this,kt,d.setTimeout(()=>{fe(this,Pe,""),fe(this,kt,null)},500))};d.customElements.get("media-chrome-listbox")||d.customElements.define("media-chrome-listbox",Sa);var ko=Sa;var ns=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},b=(i,e,t)=>(ns(i,e,"read from private field"),t?t.call(i):e.get(i)),F=(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)},te=(i,e,t,a)=>(ns(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ye=(i,e,t)=>(ns(i,e,"access private method"),t),Ct,bi,Lt,N,Ei,L,ve,fi,et,xt,wa,rs,Mo,ss,So,Rt,vi,os,wo,Ca,ls,Co=u.createElement("template");Co.innerHTML=`
794
+ `;var Sa=class extends d.HTMLElement{constructor(e={}){super(),te(this,ye),te(this,je),te(this,pi),te(this,ts),te(this,as),te(this,Pe,""),te(this,kt,null),te(this,hi,void 0),te(this,wt,void 0),te(this,ka,s=>{this.handleClick(s)}),te(this,It,s=>{let{key:n}=s;if(n==="Escape"){this.removeEventListener("keyup",M(this,It));return}n==="Enter"||n===" "?this.handleSelection(s):this.handleMovement(s)}),te(this,es,s=>{let{metaKey:n,altKey:l}=s;if(n||l){this.removeEventListener("keyup",M(this,It));return}s.preventDefault(),this.addEventListener("keyup",M(this,It),{once:!0})});let t=this.attachShadow({mode:"open"}),a=Io.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=u.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a),Ee(this,hi,this.shadowRoot.querySelector("slot")),M(this,hi).addEventListener("slotchange",()=>{Ee(this,ye,M(this,hi).assignedElements({flatten:!0}),jr),M(this,ye,Mt).length===1&&M(this,ye,Mt)[0].nodeName.toLowerCase()==="slot"&&Ee(this,ye,M(this,ye,Mt)[0].assignedElements({flatten:!0}),jr);let s=M(this,je,St);if(s.some(c=>c.getAttribute("tabindex")==="0"))return;let l=s.filter(c=>c.getAttribute("aria-selected")==="true")[0];l||(l=s[0]),l&&(l.setAttribute("tabindex",0),l.setAttribute("aria-selected","true"))})}static get observedAttributes(){return["disabled",E.MEDIA_CONTROLLER]}get selectedOptions(){return M(this,je,St).filter(e=>e.getAttribute("aria-selected")==="true")}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",M(this,ka)),this.addEventListener("keydown",M(this,es))}disable(){this.removeEventListener("click",M(this,ka)),this.removeEventListener("keyup",M(this,It))}attributeChangedCallback(e,t,a){var r,s;if(e===E.MEDIA_CONTROLLER){if(t){let n=u.getElementById(t);(r=n==null?void 0:n.unassociateElement)==null||r.call(n,this)}if(a){let n=u.getElementById(a);(s=n==null?void 0:n.associateElement)==null||s.call(n,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let t=this.getAttribute(E.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(E.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e){let t=mi(this,pi,Ma).call(this,e);if(!t)return;let a=t.getAttribute("aria-selected")==="true";this.getAttribute("aria-multiselectable")!=="true"&&M(this,ye,Mt).forEach(r=>r.setAttribute("aria-selected","false")),a?t.setAttribute("aria-selected","false"):t.setAttribute("aria-selected","true"),this.dispatchEvent(new Event("change"))}handleMovement(e){let{key:t}=e,a=M(this,je,St),r=mi(this,pi,Ma).call(this,e);r||(r=a.filter(n=>n.getAttribute("tabindex")==="0")[0]);let s;switch(t){case"ArrowDown":s=r.nextElementSibling,s!=null&&s.hasAttribute("disabled")&&(s=s.nextElementSibling);break;case"ArrowUp":s=r.previousElementSibling,s!=null&&s.hasAttribute("disabled")&&(s=s.previousElementSibling);break;case"Home":s=a[0];break;case"End":s=a[a.length-1];break;default:s=mi(this,ts,yo).call(this,t);break}s&&(a.forEach(n=>n.setAttribute("tabindex","-1")),s.setAttribute("tabindex","0"),s.focus())}handleClick(e){let t=mi(this,pi,Ma).call(this,e);!t||t.hasAttribute("disabled")||(M(this,je,St).forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e))}};Pe=new WeakMap;kt=new WeakMap;hi=new WeakMap;wt=new WeakMap;ye=new WeakSet;Mt=function(){return M(this,wt)||Ee(this,wt,Array.from(this.shadowRoot.querySelectorAll("media-chrome-listitem"))),M(this,wt)};jr=function(i){Ee(this,wt,i)};je=new WeakSet;St=function(){return M(this,ye,Mt).filter(i=>!i.hasAttribute("disabled"))};ka=new WeakMap;It=new WeakMap;es=new WeakMap;pi=new WeakSet;Ma=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-LISTITEM");return e[t]};ts=new WeakSet;yo=function(i){mi(this,as,To).call(this);let e=M(this,je,St),t=e.findIndex(m=>m.getAttribute("tabindex")==="0");Ee(this,Pe,M(this,Pe)+i);let a=M(this,Pe).split("").every(m=>m===i),r=e.slice(t+(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(M(this,Pe))),s=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(M(this,Pe))),n=[],l=[];return a&&(n=e.slice(t+(a?1:0)).filter(m=>m.textContent.startsWith(i)),l=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.startsWith(i))),[...r,...s,...n,...l][0]};as=new WeakSet;To=function(){d.clearTimeout(M(this,kt)),Ee(this,kt,null),Ee(this,kt,d.setTimeout(()=>{Ee(this,Pe,""),Ee(this,kt,null)},500))};d.customElements.get("media-chrome-listbox")||d.customElements.define("media-chrome-listbox",Sa);var ko=Sa;var ns=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},b=(i,e,t)=>(ns(i,e,"read from private field"),t?t.call(i):e.get(i)),F=(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)},ie=(i,e,t,a)=>(ns(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Te=(i,e,t)=>(ns(i,e,"access private method"),t),Ct,bi,Lt,P,fi,L,ve,Ei,et,xt,wa,rs,Mo,ss,So,Rt,vi,os,wo,Ca,ls,Co=u.createElement("template");Co.innerHTML=`
795
795
  <style>
796
796
  :host {
797
797
  display: inline-flex;
@@ -819,7 +819,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
819
819
  <slot></slot>
820
820
  </media-chrome-listbox>
821
821
  </slot>
822
- `;var La=class extends d.HTMLElement{constructor(){var e;super(),F(this,rs),F(this,ss),F(this,Rt),F(this,os),F(this,Ca),F(this,Ct,void 0),F(this,bi,void 0),F(this,Lt,!0),F(this,N,void 0),F(this,Ei,void 0),F(this,L,void 0),F(this,ve,void 0),F(this,fi,!1),F(this,et,s=>{let{key:n}=s;if(!this.keysUsed.includes(n)){this.removeEventListener("keyup",b(this,et));return}s.composedPath().includes(b(this,N))&&(n==="Enter"||n===" ")?b(this,Ct).call(this):n==="Escape"&&!b(this,ve).hidden&&ye(this,Rt,vi).call(this)}),F(this,xt,s=>{let{metaKey:n,altKey:l,key:c}=s;if(n||l||!this.keysUsed.includes(c)){this.removeEventListener("keyup",b(this,et));return}s.preventDefault(),this.addEventListener("keyup",b(this,et),{once:!0})}),F(this,wa,s=>{s.composedPath().includes(this)||b(this,ve).hidden||ye(this,Rt,vi).call(this)});let t=this.attachShadow({mode:"open"}),a=Co.content.cloneNode(!0);this.nativeEl=a,t.appendChild(a);let{style:r}=R(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),te(this,Ct,ye(this,rs,Mo).bind(this)),te(this,bi,ye(this,ss,So).bind(this)),(e=this.init)==null||e.call(this),te(this,N,this.shadowRoot.querySelector("[part=button]")),te(this,L,this.shadowRoot.querySelector("[part=listbox]")),te(this,Ei,this.shadowRoot.querySelector("slot[name=button]")),b(this,Ei).addEventListener("slotchange",()=>{let s=b(this,Ei).assignedElements()[0];!s||(this.disable(),te(this,N,s),b(this,N).preventClick=!0,b(this,N).hasAttribute("disabled")&&te(this,Lt,!1),b(this,Lt)?(this.enable(),b(this,N).setAttribute("aria-haspopup","listbox")):this.disable())}),te(this,ve,this.shadowRoot.querySelector("slot[name=listbox]")),b(this,ve).addEventListener("slotchange",()=>{this.disable(),te(this,L,b(this,ve).assignedElements()[0]||b(this,L)),this.enable()})}static get observedAttributes(){return["disabled",f.MEDIA_CONTROLLER]}enable(){b(this,N).removeAttribute("disabled"),b(this,N).addEventListener("click",b(this,Ct)),b(this,N).addEventListener("keydown",b(this,xt)),b(this,L).addEventListener("keydown",b(this,xt)),ye(this,Ca,ls).call(this),b(this,L).addEventListener("change",b(this,bi)),u.addEventListener("click",b(this,wa))}disable(){b(this,N).setAttribute("disabled",""),b(this,N).removeEventListener("click",b(this,Ct)),b(this,N).removeEventListener("keydown",b(this,xt)),b(this,N).removeEventListener("keyup",b(this,et)),b(this,L).removeEventListener("keydown",b(this,xt)),b(this,L).removeEventListener("keyup",b(this,et)),b(this,L).addEventListener("change",b(this,bi)),u.removeEventListener("click",b(this,wa))}attributeChangedCallback(e,t,a){var r,s;if(e===f.MEDIA_CONTROLLER){if(t){let n=u.getElementById(t);(r=n==null?void 0:n.unassociateElement)==null||r.call(n,this),b(this,L).removeAttribute(f.MEDIA_CONTROLLER)}if(a){let n=u.getElementById(a);(s=n==null?void 0:n.associateElement)==null||s.call(n,this),b(this,L).setAttribute(f.MEDIA_CONTROLLER,a)}}else e==="disabled"&&a!==t&&(a==null?(te(this,Lt,!0),this.enable()):(te(this,Lt,!1),this.disable()))}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable();let t=this.getAttribute(f.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this),b(this,L).setAttribute(f.MEDIA_CONTROLLER,t)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(f.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this),b(this,L).removeAttribute(f.MEDIA_CONTROLLER)}}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};Ct=new WeakMap;bi=new WeakMap;Lt=new WeakMap;N=new WeakMap;Ei=new WeakMap;L=new WeakMap;ve=new WeakMap;fi=new WeakMap;et=new WeakMap;xt=new WeakMap;wa=new WeakMap;rs=new WeakSet;Mo=function(){ye(this,Rt,vi).call(this)};ss=new WeakSet;So=function(){ye(this,Rt,vi).call(this)};Rt=new WeakSet;vi=function(){b(this,ve).hidden=!b(this,ve).hidden,ye(this,Ca,ls).call(this),b(this,ve).hidden?b(this,N).focus():(b(this,L).focus(),ye(this,os,wo).call(this))};os=new WeakSet;wo=function(){var i;if(b(this,L).offsetWidth===0)return;let e=b(this,N).getBoundingClientRect();if(this.hasAttribute("media-controller")||b(this,N).hasAttribute("media-controller")||b(this,L).hasAttribute("media-controller")){b(this,L).style.zIndex="1",b(this,L).style.bottom="unset",b(this,L).style.top=e.height+"px";return}let a=((i=this.getAttribute("bounds")?Qe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?i:this).getBoundingClientRect(),r=b(this,L).getBoundingClientRect(),s=-Math.max(e.x+r.width-a.right,0);b(this,L).style.transform=`translateX(${s}px)`};Ca=new WeakSet;ls=function(){te(this,fi,!b(this,fi)),b(this,N).setAttribute("aria-expanded",b(this,fi))};d.customElements.get("media-chrome-selectmenu")||d.customElements.define("media-chrome-selectmenu",La);var Lo=La;var xo=u.createElement("template");xo.innerHTML=`
822
+ `;var La=class extends d.HTMLElement{constructor(){var e;super(),F(this,rs),F(this,ss),F(this,Rt),F(this,os),F(this,Ca),F(this,Ct,void 0),F(this,bi,void 0),F(this,Lt,!0),F(this,P,void 0),F(this,fi,void 0),F(this,L,void 0),F(this,ve,void 0),F(this,Ei,!1),F(this,et,s=>{let{key:n}=s;if(!this.keysUsed.includes(n)){this.removeEventListener("keyup",b(this,et));return}s.composedPath().includes(b(this,P))&&(n==="Enter"||n===" ")?b(this,Ct).call(this):n==="Escape"&&!b(this,ve).hidden&&Te(this,Rt,vi).call(this)}),F(this,xt,s=>{let{metaKey:n,altKey:l,key:c}=s;if(n||l||!this.keysUsed.includes(c)){this.removeEventListener("keyup",b(this,et));return}s.preventDefault(),this.addEventListener("keyup",b(this,et),{once:!0})}),F(this,wa,s=>{s.composedPath().includes(this)||b(this,ve).hidden||Te(this,Rt,vi).call(this)});let t=this.attachShadow({mode:"open"}),a=Co.content.cloneNode(!0);this.nativeEl=a,t.appendChild(a);let{style:r}=D(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),ie(this,Ct,Te(this,rs,Mo).bind(this)),ie(this,bi,Te(this,ss,So).bind(this)),(e=this.init)==null||e.call(this),ie(this,P,this.shadowRoot.querySelector("[part=button]")),ie(this,L,this.shadowRoot.querySelector("[part=listbox]")),ie(this,fi,this.shadowRoot.querySelector("slot[name=button]")),b(this,fi).addEventListener("slotchange",()=>{let s=b(this,fi).assignedElements()[0];!s||(this.disable(),ie(this,P,s),b(this,P).preventClick=!0,b(this,P).hasAttribute("disabled")&&ie(this,Lt,!1),b(this,Lt)?(this.enable(),b(this,P).setAttribute("aria-haspopup","listbox")):this.disable())}),ie(this,ve,this.shadowRoot.querySelector("slot[name=listbox]")),b(this,ve).addEventListener("slotchange",()=>{this.disable(),ie(this,L,b(this,ve).assignedElements()[0]||b(this,L)),this.enable()})}static get observedAttributes(){return["disabled",E.MEDIA_CONTROLLER]}enable(){b(this,P).removeAttribute("disabled"),b(this,P).addEventListener("click",b(this,Ct)),b(this,P).addEventListener("keydown",b(this,xt)),b(this,L).addEventListener("keydown",b(this,xt)),Te(this,Ca,ls).call(this),b(this,L).addEventListener("change",b(this,bi)),u.addEventListener("click",b(this,wa))}disable(){b(this,P).setAttribute("disabled",""),b(this,P).removeEventListener("click",b(this,Ct)),b(this,P).removeEventListener("keydown",b(this,xt)),b(this,P).removeEventListener("keyup",b(this,et)),b(this,L).removeEventListener("keydown",b(this,xt)),b(this,L).removeEventListener("keyup",b(this,et)),b(this,L).addEventListener("change",b(this,bi)),u.removeEventListener("click",b(this,wa))}attributeChangedCallback(e,t,a){var r,s;if(e===E.MEDIA_CONTROLLER){if(t){let n=u.getElementById(t);(r=n==null?void 0:n.unassociateElement)==null||r.call(n,this),b(this,L).removeAttribute(E.MEDIA_CONTROLLER)}if(a){let n=u.getElementById(a);(s=n==null?void 0:n.associateElement)==null||s.call(n,this),b(this,L).setAttribute(E.MEDIA_CONTROLLER,a)}}else e==="disabled"&&a!==t&&(a==null?(ie(this,Lt,!0),this.enable()):(ie(this,Lt,!1),this.disable()))}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable();let t=this.getAttribute(E.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this),b(this,L).setAttribute(E.MEDIA_CONTROLLER,t)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(E.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this),b(this,L).removeAttribute(E.MEDIA_CONTROLLER)}}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};Ct=new WeakMap;bi=new WeakMap;Lt=new WeakMap;P=new WeakMap;fi=new WeakMap;L=new WeakMap;ve=new WeakMap;Ei=new WeakMap;et=new WeakMap;xt=new WeakMap;wa=new WeakMap;rs=new WeakSet;Mo=function(){Te(this,Rt,vi).call(this)};ss=new WeakSet;So=function(){Te(this,Rt,vi).call(this)};Rt=new WeakSet;vi=function(){b(this,ve).hidden=!b(this,ve).hidden,Te(this,Ca,ls).call(this),b(this,ve).hidden?b(this,P).focus():(b(this,L).focus(),Te(this,os,wo).call(this))};os=new WeakSet;wo=function(){var i;if(b(this,L).offsetWidth===0)return;let e=b(this,P).getBoundingClientRect();if(this.hasAttribute("media-controller")||b(this,P).hasAttribute("media-controller")||b(this,L).hasAttribute("media-controller")){b(this,L).style.zIndex="1",b(this,L).style.bottom="unset",b(this,L).style.top=e.height+"px";return}let a=((i=this.getAttribute("bounds")?Qe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?i:this).getBoundingClientRect(),r=b(this,L).getBoundingClientRect(),s=-Math.max(e.x+r.width-a.right,0);b(this,L).style.transform=`translateX(${s}px)`};Ca=new WeakSet;ls=function(){ie(this,Ei,!b(this,Ei)),b(this,P).setAttribute("aria-expanded",b(this,Ei))};d.customElements.get("media-chrome-selectmenu")||d.customElements.define("media-chrome-selectmenu",La);var Lo=La;var xo=u.createElement("template");xo.innerHTML=`
823
823
  <style>
824
824
  :host {
825
825
  display: list-item;
@@ -836,7 +836,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
836
836
  <li>
837
837
  <slot></slot>
838
838
  </li>
839
- `;var ds=class extends d.HTMLElement{static get observedAttributes(){return["disabled","aria-selected","value",f.MEDIA_CONTROLLER]}constructor(){super();let e=this.attachShadow({mode:"open"}),t=xo.content.cloneNode(!0);this.nativeEl=t,e.appendChild(t)}set value(e){this.setAttribute("value",e)}get value(){return this.getAttribute("value")}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){var r,s;if(e===f.MEDIA_CONTROLLER){if(t){let n=u.getElementById(t);(r=n==null?void 0:n.unassociateElement)==null||r.call(n,this)}if(a){let n=u.getElementById(a);(s=n==null?void 0:n.associateElement)==null||s.call(n,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","option");let t=this.getAttribute(f.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(f.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}handleClick(){}};d.customElements.get("media-chrome-listitem")||d.customElements.define("media-chrome-listitem",ds);var ps=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},B=(i,e,t)=>(ps(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)},Be=(i,e,t,a)=>(ps(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),oe=(i,e,t)=>(ps(i,e,"access private method"),t),Ot,Nt,Te,ie,xa,cs,Da,us,tt,Dt,Ra,ms,Do=`
839
+ `;var ds=class extends d.HTMLElement{static get observedAttributes(){return["disabled","aria-selected","value",E.MEDIA_CONTROLLER]}constructor(){super();let e=this.attachShadow({mode:"open"}),t=xo.content.cloneNode(!0);this.nativeEl=t,e.appendChild(t)}set value(e){this.setAttribute("value",e)}get value(){return this.getAttribute("value")}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){var r,s;if(e===E.MEDIA_CONTROLLER){if(t){let n=u.getElementById(t);(r=n==null?void 0:n.unassociateElement)==null||r.call(n,this)}if(a){let n=u.getElementById(a);(s=n==null?void 0:n.associateElement)==null||s.call(n,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","option");let t=this.getAttribute(E.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(E.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}handleClick(){}};d.customElements.get("media-chrome-listitem")||d.customElements.define("media-chrome-listitem",ds);var ps=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},H=(i,e,t)=>(ps(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)},Be=(i,e,t,a)=>(ps(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),oe=(i,e,t)=>(ps(i,e,"access private method"),t),Ot,Nt,Ie,ae,xa,cs,Da,us,tt,Dt,Ra,ms,Do=`
840
840
  fill: var(--media-icon-color, #eee);
841
841
  height: var(--media-captions-indicator-height, 1em);
842
842
  vertical-align: var(--media-captions-indicator-vertical-align, bottom);
@@ -852,8 +852,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
852
852
 
853
853
  </style>
854
854
  <slot hidden name="captions-indicator">${ec}</slot>
855
- `;var Ro=(i,e)=>i.label===e.label&&i.language===e.language,hs=class extends ko{constructor(){super({slotTemplate:Oo}),Ue(this,xa),Ue(this,Da),Ue(this,tt),Ue(this,Ra),Ue(this,Ot,[]),Ue(this,Nt,[]),Ue(this,Te,void 0),Ue(this,ie,void 0);let e=u.createElement("media-chrome-listitem");e.part.add("listitem"),e.value="off",e.textContent="Off",Be(this,Te,e);let t=this.shadowRoot.querySelector('[name="captions-indicator"]');Be(this,ie,t.firstElementChild),t.addEventListener("slotchange",()=>{let a=t.assignedElements();if(a.length===1&&a[0].nodeName.toLowerCase()==="slot"){let r=a[0].assignedElements();r.length===0?Be(this,ie,a[0].firstElementChild):r.length===1&&Be(this,ie,r[0])}B(this,ie)||Be(this,ie,t.firstElementChild),Be(this,ie,B(this,ie).cloneNode(!0)),B(this,ie).removeAttribute("slot"),B(this,ie).setAttribute("style",Do)})}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){if(e===o.MEDIA_SUBTITLES_LIST&&t!==a)Be(this,Ot,oe(this,xa,cs).call(this,a,B(this,Ot))),oe(this,tt,Dt).call(this);else if(e===o.MEDIA_CAPTIONS_LIST&&t!==a)Be(this,Nt,oe(this,xa,cs).call(this,a,B(this,Nt))),oe(this,tt,Dt).call(this);else if(e===o.MEDIA_SUBTITLES_SHOWING&&t!==a){let r=Zt(a!=null?a:"")[0];B(this,Ot).forEach(s=>{s.selected=s.language===r.language&&s.label===r.label}),oe(this,tt,Dt).call(this)}else if(e===o.MEDIA_CAPTIONS_SHOWING&&t!==a){let r=Zt(a!=null?a:"")[0];B(this,Nt).forEach(s=>{s.selected=s.language===r.language&&s.label===r.label}),oe(this,tt,Dt).call(this)}else 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.textTrack API."));super.attributeChangedCallback(e,t,a)}connectedCallback(){oe(this,tt,Dt).call(this),this.addEventListener("change",oe(this,Ra,ms)),super.connectedCallback()}disconnectedCallback(){this.removeEventListener("change",oe(this,Ra,ms)),super.disconnectedCallback()}};Ot=new WeakMap;Nt=new WeakMap;Te=new WeakMap;ie=new WeakMap;xa=new WeakSet;cs=function(i,e){let t=i?Zt(i!=null?i:""):[],a=[],r=[];return e.forEach(s=>{t.some(n=>Ro(n,s))||a.push(s)}),t.forEach(s=>{e.some(n=>Ro(n,s))||r.push(s)}),a.forEach(s=>s.el.remove()),e.filter(s=>!a.includes(s)).concat(r)};Da=new WeakSet;us=function(i,e){let t=this.shadowRoot.querySelector("ul slot");i.forEach(a=>{let r=a.el,s=!0;if(!r){r=u.createElement("media-chrome-listitem"),s=!1,r.part.add("listitem"),r.value=e+"!"+mr(a);let n=u.createElement("span");n.textContent=a.label,r.append(n),e==="cc"&&r.append(B(this,ie).cloneNode(!0))}a.selected?r.setAttribute("aria-selected","true"):r.setAttribute("aria-selected","false"),s||(t.append(r),a.el=r)})};tt=new WeakSet;Dt=function(){let i=this.shadowRoot.querySelector("ul slot");i.contains(B(this,Te))||i.append(B(this,Te)),!this.hasAttribute(o.MEDIA_CAPTIONS_SHOWING)&&!this.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)?(B(this,Te).setAttribute("aria-selected","true"),B(this,Te).setAttribute("tabindex","0")):(B(this,Te).setAttribute("aria-selected","false"),B(this,Te).setAttribute("tabindex","-1")),oe(this,Da,us).call(this,B(this,Nt),"cc"),oe(this,Da,us).call(this,B(this,Ot),"subs")};Ra=new WeakSet;ms=function(){var i,e,t;let[a,r]=(t=(e=(i=this.selectedOptions[0])==null?void 0:i.value)==null?void 0:e.split("!"))!=null?t:[];if(ze(this),!r)return;let s=new d.CustomEvent(a==="cc"?p.MEDIA_SHOW_CAPTIONS_REQUEST:p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(s)};d.customElements.get("media-captions-listbox")||d.customElements.define("media-captions-listbox",hs);var bs=class extends Lo{constructor(){super()}init(){let e=u.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0,this.hasAttribute("default-showing")&&e.setAttribute("default-showing","");let t=u.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","listitem");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)}};d.customElements.get("media-captions-selectmenu")||d.customElements.define("media-captions-selectmenu",bs);var g=Cl(require("@mux/mux-video")),w=require("@mux/playback-core");var Fo=require("@mux/mux-video");var tc="en",it={code:tc};var No="en";function y(i,e=!0){var r,s;let t=e&&(s=(r=it)==null?void 0:r[i])!=null?s:i,a=e?it.code:No;return new Es(t,a)}var Es=class{constructor(e,t=(a=>(a=it.code)!=null?a:No)()){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 Po(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${Oa(t)}: ${a}; `)}),e?e.trim():void 0}function Oa(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Na(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ie(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Pa(i){let e=ic(i).toString();return e?"?"+e:""}function ic(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function $e(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 fs=(i,e)=>!i||!e?!1:i.contains(e)?!0:fs(i,e.getRootNode().host);var Ua=require("@mux/playback-core");var vs="mux.com",ac=()=>{try{return"1.10.0"}catch{}return"UNKNOWN"},rc=ac(),$a=()=>rc,gs=(i,{maxResolution:e,token:t,domain:a=vs}={})=>{let n=!!t?{token:t}:{redundant_streams:!0,...e?{max_resolution:e}:{}};return`https://stream.${a}/${i}.m3u8${Pa(n)}`},Uo=(i,{token:e,thumbnailTime:t,domain:a=vs}={})=>{let r=e==null?t:void 0,{aud:s}=$e(e);if(!(e&&s!=="t"))return`https://image.${a}/${i}/thumbnail.webp${Pa({token:e,time:r})}`},Bo=(i,{token:e,domain:t=vs}={})=>{let{aud:a}=$e(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Pa({token:e,format:"webp"})}`},gi=i=>{if(!!i){if([Ua.StreamTypes.LIVE,Ua.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Ua.StreamTypes.LIVE}};var sc={crossorigin:"crossOrigin",playsinline:"playsInline"};function $o(i){var e;return(e=sc[i])!=null?e:Na(i)}var at,rt,Y,Ba=class{constructor(e,t){x(this,at,void 0);x(this,rt,void 0);x(this,Y,[]);J(this,at,e),J(this,rt,t)}[Symbol.iterator](){return I(this,Y).values()}get length(){return I(this,Y).length}get value(){var e;return(e=I(this,Y).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(J(this,Y,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return I(this,Y)[e]}values(){return I(this,Y).values()}keys(){return I(this,Y).keys()}forEach(e){I(this,Y).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||I(this,Y).push(r)}),!(this.value===""&&!((t=I(this,at))!=null&&t.hasAttribute(`${I(this,rt)}`)))&&((a=I(this,at))==null||a.setAttribute(`${I(this,rt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{I(this,Y).splice(I(this,Y).indexOf(a),1)}),(t=I(this,at))==null||t.setAttribute(`${I(this,rt)}`,`${this.value}`)}contains(e){return I(this,Y).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)}};at=new WeakMap,rt=new WeakMap,Y=new WeakMap;var Ho=`[mux-player ${$a()}]`;function He(...i){console.warn(Ho,...i)}function le(...i){console.error(Ho,...i)}function _s(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: ")}
856
- ${a}${i.file}`}He(e)}var K={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},st={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Vo=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}}),nc=Fo.VideoEvents.filter(i=>i!=="error"),oc=Object.values(K).filter(i=>![K.PLAYSINLINE].includes(i)),lc=Object.values(st);function Ko(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),nc.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var As=class extends D.HTMLElement{static get observedAttributes(){return[...oc,...lc]}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(s=>{var l,c;let n=(l=this.media)==null?void 0:l.querySelector(`track[src="${s.src}"]`);n&&((c=this.media)==null||c.removeChild(n))}),r.addedNodes.forEach(s=>{var n;(n=this.media)==null||n.append(s.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,s;switch(e){case st.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case st.VOLUME:{let n=(r=Ie(a))!=null?r:1;this.media&&(this.media.volume=n);return}case st.PLAYBACKRATE:{let n=(s=Ie(a))!=null?s:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);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 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:Vo}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:Vo}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=Ie(this.getAttribute(st.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(st.PLAYBACKRATE,`${e}`):this.removeAttribute(st.PLAYBACKRATE)}get crossOrigin(){return _i(this,K.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(K.CROSSORIGIN,`${e}`)}get autoplay(){return _i(this,K.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(K.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(K.AUTOPLAY)}get loop(){return _i(this,K.LOOP)!=null}set loop(e){e?this.setAttribute(K.LOOP,""):this.removeAttribute(K.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=Boolean(e))}get defaultMuted(){return _i(this,K.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(K.MUTED,""):this.removeAttribute(K.MUTED)}get playsInline(){return _i(this,K.PLAYSINLINE)!=null}set playsInline(e){le("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(K.PRELOAD,e):this.removeAttribute(K.PRELOAD)}};function _i(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var ys=As;var dc=Object.defineProperty,cc=(i,e,t)=>e in i?dc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,uc=(i,e,t)=>(cc(i,typeof e!="symbol"?e+"":e,t),t),Qo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},A=(i,e,t)=>(Qo(i,e,"read from private field"),t?t.call(i):e.get(i)),ge=(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)},ke=(i,e,t,a)=>(Qo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Pt,Ha,nt,Ai,We,Ve,Fe,ot,Ut,Wa,de,Yo=1,Go=0,mc=1,hc={processCallback(i,e,t){if(!!t){for(let[a,r]of e)if(a in t){let s=t[a];typeof s=="boolean"&&r instanceof G&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=s:typeof s=="function"&&r instanceof G?r.element[r.attributeName]=s:r.value=s}}}},Me=class extends d.DocumentFragment{constructor(e,t,a=hc){var r;super(),ge(this,Pt,void 0),ge(this,Ha,void 0),this.append(e.content.cloneNode(!0)),ke(this,Pt,zo(this)),ke(this,Ha,a),(r=a.createCallback)==null||r.call(a,this,A(this,Pt),t),a.processCallback(this,A(this,Pt),t)}update(e){A(this,Ha).processCallback(this,A(this,Pt),e)}};Pt=new WeakMap;Ha=new WeakMap;var zo=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let s=new Ts;for([t,a]of qo(r.value))if(!t)s.append(a);else{let n=new G(i,r.name,r.namespaceURI);s.append(n),e.push([a,n])}r.value=s.toString()}for(let r of i.childNodes)if(r.nodeType===Yo&&!(r instanceof HTMLTemplateElement))zo(r,e);else if(r.nodeType===Yo||r.data.includes("{{")){let s=[];if(r.data)for([t,a]of qo(r.data))if(!t)s.push(new Text(a));else{let n=new Se(i);s.push(n),e.push([a,n])}else if(r instanceof HTMLTemplateElement){let n=new yi(i,r);s.push(n),e.push([n.expression,n])}r.replaceWith(...s.flatMap(n=>n.replacementNodes||[n]))}return e},Zo={},qo=i=>{let e="",t=0,a=Zo[i],r=0,s;if(a)return a;for(a=[];s=i[r];r++)s==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([Go,e]),e="",r++):s==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([mc,e.trim()]),e="",r++):e+=s||"";return e&&a.push([Go,(t>0?"{{":"")+e]),Zo[i]=a},pc=11,Va=class{get value(){return""}set value(e){}toString(){return this.value}},Xo=new WeakMap,Ts=class{constructor(){ge(this,nt,[])}[Symbol.iterator](){return A(this,nt).values()}get length(){return A(this,nt).length}item(e){return A(this,nt)[e]}append(...e){for(let t of e)t instanceof G&&Xo.set(t,this),A(this,nt).push(t)}toString(){return A(this,nt).join("")}};nt=new WeakMap;var G=class extends Va{constructor(e,t,a){super(),ge(this,ot),ge(this,Ai,""),ge(this,We,void 0),ge(this,Ve,void 0),ge(this,Fe,void 0),ke(this,We,e),ke(this,Ve,t),ke(this,Fe,a)}get attributeName(){return A(this,Ve)}get attributeNamespace(){return A(this,Fe)}get element(){return A(this,We)}get value(){return A(this,Ai)}set value(e){A(this,Ai)!==e&&(ke(this,Ai,e),!A(this,ot,Ut)||A(this,ot,Ut).length===1?e==null?A(this,We).removeAttributeNS(A(this,Fe),A(this,Ve)):A(this,We).setAttributeNS(A(this,Fe),A(this,Ve),e):A(this,We).setAttributeNS(A(this,Fe),A(this,Ve),A(this,ot,Ut)))}get booleanValue(){return A(this,We).hasAttributeNS(A(this,Fe),A(this,Ve))}set booleanValue(e){if(!A(this,ot,Ut)||A(this,ot,Ut).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Ai=new WeakMap;We=new WeakMap;Ve=new WeakMap;Fe=new WeakMap;ot=new WeakSet;Ut=function(){return Xo.get(this)};var Se=class extends Va{constructor(e,t){super(),ge(this,Wa,void 0),ge(this,de,void 0),ke(this,Wa,e),ke(this,de,t?[...t]:[new Text])}get replacementNodes(){return A(this,de)}get parentNode(){return A(this,Wa)}get nextSibling(){return A(this,de)[A(this,de).length-1].nextSibling}get previousSibling(){return A(this,de)[0].previousSibling}get value(){return A(this,de).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===pc?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),ke(this,de,bc(A(this,de)[0].parentNode,A(this,de),t,this.nextSibling))}};Wa=new WeakMap;de=new WeakMap;var yi=class extends Se{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),uc(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function bc(i,e,t,a=null){let r=0,s,n,l,c=t.length,m=e.length;for(;r<c&&r<m&&e[r]==t[r];)r++;for(;r<c&&r<m&&t[c-1]==e[m-1];)a=t[--m,--c];if(r==m)for(;r<c;)i.insertBefore(t[r++],a);if(r==c)for(;r<m;)i.removeChild(e[r++]);else{for(s=e[r];r<c;)l=t[r++],n=s?s.nextSibling:a,s==l?s=n:r<c&&t[r]==n?(i.replaceChild(l,s),s=n):i.insertBefore(l,s);for(;s!=a;)n=s.nextSibling,i.removeChild(s),s=n}return t}var Jo={string:i=>String(i)},Ka=class{constructor(e){this.template=e,this.state=void 0}},lt=new WeakMap,dt=new WeakMap,Is={partial:(i,e)=>{e[i.expression]=new Ka(i.template)},if:(i,e)=>{var t;if(el(i.expression,e))if(lt.get(i)!==i.template){lt.set(i,i.template);let a=new Me(i.template,e,Ya);i.replace(a),dt.set(i,a)}else(t=dt.get(i))==null||t.update(e);else i.replace(""),lt.delete(i),dt.delete(i)}},Ec=Object.keys(Is),Ya={processCallback(i,e,t){var a,r;if(!!t)for(let[s,n]of e){if(n instanceof yi){if(!n.directive){let c=Ec.find(m=>n.template.hasAttribute(m));c&&(n.directive=c,n.expression=n.template.getAttribute(c))}(a=Is[n.directive])==null||a.call(Is,n,t);continue}let l=el(s,t);if(l instanceof Ka){lt.get(n)!==l.template?(lt.set(n,l.template),l=new Me(l.template,l.state,Ya),n.value=l,dt.set(n,l)):(r=dt.get(n))==null||r.update(l.state);continue}l?(n instanceof G&&n.attributeName.startsWith("aria-")&&(l=String(l)),n instanceof G?typeof l=="boolean"?n.booleanValue=l:typeof l=="function"?n.element[n.attributeName]=l:n.value=l:(n.value=l,lt.delete(n),dt.delete(n))):n instanceof G?n.value=void 0:(n.value=void 0,lt.delete(n),dt.delete(n))}}},jo={"!":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=Jo[e])==null?void 0:t.call(Jo,i)}};function fc(i){return vc(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function el(i,e={}){var t,a,r,s,n,l,c;let m=fc(i);if(m.length===0||m.some(({type:E})=>!E))return Ti(i);if(((t=m[0])==null?void 0:t.token)===">"){let E=e[(a=m[1])==null?void 0:a.token];if(!E)return Ti(i);let v={...e};E.state=v;let _=m.slice(2);for(let T=0;T<_.length;T+=3){let $=(r=_[T])==null?void 0:r.token,k=(s=_[T+1])==null?void 0:s.token,H=(n=_[T+2])==null?void 0:n.token;$&&k==="="&&(v[$]=Ii(H,e))}return E}if(m.length===1)return Fa(m[0])?Ii(m[0].token,e):Ti(i);if(m.length===2){let E=(l=m[0])==null?void 0:l.token,v=jo[E];if(!v||!Fa(m[1]))return Ti(i);let _=Ii(m[1].token,e);return v(_)}if(m.length===3){let E=(c=m[1])==null?void 0:c.token,v=jo[E];if(!v||!Fa(m[0])||!Fa(m[2]))return Ti(i);let _=Ii(m[0].token,e);if(E==="|")return v(_,m[2].token);let T=Ii(m[2].token,e);return v(_,T)}}function Ti(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Fa({type:i}){return["number","boolean","string","param"].includes(i)}function Ii(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):Bi(i)?parseFloat(i):e[i]}function vc(i,e){let t,a,r,s=[];for(;i;){r=null,t=i.length;for(let n in e)a=e[n].exec(i),a&&a.index<t&&(r={token:a[0],type:n,matches:a.slice(1)},t=a.index);t&&s.push({token:i.substr(0,t),type:void 0}),r&&s.push(r),i=i.substr(t+(r?r.token.length:0))}return s}var gc=Object.defineProperty,_c=(i,e,t)=>e in i?gc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ki=(i,e,t)=>(_c(i,typeof e!="symbol"?e+"":e,t),t),ws=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tl=(i,e,t)=>(ws(i,e,"read from private field"),t?t.call(i):e.get(i)),ks=(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)},Ga=(i,e,t,a)=>(ws(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ac=(i,e,t)=>(ws(i,e,"access private method"),t),Bt,Za,Ss,il,Ms={"media-target-live-window":"targetLiveWindow","media-stream-type":"streamType"},al=u.createElement("template");al.innerHTML=`
855
+ `;var Ro=(i,e)=>i.label===e.label&&i.language===e.language,hs=class extends ko{constructor(){super({slotTemplate:Oo}),Ue(this,xa),Ue(this,Da),Ue(this,tt),Ue(this,Ra),Ue(this,Ot,[]),Ue(this,Nt,[]),Ue(this,Ie,void 0),Ue(this,ae,void 0);let e=u.createElement("media-chrome-listitem");e.part.add("listitem"),e.value="off",e.textContent="Off",Be(this,Ie,e);let t=this.shadowRoot.querySelector('[name="captions-indicator"]');Be(this,ae,t.firstElementChild),t.addEventListener("slotchange",()=>{let a=t.assignedElements();if(a.length===1&&a[0].nodeName.toLowerCase()==="slot"){let r=a[0].assignedElements();r.length===0?Be(this,ae,a[0].firstElementChild):r.length===1&&Be(this,ae,r[0])}H(this,ae)||Be(this,ae,t.firstElementChild),Be(this,ae,H(this,ae).cloneNode(!0)),H(this,ae).removeAttribute("slot"),H(this,ae).setAttribute("style",Do)})}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){if(e===o.MEDIA_SUBTITLES_LIST&&t!==a)Be(this,Ot,oe(this,xa,cs).call(this,a,H(this,Ot))),oe(this,tt,Dt).call(this);else if(e===o.MEDIA_CAPTIONS_LIST&&t!==a)Be(this,Nt,oe(this,xa,cs).call(this,a,H(this,Nt))),oe(this,tt,Dt).call(this);else if(e===o.MEDIA_SUBTITLES_SHOWING&&t!==a){let r=Zt(a!=null?a:"")[0];H(this,Ot).forEach(s=>{s.selected=s.language===r.language&&s.label===r.label}),oe(this,tt,Dt).call(this)}else if(e===o.MEDIA_CAPTIONS_SHOWING&&t!==a){let r=Zt(a!=null?a:"")[0];H(this,Nt).forEach(s=>{s.selected=s.language===r.language&&s.label===r.label}),oe(this,tt,Dt).call(this)}else 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.textTrack API."));super.attributeChangedCallback(e,t,a)}connectedCallback(){oe(this,tt,Dt).call(this),this.addEventListener("change",oe(this,Ra,ms)),super.connectedCallback()}disconnectedCallback(){this.removeEventListener("change",oe(this,Ra,ms)),super.disconnectedCallback()}};Ot=new WeakMap;Nt=new WeakMap;Ie=new WeakMap;ae=new WeakMap;xa=new WeakSet;cs=function(i,e){let t=i?Zt(i!=null?i:""):[],a=[],r=[];return e.forEach(s=>{t.some(n=>Ro(n,s))||a.push(s)}),t.forEach(s=>{e.some(n=>Ro(n,s))||r.push(s)}),a.forEach(s=>s.el.remove()),e.filter(s=>!a.includes(s)).concat(r)};Da=new WeakSet;us=function(i,e){let t=this.shadowRoot.querySelector("ul slot");i.forEach(a=>{let r=a.el,s=!0;if(!r){r=u.createElement("media-chrome-listitem"),s=!1,r.part.add("listitem"),r.value=e+"!"+mr(a);let n=u.createElement("span");n.textContent=a.label,r.append(n),e==="cc"&&r.append(H(this,ae).cloneNode(!0))}a.selected?r.setAttribute("aria-selected","true"):r.setAttribute("aria-selected","false"),s||(t.append(r),a.el=r)})};tt=new WeakSet;Dt=function(){let i=this.shadowRoot.querySelector("ul slot");i.contains(H(this,Ie))||i.append(H(this,Ie)),!this.hasAttribute(o.MEDIA_CAPTIONS_SHOWING)&&!this.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)?(H(this,Ie).setAttribute("aria-selected","true"),H(this,Ie).setAttribute("tabindex","0")):(H(this,Ie).setAttribute("aria-selected","false"),H(this,Ie).setAttribute("tabindex","-1")),oe(this,Da,us).call(this,H(this,Nt),"cc"),oe(this,Da,us).call(this,H(this,Ot),"subs")};Ra=new WeakSet;ms=function(){var i,e,t;let[a,r]=(t=(e=(i=this.selectedOptions[0])==null?void 0:i.value)==null?void 0:e.split("!"))!=null?t:[];if(ze(this),!r)return;let s=new d.CustomEvent(a==="cc"?p.MEDIA_SHOW_CAPTIONS_REQUEST:p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(s)};d.customElements.get("media-captions-listbox")||d.customElements.define("media-captions-listbox",hs);var bs=class extends Lo{constructor(){super()}init(){let e=u.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0,this.hasAttribute("default-showing")&&e.setAttribute("default-showing","");let t=u.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","listitem");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)}};d.customElements.get("media-captions-selectmenu")||d.customElements.define("media-captions-selectmenu",bs);var v=Cl(require("@mux/mux-video")),w=require("@mux/playback-core");var Fo=require("@mux/mux-video");var tc="en",it={code:tc};var No="en";function T(i,e=!0){var r,s;let t=e&&(s=(r=it)==null?void 0:r[i])!=null?s:i,a=e?it.code:No;return new fs(t,a)}var fs=class{constructor(e,t=(a=>(a=it.code)!=null?a:No)()){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 Po(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${Oa(t)}: ${a}; `)}),e?e.trim():void 0}function Oa(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Na(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function ke(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Pa(i){let e=ic(i).toString();return e?"?"+e:""}function ic(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function $e(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 Es=(i,e)=>!i||!e?!1:i.contains(e)?!0:Es(i,e.getRootNode().host);var Ua=require("@mux/playback-core");var vs="mux.com",ac=()=>{try{return"1.10.1"}catch{}return"UNKNOWN"},rc=ac(),$a=()=>rc,gs=(i,{maxResolution:e,token:t,domain:a=vs}={})=>{let n=!!t?{token:t}:{redundant_streams:!0,...e?{max_resolution:e}:{}};return`https://stream.${a}/${i}.m3u8${Pa(n)}`},Uo=(i,{token:e,thumbnailTime:t,domain:a=vs}={})=>{let r=e==null?t:void 0,{aud:s}=$e(e);if(!(e&&s!=="t"))return`https://image.${a}/${i}/thumbnail.webp${Pa({token:e,time:r})}`},Bo=(i,{token:e,domain:t=vs}={})=>{let{aud:a}=$e(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Pa({token:e,format:"webp"})}`},gi=i=>{if(!!i){if([Ua.StreamTypes.LIVE,Ua.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Ua.StreamTypes.LIVE}};var sc={crossorigin:"crossOrigin",playsinline:"playsInline"};function $o(i){var e;return(e=sc[i])!=null?e:Na(i)}var at,rt,Y,Ba=class{constructor(e,t){R(this,at,void 0);R(this,rt,void 0);R(this,Y,[]);j(this,at,e),j(this,rt,t)}[Symbol.iterator](){return I(this,Y).values()}get length(){return I(this,Y).length}get value(){var e;return(e=I(this,Y).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(j(this,Y,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return I(this,Y)[e]}values(){return I(this,Y).values()}keys(){return I(this,Y).keys()}forEach(e){I(this,Y).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||I(this,Y).push(r)}),!(this.value===""&&!((t=I(this,at))!=null&&t.hasAttribute(`${I(this,rt)}`)))&&((a=I(this,at))==null||a.setAttribute(`${I(this,rt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{I(this,Y).splice(I(this,Y).indexOf(a),1)}),(t=I(this,at))==null||t.setAttribute(`${I(this,rt)}`,`${this.value}`)}contains(e){return I(this,Y).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)}};at=new WeakMap,rt=new WeakMap,Y=new WeakMap;var Ho=`[mux-player ${$a()}]`;function He(...i){console.warn(Ho,...i)}function le(...i){console.error(Ho,...i)}function _s(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+=` ${T("Read more: ")}
856
+ ${a}${i.file}`}He(e)}var K={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},st={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Vo=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}}),nc=Fo.VideoEvents.filter(i=>i!=="error"),oc=Object.values(K).filter(i=>![K.PLAYSINLINE].includes(i)),lc=Object.values(st);function Ko(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),nc.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var As=class extends O.HTMLElement{static get observedAttributes(){return[...oc,...lc]}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(s=>{var l,c;let n=(l=this.media)==null?void 0:l.querySelector(`track[src="${s.src}"]`);n&&((c=this.media)==null||c.removeChild(n))}),r.addedNodes.forEach(s=>{var n;(n=this.media)==null||n.append(s.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,s;switch(e){case st.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case st.VOLUME:{let n=(r=ke(a))!=null?r:1;this.media&&(this.media.volume=n);return}case st.PLAYBACKRATE:{let n=(s=ke(a))!=null?s:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);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 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:Vo}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:Vo}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=ke(this.getAttribute(st.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(st.PLAYBACKRATE,`${e}`):this.removeAttribute(st.PLAYBACKRATE)}get crossOrigin(){return _i(this,K.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(K.CROSSORIGIN,`${e}`)}get autoplay(){return _i(this,K.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(K.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(K.AUTOPLAY)}get loop(){return _i(this,K.LOOP)!=null}set loop(e){e?this.setAttribute(K.LOOP,""):this.removeAttribute(K.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=Boolean(e))}get defaultMuted(){return _i(this,K.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(K.MUTED,""):this.removeAttribute(K.MUTED)}get playsInline(){return _i(this,K.PLAYSINLINE)!=null}set playsInline(e){le("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(K.PRELOAD,e):this.removeAttribute(K.PRELOAD)}};function _i(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var ys=As;var dc=Object.defineProperty,cc=(i,e,t)=>e in i?dc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,uc=(i,e,t)=>(cc(i,typeof e!="symbol"?e+"":e,t),t),Qo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},A=(i,e,t)=>(Qo(i,e,"read from private field"),t?t.call(i):e.get(i)),ge=(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)},Me=(i,e,t,a)=>(Qo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Pt,Ha,nt,Ai,We,Ve,Fe,ot,Ut,Wa,de,Yo=1,Go=0,mc=1,hc={processCallback(i,e,t){if(!!t){for(let[a,r]of e)if(a in t){let s=t[a];typeof s=="boolean"&&r instanceof G&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=s:typeof s=="function"&&r instanceof G?r.element[r.attributeName]=s:r.value=s}}}},Se=class extends d.DocumentFragment{constructor(e,t,a=hc){var r;super(),ge(this,Pt,void 0),ge(this,Ha,void 0),this.append(e.content.cloneNode(!0)),Me(this,Pt,zo(this)),Me(this,Ha,a),(r=a.createCallback)==null||r.call(a,this,A(this,Pt),t),a.processCallback(this,A(this,Pt),t)}update(e){A(this,Ha).processCallback(this,A(this,Pt),e)}};Pt=new WeakMap;Ha=new WeakMap;var zo=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let s=new Ts;for([t,a]of qo(r.value))if(!t)s.append(a);else{let n=new G(i,r.name,r.namespaceURI);s.append(n),e.push([a,n])}r.value=s.toString()}for(let r of i.childNodes)if(r.nodeType===Yo&&!(r instanceof HTMLTemplateElement))zo(r,e);else if(r.nodeType===Yo||r.data.includes("{{")){let s=[];if(r.data)for([t,a]of qo(r.data))if(!t)s.push(new Text(a));else{let n=new we(i);s.push(n),e.push([a,n])}else if(r instanceof HTMLTemplateElement){let n=new yi(i,r);s.push(n),e.push([n.expression,n])}r.replaceWith(...s.flatMap(n=>n.replacementNodes||[n]))}return e},Zo={},qo=i=>{let e="",t=0,a=Zo[i],r=0,s;if(a)return a;for(a=[];s=i[r];r++)s==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([Go,e]),e="",r++):s==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([mc,e.trim()]),e="",r++):e+=s||"";return e&&a.push([Go,(t>0?"{{":"")+e]),Zo[i]=a},pc=11,Va=class{get value(){return""}set value(e){}toString(){return this.value}},Xo=new WeakMap,Ts=class{constructor(){ge(this,nt,[])}[Symbol.iterator](){return A(this,nt).values()}get length(){return A(this,nt).length}item(e){return A(this,nt)[e]}append(...e){for(let t of e)t instanceof G&&Xo.set(t,this),A(this,nt).push(t)}toString(){return A(this,nt).join("")}};nt=new WeakMap;var G=class extends Va{constructor(e,t,a){super(),ge(this,ot),ge(this,Ai,""),ge(this,We,void 0),ge(this,Ve,void 0),ge(this,Fe,void 0),Me(this,We,e),Me(this,Ve,t),Me(this,Fe,a)}get attributeName(){return A(this,Ve)}get attributeNamespace(){return A(this,Fe)}get element(){return A(this,We)}get value(){return A(this,Ai)}set value(e){A(this,Ai)!==e&&(Me(this,Ai,e),!A(this,ot,Ut)||A(this,ot,Ut).length===1?e==null?A(this,We).removeAttributeNS(A(this,Fe),A(this,Ve)):A(this,We).setAttributeNS(A(this,Fe),A(this,Ve),e):A(this,We).setAttributeNS(A(this,Fe),A(this,Ve),A(this,ot,Ut)))}get booleanValue(){return A(this,We).hasAttributeNS(A(this,Fe),A(this,Ve))}set booleanValue(e){if(!A(this,ot,Ut)||A(this,ot,Ut).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Ai=new WeakMap;We=new WeakMap;Ve=new WeakMap;Fe=new WeakMap;ot=new WeakSet;Ut=function(){return Xo.get(this)};var we=class extends Va{constructor(e,t){super(),ge(this,Wa,void 0),ge(this,de,void 0),Me(this,Wa,e),Me(this,de,t?[...t]:[new Text])}get replacementNodes(){return A(this,de)}get parentNode(){return A(this,Wa)}get nextSibling(){return A(this,de)[A(this,de).length-1].nextSibling}get previousSibling(){return A(this,de)[0].previousSibling}get value(){return A(this,de).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===pc?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Me(this,de,bc(A(this,de)[0].parentNode,A(this,de),t,this.nextSibling))}};Wa=new WeakMap;de=new WeakMap;var yi=class extends we{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),uc(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function bc(i,e,t,a=null){let r=0,s,n,l,c=t.length,m=e.length;for(;r<c&&r<m&&e[r]==t[r];)r++;for(;r<c&&r<m&&t[c-1]==e[m-1];)a=t[--m,--c];if(r==m)for(;r<c;)i.insertBefore(t[r++],a);if(r==c)for(;r<m;)i.removeChild(e[r++]);else{for(s=e[r];r<c;)l=t[r++],n=s?s.nextSibling:a,s==l?s=n:r<c&&t[r]==n?(i.replaceChild(l,s),s=n):i.insertBefore(l,s);for(;s!=a;)n=s.nextSibling,i.removeChild(s),s=n}return t}var Jo={string:i=>String(i)},Ka=class{constructor(e){this.template=e,this.state=void 0}},lt=new WeakMap,dt=new WeakMap,Is={partial:(i,e)=>{e[i.expression]=new Ka(i.template)},if:(i,e)=>{var t;if(el(i.expression,e))if(lt.get(i)!==i.template){lt.set(i,i.template);let a=new Se(i.template,e,Ya);i.replace(a),dt.set(i,a)}else(t=dt.get(i))==null||t.update(e);else i.replace(""),lt.delete(i),dt.delete(i)}},fc=Object.keys(Is),Ya={processCallback(i,e,t){var a,r;if(!!t)for(let[s,n]of e){if(n instanceof yi){if(!n.directive){let c=fc.find(m=>n.template.hasAttribute(m));c&&(n.directive=c,n.expression=n.template.getAttribute(c))}(a=Is[n.directive])==null||a.call(Is,n,t);continue}let l=el(s,t);if(l instanceof Ka){lt.get(n)!==l.template?(lt.set(n,l.template),l=new Se(l.template,l.state,Ya),n.value=l,dt.set(n,l)):(r=dt.get(n))==null||r.update(l.state);continue}l?(n instanceof G&&n.attributeName.startsWith("aria-")&&(l=String(l)),n instanceof G?typeof l=="boolean"?n.booleanValue=l:typeof l=="function"?n.element[n.attributeName]=l:n.value=l:(n.value=l,lt.delete(n),dt.delete(n))):n instanceof G?n.value=void 0:(n.value=void 0,lt.delete(n),dt.delete(n))}}},jo={"!":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=Jo[e])==null?void 0:t.call(Jo,i)}};function Ec(i){return vc(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function el(i,e={}){var t,a,r,s,n,l,c;let m=Ec(i);if(m.length===0||m.some(({type:f})=>!f))return Ti(i);if(((t=m[0])==null?void 0:t.token)===">"){let f=e[(a=m[1])==null?void 0:a.token];if(!f)return Ti(i);let _={...e};f.state=_;let g=m.slice(2);for(let y=0;y<g.length;y+=3){let x=(r=g[y])==null?void 0:r.token,$=(s=g[y+1])==null?void 0:s.token,k=(n=g[y+2])==null?void 0:n.token;x&&$==="="&&(_[x]=Ii(k,e))}return f}if(m.length===1)return Fa(m[0])?Ii(m[0].token,e):Ti(i);if(m.length===2){let f=(l=m[0])==null?void 0:l.token,_=jo[f];if(!_||!Fa(m[1]))return Ti(i);let g=Ii(m[1].token,e);return _(g)}if(m.length===3){let f=(c=m[1])==null?void 0:c.token,_=jo[f];if(!_||!Fa(m[0])||!Fa(m[2]))return Ti(i);let g=Ii(m[0].token,e);if(f==="|")return _(g,m[2].token);let y=Ii(m[2].token,e);return _(g,y)}}function Ti(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Fa({type:i}){return["number","boolean","string","param"].includes(i)}function Ii(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):Bi(i)?parseFloat(i):e[i]}function vc(i,e){let t,a,r,s=[];for(;i;){r=null,t=i.length;for(let n in e)a=e[n].exec(i),a&&a.index<t&&(r={token:a[0],type:n,matches:a.slice(1)},t=a.index);t&&s.push({token:i.substr(0,t),type:void 0}),r&&s.push(r),i=i.substr(t+(r?r.token.length:0))}return s}var gc=Object.defineProperty,_c=(i,e,t)=>e in i?gc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ki=(i,e,t)=>(_c(i,typeof e!="symbol"?e+"":e,t),t),ws=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tl=(i,e,t)=>(ws(i,e,"read from private field"),t?t.call(i):e.get(i)),ks=(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)},Ga=(i,e,t,a)=>(ws(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ac=(i,e,t)=>(ws(i,e,"access private method"),t),Bt,Za,Ss,il,Ms={"media-target-live-window":"targetLiveWindow","media-stream-type":"streamType"},al=u.createElement("template");al.innerHTML=`
857
857
  <style>
858
858
  :host {
859
859
  display: inline-block;
@@ -865,7 +865,7 @@ ${a}${i.file}`}He(e)}var K={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"
865
865
  height: 100%;
866
866
  }
867
867
  </style>
868
- `;var $t=class extends d.HTMLElement{constructor(){super(),ks(this,Ss),ki(this,"renderRoot"),ki(this,"renderer"),ks(this,Bt,void 0),ks(this,Za,void 0),this.renderRoot=this.attachShadow({mode:"open"});let e=new MutationObserver(t=>{t.some(a=>{let r=a.target;return r===this?!0:r.localName!=="media-controller"?!1:!!(Ms[a.attributeName]||a.attributeName.startsWith("breakpoint-"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.createRenderer(),Ac(this,Ss,il).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=tl(this,Bt))!=null?e:this.constructor.template}set template(e){Ga(this,Bt,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:n})=>Ms[n]||n.startsWith("breakpoint-")),...Array.from(this.attributes)],s={};for(let n of r){let l=(a=Ms[n.name])!=null?a:Xs(n.name),{value:c}=n;c!=null?(Bi(c)&&(c=parseFloat(c)),s[l]=c===""?!0:c):s[l]=!1}return s}async attributeChangedCallback(e,t,a){var r;if(e==="template"&&t!=a){if(a){let s=(r=this.getRootNode())==null?void 0:r.getElementById(a);if(s)Ga(this,Bt,s);else if(yc(a))try{let n=await Tc(a),l=u.createElement("template");l.innerHTML=n,Ga(this,Bt,l)}catch{console.warn(`"${a}" is not a valid template element ID or a valid URL to a template file.`)}}this.createRenderer()}}createRenderer(){this.template&&this.template!==tl(this,Za)&&(Ga(this,Za,this.template),this.renderer=new Me(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(al.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Bt=new WeakMap;Za=new WeakMap;Ss=new WeakSet;il=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};ki($t,"template");ki($t,"observedAttributes",["template"]);ki($t,"processor",Ya);function yc(i){let e=/^https?:\/\//.test(i)?void 0:location.origin;try{new URL(i,e)}catch{return!1}return!0}async function Tc(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()}d.customElements.get("media-theme")||d.customElements.define("media-theme",$t);var rl=`:host {
868
+ `;var $t=class extends d.HTMLElement{constructor(){super(),ks(this,Ss),ki(this,"renderRoot"),ki(this,"renderer"),ks(this,Bt,void 0),ks(this,Za,void 0),this.renderRoot=this.attachShadow({mode:"open"});let e=new MutationObserver(t=>{t.some(a=>{let r=a.target;return r===this?!0:r.localName!=="media-controller"?!1:!!(Ms[a.attributeName]||a.attributeName.startsWith("breakpoint-"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.createRenderer(),Ac(this,Ss,il).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=tl(this,Bt))!=null?e:this.constructor.template}set template(e){Ga(this,Bt,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:n})=>Ms[n]||n.startsWith("breakpoint-")),...Array.from(this.attributes)],s={};for(let n of r){let l=(a=Ms[n.name])!=null?a:Xs(n.name),{value:c}=n;c!=null?(Bi(c)&&(c=parseFloat(c)),s[l]=c===""?!0:c):s[l]=!1}return s}async attributeChangedCallback(e,t,a){var r;if(e==="template"&&t!=a){if(a){let s=(r=this.getRootNode())==null?void 0:r.getElementById(a);if(s)Ga(this,Bt,s);else if(yc(a))try{let n=await Tc(a),l=u.createElement("template");l.innerHTML=n,Ga(this,Bt,l)}catch{console.warn(`"${a}" is not a valid template element ID or a valid URL to a template file.`)}}this.createRenderer()}}createRenderer(){this.template&&this.template!==tl(this,Za)&&(Ga(this,Za,this.template),this.renderer=new Se(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(al.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Bt=new WeakMap;Za=new WeakMap;Ss=new WeakSet;il=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};ki($t,"template");ki($t,"observedAttributes",["template"]);ki($t,"processor",Ya);function yc(i){let e=/^https?:\/\//.test(i)?void 0:location.origin;try{new URL(i,e)}catch{return!1}return!0}async function Tc(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()}d.customElements.get("media-theme")||d.customElements.define("media-theme",$t);var rl=`:host {
869
869
  --media-control-display: var(--controls);
870
870
  --media-loading-indicator-display: var(--loading-indicator);
871
871
  --media-dialog-display: var(--dialog);
@@ -905,6 +905,7 @@ a {
905
905
  media-theme {
906
906
  width: 100%;
907
907
  height: 100%;
908
+ direction: ltr;
908
909
  }
909
910
 
910
911
  ::part(top),
@@ -1049,6 +1050,19 @@ media-theme {
1049
1050
  --captions-selectmenu: none;
1050
1051
  }
1051
1052
 
1053
+
1054
+ /* 0.433s is the transition duration for VTT Regions.
1055
+ * Borrowed here, so the captions don't move too fast. */
1056
+ media-controller ::slotted([slot='media']) {
1057
+ --media-webkit-text-track-transition: transform 0.433s ease-out 0.3s;
1058
+ }
1059
+ media-controller:is([media-paused],:not([user-inactive])) ::slotted([slot='media']) {
1060
+ /* 42px is the height of the control bar and progress bar
1061
+ * with an additional 5px as a buffer, to get 47px */
1062
+ --media-webkit-text-track-transform: translateY(-47px);
1063
+ --media-webkit-text-track-transition: transform 0.15s ease;
1064
+ }
1065
+
1052
1066
  media-captions-selectmenu {
1053
1067
  --media-listbox-background: var(--_secondary-color);
1054
1068
  --media-listbox-selected-background: rgba(255, 255, 255, 0.28);
@@ -1790,7 +1804,7 @@ media-theme {
1790
1804
  <div class="dialog">
1791
1805
  <slot></slot>
1792
1806
  </div>
1793
- `;var Ke=class extends D.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})),nl(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Mc(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")&&nl(this)}};Ke.styles=ol,Ke.template=ll,Ke.observedAttributes=["open"];function nl(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=dl(i.shadowRoot)),i._previouslyFocusedElement=Q.activeElement,Q.activeElement instanceof HTMLElement&&Q.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function dl(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 s=0;s<r.length&&!(r[s].tagName&&r[s].shadowRoot&&(a=dl(r[s].shadowRoot),a));s++);}return a}function Mc(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}D.customElements.get("media-dialog")||(D.customElements.define("media-dialog",Ke),D.MediaDialog=Ke);var Cs=Ke;var cl=Q.createElement("template");cl.innerHTML=`
1807
+ `;var Ke=class extends O.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})),nl(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Mc(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")&&nl(this)}};Ke.styles=ol,Ke.template=ll,Ke.observedAttributes=["open"];function nl(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=dl(i.shadowRoot)),i._previouslyFocusedElement=Q.activeElement,Q.activeElement instanceof HTMLElement&&Q.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function dl(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 s=0;s<r.length&&!(r[s].tagName&&r[s].shadowRoot&&(a=dl(r[s].shadowRoot),a));s++);}return a}function Mc(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}O.customElements.get("media-dialog")||(O.customElements.define("media-dialog",Ke),O.MediaDialog=Ke);var Cs=Ke;var cl=Q.createElement("template");cl.innerHTML=`
1794
1808
  <style>
1795
1809
  ${Cs.styles}
1796
1810
 
@@ -1821,12 +1835,12 @@ media-theme {
1821
1835
  </svg>
1822
1836
  </button>
1823
1837
  </slot>
1824
- `;var Mi=class extends Cs{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};Mi.template=cl;D.customElements.get("mxp-dialog")||(D.customElements.define("mxp-dialog",Mi),D.MxpDialog=Mi);var Si=new WeakMap,wi=class{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=Si.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=Si.get(this.element);t&&t.delete(this.type)}}static for(e){Si.has(e.element)||Si.set(e.element,new Map);let t=e.attributeName.slice(2),a=Si.get(e.element);return a&&a.has(t)?a.get(t):new wi(e.element,t)}};function Sc(i,e){return i instanceof G&&i.attributeName.startsWith("on")?(wi.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function wc(i,e){return e instanceof qa&&i instanceof Se?(e.renderInto(i),!0):!1}function Cc(i,e){return e instanceof DocumentFragment&&i instanceof Se?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function Lc(i,e){if(i instanceof G){let t=i.attributeNamespace,a=i.element.getAttributeNS(t,i.attributeName);return String(e)!==a&&(i.value=String(e)),!0}return i.value=String(e),!0}function xc(i,e){if(i instanceof G&&e instanceof Element){let t=i.element;return t[i.attributeName]!==e&&(i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),t[i.attributeName]=e),!0}return!1}function Rc(i,e){if(typeof e=="boolean"&&i instanceof G){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function Dc(i,e){return e===!1&&i instanceof Se?(i.replace(""),!0):!1}function Oc(i,e){xc(i,e)||Rc(i,e)||Sc(i,e)||Dc(i,e)||wc(i,e)||Cc(i,e)||Lc(i,e)}var Ls=new Map,ul=new WeakMap,ml=new WeakMap,qa=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Ls.has(this.stringsKey))return Ls.get(this.stringsKey);{let e=Q.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,s)=>a+r+(s<t?`{{ ${s} }}`:""),""),Ls.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(ul.get(e)!==t){ul.set(e,t);let s=new Me(t,this.values,this.processor);ml.set(e,s),e instanceof Se?e.replace(...s.children):e.appendChild(s);return}let a=ml.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Nc={processCallback(i,e,t){var a;if(!!t){for(let[r,s]of e)if(r in t){let n=(a=t[r])!=null?a:"";Oc(s,n)}}}};function we(i,...e){return new qa(i,e,Nc)}function hl(i,e){i.renderInto(e)}var pl=require("@mux/playback-core"),xs=Q.createElement("template");"innerHTML"in xs&&(xs.innerHTML=sl);var bl=i=>we`
1838
+ `;var Mi=class extends Cs{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};Mi.template=cl;O.customElements.get("mxp-dialog")||(O.customElements.define("mxp-dialog",Mi),O.MxpDialog=Mi);var Si=new WeakMap,wi=class{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=Si.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=Si.get(this.element);t&&t.delete(this.type)}}static for(e){Si.has(e.element)||Si.set(e.element,new Map);let t=e.attributeName.slice(2),a=Si.get(e.element);return a&&a.has(t)?a.get(t):new wi(e.element,t)}};function Sc(i,e){return i instanceof G&&i.attributeName.startsWith("on")?(wi.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function wc(i,e){return e instanceof qa&&i instanceof we?(e.renderInto(i),!0):!1}function Cc(i,e){return e instanceof DocumentFragment&&i instanceof we?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function Lc(i,e){if(i instanceof G){let t=i.attributeNamespace,a=i.element.getAttributeNS(t,i.attributeName);return String(e)!==a&&(i.value=String(e)),!0}return i.value=String(e),!0}function xc(i,e){if(i instanceof G&&e instanceof Element){let t=i.element;return t[i.attributeName]!==e&&(i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),t[i.attributeName]=e),!0}return!1}function Rc(i,e){if(typeof e=="boolean"&&i instanceof G){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function Dc(i,e){return e===!1&&i instanceof we?(i.replace(""),!0):!1}function Oc(i,e){xc(i,e)||Rc(i,e)||Sc(i,e)||Dc(i,e)||wc(i,e)||Cc(i,e)||Lc(i,e)}var Ls=new Map,ul=new WeakMap,ml=new WeakMap,qa=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Ls.has(this.stringsKey))return Ls.get(this.stringsKey);{let e=Q.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,s)=>a+r+(s<t?`{{ ${s} }}`:""),""),Ls.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(ul.get(e)!==t){ul.set(e,t);let s=new Se(t,this.values,this.processor);ml.set(e,s),e instanceof we?e.replace(...s.children):e.appendChild(s);return}let a=ml.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Nc={processCallback(i,e,t){var a;if(!!t){for(let[r,s]of e)if(r in t){let n=(a=t[r])!=null?a:"";Oc(s,n)}}}};function Ce(i,...e){return new qa(i,e,Nc)}function hl(i,e){i.renderInto(e)}var pl=require("@mux/playback-core"),xs=Q.createElement("template");"innerHTML"in xs&&(xs.innerHTML=sl);var bl=i=>Ce`
1825
1839
  <style>
1826
1840
  ${rl}
1827
1841
  </style>
1828
1842
  ${Uc(i)}
1829
- `,Pc=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return gi(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Uc=i=>{var e,t,a,r,s,n,l,c,m,E,v,_,T,$,k,H,ce,ae,xe,Vt,mt,Ni,Os,Ns,Ps,Us,Bs,$s,Hs,Ws,Vs,Fs,Ks,Ys,Gs;return we`
1843
+ `,Pc=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return gi(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Uc=i=>{var e,t,a,r,s,n,l,c,m,f,_,g,y,x,$,k,_e,ce,J,Vt,mt,Ni,Os,Ns,Ps,Us,Bs,$s,Hs,Ws,Vs,Fs,Ks,Ys,Gs;return Ce`
1830
1844
  <media-theme
1831
1845
  template="${(e=i.themeTemplate)!=null?e:xs.content.children[0]}"
1832
1846
  default-stream-type="${(t=i.defaultStreamType)!=null?t:!1}"
@@ -1841,21 +1855,21 @@ media-theme {
1841
1855
  backward-seek-offset="${(l=i.backwardSeekOffset)!=null?l:!1}"
1842
1856
  playback-rates="${(c=i.playbackRates)!=null?c:!1}"
1843
1857
  default-show-remaining-time="${(m=i.defaultShowRemainingTime)!=null?m:!1}"
1844
- hide-duration="${(E=i.hideDuration)!=null?E:!1}"
1845
- title="${(v=i.title)!=null?v:!1}"
1858
+ hide-duration="${(f=i.hideDuration)!=null?f:!1}"
1859
+ title="${(_=i.title)!=null?_:!1}"
1846
1860
  exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, poster, live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
1847
1861
  >
1848
1862
  <mux-video
1849
1863
  slot="media"
1850
- target-live-window="${(_=i.targetLiveWindow)!=null?_:!1}"
1851
- stream-type="${(T=gi(i.streamType))!=null?T:!1}"
1852
- crossorigin="${($=i.crossOrigin)!=null?$:""}"
1864
+ target-live-window="${(g=i.targetLiveWindow)!=null?g:!1}"
1865
+ stream-type="${(y=gi(i.streamType))!=null?y:!1}"
1866
+ crossorigin="${(x=i.crossOrigin)!=null?x:""}"
1853
1867
  playsinline
1854
- autoplay="${(k=i.autoplay)!=null?k:!1}"
1855
- muted="${(H=i.muted)!=null?H:!1}"
1856
- loop="${(ce=i.loop)!=null?ce:!1}"
1857
- preload="${(ae=i.preload)!=null?ae:!1}"
1858
- debug="${(xe=i.debug)!=null?xe:!1}"
1868
+ autoplay="${($=i.autoplay)!=null?$:!1}"
1869
+ muted="${(k=i.muted)!=null?k:!1}"
1870
+ loop="${(_e=i.loop)!=null?_e:!1}"
1871
+ preload="${(ce=i.preload)!=null?ce:!1}"
1872
+ debug="${(J=i.debug)!=null?J:!1}"
1859
1873
  prefer-cmcd="${(Vt=i.preferCmcd)!=null?Vt:!1}"
1860
1874
  disable-cookies="${(mt=i.disableCookies)!=null?mt:!1}"
1861
1875
  prefer-playback="${(Ni=i.preferPlayback)!=null?Ni:!1}"
@@ -1869,7 +1883,7 @@ media-theme {
1869
1883
  cast-src="${i.src?i.src:i.playbackId?gs(i.playbackId,{maxResolution:i.maxResolution,domain:i.customDomain,token:i.tokens.playback}):!1}"
1870
1884
  exportparts="video"
1871
1885
  >
1872
- ${i.storyboard?we`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:we``}
1886
+ ${i.storyboard?Ce`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:Ce``}
1873
1887
  </mux-video>
1874
1888
  <media-poster-image
1875
1889
  slot="poster"
@@ -1883,18 +1897,18 @@ media-theme {
1883
1897
  onclose="${i.onCloseErrorDialog}"
1884
1898
  oninitfocus="${i.onInitFocusDialog}"
1885
1899
  >
1886
- ${(Vs=i.dialog)!=null&&Vs.title?we`<h3>${i.dialog.title}</h3>`:we``}
1900
+ ${(Vs=i.dialog)!=null&&Vs.title?Ce`<h3>${i.dialog.title}</h3>`:Ce``}
1887
1901
  <p>
1888
1902
  ${(Fs=i.dialog)==null?void 0:Fs.message}
1889
- ${(Ks=i.dialog)!=null&&Ks.linkUrl?we`<a
1903
+ ${(Ks=i.dialog)!=null&&Ks.linkUrl?Ce`<a
1890
1904
  href="${i.dialog.linkUrl}"
1891
1905
  target="_blank"
1892
1906
  rel="external noopener"
1893
- aria-label="${(Ys=i.dialog.linkText)!=null?Ys:""} ${y("(opens in a new window)")}"
1907
+ aria-label="${(Ys=i.dialog.linkText)!=null?Ys:""} ${T("(opens in a new window)")}"
1894
1908
  >${(Gs=i.dialog.linkText)!=null?Gs:i.dialog.linkUrl}</a
1895
- >`:we``}
1909
+ >`:Ce``}
1896
1910
  </p>
1897
1911
  </mxp-dialog>
1898
1912
  </media-theme>
1899
- `};var Ci=require("@mux/mux-video");function Qa(i,e,t,a,r){var l,c,m;let s={},n={};switch(i.code){case Ci.MediaError.MEDIA_ERR_NETWORK:{switch(s.title=y("Network Error",r),s.message=i.message,(l=i.data)==null?void 0:l.response.code){case 412:{s.title=y("Video is not currently available",r),s.message=y("The live stream or video file are not yet ready.",r),n.message=y("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),n.file="412-not-playable.md";break}case 404:{s.title=y("Video does not exist",r),s.message="",n.message=y("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),n.file="404-not-found.md";break}case 403:{if(s.title=y("Invalid playback URL",r),s.message=y("The video URL or playback-token are formatted with incorrect or incomplete information.",r),n.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),n.file="missing-signed-tokens.md",!a)break;let{exp:E,aud:v,sub:_}=$e(a),T=Date.now()>E*1e3,$=_!==t,k=v!=="v",H={timeStyle:"medium",dateStyle:"medium"};if(T){s.title=y("Video URL has expired",r),s.message=y("The video\u2019s secured playback-token has expired.",r),n.message=y("The video\u2019s secured playback-token has expired.",r),n.context=y("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(it.code,H).format(E*1e3),currentDate:new Intl.DateTimeFormat(it.code,H).format(Date.now())}),n.file="403-expired-token.md";break}if($){s.title=y("Video URL is formatted incorrectly",r),s.message=y("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),n.message=y("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),n.context=y("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:t,tokenPlaybackId:_}),n.file="403-playback-id-mismatch.md";break}if(k){s.title=y("Video URL is formatted incorrectly",r),s.message=y("The playback-token is formatted with incorrect information.",r),n.message=y("The playback-token is formatted with incorrect information.",r),n.context=y("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:v}),n.file="403-incorrect-aud-value.md";break}n.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),n.file="403-malformatted-token.md";break}}break}case Ci.MediaError.MEDIA_ERR_DECODE:{let{message:E}=i;s={title:y("Media Error",r),message:E},n.file="media-decode-error.md";break}case Ci.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let E=(m=(c=i.data)==null?void 0:c.response)==null?void 0:m.code;if(E>=400&&E<500){i.code=Ci.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:E}},{dialog:s,devlog:n}=Qa(i,e,t,a);break}s={title:y("Source Not Supported",r),message:i.message},n.file="media-src-not-supported.md";break}default:s={title:y("Error",r),message:i.message};break}return e&&(s={title:y("Your device appears to be offline",r),message:y("Check your internet connection and try reloading this video.",r)}),{dialog:s,devlog:n}}var Ce={SRC:"src",POSTER:"poster"},h={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-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",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window"},Rs=["audio","backward-seek-offset","default-show-remaining-time","default-showing-captions","noautoseektolive","disabled","exportparts","forward-seek-offset","hide-duration","hotkeys","nohotkeys","playbackrates","default-stream-type","stream-type","style","target-live-window","template","title"];function Bc(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(h.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:$c(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(h.NOHOTKEYS),hotKeys:i.getAttribute(h.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,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:gi(i.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:Hc(i),playbackRates:i.getAttribute(h.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(h.TITLE),...e}}function $c(i){var t,a;let e=i.getAttribute(h.THEME);if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let s=D.customElements.get(e);if(s!=null&&s.template)return s.template}}function Hc(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 El(i){return i.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,t)=>{let a=i.getAttribute(t);return a!==null&&(e[t.replace(/^metadata-/,"").replace(/-/g,"_")]=a),e},{})}var Wc=Object.values(g.Attributes),Vc=Object.values(Ce),Fc=Object.values(h),Kc=$a(),Yc="mux-player",fl={dialog:void 0,isDialogOpen:!1},xi,Ri,Le,Di,ut,Ye,Ht,za,vl,Oi,Ds,Ge,Wt,Xa,gl,Ja,_l,ja,Al,er,yl,Li=class extends ys{constructor(){super();x(this,Ye);x(this,za);x(this,Oi);x(this,Ge);x(this,Xa);x(this,Ja);x(this,ja);x(this,er);x(this,xi,!1);x(this,Ri,{});x(this,Le,!0);x(this,Di,new Ba(this,"hotkeys"));x(this,ut,{...fl,onCloseErrorDialog:()=>P(this,Oi,Ds).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{fs(this,Q.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),P(this,za,vl).call(this),this.isConnected&&P(this,Ye,Ht).call(this)}static get observedAttributes(){var t;return[...(t=ys.observedAttributes)!=null?t:[],...Vc,...Wc,...Fc]}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=El(this))}attributeChangedCallback(t,a,r){switch(P(this,Ye,Ht).call(this),super.attributeChangedCallback(t,a,r),t){case h.HOTKEYS:I(this,Di).value=r;break;case h.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&He(y("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case h.THUMBNAIL_TOKEN:{let{aud:n}=$e(r);r&&n!=="t"&&He(y("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:n}));break}case h.STORYBOARD_TOKEN:{let{aud:n}=$e(r);r&&n!=="s"&&He(y("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:n}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&le(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&&![w.StreamTypes.LIVE,w.StreamTypes.ON_DEMAND,w.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:_s({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})}):this.targetLiveWindow=r===w.StreamTypes.LIVE?0:Number.NaN}[g.Attributes.PLAYBACK_ID,Ce.SRC,h.PLAYBACK_TOKEN].includes(t)&&a!==r&&J(this,ut,{...I(this,ut),...fl}),P(this,Ge,Wt).call(this,{[$o(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?w.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):He(`Invalid value for preferCmcd. Must be one of ${w.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute("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(h.THEME))!=null?t:""}set theme(t){this.setAttribute(h.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(Rs.includes(r))continue;let s=t.getAttribute(r);a[Na(r)]=s===""?!0:s}return a}set themeProps(t){var r,s;P(this,Ye,Ht).call(this);let a={...this.themeProps,...t};for(let n in a){if(Rs.includes(n))continue;let l=t==null?void 0:t[n];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(Oa(n),Boolean(l)):(s=this.mediaTheme)==null||s.setAttribute(Oa(n),l)}}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=ct(this,Ce.SRC))!=null?t:void 0:(a=this.getAttribute(Ce.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Ce.SRC,t):this.removeAttribute(Ce.SRC)}get poster(){var a;let t=this.getAttribute(Ce.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return Uo(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Ce.POSTER,t):this.removeAttribute(Ce.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(h.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(h.STORYBOARD_SRC,t):this.removeAttribute(h.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[w.StreamTypes.LIVE,w.StreamTypes.UNKNOWN].includes(this.streamType)))return Bo(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(h.AUDIO)}set audio(t){if(!t){this.removeAttribute(h.AUDIO);return}this.setAttribute(h.AUDIO,"")}get hotkeys(){return I(this,Di)}get nohotkeys(){return this.hasAttribute(h.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(h.NOHOTKEYS);return}this.setAttribute(h.NOHOTKEYS,"")}get thumbnailTime(){return Ie(this.getAttribute(h.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(h.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(h.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(h.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=ct(this,h.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(h.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(h.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=D.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(h.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(h.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=D.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(h.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(h.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(h.PLAYBACK_RATES))return this.getAttribute(h.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(h.PLAYBACK_RATES);return}this.setAttribute(h.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=Ie(this.getAttribute(h.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(h.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=Ie(this.getAttribute(h.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(h.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(h.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:Yc}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:Kc}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 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=ct(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get debug(){return ct(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return ct(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:w.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?r:w.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(h.DEFAULT_STREAM_TYPE,t):this.removeAttribute(h.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(h.TARGET_LIVE_WINDOW)?+this.getAttribute(h.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(h.TARGET_LIVE_WINDOW):this.setAttribute(h.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return Ie(ct(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===w.PlaybackTypes.MSE||t===w.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===w.PlaybackTypes.MSE||t===w.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(P(this,Ye,Ht).call(this),!this.media){le("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...El(this),...t}}async addCuePoints(t){var a;if(P(this,Ye,Ht).call(this),!this.media){le("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(h.PLAYBACK_TOKEN),a=this.getAttribute(h.THUMBNAIL_TOKEN),r=this.getAttribute(h.STORYBOARD_TOKEN);return{...I(this,Ri),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){J(this,Ri,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(h.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(h.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(h.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(h.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(h.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(h.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,s){var l;let n=(l=this.media)==null?void 0:l.nativeEl;if(!!n)return(0,w.addTextTrack)(n,t,a,r,s)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,w.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};xi=new WeakMap,Ri=new WeakMap,Le=new WeakMap,Di=new WeakMap,ut=new WeakMap,Ye=new WeakSet,Ht=function(){var t,a,r;if(!I(this,xi)){J(this,xi,!0),P(this,Ge,Wt).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof D.HTMLElement))throw""}catch{le("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{le("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ti))throw""}catch{le("<media-controller> failed to upgrade!")}Ko(this),P(this,Xa,gl).call(this),P(this,Ja,_l).call(this),P(this,ja,Al).call(this),J(this,Le,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("user-inactive"))!=null?a:!0),P(this,er,yl).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{P(this,Ge,Wt).call(this)})}},za=new WeakSet,vl=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{}},Oi=new WeakSet,Ds=function(t){Object.assign(I(this,ut),t),P(this,Ge,Wt).call(this)},Ge=new WeakSet,Wt=function(t={}){hl(bl(Bc(this,{...I(this,ut),...t})),this.shadowRoot)},Xa=new WeakSet,gl=function(){let t=r=>{var l,c;if(!(r!=null&&r.startsWith("theme-")))return;let s=r.replace(/^theme-/,"");if(Rs.includes(s))return;let n=this.getAttribute(r);n!=null?(l=this.mediaTheme)==null||l.setAttribute(s,n):(c=this.mediaTheme)==null||c.removeAttribute(s)};new MutationObserver(r=>{for(let{attributeName:s}of r)t(s)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},Ja=new WeakSet,_l=function(){var a;let t=r=>{let{detail:s}=r;if(s instanceof g.MediaError||(s=new g.MediaError(s.message,s.code,s.fatal)),!(s!=null&&s.fatal)){He(s),s.data&&He(`${s.name} data:`,s.data);return}let{dialog:n,devlog:l}=Qa(s,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&_s(l),le(s),s.data&&le(`${s.name} data:`,s.data),P(this,Oi,Ds).call(this,{isDialogOpen:!0,dialog:n})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var n,l,c;if(!(((n=this.media)==null?void 0:n.error)instanceof g.MediaError))return r;let{devlog:s}=Qa((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(c=this.media)==null?void 0:c.error.code,player_error_message:s.message?String(s.message):r.player_error_message,player_error_context:s.context?String(s.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var n,l;let{detail:s}=r;if(!s){let{message:c,code:m}=(l=(n=this.media)==null?void 0:n.error)!=null?l:{};s=new g.MediaError(c,m)}!(s!=null&&s.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:s}))})},ja=new WeakSet,Al=function(){var a,r,s,n;let t=()=>P(this,Ge,Wt).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(n=(s=this.media)==null?void 0:s.textTracks)==null||n.addEventListener("removetrack",t)},er=new WeakSet,yl=function(){var m,E;let t=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(t)return;let a,r=new WeakMap,s=()=>this.streamType===w.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,n=(v,_,T=!1)=>{if(s())return;Array.from(v&&v.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!_||this.paused){let H=k.text.split(`
1900
- `).length,ce=t?-2:-3;this.streamType===w.StreamTypes.LIVE&&(ce=t?-1:-2);let ae=ce-H;if(k.line===ae&&!T)return;r.has(k)||r.set(k,k.line),k.line=ae-1,k.line=ae}else setTimeout(()=>{k.line=r.get(k)||"auto"},500)})},l=()=>{var v,_;n(a,(_=(v=this.mediaController)==null?void 0:v.hasAttribute("user-inactive"))!=null?_:!1)},c=()=>{var T,$;let _=Array.from((($=(T=this.mediaController)==null?void 0:T.media)==null?void 0:$.textTracks)||[]).filter(k=>["subtitles","captions"].includes(k.kind)&&k.mode==="showing")[0];_!==a&&(a==null||a.removeEventListener("cuechange",l)),a=_,a==null||a.addEventListener("cuechange",l),n(a,I(this,Le))};if(c(),(m=this.textTracks)==null||m.addEventListener("change",c),(E=this.textTracks)==null||E.addEventListener("addtrack",c),navigator.userAgent.includes("Chrome/")){let v=()=>{n(a,I(this,Le),!0),this.paused||window.requestAnimationFrame(v)};this.addEventListener("playing",()=>{v()})}this.addEventListener("userinactivechange",()=>{var _,T;let v=(T=(_=this.mediaController)==null?void 0:_.hasAttribute("user-inactive"))!=null?T:!0;I(this,Le)!==v&&(J(this,Le,v),n(a,I(this,Le)))})};function ct(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}D.customElements.get("mux-player")||(D.customElements.define("mux-player",Li),D.MuxPlayerElement=Li);var Gc=Li;
1913
+ `};var Ci=require("@mux/mux-video");function Qa(i,e,t,a,r){var l,c,m;let s={},n={};switch(i.code){case Ci.MediaError.MEDIA_ERR_NETWORK:{switch(s.title=T("Network Error",r),s.message=i.message,(l=i.data)==null?void 0:l.response.code){case 412:{s.title=T("Video is not currently available",r),s.message=T("The live stream or video file are not yet ready.",r),n.message=T("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),n.file="412-not-playable.md";break}case 404:{s.title=T("Video does not exist",r),s.message="",n.message=T("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),n.file="404-not-found.md";break}case 403:{if(s.title=T("Invalid playback URL",r),s.message=T("The video URL or playback-token are formatted with incorrect or incomplete information.",r),n.message=T("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),n.file="missing-signed-tokens.md",!a)break;let{exp:f,aud:_,sub:g}=$e(a),y=Date.now()>f*1e3,x=g!==t,$=_!=="v",k={timeStyle:"medium",dateStyle:"medium"};if(y){s.title=T("Video URL has expired",r),s.message=T("The video\u2019s secured playback-token has expired.",r),n.message=T("The video\u2019s secured playback-token has expired.",r),n.context=T("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(it.code,k).format(f*1e3),currentDate:new Intl.DateTimeFormat(it.code,k).format(Date.now())}),n.file="403-expired-token.md";break}if(x){s.title=T("Video URL is formatted incorrectly",r),s.message=T("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),n.message=T("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),n.context=T("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:t,tokenPlaybackId:g}),n.file="403-playback-id-mismatch.md";break}if($){s.title=T("Video URL is formatted incorrectly",r),s.message=T("The playback-token is formatted with incorrect information.",r),n.message=T("The playback-token is formatted with incorrect information.",r),n.context=T("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:_}),n.file="403-incorrect-aud-value.md";break}n.message=T("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),n.file="403-malformatted-token.md";break}}break}case Ci.MediaError.MEDIA_ERR_DECODE:{let{message:f}=i;s={title:T("Media Error",r),message:f},n.file="media-decode-error.md";break}case Ci.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let f=(m=(c=i.data)==null?void 0:c.response)==null?void 0:m.code;if(f>=400&&f<500){i.code=Ci.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:f}},{dialog:s,devlog:n}=Qa(i,e,t,a);break}s={title:T("Source Not Supported",r),message:i.message},n.file="media-src-not-supported.md";break}default:s={title:T("Error",r),message:i.message};break}return e&&(s={title:T("Your device appears to be offline",r),message:T("Check your internet connection and try reloading this video.",r)}),{dialog:s,devlog:n}}var Le={SRC:"src",POSTER:"poster"},h={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-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",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window"},Rs=["audio","backward-seek-offset","default-show-remaining-time","default-showing-captions","noautoseektolive","disabled","exportparts","forward-seek-offset","hide-duration","hotkeys","nohotkeys","playbackrates","default-stream-type","stream-type","style","target-live-window","template","title"];function Bc(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(h.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:$c(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(h.NOHOTKEYS),hotKeys:i.getAttribute(h.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,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(v.Attributes.TARGET_LIVE_WINDOW),streamType:gi(i.getAttribute(v.Attributes.STREAM_TYPE)),primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:Hc(i),playbackRates:i.getAttribute(h.PLAYBACK_RATES),customDomain:(a=i.getAttribute(v.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(h.TITLE),...e}}function $c(i){var t,a;let e=i.getAttribute(h.THEME);if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let s=O.customElements.get(e);if(s!=null&&s.template)return s.template}}function Hc(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 fl(i){return i.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,t)=>{let a=i.getAttribute(t);return a!==null&&(e[t.replace(/^metadata-/,"").replace(/-/g,"_")]=a),e},{})}var Wc=Object.values(v.Attributes),Vc=Object.values(Le),Fc=Object.values(h),Kc=$a(),Yc="mux-player",El={dialog:void 0,isDialogOpen:!1},xi,Ri,xe,Di,ut,Ye,Ht,za,vl,Oi,Ds,Ge,Wt,Xa,gl,Ja,_l,ja,Al,er,yl,Li=class extends ys{constructor(){super();R(this,Ye);R(this,za);R(this,Oi);R(this,Ge);R(this,Xa);R(this,Ja);R(this,ja);R(this,er);R(this,xi,!1);R(this,Ri,{});R(this,xe,!0);R(this,Di,new Ba(this,"hotkeys"));R(this,ut,{...El,onCloseErrorDialog:()=>U(this,Oi,Ds).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{Es(this,Q.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),U(this,za,vl).call(this),this.isConnected&&U(this,Ye,Ht).call(this)}static get observedAttributes(){var t;return[...(t=ys.observedAttributes)!=null?t:[],...Vc,...Wc,...Fc]}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=fl(this))}attributeChangedCallback(t,a,r){switch(U(this,Ye,Ht).call(this),super.attributeChangedCallback(t,a,r),t){case h.HOTKEYS:I(this,Di).value=r;break;case h.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&He(T("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case h.THUMBNAIL_TOKEN:{let{aud:n}=$e(r);r&&n!=="t"&&He(T("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:n}));break}case h.STORYBOARD_TOKEN:{let{aud:n}=$e(r);r&&n!=="s"&&He(T("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:n}));break}case v.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&le(T("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case v.Attributes.STREAM_TYPE:r&&![w.StreamTypes.LIVE,w.StreamTypes.ON_DEMAND,w.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:_s({file:"invalid-stream-type.md",message:T("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=r===w.StreamTypes.LIVE?0:Number.NaN}[v.Attributes.PLAYBACK_ID,Le.SRC,h.PLAYBACK_TOKEN].includes(t)&&a!==r&&j(this,ut,{...I(this,ut),...El}),U(this,Ge,Wt).call(this,{[$o(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(v.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?w.CmcdTypeValues.includes(t)?this.setAttribute(v.Attributes.PREFER_CMCD,t):He(`Invalid value for preferCmcd. Must be one of ${w.CmcdTypeValues.join()}`):this.removeAttribute(v.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute("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(h.THEME))!=null?t:""}set theme(t){this.setAttribute(h.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(Rs.includes(r))continue;let s=t.getAttribute(r);a[Na(r)]=s===""?!0:s}return a}set themeProps(t){var r,s;U(this,Ye,Ht).call(this);let a={...this.themeProps,...t};for(let n in a){if(Rs.includes(n))continue;let l=t==null?void 0:t[n];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(Oa(n),Boolean(l)):(s=this.mediaTheme)==null||s.setAttribute(Oa(n),l)}}get playbackId(){var t;return(t=this.getAttribute(v.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(v.Attributes.PLAYBACK_ID,t):this.removeAttribute(v.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=ct(this,Le.SRC))!=null?t:void 0:(a=this.getAttribute(Le.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Le.SRC,t):this.removeAttribute(Le.SRC)}get poster(){var a;let t=this.getAttribute(Le.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return Uo(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Le.POSTER,t):this.removeAttribute(Le.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(h.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(h.STORYBOARD_SRC,t):this.removeAttribute(h.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[w.StreamTypes.LIVE,w.StreamTypes.UNKNOWN].includes(this.streamType)))return Bo(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(h.AUDIO)}set audio(t){if(!t){this.removeAttribute(h.AUDIO);return}this.setAttribute(h.AUDIO,"")}get hotkeys(){return I(this,Di)}get nohotkeys(){return this.hasAttribute(h.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(h.NOHOTKEYS);return}this.setAttribute(h.NOHOTKEYS,"")}get thumbnailTime(){return ke(this.getAttribute(h.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(h.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(h.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(h.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=ct(this,h.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(h.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(h.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=O.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(h.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(h.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=O.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(h.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(h.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(h.PLAYBACK_RATES))return this.getAttribute(h.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(h.PLAYBACK_RATES);return}this.setAttribute(h.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=ke(this.getAttribute(h.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(h.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=ke(this.getAttribute(h.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(h.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(h.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:Yc}get playerSoftwareVersion(){var t;return(t=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:Kc}get beaconCollectionDomain(){var t;return(t=this.getAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(v.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(v.Attributes.MAX_RESOLUTION,t):this.removeAttribute(v.Attributes.MAX_RESOLUTION))}get customDomain(){var t;return(t=this.getAttribute(v.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(v.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(v.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=ct(this,v.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(v.Attributes.ENV_KEY,`${t}`)}get debug(){return ct(this,v.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(v.Attributes.DEBUG,""):this.removeAttribute(v.Attributes.DEBUG)}get disableCookies(){return ct(this,v.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(v.Attributes.DISABLE_COOKIES,""):this.removeAttribute(v.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(v.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:w.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(v.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?r:w.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(h.DEFAULT_STREAM_TYPE,t):this.removeAttribute(h.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(h.TARGET_LIVE_WINDOW)?+this.getAttribute(h.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(h.TARGET_LIVE_WINDOW):this.setAttribute(h.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return ke(ct(this,v.Attributes.START_TIME))}set startTime(t){this.setAttribute(v.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(v.Attributes.PREFER_PLAYBACK);if(t===w.PlaybackTypes.MSE||t===w.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===w.PlaybackTypes.MSE||t===w.PlaybackTypes.NATIVE?this.setAttribute(v.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(v.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(U(this,Ye,Ht).call(this),!this.media){le("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...fl(this),...t}}async addCuePoints(t){var a;if(U(this,Ye,Ht).call(this),!this.media){le("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(h.PLAYBACK_TOKEN),a=this.getAttribute(h.THUMBNAIL_TOKEN),r=this.getAttribute(h.STORYBOARD_TOKEN);return{...I(this,Ri),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){j(this,Ri,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(h.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(h.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(h.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(h.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(h.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(h.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,s){var l;let n=(l=this.media)==null?void 0:l.nativeEl;if(!!n)return(0,w.addTextTrack)(n,t,a,r,s)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,w.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};xi=new WeakMap,Ri=new WeakMap,xe=new WeakMap,Di=new WeakMap,ut=new WeakMap,Ye=new WeakSet,Ht=function(){var t,a,r;if(!I(this,xi)){j(this,xi,!0),U(this,Ge,Wt).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof O.HTMLElement))throw""}catch{le("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof v.default))throw""}catch{le("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ti))throw""}catch{le("<media-controller> failed to upgrade!")}Ko(this),U(this,Xa,gl).call(this),U(this,Ja,_l).call(this),U(this,ja,Al).call(this),j(this,xe,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("user-inactive"))!=null?a:!0),U(this,er,yl).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{U(this,Ge,Wt).call(this)})}},za=new WeakSet,vl=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{}},Oi=new WeakSet,Ds=function(t){Object.assign(I(this,ut),t),U(this,Ge,Wt).call(this)},Ge=new WeakSet,Wt=function(t={}){hl(bl(Bc(this,{...I(this,ut),...t})),this.shadowRoot)},Xa=new WeakSet,gl=function(){let t=r=>{var l,c;if(!(r!=null&&r.startsWith("theme-")))return;let s=r.replace(/^theme-/,"");if(Rs.includes(s))return;let n=this.getAttribute(r);n!=null?(l=this.mediaTheme)==null||l.setAttribute(s,n):(c=this.mediaTheme)==null||c.removeAttribute(s)};new MutationObserver(r=>{for(let{attributeName:s}of r)t(s)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},Ja=new WeakSet,_l=function(){var a;let t=r=>{let{detail:s}=r;if(s instanceof v.MediaError||(s=new v.MediaError(s.message,s.code,s.fatal)),!(s!=null&&s.fatal)){He(s),s.data&&He(`${s.name} data:`,s.data);return}let{dialog:n,devlog:l}=Qa(s,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&_s(l),le(s),s.data&&le(`${s.name} data:`,s.data),U(this,Oi,Ds).call(this,{isDialogOpen:!0,dialog:n})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var n,l,c;if(!(((n=this.media)==null?void 0:n.error)instanceof v.MediaError))return r;let{devlog:s}=Qa((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(c=this.media)==null?void 0:c.error.code,player_error_message:s.message?String(s.message):r.player_error_message,player_error_context:s.context?String(s.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var n,l;let{detail:s}=r;if(!s){let{message:c,code:m}=(l=(n=this.media)==null?void 0:n.error)!=null?l:{};s=new v.MediaError(c,m)}!(s!=null&&s.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:s}))})},ja=new WeakSet,Al=function(){var a,r,s,n;let t=()=>U(this,Ge,Wt).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(n=(s=this.media)==null?void 0:s.textTracks)==null||n.addEventListener("removetrack",t)},er=new WeakSet,yl=function(){var f,_;let t=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let r,s=new WeakMap,n=()=>this.streamType===w.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,l=(g,y,x=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!y||this.paused){let _e=k.text.split(`
1914
+ `).length,ce=t?-2:-3;this.streamType===w.StreamTypes.LIVE&&(ce=t?-1:-2);let J=ce-_e;if(k.line===J&&!x)return;s.has(k)||s.set(k,k.line),k.line=J-1,k.line=J}else setTimeout(()=>{k.line=s.get(k)||"auto"},500)})},c=()=>{var g,y;l(r,(y=(g=this.mediaController)==null?void 0:g.hasAttribute("user-inactive"))!=null?y:!1)},m=()=>{var x,$;let y=Array.from((($=(x=this.mediaController)==null?void 0:x.media)==null?void 0:$.textTracks)||[]).filter(k=>["subtitles","captions"].includes(k.kind)&&k.mode==="showing")[0];y!==r&&(r==null||r.removeEventListener("cuechange",c)),r=y,r==null||r.addEventListener("cuechange",c),l(r,I(this,xe))};if(m(),(f=this.textTracks)==null||f.addEventListener("change",m),(_=this.textTracks)==null||_.addEventListener("addtrack",m),navigator.userAgent.includes("Chrome/")){let g=()=>{l(r,I(this,xe),!0),this.paused||window.requestAnimationFrame(g)};this.addEventListener("playing",()=>{g()})}this.addEventListener("userinactivechange",()=>{var y,x;let g=(x=(y=this.mediaController)==null?void 0:y.hasAttribute("user-inactive"))!=null?x:!0;I(this,xe)!==g&&(j(this,xe,g),l(r,I(this,xe)))})};function ct(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}O.customElements.get("mux-player")||(O.customElements.define("mux-player",Li),O.MuxPlayerElement=Li);var Gc=Li;