@mux/mux-player 1.7.2 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Uo=Object.create;var Ii=Object.defineProperty;var No=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var Ho=Object.getPrototypeOf,$o=Object.prototype.hasOwnProperty;var Wo=(i,e)=>{for(var t in e)Ii(i,t,{get:e[t],enumerable:!0})},pn=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Bo(e))!$o.call(i,r)&&r!==t&&Ii(i,r,{get:()=>e[r],enumerable:!(a=No(e,r))||a.enumerable});return i};var Vo=(i,e,t)=>(t=i!=null?Uo(Ho(i)):{},pn(e||!i||!i.__esModule?Ii(t,"default",{value:i,enumerable:!0}):t,i)),Fo=i=>pn(Ii({},"__esModule",{value:!0}),i);var Ma=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var A=(i,e,t)=>(Ma(i,e,"read from private field"),t?t.call(i):e.get(i)),L=(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)},G=(i,e,t,a)=>(Ma(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var P=(i,e,t)=>(Ma(i,e,"access private method"),t);var qd={};Wo(qd,{MediaError:()=>v.MediaError,default:()=>Zd,getVideoAttribute:()=>Be});module.exports=Fo(qd);var dt=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends dt{}globalThis.DocumentFragment=i}var Dt=class extends dt{},ka=class extends dt{},Ko={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(Dt)}},Rt,Sa=class{constructor(e,t={}){L(this,Rt,void 0);G(this,Rt,t==null?void 0:t.detail)}get detail(){return A(this,Rt)}initCustomEvent(){}};Rt=new WeakMap;function Yo(i,e){return new Dt}var bn={document:{createElement:Yo},DocumentFragment,customElements:Ko,CustomEvent:Sa,EventTarget:dt,HTMLElement:Dt,HTMLVideoElement:ka},En=typeof window=="undefined"||typeof globalThis.customElements=="undefined",R=En?bn:globalThis,F=En?bn.document:globalThis.document;var h={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"},Ot={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"},p={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_TIME_IS_LIVE:"media-time-is-live"},Jd=Object.entries(Ot).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"user-inactive"}),fn=Object.entries(o).reduce((i,[e,t])=>{let a=Ot[e];return a&&(i[t]=a),i},{"user-inactive":"userinactivechange"}),ct={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},$e={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ca={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ee={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Pt={LIVE:"live",ON_DEMAND:"on-demand"};var $={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"},w={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`},Zo={...$,...w};function Ti(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 vn(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function gn(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function An(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var _n=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],qo=(i,e)=>{let t=i===1?_n[e].singular:_n[e].plural;return`${i} ${t}`},We=i=>{if(!gn(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,c)=>d&&qo(d,c)).filter(d=>d).join(", ")}${t?" remaining":""}`};function X(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="-"),n=n>0||d>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Mi=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},La=class{observe(){}},yn={ResizeObserver:La,HTMLElement:class extends Mi{},DocumentFragment:class extends Mi{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},zo={createElement:function(){return new yn.HTMLElement}},In=typeof window=="undefined"||typeof window.customElements=="undefined",l=In?yn:window,u=In?zo:window.document;var Xo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ve=(i,e,t)=>(Xo(i,e,"read from private field"),t?t.call(i):e.get(i)),wa=(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)},ki,ut,xa,Tn=u.createElement("template");Tn.innerHTML=`
1
+ "use strict";var Uo=Object.create;var Ii=Object.defineProperty;var No=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var Ho=Object.getPrototypeOf,$o=Object.prototype.hasOwnProperty;var Wo=(i,e)=>{for(var t in e)Ii(i,t,{get:e[t],enumerable:!0})},pn=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Bo(e))!$o.call(i,r)&&r!==t&&Ii(i,r,{get:()=>e[r],enumerable:!(a=No(e,r))||a.enumerable});return i};var Vo=(i,e,t)=>(t=i!=null?Uo(Ho(i)):{},pn(e||!i||!i.__esModule?Ii(t,"default",{value:i,enumerable:!0}):t,i)),Fo=i=>pn(Ii({},"__esModule",{value:!0}),i);var Ma=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var A=(i,e,t)=>(Ma(i,e,"read from private field"),t?t.call(i):e.get(i)),L=(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)},G=(i,e,t,a)=>(Ma(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var P=(i,e,t)=>(Ma(i,e,"access private method"),t);var qd={};Wo(qd,{MediaError:()=>f.MediaError,default:()=>Zd,getVideoAttribute:()=>Be});module.exports=Fo(qd);var dt=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends dt{}globalThis.DocumentFragment=i}var Rt=class extends dt{},ka=class extends dt{},Ko={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(Rt)}},Dt,Sa=class{constructor(e,t={}){L(this,Dt,void 0);G(this,Dt,t==null?void 0:t.detail)}get detail(){return A(this,Dt)}initCustomEvent(){}};Dt=new WeakMap;function Yo(i,e){return new Rt}var bn={document:{createElement:Yo},DocumentFragment,customElements:Ko,CustomEvent:Sa,EventTarget:dt,HTMLElement:Rt,HTMLVideoElement:ka},En=typeof window=="undefined"||typeof globalThis.customElements=="undefined",D=En?bn:globalThis,F=En?bn.document:globalThis.document;var h={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"},Ot={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"},p={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_TIME_IS_LIVE:"media-time-is-live"},Jd=Object.entries(Ot).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"user-inactive"}),fn=Object.entries(o).reduce((i,[e,t])=>{let a=Ot[e];return a&&(i[t]=a),i},{"user-inactive":"userinactivechange"}),ct={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},$e={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ca={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ee={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Pt={LIVE:"live",ON_DEMAND:"on-demand"};var $={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"},w={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`},Zo={...$,...w};function Ti(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 vn(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function gn(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function An(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var _n=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],qo=(i,e)=>{let t=i===1?_n[e].singular:_n[e].plural;return`${i} ${t}`},We=i=>{if(!gn(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,c)=>d&&qo(d,c)).filter(d=>d).join(", ")}${t?" remaining":""}`};function X(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="-"),n=n>0||d>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Mi=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},La=class{observe(){}},yn={ResizeObserver:La,HTMLElement:class extends Mi{},DocumentFragment:class extends Mi{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},zo={createElement:function(){return new yn.HTMLElement}},In=typeof window=="undefined"||typeof window.customElements=="undefined",l=In?yn:window,u=In?zo:window.document;var Xo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ve=(i,e,t)=>(Xo(i,e,"read from private field"),t?t.call(i):e.get(i)),wa=(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)},ki,ut,xa,Tn=u.createElement("template");Tn.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  display: inline-flex;
@@ -55,7 +55,7 @@
55
55
  </svg>
56
56
  `,Mn=u.createElement("template");Mn.innerHTML=`
57
57
  <slot name="airplay">${Jo}</slot>
58
- `;var Da=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Mn,...e})}connectedCallback(){this.setAttribute("aria-label",w.AIRPLAY()),super.connectedCallback()}handleClick(){let e=new l.CustomEvent(h.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",Da);var jo='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',el='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>',Sn=u.createElement("template");Sn.innerHTML=`
58
+ `;var Ra=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Mn,...e})}connectedCallback(){this.setAttribute("aria-label",w.AIRPLAY()),super.connectedCallback()}handleClick(){let e=new l.CustomEvent(h.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",Ra);var jo='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',el='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>',Sn=u.createElement("template");Sn.innerHTML=`
59
59
  <style>
60
60
  :host([${o.MEDIA_IS_CASTING}]) slot:not([name=exit]) > *,
61
61
  :host([${o.MEDIA_IS_CASTING}]) ::slotted(:not([slot=exit])) {
@@ -71,14 +71,14 @@
71
71
 
72
72
  <slot name="enter">${jo}</slot>
73
73
  <slot name="exit">${el}</slot>
74
- `;var kn=i=>{let t=i.getAttribute(o.MEDIA_IS_CASTING)!=null?w.EXIT_CAST():w.ENTER_CAST();i.setAttribute("aria-label",t)},Ra=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Sn,...e})}connectedCallback(){kn(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_CASTING&&kn(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_CASTING)!=null?h.MEDIA_EXIT_CAST_REQUEST:h.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",Ra);var Ci=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},tl=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Li=(i,e)=>tl(i,e)[0],Ut=(i,e)=>!i||!e?!1:i.contains(e)?!0:Ut(i,e.getRootNode().host),Fe=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Fe(i.getRootNode().host,e)};function ce(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===e)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{}}}}var Ln=u.createElement("template");Ln.innerHTML=`
74
+ `;var kn=i=>{let t=i.getAttribute(o.MEDIA_IS_CASTING)!=null?w.EXIT_CAST():w.ENTER_CAST();i.setAttribute("aria-label",t)},Da=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Sn,...e})}connectedCallback(){kn(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_CASTING&&kn(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_CASTING)!=null?h.MEDIA_EXIT_CAST_REQUEST:h.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",Da);var Ci=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},tl=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Li=(i,e)=>tl(i,e)[0],Ut=(i,e)=>!i||!e?!1:i.contains(e)?!0:Ut(i,e.getRootNode().host),Fe=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Fe(i.getRootNode().host,e)};function ce(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===e)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{}}}}var Ln=u.createElement("template");Ln.innerHTML=`
75
75
  <style>
76
76
  :host {
77
77
  display: inline-block;
78
78
  box-sizing: border-box;
79
79
  }
80
80
  </style>
81
- `;var Oa=class extends l.HTMLElement{static get observedAttributes(){return[p.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}constructor(e={}){super();let t=this.attachShadow({mode:"open"}),a=Ln.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)}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var e;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0);let t=Cn(this);this.getAttribute(p.MEDIA_CONTROLLER)&&((e=t==null?void 0:t.associateElement)==null||e.call(t,this)),t==null||t.addEventListener("pointerdown",this),t==null||t.addEventListener("click",this)}disconnectedCallback(){var e;let t=Cn(this);this.getAttribute(p.MEDIA_CONTROLLER)&&((e=t==null?void 0:t.unassociateElement)==null||e.call(t,this)),t==null||t.removeEventListener("pointerdown",this),t==null||t.removeEventListener("click",this)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:s}=e,{left:d,top:c,width:m,height:b}=this.getBoundingClientRect(),y=n-d,f=s-c;if(y<0||f<0||y>m||f>b||m===0&&b===0)return;let{pointerType:I=this._pointerType}=e;if(this._pointerType=void 0,I===Ca.TOUCH){this.handleTap(e);return}else if(I===Ca.MOUSE){this.handleMouseClick(e);return}}}}handleTap(e){}handleMouseClick(e){let t=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}};function Cn(i){let e=i.getAttribute(p.MEDIA_CONTROLLER);return e?u.getElementById(e):Fe(i,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Oa);var wn=u.createElement("template");wn.innerHTML=`
81
+ `;var Oa=class extends l.HTMLElement{static get observedAttributes(){return[p.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}constructor(e={}){super();let t=this.attachShadow({mode:"open"}),a=Ln.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)}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var e;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0);let t=Cn(this);this.getAttribute(p.MEDIA_CONTROLLER)&&((e=t==null?void 0:t.associateElement)==null||e.call(t,this)),t==null||t.addEventListener("pointerdown",this),t==null||t.addEventListener("click",this)}disconnectedCallback(){var e;let t=Cn(this);this.getAttribute(p.MEDIA_CONTROLLER)&&((e=t==null?void 0:t.unassociateElement)==null||e.call(t,this)),t==null||t.removeEventListener("pointerdown",this),t==null||t.removeEventListener("click",this)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:s}=e,{left:d,top:c,width:m,height:b}=this.getBoundingClientRect(),y=n-d,v=s-c;if(y<0||v<0||y>m||v>b||m===0&&b===0)return;let{pointerType:I=this._pointerType}=e;if(this._pointerType=void 0,I===Ca.TOUCH){this.handleTap(e);return}else if(I===Ca.MOUSE){this.handleMouseClick(e);return}}}}handleTap(e){}handleMouseClick(e){let t=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}};function Cn(i){let e=i.getAttribute(p.MEDIA_CONTROLLER);return e?u.getElementById(e):Fe(i,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Oa);var wn=u.createElement("template");wn.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 il=Object.values(o),al="sm:384 md:576 lg:768 xl:960",rl=i=>{var e;for(let t of i){let a=t.target;if(!a.isConnected)continue;let r=(e=a.getAttribute("breakpoints"))!=null?e:al,n=nl(r),s=sl(n,t.contentRect);Object.keys(n).forEach(d=>{if(s.includes(d)){a.hasAttribute(`breakpoint-${d}`)||a.setAttribute(`breakpoint-${d}`,"");return}a.removeAttribute(`breakpoint-${d}`)})}};function nl(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function sl(i,e){return Object.keys(i).filter(t=>e.width>=i[t])}var wi=class extends l.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(wn.content.cloneNode(!0));let e=s=>{let d=this.media;for(let c of s)c.type==="childList"&&(c.removedNodes.forEach(m=>{if(m.slot=="media"&&c.target==this){let b=c.previousSibling&&c.previousSibling.previousElementSibling;if(!b||!d)this.mediaUnsetCallback(m);else{let y=b.slot!=="media";for(;(b=b.previousSibling)!==null;)b.slot=="media"&&(y=!1);y&&this.mediaUnsetCallback(m)}}}),d&&c.addedNodes.forEach(m=>{m==d&&this.handleMediaUpdated(d).then(b=>this.mediaSetCallback(b))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0}),new ResizeObserver(rl).observe(this);let r=this.media,n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(r);return}this.media&&(r=this.media,this.handleMediaUpdated(this.media).then(d=>this.mediaSetCallback(d)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(il)}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?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=n=>Promise.resolve(n),a=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?l.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){let t=this.getAttribute("audio")!=null?$.AUDIO_PLAYER():$.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",t),this.media&&this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0)return;this.setAttribute("user-inactive","user-inactive");let s=new l.CustomEvent(Ot.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{this.removeAttribute("user-inactive");let s=new l.CustomEvent(Ot.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(s)},n=()=>{r(),l.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=l.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{n()}),this.addEventListener("pointerup",s=>{s.pointerType==="touch"?[this,this.media].includes(s.target)&&!this.hasAttribute("user-inactive")?a():n():s.composedPath().some(d=>{var c;return["media-play-button","media-fullscreen-button"].includes((c=d==null?void 0:d.nodeName)==null?void 0:c.toLowerCase())})&&n()}),this.addEventListener("pointermove",s=>{s.pointerType==="mouse"&&s.target!==this&&(r(),l.clearTimeout(this._inactiveTimeout),[this,this.media].includes(s.target)&&n())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),this.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}};l.customElements.get("media-container-temp")||l.customElements.define("media-container-temp",wi);var xn=wi;var Dn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},W=(i,e,t)=>(Dn(i,e,"read from private field"),t?t.call(i):e.get(i)),Pa=(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)},Ua=(i,e,t,a)=>(Dn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),mt,ht,z,xi=class{constructor(e,t){Pa(this,mt,void 0),Pa(this,ht,void 0),Pa(this,z,new Set),Ua(this,mt,e),Ua(this,ht,t)}[Symbol.iterator](){return W(this,z).values()}get length(){return W(this,z).size}get value(){var e;return(e=[...W(this,z)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ua(this,z,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...W(this,z)][e]}values(){return W(this,z).values()}keys(){return W(this,z).keys()}forEach(e){W(this,z).forEach(e)}add(...e){var t,a;e.forEach(r=>W(this,z).add(r)),!(this.value===""&&!((t=W(this,mt))!=null&&t.hasAttribute(`${W(this,ht)}`)))&&((a=W(this,mt))==null||a.setAttribute(`${W(this,ht)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>W(this,z).delete(a)),(t=W(this,mt))==null||t.setAttribute(`${W(this,ht)}`,`${this.value}`)}contains(e){return W(this,z).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)}};mt=new WeakMap;ht=new WeakMap;z=new WeakMap;var U={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};u.fullscreenElement===void 0&&(U.enter="webkitRequestFullScreen",U.exit=u.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",U.event="webkitfullscreenchange",U.element="webkitFullscreenElement",U.error="webkitfullscreenerror",U.enabled="webkitFullscreenEnabled");var Na=(i="")=>i.split(/\s+/),Rn=(i="")=>{let[e,t]=i.split(":"),a=t?decodeURIComponent(t):void 0;return{language:e,label:a}},Nt=(i="",e={})=>Na(i).map(t=>{let a=Rn(t);return{...e,...a}}),ol=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?Rn(e):e):typeof i=="string"?Nt(i):[i],Ba=({label:i,language:e}={})=>i?`${e}:${encodeURIComponent(i)}`:e,te=(i=[])=>Array.prototype.map.call(i,Ba).join(" "),ll=(i,e)=>t=>t[i]===e,On=i=>{let e=Object.entries(i).map(([t,a])=>ll(t,a));return t=>e.every(a=>a(t))},Bt=(i,e=[],t=[])=>{let a=ol(t).map(On),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},pt=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:On(e);return Array.from(i.textTracks).filter(t)},Ht=i=>{let e=!!i.getAttribute(o.MEDIA_CAPTIONS_SHOWING),t=!i.hasAttribute("no-subtitles-fallback")&&!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return e||t},ye=i=>{var e,t,a,r;if(Ht(i)){let s=i.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(s){let c=new window.CustomEvent(h.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});i.dispatchEvent(c)}let d=i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(d&&!i.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:d});i.dispatchEvent(c)}}else{let[s]=(t=Na((e=i.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?e:""))!=null?t:[];if(s){let d=new window.CustomEvent(h.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});i.dispatchEvent(d)}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[d]=(r=Na((a=i.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?r:[];if(d){let c=new window.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:d});i.dispatchEvent(c)}}}};var Va=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ye=(i,e,t)=>(Va(i,e,"read from private field"),t?t.call(i):e.get(i)),Di=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Pn=(i,e,t,a)=>(Va(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),bt=(i,e,t)=>(Va(i,e,"access private method"),t),Ie,Wt,Et,Yt,Oi,Ha,dl=Object.values(Pt),Hn=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],cl=10,Un=0,Ui=class extends xn{constructor(){super(),Di(this,Et),Di(this,Oi),Di(this,Ie,new xi(this,"hotkeys")),Di(this,Wt,void 0),gl||(this._airplayUnavailable=ee.UNSUPPORTED),Bn||(this._fullscreenUnavailable=ee.UNAVAILABLE),Al||(this._castUnavailable=ee.UNSUPPORTED),fl||(this._pipUnavailable=ee.UNSUPPORTED),Kt!==void 0?Kt||(this._volumeUnavailable=ee.UNSUPPORTED):vl.then(()=>{Kt||(this._volumeUnavailable=ee.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=$t[o.MEDIA_STREAM_TYPE](this),n=this.getAttribute("noautoseektolive")===null;r==Pt.LIVE&&n&&e.MEDIA_SEEK_TO_LIVE_REQUEST(t,a),this.media.play()},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{l.localStorage.setItem("media-chrome-pref-volume",r.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{if(!Bn){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let t=this.media;u.pictureInPictureElement&&u.exitPictureInPicture(),super[U.enter]?this.fullscreenElement[U.enter]():t.webkitEnterFullscreen?t.webkitEnterFullscreen():t.requestFullscreen?t.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{u[U.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[U.element]&&u[U.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 n=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(a),n()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&a(),n()},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[U.element]&&u[U.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 n=t.detail;n===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,n);let[s]=pt(r,{kind:ct.METADATA,label:"thumbnails"});if(!(s&&s.cues))return;if(n===null){this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let d=Array.prototype.find.call(s.cues,y=>y.startTime>=n);if(!d)return;let c=/'^(?:[a-z]+:)?\/\//i.test(d.text)||(a=r.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,m=new URL(d.text,c),b=new URLSearchParams(m.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,m.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,b.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:t=>{let a=Pi(this),{detail:r=[]}=t;Bt($e.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:t=>{let a=Pi(this),{detail:r=[]}=t;Bt($e.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:t=>{let a=Ft(this),{detail:r=[]}=t;Bt($e.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:t=>{let a=Ft(this),{detail:r=[]}=t;Bt($e.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:t}=this;if(!!t){if(!(t.webkitShowPlaybackTargetPicker&&l.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${Ti(t,!0)}`;this[a]=r=>{if(r.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}e[t](r,this.media)},this.addEventListener(h[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,Wn(this)),this.propagateMediaState(o.MEDIA_VOLUME,Vn(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,Fn(this))},[U.event]:t=>{let r=!!u[U.element]&&(t==null?void 0:t.target),n=Ut(this.fullscreenElement,r);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,n)},"enterpictureinpicture,leavepictureinpicture":t=>{var a;let r;if(t)r=t.type=="enterpictureinpicture";else{let n=(a=this.getRootNode().pictureInPictureElement)!=null?a:u.pictureInPictureElement;r=this.media&&Ut(this.media,n)}this.propagateMediaState(o.MEDIA_IS_PIP,r)},"entercast,leavecast,castchange":t=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,n=this.media&&Ut(this.media,r);(t==null?void 0:t.type)==="castchange"&&(t==null?void 0:t.detail)==="CONNECTING"&&(n="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,n)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,Kn(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,Yn(this)),this.propagateMediaState(o.MEDIA_STREAM_TYPE)},"loadedmetadata,emptied,progress":()=>{var t;this.propagateMediaState(o.MEDIA_SEEKABLE,(t=Gn(this))==null?void 0:t.join(":"))},"progress,emptied":()=>{var t;this.propagateMediaState(o.MEDIA_BUFFERED,Il((t=this.media)==null?void 0:t.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Zn(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!==ee.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=ee.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=t}if(this._castUnavailable!==ee.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=ee.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=t}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,te(Pi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,te(Ft(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,te($a(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,te(Nn(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,te($a(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,te(Nn(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys","default-stream-type")}get fullscreenElement(){var e;return(e=Ye(this,Wt))!=null?e:this}set fullscreenElement(e){this.hasAttribute("fullscreen-element")&&this.removeAttribute("fullscreen-element"),Pn(this,Wt,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")Ye(this,Ie).value=a;else if(e==="default-stream-type")this.propagateMediaState(o.MEDIA_STREAM_TYPE);else if(e==="fullscreen-element"){let n=a?(r=this.getRootNode())==null?void 0:r.getElementById(a):void 0;Pn(this,Wt,n)}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(n=>{(n==U.event?this.getRootNode():e).addEventListener(n,r)}),r()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(n=>{e.textTracks&&e.textTracks.addEventListener(n,a)}),a()});try{let t=l.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(this._mediaStatePropagators).forEach(t=>{let a=t.split(","),r=this._mediaStatePropagators[t];a.forEach(n=>{(n==U.event?this.getRootNode():e).removeEventListener(n,r)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(n=>{e.textTracks&&e.textTracks.removeEventListener(n,a)}),a()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(e,t){arguments.length===1&&(t=$t[e](this)),Ke(this.mediaStateReceivers,e,t);let a=new l.CustomEvent(fn[e],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=pl(e,a,r);Object.keys(h).forEach(s=>{e.addEventListener(h[s],this[`_handle${Ti(s,!0)}`])}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(h).forEach(r=>{e.removeEventListener(h[r],this[`_handle${Ti(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Ke([e],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Ke([e],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Ke([e],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Ke([e],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Ke([e],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||Ke([e],o[r],$t[o[r]]?$t[o[r]](this):$t.default(this,o[r]))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",bt(this,Oi,Ha))}disableHotkeys(){this.removeEventListener("keydown",bt(this,Oi,Ha)),this.removeEventListener("keyup",bt(this,Et,Yt))}get hotkeys(){return Ye(this,Ie)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute("keysused"))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(I=>I==="Space"?" ":I).filter(Boolean).includes(e.key))return;let d,c,m,b,y,f=cl;if(!Ye(this,Ie).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&Ye(this,Ie).contains("nospace")))switch(e.key){case" ":case"k":d=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"m":d=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"f":d=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"c":ye(this);break;case"ArrowLeft":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:Un,b=Math.max(m-f,0),y=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(y);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:Un,b=Math.max(m+f,0),y=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(y);break;default:break}}};Ie=new WeakMap;Wt=new WeakMap;Et=new WeakSet;Yt=function(i){let{key:e}=i;if(!Hn.includes(e)){this.removeEventListener("keyup",bt(this,Et,Yt));return}this.keyboardShortcutHandler(i)};Oi=new WeakSet;Ha=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Hn.includes(a)){this.removeEventListener("keyup",bt(this,Et,Yt));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Ye(this,Ie).contains(`no${a.toLowerCase()}`)||a===" "&&Ye(this,Ie).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",bt(this,Et,Yt),{once:!0})};var $t={default(i,e){return i.getAttribute(e)},[o.MEDIA_CAPTIONS_LIST](i){return te(Pi(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return te(Ft(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return te(Ft(i))||void 0},[o.MEDIA_CAPTIONS_SHOWING](i){return te($a(i))||void 0},[o.MEDIA_PAUSED](i){return $n(i)},[o.MEDIA_MUTED](i){return Wn(i)},[o.MEDIA_VOLUME](i){return Vn(i)},[o.MEDIA_VOLUME_LEVEL](i){return Fn(i)},[o.MEDIA_CURRENT_TIME](i){return Kn(i)},[o.MEDIA_DURATION](i){return Yn(i)},[o.MEDIA_SEEKABLE](i){var e;return(e=Gn(i))==null?void 0:e.join(":")},[o.MEDIA_PLAYBACK_RATE](i){return Zn(i)},[o.MEDIA_STREAM_TYPE](i){let e=i.media;if(!e)return null;let t=e.duration;if(t===1/0)return Pt.LIVE;if(Number.isFinite(t))return Pt.ON_DEMAND;{let a=i.getAttribute("default-stream-type");if(dl.includes(a))return a}return null},[o.MEDIA_TIME_IS_LIVE](i){let e=i.media;if(!e)return!1;let t=i.getAttribute(o.MEDIA_STREAM_TYPE)==="live",a=e.seekable;if(t&&!a)return!0;if(!(a!=null&&a.length))return!1;let r=10,n=i.getAttribute("livethreshold");n!==null&&(n=Number(n),Number.isNaN(n)||(r=n));let s=e.currentTime,d=a.end(a.length-1);return s>d-r}},$n=i=>i.media?i.media.paused:!0,Wn=i=>!!(i.media&&i.media.muted),Vn=i=>{let e=i.media;return e?e.volume:1},Fn=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},Kn=i=>{let e=i.media;return e?e.currentTime:0},Yn=i=>{let e=i==null?void 0:i.media;return Number.isFinite(e==null?void 0:e.duration)?e.duration:NaN},Gn=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))]},Zn=i=>{let e=i.media;return e?e.playbackRate:1},Ft=i=>pt(i.media,{kind:ct.SUBTITLES}),Pi=i=>pt(i.media,{kind:ct.CAPTIONS}),Nn=i=>pt(i.media,{kind:ct.SUBTITLES,mode:$e.SHOWING}),$a=i=>pt(i.media,{kind:ct.CAPTIONS,mode:$e.SHOWING}),ul=Object.values(o),qn=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(l.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,p.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(d=>ul.includes(d)):[]},Wa=i=>!!qn(i).length,ml=async(i,e,t)=>(i.isConnected||await Qn(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)),hl=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Vt=(i,e)=>{if(hl(i))return;let t=(r,n)=>{var s,d;Wa(r)&&n(r);let{children:c=[]}=r!=null?r:{},m=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...c,...m].forEach(y=>Vt(y,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Wa(i)){l.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Ke=(i,e,t)=>{i.forEach(a=>{!qn(a).includes(e)||ml(a,e,t)})},pl=(i,e,t)=>{Vt(i,e);let a=c=>{var m;let b=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(b)},r=c=>{var m;let b=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;t(b)};i.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=c=>{c.forEach(m=>{let{addedNodes:b=[],removedNodes:y=[],type:f,target:I,attributeName:B}=m;f==="childList"?(Array.prototype.forEach.call(b,D=>Vt(D,e)),Array.prototype.forEach.call(y,D=>Vt(D,t))):f==="attributes"&&B===p.MEDIA_CHROME_ATTRIBUTES&&(Wa(I)?e(I):t(I))})},s=new MutationObserver(n);return s.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Vt(i,t),s.disconnect(),i.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Ri,Fa=()=>{var i,e;return Ri||(Ri=(e=(i=u)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Ri)},bl=async(i=Fa())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Qn(0),i.volume!==e},Qn=i=>new Promise(e=>setTimeout(e,i)),El=(i=Fa())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",fl=El(),Kt,vl=bl().then(i=>(Kt=i,Kt)),gl=!!l.WebKitPlaybackTargetAvailabilityEvent,Al=!!l.chrome,_l=(i=Fa())=>{let e=u[U.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Bn=_l(),yl=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 Il(i=yl){return Array.from(i).map((e,t)=>[Number(i.start(t).toFixed(3)),Number(i.end(t).toFixed(3))].join(":")).join(" ")}l.customElements.get("media-controller")||l.customElements.define("media-controller",Ui);var Gt=Ui;var Xn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Tl=(i,e,t)=>(Xn(i,e,"read from private field"),t?t.call(i):e.get(i)),Ml=(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)},kl=(i,e,t,a)=>(Xn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ni,Jn=u.createElement("template"),zn=`
196
+ `;var il=Object.values(o),al="sm:384 md:576 lg:768 xl:960",rl=i=>{var e;for(let t of i){let a=t.target;if(!a.isConnected)continue;let r=(e=a.getAttribute("breakpoints"))!=null?e:al,n=nl(r),s=sl(n,t.contentRect);Object.keys(n).forEach(d=>{if(s.includes(d)){a.hasAttribute(`breakpoint-${d}`)||a.setAttribute(`breakpoint-${d}`,"");return}a.removeAttribute(`breakpoint-${d}`)})}};function nl(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function sl(i,e){return Object.keys(i).filter(t=>e.width>=i[t])}var wi=class extends l.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(wn.content.cloneNode(!0));let e=s=>{let d=this.media;for(let c of s)c.type==="childList"&&(c.removedNodes.forEach(m=>{if(m.slot=="media"&&c.target==this){let b=c.previousSibling&&c.previousSibling.previousElementSibling;if(!b||!d)this.mediaUnsetCallback(m);else{let y=b.slot!=="media";for(;(b=b.previousSibling)!==null;)b.slot=="media"&&(y=!1);y&&this.mediaUnsetCallback(m)}}}),d&&c.addedNodes.forEach(m=>{m==d&&this.handleMediaUpdated(d).then(b=>this.mediaSetCallback(b))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0}),new ResizeObserver(rl).observe(this);let r=this.media,n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(r);return}this.media&&(r=this.media,this.handleMediaUpdated(this.media).then(d=>this.mediaSetCallback(d)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(il)}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?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=n=>Promise.resolve(n),a=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?l.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){let t=this.getAttribute("audio")!=null?$.AUDIO_PLAYER():$.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",t),this.media&&this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0)return;this.setAttribute("user-inactive","user-inactive");let s=new l.CustomEvent(Ot.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{this.removeAttribute("user-inactive");let s=new l.CustomEvent(Ot.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(s)},n=()=>{r(),l.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=l.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{n()}),this.addEventListener("pointerup",s=>{s.pointerType==="touch"?[this,this.media].includes(s.target)&&!this.hasAttribute("user-inactive")?a():n():s.composedPath().some(d=>{var c;return["media-play-button","media-fullscreen-button"].includes((c=d==null?void 0:d.nodeName)==null?void 0:c.toLowerCase())})&&n()}),this.addEventListener("pointermove",s=>{s.pointerType==="mouse"&&s.target!==this&&(r(),l.clearTimeout(this._inactiveTimeout),[this,this.media].includes(s.target)&&n())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),this.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}};l.customElements.get("media-container-temp")||l.customElements.define("media-container-temp",wi);var xn=wi;var Rn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},W=(i,e,t)=>(Rn(i,e,"read from private field"),t?t.call(i):e.get(i)),Pa=(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)},Ua=(i,e,t,a)=>(Rn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),mt,ht,z,xi=class{constructor(e,t){Pa(this,mt,void 0),Pa(this,ht,void 0),Pa(this,z,new Set),Ua(this,mt,e),Ua(this,ht,t)}[Symbol.iterator](){return W(this,z).values()}get length(){return W(this,z).size}get value(){var e;return(e=[...W(this,z)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ua(this,z,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...W(this,z)][e]}values(){return W(this,z).values()}keys(){return W(this,z).keys()}forEach(e){W(this,z).forEach(e)}add(...e){var t,a;e.forEach(r=>W(this,z).add(r)),!(this.value===""&&!((t=W(this,mt))!=null&&t.hasAttribute(`${W(this,ht)}`)))&&((a=W(this,mt))==null||a.setAttribute(`${W(this,ht)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>W(this,z).delete(a)),(t=W(this,mt))==null||t.setAttribute(`${W(this,ht)}`,`${this.value}`)}contains(e){return W(this,z).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)}};mt=new WeakMap;ht=new WeakMap;z=new WeakMap;var U={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};u.fullscreenElement===void 0&&(U.enter="webkitRequestFullScreen",U.exit=u.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",U.event="webkitfullscreenchange",U.element="webkitFullscreenElement",U.error="webkitfullscreenerror",U.enabled="webkitFullscreenEnabled");var Na=(i="")=>i.split(/\s+/),Dn=(i="")=>{let[e,t]=i.split(":"),a=t?decodeURIComponent(t):void 0;return{language:e,label:a}},Nt=(i="",e={})=>Na(i).map(t=>{let a=Dn(t);return{...e,...a}}),ol=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?Dn(e):e):typeof i=="string"?Nt(i):[i],Ba=({label:i,language:e}={})=>i?`${e}:${encodeURIComponent(i)}`:e,te=(i=[])=>Array.prototype.map.call(i,Ba).join(" "),ll=(i,e)=>t=>t[i]===e,On=i=>{let e=Object.entries(i).map(([t,a])=>ll(t,a));return t=>e.every(a=>a(t))},Bt=(i,e=[],t=[])=>{let a=ol(t).map(On),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},pt=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:On(e);return Array.from(i.textTracks).filter(t)},Ht=i=>{let e=!!i.getAttribute(o.MEDIA_CAPTIONS_SHOWING),t=!i.hasAttribute("no-subtitles-fallback")&&!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return e||t},ye=i=>{var e,t,a,r;if(Ht(i)){let s=i.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(s){let c=new window.CustomEvent(h.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});i.dispatchEvent(c)}let d=i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(d&&!i.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:d});i.dispatchEvent(c)}}else{let[s]=(t=Na((e=i.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?e:""))!=null?t:[];if(s){let d=new window.CustomEvent(h.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});i.dispatchEvent(d)}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[d]=(r=Na((a=i.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?r:[];if(d){let c=new window.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:d});i.dispatchEvent(c)}}}};var Va=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ye=(i,e,t)=>(Va(i,e,"read from private field"),t?t.call(i):e.get(i)),Ri=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Pn=(i,e,t,a)=>(Va(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),bt=(i,e,t)=>(Va(i,e,"access private method"),t),Ie,Wt,Et,Yt,Oi,Ha,dl=Object.values(Pt),Hn=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],cl=10,Un=0,Ui=class extends xn{constructor(){super(),Ri(this,Et),Ri(this,Oi),Ri(this,Ie,new xi(this,"hotkeys")),Ri(this,Wt,void 0),gl||(this._airplayUnavailable=ee.UNSUPPORTED),Bn||(this._fullscreenUnavailable=ee.UNAVAILABLE),Al||(this._castUnavailable=ee.UNSUPPORTED),fl||(this._pipUnavailable=ee.UNSUPPORTED),Kt!==void 0?Kt||(this._volumeUnavailable=ee.UNSUPPORTED):vl.then(()=>{Kt||(this._volumeUnavailable=ee.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=$t[o.MEDIA_STREAM_TYPE](this),n=this.getAttribute("noautoseektolive")===null;r==Pt.LIVE&&n&&e.MEDIA_SEEK_TO_LIVE_REQUEST(t,a),this.media.play()},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{l.localStorage.setItem("media-chrome-pref-volume",r.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{if(!Bn){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let t=this.media;u.pictureInPictureElement&&u.exitPictureInPicture(),super[U.enter]?this.fullscreenElement[U.enter]():t.webkitEnterFullscreen?t.webkitEnterFullscreen():t.requestFullscreen?t.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{u[U.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[U.element]&&u[U.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 n=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(a),n()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&a(),n()},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[U.element]&&u[U.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 n=t.detail;n===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,n);let[s]=pt(r,{kind:ct.METADATA,label:"thumbnails"});if(!(s&&s.cues))return;if(n===null){this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let d=Array.prototype.find.call(s.cues,y=>y.startTime>=n);if(!d)return;let c=/'^(?:[a-z]+:)?\/\//i.test(d.text)||(a=r.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,m=new URL(d.text,c),b=new URLSearchParams(m.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,m.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,b.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:t=>{let a=Pi(this),{detail:r=[]}=t;Bt($e.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:t=>{let a=Pi(this),{detail:r=[]}=t;Bt($e.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:t=>{let a=Ft(this),{detail:r=[]}=t;Bt($e.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:t=>{let a=Ft(this),{detail:r=[]}=t;Bt($e.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:t}=this;if(!!t){if(!(t.webkitShowPlaybackTargetPicker&&l.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${Ti(t,!0)}`;this[a]=r=>{if(r.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}e[t](r,this.media)},this.addEventListener(h[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,Wn(this)),this.propagateMediaState(o.MEDIA_VOLUME,Vn(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,Fn(this))},[U.event]:t=>{let r=!!u[U.element]&&(t==null?void 0:t.target),n=Ut(this.fullscreenElement,r);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,n)},"enterpictureinpicture,leavepictureinpicture":t=>{var a;let r;if(t)r=t.type=="enterpictureinpicture";else{let n=(a=this.getRootNode().pictureInPictureElement)!=null?a:u.pictureInPictureElement;r=this.media&&Ut(this.media,n)}this.propagateMediaState(o.MEDIA_IS_PIP,r)},"entercast,leavecast,castchange":t=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,n=this.media&&Ut(this.media,r);(t==null?void 0:t.type)==="castchange"&&(t==null?void 0:t.detail)==="CONNECTING"&&(n="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,n)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,Kn(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,Yn(this)),this.propagateMediaState(o.MEDIA_STREAM_TYPE)},"loadedmetadata,emptied,progress":()=>{var t;this.propagateMediaState(o.MEDIA_SEEKABLE,(t=Gn(this))==null?void 0:t.join(":"))},"progress,emptied":()=>{var t;this.propagateMediaState(o.MEDIA_BUFFERED,Il((t=this.media)==null?void 0:t.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Zn(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!==ee.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=ee.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=t}if(this._castUnavailable!==ee.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=ee.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=t}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,te(Pi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,te(Ft(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,te($a(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,te(Nn(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,te($a(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,te(Nn(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys","default-stream-type")}get fullscreenElement(){var e;return(e=Ye(this,Wt))!=null?e:this}set fullscreenElement(e){this.hasAttribute("fullscreen-element")&&this.removeAttribute("fullscreen-element"),Pn(this,Wt,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")Ye(this,Ie).value=a;else if(e==="default-stream-type")this.propagateMediaState(o.MEDIA_STREAM_TYPE);else if(e==="fullscreen-element"){let n=a?(r=this.getRootNode())==null?void 0:r.getElementById(a):void 0;Pn(this,Wt,n)}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(n=>{(n==U.event?this.getRootNode():e).addEventListener(n,r)}),r()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(n=>{e.textTracks&&e.textTracks.addEventListener(n,a)}),a()});try{let t=l.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(this._mediaStatePropagators).forEach(t=>{let a=t.split(","),r=this._mediaStatePropagators[t];a.forEach(n=>{(n==U.event?this.getRootNode():e).removeEventListener(n,r)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(n=>{e.textTracks&&e.textTracks.removeEventListener(n,a)}),a()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(e,t){arguments.length===1&&(t=$t[e](this)),Ke(this.mediaStateReceivers,e,t);let a=new l.CustomEvent(fn[e],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=pl(e,a,r);Object.keys(h).forEach(s=>{e.addEventListener(h[s],this[`_handle${Ti(s,!0)}`])}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(h).forEach(r=>{e.removeEventListener(h[r],this[`_handle${Ti(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Ke([e],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Ke([e],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Ke([e],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Ke([e],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Ke([e],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||Ke([e],o[r],$t[o[r]]?$t[o[r]](this):$t.default(this,o[r]))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",bt(this,Oi,Ha))}disableHotkeys(){this.removeEventListener("keydown",bt(this,Oi,Ha)),this.removeEventListener("keyup",bt(this,Et,Yt))}get hotkeys(){return Ye(this,Ie)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute("keysused"))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(I=>I==="Space"?" ":I).filter(Boolean).includes(e.key))return;let d,c,m,b,y,v=cl;if(!Ye(this,Ie).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&Ye(this,Ie).contains("nospace")))switch(e.key){case" ":case"k":d=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"m":d=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"f":d=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"c":ye(this);break;case"ArrowLeft":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:Un,b=Math.max(m-v,0),y=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(y);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:Un,b=Math.max(m+v,0),y=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(y);break;default:break}}};Ie=new WeakMap;Wt=new WeakMap;Et=new WeakSet;Yt=function(i){let{key:e}=i;if(!Hn.includes(e)){this.removeEventListener("keyup",bt(this,Et,Yt));return}this.keyboardShortcutHandler(i)};Oi=new WeakSet;Ha=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Hn.includes(a)){this.removeEventListener("keyup",bt(this,Et,Yt));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Ye(this,Ie).contains(`no${a.toLowerCase()}`)||a===" "&&Ye(this,Ie).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",bt(this,Et,Yt),{once:!0})};var $t={default(i,e){return i.getAttribute(e)},[o.MEDIA_CAPTIONS_LIST](i){return te(Pi(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return te(Ft(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return te(Ft(i))||void 0},[o.MEDIA_CAPTIONS_SHOWING](i){return te($a(i))||void 0},[o.MEDIA_PAUSED](i){return $n(i)},[o.MEDIA_MUTED](i){return Wn(i)},[o.MEDIA_VOLUME](i){return Vn(i)},[o.MEDIA_VOLUME_LEVEL](i){return Fn(i)},[o.MEDIA_CURRENT_TIME](i){return Kn(i)},[o.MEDIA_DURATION](i){return Yn(i)},[o.MEDIA_SEEKABLE](i){var e;return(e=Gn(i))==null?void 0:e.join(":")},[o.MEDIA_PLAYBACK_RATE](i){return Zn(i)},[o.MEDIA_STREAM_TYPE](i){let e=i.media;if(!e)return null;let t=e.duration;if(t===1/0)return Pt.LIVE;if(Number.isFinite(t))return Pt.ON_DEMAND;{let a=i.getAttribute("default-stream-type");if(dl.includes(a))return a}return null},[o.MEDIA_TIME_IS_LIVE](i){let e=i.media;if(!e)return!1;let t=i.getAttribute(o.MEDIA_STREAM_TYPE)==="live",a=e.seekable;if(t&&!a)return!0;if(!(a!=null&&a.length))return!1;let r=10,n=i.getAttribute("livethreshold");n!==null&&(n=Number(n),Number.isNaN(n)||(r=n));let s=e.currentTime,d=a.end(a.length-1);return s>d-r}},$n=i=>i.media?i.media.paused:!0,Wn=i=>!!(i.media&&i.media.muted),Vn=i=>{let e=i.media;return e?e.volume:1},Fn=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},Kn=i=>{let e=i.media;return e?e.currentTime:0},Yn=i=>{let e=i==null?void 0:i.media;return Number.isFinite(e==null?void 0:e.duration)?e.duration:NaN},Gn=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))]},Zn=i=>{let e=i.media;return e?e.playbackRate:1},Ft=i=>pt(i.media,{kind:ct.SUBTITLES}),Pi=i=>pt(i.media,{kind:ct.CAPTIONS}),Nn=i=>pt(i.media,{kind:ct.SUBTITLES,mode:$e.SHOWING}),$a=i=>pt(i.media,{kind:ct.CAPTIONS,mode:$e.SHOWING}),ul=Object.values(o),qn=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(l.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,p.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(d=>ul.includes(d)):[]},Wa=i=>!!qn(i).length,ml=async(i,e,t)=>(i.isConnected||await Qn(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)),hl=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Vt=(i,e)=>{if(hl(i))return;let t=(r,n)=>{var s,d;Wa(r)&&n(r);let{children:c=[]}=r!=null?r:{},m=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...c,...m].forEach(y=>Vt(y,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Wa(i)){l.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Ke=(i,e,t)=>{i.forEach(a=>{!qn(a).includes(e)||ml(a,e,t)})},pl=(i,e,t)=>{Vt(i,e);let a=c=>{var m;let b=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(b)},r=c=>{var m;let b=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;t(b)};i.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=c=>{c.forEach(m=>{let{addedNodes:b=[],removedNodes:y=[],type:v,target:I,attributeName:B}=m;v==="childList"?(Array.prototype.forEach.call(b,R=>Vt(R,e)),Array.prototype.forEach.call(y,R=>Vt(R,t))):v==="attributes"&&B===p.MEDIA_CHROME_ATTRIBUTES&&(Wa(I)?e(I):t(I))})},s=new MutationObserver(n);return s.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Vt(i,t),s.disconnect(),i.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Di,Fa=()=>{var i,e;return Di||(Di=(e=(i=u)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Di)},bl=async(i=Fa())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Qn(0),i.volume!==e},Qn=i=>new Promise(e=>setTimeout(e,i)),El=(i=Fa())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",fl=El(),Kt,vl=bl().then(i=>(Kt=i,Kt)),gl=!!l.WebKitPlaybackTargetAvailabilityEvent,Al=!!l.chrome,_l=(i=Fa())=>{let e=u[U.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Bn=_l(),yl=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 Il(i=yl){return Array.from(i).map((e,t)=>[Number(i.start(t).toFixed(3)),Number(i.end(t).toFixed(3))].join(":")).join(" ")}l.customElements.get("media-controller")||l.customElements.define("media-controller",Ui);var Gt=Ui;var Xn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Tl=(i,e,t)=>(Xn(i,e,"read from private field"),t?t.call(i):e.get(i)),Ml=(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)},kl=(i,e,t,a)=>(Xn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ni,Jn=u.createElement("template"),zn=`
197
197
  height: var(--thumb-height);
198
198
  width: var(--media-range-thumb-width, 10px);
199
199
  border: var(--media-range-thumb-border, none);
@@ -440,9 +440,9 @@
440
440
 
441
441
  <slot name="on">${wl}</slot>
442
442
  <slot name="off">${xl}</slot>
443
- `;var is=i=>{i.setAttribute("aria-checked",Ht(i))},Qa=class extends C{static get observedAttributes(){return[...super.observedAttributes,"no-subtitles-fallback","default-showing",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:as,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",$.CLOSED_CAPTIONS()),is(this)}attributeChangedCallback(e,t,a){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(e)&&is(this),this.hasAttribute("default-showing")&&this.getAttribute("aria-checked")!=="true"){let r=!this.hasAttribute("no-subtitles-fallback");if((r?[o.MEDIA_CAPTIONS_LIST,o.MEDIA_SUBTITLES_LIST]:[o.MEDIA_CAPTIONS_LIST]).includes(e)){let s=!!this.getAttribute(o.MEDIA_CAPTIONS_LIST)||!!(r&&this.getAttribute(o.MEDIA_SUBTITLES_LIST));this._captionsReady!==s&&(this._captionsReady=s,this._captionsReady&&this.handleClick())}}super.attributeChangedCallback(e,t,a)}handleClick(){ye(this)}};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",Qa);var za="30",Dl=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${za}</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg>`,ss=u.createElement("template");ss.innerHTML=`
444
- <slot name="forward">${Dl}</slot>
445
- `;var Rl=0,rs=i=>{let e=Math.abs(+i.getAttribute("seek-offset")),t=w.SEEK_FORWARD_N_SECS({seekOffset:e});i.setAttribute("aria-label",t)},ns=i=>{let e=Li(i,"forward"),t=i.getAttribute("seek-offset");Ci(e,t)},Xa=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(e={}){super({slotTemplate:ss,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",za),rs(this),ns(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",za),ns(this),rs(this)),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),t=+this.getAttribute("seek-offset"),r=(e&&!Number.isNaN(+e)?+e:Rl)+t,n=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",Xa);var Ol=`<svg aria-hidden="true" viewBox="0 0 26 24">
443
+ `;var is=i=>{i.setAttribute("aria-checked",Ht(i))},Qa=class extends C{static get observedAttributes(){return[...super.observedAttributes,"no-subtitles-fallback","default-showing",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:as,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",$.CLOSED_CAPTIONS()),is(this)}attributeChangedCallback(e,t,a){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(e)&&is(this),this.hasAttribute("default-showing")&&this.getAttribute("aria-checked")!=="true"){let r=!this.hasAttribute("no-subtitles-fallback");if((r?[o.MEDIA_CAPTIONS_LIST,o.MEDIA_SUBTITLES_LIST]:[o.MEDIA_CAPTIONS_LIST]).includes(e)){let s=!!this.getAttribute(o.MEDIA_CAPTIONS_LIST)||!!(r&&this.getAttribute(o.MEDIA_SUBTITLES_LIST));this._captionsReady!==s&&(this._captionsReady=s,this._captionsReady&&this.handleClick())}}super.attributeChangedCallback(e,t,a)}handleClick(){ye(this)}};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",Qa);var za="30",Rl=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${za}</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg>`,ss=u.createElement("template");ss.innerHTML=`
444
+ <slot name="forward">${Rl}</slot>
445
+ `;var Dl=0,rs=i=>{let e=Math.abs(+i.getAttribute("seek-offset")),t=w.SEEK_FORWARD_N_SECS({seekOffset:e});i.setAttribute("aria-label",t)},ns=i=>{let e=Li(i,"forward"),t=i.getAttribute("seek-offset");Ci(e,t)},Xa=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(e={}){super({slotTemplate:ss,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",za),rs(this),ns(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",za),ns(this),rs(this)),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),t=+this.getAttribute("seek-offset"),r=(e&&!Number.isNaN(+e)?+e:Dl)+t,n=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",Xa);var Ol=`<svg aria-hidden="true" viewBox="0 0 26 24">
446
446
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
447
447
  </svg>`,Pl=`<svg aria-hidden="true" viewBox="0 0 26 24">
448
448
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
@@ -708,7 +708,7 @@
708
708
  }
709
709
  </style>
710
710
  <img crossorigin loading="eager" decoding="async" />
711
- `;var Er=class extends l.HTMLElement{static get observedAttributes(){return[p.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ss.content.cloneNode(!0))}connectedCallback(){var e;let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}attributeChangedCallback(e,t,a){var r,n;if(["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}update(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS),t=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(e&&t))return;let[a,r,n,s]=e.split(/\s+/).map(yi=>+yi),d=t.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:b,minWidth:y,minHeight:f}=c,I=Math.min(parseInt(m)/n,parseInt(b)/s),B=Math.max(parseInt(y)/n,parseInt(f)/s),D=I<1,M=D?I:B>1?B:1,{style:k}=ce(this.shadowRoot,":host"),j=ce(this.shadowRoot,"img").style,Q=this.shadowRoot.querySelector("img"),de=D?"min":"max";k.setProperty(`${de}-width`,"initial","important"),k.setProperty(`${de}-height`,"initial","important"),k.width=`${n*M}px`,k.height=`${s*M}px`;let lt=()=>{j.width=`${this.imgWidth*M}px`,j.height=`${this.imgHeight*M}px`,j.display="block"};Q.src!==d&&(Q.onload=()=>{this.imgWidth=Q.naturalWidth,this.imgHeight=Q.naturalHeight,lt()},Q.src=d,lt()),lt(),j.transform=`translate(-${a*M}px, -${r*M}px)`}};l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",Er);var Cs=u.createElement("template"),ql=`
711
+ `;var Er=class extends l.HTMLElement{static get observedAttributes(){return[p.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ss.content.cloneNode(!0))}connectedCallback(){var e;let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}attributeChangedCallback(e,t,a){var r,n;if(["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}update(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS),t=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(e&&t))return;let[a,r,n,s]=e.split(/\s+/).map(yi=>+yi),d=t.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:b,minWidth:y,minHeight:v}=c,I=Math.min(parseInt(m)/n,parseInt(b)/s),B=Math.max(parseInt(y)/n,parseInt(v)/s),R=I<1,M=R?I:B>1?B:1,{style:k}=ce(this.shadowRoot,":host"),j=ce(this.shadowRoot,"img").style,Q=this.shadowRoot.querySelector("img"),de=R?"min":"max";k.setProperty(`${de}-width`,"initial","important"),k.setProperty(`${de}-height`,"initial","important"),k.width=`${n*M}px`,k.height=`${s*M}px`;let lt=()=>{j.width=`${this.imgWidth*M}px`,j.height=`${this.imgHeight*M}px`,j.display="block"};Q.src!==d&&(Q.onload=()=>{this.imgWidth=Q.naturalWidth,this.imgHeight=Q.naturalHeight,lt()},Q.src=d,lt()),lt(),j.transform=`translate(-${a*M}px, -${r*M}px)`}};l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",Er);var Cs=u.createElement("template"),ql=`
712
712
  <svg aria-hidden="true" viewBox="0 0 100 100">
713
713
  <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">
714
714
  <animateTransform
@@ -766,7 +766,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
766
766
  }
767
767
  </style>
768
768
  <slot></slot>
769
- `;var vr=class extends l.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ls.content.cloneNode(!0))}};l.customElements.get("media-title-bar")||l.customElements.define("media-title-bar",vr);var zl=100,Xl=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)},Jl=({value:i,max:e})=>`${Math.round(i/e*100)}%`,gr=class extends Zt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=zl,this.range.addEventListener("input",()=>{let t=this.range.value/this.range.max,a=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",$.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,t,a){if(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED){let r=Xl(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Jl(this.range)),this.updateBar()}super.attributeChangedCallback(e,t,a)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",gr);var Ar=class extends Gt{};l.customElements.get("media-chrome")||l.customElements.define("media-chrome",Ar);var _r=class extends Gt{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};l.customElements.get("media-container")||l.customElements.define("media-container",_r);var Tr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},S=(i,e,t)=>(Tr(i,e,"read from private field"),t?t.call(i):e.get(i)),ie=(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)},Se=(i,e,t,a)=>(Tr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),jt=(i,e,t)=>(Tr(i,e,"access private method"),t),ke,gt,ei,ue,Ge,At,zi,vt,yr,ti,Xi,Ir,ws,Mr,xs,Ds=u.createElement("template");Ds.innerHTML=`
769
+ `;var vr=class extends l.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ls.content.cloneNode(!0))}};l.customElements.get("media-title-bar")||l.customElements.define("media-title-bar",vr);var zl=100,Xl=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)},Jl=({value:i,max:e})=>`${Math.round(i/e*100)}%`,gr=class extends Zt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=zl,this.range.addEventListener("input",()=>{let t=this.range.value/this.range.max,a=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",$.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,t,a){if(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED){let r=Xl(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Jl(this.range)),this.updateBar()}super.attributeChangedCallback(e,t,a)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",gr);var Ar=class extends Gt{};l.customElements.get("media-chrome")||l.customElements.define("media-chrome",Ar);var _r=class extends Gt{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};l.customElements.get("media-container")||l.customElements.define("media-container",_r);var Tr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},S=(i,e,t)=>(Tr(i,e,"read from private field"),t?t.call(i):e.get(i)),ie=(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)},Se=(i,e,t,a)=>(Tr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),jt=(i,e,t)=>(Tr(i,e,"access private method"),t),ke,gt,ei,ue,Ge,At,zi,vt,yr,ti,Xi,Ir,ws,Mr,xs,Rs=u.createElement("template");Rs.innerHTML=`
770
770
  <style>
771
771
  :host ul {
772
772
  list-style: none;
@@ -797,7 +797,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
797
797
  <ul tabindex="0">
798
798
  <slot></slot>
799
799
  </ul>
800
- `;var Ji=class extends l.HTMLElement{constructor(e={}){super(),ie(this,Ge),ie(this,ti),ie(this,Ir),ie(this,Mr),ie(this,ke,""),ie(this,gt,null),ie(this,ei,void 0),ie(this,ue,void 0),ie(this,zi,n=>{this.handleClick(n)}),ie(this,vt,n=>{let{key:s}=n;if(s==="Escape"){this.removeEventListener("keyup",S(this,vt));return}s==="Enter"||s===" "?this.handleSelection(n):this.handleMovement(n)}),ie(this,yr,n=>{let{metaKey:s,altKey:d}=n;if(s||d){this.removeEventListener("keyup",S(this,vt));return}n.preventDefault(),this.addEventListener("keyup",S(this,vt),{once:!0})});let t=this.attachShadow({mode:"open"}),a=Ds.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),Se(this,ei,this.shadowRoot.querySelector("slot")),S(this,ei).addEventListener("slotchange",()=>{Se(this,ue,S(this,ei).assignedElements()),S(this,ue).length===1&&S(this,ue)[0].nodeName.toLowerCase()==="slot"&&Se(this,ue,S(this,ue)[0].assignedElements());let n=S(this,Ge,At);if(n.some(c=>c.getAttribute("tabindex")==="0"))return;let d=n.filter(c=>c.getAttribute("aria-selected")==="true")[0];d||(d=n[0]),d&&(d.setAttribute("tabindex",0),d.setAttribute("aria-selected","true"))})}static get observedAttributes(){return["disabled",p.MEDIA_CONTROLLER]}get selectedOptions(){return S(this,Ge,At).filter(e=>e.getAttribute("aria-selected")==="true")}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",S(this,zi)),this.addEventListener("keydown",S(this,yr))}disable(){this.removeEventListener("click",S(this,zi)),this.removeEventListener("keyup",S(this,vt))}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,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(p.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(p.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=jt(this,ti,Xi).call(this,e);if(!t)return;let a=t.getAttribute("aria-selected")==="true";this.getAttribute("aria-multiselectable")!=="true"&&S(this,ue).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=S(this,Ge,At),r=jt(this,ti,Xi).call(this,e);r||(r=a.filter(s=>s.getAttribute("tabindex")==="0")[0]);let n;switch(t){case"ArrowDown":n=r.nextElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.nextElementSibling);break;case"ArrowUp":n=r.previousElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.previousElementSibling);break;case"Home":n=a[0];break;case"End":n=a[a.length-1];break;default:n=jt(this,Ir,ws).call(this,t);break}n&&(a.forEach(s=>s.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=jt(this,ti,Xi).call(this,e);!t||t.hasAttribute("disabled")||(S(this,Ge,At).forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e))}};ke=new WeakMap;gt=new WeakMap;ei=new WeakMap;ue=new WeakMap;Ge=new WeakSet;At=function(){return S(this,ue).filter(i=>!i.hasAttribute("disabled"))};zi=new WeakMap;vt=new WeakMap;yr=new WeakMap;ti=new WeakSet;Xi=function(i){if(i.target===this)return;let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-LISTITEM");return e[t]};Ir=new WeakSet;ws=function(i){jt(this,Mr,xs).call(this);let e=S(this,Ge,At),t=e.findIndex(m=>m.getAttribute("tabindex")==="0");Se(this,ke,S(this,ke)+i);let a=S(this,ke).split("").every(m=>m===i),r=e.slice(t+(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(S(this,ke))),n=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(S(this,ke))),s=[],d=[];return a&&(s=e.slice(t+(a?1:0)).filter(m=>m.textContent.startsWith(i)),d=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.startsWith(i))),[...r,...n,...s,...d][0]};Mr=new WeakSet;xs=function(){l.clearTimeout(S(this,gt)),Se(this,gt,null),Se(this,gt,l.setTimeout(()=>{Se(this,ke,""),Se(this,gt,null)},500))};l.customElements.get("media-chrome-listbox")||l.customElements.define("media-chrome-listbox",Ji);var Rs=Ji;var Lr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},T=(i,e,t)=>(Lr(i,e,"read from private field"),t?t.call(i):e.get(i)),se=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ze=(i,e,t,a)=>(Lr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_t=(i,e,t)=>(Lr(i,e,"access private method"),t),ji,qe,me,q,Ce,ii,kr,Os,Sr,Ps,ta,wr,ea,xr,Us=u.createElement("template");Us.innerHTML=`
800
+ `;var Ji=class extends l.HTMLElement{constructor(e={}){super(),ie(this,Ge),ie(this,ti),ie(this,Ir),ie(this,Mr),ie(this,ke,""),ie(this,gt,null),ie(this,ei,void 0),ie(this,ue,void 0),ie(this,zi,n=>{this.handleClick(n)}),ie(this,vt,n=>{let{key:s}=n;if(s==="Escape"){this.removeEventListener("keyup",S(this,vt));return}s==="Enter"||s===" "?this.handleSelection(n):this.handleMovement(n)}),ie(this,yr,n=>{let{metaKey:s,altKey:d}=n;if(s||d){this.removeEventListener("keyup",S(this,vt));return}n.preventDefault(),this.addEventListener("keyup",S(this,vt),{once:!0})});let t=this.attachShadow({mode:"open"}),a=Rs.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),Se(this,ei,this.shadowRoot.querySelector("slot")),S(this,ei).addEventListener("slotchange",()=>{Se(this,ue,S(this,ei).assignedElements()),S(this,ue).length===1&&S(this,ue)[0].nodeName.toLowerCase()==="slot"&&Se(this,ue,S(this,ue)[0].assignedElements());let n=S(this,Ge,At);if(n.some(c=>c.getAttribute("tabindex")==="0"))return;let d=n.filter(c=>c.getAttribute("aria-selected")==="true")[0];d||(d=n[0]),d&&(d.setAttribute("tabindex",0),d.setAttribute("aria-selected","true"))})}static get observedAttributes(){return["disabled",p.MEDIA_CONTROLLER]}get selectedOptions(){return S(this,Ge,At).filter(e=>e.getAttribute("aria-selected")==="true")}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",S(this,zi)),this.addEventListener("keydown",S(this,yr))}disable(){this.removeEventListener("click",S(this,zi)),this.removeEventListener("keyup",S(this,vt))}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,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(p.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(p.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=jt(this,ti,Xi).call(this,e);if(!t)return;let a=t.getAttribute("aria-selected")==="true";this.getAttribute("aria-multiselectable")!=="true"&&S(this,ue).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=S(this,Ge,At),r=jt(this,ti,Xi).call(this,e);r||(r=a.filter(s=>s.getAttribute("tabindex")==="0")[0]);let n;switch(t){case"ArrowDown":n=r.nextElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.nextElementSibling);break;case"ArrowUp":n=r.previousElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.previousElementSibling);break;case"Home":n=a[0];break;case"End":n=a[a.length-1];break;default:n=jt(this,Ir,ws).call(this,t);break}n&&(a.forEach(s=>s.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=jt(this,ti,Xi).call(this,e);!t||t.hasAttribute("disabled")||(S(this,Ge,At).forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e))}};ke=new WeakMap;gt=new WeakMap;ei=new WeakMap;ue=new WeakMap;Ge=new WeakSet;At=function(){return S(this,ue).filter(i=>!i.hasAttribute("disabled"))};zi=new WeakMap;vt=new WeakMap;yr=new WeakMap;ti=new WeakSet;Xi=function(i){if(i.target===this)return;let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-LISTITEM");return e[t]};Ir=new WeakSet;ws=function(i){jt(this,Mr,xs).call(this);let e=S(this,Ge,At),t=e.findIndex(m=>m.getAttribute("tabindex")==="0");Se(this,ke,S(this,ke)+i);let a=S(this,ke).split("").every(m=>m===i),r=e.slice(t+(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(S(this,ke))),n=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(S(this,ke))),s=[],d=[];return a&&(s=e.slice(t+(a?1:0)).filter(m=>m.textContent.startsWith(i)),d=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.startsWith(i))),[...r,...n,...s,...d][0]};Mr=new WeakSet;xs=function(){l.clearTimeout(S(this,gt)),Se(this,gt,null),Se(this,gt,l.setTimeout(()=>{Se(this,ke,""),Se(this,gt,null)},500))};l.customElements.get("media-chrome-listbox")||l.customElements.define("media-chrome-listbox",Ji);var Ds=Ji;var Lr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},T=(i,e,t)=>(Lr(i,e,"read from private field"),t?t.call(i):e.get(i)),se=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ze=(i,e,t,a)=>(Lr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_t=(i,e,t)=>(Lr(i,e,"access private method"),t),ji,qe,me,q,Ce,ii,kr,Os,Sr,Ps,ta,wr,ea,xr,Us=u.createElement("template");Us.innerHTML=`
801
801
  <style>
802
802
  :host {
803
803
  display: inline-block;
@@ -833,7 +833,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
833
833
  <li>
834
834
  <slot></slot>
835
835
  </li>
836
- `;var Dr=class extends l.HTMLElement{static get observedAttributes(){return["disabled","aria-selected","value",p.MEDIA_CONTROLLER]}constructor(){super();let e=this.attachShadow({mode:"open"}),t=Ns.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,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,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(p.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(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}handleClick(){}};l.customElements.get("media-chrome-listitem")||l.customElements.define("media-chrome-listitem",Dr);var Nr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},H=(i,e,t)=>(Nr(i,e,"read from private field"),t?t.call(i):e.get(i)),Le=(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)},we=(i,e,t,a)=>(Nr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ae=(i,e,t)=>(Nr(i,e,"access private method"),t),It,Tt,he,J,ia,Rr,ra,Or,Qe,yt,aa,Pr,Hs=`
836
+ `;var Rr=class extends l.HTMLElement{static get observedAttributes(){return["disabled","aria-selected","value",p.MEDIA_CONTROLLER]}constructor(){super();let e=this.attachShadow({mode:"open"}),t=Ns.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,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,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(p.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(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}handleClick(){}};l.customElements.get("media-chrome-listitem")||l.customElements.define("media-chrome-listitem",Rr);var Nr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},H=(i,e,t)=>(Nr(i,e,"read from private field"),t?t.call(i):e.get(i)),Le=(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)},we=(i,e,t,a)=>(Nr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ae=(i,e,t)=>(Nr(i,e,"access private method"),t),It,Tt,he,J,ia,Dr,ra,Or,Qe,yt,aa,Pr,Hs=`
837
837
  fill: var(--media-icon-color, #eee);
838
838
  height: var(--media-captions-indicator-height, 1em);
839
839
  vertical-align: var(--media-captions-indicator-vertical-align, bottom);
@@ -843,7 +843,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
843
843
  <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"/>
844
844
  </svg>`,$s=u.createElement("template");$s.innerHTML=`
845
845
  <slot hidden name="captions-indicator">${jl}</slot>
846
- `;var Bs=(i,e)=>i.label===e.label&&i.language===e.language,Ur=class extends Rs{constructor(){super({slotTemplate:$s}),Le(this,ia),Le(this,ra),Le(this,Qe),Le(this,aa),Le(this,It,[]),Le(this,Tt,[]),Le(this,he,void 0),Le(this,J,void 0);let e=u.createElement("media-chrome-listitem");e.value="off",e.textContent="Off",we(this,he,e);let t=this.shadowRoot.querySelector('[name="captions-indicator"]');we(this,J,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?we(this,J,a[0].firstElementChild):r.length===1&&we(this,J,r[0])}H(this,J)||we(this,J,t.firstElementChild),we(this,J,H(this,J).cloneNode(!0)),H(this,J).removeAttribute("slot"),H(this,J).setAttribute("style",Hs)})}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)we(this,It,ae(this,ia,Rr).call(this,a,H(this,It))),ae(this,Qe,yt).call(this);else if(e===o.MEDIA_CAPTIONS_LIST&&t!==a)we(this,Tt,ae(this,ia,Rr).call(this,a,H(this,Tt))),ae(this,Qe,yt).call(this);else if(e===o.MEDIA_SUBTITLES_SHOWING&&t!==a){let r=Nt(a!=null?a:"")[0];H(this,It).forEach(n=>{n.selected=n.language===r.language&&n.label===r.label}),ae(this,Qe,yt).call(this)}else if(e===o.MEDIA_CAPTIONS_SHOWING&&t!==a){let r=Nt(a!=null?a:"")[0];H(this,Tt).forEach(n=>{n.selected=n.language===r.language&&n.label===r.label}),ae(this,Qe,yt).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(){ae(this,Qe,yt).call(this),this.addEventListener("change",ae(this,aa,Pr)),super.connectedCallback()}disconnectedCallback(){this.removeEventListener("change",ae(this,aa,Pr)),super.disconnectedCallback()}};It=new WeakMap;Tt=new WeakMap;he=new WeakMap;J=new WeakMap;ia=new WeakSet;Rr=function(i,e){let t=i?Nt(i!=null?i:""):[],a=[],r=[];return e.forEach(n=>{t.some(s=>Bs(s,n))||a.push(n)}),t.forEach(n=>{e.some(s=>Bs(s,n))||r.push(n)}),a.forEach(n=>n.el.remove()),e.filter(n=>!a.includes(n)).concat(r)};ra=new WeakSet;Or=function(i,e){i.forEach(t=>{let a=t.el,r=!0;a||(a=u.createElement("media-chrome-listitem"),r=!1,a.value=e+"!"+Ba(t),a.textContent=t.label,e==="cc"&&a.append(H(this,J).cloneNode(!0))),t.selected?a.setAttribute("aria-selected","true"):a.setAttribute("aria-selected","false"),r||(this.append(a),t.el=a)})};Qe=new WeakSet;yt=function(){this.contains(H(this,he))||this.append(H(this,he)),!this.hasAttribute(o.MEDIA_CAPTIONS_SHOWING)&&!this.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)?(H(this,he).setAttribute("aria-selected","true"),H(this,he).setAttribute("tabindex","0")):(H(this,he).setAttribute("aria-selected","false"),H(this,he).setAttribute("tabindex","-1")),ae(this,ra,Or).call(this,H(this,Tt),"cc"),ae(this,ra,Or).call(this,H(this,It),"subs")};aa=new WeakSet;Pr=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(ye(this),!r)return;let n=new l.CustomEvent(a==="cc"?h.MEDIA_SHOW_CAPTIONS_REQUEST:h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)};l.customElements.get("media-captions-listbox")||l.customElements.define("media-captions-listbox",Ur);var Vr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},O=(i,e,t)=>(Vr(i,e,"read from private field"),t?t.call(i):e.get(i)),pe=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ai=(i,e,t,a)=>(Vr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Mt=(i,e,t)=>(Vr(i,e,"access private method"),t),xe,ze,kt,oe,ri,Br,Vs,Fr,Fs,na,Hr,sa,$r,Ws=`
846
+ `;var Bs=(i,e)=>i.label===e.label&&i.language===e.language,Ur=class extends Ds{constructor(){super({slotTemplate:$s}),Le(this,ia),Le(this,ra),Le(this,Qe),Le(this,aa),Le(this,It,[]),Le(this,Tt,[]),Le(this,he,void 0),Le(this,J,void 0);let e=u.createElement("media-chrome-listitem");e.value="off",e.textContent="Off",we(this,he,e);let t=this.shadowRoot.querySelector('[name="captions-indicator"]');we(this,J,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?we(this,J,a[0].firstElementChild):r.length===1&&we(this,J,r[0])}H(this,J)||we(this,J,t.firstElementChild),we(this,J,H(this,J).cloneNode(!0)),H(this,J).removeAttribute("slot"),H(this,J).setAttribute("style",Hs)})}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)we(this,It,ae(this,ia,Dr).call(this,a,H(this,It))),ae(this,Qe,yt).call(this);else if(e===o.MEDIA_CAPTIONS_LIST&&t!==a)we(this,Tt,ae(this,ia,Dr).call(this,a,H(this,Tt))),ae(this,Qe,yt).call(this);else if(e===o.MEDIA_SUBTITLES_SHOWING&&t!==a){let r=Nt(a!=null?a:"")[0];H(this,It).forEach(n=>{n.selected=n.language===r.language&&n.label===r.label}),ae(this,Qe,yt).call(this)}else if(e===o.MEDIA_CAPTIONS_SHOWING&&t!==a){let r=Nt(a!=null?a:"")[0];H(this,Tt).forEach(n=>{n.selected=n.language===r.language&&n.label===r.label}),ae(this,Qe,yt).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(){ae(this,Qe,yt).call(this),this.addEventListener("change",ae(this,aa,Pr)),super.connectedCallback()}disconnectedCallback(){this.removeEventListener("change",ae(this,aa,Pr)),super.disconnectedCallback()}};It=new WeakMap;Tt=new WeakMap;he=new WeakMap;J=new WeakMap;ia=new WeakSet;Dr=function(i,e){let t=i?Nt(i!=null?i:""):[],a=[],r=[];return e.forEach(n=>{t.some(s=>Bs(s,n))||a.push(n)}),t.forEach(n=>{e.some(s=>Bs(s,n))||r.push(n)}),a.forEach(n=>n.el.remove()),e.filter(n=>!a.includes(n)).concat(r)};ra=new WeakSet;Or=function(i,e){i.forEach(t=>{let a=t.el,r=!0;a||(a=u.createElement("media-chrome-listitem"),r=!1,a.value=e+"!"+Ba(t),a.textContent=t.label,e==="cc"&&a.append(H(this,J).cloneNode(!0))),t.selected?a.setAttribute("aria-selected","true"):a.setAttribute("aria-selected","false"),r||(this.append(a),t.el=a)})};Qe=new WeakSet;yt=function(){this.contains(H(this,he))||this.append(H(this,he)),!this.hasAttribute(o.MEDIA_CAPTIONS_SHOWING)&&!this.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)?(H(this,he).setAttribute("aria-selected","true"),H(this,he).setAttribute("tabindex","0")):(H(this,he).setAttribute("aria-selected","false"),H(this,he).setAttribute("tabindex","-1")),ae(this,ra,Or).call(this,H(this,Tt),"cc"),ae(this,ra,Or).call(this,H(this,It),"subs")};aa=new WeakSet;Pr=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(ye(this),!r)return;let n=new l.CustomEvent(a==="cc"?h.MEDIA_SHOW_CAPTIONS_REQUEST:h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)};l.customElements.get("media-captions-listbox")||l.customElements.define("media-captions-listbox",Ur);var Vr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},O=(i,e,t)=>(Vr(i,e,"read from private field"),t?t.call(i):e.get(i)),pe=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ai=(i,e,t,a)=>(Vr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Mt=(i,e,t)=>(Vr(i,e,"access private method"),t),xe,ze,kt,oe,ri,Br,Vs,Fr,Fs,na,Hr,sa,$r,Ws=`
847
847
  <svg aria-hidden="true" viewBox="0 0 26 24">
848
848
  <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"/>
849
849
  </svg>`,ed=`
@@ -889,8 +889,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
889
889
  <slot slot="captions-indicator" name="captions-indicator">${Ws}</slot>
890
890
  </media-captions-listbox>
891
891
  </media-chrome-menu-button>
892
- `;var Wr=class extends l.HTMLElement{constructor(){super(),pe(this,Br),pe(this,Fr),pe(this,na),pe(this,sa),pe(this,xe,void 0),pe(this,ze,void 0),pe(this,kt,void 0),pe(this,oe,void 0),pe(this,ri,void 0);let e=this.attachShadow({mode:"open"}),t=Ks.content.cloneNode(!0);this.nativeEl=t,e.append(t),ai(this,xe,this.shadowRoot.querySelector("media-chrome-menu-button")),ai(this,ze,O(this,xe).querySelector(".enabled")),ai(this,kt,O(this,xe).querySelector(".disabled")),ai(this,oe,O(this,xe).querySelector("media-captions-listbox")),ai(this,ri,Mt(this,Br,Vs).bind(this)),this._captionsReady=!1,Mt(this,sa,$r).call(this)}static get observedAttributes(){return["disabled",p.MEDIA_CONTROLLER,"no-subtitles-fallback","default-showing",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else e===o.MEDIA_CAPTIONS_SHOWING||e===o.MEDIA_SUBTITLES_SHOWING&&a!==t?a?Mt(this,na,Hr).call(this):Mt(this,sa,$r).call(this):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable());if(this.hasAttribute("default-showing")&&O(this,ze).hidden){let s=!this.hasAttribute("no-subtitles-fallback");if((s?[o.MEDIA_CAPTIONS_LIST,o.MEDIA_SUBTITLES_LIST]:[o.MEDIA_CAPTIONS_LIST]).includes(e)){let c=!!this.getAttribute(o.MEDIA_CAPTIONS_LIST)||!!(s&&this.getAttribute(o.MEDIA_SUBTITLES_LIST));this._captionsReady!==c&&(this._captionsReady=c,this._captionsReady&&ye(this))}}}enable(){this.addEventListener("click",O(this,ri)),O(this,xe).removeAttribute("disabled")}disable(){this.removeEventListener("click",O(this,ri)),O(this,xe).setAttribute("disabled","")}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),Ht(this)&&Mt(this,na,Hr).call(this);let t=this.getAttribute(p.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(p.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"," ","ArrowUp","ArrowDown","f","c","k","m"]}};xe=new WeakMap;ze=new WeakMap;kt=new WeakMap;oe=new WeakMap;ri=new WeakMap;Br=new WeakSet;Vs=function(){Mt(this,Fr,Fs).call(this)};Fr=new WeakSet;Fs=function(){var i,e,t;if(O(this,oe).offsetWidth===0)return;let a=this.shadowRoot.querySelectorAll("svg"),r=((i=O(this,ze).assignedElements()[0])!=null?i:a[0]).getBoundingClientRect(),n=((e=O(this,kt).assignedElements()[0])!=null?e:a[1]).getBoundingClientRect();if(this.hasAttribute("media-controller")){let s=r.width,d=n.width,c=s>0?s:d>0?d:0,m=r.height,b=n.height,y=m>0?m:b>0?b:0;O(this,oe).style.marginLeft=`calc(-${c}px - 10px * 2)`,O(this,oe).style.marginTop=`calc(${y}px + 10px * 2)`}else{let s=r.x,d=n.x,c=s>0?s:d>0?d:0,m=(t=this.getAttribute("bounds")?Fe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,b=m.getBoundingClientRect().x;O(this,oe).offsetWidth+c-b>m.offsetWidth?O(this,oe).style.translate=m.offsetWidth-O(this,oe).offsetWidth+"px":O(this,oe).style.translate=`calc(${c}px - ${b}px - 10px)`}};na=new WeakSet;Hr=function(){O(this,ze).hidden=!1,O(this,kt).hidden=!0};sa=new WeakSet;$r=function(){O(this,ze).hidden=!0,O(this,kt).hidden=!1};l.customElements.get("media-captions-menu-button")||l.customElements.define("media-captions-menu-button",Wr);var v=Vo(require("@mux/mux-video")),x=require("@mux/playback-core");var eo=require("@mux/mux-video");var td="en",Xe={code:td};var Ys="en";function _(i,e=!0){var r,n;let t=e&&(n=(r=Xe)==null?void 0:r[i])!=null?n:i,a=e?Xe.code:Ys;return new Kr(t,a)}var Kr=class{constructor(e,t=(a=>(a=Xe.code)!=null?a:Ys)()){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 Gs(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${id(t)}: ${a}; `)}),e?e.trim():void 0}function id(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Zs(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function be(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function oa(i){let e=ad(i).toString();return e?"?"+e:""}function ad(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function De(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 Yr=(i,e)=>!i||!e?!1:i.contains(e)?!0:Yr(i,e.getRootNode().host);var Gr="mux.com",rd=()=>{try{return"1.7.2"}catch{}return"UNKNOWN"},nd=rd(),da=()=>nd,Zr=(i,{token:e,domain:t=Gr}={})=>`https://stream.${t}/${i}.m3u8${oa(!!e?{token:e}:{redundant_streams:!0})}`,qs=(i,{token:e,thumbnailTime:t,domain:a=Gr}={})=>{let r=e==null?t:void 0,{aud:n}=De(e);if(!(e&&n!=="t"))return`https://image.${a}/${i}/thumbnail.webp${oa({token:e,time:r})}`},Qs=(i,{token:e,domain:t=Gr}={})=>{let{aud:a}=De(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${oa({token:e,format:"webp"})}`};var sd={crossorigin:"crossOrigin",playsinline:"playsInline"};function zs(i){var e;return(e=sd[i])!=null?e:Zs(i)}var Je,je,K,la=class{constructor(e,t){L(this,Je,void 0);L(this,je,void 0);L(this,K,[]);G(this,Je,e),G(this,je,t)}[Symbol.iterator](){return A(this,K).values()}get length(){return A(this,K).length}get value(){var e;return(e=A(this,K).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(G(this,K,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return A(this,K)[e]}values(){return A(this,K).values()}keys(){return A(this,K).keys()}forEach(e){A(this,K).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||A(this,K).push(r)}),!(this.value===""&&!((t=A(this,Je))!=null&&t.hasAttribute(`${A(this,je)}`)))&&((a=A(this,Je))==null||a.setAttribute(`${A(this,je)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{A(this,K).splice(A(this,K).indexOf(a),1)}),(t=A(this,Je))==null||t.setAttribute(`${A(this,je)}`,`${this.value}`)}contains(e){return A(this,K).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)}};Je=new WeakMap,je=new WeakMap,K=new WeakMap;var Xs=`[mux-player ${da()}]`;function Re(...i){console.warn(Xs,...i)}function re(...i){console.error(Xs,...i)}function ca(i){var t;let e=(t=i.message)!=null?t:"";if(i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${_("Read more: ")}
893
- ${a}${i.file}`}Re(e)}var V={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},et={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},js=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}}),od=eo.VideoEvents.filter(i=>i!=="error"),ld=Object.values(V).filter(i=>![V.PLAYSINLINE].includes(i)),dd=Object.values(et);function to(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),od.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var qr=class extends R.HTMLElement{static get observedAttributes(){return[...ld,...dd]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var d,c;let s=(d=this.media)==null?void 0:d.querySelector(`track[src="${n.src}"]`);s&&((c=this.media)==null||c.removeChild(s))}),r.addedNodes.forEach(n=>{var s;(s=this.media)==null||s.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case et.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case et.VOLUME:{let s=(r=be(a))!=null?r:1;this.media&&(this.media.volume=s);return}case et.PLAYBACKRATE:{let s=(n=be(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get 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:js}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:js}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=be(this.getAttribute(et.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(et.PLAYBACKRATE,`${e}`):this.removeAttribute(et.PLAYBACKRATE)}get crossOrigin(){return ni(this,V.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(V.CROSSORIGIN,`${e}`)}get autoplay(){return ni(this,V.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(V.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(V.AUTOPLAY)}get loop(){return ni(this,V.LOOP)!=null}set loop(e){e?this.setAttribute(V.LOOP,""):this.removeAttribute(V.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 ni(this,V.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(V.MUTED,""):this.removeAttribute(V.MUTED)}get playsInline(){return ni(this,V.PLAYSINLINE)!=null}set playsInline(e){re("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(V.PRELOAD,e):this.removeAttribute(V.PRELOAD)}};function ni(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Qr=qr;var cd=Object.defineProperty,ud=(i,e,t)=>e in i?cd(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,md=(i,e,t)=>(ud(i,typeof e!="symbol"?e+"":e,t),t),so=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},g=(i,e,t)=>(so(i,e,"read from private field"),t?t.call(i):e.get(i)),le=(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)=>(so(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),St,ua,tt,si,Oe,Pe,Ue,it,Ct,ma,ne,io=1,ao=0,hd=1,pd={processCallback(i,e,t){if(!!t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof Y&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof Y?r.element[r.attributeName]=n:r.value=n}}}},fe=class extends l.DocumentFragment{constructor(e,t,a=pd){var r;super(),le(this,St,void 0),le(this,ua,void 0),this.append(e.content.cloneNode(!0)),Ee(this,St,oo(this)),Ee(this,ua,a),(r=a.createCallback)==null||r.call(a,this,g(this,St),t),a.processCallback(this,g(this,St),t)}update(e){g(this,ua).processCallback(this,g(this,St),e)}};St=new WeakMap;ua=new WeakMap;var oo=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new zr;for([t,a]of no(r.value))if(!t)n.append(a);else{let s=new Y(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===io&&!(r instanceof HTMLTemplateElement))oo(r,e);else if(r.nodeType===io||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of no(r.data))if(!t)n.push(new Text(a));else{let s=new ve(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new oi(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},ro={},no=i=>{let e="",t=0,a=ro[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([ao,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([hd,e.trim()]),e="",r++):e+=n||"";return e&&a.push([ao,(t>0?"{{":"")+e]),ro[i]=a},bd=11,ha=class{get value(){return""}set value(e){}toString(){return this.value}},lo=new WeakMap,zr=class{constructor(){le(this,tt,[])}[Symbol.iterator](){return g(this,tt).values()}get length(){return g(this,tt).length}item(e){return g(this,tt)[e]}append(...e){for(let t of e)t instanceof Y&&lo.set(t,this),g(this,tt).push(t)}toString(){return g(this,tt).join("")}};tt=new WeakMap;var Y=class extends ha{constructor(e,t,a){super(),le(this,it),le(this,si,""),le(this,Oe,void 0),le(this,Pe,void 0),le(this,Ue,void 0),Ee(this,Oe,e),Ee(this,Pe,t),Ee(this,Ue,a)}get attributeName(){return g(this,Pe)}get attributeNamespace(){return g(this,Ue)}get element(){return g(this,Oe)}get value(){return g(this,si)}set value(e){g(this,si)!==e&&(Ee(this,si,e),!g(this,it,Ct)||g(this,it,Ct).length===1?e==null?g(this,Oe).removeAttributeNS(g(this,Ue),g(this,Pe)):g(this,Oe).setAttributeNS(g(this,Ue),g(this,Pe),e):g(this,Oe).setAttributeNS(g(this,Ue),g(this,Pe),g(this,it,Ct)))}get booleanValue(){return g(this,Oe).hasAttributeNS(g(this,Ue),g(this,Pe))}set booleanValue(e){if(!g(this,it,Ct)||g(this,it,Ct).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};si=new WeakMap;Oe=new WeakMap;Pe=new WeakMap;Ue=new WeakMap;it=new WeakSet;Ct=function(){return lo.get(this)};var ve=class extends ha{constructor(e,t){super(),le(this,ma,void 0),le(this,ne,void 0),Ee(this,ma,e),Ee(this,ne,t?[...t]:[new Text])}get replacementNodes(){return g(this,ne)}get parentNode(){return g(this,ma)}get nextSibling(){return g(this,ne)[g(this,ne).length-1].nextSibling}get previousSibling(){return g(this,ne)[0].previousSibling}get value(){return g(this,ne).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===bd?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Ee(this,ne,Ed(g(this,ne)[0].parentNode,g(this,ne),t,this.nextSibling))}};ma=new WeakMap;ne=new WeakMap;var oi=class extends ve{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),md(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Ed(i,e,t,a=null){let r=0,n,s,d,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(n=e[r];r<c;)d=t[r++],s=n?n.nextSibling:a,n==d?n=s:r<c&&t[r]==s?(i.replaceChild(d,n),n=s):i.insertBefore(d,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var fd=/([>&])?\s*(\w+)\s*(.*)/,vd=/^(\?\?|\|)?\s*(['"\w]*)/,gd={"|":{string:i=>String(i)},"??":(i,e)=>i!=null?i:e},pa=class{constructor(e){this.template=e}},at=new WeakMap,rt=new WeakMap,Jr={partial:(i,e)=>{e[i.expression]=new pa(i.template)},if:(i,e)=>{var t;if(yd(i.expression,e))if(at.get(i)!==i.template){at.set(i,i.template);let a=new fe(i.template,e,ba);i.replace(a),rt.set(i,a)}else(t=rt.get(i))==null||t.update(e);else i.replace(""),at.delete(i),rt.delete(i)}},Ad=Object.keys(Jr),ba={processCallback(i,e,t){var a,r,n,s;if(!!t)for(let[d,c]of e){if(c instanceof oi){if(!c.directive){let M=Ad.find(k=>c.template.hasAttribute(k));M&&(c.directive=M,c.expression=c.template.getAttribute(M))}(a=Jr[c.directive])==null||a.call(Jr,c,t);continue}let[,m,b,y]=(r=d.match(fd))!=null?r:[],f=t[b],[,I,B]=(n=y.match(vd))!=null?n:[],D=gd[I];if(typeof D=="function")f=D(f,li(B,t));else if(D&&f!=null){let M=D[B];M&&(f=M(f))}if(f){if(f instanceof pa){if(m!==">")continue;let M={...t},k=d.matchAll(/(\w+)\s*=\s*(['"\w]*)/g);for(let[,j,Q]of k)M[j]=li(Q,t);at.get(c)!==f.template?(at.set(c,f.template),f=new fe(f.template,M,ba),c.value=f,rt.set(c,f)):(s=rt.get(c))==null||s.update(M);continue}c instanceof Y&&c.attributeName.startsWith("aria-")&&(f=String(f)),c instanceof Y?typeof f=="boolean"?c.booleanValue=f:typeof f=="function"?c.element[c.attributeName]=f:c.value=f:(c.value=f,at.delete(c),rt.delete(c))}else c instanceof Y?c.booleanValue=!1:(c.value=void 0,at.delete(c),rt.delete(c))}}},_d={"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e};function yd(i,e){var t;let a=Id(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><]=|[><]/,ws:/\s+/,param:/[$a-z_][$\w]*/i});if(a.length===0||a.some(({type:n})=>!n))return console.warn(`Warning: invalid expression \`${i}\``),!1;if(a.length===1)return Xr(a[0])?li(a[0].token,e):(console.warn(`Warning: invalid expression \`${i}\``),!1);let r=a.filter(({type:n})=>n!=="ws");if(r.length===3){let n=_d[(t=r[1])==null?void 0:t.token];return!n||!Xr(r[0])||!Xr(r[2])?(console.warn(`Warning: invalid expression \`${i}\``),!1):n(li(r[0].token,e),li(r[2].token,e))}}function Xr({type:i}){return["number","boolean","string","param"].includes(i)}function li(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):An(i)?parseFloat(i):e[i]}function Id(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var Td=Object.defineProperty,Md=(i,e,t)=>e in i?Td(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,di=(i,e,t)=>(Md(i,typeof e!="symbol"?e+"":e,t),t),ho=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},co=(i,e,t)=>(ho(i,e,"read from private field"),t?t.call(i):e.get(i)),uo=(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)},mo=(i,e,t,a)=>(ho(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ea,fa,jr={"media-target-live-window":"targetLiveWindow","media-stream-type":"streamType"},Lt=class extends l.HTMLElement{constructor(){super(),di(this,"renderRoot"),di(this,"renderer"),uo(this,Ea,void 0),uo(this,fa,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:!!(jr[a.attributeName]||a.attributeName.startsWith("breakpoint-"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.createRenderer()}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e,t;let a=this.getAttribute("template");if(a){let r=(e=this.getRootNode())==null?void 0:e.getElementById(a);if(r)return r}return(t=co(this,Ea))!=null?t:this.constructor.template}set template(e){mo(this,Ea,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:s})=>jr[s]||s.startsWith("breakpoint-")),...Array.from(this.attributes)],n={};for(let s of r){let d=(a=jr[s.name])!=null?a:vn(s.name);s.value!=null?n[d]=s.value===""?!0:s.value:n[d]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&this.createRenderer()}createRenderer(){this.template&&this.template!==co(this,fa)&&(mo(this,fa,this.template),this.renderer=new fe(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Ea=new WeakMap;fa=new WeakMap;di(Lt,"template");di(Lt,"observedAttributes",["template"]);di(Lt,"processor",ba);l.customElements.get("media-theme")||l.customElements.define("media-theme",Lt);var bo=`
892
+ `;var Wr=class extends l.HTMLElement{constructor(){super(),pe(this,Br),pe(this,Fr),pe(this,na),pe(this,sa),pe(this,xe,void 0),pe(this,ze,void 0),pe(this,kt,void 0),pe(this,oe,void 0),pe(this,ri,void 0);let e=this.attachShadow({mode:"open"}),t=Ks.content.cloneNode(!0);this.nativeEl=t,e.append(t),ai(this,xe,this.shadowRoot.querySelector("media-chrome-menu-button")),ai(this,ze,O(this,xe).querySelector(".enabled")),ai(this,kt,O(this,xe).querySelector(".disabled")),ai(this,oe,O(this,xe).querySelector("media-captions-listbox")),ai(this,ri,Mt(this,Br,Vs).bind(this)),this._captionsReady=!1,Mt(this,sa,$r).call(this)}static get observedAttributes(){return["disabled",p.MEDIA_CONTROLLER,"no-subtitles-fallback","default-showing",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else e===o.MEDIA_CAPTIONS_SHOWING||e===o.MEDIA_SUBTITLES_SHOWING&&a!==t?a?Mt(this,na,Hr).call(this):Mt(this,sa,$r).call(this):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable());if(this.hasAttribute("default-showing")&&O(this,ze).hidden){let s=!this.hasAttribute("no-subtitles-fallback");if((s?[o.MEDIA_CAPTIONS_LIST,o.MEDIA_SUBTITLES_LIST]:[o.MEDIA_CAPTIONS_LIST]).includes(e)){let c=!!this.getAttribute(o.MEDIA_CAPTIONS_LIST)||!!(s&&this.getAttribute(o.MEDIA_SUBTITLES_LIST));this._captionsReady!==c&&(this._captionsReady=c,this._captionsReady&&ye(this))}}}enable(){this.addEventListener("click",O(this,ri)),O(this,xe).removeAttribute("disabled")}disable(){this.removeEventListener("click",O(this,ri)),O(this,xe).setAttribute("disabled","")}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),Ht(this)&&Mt(this,na,Hr).call(this);let t=this.getAttribute(p.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(p.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"," ","ArrowUp","ArrowDown","f","c","k","m"]}};xe=new WeakMap;ze=new WeakMap;kt=new WeakMap;oe=new WeakMap;ri=new WeakMap;Br=new WeakSet;Vs=function(){Mt(this,Fr,Fs).call(this)};Fr=new WeakSet;Fs=function(){var i,e,t;if(O(this,oe).offsetWidth===0)return;let a=this.shadowRoot.querySelectorAll("svg"),r=((i=O(this,ze).assignedElements()[0])!=null?i:a[0]).getBoundingClientRect(),n=((e=O(this,kt).assignedElements()[0])!=null?e:a[1]).getBoundingClientRect();if(this.hasAttribute("media-controller")){let s=r.width,d=n.width,c=s>0?s:d>0?d:0,m=r.height,b=n.height,y=m>0?m:b>0?b:0;O(this,oe).style.marginLeft=`calc(-${c}px - 10px * 2)`,O(this,oe).style.marginTop=`calc(${y}px + 10px * 2)`}else{let s=r.x,d=n.x,c=s>0?s:d>0?d:0,m=(t=this.getAttribute("bounds")?Fe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,b=m.getBoundingClientRect().x;O(this,oe).offsetWidth+c-b>m.offsetWidth?O(this,oe).style.translate=m.offsetWidth-O(this,oe).offsetWidth+"px":O(this,oe).style.translate=`calc(${c}px - ${b}px - 10px)`}};na=new WeakSet;Hr=function(){O(this,ze).hidden=!1,O(this,kt).hidden=!0};sa=new WeakSet;$r=function(){O(this,ze).hidden=!0,O(this,kt).hidden=!1};l.customElements.get("media-captions-menu-button")||l.customElements.define("media-captions-menu-button",Wr);var f=Vo(require("@mux/mux-video")),x=require("@mux/playback-core");var eo=require("@mux/mux-video");var td="en",Xe={code:td};var Ys="en";function _(i,e=!0){var r,n;let t=e&&(n=(r=Xe)==null?void 0:r[i])!=null?n:i,a=e?Xe.code:Ys;return new Kr(t,a)}var Kr=class{constructor(e,t=(a=>(a=Xe.code)!=null?a:Ys)()){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 Gs(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${id(t)}: ${a}; `)}),e?e.trim():void 0}function id(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Zs(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function be(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function oa(i){let e=ad(i).toString();return e?"?"+e:""}function ad(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function Re(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 Yr=(i,e)=>!i||!e?!1:i.contains(e)?!0:Yr(i,e.getRootNode().host);var Gr="mux.com",rd=()=>{try{return"1.8.0"}catch{}return"UNKNOWN"},nd=rd(),da=()=>nd,Zr=(i,{maxResolution:e,token:t,domain:a=Gr}={})=>{let s=!!t?{token:t}:{redundant_streams:!0,...e?{max_resolution:e}:{}};return`https://stream.${a}/${i}.m3u8${oa(s)}`},qs=(i,{token:e,thumbnailTime:t,domain:a=Gr}={})=>{let r=e==null?t:void 0,{aud:n}=Re(e);if(!(e&&n!=="t"))return`https://image.${a}/${i}/thumbnail.webp${oa({token:e,time:r})}`},Qs=(i,{token:e,domain:t=Gr}={})=>{let{aud:a}=Re(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${oa({token:e,format:"webp"})}`};var sd={crossorigin:"crossOrigin",playsinline:"playsInline"};function zs(i){var e;return(e=sd[i])!=null?e:Zs(i)}var Je,je,K,la=class{constructor(e,t){L(this,Je,void 0);L(this,je,void 0);L(this,K,[]);G(this,Je,e),G(this,je,t)}[Symbol.iterator](){return A(this,K).values()}get length(){return A(this,K).length}get value(){var e;return(e=A(this,K).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(G(this,K,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return A(this,K)[e]}values(){return A(this,K).values()}keys(){return A(this,K).keys()}forEach(e){A(this,K).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||A(this,K).push(r)}),!(this.value===""&&!((t=A(this,Je))!=null&&t.hasAttribute(`${A(this,je)}`)))&&((a=A(this,Je))==null||a.setAttribute(`${A(this,je)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{A(this,K).splice(A(this,K).indexOf(a),1)}),(t=A(this,Je))==null||t.setAttribute(`${A(this,je)}`,`${this.value}`)}contains(e){return A(this,K).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)}};Je=new WeakMap,je=new WeakMap,K=new WeakMap;var Xs=`[mux-player ${da()}]`;function De(...i){console.warn(Xs,...i)}function re(...i){console.error(Xs,...i)}function ca(i){var t;let e=(t=i.message)!=null?t:"";if(i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${_("Read more: ")}
893
+ ${a}${i.file}`}De(e)}var V={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},et={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},js=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}}),od=eo.VideoEvents.filter(i=>i!=="error"),ld=Object.values(V).filter(i=>![V.PLAYSINLINE].includes(i)),dd=Object.values(et);function to(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),od.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var qr=class extends D.HTMLElement{static get observedAttributes(){return[...ld,...dd]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var d,c;let s=(d=this.media)==null?void 0:d.querySelector(`track[src="${n.src}"]`);s&&((c=this.media)==null||c.removeChild(s))}),r.addedNodes.forEach(n=>{var s;(s=this.media)==null||s.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case et.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case et.VOLUME:{let s=(r=be(a))!=null?r:1;this.media&&(this.media.volume=s);return}case et.PLAYBACKRATE:{let s=(n=be(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get 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:js}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:js}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=be(this.getAttribute(et.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(et.PLAYBACKRATE,`${e}`):this.removeAttribute(et.PLAYBACKRATE)}get crossOrigin(){return ni(this,V.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(V.CROSSORIGIN,`${e}`)}get autoplay(){return ni(this,V.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(V.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(V.AUTOPLAY)}get loop(){return ni(this,V.LOOP)!=null}set loop(e){e?this.setAttribute(V.LOOP,""):this.removeAttribute(V.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 ni(this,V.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(V.MUTED,""):this.removeAttribute(V.MUTED)}get playsInline(){return ni(this,V.PLAYSINLINE)!=null}set playsInline(e){re("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(V.PRELOAD,e):this.removeAttribute(V.PRELOAD)}};function ni(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Qr=qr;var cd=Object.defineProperty,ud=(i,e,t)=>e in i?cd(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,md=(i,e,t)=>(ud(i,typeof e!="symbol"?e+"":e,t),t),so=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},g=(i,e,t)=>(so(i,e,"read from private field"),t?t.call(i):e.get(i)),le=(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)=>(so(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),St,ua,tt,si,Oe,Pe,Ue,it,Ct,ma,ne,io=1,ao=0,hd=1,pd={processCallback(i,e,t){if(!!t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof Y&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof Y?r.element[r.attributeName]=n:r.value=n}}}},fe=class extends l.DocumentFragment{constructor(e,t,a=pd){var r;super(),le(this,St,void 0),le(this,ua,void 0),this.append(e.content.cloneNode(!0)),Ee(this,St,oo(this)),Ee(this,ua,a),(r=a.createCallback)==null||r.call(a,this,g(this,St),t),a.processCallback(this,g(this,St),t)}update(e){g(this,ua).processCallback(this,g(this,St),e)}};St=new WeakMap;ua=new WeakMap;var oo=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new zr;for([t,a]of no(r.value))if(!t)n.append(a);else{let s=new Y(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===io&&!(r instanceof HTMLTemplateElement))oo(r,e);else if(r.nodeType===io||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of no(r.data))if(!t)n.push(new Text(a));else{let s=new ve(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new oi(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},ro={},no=i=>{let e="",t=0,a=ro[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([ao,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([hd,e.trim()]),e="",r++):e+=n||"";return e&&a.push([ao,(t>0?"{{":"")+e]),ro[i]=a},bd=11,ha=class{get value(){return""}set value(e){}toString(){return this.value}},lo=new WeakMap,zr=class{constructor(){le(this,tt,[])}[Symbol.iterator](){return g(this,tt).values()}get length(){return g(this,tt).length}item(e){return g(this,tt)[e]}append(...e){for(let t of e)t instanceof Y&&lo.set(t,this),g(this,tt).push(t)}toString(){return g(this,tt).join("")}};tt=new WeakMap;var Y=class extends ha{constructor(e,t,a){super(),le(this,it),le(this,si,""),le(this,Oe,void 0),le(this,Pe,void 0),le(this,Ue,void 0),Ee(this,Oe,e),Ee(this,Pe,t),Ee(this,Ue,a)}get attributeName(){return g(this,Pe)}get attributeNamespace(){return g(this,Ue)}get element(){return g(this,Oe)}get value(){return g(this,si)}set value(e){g(this,si)!==e&&(Ee(this,si,e),!g(this,it,Ct)||g(this,it,Ct).length===1?e==null?g(this,Oe).removeAttributeNS(g(this,Ue),g(this,Pe)):g(this,Oe).setAttributeNS(g(this,Ue),g(this,Pe),e):g(this,Oe).setAttributeNS(g(this,Ue),g(this,Pe),g(this,it,Ct)))}get booleanValue(){return g(this,Oe).hasAttributeNS(g(this,Ue),g(this,Pe))}set booleanValue(e){if(!g(this,it,Ct)||g(this,it,Ct).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};si=new WeakMap;Oe=new WeakMap;Pe=new WeakMap;Ue=new WeakMap;it=new WeakSet;Ct=function(){return lo.get(this)};var ve=class extends ha{constructor(e,t){super(),le(this,ma,void 0),le(this,ne,void 0),Ee(this,ma,e),Ee(this,ne,t?[...t]:[new Text])}get replacementNodes(){return g(this,ne)}get parentNode(){return g(this,ma)}get nextSibling(){return g(this,ne)[g(this,ne).length-1].nextSibling}get previousSibling(){return g(this,ne)[0].previousSibling}get value(){return g(this,ne).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===bd?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Ee(this,ne,Ed(g(this,ne)[0].parentNode,g(this,ne),t,this.nextSibling))}};ma=new WeakMap;ne=new WeakMap;var oi=class extends ve{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),md(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Ed(i,e,t,a=null){let r=0,n,s,d,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(n=e[r];r<c;)d=t[r++],s=n?n.nextSibling:a,n==d?n=s:r<c&&t[r]==s?(i.replaceChild(d,n),n=s):i.insertBefore(d,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var fd=/([>&])?\s*(\w+)\s*(.*)/,vd=/^(\?\?|\|)?\s*(['"\w]*)/,gd={"|":{string:i=>String(i)},"??":(i,e)=>i!=null?i:e},pa=class{constructor(e){this.template=e}},at=new WeakMap,rt=new WeakMap,Jr={partial:(i,e)=>{e[i.expression]=new pa(i.template)},if:(i,e)=>{var t;if(yd(i.expression,e))if(at.get(i)!==i.template){at.set(i,i.template);let a=new fe(i.template,e,ba);i.replace(a),rt.set(i,a)}else(t=rt.get(i))==null||t.update(e);else i.replace(""),at.delete(i),rt.delete(i)}},Ad=Object.keys(Jr),ba={processCallback(i,e,t){var a,r,n,s;if(!!t)for(let[d,c]of e){if(c instanceof oi){if(!c.directive){let M=Ad.find(k=>c.template.hasAttribute(k));M&&(c.directive=M,c.expression=c.template.getAttribute(M))}(a=Jr[c.directive])==null||a.call(Jr,c,t);continue}let[,m,b,y]=(r=d.match(fd))!=null?r:[],v=t[b],[,I,B]=(n=y.match(vd))!=null?n:[],R=gd[I];if(typeof R=="function")v=R(v,li(B,t));else if(R&&v!=null){let M=R[B];M&&(v=M(v))}if(v){if(v instanceof pa){if(m!==">")continue;let M={...t},k=d.matchAll(/(\w+)\s*=\s*(['"\w]*)/g);for(let[,j,Q]of k)M[j]=li(Q,t);at.get(c)!==v.template?(at.set(c,v.template),v=new fe(v.template,M,ba),c.value=v,rt.set(c,v)):(s=rt.get(c))==null||s.update(M);continue}c instanceof Y&&c.attributeName.startsWith("aria-")&&(v=String(v)),c instanceof Y?typeof v=="boolean"?c.booleanValue=v:typeof v=="function"?c.element[c.attributeName]=v:c.value=v:(c.value=v,at.delete(c),rt.delete(c))}else c instanceof Y?c.booleanValue=!1:(c.value=void 0,at.delete(c),rt.delete(c))}}},_d={"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e};function yd(i,e){var t;let a=Id(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><]=|[><]/,ws:/\s+/,param:/[$a-z_][$\w]*/i});if(a.length===0||a.some(({type:n})=>!n))return console.warn(`Warning: invalid expression \`${i}\``),!1;if(a.length===1)return Xr(a[0])?li(a[0].token,e):(console.warn(`Warning: invalid expression \`${i}\``),!1);let r=a.filter(({type:n})=>n!=="ws");if(r.length===3){let n=_d[(t=r[1])==null?void 0:t.token];return!n||!Xr(r[0])||!Xr(r[2])?(console.warn(`Warning: invalid expression \`${i}\``),!1):n(li(r[0].token,e),li(r[2].token,e))}}function Xr({type:i}){return["number","boolean","string","param"].includes(i)}function li(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):An(i)?parseFloat(i):e[i]}function Id(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var Td=Object.defineProperty,Md=(i,e,t)=>e in i?Td(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,di=(i,e,t)=>(Md(i,typeof e!="symbol"?e+"":e,t),t),ho=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},co=(i,e,t)=>(ho(i,e,"read from private field"),t?t.call(i):e.get(i)),uo=(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)},mo=(i,e,t,a)=>(ho(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ea,fa,jr={"media-target-live-window":"targetLiveWindow","media-stream-type":"streamType"},Lt=class extends l.HTMLElement{constructor(){super(),di(this,"renderRoot"),di(this,"renderer"),uo(this,Ea,void 0),uo(this,fa,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:!!(jr[a.attributeName]||a.attributeName.startsWith("breakpoint-"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.createRenderer()}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e,t;let a=this.getAttribute("template");if(a){let r=(e=this.getRootNode())==null?void 0:e.getElementById(a);if(r)return r}return(t=co(this,Ea))!=null?t:this.constructor.template}set template(e){mo(this,Ea,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:s})=>jr[s]||s.startsWith("breakpoint-")),...Array.from(this.attributes)],n={};for(let s of r){let d=(a=jr[s.name])!=null?a:vn(s.name);s.value!=null?n[d]=s.value===""?!0:s.value:n[d]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&this.createRenderer()}createRenderer(){this.template&&this.template!==co(this,fa)&&(mo(this,fa,this.template),this.renderer=new fe(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Ea=new WeakMap;fa=new WeakMap;di(Lt,"template");di(Lt,"observedAttributes",["template"]);di(Lt,"processor",ba);l.customElements.get("media-theme")||l.customElements.define("media-theme",Lt);var bo=`
894
894
  :host {
895
895
  cursor: pointer;
896
896
  }
@@ -902,7 +902,7 @@ ${a}${i.file}`}Re(e)}var V={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"
902
902
  ${bo}
903
903
  </style>
904
904
  <media-time-display show-duration></media-time-display>
905
- `;var po=["Enter"," "],ci,xt,va,wt=class extends R.HTMLElement{constructor(){var t,a;super();L(this,xt);L(this,ci,void 0);this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(a=this.shadowRoot)==null?void 0:a.querySelector("media-time-display")}static get observedAttributes(){return["hide-duration","remaining","disabled","aria-disabled"]}toggleTimeDisplay(){var t,a,r;(t=this.timeDisplayEl)!=null&&t.hasAttribute("remaining")?(a=this.timeDisplayEl)==null||a.removeAttribute("remaining"):(r=this.timeDisplayEl)==null||r.setAttribute("remaining","")}connectedCallback(){let t=a=>{let{key:r}=a;if(!po.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!po.includes(s)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),G(this,ci,setInterval(P(this,xt,va).bind(this),200)),requestAnimationFrame(()=>P(this,xt,va).call(this))}disconnectedCallback(){clearInterval(A(this,ci))}attributeChangedCallback(t,a,r){var n,s;t==="hide-duration"&&P(this,xt,va).call(this),["remaining","disabled","aria-disabled"].includes(t)&&a!==r&&(r==null?(n=this.timeDisplayEl)==null||n.removeAttribute(t):(s=this.timeDisplayEl)==null||s.setAttribute(t,r))}};ci=new WeakMap,xt=new WeakSet,va=function(){var a,r,n,s;getComputedStyle(this).getPropertyValue("--media-duration-display").trim()==="none"||this.getAttribute("hide-duration")!=null?(a=this.timeDisplayEl)!=null&&a.hasAttribute("show-duration")&&((r=this.timeDisplayEl)==null||r.removeAttribute("show-duration")):(n=this.timeDisplayEl)!=null&&n.hasAttribute("show-duration")||(s=this.timeDisplayEl)==null||s.setAttribute("show-duration","")},wt.styles=bo,wt.template=Eo;R.customElements.get("mxp-time-display")||(R.customElements.define("mxp-time-display",wt),R.MxpTimeDisplay=wt);var fo=`:host {
905
+ `;var po=["Enter"," "],ci,xt,va,wt=class extends D.HTMLElement{constructor(){var t,a;super();L(this,xt);L(this,ci,void 0);this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(a=this.shadowRoot)==null?void 0:a.querySelector("media-time-display")}static get observedAttributes(){return["hide-duration","remaining","disabled","aria-disabled"]}toggleTimeDisplay(){var t,a,r;(t=this.timeDisplayEl)!=null&&t.hasAttribute("remaining")?(a=this.timeDisplayEl)==null||a.removeAttribute("remaining"):(r=this.timeDisplayEl)==null||r.setAttribute("remaining","")}connectedCallback(){let t=a=>{let{key:r}=a;if(!po.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!po.includes(s)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),G(this,ci,setInterval(P(this,xt,va).bind(this),200)),requestAnimationFrame(()=>P(this,xt,va).call(this))}disconnectedCallback(){clearInterval(A(this,ci))}attributeChangedCallback(t,a,r){var n,s;t==="hide-duration"&&P(this,xt,va).call(this),["remaining","disabled","aria-disabled"].includes(t)&&a!==r&&(r==null?(n=this.timeDisplayEl)==null||n.removeAttribute(t):(s=this.timeDisplayEl)==null||s.setAttribute(t,r))}};ci=new WeakMap,xt=new WeakSet,va=function(){var a,r,n,s;getComputedStyle(this).getPropertyValue("--media-duration-display").trim()==="none"||this.getAttribute("hide-duration")!=null?(a=this.timeDisplayEl)!=null&&a.hasAttribute("show-duration")&&((r=this.timeDisplayEl)==null||r.removeAttribute("show-duration")):(n=this.timeDisplayEl)!=null&&n.hasAttribute("show-duration")||(s=this.timeDisplayEl)==null||s.setAttribute("show-duration","")},wt.styles=bo,wt.template=Eo;D.customElements.get("mxp-time-display")||(D.customElements.define("mxp-time-display",wt),D.MxpTimeDisplay=wt);var fo=`:host {
906
906
  display: inline-block;
907
907
  width: 100%;
908
908
  }
@@ -1879,7 +1879,7 @@ a {
1879
1879
  <div class="dialog">
1880
1880
  <slot></slot>
1881
1881
  </div>
1882
- `;var Ne=class extends R.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})),go(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Cd(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")&&go(this)}};Ne.styles=Ao,Ne.template=_o,Ne.observedAttributes=["open"];function go(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=yo(i.shadowRoot)),i._previouslyFocusedElement=F.activeElement,F.activeElement instanceof HTMLElement&&F.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function yo(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=yo(r[n].shadowRoot),a));n++);}return a}function Cd(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}R.customElements.get("media-dialog")||(R.customElements.define("media-dialog",Ne),R.MediaDialog=Ne);var en=Ne;var Io=F.createElement("template");Io.innerHTML=`
1882
+ `;var Ne=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})),go(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Cd(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")&&go(this)}};Ne.styles=Ao,Ne.template=_o,Ne.observedAttributes=["open"];function go(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=yo(i.shadowRoot)),i._previouslyFocusedElement=F.activeElement,F.activeElement instanceof HTMLElement&&F.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function yo(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=yo(r[n].shadowRoot),a));n++);}return a}function Cd(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}D.customElements.get("media-dialog")||(D.customElements.define("media-dialog",Ne),D.MediaDialog=Ne);var en=Ne;var Io=F.createElement("template");Io.innerHTML=`
1883
1883
  <style>
1884
1884
  ${en.styles}
1885
1885
 
@@ -1910,12 +1910,12 @@ a {
1910
1910
  </svg>
1911
1911
  </button>
1912
1912
  </slot>
1913
- `;var ui=class extends en{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};ui.template=Io;R.customElements.get("mxp-dialog")||(R.customElements.define("mxp-dialog",ui),R.MxpDialog=ui);var mi=new WeakMap,hi=class{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=mi.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=mi.get(this.element);t&&t.delete(this.type)}}static for(e){mi.has(e.element)||mi.set(e.element,new Map);let t=e.attributeName.slice(2),a=mi.get(e.element);return a&&a.has(t)?a.get(t):new hi(e.element,t)}};function Ld(i,e){return i instanceof Y&&i.attributeName.startsWith("on")?(hi.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function wd(i,e){return e instanceof ga&&i instanceof ve?(e.renderInto(i),!0):!1}function xd(i,e){return e instanceof DocumentFragment&&i instanceof ve?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function Dd(i,e){if(i instanceof Y){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 Rd(i,e){if(i instanceof Y&&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 Od(i,e){if(typeof e=="boolean"&&i instanceof Y){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function Pd(i,e){return e===!1&&i instanceof ve?(i.replace(""),!0):!1}function Ud(i,e){Rd(i,e)||Od(i,e)||Ld(i,e)||Pd(i,e)||wd(i,e)||xd(i,e)||Dd(i,e)}var tn=new Map,To=new WeakMap,Mo=new WeakMap,ga=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(tn.has(this.stringsKey))return tn.get(this.stringsKey);{let e=F.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),tn.set(this.stringsKey,e),e}}renderInto(e){let t=this.template;if(To.get(e)!==t){To.set(e,t);let r=new fe(t,this.values,this.processor);Mo.set(e,r),e instanceof ve?e.replace(...r.children):e.appendChild(r);return}let a=Mo.get(e);a&&a.update(this.values)}},Nd={processCallback(i,e,t){var a;if(!!t){for(let[r,n]of e)if(r in t){let s=(a=t[r])!=null?a:"";Ud(n,s)}}}};function ge(i,...e){return new ga(i,e,Nd)}function ko(i,e){i.renderInto(e)}var pi=require("@mux/playback-core"),an=F.createElement("template");"innerHTML"in an&&(an.innerHTML=vo);var So=i=>ge`
1913
+ `;var ui=class extends en{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};ui.template=Io;D.customElements.get("mxp-dialog")||(D.customElements.define("mxp-dialog",ui),D.MxpDialog=ui);var mi=new WeakMap,hi=class{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=mi.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=mi.get(this.element);t&&t.delete(this.type)}}static for(e){mi.has(e.element)||mi.set(e.element,new Map);let t=e.attributeName.slice(2),a=mi.get(e.element);return a&&a.has(t)?a.get(t):new hi(e.element,t)}};function Ld(i,e){return i instanceof Y&&i.attributeName.startsWith("on")?(hi.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function wd(i,e){return e instanceof ga&&i instanceof ve?(e.renderInto(i),!0):!1}function xd(i,e){return e instanceof DocumentFragment&&i instanceof ve?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function Rd(i,e){if(i instanceof Y){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 Dd(i,e){if(i instanceof Y&&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 Od(i,e){if(typeof e=="boolean"&&i instanceof Y){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function Pd(i,e){return e===!1&&i instanceof ve?(i.replace(""),!0):!1}function Ud(i,e){Dd(i,e)||Od(i,e)||Ld(i,e)||Pd(i,e)||wd(i,e)||xd(i,e)||Rd(i,e)}var tn=new Map,To=new WeakMap,Mo=new WeakMap,ga=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(tn.has(this.stringsKey))return tn.get(this.stringsKey);{let e=F.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),tn.set(this.stringsKey,e),e}}renderInto(e){let t=this.template;if(To.get(e)!==t){To.set(e,t);let r=new fe(t,this.values,this.processor);Mo.set(e,r),e instanceof ve?e.replace(...r.children):e.appendChild(r);return}let a=Mo.get(e);a&&a.update(this.values)}},Nd={processCallback(i,e,t){var a;if(!!t){for(let[r,n]of e)if(r in t){let s=(a=t[r])!=null?a:"";Ud(n,s)}}}};function ge(i,...e){return new ga(i,e,Nd)}function ko(i,e){i.renderInto(e)}var pi=require("@mux/playback-core"),an=F.createElement("template");"innerHTML"in an&&(an.innerHTML=vo);var So=i=>ge`
1914
1914
  <style>
1915
1915
  ${fo}
1916
1916
  </style>
1917
1917
  ${Hd(i)}
1918
- `,Co=i=>[pi.StreamTypes.LIVE,pi.StreamTypes.LL_LIVE].includes(i.streamType),Lo=i=>[pi.StreamTypes.DVR,pi.StreamTypes.LL_DVR].includes(i.streamType),wo=i=>Co(i)||Lo(i),Bd=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return wo(i)&&(e+=" noarrowleft noarrowright"),e},Hd=i=>{var e,t,a,r,n,s,d,c,m,b,y,f,I,B,D,M,k,j,Q,de,lt,yi,nn,sn,on,ln,dn,cn,un,mn,hn;return ge`
1918
+ `,Co=i=>[pi.StreamTypes.LIVE,pi.StreamTypes.LL_LIVE].includes(i.streamType),Lo=i=>[pi.StreamTypes.DVR,pi.StreamTypes.LL_DVR].includes(i.streamType),wo=i=>Co(i)||Lo(i),Bd=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return wo(i)&&(e+=" noarrowleft noarrowright"),e},Hd=i=>{var e,t,a,r,n,s,d,c,m,b,y,v,I,B,R,M,k,j,Q,de,lt,yi,nn,sn,on,ln,dn,cn,un,mn,hn;return ge`
1919
1919
  <media-theme
1920
1920
  template="${(e=i.theme)!=null?e:an.content.children[0]}"
1921
1921
  class="${i.secondaryColor?"two-tone":!1}"
@@ -1940,10 +1940,10 @@ a {
1940
1940
  slot="media"
1941
1941
  crossorigin="${(y=i.crossOrigin)!=null?y:""}"
1942
1942
  playsinline
1943
- autoplay="${(f=i.autoplay)!=null?f:!1}"
1943
+ autoplay="${(v=i.autoplay)!=null?v:!1}"
1944
1944
  muted="${(I=i.muted)!=null?I:!1}"
1945
1945
  loop="${(B=i.loop)!=null?B:!1}"
1946
- preload="${(D=i.preload)!=null?D:!1}"
1946
+ preload="${(R=i.preload)!=null?R:!1}"
1947
1947
  debug="${(M=i.debug)!=null?M:!1}"
1948
1948
  prefer-cmcd="${(k=i.preferCmcd)!=null?k:!1}"
1949
1949
  disable-cookies="${(j=i.disableCookies)!=null?j:!1}"
@@ -1955,8 +1955,8 @@ a {
1955
1955
  env-key="${(nn=i.envKey)!=null?nn:!1}"
1956
1956
  stream-type="${(sn=i.streamType)!=null?sn:!1}"
1957
1957
  custom-domain="${(on=i.customDomain)!=null?on:!1}"
1958
- src="${i.src?i.src:i.playbackId?Zr(i.playbackId,{domain:i.customDomain,token:i.tokens.playback}):!1}"
1959
- cast-src="${i.src?i.src:i.playbackId?Zr(i.playbackId,{domain:i.customDomain,token:i.tokens.playback}):!1}"
1958
+ src="${i.src?i.src:i.playbackId?Zr(i.playbackId,{maxResolution:i.maxResolution,domain:i.customDomain,token:i.tokens.playback}):!1}"
1959
+ cast-src="${i.src?i.src:i.playbackId?Zr(i.playbackId,{maxResolution:i.maxResolution,domain:i.customDomain,token:i.tokens.playback}):!1}"
1960
1960
  cast-stream-type="${Co(i)?"live":!1}"
1961
1961
  exportparts="video"
1962
1962
  >
@@ -1981,5 +1981,5 @@ a {
1981
1981
  </p>
1982
1982
  </mxp-dialog>
1983
1983
  </media-theme>
1984
- `};var bi=require("@mux/mux-video");function Aa(i,e,t,a,r){var d,c,m;let n={},s={};switch(i.code){case bi.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=_("Network Error",r),n.message=i.message,(d=i.data)==null?void 0:d.response.code){case 412:{n.title=_("Video is not currently available",r),n.message=_("The live stream or video file are not yet ready.",r),s.message=_("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),s.file="412-not-playable.md";break}case 404:{n.title=_("Video does not exist",r),n.message="",s.message=_("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),s.file="404-not-found.md";break}case 403:{if(n.title=_("Invalid playback URL",r),n.message=_("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=_("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),s.file="missing-signed-tokens.md",!a)break;let{exp:b,aud:y,sub:f}=De(a),I=Date.now()>b*1e3,B=f!==t,D=y!=="v",M={timeStyle:"medium",dateStyle:"medium"};if(I){n.title=_("Video URL has expired",r),n.message=_("The video\u2019s secured playback-token has expired.",r),s.message=_("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(Xe.code,M).format(b*1e3),currentDate:new Intl.DateTimeFormat(Xe.code,M).format(Date.now())}),s.file="403-expired-token.md";break}if(B){n.title=_("Video URL is formatted incorrectly",r),n.message=_("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=_("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:t,tokenPlaybackId:f}),s.file="403-playback-id-mismatch.md";break}if(D){n.title=_("Video URL is formatted incorrectly",r),n.message=_("The playback-token is formatted with incorrect information.",r),s.message=_("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:y}),s.file="403-incorrect-aud-value.md";break}s.message=_("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),s.file="403-malformatted-token.md";break}}break}case bi.MediaError.MEDIA_ERR_DECODE:{let{message:b}=i;n={title:_("Media Error",r),message:b},s.file="media-decode-error.md";break}case bi.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let b=(m=(c=i.data)==null?void 0:c.response)==null?void 0:m.code;if(b>=400&&b<500){i.code=bi.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:b}},{dialog:n,devlog:s}=Aa(i,e,t,a);break}n={title:_("Source Not Supported",r),message:i.message},s.file="media-src-not-supported.md";break}default:n={title:_("Error",r),message:i.message};break}return e&&(n={title:_("Your device appears to be offline",r),message:_("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var $d=Object.values(x.StreamTypes),Ae={SRC:"src",POSTER:"poster"},E={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"};function Wd(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(E.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),theme:i.getAttribute("theme"),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(E.NOHOTKEYS),hotKeys:i.getAttribute(E.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,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,streamType:i.streamType,primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,playbackRates:i.getAttribute(E.PLAYBACK_RATES),customDomain:(a=i.getAttribute(v.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(E.TITLE),...e}}var Vd=Object.values(v.Attributes),Fd=Object.values(Ae),Kd=Object.values(E),Yd=da(),Gd="mux-player",xo={dialog:void 0,isDialogOpen:!1},He,gi,_e,Ai,nt,st,Ei,_a,Do,_i,rn,ot,fi,ya,Ro,Ia,Oo,Ta,Po,vi=class extends Qr{constructor(){super();L(this,st);L(this,_a);L(this,_i);L(this,ot);L(this,ya);L(this,Ia);L(this,Ta);L(this,He,!1);L(this,gi,{});L(this,_e,!0);L(this,Ai,new la(this,"hotkeys"));L(this,nt,{...xo,onCloseErrorDialog:()=>P(this,_i,rn).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{Yr(this,F.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),P(this,_a,Do).call(this),this.isConnected&&P(this,st,Ei).call(this)}static get observedAttributes(){var t;return[...(t=Qr.observedAttributes)!=null?t:[],...Fd,...Vd,...Kd]}get theme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.theme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}get metadataFromAttrs(){return this.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=this.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},{})}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=this.metadataFromAttrs)}attributeChangedCallback(t,a,r){switch(A(this,He)||P(this,st,Ei).call(this),super.attributeChangedCallback(t,a,r),t){case E.HOTKEYS:A(this,Ai).value=r;break;case E.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Re(_("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case E.THUMBNAIL_TOKEN:{let{aud:s}=De(r);r&&s!=="t"&&Re(_("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case E.STORYBOARD_TOKEN:{let{aud:s}=De(r);r&&s!=="s"&&Re(_("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case v.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&re(_("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r})),this.streamType?this.streamType!=null&&!$d.includes(this.streamType)&&ca({file:"invalid-stream-type.md",message:_("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):ca({file:"invalid-stream-type.md",message:String(_("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[v.Attributes.PLAYBACK_ID,Ae.SRC,E.PLAYBACK_TOKEN].includes(t)&&a!==r&&G(this,nt,{...A(this,nt),...xo}),P(this,ot,fi).call(this,{[zs(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?x.CmcdTypeValues.includes(t)?this.setAttribute(v.Attributes.PREFER_CMCD,t):Re(`Invalid value for preferCmcd. Must be one of ${x.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 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=Be(this,Ae.SRC))!=null?t:void 0:(a=this.getAttribute(Ae.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Ae.SRC,t):this.removeAttribute(Ae.SRC)}get poster(){var a;let t=this.getAttribute(Ae.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return qs(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Ae.POSTER,t):this.removeAttribute(Ae.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(E.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(E.STORYBOARD_SRC,t):this.removeAttribute(E.STORYBOARD_SRC)}get storyboard(){if(!this.audio&&(!this.streamType||![x.StreamTypes.LIVE,x.StreamTypes.LL_LIVE,x.StreamTypes.DVR,x.StreamTypes.LL_DVR].includes(this.streamType))){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(this.playbackId)return Qs(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}}get audio(){return this.hasAttribute(E.AUDIO)}set audio(t){if(!t){this.removeAttribute(E.AUDIO);return}this.setAttribute(E.AUDIO,"")}get hotkeys(){return A(this,Ai)}get nohotkeys(){return this.hasAttribute(E.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(E.NOHOTKEYS);return}this.setAttribute(E.NOHOTKEYS,"")}get thumbnailTime(){return be(this.getAttribute(E.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(E.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(E.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(E.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=Be(this,E.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(E.PLACEHOLDER,`${t}`)}get primaryColor(){var t;return(t=this.getAttribute(E.PRIMARY_COLOR))!=null?t:void 0}set primaryColor(t){this.setAttribute(E.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var t;return(t=this.getAttribute(E.SECONDARY_COLOR))!=null?t:"rgb(0 0 0 / .75)"}set secondaryColor(t){this.setAttribute(E.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(E.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(E.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(E.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(E.PLAYBACK_RATES))return this.getAttribute(E.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(E.PLAYBACK_RATES);return}this.setAttribute(E.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=be(this.getAttribute(E.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(E.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=be(this.getAttribute(E.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(E.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(E.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(E.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(E.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:Gd}get playerSoftwareVersion(){var t;return(t=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:Yd}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 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=Be(this,v.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(v.Attributes.ENV_KEY,`${t}`)}get debug(){return Be(this,v.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(v.Attributes.DEBUG,""):this.removeAttribute(v.Attributes.DEBUG)}get disableCookies(){return Be(this,v.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(v.Attributes.DISABLE_COOKIES,""):this.removeAttribute(v.Attributes.DISABLE_COOKIES)}get streamType(){return Be(this,v.Attributes.STREAM_TYPE)}set streamType(t){this.setAttribute(v.Attributes.STREAM_TYPE,`${t}`)}get startTime(){return be(Be(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===x.PlaybackTypes.MSE||t===x.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===x.PlaybackTypes.MSE||t===x.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(A(this,He)||P(this,st,Ei).call(this),!this.media){re("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...this.metadataFromAttrs,...t}}async addCuePoints(t){var a;if(A(this,He)||P(this,st,Ei).call(this),!this.media){re("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:[]}get tokens(){let t=this.getAttribute(E.PLAYBACK_TOKEN),a=this.getAttribute(E.THUMBNAIL_TOKEN),r=this.getAttribute(E.STORYBOARD_TOKEN);return{...A(this,gi),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){G(this,gi,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(E.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(E.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(E.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(E.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(E.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(E.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(!!s)return(0,x.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,x.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};He=new WeakMap,gi=new WeakMap,_e=new WeakMap,Ai=new WeakMap,nt=new WeakMap,st=new WeakSet,Ei=function(){var t,a;if(!A(this,He)){G(this,He,!0),P(this,ot,fi).call(this);try{if(customElements.upgrade(this.theme),!(this.theme instanceof R.HTMLElement))throw""}catch{re("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof v.default))throw""}catch{re("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Gt))throw""}catch{re("<media-controller> failed to upgrade!")}to(this),P(this,ya,Ro).call(this),P(this,Ia,Oo).call(this),G(this,_e,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("user-inactive"))!=null?a:!0),P(this,Ta,Po).call(this)}},_a=new WeakSet,Do=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--primary-color",syntax:"<color>",inherits:!0,initialValue:"white"}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--secondary-color",syntax:"<color>",inherits:!0,initialValue:"transparent"})}catch{}},_i=new WeakSet,rn=function(t){Object.assign(A(this,nt),t),P(this,ot,fi).call(this)},ot=new WeakSet,fi=function(t={}){ko(So(Wd(this,{...A(this,nt),...t})),this.shadowRoot)},ya=new WeakSet,Ro=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof v.MediaError||(n=new v.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Re(n),n.data&&Re(`${n.name} data:`,n.data);return}let{dialog:s,devlog:d}=Aa(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&ca(d),re(n),n.data&&re(`${n.name} data:`,n.data),P(this,_i,rn).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,d,c;if(!((s=this.media)!=null&&s.error))return r;let{devlog:n}=Aa((d=this.media)==null?void 0:d.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:n.message?String(n.message):r.player_error_message}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,d;let{detail:n}=r;if(!n){let{message:c,code:m}=(d=(s=this.media)==null?void 0:s.error)!=null?d:{};n=new v.MediaError(c,m)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Ia=new WeakSet,Oo=function(){var a,r,n,s;let t=()=>P(this,ot,fi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},Ta=new WeakSet,Po=function(){var b,y,f;let t=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(a)return;let r,n=new WeakMap,s=()=>this.streamType&&[x.StreamTypes.LIVE,x.StreamTypes.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,d=(I,B,D=!1)=>{if(s())return;Array.from(I&&I.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!B||this.paused){let j=k.text.split(`
1985
- `).length,Q=a?-2:-3;this.streamType&&[x.StreamTypes.LIVE,x.StreamTypes.LL_LIVE].includes(this.streamType)&&(Q=a?-1:-2);let de=Q-j;if(k.line===de&&!D)return;n.has(k)||n.set(k,k.line),k.line=de-1,k.line=de}else setTimeout(()=>{k.line=n.get(k)||"auto"},500)})},c=()=>{var I;d(r,(I=t==null?void 0:t.hasAttribute("user-inactive"))!=null?I:!1)},m=()=>{var D;let B=Array.from(((D=t==null?void 0:t.media)==null?void 0:D.textTracks)||[]).filter(M=>["subtitles","captions"].includes(M.kind)&&M.mode==="showing")[0];B!==r&&(r==null||r.removeEventListener("cuechange",c)),r=B,r==null||r.addEventListener("cuechange",c),d(r,A(this,_e))};if(m(),(b=t==null?void 0:t.media)==null||b.textTracks.addEventListener("change",m),(y=t==null?void 0:t.media)==null||y.textTracks.addEventListener("addtrack",m),navigator.userAgent.includes("Chrome/")){let I=()=>{d(r,A(this,_e),!0),this.paused||window.requestAnimationFrame(I)};(f=t==null?void 0:t.media)==null||f.addEventListener("playing",()=>{I()})}t==null||t.addEventListener("userinactivechange",()=>{let I=t==null?void 0:t.hasAttribute("user-inactive");A(this,_e)!==I&&(G(this,_e,I),d(r,A(this,_e)))})};function Be(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}R.customElements.get("mux-player")||(R.customElements.define("mux-player",vi),R.MuxPlayerElement=vi);var Zd=vi;
1984
+ `};var bi=require("@mux/mux-video");function Aa(i,e,t,a,r){var d,c,m;let n={},s={};switch(i.code){case bi.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=_("Network Error",r),n.message=i.message,(d=i.data)==null?void 0:d.response.code){case 412:{n.title=_("Video is not currently available",r),n.message=_("The live stream or video file are not yet ready.",r),s.message=_("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),s.file="412-not-playable.md";break}case 404:{n.title=_("Video does not exist",r),n.message="",s.message=_("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),s.file="404-not-found.md";break}case 403:{if(n.title=_("Invalid playback URL",r),n.message=_("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=_("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),s.file="missing-signed-tokens.md",!a)break;let{exp:b,aud:y,sub:v}=Re(a),I=Date.now()>b*1e3,B=v!==t,R=y!=="v",M={timeStyle:"medium",dateStyle:"medium"};if(I){n.title=_("Video URL has expired",r),n.message=_("The video\u2019s secured playback-token has expired.",r),s.message=_("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(Xe.code,M).format(b*1e3),currentDate:new Intl.DateTimeFormat(Xe.code,M).format(Date.now())}),s.file="403-expired-token.md";break}if(B){n.title=_("Video URL is formatted incorrectly",r),n.message=_("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=_("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:t,tokenPlaybackId:v}),s.file="403-playback-id-mismatch.md";break}if(R){n.title=_("Video URL is formatted incorrectly",r),n.message=_("The playback-token is formatted with incorrect information.",r),s.message=_("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:y}),s.file="403-incorrect-aud-value.md";break}s.message=_("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),s.file="403-malformatted-token.md";break}}break}case bi.MediaError.MEDIA_ERR_DECODE:{let{message:b}=i;n={title:_("Media Error",r),message:b},s.file="media-decode-error.md";break}case bi.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let b=(m=(c=i.data)==null?void 0:c.response)==null?void 0:m.code;if(b>=400&&b<500){i.code=bi.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:b}},{dialog:n,devlog:s}=Aa(i,e,t,a);break}n={title:_("Source Not Supported",r),message:i.message},s.file="media-src-not-supported.md";break}default:n={title:_("Error",r),message:i.message};break}return e&&(n={title:_("Your device appears to be offline",r),message:_("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var $d=Object.values(x.StreamTypes),Ae={SRC:"src",POSTER:"poster"},E={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"};function Wd(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(E.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),theme:i.getAttribute("theme"),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(E.NOHOTKEYS),hotKeys:i.getAttribute(E.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,streamType:i.streamType,primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,playbackRates:i.getAttribute(E.PLAYBACK_RATES),customDomain:(a=i.getAttribute(f.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(E.TITLE),...e}}var Vd=Object.values(f.Attributes),Fd=Object.values(Ae),Kd=Object.values(E),Yd=da(),Gd="mux-player",xo={dialog:void 0,isDialogOpen:!1},He,gi,_e,Ai,nt,st,Ei,_a,Ro,_i,rn,ot,fi,ya,Do,Ia,Oo,Ta,Po,vi=class extends Qr{constructor(){super();L(this,st);L(this,_a);L(this,_i);L(this,ot);L(this,ya);L(this,Ia);L(this,Ta);L(this,He,!1);L(this,gi,{});L(this,_e,!0);L(this,Ai,new la(this,"hotkeys"));L(this,nt,{...xo,onCloseErrorDialog:()=>P(this,_i,rn).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{Yr(this,F.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),P(this,_a,Ro).call(this),this.isConnected&&P(this,st,Ei).call(this)}static get observedAttributes(){var t;return[...(t=Qr.observedAttributes)!=null?t:[],...Fd,...Vd,...Kd]}get theme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.theme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}get metadataFromAttrs(){return this.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=this.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},{})}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=this.metadataFromAttrs)}attributeChangedCallback(t,a,r){switch(A(this,He)||P(this,st,Ei).call(this),super.attributeChangedCallback(t,a,r),t){case E.HOTKEYS:A(this,Ai).value=r;break;case E.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&De(_("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case E.THUMBNAIL_TOKEN:{let{aud:s}=Re(r);r&&s!=="t"&&De(_("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case E.STORYBOARD_TOKEN:{let{aud:s}=Re(r);r&&s!=="s"&&De(_("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case f.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&re(_("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r})),this.streamType?this.streamType!=null&&!$d.includes(this.streamType)&&ca({file:"invalid-stream-type.md",message:_("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):ca({file:"invalid-stream-type.md",message:String(_("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[f.Attributes.PLAYBACK_ID,Ae.SRC,E.PLAYBACK_TOKEN].includes(t)&&a!==r&&G(this,nt,{...A(this,nt),...xo}),P(this,ot,fi).call(this,{[zs(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(f.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?x.CmcdTypeValues.includes(t)?this.setAttribute(f.Attributes.PREFER_CMCD,t):De(`Invalid value for preferCmcd. Must be one of ${x.CmcdTypeValues.join()}`):this.removeAttribute(f.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 playbackId(){var t;return(t=this.getAttribute(f.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(f.Attributes.PLAYBACK_ID,t):this.removeAttribute(f.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=Be(this,Ae.SRC))!=null?t:void 0:(a=this.getAttribute(Ae.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Ae.SRC,t):this.removeAttribute(Ae.SRC)}get poster(){var a;let t=this.getAttribute(Ae.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return qs(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Ae.POSTER,t):this.removeAttribute(Ae.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(E.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(E.STORYBOARD_SRC,t):this.removeAttribute(E.STORYBOARD_SRC)}get storyboard(){if(!this.audio&&(!this.streamType||![x.StreamTypes.LIVE,x.StreamTypes.LL_LIVE,x.StreamTypes.DVR,x.StreamTypes.LL_DVR].includes(this.streamType))){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(this.playbackId)return Qs(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}}get audio(){return this.hasAttribute(E.AUDIO)}set audio(t){if(!t){this.removeAttribute(E.AUDIO);return}this.setAttribute(E.AUDIO,"")}get hotkeys(){return A(this,Ai)}get nohotkeys(){return this.hasAttribute(E.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(E.NOHOTKEYS);return}this.setAttribute(E.NOHOTKEYS,"")}get thumbnailTime(){return be(this.getAttribute(E.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(E.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(E.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(E.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=Be(this,E.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(E.PLACEHOLDER,`${t}`)}get primaryColor(){var t;return(t=this.getAttribute(E.PRIMARY_COLOR))!=null?t:void 0}set primaryColor(t){this.setAttribute(E.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var t;return(t=this.getAttribute(E.SECONDARY_COLOR))!=null?t:"rgb(0 0 0 / .75)"}set secondaryColor(t){this.setAttribute(E.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(E.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(E.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(E.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(E.PLAYBACK_RATES))return this.getAttribute(E.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(E.PLAYBACK_RATES);return}this.setAttribute(E.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=be(this.getAttribute(E.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(E.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=be(this.getAttribute(E.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(E.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(E.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(E.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(E.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(f.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:Gd}get playerSoftwareVersion(){var t;return(t=this.getAttribute(f.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:Yd}get beaconCollectionDomain(){var t;return(t=this.getAttribute(f.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(f.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(f.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(f.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(f.Attributes.MAX_RESOLUTION,t):this.removeAttribute(f.Attributes.MAX_RESOLUTION))}get customDomain(){var t;return(t=this.getAttribute(f.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(f.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(f.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=Be(this,f.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(f.Attributes.ENV_KEY,`${t}`)}get debug(){return Be(this,f.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(f.Attributes.DEBUG,""):this.removeAttribute(f.Attributes.DEBUG)}get disableCookies(){return Be(this,f.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(f.Attributes.DISABLE_COOKIES,""):this.removeAttribute(f.Attributes.DISABLE_COOKIES)}get streamType(){return Be(this,f.Attributes.STREAM_TYPE)}set streamType(t){this.setAttribute(f.Attributes.STREAM_TYPE,`${t}`)}get startTime(){return be(Be(this,f.Attributes.START_TIME))}set startTime(t){this.setAttribute(f.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(f.Attributes.PREFER_PLAYBACK);if(t===x.PlaybackTypes.MSE||t===x.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===x.PlaybackTypes.MSE||t===x.PlaybackTypes.NATIVE?this.setAttribute(f.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(f.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(A(this,He)||P(this,st,Ei).call(this),!this.media){re("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...this.metadataFromAttrs,...t}}async addCuePoints(t){var a;if(A(this,He)||P(this,st,Ei).call(this),!this.media){re("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:[]}get tokens(){let t=this.getAttribute(E.PLAYBACK_TOKEN),a=this.getAttribute(E.THUMBNAIL_TOKEN),r=this.getAttribute(E.STORYBOARD_TOKEN);return{...A(this,gi),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){G(this,gi,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(E.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(E.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(E.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(E.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(E.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(E.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(!!s)return(0,x.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,x.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};He=new WeakMap,gi=new WeakMap,_e=new WeakMap,Ai=new WeakMap,nt=new WeakMap,st=new WeakSet,Ei=function(){var t,a;if(!A(this,He)){G(this,He,!0),P(this,ot,fi).call(this);try{if(customElements.upgrade(this.theme),!(this.theme instanceof D.HTMLElement))throw""}catch{re("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof f.default))throw""}catch{re("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Gt))throw""}catch{re("<media-controller> failed to upgrade!")}to(this),P(this,ya,Do).call(this),P(this,Ia,Oo).call(this),G(this,_e,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("user-inactive"))!=null?a:!0),P(this,Ta,Po).call(this)}},_a=new WeakSet,Ro=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--primary-color",syntax:"<color>",inherits:!0,initialValue:"white"}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--secondary-color",syntax:"<color>",inherits:!0,initialValue:"transparent"})}catch{}},_i=new WeakSet,rn=function(t){Object.assign(A(this,nt),t),P(this,ot,fi).call(this)},ot=new WeakSet,fi=function(t={}){ko(So(Wd(this,{...A(this,nt),...t})),this.shadowRoot)},ya=new WeakSet,Do=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof f.MediaError||(n=new f.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){De(n),n.data&&De(`${n.name} data:`,n.data);return}let{dialog:s,devlog:d}=Aa(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&ca(d),re(n),n.data&&re(`${n.name} data:`,n.data),P(this,_i,rn).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,d,c;if(!((s=this.media)!=null&&s.error))return r;let{devlog:n}=Aa((d=this.media)==null?void 0:d.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:n.message?String(n.message):r.player_error_message}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,d;let{detail:n}=r;if(!n){let{message:c,code:m}=(d=(s=this.media)==null?void 0:s.error)!=null?d:{};n=new f.MediaError(c,m)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Ia=new WeakSet,Oo=function(){var a,r,n,s;let t=()=>P(this,ot,fi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},Ta=new WeakSet,Po=function(){var b,y,v;let t=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(a)return;let r,n=new WeakMap,s=()=>this.streamType&&[x.StreamTypes.LIVE,x.StreamTypes.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,d=(I,B,R=!1)=>{if(s())return;Array.from(I&&I.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!B||this.paused){let j=k.text.split(`
1985
+ `).length,Q=a?-2:-3;this.streamType&&[x.StreamTypes.LIVE,x.StreamTypes.LL_LIVE].includes(this.streamType)&&(Q=a?-1:-2);let de=Q-j;if(k.line===de&&!R)return;n.has(k)||n.set(k,k.line),k.line=de-1,k.line=de}else setTimeout(()=>{k.line=n.get(k)||"auto"},500)})},c=()=>{var I;d(r,(I=t==null?void 0:t.hasAttribute("user-inactive"))!=null?I:!1)},m=()=>{var R;let B=Array.from(((R=t==null?void 0:t.media)==null?void 0:R.textTracks)||[]).filter(M=>["subtitles","captions"].includes(M.kind)&&M.mode==="showing")[0];B!==r&&(r==null||r.removeEventListener("cuechange",c)),r=B,r==null||r.addEventListener("cuechange",c),d(r,A(this,_e))};if(m(),(b=t==null?void 0:t.media)==null||b.textTracks.addEventListener("change",m),(y=t==null?void 0:t.media)==null||y.textTracks.addEventListener("addtrack",m),navigator.userAgent.includes("Chrome/")){let I=()=>{d(r,A(this,_e),!0),this.paused||window.requestAnimationFrame(I)};(v=t==null?void 0:t.media)==null||v.addEventListener("playing",()=>{I()})}t==null||t.addEventListener("userinactivechange",()=>{let I=t==null?void 0:t.hasAttribute("user-inactive");A(this,_e)!==I&&(G(this,_e,I),d(r,A(this,_e)))})};function Be(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}D.customElements.get("mux-player")||(D.customElements.define("mux-player",vi),D.MuxPlayerElement=vi);var Zd=vi;