@mux/mux-player 1.2.0 → 1.3.0-canary.0-a2befb5

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 $o=Object.create;var xt=Object.defineProperty;var Bo=Object.getOwnPropertyDescriptor;var Vo=Object.getOwnPropertyNames;var Ho=Object.getPrototypeOf,Wo=Object.prototype.hasOwnProperty;var Fo=(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 Vo(i))!Wo.call(t,r)&&r!==e&&xt(t,r,{get:()=>i[r],enumerable:!(a=Bo(i,r))||a.enumerable});return t};var Ko=(t,i,e)=>(e=t!=null?$o(Ho(t)):{},ar(i||!t||!t.__esModule?xt(e,"default",{value:t,enumerable:!0}):e,t)),Yo=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={};Fo(sd,{MediaError:()=>v.MediaError,default:()=>od,getVideoAttribute:()=>Re});module.exports=Yo(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{},Go={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 Zo(t,i){return new tt}var rr={document:{createElement:Zo},DocumentFragment,customElements:Go,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"},ve={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 zo=t=>typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t),sr=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],jo=(t,i)=>{let e=t===1?sr[i].singular:sr[i].plural;return`${t} ${e}`},Ae=t=>{if(!zo(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&&jo(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(){}},Jo={createElement:function(){return new lr.HTMLElement}},dr=typeof window=="undefined"||typeof window.customElements=="undefined",u=dr?lr:window,d=dr?Jo:window.document;function p(t,i){u.customElements.get(t)||(u.customElements.define(t,i),u[i.name]=i)}var es=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},_e=(t,i,e)=>(es(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=`
1
+ "use strict";var Bo=Object.create;var Rt=Object.defineProperty;var Vo=Object.getOwnPropertyDescriptor;var Ho=Object.getOwnPropertyNames;var Wo=Object.getPrototypeOf,Fo=Object.prototype.hasOwnProperty;var Ko=(t,i)=>{for(var e in i)Rt(t,e,{get:i[e],enumerable:!0})},nr=(t,i,e,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Ho(i))!Fo.call(t,r)&&r!==e&&Rt(t,r,{get:()=>i[r],enumerable:!(a=Vo(i,r))||a.enumerable});return t};var Yo=(t,i,e)=>(e=t!=null?Bo(Wo(t)):{},nr(i||!t||!t.__esModule?Rt(e,"default",{value:t,enumerable:!0}):e,t)),Go=t=>nr(Rt({},"__esModule",{value:!0}),t);var Mi=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var v=(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)},$=(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 cd={};Ko(cd,{MediaError:()=>g.MediaError,default:()=>dd,getVideoAttribute:()=>ye});module.exports=Go(cd);var Ne=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Ne{}globalThis.DocumentFragment=t}var it=class extends Ne{},ki=class extends Ne{},Zo={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(it)}},at,Si=class{constructor(i,e={}){T(this,at,void 0);$(this,at,e==null?void 0:e.detail)}get detail(){return v(this,at)}initCustomEvent(){}};at=new WeakMap;function Qo(t,i){return new it}var or={document:{createElement:Qo},DocumentFragment,customElements:Zo,CustomEvent:Si,EventTarget:Ne,HTMLElement:it,HTMLVideoElement:ki},sr=typeof window=="undefined"||typeof globalThis.customElements=="undefined",M=sr?or:globalThis,Z=sr?or.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"},rt={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"},hd=Object.entries(rt).reduce((t,[i,e])=>{let a=o[i];return a&&(t[e]=a),t},{userinactivechange:"user-inactive"}),lr=Object.entries(o).reduce((t,[i,e])=>{let a=rt[i];return a&&(t[e]=a),t},{"user-inactive":"userinactivechange"}),$e={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Ie={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Li={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Q={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"};var O={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"},L={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={...O,...L};var jo=t=>typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t),dr=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Xo=(t,i)=>{let e=t===1?dr[i].singular:dr[i].plural;return`${t} ${e}`},Me=t=>{if(!jo(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&&Xo(l,c)).filter(l=>l).join(", ")}${e?" remaining":""}`};function j(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 cr={HTMLElement:function(){this.addEventListener=()=>{},this.removeEventListener=()=>{},this.dispatchEvent=()=>{}},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},es={createElement:function(){return new cr.HTMLElement}},ur=typeof window=="undefined"||typeof window.customElements=="undefined",u=ur?cr:window,d=ur?es:window.document;function p(t,i){u.customElements.get(t)||(u.customElements.define(t,i),u[i.name]=i)}var ts=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},ke=(t,i,e)=>(ts(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)},Pt,Be,wi,mr=d.createElement("template");mr.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,$e,n=>{let{key:s}=n;if(!this.keysUsed.includes(s)){this.removeEventListener("keyup",_e(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",_e(this,$e));return}this.addEventListener("keyup",_e(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",_e(this,Rt)),this.addEventListener("keydown",_e(this,wi)),this.setAttribute("tabindex",0)}disable(){this.removeEventListener("click",_e(this,Rt)),this.removeEventListener("keyup",_e(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 ts=`<svg aria-hidden="true" viewBox="0 0 26 24">
53
+ `;var Ut=class extends u.HTMLElement{constructor(i={}){super(),Ci(this,Pt,n=>{this.handleClick(n)}),Ci(this,Be,n=>{let{key:s}=n;if(!this.keysUsed.includes(s)){this.removeEventListener("keyup",ke(this,Be));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",ke(this,Be));return}this.addEventListener("keyup",ke(this,Be),{once:!0})});let e=this.attachShadow({mode:"open"}),a=mr.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)}static get observedAttributes(){return["disabled",o.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",ke(this,Pt)),this.addEventListener("keydown",ke(this,wi)),this.setAttribute("tabindex",0)}disable(){this.removeEventListener("click",ke(this,Pt)),this.removeEventListener("keyup",ke(this,Be)),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.hasAttribute("disabled")||this.enable(),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;this.disable();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(){}};Pt=new WeakMap;Be=new WeakMap;wi=new WeakMap;p("media-chrome-button",Ut);var w=Ut;var is=`<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
- `,ur=d.createElement("template");ur.innerHTML=`
57
- <slot name="airplay">${ts}</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 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"/></g></svg>',as='<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=`
56
+ `,hr=d.createElement("template");hr.innerHTML=`
57
+ <slot name="airplay">${is}</slot>
58
+ `;var xi=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(i={}){super({slotTemplate:hr,...i})}connectedCallback(){this.setAttribute("aria-label",L.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",xi);var as='<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>',rs='<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>',br=d.createElement("template");br.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">${is}</slot>
73
- <slot name="exit">${as}</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)},rs=(t,i)=>{let e=`slot[name="${i}"]`,a=t.shadowRoot.querySelector(e);return a?a.children:[]},Ot=(t,i)=>rs(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=`
72
+ <slot name="enter">${as}</slot>
73
+ <slot name="exit">${rs}</slot>
74
+ `;var pr=t=>{let e=t.getAttribute(o.MEDIA_IS_CASTING)!=null?L.EXIT_CAST():L.ENTER_CAST();t.setAttribute("aria-label",e)},Di=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(i={}){super({slotTemplate:br,...i})}connectedCallback(){pr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_CASTING&&pr(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",Di);var Ot=(t,i,e=".value")=>{let a=t.querySelector(e);!a||(a.textContent=i)},ns=(t,i)=>{let e=`slot[name="${i}"]`,a=t.shadowRoot.querySelector(e);return a?a.children:[]},Nt=(t,i)=>ns(t,i)[0],nt=(t,i)=>!t||!i?!1:t.contains(i)?!0:nt(t,i.getRootNode().host),ot=(t,i)=>{if(!t)return null;let e=t.closest(i);return e||ot(t.getRootNode().host,i)};function re(t,i){var e;let a;for(a of t.querySelectorAll("style")){let r;try{r=(e=a.sheet)==null?void 0:e.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===i)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${i}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{}}}}var fr=d.createElement("template");fr.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=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=`
81
+ `;var Ri=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}constructor(i={}){super();let e=this.attachShadow({mode:"open"}),a=fr.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=Er(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=Er(this);this.getAttribute(o.MEDIA_CONTROLLER)&&((i=e==null?void 0:e.unassociateElement)==null||i.call(e,this)),e==null||e.removeEventListener("pointerdown",this),e==null||e.removeEventListener("click",this)}handleEvent(i){var e;let a=(e=i.composedPath())==null?void 0:e[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(i.type==="pointerdown")this._pointerType=i.pointerType;else if(i.type==="click"){let{clientX:n,clientY:s}=i,{left:l,top:c,width:m,height:f}=this.getBoundingClientRect(),_=n-l,S=s-c;if(_<0||S<0||_>m||S>f||m===0&&f===0)return;let{pointerType:y=this._pointerType}=i;if(this._pointerType=void 0,y===Li.TOUCH){this.handleTap(i);return}else if(y===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 Er(t){let i=t.getAttribute(o.MEDIA_CONTROLLER);return i?d.getElementById(i):ot(t,"media-controller")}p("media-gesture-receiver",Ri);var gr=d.createElement("template");gr.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 ns=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(ns)}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}},os=(t="",i={})=>Ni(t).map(e=>{let a=vr(e);return{...i,...a}}),ss=t=>Array.isArray(t)?t.map(i=>typeof i=="string"?vr(i):i):typeof t=="string"?os(t):[t],ls=({label:t,language:i}={})=>t?`${i}:${encodeURIComponent(t)}`:i,Q=(t=[])=>Array.prototype.map.call(t,ls).join(" "),ds=(t,i)=>e=>e[t]===i,Ar=t=>{let i=Object.entries(t).map(([e,a])=>ds(e,a));return e=>i.every(a=>a(e))},nt=(t,i=[],e=[])=>{let a=ss(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),pe,Ke,dt,Wt,Hi,Mr=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],cs=10,_r=0,Kt=class extends fr{constructor(){super(),Bi(this,Ke),Bi(this,Wt),Bi(this,pe,new $t(this,"hotkeys")),vs||(this._airplayUnavailable=Z.UNSUPPORTED),Tr||(this._fullscreenUnavailable=Z.UNAVAILABLE),As||(this._castUnavailable=Z.UNSUPPORTED),fs||(this._pipUnavailable=Z.UNSUPPORTED),lt!==void 0?lt||(this._volumeUnavailable=Z.UNSUPPORTED):gs.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(ve.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:e=>{let a=Ft(this),{detail:r=[]}=e;nt(ve.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:e=>{let a=st(this),{detail:r=[]}=e;nt(ve.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:e=>{let a=st(this),{detail:r=[]}=e;nt(ve.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,ys((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,pe).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){ye(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=ps(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),ye([i],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),ye([i],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),ye([i],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),ye([i],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),ye([i],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||ye([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,pe)}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=cs;if(!We(this,pe).contains(`no${i.key.toLowerCase()}`)&&!(i.key===" "&&We(this,pe).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}}};pe=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,pe).contains(`no${a.toLowerCase()}`)||a===" "&&We(this,pe).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:ve.SHOWING}),Wi=t=>He(t.media,{kind:Ne.CAPTIONS,mode:ve.SHOWING}),us=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=>us.includes(l)):[]},Fi=t=>!!Pr(t).length,ms=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)),hs=t=>{var i;return!!((i=t.closest)!=null&&i.call(t,'*[slot="media"]'))},ot=(t,i)=>{if(hs(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)},ye=(t,i,e)=>{t.forEach(a=>{!Pr(a).includes(i)||ms(a,i,e)})},ps=(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)},bs=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)),Es=(t=Ki())=>typeof(t==null?void 0:t.requestPictureInPicture)=="function",fs=Es(),lt,gs=bs().then(t=>(lt=t,lt)),vs=!!u.WebKitPlaybackTargetAvailabilityEvent,As=!!u.chrome,_s=(t=Ki())=>{let i=d[w.enabled];return!i&&t&&(i="webkitSupportsFullscreen"in t),i},Tr=_s();function ys(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=`
192
+ `;var os=Object.values(o),$t=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(gr.content.cloneNode(!0));let i=n=>{let s=this.media;for(let l of n)l.type==="childList"&&(l.removedNodes.forEach(c=>{if(c.slot=="media"&&l.target==this){let m=l.previousSibling&&l.previousSibling.previousElementSibling;if(!m||!s)this.mediaUnsetCallback(c);else{let f=m.slot!=="media";for(;(m=m.previousSibling)!==null;)m.slot=="media"&&(f=!1);f&&this.mediaUnsetCallback(c)}}}),s&&l.addedNodes.forEach(c=>{c==s&&this.handleMediaUpdated(s).then(m=>this.mediaSetCallback(m))}))};new MutationObserver(i).observe(this,{childList:!0,subtree:!0});let a=this.media,r=this.querySelector(":scope > slot[slot=media]");r&&r.addEventListener("slotchange",()=>{if(!r.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(a);return}this.media&&(a=this.media,this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(os)}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?O.AUDIO_PLAYER():O.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(rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{this.removeAttribute("user-inactive");let s=new u.CustomEvent(rt.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():s.composedPath().some(l=>{var c;return["media-play-button","media-fullscreen-button"].includes((c=l==null?void 0:l.nodeName)==null?void 0:c.toLowerCase())})&&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",$t);var vr=$t;var Ar=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},R=(t,i,e)=>(Ar(t,i,"read from private field"),e?e.call(t):i.get(t)),Pi=(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)},Ui=(t,i,e,a)=>(Ar(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),Ve,He,F,Bt=class{constructor(i,e){Pi(this,Ve,void 0),Pi(this,He,void 0),Pi(this,F,[]),Ui(this,Ve,i),Ui(this,He,e)}[Symbol.iterator](){return R(this,F).values()}get length(){return R(this,F).length}get value(){var i;return(i=R(this,F).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(Ui(this,F,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return R(this,F)[i]}values(){return R(this,F).values()}keys(){return R(this,F).keys()}forEach(i){R(this,F).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||R(this,F).push(r)}),!(this.value===""&&!((e=R(this,Ve))!=null&&e.hasAttribute(`${R(this,He)}`)))&&((a=R(this,Ve))==null||a.setAttribute(`${R(this,He)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{R(this,F).splice(R(this,F).indexOf(a),1)}),(e=R(this,Ve))==null||e.setAttribute(`${R(this,He)}`,`${this.value}`)}contains(i){return R(this,F).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)}};Ve=new WeakMap;He=new WeakMap;F=new WeakMap;var x={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};d.fullscreenElement===void 0&&(x.enter="webkitRequestFullScreen",x.exit=d.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",x.event="webkitfullscreenchange",x.element="webkitFullscreenElement",x.error="webkitfullscreenerror",x.enabled="webkitFullscreenEnabled");function Vt(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 Oi=(t="")=>t.split(/\s+/),_r=(t="")=>{let[i,e]=t.split(":"),a=e?decodeURIComponent(e):void 0;return{language:i,label:a}},ss=(t="",i={})=>Oi(t).map(e=>{let a=_r(e);return{...i,...a}}),ls=t=>Array.isArray(t)?t.map(i=>typeof i=="string"?_r(i):i):typeof t=="string"?ss(t):[t],ds=({label:t,language:i}={})=>t?`${i}:${encodeURIComponent(t)}`:i,q=(t=[])=>Array.prototype.map.call(t,ds).join(" "),cs=(t,i)=>e=>e[t]===i,yr=t=>{let i=Object.entries(t).map(([e,a])=>cs(e,a));return e=>i.every(a=>a(e))},st=(t,i=[],e=[])=>{let a=ls(e).map(yr),r=n=>a.some(s=>s(n));Array.from(i).filter(r).forEach(n=>{n.mode=t})},We=(t,i=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let e=typeof i=="function"?i:yr(i);return Array.from(t.textTracks).filter(e)},Ni=t=>{let i=!!t.getAttribute(o.MEDIA_CAPTIONS_SHOWING),e=!t.hasAttribute("no-subtitles-fallback")&&!!t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return i||e},Ht=t=>{var i,e,a,r;if(Ni(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=Oi((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=Oi((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 kr=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},Fe=(t,i,e)=>(kr(t,i,"read from private field"),e?e.call(t):i.get(t)),$i=(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)},Ke=(t,i,e)=>(kr(t,i,"access private method"),e),Ee,Ye,ut,Ft,Vi,Sr=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],us=10,Tr=0,Yt=class extends vr{constructor(){super(),$i(this,Ye),$i(this,Ft),$i(this,Ee,new Bt(this,"hotkeys")),As||(this._airplayUnavailable=Q.UNSUPPORTED),Mr||(this._fullscreenUnavailable=Q.UNAVAILABLE),_s||(this._castUnavailable=Q.UNSUPPORTED),gs||(this._pipUnavailable=Q.UNSUPPORTED),ct!==void 0?ct||(this._volumeUnavailable=Q.UNSUPPORTED):vs.then(()=>{ct||(this._volumeUnavailable=Q.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(!Mr){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let e=this.media;d.pictureInPictureElement&&d.exitPictureInPicture(),super[x.enter]?super[x.enter]():e.webkitEnterFullscreen?e.webkitEnterFullscreen():e.requestFullscreen?e.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{d[x.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[x.element]&&d[x.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[x.element]&&d[x.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]=We(r,{kind:$e.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,_=>_.startTime>=n);if(!l)return;let c=/'^(?:[a-z]+:)?\/\//i.test(l.text)||(a=r.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,m=new URL(l.text,c),f=new URLSearchParams(m.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,m.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,f.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:e=>{let a=Kt(this),{detail:r=[]}=e;st(Ie.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:e=>{let a=Kt(this),{detail:r=[]}=e;st(Ie.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:e=>{let a=dt(this),{detail:r=[]}=e;st(Ie.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:e=>{let a=dt(this),{detail:r=[]}=e;st(Ie.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${Vt(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,Lr(this))},"playing,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((e=this.media)!=null&&e.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,Cr(this)),this.propagateMediaState(o.MEDIA_VOLUME,wr(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,xr(this))},[x.event]:e=>{let r=!!d[x.element]&&(e==null?void 0:e.target),n=nt(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&&nt(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&&nt(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,Dr(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,Rr(this))},"loadedmetadata,emptied,progress":()=>{var e;this.propagateMediaState(o.MEDIA_SEEKABLE,(e=Pr(this))==null?void 0:e.join(":"))},"progress,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_BUFFERED,Ts((e=this.media)==null?void 0:e.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Ur(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!==Q.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=Q.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=e}if(this._castUnavailable!==Q.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=Q.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(Kt(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,q(dt(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,q(Hi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,q(Ir(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,q(Hi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,q(Ir(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"&&(Fe(this,Ee).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==x.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==x.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){Se(this.mediaStateReceivers,i,e);let a=new u.CustomEvent(lr[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=bs(i,a,r);Object.keys(h).forEach(s=>{i.addEventListener(h[s],this[`_handle${Vt(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${Vt(r,!0)}`])})}registerMediaStateReceiver(i){if(!i)return;let e=this.mediaStateReceivers;e.indexOf(i)>-1||(e.push(i),Se([i],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Se([i],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Se([i],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Se([i],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Se([i],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||Se([i],o[r],Bi[o[r]]?Bi[o[r]](this):Bi.default(this,o[r]))}))}unregisterMediaStateReceiver(i){let e=this.mediaStateReceivers,a=e.indexOf(i);a<0||e.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Ke(this,Ft,Vi))}disableHotkeys(){this.removeEventListener("keydown",Ke(this,Ft,Vi)),this.removeEventListener("keyup",Ke(this,Ye,ut))}get hotkeys(){return Fe(this,Ee)}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(y=>y==="Space"?" ":y).filter(Boolean).includes(i.key))return;let l,c,m,f,_,S=us;if(!Fe(this,Ee).contains(`no${i.key.toLowerCase()}`)&&!(i.key===" "&&Fe(this,Ee).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":Ht(this);break;case"ArrowLeft":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:Tr,f=Math.max(m-S,0),_=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(_);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:Tr,f=Math.max(m+S,0),_=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(_);break;default:break}}};Ee=new WeakMap;Ye=new WeakSet;ut=function(t){let{key:i}=t;if(!Sr.includes(i)){this.removeEventListener("keyup",Ke(this,Ye,ut));return}this.keyboardShortcutHandler(t)};Ft=new WeakSet;Vi=function(t){let{metaKey:i,altKey:e,key:a}=t;if(i||e||!Sr.includes(a)){this.removeEventListener("keyup",Ke(this,Ye,ut));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Fe(this,Ee).contains(`no${a.toLowerCase()}`)||a===" "&&Fe(this,Ee).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",Ke(this,Ye,ut),{once:!0})};var Bi={default(t,i){return t.getAttribute(i)},[o.MEDIA_CAPTIONS_LIST](t){return q(Kt(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return q(dt(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return q(dt(t))||void 0},[o.MEDIA_CAPTIONS_SHOWING](t){return q(Hi(t))||void 0},[o.MEDIA_PAUSED](t){return Lr(t)},[o.MEDIA_MUTED](t){return Cr(t)},[o.MEDIA_VOLUME](t){return wr(t)},[o.MEDIA_VOLUME_LEVEL](t){return xr(t)},[o.MEDIA_CURRENT_TIME](t){return Dr(t)},[o.MEDIA_DURATION](t){return Rr(t)},[o.MEDIA_SEEKABLE](t){var i;return(i=Pr(t))==null?void 0:i.join(":")},[o.MEDIA_PLAYBACK_RATE](t){return Ur(t)}},Lr=t=>t.media?t.media.paused:!0,Cr=t=>!!(t.media&&t.media.muted),wr=t=>{let i=t.media;return i?i.volume:1},xr=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},Dr=t=>{let i=t.media;return i?i.currentTime:0},Rr=t=>{let i=t==null?void 0:t.media;return Number.isFinite(i==null?void 0:i.duration)?i.duration:NaN},Pr=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))]},Ur=t=>{let i=t.media;return i?i.playbackRate:1},dt=t=>We(t.media,{kind:$e.SUBTITLES}),Kt=t=>We(t.media,{kind:$e.CAPTIONS}),Ir=t=>We(t.media,{kind:$e.SUBTITLES,mode:Ie.SHOWING}),Hi=t=>We(t.media,{kind:$e.CAPTIONS,mode:Ie.SHOWING}),ms=Object.values(o),Or=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=>ms.includes(l)):[]},Wi=t=>!!Or(t).length,hs=async(t,i,e)=>(t.isConnected||await Nr(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)),ps=t=>{var i;return!!((i=t.closest)!=null&&i.call(t,'*[slot="media"]'))},lt=(t,i)=>{if(ps(t))return;let e=(r,n)=>{var s,l;Wi(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(_=>lt(_,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Wi(t)){u.customElements.whenDefined(a).then(()=>{e(t,i)});return}e(t,i)},Se=(t,i,e)=>{t.forEach(a=>{!Or(a).includes(i)||hs(a,i,e)})},bs=(t,i,e)=>{lt(t,i);let a=c=>{var m;let f=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;i(f)},r=c=>{var m;let f=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(f)};t.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=c=>{c.forEach(m=>{let{addedNodes:f=[],removedNodes:_=[],type:S,target:y,attributeName:W}=m;S==="childList"?(Array.prototype.forEach.call(f,P=>lt(P,i)),Array.prototype.forEach.call(_,P=>lt(P,e))):S==="attributes"&&W===o.MEDIA_CHROME_ATTRIBUTES&&(Wi(y)?i(y):e(y))})},s=new MutationObserver(n);return s.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{lt(t,e),s.disconnect(),t.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Wt,Fi=()=>{var t,i;return Wt||(Wt=(i=(t=d)==null?void 0:t.createElement)==null?void 0:i.call(t,"video"),Wt)},Es=async(t=Fi())=>{if(!t)return!1;let i=t.volume;return t.volume=i/2+.1,await Nr(0),t.volume!==i},Nr=t=>new Promise(i=>setTimeout(i,t)),fs=(t=Fi())=>typeof(t==null?void 0:t.requestPictureInPicture)=="function",gs=fs(),ct,vs=Es().then(t=>(ct=t,ct)),As=!!u.WebKitPlaybackTargetAvailabilityEvent,_s=!!u.chrome,ys=(t=Fi())=>{let i=d[x.enabled];return!i&&t&&(i="webkitSupportsFullscreen"in t),i},Mr=ys();function Ts(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",Yt);var mt=Yt;var Br=d.createElement("template"),$r=`
193
193
  height: var(--thumb-height);
194
194
  width: var(--media-range-thumb-width, 10px);
195
195
  border: var(--media-range-thumb-border, none);
@@ -200,18 +200,20 @@
200
200
  transition: var(--media-range-thumb-transition, none);
201
201
  transform: var(--media-range-thumb-transform, none);
202
202
  opacity: var(--media-range-thumb-opacity, 1);
203
- `,Yt=`
203
+ `,Ki=`
204
204
  width: var(--media-range-track-width, 100%);
205
205
  min-width: 40px;
206
206
  height: var(--track-height);
207
207
  border: var(--media-range-track-border, none);
208
+ outline: var(--media-range-track-outline);
209
+ outline-offset: var(--media-range-track-outline-offset);
208
210
  border-radius: var(--media-range-track-border-radius, 0);
209
211
  background: var(--media-range-track-progress-internal, var(--media-range-track-background, #eee));
210
212
  box-shadow: var(--media-range-track-box-shadow, none);
211
213
  transition: var(--media-range-track-transition, none);
212
214
  transform: translate(var(--media-range-track-translate-x, 0), var(--media-range-track-translate-y, 0));
213
215
  cursor: pointer;
214
- `;Nr.innerHTML=`
216
+ `;Br.innerHTML=`
215
217
  <style>
216
218
  :host {
217
219
  --thumb-height: var(--media-range-thumb-height, 10px);
@@ -219,12 +221,10 @@
219
221
  --media-range-padding: var(--media-control-padding, 10px);
220
222
  --_media-range-padding: var(--media-range-padding, 10px);
221
223
 
222
- position: relative;
223
- display: inline-flex;
224
- align-items: center;
225
- justify-content: center;
226
224
  vertical-align: middle;
227
225
  box-sizing: border-box;
226
+ display: inline-block;
227
+ position: relative;
228
228
  background: var(--media-control-background, rgba(20,20,30, 0.7));
229
229
  transition: background 0.15s linear;
230
230
  width: 100px;
@@ -240,6 +240,11 @@
240
240
  background: var(--media-control-hover-background, rgba(50,50,60, 0.7));
241
241
  }
242
242
 
243
+ #container {
244
+ position: relative;
245
+ height: 100%;
246
+ }
247
+
243
248
  input[type=range] {
244
249
 
245
250
  -webkit-appearance: none;
@@ -257,19 +262,19 @@
257
262
 
258
263
  input[type=range]::-webkit-slider-thumb {
259
264
  -webkit-appearance: none;
260
- ${Or}
265
+ ${$r}
261
266
 
262
267
  margin-top: calc(calc(0px - var(--thumb-height) + var(--track-height)) / 2);
263
268
  }
264
269
 
265
270
 
266
271
  input[type=range]::-moz-range-thumb {
267
- ${Or}
272
+ ${$r}
268
273
  translate: var(--media-range-track-translate-x, 0) var(--media-range-track-translate-y, 0);
269
274
  }
270
275
 
271
- input[type=range]::-webkit-slider-runnable-track { ${Yt} }
272
- input[type=range]::-moz-range-track { ${Yt} }
276
+ input[type=range]::-webkit-slider-runnable-track { ${Ki} }
277
+ input[type=range]::-moz-range-track { ${Ki} }
273
278
  input[type=range]::-ms-track {
274
279
 
275
280
  width: 100%;
@@ -279,24 +284,23 @@
279
284
  border-color: transparent;
280
285
  color: transparent;
281
286
 
282
- ${Yt}
287
+ ${Ki}
283
288
  }
284
289
 
285
290
  #background,
286
291
  #pointer {
287
- ${Yt}
288
- width: auto;
292
+ min-width: 40px;
293
+ width: var(--media-range-track-width, 100%);
294
+ height: var(--track-height);
295
+ border-radius: var(--media-range-track-border-radius, 0);
289
296
  position: absolute;
290
297
  top: 50%;
291
298
  transform: translate(var(--media-range-track-translate-x, 0px), calc(var(--media-range-track-translate-y, 0px) - 50%));
292
- left: var(--media-range-padding-left, var(--_media-range-padding));
293
- right: var(--media-range-padding-right, var(--_media-range-padding));
294
299
  background: var(--media-range-track-background, #333);
295
300
  }
296
301
 
297
302
  #pointer {
298
303
  min-width: auto;
299
- right: auto;
300
304
  background: var(--media-range-track-pointer-background);
301
305
  border-right: var(--media-range-track-pointer-border-right);
302
306
  transition: visibility .25s, opacity .25s;
@@ -314,10 +318,8 @@
314
318
 
315
319
  z-index: 1;
316
320
  display: var(--media-time-range-hover-display, none);
317
- box-sizing: border-box;
318
321
  position: absolute;
319
- left: var(--media-range-padding-left, var(--_media-range-padding));
320
- right: var(--media-range-padding-right, var(--_media-range-padding));
322
+ width: 100%;
321
323
  bottom: var(--media-time-range-hover-bottom, -5px);
322
324
  height: var(--media-time-range-hover-height, max(calc(100% + 5px), 20px));
323
325
  }
@@ -354,11 +356,13 @@
354
356
  background-color: #777;
355
357
  }
356
358
  </style>
357
- <div id="background"></div>
358
- <div id="pointer"></div>
359
- <div id="hoverzone"></div>
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(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=`
359
+ <div id="container">
360
+ <div id="background"></div>
361
+ <div id="pointer"></div>
362
+ <div id="hoverzone"></div>
363
+ <input id="range" type="range" min="0" max="1000" step="any" value="0">
364
+ </div>
365
+ `;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(Br.content.cloneNode(!0)),this.container=this.shadowRoot.querySelector("#container"),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}=re(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}=re(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 ht=Gt;var Vr=d.createElement("template");Vr.innerHTML=`
362
366
  <style>
363
367
  :host {
364
368
 
@@ -377,7 +381,7 @@
377
381
  </style>
378
382
 
379
383
  <slot></slot>
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=`
384
+ `;var Yi=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Vr.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 Hr=d.createElement("template");Hr.innerHTML=`
381
385
  <style>
382
386
  :host {
383
387
  display: inline-flex;
@@ -412,11 +416,11 @@
412
416
  <span id="container">
413
417
  <slot></slot>
414
418
  </span>
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 be=Zt;var Gi=class extends be{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 be{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 Ts="&nbsp;/&nbsp;",Is=(t,{timesSep:i=Ts}={})=>{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},Ms="video not loaded, unknown time.",Ss=t=>{let i=t.mediaCurrentTime,e=t.mediaDuration||t.mediaSeekableEnd;if(i==null||e==null){t.setAttribute("aria-valuetext",Ms);return}let a=t.hasAttribute("remaining"),r=t.hasAttribute("show-duration"),n=a?Ae(0-(e-i)):Ae(i);if(!r){t.setAttribute("aria-valuetext",n);return}let s=Ae(e),l=`${n} of ${s}`;t.setAttribute("aria-valuetext",l)},Qi=class extends be{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=Is(this);Ss(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 ks=`<svg aria-hidden="true" viewBox="0 0 26 24">
419
+ `;var Zt=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Hr.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 fe=Zt;var Gi=class extends fe{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}attributeChangedCallback(i,e,a){i===o.MEDIA_CURRENT_TIME&&(this.container.innerHTML=j(a)),super.attributeChangedCallback(i,e,a)}};p("media-current-time-display",Gi);var Zi=class extends fe{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(i,e,a){i===o.MEDIA_DURATION&&(this.container.innerHTML=j(a)),super.attributeChangedCallback(i,e,a)}};p("media-duration-display",Zi);var Is="&nbsp;/&nbsp;",Ms=(t,{timesSep:i=Is}={})=>{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?j(0-(c-l)):j(l);return s?`${m}${i}${j(c)}`:m},ks="video not loaded, unknown time.",Ss=t=>{let i=t.mediaCurrentTime,e=t.mediaDuration||t.mediaSeekableEnd;if(i==null||e==null){t.setAttribute("aria-valuetext",ks);return}let a=t.hasAttribute("remaining"),r=t.hasAttribute("show-duration"),n=a?Me(0-(e-i)):Me(i);if(!r){t.setAttribute("aria-valuetext",n);return}let s=Me(e),l=`${n} of ${s}`;t.setAttribute("aria-valuetext",l)},Qi=class extends fe{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration","disabled"]}constructor(){super()}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",O.PLAYBACK_TIME()),super.connectedCallback()}disconnectedCallback(){this.disable()}attributeChangedCallback(i,e,a){if([o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"].includes(i)){let r=Ms(this);Ss(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 Ls=`<svg aria-hidden="true" viewBox="0 0 26 24">
416
420
  <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>`,Ls=`<svg aria-hidden="true" viewBox="0 0 26 24">
421
+ </svg>`,Cs=`<svg aria-hidden="true" viewBox="0 0 26 24">
418
422
  <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>`,Hr=d.createElement("template");Hr.innerHTML=`
423
+ </svg>`,Fr=d.createElement("template");Fr.innerHTML=`
420
424
  <style>
421
425
  :host([aria-checked="true"]) slot:not([name=on]) > *,
422
426
  :host([aria-checked="true"]) ::slotted(:not([slot=on])) {
@@ -430,15 +434,15 @@
430
434
  }
431
435
  </style>
432
436
 
433
- <slot name="on">${ks}</slot>
434
- <slot name="off">${Ls}</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,Cs=`<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">${Cs}</slot>
437
- `;var ws=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:ws)+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 Ds=`<svg aria-hidden="true" viewBox="0 0 26 24">
437
+ <slot name="on">${Ls}</slot>
438
+ <slot name="off">${Cs}</slot>
439
+ `;var Wr=t=>{t.setAttribute("aria-checked",Ni(t))},qi=class extends w{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:Fr,...i}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",O.CLOSED_CAPTIONS()),Wr(this)}attributeChangedCallback(i,e,a){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(i)&&Wr(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){Ht(this)}};p("media-captions-button",qi);var zi=30,ws=`<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>`,Gr=d.createElement("template");Gr.innerHTML=`
440
+ <slot name="forward">${ws}</slot>
441
+ `;var xs=0,Kr=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=L.SEEK_FORWARD_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},Yr=t=>{let i=Nt(t,"forward"),e=t.getAttribute("seek-offset");Ot(i,e)},ji=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(i={}){super({slotTemplate:Gr,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",zi),Kr(this),Yr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",zi),Yr(this),Kr(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:xs)+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 Ds=`<svg aria-hidden="true" viewBox="0 0 26 24">
438
442
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
439
- </svg>`,xs=`<svg aria-hidden="true" viewBox="0 0 26 24">
443
+ </svg>`,Rs=`<svg aria-hidden="true" viewBox="0 0 26 24">
440
444
  <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>`,Gr=d.createElement("template");Gr.innerHTML=`
445
+ </svg>`,Qr=d.createElement("template");Qr.innerHTML=`
442
446
  <style>
443
447
  :host([${o.MEDIA_IS_FULLSCREEN}]) slot:not([name=exit]) > *,
444
448
  :host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted(:not([slot=exit])) {
@@ -453,14 +457,14 @@
453
457
  </style>
454
458
 
455
459
  <slot name="enter">${Ds}</slot>
456
- <slot name="exit">${xs}</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 Rs=`<svg aria-hidden="true" viewBox="0 0 24 24">
460
+ <slot name="exit">${Rs}</slot>
461
+ `;var Zr=t=>{let e=t.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?L.EXIT_FULLSCREEN():L.ENTER_FULLSCREEN();t.setAttribute("aria-label",e)},Xi=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(i={}){super({slotTemplate:Qr,...i})}connectedCallback(){Zr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_FULLSCREEN&&Zr(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 Ps=`<svg aria-hidden="true" viewBox="0 0 24 24">
458
462
  <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>`,Zr=`<svg aria-hidden="true" viewBox="0 0 24 24">
463
+ </svg>`,qr=`<svg aria-hidden="true" viewBox="0 0 24 24">
460
464
  <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>`,Ps=`<svg aria-hidden="true" viewBox="0 0 24 24">
465
+ </svg>`,Us=`<svg aria-hidden="true" viewBox="0 0 24 24">
462
466
  <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=`
467
+ </svg>`,jr=d.createElement("template");jr.innerHTML=`
464
468
  <style>
465
469
 
466
470
  :host(:not([${o.MEDIA_VOLUME_LEVEL}])) slot:not([name=high]) > *,
@@ -486,13 +490,13 @@
486
490
  }
487
491
  </style>
488
492
 
489
- <slot name="off">${Rs}</slot>
490
- <slot name="low">${Zr}</slot>
491
- <slot name="medium">${Zr}</slot>
492
- <slot name="high">${Ps}</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">
493
+ <slot name="off">${Ps}</slot>
494
+ <slot name="low">${qr}</slot>
495
+ <slot name="medium">${qr}</slot>
496
+ <slot name="high">${Us}</slot>
497
+ `;var zr=t=>{let e=t.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?L.UNMUTE():L.MUTE();t.setAttribute("aria-label",e)},Ji=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(i={}){super({slotTemplate:jr,...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",Ji);var Xr=`<svg aria-hidden="true" viewBox="0 0 28 24">
494
498
  <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>`,Xr=d.createElement("template");Xr.innerHTML=`
499
+ </svg>`,en=d.createElement("template");en.innerHTML=`
496
500
  <style>
497
501
  :host([${o.MEDIA_IS_PIP}]) slot:not([name=exit]) > *,
498
502
  :host([${o.MEDIA_IS_PIP}]) ::slotted(:not([slot=exit])) {
@@ -506,13 +510,13 @@
506
510
  }
507
511
  </style>
508
512
 
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 Us=`<svg aria-hidden="true" viewBox="0 0 24 24">
513
+ <slot name="enter">${Xr}</slot>
514
+ <slot name="exit">${Xr}</slot>
515
+ `;var Jr=t=>{let e=t.getAttribute(o.MEDIA_IS_PIP)!=null?L.EXIT_PIP():L.ENTER_PIP();t.setAttribute("aria-label",e)},ea=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(i={}){super({slotTemplate:en,...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 Os=`<svg aria-hidden="true" viewBox="0 0 24 24">
512
516
  <path d="m6 21 15-9L6 3v18Z"/>
513
- </svg>`,Os=`<svg aria-hidden="true" viewBox="0 0 24 24">
517
+ </svg>`,Ns=`<svg aria-hidden="true" viewBox="0 0 24 24">
514
518
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
515
- </svg>`,en=d.createElement("template");en.innerHTML=`
519
+ </svg>`,an=d.createElement("template");an.innerHTML=`
516
520
  <style>
517
521
  :host([${o.MEDIA_PAUSED}]) slot[name=pause] > *,
518
522
  :host([${o.MEDIA_PAUSED}]) ::slotted([slot=pause]) {
@@ -525,11 +529,11 @@
525
529
  }
526
530
  </style>
527
531
 
528
- <slot name="play">${Us}</slot>
529
- <slot name="pause">${Os}</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=`
532
+ <slot name="play">${Os}</slot>
533
+ <slot name="pause">${Ns}</slot>
534
+ `;var tn=t=>{let e=t.getAttribute(o.MEDIA_PAUSED)!=null?L.PLAY():L.PAUSE();t.setAttribute("aria-label",e)},ta=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED]}constructor(i={}){super({slotTemplate:an,...i})}connectedCallback(){tn(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_PAUSED&&tn(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 rn=[1,1.25,1.5,1.75,2],Qt=1,nn=d.createElement("template");nn.innerHTML=`
531
535
  <span id="container"></span>
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=`
536
+ `;var ia=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,"rates"]}constructor(i={}){super({slotTemplate:nn,...i}),this._rates=rn,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:rn;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",O.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 on=d.createElement("template");on.innerHTML=`
533
537
  <style>
534
538
  :host {
535
539
  pointer-events: none;
@@ -555,7 +559,7 @@
555
559
  </style>
556
560
 
557
561
  <img aria-hidden="true" id="image"/>
558
- `;var Ns=t=>{t.style.removeProperty("background-image")},$s=(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?Ns(this.image):$s(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,Bs="video not loaded, unknown time.",na=t=>{let i=t.range,e=Ae(+i.value),a=Ae(+i.max),r=e&&a?`${e} of ${a}`:Bs;i.setAttribute("aria-valuetext",r)},sn=d.createElement("template");sn.innerHTML=`
562
+ `;var $s=t=>{t.style.removeProperty("background-image")},Bs=(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(on.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?$s(this.image):Bs(this.image,a))}};p("media-poster-image",aa);var da=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},K=(t,i,e)=>(da(t,i,"read from private field"),e?e.call(t):i.get(t)),X=(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)},pt=(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),bt,qt,zt,Ge,Et,oa,Xt,ei,jt,sa,la,ln,Vs="video not loaded, unknown time.",na=t=>{let i=t.range,e=Me(+i.value),a=Me(+i.max),r=e&&a?`${e} of ${a}`:Vs;i.setAttribute("aria-valuetext",r)},dn=d.createElement("template");dn.innerHTML=`
559
563
  <style>
560
564
  :host {
561
565
  --media-preview-background-color: rgba(20,20,30, .5);
@@ -567,13 +571,24 @@
567
571
  color: #fff;
568
572
  }
569
573
 
574
+ #preview-rail,
575
+ #current-rail {
576
+
577
+ width: 1%;
578
+ position: absolute;
579
+ left: 0;
580
+ bottom: 100%;
581
+ pointer-events: none;
582
+ }
583
+
570
584
  [part~="box"] {
585
+
586
+ position: absolute;
587
+ bottom: 100%;
571
588
  display: flex;
572
589
  flex-direction: column;
573
590
  align-items: center;
574
- position: absolute;
575
- left: 0;
576
- bottom: 100%;
591
+ transform: translateX(-50%);
577
592
  }
578
593
 
579
594
  [part~="preview-box"] {
@@ -637,20 +652,20 @@
637
652
  --media-time-range-hover-display: block;
638
653
  }
639
654
  </style>
640
- <span part="box preview-box">
641
- <slot name="preview">
655
+ <div id="preview-rail">
656
+ <slot name="preview" part="box preview-box">
642
657
  <media-preview-thumbnail></media-preview-thumbnail>
643
658
  <media-preview-time-display></media-preview-time-display>
644
659
  </slot>
645
- </span>
646
- <span part="box current-box">
647
- <slot name="current">
660
+ </div>
661
+ <div id="current-rail">
662
+ <slot name="current" part="box current-box">
648
663
 
649
664
  </slot>
650
- </span>
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,Vs=`<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">${Vs}</slot>
653
- `;var Hs=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:Hs,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 be{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=`
665
+ </div>
666
+ `;var Jt=class extends ht{constructor(){super(),X(this,jt),X(this,la),X(this,bt,void 0),X(this,qt,void 0),X(this,zt,i=>{if([...K(this,bt)].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=sn(this,K(this,qt),r),{style:s}=re(this.shadowRoot,"#preview-rail");s.transform=`translateX(${n})`;let l=r*e,c=new u.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:l});this.dispatchEvent(c)}),X(this,Ge,!1),X(this,Et,i=>{(!i.composedPath().includes(this)||[...K(this,bt)].some(e=>i.composedPath().includes(e)))&&(u.removeEventListener("pointermove",K(this,Et)),pt(this,Ge,!1),K(this,Xt).call(this))}),X(this,oa,()=>{u.addEventListener("pointermove",K(this,zt),!1)}),X(this,Xt,()=>{u.removeEventListener("pointermove",K(this,zt));let i=new u.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(i)}),X(this,ei,()=>{let i=this.getAttribute(o.MEDIA_DURATION);!K(this,Ge)&&i&&(pt(this,Ge,!0),K(this,oa).call(this),u.addEventListener("pointermove",K(this,Et),!1))}),this.container.appendChild(dn.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)},pt(this,bt,this.shadowRoot.querySelectorAll('[part~="box"]')),pt(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",O.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,ln).call(this)),super.attributeChangedCallback(i,e,a)}get mediaPaused(){return this.hasAttribute(o.MEDIA_PAUSED)}get mediaLoading(){return this.hasAttribute(o.MEDIA_LOADING)}get mediaDuration(){let i=this.getAttribute(o.MEDIA_DURATION);return i!=null?+i:void 0}get mediaCurrentTime(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME);return i!=null?+i:void 0}get mediaPlaybackRate(){let i=this.getAttribute(o.MEDIA_PLAYBACK_RATE);return i!=null?+i:1}get mediaBuffered(){let i=this.getAttribute(o.MEDIA_BUFFERED);return i?i.split(" ").map(e=>e.split(":").map(a=>+a)):[]}get mediaSeekable(){let i=this.getAttribute(o.MEDIA_SEEKABLE);if(!!i)return i.split(":").map(e=>+e)}get mediaSeekableEnd(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e}get mediaSeekableStart(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e}getBarColors(){var i;let e=super.getBarColors(),{range:a}=this,r=a.max-a.min,n=this.mediaBuffered;if(!n.length||!Number.isFinite(r)||r<=0)return e;let s=this.mediaCurrentTime,[,l=a.min]=(i=n.find(([f,_])=>f<=s&&s<=_))!=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=sn(this,i,e),{style:r}=re(this.shadowRoot,"#current-rail");r.transform=`translateX(${a})`}};bt=new WeakMap;qt=new WeakMap;zt=new WeakMap;Ge=new WeakMap;Et=new WeakMap;oa=new WeakMap;Xt=new WeakMap;ei=new WeakMap;jt=new WeakSet;sa=function(){this.addEventListener("pointermove",K(this,ei),!1)};la=new WeakSet;ln=function(){u.removeEventListener("pointermove",K(this,Et)),this.removeEventListener("pointermove",K(this,ei)),pt(this,Ge,!1),K(this,Xt).call(this)};function sn(t,i,e){var a;let r=`${e*100*100}%`,n=i.offsetWidth;if(!n)return r;let s=(a=t.getAttribute("bounds")?ot(t,`#${t.getAttribute("bounds")}`):t.parentElement)!=null?a:t,l=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-left")),c=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-right")),m=t.range.getBoundingClientRect(),f=s.getBoundingClientRect(),_=(l-(m.left-f.left-n/2))/m.width*100,S=(f.right-m.left-n/2-c)/m.width*100;return Number.isNaN(_)||(r=`max(${_*100}%, ${r})`),Number.isNaN(S)||(r=`min(${r}, ${S*100}%)`),r}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,Hs=`<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>`,mn=d.createElement("template");mn.innerHTML=`
667
+ <slot name="backward">${Hs}</slot>
668
+ `;var Ws=0,cn=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=L.SEEK_BACK_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},un=t=>{let i=Nt(t,"backward"),e=t.getAttribute("seek-offset");Ot(i,e)},ha=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(i={}){super({slotTemplate:mn,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",ma),cn(this),un(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",ma),un(this),cn(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:Ws,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 fe{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(i,e,a){i===o.MEDIA_PREVIEW_TIME&&a!=null&&(this.container.textContent=j(a)),super.attributeChangedCallback(i,e,a)}};p("media-preview-time-display",pa);var hn=d.createElement("template");hn.innerHTML=`
654
669
  <style>
655
670
  :host {
656
671
  box-sizing: border-box;
@@ -664,7 +679,7 @@
664
679
  }
665
680
  </style>
666
681
  <img crossorigin loading="eager" decoding="async" />
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"),Ws=`
682
+ `;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(hn.content.cloneNode(!0))}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}attributeChangedCallback(i,e,a){var r,n;if(["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(i)&&this.update(),i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}update(){let i=this.getAttribute(o.MEDIA_PREVIEW_COORDS),e=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(i&&e))return;let[a,r,n,s]=i.split(/\s+/).map(Dt=>+Dt),l=e.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:f,minWidth:_,minHeight:S}=c,y=Math.min(parseInt(m)/n,parseInt(f)/s),W=Math.max(parseInt(_)/n,parseInt(S)/s),P=y<1,U=P?y:W>1?W:1,{style:C}=re(this.shadowRoot,":host"),ie=re(this.shadowRoot,"img").style,G=this.shadowRoot.querySelector("img"),ae=P?"min":"max";C.setProperty(`${ae}-width`,"initial","important"),C.setProperty(`${ae}-height`,"initial","important"),C.width=`${n*U}px`,C.height=`${s*U}px`;let Oe=()=>{ie.width=`${this.imgWidth*U}px`,ie.height=`${this.imgHeight*U}px`,ie.display="block"};G.src!==l&&(G.onload=()=>{this.imgWidth=G.naturalWidth,this.imgHeight=G.naturalHeight,Oe()},G.src=l,Oe()),Oe(),ie.transform=`translate(-${a*U}px, -${r*U}px)`}};p("media-preview-thumbnail",ba);var pn=d.createElement("template"),Fs=`
668
683
  <svg aria-hidden="true" viewBox="0 0 100 100">
669
684
  <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
685
  <animateTransform
@@ -677,7 +692,7 @@
677
692
  repeatCount="indefinite" />
678
693
  </path>
679
694
  </svg>
680
- `;mn.innerHTML=`
695
+ `;pn.innerHTML=`
681
696
  <style>
682
697
  :host {
683
698
  display: inline-block;
@@ -714,28 +729,28 @@ svg, img, ::slotted(svg), ::slotted(img) {
714
729
  }
715
730
  </style>
716
731
 
717
- <slot name="loading">${Ws}</slot>
718
- <div id="status" role="status" aria-live="polite">${N.MEDIA_LOADING()}</div>
719
- `;var Fs=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:Fs);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=`
732
+ <slot name="loading">${Fs}</slot>
733
+ <div id="status" role="status" aria-live="polite">${O.MEDIA_LOADING()}</div>
734
+ `;var Ks=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=pn.content.cloneNode(!0);i.appendChild(e)}attributeChangedCallback(i,e,a){var r,n,s;if(i===o.MEDIA_LOADING||i===o.MEDIA_PAUSED){let l=this.getAttribute(o.MEDIA_PAUSED)!=null,c=this.getAttribute(o.MEDIA_LOADING)!=null,m=!l&&c;if(!m)this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),this.removeAttribute("is-loading");else if(!this.loadingDelayHandle&&m){let f=+((r=this.getAttribute("loading-delay"))!=null?r:Ks);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},f)}}else if(i===o.MEDIA_CONTROLLER){if(e){let l=d.getElementById(e);(n=l==null?void 0:l.unassociateElement)==null||n.call(l,this)}if(a){let l=d.getElementById(a);(s=l==null?void 0:l.associateElement)==null||s.call(l,this)}}}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0);let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-loading-indicator",Ea);var bn=d.createElement("template");bn.innerHTML=`
720
735
  <style>
721
736
  :host {
722
737
  }
723
738
  </style>
724
739
  <slot></slot>
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 Ks=100,Ys=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)},Gs=({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=Ks,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=Ys(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Gs(this.range)),this.updateBar()}super.attributeChangedCallback(i,e,a)}};p("media-volume-range",ga);var Zs=Object.defineProperty,Qs=(t,i,e)=>i in t?Zs(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,qs=(t,i,e)=>(Qs(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=Ko(require("@mux/mux-video")),D=require("@mux/playback-core");var kn=require("@mux/mux-video");var zs="en",Te={code:zs};var pn="en";function A(t,i=!0){var r,n;let e=i&&(n=(r=Te)==null?void 0:r[t])!=null?n:t,a=i?Te.code:pn;return new ya(e,a)}var ya=class{constructor(i,e=(a=>(a=Te.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+=`${js(e)}: ${a}; `)}),i?i.trim():void 0}function js(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 se(t){if(t==null)return;let i=+t;return Number.isNaN(i)?void 0:i}function ti(t){let i=Xs(t).toString();return i?"?"+i:""}function Xs(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",Js=()=>{try{return"1.2.0"}catch{}return"UNKNOWN"},el=Js(),ai=()=>el,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 tl={crossorigin:"crossOrigin",playsinline:"playsInline"};function _n(t){var i;return(i=tl[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},il=1,al=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<=il*(fn+gn):i===ft.StreamTypes.LIVE||i===ft.StreamTypes.DVR?r<=al*(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"},Sn=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=kn.VideoEvents.filter(t=>t!=="error"),nl=Object.values($).filter(t=>![$.PLAYSINLINE].includes(t)),ol=Object.values(ke);function Ln(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){var r,n;switch(i){case ke.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ke.VOLUME:{let s=(r=se(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ke.PLAYBACKRATE:{let s=(n=se(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);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:Sn}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:Sn}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=se(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,Cn=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 Cn.get(this)}set value(i){Cn.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 Ee=new WeakMap,J=class{constructor(i,e){this.expression=e,Ee.set(this,[i]),i.textContent=""}get value(){return Ee.get(this).map(i=>i.textContent).join("")}set value(i){this.replace(i)}get previousSibling(){return Ee.get(this)[0].previousSibling}get nextSibling(){return Ee.get(this)[Ee.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("")),Ee.get(this)[0].before(...e);for(let a of Ee.get(this))a.remove();Ee.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 wn(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)=>{wn(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,le=class extends DocumentFragment{constructor(i,e,a=Da){var r,n;super(),Object.getPrototypeOf(this)!==le.prototype&&Object.setPrototypeOf(this,le.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,Dn=new WeakMap,xn=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(Dn.get(i)!==e){Dn.set(i,e);let r=new le(e,this.values,this.processor);xn.set(i,r),i instanceof J?i.replace(...r.children):i.appendChild(r);return}let a=xn.get(i);a&&a.update(this.values)}},Rn=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=Rn.get(l),t===void 0&&(e.raw=e,Rn.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 le(e,i)}var Ra=(...t)=>({$static$:t.map(i=>i instanceof Tt?i:/\w-/.test(i)?{strings:[i]}:{strings:[]})});var Un=`
740
+ `;var fa=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(bn.content.cloneNode(!0))}};p("media-title-bar",fa);var Ys=100,Gs=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)},Zs=({value:t,max:i})=>`${Math.round(t/i*100)}%`,ga=class extends ht{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=Ys,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",O.VOLUME()),super.connectedCallback()}attributeChangedCallback(i,e,a){if(i===o.MEDIA_VOLUME||i===o.MEDIA_MUTED){let r=Gs(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Zs(this.range)),this.updateBar()}super.attributeChangedCallback(i,e,a)}};p("media-volume-range",ga);var Qs=Object.defineProperty,qs=(t,i,e)=>i in t?Qs(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,zs=(t,i,e)=>(qs(t,typeof i!="symbol"?i+"":i,e),e),ft=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")}};zs(ft,"template","");p("media-theme",ft);var va=ft;var Aa=class extends mt{};u.customElements.get("media-chrome")||u.customElements.define("media-chrome",Aa);var _a=class extends mt{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};u.customElements.get("media-container")||u.customElements.define("media-container",_a);var g=Yo(require("@mux/mux-video")),k=require("@mux/playback-core");var Cn=require("@mux/mux-video");var js="en",Le={code:js};var En="en";function A(t,i=!0){var r,n;let e=i&&(n=(r=Le)==null?void 0:r[t])!=null?n:t,a=i?Le.code:En;return new ya(e,a)}var ya=class{constructor(i,e=(a=>(a=Le.code)!=null?a:En)()){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 fn(t){let i="";return Object.entries(t).forEach(([e,a])=>{a!=null&&(i+=`${Xs(e)}: ${a}; `)}),i?i.trim():void 0}function Xs(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function gn(t){return t.replace(/[-_]([a-z])/g,(i,e)=>e.toUpperCase())}function ne(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 ge(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 gt=require("@mux/playback-core");var Ia="mux.com",el=()=>{try{return"1.3.0"}catch{}return"UNKNOWN"},tl=el(),ai=()=>tl,Ma=(t,{token:i,domain:e=Ia}={})=>`https://stream.${e}/${t}.m3u8${ti(!!i?{token:i}:{redundant_streams:!0})}`,_n=(t,{token:i,thumbnailTime:e,domain:a=Ia}={})=>{let r=i==null?e:void 0,{aud:n}=ge(i);if(!(i&&n!=="t"))return`https://image.${a}/${t}/thumbnail.jpg${ti({token:i,time:r})}`},yn=(t,{token:i,domain:e=Ia}={})=>{let{aud:a}=ge(i);if(!(i&&a!=="s"))return`https://image.${e}/${t}/storyboard.vtt${ti({token:i})}`};function ka(t){if(t&&/^media-theme-[\w-]+$/.test(t))return t}var il={crossorigin:"crossOrigin",playsinline:"playsInline"};function Tn(t){var i;return(i=il[t])!=null?i:gn(t)}var In=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=In(t);if(i==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}t.currentTime=i},al=1,rl=5,vn=3,An=.5,Mn=t=>{var n;let{streamType:i}=t,e=In(t),a=(n=t.media)==null?void 0:n.currentTime;if(e==null||a==null)return!1;let r=e-a;return i===gt.StreamTypes.LL_LIVE||i===gt.StreamTypes.LL_DVR?r<=al*(vn+An):i===gt.StreamTypes.LIVE||i===gt.StreamTypes.DVR?r<=rl*(vn+An):!1},Ce,we,B,ii=class{constructor(i,e){T(this,Ce,void 0);T(this,we,void 0);T(this,B,[]);$(this,Ce,i),$(this,we,e)}[Symbol.iterator](){return v(this,B).values()}get length(){return v(this,B).length}get value(){var i;return(i=v(this,B).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&($(this,B,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return v(this,B)[i]}values(){return v(this,B).values()}keys(){return v(this,B).keys()}forEach(i){v(this,B).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||v(this,B).push(r)}),!(this.value===""&&!((e=v(this,Ce))!=null&&e.hasAttribute(`${v(this,we)}`)))&&((a=v(this,Ce))==null||a.setAttribute(`${v(this,we)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{v(this,B).splice(v(this,B).indexOf(a),1)}),(e=v(this,Ce))==null||e.setAttribute(`${v(this,we)}`,`${this.value}`)}contains(i){return v(this,B).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)}};Ce=new WeakMap,we=new WeakMap,B=new WeakMap;var kn=`[mux-player ${ai()}]`;function xe(...t){console.warn(kn,...t)}function J(...t){console.error(kn,...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: ")}
741
+ ${a}${t.file}`}xe(i)}var N={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},De={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Ln=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}}),nl=Cn.VideoEvents.filter(t=>t!=="error"),ol=Object.values(N).filter(t=>![N.PLAYSINLINE].includes(t)),sl=Object.values(De);function wn(t){t.querySelectorAll(":scope > track").forEach(i=>{var e;(e=t.media)==null||e.append(i.cloneNode())}),nl.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[...ol,...sl]}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){var r,n;switch(i){case De.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case De.VOLUME:{let s=(r=ne(a))!=null?r:1;this.media&&(this.media.volume=s);return}case De.PLAYBACKRATE:{let s=(n=ne(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);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:Ln}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:Ln}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=ne(this.getAttribute(De.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(De.PLAYBACKRATE,`${i}`):this.removeAttribute(De.PLAYBACKRATE)}get crossOrigin(){return vt(this,N.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(N.CROSSORIGIN,`${i}`)}get autoplay(){return vt(this,N.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(N.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(N.AUTOPLAY)}get loop(){return vt(this,N.LOOP)!=null}set loop(i){i?this.setAttribute(N.LOOP,""):this.removeAttribute(N.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 vt(this,N.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(N.MUTED,""):this.removeAttribute(N.MUTED)}get playsInline(){return vt(this,N.PLAYSINLINE)!=null}set playsInline(i){J("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(N.PRELOAD,i):this.removeAttribute(N.PRELOAD)}};function vt(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 Re=new WeakMap,xn=new WeakMap,z=class{constructor(i,e){this.expression=e,Re.set(this,i),i.updateParent("")}get attributeName(){return Re.get(this).attr.name}get attributeNamespace(){return Re.get(this).attr.namespaceURI}get value(){return xn.get(this)}set value(i){xn.set(this,i||""),Re.get(this).updateParent(i)}get element(){return Re.get(this).element}get booleanValue(){return Re.get(this).booleanValue}set booleanValue(i){Re.get(this).booleanValue=i}},At=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 ve=new WeakMap,ee=class{constructor(i,e){this.expression=e,ve.set(this,[i]),i.textContent=""}get value(){return ve.get(this).map(i=>i.textContent).join("")}set value(i){this.replace(i)}get previousSibling(){return ve.get(this)[0].previousSibling}get nextSibling(){return ve.get(this)[ve.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("")),ve.get(this)[0].before(...e);for(let a of ve.get(this))a.remove();ve.set(this,e)}};function _t(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 Dn(t,i){return typeof i=="boolean"&&t instanceof z&&typeof t.element[t.attributeName]=="boolean"?(t.booleanValue=i,!0):!1}var xa=_t(wa),ll=_t((t,i)=>{Dn(t,i)||wa(t,i)});function*dl(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 At(e,r);for(let s of oi(r.value))if(s.type==="string")n.append(s.value);else{let l=new z(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 ee(e,n.value));break}}}var si=new WeakMap,li=new WeakMap,oe=class extends DocumentFragment{constructor(i,e,a=xa){var r,n;super(),Object.getPrototypeOf(this)!==oe.prototype&&Object.setPrototypeOf(this,oe.prototype),this.appendChild(i.content.cloneNode(!0)),li.set(this,Array.from(dl(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 yt=new WeakMap,Tt=class{constructor(i,e){this.element=i;this.type=e;this.element.addEventListener(this.type,this);let a=yt.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=yt.get(this.element);e&&e.delete(this.type)}}static for(i){yt.has(i.element)||yt.set(i.element,new Map);let e=i.attributeName.slice(2),a=yt.get(i.element);return a&&a.has(e)?a.get(e):new Tt(i.element,e)}};function cl(t,i){return t instanceof z&&t.attributeName.startsWith("on")?(Tt.for(t).set(i),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function ul(t,i){return i instanceof It&&t instanceof ee?(i.renderInto(t),!0):!1}function ml(t,i){return i instanceof DocumentFragment&&t instanceof ee?(i.childNodes.length&&t.replace(...i.childNodes),!0):!1}function hl(t,i){if(t instanceof z){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 pl(t,i){if(typeof i=="boolean"&&t instanceof z){let e=t.attributeNamespace,a=t.element.hasAttributeNS(e,t.attributeName);return i!==a&&(t.booleanValue=i),!0}return!1}function bl(t,i){return i===!1&&t instanceof ee?(t.replace(""),!0):!1}function El(t,i){pl(t,i)||cl(t,i)||bl(t,i)||ul(t,i)||ml(t,i)||hl(t,i)}var Da=new WeakMap,Rn=new WeakMap,Pn=new WeakMap,It=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(Rn.get(i)!==e){Rn.set(i,e);let r=new oe(e,this.values,this.processor);Pn.set(i,r),i instanceof ee?i.replace(...r.children):i.appendChild(r);return}let a=Pn.get(i);a&&a.update(this.values)}},Un=new Map,fl=_t(El);function b(t,...i){let e=[""],a=[],r,n=!1,s=(l,c=[])=>{e[e.length-1]=e[e.length-1]+l[0],c.forEach((m,f)=>{(r=m==null?void 0:m.$static$)!==void 0?(r.forEach(_=>{s(_.strings,_.values)}),e[e.length-1]=e[e.length-1]+l[f+1],n=!0):(a.push(m),e.push(l[f+1]))})};if(s(t,i),n){let l=e.join("$$html$$");t=Un.get(l),t===void 0&&(e.raw=e,Un.set(l,t=e)),i=a}return new It(t,i,fl)}function di(t,i){t.renderInto(i)}function D(t,i){let e=document.createElement("template");return e.innerHTML=t,new oe(e,i)}var Ra=(...t)=>({$static$:t.map(i=>i instanceof It?i:/\w-/.test(i)?{strings:[i]}:{strings:[]})});var Nn=`
727
742
  :host {
728
743
  cursor: pointer;
729
744
  }
730
745
  media-time-display {
731
746
  color: inherit;
732
747
  }
733
- `,On=G.createElement("template");On.innerHTML=`
748
+ `,$n=Z.createElement("template");$n.innerHTML=`
734
749
  <style>
735
- ${Un}
750
+ ${Nn}
736
751
  </style>
737
752
  <media-time-display show-duration></media-time-display>
738
- `;var Pn=["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(!Pn.includes(r)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!Pn.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=Un,Ge.template=On;M.customElements.get("mxp-time-display")||(M.customElements.define("mxp-time-display",Ge),M.MxpTimeDisplay=Ge);var Nn=`:host(:not([audio])) {
753
+ `;var On=["Enter"," "],Mt,Qe,ci,Ze=class extends M.HTMLElement{constructor(){var e,a;super();T(this,Qe);T(this,Mt,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(!On.includes(r)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!On.includes(s)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),$(this,Mt,setInterval(I(this,Qe,ci).bind(this),200)),requestAnimationFrame(()=>I(this,Qe,ci).call(this))}disconnectedCallback(){clearInterval(v(this,Mt))}attributeChangedCallback(e,a,r){var n,s;e==="hide-duration"&&I(this,Qe,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))}};Mt=new WeakMap,Qe=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","")},Ze.styles=Nn,Ze.template=$n;M.customElements.get("mxp-time-display")||(M.customElements.define("mxp-time-display",Ze),M.MxpTimeDisplay=Ze);var Bn=`:host(:not([audio])) {
739
754
  --secondary-color: transparent;
740
755
  }
741
756
 
@@ -835,57 +850,87 @@ media-controller {
835
850
 
836
851
  :host media-time-range {
837
852
  color: var(--_primary-color);
853
+ --media-range-thumb-opacity: 0;
838
854
  }
839
855
 
840
856
  :host(:not([audio])) media-time-range {
841
857
  --media-range-padding-left: var(--mux-time-range-padding, 10px);
842
858
  --media-range-padding-right: var(--mux-time-range-padding, 10px);
843
- width: 100%;
859
+ --media-range-padding: 0;
844
860
  z-index: 10;
845
861
  height: 10px;
846
- bottom: -2px;
862
+ bottom: -3px;
847
863
  background: linear-gradient(
848
864
  180deg,
849
865
  transparent,
850
866
  transparent 3px,
851
- var(--media-control-background) 3px,
852
- var(--media-control-background) 8px,
853
- transparent 8px,
867
+ var(--media-control-background, rgba(20, 20, 30, 0.7)) 3px,
868
+ var(--media-control-background, rgba(20, 20, 30, 0.7)) 7px,
869
+ transparent 7px,
854
870
  transparent
855
871
  );
872
+ width: 100%;
873
+ }
874
+
875
+ media-control-bar {
876
+ --media-control-padding: 9px 7px;
877
+ }
878
+
879
+ .size-small media-control-bar {
880
+ --media-control-padding: 9px 5px;
881
+ }
882
+
883
+ .size-extra-small media-control-bar {
884
+ --media-control-padding: 4px 3px;
856
885
  }
857
886
 
858
887
  media-control-bar :is([role='button'], [role='switch'], button) {
859
888
  line-height: 0;
860
- --media-control-padding: 10px 7px;
861
889
  }
862
890
 
863
- .size-extra-small media-control-bar [role='button'],
864
- .size-extra-small media-control-bar [role='switch'] {
865
- height: auto;
866
- padding: 4.4% 3.2%;
891
+ media-control-bar :is(media-text-display, mxp-time-display):first-child {
892
+ --media-control-padding: 9px 5px 9px 10px;
867
893
  }
868
894
 
869
895
  .spacer {
870
896
  flex-grow: 1;
871
- height: 100%;
872
897
  background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
873
898
  }
874
899
 
875
900
  /* Add a small space on the right to have the play button and
876
901
  * fullscreen button aligned in relation to the progress bar. */
877
- .size-large .padding-2 {
902
+ media-control-bar:not([slot])::after {
903
+ content: '';
878
904
  width: 2px;
879
905
  height: 100%;
880
906
  background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
881
907
  }
882
908
 
909
+ media-control-bar[slot='top-chrome'] {
910
+ min-height: 42px;
911
+ pointer-events: none;
912
+ }
913
+
914
+ :host([title]) media-control-bar[slot='top-chrome']::before {
915
+ content: '';
916
+ position: absolute;
917
+ width: 100%;
918
+ padding-bottom: min(160px, 25%);
919
+ background: linear-gradient(rgb(0 0 0 / 0.4), transparent);
920
+ }
921
+
922
+ media-control-bar[slot='top-chrome'] > * {
923
+ --media-control-background: transparent;
924
+ --media-control-hover-background: transparent;
925
+ position: relative;
926
+ }
927
+
883
928
  media-controller::part(vertical-layer) {
884
929
  transition: background-color 1s;
885
930
  }
886
931
 
887
932
  media-controller:is([media-paused], :not([user-inactive]))::part(vertical-layer) {
888
- background-color: var(--controls-backdrop-color, var(--controls, rgba(0, 0, 0, 0.6)));
933
+ background-color: var(--controls-backdrop-color, var(--controls, transparent));
889
934
  transition: background-color 0.25s;
890
935
  }
891
936
 
@@ -898,13 +943,18 @@ media-controller:is([media-paused], :not([user-inactive]))::part(vertical-layer)
898
943
  flex-flow: row;
899
944
  align-items: center;
900
945
  justify-content: center;
946
+ filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.25)) drop-shadow(0 0 6px rgb(0 0 0 / 0.25));
947
+ paint-order: stroke;
948
+ stroke: rgba(102, 102, 102, 1);
949
+ stroke-width: 0.3px;
950
+ text-shadow: 0 0 2px rgb(0 0 0 / 0.25), 0 0 6px rgb(0 0 0 / 0.25);
901
951
  }
902
952
 
903
953
  .center-controls media-play-button {
904
954
  --media-control-background: transparent;
905
955
  --media-control-hover-background: transparent;
906
956
  padding: 0;
907
- width: max(30px, min(11%, 100px));
957
+ width: max(43px, min(10%, 55px));
908
958
  }
909
959
 
910
960
  .center-controls media-seek-backward-button,
@@ -912,8 +962,16 @@ media-controller:is([media-paused], :not([user-inactive]))::part(vertical-layer)
912
962
  --media-control-background: transparent;
913
963
  --media-control-hover-background: transparent;
914
964
  padding: 0;
915
- margin: 0 4%;
916
- width: min(7%, 70px);
965
+ margin: 0 2%;
966
+ width: max(33px, min(8%, 40px));
967
+ }
968
+
969
+ media-control-bar:not([slot]) media-seek-backward-button {
970
+ padding-right: 5px;
971
+ }
972
+
973
+ media-control-bar:not([slot]) media-seek-forward-button {
974
+ padding-left: 5px;
917
975
  }
918
976
 
919
977
  media-loading-indicator {
@@ -955,52 +1013,53 @@ media-time-display {
955
1013
 
956
1014
  .title-display {
957
1015
  font-size: 16px;
1016
+ text-shadow: 0 0 2px rgb(0 0 0 / 0.6);
958
1017
  }
959
1018
 
960
1019
  :host([audio]) .title-display {
961
1020
  flex-grow: 1;
962
1021
  font-size: 21px;
963
1022
  }
964
- `;var $n=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
1023
+ `;var Vn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
965
1024
  <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
1025
  <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
1026
  </svg>
968
- `;var Bn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
1027
+ `;var Hn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
969
1028
  <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
1029
  </svg>
971
- `;var Vn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
1030
+ `;var Wn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
972
1031
  <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
1032
  </svg>
974
- `;var Hn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
1033
+ `;var Fn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
975
1034
  <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
1035
  <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
977
1036
  <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
1037
  </svg>
979
- `;var Wn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
1038
+ `;var Kn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
980
1039
  <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
1040
  <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
982
1041
  <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
1042
  <path d="M20.5 5.5h-15v5.811c3.52.906 6.283 3.67 7.189 7.19H20.5V5.5Z"/>
984
1043
  </svg>
985
- `;var Fn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
1044
+ `;var Yn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
986
1045
  <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
1046
  </svg>
988
- `;var Kn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
1047
+ `;var Gn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
989
1048
  <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
1049
  </svg>
991
- `;var Yn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
1050
+ `;var Zn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
992
1051
  <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
1052
  </svg>
994
- `;var Gn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
1053
+ `;var Qn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
995
1054
  <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
1055
  </svg>
997
- `;var Zn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
1056
+ `;var qn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
998
1057
  <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
1058
  </svg>
1000
- `;var Qn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
1059
+ `;var zn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
1001
1060
  <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
1061
  </svg>
1003
- `;var qn=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
1062
+ `;var jn=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
1004
1063
  <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
1064
  <text
1006
1065
  class="value"
@@ -1010,7 +1069,7 @@ media-time-display {
1010
1069
  {{value}}
1011
1070
  </text>
1012
1071
  </svg>
1013
- `;var zn=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
1072
+ `;var Xn=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
1014
1073
  <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
1074
  <text
1016
1075
  class="value"
@@ -1020,21 +1079,21 @@ media-time-display {
1020
1079
  {{value}}
1021
1080
  </text>
1022
1081
  </svg>
1023
- `;var jn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
1082
+ `;var Jn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
1024
1083
  <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
1084
  </svg>
1026
- `;var Xn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
1085
+ `;var eo=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
1027
1086
  <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
1087
  </svg>
1029
- `;var Jn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
1088
+ `;var to=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
1030
1089
  <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
1090
  </svg>
1032
- `;var eo=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
1091
+ `;var io=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
1033
1092
  <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
1093
  </svg>
1035
- `;var 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=()=>R(Qn),ho=t=>R(qn,t),po=t=>R(zn,t),bo=()=>R(jn),Eo=()=>R(Xn),fo=()=>R(Jn),go=()=>R(eo);var H=require("@mux/playback-core");var de={LG:"large",SM:"small",XS:"extra-small"},mi,vo,ui=class extends va{constructor(){super();T(this,mi);I(this,mi,vo).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`
1094
+ `;var ao=()=>D(Vn),ro=()=>D(Hn),no=()=>D(Wn),oo=()=>D(Fn),so=()=>D(Kn),lo=()=>D(Yn),co=()=>D(Gn),uo=()=>D(Zn),mo=()=>D(Qn),ho=()=>D(qn),po=()=>D(zn),bo=t=>D(jn,t),Eo=t=>D(Xn,t),fo=()=>D(Jn),go=()=>D(eo),vo=()=>D(to),Ao=()=>D(io);var V=require("@mux/playback-core");var se={LG:"large",SM:"small",XS:"extra-small"},mi,_o,ui=class extends va{constructor(){super();T(this,mi);I(this,mi,_o).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,[V.StreamTypes.LIVE,V.StreamTypes.LL_LIVE,V.StreamTypes.DVR,V.StreamTypes.LL_DVR].includes(e.streamType)&&(e.hotkeys=e.hotkeys||"",e.hotkeys+=" noarrowleft noarrowright"),di(b`
1036
1095
  <style>
1037
- ${Nn}
1096
+ ${Bn}
1038
1097
  </style>
1039
1098
  <media-controller
1040
1099
  gestures-disabled="${!e.hasSrc||e.isDialogOpen}"
@@ -1052,240 +1111,251 @@ media-time-display {
1052
1111
  placeholder-src="${(r=e.placeholder)!=null?r:!1}"
1053
1112
  ></media-poster-image>
1054
1113
  <media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
1055
- ${Ol(e)}
1114
+ ${Nl(e)}
1056
1115
  <slot></slot>
1057
1116
  </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,vo=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 de.LG:return Kl(t);case de.SM:return Fl(t);case de.XS:return Wl(t)}case H.StreamTypes.DVR:case H.StreamTypes.LL_DVR:switch(e){case de.LG:return Zl(t);case de.SM:return Gl(t);case de.XS:return Yl(t)}case H.StreamTypes.ON_DEMAND:default:switch(e){case de.LG:return Hl(t);case de.SM:return Vl(t);case de.XS:return Pa(t)}}},K=t=>f`
1117
+ `,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 f=s.closest('[slot="top-chrome"]')?"top":s.closest('[slot="centered-chrome"]')?"center":"bottom";s.setAttribute("part",`${f} ${c} ${m}`)})}};mi=new WeakSet,_o=function(){var e,a;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"})}catch{}};M.customElements.get("media-theme-mux")||M.customElements.define("media-theme-mux",ui);var Nl=t=>{let{streamType:i,playerSize:e,audio:a}=t;if(a)switch(i){case V.StreamTypes.LIVE:case V.StreamTypes.LL_LIVE:return Vl(t);case V.StreamTypes.DVR:case V.StreamTypes.LL_DVR:return Bl(t);case V.StreamTypes.ON_DEMAND:default:return $l(t)}switch(i){case V.StreamTypes.LIVE:case V.StreamTypes.LL_LIVE:switch(e){case se.LG:return Gl(t);case se.SM:return Yl(t);case se.XS:return Kl(t)}case V.StreamTypes.DVR:case V.StreamTypes.LL_DVR:switch(e){case se.LG:return ql(t);case se.SM:return Ql(t);case se.XS:return Zl(t)}case V.StreamTypes.ON_DEMAND:default:switch(e){case se.LG:return Fl(t);case se.SM:return Wl(t);case se.XS:return Hl(t)}}},H=t=>b`
1059
1118
  <media-play-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1060
- ${mo()}
1061
- ${lo()}
1062
- </media-play-button>`,Qe=({backwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>f`
1119
+ ${po()}
1120
+ ${uo()}
1121
+ </media-play-button>`,qe=({backwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>b`
1063
1122
  <media-seek-backward-button seek-offset="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
1064
- ${ho({value:t})}
1065
- </media-seek-backward-button>`,qe=({forwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>f`
1123
+ ${bo({value:t})}
1124
+ </media-seek-backward-button>`,ze=({forwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>b`
1066
1125
  <media-seek-forward-button seek-offset="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
1067
- ${po({value:t})}
1068
- </media-seek-forward-button>`,ee=({isDialogOpen:t})=>f`
1126
+ ${Eo({value:t})}
1127
+ </media-seek-forward-button>`,Y=({isDialogOpen:t})=>b`
1069
1128
  <media-mute-button disabled="${t}" aria-disabled="${t&&"true"}">
1070
- ${bo()}
1071
1129
  ${fo()}
1072
- ${Eo()}
1130
+ ${vo()}
1073
1131
  ${go()}
1074
- </media-mute-button>`,Ce=({defaultHiddenCaptions:t,isDialogOpen:i})=>f`
1132
+ ${Ao()}
1133
+ </media-mute-button>`,le=({defaultHiddenCaptions:t,isDialogOpen:i})=>b`
1075
1134
  <media-captions-button default-showing="${!t}" disabled="${i}" aria-disabled="${i&&"true"}">
1076
- ${io()}
1077
- ${ao()}
1078
- </media-captions-button>`,te=t=>f`
1135
+ ${ro()}
1136
+ ${no()}
1137
+ </media-captions-button>`,de=t=>b`
1079
1138
  <media-airplay-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1080
- ${to()}
1081
- </media-airplay-button>`,we=t=>f`
1139
+ ${ao()}
1140
+ </media-airplay-button>`,je=t=>b`
1082
1141
  <media-pip-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1083
- ${co()}
1084
- ${uo()}
1085
- </media-pip-button>`,De=t=>f`
1142
+ ${mo()}
1143
+ ${ho()}
1144
+ </media-pip-button>`,ce=t=>b`
1086
1145
  <media-fullscreen-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1146
+ ${lo()}
1147
+ ${co()}
1148
+ </media-fullscreen-button>`,ue=t=>b`
1149
+ <media-cast-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1087
1150
  ${oo()}
1088
1151
  ${so()}
1089
- </media-fullscreen-button>`,ie=t=>f`
1090
- <media-cast-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1091
- ${ro()}
1092
- ${no()}
1093
- </media-cast-button>`,hi=({playbackRates:t,isDialogOpen:i})=>f`
1152
+ </media-cast-button>`,hi=({playbackRates:t,isDialogOpen:i})=>b`
1094
1153
  <media-playback-rate-button rates="${t!=null?t:!1}" disabled="${i}" aria-disabled="${i&&"true"}">
1095
- </media-playback-rate-button>`,ce=({isDialogOpen:t})=>f`
1154
+ </media-playback-rate-button>`,me=({isDialogOpen:t})=>b`
1096
1155
  <media-volume-range disabled="${t}" aria-disabled="${t&&"true"}">
1097
- </media-volume-range>`,ze=t=>f`
1156
+ </media-volume-range>`,Ae=t=>b`
1098
1157
  <media-time-range disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1099
- </media-time-range>`,pi=({defaultShowRemainingTime:t,hasSrc:i,isDialogOpen:e})=>f`
1158
+ </media-time-range>`,pi=({defaultShowRemainingTime:t,hasSrc:i,isDialogOpen:e})=>b`
1100
1159
  <mxp-time-display remaining="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
1101
- </mxp-time-display>`,ue=({title:t})=>f`
1102
- <media-text-display part="title" class="title-display">${t}</media-text-display>`,Nl=t=>f`
1103
- ${t.title?`<media-control-bar>${ue(t)}</media-control-bar>`:f``}
1160
+ </mxp-time-display>`,he=({title:t})=>b`
1161
+ <media-text-display part="title" class="title-display">${t}</media-text-display>`,$l=t=>b`
1162
+ ${t.title?b`<media-control-bar>${he(t)}</media-control-bar>`:b``}
1104
1163
  <media-control-bar>
1105
- ${K(t)}
1106
- ${Qe(t)}
1164
+ ${H(t)}
1107
1165
  ${qe(t)}
1108
- ${pi(t)}
1109
1166
  ${ze(t)}
1110
- ${ee(t)}
1111
- ${ce(t)}
1167
+ ${pi(t)}
1168
+ ${Ae(t)}
1169
+ ${Y(t)}
1170
+ ${me(t)}
1112
1171
  ${hi(t)}
1113
- ${te(t)}
1114
- ${ie(t)}
1172
+ ${de(t)}
1173
+ ${ue(t)}
1115
1174
  </media-control-bar>
1116
- `,$l=t=>f`
1117
- ${t.title?`<media-control-bar>${ue(t)}</media-control-bar>`:f``}
1175
+ `,Bl=t=>b`
1176
+ ${t.title?b`<media-control-bar>${he(t)}</media-control-bar>`:b``}
1118
1177
  <media-control-bar>
1119
- ${K(t)}
1178
+ ${H(t)}
1120
1179
  <slot name="seek-live"></slot>
1121
- ${Qe(t)}
1122
1180
  ${qe(t)}
1123
- ${pi(t)}
1124
1181
  ${ze(t)}
1125
- ${ee(t)}
1126
- ${ce(t)}
1182
+ ${pi(t)}
1183
+ ${Ae(t)}
1184
+ ${Y(t)}
1185
+ ${me(t)}
1127
1186
  ${hi(t)}
1128
- ${te(t)}
1129
- ${ie(t)}
1187
+ ${de(t)}
1188
+ ${ue(t)}
1130
1189
  </media-control-bar>
1131
- `,Bl=t=>f`
1132
- ${t.title?`<media-control-bar>${ue(t)}</media-control-bar>`:f``}
1190
+ `,Vl=t=>b`
1191
+ ${t.title?b`<media-control-bar>${he(t)}</media-control-bar>`:b``}
1133
1192
  <media-control-bar>
1134
- ${K(t)}
1193
+ ${H(t)}
1135
1194
  <slot name="seek-live"></slot>
1136
- ${ee(t)}
1137
- ${ce(t)}
1138
- ${te(t)}
1139
- ${ie(t)}
1140
- </media-control-bar>
1141
- `,Pa=t=>f`
1142
- <media-control-bar slot="top-chrome">
1143
- ${Ce(t)}
1195
+ ${Y(t)}
1196
+ ${me(t)}
1144
1197
  <div class="spacer"></div>
1145
- ${te(t)}
1146
- ${ie(t)}
1147
- ${we(t)}
1198
+ ${de(t)}
1199
+ ${ue(t)}
1148
1200
  </media-control-bar>
1149
- <div slot="centered-chrome" class="center-controls">
1150
- ${K(t)}
1151
- </div>
1201
+ `,Hl=t=>b`
1202
+ ${Ae(t)}
1152
1203
  <media-control-bar>
1153
- ${ee(t)}
1204
+ ${H(t)}
1205
+ ${Y(t)}
1154
1206
  <div class="spacer"></div>
1155
- ${De(t)}
1207
+ ${le(t)}
1208
+ ${ce(t)}
1156
1209
  </media-control-bar>
1157
- `,Vl=t=>f`
1210
+ `,Wl=t=>b`
1158
1211
  <media-control-bar slot="top-chrome">
1159
- ${t.title?ue(t):f``}
1160
- <div class="spacer"></div>
1161
- ${Ce(t)}
1162
- ${te(t)}
1163
- ${ie(t)}
1164
- ${we(t)}
1212
+ ${t.title?he(t):b``}
1165
1213
  </media-control-bar>
1166
1214
  <div slot="centered-chrome" class="center-controls">
1167
- ${Qe(t)}
1168
- ${K(t)}
1169
1215
  ${qe(t)}
1216
+ ${H(t)}
1217
+ ${ze(t)}
1170
1218
  </div>
1171
- ${ze(t)}
1219
+ ${Ae(t)}
1172
1220
  <media-control-bar>
1173
1221
  ${pi(t)}
1174
- ${ee(t)}
1175
- ${ce(t)}
1222
+ ${Y(t)}
1223
+ ${me(t)}
1176
1224
  <div class="spacer"></div>
1177
1225
  ${hi(t)}
1178
- ${De(t)}
1179
- <div class="padding-2"></div>
1226
+ ${le(t)}
1227
+ ${de(t)}
1228
+ ${ue(t)}
1229
+ ${je(t)}
1230
+ ${ce(t)}
1180
1231
  </media-control-bar>
1181
- `,Hl=t=>f`
1232
+ `,Fl=t=>b`
1182
1233
  <media-control-bar slot="top-chrome">
1183
- ${t.title?ue(t):f``}
1234
+ ${t.title?he(t):b``}
1184
1235
  </media-control-bar>
1185
1236
  <div slot="centered-chrome" class="center-controls">
1186
- ${K(t)}
1237
+ ${H(t)}
1187
1238
  </div>
1188
- ${ze(t)}
1239
+ ${Ae(t)}
1189
1240
  <media-control-bar>
1190
- ${K(t)}
1191
- ${Qe(t)}
1241
+ ${H(t)}
1192
1242
  ${qe(t)}
1243
+ ${ze(t)}
1193
1244
  ${pi(t)}
1194
- ${ee(t)}
1195
- ${ce(t)}
1245
+ ${Y(t)}
1246
+ ${me(t)}
1196
1247
  <div class="spacer"></div>
1197
1248
  ${hi(t)}
1198
- ${Ce(t)}
1199
- ${te(t)}
1200
- ${ie(t)}
1201
- ${we(t)}
1202
- ${De(t)}
1203
- <div class="padding-2"></div>
1249
+ ${le(t)}
1250
+ ${de(t)}
1251
+ ${ue(t)}
1252
+ ${je(t)}
1253
+ ${ce(t)}
1204
1254
  </media-control-bar>
1205
- `,Wl=Pa,Fl=t=>f`
1255
+ `,Kl=t=>b`
1206
1256
  <media-control-bar slot="top-chrome">
1207
- ${t.title?ue(t):f``}
1257
+ <slot name="seek-live"></slot>
1258
+ </media-control-bar>
1259
+ <media-control-bar>
1260
+ ${H(t)}
1261
+ ${Y(t)}
1208
1262
  <div class="spacer"></div>
1209
- ${Ce(t)}
1210
- ${te(t)}
1211
- ${ie(t)}
1212
- ${we(t)}
1263
+ ${le(t)}
1264
+ ${ce(t)}
1265
+ </media-control-bar>
1266
+ `,Yl=t=>b`
1267
+ <media-control-bar slot="top-chrome">
1268
+ <slot name="seek-live"></slot>
1269
+ ${t.title?he(t):b``}
1213
1270
  </media-control-bar>
1214
1271
  <div slot="centered-chrome" class="center-controls">
1215
- ${K(t)}
1272
+ ${H(t)}
1216
1273
  </div>
1217
1274
  <media-control-bar>
1218
- ${ee(t)}
1219
- ${ce(t)}
1220
- <slot name="seek-live"></slot>
1275
+ ${Y(t)}
1276
+ ${me(t)}
1221
1277
  <div class="spacer"></div>
1222
- ${De(t)}
1278
+ ${le(t)}
1279
+ ${de(t)}
1280
+ ${ue(t)}
1281
+ ${je(t)}
1282
+ ${ce(t)}
1223
1283
  </media-control-bar>
1224
- `,Kl=t=>f`
1284
+ `,Gl=t=>b`
1225
1285
  <media-control-bar slot="top-chrome">
1226
- ${t.title?ue(t):f``}
1286
+ <slot name="seek-live"></slot>
1287
+ ${t.title?he(t):b``}
1227
1288
  </media-control-bar>
1228
1289
  <div slot="centered-chrome" class="center-controls">
1229
- ${K(t)}
1290
+ ${H(t)}
1230
1291
  </div>
1231
1292
  <media-control-bar>
1232
- ${ee(t)}
1293
+ ${H(t)}
1294
+ ${Y(t)}
1295
+ ${me(t)}
1296
+ <div class="spacer"></div>
1297
+ ${le(t)}
1298
+ ${de(t)}
1299
+ ${ue(t)}
1300
+ ${je(t)}
1233
1301
  ${ce(t)}
1302
+ </media-control-bar>
1303
+ `,Zl=t=>b`
1304
+ <media-control-bar slot="top-chrome">
1234
1305
  <slot name="seek-live"></slot>
1306
+ </media-control-bar>
1307
+ ${Ae(t)}
1308
+ <media-control-bar>
1309
+ ${H(t)}
1310
+ ${Y(t)}
1235
1311
  <div class="spacer"></div>
1236
- ${Ce(t)}
1237
- ${te(t)}
1238
- ${ie(t)}
1239
- ${we(t)}
1240
- ${De(t)}
1312
+ ${le(t)}
1313
+ ${ce(t)}
1241
1314
  </media-control-bar>
1242
- `,Yl=Pa,Gl=t=>f`
1315
+ `,Ql=t=>b`
1243
1316
  <media-control-bar slot="top-chrome">
1244
- ${t.title?ue(t):f``}
1245
- <div class="spacer"></div>
1246
- ${Ce(t)}
1247
- ${te(t)}
1248
- ${ie(t)}
1249
- ${we(t)}
1317
+ <slot name="seek-live"></slot>
1318
+ ${t.title?he(t):b``}
1250
1319
  </media-control-bar>
1251
1320
  <div slot="centered-chrome" class="center-controls">
1252
- ${Qe(t)}
1253
- ${K(t)}
1254
1321
  ${qe(t)}
1322
+ ${H(t)}
1323
+ ${ze(t)}
1255
1324
  </div>
1256
- ${ze(t)}
1325
+ ${Ae(t)}
1257
1326
  <media-control-bar>
1258
- ${ee(t)}
1259
- ${ce(t)}
1260
- <slot name="seek-live"></slot>
1327
+ ${Y(t)}
1328
+ ${me(t)}
1261
1329
  <div class="spacer"></div>
1262
- ${De(t)}
1263
- <div class="padding-2"></div>
1330
+ ${le(t)}
1331
+ ${de(t)}
1332
+ ${ue(t)}
1333
+ ${je(t)}
1334
+ ${ce(t)}
1264
1335
  </media-control-bar>
1265
- `,Zl=t=>f`
1336
+ `,ql=t=>b`
1266
1337
  <media-control-bar slot="top-chrome">
1267
- ${t.title?ue(t):f``}
1338
+ <slot name="seek-live"></slot>
1339
+ ${t.title?he(t):b``}
1268
1340
  </media-control-bar>
1269
1341
  <div slot="centered-chrome" class="center-controls">
1270
- ${K(t)}
1342
+ ${H(t)}
1271
1343
  </div>
1272
- ${ze(t)}
1344
+ ${Ae(t)}
1273
1345
  <media-control-bar>
1274
- ${K(t)}
1275
- ${Qe(t)}
1346
+ ${H(t)}
1276
1347
  ${qe(t)}
1277
- ${ee(t)}
1278
- ${ce(t)}
1279
- <slot name="seek-live"></slot>
1348
+ ${ze(t)}
1349
+ ${Y(t)}
1350
+ ${me(t)}
1280
1351
  <div class="spacer"></div>
1281
- ${Ce(t)}
1282
- ${te(t)}
1283
- ${ie(t)}
1284
- ${we(t)}
1285
- ${De(t)}
1286
- <div class="padding-2"></div>
1352
+ ${le(t)}
1353
+ ${de(t)}
1354
+ ${ue(t)}
1355
+ ${je(t)}
1356
+ ${ce(t)}
1287
1357
  </media-control-bar>
1288
- `;var _o=`
1358
+ `;var To=`
1289
1359
  :host {
1290
1360
  z-index: 100;
1291
1361
  display: flex;
@@ -1337,17 +1407,17 @@ media-time-display {
1337
1407
  text-align: center;
1338
1408
  line-height: 1.4;
1339
1409
  }
1340
- `,yo=G.createElement("template");yo.innerHTML=`
1410
+ `,Io=Z.createElement("template");Io.innerHTML=`
1341
1411
  <style>
1342
- ${_o}
1412
+ ${To}
1343
1413
  </style>
1344
1414
 
1345
1415
  <div class="dialog">
1346
1416
  <slot></slot>
1347
1417
  </div>
1348
- `;var fe=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})),Ao(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")&&Ao(this)}};fe.styles=_o,fe.template=yo,fe.observedAttributes=["open"];function Ao(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=To(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 To(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=To(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",fe),M.MediaDialog=fe);var Ua=fe;var Io=G.createElement("template");Io.innerHTML=`
1418
+ `;var _e=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})),yo(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),zl(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")&&yo(this)}};_e.styles=To,_e.template=Io,_e.observedAttributes=["open"];function yo(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=Mo(t.shadowRoot)),t._previouslyFocusedElement=Z.activeElement,Z.activeElement instanceof HTMLElement&&Z.activeElement.blur(),t.addEventListener("transitionend",()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},{once:!0})}function Mo(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=Mo(r[n].shadowRoot),a));n++);}return a}function zl(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}M.customElements.get("media-dialog")||(M.customElements.define("media-dialog",_e),M.MediaDialog=_e);var Pa=_e;var ko=Z.createElement("template");ko.innerHTML=`
1349
1419
  <style>
1350
- ${Ua.styles}
1420
+ ${Pa.styles}
1351
1421
 
1352
1422
  .close {
1353
1423
  background: none;
@@ -1376,7 +1446,7 @@ media-time-display {
1376
1446
  </svg>
1377
1447
  </button>
1378
1448
  </slot>
1379
- `;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=Io;M.customElements.get("mxp-dialog")||(M.customElements.define("mxp-dialog",Mt),M.MxpDialog=Mt);var Mo=`:host {
1449
+ `;var kt=class extends Pa{constructor(){var i,e;super(),(e=(i=this.shadowRoot)==null?void 0:i.querySelector(".close"))==null||e.addEventListener("click",()=>{this.close()})}};kt.template=ko;M.customElements.get("mxp-dialog")||(M.customElements.define("mxp-dialog",kt),M.MxpDialog=kt);var So=`:host {
1380
1450
  display: inline-block;
1381
1451
  width: 100%;
1382
1452
  }
@@ -1391,21 +1461,36 @@ a {
1391
1461
  font-size: 0.9em;
1392
1462
  text-decoration: underline;
1393
1463
  }
1394
- [part~='seek-live'] {
1395
- height: 44px;
1464
+
1465
+ [audio] [part~='seek-live'] {
1466
+ margin: 0;
1467
+ height: 42px;
1468
+ border-radius: 0;
1396
1469
  background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
1397
- color: white;
1470
+ }
1471
+
1472
+ [part~='seek-live'] {
1473
+ margin-left: 10px;
1474
+ margin-right: 5px;
1475
+ align-self: center;
1476
+ position: relative;
1477
+ box-sizing: border-box;
1478
+ padding: 4px 6px;
1479
+ border-radius: 12px;
1480
+ background-color: rgba(20, 20, 30, 0.7);
1481
+ font-size: 0.75rem;
1482
+ line-height: 1;
1483
+ color: #fff;
1398
1484
  border: none;
1399
1485
  cursor: pointer;
1400
1486
  }
1401
1487
 
1402
- [part~='seek-live']::before {
1403
- content: '\u25CF ';
1404
- color: rgb(118, 118, 118);
1405
- padding-right: 5px;
1488
+ [part~='seek-live'] svg {
1489
+ width: 8px;
1490
+ fill: rgb(118, 118, 118);
1406
1491
  }
1407
- [part~='seek-live'][in-live-window]::before {
1408
- color: #fb3c4d;
1492
+ [part~='seek-live'][in-live-window] svg {
1493
+ fill: #fb3c4d;
1409
1494
  }
1410
1495
 
1411
1496
  [part~='seek-live'][disabled] {
@@ -1527,92 +1612,90 @@ a {
1527
1612
  ::part(title display) {
1528
1613
  display: var(--media-controls, var(--media-title-display));
1529
1614
  }
1530
- `;var xe=require("@mux/playback-core"),Lo=t=>f`
1615
+ `;var Pe=require("@mux/playback-core"),Co=t=>b`
1531
1616
  <style>
1532
- ${Mo}
1617
+ ${So}
1533
1618
  </style>
1534
- ${zl(t)}
1535
- `,So=t=>[xe.StreamTypes.LIVE,xe.StreamTypes.LL_LIVE].includes(t.streamType),ko=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`
1536
- <${Ra((i=Sa(t.theme))!=null?i:"media-theme-mux")}
1619
+ ${Jl(t)}
1620
+ `,Lo=t=>[Pe.StreamTypes.LIVE,Pe.StreamTypes.LL_LIVE].includes(t.streamType),Xl=t=>[Pe.StreamTypes.LIVE,Pe.StreamTypes.LL_LIVE,Pe.StreamTypes.DVR,Pe.StreamTypes.LL_DVR].includes(t.streamType),Jl=t=>{var i,e,a,r,n,s,l,c,m,f,_,S,y,W,P,U,C,ie,G,ae,Oe,Dt,Na,$a,Ba,Va,Ha,Wa,Fa,Ka,Ya,Ga,Za,Qa,qa,za,ja,Xa,Ja,er,tr,ir,ar;return b`
1621
+ <${Ra((i=ka(t.theme))!=null?i:"media-theme-mux")}
1537
1622
  has-src="${(e=t.hasSrc)!=null?e:!1}"
1538
1623
  has-open-dialog="${(a=t.isDialogOpen)!=null?a:!1}"
1539
1624
  nohotkeys="${(r=t.noHotKeys)!=null?r:!1}"
1540
1625
  audio="${(n=t.audio)!=null?n:!1}"
1541
- style="${(s=bn({"--primary-color":t.primaryColor,"--secondary-color":t.secondaryColor}))!=null?s:!1}"
1626
+ style="${(s=fn({"--primary-color":t.primaryColor,"--secondary-color":t.secondaryColor}))!=null?s:!1}"
1542
1627
  class="size-${t.playerSize}${t.secondaryColor?" two-tone":""}"
1543
1628
  stream-type="${(l=t.streamType)!=null?l:!1}"
1544
1629
  player-size="${(c=t.playerSize)!=null?c:!1}"
1545
1630
  default-hidden-captions="${(m=t.defaultHiddenCaptions)!=null?m:!1}"
1546
- forward-seek-offset="${(E=t.forwardSeekOffset)!=null?E:!1}"
1547
- backward-seek-offset="${(y=t.backwardSeekOffset)!=null?y:!1}"
1631
+ forward-seek-offset="${(f=t.forwardSeekOffset)!=null?f:!1}"
1632
+ backward-seek-offset="${(_=t.backwardSeekOffset)!=null?_:!1}"
1548
1633
  playbackrates="${(S=t.playbackRates)!=null?S:!1}"
1549
- default-show-remaining-time="${(_=t.defaultShowRemainingTime)!=null?_:!1}"
1550
- title="${(O=t.title)!=null?O:!1}"
1551
- hotkeys="${(x=t.hotKeys)!=null?x:!1}"
1552
- poster="${t.poster===""?!1:(P=t.poster)!=null?P:!1}"
1553
- placeholder="${(L=t.placeholder)!=null?L:!1}"
1634
+ default-show-remaining-time="${(y=t.defaultShowRemainingTime)!=null?y:!1}"
1635
+ title="${(W=t.title)!=null?W:!1}"
1636
+ hotkeys="${(P=t.hotKeys)!=null?P:!1}"
1637
+ poster="${t.poster===""?!1:(U=t.poster)!=null?U:!1}"
1638
+ placeholder="${(C=t.placeholder)!=null?C:!1}"
1554
1639
  exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, poster, seek-live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
1555
1640
  >
1556
1641
  <mux-video
1557
1642
  slot="media"
1558
- crossorigin="${(re=t.crossOrigin)!=null?re:""}"
1643
+ crossorigin="${(ie=t.crossOrigin)!=null?ie:""}"
1559
1644
  playsinline
1560
- autoplay="${(Y=t.autoplay)!=null?Y:!1}"
1561
- muted="${(ne=t.muted)!=null?ne:!1}"
1562
- loop="${(Ue=t.loop)!=null?Ue:!1}"
1645
+ autoplay="${(G=t.autoplay)!=null?G:!1}"
1646
+ muted="${(ae=t.muted)!=null?ae:!1}"
1647
+ loop="${(Oe=t.loop)!=null?Oe:!1}"
1563
1648
  preload="${(Dt=t.preload)!=null?Dt:!1}"
1564
- debug="${($a=t.debug)!=null?$a:!1}"
1565
- prefer-playback="${(Ba=t.preferPlayback)!=null?Ba:!1}"
1649
+ debug="${(Na=t.debug)!=null?Na:!1}"
1650
+ experimental-cmcd="${($a=t.experimentalCmcd)!=null?$a:!1}"
1651
+ disable-cookies="${(Ba=t.disableCookies)!=null?Ba:!1}"
1652
+ prefer-playback="${(Va=t.preferPlayback)!=null?Va:!1}"
1566
1653
  start-time="${t.startTime!=null?t.startTime:!1}"
1567
- metadata-video-id="${(Va=t.metadataVideoId)!=null?Va:!1}"
1568
- metadata-video-title="${(Ha=t.metadataVideoTitle)!=null?Ha:!1}"
1569
- metadata-viewer-user-id="${(Wa=t.metadataViewerUserId)!=null?Wa:!1}"
1570
- beacon-collection-domain="${(Fa=t.beaconCollectionDomain)!=null?Fa:!1}"
1571
- player-software-name="${(Ka=t.playerSoftwareName)!=null?Ka:!1}"
1572
- player-software-version="${(Ya=t.playerSoftwareVersion)!=null?Ya:!1}"
1573
- env-key="${(Ga=t.envKey)!=null?Ga:!1}"
1574
- stream-type="${(Za=t.streamType)!=null?Za:!1}"
1575
- custom-domain="${(Qa=t.customDomain)!=null?Qa:!1}"
1654
+ metadata-video-id="${(Ha=t.metadataVideoId)!=null?Ha:!1}"
1655
+ metadata-video-title="${(Fa=(Wa=t.metadataVideoTitle)!=null?Wa:t.title)!=null?Fa:!1}"
1656
+ metadata-viewer-user-id="${(Ka=t.metadataViewerUserId)!=null?Ka:!1}"
1657
+ beacon-collection-domain="${(Ya=t.beaconCollectionDomain)!=null?Ya:!1}"
1658
+ player-software-name="${(Ga=t.playerSoftwareName)!=null?Ga:!1}"
1659
+ player-software-version="${(Za=t.playerSoftwareVersion)!=null?Za:!1}"
1660
+ env-key="${(Qa=t.envKey)!=null?Qa:!1}"
1661
+ stream-type="${(qa=t.streamType)!=null?qa:!1}"
1662
+ custom-domain="${(za=t.customDomain)!=null?za:!1}"
1576
1663
  src="${t.src?t.src:t.playbackId?Ma(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
1577
1664
  cast-src="${t.src?t.src:t.playbackId?Ma(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
1578
- cast-stream-type="${So(t)?"live":!1}"
1665
+ cast-stream-type="${Lo(t)?"live":!1}"
1579
1666
  exportparts="video"
1580
1667
  >
1581
- ${t.playbackId&&!t.audio&&!ko(t)?f`<track
1582
- label="thumbnails"
1583
- default
1584
- kind="metadata"
1585
- src="${An(t.playbackId,{domain:t.customDomain,token:t.tokens.storyboard})}"
1586
- />`:f``}
1668
+ ${t.storyboard?b`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:b``}
1587
1669
  </mux-video>
1588
- ${ko(t)?f`<button
1670
+ ${Xl(t)?b`<button
1589
1671
  slot="seek-live"
1590
- part="${So(t)?"top":"bottom"} seek-live button"
1672
+ part="${Lo(t)?"top":"bottom"} seek-live button"
1591
1673
  disabled="${t.inLiveWindow||!t.hasSrc||t.isDialogOpen}"
1592
1674
  aria-disabled="${(t.inLiveWindow||!t.hasSrc||t.isDialogOpen)&&"true"}"
1593
1675
  in-live-window="${t.inLiveWindow}"
1594
- onclick="${function(Oo){var ir;if((ir=t.onSeekToLive)==null||ir.call(t,Oo),t.paused){let No=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(No)}}}"
1676
+ onclick="${function(No){var rr;if((rr=t.onSeekToLive)==null||rr.call(t,No),t.paused){let $o=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent($o)}}}"
1595
1677
  >
1678
+ <svg viewBox="0 0 8 8"><circle cx="4" cy="4" r="4"></circle></svg>
1596
1679
  Live
1597
- </button>`:f``}
1680
+ </button>`:b``}
1598
1681
  <mxp-dialog
1599
1682
  no-auto-hide
1600
- open="${(qa=t.isDialogOpen)!=null?qa:!1}"
1683
+ open="${(ja=t.isDialogOpen)!=null?ja:!1}"
1601
1684
  onclose="${t.onCloseErrorDialog}"
1602
1685
  oninitfocus="${t.onInitFocusDialog}"
1603
1686
  >
1604
- ${(za=t.dialog)!=null&&za.title?f`<h3>${t.dialog.title}</h3>`:f``}
1687
+ ${(Xa=t.dialog)!=null&&Xa.title?b`<h3>${t.dialog.title}</h3>`:b``}
1605
1688
  <p>
1606
- ${(ja=t.dialog)==null?void 0:ja.message}
1607
- ${(Xa=t.dialog)!=null&&Xa.linkUrl?f`<a
1689
+ ${(Ja=t.dialog)==null?void 0:Ja.message}
1690
+ ${(er=t.dialog)!=null&&er.linkUrl?b`<a
1608
1691
  href="${t.dialog.linkUrl}"
1609
1692
  target="_blank"
1610
1693
  rel="external noopener"
1611
- aria-label="${(Ja=t.dialog.linkText)!=null?Ja:""} ${A("(opens in a new window)")}"
1612
- >${(er=t.dialog.linkText)!=null?er:t.dialog.linkUrl}</a
1613
- >`:f``}
1694
+ aria-label="${(tr=t.dialog.linkText)!=null?tr:""} ${A("(opens in a new window)")}"
1695
+ >${(ir=t.dialog.linkText)!=null?ir:t.dialog.linkUrl}</a
1696
+ >`:b``}
1614
1697
  </p>
1615
1698
  </mxp-dialog>
1616
- </${Ra((tr=Sa(t.theme))!=null?tr:"media-theme-mux")}>
1617
- `};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(Te.code,P).format(E*1e3),currentDate:new Intl.DateTimeFormat(Te.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 me={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(me),ad=Object.values(b),rd=ai(),nd="mux-player",Co={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},Pe,Lt,he,Ct,Xe,ae,Je,fi,ge,je,et,gi,wt,Na,vi,wo,Ai,Do,_i,xo,yi,Ro,Ti,Po,Ii,Uo,kt=class extends Ca{constructor(){super();T(this,Je);T(this,ge);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,he,!0);T(this,Ct,new ii(this,"hotkeys"));T(this,Xe,void 0);T(this,ae,{...Co,onCloseErrorDialog:()=>I(this,ge,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,wo).call(this)}disconnectedCallback(){I(this,Ai,Do).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,me.SRC,b.PLAYBACK_TOKEN].includes(e)&&a!==r&&B(this,ae,{...g(this,ae),...Co}),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,me.SRC))!=null?e:void 0:(a=this.getAttribute(me.SRC))!=null?a:void 0}set src(e){e?this.setAttribute(me.SRC,e):this.removeAttribute(me.SRC)}get poster(){var a;let e=this.getAttribute(me.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(me.POSTER,e):this.removeAttribute(me.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 se(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=se(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=se(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 se(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,he=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,ge,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!")}Ln(this),I(this,yi,Ro).call(this),I(this,Ti,Po).call(this),I(this,_i,xo).call(this),B(this,he,(r=(a=this.mediaController)==null?void 0:a.hasAttribute("user-inactive"))!=null?r:!0),I(this,Ii,Uo).call(this)}},ge=new WeakSet,je=function(e){Object.assign(g(this,ae),e),I(this,et,gi).call(this)},et=new WeakSet,gi=function(e={}){di(Lo(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,ge,je).call(this,{playerSize:Ei((a=this.mediaController)!=null?a:this)})},vi=new WeakSet,wo=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,Do=function(){var e;(e=g(this,Xe))==null||e.disconnect()},_i=new WeakSet,xo=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,ge,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,Ro=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,ge,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,Po=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,Uo=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(`
1618
- `).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,he))};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,he),!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,he)!==_&&(B(this,he,_),l(r,g(this,he)))})};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;
1699
+ </${Ra((ar=ka(t.theme))!=null?ar:"media-theme-mux")}>
1700
+ `};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:f,aud:_,sub:S}=ge(a),y=Date.now()>f*1e3,W=S!==e,P=_!=="v",U={timeStyle:"medium",dateStyle:"medium"};if(y){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(Le.code,U).format(f*1e3),currentDate:new Intl.DateTimeFormat(Le.code,U).format(Date.now())}),s.file="403-expired-token.md";break}if(W){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(P){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:_}),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:f}=t;n={title:A("Media Error",r),message:f},s.file="media-decode-error.md";break}case St.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let f=(m=(c=t.data)==null?void 0:c.response)==null?void 0:m.code;if(f>=400&&f<500){t.code=St.MediaError.MEDIA_ERR_NETWORK,t.data={response:{code:f}},{dialog:n,devlog:s}=bi(t,i,e,a);break}n={title:A("Source Not Supported",r),message:t.message},s.file="media-src-not-supported.md";break}default:n={title:A("Error",r),message:t.message};break}return i&&(n={title:A("Your device appears to be offline",r),message:A("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var ed=Object.values(k.StreamTypes),td=700,id=300,Ua={LG:"large",SM:"small",XS:"extra-small"};function Ei(t){let i=t.getBoundingClientRect();return i.width<id?Ua.XS:i.width<td?Ua.SM:Ua.LG}var pe={SRC:"src",POSTER:"poster"},E={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",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 ad(t,i){var a,r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src,poster:t.poster,storyboard:t.storyboard,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(E.NOHOTKEYS),hotKeys:t.getAttribute(E.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,experimentalCmcd:t.experimentalCmcd,debug:t.debug,disableCookies:t.disableCookies,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(E.PLAYBACK_RATES),customDomain:(a=t.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,playerSize:Ei((r=t.mediaController)!=null?r:t),metadataVideoId:t.getAttribute(g.Attributes.METADATA_VIDEO_ID),metadataVideoTitle:t.getAttribute(g.Attributes.METADATA_VIDEO_TITLE),metadataViewerUserId:t.getAttribute(g.Attributes.METADATA_VIEWER_USER_ID),title:t.getAttribute(E.TITLE),...i}}var rd=Object.values(g.Attributes),nd=Object.values(pe),od=Object.values(E),sd=ai(),ld="mux-player",wo={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},Ue,Ct,be,wt,Je,te,et,fi,Te,Xe,tt,gi,xt,Oa,vi,xo,Ai,Do,_i,Ro,yi,Po,Ti,Uo,Ii,Oo,Lt=class extends Ca{constructor(){super();T(this,et);T(this,Te);T(this,tt);T(this,xt);T(this,vi);T(this,Ai);T(this,_i);T(this,yi);T(this,Ti);T(this,Ii);T(this,Ue,!1);T(this,Ct,{});T(this,be,!0);T(this,wt,new ii(this,"hotkeys"));T(this,Je,void 0);T(this,te,{...wo,onCloseErrorDialog:()=>I(this,Te,Xe).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Ta(this,Z.activeElement)||e.preventDefault()},onSeekToLive:()=>Sa(this)});this.attachShadow({mode:"open"}),this.isConnected&&I(this,et,fi).call(this)}static get observedAttributes(){var e;return[...(e=Ca.observedAttributes)!=null?e:[],...nd,...rd,...od]}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,xt,Oa).call(this),I(this,vi,xo).call(this)}disconnectedCallback(){I(this,Ai,Do).call(this)}attributeChangedCallback(e,a,r){switch(v(this,Ue)||I(this,et,fi).call(this),super.attributeChangedCallback(e,a,r),e){case E.HOTKEYS:v(this,wt).value=r;break;case E.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&xe(A("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case E.THUMBNAIL_TOKEN:{let{aud:s}=ge(r);r&&s!=="t"&&xe(A("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case E.STORYBOARD_TOKEN:{let{aud:s}=ge(r);r&&s!=="s"&&xe(A("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&J(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&&!ed.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}}[g.Attributes.PLAYBACK_ID,pe.SRC,E.PLAYBACK_TOKEN].includes(e)&&a!==r&&$(this,te,{...v(this,te),...wo}),I(this,tt,gi).call(this,{[Tn(e)]:r})}get experimentalCmcd(){return this.hasAttribute(g.Attributes.EXPERIMENTAL_CMCD)}set experimentalCmcd(e){!!e!==this.experimentalCmcd&&(e?this.setAttribute(g.Attributes.EXPERIMENTAL_CMCD,""):this.removeAttribute(g.Attributes.EXPERIMENTAL_CMCD))}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){return v(this,te).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(g.Attributes.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(g.Attributes.PLAYBACK_ID,e):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var e,a;return this.playbackId?(e=ye(this,pe.SRC))!=null?e:void 0:(a=this.getAttribute(pe.SRC))!=null?a:void 0}set src(e){e?this.setAttribute(pe.SRC,e):this.removeAttribute(pe.SRC)}get poster(){var a;let e=this.getAttribute(pe.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return _n(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(pe.POSTER,e):this.removeAttribute(pe.POSTER)}get storyboard(){if(this.playbackId&&!this.audio&&(!this.streamType||![k.StreamTypes.LIVE,k.StreamTypes.LL_LIVE,k.StreamTypes.DVR,k.StreamTypes.LL_DVR].includes(this.streamType)))return yn(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(E.AUDIO)}set audio(e){if(!e){this.removeAttribute(E.AUDIO);return}this.setAttribute(E.AUDIO,"")}get hotkeys(){return v(this,wt)}get nohotkeys(){return this.hasAttribute(E.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(E.NOHOTKEYS);return}this.setAttribute(E.NOHOTKEYS,"")}get thumbnailTime(){return ne(this.getAttribute(E.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(E.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(E.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(E.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=ye(this,E.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(E.PLACEHOLDER,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(E.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(E.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(E.SECONDARY_COLOR))!=null?e:"rgb(0 0 0 / .65)"}set secondaryColor(e){this.setAttribute(E.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(E.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(E.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(E.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(E.PLAYBACK_RATES))return this.getAttribute(E.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,a)=>e-a)}set playbackRates(e){if(!e){this.removeAttribute(E.PLAYBACK_RATES);return}this.setAttribute(E.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=ne(this.getAttribute(E.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(E.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=ne(this.getAttribute(E.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(E.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(E.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(E.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(E.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?e:ld}get playerSoftwareVersion(){var e;return(e=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?e:sd}get beaconCollectionDomain(){var e;return(e=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get customDomain(){var e;return(e=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,e):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var e;return(e=ye(this,g.Attributes.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(g.Attributes.ENV_KEY,`${e}`)}get debug(){return ye(this,g.Attributes.DEBUG)!=null}set debug(e){e?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return ye(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){return ye(this,g.Attributes.STREAM_TYPE)}set streamType(e){this.setAttribute(g.Attributes.STREAM_TYPE,`${e}`)}get startTime(){return ne(ye(this,g.Attributes.START_TIME))}set startTime(e){this.setAttribute(g.Attributes.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(e===k.PlaybackTypes.MSE||e===k.PlaybackTypes.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===k.PlaybackTypes.MSE||e===k.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,e):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(v(this,Ue)||I(this,et,fi).call(this),!this.media){J("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(E.PLAYBACK_TOKEN),a=this.getAttribute(E.THUMBNAIL_TOKEN),r=this.getAttribute(E.STORYBOARD_TOKEN);return{...v(this,Ct),...e!=null?{playback:e}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(e){$(this,Ct,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(E.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(E.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(E.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(E.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(E.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(E.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(!!s)return(0,k.addTextTrack)(s,e,a,r,n)}removeTextTrack(e){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,k.removeTextTrack)(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};Ue=new WeakMap,Ct=new WeakMap,be=new WeakMap,wt=new WeakMap,Je=new WeakMap,te=new WeakMap,et=new WeakSet,fi=function(){var e,a,r;if(!v(this,Ue)){$(this,Ue,!0),I(this,Te,Xe).call(this,{playerSize:Ei(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof M.HTMLElement))throw""}catch{J(`<${(e=this.theme)==null?void 0:e.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{J("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof mt))throw""}catch{J("<media-controller> failed to upgrade!")}wn(this),I(this,yi,Po).call(this),I(this,Ti,Uo).call(this),I(this,_i,Ro).call(this),$(this,be,(r=(a=this.mediaController)==null?void 0:a.hasAttribute("user-inactive"))!=null?r:!0),I(this,Ii,Oo).call(this)}},Te=new WeakSet,Xe=function(e){Object.assign(v(this,te),e),I(this,tt,gi).call(this)},tt=new WeakSet,gi=function(e={}){di(Co(ad(this,{...v(this,te),...e})),this.shadowRoot)},xt=new WeakSet,Oa=function(){var e,a;v(this,te).playerSize!=Ei((e=this.mediaController)!=null?e:this)&&I(this,Te,Xe).call(this,{playerSize:Ei((a=this.mediaController)!=null?a:this)})},vi=new WeakSet,xo=function(){var e;$(this,Je,new ResizeObserver(()=>I(this,xt,Oa).call(this))),v(this,Je).observe((e=this.mediaController)!=null?e:this)},Ai=new WeakSet,Do=function(){var e;(e=v(this,Je))==null||e.disconnect()},_i=new WeakSet,Ro=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&&[k.StreamTypes.LIVE,k.StreamTypes.LL_LIVE,k.StreamTypes.DVR,k.StreamTypes.LL_DVR].includes(this.streamType)&&this.hasPlayed&&Sa(this)});let e=()=>{let c=Mn(this),m=v(this,te).inLiveWindow;c!==m&&(I(this,Te,Xe).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,Po=function(){var a;let e=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){xe(n),n.data&&xe(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=bi(n,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&ri(l),J(n),n.data&&J(`${n.name} data:`,n.data),I(this,Te,Xe).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 g.MediaError(c,m)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Ti=new WeakSet,Uo=function(){var a,r,n,s;let e=()=>I(this,tt,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,Oo=function(){var f,_,S;let e=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(a)return;let r,n=new WeakMap,s=()=>this.streamType&&[k.StreamTypes.LIVE,k.StreamTypes.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,l=(y,W,P=!1)=>{if(s())return;Array.from(y&&y.activeCues||[]).forEach(C=>{if(!(!C.snapToLines||C.line<-5||C.line>=0&&C.line<10))if(!W||this.paused){let ie=C.text.split(`
1701
+ `).length,G=a?-2:-3;this.streamType&&[k.StreamTypes.LIVE,k.StreamTypes.LL_LIVE].includes(this.streamType)&&(G=a?-1:-2);let ae=G-ie;if(C.line===ae&&!P)return;n.has(C)||n.set(C,C.line),C.line=ae-1,C.line=ae}else setTimeout(()=>{C.line=n.get(C)||"auto"},500)})},c=()=>{var y;l(r,(y=e==null?void 0:e.hasAttribute("user-inactive"))!=null?y:!1)},m=()=>{var P;let W=Array.from(((P=e==null?void 0:e.media)==null?void 0:P.textTracks)||[]).filter(U=>["subtitles","captions"].includes(U.kind)&&U.mode==="showing")[0];W!==r&&(r==null||r.removeEventListener("cuechange",c)),r=W,r==null||r.addEventListener("cuechange",c),l(r,v(this,be))};if(m(),(f=e==null?void 0:e.media)==null||f.textTracks.addEventListener("change",m),(_=e==null?void 0:e.media)==null||_.textTracks.addEventListener("addtrack",m),navigator.userAgent.includes("Chrome/")){let y=()=>{l(r,v(this,be),!0),this.paused||window.requestAnimationFrame(y)};(S=e==null?void 0:e.media)==null||S.addEventListener("playing",()=>{y()})}e==null||e.addEventListener("userinactivechange",()=>{let y=e==null?void 0:e.hasAttribute("user-inactive");v(this,be)!==y&&($(this,be,y),l(r,v(this,be)))})};function ye(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}M.customElements.get("mux-player")||(M.customElements.define("mux-player",Lt),M.MuxPlayerElement=Lt);var dd=Lt;