@mux/mux-player 1.0.0 → 1.1.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 Io=Object.create;var xt=Object.defineProperty;var Mo=Object.getOwnPropertyDescriptor;var So=Object.getOwnPropertyNames;var ko=Object.getPrototypeOf,Lo=Object.prototype.hasOwnProperty;var Co=(t,i)=>{for(var e in i)xt(t,e,{get:i[e],enumerable:!0})},Ya=(t,i,e,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of So(i))!Lo.call(t,r)&&r!==e&&xt(t,r,{get:()=>i[r],enumerable:!(a=Mo(i,r))||a.enumerable});return t};var wo=(t,i,e)=>(e=t!=null?Io(ko(t)):{},Ya(i||!t||!t.__esModule?xt(e,"default",{value:t,enumerable:!0}):e,t)),Do=t=>Ya(xt({},"__esModule",{value:!0}),t);var Mi=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var g=(t,i,e)=>(Mi(t,i,"read from private field"),e?e.call(t):i.get(t)),T=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},B=(t,i,e,a)=>(Mi(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e);var I=(t,i,e)=>(Mi(t,i,"access private method"),e);var Yl={};Co(Yl,{MediaError:()=>v.MediaError,default:()=>Kl,getVideoAttribute:()=>De});module.exports=Do(Yl);var Pe=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Pe{}globalThis.DocumentFragment=t}var et=class extends Pe{},Si=class extends Pe{},xo={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(et)}},tt,ki=class{constructor(i,e={}){T(this,tt,void 0);B(this,tt,e==null?void 0:e.detail)}get detail(){return g(this,tt)}initCustomEvent(){}};tt=new WeakMap;function Ro(t,i){return new et}var Ga={document:{createElement:Ro},DocumentFragment,customElements:xo,CustomEvent:ki,EventTarget:Pe,HTMLElement:et,HTMLVideoElement:Si},Za=typeof window=="undefined"||typeof globalThis.customElements=="undefined",M=Za?Ga:globalThis,G=Za?Ga.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",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},it={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"},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_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered"},Ql=Object.entries(it).reduce((t,[i,e])=>{let a=o[i];return a&&(t[e]=a),t},{userinactivechange:"user-inactive"}),Qa=Object.entries(o).reduce((t,[i,e])=>{let a=it[i];return a&&(t[e]=a),t},{"user-inactive":"userinactivechange"}),Ue={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},fe={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Li={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Z={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"};var $={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:t=1}={})=>`current playback rate ${t}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},k={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:t=30}={})=>`seek forward ${t} seconds`,SEEK_BACK_N_SECS:({seekOffset:t=30}={})=>`seek back ${t} seconds`},Uo={...$,...k};var Oo=t=>typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t),qa=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],No=(t,i)=>{let e=t===1?qa[i].singular:qa[i].plural;return`${t} ${e}`},ge=t=>{if(!Oo(t))return"";let i=Math.abs(t),e=i!==t,a=new Date(0,0,0,0,0,i,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,c)=>l&&No(l,c)).filter(l=>l).join(", ")}${e?" remaining":""}`};function z(t,i){let e=!1;t<0&&(e=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),n=Math.floor(t/3600),s=Math.floor(i/60%60),l=Math.floor(i/3600);return(isNaN(t)||t===1/0)&&(n=r=a="-"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(e?"-":"")+n+r+a}var za={HTMLElement:function(){this.addEventListener=()=>{},this.removeEventListener=()=>{},this.dispatchEvent=()=>{}},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},Bo={createElement:function(){return new za.HTMLElement}},ja=typeof window=="undefined"||typeof window.customElements=="undefined",u=ja?za:window,d=ja?Bo:window.document;function p(t,i){u.customElements.get(t)||(u.customElements.define(t,i),u[i.name]=i)}var Vo=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},Oe=(t,i,e)=>(Vo(t,i,"read from private field"),e?e.call(t):i.get(t)),Ci=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Rt,at,wi,Xa=d.createElement("template");Xa.innerHTML=`
1
+ "use strict";var Oo=Object.create;var xt=Object.defineProperty;var No=Object.getOwnPropertyDescriptor;var $o=Object.getOwnPropertyNames;var Bo=Object.getPrototypeOf,Vo=Object.prototype.hasOwnProperty;var Ho=(t,i)=>{for(var e in i)xt(t,e,{get:i[e],enumerable:!0})},ir=(t,i,e,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of $o(i))!Vo.call(t,r)&&r!==e&&xt(t,r,{get:()=>i[r],enumerable:!(a=No(i,r))||a.enumerable});return t};var Wo=(t,i,e)=>(e=t!=null?Oo(Bo(t)):{},ir(i||!t||!t.__esModule?xt(e,"default",{value:t,enumerable:!0}):e,t)),Fo=t=>ir(xt({},"__esModule",{value:!0}),t);var Mi=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var g=(t,i,e)=>(Mi(t,i,"read from private field"),e?e.call(t):i.get(t)),T=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},B=(t,i,e,a)=>(Mi(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e);var I=(t,i,e)=>(Mi(t,i,"access private method"),e);var nd={};Ho(nd,{MediaError:()=>v.MediaError,default:()=>rd,getVideoAttribute:()=>xe});module.exports=Fo(nd);var Ue=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Ue{}globalThis.DocumentFragment=t}var et=class extends Ue{},Si=class extends Ue{},Ko={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(et)}},tt,ki=class{constructor(i,e={}){T(this,tt,void 0);B(this,tt,e==null?void 0:e.detail)}get detail(){return g(this,tt)}initCustomEvent(){}};tt=new WeakMap;function Yo(t,i){return new et}var ar={document:{createElement:Yo},DocumentFragment,customElements:Ko,CustomEvent:ki,EventTarget:Ue,HTMLElement:et,HTMLVideoElement:Si},rr=typeof window=="undefined"||typeof globalThis.customElements=="undefined",M=rr?ar:globalThis,G=rr?ar.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",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},it={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"},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_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered"},ld=Object.entries(it).reduce((t,[i,e])=>{let a=o[i];return a&&(t[e]=a),t},{userinactivechange:"user-inactive"}),nr=Object.entries(o).reduce((t,[i,e])=>{let a=it[i];return a&&(t[e]=a),t},{"user-inactive":"userinactivechange"}),Oe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},ge={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Li={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Z={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"};var N={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:t=1}={})=>`current playback rate ${t}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},k={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:t=30}={})=>`seek forward ${t} seconds`,SEEK_BACK_N_SECS:({seekOffset:t=30}={})=>`seek back ${t} seconds`},Zo={...N,...k};var Qo=t=>typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t),or=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],qo=(t,i)=>{let e=t===1?or[i].singular:or[i].plural;return`${t} ${e}`},ve=t=>{if(!Qo(t))return"";let i=Math.abs(t),e=i!==t,a=new Date(0,0,0,0,0,i,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,c)=>l&&qo(l,c)).filter(l=>l).join(", ")}${e?" remaining":""}`};function z(t,i){let e=!1;t<0&&(e=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),n=Math.floor(t/3600),s=Math.floor(i/60%60),l=Math.floor(i/3600);return(isNaN(t)||t===1/0)&&(n=r=a="-"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(e?"-":"")+n+r+a}var sr={HTMLElement:function(){this.addEventListener=()=>{},this.removeEventListener=()=>{},this.dispatchEvent=()=>{}},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},jo={createElement:function(){return new sr.HTMLElement}},lr=typeof window=="undefined"||typeof window.customElements=="undefined",u=lr?sr:window,d=lr?jo:window.document;function p(t,i){u.customElements.get(t)||(u.customElements.define(t,i),u[i.name]=i)}var Xo=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},Ne=(t,i,e)=>(Xo(t,i,"read from private field"),e?e.call(t):i.get(t)),Ci=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Rt,at,wi,dr=d.createElement("template");dr.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  display: inline-flex;
@@ -50,12 +50,12 @@
50
50
  min-width: 100%;
51
51
  }
52
52
  </style>
53
- `;var Pt=class extends u.HTMLElement{constructor(i={}){super(),Ci(this,Rt,n=>{this.handleClick(n)}),Ci(this,at,n=>{let{key:s}=n;if(!this.keysUsed.includes(s)){this.removeEventListener("keyup",keyupListener);return}this.handleClick(n)}),Ci(this,wi,n=>{let{metaKey:s,altKey:l,key:c}=n;if(s||l||!this.keysUsed.includes(c)){this.removeEventListener("keyup",Oe(this,at));return}this.addEventListener("keyup",Oe(this,at),{once:!0})});let e=this.attachShadow({mode:"open"}),a=Xa.content.cloneNode(!0);this.nativeEl=a;let r=i.slotTemplate;r||(r=d.createElement("template"),r.innerHTML=`<slot>${i.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),e.appendChild(a),this.enable()}static get observedAttributes(){return["disabled",o.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",Oe(this,Rt)),this.addEventListener("keydown",Oe(this,wi)),this.setAttribute("tabindex",0)}disable(){this.removeEventListener("click",Oe(this,Rt)),this.removeEventListener("keyup",Oe(this,at)),this.removeAttribute("tabindex")}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else i==="disabled"&&a!==e&&(a==null?this.enable():this.disable())}connectedCallback(){var i;this.setAttribute("role","button");let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}get keysUsed(){return["Enter"," "]}handleClick(){}};Rt=new WeakMap;at=new WeakMap;wi=new WeakMap;p("media-chrome-button",Pt);var C=Pt;var Ho=`<svg aria-hidden="true" viewBox="0 0 26 24">
53
+ `;var Pt=class extends u.HTMLElement{constructor(i={}){super(),Ci(this,Rt,n=>{this.handleClick(n)}),Ci(this,at,n=>{let{key:s}=n;if(!this.keysUsed.includes(s)){this.removeEventListener("keyup",keyupListener);return}this.handleClick(n)}),Ci(this,wi,n=>{let{metaKey:s,altKey:l,key:c}=n;if(s||l||!this.keysUsed.includes(c)){this.removeEventListener("keyup",Ne(this,at));return}this.addEventListener("keyup",Ne(this,at),{once:!0})});let e=this.attachShadow({mode:"open"}),a=dr.content.cloneNode(!0);this.nativeEl=a;let r=i.slotTemplate;r||(r=d.createElement("template"),r.innerHTML=`<slot>${i.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),e.appendChild(a),this.enable()}static get observedAttributes(){return["disabled",o.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",Ne(this,Rt)),this.addEventListener("keydown",Ne(this,wi)),this.setAttribute("tabindex",0)}disable(){this.removeEventListener("click",Ne(this,Rt)),this.removeEventListener("keyup",Ne(this,at)),this.removeAttribute("tabindex")}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else i==="disabled"&&a!==e&&(a==null?this.enable():this.disable())}connectedCallback(){var i;this.setAttribute("role","button");let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}get keysUsed(){return["Enter"," "]}handleClick(){}};Rt=new WeakMap;at=new WeakMap;wi=new WeakMap;p("media-chrome-button",Pt);var C=Pt;var Jo=`<svg aria-hidden="true" viewBox="0 0 26 24">
54
54
  <path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
55
55
  </svg>
56
- `,Ja=d.createElement("template");Ja.innerHTML=`
57
- <slot name="airplay">${Ho}</slot>
58
- `;var Di=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(i={}){super({slotTemplate:Ja,...i})}connectedCallback(){this.setAttribute("aria-label",k.AIRPLAY()),super.connectedCallback()}handleClick(i){let e=new u.CustomEvent(h.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};p("media-airplay-button",Di);var Wo='<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>',Fo='<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>',tr=d.createElement("template");tr.innerHTML=`
56
+ `,cr=d.createElement("template");cr.innerHTML=`
57
+ <slot name="airplay">${Jo}</slot>
58
+ `;var Di=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(i={}){super({slotTemplate:cr,...i})}connectedCallback(){this.setAttribute("aria-label",k.AIRPLAY()),super.connectedCallback()}handleClick(i){let e=new u.CustomEvent(h.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};p("media-airplay-button",Di);var es='<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>',ts='<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>',mr=d.createElement("template");mr.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])) {
@@ -69,16 +69,16 @@
69
69
  }
70
70
  </style>
71
71
 
72
- <slot name="enter">${Wo}</slot>
73
- <slot name="exit">${Fo}</slot>
74
- `;var er=t=>{let e=t.getAttribute(o.MEDIA_IS_CASTING)!=null?k.EXIT_CAST():k.ENTER_CAST();t.setAttribute("aria-label",e)},xi=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(i={}){super({slotTemplate:tr,...i})}connectedCallback(){er(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_CASTING&&er(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_IS_CASTING)!=null?h.MEDIA_EXIT_CAST_REQUEST:h.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-cast-button",xi);var Ut=(t,i,e=".value")=>{let a=t.querySelector(e);!a||(a.textContent=i)},Ko=(t,i)=>{let e=`slot[name="${i}"]`,a=t.shadowRoot.querySelector(e);return a?a.children:[]},Ot=(t,i)=>Ko(t,i)[0],rt=(t,i)=>!t||!i?!1:t.contains(i)?!0:rt(t,i.getRootNode().host),Ri=(t,i)=>{if(!t)return null;let e=t.closest(i);return e||Ri(t.getRootNode().host,i)};function oe(t,i){var e,a;let r;for(r of t.querySelectorAll("style"))for(let n of(a=(e=r.sheet)==null?void 0:e.cssRules)!=null?a:[])if(n.selectorText===i)return n;return r!=null&&r.sheet?(r.sheet.insertRule(`${i}{}`,r.sheet.cssRules.length),r.sheet.cssRules[r.sheet.cssRules.length-1]):{style:{setProperty:()=>{}}}}var ar=d.createElement("template");ar.innerHTML=`
72
+ <slot name="enter">${es}</slot>
73
+ <slot name="exit">${ts}</slot>
74
+ `;var ur=t=>{let e=t.getAttribute(o.MEDIA_IS_CASTING)!=null?k.EXIT_CAST():k.ENTER_CAST();t.setAttribute("aria-label",e)},xi=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(i={}){super({slotTemplate:mr,...i})}connectedCallback(){ur(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_CASTING&&ur(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_IS_CASTING)!=null?h.MEDIA_EXIT_CAST_REQUEST:h.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-cast-button",xi);var Ut=(t,i,e=".value")=>{let a=t.querySelector(e);!a||(a.textContent=i)},is=(t,i)=>{let e=`slot[name="${i}"]`,a=t.shadowRoot.querySelector(e);return a?a.children:[]},Ot=(t,i)=>is(t,i)[0],rt=(t,i)=>!t||!i?!1:t.contains(i)?!0:rt(t,i.getRootNode().host),Ri=(t,i)=>{if(!t)return null;let e=t.closest(i);return e||Ri(t.getRootNode().host,i)};function oe(t,i){var e,a;let r;for(r of t.querySelectorAll("style"))for(let n of(a=(e=r.sheet)==null?void 0:e.cssRules)!=null?a:[])if(n.selectorText===i)return n;return r!=null&&r.sheet?(r.sheet.insertRule(`${i}{}`,r.sheet.cssRules.length),r.sheet.cssRules[r.sheet.cssRules.length-1]):{style:{setProperty:()=>{}}}}var pr=d.createElement("template");pr.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 Pi=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}constructor(i={}){super();let e=this.attachShadow({mode:"open"}),a=ar.content.cloneNode(!0);this.nativeEl=a;let r=i.slotTemplate;r||(r=d.createElement("template"),r.innerHTML=`<slot>${i.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),e.appendChild(a)}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var i;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0);let e=ir(this);this.getAttribute(o.MEDIA_CONTROLLER)&&((i=e==null?void 0:e.associateElement)==null||i.call(e,this)),e==null||e.addEventListener("pointerdown",this),e==null||e.addEventListener("click",this)}disconnectedCallback(){var i;let e=ir(this);this.getAttribute(o.MEDIA_CONTROLLER)&&((i=e==null?void 0:e.unassociateElement)==null||i.call(e,this)),e==null||e.removeEventListener("pointerdown",this),e==null||e.removeEventListener("click",this)}handleEvent(i){var e;let a=(e=i.composedPath())==null?void 0:e[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(i.type==="pointerdown")this._pointerType=i.pointerType;else if(i.type==="click"){let{clientX:n,clientY:s}=i,{left:l,top:c,width:m,height:f}=this.getBoundingClientRect(),y=n-l,S=s-c;if(y<0||S<0||y>m||S>f||m===0&&f===0)return;let{pointerType:_=this._pointerType}=i;if(this._pointerType=void 0,_===Li.TOUCH){this.handleTap(i);return}else if(_===Li.MOUSE){this.handleMouseClick(i);return}}}}handleTap(){}handleMouseClick(){let i=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(i,{composed:!0,bubbles:!0}))}};function ir(t){let i=t.getAttribute(o.MEDIA_CONTROLLER);return i?d.getElementById(i):Ri(t,"media-controller")}p("media-gesture-receiver",Pi);var rr=d.createElement("template");rr.innerHTML=`
81
+ `;var Pi=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}constructor(i={}){super();let e=this.attachShadow({mode:"open"}),a=pr.content.cloneNode(!0);this.nativeEl=a;let r=i.slotTemplate;r||(r=d.createElement("template"),r.innerHTML=`<slot>${i.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),e.appendChild(a)}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var i;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0);let e=hr(this);this.getAttribute(o.MEDIA_CONTROLLER)&&((i=e==null?void 0:e.associateElement)==null||i.call(e,this)),e==null||e.addEventListener("pointerdown",this),e==null||e.addEventListener("click",this)}disconnectedCallback(){var i;let e=hr(this);this.getAttribute(o.MEDIA_CONTROLLER)&&((i=e==null?void 0:e.unassociateElement)==null||i.call(e,this)),e==null||e.removeEventListener("pointerdown",this),e==null||e.removeEventListener("click",this)}handleEvent(i){var e;let a=(e=i.composedPath())==null?void 0:e[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(i.type==="pointerdown")this._pointerType=i.pointerType;else if(i.type==="click"){let{clientX:n,clientY:s}=i,{left:l,top:c,width:m,height:E}=this.getBoundingClientRect(),y=n-l,S=s-c;if(y<0||S<0||y>m||S>E||m===0&&E===0)return;let{pointerType:_=this._pointerType}=i;if(this._pointerType=void 0,_===Li.TOUCH){this.handleTap(i);return}else if(_===Li.MOUSE){this.handleMouseClick(i);return}}}}handleTap(){}handleMouseClick(){let i=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(i,{composed:!0,bubbles:!0}))}};function hr(t){let i=t.getAttribute(o.MEDIA_CONTROLLER);return i?d.getElementById(i):Ri(t,"media-controller")}p("media-gesture-receiver",Pi);var br=d.createElement("template");br.innerHTML=`
82
82
  <style>
83
83
 
84
84
  :host([media-is-fullscreen]) ::slotted([slot=media]) {
@@ -189,7 +189,7 @@
189
189
 
190
190
  <slot part="bottom chrome"></slot>
191
191
  </span>
192
- `;var Yo=Object.values(o),Nt=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(rr.content.cloneNode(!0));let i=n=>{let s=this.media;for(let l of n)l.type==="childList"&&(l.removedNodes.forEach(c=>{if(c.slot=="media"&&l.target==this){let m=l.previousSibling&&l.previousSibling.previousElementSibling;if(!m||!s)this.mediaUnsetCallback(c);else{let f=m.slot!=="media";for(;(m=m.previousSibling)!==null;)m.slot=="media"&&(f=!1);f&&this.mediaUnsetCallback(c)}}}),s&&l.addedNodes.forEach(c=>{c==s&&this.handleMediaUpdated(s).then(m=>this.mediaSetCallback(m))}))};new MutationObserver(i).observe(this,{childList:!0,subtree:!0});let a=this.media,r=this.querySelector(":scope > slot[slot=media]");r&&r.addEventListener("slotchange",()=>{if(!r.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(a);return}this.media&&(a=this.media,this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(Yo)}attributeChangedCallback(i,e,a){i.toLowerCase()=="autohide"&&(this.autohide=a)}get media(){let i=this.querySelector(":scope > [slot=media]");return(i==null?void 0:i.nodeName)=="SLOT"&&(i=i.assignedElements({flatten:!0})[0]),i}mediaSetCallback(i){this._mediaClickPlayToggle=()=>{let e=i.paused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}}handleMediaUpdated(i){let e=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(!i)return a(i);let r=i.nodeName.toLowerCase();return r.includes("-")?u.customElements.whenDefined(r).then(()=>e(i)):e(i)}mediaUnsetCallback(){}connectedCallback(){let e=this.getAttribute("audio")!=null?$.AUDIO_PLAYER():$.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",e),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 u.CustomEvent(it.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{this.removeAttribute("user-inactive");let s=new u.CustomEvent(it.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(s)},n=()=>{r(),u.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=u.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())}),this.addEventListener("pointermove",s=>{s.pointerType==="mouse"&&s.target!==this&&(r(),u.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(i){i=Number(i),this._autohide=isNaN(i)?0:i}get autohide(){return this._autohide===void 0?2:this._autohide}};p("media-container-temp",Nt);var nr=Nt;var or=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},O=(t,i,e)=>(or(t,i,"read from private field"),e?e.call(t):i.get(t)),Ui=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Oi=(t,i,e,a)=>(or(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),Ne,$e,W,$t=class{constructor(i,e){Ui(this,Ne,void 0),Ui(this,$e,void 0),Ui(this,W,[]),Oi(this,Ne,i),Oi(this,$e,e)}[Symbol.iterator](){return O(this,W).values()}get length(){return O(this,W).length}get value(){var i;return(i=O(this,W).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(Oi(this,W,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return O(this,W)[i]}values(){return O(this,W).values()}keys(){return O(this,W).keys()}forEach(i){O(this,W).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||O(this,W).push(r)}),!(this.value===""&&!((e=O(this,Ne))!=null&&e.hasAttribute(`${O(this,$e)}`)))&&((a=O(this,Ne))==null||a.setAttribute(`${O(this,$e)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{O(this,W).splice(O(this,W).indexOf(a),1)}),(e=O(this,Ne))==null||e.setAttribute(`${O(this,$e)}`,`${this.value}`)}contains(i){return O(this,W).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Ne=new WeakMap;$e=new WeakMap;W=new WeakMap;var w={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};d.fullscreenElement===void 0&&(w.enter="webkitRequestFullScreen",w.exit=d.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",w.event="webkitfullscreenchange",w.element="webkitFullscreenElement",w.error="webkitfullscreenerror",w.enabled="webkitFullscreenEnabled");function Bt(t,i=!1){return t.split("_").map(function(e,a){return(a||i?e[0].toUpperCase():e[0].toLowerCase())+e.slice(1).toLowerCase()}).join("")}var Ni=(t="")=>t.split(/\s+/),sr=(t="")=>{let[i,e]=t.split(":"),a=e?decodeURIComponent(e):void 0;return{language:i,label:a}},Go=(t="",i={})=>Ni(t).map(e=>{let a=sr(e);return{...i,...a}}),Zo=t=>Array.isArray(t)?t.map(i=>typeof i=="string"?sr(i):i):typeof t=="string"?Go(t):[t],Qo=({label:t,language:i}={})=>t?`${i}:${encodeURIComponent(t)}`:i,Q=(t=[])=>Array.prototype.map.call(t,Qo).join(" "),qo=(t,i)=>e=>e[t]===i,lr=t=>{let i=Object.entries(t).map(([e,a])=>qo(e,a));return e=>i.every(a=>a(e))},nt=(t,i=[],e=[])=>{let a=Zo(e).map(lr),r=n=>a.some(s=>s(n));Array.from(i).filter(r).forEach(n=>{n.mode=t})},Be=(t,i=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let e=typeof i=="function"?i:lr(i);return Array.from(t.textTracks).filter(e)},$i=t=>{let i=!!t.getAttribute(o.MEDIA_CAPTIONS_SHOWING),e=!t.hasAttribute("no-subtitles-fallback")&&!!t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return i||e},Vt=t=>{var i,e,a,r;if($i(t)){let s=t.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(s){let c=new window.CustomEvent(h.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});t.dispatchEvent(c)}let l=t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(l&&!t.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});t.dispatchEvent(c)}}else{let[s]=(e=Ni((i=t.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?i:""))!=null?e:[];if(s){let l=new window.CustomEvent(h.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});t.dispatchEvent(l)}else if(t.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[l]=(r=Ni((a=t.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?r:[];if(l){let c=new window.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});t.dispatchEvent(c)}}}};var ur=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},Ve=(t,i,e)=>(ur(t,i,"read from private field"),e?e.call(t):i.get(t)),Bi=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},He=(t,i,e)=>(ur(t,i,"access private method"),e),me,We,dt,Wt,Hi,mr=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],zo=10,Kt=class extends nr{constructor(){super(),Bi(this,We),Bi(this,Wt),Bi(this,me,new $t(this,"hotkeys")),ns||(this._airplayUnavailable=Z.UNSUPPORTED),cr||(this._fullscreenUnavailable=Z.UNAVAILABLE),os||(this._castUnavailable=Z.UNSUPPORTED),as||(this._pipUnavailable=Z.UNSUPPORTED),lt!==void 0?lt||(this._volumeUnavailable=Z.UNSUPPORTED):rs.then(()=>{lt||(this._volumeUnavailable=Z.UNSUPPORTED,this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associatedElements=[],this.associateElement(this);let i={MEDIA_PLAY_REQUEST:()=>this.media.play(),MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let e=this.media;e.muted=!1,e.volume===0&&(e.volume=.25)},MEDIA_VOLUME_REQUEST:e=>{let a=this.media,r=e.detail;a.volume=r,r>0&&a.muted&&(a.muted=!1);try{u.localStorage.setItem("media-chrome-pref-volume",r.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{if(!cr){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let e=this.media;d.pictureInPictureElement&&d.exitPictureInPicture(),super[w.enter]?super[w.enter]():e.webkitEnterFullscreen?e.webkitEnterFullscreen():e.requestFullscreen?e.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{d[w.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let e=this.media;if(!d.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!e.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}d[w.element]&&d[w.exit]();let a=r=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};e.requestPictureInPicture().catch(r=>{if(r.code===11)if(e.readyState===0&&e.preload==="none"){let n=function(){e.removeEventListener("loadedmetadata",s),e.preload="none"},s=function(){e.requestPictureInPicture().catch(a),n()};e.addEventListener("loadedmetadata",s),e.preload="metadata",setTimeout(()=>{e.readyState===0&&a(),n()},1e3)}else throw r;else throw r})},MEDIA_EXIT_PIP_REQUEST:()=>{d.pictureInPictureElement&&d.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var e;let a=this.media;!((e=globalThis.CastableVideoElement)!=null&&e.castEnabled)||(d[w.element]&&d[w.exit](),a.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var e;(e=globalThis.CastableVideoElement)!=null&&e.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:e=>{let a=this.media,r=e.detail;(a.readyState>0||a.readyState===void 0)&&(a.currentTime=r)},MEDIA_PLAYBACK_RATE_REQUEST:e=>{this.media.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:e=>{var a;let r=this.media;if(!r)return;let n=e.detail;n===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,n);let[s]=Be(r,{kind:Ue.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 l=Array.prototype.find.call(s.cues,y=>y.startTime>=n);if(!l)return;let c=/'^(?:[a-z]+:)?\/\//i.test(l.text)||(a=r.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,m=new URL(l.text,c),f=new URLSearchParams(m.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,m.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,f.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:e=>{let a=Ft(this),{detail:r=[]}=e;nt(fe.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:e=>{let a=Ft(this),{detail:r=[]}=e;nt(fe.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:e=>{let a=st(this),{detail:r=[]}=e;nt(fe.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:e=>{let a=st(this),{detail:r=[]}=e;nt(fe.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:e}=this;if(!!e){if(!(e.webkitShowPlaybackTargetPicker&&u.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}e.webkitShowPlaybackTargetPicker()}}};if(Object.keys(i).forEach(e=>{let a=`_handle${Bt(e,!0)}`;this[a]=r=>{if(r.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}i[e](r,this.media)},this.addEventListener(h[e],this[a])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(o.MEDIA_PAUSED,hr(this))},"playing,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((e=this.media)!=null&&e.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,pr(this)),this.propagateMediaState(o.MEDIA_VOLUME,br(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,Er(this))},[w.event]:e=>{let r=!!d[w.element]&&(e==null?void 0:e.target),n=rt(this,r);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,n)},"enterpictureinpicture,leavepictureinpicture":e=>{var a;let r;if(e)r=e.type=="enterpictureinpicture";else{let n=(a=this.getRootNode().pictureInPictureElement)!=null?a:d.pictureInPictureElement;r=this.media&&rt(this.media,n)}this.propagateMediaState(o.MEDIA_IS_PIP,r)},"entercast,leavecast,castchange":e=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,n=this.media&&rt(this.media,r);(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(n="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,n)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,fr(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,gr(this))},"loadedmetadata,emptied,progress":()=>{var e;this.propagateMediaState(o.MEDIA_SEEKABLE,(e=vr(this))==null?void 0:e.join(":"))},"progress,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_BUFFERED,ss((e=this.media)==null?void 0:e.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Ar(this))},"waiting,playing,emptied":()=>{var e;let a=((e=this.media)==null?void 0:e.readyState)<3;this.propagateMediaState(o.MEDIA_LOADING,a)}},this._airplayUnavailable!==Z.UNSUPPORTED){let e=a=>{(a==null?void 0:a.availability)==="available"?this._airplayUnavailable=void 0:(a==null?void 0:a.availability)==="not-available"&&(this._airplayUnavailable=Z.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=e}if(this._castUnavailable!==Z.UNSUPPORTED){let e=()=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castState;r!=null&&r.includes("CONNECT")?this._castUnavailable=void 0:this._castUnavailable=Z.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=e}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,Q(Ft(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,Q(st(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,Q(Wi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,Q(dr(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,Q(Wi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,Q(dr(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys")}attributeChangedCallback(i,e,a){i==="nohotkeys"?a!==e&&a===""?(this.hasAttribute("hotkeys")&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==e&&a===null&&this.enableHotkeys():i==="hotkeys"&&(Ve(this,me).value=a),super.attributeChangedCallback(i,e,a)}mediaSetCallback(i){super.mediaSetCallback(i),i.hasAttribute("tabindex")||i.setAttribute("tabindex",-1),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),r=this._mediaStatePropagators[e];a.forEach(n=>{(n==w.event?this.getRootNode():i).addEventListener(n,r)}),r()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(n=>{i.textTracks&&i.textTracks.addEventListener(n,a)}),a()});try{let e=u.localStorage.getItem("media-chrome-pref-volume");e!==null&&(i.volume=e)}catch(e){console.debug("Error getting volume pref",e)}}mediaUnsetCallback(i){super.mediaUnsetCallback(i),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),r=this._mediaStatePropagators[e];a.forEach(n=>{(n==w.event?this.getRootNode():i).removeEventListener(n,r)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(n=>{i.textTracks&&i.textTracks.removeEventListener(n,a)}),a()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(i,e){ve(this.mediaStateReceivers,i,e);let a=new u.CustomEvent(Qa[i],{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}associateElement(i){if(!i)return;let{associatedElementSubscriptions:e}=this;if(e.has(i))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=es(i,a,r);Object.keys(h).forEach(s=>{i.addEventListener(h[s],this[`_handle${Bt(s,!0)}`])}),e.set(i,n)}unassociateElement(i){if(!i)return;let{associatedElementSubscriptions:e}=this;if(!e.has(i))return;e.get(i)(),e.delete(i),Object.keys(h).forEach(r=>{i.removeEventListener(h[r],this[`_handle${Bt(r,!0)}`])})}registerMediaStateReceiver(i){if(!i)return;let e=this.mediaStateReceivers;e.indexOf(i)>-1||(e.push(i),ve([i],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),ve([i],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),ve([i],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),ve([i],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),ve([i],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||ve([i],o[r],Vi[o[r]]?Vi[o[r]](this):Vi.default(this,o[r]))}))}unregisterMediaStateReceiver(i){let e=this.mediaStateReceivers,a=e.indexOf(i);a<0||e.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",He(this,Wt,Hi))}disableHotkeys(){this.removeEventListener("keydown",He(this,Wt,Hi)),this.removeEventListener("keyup",He(this,We,dt))}get hotkeys(){return Ve(this,me)}keyboardShortcutHandler(i){var e,a,r,n;if(((n=(r=(e=i.target.getAttribute("keysused"))==null?void 0:e.split(" "))!=null?r:(a=i.target)==null?void 0:a.keysUsed)!=null?n:[]).map(_=>_==="Space"?" ":_).filter(Boolean).includes(i.key))return;let l,c,m,f,y,S=zo;if(!Ve(this,me).contains(`no${i.key.toLowerCase()}`)&&!(i.key===" "&&Ve(this,me).contains("nospace")))switch(i.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":Vt(this);break;case"ArrowLeft":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:DEFAULT_TIME,f=Math.max(m-S,0),y=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(y);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:DEFAULT_TIME,f=Math.max(m+S,0),y=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(y);break;default:break}}};me=new WeakMap;We=new WeakSet;dt=function(t){let{key:i}=t;if(!mr.includes(i)){this.removeEventListener("keyup",He(this,We,dt));return}this.keyboardShortcutHandler(t)};Wt=new WeakSet;Hi=function(t){let{metaKey:i,altKey:e,key:a}=t;if(i||e||!mr.includes(a)){this.removeEventListener("keyup",He(this,We,dt));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Ve(this,me).contains(`no${a.toLowerCase()}`)||a===" "&&Ve(this,me).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",He(this,We,dt),{once:!0})};var Vi={default(t,i){return t.getAttribute(i)},[o.MEDIA_CAPTIONS_LIST](t){return Q(Ft(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return Q(st(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return Q(st(t))||void 0},[o.MEDIA_CAPTIONS_SHOWING](t){return Q(Wi(t))||void 0},[o.MEDIA_PAUSED](t){return hr(t)},[o.MEDIA_MUTED](t){return pr(t)},[o.MEDIA_VOLUME](t){return br(t)},[o.MEDIA_VOLUME_LEVEL](t){return Er(t)},[o.MEDIA_CURRENT_TIME](t){return fr(t)},[o.MEDIA_DURATION](t){return gr(t)},[o.MEDIA_SEEKABLE](t){var i;return(i=vr(t))==null?void 0:i.join(":")},[o.MEDIA_PLAYBACK_RATE](t){return Ar(t)}},hr=t=>t.media?t.media.paused:!0,pr=t=>!!(t.media&&t.media.muted),br=t=>{let i=t.media;return i?i.volume:1},Er=t=>{let i="high";if(!t.media)return i;let{muted:e,volume:a}=t.media;return a===0||e?i="off":a<.5?i="low":a<.75&&(i="medium"),i},fr=t=>{let i=t.media;return i?i.currentTime:0},gr=t=>{let i=t==null?void 0:t.media;return Number.isFinite(i==null?void 0:i.duration)?i.duration:NaN},vr=t=>{var i;let e=t==null?void 0:t.media;if(!((i=e==null?void 0:e.seekable)!=null&&i.length))return;let a=e.seekable.start(0),r=e.seekable.end(e.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},Ar=t=>{let i=t.media;return i?i.playbackRate:1},st=t=>Be(t.media,{kind:Ue.SUBTITLES}),Ft=t=>Be(t.media,{kind:Ue.CAPTIONS}),dr=t=>Be(t.media,{kind:Ue.SUBTITLES,mode:fe.SHOWING}),Wi=t=>Be(t.media,{kind:Ue.CAPTIONS,mode:fe.SHOWING}),jo=Object.values(o),_r=t=>{var i,e,a,r;let{observedAttributes:n}=t.constructor;!n&&((i=t.nodeName)==null?void 0:i.includes("-"))&&(u.customElements.upgrade(t),{observedAttributes:n}=t.constructor);let s=(r=(a=(e=t==null?void 0:t.getAttribute)==null?void 0:e.call(t,o.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>jo.includes(l)):[]},Fi=t=>!!_r(t).length,Xo=async(t,i,e)=>(t.isConnected||await Tr(0),e==null?t.removeAttribute(i):typeof e=="boolean"?e?t.setAttribute(i,""):t.removeAttribute(i):Number.isNaN(e)?t.removeAttribute(i):t.setAttribute(i,e)),Jo=t=>{var i;return!!((i=t.closest)!=null&&i.call(t,'*[slot="media"]'))},ot=(t,i)=>{if(Jo(t))return;let e=(r,n)=>{var s,l;Fi(r)&&n(r);let{children:c=[]}=r!=null?r:{},m=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...c,...m].forEach(y=>ot(y,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Fi(t)){u.customElements.whenDefined(a).then(()=>{e(t,i)});return}e(t,i)},ve=(t,i,e)=>{t.forEach(a=>{!_r(a).includes(i)||Xo(a,i,e)})},es=(t,i,e)=>{ot(t,i);let a=c=>{var m;let f=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;i(f)},r=c=>{var m;let f=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(f)};t.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=c=>{c.forEach(m=>{let{addedNodes:f=[],removedNodes:y=[],type:S,target:_,attributeName:N}=m;S==="childList"?(Array.prototype.forEach.call(f,x=>ot(x,i)),Array.prototype.forEach.call(y,x=>ot(x,e))):S==="attributes"&&N===o.MEDIA_CHROME_ATTRIBUTES&&(Fi(_)?i(_):e(_))})},s=new MutationObserver(n);return s.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{ot(t,e),s.disconnect(),t.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Ht,yr=()=>{var t,i;return Ht||(Ht=(i=(t=d)==null?void 0:t.createElement)==null?void 0:i.call(t,"video"),Ht)},ts=async(t=yr())=>{if(!t)return!1;let i=t.volume;return t.volume=i/2+.1,await Tr(0),t.volume!==i},Tr=t=>new Promise(i=>setTimeout(i,t)),is=(t=yr())=>typeof(t==null?void 0:t.requestPictureInPicture)=="function",as=is(),lt,rs=ts().then(t=>(lt=t,lt)),ns=!!u.WebKitPlaybackTargetAvailabilityEvent,os=!!u.chrome,cr=d[w.enabled];function ss(t=[]){return Array.from(t).map((i,e)=>[Number(t.start(e).toFixed(3)),Number(t.end(e).toFixed(3))].join(":")).join(" ")}p("media-controller",Kt);var ct=Kt;var Mr=d.createElement("template"),Ir=`
192
+ `;var as=Object.values(o),Nt=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(br.content.cloneNode(!0));let i=n=>{let s=this.media;for(let l of n)l.type==="childList"&&(l.removedNodes.forEach(c=>{if(c.slot=="media"&&l.target==this){let m=l.previousSibling&&l.previousSibling.previousElementSibling;if(!m||!s)this.mediaUnsetCallback(c);else{let E=m.slot!=="media";for(;(m=m.previousSibling)!==null;)m.slot=="media"&&(E=!1);E&&this.mediaUnsetCallback(c)}}}),s&&l.addedNodes.forEach(c=>{c==s&&this.handleMediaUpdated(s).then(m=>this.mediaSetCallback(m))}))};new MutationObserver(i).observe(this,{childList:!0,subtree:!0});let a=this.media,r=this.querySelector(":scope > slot[slot=media]");r&&r.addEventListener("slotchange",()=>{if(!r.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(a);return}this.media&&(a=this.media,this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(as)}attributeChangedCallback(i,e,a){i.toLowerCase()=="autohide"&&(this.autohide=a)}get media(){let i=this.querySelector(":scope > [slot=media]");return(i==null?void 0:i.nodeName)=="SLOT"&&(i=i.assignedElements({flatten:!0})[0]),i}mediaSetCallback(i){this._mediaClickPlayToggle=()=>{let e=i.paused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}}handleMediaUpdated(i){let e=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(!i)return a(i);let r=i.nodeName.toLowerCase();return r.includes("-")?u.customElements.whenDefined(r).then(()=>e(i)):e(i)}mediaUnsetCallback(){}connectedCallback(){let e=this.getAttribute("audio")!=null?N.AUDIO_PLAYER():N.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",e),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 u.CustomEvent(it.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{this.removeAttribute("user-inactive");let s=new u.CustomEvent(it.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(s)},n=()=>{r(),u.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=u.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())}),this.addEventListener("pointermove",s=>{s.pointerType==="mouse"&&s.target!==this&&(r(),u.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(i){i=Number(i),this._autohide=isNaN(i)?0:i}get autohide(){return this._autohide===void 0?2:this._autohide}};p("media-container-temp",Nt);var Er=Nt;var fr=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},U=(t,i,e)=>(fr(t,i,"read from private field"),e?e.call(t):i.get(t)),Ui=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Oi=(t,i,e,a)=>(fr(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),$e,Be,W,$t=class{constructor(i,e){Ui(this,$e,void 0),Ui(this,Be,void 0),Ui(this,W,[]),Oi(this,$e,i),Oi(this,Be,e)}[Symbol.iterator](){return U(this,W).values()}get length(){return U(this,W).length}get value(){var i;return(i=U(this,W).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(Oi(this,W,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return U(this,W)[i]}values(){return U(this,W).values()}keys(){return U(this,W).keys()}forEach(i){U(this,W).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||U(this,W).push(r)}),!(this.value===""&&!((e=U(this,$e))!=null&&e.hasAttribute(`${U(this,Be)}`)))&&((a=U(this,$e))==null||a.setAttribute(`${U(this,Be)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{U(this,W).splice(U(this,W).indexOf(a),1)}),(e=U(this,$e))==null||e.setAttribute(`${U(this,Be)}`,`${this.value}`)}contains(i){return U(this,W).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};$e=new WeakMap;Be=new WeakMap;W=new WeakMap;var w={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};d.fullscreenElement===void 0&&(w.enter="webkitRequestFullScreen",w.exit=d.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",w.event="webkitfullscreenchange",w.element="webkitFullscreenElement",w.error="webkitfullscreenerror",w.enabled="webkitFullscreenEnabled");function Bt(t,i=!1){return t.split("_").map(function(e,a){return(a||i?e[0].toUpperCase():e[0].toLowerCase())+e.slice(1).toLowerCase()}).join("")}var Ni=(t="")=>t.split(/\s+/),gr=(t="")=>{let[i,e]=t.split(":"),a=e?decodeURIComponent(e):void 0;return{language:i,label:a}},rs=(t="",i={})=>Ni(t).map(e=>{let a=gr(e);return{...i,...a}}),ns=t=>Array.isArray(t)?t.map(i=>typeof i=="string"?gr(i):i):typeof t=="string"?rs(t):[t],os=({label:t,language:i}={})=>t?`${i}:${encodeURIComponent(t)}`:i,Q=(t=[])=>Array.prototype.map.call(t,os).join(" "),ss=(t,i)=>e=>e[t]===i,vr=t=>{let i=Object.entries(t).map(([e,a])=>ss(e,a));return e=>i.every(a=>a(e))},nt=(t,i=[],e=[])=>{let a=ns(e).map(vr),r=n=>a.some(s=>s(n));Array.from(i).filter(r).forEach(n=>{n.mode=t})},Ve=(t,i=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let e=typeof i=="function"?i:vr(i);return Array.from(t.textTracks).filter(e)},$i=t=>{let i=!!t.getAttribute(o.MEDIA_CAPTIONS_SHOWING),e=!t.hasAttribute("no-subtitles-fallback")&&!!t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return i||e},Vt=t=>{var i,e,a,r;if($i(t)){let s=t.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(s){let c=new window.CustomEvent(h.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});t.dispatchEvent(c)}let l=t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(l&&!t.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});t.dispatchEvent(c)}}else{let[s]=(e=Ni((i=t.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?i:""))!=null?e:[];if(s){let l=new window.CustomEvent(h.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});t.dispatchEvent(l)}else if(t.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[l]=(r=Ni((a=t.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?r:[];if(l){let c=new window.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});t.dispatchEvent(c)}}}};var yr=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},He=(t,i,e)=>(yr(t,i,"read from private field"),e?e.call(t):i.get(t)),Bi=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},We=(t,i,e)=>(yr(t,i,"access private method"),e),he,Fe,dt,Wt,Hi,Tr=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],ls=10,Kt=class extends Er{constructor(){super(),Bi(this,Fe),Bi(this,Wt),Bi(this,he,new $t(this,"hotkeys")),fs||(this._airplayUnavailable=Z.UNSUPPORTED),_r||(this._fullscreenUnavailable=Z.UNAVAILABLE),gs||(this._castUnavailable=Z.UNSUPPORTED),bs||(this._pipUnavailable=Z.UNSUPPORTED),lt!==void 0?lt||(this._volumeUnavailable=Z.UNSUPPORTED):Es.then(()=>{lt||(this._volumeUnavailable=Z.UNSUPPORTED,this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associatedElements=[],this.associateElement(this);let i={MEDIA_PLAY_REQUEST:()=>this.media.play(),MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let e=this.media;e.muted=!1,e.volume===0&&(e.volume=.25)},MEDIA_VOLUME_REQUEST:e=>{let a=this.media,r=e.detail;a.volume=r,r>0&&a.muted&&(a.muted=!1);try{u.localStorage.setItem("media-chrome-pref-volume",r.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{if(!_r){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let e=this.media;d.pictureInPictureElement&&d.exitPictureInPicture(),super[w.enter]?super[w.enter]():e.webkitEnterFullscreen?e.webkitEnterFullscreen():e.requestFullscreen?e.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{d[w.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let e=this.media;if(!d.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!e.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}d[w.element]&&d[w.exit]();let a=r=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};e.requestPictureInPicture().catch(r=>{if(r.code===11)if(e.readyState===0&&e.preload==="none"){let n=function(){e.removeEventListener("loadedmetadata",s),e.preload="none"},s=function(){e.requestPictureInPicture().catch(a),n()};e.addEventListener("loadedmetadata",s),e.preload="metadata",setTimeout(()=>{e.readyState===0&&a(),n()},1e3)}else throw r;else throw r})},MEDIA_EXIT_PIP_REQUEST:()=>{d.pictureInPictureElement&&d.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var e;let a=this.media;!((e=globalThis.CastableVideoElement)!=null&&e.castEnabled)||(d[w.element]&&d[w.exit](),a.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var e;(e=globalThis.CastableVideoElement)!=null&&e.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:e=>{let a=this.media,r=e.detail;(a.readyState>0||a.readyState===void 0)&&(a.currentTime=r)},MEDIA_PLAYBACK_RATE_REQUEST:e=>{this.media.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:e=>{var a;let r=this.media;if(!r)return;let n=e.detail;n===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,n);let[s]=Ve(r,{kind:Oe.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 l=Array.prototype.find.call(s.cues,y=>y.startTime>=n);if(!l)return;let c=/'^(?:[a-z]+:)?\/\//i.test(l.text)||(a=r.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,m=new URL(l.text,c),E=new URLSearchParams(m.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,m.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,E.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:e=>{let a=Ft(this),{detail:r=[]}=e;nt(ge.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:e=>{let a=Ft(this),{detail:r=[]}=e;nt(ge.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:e=>{let a=st(this),{detail:r=[]}=e;nt(ge.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:e=>{let a=st(this),{detail:r=[]}=e;nt(ge.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:e}=this;if(!!e){if(!(e.webkitShowPlaybackTargetPicker&&u.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}e.webkitShowPlaybackTargetPicker()}}};if(Object.keys(i).forEach(e=>{let a=`_handle${Bt(e,!0)}`;this[a]=r=>{if(r.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}i[e](r,this.media)},this.addEventListener(h[e],this[a])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(o.MEDIA_PAUSED,Ir(this))},"playing,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((e=this.media)!=null&&e.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,Mr(this)),this.propagateMediaState(o.MEDIA_VOLUME,Sr(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,kr(this))},[w.event]:e=>{let r=!!d[w.element]&&(e==null?void 0:e.target),n=rt(this,r);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,n)},"enterpictureinpicture,leavepictureinpicture":e=>{var a;let r;if(e)r=e.type=="enterpictureinpicture";else{let n=(a=this.getRootNode().pictureInPictureElement)!=null?a:d.pictureInPictureElement;r=this.media&&rt(this.media,n)}this.propagateMediaState(o.MEDIA_IS_PIP,r)},"entercast,leavecast,castchange":e=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,n=this.media&&rt(this.media,r);(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(n="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,n)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,Lr(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,Cr(this))},"loadedmetadata,emptied,progress":()=>{var e;this.propagateMediaState(o.MEDIA_SEEKABLE,(e=wr(this))==null?void 0:e.join(":"))},"progress,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_BUFFERED,vs((e=this.media)==null?void 0:e.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Dr(this))},"waiting,playing,emptied":()=>{var e;let a=((e=this.media)==null?void 0:e.readyState)<3;this.propagateMediaState(o.MEDIA_LOADING,a)}},this._airplayUnavailable!==Z.UNSUPPORTED){let e=a=>{(a==null?void 0:a.availability)==="available"?this._airplayUnavailable=void 0:(a==null?void 0:a.availability)==="not-available"&&(this._airplayUnavailable=Z.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=e}if(this._castUnavailable!==Z.UNSUPPORTED){let e=()=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castState;r!=null&&r.includes("CONNECT")?this._castUnavailable=void 0:this._castUnavailable=Z.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=e}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,Q(Ft(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,Q(st(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,Q(Wi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,Q(Ar(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,Q(Wi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,Q(Ar(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys")}attributeChangedCallback(i,e,a){i==="nohotkeys"?a!==e&&a===""?(this.hasAttribute("hotkeys")&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==e&&a===null&&this.enableHotkeys():i==="hotkeys"&&(He(this,he).value=a),super.attributeChangedCallback(i,e,a)}mediaSetCallback(i){super.mediaSetCallback(i),i.hasAttribute("tabindex")||i.setAttribute("tabindex",-1),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),r=this._mediaStatePropagators[e];a.forEach(n=>{(n==w.event?this.getRootNode():i).addEventListener(n,r)}),r()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(n=>{i.textTracks&&i.textTracks.addEventListener(n,a)}),a()});try{let e=u.localStorage.getItem("media-chrome-pref-volume");e!==null&&(i.volume=e)}catch(e){console.debug("Error getting volume pref",e)}}mediaUnsetCallback(i){super.mediaUnsetCallback(i),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),r=this._mediaStatePropagators[e];a.forEach(n=>{(n==w.event?this.getRootNode():i).removeEventListener(n,r)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(n=>{i.textTracks&&i.textTracks.removeEventListener(n,a)}),a()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(i,e){Ae(this.mediaStateReceivers,i,e);let a=new u.CustomEvent(nr[i],{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}associateElement(i){if(!i)return;let{associatedElementSubscriptions:e}=this;if(e.has(i))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=ms(i,a,r);Object.keys(h).forEach(s=>{i.addEventListener(h[s],this[`_handle${Bt(s,!0)}`])}),e.set(i,n)}unassociateElement(i){if(!i)return;let{associatedElementSubscriptions:e}=this;if(!e.has(i))return;e.get(i)(),e.delete(i),Object.keys(h).forEach(r=>{i.removeEventListener(h[r],this[`_handle${Bt(r,!0)}`])})}registerMediaStateReceiver(i){if(!i)return;let e=this.mediaStateReceivers;e.indexOf(i)>-1||(e.push(i),Ae([i],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Ae([i],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Ae([i],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Ae([i],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Ae([i],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||Ae([i],o[r],Vi[o[r]]?Vi[o[r]](this):Vi.default(this,o[r]))}))}unregisterMediaStateReceiver(i){let e=this.mediaStateReceivers,a=e.indexOf(i);a<0||e.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",We(this,Wt,Hi))}disableHotkeys(){this.removeEventListener("keydown",We(this,Wt,Hi)),this.removeEventListener("keyup",We(this,Fe,dt))}get hotkeys(){return He(this,he)}keyboardShortcutHandler(i){var e,a,r,n;if(((n=(r=(e=i.target.getAttribute("keysused"))==null?void 0:e.split(" "))!=null?r:(a=i.target)==null?void 0:a.keysUsed)!=null?n:[]).map(_=>_==="Space"?" ":_).filter(Boolean).includes(i.key))return;let l,c,m,E,y,S=ls;if(!He(this,he).contains(`no${i.key.toLowerCase()}`)&&!(i.key===" "&&He(this,he).contains("nospace")))switch(i.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":Vt(this);break;case"ArrowLeft":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:DEFAULT_TIME,E=Math.max(m-S,0),y=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(y);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:DEFAULT_TIME,E=Math.max(m+S,0),y=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(y);break;default:break}}};he=new WeakMap;Fe=new WeakSet;dt=function(t){let{key:i}=t;if(!Tr.includes(i)){this.removeEventListener("keyup",We(this,Fe,dt));return}this.keyboardShortcutHandler(t)};Wt=new WeakSet;Hi=function(t){let{metaKey:i,altKey:e,key:a}=t;if(i||e||!Tr.includes(a)){this.removeEventListener("keyup",We(this,Fe,dt));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(He(this,he).contains(`no${a.toLowerCase()}`)||a===" "&&He(this,he).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",We(this,Fe,dt),{once:!0})};var Vi={default(t,i){return t.getAttribute(i)},[o.MEDIA_CAPTIONS_LIST](t){return Q(Ft(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return Q(st(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return Q(st(t))||void 0},[o.MEDIA_CAPTIONS_SHOWING](t){return Q(Wi(t))||void 0},[o.MEDIA_PAUSED](t){return Ir(t)},[o.MEDIA_MUTED](t){return Mr(t)},[o.MEDIA_VOLUME](t){return Sr(t)},[o.MEDIA_VOLUME_LEVEL](t){return kr(t)},[o.MEDIA_CURRENT_TIME](t){return Lr(t)},[o.MEDIA_DURATION](t){return Cr(t)},[o.MEDIA_SEEKABLE](t){var i;return(i=wr(t))==null?void 0:i.join(":")},[o.MEDIA_PLAYBACK_RATE](t){return Dr(t)}},Ir=t=>t.media?t.media.paused:!0,Mr=t=>!!(t.media&&t.media.muted),Sr=t=>{let i=t.media;return i?i.volume:1},kr=t=>{let i="high";if(!t.media)return i;let{muted:e,volume:a}=t.media;return a===0||e?i="off":a<.5?i="low":a<.75&&(i="medium"),i},Lr=t=>{let i=t.media;return i?i.currentTime:0},Cr=t=>{let i=t==null?void 0:t.media;return Number.isFinite(i==null?void 0:i.duration)?i.duration:NaN},wr=t=>{var i;let e=t==null?void 0:t.media;if(!((i=e==null?void 0:e.seekable)!=null&&i.length))return;let a=e.seekable.start(0),r=e.seekable.end(e.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},Dr=t=>{let i=t.media;return i?i.playbackRate:1},st=t=>Ve(t.media,{kind:Oe.SUBTITLES}),Ft=t=>Ve(t.media,{kind:Oe.CAPTIONS}),Ar=t=>Ve(t.media,{kind:Oe.SUBTITLES,mode:ge.SHOWING}),Wi=t=>Ve(t.media,{kind:Oe.CAPTIONS,mode:ge.SHOWING}),ds=Object.values(o),xr=t=>{var i,e,a,r;let{observedAttributes:n}=t.constructor;!n&&((i=t.nodeName)==null?void 0:i.includes("-"))&&(u.customElements.upgrade(t),{observedAttributes:n}=t.constructor);let s=(r=(a=(e=t==null?void 0:t.getAttribute)==null?void 0:e.call(t,o.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>ds.includes(l)):[]},Fi=t=>!!xr(t).length,cs=async(t,i,e)=>(t.isConnected||await Pr(0),e==null?t.removeAttribute(i):typeof e=="boolean"?e?t.setAttribute(i,""):t.removeAttribute(i):Number.isNaN(e)?t.removeAttribute(i):t.setAttribute(i,e)),us=t=>{var i;return!!((i=t.closest)!=null&&i.call(t,'*[slot="media"]'))},ot=(t,i)=>{if(us(t))return;let e=(r,n)=>{var s,l;Fi(r)&&n(r);let{children:c=[]}=r!=null?r:{},m=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...c,...m].forEach(y=>ot(y,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Fi(t)){u.customElements.whenDefined(a).then(()=>{e(t,i)});return}e(t,i)},Ae=(t,i,e)=>{t.forEach(a=>{!xr(a).includes(i)||cs(a,i,e)})},ms=(t,i,e)=>{ot(t,i);let a=c=>{var m;let E=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;i(E)},r=c=>{var m;let E=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(E)};t.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=c=>{c.forEach(m=>{let{addedNodes:E=[],removedNodes:y=[],type:S,target:_,attributeName:O}=m;S==="childList"?(Array.prototype.forEach.call(E,x=>ot(x,i)),Array.prototype.forEach.call(y,x=>ot(x,e))):S==="attributes"&&O===o.MEDIA_CHROME_ATTRIBUTES&&(Fi(_)?i(_):e(_))})},s=new MutationObserver(n);return s.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{ot(t,e),s.disconnect(),t.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Ht,Rr=()=>{var t,i;return Ht||(Ht=(i=(t=d)==null?void 0:t.createElement)==null?void 0:i.call(t,"video"),Ht)},hs=async(t=Rr())=>{if(!t)return!1;let i=t.volume;return t.volume=i/2+.1,await Pr(0),t.volume!==i},Pr=t=>new Promise(i=>setTimeout(i,t)),ps=(t=Rr())=>typeof(t==null?void 0:t.requestPictureInPicture)=="function",bs=ps(),lt,Es=hs().then(t=>(lt=t,lt)),fs=!!u.WebKitPlaybackTargetAvailabilityEvent,gs=!!u.chrome,_r=d[w.enabled];function vs(t=[]){return Array.from(t).map((i,e)=>[Number(t.start(e).toFixed(3)),Number(t.end(e).toFixed(3))].join(":")).join(" ")}p("media-controller",Kt);var ct=Kt;var Or=d.createElement("template"),Ur=`
193
193
  height: var(--thumb-height);
194
194
  width: var(--media-range-thumb-width, 10px);
195
195
  border: var(--media-range-thumb-border, none);
@@ -211,7 +211,7 @@
211
211
  transition: var(--media-range-track-transition, none);
212
212
  transform: translate(var(--media-range-track-translate-x, 0), var(--media-range-track-translate-y, 0));
213
213
  cursor: pointer;
214
- `;Mr.innerHTML=`
214
+ `;Or.innerHTML=`
215
215
  <style>
216
216
  :host {
217
217
  --thumb-height: var(--media-range-thumb-height, 10px);
@@ -257,14 +257,14 @@
257
257
 
258
258
  input[type=range]::-webkit-slider-thumb {
259
259
  -webkit-appearance: none;
260
- ${Ir}
260
+ ${Ur}
261
261
 
262
262
  margin-top: calc(calc(0px - var(--thumb-height) + var(--track-height)) / 2);
263
263
  }
264
264
 
265
265
 
266
266
  input[type=range]::-moz-range-thumb {
267
- ${Ir}
267
+ ${Ur}
268
268
  translate: var(--media-range-track-translate-x, 0) var(--media-range-track-translate-y, 0);
269
269
  }
270
270
 
@@ -358,7 +358,7 @@
358
358
  <div id="pointer"></div>
359
359
  <div id="hoverzone"></div>
360
360
  <input id="range" type="range" min="0" max="1000" step="any" value="0">
361
- `;var Gt=class extends u.HTMLElement{static get observedAttributes(){return["disabled","aria-disabled",o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Mr.content.cloneNode(!0)),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this))}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else(i==="disabled"||i==="aria-disabled"&&e!==a)&&(a==null?this.range.removeAttribute(i):this.range.setAttribute(i,a))}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}this.updateBar()}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}updatePointerBar(i){let e=this.range.getBoundingClientRect(),a=(i.clientX-e.left)/e.width;a=Math.max(0,Math.min(1,a));let{style:r}=oe(this.shadowRoot,"#pointer");r.setProperty("width",`${a*e.width}px`)}updateBar(){let i=this.getBarColors(),e="linear-gradient(to right, ",a=0;i.forEach(n=>{n[1]<a||(e=e+`${n[0]} ${a}%, ${n[0]} ${n[1]}%,`,a=n[1])}),e=e.slice(0,e.length-1)+")";let{style:r}=oe(this.shadowRoot,":host");r.setProperty("--media-range-track-progress-internal",e)}getBarColors(){let i=this.range,e=i.value-i.min,a=i.max-i.min,r=e/a*100,n=0;if(i.value>i.min&&i.value<i.max){let l=getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10px";n=parseInt(l)*(.5-r/100)/i.offsetWidth*100}return[["var(--media-range-bar-color, #fff)",r+n],["transparent",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};p("media-chrome-range",Gt);var ut=Gt;var Sr=d.createElement("template");Sr.innerHTML=`
361
+ `;var Gt=class extends u.HTMLElement{static get observedAttributes(){return["disabled","aria-disabled",o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Or.content.cloneNode(!0)),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this))}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else(i==="disabled"||i==="aria-disabled"&&e!==a)&&(a==null?this.range.removeAttribute(i):this.range.setAttribute(i,a))}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}this.updateBar()}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}updatePointerBar(i){let e=this.range.getBoundingClientRect(),a=(i.clientX-e.left)/e.width;a=Math.max(0,Math.min(1,a));let{style:r}=oe(this.shadowRoot,"#pointer");r.setProperty("width",`${a*e.width}px`)}updateBar(){let i=this.getBarColors(),e="linear-gradient(to right, ",a=0;i.forEach(n=>{n[1]<a||(e=e+`${n[0]} ${a}%, ${n[0]} ${n[1]}%,`,a=n[1])}),e=e.slice(0,e.length-1)+")";let{style:r}=oe(this.shadowRoot,":host");r.setProperty("--media-range-track-progress-internal",e)}getBarColors(){let i=this.range,e=i.value-i.min,a=i.max-i.min,r=e/a*100,n=0;if(i.value>i.min&&i.value<i.max){let l=getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10px";n=parseInt(l)*(.5-r/100)/i.offsetWidth*100}return[["var(--media-range-bar-color, #fff)",r+n],["transparent",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};p("media-chrome-range",Gt);var ut=Gt;var Nr=d.createElement("template");Nr.innerHTML=`
362
362
  <style>
363
363
  :host {
364
364
 
@@ -377,7 +377,7 @@
377
377
  </style>
378
378
 
379
379
  <slot></slot>
380
- `;var Ki=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Sr.content.cloneNode(!0))}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-control-bar",Ki);var kr=d.createElement("template");kr.innerHTML=`
380
+ `;var Ki=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Nr.content.cloneNode(!0))}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-control-bar",Ki);var $r=d.createElement("template");$r.innerHTML=`
381
381
  <style>
382
382
  :host {
383
383
  display: inline-flex;
@@ -412,11 +412,11 @@
412
412
  <span id="container">
413
413
  <slot></slot>
414
414
  </span>
415
- `;var Zt=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(kr.content.cloneNode(!0)),this.container=this.shadowRoot.querySelector("#container")}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-text-display",Zt);var he=Zt;var Yi=class extends he{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}attributeChangedCallback(i,e,a){i===o.MEDIA_CURRENT_TIME&&(this.container.innerHTML=z(a)),super.attributeChangedCallback(i,e,a)}};p("media-current-time-display",Yi);var Gi=class extends he{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(i,e,a){i===o.MEDIA_DURATION&&(this.container.innerHTML=z(a)),super.attributeChangedCallback(i,e,a)}};p("media-duration-display",Gi);var ls="&nbsp;/&nbsp;",ds=(t,{timesSep:i=ls}={})=>{var e,a,r;let n=t.getAttribute("remaining")!=null,s=t.getAttribute("show-duration")!=null,l=(e=t.mediaCurrentTime)!=null?e:0,c=(r=(a=t.mediaDuration)!=null?a:t.mediaSeekableEnd)!=null?r:0,m=n?z(0-(c-l)):z(l);return s?`${m}${i}${z(c)}`:m},cs="video not loaded, unknown time.",us=t=>{let i=t.mediaCurrentTime,e=t.mediaDuration||t.mediaSeekableEnd;if(i==null||e==null){t.setAttribute("aria-valuetext",cs);return}let a=t.hasAttribute("remaining"),r=t.hasAttribute("show-duration"),n=a?ge(0-(e-i)):ge(i);if(!r){t.setAttribute("aria-valuetext",n);return}let s=ge(e),l=`${n} of ${s}`;t.setAttribute("aria-valuetext",l)},Zi=class extends he{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration","disabled"]}constructor(){super(),this.enable()}connectedCallback(){this.setAttribute("role","progressbar"),this.setAttribute("aria-label",$.PLAYBACK_TIME()),super.connectedCallback()}attributeChangedCallback(i,e,a){if([o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"].includes(i)){let r=ds(this);us(this),this.container.innerHTML=r}else i==="disabled"&&a!==e&&(a==null?this.enable():this.disable());super.attributeChangedCallback(i,e,a)}enable(){this.setAttribute("tabindex",0)}disable(){this.removeAttribute("tabindex")}get mediaDuration(){let i=this.getAttribute(o.MEDIA_DURATION);return i!=null?+i:void 0}get mediaCurrentTime(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME);return i!=null?+i:void 0}get mediaSeekable(){let i=this.getAttribute(o.MEDIA_SEEKABLE);if(!!i)return i.split(":").map(e=>+e)}get mediaSeekableEnd(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e}get mediaSeekableStart(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e}};p("media-time-display",Zi);var ms=`<svg aria-hidden="true" viewBox="0 0 26 24">
415
+ `;var Zt=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild($r.content.cloneNode(!0)),this.container=this.shadowRoot.querySelector("#container")}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-text-display",Zt);var pe=Zt;var Yi=class extends pe{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}attributeChangedCallback(i,e,a){i===o.MEDIA_CURRENT_TIME&&(this.container.innerHTML=z(a)),super.attributeChangedCallback(i,e,a)}};p("media-current-time-display",Yi);var Gi=class extends pe{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(i,e,a){i===o.MEDIA_DURATION&&(this.container.innerHTML=z(a)),super.attributeChangedCallback(i,e,a)}};p("media-duration-display",Gi);var As="&nbsp;/&nbsp;",_s=(t,{timesSep:i=As}={})=>{var e,a,r;let n=t.getAttribute("remaining")!=null,s=t.getAttribute("show-duration")!=null,l=(e=t.mediaCurrentTime)!=null?e:0,c=(r=(a=t.mediaDuration)!=null?a:t.mediaSeekableEnd)!=null?r:0,m=n?z(0-(c-l)):z(l);return s?`${m}${i}${z(c)}`:m},ys="video not loaded, unknown time.",Ts=t=>{let i=t.mediaCurrentTime,e=t.mediaDuration||t.mediaSeekableEnd;if(i==null||e==null){t.setAttribute("aria-valuetext",ys);return}let a=t.hasAttribute("remaining"),r=t.hasAttribute("show-duration"),n=a?ve(0-(e-i)):ve(i);if(!r){t.setAttribute("aria-valuetext",n);return}let s=ve(e),l=`${n} of ${s}`;t.setAttribute("aria-valuetext",l)},Zi=class extends pe{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration","disabled"]}constructor(){super(),this.enable()}connectedCallback(){this.setAttribute("role","progressbar"),this.setAttribute("aria-label",N.PLAYBACK_TIME()),super.connectedCallback()}attributeChangedCallback(i,e,a){if([o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"].includes(i)){let r=_s(this);Ts(this),this.container.innerHTML=r}else i==="disabled"&&a!==e&&(a==null?this.enable():this.disable());super.attributeChangedCallback(i,e,a)}enable(){this.setAttribute("tabindex",0)}disable(){this.removeAttribute("tabindex")}get mediaDuration(){let i=this.getAttribute(o.MEDIA_DURATION);return i!=null?+i:void 0}get mediaCurrentTime(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME);return i!=null?+i:void 0}get mediaSeekable(){let i=this.getAttribute(o.MEDIA_SEEKABLE);if(!!i)return i.split(":").map(e=>+e)}get mediaSeekableEnd(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e}get mediaSeekableStart(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e}};p("media-time-display",Zi);var Is=`<svg aria-hidden="true" viewBox="0 0 26 24">
416
416
  <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"/>
417
- </svg>`,hs=`<svg aria-hidden="true" viewBox="0 0 26 24">
417
+ </svg>`,Ms=`<svg aria-hidden="true" viewBox="0 0 26 24">
418
418
  <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
419
- </svg>`,Cr=d.createElement("template");Cr.innerHTML=`
419
+ </svg>`,Vr=d.createElement("template");Vr.innerHTML=`
420
420
  <style>
421
421
  :host([aria-checked="true"]) slot:not([name=on]) > *,
422
422
  :host([aria-checked="true"]) ::slotted(:not([slot=on])) {
@@ -430,15 +430,15 @@
430
430
  }
431
431
  </style>
432
432
 
433
- <slot name="on">${ms}</slot>
434
- <slot name="off">${hs}</slot>
435
- `;var Lr=t=>{t.setAttribute("aria-checked",$i(t))},Qi=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(i={}){super({slotTemplate:Cr,...i}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",$.CLOSED_CAPTIONS()),Lr(this)}attributeChangedCallback(i,e,a){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(i)&&Lr(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(i)){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(i,e,a)}handleClick(i){Vt(this)}};p("media-captions-button",Qi);var qi=30,ps=`<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)">${qi}</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>`,xr=d.createElement("template");xr.innerHTML=`
436
- <slot name="forward">${ps}</slot>
437
- `;var bs=0,wr=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=k.SEEK_FORWARD_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},Dr=t=>{let i=Ot(t,"forward"),e=t.getAttribute("seek-offset");Ut(i,e)},zi=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(i={}){super({slotTemplate:xr,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",qi),wr(this),Dr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",qi),Dr(this),wr(this)),super.attributeChangedCallback(i,e,a)}handleClick(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME),e=+this.getAttribute("seek-offset"),r=(i&&!Number.isNaN(+i)?+i:bs)+e,n=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};p("media-seek-forward-button",zi);var Es=`<svg aria-hidden="true" viewBox="0 0 26 24">
433
+ <slot name="on">${Is}</slot>
434
+ <slot name="off">${Ms}</slot>
435
+ `;var Br=t=>{t.setAttribute("aria-checked",$i(t))},Qi=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(i={}){super({slotTemplate:Vr,...i}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",N.CLOSED_CAPTIONS()),Br(this)}attributeChangedCallback(i,e,a){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(i)&&Br(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(i)){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(i,e,a)}handleClick(i){Vt(this)}};p("media-captions-button",Qi);var qi=30,Ss=`<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)">${qi}</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>`,Fr=d.createElement("template");Fr.innerHTML=`
436
+ <slot name="forward">${Ss}</slot>
437
+ `;var ks=0,Hr=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=k.SEEK_FORWARD_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},Wr=t=>{let i=Ot(t,"forward"),e=t.getAttribute("seek-offset");Ut(i,e)},zi=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(i={}){super({slotTemplate:Fr,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",qi),Hr(this),Wr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",qi),Wr(this),Hr(this)),super.attributeChangedCallback(i,e,a)}handleClick(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME),e=+this.getAttribute("seek-offset"),r=(i&&!Number.isNaN(+i)?+i:ks)+e,n=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};p("media-seek-forward-button",zi);var Ls=`<svg aria-hidden="true" viewBox="0 0 26 24">
438
438
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
439
- </svg>`,fs=`<svg aria-hidden="true" viewBox="0 0 26 24">
439
+ </svg>`,Cs=`<svg aria-hidden="true" viewBox="0 0 26 24">
440
440
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
441
- </svg>`,Pr=d.createElement("template");Pr.innerHTML=`
441
+ </svg>`,Yr=d.createElement("template");Yr.innerHTML=`
442
442
  <style>
443
443
  :host([${o.MEDIA_IS_FULLSCREEN}]) slot:not([name=exit]) > *,
444
444
  :host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted(:not([slot=exit])) {
@@ -452,15 +452,15 @@
452
452
  }
453
453
  </style>
454
454
 
455
- <slot name="enter">${Es}</slot>
456
- <slot name="exit">${fs}</slot>
457
- `;var Rr=t=>{let e=t.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?k.EXIT_FULLSCREEN():k.ENTER_FULLSCREEN();t.setAttribute("aria-label",e)},ji=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(i={}){super({slotTemplate:Pr,...i})}connectedCallback(){Rr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_FULLSCREEN&&Rr(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-fullscreen-button",ji);var gs=`<svg aria-hidden="true" viewBox="0 0 24 24">
455
+ <slot name="enter">${Ls}</slot>
456
+ <slot name="exit">${Cs}</slot>
457
+ `;var Kr=t=>{let e=t.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?k.EXIT_FULLSCREEN():k.ENTER_FULLSCREEN();t.setAttribute("aria-label",e)},ji=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(i={}){super({slotTemplate:Yr,...i})}connectedCallback(){Kr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_FULLSCREEN&&Kr(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-fullscreen-button",ji);var ws=`<svg aria-hidden="true" viewBox="0 0 24 24">
458
458
  <path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
459
- </svg>`,Ur=`<svg aria-hidden="true" viewBox="0 0 24 24">
459
+ </svg>`,Gr=`<svg aria-hidden="true" viewBox="0 0 24 24">
460
460
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
461
- </svg>`,vs=`<svg aria-hidden="true" viewBox="0 0 24 24">
461
+ </svg>`,Ds=`<svg aria-hidden="true" viewBox="0 0 24 24">
462
462
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
463
- </svg>`,Nr=d.createElement("template");Nr.innerHTML=`
463
+ </svg>`,Qr=d.createElement("template");Qr.innerHTML=`
464
464
  <style>
465
465
 
466
466
  :host(:not([${o.MEDIA_VOLUME_LEVEL}])) slot:not([name=high]) > *,
@@ -486,13 +486,13 @@
486
486
  }
487
487
  </style>
488
488
 
489
- <slot name="off">${gs}</slot>
490
- <slot name="low">${Ur}</slot>
491
- <slot name="medium">${Ur}</slot>
492
- <slot name="high">${vs}</slot>
493
- `;var Or=t=>{let e=t.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?k.UNMUTE():k.MUTE();t.setAttribute("aria-label",e)},Xi=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(i={}){super({slotTemplate:Nr,...i})}connectedCallback(){Or(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_VOLUME_LEVEL&&Or(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-mute-button",Xi);var $r=`<svg aria-hidden="true" viewBox="0 0 28 24">
489
+ <slot name="off">${ws}</slot>
490
+ <slot name="low">${Gr}</slot>
491
+ <slot name="medium">${Gr}</slot>
492
+ <slot name="high">${Ds}</slot>
493
+ `;var Zr=t=>{let e=t.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?k.UNMUTE():k.MUTE();t.setAttribute("aria-label",e)},Xi=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(i={}){super({slotTemplate:Qr,...i})}connectedCallback(){Zr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_VOLUME_LEVEL&&Zr(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-mute-button",Xi);var qr=`<svg aria-hidden="true" viewBox="0 0 28 24">
494
494
  <path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
495
- </svg>`,Vr=d.createElement("template");Vr.innerHTML=`
495
+ </svg>`,jr=d.createElement("template");jr.innerHTML=`
496
496
  <style>
497
497
  :host([${o.MEDIA_IS_PIP}]) slot:not([name=exit]) > *,
498
498
  :host([${o.MEDIA_IS_PIP}]) ::slotted(:not([slot=exit])) {
@@ -506,13 +506,13 @@
506
506
  }
507
507
  </style>
508
508
 
509
- <slot name="enter">${$r}</slot>
510
- <slot name="exit">${$r}</slot>
511
- `;var Br=t=>{let e=t.getAttribute(o.MEDIA_IS_PIP)!=null?k.EXIT_PIP():k.ENTER_PIP();t.setAttribute("aria-label",e)},Ji=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(i={}){super({slotTemplate:Vr,...i})}connectedCallback(){Br(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_PIP&&Br(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_IS_PIP)!=null?h.MEDIA_EXIT_PIP_REQUEST:h.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-pip-button",Ji);var As=`<svg aria-hidden="true" viewBox="0 0 24 24">
509
+ <slot name="enter">${qr}</slot>
510
+ <slot name="exit">${qr}</slot>
511
+ `;var zr=t=>{let e=t.getAttribute(o.MEDIA_IS_PIP)!=null?k.EXIT_PIP():k.ENTER_PIP();t.setAttribute("aria-label",e)},Ji=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(i={}){super({slotTemplate:jr,...i})}connectedCallback(){zr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_PIP&&zr(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_IS_PIP)!=null?h.MEDIA_EXIT_PIP_REQUEST:h.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-pip-button",Ji);var xs=`<svg aria-hidden="true" viewBox="0 0 24 24">
512
512
  <path d="m6 21 15-9L6 3v18Z"/>
513
- </svg>`,_s=`<svg aria-hidden="true" viewBox="0 0 24 24">
513
+ </svg>`,Rs=`<svg aria-hidden="true" viewBox="0 0 24 24">
514
514
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
515
- </svg>`,Wr=d.createElement("template");Wr.innerHTML=`
515
+ </svg>`,Jr=d.createElement("template");Jr.innerHTML=`
516
516
  <style>
517
517
  :host([${o.MEDIA_PAUSED}]) slot[name=pause] > *,
518
518
  :host([${o.MEDIA_PAUSED}]) ::slotted([slot=pause]) {
@@ -525,19 +525,16 @@
525
525
  }
526
526
  </style>
527
527
 
528
- <slot name="play">${As}</slot>
529
- <slot name="pause">${_s}</slot>
530
- `;var Hr=t=>{let e=t.getAttribute(o.MEDIA_PAUSED)!=null?k.PLAY():k.PAUSE();t.setAttribute("aria-label",e)},ea=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED]}constructor(i={}){super({slotTemplate:Wr,...i})}connectedCallback(){Hr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_PAUSED&&Hr(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-play-button",ea);var Fr=[1,1.25,1.5,1.75,2],Qt=1,Kr=d.createElement("template");Kr.innerHTML=`
528
+ <slot name="play">${xs}</slot>
529
+ <slot name="pause">${Rs}</slot>
530
+ `;var Xr=t=>{let e=t.getAttribute(o.MEDIA_PAUSED)!=null?k.PLAY():k.PAUSE();t.setAttribute("aria-label",e)},ea=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED]}constructor(i={}){super({slotTemplate:Jr,...i})}connectedCallback(){Xr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_PAUSED&&Xr(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-play-button",ea);var en=[1,1.25,1.5,1.75,2],Qt=1,tn=d.createElement("template");tn.innerHTML=`
531
531
  <span id="container"></span>
532
- `;var ta=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,"rates"]}constructor(i={}){super({slotTemplate:Kr,...i}),this._rates=Fr,this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${Qt}x`}attributeChangedCallback(i,e,a){if(i==="rates"){let r=(a!=null?a:"").trim().split(/\s*,?\s+/).map(n=>Number(n)).filter(n=>!Number.isNaN(n)).sort((n,s)=>n-s);this._rates=r.length?r:Fr;return}if(i===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Qt:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",$.PLAYBACK_RATE({playbackRate:n}));return}super.attributeChangedCallback(i,e,a)}handleClick(i){var e,a;let r=+this.getAttribute(o.MEDIA_PLAYBACK_RATE)||Qt,n=(a=(e=this._rates.find(l=>l>r))!=null?e:this._rates[0])!=null?a:Qt,s=new u.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(s)}};p("media-playback-rate-button",ta);var Yr=d.createElement("template");Yr.innerHTML=`
532
+ `;var ta=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,"rates"]}constructor(i={}){super({slotTemplate:tn,...i}),this._rates=en,this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${Qt}x`}attributeChangedCallback(i,e,a){if(i==="rates"){let r=(a!=null?a:"").trim().split(/\s*,?\s+/).map(n=>Number(n)).filter(n=>!Number.isNaN(n)).sort((n,s)=>n-s);this._rates=r.length?r:en;return}if(i===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Qt:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",N.PLAYBACK_RATE({playbackRate:n}));return}super.attributeChangedCallback(i,e,a)}handleClick(i){var e,a;let r=+this.getAttribute(o.MEDIA_PLAYBACK_RATE)||Qt,n=(a=(e=this._rates.find(l=>l>r))!=null?e:this._rates[0])!=null?a:Qt,s=new u.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(s)}};p("media-playback-rate-button",ta);var an=d.createElement("template");an.innerHTML=`
533
533
  <style>
534
534
  :host {
535
535
  pointer-events: none;
536
536
  display: inline-block;
537
537
  box-sizing: border-box;
538
-
539
- width: auto;
540
- height: auto;
541
538
  }
542
539
 
543
540
  img {
@@ -545,10 +542,11 @@
545
542
  max-height: 100%;
546
543
  min-width: 100%;
547
544
  min-height: 100%;
548
- background-size: contain;
549
- background-position: center;
550
545
  background-repeat: no-repeat;
551
- object-fit: contain;
546
+ background-position: var(--media-background-position, var(--media-object-position, center));
547
+ background-size: var(--media-background-size, var(--media-object-fit, contain));
548
+ object-fit: var(--media-object-fit, contain);
549
+ object-position: var(--media-object-position, center);
552
550
  }
553
551
 
554
552
  :host([${o.MEDIA_HAS_PLAYED}]) img {
@@ -557,7 +555,7 @@
557
555
  </style>
558
556
 
559
557
  <img aria-hidden="true" id="image"/>
560
- `;var ys=(t,i)=>{t.style["background-image"]=`url('${i}')`},ia=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_HAS_PLAYED,"placeholder-src","src"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Yr.content.cloneNode(!0)),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(i,e,a){i==="src"&&this.image.setAttribute("src",a),i==="placeholder-src"&&ys(this.image,a)}};p("media-poster-image",ia);var la=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},F=(t,i,e)=>(la(t,i,"read from private field"),e?e.call(t):i.get(t)),j=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},mt=(t,i,e,a)=>(la(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),aa=(t,i,e)=>(la(t,i,"access private method"),e),ht,qt,zt,Fe,pt,na,Xt,ei,jt,oa,sa,Zr,Ts="video not loaded, unknown time.",ra=t=>{let i=t.range,e=ge(+i.value),a=ge(+i.max),r=e&&a?`${e} of ${a}`:Ts;i.setAttribute("aria-valuetext",r)},Qr=d.createElement("template");Qr.innerHTML=`
558
+ `;var Ps=t=>{t.style.removeProperty("background-image")},Us=(t,i)=>{t.style["background-image"]=`url('${i}')`},ia=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_HAS_PLAYED,"placeholder-src","src"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(an.content.cloneNode(!0)),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(i,e,a){i==="src"&&(a==null?this.image.removeAttribute("src"):this.image.setAttribute("src",a)),i==="placeholder-src"&&(a==null?Ps(this.image):Us(this.image,a))}};p("media-poster-image",ia);var la=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},F=(t,i,e)=>(la(t,i,"read from private field"),e?e.call(t):i.get(t)),j=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},mt=(t,i,e,a)=>(la(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),aa=(t,i,e)=>(la(t,i,"access private method"),e),ht,qt,zt,Ke,pt,na,Xt,ei,jt,oa,sa,nn,Os="video not loaded, unknown time.",ra=t=>{let i=t.range,e=ve(+i.value),a=ve(+i.max),r=e&&a?`${e} of ${a}`:Os;i.setAttribute("aria-valuetext",r)},on=d.createElement("template");on.innerHTML=`
561
559
  <style>
562
560
  :host {
563
561
  --media-preview-background-color: rgba(20,20,30, .5);
@@ -650,9 +648,9 @@
650
648
 
651
649
  </slot>
652
650
  </span>
653
- `;var Jt=class extends ut{constructor(){super(),j(this,jt),j(this,sa),j(this,ht,void 0),j(this,qt,void 0),j(this,zt,i=>{if([...F(this,ht)].some(m=>i.composedPath().includes(m)))return;this.updatePointerBar(i);let e=+this.getAttribute(o.MEDIA_DURATION);if(!e)return;let a=this.range.getBoundingClientRect(),r=(i.clientX-a.left)/a.width;r=Math.max(0,Math.min(1,r));let n=Gr(this,F(this,qt),r),{style:s}=oe(this.shadowRoot,'[part~="preview-box"]');s.transform=`translateX(${n}px)`;let l=r*e,c=new u.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:l});this.dispatchEvent(c)}),j(this,Fe,!1),j(this,pt,i=>{(!i.composedPath().includes(this)||[...F(this,ht)].some(e=>i.composedPath().includes(e)))&&(u.removeEventListener("pointermove",F(this,pt)),mt(this,Fe,!1),F(this,Xt).call(this))}),j(this,na,()=>{u.addEventListener("pointermove",F(this,zt),!1)}),j(this,Xt,()=>{u.removeEventListener("pointermove",F(this,zt));let i=new u.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(i)}),j(this,ei,()=>{let i=this.getAttribute(o.MEDIA_DURATION);!F(this,Fe)&&i&&(mt(this,Fe,!0),F(this,na).call(this),u.addEventListener("pointermove",F(this,pt),!1))}),this.shadowRoot.appendChild(Qr.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let e=this.range.value,a=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}),this._refreshBar=()=>{let i=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+i*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},mt(this,ht,this.shadowRoot.querySelectorAll('[part~="box"]')),mt(this,qt,this.shadowRoot.querySelector('[part~="preview-box"]')),aa(this,jt,oa).call(this)}static get observedAttributes(){return[...super.observedAttributes,"thumbnails","disabled",o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING]}connectedCallback(){this.range.setAttribute("aria-label",$.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(i,e,a){var r,n,s,l,c;(i===o.MEDIA_CURRENT_TIME||i===o.MEDIA_PAUSED||i===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,ra(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),i===o.MEDIA_DURATION&&(this.range.max=Math.floor((n=(r=this.mediaSeekableEnd)!=null?r:this.mediaDuration)!=null?n:1e3),ra(this),this.updateBar(),this.updateCurrentBox()),i===o.MEDIA_SEEKABLE&&(this.range.min=(s=this.mediaSeekableStart)!=null?s:0,this.range.max=Math.floor((c=(l=this.mediaSeekableEnd)!=null?l:this.mediaDuration)!=null?c:1e3),ra(this),this.updateBar()),i===o.MEDIA_BUFFERED&&this.updateBar(),i==="disabled"&&(a==null?aa(this,jt,oa).call(this):aa(this,sa,Zr).call(this)),super.attributeChangedCallback(i,e,a)}get mediaPaused(){return this.hasAttribute(o.MEDIA_PAUSED)}get mediaLoading(){return this.hasAttribute(o.MEDIA_LOADING)}get mediaDuration(){let i=this.getAttribute(o.MEDIA_DURATION);return i!=null?+i:void 0}get mediaCurrentTime(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME);return i!=null?+i:void 0}get mediaPlaybackRate(){let i=this.getAttribute(o.MEDIA_PLAYBACK_RATE);return i!=null?+i:1}get mediaBuffered(){let i=this.getAttribute(o.MEDIA_BUFFERED);return i?i.split(" ").map(e=>e.split(":").map(a=>+a)):[]}get mediaSeekable(){let i=this.getAttribute(o.MEDIA_SEEKABLE);if(!!i)return i.split(":").map(e=>+e)}get mediaSeekableEnd(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e}get mediaSeekableStart(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e}getBarColors(){var i;let e=super.getBarColors(),{range:a}=this,r=a.max-a.min,n=this.mediaBuffered;if(!n.length||!Number.isFinite(r)||r<=0)return e;let s=this.mediaCurrentTime,[,l=a.min]=(i=n.find(([f,y])=>f<=s&&s<=y))!=null?i:[],m=(l-a.min)/r*100;return e.splice(1,0,["var(--media-time-buffered-color, rgba(255,255,255, .4))",m]),e}updateCurrentBox(){let i=this.shadowRoot.querySelector('[part~="current-box"]'),e=this.range.value/(this.range.max-this.range.min),a=Gr(this,i,e),{style:r}=oe(this.shadowRoot,'[part~="current-box"]');r.transform=`translateX(${a}px)`}};ht=new WeakMap;qt=new WeakMap;zt=new WeakMap;Fe=new WeakMap;pt=new WeakMap;na=new WeakMap;Xt=new WeakMap;ei=new WeakMap;jt=new WeakSet;oa=function(){this.addEventListener("pointermove",F(this,ei),!1)};sa=new WeakSet;Zr=function(){u.removeEventListener("pointermove",F(this,pt)),this.removeEventListener("pointermove",F(this,ei)),mt(this,Fe,!1),F(this,Xt).call(this)};function Gr(t,i,e){var a;let r=t.getBoundingClientRect(),n=t.range.getBoundingClientRect(),s=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-left")),l=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-right")),c=s+e*n.width,m=i.offsetWidth,f=c-m/2,S=((a=t.getAttribute("media-bounds")?d.getElementById(t.getAttribute("media-bounds")):t.parentElement)!=null?a:t).getBoundingClientRect(),_=r.left-S.left,N=S.right-r.left-m-l,x=s-_;return Math.max(x,Math.min(f,N))}p("media-time-range",Jt);var da=Jt;var ca=class extends da{constructor(){super(),console.warn("MediaChrome: <media-progress-range> is deprecated. Use <media-time-range> instead.")}};p("media-progress-range",ca);var ua=30,Is=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${ua}</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg>`,jr=d.createElement("template");jr.innerHTML=`
654
- <slot name="backward">${Is}</slot>
655
- `;var Ms=0,qr=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=k.SEEK_BACK_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},zr=t=>{let i=Ot(t,"backward"),e=t.getAttribute("seek-offset");Ut(i,e)},ma=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(i={}){super({slotTemplate:jr,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",ua),qr(this),zr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",ua),zr(this),qr(this)),super.attributeChangedCallback(i,e,a)}handleClick(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME),e=+this.getAttribute("seek-offset"),a=i&&!Number.isNaN(+i)?+i:Ms,r=Math.max(a-e,0),n=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};p("media-seek-backward-button",ma);var ha=class extends he{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(i,e,a){i===o.MEDIA_PREVIEW_TIME&&a!=null&&(this.container.textContent=z(a)),super.attributeChangedCallback(i,e,a)}};p("media-preview-time-display",ha);var Xr=d.createElement("template");Xr.innerHTML=`
651
+ `;var Jt=class extends ut{constructor(){super(),j(this,jt),j(this,sa),j(this,ht,void 0),j(this,qt,void 0),j(this,zt,i=>{if([...F(this,ht)].some(m=>i.composedPath().includes(m)))return;this.updatePointerBar(i);let e=+this.getAttribute(o.MEDIA_DURATION);if(!e)return;let a=this.range.getBoundingClientRect(),r=(i.clientX-a.left)/a.width;r=Math.max(0,Math.min(1,r));let n=rn(this,F(this,qt),r),{style:s}=oe(this.shadowRoot,'[part~="preview-box"]');s.transform=`translateX(${n}px)`;let l=r*e,c=new u.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:l});this.dispatchEvent(c)}),j(this,Ke,!1),j(this,pt,i=>{(!i.composedPath().includes(this)||[...F(this,ht)].some(e=>i.composedPath().includes(e)))&&(u.removeEventListener("pointermove",F(this,pt)),mt(this,Ke,!1),F(this,Xt).call(this))}),j(this,na,()=>{u.addEventListener("pointermove",F(this,zt),!1)}),j(this,Xt,()=>{u.removeEventListener("pointermove",F(this,zt));let i=new u.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(i)}),j(this,ei,()=>{let i=this.getAttribute(o.MEDIA_DURATION);!F(this,Ke)&&i&&(mt(this,Ke,!0),F(this,na).call(this),u.addEventListener("pointermove",F(this,pt),!1))}),this.shadowRoot.appendChild(on.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let e=this.range.value,a=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}),this._refreshBar=()=>{let i=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+i*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},mt(this,ht,this.shadowRoot.querySelectorAll('[part~="box"]')),mt(this,qt,this.shadowRoot.querySelector('[part~="preview-box"]')),aa(this,jt,oa).call(this)}static get observedAttributes(){return[...super.observedAttributes,"thumbnails","disabled",o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING]}connectedCallback(){this.range.setAttribute("aria-label",N.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(i,e,a){var r,n,s,l,c;(i===o.MEDIA_CURRENT_TIME||i===o.MEDIA_PAUSED||i===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,ra(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),i===o.MEDIA_DURATION&&(this.range.max=Math.floor((n=(r=this.mediaSeekableEnd)!=null?r:this.mediaDuration)!=null?n:1e3),ra(this),this.updateBar(),this.updateCurrentBox()),i===o.MEDIA_SEEKABLE&&(this.range.min=(s=this.mediaSeekableStart)!=null?s:0,this.range.max=Math.floor((c=(l=this.mediaSeekableEnd)!=null?l:this.mediaDuration)!=null?c:1e3),ra(this),this.updateBar()),i===o.MEDIA_BUFFERED&&this.updateBar(),i==="disabled"&&(a==null?aa(this,jt,oa).call(this):aa(this,sa,nn).call(this)),super.attributeChangedCallback(i,e,a)}get mediaPaused(){return this.hasAttribute(o.MEDIA_PAUSED)}get mediaLoading(){return this.hasAttribute(o.MEDIA_LOADING)}get mediaDuration(){let i=this.getAttribute(o.MEDIA_DURATION);return i!=null?+i:void 0}get mediaCurrentTime(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME);return i!=null?+i:void 0}get mediaPlaybackRate(){let i=this.getAttribute(o.MEDIA_PLAYBACK_RATE);return i!=null?+i:1}get mediaBuffered(){let i=this.getAttribute(o.MEDIA_BUFFERED);return i?i.split(" ").map(e=>e.split(":").map(a=>+a)):[]}get mediaSeekable(){let i=this.getAttribute(o.MEDIA_SEEKABLE);if(!!i)return i.split(":").map(e=>+e)}get mediaSeekableEnd(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e}get mediaSeekableStart(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e}getBarColors(){var i;let e=super.getBarColors(),{range:a}=this,r=a.max-a.min,n=this.mediaBuffered;if(!n.length||!Number.isFinite(r)||r<=0)return e;let s=this.mediaCurrentTime,[,l=a.min]=(i=n.find(([E,y])=>E<=s&&s<=y))!=null?i:[],m=(l-a.min)/r*100;return e.splice(1,0,["var(--media-time-buffered-color, rgba(255,255,255, .4))",m]),e}updateCurrentBox(){let i=this.shadowRoot.querySelector('[part~="current-box"]'),e=this.range.value/(this.range.max-this.range.min),a=rn(this,i,e),{style:r}=oe(this.shadowRoot,'[part~="current-box"]');r.transform=`translateX(${a}px)`}};ht=new WeakMap;qt=new WeakMap;zt=new WeakMap;Ke=new WeakMap;pt=new WeakMap;na=new WeakMap;Xt=new WeakMap;ei=new WeakMap;jt=new WeakSet;oa=function(){this.addEventListener("pointermove",F(this,ei),!1)};sa=new WeakSet;nn=function(){u.removeEventListener("pointermove",F(this,pt)),this.removeEventListener("pointermove",F(this,ei)),mt(this,Ke,!1),F(this,Xt).call(this)};function rn(t,i,e){var a;let r=t.getBoundingClientRect(),n=t.range.getBoundingClientRect(),s=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-left")),l=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-right")),c=s+e*n.width,m=i.offsetWidth,E=c-m/2,S=((a=t.getAttribute("media-bounds")?d.getElementById(t.getAttribute("media-bounds")):t.parentElement)!=null?a:t).getBoundingClientRect(),_=r.left-S.left,O=S.right-r.left-m-l,x=s-_;return Math.max(x,Math.min(E,O))}p("media-time-range",Jt);var da=Jt;var ca=class extends da{constructor(){super(),console.warn("MediaChrome: <media-progress-range> is deprecated. Use <media-time-range> instead.")}};p("media-progress-range",ca);var ua=30,Ns=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${ua}</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg>`,dn=d.createElement("template");dn.innerHTML=`
652
+ <slot name="backward">${Ns}</slot>
653
+ `;var $s=0,sn=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=k.SEEK_BACK_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},ln=t=>{let i=Ot(t,"backward"),e=t.getAttribute("seek-offset");Ut(i,e)},ma=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(i={}){super({slotTemplate:dn,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",ua),sn(this),ln(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",ua),ln(this),sn(this)),super.attributeChangedCallback(i,e,a)}handleClick(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME),e=+this.getAttribute("seek-offset"),a=i&&!Number.isNaN(+i)?+i:$s,r=Math.max(a-e,0),n=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};p("media-seek-backward-button",ma);var ha=class extends pe{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(i,e,a){i===o.MEDIA_PREVIEW_TIME&&a!=null&&(this.container.textContent=z(a)),super.attributeChangedCallback(i,e,a)}};p("media-preview-time-display",ha);var cn=d.createElement("template");cn.innerHTML=`
656
654
  <style>
657
655
  :host {
658
656
  box-sizing: border-box;
@@ -666,7 +664,7 @@
666
664
  }
667
665
  </style>
668
666
  <img crossorigin loading="eager" decoding="async" />
669
- `;var pa=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Xr.content.cloneNode(!0))}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}attributeChangedCallback(i,e,a){var r,n;if(["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(i)&&this.update(),i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}update(){let i=this.getAttribute(o.MEDIA_PREVIEW_COORDS),e=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(i&&e))return;let[a,r,n,s]=i.split(/\s+/).map(Dt=>+Dt),l=e.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:f,minWidth:y,minHeight:S}=c,_=Math.min(parseInt(m)/n,parseInt(f)/s),N=Math.max(parseInt(y)/n,parseInt(S)/s),x=_<1,U=x?_:N>1?N:1,{style:L}=oe(this.shadowRoot,":host"),re=oe(this.shadowRoot,"img").style,Y=this.shadowRoot.querySelector("img"),ne=x?"min":"max";L.setProperty(`${ne}-width`,"initial","important"),L.setProperty(`${ne}-height`,"initial","important"),L.width=`${n*U}px`,L.height=`${s*U}px`;let Re=()=>{re.width=`${this.imgWidth*U}px`,re.height=`${this.imgHeight*U}px`,re.display="block"};Y.src!==l&&(Y.onload=()=>{this.imgWidth=Y.naturalWidth,this.imgHeight=Y.naturalHeight,Re()},Y.src=l,Re()),Re(),re.transform=`translate(-${a*U}px, -${r*U}px)`}};p("media-preview-thumbnail",pa);var Jr=d.createElement("template"),Ss=`
667
+ `;var pa=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(cn.content.cloneNode(!0))}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}attributeChangedCallback(i,e,a){var r,n;if(["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(i)&&this.update(),i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}update(){let i=this.getAttribute(o.MEDIA_PREVIEW_COORDS),e=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(i&&e))return;let[a,r,n,s]=i.split(/\s+/).map(Dt=>+Dt),l=e.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:E,minWidth:y,minHeight:S}=c,_=Math.min(parseInt(m)/n,parseInt(E)/s),O=Math.max(parseInt(y)/n,parseInt(S)/s),x=_<1,P=x?_:O>1?O:1,{style:L}=oe(this.shadowRoot,":host"),re=oe(this.shadowRoot,"img").style,Y=this.shadowRoot.querySelector("img"),ne=x?"min":"max";L.setProperty(`${ne}-width`,"initial","important"),L.setProperty(`${ne}-height`,"initial","important"),L.width=`${n*P}px`,L.height=`${s*P}px`;let Pe=()=>{re.width=`${this.imgWidth*P}px`,re.height=`${this.imgHeight*P}px`,re.display="block"};Y.src!==l&&(Y.onload=()=>{this.imgWidth=Y.naturalWidth,this.imgHeight=Y.naturalHeight,Pe()},Y.src=l,Pe()),Pe(),re.transform=`translate(-${a*P}px, -${r*P}px)`}};p("media-preview-thumbnail",pa);var un=d.createElement("template"),Bs=`
670
668
  <svg aria-hidden="true" viewBox="0 0 100 100">
671
669
  <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">
672
670
  <animateTransform
@@ -679,7 +677,7 @@
679
677
  repeatCount="indefinite" />
680
678
  </path>
681
679
  </svg>
682
- `;Jr.innerHTML=`
680
+ `;un.innerHTML=`
683
681
  <style>
684
682
  :host {
685
683
  display: inline-block;
@@ -716,28 +714,28 @@ svg, img, ::slotted(svg), ::slotted(img) {
716
714
  }
717
715
  </style>
718
716
 
719
- <slot name="loading">${Ss}</slot>
720
- <div id="status" role="status" aria-live="polite">${$.MEDIA_LOADING()}</div>
721
- `;var ks=500,ba=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,"loading-delay"]}constructor(){super();let i=this.attachShadow({mode:"open"}),e=Jr.content.cloneNode(!0);i.appendChild(e)}attributeChangedCallback(i,e,a){var r,n,s;if(i===o.MEDIA_LOADING||i===o.MEDIA_PAUSED){let l=this.getAttribute(o.MEDIA_PAUSED)!=null,c=this.getAttribute(o.MEDIA_LOADING)!=null,m=!l&&c;if(!m)this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),this.removeAttribute("is-loading");else if(!this.loadingDelayHandle&&m){let f=+((r=this.getAttribute("loading-delay"))!=null?r:ks);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},f)}}else if(i===o.MEDIA_CONTROLLER){if(e){let l=d.getElementById(e);(n=l==null?void 0:l.unassociateElement)==null||n.call(l,this)}if(a){let l=d.getElementById(a);(s=l==null?void 0:l.associateElement)==null||s.call(l,this)}}}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0);let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-loading-indicator",ba);var en=d.createElement("template");en.innerHTML=`
717
+ <slot name="loading">${Bs}</slot>
718
+ <div id="status" role="status" aria-live="polite">${N.MEDIA_LOADING()}</div>
719
+ `;var Vs=500,ba=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,"loading-delay"]}constructor(){super();let i=this.attachShadow({mode:"open"}),e=un.content.cloneNode(!0);i.appendChild(e)}attributeChangedCallback(i,e,a){var r,n,s;if(i===o.MEDIA_LOADING||i===o.MEDIA_PAUSED){let l=this.getAttribute(o.MEDIA_PAUSED)!=null,c=this.getAttribute(o.MEDIA_LOADING)!=null,m=!l&&c;if(!m)this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),this.removeAttribute("is-loading");else if(!this.loadingDelayHandle&&m){let E=+((r=this.getAttribute("loading-delay"))!=null?r:Vs);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},E)}}else if(i===o.MEDIA_CONTROLLER){if(e){let l=d.getElementById(e);(n=l==null?void 0:l.unassociateElement)==null||n.call(l,this)}if(a){let l=d.getElementById(a);(s=l==null?void 0:l.associateElement)==null||s.call(l,this)}}}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0);let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-loading-indicator",ba);var mn=d.createElement("template");mn.innerHTML=`
722
720
  <style>
723
721
  :host {
724
722
  }
725
723
  </style>
726
724
  <slot></slot>
727
- `;var Ea=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(en.content.cloneNode(!0))}};p("media-title-bar",Ea);var Ls=100,Cs=t=>{var i;if(t.getAttribute(o.MEDIA_MUTED)!=null)return 0;let a=+((i=t.getAttribute(o.MEDIA_VOLUME))!=null?i:1);return Math.round(a*t.range.max)},ws=({value:t,max:i})=>`${Math.round(t/i*100)}%`,fa=class extends ut{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=Ls,this.range.addEventListener("input",()=>{let e=this.range.value/this.range.max,a=new u.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",$.VOLUME()),super.connectedCallback()}attributeChangedCallback(i,e,a){if(i===o.MEDIA_VOLUME||i===o.MEDIA_MUTED){let r=Cs(this);this.range.value=r,this.range.setAttribute("aria-valuetext",ws(this.range)),this.updateBar()}super.attributeChangedCallback(i,e,a)}};p("media-volume-range",fa);var Ds=Object.defineProperty,xs=(t,i,e)=>i in t?Ds(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,Rs=(t,i,e)=>(xs(t,typeof i!="symbol"?i+"":i,e),e),bt=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render()}render(){this.shadowRoot.textContent="";let i=d.createElement("template");i.innerHTML=this.constructor.template,this.shadowRoot.append(i.content.cloneNode(!0))}get mediaController(){return this.shadowRoot.querySelector("media-controller")}};Rs(bt,"template","");p("media-theme",bt);var ga=bt;var va=class extends ct{};u.customElements.get("media-chrome")||u.customElements.define("media-chrome",va);var Aa=class extends ct{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};u.customElements.get("media-container")||u.customElements.define("media-container",Aa);var v=wo(require("@mux/mux-video")),D=require("@mux/playback-core");var hn=require("@mux/mux-video");var Ps="en",Ae={code:Ps};var tn="en";function A(t,i=!0){var r,n;let e=i&&(n=(r=Ae)==null?void 0:r[t])!=null?n:t,a=i?Ae.code:tn;return new _a(e,a)}var _a=class{constructor(i,e=(a=>(a=Ae.code)!=null?a:tn)()){this.message=i,this.locale=e}format(i){return this.message.replace(/\{(\w+)\}/g,(e,a)=>{var r;return(r=i[a])!=null?r:""})}toString(){return this.message}};function an(t){let i="";return Object.entries(t).forEach(([e,a])=>{a!=null&&(i+=`${Us(e)}: ${a}; `)}),i?i.trim():void 0}function Us(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function rn(t){return t.replace(/[-_]([a-z])/g,(i,e)=>e.toUpperCase())}function _e(t){if(t==null)return;let i=+t;return Number.isNaN(i)?void 0:i}function ti(t){let i=Os(t).toString();return i?"?"+i:""}function Os(t){let i={};for(let e in t)t[e]!=null&&(i[e]=t[e]);return new URLSearchParams(i)}function Et(t){let i=(t!=null?t:"").split(".")[1];if(!i)return{};let e=i.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var ya=(t,i)=>!t||!i?!1:t.contains(i)?!0:ya(t,i.getRootNode().host);var ft=require("@mux/playback-core");var Ta="mux.com",Ns=()=>{try{return"1.0.0"}catch{}return"UNKNOWN"},$s=Ns(),ai=()=>$s,Ia=(t,{token:i,domain:e=Ta}={})=>`https://stream.${e}/${t}.m3u8${ti(!!i?{token:i}:{redundant_streams:!0})}`,Ma=(t,{token:i,thumbnailTime:e,domain:a=Ta}={})=>{let r=i==null?e:void 0;return`https://image.${a}/${t}/thumbnail.jpg${ti({token:i,time:r})}`},sn=(t,{token:i,domain:e=Ta}={})=>`https://image.${e}/${t}/storyboard.vtt${ti({token:i})}`;function Sa(t){if(t&&/^media-theme-[\w-]+$/.test(t))return t}var Bs={crossorigin:"crossOrigin",playsinline:"playsInline"};function ln(t){var i;return(i=Bs[t])!=null?i:rn(t)}var dn=t=>{var e,a;let{media:i}=t;return(a=(e=i==null?void 0:i._hls)==null?void 0:e.liveSyncPosition)!=null?a:i!=null&&i.seekable.length?i==null?void 0:i.seekable.end(i.seekable.length-1):void 0},ka=t=>{let i=dn(t);if(i==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}t.currentTime=i},Vs=1,Hs=5,nn=3,on=.5,cn=t=>{var n;let{streamType:i}=t,e=dn(t),a=(n=t.media)==null?void 0:n.currentTime;if(e==null||a==null)return!1;let r=e-a;return i===ft.StreamTypes.LL_LIVE||i===ft.StreamTypes.LL_DVR?r<=Vs*(nn+on):i===ft.StreamTypes.LIVE||i===ft.StreamTypes.DVR?r<=Hs*(nn+on):!1},ye,Te,V,ii=class{constructor(i,e){T(this,ye,void 0);T(this,Te,void 0);T(this,V,[]);B(this,ye,i),B(this,Te,e)}[Symbol.iterator](){return g(this,V).values()}get length(){return g(this,V).length}get value(){var i;return(i=g(this,V).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(B(this,V,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return g(this,V)[i]}values(){return g(this,V).values()}keys(){return g(this,V).keys()}forEach(i){g(this,V).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||g(this,V).push(r)}),!(this.value===""&&!((e=g(this,ye))!=null&&e.hasAttribute(`${g(this,Te)}`)))&&((a=g(this,ye))==null||a.setAttribute(`${g(this,Te)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{g(this,V).splice(g(this,V).indexOf(a),1)}),(e=g(this,ye))==null||e.setAttribute(`${g(this,Te)}`,`${this.value}`)}contains(i){return g(this,V).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};ye=new WeakMap,Te=new WeakMap,V=new WeakMap;var un=`[mux-player ${ai()}]`;function Ie(...t){console.warn(un,...t)}function X(...t){console.error(un,...t)}function ri(t){var e;let i=(e=t.message)!=null?e:"";if(t.file){let a="https://github.com/muxinc/elements/blob/main/errors/";i+=` ${A("Read more: ")}
728
- ${a}${t.file}`}Ie(i)}var R={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",SRC:"src",POSTER:"poster",PRELOAD:"preload"},Me={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Ws=Object.freeze({length:0,start(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Fs=hn.VideoEvents.filter(t=>t!=="error"),Ks=Object.values(R).filter(t=>![R.PLAYSINLINE].includes(t)),Ys=Object.values(Me);function pn(t){t.querySelectorAll(":scope > track").forEach(i=>{var e;(e=t.media)==null||e.append(i.cloneNode())}),Fs.forEach(i=>{var e;(e=t.media)==null||e.addEventListener(i,a=>{t.dispatchEvent(new Event(a.type))})})}var La=class extends M.HTMLElement{static get observedAttributes(){return[...Ks,...Ys]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let i=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var l,c;let s=(l=this.media)==null?void 0:l.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(i).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(i,e,a){switch(i){case Me.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Me.VOLUME:{let r=+a;this.media&&!Number.isNaN(r)&&(this.media.volume=r);return}case Me.PLAYBACKRATE:{let r=+a;this.media&&!Number.isNaN(r)&&(this.media.playbackRate=r,this.media.defaultPlaybackRate=r);return}}}play(){var i,e;return(e=(i=this.media)==null?void 0:i.play())!=null?e:Promise.reject()}pause(){var i;(i=this.media)==null||i.pause()}requestCast(i){var e;return(e=this.media)==null?void 0:e.requestCast(i)}get media(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("mux-video")}get paused(){var i,e;return(e=(i=this.media)==null?void 0:i.paused)!=null?e:!0}get duration(){var i,e;return(e=(i=this.media)==null?void 0:i.duration)!=null?e:NaN}get ended(){var i,e;return(e=(i=this.media)==null?void 0:i.ended)!=null?e:!1}get buffered(){var i,e;return(e=(i=this.media)==null?void 0:i.buffered)!=null?e:Ws}get readyState(){var i,e;return(e=(i=this.media)==null?void 0:i.readyState)!=null?e:0}get videoWidth(){var i,e;return(e=(i=this.media)==null?void 0:i.videoWidth)!=null?e:0}get videoHeight(){var i,e;return(e=(i=this.media)==null?void 0:i.videoHeight)!=null?e:0}get currentTime(){var i,e;return(e=(i=this.media)==null?void 0:i.currentTime)!=null?e:0}set currentTime(i){this.media&&(this.media.currentTime=Number(i))}get volume(){var i,e;return(e=(i=this.media)==null?void 0:i.volume)!=null?e:1}set volume(i){this.media&&(this.media.volume=Number(i))}get poster(){var i;return(i=Ke(this,R.POSTER))!=null?i:""}set poster(i){this.setAttribute(R.POSTER,`${i}`)}get playbackRate(){var i,e;return(e=(i=this.media)==null?void 0:i.playbackRate)!=null?e:1}set playbackRate(i){this.media&&(this.media.playbackRate=Number(i))}get defaultPlaybackRate(){var i;return(i=_e(this.getAttribute(Me.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(Me.PLAYBACKRATE,`${i}`):this.removeAttribute(Me.PLAYBACKRATE)}get crossOrigin(){return Ke(this,R.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(R.CROSSORIGIN,`${i}`)}get autoplay(){return Ke(this,R.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(R.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(R.AUTOPLAY)}get loop(){return Ke(this,R.LOOP)!=null}set loop(i){i?this.setAttribute(R.LOOP,""):this.removeAttribute(R.LOOP)}get muted(){var i,e;return(e=(i=this.media)==null?void 0:i.muted)!=null?e:!1}set muted(i){this.media&&(this.media.muted=Boolean(i))}get defaultMuted(){return Ke(this,R.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(R.MUTED,""):this.removeAttribute(R.MUTED)}get playsInline(){return Ke(this,R.PLAYSINLINE)!=null}set playsInline(i){X("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(i){["","none","metadata","auto"].includes(i)?this.setAttribute(R.PRELOAD,i):this.removeAttribute(R.PRELOAD)}};function Ke(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}var Ca=La;var ni=new Map;function oi(t){if(ni.has(t))return ni.get(t);let i=t.length,e=0,a=0,r=0,n=[];for(let s=0;s<i;s+=1){let l=t[s],c=t[s+1],m=t[s-1];l==="{"&&c==="{"&&m!=="\\"?(r+=1,r===1&&(a=s),s+=1):l==="}"&&c==="}"&&m!=="\\"&&r&&(r-=1,r===0&&(a>e&&(n.push(Object.freeze({type:"string",start:e,end:a,value:t.slice(e,a)})),e=a),n.push(Object.freeze({type:"part",start:a,end:s+2,value:t.slice(e+2,s).trim()})),s+=1,e=s+1))}return e<i&&n.push(Object.freeze({type:"string",start:e,end:i,value:t.slice(e,i)})),ni.set(t,Object.freeze(n)),ni.get(t)}var Se=new WeakMap,bn=new WeakMap,q=class{constructor(i,e){this.expression=e,Se.set(this,i),i.updateParent("")}get attributeName(){return Se.get(this).attr.name}get attributeNamespace(){return Se.get(this).attr.namespaceURI}get value(){return bn.get(this)}set value(i){bn.set(this,i||""),Se.get(this).updateParent(i)}get element(){return Se.get(this).element}get booleanValue(){return Se.get(this).booleanValue}set booleanValue(i){Se.get(this).booleanValue=i}},gt=class{constructor(i,e){this.element=i,this.attr=e,this.partList=[]}get booleanValue(){return this.element.hasAttributeNS(this.attr.namespaceURI,this.attr.name)}set booleanValue(i){if(this.partList.length!==1)throw new DOMException("Operation not supported","NotSupportedError");this.partList[0].value=i?"":null}append(i){this.partList.push(i)}updateParent(i){if(this.partList.length===1&&i===null)this.element.removeAttributeNS(this.attr.namespaceURI,this.attr.name);else{let e=this.partList.map(a=>typeof a=="string"?a:a.value).join("");this.element.setAttributeNS(this.attr.namespaceURI,this.attr.name,e)}}};var pe=new WeakMap,J=class{constructor(i,e){this.expression=e,pe.set(this,[i]),i.textContent=""}get value(){return pe.get(this).map(i=>i.textContent).join("")}set value(i){this.replace(i)}get previousSibling(){return pe.get(this)[0].previousSibling}get nextSibling(){return pe.get(this)[pe.get(this).length-1].nextSibling}replace(...i){let e=i.map(a=>typeof a=="string"?new Text(a):a);e.length||e.push(new Text("")),pe.get(this)[0].before(...e);for(let a of pe.get(this))a.remove();pe.set(this,e)}};function vt(t){return{processCallback(i,e,a){var r;if(!(typeof a!="object"||!a)){for(let n of e)if(n.expression in a){let s=(r=a[n.expression])!==null&&r!==void 0?r:"";t(n,s)}}}}}function wa(t,i){t.value=String(i)}function En(t,i){return typeof i=="boolean"&&t instanceof q&&typeof t.element[t.attributeName]=="boolean"?(t.booleanValue=i,!0):!1}var Da=vt(wa),Gs=vt((t,i)=>{En(t,i)||wa(t,i)});function*Zs(t){let i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null,!1),e;for(;e=i.nextNode();)if(e instanceof Element&&e.hasAttributes())for(let a=0;a<e.attributes.length;a+=1){let r=e.attributes.item(a);if(r&&r.value.includes("{{")){let n=new gt(e,r);for(let s of oi(r.value))if(s.type==="string")n.append(s.value);else{let l=new q(n,s.value);n.append(l),yield l}}}else if(e instanceof Text&&e.textContent&&e.textContent.includes("{{")){let a=oi(e.textContent);for(let r=0;r<a.length;r+=1){let n=a[r];n.end<e.textContent.length&&e.splitText(n.end),n.type==="part"&&(yield new J(e,n.value));break}}}var si=new WeakMap,li=new WeakMap,se=class extends DocumentFragment{constructor(i,e,a=Da){var r,n;super(),Object.getPrototypeOf(this)!==se.prototype&&Object.setPrototypeOf(this,se.prototype),this.appendChild(i.content.cloneNode(!0)),li.set(this,Array.from(Zs(this))),si.set(this,a),(n=(r=si.get(this)).createCallback)===null||n===void 0||n.call(r,this,li.get(this),e),si.get(this).processCallback(this,li.get(this),e)}update(i){si.get(this).processCallback(this,li.get(this),i)}};var At=new WeakMap,_t=class{constructor(i,e){this.element=i;this.type=e;this.element.addEventListener(this.type,this);let a=At.get(this.element);a&&a.set(this.type,this)}set(i){if(typeof i=="function")this.handleEvent=i.bind(this.element);else if(typeof i=="object"&&typeof i.handleEvent=="function")this.handleEvent=i.handleEvent.bind(i);else{this.element.removeEventListener(this.type,this);let e=At.get(this.element);e&&e.delete(this.type)}}static for(i){At.has(i.element)||At.set(i.element,new Map);let e=i.attributeName.slice(2),a=At.get(i.element);return a&&a.has(e)?a.get(e):new _t(i.element,e)}};function Qs(t,i){return t instanceof q&&t.attributeName.startsWith("on")?(_t.for(t).set(i),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function qs(t,i){return i instanceof yt&&t instanceof J?(i.renderInto(t),!0):!1}function zs(t,i){return i instanceof DocumentFragment&&t instanceof J?(i.childNodes.length&&t.replace(...i.childNodes),!0):!1}function js(t,i){if(t instanceof q){let e=t.attributeNamespace,a=t.element.getAttributeNS(e,t.attributeName);return String(i)!==a&&(t.value=String(i)),!0}return t.value=String(i),!0}function Xs(t,i){if(typeof i=="boolean"&&t instanceof q){let e=t.attributeNamespace,a=t.element.hasAttributeNS(e,t.attributeName);return i!==a&&(t.booleanValue=i),!0}return!1}function Js(t,i){return i===!1&&t instanceof J?(t.replace(""),!0):!1}function el(t,i){Xs(t,i)||Qs(t,i)||Js(t,i)||qs(t,i)||zs(t,i)||js(t,i)}var xa=new WeakMap,fn=new WeakMap,gn=new WeakMap,yt=class{constructor(i,e,a){this.strings=i;this.values=e;this.processor=a}get template(){if(xa.has(this.strings))return xa.get(this.strings);{let i=document.createElement("template"),e=this.strings.length-1;return i.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<e?`{{ ${n} }}`:""),""),xa.set(this.strings,i),i}}renderInto(i){let e=this.template;if(fn.get(i)!==e){fn.set(i,e);let r=new se(e,this.values,this.processor);gn.set(i,r),i instanceof J?i.replace(...r.children):i.appendChild(r);return}let a=gn.get(i);a&&a.update(this.values)}},vn=new Map,tl=vt(el);function E(t,...i){let e=[""],a=[],r,n=!1,s=(l,c=[])=>{e[e.length-1]=e[e.length-1]+l[0],c.forEach((m,f)=>{(r=m==null?void 0:m.$static$)!==void 0?(r.forEach(y=>{s(y.strings,y.values)}),e[e.length-1]=e[e.length-1]+l[f+1],n=!0):(a.push(m),e.push(l[f+1]))})};if(s(t,i),n){let l=e.join("$$html$$");t=vn.get(l),t===void 0&&(e.raw=e,vn.set(l,t=e)),i=a}return new yt(t,i,tl)}function di(t,i){t.renderInto(i)}function P(t,i){let e=document.createElement("template");return e.innerHTML=t,new se(e,i)}var Ra=(...t)=>({$static$:t.map(i=>i instanceof yt?i:/\w-/.test(i)?{strings:[i]}:{strings:[]})});var _n=`
725
+ `;var Ea=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(mn.content.cloneNode(!0))}};p("media-title-bar",Ea);var Hs=100,Ws=t=>{var i;if(t.getAttribute(o.MEDIA_MUTED)!=null)return 0;let a=+((i=t.getAttribute(o.MEDIA_VOLUME))!=null?i:1);return Math.round(a*t.range.max)},Fs=({value:t,max:i})=>`${Math.round(t/i*100)}%`,fa=class extends ut{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=Hs,this.range.addEventListener("input",()=>{let e=this.range.value/this.range.max,a=new u.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",N.VOLUME()),super.connectedCallback()}attributeChangedCallback(i,e,a){if(i===o.MEDIA_VOLUME||i===o.MEDIA_MUTED){let r=Ws(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Fs(this.range)),this.updateBar()}super.attributeChangedCallback(i,e,a)}};p("media-volume-range",fa);var Ks=Object.defineProperty,Ys=(t,i,e)=>i in t?Ks(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,Gs=(t,i,e)=>(Ys(t,typeof i!="symbol"?i+"":i,e),e),bt=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render()}render(){this.shadowRoot.textContent="";let i=d.createElement("template");i.innerHTML=this.constructor.template,this.shadowRoot.append(i.content.cloneNode(!0))}get mediaController(){return this.shadowRoot.querySelector("media-controller")}};Gs(bt,"template","");p("media-theme",bt);var ga=bt;var va=class extends ct{};u.customElements.get("media-chrome")||u.customElements.define("media-chrome",va);var Aa=class extends ct{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};u.customElements.get("media-container")||u.customElements.define("media-container",Aa);var v=Wo(require("@mux/mux-video")),D=require("@mux/playback-core");var Mn=require("@mux/mux-video");var Zs="en",_e={code:Zs};var hn="en";function A(t,i=!0){var r,n;let e=i&&(n=(r=_e)==null?void 0:r[t])!=null?n:t,a=i?_e.code:hn;return new _a(e,a)}var _a=class{constructor(i,e=(a=>(a=_e.code)!=null?a:hn)()){this.message=i,this.locale=e}format(i){return this.message.replace(/\{(\w+)\}/g,(e,a)=>{var r;return(r=i[a])!=null?r:""})}toString(){return this.message}};function pn(t){let i="";return Object.entries(t).forEach(([e,a])=>{a!=null&&(i+=`${Qs(e)}: ${a}; `)}),i?i.trim():void 0}function Qs(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function bn(t){return t.replace(/[-_]([a-z])/g,(i,e)=>e.toUpperCase())}function ye(t){if(t==null)return;let i=+t;return Number.isNaN(i)?void 0:i}function ti(t){let i=qs(t).toString();return i?"?"+i:""}function qs(t){let i={};for(let e in t)t[e]!=null&&(i[e]=t[e]);return new URLSearchParams(i)}function Et(t){let i=(t!=null?t:"").split(".")[1];if(!i)return{};let e=i.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var ya=(t,i)=>!t||!i?!1:t.contains(i)?!0:ya(t,i.getRootNode().host);var ft=require("@mux/playback-core");var Ta="mux.com",zs=()=>{try{return"1.1.0"}catch{}return"UNKNOWN"},js=zs(),ai=()=>js,Ia=(t,{token:i,domain:e=Ta}={})=>`https://stream.${e}/${t}.m3u8${ti(!!i?{token:i}:{redundant_streams:!0})}`,gn=(t,{token:i,thumbnailTime:e,domain:a=Ta}={})=>{let r=i==null?e:void 0;return`https://image.${a}/${t}/thumbnail.jpg${ti({token:i,time:r})}`},vn=(t,{token:i,domain:e=Ta}={})=>`https://image.${e}/${t}/storyboard.vtt${ti({token:i})}`;function Ma(t){if(t&&/^media-theme-[\w-]+$/.test(t))return t}var Xs={crossorigin:"crossOrigin",playsinline:"playsInline"};function An(t){var i;return(i=Xs[t])!=null?i:bn(t)}var _n=t=>{var e,a;let{media:i}=t;return(a=(e=i==null?void 0:i._hls)==null?void 0:e.liveSyncPosition)!=null?a:i!=null&&i.seekable.length?i==null?void 0:i.seekable.end(i.seekable.length-1):void 0},Sa=t=>{let i=_n(t);if(i==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}t.currentTime=i},Js=1,el=5,En=3,fn=.5,yn=t=>{var n;let{streamType:i}=t,e=_n(t),a=(n=t.media)==null?void 0:n.currentTime;if(e==null||a==null)return!1;let r=e-a;return i===ft.StreamTypes.LL_LIVE||i===ft.StreamTypes.LL_DVR?r<=Js*(En+fn):i===ft.StreamTypes.LIVE||i===ft.StreamTypes.DVR?r<=el*(En+fn):!1},Te,Ie,V,ii=class{constructor(i,e){T(this,Te,void 0);T(this,Ie,void 0);T(this,V,[]);B(this,Te,i),B(this,Ie,e)}[Symbol.iterator](){return g(this,V).values()}get length(){return g(this,V).length}get value(){var i;return(i=g(this,V).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(B(this,V,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return g(this,V)[i]}values(){return g(this,V).values()}keys(){return g(this,V).keys()}forEach(i){g(this,V).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||g(this,V).push(r)}),!(this.value===""&&!((e=g(this,Te))!=null&&e.hasAttribute(`${g(this,Ie)}`)))&&((a=g(this,Te))==null||a.setAttribute(`${g(this,Ie)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{g(this,V).splice(g(this,V).indexOf(a),1)}),(e=g(this,Te))==null||e.setAttribute(`${g(this,Ie)}`,`${this.value}`)}contains(i){return g(this,V).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Te=new WeakMap,Ie=new WeakMap,V=new WeakMap;var Tn=`[mux-player ${ai()}]`;function Me(...t){console.warn(Tn,...t)}function X(...t){console.error(Tn,...t)}function ri(t){var e;let i=(e=t.message)!=null?e:"";if(t.file){let a="https://github.com/muxinc/elements/blob/main/errors/";i+=` ${A("Read more: ")}
726
+ ${a}${t.file}`}Me(i)}var $={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Se={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},tl=Object.freeze({length:0,start(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),il=Mn.VideoEvents.filter(t=>t!=="error"),al=Object.values($).filter(t=>![$.PLAYSINLINE].includes(t)),rl=Object.values(Se);function Sn(t){t.querySelectorAll(":scope > track").forEach(i=>{var e;(e=t.media)==null||e.append(i.cloneNode())}),il.forEach(i=>{var e;(e=t.media)==null||e.addEventListener(i,a=>{t.dispatchEvent(new Event(a.type))})})}var ka=class extends M.HTMLElement{static get observedAttributes(){return[...al,...rl]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let i=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var l,c;let s=(l=this.media)==null?void 0:l.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(i).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(i,e,a){switch(i){case Se.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Se.VOLUME:{let r=+a;this.media&&!Number.isNaN(r)&&(this.media.volume=r);return}case Se.PLAYBACKRATE:{let r=+a;this.media&&!Number.isNaN(r)&&(this.media.playbackRate=r,this.media.defaultPlaybackRate=r);return}}}play(){var i,e;return(e=(i=this.media)==null?void 0:i.play())!=null?e:Promise.reject()}pause(){var i;(i=this.media)==null||i.pause()}requestCast(i){var e;return(e=this.media)==null?void 0:e.requestCast(i)}get media(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("mux-video")}get paused(){var i,e;return(e=(i=this.media)==null?void 0:i.paused)!=null?e:!0}get duration(){var i,e;return(e=(i=this.media)==null?void 0:i.duration)!=null?e:NaN}get ended(){var i,e;return(e=(i=this.media)==null?void 0:i.ended)!=null?e:!1}get buffered(){var i,e;return(e=(i=this.media)==null?void 0:i.buffered)!=null?e:tl}get readyState(){var i,e;return(e=(i=this.media)==null?void 0:i.readyState)!=null?e:0}get videoWidth(){var i,e;return(e=(i=this.media)==null?void 0:i.videoWidth)!=null?e:0}get videoHeight(){var i,e;return(e=(i=this.media)==null?void 0:i.videoHeight)!=null?e:0}get currentTime(){var i,e;return(e=(i=this.media)==null?void 0:i.currentTime)!=null?e:0}set currentTime(i){this.media&&(this.media.currentTime=Number(i))}get volume(){var i,e;return(e=(i=this.media)==null?void 0:i.volume)!=null?e:1}set volume(i){this.media&&(this.media.volume=Number(i))}get playbackRate(){var i,e;return(e=(i=this.media)==null?void 0:i.playbackRate)!=null?e:1}set playbackRate(i){this.media&&(this.media.playbackRate=Number(i))}get defaultPlaybackRate(){var i;return(i=ye(this.getAttribute(Se.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(Se.PLAYBACKRATE,`${i}`):this.removeAttribute(Se.PLAYBACKRATE)}get crossOrigin(){return gt(this,$.CROSSORIGIN)}set crossOrigin(i){this.setAttribute($.CROSSORIGIN,`${i}`)}get autoplay(){return gt(this,$.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute($.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute($.AUTOPLAY)}get loop(){return gt(this,$.LOOP)!=null}set loop(i){i?this.setAttribute($.LOOP,""):this.removeAttribute($.LOOP)}get muted(){var i,e;return(e=(i=this.media)==null?void 0:i.muted)!=null?e:!1}set muted(i){this.media&&(this.media.muted=Boolean(i))}get defaultMuted(){return gt(this,$.MUTED)!=null}set defaultMuted(i){i?this.setAttribute($.MUTED,""):this.removeAttribute($.MUTED)}get playsInline(){return gt(this,$.PLAYSINLINE)!=null}set playsInline(i){X("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(i){["","none","metadata","auto"].includes(i)?this.setAttribute($.PRELOAD,i):this.removeAttribute($.PRELOAD)}};function gt(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}var La=ka;var ni=new Map;function oi(t){if(ni.has(t))return ni.get(t);let i=t.length,e=0,a=0,r=0,n=[];for(let s=0;s<i;s+=1){let l=t[s],c=t[s+1],m=t[s-1];l==="{"&&c==="{"&&m!=="\\"?(r+=1,r===1&&(a=s),s+=1):l==="}"&&c==="}"&&m!=="\\"&&r&&(r-=1,r===0&&(a>e&&(n.push(Object.freeze({type:"string",start:e,end:a,value:t.slice(e,a)})),e=a),n.push(Object.freeze({type:"part",start:a,end:s+2,value:t.slice(e+2,s).trim()})),s+=1,e=s+1))}return e<i&&n.push(Object.freeze({type:"string",start:e,end:i,value:t.slice(e,i)})),ni.set(t,Object.freeze(n)),ni.get(t)}var ke=new WeakMap,kn=new WeakMap,q=class{constructor(i,e){this.expression=e,ke.set(this,i),i.updateParent("")}get attributeName(){return ke.get(this).attr.name}get attributeNamespace(){return ke.get(this).attr.namespaceURI}get value(){return kn.get(this)}set value(i){kn.set(this,i||""),ke.get(this).updateParent(i)}get element(){return ke.get(this).element}get booleanValue(){return ke.get(this).booleanValue}set booleanValue(i){ke.get(this).booleanValue=i}},vt=class{constructor(i,e){this.element=i,this.attr=e,this.partList=[]}get booleanValue(){return this.element.hasAttributeNS(this.attr.namespaceURI,this.attr.name)}set booleanValue(i){if(this.partList.length!==1)throw new DOMException("Operation not supported","NotSupportedError");this.partList[0].value=i?"":null}append(i){this.partList.push(i)}updateParent(i){if(this.partList.length===1&&i===null)this.element.removeAttributeNS(this.attr.namespaceURI,this.attr.name);else{let e=this.partList.map(a=>typeof a=="string"?a:a.value).join("");this.element.setAttributeNS(this.attr.namespaceURI,this.attr.name,e)}}};var be=new WeakMap,J=class{constructor(i,e){this.expression=e,be.set(this,[i]),i.textContent=""}get value(){return be.get(this).map(i=>i.textContent).join("")}set value(i){this.replace(i)}get previousSibling(){return be.get(this)[0].previousSibling}get nextSibling(){return be.get(this)[be.get(this).length-1].nextSibling}replace(...i){let e=i.map(a=>typeof a=="string"?new Text(a):a);e.length||e.push(new Text("")),be.get(this)[0].before(...e);for(let a of be.get(this))a.remove();be.set(this,e)}};function At(t){return{processCallback(i,e,a){var r;if(!(typeof a!="object"||!a)){for(let n of e)if(n.expression in a){let s=(r=a[n.expression])!==null&&r!==void 0?r:"";t(n,s)}}}}}function Ca(t,i){t.value=String(i)}function Ln(t,i){return typeof i=="boolean"&&t instanceof q&&typeof t.element[t.attributeName]=="boolean"?(t.booleanValue=i,!0):!1}var wa=At(Ca),nl=At((t,i)=>{Ln(t,i)||Ca(t,i)});function*ol(t){let i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null,!1),e;for(;e=i.nextNode();)if(e instanceof Element&&e.hasAttributes())for(let a=0;a<e.attributes.length;a+=1){let r=e.attributes.item(a);if(r&&r.value.includes("{{")){let n=new vt(e,r);for(let s of oi(r.value))if(s.type==="string")n.append(s.value);else{let l=new q(n,s.value);n.append(l),yield l}}}else if(e instanceof Text&&e.textContent&&e.textContent.includes("{{")){let a=oi(e.textContent);for(let r=0;r<a.length;r+=1){let n=a[r];n.end<e.textContent.length&&e.splitText(n.end),n.type==="part"&&(yield new J(e,n.value));break}}}var si=new WeakMap,li=new WeakMap,se=class extends DocumentFragment{constructor(i,e,a=wa){var r,n;super(),Object.getPrototypeOf(this)!==se.prototype&&Object.setPrototypeOf(this,se.prototype),this.appendChild(i.content.cloneNode(!0)),li.set(this,Array.from(ol(this))),si.set(this,a),(n=(r=si.get(this)).createCallback)===null||n===void 0||n.call(r,this,li.get(this),e),si.get(this).processCallback(this,li.get(this),e)}update(i){si.get(this).processCallback(this,li.get(this),i)}};var _t=new WeakMap,yt=class{constructor(i,e){this.element=i;this.type=e;this.element.addEventListener(this.type,this);let a=_t.get(this.element);a&&a.set(this.type,this)}set(i){if(typeof i=="function")this.handleEvent=i.bind(this.element);else if(typeof i=="object"&&typeof i.handleEvent=="function")this.handleEvent=i.handleEvent.bind(i);else{this.element.removeEventListener(this.type,this);let e=_t.get(this.element);e&&e.delete(this.type)}}static for(i){_t.has(i.element)||_t.set(i.element,new Map);let e=i.attributeName.slice(2),a=_t.get(i.element);return a&&a.has(e)?a.get(e):new yt(i.element,e)}};function sl(t,i){return t instanceof q&&t.attributeName.startsWith("on")?(yt.for(t).set(i),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function ll(t,i){return i instanceof Tt&&t instanceof J?(i.renderInto(t),!0):!1}function dl(t,i){return i instanceof DocumentFragment&&t instanceof J?(i.childNodes.length&&t.replace(...i.childNodes),!0):!1}function cl(t,i){if(t instanceof q){let e=t.attributeNamespace,a=t.element.getAttributeNS(e,t.attributeName);return String(i)!==a&&(t.value=String(i)),!0}return t.value=String(i),!0}function ul(t,i){if(typeof i=="boolean"&&t instanceof q){let e=t.attributeNamespace,a=t.element.hasAttributeNS(e,t.attributeName);return i!==a&&(t.booleanValue=i),!0}return!1}function ml(t,i){return i===!1&&t instanceof J?(t.replace(""),!0):!1}function hl(t,i){ul(t,i)||sl(t,i)||ml(t,i)||ll(t,i)||dl(t,i)||cl(t,i)}var Da=new WeakMap,Cn=new WeakMap,wn=new WeakMap,Tt=class{constructor(i,e,a){this.strings=i;this.values=e;this.processor=a}get template(){if(Da.has(this.strings))return Da.get(this.strings);{let i=document.createElement("template"),e=this.strings.length-1;return i.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<e?`{{ ${n} }}`:""),""),Da.set(this.strings,i),i}}renderInto(i){let e=this.template;if(Cn.get(i)!==e){Cn.set(i,e);let r=new se(e,this.values,this.processor);wn.set(i,r),i instanceof J?i.replace(...r.children):i.appendChild(r);return}let a=wn.get(i);a&&a.update(this.values)}},Dn=new Map,pl=At(hl);function f(t,...i){let e=[""],a=[],r,n=!1,s=(l,c=[])=>{e[e.length-1]=e[e.length-1]+l[0],c.forEach((m,E)=>{(r=m==null?void 0:m.$static$)!==void 0?(r.forEach(y=>{s(y.strings,y.values)}),e[e.length-1]=e[e.length-1]+l[E+1],n=!0):(a.push(m),e.push(l[E+1]))})};if(s(t,i),n){let l=e.join("$$html$$");t=Dn.get(l),t===void 0&&(e.raw=e,Dn.set(l,t=e)),i=a}return new Tt(t,i,pl)}function di(t,i){t.renderInto(i)}function R(t,i){let e=document.createElement("template");return e.innerHTML=t,new se(e,i)}var xa=(...t)=>({$static$:t.map(i=>i instanceof Tt?i:/\w-/.test(i)?{strings:[i]}:{strings:[]})});var Rn=`
729
727
  :host {
730
728
  cursor: pointer;
731
729
  }
732
730
  media-time-display {
733
731
  color: inherit;
734
732
  }
735
- `,yn=G.createElement("template");yn.innerHTML=`
733
+ `,Pn=G.createElement("template");Pn.innerHTML=`
736
734
  <style>
737
- ${_n}
735
+ ${Rn}
738
736
  </style>
739
737
  <media-time-display show-duration></media-time-display>
740
- `;var An=["Enter"," "],Tt,Ge,ci,Ye=class extends M.HTMLElement{constructor(){var e,a;super();T(this,Ge);T(this,Tt,void 0);this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.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 e,a,r;(e=this.timeDisplayEl)!=null&&e.hasAttribute("remaining")?(a=this.timeDisplayEl)==null||a.removeAttribute("remaining"):(r=this.timeDisplayEl)==null||r.setAttribute("remaining","")}connectedCallback(){let e=a=>{let{key:r}=a;if(!An.includes(r)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!An.includes(s)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),B(this,Tt,setInterval(I(this,Ge,ci).bind(this),200)),requestAnimationFrame(()=>I(this,Ge,ci).call(this))}disconnectedCallback(){clearInterval(g(this,Tt))}attributeChangedCallback(e,a,r){var n,s;e==="hide-duration"&&I(this,Ge,ci).call(this),["remaining","disabled","aria-disabled"].includes(e)&&a!==r&&(r==null?(n=this.timeDisplayEl)==null||n.removeAttribute(e):(s=this.timeDisplayEl)==null||s.setAttribute(e,r))}};Tt=new WeakMap,Ge=new WeakSet,ci=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","")},Ye.styles=_n,Ye.template=yn;M.customElements.get("mxp-time-display")||(M.customElements.define("mxp-time-display",Ye),M.MxpTimeDisplay=Ye);var Tn=`:host(:not([audio])) {
738
+ `;var xn=["Enter"," "],It,Ge,ci,Ye=class extends M.HTMLElement{constructor(){var e,a;super();T(this,Ge);T(this,It,void 0);this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.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 e,a,r;(e=this.timeDisplayEl)!=null&&e.hasAttribute("remaining")?(a=this.timeDisplayEl)==null||a.removeAttribute("remaining"):(r=this.timeDisplayEl)==null||r.setAttribute("remaining","")}connectedCallback(){let e=a=>{let{key:r}=a;if(!xn.includes(r)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!xn.includes(s)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),B(this,It,setInterval(I(this,Ge,ci).bind(this),200)),requestAnimationFrame(()=>I(this,Ge,ci).call(this))}disconnectedCallback(){clearInterval(g(this,It))}attributeChangedCallback(e,a,r){var n,s;e==="hide-duration"&&I(this,Ge,ci).call(this),["remaining","disabled","aria-disabled"].includes(e)&&a!==r&&(r==null?(n=this.timeDisplayEl)==null||n.removeAttribute(e):(s=this.timeDisplayEl)==null||s.setAttribute(e,r))}};It=new WeakMap,Ge=new WeakSet,ci=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","")},Ye.styles=Rn,Ye.template=Pn;M.customElements.get("mxp-time-display")||(M.customElements.define("mxp-time-display",Ye),M.MxpTimeDisplay=Ye);var Un=`:host(:not([audio])) {
741
739
  --secondary-color: transparent;
742
740
  }
743
741
 
@@ -887,7 +885,7 @@ media-controller::part(vertical-layer) {
887
885
  }
888
886
 
889
887
  media-controller:is([media-paused], :not([user-inactive]))::part(vertical-layer) {
890
- background-color: var(--controls-backdrop-color, rgba(0, 0, 0, 0.6));
888
+ background-color: var(--controls-backdrop-color, var(--controls, rgba(0, 0, 0, 0.6)));
891
889
  transition: background-color 0.25s;
892
890
  }
893
891
 
@@ -963,46 +961,46 @@ media-time-display {
963
961
  flex-grow: 1;
964
962
  font-size: 21px;
965
963
  }
966
- `;var In=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
964
+ `;var On=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
967
965
  <path d="M13.19 14.22a.25.25 0 0 0-.38 0l-5.46 6.37a.25.25 0 0 0 .19.41h10.92a.25.25 0 0 0 .19-.41l-5.46-6.37Z"/>
968
966
  <path d="M22 3H4a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h2.94L8 16.75H4.25V4.25h17.5v12.5H18L19.06 18H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
969
967
  </svg>
970
- `;var Mn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
968
+ `;var Nn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
971
969
  <path d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-1.81-.12-4.67-.18-7.53-.18-2.86 0-5.72.06-7.53.18a2.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.5c1.81.12 4.67.18 7.53.18 2.86 0 5.72-.06 7.53-.18a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.137-.21-8.283 0-12.42a1.11 1.11 0 0 1 .91-1.11c1.67-.11 4.43-.18 7.43-.18s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.137.21 8.283 0 12.42ZM10.843 14a1.55 1.55 0 0 1-.76.18 1.57 1.57 0 0 1-.71-.18 1.69 1.69 0 0 1-.57-.42 2.099 2.099 0 0 1-.38-.58 2.47 2.47 0 0 1 0-1.64 2 2 0 0 1 .39-.66 1.73 1.73 0 0 1 .58-.42c.23-.103.479-.158.73-.16.241-.004.48.044.7.14.199.088.373.222.51.39l1.08-.89a2.179 2.179 0 0 0-.47-.44 2.81 2.81 0 0 0-.54-.32 2.91 2.91 0 0 0-.58-.15 2.71 2.71 0 0 0-.56 0 4.08 4.08 0 0 0-1.38.15 3.27 3.27 0 0 0-1.09.67 3.14 3.14 0 0 0-.71 1.06 3.62 3.62 0 0 0-.26 1.39 3.57 3.57 0 0 0 .26 1.38 3 3 0 0 0 .71 1.06c.316.293.687.52 1.09.67.443.16.91.238 1.38.23a3.2 3.2 0 0 0 1.28-.27c.401-.183.747-.47 1-.83l-1.17-.88a1.42 1.42 0 0 1-.53.52Zm6.62 0a1.58 1.58 0 0 1-.76.18 1.54 1.54 0 0 1-.7-.18 1.69 1.69 0 0 1-.57-.42 2.12 2.12 0 0 1-.43-.58 2.29 2.29 0 0 1 .39-2.3 1.84 1.84 0 0 1 1.32-.58c.241-.003.48.045.7.14.199.088.373.222.51.39l1.08-.92a2.43 2.43 0 0 0-.47-.44 3.22 3.22 0 0 0-.53-.29 2.999 2.999 0 0 0-.57-.15 2.87 2.87 0 0 0-.57 0 4.06 4.06 0 0 0-1.36.15 3.17 3.17 0 0 0-1.09.67 3 3 0 0 0-.72 1.06 3.62 3.62 0 0 0-.25 1.39 3.57 3.57 0 0 0 .25 1.38c.16.402.405.764.72 1.06a3.17 3.17 0 0 0 1.09.67c.44.16.904.237 1.37.23.441 0 .877-.092 1.28-.27a2.45 2.45 0 0 0 1-.83l-1.15-.85a1.49 1.49 0 0 1-.54.49Z"/>
972
970
  </svg>
973
- `;var Sn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
971
+ `;var $n=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
974
972
  <path d="M22.832 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.41 10.1a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 4 4 0 0 1-1.28-.83 3.67 3.67 0 0 1-.84-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.53 3.53 0 0 1 .84-1.21 3.89 3.89 0 0 1 1.29-.8 4.76 4.76 0 0 1 1.63-.27 4.06 4.06 0 0 1 1.35.24c.225.091.44.205.64.34a2.7 2.7 0 0 1 .55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.35 2.35 0 0 0-.46.77 2.78 2.78 0 0 0-.16 1c-.009.34.046.68.16 1 .104.283.26.545.46.77.188.21.415.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.88 2.88 0 0 1-1.22 1.01Zm7.52 0a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 3.89 3.89 0 0 1-1.28-.83 3.55 3.55 0 0 1-.85-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.43 3.43 0 0 1 .85-1.25 3.75 3.75 0 0 1 1.28-.8 4.76 4.76 0 0 1 1.63-.27 4 4 0 0 1 1.35.24c.225.091.44.205.64.34.21.144.395.32.55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.352 2.352 0 0 0-.46.77 3.01 3.01 0 0 0-.16 1c-.003.34.05.678.16 1 .108.282.263.542.46.77.188.21.416.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.82 2.82 0 0 1-1.21 1.05Z"/>
975
973
  </svg>
976
- `;var kn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
974
+ `;var Bn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
977
975
  <path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z"/>
978
976
  <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
979
977
  <path d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
980
978
  </svg>
981
- `;var Ln=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
979
+ `;var Vn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
982
980
  <path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z"/>
983
981
  <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
984
982
  <path d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
985
983
  <path d="M20.5 5.5h-15v5.811c3.52.906 6.283 3.67 7.189 7.19H20.5V5.5Z"/>
986
984
  </svg>
987
- `;var Cn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
985
+ `;var Hn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
988
986
  <path d="M20.25 14.5a.76.76 0 0 0-.75.75v4.25h-4.25a.75.75 0 1 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5a.76.76 0 0 0-.75-.75Zm0-11.5h-5a.76.76 0 0 0-.75.75.76.76 0 0 0 .75.75h4.25v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75ZM8.75 19.5H4.5v-4.25a.76.76 0 0 0-.75-.75.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75h5a.75.75 0 1 0 0-1.5Zm0-16.5h-5a.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75.76.76 0 0 0 .75-.75V4.5h4.25a.76.76 0 0 0 .75-.75.76.76 0 0 0-.75-.75Z"/>
989
987
  </svg>
990
- `;var wn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
988
+ `;var Wn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
991
989
  <path d="M20.25 14.5h-5a.76.76 0 0 0-.75.75v5a.75.75 0 1 0 1.5 0V16h4.25a.75.75 0 1 0 0-1.5Zm-5-5h5a.75.75 0 1 0 0-1.5H16V3.75a.75.75 0 1 0-1.5 0v5a.76.76 0 0 0 .75.75Zm-6.5 5h-5a.75.75 0 1 0 0 1.5H8v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75Zm0-11.5a.76.76 0 0 0-.75.75V8H3.75a.75.75 0 0 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5A.76.76 0 0 0 8.75 3Z"/>
992
990
  </svg>
993
- `;var Dn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
991
+ `;var Fn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
994
992
  <path d="M6 19.5a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v15ZM14.5 4a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3Z"/>
995
993
  </svg>
996
- `;var xn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
994
+ `;var Kn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
997
995
  <path d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"/>
998
996
  </svg>
999
- `;var Rn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
997
+ `;var Yn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
1000
998
  <path d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"/>
1001
999
  </svg>
1002
- `;var Pn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
1000
+ `;var Gn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
1003
1001
  <path d="m6.73 20.93 14.05-8.54a.46.46 0 0 0 0-.78L6.73 3.07a.48.48 0 0 0-.73.39v17.07a.48.48 0 0 0 .73.4Z"/>
1004
1002
  </svg>
1005
- `;var Un=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
1003
+ `;var Zn=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
1006
1004
  <path d="M11 6V3L5.37 7 11 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 11 6Z"/>
1007
1005
  <text
1008
1006
  class="value"
@@ -1012,7 +1010,7 @@ media-time-display {
1012
1010
  {{value}}
1013
1011
  </text>
1014
1012
  </svg>
1015
- `;var On=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
1013
+ `;var Qn=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
1016
1014
  <path d="M11 6V3l5.61 4L11 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 11 6Z"/>
1017
1015
  <text
1018
1016
  class="value"
@@ -1022,21 +1020,21 @@ media-time-display {
1022
1020
  {{value}}
1023
1021
  </text>
1024
1022
  </svg>
1025
- `;var Nn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
1023
+ `;var qn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
1026
1024
  <path d="m11.14 4.86-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.21a.5.5 0 0 0-.86-.35Zm2.74-1.56v1.52A7.52 7.52 0 0 1 19.47 12a7.52 7.52 0 0 1-5.59 7.18v1.52A9 9 0 0 0 21 12a9 9 0 0 0-7.12-8.7Zm3.56 8.7a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
1027
1025
  </svg>
1028
- `;var $n=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
1026
+ `;var zn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
1029
1027
  <path d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
1030
1028
  </svg>
1031
- `;var Bn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
1029
+ `;var jn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
1032
1030
  <path d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
1033
1031
  </svg>
1034
- `;var Vn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
1032
+ `;var Xn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
1035
1033
  <path d="m3 4.05 4.48 4.47-.33.33a.49.49 0 0 1-.36.15H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.48.48 0 0 0 .36.15.5.5 0 0 0 .5-.5v-5.75l4.67 4.66a7.71 7.71 0 0 1-2.79 1.47v1.52a9.32 9.32 0 0 0 3.87-1.91L20 21l1-1L4.06 3 3 4.05Zm5.36 5.36 2.39 2.39V17L8 14.26a1.74 1.74 0 0 0-1.24-.51H4.25v-3.5h2.54A1.74 1.74 0 0 0 8 9.74l.36-.33ZM19.47 12a7.19 7.19 0 0 1-.89 3.47l1.11 1.1A8.64 8.64 0 0 0 21 12a9 9 0 0 0-7.12-8.7v1.52A7.52 7.52 0 0 1 19.47 12ZM12 8.88V5.21a.5.5 0 0 0-.5-.5.48.48 0 0 0-.36.15L9.56 6.44 12 8.88ZM15.91 12a4.284 4.284 0 0 1-.07.72l1.22 1.22a5.2 5.2 0 0 0 .38-1.94 5.49 5.49 0 0 0-3.56-5.1v1.66A4 4 0 0 1 15.91 12Z"/>
1036
1034
  </svg>
1037
- `;var Hn=()=>P(In),Wn=()=>P(Mn),Fn=()=>P(Sn),Kn=()=>P(kn),Yn=()=>P(Ln),Gn=()=>P(Cn),Zn=()=>P(wn),Qn=()=>P(Dn),qn=()=>P(xn),zn=()=>P(Rn),jn=()=>P(Pn),Xn=t=>P(Un,t),Jn=t=>P(On,t),eo=()=>P(Nn),to=()=>P($n),io=()=>P(Bn),ao=()=>P(Vn);var H=require("@mux/playback-core");var le={LG:"large",SM:"small",XS:"extra-small"},mi,ro,ui=class extends ga{constructor(){super();T(this,mi);I(this,mi,ro).call(this)}static get observedAttributes(){return["audio","has-open-dialog","has-src","nohotkeys","hotkeys","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset","playbackrates","default-show-remaining-time","poster","placeholder","title"]}attributeChangedCallback(){this.render()}render(){var a;let e={hasSrc:this.hasAttribute("has-src"),isDialogOpen:this.hasAttribute("has-open-dialog"),audio:this.hasAttribute("audio"),nohotkeys:this.hasAttribute("nohotkeys"),hotkeys:this.getAttribute("hotkeys"),streamType:this.getAttribute("stream-type"),playerSize:this.getAttribute("player-size"),defaultHiddenCaptions:this.hasAttribute("default-hidden-captions"),forwardSeekOffset:this.getAttribute("forward-seek-offset"),backwardSeekOffset:this.getAttribute("backward-seek-offset"),playbackRates:this.getAttribute("playbackrates"),defaultShowRemainingTime:this.hasAttribute("default-show-remaining-time"),poster:this.getAttribute("poster"),placeholder:this.getAttribute("placeholder"),title:this.getAttribute("title")};e.nohotkeys=e.nohotkeys||!e.hasSrc||e.isDialogOpen,[H.StreamTypes.LIVE,H.StreamTypes.LL_LIVE,H.StreamTypes.DVR,H.StreamTypes.LL_DVR].includes(e.streamType)&&(e.hotkeys=e.hotkeys||"",e.hotkeys+=" noarrowleft noarrowright"),di(E`
1035
+ `;var Jn=()=>R(On),eo=()=>R(Nn),to=()=>R($n),io=()=>R(Bn),ao=()=>R(Vn),ro=()=>R(Hn),no=()=>R(Wn),oo=()=>R(Fn),so=()=>R(Kn),lo=()=>R(Yn),co=()=>R(Gn),uo=t=>R(Zn,t),mo=t=>R(Qn,t),ho=()=>R(qn),po=()=>R(zn),bo=()=>R(jn),Eo=()=>R(Xn);var H=require("@mux/playback-core");var le={LG:"large",SM:"small",XS:"extra-small"},mi,fo,ui=class extends ga{constructor(){super();T(this,mi);I(this,mi,fo).call(this)}static get observedAttributes(){return["audio","has-open-dialog","has-src","nohotkeys","hotkeys","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset","playbackrates","default-show-remaining-time","poster","placeholder","title"]}attributeChangedCallback(){this.render()}render(){var a,r,n;let e={hasSrc:this.hasAttribute("has-src"),isDialogOpen:this.hasAttribute("has-open-dialog"),audio:this.hasAttribute("audio"),nohotkeys:this.hasAttribute("nohotkeys"),hotkeys:this.getAttribute("hotkeys"),streamType:this.getAttribute("stream-type"),playerSize:this.getAttribute("player-size"),defaultHiddenCaptions:this.hasAttribute("default-hidden-captions"),forwardSeekOffset:this.getAttribute("forward-seek-offset"),backwardSeekOffset:this.getAttribute("backward-seek-offset"),playbackRates:this.getAttribute("playbackrates"),defaultShowRemainingTime:this.hasAttribute("default-show-remaining-time"),poster:this.getAttribute("poster"),placeholder:this.getAttribute("placeholder"),title:this.getAttribute("title")};e.nohotkeys=e.nohotkeys||!e.hasSrc||e.isDialogOpen,[H.StreamTypes.LIVE,H.StreamTypes.LL_LIVE,H.StreamTypes.DVR,H.StreamTypes.LL_DVR].includes(e.streamType)&&(e.hotkeys=e.hotkeys||"",e.hotkeys+=" noarrowleft noarrowright"),di(f`
1038
1036
  <style>
1039
- ${Tn}
1037
+ ${Un}
1040
1038
  </style>
1041
1039
  <media-controller
1042
1040
  gestures-disabled="${!e.hasSrc||e.isDialogOpen}"
@@ -1049,59 +1047,60 @@ media-time-display {
1049
1047
  <slot name="media" slot="media"></slot>
1050
1048
  <media-poster-image
1051
1049
  slot="poster"
1052
- src="${e.poster}"
1053
- placeholder-src="${e.placeholder}"
1050
+ part="poster"
1051
+ src="${(a=e.poster)!=null?a:!1}"
1052
+ placeholder-src="${(r=e.placeholder)!=null?r:!1}"
1054
1053
  ></media-poster-image>
1055
1054
  <media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
1056
- ${_l(e)}
1055
+ ${Pl(e)}
1057
1056
  <slot></slot>
1058
1057
  </media-controller>
1059
- `,this.shadowRoot),(a=this.shadowRoot)==null||a.querySelectorAll("*").forEach(r=>{if(!r.localName.includes("-"))return;let n=r.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!n)return;let[,,s,l]=n;s==="text"&&r.classList.contains("title-display")&&(s="title");let c=r.closest('[slot="top-chrome"]')?"top":r.closest('[slot="centered-chrome"]')?"center":"bottom";r.setAttribute("part",`${c} ${s} ${l}`)})}};mi=new WeakSet,ro=function(){var e,a,r;try{(e=window==null?void 0:window.CSS)==null||e.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"}),(r=window==null?void 0:window.CSS)==null||r.registerProperty({name:"--controls-backdrop-color",syntax:"<color>",inherits:!0,initialValue:"rgba(0, 0, 0, 0.6)"})}catch{}};M.customElements.get("media-theme-mux")||M.customElements.define("media-theme-mux",ui);var _l=t=>{let{streamType:i,playerSize:e,audio:a}=t;if(a)switch(i){case H.StreamTypes.LIVE:case H.StreamTypes.LL_LIVE:return Il(t);case H.StreamTypes.DVR:case H.StreamTypes.LL_DVR:return Tl(t);case H.StreamTypes.ON_DEMAND:default:return yl(t)}switch(i){case H.StreamTypes.LIVE:case H.StreamTypes.LL_LIVE:switch(e){case le.LG:return Cl(t);case le.SM:return Ll(t);case le.XS:return kl(t)}case H.StreamTypes.DVR:case H.StreamTypes.LL_DVR:switch(e){case le.LG:return xl(t);case le.SM:return Dl(t);case le.XS:return wl(t)}case H.StreamTypes.ON_DEMAND:default:switch(e){case le.LG:return Sl(t);case le.SM:return Ml(t);case le.XS:return Pa(t)}}},K=t=>E`
1058
+ `,this.shadowRoot),(n=this.shadowRoot)==null||n.querySelectorAll("*").forEach(s=>{if(!s.localName.includes("-"))return;let l=s.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!l)return;let[,,c,m]=l;c==="text"&&s.classList.contains("title-display")&&(c="title");let E=s.closest('[slot="top-chrome"]')?"top":s.closest('[slot="centered-chrome"]')?"center":"bottom";s.setAttribute("part",`${E} ${c} ${m}`)})}};mi=new WeakSet,fo=function(){var e,a,r;try{(e=window==null?void 0:window.CSS)==null||e.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"}),(r=window==null?void 0:window.CSS)==null||r.registerProperty({name:"--controls-backdrop-color",syntax:"<color>",inherits:!0,initialValue:"rgba(0, 0, 0, 0.6)"})}catch{}};M.customElements.get("media-theme-mux")||M.customElements.define("media-theme-mux",ui);var Pl=t=>{let{streamType:i,playerSize:e,audio:a}=t;if(a)switch(i){case H.StreamTypes.LIVE:case H.StreamTypes.LL_LIVE:return Nl(t);case H.StreamTypes.DVR:case H.StreamTypes.LL_DVR:return Ol(t);case H.StreamTypes.ON_DEMAND:default:return Ul(t)}switch(i){case H.StreamTypes.LIVE:case H.StreamTypes.LL_LIVE:switch(e){case le.LG:return Wl(t);case le.SM:return Hl(t);case le.XS:return Vl(t)}case H.StreamTypes.DVR:case H.StreamTypes.LL_DVR:switch(e){case le.LG:return Yl(t);case le.SM:return Kl(t);case le.XS:return Fl(t)}case H.StreamTypes.ON_DEMAND:default:switch(e){case le.LG:return Bl(t);case le.SM:return $l(t);case le.XS:return Ra(t)}}},K=t=>f`
1060
1059
  <media-play-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1061
- ${jn()}
1062
- ${Qn()}
1063
- </media-play-button>`,Ze=({backwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>E`
1060
+ ${co()}
1061
+ ${oo()}
1062
+ </media-play-button>`,Ze=({backwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>f`
1064
1063
  <media-seek-backward-button seek-offset="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
1065
- ${Xn({value:t})}
1066
- </media-seek-backward-button>`,Qe=({forwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>E`
1064
+ ${uo({value:t})}
1065
+ </media-seek-backward-button>`,Qe=({forwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>f`
1067
1066
  <media-seek-forward-button seek-offset="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
1068
- ${Jn({value:t})}
1069
- </media-seek-forward-button>`,ee=({isDialogOpen:t})=>E`
1067
+ ${mo({value:t})}
1068
+ </media-seek-forward-button>`,ee=({isDialogOpen:t})=>f`
1070
1069
  <media-mute-button disabled="${t}" aria-disabled="${t&&"true"}">
1070
+ ${ho()}
1071
+ ${bo()}
1072
+ ${po()}
1073
+ ${Eo()}
1074
+ </media-mute-button>`,Le=({defaultHiddenCaptions:t,isDialogOpen:i})=>f`
1075
+ <media-captions-button default-showing="${!t}" disabled="${i}" aria-disabled="${i&&"true"}">
1071
1076
  ${eo()}
1072
- ${io()}
1073
1077
  ${to()}
1074
- ${ao()}
1075
- </media-mute-button>`,ke=({defaultHiddenCaptions:t,isDialogOpen:i})=>E`
1076
- <media-captions-button default-showing="${!t}" disabled="${i}" aria-disabled="${i&&"true"}">
1077
- ${Wn()}
1078
- ${Fn()}
1079
- </media-captions-button>`,te=t=>E`
1078
+ </media-captions-button>`,te=t=>f`
1080
1079
  <media-airplay-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1081
- ${Hn()}
1082
- </media-airplay-button>`,Le=t=>E`
1080
+ ${Jn()}
1081
+ </media-airplay-button>`,Ce=t=>f`
1083
1082
  <media-pip-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1084
- ${qn()}
1085
- ${zn()}
1086
- </media-pip-button>`,Ce=t=>E`
1083
+ ${so()}
1084
+ ${lo()}
1085
+ </media-pip-button>`,we=t=>f`
1087
1086
  <media-fullscreen-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1088
- ${Gn()}
1089
- ${Zn()}
1090
- </media-fullscreen-button>`,ie=t=>E`
1087
+ ${ro()}
1088
+ ${no()}
1089
+ </media-fullscreen-button>`,ie=t=>f`
1091
1090
  <media-cast-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1092
- ${Kn()}
1093
- ${Yn()}
1094
- </media-cast-button>`,hi=({playbackRates:t,isDialogOpen:i})=>E`
1091
+ ${io()}
1092
+ ${ao()}
1093
+ </media-cast-button>`,hi=({playbackRates:t,isDialogOpen:i})=>f`
1095
1094
  <media-playback-rate-button rates="${t!=null?t:!1}" disabled="${i}" aria-disabled="${i&&"true"}">
1096
- </media-playback-rate-button>`,de=({isDialogOpen:t})=>E`
1095
+ </media-playback-rate-button>`,de=({isDialogOpen:t})=>f`
1097
1096
  <media-volume-range disabled="${t}" aria-disabled="${t&&"true"}">
1098
- </media-volume-range>`,qe=t=>E`
1097
+ </media-volume-range>`,qe=t=>f`
1099
1098
  <media-time-range disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1100
- </media-time-range>`,pi=({defaultShowRemainingTime:t,hasSrc:i,isDialogOpen:e})=>E`
1099
+ </media-time-range>`,pi=({defaultShowRemainingTime:t,hasSrc:i,isDialogOpen:e})=>f`
1101
1100
  <mxp-time-display remaining="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
1102
- </mxp-time-display>`,ce=({title:t})=>E`
1103
- <media-text-display part="title" class="title-display">${t}</media-text-display>`,yl=t=>E`
1104
- ${t.title?`<media-control-bar>${ce(t)}</media-control-bar>`:E``}
1101
+ </mxp-time-display>`,ce=({title:t})=>f`
1102
+ <media-text-display part="title" class="title-display">${t}</media-text-display>`,Ul=t=>f`
1103
+ ${t.title?`<media-control-bar>${ce(t)}</media-control-bar>`:f``}
1105
1104
  <media-control-bar>
1106
1105
  ${K(t)}
1107
1106
  ${Ze(t)}
@@ -1114,8 +1113,8 @@ media-time-display {
1114
1113
  ${te(t)}
1115
1114
  ${ie(t)}
1116
1115
  </media-control-bar>
1117
- `,Tl=t=>E`
1118
- ${t.title?`<media-control-bar>${ce(t)}</media-control-bar>`:E``}
1116
+ `,Ol=t=>f`
1117
+ ${t.title?`<media-control-bar>${ce(t)}</media-control-bar>`:f``}
1119
1118
  <media-control-bar>
1120
1119
  ${K(t)}
1121
1120
  <slot name="seek-live"></slot>
@@ -1129,8 +1128,8 @@ media-time-display {
1129
1128
  ${te(t)}
1130
1129
  ${ie(t)}
1131
1130
  </media-control-bar>
1132
- `,Il=t=>E`
1133
- ${t.title?`<media-control-bar>${ce(t)}</media-control-bar>`:E``}
1131
+ `,Nl=t=>f`
1132
+ ${t.title?`<media-control-bar>${ce(t)}</media-control-bar>`:f``}
1134
1133
  <media-control-bar>
1135
1134
  ${K(t)}
1136
1135
  <slot name="seek-live"></slot>
@@ -1139,13 +1138,13 @@ media-time-display {
1139
1138
  ${te(t)}
1140
1139
  ${ie(t)}
1141
1140
  </media-control-bar>
1142
- `,Pa=t=>E`
1141
+ `,Ra=t=>f`
1143
1142
  <media-control-bar slot="top-chrome">
1144
- ${ke(t)}
1143
+ ${Le(t)}
1145
1144
  <div class="spacer"></div>
1146
1145
  ${te(t)}
1147
1146
  ${ie(t)}
1148
- ${Le(t)}
1147
+ ${Ce(t)}
1149
1148
  </media-control-bar>
1150
1149
  <div slot="centered-chrome" class="center-controls">
1151
1150
  ${K(t)}
@@ -1153,16 +1152,16 @@ media-time-display {
1153
1152
  <media-control-bar>
1154
1153
  ${ee(t)}
1155
1154
  <div class="spacer"></div>
1156
- ${Ce(t)}
1155
+ ${we(t)}
1157
1156
  </media-control-bar>
1158
- `,Ml=t=>E`
1157
+ `,$l=t=>f`
1159
1158
  <media-control-bar slot="top-chrome">
1160
- ${t.title?ce(t):E``}
1159
+ ${t.title?ce(t):f``}
1161
1160
  <div class="spacer"></div>
1162
- ${ke(t)}
1161
+ ${Le(t)}
1163
1162
  ${te(t)}
1164
1163
  ${ie(t)}
1165
- ${Le(t)}
1164
+ ${Ce(t)}
1166
1165
  </media-control-bar>
1167
1166
  <div slot="centered-chrome" class="center-controls">
1168
1167
  ${Ze(t)}
@@ -1176,12 +1175,12 @@ media-time-display {
1176
1175
  ${de(t)}
1177
1176
  <div class="spacer"></div>
1178
1177
  ${hi(t)}
1179
- ${Ce(t)}
1178
+ ${we(t)}
1180
1179
  <div class="padding-2"></div>
1181
1180
  </media-control-bar>
1182
- `,Sl=t=>E`
1181
+ `,Bl=t=>f`
1183
1182
  <media-control-bar slot="top-chrome">
1184
- ${t.title?ce(t):E``}
1183
+ ${t.title?ce(t):f``}
1185
1184
  </media-control-bar>
1186
1185
  <div slot="centered-chrome" class="center-controls">
1187
1186
  ${K(t)}
@@ -1196,21 +1195,21 @@ media-time-display {
1196
1195
  ${de(t)}
1197
1196
  <div class="spacer"></div>
1198
1197
  ${hi(t)}
1199
- ${ke(t)}
1198
+ ${Le(t)}
1200
1199
  ${te(t)}
1201
1200
  ${ie(t)}
1202
- ${Le(t)}
1203
1201
  ${Ce(t)}
1202
+ ${we(t)}
1204
1203
  <div class="padding-2"></div>
1205
1204
  </media-control-bar>
1206
- `,kl=Pa,Ll=t=>E`
1205
+ `,Vl=Ra,Hl=t=>f`
1207
1206
  <media-control-bar slot="top-chrome">
1208
- ${t.title?ce(t):E``}
1207
+ ${t.title?ce(t):f``}
1209
1208
  <div class="spacer"></div>
1210
- ${ke(t)}
1209
+ ${Le(t)}
1211
1210
  ${te(t)}
1212
1211
  ${ie(t)}
1213
- ${Le(t)}
1212
+ ${Ce(t)}
1214
1213
  </media-control-bar>
1215
1214
  <div slot="centered-chrome" class="center-controls">
1216
1215
  ${K(t)}
@@ -1220,11 +1219,11 @@ media-time-display {
1220
1219
  ${de(t)}
1221
1220
  <slot name="seek-live"></slot>
1222
1221
  <div class="spacer"></div>
1223
- ${Ce(t)}
1222
+ ${we(t)}
1224
1223
  </media-control-bar>
1225
- `,Cl=t=>E`
1224
+ `,Wl=t=>f`
1226
1225
  <media-control-bar slot="top-chrome">
1227
- ${t.title?ce(t):E``}
1226
+ ${t.title?ce(t):f``}
1228
1227
  </media-control-bar>
1229
1228
  <div slot="centered-chrome" class="center-controls">
1230
1229
  ${K(t)}
@@ -1234,20 +1233,20 @@ media-time-display {
1234
1233
  ${de(t)}
1235
1234
  <slot name="seek-live"></slot>
1236
1235
  <div class="spacer"></div>
1237
- ${ke(t)}
1236
+ ${Le(t)}
1238
1237
  ${te(t)}
1239
1238
  ${ie(t)}
1240
- ${Le(t)}
1241
1239
  ${Ce(t)}
1240
+ ${we(t)}
1242
1241
  </media-control-bar>
1243
- `,wl=Pa,Dl=t=>E`
1242
+ `,Fl=Ra,Kl=t=>f`
1244
1243
  <media-control-bar slot="top-chrome">
1245
- ${t.title?ce(t):E``}
1244
+ ${t.title?ce(t):f``}
1246
1245
  <div class="spacer"></div>
1247
- ${ke(t)}
1246
+ ${Le(t)}
1248
1247
  ${te(t)}
1249
1248
  ${ie(t)}
1250
- ${Le(t)}
1249
+ ${Ce(t)}
1251
1250
  </media-control-bar>
1252
1251
  <div slot="centered-chrome" class="center-controls">
1253
1252
  ${Ze(t)}
@@ -1260,12 +1259,12 @@ media-time-display {
1260
1259
  ${de(t)}
1261
1260
  <slot name="seek-live"></slot>
1262
1261
  <div class="spacer"></div>
1263
- ${Ce(t)}
1262
+ ${we(t)}
1264
1263
  <div class="padding-2"></div>
1265
1264
  </media-control-bar>
1266
- `,xl=t=>E`
1265
+ `,Yl=t=>f`
1267
1266
  <media-control-bar slot="top-chrome">
1268
- ${t.title?ce(t):E``}
1267
+ ${t.title?ce(t):f``}
1269
1268
  </media-control-bar>
1270
1269
  <div slot="centered-chrome" class="center-controls">
1271
1270
  ${K(t)}
@@ -1279,14 +1278,14 @@ media-time-display {
1279
1278
  ${de(t)}
1280
1279
  <slot name="seek-live"></slot>
1281
1280
  <div class="spacer"></div>
1282
- ${ke(t)}
1281
+ ${Le(t)}
1283
1282
  ${te(t)}
1284
1283
  ${ie(t)}
1285
- ${Le(t)}
1286
1284
  ${Ce(t)}
1285
+ ${we(t)}
1287
1286
  <div class="padding-2"></div>
1288
1287
  </media-control-bar>
1289
- `;var oo=`
1288
+ `;var vo=`
1290
1289
  :host {
1291
1290
  z-index: 100;
1292
1291
  display: flex;
@@ -1344,17 +1343,17 @@ media-time-display {
1344
1343
  text-align: center;
1345
1344
  line-height: 1.4;
1346
1345
  }
1347
- `,so=G.createElement("template");so.innerHTML=`
1346
+ `,Ao=G.createElement("template");Ao.innerHTML=`
1348
1347
  <style>
1349
- ${oo}
1348
+ ${vo}
1350
1349
  </style>
1351
1350
 
1352
1351
  <div class="dialog">
1353
1352
  <slot></slot>
1354
1353
  </div>
1355
- `;var be=class extends M.HTMLElement{constructor(){var e;super();this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),no(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Rl(this))}attributeChangedCallback(e,a,r){e==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&no(this)}};be.styles=oo,be.template=so,be.observedAttributes=["open"];function no(t){let i=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(t.dispatchEvent(i),i.defaultPrevented)return;let e=t.querySelector("[autofocus]:not([disabled])");!e&&t.tabIndex>=0&&(e=t),e||(e=lo(t.shadowRoot)),t._previouslyFocusedElement=G.activeElement,G.activeElement instanceof HTMLElement&&G.activeElement.blur(),t.addEventListener("transitionend",()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},{once:!0})}function lo(t){let e=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=t==null?void 0:t.querySelector(e.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(t==null?void 0:t.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=lo(r[n].shadowRoot),a));n++);}return a}function Rl(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}M.customElements.get("media-dialog")||(M.customElements.define("media-dialog",be),M.MediaDialog=be);var Ua=be;var co=G.createElement("template");co.innerHTML=`
1354
+ `;var Ee=class extends M.HTMLElement{constructor(){var e;super();this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.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})),Gl(this))}attributeChangedCallback(e,a,r){e==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&go(this)}};Ee.styles=vo,Ee.template=Ao,Ee.observedAttributes=["open"];function go(t){let i=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(t.dispatchEvent(i),i.defaultPrevented)return;let e=t.querySelector("[autofocus]:not([disabled])");!e&&t.tabIndex>=0&&(e=t),e||(e=_o(t.shadowRoot)),t._previouslyFocusedElement=G.activeElement,G.activeElement instanceof HTMLElement&&G.activeElement.blur(),t.addEventListener("transitionend",()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},{once:!0})}function _o(t){let e=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=t==null?void 0:t.querySelector(e.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(t==null?void 0:t.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=_o(r[n].shadowRoot),a));n++);}return a}function Gl(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}M.customElements.get("media-dialog")||(M.customElements.define("media-dialog",Ee),M.MediaDialog=Ee);var Pa=Ee;var yo=G.createElement("template");yo.innerHTML=`
1356
1355
  <style>
1357
- ${Ua.styles}
1356
+ ${Pa.styles}
1358
1357
 
1359
1358
  .close {
1360
1359
  background: none;
@@ -1383,7 +1382,7 @@ media-time-display {
1383
1382
  </svg>
1384
1383
  </button>
1385
1384
  </slot>
1386
- `;var It=class extends Ua{constructor(){var i,e;super(),(e=(i=this.shadowRoot)==null?void 0:i.querySelector(".close"))==null||e.addEventListener("click",()=>{this.close()})}};It.template=co;M.customElements.get("mxp-dialog")||(M.customElements.define("mxp-dialog",It),M.MxpDialog=It);var uo=`:host {
1385
+ `;var Mt=class extends Pa{constructor(){var i,e;super(),(e=(i=this.shadowRoot)==null?void 0:i.querySelector(".close"))==null||e.addEventListener("click",()=>{this.close()})}};Mt.template=yo;M.customElements.get("mxp-dialog")||(M.customElements.define("mxp-dialog",Mt),M.MxpDialog=Mt);var To=`:host {
1387
1386
  display: inline-block;
1388
1387
  width: 100%;
1389
1388
  }
@@ -1534,93 +1533,92 @@ a {
1534
1533
  ::part(title display) {
1535
1534
  display: var(--media-controls, var(--media-title-display));
1536
1535
  }
1537
- `;var we=require("@mux/playback-core"),po=t=>E`
1536
+ `;var De=require("@mux/playback-core"),So=t=>f`
1538
1537
  <style>
1539
- ${uo}
1538
+ ${To}
1540
1539
  </style>
1541
- ${Ul(t)}
1542
- `,mo=t=>[we.StreamTypes.LIVE,we.StreamTypes.LL_LIVE].includes(t.streamType),ho=t=>[we.StreamTypes.LIVE,we.StreamTypes.LL_LIVE,we.StreamTypes.DVR,we.StreamTypes.LL_DVR].includes(t.streamType),Ul=t=>{var i,e,a,r,n,s,l,c,m,f,y,S,_,N,x,U,L,re,Y,ne,Re,Dt,$a,Ba,Va,Ha,Wa,Fa;return E`
1543
- <${Ra((i=Sa(t.theme))!=null?i:"media-theme-mux")}
1544
- has-src="${t.hasSrc}"
1545
- has-open-dialog="${t.isDialogOpen}"
1546
- nohotkeys="${(e=t.noHotKeys)!=null?e:!1}"
1547
- audio="${t.audio||!1}"
1548
- style="${(a=an({"--primary-color":t.primaryColor,"--secondary-color":t.secondaryColor}))!=null?a:!1}"
1540
+ ${Ql(t)}
1541
+ `,Io=t=>[De.StreamTypes.LIVE,De.StreamTypes.LL_LIVE].includes(t.streamType),Mo=t=>[De.StreamTypes.LIVE,De.StreamTypes.LL_LIVE,De.StreamTypes.DVR,De.StreamTypes.LL_DVR].includes(t.streamType),Ql=t=>{var i,e,a,r,n,s,l,c,m,E,y,S,_,O,x,P,L,re,Y,ne,Pe,Dt,Na,$a,Ba,Va,Ha,Wa,Fa,Ka,Ya,Ga,Za,Qa,qa,za,ja,Xa,Ja,er;return f`
1542
+ <${xa((i=Ma(t.theme))!=null?i:"media-theme-mux")}
1543
+ has-src="${(e=t.hasSrc)!=null?e:!1}"
1544
+ has-open-dialog="${(a=t.isDialogOpen)!=null?a:!1}"
1545
+ nohotkeys="${(r=t.noHotKeys)!=null?r:!1}"
1546
+ audio="${(n=t.audio)!=null?n:!1}"
1547
+ style="${(s=pn({"--primary-color":t.primaryColor,"--secondary-color":t.secondaryColor}))!=null?s:!1}"
1549
1548
  class="size-${t.playerSize}${t.secondaryColor?" two-tone":""}"
1550
- stream-type="${t.streamType}"
1551
- player-size="${t.playerSize}"
1552
- default-hidden-captions="${t.defaultHiddenCaptions}"
1553
- forward-seek-offset="${t.forwardSeekOffset}"
1554
- backward-seek-offset="${t.backwardSeekOffset}"
1555
- playbackrates="${(r=t.playbackRates)!=null?r:!1}"
1556
- default-show-remaining-time="${(n=t.defaultShowRemainingTime)!=null?n:!1}"
1557
- title="${(s=t.title)!=null?s:!1}"
1558
- hotkeys="${t.hotKeys||!1}"
1559
- poster="${t.poster?t.poster:t.playbackId&&!t.audio?Ma(t.playbackId,{domain:t.customDomain,thumbnailTime:(l=t.thumbnailTime)!=null?l:t.startTime,token:t.tokens.thumbnail}):!1}"
1560
- placeholder="${t.placeholder}"
1561
- exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, seek-live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
1549
+ stream-type="${(l=t.streamType)!=null?l:!1}"
1550
+ player-size="${(c=t.playerSize)!=null?c:!1}"
1551
+ default-hidden-captions="${(m=t.defaultHiddenCaptions)!=null?m:!1}"
1552
+ forward-seek-offset="${(E=t.forwardSeekOffset)!=null?E:!1}"
1553
+ backward-seek-offset="${(y=t.backwardSeekOffset)!=null?y:!1}"
1554
+ playbackrates="${(S=t.playbackRates)!=null?S:!1}"
1555
+ default-show-remaining-time="${(_=t.defaultShowRemainingTime)!=null?_:!1}"
1556
+ title="${(O=t.title)!=null?O:!1}"
1557
+ hotkeys="${(x=t.hotKeys)!=null?x:!1}"
1558
+ poster="${t.poster===""?!1:(P=t.poster)!=null?P:!1}"
1559
+ placeholder="${(L=t.placeholder)!=null?L:!1}"
1560
+ exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, poster, seek-live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
1562
1561
  >
1563
1562
  <mux-video
1564
1563
  slot="media"
1565
- crossorigin="${(c=t.crossOrigin)!=null?c:""}"
1564
+ crossorigin="${(re=t.crossOrigin)!=null?re:""}"
1566
1565
  playsinline
1567
- autoplay="${(m=t.autoplay)!=null?m:!1}"
1568
- muted="${(f=t.muted)!=null?f:!1}"
1569
- loop="${(y=t.loop)!=null?y:!1}"
1570
- preload="${(S=t.preload)!=null?S:!1}"
1571
- debug="${(_=t.debug)!=null?_:!1}"
1572
- prefer-playback="${(N=t.preferPlayback)!=null?N:!1}"
1566
+ autoplay="${(Y=t.autoplay)!=null?Y:!1}"
1567
+ muted="${(ne=t.muted)!=null?ne:!1}"
1568
+ loop="${(Pe=t.loop)!=null?Pe:!1}"
1569
+ preload="${(Dt=t.preload)!=null?Dt:!1}"
1570
+ debug="${(Na=t.debug)!=null?Na:!1}"
1571
+ prefer-playback="${($a=t.preferPlayback)!=null?$a:!1}"
1573
1572
  start-time="${t.startTime!=null?t.startTime:!1}"
1574
- metadata-video-id="${(x=t.metadataVideoId)!=null?x:!1}"
1575
- metadata-video-title="${(U=t.metadataVideoTitle)!=null?U:!1}"
1576
- metadata-viewer-user-id="${(L=t.metadataViewerUserId)!=null?L:!1}"
1577
- beacon-collection-domain="${(re=t.beaconCollectionDomain)!=null?re:!1}"
1578
- player-software-name="${t.playerSoftwareName}"
1579
- player-software-version="${t.playerSoftwareVersion}"
1580
- env-key="${(Y=t.envKey)!=null?Y:!1}"
1581
- stream-type="${(ne=t.streamType)!=null?ne:!1}"
1582
- custom-domain="${(Re=t.customDomain)!=null?Re:!1}"
1573
+ metadata-video-id="${(Ba=t.metadataVideoId)!=null?Ba:!1}"
1574
+ metadata-video-title="${(Va=t.metadataVideoTitle)!=null?Va:!1}"
1575
+ metadata-viewer-user-id="${(Ha=t.metadataViewerUserId)!=null?Ha:!1}"
1576
+ beacon-collection-domain="${(Wa=t.beaconCollectionDomain)!=null?Wa:!1}"
1577
+ player-software-name="${(Fa=t.playerSoftwareName)!=null?Fa:!1}"
1578
+ player-software-version="${(Ka=t.playerSoftwareVersion)!=null?Ka:!1}"
1579
+ env-key="${(Ya=t.envKey)!=null?Ya:!1}"
1580
+ stream-type="${(Ga=t.streamType)!=null?Ga:!1}"
1581
+ custom-domain="${(Za=t.customDomain)!=null?Za:!1}"
1583
1582
  src="${t.src?t.src:t.playbackId?Ia(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
1584
- poster="${t.poster?t.poster:t.playbackId&&!t.audio?Ma(t.playbackId,{domain:t.customDomain,thumbnailTime:(Dt=t.thumbnailTime)!=null?Dt:t.startTime,token:t.tokens.thumbnail}):!1}"
1585
1583
  cast-src="${t.src?t.src:t.playbackId?Ia(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
1586
- cast-stream-type="${mo(t)?"live":!1}"
1584
+ cast-stream-type="${Io(t)?"live":!1}"
1587
1585
  exportparts="video"
1588
1586
  >
1589
- ${t.playbackId&&!t.audio&&!ho(t)?E`<track
1587
+ ${t.playbackId&&!t.audio&&!Mo(t)?f`<track
1590
1588
  label="thumbnails"
1591
1589
  default
1592
1590
  kind="metadata"
1593
- src="${sn(t.playbackId,{domain:t.customDomain,token:t.tokens.storyboard})}"
1594
- />`:E``}
1591
+ src="${vn(t.playbackId,{domain:t.customDomain,token:t.tokens.storyboard})}"
1592
+ />`:f``}
1595
1593
  </mux-video>
1596
- ${ho(t)?E`<button
1594
+ ${Mo(t)?f`<button
1597
1595
  slot="seek-live"
1598
- part="${mo(t)?"top":"bottom"} seek-live button"
1596
+ part="${Io(t)?"top":"bottom"} seek-live button"
1599
1597
  disabled="${t.inLiveWindow||!t.hasSrc||t.isDialogOpen}"
1600
1598
  aria-disabled="${(t.inLiveWindow||!t.hasSrc||t.isDialogOpen)&&"true"}"
1601
1599
  in-live-window="${t.inLiveWindow}"
1602
- onclick="${function(yo){var Ka;if((Ka=t.onSeekToLive)==null||Ka.call(t,yo),t.paused){let To=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(To)}}}"
1600
+ onclick="${function(Po){var tr;if((tr=t.onSeekToLive)==null||tr.call(t,Po),t.paused){let Uo=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(Uo)}}}"
1603
1601
  >
1604
1602
  Live
1605
- </button>`:E``}
1603
+ </button>`:f``}
1606
1604
  <mxp-dialog
1607
1605
  no-auto-hide
1608
- open="${t.isDialogOpen}"
1606
+ open="${(Qa=t.isDialogOpen)!=null?Qa:!1}"
1609
1607
  onclose="${t.onCloseErrorDialog}"
1610
1608
  oninitfocus="${t.onInitFocusDialog}"
1611
1609
  >
1612
- ${($a=t.dialog)!=null&&$a.title?E`<h3>${t.dialog.title}</h3>`:E``}
1610
+ ${(qa=t.dialog)!=null&&qa.title?f`<h3>${t.dialog.title}</h3>`:f``}
1613
1611
  <p>
1614
- ${(Ba=t.dialog)==null?void 0:Ba.message}
1615
- ${(Va=t.dialog)!=null&&Va.linkUrl?E`<a
1612
+ ${(za=t.dialog)==null?void 0:za.message}
1613
+ ${(ja=t.dialog)!=null&&ja.linkUrl?f`<a
1616
1614
  href="${t.dialog.linkUrl}"
1617
1615
  target="_blank"
1618
1616
  rel="external noopener"
1619
- aria-label="${(Ha=t.dialog.linkText)!=null?Ha:""} ${A("(opens in a new window)")}"
1620
- >${(Wa=t.dialog.linkText)!=null?Wa:t.dialog.linkUrl}</a
1621
- >`:E``}
1617
+ aria-label="${(Xa=t.dialog.linkText)!=null?Xa:""} ${A("(opens in a new window)")}"
1618
+ >${(Ja=t.dialog.linkText)!=null?Ja:t.dialog.linkUrl}</a
1619
+ >`:f``}
1622
1620
  </p>
1623
1621
  </mxp-dialog>
1624
- </${Ra((Fa=Sa(t.theme))!=null?Fa:"media-theme-mux")}>
1625
- `};var Mt=require("@mux/mux-video");function bi(t,i,e,a,r){var l,c,m;let n={},s={};switch(t.code){case Mt.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=A("Network Error",r),n.message=t.message,(l=t.data)==null?void 0:l.response.code){case 412:{n.title=A("Video is not currently available",r),n.message=A("The live stream or video file are not yet ready.",r),s.message=A("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=A("Video does not exist",r),n.message="",s.message=A("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=A("Invalid playback URL",r),n.message=A("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=A("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:f,aud:y,sub:S}=Et(a),_=Date.now()>f*1e3,N=S!==e,x=y!=="v",U={timeStyle:"medium",dateStyle:"medium"};if(_){n.title=A("Video URL has expired",r),n.message=A("The video\u2019s secured playback-token has expired.",r),s.message=A("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(Ae.code,U).format(f*1e3),currentDate:new Intl.DateTimeFormat(Ae.code,U).format(Date.now())}),s.file="403-expired-token.md";break}if(N){n.title=A("Video URL is formatted incorrectly",r),n.message=A("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=A("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:e,tokenPlaybackId:S}),s.file="403-playback-id-mismatch.md";break}if(x){n.title=A("Video URL is formatted incorrectly",r),n.message=A("The playback-token is formatted with incorrect information.",r),s.message=A("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=A("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 Mt.MediaError.MEDIA_ERR_DECODE:{let{message:f}=t;n={title:A("Media Error",r),message:f},s.file="media-decode-error.md";break}case Mt.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let f=(m=(c=t.data)==null?void 0:c.response)==null?void 0:m.code;if(f>=400&&f<500){t.code=Mt.MediaError.MEDIA_ERR_NETWORK,t.data={response:{code:f}},{dialog:n,devlog:s}=bi(t,i,e,a);break}n={title:A("Source Not Supported",r),message:t.message},s.file="media-src-not-supported.md";break}default:n={title:A("Error",r),message:t.message};break}return i&&(n={title:A("Your device appears to be offline",r),message:A("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var Ol=Object.values(D.StreamTypes),Nl=700,$l=300,Oa={LG:"large",SM:"small",XS:"extra-small"};function Ei(t){let i=t.getBoundingClientRect();return i.width<$l?Oa.XS:i.width<Nl?Oa.SM:Oa.LG}var St={SRC:"src"},b={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",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 Bl(t,i){var e,a;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src,poster:t.getAttribute("poster"),placeholder:t.getAttribute("placeholder"),theme:t.getAttribute("theme"),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(b.NOHOTKEYS),hotKeys:t.getAttribute(b.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,debug:t.debug,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,streamType:t.streamType,primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultShowRemainingTime:t.defaultShowRemainingTime,playbackRates:t.getAttribute(b.PLAYBACK_RATES),customDomain:(e=t.getAttribute(v.Attributes.CUSTOM_DOMAIN))!=null?e:void 0,playerSize:Ei((a=t.mediaController)!=null?a:t),metadataVideoId:t.getAttribute(v.Attributes.METADATA_VIDEO_ID),metadataVideoTitle:t.getAttribute(v.Attributes.METADATA_VIDEO_TITLE),metadataViewerUserId:t.getAttribute(v.Attributes.METADATA_VIEWER_USER_ID),title:t.getAttribute(b.TITLE),...i}}var Vl=Object.values(v.Attributes),Hl=Object.values(b),Wl=ai(),Fl="mux-player",bo={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},xe,Lt,ue,Ct,je,ae,Xe,fi,Ee,ze,Je,gi,wt,Na,vi,Eo,Ai,fo,_i,go,yi,vo,Ti,Ao,Ii,_o,kt=class extends Ca{constructor(){super();T(this,Xe);T(this,Ee);T(this,Je);T(this,wt);T(this,vi);T(this,Ai);T(this,_i);T(this,yi);T(this,Ti);T(this,Ii);T(this,xe,!1);T(this,Lt,{});T(this,ue,!0);T(this,Ct,new ii(this,"hotkeys"));T(this,je,void 0);T(this,ae,{...bo,onCloseErrorDialog:()=>I(this,Ee,ze).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{ya(this,G.activeElement)||e.preventDefault()},onSeekToLive:()=>ka(this)});this.attachShadow({mode:"open"}),this.isConnected&&I(this,Xe,fi).call(this)}static get observedAttributes(){var e;return[...(e=Ca.observedAttributes)!=null?e:[],...Vl,...Hl]}get theme(){var e,a;return Array.from((a=(e=this.shadowRoot)==null?void 0:e.children)!=null?a:[]).find(({localName:r})=>r.startsWith("media-theme-"))}get mediaController(){var e,a;return(a=(e=this.theme)==null?void 0:e.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){I(this,wt,Na).call(this),I(this,vi,Eo).call(this)}disconnectedCallback(){I(this,Ai,fo).call(this)}attributeChangedCallback(e,a,r){switch(g(this,xe)||I(this,Xe,fi).call(this),super.attributeChangedCallback(e,a,r),e){case b.HOTKEYS:g(this,Ct).value=r;break;case b.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Ie(A("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case b.THUMBNAIL_TOKEN:{let{aud:s}=Et(r);r&&s!=="t"&&Ie(A("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case b.STORYBOARD_TOKEN:{let{aud:s}=Et(r);r&&s!=="s"&&Ie(A("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")&&X(A("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&&!Ol.includes(this.streamType)&&ri({file:"invalid-stream-type.md",message:A("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})}):ri({file:"invalid-stream-type.md",message:String(A("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,St.SRC,b.PLAYBACK_TOKEN].includes(e)&&a!==r&&B(this,ae,{...g(this,ae),...bo}),I(this,Je,gi).call(this,{[ln(e)]:r})}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){return g(this,ae).inLiveWindow}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get audio(){return this.hasAttribute(b.AUDIO)}set audio(e){if(!e){this.removeAttribute(b.AUDIO);return}this.setAttribute(b.AUDIO,"")}get hotkeys(){return g(this,Ct)}get nohotkeys(){return this.hasAttribute(b.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(b.NOHOTKEYS);return}this.setAttribute(b.NOHOTKEYS,"")}get thumbnailTime(){return _e(this.getAttribute(b.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(b.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(b.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(b.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=De(this,b.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(b.PLACEHOLDER,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(b.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(b.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(b.SECONDARY_COLOR))!=null?e:void 0}set secondaryColor(e){this.setAttribute(b.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(b.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(b.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(b.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(b.PLAYBACK_RATES))return this.getAttribute(b.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,a)=>e-a)}set playbackRates(e){if(!e){this.removeAttribute(b.PLAYBACK_RATES);return}this.setAttribute(b.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=_e(this.getAttribute(b.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(b.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=_e(this.getAttribute(b.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(b.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(b.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(b.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(b.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_NAME))!=null?e:Fl}get playerSoftwareVersion(){var e;return(e=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_VERSION))!=null?e:Wl}get beaconCollectionDomain(){var e;return(e=this.getAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN))}get playbackId(){var e;return(e=this.getAttribute(v.Attributes.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(v.Attributes.PLAYBACK_ID,e):this.removeAttribute(v.Attributes.PLAYBACK_ID)}get src(){var e,a;return this.playbackId?(e=De(this,St.SRC))!=null?e:void 0:(a=this.getAttribute(St.SRC))!=null?a:void 0}set src(e){e?this.setAttribute(St.SRC,e):this.removeAttribute(St.SRC)}get customDomain(){var e;return(e=this.getAttribute(v.Attributes.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(v.Attributes.CUSTOM_DOMAIN,e):this.removeAttribute(v.Attributes.CUSTOM_DOMAIN))}get envKey(){var e;return(e=De(this,v.Attributes.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(v.Attributes.ENV_KEY,`${e}`)}get debug(){return De(this,v.Attributes.DEBUG)!=null}set debug(e){e?this.setAttribute(v.Attributes.DEBUG,""):this.removeAttribute(v.Attributes.DEBUG)}get streamType(){return De(this,v.Attributes.STREAM_TYPE)}set streamType(e){this.setAttribute(v.Attributes.STREAM_TYPE,`${e}`)}get startTime(){return _e(De(this,v.Attributes.START_TIME))}set startTime(e){this.setAttribute(v.Attributes.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(v.Attributes.PREFER_PLAYBACK);if(e===D.PlaybackTypes.MSE||e===D.PlaybackTypes.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===D.PlaybackTypes.MSE||e===D.PlaybackTypes.NATIVE?this.setAttribute(v.Attributes.PREFER_PLAYBACK,e):this.removeAttribute(v.Attributes.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(g(this,xe)||I(this,Xe,fi).call(this),!this.media){X("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=e}get tokens(){let e=this.getAttribute(b.PLAYBACK_TOKEN),a=this.getAttribute(b.THUMBNAIL_TOKEN),r=this.getAttribute(b.STORYBOARD_TOKEN);return{...g(this,Lt),...e!=null?{playback:e}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(e){B(this,Lt,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(b.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(b.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(b.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(b.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(b.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(b.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(!!s)return(0,D.addTextTrack)(s,e,a,r,n)}removeTextTrack(e){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,D.removeTextTrack)(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};xe=new WeakMap,Lt=new WeakMap,ue=new WeakMap,Ct=new WeakMap,je=new WeakMap,ae=new WeakMap,Xe=new WeakSet,fi=function(){var e,a,r;if(!g(this,xe)){B(this,xe,!0),I(this,Ee,ze).call(this,{playerSize:Ei(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof M.HTMLElement))throw""}catch{X(`<${(e=this.theme)==null?void 0:e.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof v.default))throw""}catch{X("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ct))throw""}catch{X("<media-controller> failed to upgrade!")}pn(this),I(this,yi,vo).call(this),I(this,Ti,Ao).call(this),I(this,_i,go).call(this),B(this,ue,(r=(a=this.mediaController)==null?void 0:a.hasAttribute("user-inactive"))!=null?r:!0),I(this,Ii,_o).call(this)}},Ee=new WeakSet,ze=function(e){Object.assign(g(this,ae),e),I(this,Je,gi).call(this)},Je=new WeakSet,gi=function(e={}){di(po(Bl(this,{...g(this,ae),...e})),this.shadowRoot)},wt=new WeakSet,Na=function(){var e,a;g(this,ae).playerSize!=Ei((e=this.mediaController)!=null?e:this)&&I(this,Ee,ze).call(this,{playerSize:Ei((a=this.mediaController)!=null?a:this)})},vi=new WeakSet,Eo=function(){var e;B(this,je,new ResizeObserver(()=>I(this,wt,Na).call(this))),g(this,je).observe((e=this.mediaController)!=null?e:this)},Ai=new WeakSet,fo=function(){var e;(e=g(this,je))==null||e.disconnect()},_i=new WeakSet,go=function(){var a,r,n,s,l;(a=this.mediaController)==null||a.addEventListener("mediaplayrequest",c=>{var m;((m=c.target)==null?void 0:m.localName)==="media-play-button"&&this.streamType&&[D.StreamTypes.LIVE,D.StreamTypes.LL_LIVE,D.StreamTypes.DVR,D.StreamTypes.LL_DVR].includes(this.streamType)&&this.hasPlayed&&ka(this)});let e=()=>{let c=cn(this),m=g(this,ae).inLiveWindow;c!==m&&(I(this,Ee,ze).call(this,{inLiveWindow:c}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(r=this.media)==null||r.addEventListener("progress",e),(n=this.media)==null||n.addEventListener("waiting",e),(s=this.media)==null||s.addEventListener("timeupdate",e),(l=this.media)==null||l.addEventListener("emptied",e)},yi=new WeakSet,vo=function(){var a;let e=r=>{let{detail:n}=r;if(n instanceof v.MediaError||(n=new v.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Ie(n),n.data&&Ie(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=bi(n,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&ri(l),X(n),n.data&&X(`${n.name} data:`,n.data),I(this,Ee,ze).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,c;if(!((s=this.media)!=null&&s.error))return r;let{devlog:n}=bi((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(c=this.media)==null?void 0:c.error.code,player_error_message:n.message?String(n.message):r.player_error_message}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:c,code:m}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new v.MediaError(c,m)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Ti=new WeakSet,Ao=function(){var a,r,n,s;let e=()=>I(this,Je,gi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",e),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",e)},Ii=new WeakSet,_o=function(){var f,y,S;let e=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(a)return;let r,n=new WeakMap,s=()=>this.streamType&&[D.StreamTypes.LIVE,D.StreamTypes.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,l=(_,N,x=!1)=>{if(s())return;Array.from(_&&_.activeCues||[]).forEach(L=>{if(!(!L.snapToLines||L.line<-5||L.line>=0&&L.line<10))if(!N||this.paused){let re=L.text.split(`
1626
- `).length,Y=a?-2:-3;this.streamType&&[D.StreamTypes.LIVE,D.StreamTypes.LL_LIVE].includes(this.streamType)&&(Y=a?-1:-2);let ne=Y-re;if(L.line===ne&&!x)return;n.has(L)||n.set(L,L.line),L.line=ne-1,L.line=ne}else setTimeout(()=>{L.line=n.get(L)||"auto"},500)})},c=()=>{var _;l(r,(_=e==null?void 0:e.hasAttribute("user-inactive"))!=null?_:!1)},m=()=>{var x;let N=Array.from(((x=e==null?void 0:e.media)==null?void 0:x.textTracks)||[]).filter(U=>["subtitles","captions"].includes(U.kind)&&U.mode==="showing")[0];N!==r&&(r==null||r.removeEventListener("cuechange",c)),r=N,r==null||r.addEventListener("cuechange",c),l(r,g(this,ue))};if(m(),(f=e==null?void 0:e.media)==null||f.textTracks.addEventListener("change",m),(y=e==null?void 0:e.media)==null||y.textTracks.addEventListener("addtrack",m),navigator.userAgent.includes("Chrome/")){let _=()=>{l(r,g(this,ue),!0),this.paused||window.requestAnimationFrame(_)};(S=e==null?void 0:e.media)==null||S.addEventListener("playing",()=>{_()})}e==null||e.addEventListener("userinactivechange",()=>{let _=e==null?void 0:e.hasAttribute("user-inactive");g(this,ue)!==_&&(B(this,ue,_),l(r,g(this,ue)))})};function De(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}M.customElements.get("mux-player")||(M.customElements.define("mux-player",kt),M.MuxPlayerElement=kt);var Kl=kt;
1622
+ </${xa((er=Ma(t.theme))!=null?er:"media-theme-mux")}>
1623
+ `};var St=require("@mux/mux-video");function bi(t,i,e,a,r){var l,c,m;let n={},s={};switch(t.code){case St.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=A("Network Error",r),n.message=t.message,(l=t.data)==null?void 0:l.response.code){case 412:{n.title=A("Video is not currently available",r),n.message=A("The live stream or video file are not yet ready.",r),s.message=A("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=A("Video does not exist",r),n.message="",s.message=A("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=A("Invalid playback URL",r),n.message=A("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=A("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:E,aud:y,sub:S}=Et(a),_=Date.now()>E*1e3,O=S!==e,x=y!=="v",P={timeStyle:"medium",dateStyle:"medium"};if(_){n.title=A("Video URL has expired",r),n.message=A("The video\u2019s secured playback-token has expired.",r),s.message=A("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(_e.code,P).format(E*1e3),currentDate:new Intl.DateTimeFormat(_e.code,P).format(Date.now())}),s.file="403-expired-token.md";break}if(O){n.title=A("Video URL is formatted incorrectly",r),n.message=A("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=A("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:e,tokenPlaybackId:S}),s.file="403-playback-id-mismatch.md";break}if(x){n.title=A("Video URL is formatted incorrectly",r),n.message=A("The playback-token is formatted with incorrect information.",r),s.message=A("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=A("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 St.MediaError.MEDIA_ERR_DECODE:{let{message:E}=t;n={title:A("Media Error",r),message:E},s.file="media-decode-error.md";break}case St.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let E=(m=(c=t.data)==null?void 0:c.response)==null?void 0:m.code;if(E>=400&&E<500){t.code=St.MediaError.MEDIA_ERR_NETWORK,t.data={response:{code:E}},{dialog:n,devlog:s}=bi(t,i,e,a);break}n={title:A("Source Not Supported",r),message:t.message},s.file="media-src-not-supported.md";break}default:n={title:A("Error",r),message:t.message};break}return i&&(n={title:A("Your device appears to be offline",r),message:A("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var ql=Object.values(D.StreamTypes),zl=700,jl=300,Ua={LG:"large",SM:"small",XS:"extra-small"};function Ei(t){let i=t.getBoundingClientRect();return i.width<jl?Ua.XS:i.width<zl?Ua.SM:Ua.LG}var ue={SRC:"src",POSTER:"poster"},b={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",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 Xl(t,i){var e,a;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src,poster:t.poster,placeholder:t.getAttribute("placeholder"),theme:t.getAttribute("theme"),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(b.NOHOTKEYS),hotKeys:t.getAttribute(b.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,debug:t.debug,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,streamType:t.streamType,primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultShowRemainingTime:t.defaultShowRemainingTime,playbackRates:t.getAttribute(b.PLAYBACK_RATES),customDomain:(e=t.getAttribute(v.Attributes.CUSTOM_DOMAIN))!=null?e:void 0,playerSize:Ei((a=t.mediaController)!=null?a:t),metadataVideoId:t.getAttribute(v.Attributes.METADATA_VIDEO_ID),metadataVideoTitle:t.getAttribute(v.Attributes.METADATA_VIDEO_TITLE),metadataViewerUserId:t.getAttribute(v.Attributes.METADATA_VIEWER_USER_ID),title:t.getAttribute(b.TITLE),...i}}var Jl=Object.values(v.Attributes),ed=Object.values(ue),td=Object.values(b),id=ai(),ad="mux-player",ko={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},Re,Lt,me,Ct,je,ae,Xe,fi,fe,ze,Je,gi,wt,Oa,vi,Lo,Ai,Co,_i,wo,yi,Do,Ti,xo,Ii,Ro,kt=class extends La{constructor(){super();T(this,Xe);T(this,fe);T(this,Je);T(this,wt);T(this,vi);T(this,Ai);T(this,_i);T(this,yi);T(this,Ti);T(this,Ii);T(this,Re,!1);T(this,Lt,{});T(this,me,!0);T(this,Ct,new ii(this,"hotkeys"));T(this,je,void 0);T(this,ae,{...ko,onCloseErrorDialog:()=>I(this,fe,ze).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{ya(this,G.activeElement)||e.preventDefault()},onSeekToLive:()=>Sa(this)});this.attachShadow({mode:"open"}),this.isConnected&&I(this,Xe,fi).call(this)}static get observedAttributes(){var e;return[...(e=La.observedAttributes)!=null?e:[],...ed,...Jl,...td]}get theme(){var e,a;return Array.from((a=(e=this.shadowRoot)==null?void 0:e.children)!=null?a:[]).find(({localName:r})=>r.startsWith("media-theme-"))}get mediaController(){var e,a;return(a=(e=this.theme)==null?void 0:e.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){I(this,wt,Oa).call(this),I(this,vi,Lo).call(this)}disconnectedCallback(){I(this,Ai,Co).call(this)}attributeChangedCallback(e,a,r){switch(g(this,Re)||I(this,Xe,fi).call(this),super.attributeChangedCallback(e,a,r),e){case b.HOTKEYS:g(this,Ct).value=r;break;case b.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Me(A("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case b.THUMBNAIL_TOKEN:{let{aud:s}=Et(r);r&&s!=="t"&&Me(A("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case b.STORYBOARD_TOKEN:{let{aud:s}=Et(r);r&&s!=="s"&&Me(A("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")&&X(A("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&&!ql.includes(this.streamType)&&ri({file:"invalid-stream-type.md",message:A("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})}):ri({file:"invalid-stream-type.md",message:String(A("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,ue.SRC,b.PLAYBACK_TOKEN].includes(e)&&a!==r&&B(this,ae,{...g(this,ae),...ko}),I(this,Je,gi).call(this,{[An(e)]:r})}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){return g(this,ae).inLiveWindow}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get playbackId(){var e;return(e=this.getAttribute(v.Attributes.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(v.Attributes.PLAYBACK_ID,e):this.removeAttribute(v.Attributes.PLAYBACK_ID)}get src(){var e,a;return this.playbackId?(e=xe(this,ue.SRC))!=null?e:void 0:(a=this.getAttribute(ue.SRC))!=null?a:void 0}set src(e){e?this.setAttribute(ue.SRC,e):this.removeAttribute(ue.SRC)}get poster(){var a;let e=this.getAttribute(ue.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return gn(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(ue.POSTER,e):this.removeAttribute(ue.POSTER)}get audio(){return this.hasAttribute(b.AUDIO)}set audio(e){if(!e){this.removeAttribute(b.AUDIO);return}this.setAttribute(b.AUDIO,"")}get hotkeys(){return g(this,Ct)}get nohotkeys(){return this.hasAttribute(b.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(b.NOHOTKEYS);return}this.setAttribute(b.NOHOTKEYS,"")}get thumbnailTime(){return ye(this.getAttribute(b.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(b.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(b.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(b.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=xe(this,b.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(b.PLACEHOLDER,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(b.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(b.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(b.SECONDARY_COLOR))!=null?e:void 0}set secondaryColor(e){this.setAttribute(b.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(b.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(b.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(b.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(b.PLAYBACK_RATES))return this.getAttribute(b.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,a)=>e-a)}set playbackRates(e){if(!e){this.removeAttribute(b.PLAYBACK_RATES);return}this.setAttribute(b.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=ye(this.getAttribute(b.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(b.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=ye(this.getAttribute(b.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(b.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(b.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(b.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(b.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_NAME))!=null?e:ad}get playerSoftwareVersion(){var e;return(e=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_VERSION))!=null?e:id}get beaconCollectionDomain(){var e;return(e=this.getAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN))}get customDomain(){var e;return(e=this.getAttribute(v.Attributes.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(v.Attributes.CUSTOM_DOMAIN,e):this.removeAttribute(v.Attributes.CUSTOM_DOMAIN))}get envKey(){var e;return(e=xe(this,v.Attributes.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(v.Attributes.ENV_KEY,`${e}`)}get debug(){return xe(this,v.Attributes.DEBUG)!=null}set debug(e){e?this.setAttribute(v.Attributes.DEBUG,""):this.removeAttribute(v.Attributes.DEBUG)}get streamType(){return xe(this,v.Attributes.STREAM_TYPE)}set streamType(e){this.setAttribute(v.Attributes.STREAM_TYPE,`${e}`)}get startTime(){return ye(xe(this,v.Attributes.START_TIME))}set startTime(e){this.setAttribute(v.Attributes.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(v.Attributes.PREFER_PLAYBACK);if(e===D.PlaybackTypes.MSE||e===D.PlaybackTypes.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===D.PlaybackTypes.MSE||e===D.PlaybackTypes.NATIVE?this.setAttribute(v.Attributes.PREFER_PLAYBACK,e):this.removeAttribute(v.Attributes.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(g(this,Re)||I(this,Xe,fi).call(this),!this.media){X("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=e}get tokens(){let e=this.getAttribute(b.PLAYBACK_TOKEN),a=this.getAttribute(b.THUMBNAIL_TOKEN),r=this.getAttribute(b.STORYBOARD_TOKEN);return{...g(this,Lt),...e!=null?{playback:e}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(e){B(this,Lt,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(b.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(b.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(b.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(b.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(b.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(b.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(!!s)return(0,D.addTextTrack)(s,e,a,r,n)}removeTextTrack(e){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,D.removeTextTrack)(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};Re=new WeakMap,Lt=new WeakMap,me=new WeakMap,Ct=new WeakMap,je=new WeakMap,ae=new WeakMap,Xe=new WeakSet,fi=function(){var e,a,r;if(!g(this,Re)){B(this,Re,!0),I(this,fe,ze).call(this,{playerSize:Ei(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof M.HTMLElement))throw""}catch{X(`<${(e=this.theme)==null?void 0:e.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof v.default))throw""}catch{X("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ct))throw""}catch{X("<media-controller> failed to upgrade!")}Sn(this),I(this,yi,Do).call(this),I(this,Ti,xo).call(this),I(this,_i,wo).call(this),B(this,me,(r=(a=this.mediaController)==null?void 0:a.hasAttribute("user-inactive"))!=null?r:!0),I(this,Ii,Ro).call(this)}},fe=new WeakSet,ze=function(e){Object.assign(g(this,ae),e),I(this,Je,gi).call(this)},Je=new WeakSet,gi=function(e={}){di(So(Xl(this,{...g(this,ae),...e})),this.shadowRoot)},wt=new WeakSet,Oa=function(){var e,a;g(this,ae).playerSize!=Ei((e=this.mediaController)!=null?e:this)&&I(this,fe,ze).call(this,{playerSize:Ei((a=this.mediaController)!=null?a:this)})},vi=new WeakSet,Lo=function(){var e;B(this,je,new ResizeObserver(()=>I(this,wt,Oa).call(this))),g(this,je).observe((e=this.mediaController)!=null?e:this)},Ai=new WeakSet,Co=function(){var e;(e=g(this,je))==null||e.disconnect()},_i=new WeakSet,wo=function(){var a,r,n,s,l;(a=this.mediaController)==null||a.addEventListener("mediaplayrequest",c=>{var m;((m=c.target)==null?void 0:m.localName)==="media-play-button"&&this.streamType&&[D.StreamTypes.LIVE,D.StreamTypes.LL_LIVE,D.StreamTypes.DVR,D.StreamTypes.LL_DVR].includes(this.streamType)&&this.hasPlayed&&Sa(this)});let e=()=>{let c=yn(this),m=g(this,ae).inLiveWindow;c!==m&&(I(this,fe,ze).call(this,{inLiveWindow:c}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(r=this.media)==null||r.addEventListener("progress",e),(n=this.media)==null||n.addEventListener("waiting",e),(s=this.media)==null||s.addEventListener("timeupdate",e),(l=this.media)==null||l.addEventListener("emptied",e)},yi=new WeakSet,Do=function(){var a;let e=r=>{let{detail:n}=r;if(n instanceof v.MediaError||(n=new v.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Me(n),n.data&&Me(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=bi(n,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&ri(l),X(n),n.data&&X(`${n.name} data:`,n.data),I(this,fe,ze).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,c;if(!((s=this.media)!=null&&s.error))return r;let{devlog:n}=bi((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(c=this.media)==null?void 0:c.error.code,player_error_message:n.message?String(n.message):r.player_error_message}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:c,code:m}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new v.MediaError(c,m)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Ti=new WeakSet,xo=function(){var a,r,n,s;let e=()=>I(this,Je,gi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",e),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",e)},Ii=new WeakSet,Ro=function(){var E,y,S;let e=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(a)return;let r,n=new WeakMap,s=()=>this.streamType&&[D.StreamTypes.LIVE,D.StreamTypes.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,l=(_,O,x=!1)=>{if(s())return;Array.from(_&&_.activeCues||[]).forEach(L=>{if(!(!L.snapToLines||L.line<-5||L.line>=0&&L.line<10))if(!O||this.paused){let re=L.text.split(`
1624
+ `).length,Y=a?-2:-3;this.streamType&&[D.StreamTypes.LIVE,D.StreamTypes.LL_LIVE].includes(this.streamType)&&(Y=a?-1:-2);let ne=Y-re;if(L.line===ne&&!x)return;n.has(L)||n.set(L,L.line),L.line=ne-1,L.line=ne}else setTimeout(()=>{L.line=n.get(L)||"auto"},500)})},c=()=>{var _;l(r,(_=e==null?void 0:e.hasAttribute("user-inactive"))!=null?_:!1)},m=()=>{var x;let O=Array.from(((x=e==null?void 0:e.media)==null?void 0:x.textTracks)||[]).filter(P=>["subtitles","captions"].includes(P.kind)&&P.mode==="showing")[0];O!==r&&(r==null||r.removeEventListener("cuechange",c)),r=O,r==null||r.addEventListener("cuechange",c),l(r,g(this,me))};if(m(),(E=e==null?void 0:e.media)==null||E.textTracks.addEventListener("change",m),(y=e==null?void 0:e.media)==null||y.textTracks.addEventListener("addtrack",m),navigator.userAgent.includes("Chrome/")){let _=()=>{l(r,g(this,me),!0),this.paused||window.requestAnimationFrame(_)};(S=e==null?void 0:e.media)==null||S.addEventListener("playing",()=>{_()})}e==null||e.addEventListener("userinactivechange",()=>{let _=e==null?void 0:e.hasAttribute("user-inactive");g(this,me)!==_&&(B(this,me,_),l(r,g(this,me)))})};function xe(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}M.customElements.get("mux-player")||(M.customElements.define("mux-player",kt),M.MuxPlayerElement=kt);var rd=kt;