@mux/mux-player 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var 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=`
1
+ "use strict";var No=Object.create;var xt=Object.defineProperty;var $o=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var Vo=Object.getPrototypeOf,Ho=Object.prototype.hasOwnProperty;var Wo=(t,i)=>{for(var e in i)xt(t,e,{get:i[e],enumerable:!0})},ar=(t,i,e,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Bo(i))!Ho.call(t,r)&&r!==e&&xt(t,r,{get:()=>i[r],enumerable:!(a=$o(i,r))||a.enumerable});return t};var Fo=(t,i,e)=>(e=t!=null?No(Vo(t)):{},ar(i||!t||!t.__esModule?xt(e,"default",{value:t,enumerable:!0}):e,t)),Ko=t=>ar(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 sd={};Wo(sd,{MediaError:()=>v.MediaError,default:()=>od,getVideoAttribute:()=>Re});module.exports=Ko(sd);var Oe=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Oe{}globalThis.DocumentFragment=t}var tt=class extends Oe{},Si=class extends Oe{},Yo={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(tt)}},it,ki=class{constructor(i,e={}){T(this,it,void 0);B(this,it,e==null?void 0:e.detail)}get detail(){return g(this,it)}initCustomEvent(){}};it=new WeakMap;function Go(t,i){return new tt}var rr={document:{createElement:Go},DocumentFragment,customElements:Yo,CustomEvent:ki,EventTarget:Oe,HTMLElement:tt,HTMLVideoElement:Si},nr=typeof window=="undefined"||typeof globalThis.customElements=="undefined",M=nr?rr:globalThis,G=nr?rr.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"},at={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"},cd=Object.entries(at).reduce((t,[i,e])=>{let a=o[i];return a&&(t[e]=a),t},{userinactivechange:"user-inactive"}),or=Object.entries(o).reduce((t,[i,e])=>{let a=at[i];return a&&(t[e]=a),t},{"user-inactive":"userinactivechange"}),Ne={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`},Qo={...N,...k};var qo=t=>typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t),sr=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],zo=(t,i)=>{let e=t===1?sr[i].singular:sr[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&&zo(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 lr={HTMLElement:function(){this.addEventListener=()=>{},this.removeEventListener=()=>{},this.dispatchEvent=()=>{}},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},Xo={createElement:function(){return new lr.HTMLElement}},dr=typeof window=="undefined"||typeof window.customElements=="undefined",u=dr?lr:window,d=dr?Xo:window.document;function p(t,i){u.customElements.get(t)||(u.customElements.define(t,i),u[i.name]=i)}var Jo=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},Ae=(t,i,e)=>(Jo(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,$e,wi,cr=d.createElement("template");cr.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",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">
53
+ `;var Pt=class extends u.HTMLElement{constructor(i={}){super(),Ci(this,Rt,n=>{this.handleClick(n)}),Ci(this,$e,n=>{let{key:s}=n;if(!this.keysUsed.includes(s)){this.removeEventListener("keyup",Ae(this,$e));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",Ae(this,$e));return}this.addEventListener("keyup",Ae(this,$e),{once:!0})});let e=this.attachShadow({mode:"open"}),a=cr.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",Ae(this,Rt)),this.addEventListener("keydown",Ae(this,wi)),this.setAttribute("tabindex",0)}disable(){this.removeEventListener("click",Ae(this,Rt)),this.removeEventListener("keyup",Ae(this,$e)),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;$e=new WeakMap;wi=new WeakMap;p("media-chrome-button",Pt);var C=Pt;var es=`<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
- `,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=`
56
+ `,ur=d.createElement("template");ur.innerHTML=`
57
+ <slot name="airplay">${es}</slot>
58
+ `;var Di=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(i={}){super({slotTemplate:ur,...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 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"/></g></svg>',is='<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>',hr=d.createElement("template");hr.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">${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=`
72
+ <slot name="enter">${ts}</slot>
73
+ <slot name="exit">${is}</slot>
74
+ `;var mr=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:hr,...i})}connectedCallback(){mr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_CASTING&&mr(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)},as=(t,i)=>{let e=`slot[name="${i}"]`,a=t.shadowRoot.querySelector(e);return a?a.children:[]},Ot=(t,i)=>as(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 br=d.createElement("template");br.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=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=`
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=br.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=pr(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=pr(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 pr(t){let i=t.getAttribute(o.MEDIA_CONTROLLER);return i?d.getElementById(i):Ri(t,"media-controller")}p("media-gesture-receiver",Pi);var Er=d.createElement("template");Er.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 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=`
192
+ `;var rs=Object.values(o),Nt=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Er.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(rs)}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(at.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{this.removeAttribute("user-inactive");let s=new u.CustomEvent(at.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 fr=Nt;var gr=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},U=(t,i,e)=>(gr(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)=>(gr(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),Be,Ve,W,$t=class{constructor(i,e){Ui(this,Be,void 0),Ui(this,Ve,void 0),Ui(this,W,[]),Oi(this,Be,i),Oi(this,Ve,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,Be))!=null&&e.hasAttribute(`${U(this,Ve)}`)))&&((a=U(this,Be))==null||a.setAttribute(`${U(this,Ve)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{U(this,W).splice(U(this,W).indexOf(a),1)}),(e=U(this,Be))==null||e.setAttribute(`${U(this,Ve)}`,`${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)}};Be=new WeakMap;Ve=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+/),vr=(t="")=>{let[i,e]=t.split(":"),a=e?decodeURIComponent(e):void 0;return{language:i,label:a}},ns=(t="",i={})=>Ni(t).map(e=>{let a=vr(e);return{...i,...a}}),os=t=>Array.isArray(t)?t.map(i=>typeof i=="string"?vr(i):i):typeof t=="string"?ns(t):[t],ss=({label:t,language:i}={})=>t?`${i}:${encodeURIComponent(t)}`:i,Q=(t=[])=>Array.prototype.map.call(t,ss).join(" "),ls=(t,i)=>e=>e[t]===i,Ar=t=>{let i=Object.entries(t).map(([e,a])=>ls(e,a));return e=>i.every(a=>a(e))},nt=(t,i=[],e=[])=>{let a=os(e).map(Ar),r=n=>a.some(s=>s(n));Array.from(i).filter(r).forEach(n=>{n.mode=t})},He=(t,i=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let e=typeof i=="function"?i:Ar(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 Ir=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},We=(t,i,e)=>(Ir(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)},Fe=(t,i,e)=>(Ir(t,i,"access private method"),e),he,Ke,dt,Wt,Hi,Mr=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],ds=10,_r=0,Kt=class extends fr{constructor(){super(),Bi(this,Ke),Bi(this,Wt),Bi(this,he,new $t(this,"hotkeys")),gs||(this._airplayUnavailable=Z.UNSUPPORTED),Tr||(this._fullscreenUnavailable=Z.UNAVAILABLE),vs||(this._castUnavailable=Z.UNSUPPORTED),Es||(this._pipUnavailable=Z.UNSUPPORTED),lt!==void 0?lt||(this._volumeUnavailable=Z.UNSUPPORTED):fs.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(!Tr){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]=He(r,{kind:Ne.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,Sr(this))},"playing,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((e=this.media)!=null&&e.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,kr(this)),this.propagateMediaState(o.MEDIA_VOLUME,Lr(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,Cr(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,wr(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,Dr(this))},"loadedmetadata,emptied,progress":()=>{var e;this.propagateMediaState(o.MEDIA_SEEKABLE,(e=xr(this))==null?void 0:e.join(":"))},"progress,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_BUFFERED,_s((e=this.media)==null?void 0:e.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Rr(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(yr(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,Q(Wi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,Q(yr(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"&&(We(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){_e(this.mediaStateReceivers,i,e);let a=new u.CustomEvent(or[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=hs(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),_e([i],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),_e([i],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),_e([i],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),_e([i],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),_e([i],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||_e([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",Fe(this,Wt,Hi))}disableHotkeys(){this.removeEventListener("keydown",Fe(this,Wt,Hi)),this.removeEventListener("keyup",Fe(this,Ke,dt))}get hotkeys(){return We(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=ds;if(!We(this,he).contains(`no${i.key.toLowerCase()}`)&&!(i.key===" "&&We(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:_r,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:_r,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;Ke=new WeakSet;dt=function(t){let{key:i}=t;if(!Mr.includes(i)){this.removeEventListener("keyup",Fe(this,Ke,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",Fe(this,Ke,dt));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(We(this,he).contains(`no${a.toLowerCase()}`)||a===" "&&We(this,he).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",Fe(this,Ke,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 Sr(t)},[o.MEDIA_MUTED](t){return kr(t)},[o.MEDIA_VOLUME](t){return Lr(t)},[o.MEDIA_VOLUME_LEVEL](t){return Cr(t)},[o.MEDIA_CURRENT_TIME](t){return wr(t)},[o.MEDIA_DURATION](t){return Dr(t)},[o.MEDIA_SEEKABLE](t){var i;return(i=xr(t))==null?void 0:i.join(":")},[o.MEDIA_PLAYBACK_RATE](t){return Rr(t)}},Sr=t=>t.media?t.media.paused:!0,kr=t=>!!(t.media&&t.media.muted),Lr=t=>{let i=t.media;return i?i.volume:1},Cr=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},wr=t=>{let i=t.media;return i?i.currentTime:0},Dr=t=>{let i=t==null?void 0:t.media;return Number.isFinite(i==null?void 0:i.duration)?i.duration:NaN},xr=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))]},Rr=t=>{let i=t.media;return i?i.playbackRate:1},st=t=>He(t.media,{kind:Ne.SUBTITLES}),Ft=t=>He(t.media,{kind:Ne.CAPTIONS}),yr=t=>He(t.media,{kind:Ne.SUBTITLES,mode:ge.SHOWING}),Wi=t=>He(t.media,{kind:Ne.CAPTIONS,mode:ge.SHOWING}),cs=Object.values(o),Pr=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=>cs.includes(l)):[]},Fi=t=>!!Pr(t).length,us=async(t,i,e)=>(t.isConnected||await Ur(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)),ms=t=>{var i;return!!((i=t.closest)!=null&&i.call(t,'*[slot="media"]'))},ot=(t,i)=>{if(ms(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)},_e=(t,i,e)=>{t.forEach(a=>{!Pr(a).includes(i)||us(a,i,e)})},hs=(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,Ki=()=>{var t,i;return Ht||(Ht=(i=(t=d)==null?void 0:t.createElement)==null?void 0:i.call(t,"video"),Ht)},ps=async(t=Ki())=>{if(!t)return!1;let i=t.volume;return t.volume=i/2+.1,await Ur(0),t.volume!==i},Ur=t=>new Promise(i=>setTimeout(i,t)),bs=(t=Ki())=>typeof(t==null?void 0:t.requestPictureInPicture)=="function",Es=bs(),lt,fs=ps().then(t=>(lt=t,lt)),gs=!!u.WebKitPlaybackTargetAvailabilityEvent,vs=!!u.chrome,As=(t=Ki())=>{let i=d[w.enabled];return!i&&t&&(i="webkitSupportsFullscreen"in t),i},Tr=As();function _s(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 Nr=d.createElement("template"),Or=`
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
- `;Or.innerHTML=`
214
+ `;Nr.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
- ${Ur}
260
+ ${Or}
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
- ${Ur}
267
+ ${Or}
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(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=`
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(Nr.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 $r=d.createElement("template");$r.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(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=`
380
+ `;var Yi=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild($r.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",Yi);var Br=d.createElement("template");Br.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($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">
415
+ `;var Zt=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Br.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 Gi=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",Gi);var Zi=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",Zi);var ys="&nbsp;/&nbsp;",Ts=(t,{timesSep:i=ys}={})=>{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},Is="video not loaded, unknown time.",Ms=t=>{let i=t.mediaCurrentTime,e=t.mediaDuration||t.mediaSeekableEnd;if(i==null||e==null){t.setAttribute("aria-valuetext",Is);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)},Qi=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=Ts(this);Ms(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",Qi);var Ss=`<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>`,Ms=`<svg aria-hidden="true" viewBox="0 0 26 24">
417
+ </svg>`,ks=`<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>`,Vr=d.createElement("template");Vr.innerHTML=`
419
+ </svg>`,Hr=d.createElement("template");Hr.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">${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">
433
+ <slot name="on">${Ss}</slot>
434
+ <slot name="off">${ks}</slot>
435
+ `;var Vr=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:Hr,...i}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",N.CLOSED_CAPTIONS()),Vr(this)}attributeChangedCallback(i,e,a){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(i)&&Vr(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 zi=30,Ls=`<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)">${zi}</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>`,Kr=d.createElement("template");Kr.innerHTML=`
436
+ <slot name="forward">${Ls}</slot>
437
+ `;var Cs=0,Wr=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=k.SEEK_FORWARD_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},Fr=t=>{let i=Ot(t,"forward"),e=t.getAttribute("seek-offset");Ut(i,e)},ji=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(i={}){super({slotTemplate:Kr,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",zi),Wr(this),Fr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",zi),Fr(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:Cs)+e,n=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};p("media-seek-forward-button",ji);var ws=`<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>`,Cs=`<svg aria-hidden="true" viewBox="0 0 26 24">
439
+ </svg>`,Ds=`<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>`,Yr=d.createElement("template");Yr.innerHTML=`
441
+ </svg>`,Gr=d.createElement("template");Gr.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">${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">
455
+ <slot name="enter">${ws}</slot>
456
+ <slot name="exit">${Ds}</slot>
457
+ `;var Yr=t=>{let e=t.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?k.EXIT_FULLSCREEN():k.ENTER_FULLSCREEN();t.setAttribute("aria-label",e)},Xi=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(i={}){super({slotTemplate:Gr,...i})}connectedCallback(){Yr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_FULLSCREEN&&Yr(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",Xi);var xs=`<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>`,Gr=`<svg aria-hidden="true" viewBox="0 0 24 24">
459
+ </svg>`,Zr=`<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>`,Ds=`<svg aria-hidden="true" viewBox="0 0 24 24">
461
+ </svg>`,Rs=`<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>`,Qr=d.createElement("template");Qr.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">${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">
489
+ <slot name="off">${xs}</slot>
490
+ <slot name="low">${Zr}</slot>
491
+ <slot name="medium">${Zr}</slot>
492
+ <slot name="high">${Rs}</slot>
493
+ `;var Qr=t=>{let e=t.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?k.UNMUTE():k.MUTE();t.setAttribute("aria-label",e)},Ji=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(i={}){super({slotTemplate:qr,...i})}connectedCallback(){Qr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_VOLUME_LEVEL&&Qr(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",Ji);var zr=`<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>`,jr=d.createElement("template");jr.innerHTML=`
495
+ </svg>`,Xr=d.createElement("template");Xr.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">${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">
509
+ <slot name="enter">${zr}</slot>
510
+ <slot name="exit">${zr}</slot>
511
+ `;var jr=t=>{let e=t.getAttribute(o.MEDIA_IS_PIP)!=null?k.EXIT_PIP():k.ENTER_PIP();t.setAttribute("aria-label",e)},ea=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(i={}){super({slotTemplate:Xr,...i})}connectedCallback(){jr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_PIP&&jr(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",ea);var Ps=`<svg aria-hidden="true" viewBox="0 0 24 24">
512
512
  <path d="m6 21 15-9L6 3v18Z"/>
513
- </svg>`,Rs=`<svg aria-hidden="true" viewBox="0 0 24 24">
513
+ </svg>`,Us=`<svg aria-hidden="true" viewBox="0 0 24 24">
514
514
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
515
- </svg>`,Jr=d.createElement("template");Jr.innerHTML=`
515
+ </svg>`,en=d.createElement("template");en.innerHTML=`
516
516
  <style>
517
517
  :host([${o.MEDIA_PAUSED}]) slot[name=pause] > *,
518
518
  :host([${o.MEDIA_PAUSED}]) ::slotted([slot=pause]) {
@@ -525,11 +525,11 @@
525
525
  }
526
526
  </style>
527
527
 
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=`
528
+ <slot name="play">${Ps}</slot>
529
+ <slot name="pause">${Us}</slot>
530
+ `;var Jr=t=>{let e=t.getAttribute(o.MEDIA_PAUSED)!=null?k.PLAY():k.PAUSE();t.setAttribute("aria-label",e)},ta=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED]}constructor(i={}){super({slotTemplate:en,...i})}connectedCallback(){Jr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_PAUSED&&Jr(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",ta);var tn=[1,1.25,1.5,1.75,2],Qt=1,an=d.createElement("template");an.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: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=`
532
+ `;var ia=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,"rates"]}constructor(i={}){super({slotTemplate:an,...i}),this._rates=tn,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:tn;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",ia);var rn=d.createElement("template");rn.innerHTML=`
533
533
  <style>
534
534
  :host {
535
535
  pointer-events: none;
@@ -555,7 +555,7 @@
555
555
  </style>
556
556
 
557
557
  <img aria-hidden="true" id="image"/>
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=`
558
+ `;var Os=t=>{t.style.removeProperty("background-image")},Ns=(t,i)=>{t.style["background-image"]=`url('${i}')`},aa=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_HAS_PLAYED,"placeholder-src","src"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(rn.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?Os(this.image):Ns(this.image,a))}};p("media-poster-image",aa);var da=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},F=(t,i,e)=>(da(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)=>(da(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),ra=(t,i,e)=>(da(t,i,"access private method"),e),ht,qt,zt,Ye,pt,oa,Xt,ei,jt,sa,la,on,$s="video not loaded, unknown time.",na=t=>{let i=t.range,e=ve(+i.value),a=ve(+i.max),r=e&&a?`${e} of ${a}`:$s;i.setAttribute("aria-valuetext",r)},sn=d.createElement("template");sn.innerHTML=`
559
559
  <style>
560
560
  :host {
561
561
  --media-preview-background-color: rgba(20,20,30, .5);
@@ -648,9 +648,9 @@
648
648
 
649
649
  </slot>
650
650
  </span>
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=`
651
+ `;var Jt=class extends ut{constructor(){super(),j(this,jt),j(this,la),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=nn(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,Ye,!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,Ye,!1),F(this,Xt).call(this))}),j(this,oa,()=>{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,Ye)&&i&&(mt(this,Ye,!0),F(this,oa).call(this),u.addEventListener("pointermove",F(this,pt),!1))}),this.shadowRoot.appendChild(sn.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"]')),ra(this,jt,sa).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,na(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),na(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),na(this),this.updateBar()),i===o.MEDIA_BUFFERED&&this.updateBar(),i==="disabled"&&(a==null?ra(this,jt,sa).call(this):ra(this,la,on).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=nn(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;Ye=new WeakMap;pt=new WeakMap;oa=new WeakMap;Xt=new WeakMap;ei=new WeakMap;jt=new WeakSet;sa=function(){this.addEventListener("pointermove",F(this,ei),!1)};la=new WeakSet;on=function(){u.removeEventListener("pointermove",F(this,pt)),this.removeEventListener("pointermove",F(this,ei)),mt(this,Ye,!1),F(this,Xt).call(this)};function nn(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 ca=Jt;var ua=class extends ca{constructor(){super(),console.warn("MediaChrome: <media-progress-range> is deprecated. Use <media-time-range> instead.")}};p("media-progress-range",ua);var ma=30,Bs=`<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)">${ma}</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>`,cn=d.createElement("template");cn.innerHTML=`
652
+ <slot name="backward">${Bs}</slot>
653
+ `;var Vs=0,ln=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=k.SEEK_BACK_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},dn=t=>{let i=Ot(t,"backward"),e=t.getAttribute("seek-offset");Ut(i,e)},ha=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(i={}){super({slotTemplate:cn,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",ma),ln(this),dn(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",ma),dn(this),ln(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:Vs,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",ha);var pa=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",pa);var un=d.createElement("template");un.innerHTML=`
654
654
  <style>
655
655
  :host {
656
656
  box-sizing: border-box;
@@ -664,7 +664,7 @@
664
664
  }
665
665
  </style>
666
666
  <img crossorigin loading="eager" decoding="async" />
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=`
667
+ `;var ba=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(un.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 Ue=()=>{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,Ue()},Y.src=l,Ue()),Ue(),re.transform=`translate(-${a*P}px, -${r*P}px)`}};p("media-preview-thumbnail",ba);var mn=d.createElement("template"),Hs=`
668
668
  <svg aria-hidden="true" viewBox="0 0 100 100">
669
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">
670
670
  <animateTransform
@@ -677,7 +677,7 @@
677
677
  repeatCount="indefinite" />
678
678
  </path>
679
679
  </svg>
680
- `;un.innerHTML=`
680
+ `;mn.innerHTML=`
681
681
  <style>
682
682
  :host {
683
683
  display: inline-block;
@@ -714,28 +714,28 @@ svg, img, ::slotted(svg), ::slotted(img) {
714
714
  }
715
715
  </style>
716
716
 
717
- <slot name="loading">${Bs}</slot>
717
+ <slot name="loading">${Hs}</slot>
718
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=`
719
+ `;var Ws=500,Ea=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=mn.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:Ws);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",Ea);var hn=d.createElement("template");hn.innerHTML=`
720
720
  <style>
721
721
  :host {
722
722
  }
723
723
  </style>
724
724
  <slot></slot>
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.1"}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=`
725
+ `;var fa=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(hn.content.cloneNode(!0))}};p("media-title-bar",fa);var Fs=100,Ks=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)},Ys=({value:t,max:i})=>`${Math.round(t/i*100)}%`,ga=class extends ut{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=Fs,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=Ks(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Ys(this.range)),this.updateBar()}super.attributeChangedCallback(i,e,a)}};p("media-volume-range",ga);var Gs=Object.defineProperty,Zs=(t,i,e)=>i in t?Gs(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,Qs=(t,i,e)=>(Zs(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")}};Qs(bt,"template","");p("media-theme",bt);var va=bt;var Aa=class extends ct{};u.customElements.get("media-chrome")||u.customElements.define("media-chrome",Aa);var _a=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",_a);var v=Fo(require("@mux/mux-video")),D=require("@mux/playback-core");var Sn=require("@mux/mux-video");var qs="en",ye={code:qs};var pn="en";function A(t,i=!0){var r,n;let e=i&&(n=(r=ye)==null?void 0:r[t])!=null?n:t,a=i?ye.code:pn;return new ya(e,a)}var ya=class{constructor(i,e=(a=>(a=ye.code)!=null?a:pn)()){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 bn(t){let i="";return Object.entries(t).forEach(([e,a])=>{a!=null&&(i+=`${zs(e)}: ${a}; `)}),i?i.trim():void 0}function zs(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function En(t){return t.replace(/[-_]([a-z])/g,(i,e)=>e.toUpperCase())}function Te(t){if(t==null)return;let i=+t;return Number.isNaN(i)?void 0:i}function ti(t){let i=js(t).toString();return i?"?"+i:""}function js(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 Ta=(t,i)=>!t||!i?!1:t.contains(i)?!0:Ta(t,i.getRootNode().host);var ft=require("@mux/playback-core");var Ia="mux.com",Xs=()=>{try{return"1.1.2"}catch{}return"UNKNOWN"},Js=Xs(),ai=()=>Js,Ma=(t,{token:i,domain:e=Ia}={})=>`https://stream.${e}/${t}.m3u8${ti(!!i?{token:i}:{redundant_streams:!0})}`,vn=(t,{token:i,thumbnailTime:e,domain:a=Ia}={})=>{let r=i==null?e:void 0;return`https://image.${a}/${t}/thumbnail.jpg${ti({token:i,time:r})}`},An=(t,{token:i,domain:e=Ia}={})=>`https://image.${e}/${t}/storyboard.vtt${ti({token:i})}`;function Sa(t){if(t&&/^media-theme-[\w-]+$/.test(t))return t}var el={crossorigin:"crossOrigin",playsinline:"playsInline"};function _n(t){var i;return(i=el[t])!=null?i:En(t)}var yn=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=yn(t);if(i==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}t.currentTime=i},tl=1,il=5,fn=3,gn=.5,Tn=t=>{var n;let{streamType:i}=t,e=yn(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<=tl*(fn+gn):i===ft.StreamTypes.LIVE||i===ft.StreamTypes.DVR?r<=il*(fn+gn):!1},Ie,Me,V,ii=class{constructor(i,e){T(this,Ie,void 0);T(this,Me,void 0);T(this,V,[]);B(this,Ie,i),B(this,Me,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,Ie))!=null&&e.hasAttribute(`${g(this,Me)}`)))&&((a=g(this,Ie))==null||a.setAttribute(`${g(this,Me)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{g(this,V).splice(g(this,V).indexOf(a),1)}),(e=g(this,Ie))==null||e.setAttribute(`${g(this,Me)}`,`${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)}};Ie=new WeakMap,Me=new WeakMap,V=new WeakMap;var In=`[mux-player ${ai()}]`;function Se(...t){console.warn(In,...t)}function X(...t){console.error(In,...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}`}Se(i)}var $={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ke={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},al=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}}),rl=Sn.VideoEvents.filter(t=>t!=="error"),nl=Object.values($).filter(t=>![$.PLAYSINLINE].includes(t)),ol=Object.values(ke);function kn(t){t.querySelectorAll(":scope > track").forEach(i=>{var e;(e=t.media)==null||e.append(i.cloneNode())}),rl.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[...nl,...ol]}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 ke.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ke.VOLUME:{let r=+a;this.media&&!Number.isNaN(r)&&(this.media.volume=r);return}case ke.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:al}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=Te(this.getAttribute(ke.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(ke.PLAYBACKRATE,`${i}`):this.removeAttribute(ke.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 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 Le=new WeakMap,Ln=new WeakMap,q=class{constructor(i,e){this.expression=e,Le.set(this,i),i.updateParent("")}get attributeName(){return Le.get(this).attr.name}get attributeNamespace(){return Le.get(this).attr.namespaceURI}get value(){return Ln.get(this)}set value(i){Ln.set(this,i||""),Le.get(this).updateParent(i)}get element(){return Le.get(this).element}get booleanValue(){return Le.get(this).booleanValue}set booleanValue(i){Le.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 wa(t,i){t.value=String(i)}function Cn(t,i){return typeof i=="boolean"&&t instanceof q&&typeof t.element[t.attributeName]=="boolean"?(t.booleanValue=i,!0):!1}var Da=At(wa),sl=At((t,i)=>{Cn(t,i)||wa(t,i)});function*ll(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=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(ll(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 dl(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 cl(t,i){return i instanceof Tt&&t instanceof J?(i.renderInto(t),!0):!1}function ul(t,i){return i instanceof DocumentFragment&&t instanceof J?(i.childNodes.length&&t.replace(...i.childNodes),!0):!1}function ml(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 hl(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 pl(t,i){return i===!1&&t instanceof J?(t.replace(""),!0):!1}function bl(t,i){hl(t,i)||dl(t,i)||pl(t,i)||cl(t,i)||ul(t,i)||ml(t,i)}var xa=new WeakMap,wn=new WeakMap,Dn=new WeakMap,Tt=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(wn.get(i)!==e){wn.set(i,e);let r=new se(e,this.values,this.processor);Dn.set(i,r),i instanceof J?i.replace(...r.children):i.appendChild(r);return}let a=Dn.get(i);a&&a.update(this.values)}},xn=new Map,El=At(bl);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=xn.get(l),t===void 0&&(e.raw=e,xn.set(l,t=e)),i=a}return new Tt(t,i,El)}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 Ra=(...t)=>({$static$:t.map(i=>i instanceof Tt?i:/\w-/.test(i)?{strings:[i]}:{strings:[]})});var Pn=`
727
727
  :host {
728
728
  cursor: pointer;
729
729
  }
730
730
  media-time-display {
731
731
  color: inherit;
732
732
  }
733
- `,Pn=G.createElement("template");Pn.innerHTML=`
733
+ `,Un=G.createElement("template");Un.innerHTML=`
734
734
  <style>
735
- ${Rn}
735
+ ${Pn}
736
736
  </style>
737
737
  <media-time-display show-duration></media-time-display>
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])) {
738
+ `;var Rn=["Enter"," "],It,Ze,ci,Ge=class extends M.HTMLElement{constructor(){var e,a;super();T(this,Ze);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(!Rn.includes(r)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!Rn.includes(s)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),B(this,It,setInterval(I(this,Ze,ci).bind(this),200)),requestAnimationFrame(()=>I(this,Ze,ci).call(this))}disconnectedCallback(){clearInterval(g(this,It))}attributeChangedCallback(e,a,r){var n,s;e==="hide-duration"&&I(this,Ze,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,Ze=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","")},Ge.styles=Pn,Ge.template=Un;M.customElements.get("mxp-time-display")||(M.customElements.define("mxp-time-display",Ge),M.MxpTimeDisplay=Ge);var On=`:host(:not([audio])) {
739
739
  --secondary-color: transparent;
740
740
  }
741
741
 
@@ -961,46 +961,46 @@ media-time-display {
961
961
  flex-grow: 1;
962
962
  font-size: 21px;
963
963
  }
964
- `;var On=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
964
+ `;var Nn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
965
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"/>
966
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"/>
967
967
  </svg>
968
- `;var Nn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
968
+ `;var $n=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
969
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"/>
970
970
  </svg>
971
- `;var $n=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
971
+ `;var Bn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
972
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"/>
973
973
  </svg>
974
- `;var Bn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
974
+ `;var Vn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
975
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"/>
976
976
  <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
977
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"/>
978
978
  </svg>
979
- `;var Vn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
979
+ `;var Hn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
980
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"/>
981
981
  <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
982
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"/>
983
983
  <path d="M20.5 5.5h-15v5.811c3.52.906 6.283 3.67 7.189 7.19H20.5V5.5Z"/>
984
984
  </svg>
985
- `;var Hn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
985
+ `;var Wn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
986
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"/>
987
987
  </svg>
988
- `;var Wn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
988
+ `;var Fn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
989
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"/>
990
990
  </svg>
991
- `;var Fn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
991
+ `;var Kn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
992
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"/>
993
993
  </svg>
994
- `;var Kn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
994
+ `;var Yn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
995
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"/>
996
996
  </svg>
997
- `;var Yn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
997
+ `;var Gn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
998
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"/>
999
999
  </svg>
1000
- `;var Gn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
1000
+ `;var Zn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
1001
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"/>
1002
1002
  </svg>
1003
- `;var Zn=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
1003
+ `;var Qn=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
1004
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"/>
1005
1005
  <text
1006
1006
  class="value"
@@ -1010,7 +1010,7 @@ media-time-display {
1010
1010
  {{value}}
1011
1011
  </text>
1012
1012
  </svg>
1013
- `;var Qn=`<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">
1014
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"/>
1015
1015
  <text
1016
1016
  class="value"
@@ -1020,21 +1020,21 @@ media-time-display {
1020
1020
  {{value}}
1021
1021
  </text>
1022
1022
  </svg>
1023
- `;var qn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
1023
+ `;var zn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
1024
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"/>
1025
1025
  </svg>
1026
- `;var zn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
1026
+ `;var jn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
1027
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"/>
1028
1028
  </svg>
1029
- `;var jn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
1029
+ `;var Xn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
1030
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"/>
1031
1031
  </svg>
1032
- `;var Xn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
1032
+ `;var Jn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
1033
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"/>
1034
1034
  </svg>
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`
1035
+ `;var 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=()=>R(Zn),mo=t=>R(Qn,t),ho=t=>R(qn,t),po=()=>R(zn),bo=()=>R(jn),Eo=()=>R(Xn),fo=()=>R(Jn);var H=require("@mux/playback-core");var le={LG:"large",SM:"small",XS:"extra-small"},mi,go,ui=class extends va{constructor(){super();T(this,mi);I(this,mi,go).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`
1036
1036
  <style>
1037
- ${Un}
1037
+ ${On}
1038
1038
  </style>
1039
1039
  <media-controller
1040
1040
  gestures-disabled="${!e.hasSrc||e.isDialogOpen}"
@@ -1052,83 +1052,83 @@ media-time-display {
1052
1052
  placeholder-src="${(r=e.placeholder)!=null?r:!1}"
1053
1053
  ></media-poster-image>
1054
1054
  <media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
1055
- ${Pl(e)}
1055
+ ${Ol(e)}
1056
1056
  <slot></slot>
1057
1057
  </media-controller>
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`
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,go=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 Ol=t=>{let{streamType:i,playerSize:e,audio:a}=t;if(a)switch(i){case H.StreamTypes.LIVE:case H.StreamTypes.LL_LIVE:return Bl(t);case H.StreamTypes.DVR:case H.StreamTypes.LL_DVR:return $l(t);case H.StreamTypes.ON_DEMAND:default:return Nl(t)}switch(i){case H.StreamTypes.LIVE:case H.StreamTypes.LL_LIVE:switch(e){case le.LG:return Kl(t);case le.SM:return Fl(t);case le.XS:return Wl(t)}case H.StreamTypes.DVR:case H.StreamTypes.LL_DVR:switch(e){case le.LG:return Zl(t);case le.SM:return Gl(t);case le.XS:return Yl(t)}case H.StreamTypes.ON_DEMAND:default:switch(e){case le.LG:return Hl(t);case le.SM:return Vl(t);case le.XS:return Pa(t)}}},K=t=>f`
1059
1059
  <media-play-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1060
- ${co()}
1061
- ${oo()}
1062
- </media-play-button>`,Ze=({backwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>f`
1060
+ ${uo()}
1061
+ ${so()}
1062
+ </media-play-button>`,Qe=({backwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>f`
1063
1063
  <media-seek-backward-button seek-offset="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
1064
- ${uo({value:t})}
1065
- </media-seek-backward-button>`,Qe=({forwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>f`
1066
- <media-seek-forward-button seek-offset="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
1067
1064
  ${mo({value:t})}
1065
+ </media-seek-backward-button>`,qe=({forwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>f`
1066
+ <media-seek-forward-button seek-offset="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
1067
+ ${ho({value:t})}
1068
1068
  </media-seek-forward-button>`,ee=({isDialogOpen:t})=>f`
1069
1069
  <media-mute-button disabled="${t}" aria-disabled="${t&&"true"}">
1070
- ${ho()}
1071
- ${bo()}
1072
1070
  ${po()}
1073
1071
  ${Eo()}
1074
- </media-mute-button>`,Le=({defaultHiddenCaptions:t,isDialogOpen:i})=>f`
1072
+ ${bo()}
1073
+ ${fo()}
1074
+ </media-mute-button>`,Ce=({defaultHiddenCaptions:t,isDialogOpen:i})=>f`
1075
1075
  <media-captions-button default-showing="${!t}" disabled="${i}" aria-disabled="${i&&"true"}">
1076
- ${eo()}
1077
1076
  ${to()}
1077
+ ${io()}
1078
1078
  </media-captions-button>`,te=t=>f`
1079
1079
  <media-airplay-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1080
- ${Jn()}
1081
- </media-airplay-button>`,Ce=t=>f`
1080
+ ${eo()}
1081
+ </media-airplay-button>`,we=t=>f`
1082
1082
  <media-pip-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1083
- ${so()}
1084
1083
  ${lo()}
1085
- </media-pip-button>`,we=t=>f`
1084
+ ${co()}
1085
+ </media-pip-button>`,De=t=>f`
1086
1086
  <media-fullscreen-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1087
- ${ro()}
1088
1087
  ${no()}
1088
+ ${oo()}
1089
1089
  </media-fullscreen-button>`,ie=t=>f`
1090
1090
  <media-cast-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1091
- ${io()}
1092
1091
  ${ao()}
1092
+ ${ro()}
1093
1093
  </media-cast-button>`,hi=({playbackRates:t,isDialogOpen:i})=>f`
1094
1094
  <media-playback-rate-button rates="${t!=null?t:!1}" disabled="${i}" aria-disabled="${i&&"true"}">
1095
1095
  </media-playback-rate-button>`,de=({isDialogOpen:t})=>f`
1096
1096
  <media-volume-range disabled="${t}" aria-disabled="${t&&"true"}">
1097
- </media-volume-range>`,qe=t=>f`
1097
+ </media-volume-range>`,ze=t=>f`
1098
1098
  <media-time-range disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1099
1099
  </media-time-range>`,pi=({defaultShowRemainingTime:t,hasSrc:i,isDialogOpen:e})=>f`
1100
1100
  <mxp-time-display remaining="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
1101
1101
  </mxp-time-display>`,ce=({title:t})=>f`
1102
- <media-text-display part="title" class="title-display">${t}</media-text-display>`,Ul=t=>f`
1102
+ <media-text-display part="title" class="title-display">${t}</media-text-display>`,Nl=t=>f`
1103
1103
  ${t.title?`<media-control-bar>${ce(t)}</media-control-bar>`:f``}
1104
1104
  <media-control-bar>
1105
1105
  ${K(t)}
1106
- ${Ze(t)}
1107
1106
  ${Qe(t)}
1108
- ${pi(t)}
1109
1107
  ${qe(t)}
1108
+ ${pi(t)}
1109
+ ${ze(t)}
1110
1110
  ${ee(t)}
1111
1111
  ${de(t)}
1112
1112
  ${hi(t)}
1113
1113
  ${te(t)}
1114
1114
  ${ie(t)}
1115
1115
  </media-control-bar>
1116
- `,Ol=t=>f`
1116
+ `,$l=t=>f`
1117
1117
  ${t.title?`<media-control-bar>${ce(t)}</media-control-bar>`:f``}
1118
1118
  <media-control-bar>
1119
1119
  ${K(t)}
1120
1120
  <slot name="seek-live"></slot>
1121
- ${Ze(t)}
1122
1121
  ${Qe(t)}
1123
- ${pi(t)}
1124
1122
  ${qe(t)}
1123
+ ${pi(t)}
1124
+ ${ze(t)}
1125
1125
  ${ee(t)}
1126
1126
  ${de(t)}
1127
1127
  ${hi(t)}
1128
1128
  ${te(t)}
1129
1129
  ${ie(t)}
1130
1130
  </media-control-bar>
1131
- `,Nl=t=>f`
1131
+ `,Bl=t=>f`
1132
1132
  ${t.title?`<media-control-bar>${ce(t)}</media-control-bar>`:f``}
1133
1133
  <media-control-bar>
1134
1134
  ${K(t)}
@@ -1138,13 +1138,13 @@ media-time-display {
1138
1138
  ${te(t)}
1139
1139
  ${ie(t)}
1140
1140
  </media-control-bar>
1141
- `,Ra=t=>f`
1141
+ `,Pa=t=>f`
1142
1142
  <media-control-bar slot="top-chrome">
1143
- ${Le(t)}
1143
+ ${Ce(t)}
1144
1144
  <div class="spacer"></div>
1145
1145
  ${te(t)}
1146
1146
  ${ie(t)}
1147
- ${Ce(t)}
1147
+ ${we(t)}
1148
1148
  </media-control-bar>
1149
1149
  <div slot="centered-chrome" class="center-controls">
1150
1150
  ${K(t)}
@@ -1152,64 +1152,64 @@ media-time-display {
1152
1152
  <media-control-bar>
1153
1153
  ${ee(t)}
1154
1154
  <div class="spacer"></div>
1155
- ${we(t)}
1155
+ ${De(t)}
1156
1156
  </media-control-bar>
1157
- `,$l=t=>f`
1157
+ `,Vl=t=>f`
1158
1158
  <media-control-bar slot="top-chrome">
1159
1159
  ${t.title?ce(t):f``}
1160
1160
  <div class="spacer"></div>
1161
- ${Le(t)}
1161
+ ${Ce(t)}
1162
1162
  ${te(t)}
1163
1163
  ${ie(t)}
1164
- ${Ce(t)}
1164
+ ${we(t)}
1165
1165
  </media-control-bar>
1166
1166
  <div slot="centered-chrome" class="center-controls">
1167
- ${Ze(t)}
1168
- ${K(t)}
1169
1167
  ${Qe(t)}
1168
+ ${K(t)}
1169
+ ${qe(t)}
1170
1170
  </div>
1171
- ${qe(t)}
1171
+ ${ze(t)}
1172
1172
  <media-control-bar>
1173
1173
  ${pi(t)}
1174
1174
  ${ee(t)}
1175
1175
  ${de(t)}
1176
1176
  <div class="spacer"></div>
1177
1177
  ${hi(t)}
1178
- ${we(t)}
1178
+ ${De(t)}
1179
1179
  <div class="padding-2"></div>
1180
1180
  </media-control-bar>
1181
- `,Bl=t=>f`
1181
+ `,Hl=t=>f`
1182
1182
  <media-control-bar slot="top-chrome">
1183
1183
  ${t.title?ce(t):f``}
1184
1184
  </media-control-bar>
1185
1185
  <div slot="centered-chrome" class="center-controls">
1186
1186
  ${K(t)}
1187
1187
  </div>
1188
- ${qe(t)}
1188
+ ${ze(t)}
1189
1189
  <media-control-bar>
1190
1190
  ${K(t)}
1191
- ${Ze(t)}
1192
1191
  ${Qe(t)}
1192
+ ${qe(t)}
1193
1193
  ${pi(t)}
1194
1194
  ${ee(t)}
1195
1195
  ${de(t)}
1196
1196
  <div class="spacer"></div>
1197
1197
  ${hi(t)}
1198
- ${Le(t)}
1198
+ ${Ce(t)}
1199
1199
  ${te(t)}
1200
1200
  ${ie(t)}
1201
- ${Ce(t)}
1202
1201
  ${we(t)}
1202
+ ${De(t)}
1203
1203
  <div class="padding-2"></div>
1204
1204
  </media-control-bar>
1205
- `,Vl=Ra,Hl=t=>f`
1205
+ `,Wl=Pa,Fl=t=>f`
1206
1206
  <media-control-bar slot="top-chrome">
1207
1207
  ${t.title?ce(t):f``}
1208
1208
  <div class="spacer"></div>
1209
- ${Le(t)}
1209
+ ${Ce(t)}
1210
1210
  ${te(t)}
1211
1211
  ${ie(t)}
1212
- ${Ce(t)}
1212
+ ${we(t)}
1213
1213
  </media-control-bar>
1214
1214
  <div slot="centered-chrome" class="center-controls">
1215
1215
  ${K(t)}
@@ -1219,9 +1219,9 @@ media-time-display {
1219
1219
  ${de(t)}
1220
1220
  <slot name="seek-live"></slot>
1221
1221
  <div class="spacer"></div>
1222
- ${we(t)}
1222
+ ${De(t)}
1223
1223
  </media-control-bar>
1224
- `,Wl=t=>f`
1224
+ `,Kl=t=>f`
1225
1225
  <media-control-bar slot="top-chrome">
1226
1226
  ${t.title?ce(t):f``}
1227
1227
  </media-control-bar>
@@ -1233,59 +1233,59 @@ media-time-display {
1233
1233
  ${de(t)}
1234
1234
  <slot name="seek-live"></slot>
1235
1235
  <div class="spacer"></div>
1236
- ${Le(t)}
1236
+ ${Ce(t)}
1237
1237
  ${te(t)}
1238
1238
  ${ie(t)}
1239
- ${Ce(t)}
1240
1239
  ${we(t)}
1240
+ ${De(t)}
1241
1241
  </media-control-bar>
1242
- `,Fl=Ra,Kl=t=>f`
1242
+ `,Yl=Pa,Gl=t=>f`
1243
1243
  <media-control-bar slot="top-chrome">
1244
1244
  ${t.title?ce(t):f``}
1245
1245
  <div class="spacer"></div>
1246
- ${Le(t)}
1246
+ ${Ce(t)}
1247
1247
  ${te(t)}
1248
1248
  ${ie(t)}
1249
- ${Ce(t)}
1249
+ ${we(t)}
1250
1250
  </media-control-bar>
1251
1251
  <div slot="centered-chrome" class="center-controls">
1252
- ${Ze(t)}
1253
- ${K(t)}
1254
1252
  ${Qe(t)}
1253
+ ${K(t)}
1254
+ ${qe(t)}
1255
1255
  </div>
1256
- ${qe(t)}
1256
+ ${ze(t)}
1257
1257
  <media-control-bar>
1258
1258
  ${ee(t)}
1259
1259
  ${de(t)}
1260
1260
  <slot name="seek-live"></slot>
1261
1261
  <div class="spacer"></div>
1262
- ${we(t)}
1262
+ ${De(t)}
1263
1263
  <div class="padding-2"></div>
1264
1264
  </media-control-bar>
1265
- `,Yl=t=>f`
1265
+ `,Zl=t=>f`
1266
1266
  <media-control-bar slot="top-chrome">
1267
1267
  ${t.title?ce(t):f``}
1268
1268
  </media-control-bar>
1269
1269
  <div slot="centered-chrome" class="center-controls">
1270
1270
  ${K(t)}
1271
1271
  </div>
1272
- ${qe(t)}
1272
+ ${ze(t)}
1273
1273
  <media-control-bar>
1274
1274
  ${K(t)}
1275
- ${Ze(t)}
1276
1275
  ${Qe(t)}
1276
+ ${qe(t)}
1277
1277
  ${ee(t)}
1278
1278
  ${de(t)}
1279
1279
  <slot name="seek-live"></slot>
1280
1280
  <div class="spacer"></div>
1281
- ${Le(t)}
1281
+ ${Ce(t)}
1282
1282
  ${te(t)}
1283
1283
  ${ie(t)}
1284
- ${Ce(t)}
1285
1284
  ${we(t)}
1285
+ ${De(t)}
1286
1286
  <div class="padding-2"></div>
1287
1287
  </media-control-bar>
1288
- `;var vo=`
1288
+ `;var Ao=`
1289
1289
  :host {
1290
1290
  z-index: 100;
1291
1291
  display: flex;
@@ -1343,17 +1343,17 @@ media-time-display {
1343
1343
  text-align: center;
1344
1344
  line-height: 1.4;
1345
1345
  }
1346
- `,Ao=G.createElement("template");Ao.innerHTML=`
1346
+ `,_o=G.createElement("template");_o.innerHTML=`
1347
1347
  <style>
1348
- ${vo}
1348
+ ${Ao}
1349
1349
  </style>
1350
1350
 
1351
1351
  <div class="dialog">
1352
1352
  <slot></slot>
1353
1353
  </div>
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=`
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})),vo(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Ql(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")&&vo(this)}};Ee.styles=Ao,Ee.template=_o,Ee.observedAttributes=["open"];function vo(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=yo(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 yo(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=yo(r[n].shadowRoot),a));n++);}return a}function Ql(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}M.customElements.get("media-dialog")||(M.customElements.define("media-dialog",Ee),M.MediaDialog=Ee);var Ua=Ee;var To=G.createElement("template");To.innerHTML=`
1355
1355
  <style>
1356
- ${Pa.styles}
1356
+ ${Ua.styles}
1357
1357
 
1358
1358
  .close {
1359
1359
  background: none;
@@ -1382,7 +1382,7 @@ media-time-display {
1382
1382
  </svg>
1383
1383
  </button>
1384
1384
  </slot>
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 {
1385
+ `;var Mt=class extends Ua{constructor(){var i,e;super(),(e=(i=this.shadowRoot)==null?void 0:i.querySelector(".close"))==null||e.addEventListener("click",()=>{this.close()})}};Mt.template=To;M.customElements.get("mxp-dialog")||(M.customElements.define("mxp-dialog",Mt),M.MxpDialog=Mt);var Io=`:host {
1386
1386
  display: inline-block;
1387
1387
  width: 100%;
1388
1388
  }
@@ -1533,18 +1533,18 @@ a {
1533
1533
  ::part(title display) {
1534
1534
  display: var(--media-controls, var(--media-title-display));
1535
1535
  }
1536
- `;var De=require("@mux/playback-core"),So=t=>f`
1536
+ `;var xe=require("@mux/playback-core"),ko=t=>f`
1537
1537
  <style>
1538
- ${To}
1538
+ ${Io}
1539
1539
  </style>
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")}
1540
+ ${zl(t)}
1541
+ `,Mo=t=>[xe.StreamTypes.LIVE,xe.StreamTypes.LL_LIVE].includes(t.streamType),So=t=>[xe.StreamTypes.LIVE,xe.StreamTypes.LL_LIVE,xe.StreamTypes.DVR,xe.StreamTypes.LL_DVR].includes(t.streamType),zl=t=>{var i,e,a,r,n,s,l,c,m,E,y,S,_,O,x,P,L,re,Y,ne,Ue,Dt,$a,Ba,Va,Ha,Wa,Fa,Ka,Ya,Ga,Za,Qa,qa,za,ja,Xa,Ja,er,tr;return f`
1542
+ <${Ra((i=Sa(t.theme))!=null?i:"media-theme-mux")}
1543
1543
  has-src="${(e=t.hasSrc)!=null?e:!1}"
1544
1544
  has-open-dialog="${(a=t.isDialogOpen)!=null?a:!1}"
1545
1545
  nohotkeys="${(r=t.noHotKeys)!=null?r:!1}"
1546
1546
  audio="${(n=t.audio)!=null?n:!1}"
1547
- style="${(s=pn({"--primary-color":t.primaryColor,"--secondary-color":t.secondaryColor}))!=null?s:!1}"
1547
+ style="${(s=bn({"--primary-color":t.primaryColor,"--secondary-color":t.secondaryColor}))!=null?s:!1}"
1548
1548
  class="size-${t.playerSize}${t.secondaryColor?" two-tone":""}"
1549
1549
  stream-type="${(l=t.streamType)!=null?l:!1}"
1550
1550
  player-size="${(c=t.playerSize)!=null?c:!1}"
@@ -1565,60 +1565,60 @@ a {
1565
1565
  playsinline
1566
1566
  autoplay="${(Y=t.autoplay)!=null?Y:!1}"
1567
1567
  muted="${(ne=t.muted)!=null?ne:!1}"
1568
- loop="${(Pe=t.loop)!=null?Pe:!1}"
1568
+ loop="${(Ue=t.loop)!=null?Ue:!1}"
1569
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}"
1570
+ debug="${($a=t.debug)!=null?$a:!1}"
1571
+ prefer-playback="${(Ba=t.preferPlayback)!=null?Ba:!1}"
1572
1572
  start-time="${t.startTime!=null?t.startTime:!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}"
1582
- src="${t.src?t.src:t.playbackId?Ia(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
1583
- cast-src="${t.src?t.src:t.playbackId?Ia(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
1584
- cast-stream-type="${Io(t)?"live":!1}"
1573
+ metadata-video-id="${(Va=t.metadataVideoId)!=null?Va:!1}"
1574
+ metadata-video-title="${(Ha=t.metadataVideoTitle)!=null?Ha:!1}"
1575
+ metadata-viewer-user-id="${(Wa=t.metadataViewerUserId)!=null?Wa:!1}"
1576
+ beacon-collection-domain="${(Fa=t.beaconCollectionDomain)!=null?Fa:!1}"
1577
+ player-software-name="${(Ka=t.playerSoftwareName)!=null?Ka:!1}"
1578
+ player-software-version="${(Ya=t.playerSoftwareVersion)!=null?Ya:!1}"
1579
+ env-key="${(Ga=t.envKey)!=null?Ga:!1}"
1580
+ stream-type="${(Za=t.streamType)!=null?Za:!1}"
1581
+ custom-domain="${(Qa=t.customDomain)!=null?Qa:!1}"
1582
+ src="${t.src?t.src:t.playbackId?Ma(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
1583
+ cast-src="${t.src?t.src:t.playbackId?Ma(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
1584
+ cast-stream-type="${Mo(t)?"live":!1}"
1585
1585
  exportparts="video"
1586
1586
  >
1587
- ${t.playbackId&&!t.audio&&!Mo(t)?f`<track
1587
+ ${t.playbackId&&!t.audio&&!So(t)?f`<track
1588
1588
  label="thumbnails"
1589
1589
  default
1590
1590
  kind="metadata"
1591
- src="${vn(t.playbackId,{domain:t.customDomain,token:t.tokens.storyboard})}"
1591
+ src="${An(t.playbackId,{domain:t.customDomain,token:t.tokens.storyboard})}"
1592
1592
  />`:f``}
1593
1593
  </mux-video>
1594
- ${Mo(t)?f`<button
1594
+ ${So(t)?f`<button
1595
1595
  slot="seek-live"
1596
- part="${Io(t)?"top":"bottom"} seek-live button"
1596
+ part="${Mo(t)?"top":"bottom"} seek-live button"
1597
1597
  disabled="${t.inLiveWindow||!t.hasSrc||t.isDialogOpen}"
1598
1598
  aria-disabled="${(t.inLiveWindow||!t.hasSrc||t.isDialogOpen)&&"true"}"
1599
1599
  in-live-window="${t.inLiveWindow}"
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)}}}"
1600
+ onclick="${function(Uo){var ir;if((ir=t.onSeekToLive)==null||ir.call(t,Uo),t.paused){let Oo=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(Oo)}}}"
1601
1601
  >
1602
1602
  Live
1603
1603
  </button>`:f``}
1604
1604
  <mxp-dialog
1605
1605
  no-auto-hide
1606
- open="${(Qa=t.isDialogOpen)!=null?Qa:!1}"
1606
+ open="${(qa=t.isDialogOpen)!=null?qa:!1}"
1607
1607
  onclose="${t.onCloseErrorDialog}"
1608
1608
  oninitfocus="${t.onInitFocusDialog}"
1609
1609
  >
1610
- ${(qa=t.dialog)!=null&&qa.title?f`<h3>${t.dialog.title}</h3>`:f``}
1610
+ ${(za=t.dialog)!=null&&za.title?f`<h3>${t.dialog.title}</h3>`:f``}
1611
1611
  <p>
1612
- ${(za=t.dialog)==null?void 0:za.message}
1613
- ${(ja=t.dialog)!=null&&ja.linkUrl?f`<a
1612
+ ${(ja=t.dialog)==null?void 0:ja.message}
1613
+ ${(Xa=t.dialog)!=null&&Xa.linkUrl?f`<a
1614
1614
  href="${t.dialog.linkUrl}"
1615
1615
  target="_blank"
1616
1616
  rel="external noopener"
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
1617
+ aria-label="${(Ja=t.dialog.linkText)!=null?Ja:""} ${A("(opens in a new window)")}"
1618
+ >${(er=t.dialog.linkText)!=null?er:t.dialog.linkUrl}</a
1619
1619
  >`:f``}
1620
1620
  </p>
1621
1621
  </mxp-dialog>
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;
1622
+ </${Ra((tr=Sa(t.theme))!=null?tr:"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(ye.code,P).format(E*1e3),currentDate:new Intl.DateTimeFormat(ye.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 jl=Object.values(D.StreamTypes),Xl=700,Jl=300,Oa={LG:"large",SM:"small",XS:"extra-small"};function Ei(t){let i=t.getBoundingClientRect();return i.width<Jl?Oa.XS:i.width<Xl?Oa.SM:Oa.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 ed(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 td=Object.values(v.Attributes),id=Object.values(ue),ad=Object.values(b),rd=ai(),nd="mux-player",Lo={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},Pe,Lt,me,Ct,Xe,ae,Je,fi,fe,je,et,gi,wt,Na,vi,Co,Ai,wo,_i,Do,yi,xo,Ti,Ro,Ii,Po,kt=class extends Ca{constructor(){super();T(this,Je);T(this,fe);T(this,et);T(this,wt);T(this,vi);T(this,Ai);T(this,_i);T(this,yi);T(this,Ti);T(this,Ii);T(this,Pe,!1);T(this,Lt,{});T(this,me,!0);T(this,Ct,new ii(this,"hotkeys"));T(this,Xe,void 0);T(this,ae,{...Lo,onCloseErrorDialog:()=>I(this,fe,je).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Ta(this,G.activeElement)||e.preventDefault()},onSeekToLive:()=>ka(this)});this.attachShadow({mode:"open"}),this.isConnected&&I(this,Je,fi).call(this)}static get observedAttributes(){var e;return[...(e=Ca.observedAttributes)!=null?e:[],...id,...td,...ad]}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,Co).call(this)}disconnectedCallback(){I(this,Ai,wo).call(this)}attributeChangedCallback(e,a,r){switch(g(this,Pe)||I(this,Je,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&&Se(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"&&Se(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"&&Se(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&&!jl.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),...Lo}),I(this,et,gi).call(this,{[_n(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=Re(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 vn(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 Te(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=Re(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=Te(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=Te(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:nd}get playerSoftwareVersion(){var e;return(e=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_VERSION))!=null?e:rd}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=Re(this,v.Attributes.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(v.Attributes.ENV_KEY,`${e}`)}get debug(){return Re(this,v.Attributes.DEBUG)!=null}set debug(e){e?this.setAttribute(v.Attributes.DEBUG,""):this.removeAttribute(v.Attributes.DEBUG)}get streamType(){return Re(this,v.Attributes.STREAM_TYPE)}set streamType(e){this.setAttribute(v.Attributes.STREAM_TYPE,`${e}`)}get startTime(){return Te(Re(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,Pe)||I(this,Je,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}};Pe=new WeakMap,Lt=new WeakMap,me=new WeakMap,Ct=new WeakMap,Xe=new WeakMap,ae=new WeakMap,Je=new WeakSet,fi=function(){var e,a,r;if(!g(this,Pe)){B(this,Pe,!0),I(this,fe,je).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!")}kn(this),I(this,yi,xo).call(this),I(this,Ti,Ro).call(this),I(this,_i,Do).call(this),B(this,me,(r=(a=this.mediaController)==null?void 0:a.hasAttribute("user-inactive"))!=null?r:!0),I(this,Ii,Po).call(this)}},fe=new WeakSet,je=function(e){Object.assign(g(this,ae),e),I(this,et,gi).call(this)},et=new WeakSet,gi=function(e={}){di(ko(ed(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,fe,je).call(this,{playerSize:Ei((a=this.mediaController)!=null?a:this)})},vi=new WeakSet,Co=function(){var e;B(this,Xe,new ResizeObserver(()=>I(this,wt,Na).call(this))),g(this,Xe).observe((e=this.mediaController)!=null?e:this)},Ai=new WeakSet,wo=function(){var e;(e=g(this,Xe))==null||e.disconnect()},_i=new WeakSet,Do=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=Tn(this),m=g(this,ae).inLiveWindow;c!==m&&(I(this,fe,je).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,xo=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)){Se(n),n.data&&Se(`${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,je).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,Ro=function(){var a,r,n,s;let e=()=>I(this,et,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,Po=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 Re(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 od=kt;