@mux/mux-player 3.9.2 → 3.9.3-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/base.cjs.js CHANGED
@@ -1,11 +1,11 @@
1
- "use strict";var Ms=Object.defineProperty;var Eh=Object.getOwnPropertyDescriptor;var bh=Object.getOwnPropertyNames;var gh=Object.prototype.hasOwnProperty;var nu=t=>{throw TypeError(t)};var _h=(t,e)=>{for(var i in e)Ms(t,i,{get:e[i],enumerable:!0})},Ah=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of bh(e))!gh.call(t,r)&&r!==i&&Ms(t,r,{get:()=>e[r],enumerable:!(a=Eh(e,r))||a.enumerable});return t};var Th=t=>Ah(Ms({},"__esModule",{value:!0}),t);var Cs=(t,e,i)=>e.has(t)||nu("Cannot "+i);var H=(t,e,i)=>(Cs(t,e,"read from private field"),i?i.call(t):e.get(t)),pe=(t,e,i)=>e.has(t)?nu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),ye=(t,e,i,a)=>(Cs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),X=(t,e,i)=>(Cs(t,e,"access private method"),i);var TE={};_h(TE,{MediaError:()=>g.MediaError,default:()=>AE,generatePlayerInitTime:()=>D.generatePlayerInitTime,getVideoAttribute:()=>Vt,playerSoftwareName:()=>Wd,playerSoftwareVersion:()=>$d});module.exports=Th(TE);var Mi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Mi{}globalThis.DocumentFragment=t}var Wa=class extends Mi{},Ls=class extends Mi{},yh={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Wa)}},Fa,ws=class{constructor(e,i={}){pe(this,Fa);ye(this,Fa,i==null?void 0:i.detail)}get detail(){return H(this,Fa)}initCustomEvent(){}};Fa=new WeakMap;function kh(t,e){return new Wa}var su={document:{createElement:kh},DocumentFragment,customElements:yh,CustomEvent:ws,EventTarget:Mi,HTMLElement:Wa,HTMLVideoElement:Ls},lu=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ke=lu?su:globalThis,Gt=lu?su.document:globalThis.document;var m={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",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_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},x={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Rs={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},du=Object.entries(Rs),n=du.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Sh={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Le=du.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Sh}),ME=Object.entries(Le).reduce((t,[e,i])=>{let a=n[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),uu=Object.entries(n).reduce((t,[e,i])=>{let a=Le[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),fe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},St={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var so={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ve={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Pe={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var cu={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function mu(t){return t==null?void 0:t.map(Mh).join(" ")}function hu(t){return t==null?void 0:t.split(/\s+/).map(Ch)}function Mh(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function Ch(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function pu(t){return t==null?void 0:t.map(Lh).join(" ")}function fu(t){return t==null?void 0:t.split(/\s+/).map(wh)}function Lh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(o=>o!=null).join(":")}}function wh(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function vu(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function Ci(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function lo(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var uo=t=>new Promise(e=>setTimeout(e,t));var Eu=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Rh=(t,e)=>{let i=t===1?Eu[e].singular:Eu[e].plural;return`${t} ${i}`},Yt=t=>{if(!Ci(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&Rh(d,u)).filter(d=>d).join(", ")}${i?" remaining":""}`};function Ne(t,e){let i=!1;t<0&&(i=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),o=Math.floor(t/3600),s=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(o=r=a="0"),o=o>0||d>0?o+":":"",r=((o||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(i?"-":"")+o+r+a}var wE=Object.freeze({length:0,start(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var bu={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var gu,xs={en:bu},Ds=((gu=globalThis.navigator)==null?void 0:gu.language)||"en",_u=t=>{Ds=t};var Dh=t=>{var e,i,a;let[r]=Ds.split("-");return((e=xs[Ds])==null?void 0:e[t])||((i=xs[r])==null?void 0:i[t])||((a=xs.en)==null?void 0:a[t])||t},h=(t,e={})=>Dh(t).replace(/\{(\w+)\}/g,(i,a)=>a in e?String(e[a]):`{${a}}`);var co=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},mo=class extends co{},ho=class extends mo{constructor(){super(...arguments),this.role=null}},Os=class{observe(){}unobserve(){}disconnect(){}},Au={createElement:function(){return new Va.HTMLElement},createElementNS:function(){return new Va.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},Va={ResizeObserver:Os,document:Au,Node:mo,Element:ho,HTMLElement:class extends ho{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Va.DocumentFragment}},DocumentFragment:class extends co{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(t){return null},setItem(t,e){},removeItem(t){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(t){return{matches:!1,media:t}},DOMParser:class{parseFromString(e,i){return{body:{textContent:e}}}}},Tu="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window=="undefined"||typeof window.customElements=="undefined",yu=Object.keys(Va).every(t=>t in globalThis),l=Tu&&!yu?Va:globalThis,V=Tu&&!yu?Au:globalThis.document;var ku=new WeakMap,Ps=t=>{let e=ku.get(t);return e||ku.set(t,e=new Set),e},Su=new l.ResizeObserver(t=>{for(let e of t)for(let i of Ps(e.target))i(e)});function ht(t,e){Ps(t).add(e),Su.observe(t)}function pt(t,e){let i=Ps(t);i.delete(e),i.size||Su.unobserve(t)}function Z(t){let e={};for(let i of t)e[i.name]=i.value;return e}function Y(t){var e;return(e=po(t))!=null?e:Ve(t,"media-controller")}function po(t){var e;let{MEDIA_CONTROLLER:i}=x,a=t.getAttribute(i);if(a)return(e=qt(t))==null?void 0:e.getElementById(a)}var fo=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},Oh=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},vo=(t,e)=>Oh(t,e)[0],ue=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:ue(t,e.getRootNode().host),Ve=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Ve(t.getRootNode().host,e)};function Ka(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=Ka(i.shadowRoot))!=null?e:i:null}function qt(t){var e;let i=(e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t);return i instanceof ShadowRoot||i instanceof Document?i:null}function Eo(t,{depth:e=3,checkOpacity:i=!0,checkVisibilityCSS:a=!0}={}){if(t.checkVisibility)return t.checkVisibility({checkOpacity:i,checkVisibilityCSS:a});let r=t;for(;r&&e>0;){let o=getComputedStyle(r);if(i&&o.opacity==="0"||a&&o.visibility==="hidden"||o.display==="none")return!1;r=r.parentElement,e--}return!0}function Iu(t,e,i,a){let r=a.x-i.x,o=a.y-i.y,s=r*r+o*o;if(s===0)return 0;let d=((t-i.x)*r+(e-i.y)*o)/s;return Math.max(0,Math.min(1,d))}function q(t,e){let i=Ph(t,a=>a===e);return i||Ga(t,e)}function Ph(t,e){var i,a;let r;for(r of(i=t.querySelectorAll("style:not([media])"))!=null?i:[]){let o;try{o=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of o!=null?o:[])if(e(s.selectorText))return s}}function Ga(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],o=r==null?void 0:r[r.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(a=o.sheet.cssRules)==null?void 0:a[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function O(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function N(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}O(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function k(t,e){return t.hasAttribute(e)}function S(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}k(t,e)!=i&&t.toggleAttribute(e,i)}function w(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function R(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;w(t,e,void 0)!==a&&t.setAttribute(e,a)}var Mu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},It=(t,e,i)=>(Mu(t,e,"read from private field"),i?i.call(t):e.get(t)),Nh=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},bo=(t,e,i,a)=>(Mu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ee;function Uh(t){return`
1
+ "use strict";var Cs=Object.defineProperty;var Eh=Object.getOwnPropertyDescriptor;var bh=Object.getOwnPropertyNames;var gh=Object.prototype.hasOwnProperty;var nu=t=>{throw TypeError(t)};var _h=(t,e)=>{for(var i in e)Cs(t,i,{get:e[i],enumerable:!0})},Ah=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of bh(e))!gh.call(t,r)&&r!==i&&Cs(t,r,{get:()=>e[r],enumerable:!(a=Eh(e,r))||a.enumerable});return t};var Th=t=>Ah(Cs({},"__esModule",{value:!0}),t);var Ls=(t,e,i)=>e.has(t)||nu("Cannot "+i);var H=(t,e,i)=>(Ls(t,e,"read from private field"),i?i.call(t):e.get(t)),pe=(t,e,i)=>e.has(t)?nu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),ye=(t,e,i,a)=>(Ls(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),X=(t,e,i)=>(Ls(t,e,"access private method"),i);var TE={};_h(TE,{MediaError:()=>g.MediaError,default:()=>AE,generatePlayerInitTime:()=>D.generatePlayerInitTime,getVideoAttribute:()=>Vt,playerSoftwareName:()=>Fd,playerSoftwareVersion:()=>Wd});module.exports=Th(TE);var Mi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Mi{}globalThis.DocumentFragment=t}var Fa=class extends Mi{},ws=class extends Mi{},yh={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Fa)}},Va,Rs=class{constructor(e,i={}){pe(this,Va);ye(this,Va,i==null?void 0:i.detail)}get detail(){return H(this,Va)}initCustomEvent(){}};Va=new WeakMap;function kh(t,e){return new Fa}var su={document:{createElement:kh},DocumentFragment,customElements:yh,CustomEvent:Rs,EventTarget:Mi,HTMLElement:Fa,HTMLVideoElement:ws},lu=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ke=lu?su:globalThis,Gt=lu?su.document:globalThis.document;var m={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",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_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},x={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},xs={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},du=Object.entries(xs),n=du.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Sh={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Le=du.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Sh}),ME=Object.entries(Le).reduce((t,[e,i])=>{let a=n[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),uu=Object.entries(n).reduce((t,[e,i])=>{let a=Le[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),fe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},St={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var lo={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ve={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ne={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var cu={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function mu(t){return t==null?void 0:t.map(Mh).join(" ")}function hu(t){return t==null?void 0:t.split(/\s+/).map(Ch)}function Mh(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function Ch(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function pu(t){return t==null?void 0:t.map(Lh).join(" ")}function fu(t){return t==null?void 0:t.split(/\s+/).map(wh)}function Lh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(o=>o!=null).join(":")}}function wh(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function vu(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function Ci(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function uo(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var co=t=>new Promise(e=>setTimeout(e,t));var Eu=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Rh=(t,e)=>{let i=t===1?Eu[e].singular:Eu[e].plural;return`${t} ${i}`},Yt=t=>{if(!Ci(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&Rh(d,u)).filter(d=>d).join(", ")}${i?" remaining":""}`};function Pe(t,e){let i=!1;t<0&&(i=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),o=Math.floor(t/3600),s=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(o=r=a="0"),o=o>0||d>0?o+":":"",r=((o||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(i?"-":"")+o+r+a}var wE=Object.freeze({length:0,start(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var bu={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var gu,Ds={en:bu},Os=((gu=globalThis.navigator)==null?void 0:gu.language)||"en",_u=t=>{Os=t};var Dh=t=>{var e,i,a;let[r]=Os.split("-");return((e=Ds[Os])==null?void 0:e[t])||((i=Ds[r])==null?void 0:i[t])||((a=Ds.en)==null?void 0:a[t])||t},h=(t,e={})=>Dh(t).replace(/\{(\w+)\}/g,(i,a)=>a in e?String(e[a]):`{${a}}`);var mo=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},ho=class extends mo{},po=class extends ho{constructor(){super(...arguments),this.role=null}},Ns=class{observe(){}unobserve(){}disconnect(){}},Au={createElement:function(){return new Ka.HTMLElement},createElementNS:function(){return new Ka.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},Ka={ResizeObserver:Ns,document:Au,Node:ho,Element:po,HTMLElement:class extends po{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Ka.DocumentFragment}},DocumentFragment:class extends mo{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(t){return null},setItem(t,e){},removeItem(t){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(t){return{matches:!1,media:t}},DOMParser:class{parseFromString(e,i){return{body:{textContent:e}}}}},Tu="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window=="undefined"||typeof window.customElements=="undefined",yu=Object.keys(Ka).every(t=>t in globalThis),l=Tu&&!yu?Ka:globalThis,V=Tu&&!yu?Au:globalThis.document;var ku=new WeakMap,Ps=t=>{let e=ku.get(t);return e||ku.set(t,e=new Set),e},Su=new l.ResizeObserver(t=>{for(let e of t)for(let i of Ps(e.target))i(e)});function ht(t,e){Ps(t).add(e),Su.observe(t)}function pt(t,e){let i=Ps(t);i.delete(e),i.size||Su.unobserve(t)}function Z(t){let e={};for(let i of t)e[i.name]=i.value;return e}function Y(t){var e;return(e=fo(t))!=null?e:Ve(t,"media-controller")}function fo(t){var e;let{MEDIA_CONTROLLER:i}=x,a=t.getAttribute(i);if(a)return(e=qt(t))==null?void 0:e.getElementById(a)}var vo=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},Oh=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},Eo=(t,e)=>Oh(t,e)[0],ue=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:ue(t,e.getRootNode().host),Ve=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Ve(t.getRootNode().host,e)};function Ga(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=Ga(i.shadowRoot))!=null?e:i:null}function qt(t){var e;let i=(e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t);return i instanceof ShadowRoot||i instanceof Document?i:null}function bo(t,{depth:e=3,checkOpacity:i=!0,checkVisibilityCSS:a=!0}={}){if(t.checkVisibility)return t.checkVisibility({checkOpacity:i,checkVisibilityCSS:a});let r=t;for(;r&&e>0;){let o=getComputedStyle(r);if(i&&o.opacity==="0"||a&&o.visibility==="hidden"||o.display==="none")return!1;r=r.parentElement,e--}return!0}function Iu(t,e,i,a){let r=a.x-i.x,o=a.y-i.y,s=r*r+o*o;if(s===0)return 0;let d=((t-i.x)*r+(e-i.y)*o)/s;return Math.max(0,Math.min(1,d))}function q(t,e){let i=Nh(t,a=>a===e);return i||Ya(t,e)}function Nh(t,e){var i,a;let r;for(r of(i=t.querySelectorAll("style:not([media])"))!=null?i:[]){let o;try{o=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of o!=null?o:[])if(e(s.selectorText))return s}}function Ya(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],o=r==null?void 0:r[r.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(a=o.sheet.cssRules)==null?void 0:a[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function O(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function P(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}O(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function k(t,e){return t.hasAttribute(e)}function S(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}k(t,e)!=i&&t.toggleAttribute(e,i)}function w(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function R(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;w(t,e,void 0)!==a&&t.setAttribute(e,a)}var Mu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},It=(t,e,i)=>(Mu(t,e,"read from private field"),i?i.call(t):e.get(t)),Ph=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},go=(t,e,i,a)=>(Mu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ee;function Uh(t){return`
2
2
  <style>
3
3
  :host {
4
4
  display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
5
5
  box-sizing: border-box;
6
6
  }
7
7
  </style>
8
- `}var Li=class extends l.HTMLElement{constructor(){if(super(),Nh(this,Ee,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER,n.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER&&(i&&((o=(r=It(this,Ee))==null?void 0:r.unassociateElement)==null||o.call(r,this),bo(this,Ee,null)),a&&this.isConnected&&(bo(this,Ee,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=It(this,Ee))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),bo(this,Ee,Hh(this)),this.getAttribute(x.MEDIA_CONTROLLER)&&((i=(e=It(this,Ee))==null?void 0:e.associateElement)==null||i.call(e,this)),(a=It(this,Ee))==null||a.addEventListener("pointerdown",this),(r=It(this,Ee))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,i,a,r;this.getAttribute(x.MEDIA_CONTROLLER)&&((i=(e=It(this,Ee))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=It(this,Ee))==null||a.removeEventListener("pointerdown",this),(r=It(this,Ee))==null||r.removeEventListener("click",this),bo(this,Ee,null)}handleEvent(e){var i;let a=(i=e.composedPath())==null?void 0:i[0];if(["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:o,clientY:s}=e,{left:d,top:u,width:p,height:T}=this.getBoundingClientRect(),_=o-d,E=s-u;if(_<0||E<0||_>p||E>T||p===0&&T===0)return;let f=this._pointerType||"mouse";if(this._pointerType=void 0,f===so.TOUCH){this.handleTap(e);return}else if(f===so.MOUSE||f===so.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let i=this.mediaPaused?m.MEDIA_PLAY_REQUEST:m.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(i,{composed:!0,bubbles:!0}))}};Ee=new WeakMap;Li.shadowRootOptions={mode:"open"};Li.getTemplateHTML=Uh;function Hh(t){var e;let i=t.getAttribute(x.MEDIA_CONTROLLER);return i?(e=t.getRootNode())==null?void 0:e.getElementById(i):Ve(t,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Li);var go=Li;var Bs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ie=(t,e,i)=>(Bs(t,e,"read from private field"),i?i.call(t):e.get(t)),Se=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Zt=(t,e,i,a)=>(Bs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),we=(t,e,i)=>(Bs(t,e,"access private method"),i),To,wi,qa,Ri,_o,Ns,Cu,Ya,Ao,Us,Lu,Hs,wu,Za,yo,ko,$s,xi,Qa,y={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Bh(t){return`
8
+ `}var Li=class extends l.HTMLElement{constructor(){if(super(),Ph(this,Ee,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER,n.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER&&(i&&((o=(r=It(this,Ee))==null?void 0:r.unassociateElement)==null||o.call(r,this),go(this,Ee,null)),a&&this.isConnected&&(go(this,Ee,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=It(this,Ee))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),go(this,Ee,Hh(this)),this.getAttribute(x.MEDIA_CONTROLLER)&&((i=(e=It(this,Ee))==null?void 0:e.associateElement)==null||i.call(e,this)),(a=It(this,Ee))==null||a.addEventListener("pointerdown",this),(r=It(this,Ee))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,i,a,r;this.getAttribute(x.MEDIA_CONTROLLER)&&((i=(e=It(this,Ee))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=It(this,Ee))==null||a.removeEventListener("pointerdown",this),(r=It(this,Ee))==null||r.removeEventListener("click",this),go(this,Ee,null)}handleEvent(e){var i;let a=(i=e.composedPath())==null?void 0:i[0];if(["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:o,clientY:s}=e,{left:d,top:u,width:p,height:T}=this.getBoundingClientRect(),_=o-d,E=s-u;if(_<0||E<0||_>p||E>T||p===0&&T===0)return;let f=this._pointerType||"mouse";if(this._pointerType=void 0,f===lo.TOUCH){this.handleTap(e);return}else if(f===lo.MOUSE||f===lo.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let i=this.mediaPaused?m.MEDIA_PLAY_REQUEST:m.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(i,{composed:!0,bubbles:!0}))}};Ee=new WeakMap;Li.shadowRootOptions={mode:"open"};Li.getTemplateHTML=Uh;function Hh(t){var e;let i=t.getAttribute(x.MEDIA_CONTROLLER);return i?(e=t.getRootNode())==null?void 0:e.getElementById(i):Ve(t,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Li);var _o=Li;var $s=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ie=(t,e,i)=>($s(t,e,"read from private field"),i?i.call(t):e.get(t)),Se=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Zt=(t,e,i,a)=>($s(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),we=(t,e,i)=>($s(t,e,"access private method"),i),yo,wi,Za,Ri,Ao,Us,Cu,qa,To,Hs,Lu,Bs,wu,Qa,ko,So,Ws,xi,za,y={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Bh(t){return`
9
9
  <style>
10
10
 
11
11
  :host([${n.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -143,8 +143,8 @@
143
143
  <slot name="poster" part="layer poster-layer"></slot>
144
144
  <slot name="gestures-chrome" part="layer gesture-layer">
145
145
  <media-gesture-receiver slot="gestures-chrome">
146
- <template shadowrootmode="${go.shadowRootOptions.mode}">
147
- ${go.getTemplateHTML({})}
146
+ <template shadowrootmode="${_o.shadowRootOptions.mode}">
147
+ ${_o.getTemplateHTML({})}
148
148
  </template>
149
149
  </media-gesture-receiver>
150
150
  </slot>
@@ -156,7 +156,7 @@
156
156
  <slot part="bottom chrome"></slot>
157
157
  </span>
158
158
  <slot name="dialog" part="layer dialog-layer"></slot>
159
- `}var $h=Object.values(n),Wh="sm:384 md:576 lg:768 xl:960";function Fh(t){Ru(t.target,t.contentRect.width)}function Ru(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(y.BREAKPOINTS))!=null?i:Wh,r=Vh(a),o=Kh(r,e),s=!1;if(Object.keys(r).forEach(d=>{if(o.includes(d)){t.hasAttribute(`breakpoint${d}`)||(t.setAttribute(`breakpoint${d}`,""),s=!0);return}t.hasAttribute(`breakpoint${d}`)&&(t.removeAttribute(`breakpoint${d}`),s=!0)}),s){let d=new CustomEvent(Le.BREAKPOINTS_CHANGE,{detail:o});t.dispatchEvent(d)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(Le.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Vh(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function Kh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var Qt=class extends l.HTMLElement{constructor(){if(super(),Se(this,Ns),Se(this,Us),Se(this,Hs),Se(this,Za),Se(this,ko),Se(this,xi),Se(this,To,0),Se(this,wi,null),Se(this,qa,null),Se(this,Ri,void 0),this.breakpointsComputed=!1,Se(this,_o,new MutationObserver(we(this,Ns,Cu).bind(this))),Se(this,Ya,!1),Se(this,Ao,i=>{Ie(this,Ya)||(setTimeout(()=>{Fh(i),Zt(this,Ya,!1)},0),Zt(this,Ya,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let i=Z(this.attributes),a=this.constructor.getTemplateHTML(i);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(a):this.shadowRoot.innerHTML=a}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){Ie(this,wi)&&this.mediaUnsetCallback(Ie(this,wi));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[y.AUTOHIDE,y.GESTURES_DISABLED].concat($h).filter(e=>![n.MEDIA_RENDITION_LIST,n.MEDIA_AUDIO_TRACK_LIST,n.MEDIA_CHAPTERS_CUES,n.MEDIA_WIDTH,n.MEDIA_HEIGHT,n.MEDIA_ERROR,n.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,i,a){e.toLowerCase()==y.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Zt(this,wi,e),e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Ie(this,_o).observe(this,{childList:!0,subtree:!0}),ht(this,Ie(this,Ao));let a=this.getAttribute(y.AUDIO)!=null?h("audio player"):h("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(y.USER_INACTIVE,""),Ru(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=l.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Ie(this,_o).disconnect(),pt(this,Ie(this,Ao)),this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Zt(this,wi,null)}handleEvent(e){switch(e.type){case"pointerdown":Zt(this,To,e.timeStamp);break;case"pointermove":we(this,Us,Lu).call(this,e);break;case"pointerup":we(this,Hs,wu).call(this,e);break;case"mouseleave":we(this,Za,yo).call(this);break;case"mouseup":this.removeAttribute(y.KEYBOARD_CONTROL);break;case"keyup":we(this,xi,Qa).call(this),this.setAttribute(y.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Zt(this,Ri,isNaN(i)?0:i)}get autohide(){return(Ie(this,Ri)===void 0?2:Ie(this,Ri)).toString()}get breakpoints(){return w(this,y.BREAKPOINTS)}set breakpoints(e){R(this,y.BREAKPOINTS,e)}get audio(){return k(this,y.AUDIO)}set audio(e){S(this,y.AUDIO,e)}get gesturesDisabled(){return k(this,y.GESTURES_DISABLED)}set gesturesDisabled(e){S(this,y.GESTURES_DISABLED,e)}get keyboardControl(){return k(this,y.KEYBOARD_CONTROL)}set keyboardControl(e){S(this,y.KEYBOARD_CONTROL,e)}get noAutohide(){return k(this,y.NO_AUTOHIDE)}set noAutohide(e){S(this,y.NO_AUTOHIDE,e)}get autohideOverControls(){return k(this,y.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){S(this,y.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return k(this,y.USER_INACTIVE)}set userInteractive(e){S(this,y.USER_INACTIVE,e)}};To=new WeakMap;wi=new WeakMap;qa=new WeakMap;Ri=new WeakMap;_o=new WeakMap;Ns=new WeakSet;Cu=function(t){let e=this.media;for(let i of t){if(i.type!=="childList")continue;let a=i.removedNodes;for(let r of a){if(r.slot!="media"||i.target!=this)continue;let o=i.previousSibling&&i.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(r);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(r)}}if(e)for(let r of i.addedNodes)r===e&&this.handleMediaUpdated(e)}};Ya=new WeakMap;Ao=new WeakMap;Us=new WeakSet;Lu=function(t){if(t.pointerType!=="mouse"&&t.timeStamp-Ie(this,To)<250)return;we(this,ko,$s).call(this),clearTimeout(Ie(this,qa));let e=this.hasAttribute(y.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(t.target)||e)&&we(this,xi,Qa).call(this)};Hs=new WeakSet;wu=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(y.USER_INACTIVE);[this,this.media].includes(t.target)&&e?we(this,Za,yo).call(this):we(this,xi,Qa).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&we(this,xi,Qa).call(this)};Za=new WeakSet;yo=function(){if(Ie(this,Ri)<0||this.hasAttribute(y.USER_INACTIVE))return;this.setAttribute(y.USER_INACTIVE,"");let t=new l.CustomEvent(Le.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};ko=new WeakSet;$s=function(){if(!this.hasAttribute(y.USER_INACTIVE))return;this.removeAttribute(y.USER_INACTIVE);let t=new l.CustomEvent(Le.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};xi=new WeakSet;Qa=function(){we(this,ko,$s).call(this),clearTimeout(Ie(this,qa));let t=parseInt(this.autohide);t<0||Zt(this,qa,setTimeout(()=>{we(this,Za,yo).call(this)},t*1e3))};Qt.shadowRootOptions={mode:"open"};Qt.getTemplateHTML=Bh;l.customElements.get("media-container")||l.customElements.define("media-container",Qt);var xu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},oe=(t,e,i)=>(xu(t,e,"read from private field"),i?i.call(t):e.get(t)),za=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},So=(t,e,i,a)=>(xu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Di,Oi,Io,zt,ft,Mt,Ct=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){za(this,ft),za(this,Di,void 0),za(this,Oi,void 0),za(this,Io,void 0),za(this,zt,new Set),So(this,Di,e),So(this,Oi,i),So(this,Io,new Set(a))}[Symbol.iterator](){return oe(this,ft,Mt).values()}get length(){return oe(this,ft,Mt).size}get value(){var e;return(e=[...oe(this,ft,Mt)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(So(this,zt,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...oe(this,ft,Mt)][e]}values(){return oe(this,ft,Mt).values()}forEach(e,i){oe(this,ft,Mt).forEach(e,i)}add(...e){var i,a;e.forEach(r=>oe(this,zt).add(r)),!(this.value===""&&!((i=oe(this,Di))!=null&&i.hasAttribute(`${oe(this,Oi)}`)))&&((a=oe(this,Di))==null||a.setAttribute(`${oe(this,Oi)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>oe(this,zt).delete(a)),(i=oe(this,Di))==null||i.setAttribute(`${oe(this,Oi)}`,`${this.value}`)}contains(e){return oe(this,ft,Mt).has(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){return this.remove(e),this.add(i),e===i}};Di=new WeakMap;Oi=new WeakMap;Io=new WeakMap;zt=new WeakMap;ft=new WeakSet;Mt=function(){return oe(this,zt).size?oe(this,zt):oe(this,Io)};var Gh=(t="")=>t.split(/\s+/),Du=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?fe.CAPTIONS:fe.SUBTITLES,language:i,label:r}},Xt=(t="",e={})=>Gh(t).map(i=>{let a=Du(i);return{...e,...a}}),Ws=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?Du(e):e):typeof t=="string"?Xt(t):[t]:[],Mo=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,vt=(t=[])=>Array.prototype.map.call(t,Mo).join(" "),Yh=(t,e)=>i=>i[t]===e,Ou=t=>{let e=Object.entries(t).map(([i,a])=>Yh(i,a));return i=>e.every(a=>a(i))},Jt=(t,e=[],i=[])=>{let a=Ws(i).map(Ou),r=o=>a.some(s=>s(o));Array.from(e).filter(r).forEach(o=>{o.mode=t})},jt=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:Ou(e);return Array.from(t.textTracks).filter(i)},Co=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(n.MEDIA_SUBTITLES_SHOWING)};var Nu=t=>{var e;let{media:i,fullscreenElement:a}=t;try{let r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let o=(e=a[r])==null?void 0:e.call(a);if(o instanceof Promise)return o.catch(()=>{})}else i!=null&&i.webkitEnterFullscreen?i.webkitEnterFullscreen():i!=null&&i.requestFullscreen&&i.requestFullscreen()}catch(r){console.error(r)}},Pu="exitFullscreen"in V?"exitFullscreen":"webkitExitFullscreen"in V?"webkitExitFullscreen":"webkitCancelFullScreen"in V?"webkitCancelFullScreen":void 0,Uu=t=>{var e;let{documentElement:i}=t;if(Pu){let a=(e=i==null?void 0:i[Pu])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},Xa="fullscreenElement"in V?"fullscreenElement":"webkitFullscreenElement"in V?"webkitFullscreenElement":void 0,qh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[Xa];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===cu.FULLSCREEN?i:a},Hu=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let o=qh(t);if(!o)return!1;if(o===r||o===i)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(Xa in s))return ue(o,r);for(;s!=null&&s[Xa];){if(s[Xa]===r)return!0;s=(e=s[Xa])==null?void 0:e.shadowRoot}}return!1},Zh="fullscreenEnabled"in V?"fullscreenEnabled":"webkitFullscreenEnabled"in V?"webkitFullscreenEnabled":void 0,Bu=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[Zh])||i&&"webkitSupportsFullscreen"in i};var Lo,Fs=()=>{var t,e;return Lo||(Lo=(e=(t=V)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Lo)},$u=async(t=Fs())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([Qh(t,i.signal),zh(t,e)]);return i.abort(),a},Qh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),zh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await uo(10)}return t.volume!==e},Xh=/.*Version\/.*Safari\/.*/.test(l.navigator.userAgent),Vs=(t=Fs())=>l.matchMedia("(display-mode: standalone)").matches&&Xh?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",Ks=(t=Fs())=>Bu({documentElement:V,media:t}),Wu=Ks(),Fu=Vs(),Vu=!!l.WebKitPlaybackTargetAvailabilityEvent,Ku=!!l.chrome;var Pi=t=>jt(t.media,e=>[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),Gs=t=>jt(t.media,e=>e.mode===St.SHOWING&&[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)),wo=(t,e)=>{let i=Pi(t),a=Gs(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)Jt(St.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let o=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let T=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),_=T?[T,...globalThis.navigator.languages]:globalThis.navigator.languages,E=i.filter(f=>_.some(I=>f.language.toLowerCase().startsWith(I.split("-")[0]))).sort((f,I)=>{let b=_.findIndex(C=>f.language.toLowerCase().startsWith(C.split("-")[0])),M=_.findIndex(C=>I.language.toLowerCase().startsWith(C.split("-")[0]));return b-M});E[0]&&(o=E[0])}let{language:d,label:u,kind:p}=o;Jt(St.DISABLED,i,a),Jt(St.SHOWING,i,[{language:d,label:u,kind:p}])}}},Ro=(t,e)=>t===e?!0:t==null||e==null||typeof t!=typeof e?!1:typeof t=="number"&&Number.isNaN(t)&&Number.isNaN(e)?!0:typeof t!="object"?!1:Array.isArray(t)?Jh(t,e):Object.entries(t).every(([i,a])=>i in e&&Ro(a,e[i])),Jh=(t,e)=>{let i=Array.isArray(t),a=Array.isArray(e);return i!==a?!1:i||a?t.length!==e.length?!1:t.every((r,o)=>Ro(r,e[o])):!0};var jh=Object.values(Pe),xo,ep=$u().then(t=>(xo=t,xo)),Gu=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof l.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=l.customElements.get(i);a&&e instanceof a||(await l.customElements.whenDefined(i),l.customElements.upgrade(e))}))},tp=new l.DOMParser,ip=t=>t&&(tp.parseFromString(t,"text/html").body.textContent||t),Ni={mediaError:{get(t,e){let{media:i}=t;if((e==null?void 0:e.type)!=="playing")return i==null?void 0:i.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(t,e){var i;let{media:a}=t;if((e==null?void 0:e.type)!=="playing")return(i=a==null?void 0:a.error)==null?void 0:i.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(t,e){var i,a;let{media:r}=t;if((e==null?void 0:e.type)!=="playing")return(a=(i=r==null?void 0:r.error)==null?void 0:i.message)!=null?a:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.paused)!=null?e:!0},set(t,e){var i;let{media:a}=e;a&&(t?a.pause():(i=a.play())==null||i.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(t,e){let{media:i}=t;return i?e?e.type==="playing":!i.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.playbackRate)!=null?e:1},set(t,e){let{media:i}=e;i&&Number.isFinite(+t)&&(i.playbackRate=+t)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.muted)!=null?e:!1},set(t,e){let{media:i,options:{noMutedPref:a}={}}=e;if(i){i.muted=t;try{let r=l.localStorage.getItem("media-chrome-pref-muted")!==null,o=i.hasAttribute("muted");if(a){r&&l.localStorage.removeItem("media-chrome-pref-muted");return}if(o&&!r)return;l.localStorage.setItem("media-chrome-pref-muted",t?"true":"false")}catch(r){console.debug("Error setting muted pref",r)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noMutedPref:i}}=e,{media:a}=e;if(!(!a||a.muted||i))try{let r=l.localStorage.getItem("media-chrome-pref-muted")==="true";Ni.mediaMuted.set(r,e),t(r)}catch(r){console.debug("Error getting muted pref",r)}}]},mediaLoop:{get(t){let{media:e}=t;return e==null?void 0:e.loop},set(t,e){let{media:i}=e;i&&(i.loop=t)},mediaEvents:["medialooprequest"]},mediaVolume:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.volume)!=null?e:1},set(t,e){let{media:i,options:{noVolumePref:a}={}}=e;if(i){try{t==null?l.localStorage.removeItem("media-chrome-pref-volume"):!i.hasAttribute("muted")&&!a&&l.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch(r){console.debug("Error setting volume pref",r)}Number.isFinite(+t)&&(i.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noVolumePref:i}}=e;if(!i)try{let{media:a}=e;if(!a)return;let r=l.localStorage.getItem("media-chrome-pref-volume");if(r==null)return;Ni.mediaVolume.set(+r,e),t(+r)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(t){let{media:e}=t;return typeof(e==null?void 0:e.volume)=="undefined"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.currentTime)!=null?e:0},set(t,e){let{media:i}=e;!i||!Ci(t)||(i.currentTime=t)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(t){let{media:e,options:{defaultDuration:i}={}}=t;return i&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?i:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(t){let{media:e}=t;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(t){var e;let{media:i}=t;if(!((e=i==null?void 0:i.seekable)!=null&&e.length))return;let a=i.seekable.start(0),r=i.seekable.end(i.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(t){var e;let{media:i}=t,a=(e=i==null?void 0:i.buffered)!=null?e:[];return Array.from(a).map((r,o)=>[Number(a.start(o).toFixed(3)),Number(a.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(t){let{media:e,options:{defaultStreamType:i}={}}=t,a=[Pe.LIVE,Pe.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(jh.includes(r))return r===Pe.UNKNOWN?a:r;let o=e.duration;return o===1/0?Pe.LIVE:Number.isFinite(o)?Pe.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(t){let{media:e}=t;if(!e)return Number.NaN;let{targetLiveWindow:i}=e,a=Ni.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===Pe.LIVE?0:i},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(t){let{media:e,options:{liveEdgeOffset:i=10}={}}=t;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Ni.mediaStreamType.get(t)===Pe.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let o=r.end(r.length-1)-i;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(t){return Pi(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return Gs(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i,a;let{media:r,options:o}=e;if(!r)return;let s=d=>{var u;!o.defaultSubtitles||d&&![fe.CAPTIONS,fe.SUBTITLES].includes((u=d==null?void 0:d.track)==null?void 0:u.kind)||wo(e,!0)};return r.addEventListener("loadstart",s),(i=r.textTracks)==null||i.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),()=>{var d,u;r.removeEventListener("loadstart",s),(d=r.textTracks)==null||d.removeEventListener("addtrack",s),(u=r.textTracks)==null||u.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(t){var e;let{media:i}=t;if(!i)return[];let[a]=jt(i,{kind:fe.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:o,endTime:s})=>({text:ip(r),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;if(!a)return;let r=a.querySelector('track[kind="chapters"][default][src]'),o=(i=a.shadowRoot)==null?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",t),o==null||o.addEventListener("load",t),()=>{r==null||r.removeEventListener("load",t),o==null||o.removeEventListener("load",t)}}]},mediaIsPip:{get(t){var e,i;let{media:a,documentElement:r}=t;if(!a||!r||!r.pictureInPictureElement)return!1;if(r.pictureInPictureElement===a)return!0;if(r.pictureInPictureElement instanceof HTMLMediaElement)return(e=a.localName)!=null&&e.includes("-")?ue(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let o=r.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===a)return!0;o=(i=o.pictureInPictureElement)==null?void 0:i.shadowRoot}}return!1},set(t,e){let{media:i}=e;if(i)if(t){if(!V.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(r=>{if(r.code===11){if(!i.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(i.readyState===0&&i.preload==="none"){let o=()=>{i.removeEventListener("loadedmetadata",s),i.preload="none"},s=()=>{i.requestPictureInPicture().catch(a),o()};i.addEventListener("loadedmetadata",s),i.preload="metadata",setTimeout(()=>{i.readyState===0&&a(),o()},1e3)}else throw r}else throw r})}else V.pictureInPictureElement&&V.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(t){var e,i,a;let{media:r}=t;return(a=(i=r==null?void 0:r.videoRenditions)==null?void 0:i[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=t,r=Array.prototype.findIndex.call(i.videoRenditions,o=>o.id==a);i.videoRenditions.selectedIndex!=r&&(i.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(t){var e,i;let{media:a}=t;return(i=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:i.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=t;for(let r of i.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(t){return Hu(t)},set(t,e,i){var a;t?(Nu(e),i.detail&&((a=e.media)==null||a.focus())):Uu(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(t){var e;let{media:i}=t;return!(i!=null&&i.remote)||((e=i.remote)==null?void 0:e.state)==="disconnected"?!1:!!i.remote.state},set(t,e){var i,a;let{media:r}=e;if(r&&!(t&&((i=r.remote)==null?void 0:i.state)!=="disconnected")&&!(!t&&((a=r.remote)==null?void 0:a.state)!=="connected")){if(typeof r.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}r.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(t,e){let{media:i}=e;if(i){if(!(i.webkitShowPlaybackTargetPicker&&l.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(t){let{media:e}=t;if(!Wu||!Ks(e))return ve.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!Fu||!Vs(e))return ve.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return ve.UNAVAILABLE}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(xo===!1||(e==null?void 0:e.volume)==null)return ve.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{xo==null&&ep.then(e=>t(e?void 0:ve.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!Ku||!((i=a==null?void 0:a.remote)!=null&&i.state))return ve.UNSUPPORTED;if(!(e==null||e==="available"))return ve.UNAVAILABLE},stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(t,e){if(!Vu)return ve.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return ve.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(t){var e;let{media:i}=t;if(!(i!=null&&i.videoRenditions))return ve.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return ve.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return ve.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return ve.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(t){let{options:{mediaLang:e}={}}=t;return e!=null?e:"en"}}};var Yu={[m.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,o;let{media:s}=e,d=i!=null?i:void 0,u,p;if(s&&d!=null){let[f]=jt(s,{kind:fe.METADATA,label:"thumbnails"}),I=Array.prototype.find.call((a=f==null?void 0:f.cues)!=null?a:[],(b,M,C)=>M===0?b.endTime>d:M===C.length-1?b.startTime<=d:b.startTime<=d&&b.endTime>d);if(I){let b=/'^(?:[a-z]+:)?\/\//i.test(I.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,M=new URL(I.text,b);p=new URLSearchParams(M.hash).get("#xywh").split(",").map(ie=>+ie),u=M.href}}let T=t.mediaDuration.get(e),E=(o=t.mediaChaptersCues.get(e).find((f,I,b)=>I===b.length-1&&T===f.endTime?f.startTime<=d&&f.endTime>=d:f.startTime<=d&&f.endTime>d))==null?void 0:o.text;return i!=null&&E==null&&(E=""),{mediaPreviewTime:d,mediaPreviewImage:u,mediaPreviewCoords:p,mediaPreviewChapter:E}},[m.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[m.MEDIA_PLAY_REQUEST](t,e){var i,a,r,o;let s="mediaPaused",u=t.mediaStreamType.get(e)===Pe.LIVE,p=!((i=e.options)!=null&&i.noAutoSeekToLive),T=t.mediaTargetLiveWindow.get(e)>0;if(u&&p&&!T){let _=(a=t.mediaSeekable.get(e))==null?void 0:a[1];if(_){let E=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,f=_-E;t.mediaCurrentTime.set(f,e)}}t[s].set(!1,e)},[m.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[m.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[m.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[m.MEDIA_LOOP_REQUEST](t,e,{detail:i}){let a="mediaLoop",r=!!i;return t[a].set(r,e),{mediaLoop:r}},[m.MEDIA_VOLUME_REQUEST](t,e,{detail:i}){let a="mediaVolume",r=i;r&&t.mediaMuted.get(e)&&t.mediaMuted.set(!1,e),t[a].set(r,e)},[m.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[m.MEDIA_SEEK_TO_LIVE_REQUEST](t,e){var i,a,r;let o="mediaCurrentTime",s=(i=t.mediaSeekable.get(e))==null?void 0:i[1];if(Number.isNaN(Number(s)))return;let d=(r=(a=e.options)==null?void 0:a.seekToLiveOffset)!=null?r:0,u=s-d;t[o].set(u,e)},[m.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,o=Pi(e),s=Ws(i),d=(a=s[0])==null?void 0:a.language;d&&!r.noSubtitlesLangPref&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),Jt(St.SHOWING,o,s)},[m.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=Pi(e),r=i!=null?i:[];Jt(St.DISABLED,a,r)},[m.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){wo(e,i)},[m.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[m.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[m.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[m.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[m.MEDIA_ENTER_FULLSCREEN_REQUEST](t,e,i){let a="mediaIsFullscreen";t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t[a].set(!0,e,i)},[m.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[m.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[m.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[m.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var qu=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Ni,requestMap:r=Yu,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let d=[],u={options:{...o}},p=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),T=b=>{b!=null&&(Ro(b,p)||(p=Object.freeze({...p,...b}),d.forEach(M=>M(p))))},_=()=>{let b=Object.entries(a).reduce((M,[C,{get:ie}])=>(M[C]=ie(u),M),{});T(b)},E={},f,I=async(b,M)=>{var C,ie,Ae,kt,ct,Ia,Ma,Ca,La,wa,Ra,xa,Da,Oa,Pa,Na;let oo=!!f;if(f={...u,...f!=null?f:{},...b},oo)return;await Gu(...Object.values(b));let mt=d.length>0&&M===0&&s,Ua=u.media!==f.media,Ha=((C=u.media)==null?void 0:C.textTracks)!==((ie=f.media)==null?void 0:ie.textTracks),Ba=((Ae=u.media)==null?void 0:Ae.videoRenditions)!==((kt=f.media)==null?void 0:kt.videoRenditions),Kd=((ct=u.media)==null?void 0:ct.audioTracks)!==((Ia=f.media)==null?void 0:Ia.audioTracks),Gd=((Ma=u.media)==null?void 0:Ma.remote)!==((Ca=f.media)==null?void 0:Ca.remote),Yd=u.documentElement!==f.documentElement,qd=!!u.media&&(Ua||mt),Zd=!!((La=u.media)!=null&&La.textTracks)&&(Ha||mt),Qd=!!((wa=u.media)!=null&&wa.videoRenditions)&&(Ba||mt),zd=!!((Ra=u.media)!=null&&Ra.audioTracks)&&(Kd||mt),Xd=!!((xa=u.media)!=null&&xa.remote)&&(Gd||mt),Jd=!!u.documentElement&&(Yd||mt),Is=qd||Zd||Qd||zd||Xd||Jd,Ii=d.length===0&&M===1&&s,jd=!!f.media&&(Ua||Ii),eu=!!((Da=f.media)!=null&&Da.textTracks)&&(Ha||Ii),tu=!!((Oa=f.media)!=null&&Oa.videoRenditions)&&(Ba||Ii),iu=!!((Pa=f.media)!=null&&Pa.audioTracks)&&(Kd||Ii),au=!!((Na=f.media)!=null&&Na.remote)&&(Gd||Ii),ru=!!f.documentElement&&(Yd||Ii),ou=jd||eu||tu||iu||au||ru;if(!(Is||ou)){Object.entries(f).forEach(([F,$a])=>{u[F]=$a}),_(),f=void 0;return}Object.entries(a).forEach(([F,{get:$a,mediaEvents:uh=[],textTracksEvents:ch=[],videoRenditionsEvents:mh=[],audioTracksEvents:hh=[],remoteEvents:ph=[],rootEvents:fh=[],stateOwnersUpdateHandlers:vh=[]}])=>{E[F]||(E[F]={});let Te=Q=>{let ee=$a(u,Q);T({[F]:ee})},re;re=E[F].mediaEvents,uh.forEach(Q=>{re&&qd&&(u.media.removeEventListener(Q,re),E[F].mediaEvents=void 0),jd&&(f.media.addEventListener(Q,Te),E[F].mediaEvents=Te)}),re=E[F].textTracksEvents,ch.forEach(Q=>{var ee,Oe;re&&Zd&&((ee=u.media.textTracks)==null||ee.removeEventListener(Q,re),E[F].textTracksEvents=void 0),eu&&((Oe=f.media.textTracks)==null||Oe.addEventListener(Q,Te),E[F].textTracksEvents=Te)}),re=E[F].videoRenditionsEvents,mh.forEach(Q=>{var ee,Oe;re&&Qd&&((ee=u.media.videoRenditions)==null||ee.removeEventListener(Q,re),E[F].videoRenditionsEvents=void 0),tu&&((Oe=f.media.videoRenditions)==null||Oe.addEventListener(Q,Te),E[F].videoRenditionsEvents=Te)}),re=E[F].audioTracksEvents,hh.forEach(Q=>{var ee,Oe;re&&zd&&((ee=u.media.audioTracks)==null||ee.removeEventListener(Q,re),E[F].audioTracksEvents=void 0),iu&&((Oe=f.media.audioTracks)==null||Oe.addEventListener(Q,Te),E[F].audioTracksEvents=Te)}),re=E[F].remoteEvents,ph.forEach(Q=>{var ee,Oe;re&&Xd&&((ee=u.media.remote)==null||ee.removeEventListener(Q,re),E[F].remoteEvents=void 0),au&&((Oe=f.media.remote)==null||Oe.addEventListener(Q,Te),E[F].remoteEvents=Te)}),re=E[F].rootEvents,fh.forEach(Q=>{re&&Jd&&(u.documentElement.removeEventListener(Q,re),E[F].rootEvents=void 0),ru&&(f.documentElement.addEventListener(Q,Te),E[F].rootEvents=Te)});let no=E[F].stateOwnersUpdateHandlers;if(no&&Is&&(Array.isArray(no)?no:[no]).forEach(ee=>{typeof ee=="function"&&ee()}),ou){let Q=vh.map(ee=>ee(Te,f)).filter(ee=>typeof ee=="function");E[F].stateOwnersUpdateHandlers=Q.length===1?Q[0]:Q}else Is&&(E[F].stateOwnersUpdateHandlers=void 0)}),Object.entries(f).forEach(([F,$a])=>{u[F]=$a}),_(),f=void 0};return I({media:t,fullscreenElement:e,documentElement:i,options:o}),{dispatch(b){let{type:M,detail:C}=b;if(r[M]&&p.mediaErrorCode==null){T(r[M](a,u,b));return}M==="mediaelementchangerequest"?I({media:C}):M==="fullscreenelementchangerequest"?I({fullscreenElement:C}):M==="documentelementchangerequest"?I({documentElement:C}):M==="optionschangerequest"&&(Object.entries(C!=null?C:{}).forEach(([ie,Ae])=>{u.options[ie]=Ae}),_())},getState(){return p},subscribe(b){return I({},d.length+1),d.push(b),b(p),()=>{let M=d.indexOf(b);M>=0&&(I({},d.length-1),d.splice(M,1))}}}};var zs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},L=(t,e,i)=>(zs(t,e,"read from private field"),i?i.call(t):e.get(t)),Ue=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Et=(t,e,i,a)=>(zs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ge=(t,e,i)=>(zs(t,e,"access private method"),i),Lt,Ja,$,ti,ja,Ke,Do,Oo,Ys,ii,Ui,Po,qs,Zs,ec,tc=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],Zu=10,Qu=.025,zu=.25,ap=.25,rp=2,v={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},No=class extends Qt{constructor(){super(),Ue(this,Oo),Ue(this,ii),Ue(this,Po),Ue(this,Zs),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Ue(this,Lt,new Ct(this,v.HOTKEYS)),Ue(this,Ja,void 0),Ue(this,$,void 0),Ue(this,ti,null),Ue(this,ja,void 0),Ue(this,Ke,void 0),Ue(this,Do,i=>{var a;(a=L(this,$))==null||a.dispatch(i)}),this.associateElement(this);let e={};Et(this,ja,i=>{Object.entries(i).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let o=a.toLowerCase(),s=new l.CustomEvent(uu[o],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.hasAttribute(v.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(v.NO_HOTKEYS,v.HOTKEYS,v.DEFAULT_STREAM_TYPE,v.DEFAULT_SUBTITLES,v.DEFAULT_DURATION,v.NO_MUTED_PREF,v.NO_VOLUME_PREF,v.LANG,v.LOOP)}get mediaStore(){return L(this,$)}set mediaStore(e){var i,a;if(L(this,$)&&((i=L(this,Ke))==null||i.call(this),Et(this,Ke,void 0)),Et(this,$,e),!L(this,$)&&!this.hasAttribute(v.NO_DEFAULT_STORE)){Ge(this,Oo,Ys).call(this);return}Et(this,Ke,(a=L(this,$))==null?void 0:a.subscribe(L(this,ja)))}get fullscreenElement(){var e;return(e=L(this,Ja))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(v.FULLSCREEN_ELEMENT)&&this.removeAttribute(v.FULLSCREEN_ELEMENT),Et(this,Ja,e),(i=L(this,$))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return k(this,v.DEFAULT_SUBTITLES)}set defaultSubtitles(e){S(this,v.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return w(this,v.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){R(this,v.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return O(this,v.DEFAULT_DURATION)}set defaultDuration(e){N(this,v.DEFAULT_DURATION,e)}get noHotkeys(){return k(this,v.NO_HOTKEYS)}set noHotkeys(e){S(this,v.NO_HOTKEYS,e)}get keysUsed(){return w(this,v.KEYS_USED)}set keysUsed(e){R(this,v.KEYS_USED,e)}get liveEdgeOffset(){return O(this,v.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){N(this,v.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return k(this,v.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){S(this,v.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return k(this,v.NO_VOLUME_PREF)}set noVolumePref(e){S(this,v.NO_VOLUME_PREF,e)}get noMutedPref(){return k(this,v.NO_MUTED_PREF)}set noMutedPref(e){S(this,v.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return k(this,v.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){S(this,v.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return k(this,v.NO_DEFAULT_STORE)}set noDefaultStore(e){S(this,v.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,o,s,d,u,p,T,_,E,f,I,b;if(super.attributeChangedCallback(e,i,a),e===v.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(v.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==i&&a===null&&this.enableHotkeys();else if(e===v.HOTKEYS)L(this,Lt).value=a;else if(e===v.DEFAULT_SUBTITLES&&a!==i)(r=L(this,$))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(v.DEFAULT_SUBTITLES)}});else if(e===v.DEFAULT_STREAM_TYPE)(s=L(this,$))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(v.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===v.LIVE_EDGE_OFFSET)(d=L(this,$))==null||d.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(v.LIVE_EDGE_OFFSET)}});else if(e===v.SEEK_TO_LIVE_OFFSET)(u=L(this,$))==null||u.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(v.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===v.NO_AUTO_SEEK_TO_LIVE)(p=L(this,$))==null||p.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(v.NO_AUTO_SEEK_TO_LIVE)}});else if(e===v.FULLSCREEN_ELEMENT){let M=a?(T=this.getRootNode())==null?void 0:T.getElementById(a):void 0;Et(this,Ja,M),(_=L(this,$))==null||_.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===v.LANG&&a!==i?(_u(a),(E=L(this,$))==null||E.dispatch({type:"optionschangerequest",detail:{mediaLang:a}})):e===v.LOOP&&a!==i?(f=L(this,$))==null||f.dispatch({type:m.MEDIA_LOOP_REQUEST,detail:a!=null}):e===v.NO_VOLUME_PREF&&a!==i?(I=L(this,$))==null||I.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(v.NO_VOLUME_PREF)}}):e===v.NO_MUTED_PREF&&a!==i&&((b=L(this,$))==null||b.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(v.NO_MUTED_PREF)}}))}connectedCallback(){var e,i;!L(this,$)&&!this.hasAttribute(v.NO_DEFAULT_STORE)&&Ge(this,Oo,Ys).call(this),(e=L(this,$))==null||e.dispatch({type:"documentelementchangerequest",detail:V}),super.connectedCallback(),L(this,$)&&!L(this,Ke)&&Et(this,Ke,(i=L(this,$))==null?void 0:i.subscribe(L(this,ja))),this.hasAttribute(v.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,i,a,r;(e=super.disconnectedCallback)==null||e.call(this),L(this,$)&&((i=L(this,$))==null||i.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=L(this,$))==null||a.dispatch({type:m.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),L(this,Ke)&&((r=L(this,Ke))==null||r.call(this),Et(this,Ke,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=L(this,$))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=L(this,$))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){ju(this.mediaStateReceivers,e,i)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(i.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),o=up(e,a,r);Object.values(m).forEach(s=>{e.addEventListener(s,L(this,Do))}),i.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(!i.has(e))return;i.get(e)(),i.delete(e),Object.values(m).forEach(r=>{e.removeEventListener(r,L(this,Do))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),L(this,$)&&Object.entries(L(this,$).getState()).forEach(([r,o])=>{ju([e],r,o)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Ge(this,Po,qs))}disableHotkeys(){this.removeEventListener("keydown",Ge(this,Po,qs)),this.removeEventListener("keyup",Ge(this,ii,Ui))}get hotkeys(){return w(this,v.HOTKEYS)}set hotkeys(e){R(this,v.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,o,s,d,u,p,T;let _=e.target;if(((r=(a=(i=_.getAttribute(v.KEYS_USED))==null?void 0:i.split(" "))!=null?a:_==null?void 0:_.keysUsed)!=null?r:[]).map(C=>C==="Space"?" ":C).filter(Boolean).includes(e.key))return;let f,I,b;if(!(L(this,Lt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&L(this,Lt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&L(this,Lt).contains("noshift+/")))switch(e.key){case" ":case"k":f=L(this,$).getState().mediaPaused?m.MEDIA_PLAY_REQUEST:m.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"m":f=this.mediaStore.getState().mediaVolumeLevel==="off"?m.MEDIA_UNMUTE_REQUEST:m.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"f":f=this.mediaStore.getState().mediaIsFullscreen?m.MEDIA_EXIT_FULLSCREEN_REQUEST:m.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(m.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let C=this.hasAttribute(v.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(v.KEYBOARD_BACKWARD_SEEK_OFFSET):Zu;I=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-C,0),b=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"ArrowRight":case"l":{let C=this.hasAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET):Zu;I=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+C,0),b=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"ArrowUp":{let C=this.hasAttribute(v.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_UP_VOLUME_STEP):Qu;I=Math.min(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)+C,1),b=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"ArrowDown":{let C=this.hasAttribute(v.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_DOWN_VOLUME_STEP):Qu;I=Math.max(((u=this.mediaStore.getState().mediaVolume)!=null?u:1)-C,0),b=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"<":{let C=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;I=Math.max(C-zu,ap).toFixed(2),b=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case">":{let C=(T=this.mediaStore.getState().mediaPlaybackRate)!=null?T:1;I=Math.min(C+zu,rp).toFixed(2),b=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"/":case"?":{e.shiftKey&&Ge(this,Zs,ec).call(this);break}case"p":{f=this.mediaStore.getState().mediaIsPip?m.MEDIA_EXIT_PIP_REQUEST:m.MEDIA_ENTER_PIP_REQUEST,b=new l.CustomEvent(f,{composed:!0,bubbles:!0}),this.dispatchEvent(b);break}default:break}}};Lt=new WeakMap;Ja=new WeakMap;$=new WeakMap;ti=new WeakMap;ja=new WeakMap;Ke=new WeakMap;Do=new WeakMap;Oo=new WeakSet;Ys=function(){var t;this.mediaStore=qu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(v.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(v.DEFAULT_DURATION)?+this.getAttribute(v.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(v.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(v.SEEK_TO_LIVE_OFFSET):this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(v.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(v.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(v.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(v.NO_SUBTITLES_LANG_PREF)}})};ii=new WeakSet;Ui=function(t){let{key:e,shiftKey:i}=t;if(!(i&&(e==="/"||e==="?")||tc.includes(e))){this.removeEventListener("keyup",Ge(this,ii,Ui));return}this.keyboardShortcutHandler(t)};Po=new WeakSet;qs=function(t){var e;let{metaKey:i,altKey:a,key:r,shiftKey:o}=t,s=o&&(r==="/"||r==="?");if(s&&((e=L(this,ti))!=null&&e.open)){this.removeEventListener("keyup",Ge(this,ii,Ui));return}if(i||a||!s&&!tc.includes(r)){this.removeEventListener("keyup",Ge(this,ii,Ui));return}let d=t.target,u=d instanceof HTMLElement&&(d.tagName.toLowerCase()==="media-volume-range"||d.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(r)&&!(L(this,Lt).contains(`no${r.toLowerCase()}`)||r===" "&&L(this,Lt).contains("nospace"))&&!u&&t.preventDefault(),this.addEventListener("keyup",Ge(this,ii,Ui),{once:!0})};Zs=new WeakSet;ec=function(){L(this,ti)||(Et(this,ti,V.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(L(this,ti))),L(this,ti).open=!0};var op=Object.values(n),np=Object.values(Rs),ic=t=>{var e,i,a,r;let{observedAttributes:o}=t.constructor;!o&&((e=t.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(t),{observedAttributes:o}=t.constructor);let s=(r=(a=(i=t==null?void 0:t.getAttribute)==null?void 0:i.call(t,x.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(o||s)?(o||s).filter(d=>op.includes(d)):[]},sp=t=>{var e,i;return(e=t.nodeName)!=null&&e.includes("-")&&l.customElements.get((i=t.nodeName)==null?void 0:i.toLowerCase())&&!(t instanceof l.customElements.get(t.nodeName.toLowerCase()))&&l.customElements.upgrade(t),np.some(a=>a in t)},Qs=t=>sp(t)||!!ic(t).length,Xu=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},Ju={[n.MEDIA_SUBTITLES_LIST]:vt,[n.MEDIA_SUBTITLES_SHOWING]:vt,[n.MEDIA_SEEKABLE]:Xu,[n.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(Xu).join(" "),[n.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[n.MEDIA_RENDITION_LIST]:mu,[n.MEDIA_AUDIO_TRACK_LIST]:pu},lp=async(t,e,i)=>{var a,r;if(t.isConnected||await uo(0),typeof i=="boolean"||i==null)return S(t,e,i);if(typeof i=="number")return N(t,e,i);if(typeof i=="string")return R(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let o=(r=(a=Ju[e])==null?void 0:a.call(Ju,i))!=null?r:i;return t.setAttribute(e,o)},dp=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},ei=(t,e)=>{if(dp(t))return;let i=(r,o)=>{var s,d;Qs(r)&&o(r);let{children:u=[]}=r!=null?r:{},p=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...u,...p].forEach(_=>ei(_,o))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Qs(t)){l.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},ju=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=ic(a),o=e.toLowerCase();r.includes(o)&&lp(a,o,i)})},up=(t,e,i)=>{ei(t,e);let a=T=>{var _;let E=(_=T==null?void 0:T.composedPath()[0])!=null?_:T.target;e(E)},r=T=>{var _;let E=(_=T==null?void 0:T.composedPath()[0])!=null?_:T.target;i(E)};t.addEventListener(m.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(m.UNREGISTER_MEDIA_STATE_RECEIVER,r);let o=T=>{T.forEach(_=>{let{addedNodes:E=[],removedNodes:f=[],type:I,target:b,attributeName:M}=_;I==="childList"?(Array.prototype.forEach.call(E,C=>ei(C,e)),Array.prototype.forEach.call(f,C=>ei(C,i))):I==="attributes"&&M===x.MEDIA_CHROME_ATTRIBUTES&&(Qs(b)?e(b):i(b))})},s=[],d=T=>{let _=T.target;_.name!=="media"&&(s.forEach(E=>ei(E,i)),s=[..._.assignedElements({flatten:!0})],s.forEach(E=>ei(E,e)))};t.addEventListener("slotchange",d);let u=new MutationObserver(o);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{ei(t,i),t.removeEventListener("slotchange",d),u.disconnect(),t.removeEventListener(m.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(m.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",No);var Xs=No;var Hi={PLACEMENT:"placement",BOUNDS:"bounds"};function cp(t){return`
159
+ `}var $h=Object.values(n),Wh="sm:384 md:576 lg:768 xl:960";function Fh(t){Ru(t.target,t.contentRect.width)}function Ru(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(y.BREAKPOINTS))!=null?i:Wh,r=Vh(a),o=Kh(r,e),s=!1;if(Object.keys(r).forEach(d=>{if(o.includes(d)){t.hasAttribute(`breakpoint${d}`)||(t.setAttribute(`breakpoint${d}`,""),s=!0);return}t.hasAttribute(`breakpoint${d}`)&&(t.removeAttribute(`breakpoint${d}`),s=!0)}),s){let d=new CustomEvent(Le.BREAKPOINTS_CHANGE,{detail:o});t.dispatchEvent(d)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(Le.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Vh(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function Kh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var Qt=class extends l.HTMLElement{constructor(){if(super(),Se(this,Us),Se(this,Hs),Se(this,Bs),Se(this,Qa),Se(this,So),Se(this,xi),Se(this,yo,0),Se(this,wi,null),Se(this,Za,null),Se(this,Ri,void 0),this.breakpointsComputed=!1,Se(this,Ao,new MutationObserver(we(this,Us,Cu).bind(this))),Se(this,qa,!1),Se(this,To,i=>{Ie(this,qa)||(setTimeout(()=>{Fh(i),Zt(this,qa,!1)},0),Zt(this,qa,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let i=Z(this.attributes),a=this.constructor.getTemplateHTML(i);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(a):this.shadowRoot.innerHTML=a}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){Ie(this,wi)&&this.mediaUnsetCallback(Ie(this,wi));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[y.AUTOHIDE,y.GESTURES_DISABLED].concat($h).filter(e=>![n.MEDIA_RENDITION_LIST,n.MEDIA_AUDIO_TRACK_LIST,n.MEDIA_CHAPTERS_CUES,n.MEDIA_WIDTH,n.MEDIA_HEIGHT,n.MEDIA_ERROR,n.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,i,a){e.toLowerCase()==y.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Zt(this,wi,e),e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Ie(this,Ao).observe(this,{childList:!0,subtree:!0}),ht(this,Ie(this,To));let a=this.getAttribute(y.AUDIO)!=null?h("audio player"):h("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(y.USER_INACTIVE,""),Ru(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=l.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Ie(this,Ao).disconnect(),pt(this,Ie(this,To)),this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Zt(this,wi,null)}handleEvent(e){switch(e.type){case"pointerdown":Zt(this,yo,e.timeStamp);break;case"pointermove":we(this,Hs,Lu).call(this,e);break;case"pointerup":we(this,Bs,wu).call(this,e);break;case"mouseleave":we(this,Qa,ko).call(this);break;case"mouseup":this.removeAttribute(y.KEYBOARD_CONTROL);break;case"keyup":we(this,xi,za).call(this),this.setAttribute(y.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Zt(this,Ri,isNaN(i)?0:i)}get autohide(){return(Ie(this,Ri)===void 0?2:Ie(this,Ri)).toString()}get breakpoints(){return w(this,y.BREAKPOINTS)}set breakpoints(e){R(this,y.BREAKPOINTS,e)}get audio(){return k(this,y.AUDIO)}set audio(e){S(this,y.AUDIO,e)}get gesturesDisabled(){return k(this,y.GESTURES_DISABLED)}set gesturesDisabled(e){S(this,y.GESTURES_DISABLED,e)}get keyboardControl(){return k(this,y.KEYBOARD_CONTROL)}set keyboardControl(e){S(this,y.KEYBOARD_CONTROL,e)}get noAutohide(){return k(this,y.NO_AUTOHIDE)}set noAutohide(e){S(this,y.NO_AUTOHIDE,e)}get autohideOverControls(){return k(this,y.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){S(this,y.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return k(this,y.USER_INACTIVE)}set userInteractive(e){S(this,y.USER_INACTIVE,e)}};yo=new WeakMap;wi=new WeakMap;Za=new WeakMap;Ri=new WeakMap;Ao=new WeakMap;Us=new WeakSet;Cu=function(t){let e=this.media;for(let i of t){if(i.type!=="childList")continue;let a=i.removedNodes;for(let r of a){if(r.slot!="media"||i.target!=this)continue;let o=i.previousSibling&&i.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(r);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(r)}}if(e)for(let r of i.addedNodes)r===e&&this.handleMediaUpdated(e)}};qa=new WeakMap;To=new WeakMap;Hs=new WeakSet;Lu=function(t){if(t.pointerType!=="mouse"&&t.timeStamp-Ie(this,yo)<250)return;we(this,So,Ws).call(this),clearTimeout(Ie(this,Za));let e=this.hasAttribute(y.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(t.target)||e)&&we(this,xi,za).call(this)};Bs=new WeakSet;wu=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(y.USER_INACTIVE);[this,this.media].includes(t.target)&&e?we(this,Qa,ko).call(this):we(this,xi,za).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&we(this,xi,za).call(this)};Qa=new WeakSet;ko=function(){if(Ie(this,Ri)<0||this.hasAttribute(y.USER_INACTIVE))return;this.setAttribute(y.USER_INACTIVE,"");let t=new l.CustomEvent(Le.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};So=new WeakSet;Ws=function(){if(!this.hasAttribute(y.USER_INACTIVE))return;this.removeAttribute(y.USER_INACTIVE);let t=new l.CustomEvent(Le.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};xi=new WeakSet;za=function(){we(this,So,Ws).call(this),clearTimeout(Ie(this,Za));let t=parseInt(this.autohide);t<0||Zt(this,Za,setTimeout(()=>{we(this,Qa,ko).call(this)},t*1e3))};Qt.shadowRootOptions={mode:"open"};Qt.getTemplateHTML=Bh;l.customElements.get("media-container")||l.customElements.define("media-container",Qt);var xu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},oe=(t,e,i)=>(xu(t,e,"read from private field"),i?i.call(t):e.get(t)),Xa=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Io=(t,e,i,a)=>(xu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Di,Oi,Mo,zt,ft,Mt,Ct=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){Xa(this,ft),Xa(this,Di,void 0),Xa(this,Oi,void 0),Xa(this,Mo,void 0),Xa(this,zt,new Set),Io(this,Di,e),Io(this,Oi,i),Io(this,Mo,new Set(a))}[Symbol.iterator](){return oe(this,ft,Mt).values()}get length(){return oe(this,ft,Mt).size}get value(){var e;return(e=[...oe(this,ft,Mt)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Io(this,zt,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...oe(this,ft,Mt)][e]}values(){return oe(this,ft,Mt).values()}forEach(e,i){oe(this,ft,Mt).forEach(e,i)}add(...e){var i,a;e.forEach(r=>oe(this,zt).add(r)),!(this.value===""&&!((i=oe(this,Di))!=null&&i.hasAttribute(`${oe(this,Oi)}`)))&&((a=oe(this,Di))==null||a.setAttribute(`${oe(this,Oi)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>oe(this,zt).delete(a)),(i=oe(this,Di))==null||i.setAttribute(`${oe(this,Oi)}`,`${this.value}`)}contains(e){return oe(this,ft,Mt).has(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){return this.remove(e),this.add(i),e===i}};Di=new WeakMap;Oi=new WeakMap;Mo=new WeakMap;zt=new WeakMap;ft=new WeakSet;Mt=function(){return oe(this,zt).size?oe(this,zt):oe(this,Mo)};var Gh=(t="")=>t.split(/\s+/),Du=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?fe.CAPTIONS:fe.SUBTITLES,language:i,label:r}},Xt=(t="",e={})=>Gh(t).map(i=>{let a=Du(i);return{...e,...a}}),Fs=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?Du(e):e):typeof t=="string"?Xt(t):[t]:[],Co=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,vt=(t=[])=>Array.prototype.map.call(t,Co).join(" "),Yh=(t,e)=>i=>i[t]===e,Ou=t=>{let e=Object.entries(t).map(([i,a])=>Yh(i,a));return i=>e.every(a=>a(i))},Jt=(t,e=[],i=[])=>{let a=Fs(i).map(Ou),r=o=>a.some(s=>s(o));Array.from(e).filter(r).forEach(o=>{o.mode=t})},jt=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:Ou(e);return Array.from(t.textTracks).filter(i)},Lo=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(n.MEDIA_SUBTITLES_SHOWING)};var Pu=t=>{var e;let{media:i,fullscreenElement:a}=t;try{let r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let o=(e=a[r])==null?void 0:e.call(a);if(o instanceof Promise)return o.catch(()=>{})}else i!=null&&i.webkitEnterFullscreen?i.webkitEnterFullscreen():i!=null&&i.requestFullscreen&&i.requestFullscreen()}catch(r){console.error(r)}},Nu="exitFullscreen"in V?"exitFullscreen":"webkitExitFullscreen"in V?"webkitExitFullscreen":"webkitCancelFullScreen"in V?"webkitCancelFullScreen":void 0,Uu=t=>{var e;let{documentElement:i}=t;if(Nu){let a=(e=i==null?void 0:i[Nu])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},Ja="fullscreenElement"in V?"fullscreenElement":"webkitFullscreenElement"in V?"webkitFullscreenElement":void 0,qh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[Ja];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===cu.FULLSCREEN?i:a},Hu=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let o=qh(t);if(!o)return!1;if(o===r||o===i)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(Ja in s))return ue(o,r);for(;s!=null&&s[Ja];){if(s[Ja]===r)return!0;s=(e=s[Ja])==null?void 0:e.shadowRoot}}return!1},Zh="fullscreenEnabled"in V?"fullscreenEnabled":"webkitFullscreenEnabled"in V?"webkitFullscreenEnabled":void 0,Bu=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[Zh])||i&&"webkitSupportsFullscreen"in i};var wo,Vs=()=>{var t,e;return wo||(wo=(e=(t=V)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),wo)},$u=async(t=Vs())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([Qh(t,i.signal),zh(t,e)]);return i.abort(),a},Qh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),zh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await co(10)}return t.volume!==e},Xh=/.*Version\/.*Safari\/.*/.test(l.navigator.userAgent),Ks=(t=Vs())=>l.matchMedia("(display-mode: standalone)").matches&&Xh?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",Gs=(t=Vs())=>Bu({documentElement:V,media:t}),Wu=Gs(),Fu=Ks(),Vu=!!l.WebKitPlaybackTargetAvailabilityEvent,Ku=!!l.chrome;var Ni=t=>jt(t.media,e=>[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),Ys=t=>jt(t.media,e=>e.mode===St.SHOWING&&[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)),Ro=(t,e)=>{let i=Ni(t),a=Ys(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)Jt(St.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let o=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let T=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),_=T?[T,...globalThis.navigator.languages]:globalThis.navigator.languages,E=i.filter(f=>_.some(I=>f.language.toLowerCase().startsWith(I.split("-")[0]))).sort((f,I)=>{let b=_.findIndex(C=>f.language.toLowerCase().startsWith(C.split("-")[0])),M=_.findIndex(C=>I.language.toLowerCase().startsWith(C.split("-")[0]));return b-M});E[0]&&(o=E[0])}let{language:d,label:u,kind:p}=o;Jt(St.DISABLED,i,a),Jt(St.SHOWING,i,[{language:d,label:u,kind:p}])}}},xo=(t,e)=>t===e?!0:t==null||e==null||typeof t!=typeof e?!1:typeof t=="number"&&Number.isNaN(t)&&Number.isNaN(e)?!0:typeof t!="object"?!1:Array.isArray(t)?Jh(t,e):Object.entries(t).every(([i,a])=>i in e&&xo(a,e[i])),Jh=(t,e)=>{let i=Array.isArray(t),a=Array.isArray(e);return i!==a?!1:i||a?t.length!==e.length?!1:t.every((r,o)=>xo(r,e[o])):!0};var jh=Object.values(Ne),Do,ep=$u().then(t=>(Do=t,Do)),Gu=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof l.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=l.customElements.get(i);a&&e instanceof a||(await l.customElements.whenDefined(i),l.customElements.upgrade(e))}))},tp=new l.DOMParser,ip=t=>t&&(tp.parseFromString(t,"text/html").body.textContent||t),Pi={mediaError:{get(t,e){let{media:i}=t;if((e==null?void 0:e.type)!=="playing")return i==null?void 0:i.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(t,e){var i;let{media:a}=t;if((e==null?void 0:e.type)!=="playing")return(i=a==null?void 0:a.error)==null?void 0:i.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(t,e){var i,a;let{media:r}=t;if((e==null?void 0:e.type)!=="playing")return(a=(i=r==null?void 0:r.error)==null?void 0:i.message)!=null?a:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.paused)!=null?e:!0},set(t,e){var i;let{media:a}=e;a&&(t?a.pause():(i=a.play())==null||i.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(t,e){let{media:i}=t;return i?e?e.type==="playing":!i.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.playbackRate)!=null?e:1},set(t,e){let{media:i}=e;i&&Number.isFinite(+t)&&(i.playbackRate=+t)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.muted)!=null?e:!1},set(t,e){let{media:i,options:{noMutedPref:a}={}}=e;if(i){i.muted=t;try{let r=l.localStorage.getItem("media-chrome-pref-muted")!==null,o=i.hasAttribute("muted");if(a){r&&l.localStorage.removeItem("media-chrome-pref-muted");return}if(o&&!r)return;l.localStorage.setItem("media-chrome-pref-muted",t?"true":"false")}catch(r){console.debug("Error setting muted pref",r)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noMutedPref:i}}=e,{media:a}=e;if(!(!a||a.muted||i))try{let r=l.localStorage.getItem("media-chrome-pref-muted")==="true";Pi.mediaMuted.set(r,e),t(r)}catch(r){console.debug("Error getting muted pref",r)}}]},mediaLoop:{get(t){let{media:e}=t;return e==null?void 0:e.loop},set(t,e){let{media:i}=e;i&&(i.loop=t)},mediaEvents:["medialooprequest"]},mediaVolume:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.volume)!=null?e:1},set(t,e){let{media:i,options:{noVolumePref:a}={}}=e;if(i){try{t==null?l.localStorage.removeItem("media-chrome-pref-volume"):!i.hasAttribute("muted")&&!a&&l.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch(r){console.debug("Error setting volume pref",r)}Number.isFinite(+t)&&(i.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noVolumePref:i}}=e;if(!i)try{let{media:a}=e;if(!a)return;let r=l.localStorage.getItem("media-chrome-pref-volume");if(r==null)return;Pi.mediaVolume.set(+r,e),t(+r)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(t){let{media:e}=t;return typeof(e==null?void 0:e.volume)=="undefined"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.currentTime)!=null?e:0},set(t,e){let{media:i}=e;!i||!Ci(t)||(i.currentTime=t)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(t){let{media:e,options:{defaultDuration:i}={}}=t;return i&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?i:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(t){let{media:e}=t;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(t){var e;let{media:i}=t;if(!((e=i==null?void 0:i.seekable)!=null&&e.length))return;let a=i.seekable.start(0),r=i.seekable.end(i.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(t){var e;let{media:i}=t,a=(e=i==null?void 0:i.buffered)!=null?e:[];return Array.from(a).map((r,o)=>[Number(a.start(o).toFixed(3)),Number(a.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(t){let{media:e,options:{defaultStreamType:i}={}}=t,a=[Ne.LIVE,Ne.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(jh.includes(r))return r===Ne.UNKNOWN?a:r;let o=e.duration;return o===1/0?Ne.LIVE:Number.isFinite(o)?Ne.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(t){let{media:e}=t;if(!e)return Number.NaN;let{targetLiveWindow:i}=e,a=Pi.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===Ne.LIVE?0:i},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(t){let{media:e,options:{liveEdgeOffset:i=10}={}}=t;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Pi.mediaStreamType.get(t)===Ne.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let o=r.end(r.length-1)-i;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(t){return Ni(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return Ys(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i,a;let{media:r,options:o}=e;if(!r)return;let s=d=>{var u;!o.defaultSubtitles||d&&![fe.CAPTIONS,fe.SUBTITLES].includes((u=d==null?void 0:d.track)==null?void 0:u.kind)||Ro(e,!0)};return r.addEventListener("loadstart",s),(i=r.textTracks)==null||i.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),()=>{var d,u;r.removeEventListener("loadstart",s),(d=r.textTracks)==null||d.removeEventListener("addtrack",s),(u=r.textTracks)==null||u.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(t){var e;let{media:i}=t;if(!i)return[];let[a]=jt(i,{kind:fe.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:o,endTime:s})=>({text:ip(r),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;if(!a)return;let r=a.querySelector('track[kind="chapters"][default][src]'),o=(i=a.shadowRoot)==null?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",t),o==null||o.addEventListener("load",t),()=>{r==null||r.removeEventListener("load",t),o==null||o.removeEventListener("load",t)}}]},mediaIsPip:{get(t){var e,i;let{media:a,documentElement:r}=t;if(!a||!r||!r.pictureInPictureElement)return!1;if(r.pictureInPictureElement===a)return!0;if(r.pictureInPictureElement instanceof HTMLMediaElement)return(e=a.localName)!=null&&e.includes("-")?ue(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let o=r.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===a)return!0;o=(i=o.pictureInPictureElement)==null?void 0:i.shadowRoot}}return!1},set(t,e){let{media:i}=e;if(i)if(t){if(!V.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(r=>{if(r.code===11){if(!i.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(i.readyState===0&&i.preload==="none"){let o=()=>{i.removeEventListener("loadedmetadata",s),i.preload="none"},s=()=>{i.requestPictureInPicture().catch(a),o()};i.addEventListener("loadedmetadata",s),i.preload="metadata",setTimeout(()=>{i.readyState===0&&a(),o()},1e3)}else throw r}else throw r})}else V.pictureInPictureElement&&V.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(t){var e,i,a;let{media:r}=t;return(a=(i=r==null?void 0:r.videoRenditions)==null?void 0:i[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=t,r=Array.prototype.findIndex.call(i.videoRenditions,o=>o.id==a);i.videoRenditions.selectedIndex!=r&&(i.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(t){var e,i;let{media:a}=t;return(i=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:i.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=t;for(let r of i.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(t){return Hu(t)},set(t,e,i){var a;t?(Pu(e),i.detail&&((a=e.media)==null||a.focus())):Uu(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(t){var e;let{media:i}=t;return!(i!=null&&i.remote)||((e=i.remote)==null?void 0:e.state)==="disconnected"?!1:!!i.remote.state},set(t,e){var i,a;let{media:r}=e;if(r&&!(t&&((i=r.remote)==null?void 0:i.state)!=="disconnected")&&!(!t&&((a=r.remote)==null?void 0:a.state)!=="connected")){if(typeof r.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}r.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(t,e){let{media:i}=e;if(i){if(!(i.webkitShowPlaybackTargetPicker&&l.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(t){let{media:e}=t;if(!Wu||!Gs(e))return ve.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!Fu||!Ks(e))return ve.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return ve.UNAVAILABLE}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(Do===!1||(e==null?void 0:e.volume)==null)return ve.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{Do==null&&ep.then(e=>t(e?void 0:ve.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!Ku||!((i=a==null?void 0:a.remote)!=null&&i.state))return ve.UNSUPPORTED;if(!(e==null||e==="available"))return ve.UNAVAILABLE},stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(t,e){if(!Vu)return ve.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return ve.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(t){var e;let{media:i}=t;if(!(i!=null&&i.videoRenditions))return ve.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return ve.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return ve.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return ve.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(t){let{options:{mediaLang:e}={}}=t;return e!=null?e:"en"}}};var Yu={[m.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,o;let{media:s}=e,d=i!=null?i:void 0,u,p;if(s&&d!=null){let[f]=jt(s,{kind:fe.METADATA,label:"thumbnails"}),I=Array.prototype.find.call((a=f==null?void 0:f.cues)!=null?a:[],(b,M,C)=>M===0?b.endTime>d:M===C.length-1?b.startTime<=d:b.startTime<=d&&b.endTime>d);if(I){let b=/'^(?:[a-z]+:)?\/\//i.test(I.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,M=new URL(I.text,b);p=new URLSearchParams(M.hash).get("#xywh").split(",").map(ie=>+ie),u=M.href}}let T=t.mediaDuration.get(e),E=(o=t.mediaChaptersCues.get(e).find((f,I,b)=>I===b.length-1&&T===f.endTime?f.startTime<=d&&f.endTime>=d:f.startTime<=d&&f.endTime>d))==null?void 0:o.text;return i!=null&&E==null&&(E=""),{mediaPreviewTime:d,mediaPreviewImage:u,mediaPreviewCoords:p,mediaPreviewChapter:E}},[m.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[m.MEDIA_PLAY_REQUEST](t,e){var i,a,r,o;let s="mediaPaused",u=t.mediaStreamType.get(e)===Ne.LIVE,p=!((i=e.options)!=null&&i.noAutoSeekToLive),T=t.mediaTargetLiveWindow.get(e)>0;if(u&&p&&!T){let _=(a=t.mediaSeekable.get(e))==null?void 0:a[1];if(_){let E=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,f=_-E;t.mediaCurrentTime.set(f,e)}}t[s].set(!1,e)},[m.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[m.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[m.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[m.MEDIA_LOOP_REQUEST](t,e,{detail:i}){let a="mediaLoop",r=!!i;return t[a].set(r,e),{mediaLoop:r}},[m.MEDIA_VOLUME_REQUEST](t,e,{detail:i}){let a="mediaVolume",r=i;r&&t.mediaMuted.get(e)&&t.mediaMuted.set(!1,e),t[a].set(r,e)},[m.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[m.MEDIA_SEEK_TO_LIVE_REQUEST](t,e){var i,a,r;let o="mediaCurrentTime",s=(i=t.mediaSeekable.get(e))==null?void 0:i[1];if(Number.isNaN(Number(s)))return;let d=(r=(a=e.options)==null?void 0:a.seekToLiveOffset)!=null?r:0,u=s-d;t[o].set(u,e)},[m.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,o=Ni(e),s=Fs(i),d=(a=s[0])==null?void 0:a.language;d&&!r.noSubtitlesLangPref&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),Jt(St.SHOWING,o,s)},[m.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=Ni(e),r=i!=null?i:[];Jt(St.DISABLED,a,r)},[m.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){Ro(e,i)},[m.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[m.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[m.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[m.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[m.MEDIA_ENTER_FULLSCREEN_REQUEST](t,e,i){let a="mediaIsFullscreen";t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t[a].set(!0,e,i)},[m.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[m.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[m.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[m.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var qu=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Pi,requestMap:r=Yu,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let d=[],u={options:{...o}},p=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),T=b=>{b!=null&&(xo(b,p)||(p=Object.freeze({...p,...b}),d.forEach(M=>M(p))))},_=()=>{let b=Object.entries(a).reduce((M,[C,{get:ie}])=>(M[C]=ie(u),M),{});T(b)},E={},f,I=async(b,M)=>{var C,ie,Ae,kt,ct,Ia,Ma,Ca,La,wa,Ra,xa,Da,Oa,Na,Pa;let no=!!f;if(f={...u,...f!=null?f:{},...b},no)return;await Gu(...Object.values(b));let mt=d.length>0&&M===0&&s,Ua=u.media!==f.media,Ha=((C=u.media)==null?void 0:C.textTracks)!==((ie=f.media)==null?void 0:ie.textTracks),Ba=((Ae=u.media)==null?void 0:Ae.videoRenditions)!==((kt=f.media)==null?void 0:kt.videoRenditions),$a=((ct=u.media)==null?void 0:ct.audioTracks)!==((Ia=f.media)==null?void 0:Ia.audioTracks),Gd=((Ma=u.media)==null?void 0:Ma.remote)!==((Ca=f.media)==null?void 0:Ca.remote),Yd=u.documentElement!==f.documentElement,qd=!!u.media&&(Ua||mt),Zd=!!((La=u.media)!=null&&La.textTracks)&&(Ha||mt),Qd=!!((wa=u.media)!=null&&wa.videoRenditions)&&(Ba||mt),zd=!!((Ra=u.media)!=null&&Ra.audioTracks)&&($a||mt),Xd=!!((xa=u.media)!=null&&xa.remote)&&(Gd||mt),Jd=!!u.documentElement&&(Yd||mt),Ms=qd||Zd||Qd||zd||Xd||Jd,Ii=d.length===0&&M===1&&s,jd=!!f.media&&(Ua||Ii),eu=!!((Da=f.media)!=null&&Da.textTracks)&&(Ha||Ii),tu=!!((Oa=f.media)!=null&&Oa.videoRenditions)&&(Ba||Ii),iu=!!((Na=f.media)!=null&&Na.audioTracks)&&($a||Ii),au=!!((Pa=f.media)!=null&&Pa.remote)&&(Gd||Ii),ru=!!f.documentElement&&(Yd||Ii),ou=jd||eu||tu||iu||au||ru;if(!(Ms||ou)){Object.entries(f).forEach(([F,Wa])=>{u[F]=Wa}),_(),f=void 0;return}Object.entries(a).forEach(([F,{get:Wa,mediaEvents:uh=[],textTracksEvents:ch=[],videoRenditionsEvents:mh=[],audioTracksEvents:hh=[],remoteEvents:ph=[],rootEvents:fh=[],stateOwnersUpdateHandlers:vh=[]}])=>{E[F]||(E[F]={});let Te=Q=>{let ee=Wa(u,Q);T({[F]:ee})},re;re=E[F].mediaEvents,uh.forEach(Q=>{re&&qd&&(u.media.removeEventListener(Q,re),E[F].mediaEvents=void 0),jd&&(f.media.addEventListener(Q,Te),E[F].mediaEvents=Te)}),re=E[F].textTracksEvents,ch.forEach(Q=>{var ee,Oe;re&&Zd&&((ee=u.media.textTracks)==null||ee.removeEventListener(Q,re),E[F].textTracksEvents=void 0),eu&&((Oe=f.media.textTracks)==null||Oe.addEventListener(Q,Te),E[F].textTracksEvents=Te)}),re=E[F].videoRenditionsEvents,mh.forEach(Q=>{var ee,Oe;re&&Qd&&((ee=u.media.videoRenditions)==null||ee.removeEventListener(Q,re),E[F].videoRenditionsEvents=void 0),tu&&((Oe=f.media.videoRenditions)==null||Oe.addEventListener(Q,Te),E[F].videoRenditionsEvents=Te)}),re=E[F].audioTracksEvents,hh.forEach(Q=>{var ee,Oe;re&&zd&&((ee=u.media.audioTracks)==null||ee.removeEventListener(Q,re),E[F].audioTracksEvents=void 0),iu&&((Oe=f.media.audioTracks)==null||Oe.addEventListener(Q,Te),E[F].audioTracksEvents=Te)}),re=E[F].remoteEvents,ph.forEach(Q=>{var ee,Oe;re&&Xd&&((ee=u.media.remote)==null||ee.removeEventListener(Q,re),E[F].remoteEvents=void 0),au&&((Oe=f.media.remote)==null||Oe.addEventListener(Q,Te),E[F].remoteEvents=Te)}),re=E[F].rootEvents,fh.forEach(Q=>{re&&Jd&&(u.documentElement.removeEventListener(Q,re),E[F].rootEvents=void 0),ru&&(f.documentElement.addEventListener(Q,Te),E[F].rootEvents=Te)});let so=E[F].stateOwnersUpdateHandlers;if(so&&Ms&&(Array.isArray(so)?so:[so]).forEach(ee=>{typeof ee=="function"&&ee()}),ou){let Q=vh.map(ee=>ee(Te,f)).filter(ee=>typeof ee=="function");E[F].stateOwnersUpdateHandlers=Q.length===1?Q[0]:Q}else Ms&&(E[F].stateOwnersUpdateHandlers=void 0)}),Object.entries(f).forEach(([F,Wa])=>{u[F]=Wa}),_(),f=void 0};return I({media:t,fullscreenElement:e,documentElement:i,options:o}),{dispatch(b){let{type:M,detail:C}=b;if(r[M]&&p.mediaErrorCode==null){T(r[M](a,u,b));return}M==="mediaelementchangerequest"?I({media:C}):M==="fullscreenelementchangerequest"?I({fullscreenElement:C}):M==="documentelementchangerequest"?I({documentElement:C}):M==="optionschangerequest"&&(Object.entries(C!=null?C:{}).forEach(([ie,Ae])=>{u.options[ie]=Ae}),_())},getState(){return p},subscribe(b){return I({},d.length+1),d.push(b),b(p),()=>{let M=d.indexOf(b);M>=0&&(I({},d.length-1),d.splice(M,1))}}}};var Xs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},L=(t,e,i)=>(Xs(t,e,"read from private field"),i?i.call(t):e.get(t)),Ue=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Et=(t,e,i,a)=>(Xs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ge=(t,e,i)=>(Xs(t,e,"access private method"),i),Lt,ja,$,ti,er,Ke,Oo,No,qs,ii,Ui,Po,Zs,Qs,ec,tc=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],Zu=10,Qu=.025,zu=.25,ap=.25,rp=2,v={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},Uo=class extends Qt{constructor(){super(),Ue(this,No),Ue(this,ii),Ue(this,Po),Ue(this,Qs),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Ue(this,Lt,new Ct(this,v.HOTKEYS)),Ue(this,ja,void 0),Ue(this,$,void 0),Ue(this,ti,null),Ue(this,er,void 0),Ue(this,Ke,void 0),Ue(this,Oo,i=>{var a;(a=L(this,$))==null||a.dispatch(i)}),this.associateElement(this);let e={};Et(this,er,i=>{Object.entries(i).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let o=a.toLowerCase(),s=new l.CustomEvent(uu[o],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.hasAttribute(v.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(v.NO_HOTKEYS,v.HOTKEYS,v.DEFAULT_STREAM_TYPE,v.DEFAULT_SUBTITLES,v.DEFAULT_DURATION,v.NO_MUTED_PREF,v.NO_VOLUME_PREF,v.LANG,v.LOOP)}get mediaStore(){return L(this,$)}set mediaStore(e){var i,a;if(L(this,$)&&((i=L(this,Ke))==null||i.call(this),Et(this,Ke,void 0)),Et(this,$,e),!L(this,$)&&!this.hasAttribute(v.NO_DEFAULT_STORE)){Ge(this,No,qs).call(this);return}Et(this,Ke,(a=L(this,$))==null?void 0:a.subscribe(L(this,er)))}get fullscreenElement(){var e;return(e=L(this,ja))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(v.FULLSCREEN_ELEMENT)&&this.removeAttribute(v.FULLSCREEN_ELEMENT),Et(this,ja,e),(i=L(this,$))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return k(this,v.DEFAULT_SUBTITLES)}set defaultSubtitles(e){S(this,v.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return w(this,v.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){R(this,v.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return O(this,v.DEFAULT_DURATION)}set defaultDuration(e){P(this,v.DEFAULT_DURATION,e)}get noHotkeys(){return k(this,v.NO_HOTKEYS)}set noHotkeys(e){S(this,v.NO_HOTKEYS,e)}get keysUsed(){return w(this,v.KEYS_USED)}set keysUsed(e){R(this,v.KEYS_USED,e)}get liveEdgeOffset(){return O(this,v.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){P(this,v.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return k(this,v.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){S(this,v.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return k(this,v.NO_VOLUME_PREF)}set noVolumePref(e){S(this,v.NO_VOLUME_PREF,e)}get noMutedPref(){return k(this,v.NO_MUTED_PREF)}set noMutedPref(e){S(this,v.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return k(this,v.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){S(this,v.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return k(this,v.NO_DEFAULT_STORE)}set noDefaultStore(e){S(this,v.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,o,s,d,u,p,T,_,E,f,I,b;if(super.attributeChangedCallback(e,i,a),e===v.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(v.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==i&&a===null&&this.enableHotkeys();else if(e===v.HOTKEYS)L(this,Lt).value=a;else if(e===v.DEFAULT_SUBTITLES&&a!==i)(r=L(this,$))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(v.DEFAULT_SUBTITLES)}});else if(e===v.DEFAULT_STREAM_TYPE)(s=L(this,$))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(v.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===v.LIVE_EDGE_OFFSET)(d=L(this,$))==null||d.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(v.LIVE_EDGE_OFFSET)}});else if(e===v.SEEK_TO_LIVE_OFFSET)(u=L(this,$))==null||u.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(v.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===v.NO_AUTO_SEEK_TO_LIVE)(p=L(this,$))==null||p.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(v.NO_AUTO_SEEK_TO_LIVE)}});else if(e===v.FULLSCREEN_ELEMENT){let M=a?(T=this.getRootNode())==null?void 0:T.getElementById(a):void 0;Et(this,ja,M),(_=L(this,$))==null||_.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===v.LANG&&a!==i?(_u(a),(E=L(this,$))==null||E.dispatch({type:"optionschangerequest",detail:{mediaLang:a}})):e===v.LOOP&&a!==i?(f=L(this,$))==null||f.dispatch({type:m.MEDIA_LOOP_REQUEST,detail:a!=null}):e===v.NO_VOLUME_PREF&&a!==i?(I=L(this,$))==null||I.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(v.NO_VOLUME_PREF)}}):e===v.NO_MUTED_PREF&&a!==i&&((b=L(this,$))==null||b.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(v.NO_MUTED_PREF)}}))}connectedCallback(){var e,i;!L(this,$)&&!this.hasAttribute(v.NO_DEFAULT_STORE)&&Ge(this,No,qs).call(this),(e=L(this,$))==null||e.dispatch({type:"documentelementchangerequest",detail:V}),super.connectedCallback(),L(this,$)&&!L(this,Ke)&&Et(this,Ke,(i=L(this,$))==null?void 0:i.subscribe(L(this,er))),this.hasAttribute(v.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,i,a,r;(e=super.disconnectedCallback)==null||e.call(this),L(this,$)&&((i=L(this,$))==null||i.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=L(this,$))==null||a.dispatch({type:m.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),L(this,Ke)&&((r=L(this,Ke))==null||r.call(this),Et(this,Ke,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=L(this,$))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=L(this,$))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){ju(this.mediaStateReceivers,e,i)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(i.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),o=up(e,a,r);Object.values(m).forEach(s=>{e.addEventListener(s,L(this,Oo))}),i.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(!i.has(e))return;i.get(e)(),i.delete(e),Object.values(m).forEach(r=>{e.removeEventListener(r,L(this,Oo))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),L(this,$)&&Object.entries(L(this,$).getState()).forEach(([r,o])=>{ju([e],r,o)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Ge(this,Po,Zs))}disableHotkeys(){this.removeEventListener("keydown",Ge(this,Po,Zs)),this.removeEventListener("keyup",Ge(this,ii,Ui))}get hotkeys(){return w(this,v.HOTKEYS)}set hotkeys(e){R(this,v.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,o,s,d,u,p,T;let _=e.target;if(((r=(a=(i=_.getAttribute(v.KEYS_USED))==null?void 0:i.split(" "))!=null?a:_==null?void 0:_.keysUsed)!=null?r:[]).map(C=>C==="Space"?" ":C).filter(Boolean).includes(e.key))return;let f,I,b;if(!(L(this,Lt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&L(this,Lt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&L(this,Lt).contains("noshift+/")))switch(e.key){case" ":case"k":f=L(this,$).getState().mediaPaused?m.MEDIA_PLAY_REQUEST:m.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"m":f=this.mediaStore.getState().mediaVolumeLevel==="off"?m.MEDIA_UNMUTE_REQUEST:m.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"f":f=this.mediaStore.getState().mediaIsFullscreen?m.MEDIA_EXIT_FULLSCREEN_REQUEST:m.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(m.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let C=this.hasAttribute(v.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(v.KEYBOARD_BACKWARD_SEEK_OFFSET):Zu;I=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-C,0),b=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"ArrowRight":case"l":{let C=this.hasAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET):Zu;I=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+C,0),b=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"ArrowUp":{let C=this.hasAttribute(v.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_UP_VOLUME_STEP):Qu;I=Math.min(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)+C,1),b=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"ArrowDown":{let C=this.hasAttribute(v.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_DOWN_VOLUME_STEP):Qu;I=Math.max(((u=this.mediaStore.getState().mediaVolume)!=null?u:1)-C,0),b=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"<":{let C=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;I=Math.max(C-zu,ap).toFixed(2),b=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case">":{let C=(T=this.mediaStore.getState().mediaPlaybackRate)!=null?T:1;I=Math.min(C+zu,rp).toFixed(2),b=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"/":case"?":{e.shiftKey&&Ge(this,Qs,ec).call(this);break}case"p":{f=this.mediaStore.getState().mediaIsPip?m.MEDIA_EXIT_PIP_REQUEST:m.MEDIA_ENTER_PIP_REQUEST,b=new l.CustomEvent(f,{composed:!0,bubbles:!0}),this.dispatchEvent(b);break}default:break}}};Lt=new WeakMap;ja=new WeakMap;$=new WeakMap;ti=new WeakMap;er=new WeakMap;Ke=new WeakMap;Oo=new WeakMap;No=new WeakSet;qs=function(){var t;this.mediaStore=qu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(v.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(v.DEFAULT_DURATION)?+this.getAttribute(v.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(v.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(v.SEEK_TO_LIVE_OFFSET):this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(v.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(v.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(v.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(v.NO_SUBTITLES_LANG_PREF)}})};ii=new WeakSet;Ui=function(t){let{key:e,shiftKey:i}=t;if(!(i&&(e==="/"||e==="?")||tc.includes(e))){this.removeEventListener("keyup",Ge(this,ii,Ui));return}this.keyboardShortcutHandler(t)};Po=new WeakSet;Zs=function(t){var e;let{metaKey:i,altKey:a,key:r,shiftKey:o}=t,s=o&&(r==="/"||r==="?");if(s&&((e=L(this,ti))!=null&&e.open)){this.removeEventListener("keyup",Ge(this,ii,Ui));return}if(i||a||!s&&!tc.includes(r)){this.removeEventListener("keyup",Ge(this,ii,Ui));return}let d=t.target,u=d instanceof HTMLElement&&(d.tagName.toLowerCase()==="media-volume-range"||d.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(r)&&!(L(this,Lt).contains(`no${r.toLowerCase()}`)||r===" "&&L(this,Lt).contains("nospace"))&&!u&&t.preventDefault(),this.addEventListener("keyup",Ge(this,ii,Ui),{once:!0})};Qs=new WeakSet;ec=function(){L(this,ti)||(Et(this,ti,V.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(L(this,ti))),L(this,ti).open=!0};var op=Object.values(n),np=Object.values(xs),ic=t=>{var e,i,a,r;let{observedAttributes:o}=t.constructor;!o&&((e=t.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(t),{observedAttributes:o}=t.constructor);let s=(r=(a=(i=t==null?void 0:t.getAttribute)==null?void 0:i.call(t,x.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(o||s)?(o||s).filter(d=>op.includes(d)):[]},sp=t=>{var e,i;return(e=t.nodeName)!=null&&e.includes("-")&&l.customElements.get((i=t.nodeName)==null?void 0:i.toLowerCase())&&!(t instanceof l.customElements.get(t.nodeName.toLowerCase()))&&l.customElements.upgrade(t),np.some(a=>a in t)},zs=t=>sp(t)||!!ic(t).length,Xu=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},Ju={[n.MEDIA_SUBTITLES_LIST]:vt,[n.MEDIA_SUBTITLES_SHOWING]:vt,[n.MEDIA_SEEKABLE]:Xu,[n.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(Xu).join(" "),[n.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[n.MEDIA_RENDITION_LIST]:mu,[n.MEDIA_AUDIO_TRACK_LIST]:pu},lp=async(t,e,i)=>{var a,r;if(t.isConnected||await co(0),typeof i=="boolean"||i==null)return S(t,e,i);if(typeof i=="number")return P(t,e,i);if(typeof i=="string")return R(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let o=(r=(a=Ju[e])==null?void 0:a.call(Ju,i))!=null?r:i;return t.setAttribute(e,o)},dp=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},ei=(t,e)=>{if(dp(t))return;let i=(r,o)=>{var s,d;zs(r)&&o(r);let{children:u=[]}=r!=null?r:{},p=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...u,...p].forEach(_=>ei(_,o))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!zs(t)){l.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},ju=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=ic(a),o=e.toLowerCase();r.includes(o)&&lp(a,o,i)})},up=(t,e,i)=>{ei(t,e);let a=T=>{var _;let E=(_=T==null?void 0:T.composedPath()[0])!=null?_:T.target;e(E)},r=T=>{var _;let E=(_=T==null?void 0:T.composedPath()[0])!=null?_:T.target;i(E)};t.addEventListener(m.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(m.UNREGISTER_MEDIA_STATE_RECEIVER,r);let o=T=>{T.forEach(_=>{let{addedNodes:E=[],removedNodes:f=[],type:I,target:b,attributeName:M}=_;I==="childList"?(Array.prototype.forEach.call(E,C=>ei(C,e)),Array.prototype.forEach.call(f,C=>ei(C,i))):I==="attributes"&&M===x.MEDIA_CHROME_ATTRIBUTES&&(zs(b)?e(b):i(b))})},s=[],d=T=>{let _=T.target;_.name!=="media"&&(s.forEach(E=>ei(E,i)),s=[..._.assignedElements({flatten:!0})],s.forEach(E=>ei(E,e)))};t.addEventListener("slotchange",d);let u=new MutationObserver(o);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{ei(t,i),t.removeEventListener("slotchange",d),u.disconnect(),t.removeEventListener(m.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(m.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",Uo);var Js=Uo;var Hi={PLACEMENT:"placement",BOUNDS:"bounds"};function cp(t){return`
160
160
  <style>
161
161
  :host {
162
162
  --_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
@@ -265,7 +265,7 @@
265
265
  </style>
266
266
  <slot></slot>
267
267
  <div id="arrow"></div>
268
- `}var Bi=class extends l.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Eo(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let i=this.placement;if(i==="left"||i==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ve(this,"#"+this.bounds))!=null?e:Y(this);if(!r)return;let{x:o,width:s}=r.getBoundingClientRect(),{x:d,width:u}=this.getBoundingClientRect(),p=d+u,T=o+s,_=a.getPropertyValue("--media-tooltip-offset-x"),E=_?parseFloat(_.replace("px","")):0,f=a.getPropertyValue("--media-tooltip-container-margin"),I=f?parseFloat(f.replace("px","")):0,b=d-o+E-I,M=p-T+E+I;if(b<0){this.style.setProperty("--media-tooltip-offset-x",`${b}px`);return}if(M>0){this.style.setProperty("--media-tooltip-offset-x",`${M}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Hi.PLACEMENT,Hi.BOUNDS]}get placement(){return w(this,Hi.PLACEMENT)}set placement(e){R(this,Hi.PLACEMENT,e)}get bounds(){return w(this,Hi.BOUNDS)}set bounds(e){R(this,Hi.BOUNDS,e)}};Bi.shadowRootOptions={mode:"open"};Bi.getTemplateHTML=cp;l.customElements.get("media-tooltip")||l.customElements.define("media-tooltip",Bi);var Uo=Bi;var js=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},te=(t,e,i)=>(js(t,e,"read from private field"),i?i.call(t):e.get(t)),$i=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ho=(t,e,i,a)=>(js(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),mp=(t,e,i)=>(js(t,e,"access private method"),i),Ye,Fi,Rt,Wi,Bo,Js,ac,wt={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function hp(t,e={}){return`
268
+ `}var Bi=class extends l.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!bo(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let i=this.placement;if(i==="left"||i==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ve(this,"#"+this.bounds))!=null?e:Y(this);if(!r)return;let{x:o,width:s}=r.getBoundingClientRect(),{x:d,width:u}=this.getBoundingClientRect(),p=d+u,T=o+s,_=a.getPropertyValue("--media-tooltip-offset-x"),E=_?parseFloat(_.replace("px","")):0,f=a.getPropertyValue("--media-tooltip-container-margin"),I=f?parseFloat(f.replace("px","")):0,b=d-o+E-I,M=p-T+E+I;if(b<0){this.style.setProperty("--media-tooltip-offset-x",`${b}px`);return}if(M>0){this.style.setProperty("--media-tooltip-offset-x",`${M}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Hi.PLACEMENT,Hi.BOUNDS]}get placement(){return w(this,Hi.PLACEMENT)}set placement(e){R(this,Hi.PLACEMENT,e)}get bounds(){return w(this,Hi.BOUNDS)}set bounds(e){R(this,Hi.BOUNDS,e)}};Bi.shadowRootOptions={mode:"open"};Bi.getTemplateHTML=cp;l.customElements.get("media-tooltip")||l.customElements.define("media-tooltip",Bi);var Ho=Bi;var el=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},te=(t,e,i)=>(el(t,e,"read from private field"),i?i.call(t):e.get(t)),$i=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Bo=(t,e,i,a)=>(el(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),mp=(t,e,i)=>(el(t,e,"access private method"),i),Ye,Fi,Rt,Wi,$o,js,ac,wt={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function hp(t,e={}){return`
269
269
  <style>
270
270
  :host {
271
271
  position: relative;
@@ -339,8 +339,8 @@
339
339
 
340
340
  <slot name="tooltip">
341
341
  <media-tooltip part="tooltip" aria-hidden="true">
342
- <template shadowrootmode="${Uo.shadowRootOptions.mode}">
343
- ${Uo.getTemplateHTML({})}
342
+ <template shadowrootmode="${Ho.shadowRootOptions.mode}">
343
+ ${Ho.getTemplateHTML({})}
344
344
  </template>
345
345
  <slot name="tooltip-content">
346
346
  ${this.getTooltipContentHTML(t)}
@@ -349,7 +349,7 @@
349
349
  </slot>
350
350
  `}function pp(t,e){return`
351
351
  <slot></slot>
352
- `}function fp(){return""}var U=class extends l.HTMLElement{constructor(){if(super(),$i(this,Js),$i(this,Ye,void 0),this.preventClick=!1,this.tooltipEl=null,$i(this,Fi,e=>{this.preventClick||this.handleClick(e),setTimeout(te(this,Rt),0)}),$i(this,Rt,()=>{var e,i;(i=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||i.call(e)}),$i(this,Wi,e=>{let{key:i}=e;if(!this.keysUsed.includes(i)){this.removeEventListener("keyup",te(this,Wi));return}this.preventClick||this.handleClick(e)}),$i(this,Bo,e=>{let{metaKey:i,altKey:a,key:r}=e;if(i||a||!this.keysUsed.includes(r)){this.removeEventListener("keyup",te(this,Wi));return}this.addEventListener("keyup",te(this,Wi),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes),i=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(i):this.shadowRoot.innerHTML=i}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",wt.TOOLTIP_PLACEMENT,x.MEDIA_CONTROLLER,n.MEDIA_LANG]}enable(){this.addEventListener("click",te(this,Fi)),this.addEventListener("keydown",te(this,Bo)),this.tabIndex=0}disable(){this.removeEventListener("click",te(this,Fi)),this.removeEventListener("keydown",te(this,Bo)),this.removeEventListener("keyup",te(this,Wi)),this.tabIndex=-1}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER?(i&&((o=(r=te(this,Ye))==null?void 0:r.unassociateElement)==null||o.call(r,this),Ho(this,Ye,null)),a&&this.isConnected&&(Ho(this,Ye,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=te(this,Ye))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===wt.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==i?this.tooltipEl.placement=a:e===n.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),te(this,Rt).call(this)}connectedCallback(){var e,i,a;let{style:r}=q(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let o=this.getAttribute(x.MEDIA_CONTROLLER);o&&(Ho(this,Ye,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=te(this,Ye))==null?void 0:i.associateElement)==null||a.call(i,this)),l.customElements.whenDefined("media-tooltip").then(()=>mp(this,Js,ac).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=te(this,Ye))==null?void 0:e.unassociateElement)==null||i.call(e,this),Ho(this,Ye,null),this.removeEventListener("mouseenter",te(this,Rt)),this.removeEventListener("focus",te(this,Rt)),this.removeEventListener("click",te(this,Fi))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return w(this,wt.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){R(this,wt.TOOLTIP_PLACEMENT,e)}get mediaController(){return w(this,x.MEDIA_CONTROLLER)}set mediaController(e){R(this,x.MEDIA_CONTROLLER,e)}get disabled(){return k(this,wt.DISABLED)}set disabled(e){S(this,wt.DISABLED,e)}get noTooltip(){return k(this,wt.NO_TOOLTIP)}set noTooltip(e){S(this,wt.NO_TOOLTIP,e)}handleClick(e){}};Ye=new WeakMap;Fi=new WeakMap;Rt=new WeakMap;Wi=new WeakMap;Bo=new WeakMap;Js=new WeakSet;ac=function(){this.addEventListener("mouseenter",te(this,Rt)),this.addEventListener("focus",te(this,Rt)),this.addEventListener("click",te(this,Fi));let t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)};U.shadowRootOptions={mode:"open"};U.getTemplateHTML=hp;U.getSlotTemplateHTML=pp;U.getTooltipContentHTML=fp;l.customElements.get("media-chrome-button")||l.customElements.define("media-chrome-button",U);var rc=`<svg aria-hidden="true" viewBox="0 0 26 24">
352
+ `}function fp(){return""}var U=class extends l.HTMLElement{constructor(){if(super(),$i(this,js),$i(this,Ye,void 0),this.preventClick=!1,this.tooltipEl=null,$i(this,Fi,e=>{this.preventClick||this.handleClick(e),setTimeout(te(this,Rt),0)}),$i(this,Rt,()=>{var e,i;(i=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||i.call(e)}),$i(this,Wi,e=>{let{key:i}=e;if(!this.keysUsed.includes(i)){this.removeEventListener("keyup",te(this,Wi));return}this.preventClick||this.handleClick(e)}),$i(this,$o,e=>{let{metaKey:i,altKey:a,key:r}=e;if(i||a||!this.keysUsed.includes(r)){this.removeEventListener("keyup",te(this,Wi));return}this.addEventListener("keyup",te(this,Wi),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes),i=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(i):this.shadowRoot.innerHTML=i}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",wt.TOOLTIP_PLACEMENT,x.MEDIA_CONTROLLER,n.MEDIA_LANG]}enable(){this.addEventListener("click",te(this,Fi)),this.addEventListener("keydown",te(this,$o)),this.tabIndex=0}disable(){this.removeEventListener("click",te(this,Fi)),this.removeEventListener("keydown",te(this,$o)),this.removeEventListener("keyup",te(this,Wi)),this.tabIndex=-1}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER?(i&&((o=(r=te(this,Ye))==null?void 0:r.unassociateElement)==null||o.call(r,this),Bo(this,Ye,null)),a&&this.isConnected&&(Bo(this,Ye,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=te(this,Ye))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===wt.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==i?this.tooltipEl.placement=a:e===n.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),te(this,Rt).call(this)}connectedCallback(){var e,i,a;let{style:r}=q(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let o=this.getAttribute(x.MEDIA_CONTROLLER);o&&(Bo(this,Ye,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=te(this,Ye))==null?void 0:i.associateElement)==null||a.call(i,this)),l.customElements.whenDefined("media-tooltip").then(()=>mp(this,js,ac).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=te(this,Ye))==null?void 0:e.unassociateElement)==null||i.call(e,this),Bo(this,Ye,null),this.removeEventListener("mouseenter",te(this,Rt)),this.removeEventListener("focus",te(this,Rt)),this.removeEventListener("click",te(this,Fi))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return w(this,wt.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){R(this,wt.TOOLTIP_PLACEMENT,e)}get mediaController(){return w(this,x.MEDIA_CONTROLLER)}set mediaController(e){R(this,x.MEDIA_CONTROLLER,e)}get disabled(){return k(this,wt.DISABLED)}set disabled(e){S(this,wt.DISABLED,e)}get noTooltip(){return k(this,wt.NO_TOOLTIP)}set noTooltip(e){S(this,wt.NO_TOOLTIP,e)}handleClick(e){}};Ye=new WeakMap;Fi=new WeakMap;Rt=new WeakMap;Wi=new WeakMap;$o=new WeakMap;js=new WeakSet;ac=function(){this.addEventListener("mouseenter",te(this,Rt)),this.addEventListener("focus",te(this,Rt)),this.addEventListener("click",te(this,Fi));let t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)};U.shadowRootOptions={mode:"open"};U.getTemplateHTML=hp;U.getSlotTemplateHTML=pp;U.getTooltipContentHTML=fp;l.customElements.get("media-chrome-button")||l.customElements.define("media-chrome-button",U);var rc=`<svg aria-hidden="true" viewBox="0 0 26 24">
353
353
  <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"/>
354
354
  </svg>
355
355
  `;function vp(t){return`
@@ -376,7 +376,7 @@
376
376
  `}function Ep(){return`
377
377
  <slot name="tooltip-enter">${h("start airplay")}</slot>
378
378
  <slot name="tooltip-exit">${h("stop airplay")}</slot>
379
- `}var oc=t=>{let e=t.mediaIsAirplaying?h("stop airplay"):h("start airplay");t.setAttribute("aria-label",e)},er=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_AIRPLAYING,n.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),oc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_AIRPLAYING&&oc(this)}get mediaIsAirplaying(){return k(this,n.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){S(this,n.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return w(this,n.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){R(this,n.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new l.CustomEvent(m.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};er.getSlotTemplateHTML=vp;er.getTooltipContentHTML=Ep;l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",er);var bp=`<svg aria-hidden="true" viewBox="0 0 26 24">
379
+ `}var oc=t=>{let e=t.mediaIsAirplaying?h("stop airplay"):h("start airplay");t.setAttribute("aria-label",e)},tr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_AIRPLAYING,n.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),oc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_AIRPLAYING&&oc(this)}get mediaIsAirplaying(){return k(this,n.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){S(this,n.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return w(this,n.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){R(this,n.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new l.CustomEvent(m.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};tr.getSlotTemplateHTML=vp;tr.getTooltipContentHTML=Ep;l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",tr);var bp=`<svg aria-hidden="true" viewBox="0 0 26 24">
380
380
  <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"/>
381
381
  </svg>`,gp=`<svg aria-hidden="true" viewBox="0 0 26 24">
382
382
  <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"/>
@@ -404,7 +404,7 @@
404
404
  `}function Ap(){return`
405
405
  <slot name="tooltip-enable">${h("Enable captions")}</slot>
406
406
  <slot name="tooltip-disable">${h("Disable captions")}</slot>
407
- `}var nc=t=>{t.setAttribute("aria-checked",Co(t).toString())},tr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",h("closed captions")),nc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING&&nc(this)}get mediaSubtitlesList(){return sc(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){lc(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return sc(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){lc(this,n.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(m.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};tr.getSlotTemplateHTML=_p;tr.getTooltipContentHTML=Ap;var sc=(t,e)=>{let i=t.getAttribute(e);return i?Xt(i):[]},lc=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=vt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",tr);var Tp='<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>',yp='<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>';function kp(t){return`
407
+ `}var nc=t=>{t.setAttribute("aria-checked",Lo(t).toString())},ir=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",h("closed captions")),nc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING&&nc(this)}get mediaSubtitlesList(){return sc(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){lc(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return sc(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){lc(this,n.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(m.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};ir.getSlotTemplateHTML=_p;ir.getTooltipContentHTML=Ap;var sc=(t,e)=>{let i=t.getAttribute(e);return i?Xt(i):[]},lc=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=vt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",ir);var Tp='<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>',yp='<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>';function kp(t){return`
408
408
  <style>
409
409
  :host([${n.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
410
410
  display: none !important;
@@ -428,7 +428,7 @@
428
428
  `}function Sp(){return`
429
429
  <slot name="tooltip-enter">${h("Start casting")}</slot>
430
430
  <slot name="tooltip-exit">${h("Stop casting")}</slot>
431
- `}var dc=t=>{let e=t.mediaIsCasting?h("stop casting"):h("start casting");t.setAttribute("aria-label",e)},ir=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_CASTING,n.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),dc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_CASTING&&dc(this)}get mediaIsCasting(){return k(this,n.MEDIA_IS_CASTING)}set mediaIsCasting(e){S(this,n.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return w(this,n.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){R(this,n.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?m.MEDIA_EXIT_CAST_REQUEST:m.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};ir.getSlotTemplateHTML=kp;ir.getTooltipContentHTML=Sp;l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",ir);var nl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ri=(t,e,i)=>(nl(t,e,"read from private field"),i?i.call(t):e.get(t)),bt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},sl=(t,e,i,a)=>(nl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ai=(t,e,i)=>(nl(t,e,"access private method"),i),Wo,rr,oi,$o,el,tl,uc,il,cc,al,mc,rl,hc,ol,pc;function Ip(t){return`
431
+ `}var dc=t=>{let e=t.mediaIsCasting?h("stop casting"):h("start casting");t.setAttribute("aria-label",e)},ar=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_CASTING,n.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),dc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_CASTING&&dc(this)}get mediaIsCasting(){return k(this,n.MEDIA_IS_CASTING)}set mediaIsCasting(e){S(this,n.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return w(this,n.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){R(this,n.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?m.MEDIA_EXIT_CAST_REQUEST:m.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};ar.getSlotTemplateHTML=kp;ar.getTooltipContentHTML=Sp;l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",ar);var sl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ri=(t,e,i)=>(sl(t,e,"read from private field"),i?i.call(t):e.get(t)),bt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ll=(t,e,i,a)=>(sl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ai=(t,e,i)=>(sl(t,e,"access private method"),i),Fo,or,oi,Wo,tl,il,uc,al,cc,rl,mc,ol,hc,nl,pc;function Ip(t){return`
432
432
  <style>
433
433
  :host {
434
434
  font: var(--media-font,
@@ -471,7 +471,7 @@
471
471
  ${this.getSlotTemplateHTML(t)}
472
472
  `}function Mp(t){return`
473
473
  <slot id="content"></slot>
474
- `}var ar={OPEN:"open",ANCHOR:"anchor"},qe=class extends l.HTMLElement{constructor(){super(),bt(this,$o),bt(this,tl),bt(this,il),bt(this,al),bt(this,rl),bt(this,ol),bt(this,Wo,!1),bt(this,rr,null),bt(this,oi,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[ar.OPEN,ar.ANCHOR]}get open(){return k(this,ar.OPEN)}set open(e){S(this,ar.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":ai(this,al,mc).call(this,e);break;case"focusout":ai(this,rl,hc).call(this,e);break;case"keydown":ai(this,ol,pc).call(this,e);break}}connectedCallback(){ai(this,$o,el).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,i,a){ai(this,$o,el).call(this),e===ar.OPEN&&a!==i&&(this.open?ai(this,tl,uc).call(this):ai(this,il,cc).call(this))}focus(){sl(this,rr,Ka());let e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),i=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||i)return;let a=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');a==null||a.focus()}get keysUsed(){return["Escape","Tab"]}};Wo=new WeakMap;rr=new WeakMap;oi=new WeakMap;$o=new WeakSet;el=function(){if(!ri(this,Wo)&&(sl(this,Wo,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let t=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(t),queueMicrotask(()=>{let{style:e}=q(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};tl=new WeakSet;uc=function(){var t;(t=ri(this,oi))==null||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};il=new WeakSet;cc=function(){var t;(t=ri(this,oi))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};al=new WeakSet;mc=function(t){sl(this,oi,t.relatedTarget),ue(this,t.relatedTarget)||(this.open=!this.open)};rl=new WeakSet;hc=function(t){var e;ue(this,t.relatedTarget)||((e=ri(this,rr))==null||e.focus(),ri(this,oi)&&ri(this,oi)!==t.relatedTarget&&this.open&&(this.open=!1))};ol=new WeakSet;pc=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:p}=t;d||u||p||this.keysUsed.includes(s)&&(t.preventDefault(),t.stopPropagation(),s==="Tab"?(t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()):s==="Escape"&&((o=ri(this,rr))==null||o.focus(),this.open=!1))};qe.shadowRootOptions={mode:"open"};qe.getTemplateHTML=Ip;qe.getSlotTemplateHTML=Mp;l.customElements.get("media-chrome-dialog")||l.customElements.define("media-chrome-dialog",qe);var pl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},z=(t,e,i)=>(pl(t,e,"read from private field"),i?i.call(t):e.get(t)),se=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},xt=(t,e,i,a)=>(pl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),He=(t,e,i)=>(pl(t,e,"access private method"),i),Ze,Xo,Fo,Vo,Be,Qo,Ko,Go,Yo,fl,fc,qo,ll,Zo,dl,zo,vl,ul,vc,cl,Ec,ml,bc,hl,gc;function Cp(t){return`
474
+ `}var rr={OPEN:"open",ANCHOR:"anchor"},qe=class extends l.HTMLElement{constructor(){super(),bt(this,Wo),bt(this,il),bt(this,al),bt(this,rl),bt(this,ol),bt(this,nl),bt(this,Fo,!1),bt(this,or,null),bt(this,oi,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[rr.OPEN,rr.ANCHOR]}get open(){return k(this,rr.OPEN)}set open(e){S(this,rr.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":ai(this,rl,mc).call(this,e);break;case"focusout":ai(this,ol,hc).call(this,e);break;case"keydown":ai(this,nl,pc).call(this,e);break}}connectedCallback(){ai(this,Wo,tl).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,i,a){ai(this,Wo,tl).call(this),e===rr.OPEN&&a!==i&&(this.open?ai(this,il,uc).call(this):ai(this,al,cc).call(this))}focus(){ll(this,or,Ga());let e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),i=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||i)return;let a=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');a==null||a.focus()}get keysUsed(){return["Escape","Tab"]}};Fo=new WeakMap;or=new WeakMap;oi=new WeakMap;Wo=new WeakSet;tl=function(){if(!ri(this,Fo)&&(ll(this,Fo,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let t=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(t),queueMicrotask(()=>{let{style:e}=q(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};il=new WeakSet;uc=function(){var t;(t=ri(this,oi))==null||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};al=new WeakSet;cc=function(){var t;(t=ri(this,oi))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};rl=new WeakSet;mc=function(t){ll(this,oi,t.relatedTarget),ue(this,t.relatedTarget)||(this.open=!this.open)};ol=new WeakSet;hc=function(t){var e;ue(this,t.relatedTarget)||((e=ri(this,or))==null||e.focus(),ri(this,oi)&&ri(this,oi)!==t.relatedTarget&&this.open&&(this.open=!1))};nl=new WeakSet;pc=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:p}=t;d||u||p||this.keysUsed.includes(s)&&(t.preventDefault(),t.stopPropagation(),s==="Tab"?(t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()):s==="Escape"&&((o=ri(this,or))==null||o.focus(),this.open=!1))};qe.shadowRootOptions={mode:"open"};qe.getTemplateHTML=Ip;qe.getSlotTemplateHTML=Mp;l.customElements.get("media-chrome-dialog")||l.customElements.define("media-chrome-dialog",qe);var fl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},z=(t,e,i)=>(fl(t,e,"read from private field"),i?i.call(t):e.get(t)),se=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},xt=(t,e,i,a)=>(fl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),He=(t,e,i)=>(fl(t,e,"access private method"),i),Ze,Jo,Vo,Ko,Be,zo,Go,Yo,qo,vl,fc,Zo,dl,Qo,ul,Xo,El,cl,vc,ml,Ec,hl,bc,pl,gc;function Cp(t){return`
475
475
  <style>
476
476
  :host {
477
477
  --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
@@ -699,7 +699,7 @@
699
699
  <input id="range" type="range" min="0" max="1" step="any" value="0">
700
700
  </div>
701
701
  <div id="rightgap"></div>
702
- `}var Qe=class extends l.HTMLElement{constructor(){if(super(),se(this,fl),se(this,qo),se(this,Zo),se(this,zo),se(this,ul),se(this,cl),se(this,ml),se(this,hl),se(this,Ze,void 0),se(this,Xo,void 0),se(this,Fo,void 0),se(this,Vo,void 0),se(this,Be,{}),se(this,Qo,[]),se(this,Ko,()=>{if(this.range.matches(":focus-visible")){let{style:e}=q(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),se(this,Go,()=>{let{style:e}=q(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),se(this,Yo,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes),i=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(i):this.shadowRoot.innerHTML=i}this.container=this.shadowRoot.querySelector("#container"),xt(this,Fo,this.shadowRoot.querySelector("#startpoint")),xt(this,Vo,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",x.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER?(i&&((o=(r=z(this,Ze))==null?void 0:r.unassociateElement)==null||o.call(r,this),xt(this,Ze,null)),a&&this.isConnected&&(xt(this,Ze,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=z(this,Ze))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),He(this,qo,ll).call(this)):(this.range.setAttribute(e,a),He(this,Zo,dl).call(this)))}connectedCallback(){var e,i,a;let{style:r}=q(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),z(this,Be).pointer=q(this.shadowRoot,"#pointer"),z(this,Be).progress=q(this.shadowRoot,"#progress"),z(this,Be).thumb=q(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),z(this,Be).activeSegment=q(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(x.MEDIA_CONTROLLER);o&&(xt(this,Ze,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=z(this,Ze))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",z(this,Ko)),this.shadowRoot.addEventListener("focusout",z(this,Go)),He(this,qo,ll).call(this),ht(this.container,z(this,Yo))}disconnectedCallback(){var e,i;He(this,Zo,dl).call(this),(i=(e=z(this,Ze))==null?void 0:e.unassociateElement)==null||i.call(e,this),xt(this,Ze,null),this.shadowRoot.removeEventListener("focusin",z(this,Ko)),this.shadowRoot.removeEventListener("focusout",z(this,Go)),pt(this.container,z(this,Yo))}updatePointerBar(e){var i;(i=z(this,Be).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=z(this,Be).progress)==null||e.style.setProperty("width",`${a}%`),(i=z(this,Be).thumb)==null||i.style.setProperty("left",`${a}%`)}updateSegments(e){let i=this.shadowRoot.querySelector("#segments-clipping");if(i.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let a=[...new Set([+this.range.min,...e.flatMap(o=>[o.start,o.end]),+this.range.max])];xt(this,Qo,[...a]);let r=a.pop();for(let[o,s]of a.entries()){let[d,u]=[o===0,o===a.length-1],p=d?"calc(var(--segments-gap) / -1)":`${s*100}%`,_=`calc(${((u?r:a[o+1])-s)*100}%${d||u?"":" - var(--segments-gap)"})`,E=V.createElementNS("http://www.w3.org/2000/svg","rect"),f=Ga(this.shadowRoot,`#segments-clipping rect:nth-child(${o+1})`);f.style.setProperty("x",p),f.style.setProperty("width",_),i.append(E)}}getPointerRatio(e){return Iu(e.clientX,e.clientY,z(this,Fo).getBoundingClientRect(),z(this,Vo).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":He(this,hl,gc).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":He(this,ul,vc).call(this,e);break;case"pointerdown":He(this,zo,vl).call(this,e);break;case"pointerup":He(this,cl,Ec).call(this);break;case"pointerleave":He(this,ml,bc).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};Ze=new WeakMap;Xo=new WeakMap;Fo=new WeakMap;Vo=new WeakMap;Be=new WeakMap;Qo=new WeakMap;Ko=new WeakMap;Go=new WeakMap;Yo=new WeakMap;fl=new WeakSet;fc=function(t){let e=z(this,Be).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${z(this,Qo).findIndex((o,s,d)=>{let u=d[s+1];return u!=null&&i>=o&&i<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};qo=new WeakSet;ll=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Zo=new WeakSet;dl=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(t=l.window)==null||t.removeEventListener("pointerup",this),(e=l.window)==null||e.removeEventListener("pointermove",this)};zo=new WeakSet;vl=function(t){var e;xt(this,Xo,t.composedPath().includes(this.range)),(e=l.window)==null||e.addEventListener("pointerup",this)};ul=new WeakSet;vc=function(t){var e;t.pointerType!=="mouse"&&He(this,zo,vl).call(this,t),this.addEventListener("pointerleave",this),(e=l.window)==null||e.addEventListener("pointermove",this)};cl=new WeakSet;Ec=function(){var t;(t=l.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};ml=new WeakSet;bc=function(){var t,e;this.removeEventListener("pointerleave",this),(t=l.window)==null||t.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=z(this,Be).activeSegment)==null||e.style.removeProperty("transform")};hl=new WeakSet;gc=function(t){t.pointerType==="pen"&&t.buttons===0||(this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),He(this,fl,fc).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!z(this,Xo))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};Qe.shadowRootOptions={mode:"open"};Qe.getTemplateHTML=Cp;l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",Qe);var _c=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Jo=(t,e,i)=>(_c(t,e,"read from private field"),i?i.call(t):e.get(t)),Lp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},jo=(t,e,i,a)=>(_c(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ze;function wp(t){return`
702
+ `}var Qe=class extends l.HTMLElement{constructor(){if(super(),se(this,vl),se(this,Zo),se(this,Qo),se(this,Xo),se(this,cl),se(this,ml),se(this,hl),se(this,pl),se(this,Ze,void 0),se(this,Jo,void 0),se(this,Vo,void 0),se(this,Ko,void 0),se(this,Be,{}),se(this,zo,[]),se(this,Go,()=>{if(this.range.matches(":focus-visible")){let{style:e}=q(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),se(this,Yo,()=>{let{style:e}=q(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),se(this,qo,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes),i=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(i):this.shadowRoot.innerHTML=i}this.container=this.shadowRoot.querySelector("#container"),xt(this,Vo,this.shadowRoot.querySelector("#startpoint")),xt(this,Ko,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",x.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER?(i&&((o=(r=z(this,Ze))==null?void 0:r.unassociateElement)==null||o.call(r,this),xt(this,Ze,null)),a&&this.isConnected&&(xt(this,Ze,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=z(this,Ze))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),He(this,Zo,dl).call(this)):(this.range.setAttribute(e,a),He(this,Qo,ul).call(this)))}connectedCallback(){var e,i,a;let{style:r}=q(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),z(this,Be).pointer=q(this.shadowRoot,"#pointer"),z(this,Be).progress=q(this.shadowRoot,"#progress"),z(this,Be).thumb=q(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),z(this,Be).activeSegment=q(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(x.MEDIA_CONTROLLER);o&&(xt(this,Ze,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=z(this,Ze))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",z(this,Go)),this.shadowRoot.addEventListener("focusout",z(this,Yo)),He(this,Zo,dl).call(this),ht(this.container,z(this,qo))}disconnectedCallback(){var e,i;He(this,Qo,ul).call(this),(i=(e=z(this,Ze))==null?void 0:e.unassociateElement)==null||i.call(e,this),xt(this,Ze,null),this.shadowRoot.removeEventListener("focusin",z(this,Go)),this.shadowRoot.removeEventListener("focusout",z(this,Yo)),pt(this.container,z(this,qo))}updatePointerBar(e){var i;(i=z(this,Be).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=z(this,Be).progress)==null||e.style.setProperty("width",`${a}%`),(i=z(this,Be).thumb)==null||i.style.setProperty("left",`${a}%`)}updateSegments(e){let i=this.shadowRoot.querySelector("#segments-clipping");if(i.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let a=[...new Set([+this.range.min,...e.flatMap(o=>[o.start,o.end]),+this.range.max])];xt(this,zo,[...a]);let r=a.pop();for(let[o,s]of a.entries()){let[d,u]=[o===0,o===a.length-1],p=d?"calc(var(--segments-gap) / -1)":`${s*100}%`,_=`calc(${((u?r:a[o+1])-s)*100}%${d||u?"":" - var(--segments-gap)"})`,E=V.createElementNS("http://www.w3.org/2000/svg","rect"),f=Ya(this.shadowRoot,`#segments-clipping rect:nth-child(${o+1})`);f.style.setProperty("x",p),f.style.setProperty("width",_),i.append(E)}}getPointerRatio(e){return Iu(e.clientX,e.clientY,z(this,Vo).getBoundingClientRect(),z(this,Ko).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":He(this,pl,gc).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":He(this,cl,vc).call(this,e);break;case"pointerdown":He(this,Xo,El).call(this,e);break;case"pointerup":He(this,ml,Ec).call(this);break;case"pointerleave":He(this,hl,bc).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};Ze=new WeakMap;Jo=new WeakMap;Vo=new WeakMap;Ko=new WeakMap;Be=new WeakMap;zo=new WeakMap;Go=new WeakMap;Yo=new WeakMap;qo=new WeakMap;vl=new WeakSet;fc=function(t){let e=z(this,Be).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${z(this,zo).findIndex((o,s,d)=>{let u=d[s+1];return u!=null&&i>=o&&i<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Zo=new WeakSet;dl=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Qo=new WeakSet;ul=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(t=l.window)==null||t.removeEventListener("pointerup",this),(e=l.window)==null||e.removeEventListener("pointermove",this)};Xo=new WeakSet;El=function(t){var e;xt(this,Jo,t.composedPath().includes(this.range)),(e=l.window)==null||e.addEventListener("pointerup",this)};cl=new WeakSet;vc=function(t){var e;t.pointerType!=="mouse"&&He(this,Xo,El).call(this,t),this.addEventListener("pointerleave",this),(e=l.window)==null||e.addEventListener("pointermove",this)};ml=new WeakSet;Ec=function(){var t;(t=l.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};hl=new WeakSet;bc=function(){var t,e;this.removeEventListener("pointerleave",this),(t=l.window)==null||t.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=z(this,Be).activeSegment)==null||e.style.removeProperty("transform")};pl=new WeakSet;gc=function(t){t.pointerType==="pen"&&t.buttons===0||(this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),He(this,vl,fc).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!z(this,Jo))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};Qe.shadowRootOptions={mode:"open"};Qe.getTemplateHTML=Cp;l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",Qe);var _c=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},jo=(t,e,i)=>(_c(t,e,"read from private field"),i?i.call(t):e.get(t)),Lp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},en=(t,e,i,a)=>(_c(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ze;function wp(t){return`
703
703
  <style>
704
704
  :host {
705
705
 
@@ -725,7 +725,7 @@
725
725
  </style>
726
726
 
727
727
  <slot></slot>
728
- `}var or=class extends l.HTMLElement{constructor(){if(super(),Lp(this,ze,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER&&(i&&((o=(r=Jo(this,ze))==null?void 0:r.unassociateElement)==null||o.call(r,this),jo(this,ze,null)),a&&this.isConnected&&(jo(this,ze,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=Jo(this,ze))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(x.MEDIA_CONTROLLER);r&&(jo(this,ze,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=Jo(this,ze))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=Jo(this,ze))==null?void 0:e.unassociateElement)==null||i.call(e,this),jo(this,ze,null)}};ze=new WeakMap;or.shadowRootOptions={mode:"open"};or.getTemplateHTML=wp;l.customElements.get("media-control-bar")||l.customElements.define("media-control-bar",or);var Ac=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},en=(t,e,i)=>(Ac(t,e,"read from private field"),i?i.call(t):e.get(t)),Rp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},tn=(t,e,i,a)=>(Ac(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Xe;function xp(t,e={}){return`
728
+ `}var nr=class extends l.HTMLElement{constructor(){if(super(),Lp(this,ze,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER&&(i&&((o=(r=jo(this,ze))==null?void 0:r.unassociateElement)==null||o.call(r,this),en(this,ze,null)),a&&this.isConnected&&(en(this,ze,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=jo(this,ze))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(x.MEDIA_CONTROLLER);r&&(en(this,ze,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=jo(this,ze))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=jo(this,ze))==null?void 0:e.unassociateElement)==null||i.call(e,this),en(this,ze,null)}};ze=new WeakMap;nr.shadowRootOptions={mode:"open"};nr.getTemplateHTML=wp;l.customElements.get("media-control-bar")||l.customElements.define("media-control-bar",nr);var Ac=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},tn=(t,e,i)=>(Ac(t,e,"read from private field"),i?i.call(t):e.get(t)),Rp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},an=(t,e,i,a)=>(Ac(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Xe;function xp(t,e={}){return`
729
729
  <style>
730
730
  :host {
731
731
  font: var(--media-font,
@@ -761,9 +761,9 @@
761
761
  ${this.getSlotTemplateHTML(t,e)}
762
762
  `}function Dp(t,e){return`
763
763
  <slot></slot>
764
- `}var be=class extends l.HTMLElement{constructor(){if(super(),Rp(this,Xe,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER&&(i&&((o=(r=en(this,Xe))==null?void 0:r.unassociateElement)==null||o.call(r,this),tn(this,Xe,null)),a&&this.isConnected&&(tn(this,Xe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=en(this,Xe))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let{style:r}=q(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let o=this.getAttribute(x.MEDIA_CONTROLLER);o&&(tn(this,Xe,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=en(this,Xe))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=en(this,Xe))==null?void 0:e.unassociateElement)==null||i.call(e,this),tn(this,Xe,null)}};Xe=new WeakMap;be.shadowRootOptions={mode:"open"};be.getTemplateHTML=xp;be.getSlotTemplateHTML=Dp;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",be);var yc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Tc=(t,e,i)=>(yc(t,e,"read from private field"),i?i.call(t):e.get(t)),Op=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Pp=(t,e,i,a)=>(yc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),nr;function Np(t,e){return`
765
- <slot>${Ne(e.mediaDuration)}</slot>
766
- `}var an=class extends be{constructor(){var e;super(),Op(this,nr,void 0),Pp(this,nr,this.shadowRoot.querySelector("slot")),Tc(this,nr).textContent=Ne((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===n.MEDIA_DURATION&&(Tc(this,nr).textContent=Ne(+a)),super.attributeChangedCallback(e,i,a)}get mediaDuration(){return O(this,n.MEDIA_DURATION)}set mediaDuration(e){N(this,n.MEDIA_DURATION,e)}};nr=new WeakMap;an.getSlotTemplateHTML=Np;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",an);var Up={2:h("Network Error"),3:h("Decode Error"),4:h("Source Not Supported"),5:h("Encryption Error")},Hp={2:h("A network error caused the media download to fail."),3:h("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:h("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:h("The media is encrypted and there are no keys to decrypt it.")},El=t=>{var e,i;return t.code===1?null:{title:(e=Up[t.code])!=null?e:`Error ${t.code}`,message:(i=Hp[t.code])!=null?i:t.message}};var Sc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Bp=(t,e,i)=>(Sc(t,e,"read from private field"),i?i.call(t):e.get(t)),$p=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Wp=(t,e,i,a)=>(Sc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),rn;function Fp(t){return`
764
+ `}var be=class extends l.HTMLElement{constructor(){if(super(),Rp(this,Xe,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER&&(i&&((o=(r=tn(this,Xe))==null?void 0:r.unassociateElement)==null||o.call(r,this),an(this,Xe,null)),a&&this.isConnected&&(an(this,Xe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=tn(this,Xe))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let{style:r}=q(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let o=this.getAttribute(x.MEDIA_CONTROLLER);o&&(an(this,Xe,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=tn(this,Xe))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=tn(this,Xe))==null?void 0:e.unassociateElement)==null||i.call(e,this),an(this,Xe,null)}};Xe=new WeakMap;be.shadowRootOptions={mode:"open"};be.getTemplateHTML=xp;be.getSlotTemplateHTML=Dp;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",be);var yc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Tc=(t,e,i)=>(yc(t,e,"read from private field"),i?i.call(t):e.get(t)),Op=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Np=(t,e,i,a)=>(yc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),sr;function Pp(t,e){return`
765
+ <slot>${Pe(e.mediaDuration)}</slot>
766
+ `}var rn=class extends be{constructor(){var e;super(),Op(this,sr,void 0),Np(this,sr,this.shadowRoot.querySelector("slot")),Tc(this,sr).textContent=Pe((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===n.MEDIA_DURATION&&(Tc(this,sr).textContent=Pe(+a)),super.attributeChangedCallback(e,i,a)}get mediaDuration(){return O(this,n.MEDIA_DURATION)}set mediaDuration(e){P(this,n.MEDIA_DURATION,e)}};sr=new WeakMap;rn.getSlotTemplateHTML=Pp;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",rn);var Up={2:h("Network Error"),3:h("Decode Error"),4:h("Source Not Supported"),5:h("Encryption Error")},Hp={2:h("A network error caused the media download to fail."),3:h("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:h("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:h("The media is encrypted and there are no keys to decrypt it.")},bl=t=>{var e,i;return t.code===1?null:{title:(e=Up[t.code])!=null?e:`Error ${t.code}`,message:(i=Hp[t.code])!=null?i:t.message}};var Sc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Bp=(t,e,i)=>(Sc(t,e,"read from private field"),i?i.call(t):e.get(t)),$p=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Wp=(t,e,i,a)=>(Sc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),on;function Fp(t){return`
767
767
  <style>
768
768
  :host {
769
769
  background: rgb(20 20 30 / .8);
@@ -782,7 +782,7 @@
782
782
  <slot name="error-${t.mediaerrorcode}" id="content">
783
783
  ${Ic({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
784
784
  </slot>
785
- `}function Vp(t){return t.code&&El(t)!==null}function Ic(t){var e;let{title:i,message:a}=(e=El(t))!=null?e:{},r="";return i&&(r+=`<slot name="error-${t.code}-title"><h3>${i}</h3></slot>`),a&&(r+=`<slot name="error-${t.code}-message"><p>${a}</p></slot>`),r}var kc=[n.MEDIA_ERROR_CODE,n.MEDIA_ERROR_MESSAGE],Vi=class extends qe{constructor(){super(...arguments),$p(this,rn,null)}static get observedAttributes(){return[...super.observedAttributes,...kc]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,i,a){var r;if(super.attributeChangedCallback(e,i,a),!kc.includes(e))return;let o=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=Vp(o),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(o))}get mediaError(){return Bp(this,rn)}set mediaError(e){Wp(this,rn,e)}get mediaErrorCode(){return O(this,"mediaerrorcode")}set mediaErrorCode(e){N(this,"mediaerrorcode",e)}get mediaErrorMessage(){return w(this,"mediaerrormessage")}set mediaErrorMessage(e){R(this,"mediaerrormessage",e)}};rn=new WeakMap;Vi.getSlotTemplateHTML=Fp;Vi.formatErrorMessage=Ic;l.customElements.get("media-error-dialog")||l.customElements.define("media-error-dialog",Vi);var on=Vi;var Kp=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Dt=(t,e,i)=>(Kp(t,e,"read from private field"),i?i.call(t):e.get(t)),Mc=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ki,Gi;function Gp(t){return`
785
+ `}function Vp(t){return t.code&&bl(t)!==null}function Ic(t){var e;let{title:i,message:a}=(e=bl(t))!=null?e:{},r="";return i&&(r+=`<slot name="error-${t.code}-title"><h3>${i}</h3></slot>`),a&&(r+=`<slot name="error-${t.code}-message"><p>${a}</p></slot>`),r}var kc=[n.MEDIA_ERROR_CODE,n.MEDIA_ERROR_MESSAGE],Vi=class extends qe{constructor(){super(...arguments),$p(this,on,null)}static get observedAttributes(){return[...super.observedAttributes,...kc]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,i,a){var r;if(super.attributeChangedCallback(e,i,a),!kc.includes(e))return;let o=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=Vp(o),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(o))}get mediaError(){return Bp(this,on)}set mediaError(e){Wp(this,on,e)}get mediaErrorCode(){return O(this,"mediaerrorcode")}set mediaErrorCode(e){P(this,"mediaerrorcode",e)}get mediaErrorMessage(){return w(this,"mediaerrormessage")}set mediaErrorMessage(e){R(this,"mediaerrormessage",e)}};on=new WeakMap;Vi.getSlotTemplateHTML=Fp;Vi.formatErrorMessage=Ic;l.customElements.get("media-error-dialog")||l.customElements.define("media-error-dialog",Vi);var nn=Vi;var Kp=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Dt=(t,e,i)=>(Kp(t,e,"read from private field"),i?i.call(t):e.get(t)),Mc=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ki,Gi;function Gp(t){return`
786
786
  <style>
787
787
  :host {
788
788
  position: fixed;
@@ -879,7 +879,7 @@
879
879
  <td class="description">${a}</td>
880
880
  </tr>
881
881
  `).join("")}</table>
882
- `}var nn=class extends qe{constructor(){super(...arguments),Mc(this,Ki,e=>{var i;if(!this.open)return;let a=(i=this.shadowRoot)==null?void 0:i.querySelector("#content");if(!a)return;let r=e.composedPath(),o=r[0]===this||r.includes(this),s=r.includes(a);o&&!s&&(this.open=!1)}),Mc(this,Gi,e=>{if(!this.open)return;let i=e.shiftKey&&(e.key==="/"||e.key==="?");(e.key==="Escape"||i)&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(this.open=!1,e.preventDefault(),e.stopPropagation())})}connectedCallback(){super.connectedCallback(),this.open&&(this.addEventListener("click",Dt(this,Ki)),document.addEventListener("keydown",Dt(this,Gi)))}disconnectedCallback(){this.removeEventListener("click",Dt(this,Ki)),document.removeEventListener("keydown",Dt(this,Gi))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e==="open"&&(this.open?(this.addEventListener("click",Dt(this,Ki)),document.addEventListener("keydown",Dt(this,Gi))):(this.removeEventListener("click",Dt(this,Ki)),document.removeEventListener("keydown",Dt(this,Gi))))}};Ki=new WeakMap;Gi=new WeakMap;nn.getSlotTemplateHTML=Gp;l.customElements.get("media-keyboard-shortcuts-dialog")||l.customElements.define("media-keyboard-shortcuts-dialog",nn);var Lc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},qp=(t,e,i)=>(Lc(t,e,"read from private field"),i?i.call(t):e.get(t)),Zp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Qp=(t,e,i,a)=>(Lc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),sn,zp=`<svg aria-hidden="true" viewBox="0 0 26 24">
882
+ `}var sn=class extends qe{constructor(){super(...arguments),Mc(this,Ki,e=>{var i;if(!this.open)return;let a=(i=this.shadowRoot)==null?void 0:i.querySelector("#content");if(!a)return;let r=e.composedPath(),o=r[0]===this||r.includes(this),s=r.includes(a);o&&!s&&(this.open=!1)}),Mc(this,Gi,e=>{if(!this.open)return;let i=e.shiftKey&&(e.key==="/"||e.key==="?");(e.key==="Escape"||i)&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(this.open=!1,e.preventDefault(),e.stopPropagation())})}connectedCallback(){super.connectedCallback(),this.open&&(this.addEventListener("click",Dt(this,Ki)),document.addEventListener("keydown",Dt(this,Gi)))}disconnectedCallback(){this.removeEventListener("click",Dt(this,Ki)),document.removeEventListener("keydown",Dt(this,Gi))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e==="open"&&(this.open?(this.addEventListener("click",Dt(this,Ki)),document.addEventListener("keydown",Dt(this,Gi))):(this.removeEventListener("click",Dt(this,Ki)),document.removeEventListener("keydown",Dt(this,Gi))))}};Ki=new WeakMap;Gi=new WeakMap;sn.getSlotTemplateHTML=Gp;l.customElements.get("media-keyboard-shortcuts-dialog")||l.customElements.define("media-keyboard-shortcuts-dialog",sn);var Lc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},qp=(t,e,i)=>(Lc(t,e,"read from private field"),i?i.call(t):e.get(t)),Zp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Qp=(t,e,i,a)=>(Lc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ln,zp=`<svg aria-hidden="true" viewBox="0 0 26 24">
883
883
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
884
884
  </svg>`,Xp=`<svg aria-hidden="true" viewBox="0 0 26 24">
885
885
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
@@ -907,7 +907,7 @@
907
907
  `}function jp(){return`
908
908
  <slot name="tooltip-enter">${h("Enter fullscreen mode")}</slot>
909
909
  <slot name="tooltip-exit">${h("Exit fullscreen mode")}</slot>
910
- `}var Cc=t=>{let e=t.mediaIsFullscreen?h("exit fullscreen mode"):h("enter fullscreen mode");t.setAttribute("aria-label",e)},sr=class extends U{constructor(){super(...arguments),Zp(this,sn,null)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_FULLSCREEN,n.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Cc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_FULLSCREEN&&Cc(this)}get mediaFullscreenUnavailable(){return w(this,n.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){R(this,n.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return k(this,n.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){S(this,n.MEDIA_IS_FULLSCREEN,e)}handleClick(e){Qp(this,sn,e);let i=qp(this,sn)instanceof PointerEvent,a=this.mediaIsFullscreen?new l.CustomEvent(m.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new l.CustomEvent(m.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:i});this.dispatchEvent(a)}};sn=new WeakMap;sr.getSlotTemplateHTML=Jp;sr.getTooltipContentHTML=jp;l.customElements.get("media-fullscreen-button")||l.customElements.define("media-fullscreen-button",sr);var{MEDIA_TIME_IS_LIVE:ln,MEDIA_PAUSED:lr}=n,{MEDIA_SEEK_TO_LIVE_REQUEST:ef,MEDIA_PLAY_REQUEST:tf}=m,af='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function rf(t){return`
910
+ `}var Cc=t=>{let e=t.mediaIsFullscreen?h("exit fullscreen mode"):h("enter fullscreen mode");t.setAttribute("aria-label",e)},lr=class extends U{constructor(){super(...arguments),Zp(this,ln,null)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_FULLSCREEN,n.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Cc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_FULLSCREEN&&Cc(this)}get mediaFullscreenUnavailable(){return w(this,n.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){R(this,n.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return k(this,n.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){S(this,n.MEDIA_IS_FULLSCREEN,e)}handleClick(e){Qp(this,ln,e);let i=qp(this,ln)instanceof PointerEvent,a=this.mediaIsFullscreen?new l.CustomEvent(m.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new l.CustomEvent(m.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:i});this.dispatchEvent(a)}};ln=new WeakMap;lr.getSlotTemplateHTML=Jp;lr.getTooltipContentHTML=jp;l.customElements.get("media-fullscreen-button")||l.customElements.define("media-fullscreen-button",lr);var{MEDIA_TIME_IS_LIVE:dn,MEDIA_PAUSED:dr}=n,{MEDIA_SEEK_TO_LIVE_REQUEST:ef,MEDIA_PLAY_REQUEST:tf}=m,af='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function rf(t){return`
911
911
  <style>
912
912
  :host { --media-tooltip-display: none; }
913
913
 
@@ -919,13 +919,13 @@
919
919
  color: var(--media-live-button-icon-color, rgb(140, 140, 140));
920
920
  }
921
921
 
922
- :host([${ln}]:not([${lr}])) slot[name=indicator] > *,
923
- :host([${ln}]:not([${lr}])) ::slotted([slot=indicator]) {
922
+ :host([${dn}]:not([${dr}])) slot[name=indicator] > *,
923
+ :host([${dn}]:not([${dr}])) ::slotted([slot=indicator]) {
924
924
  fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
925
925
  color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
926
926
  }
927
927
 
928
- :host([${ln}]:not([${lr}])) {
928
+ :host([${dn}]:not([${dr}])) {
929
929
  cursor: var(--media-cursor, not-allowed);
930
930
  }
931
931
 
@@ -938,7 +938,7 @@
938
938
  <slot name="indicator">${af}</slot>
939
939
 
940
940
  <slot name="spacer">&nbsp;</slot><slot name="text">${h("live")}</slot>
941
- `}var wc=t=>{var e;let i=t.mediaPaused||!t.mediaTimeIsLive,a=i?h("seek to live"):h("playing live");t.setAttribute("aria-label",a);let r=(e=t.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');r&&(r.textContent=h("live")),i?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},dn=class extends U{static get observedAttributes(){return[...super.observedAttributes,ln,lr]}connectedCallback(){super.connectedCallback(),wc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),wc(this)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return k(this,n.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){S(this,n.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new l.CustomEvent(ef,{composed:!0,bubbles:!0})),this.hasAttribute(lr)&&this.dispatchEvent(new l.CustomEvent(tf,{composed:!0,bubbles:!0})))}};dn.getSlotTemplateHTML=rf;l.customElements.get("media-live-button")||l.customElements.define("media-live-button",dn);var xc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},dr=(t,e,i)=>(xc(t,e,"read from private field"),i?i.call(t):e.get(t)),Rc=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ur=(t,e,i,a)=>(xc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Je,cn,un={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},Dc=500,of=`
941
+ `}var wc=t=>{var e;let i=t.mediaPaused||!t.mediaTimeIsLive,a=i?h("seek to live"):h("playing live");t.setAttribute("aria-label",a);let r=(e=t.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');r&&(r.textContent=h("live")),i?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},un=class extends U{static get observedAttributes(){return[...super.observedAttributes,dn,dr]}connectedCallback(){super.connectedCallback(),wc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),wc(this)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return k(this,n.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){S(this,n.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new l.CustomEvent(ef,{composed:!0,bubbles:!0})),this.hasAttribute(dr)&&this.dispatchEvent(new l.CustomEvent(tf,{composed:!0,bubbles:!0})))}};un.getSlotTemplateHTML=rf;l.customElements.get("media-live-button")||l.customElements.define("media-live-button",un);var xc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ur=(t,e,i)=>(xc(t,e,"read from private field"),i?i.call(t):e.get(t)),Rc=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},cr=(t,e,i,a)=>(xc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Je,mn,cn={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},Dc=500,of=`
942
942
  <svg aria-hidden="true" viewBox="0 0 100 100">
943
943
  <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">
944
944
  <animateTransform
@@ -998,7 +998,7 @@
998
998
 
999
999
  <slot name="icon">${of}</slot>
1000
1000
  <div id="status" role="status" aria-live="polite">${h("media loading")}</div>
1001
- `}var cr=class extends l.HTMLElement{constructor(){if(super(),Rc(this,Je,void 0),Rc(this,cn,Dc),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER,n.MEDIA_PAUSED,n.MEDIA_LOADING,un.LOADING_DELAY]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===un.LOADING_DELAY&&i!==a?this.loadingDelay=Number(a):e===x.MEDIA_CONTROLLER&&(i&&((o=(r=dr(this,Je))==null?void 0:r.unassociateElement)==null||o.call(r,this),ur(this,Je,null)),a&&this.isConnected&&(ur(this,Je,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=dr(this,Je))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(x.MEDIA_CONTROLLER);r&&(ur(this,Je,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=dr(this,Je))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=dr(this,Je))==null?void 0:e.unassociateElement)==null||i.call(e,this),ur(this,Je,null)}get loadingDelay(){return dr(this,cn)}set loadingDelay(e){ur(this,cn,e);let{style:i}=q(this.shadowRoot,":host");i.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaController(){return w(this,x.MEDIA_CONTROLLER)}set mediaController(e){R(this,x.MEDIA_CONTROLLER,e)}get noAutohide(){return k(this,un.NO_AUTOHIDE)}set noAutohide(e){S(this,un.NO_AUTOHIDE,e)}};Je=new WeakMap;cn=new WeakMap;cr.shadowRootOptions={mode:"open"};cr.getTemplateHTML=nf;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",cr);var sf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1001
+ `}var mr=class extends l.HTMLElement{constructor(){if(super(),Rc(this,Je,void 0),Rc(this,mn,Dc),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER,n.MEDIA_PAUSED,n.MEDIA_LOADING,cn.LOADING_DELAY]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===cn.LOADING_DELAY&&i!==a?this.loadingDelay=Number(a):e===x.MEDIA_CONTROLLER&&(i&&((o=(r=ur(this,Je))==null?void 0:r.unassociateElement)==null||o.call(r,this),cr(this,Je,null)),a&&this.isConnected&&(cr(this,Je,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=ur(this,Je))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(x.MEDIA_CONTROLLER);r&&(cr(this,Je,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=ur(this,Je))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=ur(this,Je))==null?void 0:e.unassociateElement)==null||i.call(e,this),cr(this,Je,null)}get loadingDelay(){return ur(this,mn)}set loadingDelay(e){cr(this,mn,e);let{style:i}=q(this.shadowRoot,":host");i.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaController(){return w(this,x.MEDIA_CONTROLLER)}set mediaController(e){R(this,x.MEDIA_CONTROLLER,e)}get noAutohide(){return k(this,cn.NO_AUTOHIDE)}set noAutohide(e){S(this,cn.NO_AUTOHIDE,e)}};Je=new WeakMap;mn=new WeakMap;mr.shadowRootOptions={mode:"open"};mr.getTemplateHTML=nf;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",mr);var sf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1002
1002
  <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"/>
1003
1003
  </svg>`,Oc=`<svg aria-hidden="true" viewBox="0 0 24 24">
1004
1004
  <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"/>
@@ -1038,7 +1038,7 @@
1038
1038
  `}function uf(){return`
1039
1039
  <slot name="tooltip-mute">${h("Mute")}</slot>
1040
1040
  <slot name="tooltip-unmute">${h("Unmute")}</slot>
1041
- `}var Pc=t=>{let i=t.mediaVolumeLevel==="off"?h("unmute"):h("mute");t.setAttribute("aria-label",i)},mr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),Pc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_VOLUME_LEVEL&&Pc(this)}get mediaVolumeLevel(){return w(this,n.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){R(this,n.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?m.MEDIA_UNMUTE_REQUEST:m.MEDIA_MUTE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};mr.getSlotTemplateHTML=df;mr.getTooltipContentHTML=uf;l.customElements.get("media-mute-button")||l.customElements.define("media-mute-button",mr);var Nc=`<svg aria-hidden="true" viewBox="0 0 28 24">
1041
+ `}var Nc=t=>{let i=t.mediaVolumeLevel==="off"?h("unmute"):h("mute");t.setAttribute("aria-label",i)},hr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),Nc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_VOLUME_LEVEL&&Nc(this)}get mediaVolumeLevel(){return w(this,n.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){R(this,n.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?m.MEDIA_UNMUTE_REQUEST:m.MEDIA_MUTE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};hr.getSlotTemplateHTML=df;hr.getTooltipContentHTML=uf;l.customElements.get("media-mute-button")||l.customElements.define("media-mute-button",hr);var Pc=`<svg aria-hidden="true" viewBox="0 0 28 24">
1042
1042
  <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"/>
1043
1043
  </svg>`;function cf(t){return`
1044
1044
  <style>
@@ -1057,13 +1057,13 @@
1057
1057
  </style>
1058
1058
 
1059
1059
  <slot name="icon">
1060
- <slot name="enter">${Nc}</slot>
1061
- <slot name="exit">${Nc}</slot>
1060
+ <slot name="enter">${Pc}</slot>
1061
+ <slot name="exit">${Pc}</slot>
1062
1062
  </slot>
1063
1063
  `}function mf(){return`
1064
1064
  <slot name="tooltip-enter">${h("Enter picture in picture mode")}</slot>
1065
1065
  <slot name="tooltip-exit">${h("Exit picture in picture mode")}</slot>
1066
- `}var Uc=t=>{let e=t.mediaIsPip?h("exit picture in picture mode"):h("enter picture in picture mode");t.setAttribute("aria-label",e)},hr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_PIP,n.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Uc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_PIP&&Uc(this)}get mediaPipUnavailable(){return w(this,n.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){R(this,n.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return k(this,n.MEDIA_IS_PIP)}set mediaIsPip(e){S(this,n.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?m.MEDIA_EXIT_PIP_REQUEST:m.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};hr.getSlotTemplateHTML=cf;hr.getTooltipContentHTML=mf;l.customElements.get("media-pip-button")||l.customElements.define("media-pip-button",hr);var hf=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Yi=(t,e,i)=>(hf(t,e,"read from private field"),i?i.call(t):e.get(t)),pf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ot,bl={RATES:"rates"},gl=[1,1.2,1.5,1.7,2],ni=1;function ff(t){return`
1066
+ `}var Uc=t=>{let e=t.mediaIsPip?h("exit picture in picture mode"):h("enter picture in picture mode");t.setAttribute("aria-label",e)},pr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_PIP,n.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Uc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_PIP&&Uc(this)}get mediaPipUnavailable(){return w(this,n.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){R(this,n.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return k(this,n.MEDIA_IS_PIP)}set mediaIsPip(e){S(this,n.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?m.MEDIA_EXIT_PIP_REQUEST:m.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};pr.getSlotTemplateHTML=cf;pr.getTooltipContentHTML=mf;l.customElements.get("media-pip-button")||l.customElements.define("media-pip-button",pr);var hf=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Yi=(t,e,i)=>(hf(t,e,"read from private field"),i?i.call(t):e.get(t)),pf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ot,gl={RATES:"rates"},_l=[1,1.2,1.5,1.7,2],ni=1;function ff(t){return`
1067
1067
  <style>
1068
1068
  :host {
1069
1069
  min-width: 5ch;
@@ -1071,7 +1071,7 @@
1071
1071
  }
1072
1072
  </style>
1073
1073
  <slot name="icon">${t.mediaplaybackrate||ni}x</slot>
1074
- `}function vf(){return h("Playback rate")}var pr=class extends U{constructor(){var e;super(),pf(this,Ot,new Ct(this,bl.RATES,{defaultValue:gl})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:ni}x`}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,bl.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===bl.RATES&&(Yi(this,Ot).value=a),e===n.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,o=Number.isNaN(r)?ni:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",h("Playback rate {playbackRate}",{playbackRate:o}))}}get rates(){return Yi(this,Ot)}set rates(e){e?Array.isArray(e)?Yi(this,Ot).value=e.join(" "):typeof e=="string"&&(Yi(this,Ot).value=e):Yi(this,Ot).value=""}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,ni)}set mediaPlaybackRate(e){N(this,n.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,i;let a=Array.from(Yi(this,Ot).values(),s=>+s).sort((s,d)=>s-d),r=(i=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?i:ni,o=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(o)}};Ot=new WeakMap;pr.getSlotTemplateHTML=ff;pr.getTooltipContentHTML=vf;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",pr);var Ef=`<svg aria-hidden="true" viewBox="0 0 24 24">
1074
+ `}function vf(){return h("Playback rate")}var fr=class extends U{constructor(){var e;super(),pf(this,Ot,new Ct(this,gl.RATES,{defaultValue:_l})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:ni}x`}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,gl.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===gl.RATES&&(Yi(this,Ot).value=a),e===n.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,o=Number.isNaN(r)?ni:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",h("Playback rate {playbackRate}",{playbackRate:o}))}}get rates(){return Yi(this,Ot)}set rates(e){e?Array.isArray(e)?Yi(this,Ot).value=e.join(" "):typeof e=="string"&&(Yi(this,Ot).value=e):Yi(this,Ot).value=""}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,ni)}set mediaPlaybackRate(e){P(this,n.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,i;let a=Array.from(Yi(this,Ot).values(),s=>+s).sort((s,d)=>s-d),r=(i=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?i:ni,o=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(o)}};Ot=new WeakMap;fr.getSlotTemplateHTML=ff;fr.getTooltipContentHTML=vf;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",fr);var Ef=`<svg aria-hidden="true" viewBox="0 0 24 24">
1075
1075
  <path d="m6 21 15-9L6 3v18Z"/>
1076
1076
  </svg>`,bf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1077
1077
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
@@ -1095,7 +1095,7 @@
1095
1095
  `}function _f(){return`
1096
1096
  <slot name="tooltip-play">${h("Play")}</slot>
1097
1097
  <slot name="tooltip-pause">${h("Pause")}</slot>
1098
- `}var Hc=t=>{let e=t.mediaPaused?h("play"):h("pause");t.setAttribute("aria-label",e)},fr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),Hc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_PAUSED||e===n.MEDIA_LANG)&&Hc(this)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?m.MEDIA_PLAY_REQUEST:m.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};fr.getSlotTemplateHTML=gf;fr.getTooltipContentHTML=_f;l.customElements.get("media-play-button")||l.customElements.define("media-play-button",fr);var je={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function Af(t){return`
1098
+ `}var Hc=t=>{let e=t.mediaPaused?h("play"):h("pause");t.setAttribute("aria-label",e)},vr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),Hc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_PAUSED||e===n.MEDIA_LANG)&&Hc(this)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?m.MEDIA_PLAY_REQUEST:m.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};vr.getSlotTemplateHTML=gf;vr.getTooltipContentHTML=_f;l.customElements.get("media-play-button")||l.customElements.define("media-play-button",vr);var je={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function Af(t){return`
1099
1099
  <style>
1100
1100
  :host {
1101
1101
  pointer-events: none;
@@ -1117,7 +1117,7 @@
1117
1117
  </style>
1118
1118
 
1119
1119
  <img part="poster img" aria-hidden="true" id="image"/>
1120
- `}var Tf=t=>{t.style.removeProperty("background-image")},yf=(t,e)=>{t.style["background-image"]=`url('${e}')`},vr=class extends l.HTMLElement{static get observedAttributes(){return[je.PLACEHOLDER_SRC,je.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,i,a){e===je.SRC&&(a==null?this.image.removeAttribute(je.SRC):this.image.setAttribute(je.SRC,a)),e===je.PLACEHOLDER_SRC&&(a==null?Tf(this.image):yf(this.image,a))}get placeholderSrc(){return w(this,je.PLACEHOLDER_SRC)}set placeholderSrc(e){R(this,je.SRC,e)}get src(){return w(this,je.SRC)}set src(e){R(this,je.SRC,e)}};vr.shadowRootOptions={mode:"open"};vr.getTemplateHTML=Af;l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",vr);var Bc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},kf=(t,e,i)=>(Bc(t,e,"read from private field"),i?i.call(t):e.get(t)),Sf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},If=(t,e,i,a)=>(Bc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),mn,_l=class extends be{constructor(){super(),Sf(this,mn,void 0),If(this,mn,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_LANG]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),(e===n.MEDIA_PREVIEW_CHAPTER||e===n.MEDIA_LANG)&&a!==i&&a!=null)if(kf(this,mn).textContent=a,a!==""){let r=h("chapter: {chapterName}",{chapterName:a});this.setAttribute("aria-valuetext",r)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return w(this,n.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){R(this,n.MEDIA_PREVIEW_CHAPTER,e)}};mn=new WeakMap;l.customElements.get("media-preview-chapter-display")||l.customElements.define("media-preview-chapter-display",_l);var $c=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},hn=(t,e,i)=>($c(t,e,"read from private field"),i?i.call(t):e.get(t)),Mf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},pn=(t,e,i,a)=>($c(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),et;function Cf(t){return`
1120
+ `}var Tf=t=>{t.style.removeProperty("background-image")},yf=(t,e)=>{t.style["background-image"]=`url('${e}')`},Er=class extends l.HTMLElement{static get observedAttributes(){return[je.PLACEHOLDER_SRC,je.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,i,a){e===je.SRC&&(a==null?this.image.removeAttribute(je.SRC):this.image.setAttribute(je.SRC,a)),e===je.PLACEHOLDER_SRC&&(a==null?Tf(this.image):yf(this.image,a))}get placeholderSrc(){return w(this,je.PLACEHOLDER_SRC)}set placeholderSrc(e){R(this,je.SRC,e)}get src(){return w(this,je.SRC)}set src(e){R(this,je.SRC,e)}};Er.shadowRootOptions={mode:"open"};Er.getTemplateHTML=Af;l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",Er);var Bc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},kf=(t,e,i)=>(Bc(t,e,"read from private field"),i?i.call(t):e.get(t)),Sf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},If=(t,e,i,a)=>(Bc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),hn,Al=class extends be{constructor(){super(),Sf(this,hn,void 0),If(this,hn,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_LANG]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),(e===n.MEDIA_PREVIEW_CHAPTER||e===n.MEDIA_LANG)&&a!==i&&a!=null)if(kf(this,hn).textContent=a,a!==""){let r=h("chapter: {chapterName}",{chapterName:a});this.setAttribute("aria-valuetext",r)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return w(this,n.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){R(this,n.MEDIA_PREVIEW_CHAPTER,e)}};hn=new WeakMap;l.customElements.get("media-preview-chapter-display")||l.customElements.define("media-preview-chapter-display",Al);var $c=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},pn=(t,e,i)=>($c(t,e,"read from private field"),i?i.call(t):e.get(t)),Mf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},fn=(t,e,i,a)=>($c(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),et;function Cf(t){return`
1121
1121
  <style>
1122
1122
  :host {
1123
1123
  box-sizing: border-box;
@@ -1131,7 +1131,7 @@
1131
1131
  }
1132
1132
  </style>
1133
1133
  <img crossorigin loading="eager" decoding="async">
1134
- `}var qi=class extends l.HTMLElement{constructor(){if(super(),Mf(this,et,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(x.MEDIA_CONTROLLER);r&&(pn(this,et,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=hn(this,et))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=hn(this,et))==null?void 0:e.unassociateElement)==null||i.call(e,this),pn(this,et,null)}attributeChangedCallback(e,i,a){var r,o,s,d,u;[n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===x.MEDIA_CONTROLLER&&(i&&((o=(r=hn(this,et))==null?void 0:r.unassociateElement)==null||o.call(r,this),pn(this,et,null)),a&&this.isConnected&&(pn(this,et,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=hn(this,et))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return w(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(n.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(i=>+i)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(n.MEDIA_PREVIEW_COORDS);return}this.setAttribute(n.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,i=this.mediaPreviewImage;if(!(e&&i))return;let[a,r,o,s]=e,d=i.split("#")[0],u=getComputedStyle(this),{maxWidth:p,maxHeight:T,minWidth:_,minHeight:E}=u,f=Math.min(parseInt(p)/o,parseInt(T)/s),I=Math.max(parseInt(_)/o,parseInt(E)/s),b=f<1,M=b?f:I>1?I:1,{style:C}=q(this.shadowRoot,":host"),ie=q(this.shadowRoot,"img").style,Ae=this.shadowRoot.querySelector("img"),kt=b?"min":"max";C.setProperty(`${kt}-width`,"initial","important"),C.setProperty(`${kt}-height`,"initial","important"),C.width=`${o*M}px`,C.height=`${s*M}px`;let ct=()=>{ie.width=`${this.imgWidth*M}px`,ie.height=`${this.imgHeight*M}px`,ie.display="block"};Ae.src!==d&&(Ae.onload=()=>{this.imgWidth=Ae.naturalWidth,this.imgHeight=Ae.naturalHeight,ct()},Ae.src=d,ct()),ct(),ie.transform=`translate(-${a*M}px, -${r*M}px)`}};et=new WeakMap;qi.shadowRootOptions={mode:"open"};qi.getTemplateHTML=Cf;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",qi);var fn=qi;var Fc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Wc=(t,e,i)=>(Fc(t,e,"read from private field"),i?i.call(t):e.get(t)),Lf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},wf=(t,e,i,a)=>(Fc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Er,Al=class extends be{constructor(){super(),Lf(this,Er,void 0),wf(this,Er,this.shadowRoot.querySelector("slot")),Wc(this,Er).textContent=Ne(0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PREVIEW_TIME&&a!=null&&(Wc(this,Er).textContent=Ne(parseFloat(a)))}get mediaPreviewTime(){return O(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){N(this,n.MEDIA_PREVIEW_TIME,e)}};Er=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",Al);var Zi={SEEK_OFFSET:"seekoffset"},Tl=30,Rf=t=>`
1134
+ `}var qi=class extends l.HTMLElement{constructor(){if(super(),Mf(this,et,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(x.MEDIA_CONTROLLER);r&&(fn(this,et,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=pn(this,et))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=pn(this,et))==null?void 0:e.unassociateElement)==null||i.call(e,this),fn(this,et,null)}attributeChangedCallback(e,i,a){var r,o,s,d,u;[n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===x.MEDIA_CONTROLLER&&(i&&((o=(r=pn(this,et))==null?void 0:r.unassociateElement)==null||o.call(r,this),fn(this,et,null)),a&&this.isConnected&&(fn(this,et,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=pn(this,et))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return w(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(n.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(i=>+i)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(n.MEDIA_PREVIEW_COORDS);return}this.setAttribute(n.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,i=this.mediaPreviewImage;if(!(e&&i))return;let[a,r,o,s]=e,d=i.split("#")[0],u=getComputedStyle(this),{maxWidth:p,maxHeight:T,minWidth:_,minHeight:E}=u,f=Math.min(parseInt(p)/o,parseInt(T)/s),I=Math.max(parseInt(_)/o,parseInt(E)/s),b=f<1,M=b?f:I>1?I:1,{style:C}=q(this.shadowRoot,":host"),ie=q(this.shadowRoot,"img").style,Ae=this.shadowRoot.querySelector("img"),kt=b?"min":"max";C.setProperty(`${kt}-width`,"initial","important"),C.setProperty(`${kt}-height`,"initial","important"),C.width=`${o*M}px`,C.height=`${s*M}px`;let ct=()=>{ie.width=`${this.imgWidth*M}px`,ie.height=`${this.imgHeight*M}px`,ie.display="block"};Ae.src!==d&&(Ae.onload=()=>{this.imgWidth=Ae.naturalWidth,this.imgHeight=Ae.naturalHeight,ct()},Ae.src=d,ct()),ct(),ie.transform=`translate(-${a*M}px, -${r*M}px)`}};et=new WeakMap;qi.shadowRootOptions={mode:"open"};qi.getTemplateHTML=Cf;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",qi);var vn=qi;var Fc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Wc=(t,e,i)=>(Fc(t,e,"read from private field"),i?i.call(t):e.get(t)),Lf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},wf=(t,e,i,a)=>(Fc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),br,Tl=class extends be{constructor(){super(),Lf(this,br,void 0),wf(this,br,this.shadowRoot.querySelector("slot")),Wc(this,br).textContent=Pe(0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PREVIEW_TIME&&a!=null&&(Wc(this,br).textContent=Pe(parseFloat(a)))}get mediaPreviewTime(){return O(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){P(this,n.MEDIA_PREVIEW_TIME,e)}};br=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",Tl);var Zi={SEEK_OFFSET:"seekoffset"},yl=30,Rf=t=>`
1135
1135
  <svg aria-hidden="true" viewBox="0 0 20 24">
1136
1136
  <defs>
1137
1137
  <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
@@ -1140,18 +1140,18 @@
1140
1140
  <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"/>
1141
1141
  </svg>`;function xf(t,e){return`
1142
1142
  <slot name="icon">${Rf(e.seekOffset)}</slot>
1143
- `}function Df(){return h("Seek backward")}var Of=0,br=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,Zi.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=O(this,Zi.SEEK_OFFSET,Tl)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===Zi.SEEK_OFFSET&&(this.seekOffset=O(this,Zi.SEEK_OFFSET,Tl))}get seekOffset(){return O(this,Zi.SEEK_OFFSET,Tl)}set seekOffset(e){N(this,Zi.SEEK_OFFSET,e),this.setAttribute("aria-label",h("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),fo(vo(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME,Of)}set mediaCurrentTime(e){N(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),i=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};br.getSlotTemplateHTML=xf;br.getTooltipContentHTML=Df;l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",br);var Qi={SEEK_OFFSET:"seekoffset"},yl=30,Pf=t=>`
1143
+ `}function Df(){return h("Seek backward")}var Of=0,gr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,Zi.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=O(this,Zi.SEEK_OFFSET,yl)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===Zi.SEEK_OFFSET&&(this.seekOffset=O(this,Zi.SEEK_OFFSET,yl))}get seekOffset(){return O(this,Zi.SEEK_OFFSET,yl)}set seekOffset(e){P(this,Zi.SEEK_OFFSET,e),this.setAttribute("aria-label",h("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),vo(Eo(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME,Of)}set mediaCurrentTime(e){P(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),i=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};gr.getSlotTemplateHTML=xf;gr.getTooltipContentHTML=Df;l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",gr);var Qi={SEEK_OFFSET:"seekoffset"},kl=30,Nf=t=>`
1144
1144
  <svg aria-hidden="true" viewBox="0 0 20 24">
1145
1145
  <defs>
1146
1146
  <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
1147
1147
  </defs>
1148
1148
  <text class="text value" transform="translate(8.9 19.87)">${t}</text>
1149
1149
  <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"/>
1150
- </svg>`;function Nf(t,e){return`
1151
- <slot name="icon">${Pf(e.seekOffset)}</slot>
1152
- `}function Uf(){return h("Seek forward")}var Hf=0,gr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,Qi.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=O(this,Qi.SEEK_OFFSET,yl)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===Qi.SEEK_OFFSET&&(this.seekOffset=O(this,Qi.SEEK_OFFSET,yl))}get seekOffset(){return O(this,Qi.SEEK_OFFSET,yl)}set seekOffset(e){N(this,Qi.SEEK_OFFSET,e),this.setAttribute("aria-label",h("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),fo(vo(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME,Hf)}set mediaCurrentTime(e){N(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,i=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};gr.getSlotTemplateHTML=Nf;gr.getTooltipContentHTML=Uf;l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",gr);var Gc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},kl=(t,e,i)=>(Gc(t,e,"read from private field"),i?i.call(t):e.get(t)),Bf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},$f=(t,e,i,a)=>(Gc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),zi,si={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Vc=[...Object.values(si),n.MEDIA_CURRENT_TIME,n.MEDIA_DURATION,n.MEDIA_SEEKABLE],Kc=["Enter"," "],Wf="&nbsp;/&nbsp;",Sl=(t,{timesSep:e=Wf}={})=>{var i,a;let r=(i=t.mediaCurrentTime)!=null?i:0,[,o]=(a=t.mediaSeekable)!=null?a:[],s=0;Number.isFinite(t.mediaDuration)?s=t.mediaDuration:Number.isFinite(o)&&(s=o);let d=t.remaining?Ne(0-(s-r)):Ne(r);return t.showDuration?`${d}${e}${Ne(s)}`:d},Ff="video not loaded, unknown time.",Vf=t=>{var e;let i=t.mediaCurrentTime,[,a]=(e=t.mediaSeekable)!=null?e:[],r=null;if(Number.isFinite(t.mediaDuration)?r=t.mediaDuration:Number.isFinite(a)&&(r=a),i==null||r===null){t.setAttribute("aria-valuetext",Ff);return}let o=t.remaining?Yt(0-(r-i)):Yt(i);if(!t.showDuration){t.setAttribute("aria-valuetext",o);return}let s=Yt(r),d=`${o} of ${s}`;t.setAttribute("aria-valuetext",d)};function Kf(t,e){return`
1153
- <slot>${Sl(e)}</slot>
1154
- `}var vn=class extends be{constructor(){super(),Bf(this,zi,void 0),$f(this,zi,this.shadowRoot.querySelector("slot")),kl(this,zi).innerHTML=`${Sl(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Vc,"disabled"]}connectedCallback(){let{style:e}=q(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",h("playback time"));let i=a=>{let{key:r}=a;if(!Kc.includes(r)){this.removeEventListener("keyup",i);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:o,key:s}=a;if(r||o||!Kc.includes(s)){this.removeEventListener("keyup",i);return}this.addEventListener("keyup",i)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,i,a){Vc.includes(e)?this.update():e==="disabled"&&a!==i&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,i,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return k(this,si.REMAINING)}set remaining(e){S(this,si.REMAINING,e)}get showDuration(){return k(this,si.SHOW_DURATION)}set showDuration(e){S(this,si.SHOW_DURATION,e)}get noToggle(){return k(this,si.NO_TOGGLE)}set noToggle(e){S(this,si.NO_TOGGLE,e)}get mediaDuration(){return O(this,n.MEDIA_DURATION)}set mediaDuration(e){N(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){N(this,n.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Sl(this);Vf(this),e!==kl(this,zi).innerHTML&&(kl(this,zi).innerHTML=e)}};zi=new WeakMap;vn.getSlotTemplateHTML=Kf;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",vn);var Yc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ne=(t,e,i)=>(Yc(t,e,"read from private field"),i?i.call(t):e.get(t)),tt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Me=(t,e,i,a)=>(Yc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Gf=(t,e,i,a)=>({set _(r){Me(t,e,r,i)},get _(){return ne(t,e,a)}}),Xi,En,Ji,_r,bn,gn,_n,ji,li,An,Tn=class{constructor(e,i,a){tt(this,Xi,void 0),tt(this,En,void 0),tt(this,Ji,void 0),tt(this,_r,void 0),tt(this,bn,void 0),tt(this,gn,void 0),tt(this,_n,void 0),tt(this,ji,void 0),tt(this,li,0),tt(this,An,(r=performance.now())=>{Me(this,li,requestAnimationFrame(ne(this,An))),Me(this,_r,performance.now()-ne(this,Ji));let o=1e3/this.fps;if(ne(this,_r)>o){Me(this,Ji,r-ne(this,_r)%o);let s=1e3/((r-ne(this,En))/++Gf(this,bn)._),d=(r-ne(this,gn))/1e3/this.duration,u=ne(this,_n)+d*this.playbackRate;u-ne(this,Xi).valueAsNumber>0?Me(this,ji,this.playbackRate/this.duration/s):(Me(this,ji,.995*ne(this,ji)),u=ne(this,Xi).valueAsNumber+ne(this,ji)),this.callback(u)}}),Me(this,Xi,e),this.callback=i,this.fps=a}start(){ne(this,li)===0&&(Me(this,Ji,performance.now()),Me(this,En,ne(this,Ji)),Me(this,bn,0),ne(this,An).call(this))}stop(){ne(this,li)!==0&&(cancelAnimationFrame(ne(this,li)),Me(this,li,0))}update({start:e,duration:i,playbackRate:a}){let r=e-ne(this,Xi).valueAsNumber,o=Math.abs(i-this.duration);(r>0||r<-.03||o>=.5)&&this.callback(e),Me(this,_n,e),Me(this,gn,performance.now()),this.duration=i,this.playbackRate=a}};Xi=new WeakMap;En=new WeakMap;Ji=new WeakMap;_r=new WeakMap;bn=new WeakMap;gn=new WeakMap;_n=new WeakMap;ji=new WeakMap;li=new WeakMap;An=new WeakMap;var Ll=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},J=(t,e,i)=>(Ll(t,e,"read from private field"),i?i.call(t):e.get(t)),ae=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Re=(t,e,i,a)=>(Ll(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),de=(t,e,i)=>(Ll(t,e,"access private method"),i),ea,di,Sn,Tr,In,kn,yr,kr,ta,ia,aa,Ar,wl,qc,Il,Mn,Rl,Cn,xl,Ln,Dl,Ml,Zc,Sr,wn,Cl,Qc,Yf="video not loaded, unknown time.",qf=t=>{let e=t.range,i=Yt(+zc(t)),a=Yt(+t.mediaSeekableEnd),r=i&&a?`${i} of ${a}`:Yf;e.setAttribute("aria-valuetext",r)};function Zf(t){return`
1150
+ </svg>`;function Pf(t,e){return`
1151
+ <slot name="icon">${Nf(e.seekOffset)}</slot>
1152
+ `}function Uf(){return h("Seek forward")}var Hf=0,_r=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,Qi.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=O(this,Qi.SEEK_OFFSET,kl)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===Qi.SEEK_OFFSET&&(this.seekOffset=O(this,Qi.SEEK_OFFSET,kl))}get seekOffset(){return O(this,Qi.SEEK_OFFSET,kl)}set seekOffset(e){P(this,Qi.SEEK_OFFSET,e),this.setAttribute("aria-label",h("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),vo(Eo(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME,Hf)}set mediaCurrentTime(e){P(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,i=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};_r.getSlotTemplateHTML=Pf;_r.getTooltipContentHTML=Uf;l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",_r);var Gc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Sl=(t,e,i)=>(Gc(t,e,"read from private field"),i?i.call(t):e.get(t)),Bf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},$f=(t,e,i,a)=>(Gc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),zi,si={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Vc=[...Object.values(si),n.MEDIA_CURRENT_TIME,n.MEDIA_DURATION,n.MEDIA_SEEKABLE],Kc=["Enter"," "],Wf="&nbsp;/&nbsp;",Il=(t,{timesSep:e=Wf}={})=>{var i,a;let r=(i=t.mediaCurrentTime)!=null?i:0,[,o]=(a=t.mediaSeekable)!=null?a:[],s=0;Number.isFinite(t.mediaDuration)?s=t.mediaDuration:Number.isFinite(o)&&(s=o);let d=t.remaining?Pe(0-(s-r)):Pe(r);return t.showDuration?`${d}${e}${Pe(s)}`:d},Ff="video not loaded, unknown time.",Vf=t=>{var e;let i=t.mediaCurrentTime,[,a]=(e=t.mediaSeekable)!=null?e:[],r=null;if(Number.isFinite(t.mediaDuration)?r=t.mediaDuration:Number.isFinite(a)&&(r=a),i==null||r===null){t.setAttribute("aria-valuetext",Ff);return}let o=t.remaining?Yt(0-(r-i)):Yt(i);if(!t.showDuration){t.setAttribute("aria-valuetext",o);return}let s=Yt(r),d=`${o} of ${s}`;t.setAttribute("aria-valuetext",d)};function Kf(t,e){return`
1153
+ <slot>${Il(e)}</slot>
1154
+ `}var En=class extends be{constructor(){super(),Bf(this,zi,void 0),$f(this,zi,this.shadowRoot.querySelector("slot")),Sl(this,zi).innerHTML=`${Il(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Vc,"disabled"]}connectedCallback(){let{style:e}=q(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",h("playback time"));let i=a=>{let{key:r}=a;if(!Kc.includes(r)){this.removeEventListener("keyup",i);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:o,key:s}=a;if(r||o||!Kc.includes(s)){this.removeEventListener("keyup",i);return}this.addEventListener("keyup",i)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,i,a){Vc.includes(e)?this.update():e==="disabled"&&a!==i&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,i,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return k(this,si.REMAINING)}set remaining(e){S(this,si.REMAINING,e)}get showDuration(){return k(this,si.SHOW_DURATION)}set showDuration(e){S(this,si.SHOW_DURATION,e)}get noToggle(){return k(this,si.NO_TOGGLE)}set noToggle(e){S(this,si.NO_TOGGLE,e)}get mediaDuration(){return O(this,n.MEDIA_DURATION)}set mediaDuration(e){P(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){P(this,n.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Il(this);Vf(this),e!==Sl(this,zi).innerHTML&&(Sl(this,zi).innerHTML=e)}};zi=new WeakMap;En.getSlotTemplateHTML=Kf;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",En);var Yc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ne=(t,e,i)=>(Yc(t,e,"read from private field"),i?i.call(t):e.get(t)),tt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Me=(t,e,i,a)=>(Yc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Gf=(t,e,i,a)=>({set _(r){Me(t,e,r,i)},get _(){return ne(t,e,a)}}),Xi,bn,Ji,Ar,gn,_n,An,ji,li,Tn,yn=class{constructor(e,i,a){tt(this,Xi,void 0),tt(this,bn,void 0),tt(this,Ji,void 0),tt(this,Ar,void 0),tt(this,gn,void 0),tt(this,_n,void 0),tt(this,An,void 0),tt(this,ji,void 0),tt(this,li,0),tt(this,Tn,(r=performance.now())=>{Me(this,li,requestAnimationFrame(ne(this,Tn))),Me(this,Ar,performance.now()-ne(this,Ji));let o=1e3/this.fps;if(ne(this,Ar)>o){Me(this,Ji,r-ne(this,Ar)%o);let s=1e3/((r-ne(this,bn))/++Gf(this,gn)._),d=(r-ne(this,_n))/1e3/this.duration,u=ne(this,An)+d*this.playbackRate;u-ne(this,Xi).valueAsNumber>0?Me(this,ji,this.playbackRate/this.duration/s):(Me(this,ji,.995*ne(this,ji)),u=ne(this,Xi).valueAsNumber+ne(this,ji)),this.callback(u)}}),Me(this,Xi,e),this.callback=i,this.fps=a}start(){ne(this,li)===0&&(Me(this,Ji,performance.now()),Me(this,bn,ne(this,Ji)),Me(this,gn,0),ne(this,Tn).call(this))}stop(){ne(this,li)!==0&&(cancelAnimationFrame(ne(this,li)),Me(this,li,0))}update({start:e,duration:i,playbackRate:a}){let r=e-ne(this,Xi).valueAsNumber,o=Math.abs(i-this.duration);(r>0||r<-.03||o>=.5)&&this.callback(e),Me(this,An,e),Me(this,_n,performance.now()),this.duration=i,this.playbackRate=a}};Xi=new WeakMap;bn=new WeakMap;Ji=new WeakMap;Ar=new WeakMap;gn=new WeakMap;_n=new WeakMap;An=new WeakMap;ji=new WeakMap;li=new WeakMap;Tn=new WeakMap;var wl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},J=(t,e,i)=>(wl(t,e,"read from private field"),i?i.call(t):e.get(t)),ae=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Re=(t,e,i,a)=>(wl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),de=(t,e,i)=>(wl(t,e,"access private method"),i),ea,di,In,yr,Mn,Sn,kr,Sr,ta,ia,aa,Tr,Rl,qc,Ml,Cn,xl,Ln,Dl,wn,Ol,Cl,Zc,Ir,Rn,Ll,Qc,Yf="video not loaded, unknown time.",qf=t=>{let e=t.range,i=Yt(+zc(t)),a=Yt(+t.mediaSeekableEnd),r=i&&a?`${i} of ${a}`:Yf;e.setAttribute("aria-valuetext",r)};function Zf(t){return`
1155
1155
  ${Qe.getTemplateHTML(t)}
1156
1156
  <style>
1157
1157
  :host {
@@ -1355,8 +1355,8 @@
1355
1355
  <div id="preview-rail">
1356
1356
  <slot name="preview" part="box preview-box">
1357
1357
  <media-preview-thumbnail>
1358
- <template shadowrootmode="${fn.shadowRootOptions.mode}">
1359
- ${fn.getTemplateHTML({})}
1358
+ <template shadowrootmode="${vn.shadowRootOptions.mode}">
1359
+ ${vn.getTemplateHTML({})}
1360
1360
  </template>
1361
1361
  </media-preview-thumbnail>
1362
1362
  <media-preview-chapter-display></media-preview-chapter-display>
@@ -1369,7 +1369,7 @@
1369
1369
 
1370
1370
  </slot>
1371
1371
  </div>
1372
- `}var yn=(t,e=t.mediaCurrentTime)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-i)/(a-i);return Math.max(0,Math.min(r,1))},zc=(t,e=t.range.valueAsNumber)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-i)+i},Ir=class extends Qe{constructor(){super(),ae(this,aa),ae(this,wl),ae(this,Mn),ae(this,Cn),ae(this,Ln),ae(this,Ml),ae(this,Sr),ae(this,Cl),ae(this,ea,void 0),ae(this,di,void 0),ae(this,Sn,void 0),ae(this,Tr,void 0),ae(this,In,void 0),ae(this,kn,void 0),ae(this,yr,void 0),ae(this,kr,void 0),ae(this,ta,void 0),ae(this,ia,void 0),ae(this,Il,a=>{this.dragging||(Ci(a)&&(this.range.valueAsNumber=a),J(this,ia)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Re(this,Sn,this.shadowRoot.querySelectorAll('[part~="box"]')),Re(this,In,this.shadowRoot.querySelector('[part~="preview-box"]')),Re(this,kn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);Re(this,yr,parseInt(i.getPropertyValue("--media-box-padding-left"))),Re(this,kr,parseInt(i.getPropertyValue("--media-box-padding-right"))),Re(this,di,new Tn(this.range,J(this,Il),60))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_DURATION,n.MEDIA_SEEKABLE,n.MEDIA_CURRENT_TIME,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_TIME,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_BUFFERED,n.MEDIA_PLAYBACK_RATE,n.MEDIA_LOADING,n.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",h("seek")),de(this,aa,Ar).call(this),Re(this,ea,this.getRootNode()),(e=J(this,ea))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),de(this,aa,Ar).call(this),(e=J(this,ea))==null||e.removeEventListener("transitionstart",this),Re(this,ea,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===n.MEDIA_CURRENT_TIME||e===n.MEDIA_PAUSED||e===n.MEDIA_ENDED||e===n.MEDIA_LOADING||e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE?(J(this,di).update({start:yn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),de(this,aa,Ar).call(this),qf(this)):e===n.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=J(this,ta),this.updateBar()))}get mediaChaptersCues(){return J(this,ta)}set mediaChaptersCues(e){var i;Re(this,ta,e),this.updateSegments((i=J(this,ta))==null?void 0:i.map(a=>({start:yn(this,a.startTime),end:yn(this,a.endTime)})))}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaDuration(){return O(this,n.MEDIA_DURATION)}set mediaDuration(e){N(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){N(this,n.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){N(this,n.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(n.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(n.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(n.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,i=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaSeekableStart(){var e;let[i=0]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaPreviewImage(){return w(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return O(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){N(this,n.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return k(this,n.MEDIA_ENDED)}set mediaEnded(e){S(this,n.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let i=this.mediaBuffered;if(!i.length)return;let a;if(this.mediaEnded)a=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([d,u])=>d<=o&&o<=u))!=null?e:[];a=yn(this,s)}let{style:r}=q(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=q(this.shadowRoot,"#current-rail"),a=q(this.shadowRoot,'[part~="current-box"]'),r=de(this,Mn,Rl).call(this,J(this,kn)),o=de(this,Cn,xl).call(this,r,this.range.valueAsNumber),s=de(this,Ln,Dl).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${o})`,i.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":de(this,Cl,Qc).call(this);break;case"pointermove":de(this,Ml,Zc).call(this,e);break;case"pointerup":J(this,ia)&&Re(this,ia,!1);break;case"pointerdown":Re(this,ia,!0);break;case"pointerleave":de(this,Sr,wn).call(this,null);break;case"transitionstart":ue(e.target,this)&&setTimeout(()=>de(this,aa,Ar).call(this),0);break}}};ea=new WeakMap;di=new WeakMap;Sn=new WeakMap;Tr=new WeakMap;In=new WeakMap;kn=new WeakMap;yr=new WeakMap;kr=new WeakMap;ta=new WeakMap;ia=new WeakMap;aa=new WeakSet;Ar=function(){de(this,wl,qc).call(this)?J(this,di).start():J(this,di).stop()};wl=new WeakSet;qc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Eo(this)};Il=new WeakMap;Mn=new WeakSet;Rl=function(t){var e;let a=((e=this.getAttribute("bounds")?Ve(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),o=t.offsetWidth,s=-(r.left-a.left-o/2),d=a.right-r.left-o/2;return{box:{width:o,min:s,max:d},bounds:a,range:r}};Cn=new WeakSet;xl=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:o}=t.box;if(!a)return i;if(Number.isNaN(r)||(i=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${i})`),!Number.isNaN(o)){let d=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;i=`min(${i}, ${d})`}return i};Ln=new WeakSet;Dl=function(t,e){let{width:i,min:a,max:r}=t.box,o=e*t.range.width;if(o<a+J(this,yr)){let s=t.range.left-t.bounds.left-J(this,yr);return`${o-i/2+s}px`}if(o>r-J(this,kr)){let s=t.bounds.right-t.range.right-J(this,kr);return`${o+i/2-s-t.range.width}px`}return 0};Ml=new WeakSet;Zc=function(t){let e=[...J(this,Sn)].some(T=>t.composedPath().includes(T));if(!this.dragging&&(e||!t.composedPath().includes(this))){de(this,Sr,wn).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=q(this.shadowRoot,"#preview-rail"),r=q(this.shadowRoot,'[part~="preview-box"]'),o=de(this,Mn,Rl).call(this,J(this,In)),s=(t.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let d=de(this,Cn,xl).call(this,o,s),u=de(this,Ln,Dl).call(this,o,s);a.style.transform=`translateX(${d})`,a.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${o.box.width}px`);let p=Math.round(J(this,Tr))-Math.round(s*i);Math.abs(p)<1&&s>.01&&s<.99||(Re(this,Tr,s*i),de(this,Sr,wn).call(this,J(this,Tr)))};Sr=new WeakSet;wn=function(t){this.dispatchEvent(new l.CustomEvent(m.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Cl=new WeakSet;Qc=function(){J(this,di).stop();let t=zc(this);this.dispatchEvent(new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Ir.shadowRootOptions={mode:"open"};Ir.getTemplateHTML=Zf;l.customElements.get("media-time-range")||l.customElements.define("media-time-range",Ir);var Qf=1,zf=t=>t.mediaMuted?0:t.mediaVolume,Xf=t=>`${Math.round(t*100)}%`,Ol=class extends Qe{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME,n.MEDIA_MUTED,n.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",h("volume"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_VOLUME||e===n.MEDIA_MUTED)&&(this.range.valueAsNumber=zf(this),this.range.setAttribute("aria-valuetext",Xf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return O(this,n.MEDIA_VOLUME,Qf)}set mediaVolume(e){N(this,n.MEDIA_VOLUME,e)}get mediaMuted(){return k(this,n.MEDIA_MUTED)}set mediaMuted(e){S(this,n.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return w(this,n.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){R(this,n.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",Ol);function Jf(t){return`
1372
+ `}var kn=(t,e=t.mediaCurrentTime)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-i)/(a-i);return Math.max(0,Math.min(r,1))},zc=(t,e=t.range.valueAsNumber)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-i)+i},Mr=class extends Qe{constructor(){super(),ae(this,aa),ae(this,Rl),ae(this,Cn),ae(this,Ln),ae(this,wn),ae(this,Cl),ae(this,Ir),ae(this,Ll),ae(this,ea,void 0),ae(this,di,void 0),ae(this,In,void 0),ae(this,yr,void 0),ae(this,Mn,void 0),ae(this,Sn,void 0),ae(this,kr,void 0),ae(this,Sr,void 0),ae(this,ta,void 0),ae(this,ia,void 0),ae(this,Ml,a=>{this.dragging||(Ci(a)&&(this.range.valueAsNumber=a),J(this,ia)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Re(this,In,this.shadowRoot.querySelectorAll('[part~="box"]')),Re(this,Mn,this.shadowRoot.querySelector('[part~="preview-box"]')),Re(this,Sn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);Re(this,kr,parseInt(i.getPropertyValue("--media-box-padding-left"))),Re(this,Sr,parseInt(i.getPropertyValue("--media-box-padding-right"))),Re(this,di,new yn(this.range,J(this,Ml),60))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_DURATION,n.MEDIA_SEEKABLE,n.MEDIA_CURRENT_TIME,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_TIME,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_BUFFERED,n.MEDIA_PLAYBACK_RATE,n.MEDIA_LOADING,n.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",h("seek")),de(this,aa,Tr).call(this),Re(this,ea,this.getRootNode()),(e=J(this,ea))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),de(this,aa,Tr).call(this),(e=J(this,ea))==null||e.removeEventListener("transitionstart",this),Re(this,ea,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===n.MEDIA_CURRENT_TIME||e===n.MEDIA_PAUSED||e===n.MEDIA_ENDED||e===n.MEDIA_LOADING||e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE?(J(this,di).update({start:kn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),de(this,aa,Tr).call(this),qf(this)):e===n.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=J(this,ta),this.updateBar()))}get mediaChaptersCues(){return J(this,ta)}set mediaChaptersCues(e){var i;Re(this,ta,e),this.updateSegments((i=J(this,ta))==null?void 0:i.map(a=>({start:kn(this,a.startTime),end:kn(this,a.endTime)})))}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaDuration(){return O(this,n.MEDIA_DURATION)}set mediaDuration(e){P(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){P(this,n.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){P(this,n.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(n.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(n.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(n.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,i=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaSeekableStart(){var e;let[i=0]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaPreviewImage(){return w(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return O(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){P(this,n.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return k(this,n.MEDIA_ENDED)}set mediaEnded(e){S(this,n.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let i=this.mediaBuffered;if(!i.length)return;let a;if(this.mediaEnded)a=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([d,u])=>d<=o&&o<=u))!=null?e:[];a=kn(this,s)}let{style:r}=q(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=q(this.shadowRoot,"#current-rail"),a=q(this.shadowRoot,'[part~="current-box"]'),r=de(this,Cn,xl).call(this,J(this,Sn)),o=de(this,Ln,Dl).call(this,r,this.range.valueAsNumber),s=de(this,wn,Ol).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${o})`,i.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":de(this,Ll,Qc).call(this);break;case"pointermove":de(this,Cl,Zc).call(this,e);break;case"pointerup":J(this,ia)&&Re(this,ia,!1);break;case"pointerdown":Re(this,ia,!0);break;case"pointerleave":de(this,Ir,Rn).call(this,null);break;case"transitionstart":ue(e.target,this)&&setTimeout(()=>de(this,aa,Tr).call(this),0);break}}};ea=new WeakMap;di=new WeakMap;In=new WeakMap;yr=new WeakMap;Mn=new WeakMap;Sn=new WeakMap;kr=new WeakMap;Sr=new WeakMap;ta=new WeakMap;ia=new WeakMap;aa=new WeakSet;Tr=function(){de(this,Rl,qc).call(this)?J(this,di).start():J(this,di).stop()};Rl=new WeakSet;qc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&bo(this)};Ml=new WeakMap;Cn=new WeakSet;xl=function(t){var e;let a=((e=this.getAttribute("bounds")?Ve(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),o=t.offsetWidth,s=-(r.left-a.left-o/2),d=a.right-r.left-o/2;return{box:{width:o,min:s,max:d},bounds:a,range:r}};Ln=new WeakSet;Dl=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:o}=t.box;if(!a)return i;if(Number.isNaN(r)||(i=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${i})`),!Number.isNaN(o)){let d=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;i=`min(${i}, ${d})`}return i};wn=new WeakSet;Ol=function(t,e){let{width:i,min:a,max:r}=t.box,o=e*t.range.width;if(o<a+J(this,kr)){let s=t.range.left-t.bounds.left-J(this,kr);return`${o-i/2+s}px`}if(o>r-J(this,Sr)){let s=t.bounds.right-t.range.right-J(this,Sr);return`${o+i/2-s-t.range.width}px`}return 0};Cl=new WeakSet;Zc=function(t){let e=[...J(this,In)].some(T=>t.composedPath().includes(T));if(!this.dragging&&(e||!t.composedPath().includes(this))){de(this,Ir,Rn).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=q(this.shadowRoot,"#preview-rail"),r=q(this.shadowRoot,'[part~="preview-box"]'),o=de(this,Cn,xl).call(this,J(this,Mn)),s=(t.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let d=de(this,Ln,Dl).call(this,o,s),u=de(this,wn,Ol).call(this,o,s);a.style.transform=`translateX(${d})`,a.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${o.box.width}px`);let p=Math.round(J(this,yr))-Math.round(s*i);Math.abs(p)<1&&s>.01&&s<.99||(Re(this,yr,s*i),de(this,Ir,Rn).call(this,J(this,yr)))};Ir=new WeakSet;Rn=function(t){this.dispatchEvent(new l.CustomEvent(m.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Ll=new WeakSet;Qc=function(){J(this,di).stop();let t=zc(this);this.dispatchEvent(new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Mr.shadowRootOptions={mode:"open"};Mr.getTemplateHTML=Zf;l.customElements.get("media-time-range")||l.customElements.define("media-time-range",Mr);var Qf=1,zf=t=>t.mediaMuted?0:t.mediaVolume,Xf=t=>`${Math.round(t*100)}%`,Nl=class extends Qe{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME,n.MEDIA_MUTED,n.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",h("volume"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_VOLUME||e===n.MEDIA_MUTED)&&(this.range.valueAsNumber=zf(this),this.range.setAttribute("aria-valuetext",Xf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return O(this,n.MEDIA_VOLUME,Qf)}set mediaVolume(e){P(this,n.MEDIA_VOLUME,e)}get mediaMuted(){return k(this,n.MEDIA_MUTED)}set mediaMuted(e){S(this,n.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return w(this,n.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){R(this,n.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",Nl);function Jf(t){return`
1373
1373
  <style>
1374
1374
  :host {
1375
1375
  min-width: 4ch;
@@ -1398,8 +1398,8 @@
1398
1398
  <path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
1399
1399
  </svg>
1400
1400
  </div>
1401
- `}function jf(){return h("Loop")}var Mr=class extends U{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=h("Loop"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return k(this,n.MEDIA_LOOP)}set mediaLoop(e){S(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(m.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Mr.getSlotTemplateHTML=Jf;Mr.getTooltipContentHTML=jf;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",Mr);var g=require("@mux/mux-video/base"),D=require("@mux/playback-core");var im=require("@mux/playback-core");var mi=require("@mux/playback-core");function Xc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Rn(i)}: ${a}; `)}),e?e.trim():void 0}function Rn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function xn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function Pl(t){let e=ev(t).toString();return e?"?"+e:""}function ev(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var Nl=(t,e)=>!t||!e?!1:t.contains(e)?!0:Nl(t,e.getRootNode().host);var Jc="mux.com",tv=()=>{try{return"3.9.2"}catch{}return"UNKNOWN"},iv=tv(),On=()=>iv,jc=(t,{token:e,customDomain:i=Jc,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,mi.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${Pl({token:e,time:o,program_time:r})}`},em=(t,{token:e,customDomain:i=Jc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,mi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${Pl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Cr=t=>{if(t){if([mi.StreamTypes.LIVE,mi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return mi.StreamTypes.LIVE}};var av={crossorigin:"crossOrigin",playsinline:"playsInline"};function tm(t){var e;return(e=av[t])!=null?e:xn(t)}var ui,ci,me,Dn=class{constructor(e,i){pe(this,ui);pe(this,ci);pe(this,me,[]);ye(this,ui,e),ye(this,ci,i)}[Symbol.iterator](){return H(this,me).values()}get length(){return H(this,me).length}get value(){var e;return(e=H(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ye(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return H(this,me)[e]}values(){return H(this,me).values()}keys(){return H(this,me).keys()}forEach(e){H(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||H(this,me).push(r)}),!(this.value===""&&!((i=H(this,ui))!=null&&i.hasAttribute(`${H(this,ci)}`)))&&((a=H(this,ui))==null||a.setAttribute(`${H(this,ci)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{H(this,me).splice(H(this,me).indexOf(a),1)}),(i=H(this,ui))==null||i.setAttribute(`${H(this,ci)}`,`${this.value}`)}contains(e){return H(this,me).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};ui=new WeakMap,ci=new WeakMap,me=new WeakMap;var am=`[mux-player ${On()}]`;function it(...t){console.warn(am,...t)}function ge(...t){console.error(am,...t)}function Ul(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,im.i18n)("Read more: ")}
1402
- https://github.com/muxinc/elements/blob/main/errors/${t.file}`),it(e)}var le={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Pt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},nA={...le,...Pt},om=Object.freeze({length:0,start(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),rv=Object.values(le).filter(t=>le.PLAYSINLINE!==t),ov=Object.values(Pt),nv=[...rv,...ov],Hl=class extends ke.HTMLElement{static get observedAttributes(){return nv}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case Pt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Pt.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Pt.PLAYBACKRATE:{let s=(o=ce(a))!=null?o:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,i;return(i=(e=this.media)==null?void 0:e.play())!=null?i:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,i;return(i=(e=this.media)==null?void 0:e.paused)!=null?i:!0}get duration(){var e,i;return(i=(e=this.media)==null?void 0:e.duration)!=null?i:NaN}get ended(){var e,i;return(i=(e=this.media)==null?void 0:e.ended)!=null?i:!1}get buffered(){var e,i;return(i=(e=this.media)==null?void 0:e.buffered)!=null?i:om}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:om}get readyState(){var e,i;return(i=(e=this.media)==null?void 0:e.readyState)!=null?i:0}get videoWidth(){var e,i;return(i=(e=this.media)==null?void 0:e.videoWidth)!=null?i:0}get videoHeight(){var e,i;return(i=(e=this.media)==null?void 0:e.videoHeight)!=null?i:0}get currentSrc(){var e,i;return(i=(e=this.media)==null?void 0:e.currentSrc)!=null?i:""}get currentTime(){var e,i;return(i=(e=this.media)==null?void 0:e.currentTime)!=null?i:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,i;return(i=(e=this.media)==null?void 0:e.volume)!=null?i:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,i;return(i=(e=this.media)==null?void 0:e.playbackRate)!=null?i:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=ce(this.getAttribute(Pt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Pt.PLAYBACKRATE,`${e}`):this.removeAttribute(Pt.PLAYBACKRATE)}get crossOrigin(){return Lr(this,le.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(le.CROSSORIGIN,`${e}`)}get autoplay(){return Lr(this,le.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(le.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(le.AUTOPLAY)}get loop(){return Lr(this,le.LOOP)!=null}set loop(e){e?this.setAttribute(le.LOOP,""):this.removeAttribute(le.LOOP)}get muted(){var e,i;return(i=(e=this.media)==null?void 0:e.muted)!=null?i:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return Lr(this,le.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(le.MUTED,""):this.removeAttribute(le.MUTED)}get playsInline(){return Lr(this,le.PLAYSINLINE)!=null}set playsInline(e){ge("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(le.PRELOAD,e):this.removeAttribute(le.PRELOAD)}};function Lr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var Bl=Hl;var um=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},P=(t,e,i)=>(um(t,e,"read from private field"),i?i.call(t):e.get(t)),at=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},gt=(t,e,i,a)=>(um(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ra,Pn,hi,wr,Nt,Ut,Ht,pi,oa,Nn,$e,nm=1,sm=0,sv=1,lv={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let o=i[a];typeof o=="boolean"&&r instanceof he&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof he?r.element[r.attributeName]=o:r.value=o}}}},_t=class extends l.DocumentFragment{constructor(e,i,a=lv){var r;super(),at(this,ra,void 0),at(this,Pn,void 0),this.append(e.content.cloneNode(!0)),gt(this,ra,cm(this)),gt(this,Pn,a),(r=a.createCallback)==null||r.call(a,this,P(this,ra),i),a.processCallback(this,P(this,ra),i)}update(e){P(this,Pn).processCallback(this,P(this,ra),e)}};ra=new WeakMap;Pn=new WeakMap;var cm=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new $l;for([i,a]of dm(r.value))if(!i)o.append(a);else{let s=new he(t,r.name,r.namespaceURI);o.append(s),e.push([a,s])}r.value=o.toString()}for(let r of t.childNodes)if(r.nodeType===nm&&!(r instanceof HTMLTemplateElement))cm(r,e);else{let o=r.data;if(r.nodeType===nm||o.includes("{{")){let s=[];if(o)for([i,a]of dm(o))if(!i)s.push(new Text(a));else{let d=new At(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new Rr(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},lm={},dm=t=>{let e="",i=0,a=lm[t],r=0,o;if(a)return a;for(a=[];o=t[r];r++)o==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([sm,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([sv,e.trim()]),e="",r++):e+=o||"";return e&&a.push([sm,(i>0?"{{":"")+e]),lm[t]=a},dv=11,Un=class{get value(){return""}set value(e){}toString(){return this.value}},mm=new WeakMap,$l=class{constructor(){at(this,hi,[])}[Symbol.iterator](){return P(this,hi).values()}get length(){return P(this,hi).length}item(e){return P(this,hi)[e]}append(...e){for(let i of e)i instanceof he&&mm.set(i,this),P(this,hi).push(i)}toString(){return P(this,hi).join("")}};hi=new WeakMap;var he=class extends Un{constructor(e,i,a){super(),at(this,pi),at(this,wr,""),at(this,Nt,void 0),at(this,Ut,void 0),at(this,Ht,void 0),gt(this,Nt,e),gt(this,Ut,i),gt(this,Ht,a)}get attributeName(){return P(this,Ut)}get attributeNamespace(){return P(this,Ht)}get element(){return P(this,Nt)}get value(){return P(this,wr)}set value(e){P(this,wr)!==e&&(gt(this,wr,e),!P(this,pi,oa)||P(this,pi,oa).length===1?e==null?P(this,Nt).removeAttributeNS(P(this,Ht),P(this,Ut)):P(this,Nt).setAttributeNS(P(this,Ht),P(this,Ut),e):P(this,Nt).setAttributeNS(P(this,Ht),P(this,Ut),P(this,pi,oa).toString()))}get booleanValue(){return P(this,Nt).hasAttributeNS(P(this,Ht),P(this,Ut))}set booleanValue(e){if(!P(this,pi,oa)||P(this,pi,oa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};wr=new WeakMap;Nt=new WeakMap;Ut=new WeakMap;Ht=new WeakMap;pi=new WeakSet;oa=function(){return mm.get(this)};var At=class extends Un{constructor(e,i){super(),at(this,Nn,void 0),at(this,$e,void 0),gt(this,Nn,e),gt(this,$e,i?[...i]:[new Text])}get replacementNodes(){return P(this,$e)}get parentNode(){return P(this,Nn)}get nextSibling(){return P(this,$e)[P(this,$e).length-1].nextSibling}get previousSibling(){return P(this,$e)[0].previousSibling}get value(){return P(this,$e).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let i=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===dv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),gt(this,$e,uv(P(this,$e)[0].parentNode,P(this,$e),i,this.nextSibling))}};Nn=new WeakMap;$e=new WeakMap;var Rr=class extends At{constructor(e,i){let a=i.getAttribute("directive")||i.getAttribute("type"),r=i.getAttribute("expression")||i.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=i,this.directive=a}};function uv(t,e,i,a=null){let r=0,o,s,d,u=i.length,p=e.length;for(;r<u&&r<p&&e[r]==i[r];)r++;for(;r<u&&r<p&&i[u-1]==e[p-1];)a=i[--p,--u];if(r==p)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<p;)t.removeChild(e[r++]);else{for(o=e[r];r<u;)d=i[r++],s=o?o.nextSibling:a,o==d?o=s:r<u&&i[r]==s?(t.replaceChild(d,o),o=s):t.insertBefore(d,o);for(;o!=a;)s=o.nextSibling,t.removeChild(o),o=s}return i}var hm={string:t=>String(t)},Bn=class{constructor(e){this.template=e,this.state=void 0}},fi=new WeakMap,vi=new WeakMap,Wl={partial:(t,e)=>{e[t.expression]=new Bn(t.template)},if:(t,e)=>{var i;if(fm(t.expression,e))if(fi.get(t)!==t.template){fi.set(t,t.template);let a=new _t(t.template,e,$n);t.replace(a),vi.set(t,a)}else(i=vi.get(t))==null||i.update(e);else t.replace(""),fi.delete(t),vi.delete(t)}},cv=Object.keys(Wl),$n={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof Rr){if(!s.directive){let u=cv.find(p=>s.template.hasAttribute(p));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=Wl[s.directive])==null||a.call(Wl,s,i);continue}let d=fm(o,i);if(d instanceof Bn){fi.get(s)!==d.template?(fi.set(s,d.template),d=new _t(d.template,d.state,$n),s.value=d,vi.set(s,d)):(r=vi.get(s))==null||r.update(d.state);continue}d?(s instanceof he&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof he?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,fi.delete(s),vi.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,fi.delete(s),vi.delete(s))}}},pm={"!":t=>!t,"!!":t=>!!t,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,"??":(t,e)=>t!=null?t:e,"|":(t,e)=>{var i;return(i=hm[e])==null?void 0:i.call(hm,t)}};function mv(t){return hv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function fm(t,e={}){var i,a,r,o,s,d,u;let p=mv(t);if(p.length===0||p.some(({type:T})=>!T))return xr(t);if(((i=p[0])==null?void 0:i.token)===">"){let T=e[(a=p[1])==null?void 0:a.token];if(!T)return xr(t);let _={...e};T.state=_;let E=p.slice(2);for(let f=0;f<E.length;f+=3){let I=(r=E[f])==null?void 0:r.token,b=(o=E[f+1])==null?void 0:o.token,M=(s=E[f+2])==null?void 0:s.token;I&&b==="="&&(_[I]=Dr(M,e))}return T}if(p.length===1)return Hn(p[0])?Dr(p[0].token,e):xr(t);if(p.length===2){let T=(d=p[0])==null?void 0:d.token,_=pm[T];if(!_||!Hn(p[1]))return xr(t);let E=Dr(p[1].token,e);return _(E)}if(p.length===3){let T=(u=p[1])==null?void 0:u.token,_=pm[T];if(!_||!Hn(p[0])||!Hn(p[2]))return xr(t);let E=Dr(p[0].token,e);if(T==="|")return _(E,p[2].token);let f=Dr(p[2].token,e);return _(E,f)}}function xr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Hn({type:t}){return["number","boolean","string","param"].includes(t)}function Dr(t,e){let i=t[0],a=t.slice(-1);return t==="true"||t==="false"?t==="true":i===a&&["'",'"'].includes(i)?t.slice(1,-1):lo(t)?parseFloat(t):e[t]}function hv(t,e){let i,a,r,o=[];for(;t;){r=null,i=t.length;for(let s in e)a=e[s].exec(t),a&&a.index<i&&(r={token:a[0],type:s,matches:a.slice(1)},i=a.index);i&&o.push({token:t.substr(0,i),type:void 0}),r&&o.push(r),t=t.substr(i+(r?r.token.length:0))}return o}var ql=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Kl=(t,e,i)=>(ql(t,e,"read from private field"),i?i.call(t):e.get(t)),Or=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ei=(t,e,i,a)=>(ql(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Fl=(t,e,i)=>(ql(t,e,"access private method"),i),na,Wn,sa,Gl,vm,Fn,Yl,Vl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Em=V.createElement("template");Em.innerHTML=`
1401
+ `}function jf(){return h("Loop")}var Cr=class extends U{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=h("Loop"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return k(this,n.MEDIA_LOOP)}set mediaLoop(e){S(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(m.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Cr.getSlotTemplateHTML=Jf;Cr.getTooltipContentHTML=jf;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",Cr);var g=require("@mux/mux-video/base"),D=require("@mux/playback-core");var im=require("@mux/playback-core");var mi=require("@mux/playback-core");function Xc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${xn(i)}: ${a}; `)}),e?e.trim():void 0}function xn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Dn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function Pl(t){let e=ev(t).toString();return e?"?"+e:""}function ev(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var Ul=(t,e)=>!t||!e?!1:t.contains(e)?!0:Ul(t,e.getRootNode().host);var Jc="mux.com",tv=()=>{try{return"3.9.2"}catch{}return"UNKNOWN"},iv=tv(),Nn=()=>iv,jc=(t,{token:e,customDomain:i=Jc,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,mi.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${Pl({token:e,time:o,program_time:r})}`},em=(t,{token:e,customDomain:i=Jc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,mi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${Pl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Lr=t=>{if(t){if([mi.StreamTypes.LIVE,mi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return mi.StreamTypes.LIVE}};var av={crossorigin:"crossOrigin",playsinline:"playsInline"};function tm(t){var e;return(e=av[t])!=null?e:Dn(t)}var ui,ci,me,On=class{constructor(e,i){pe(this,ui);pe(this,ci);pe(this,me,[]);ye(this,ui,e),ye(this,ci,i)}[Symbol.iterator](){return H(this,me).values()}get length(){return H(this,me).length}get value(){var e;return(e=H(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ye(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return H(this,me)[e]}values(){return H(this,me).values()}keys(){return H(this,me).keys()}forEach(e){H(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||H(this,me).push(r)}),!(this.value===""&&!((i=H(this,ui))!=null&&i.hasAttribute(`${H(this,ci)}`)))&&((a=H(this,ui))==null||a.setAttribute(`${H(this,ci)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{H(this,me).splice(H(this,me).indexOf(a),1)}),(i=H(this,ui))==null||i.setAttribute(`${H(this,ci)}`,`${this.value}`)}contains(e){return H(this,me).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};ui=new WeakMap,ci=new WeakMap,me=new WeakMap;var am=`[mux-player ${Nn()}]`;function it(...t){console.warn(am,...t)}function ge(...t){console.error(am,...t)}function Hl(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,im.i18n)("Read more: ")}
1402
+ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),it(e)}var le={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Nt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},nA={...le,...Nt},om=Object.freeze({length:0,start(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),rv=Object.values(le).filter(t=>le.PLAYSINLINE!==t),ov=Object.values(Nt),nv=[...rv,...ov],Bl=class extends ke.HTMLElement{static get observedAttributes(){return nv}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case Nt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Nt.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Nt.PLAYBACKRATE:{let s=(o=ce(a))!=null?o:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,i;return(i=(e=this.media)==null?void 0:e.play())!=null?i:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,i;return(i=(e=this.media)==null?void 0:e.paused)!=null?i:!0}get duration(){var e,i;return(i=(e=this.media)==null?void 0:e.duration)!=null?i:NaN}get ended(){var e,i;return(i=(e=this.media)==null?void 0:e.ended)!=null?i:!1}get buffered(){var e,i;return(i=(e=this.media)==null?void 0:e.buffered)!=null?i:om}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:om}get readyState(){var e,i;return(i=(e=this.media)==null?void 0:e.readyState)!=null?i:0}get videoWidth(){var e,i;return(i=(e=this.media)==null?void 0:e.videoWidth)!=null?i:0}get videoHeight(){var e,i;return(i=(e=this.media)==null?void 0:e.videoHeight)!=null?i:0}get currentSrc(){var e,i;return(i=(e=this.media)==null?void 0:e.currentSrc)!=null?i:""}get currentTime(){var e,i;return(i=(e=this.media)==null?void 0:e.currentTime)!=null?i:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,i;return(i=(e=this.media)==null?void 0:e.volume)!=null?i:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,i;return(i=(e=this.media)==null?void 0:e.playbackRate)!=null?i:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=ce(this.getAttribute(Nt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Nt.PLAYBACKRATE,`${e}`):this.removeAttribute(Nt.PLAYBACKRATE)}get crossOrigin(){return wr(this,le.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(le.CROSSORIGIN,`${e}`)}get autoplay(){return wr(this,le.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(le.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(le.AUTOPLAY)}get loop(){return wr(this,le.LOOP)!=null}set loop(e){e?this.setAttribute(le.LOOP,""):this.removeAttribute(le.LOOP)}get muted(){var e,i;return(i=(e=this.media)==null?void 0:e.muted)!=null?i:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return wr(this,le.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(le.MUTED,""):this.removeAttribute(le.MUTED)}get playsInline(){return wr(this,le.PLAYSINLINE)!=null}set playsInline(e){ge("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(le.PRELOAD,e):this.removeAttribute(le.PRELOAD)}};function wr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var $l=Bl;var um=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},N=(t,e,i)=>(um(t,e,"read from private field"),i?i.call(t):e.get(t)),at=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},gt=(t,e,i,a)=>(um(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ra,Pn,hi,Rr,Pt,Ut,Ht,pi,oa,Un,$e,nm=1,sm=0,sv=1,lv={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let o=i[a];typeof o=="boolean"&&r instanceof he&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof he?r.element[r.attributeName]=o:r.value=o}}}},_t=class extends l.DocumentFragment{constructor(e,i,a=lv){var r;super(),at(this,ra,void 0),at(this,Pn,void 0),this.append(e.content.cloneNode(!0)),gt(this,ra,cm(this)),gt(this,Pn,a),(r=a.createCallback)==null||r.call(a,this,N(this,ra),i),a.processCallback(this,N(this,ra),i)}update(e){N(this,Pn).processCallback(this,N(this,ra),e)}};ra=new WeakMap;Pn=new WeakMap;var cm=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new Wl;for([i,a]of dm(r.value))if(!i)o.append(a);else{let s=new he(t,r.name,r.namespaceURI);o.append(s),e.push([a,s])}r.value=o.toString()}for(let r of t.childNodes)if(r.nodeType===nm&&!(r instanceof HTMLTemplateElement))cm(r,e);else{let o=r.data;if(r.nodeType===nm||o.includes("{{")){let s=[];if(o)for([i,a]of dm(o))if(!i)s.push(new Text(a));else{let d=new At(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new xr(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},lm={},dm=t=>{let e="",i=0,a=lm[t],r=0,o;if(a)return a;for(a=[];o=t[r];r++)o==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([sm,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([sv,e.trim()]),e="",r++):e+=o||"";return e&&a.push([sm,(i>0?"{{":"")+e]),lm[t]=a},dv=11,Hn=class{get value(){return""}set value(e){}toString(){return this.value}},mm=new WeakMap,Wl=class{constructor(){at(this,hi,[])}[Symbol.iterator](){return N(this,hi).values()}get length(){return N(this,hi).length}item(e){return N(this,hi)[e]}append(...e){for(let i of e)i instanceof he&&mm.set(i,this),N(this,hi).push(i)}toString(){return N(this,hi).join("")}};hi=new WeakMap;var he=class extends Hn{constructor(e,i,a){super(),at(this,pi),at(this,Rr,""),at(this,Pt,void 0),at(this,Ut,void 0),at(this,Ht,void 0),gt(this,Pt,e),gt(this,Ut,i),gt(this,Ht,a)}get attributeName(){return N(this,Ut)}get attributeNamespace(){return N(this,Ht)}get element(){return N(this,Pt)}get value(){return N(this,Rr)}set value(e){N(this,Rr)!==e&&(gt(this,Rr,e),!N(this,pi,oa)||N(this,pi,oa).length===1?e==null?N(this,Pt).removeAttributeNS(N(this,Ht),N(this,Ut)):N(this,Pt).setAttributeNS(N(this,Ht),N(this,Ut),e):N(this,Pt).setAttributeNS(N(this,Ht),N(this,Ut),N(this,pi,oa).toString()))}get booleanValue(){return N(this,Pt).hasAttributeNS(N(this,Ht),N(this,Ut))}set booleanValue(e){if(!N(this,pi,oa)||N(this,pi,oa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Rr=new WeakMap;Pt=new WeakMap;Ut=new WeakMap;Ht=new WeakMap;pi=new WeakSet;oa=function(){return mm.get(this)};var At=class extends Hn{constructor(e,i){super(),at(this,Un,void 0),at(this,$e,void 0),gt(this,Un,e),gt(this,$e,i?[...i]:[new Text])}get replacementNodes(){return N(this,$e)}get parentNode(){return N(this,Un)}get nextSibling(){return N(this,$e)[N(this,$e).length-1].nextSibling}get previousSibling(){return N(this,$e)[0].previousSibling}get value(){return N(this,$e).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let i=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===dv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),gt(this,$e,uv(N(this,$e)[0].parentNode,N(this,$e),i,this.nextSibling))}};Un=new WeakMap;$e=new WeakMap;var xr=class extends At{constructor(e,i){let a=i.getAttribute("directive")||i.getAttribute("type"),r=i.getAttribute("expression")||i.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=i,this.directive=a}};function uv(t,e,i,a=null){let r=0,o,s,d,u=i.length,p=e.length;for(;r<u&&r<p&&e[r]==i[r];)r++;for(;r<u&&r<p&&i[u-1]==e[p-1];)a=i[--p,--u];if(r==p)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<p;)t.removeChild(e[r++]);else{for(o=e[r];r<u;)d=i[r++],s=o?o.nextSibling:a,o==d?o=s:r<u&&i[r]==s?(t.replaceChild(d,o),o=s):t.insertBefore(d,o);for(;o!=a;)s=o.nextSibling,t.removeChild(o),o=s}return i}var hm={string:t=>String(t)},$n=class{constructor(e){this.template=e,this.state=void 0}},fi=new WeakMap,vi=new WeakMap,Fl={partial:(t,e)=>{e[t.expression]=new $n(t.template)},if:(t,e)=>{var i;if(fm(t.expression,e))if(fi.get(t)!==t.template){fi.set(t,t.template);let a=new _t(t.template,e,Wn);t.replace(a),vi.set(t,a)}else(i=vi.get(t))==null||i.update(e);else t.replace(""),fi.delete(t),vi.delete(t)}},cv=Object.keys(Fl),Wn={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof xr){if(!s.directive){let u=cv.find(p=>s.template.hasAttribute(p));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=Fl[s.directive])==null||a.call(Fl,s,i);continue}let d=fm(o,i);if(d instanceof $n){fi.get(s)!==d.template?(fi.set(s,d.template),d=new _t(d.template,d.state,Wn),s.value=d,vi.set(s,d)):(r=vi.get(s))==null||r.update(d.state);continue}d?(s instanceof he&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof he?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,fi.delete(s),vi.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,fi.delete(s),vi.delete(s))}}},pm={"!":t=>!t,"!!":t=>!!t,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,"??":(t,e)=>t!=null?t:e,"|":(t,e)=>{var i;return(i=hm[e])==null?void 0:i.call(hm,t)}};function mv(t){return hv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function fm(t,e={}){var i,a,r,o,s,d,u;let p=mv(t);if(p.length===0||p.some(({type:T})=>!T))return Dr(t);if(((i=p[0])==null?void 0:i.token)===">"){let T=e[(a=p[1])==null?void 0:a.token];if(!T)return Dr(t);let _={...e};T.state=_;let E=p.slice(2);for(let f=0;f<E.length;f+=3){let I=(r=E[f])==null?void 0:r.token,b=(o=E[f+1])==null?void 0:o.token,M=(s=E[f+2])==null?void 0:s.token;I&&b==="="&&(_[I]=Or(M,e))}return T}if(p.length===1)return Bn(p[0])?Or(p[0].token,e):Dr(t);if(p.length===2){let T=(d=p[0])==null?void 0:d.token,_=pm[T];if(!_||!Bn(p[1]))return Dr(t);let E=Or(p[1].token,e);return _(E)}if(p.length===3){let T=(u=p[1])==null?void 0:u.token,_=pm[T];if(!_||!Bn(p[0])||!Bn(p[2]))return Dr(t);let E=Or(p[0].token,e);if(T==="|")return _(E,p[2].token);let f=Or(p[2].token,e);return _(E,f)}}function Dr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Bn({type:t}){return["number","boolean","string","param"].includes(t)}function Or(t,e){let i=t[0],a=t.slice(-1);return t==="true"||t==="false"?t==="true":i===a&&["'",'"'].includes(i)?t.slice(1,-1):uo(t)?parseFloat(t):e[t]}function hv(t,e){let i,a,r,o=[];for(;t;){r=null,i=t.length;for(let s in e)a=e[s].exec(t),a&&a.index<i&&(r={token:a[0],type:s,matches:a.slice(1)},i=a.index);i&&o.push({token:t.substr(0,i),type:void 0}),r&&o.push(r),t=t.substr(i+(r?r.token.length:0))}return o}var Zl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Gl=(t,e,i)=>(Zl(t,e,"read from private field"),i?i.call(t):e.get(t)),Nr=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ei=(t,e,i,a)=>(Zl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Vl=(t,e,i)=>(Zl(t,e,"access private method"),i),na,Fn,sa,Yl,vm,Vn,ql,Kl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Em=V.createElement("template");Em.innerHTML=`
1403
1403
  <style>
1404
1404
  :host {
1405
1405
  display: inline-block;
@@ -1426,7 +1426,7 @@ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),it(e)}var le={AU
1426
1426
  display: none;
1427
1427
  }
1428
1428
  </style>
1429
- `;var bi=class extends l.HTMLElement{constructor(){super(),Or(this,Gl),Or(this,Fn),Or(this,na,void 0),Or(this,Wn,void 0),Or(this,sa,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(i=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||i.some(r=>{let o=r.target;return o===this?!0:o.localName!=="media-controller"?!1:!!(Vl[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(Le.BREAKPOINTS_COMPUTED,this.render),Fl(this,Gl,vm).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Kl(this,na))!=null?e:this.constructor.template}set template(e){if(e===null){this.removeAttribute("template");return}typeof e=="string"?this.setAttribute("template",e):e instanceof HTMLTemplateElement&&(Ei(this,na,e),Ei(this,sa,null),this.createRenderer())}get props(){var e,i,a;let r=[...Array.from((i=(e=this.mediaController)==null?void 0:e.attributes)!=null?i:[]).filter(({name:s})=>Vl[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],o={};for(let s of r){let d=(a=Vl[s.name])!=null?a:vu(s.name),{value:u}=s;u!=null?(lo(u)&&(u=parseFloat(u)),o[d]=u===""?!0:u):o[d]=!1}return o}attributeChangedCallback(e,i,a){e==="template"&&i!=a&&Fl(this,Fn,Yl).call(this)}connectedCallback(){Fl(this,Fn,Yl).call(this)}createRenderer(){this.template instanceof HTMLTemplateElement&&this.template!==Kl(this,Wn)&&(Ei(this,Wn,this.template),this.renderer=new _t(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Em.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};na=new WeakMap;Wn=new WeakMap;sa=new WeakMap;Gl=new WeakSet;vm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}};Fn=new WeakSet;Yl=function(){var t;let e=this.getAttribute("template");if(!e||e===Kl(this,sa))return;let i=this.getRootNode(),a=(t=i==null?void 0:i.getElementById)==null?void 0:t.call(i,e);if(a){Ei(this,sa,e),Ei(this,na,a),this.createRenderer();return}pv(e)&&(Ei(this,sa,e),fv(e).then(r=>{let o=V.createElement("template");o.innerHTML=r,Ei(this,na,o),this.createRenderer()}).catch(console.error))};bi.observedAttributes=["template"];bi.processor=$n;function pv(t){if(!/^(\/|\.\/|https?:\/\/)/.test(t))return!1;let e=/^https?:\/\//.test(t)?void 0:location.origin;try{new URL(t,e)}catch{return!1}return!0}async function fv(t){let e=await fetch(t);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}l.customElements.get("media-theme")||l.customElements.define("media-theme",bi);var bm=`:host {
1429
+ `;var bi=class extends l.HTMLElement{constructor(){super(),Nr(this,Yl),Nr(this,Vn),Nr(this,na,void 0),Nr(this,Fn,void 0),Nr(this,sa,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(i=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||i.some(r=>{let o=r.target;return o===this?!0:o.localName!=="media-controller"?!1:!!(Kl[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(Le.BREAKPOINTS_COMPUTED,this.render),Vl(this,Yl,vm).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Gl(this,na))!=null?e:this.constructor.template}set template(e){if(e===null){this.removeAttribute("template");return}typeof e=="string"?this.setAttribute("template",e):e instanceof HTMLTemplateElement&&(Ei(this,na,e),Ei(this,sa,null),this.createRenderer())}get props(){var e,i,a;let r=[...Array.from((i=(e=this.mediaController)==null?void 0:e.attributes)!=null?i:[]).filter(({name:s})=>Kl[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],o={};for(let s of r){let d=(a=Kl[s.name])!=null?a:vu(s.name),{value:u}=s;u!=null?(uo(u)&&(u=parseFloat(u)),o[d]=u===""?!0:u):o[d]=!1}return o}attributeChangedCallback(e,i,a){e==="template"&&i!=a&&Vl(this,Vn,ql).call(this)}connectedCallback(){Vl(this,Vn,ql).call(this)}createRenderer(){this.template instanceof HTMLTemplateElement&&this.template!==Gl(this,Fn)&&(Ei(this,Fn,this.template),this.renderer=new _t(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Em.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};na=new WeakMap;Fn=new WeakMap;sa=new WeakMap;Yl=new WeakSet;vm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}};Vn=new WeakSet;ql=function(){var t;let e=this.getAttribute("template");if(!e||e===Gl(this,sa))return;let i=this.getRootNode(),a=(t=i==null?void 0:i.getElementById)==null?void 0:t.call(i,e);if(a){Ei(this,sa,e),Ei(this,na,a),this.createRenderer();return}pv(e)&&(Ei(this,sa,e),fv(e).then(r=>{let o=V.createElement("template");o.innerHTML=r,Ei(this,na,o),this.createRenderer()}).catch(console.error))};bi.observedAttributes=["template"];bi.processor=Wn;function pv(t){if(!/^(\/|\.\/|https?:\/\/)/.test(t))return!1;let e=/^https?:\/\//.test(t)?void 0:location.origin;try{new URL(t,e)}catch{return!1}return!0}async function fv(t){let e=await fetch(t);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}l.customElements.get("media-theme")||l.customElements.define("media-theme",bi);var bm=`:host {
1430
1430
  --media-control-display: var(--controls);
1431
1431
  --media-loading-indicator-display: var(--loading-indicator);
1432
1432
  --media-dialog-display: var(--dialog);
@@ -1576,19 +1576,19 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1576
1576
  :host([no-tooltips]) {
1577
1577
  --media-tooltip-display: none;
1578
1578
  }
1579
- `;var Pr=new WeakMap,Ql=class t{constructor(e,i){this.element=e;this.type=i;this.element.addEventListener(this.type,this);let a=Pr.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let i=Pr.get(this.element);i&&i.delete(this.type)}}static for(e){Pr.has(e.element)||Pr.set(e.element,new Map);let i=e.attributeName.slice(2),a=Pr.get(e.element);return a&&a.has(i)?a.get(i):new t(e.element,i)}};function Ev(t,e){return t instanceof he&&t.attributeName.startsWith("on")?(Ql.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function bv(t,e){return e instanceof Vn&&t instanceof At?(e.renderInto(t),!0):!1}function gv(t,e){return e instanceof DocumentFragment&&t instanceof At?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function _v(t,e){if(t instanceof he){let i=t.attributeNamespace,a=t.element.getAttributeNS(i,t.attributeName);return String(e)!==a&&(t.value=String(e)),!0}return t.value=String(e),!0}function Av(t,e){if(t instanceof he&&e instanceof Element){let i=t.element;return i[t.attributeName]!==e&&(t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),i[t.attributeName]=e),!0}return!1}function Tv(t,e){if(typeof e=="boolean"&&t instanceof he){let i=t.attributeNamespace,a=t.element.hasAttributeNS(i,t.attributeName);return e!==a&&(t.booleanValue=e),!0}return!1}function yv(t,e){return e===!1&&t instanceof At?(t.replace(""),!0):!1}function kv(t,e){Av(t,e)||Tv(t,e)||Ev(t,e)||yv(t,e)||bv(t,e)||gv(t,e)||_v(t,e)}var Zl=new Map,gm=new WeakMap,_m=new WeakMap,Vn=class{constructor(e,i,a){this.strings=e;this.values=i;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Zl.has(this.stringsKey))return Zl.get(this.stringsKey);{let e=Gt.createElement("template"),i=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,o)=>a+r+(o<i?`{{ ${o} }}`:""),""),Zl.set(this.stringsKey,e),e}}renderInto(e){var r;let i=this.template;if(gm.get(e)!==i){gm.set(e,i);let o=new _t(i,this.values,this.processor);_m.set(e,o),e instanceof At?e.replace(...o.children):e.appendChild(o);return}let a=_m.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Sv={processCallback(t,e,i){var a;if(i){for(let[r,o]of e)if(r in i){let s=(a=i[r])!=null?a:"";kv(o,s)}}}};function Nr(t,...e){return new Vn(t,e,Sv)}function Am(t,e){t.renderInto(e)}var Ur=require("@mux/playback-core"),Iv=t=>{let{tokens:e}=t;return e.drm?":host(:not([cast-receiver])) { --_cast-button-drm-display: none; }":""},Tm=t=>Nr`
1579
+ `;var Pr=new WeakMap,zl=class t{constructor(e,i){this.element=e;this.type=i;this.element.addEventListener(this.type,this);let a=Pr.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let i=Pr.get(this.element);i&&i.delete(this.type)}}static for(e){Pr.has(e.element)||Pr.set(e.element,new Map);let i=e.attributeName.slice(2),a=Pr.get(e.element);return a&&a.has(i)?a.get(i):new t(e.element,i)}};function Ev(t,e){return t instanceof he&&t.attributeName.startsWith("on")?(zl.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function bv(t,e){return e instanceof Kn&&t instanceof At?(e.renderInto(t),!0):!1}function gv(t,e){return e instanceof DocumentFragment&&t instanceof At?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function _v(t,e){if(t instanceof he){let i=t.attributeNamespace,a=t.element.getAttributeNS(i,t.attributeName);return String(e)!==a&&(t.value=String(e)),!0}return t.value=String(e),!0}function Av(t,e){if(t instanceof he&&e instanceof Element){let i=t.element;return i[t.attributeName]!==e&&(t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),i[t.attributeName]=e),!0}return!1}function Tv(t,e){if(typeof e=="boolean"&&t instanceof he){let i=t.attributeNamespace,a=t.element.hasAttributeNS(i,t.attributeName);return e!==a&&(t.booleanValue=e),!0}return!1}function yv(t,e){return e===!1&&t instanceof At?(t.replace(""),!0):!1}function kv(t,e){Av(t,e)||Tv(t,e)||Ev(t,e)||yv(t,e)||bv(t,e)||gv(t,e)||_v(t,e)}var Ql=new Map,gm=new WeakMap,_m=new WeakMap,Kn=class{constructor(e,i,a){this.strings=e;this.values=i;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Ql.has(this.stringsKey))return Ql.get(this.stringsKey);{let e=Gt.createElement("template"),i=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,o)=>a+r+(o<i?`{{ ${o} }}`:""),""),Ql.set(this.stringsKey,e),e}}renderInto(e){var r;let i=this.template;if(gm.get(e)!==i){gm.set(e,i);let o=new _t(i,this.values,this.processor);_m.set(e,o),e instanceof At?e.replace(...o.children):e.appendChild(o);return}let a=_m.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Sv={processCallback(t,e,i){var a;if(i){for(let[r,o]of e)if(r in i){let s=(a=i[r])!=null?a:"";kv(o,s)}}}};function Ur(t,...e){return new Kn(t,e,Sv)}function Am(t,e){t.renderInto(e)}var Hr=require("@mux/playback-core"),Iv=t=>{let{tokens:e}=t;return e.drm?":host(:not([cast-receiver])) { --_cast-button-drm-display: none; }":""},Tm=t=>Ur`
1580
1580
  <style>
1581
1581
  ${Iv(t)}
1582
1582
  ${bm}
1583
1583
  </style>
1584
1584
  ${wv(t)}
1585
- `,Mv=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Cr(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Cv={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",THUMB:"thumb",DISPLAY:"display",CONTROL_BAR:"control-bar",MENU_BUTTON:"menu-button",MENU:"menu",MENU_ITEM:"menu-item",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},Lv=Object.values(Cv).join(", "),wv=t=>{var e,i,a,r,o,s,d,u,p,T,_,E,f,I,b,M,C,ie,Ae,kt,ct,Ia,Ma,Ca,La,wa,Ra,xa,Da,Oa,Pa,Na,oo,mt,Ua,Ha,Ba;return Nr`
1585
+ `,Mv=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Lr(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Cv={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",THUMB:"thumb",DISPLAY:"display",CONTROL_BAR:"control-bar",MENU_BUTTON:"menu-button",MENU:"menu",MENU_ITEM:"menu-item",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},Lv=Object.values(Cv).join(", "),wv=t=>{var e,i,a,r,o,s,d,u,p,T,_,E,f,I,b,M,C,ie,Ae,kt,ct,Ia,Ma,Ca,La,wa,Ra,xa,Da,Oa,Na,Pa,no,mt,Ua,Ha,Ba,$a;return Ur`
1586
1586
  <media-theme
1587
1587
  template="${t.themeTemplate||!1}"
1588
1588
  defaultstreamtype="${(e=t.defaultStreamType)!=null?e:!1}"
1589
1589
  hotkeys="${Mv(t)||!1}"
1590
1590
  nohotkeys="${t.noHotKeys||!t.hasSrc||!1}"
1591
- noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(Ur.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
1591
+ noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(Hr.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
1592
1592
  novolumepref="${t.novolumepref||!1}"
1593
1593
  nomutedpref="${t.nomutedpref||!1}"
1594
1594
  disabled="${!t.hasSrc||t.isDialogOpen}"
@@ -1612,7 +1612,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1612
1612
  slot="media"
1613
1613
  inert="${(I=t.noHotKeys)!=null?I:!1}"
1614
1614
  target-live-window="${(b=t.targetLiveWindow)!=null?b:!1}"
1615
- stream-type="${(M=Cr(t.streamType))!=null?M:!1}"
1615
+ stream-type="${(M=Lr(t.streamType))!=null?M:!1}"
1616
1616
  crossorigin="${(C=t.crossOrigin)!=null?C:""}"
1617
1617
  playsinline
1618
1618
  autoplay="${(ie=t.autoplay)!=null?ie:!1}"
@@ -1629,16 +1629,17 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1629
1629
  player-init-time="${(xa=t.playerInitTime)!=null?xa:!1}"
1630
1630
  player-software-name="${(Da=t.playerSoftwareName)!=null?Da:!1}"
1631
1631
  player-software-version="${(Oa=t.playerSoftwareVersion)!=null?Oa:!1}"
1632
- env-key="${(Pa=t.envKey)!=null?Pa:!1}"
1633
- custom-domain="${(Na=t.customDomain)!=null?Na:!1}"
1634
- src="${t.src?t.src:t.playbackId?(0,Ur.toMuxVideoURL)(t):!1}"
1635
- cast-src="${t.src?t.src:t.playbackId?(0,Ur.toMuxVideoURL)(t):!1}"
1636
- cast-receiver="${(oo=t.castReceiver)!=null?oo:!1}"
1632
+ env-key="${(Na=t.envKey)!=null?Na:!1}"
1633
+ custom-domain="${(Pa=t.customDomain)!=null?Pa:!1}"
1634
+ src="${t.src?t.src:t.playbackId?(0,Hr.toMuxVideoURL)(t):!1}"
1635
+ cast-src="${t.src?t.src:t.playbackId?(0,Hr.toMuxVideoURL)(t):!1}"
1636
+ cast-receiver="${(no=t.castReceiver)!=null?no:!1}"
1637
1637
  drm-token="${(Ua=(mt=t.tokens)==null?void 0:mt.drm)!=null?Ua:!1}"
1638
1638
  exportparts="video"
1639
1639
  disable-pseudo-ended="${(Ha=t.disablePseudoEnded)!=null?Ha:!1}"
1640
+ max-auto-resolution="${(Ba=t.maxAutoResolution)!=null?Ba:!1}"
1640
1641
  >
1641
- ${t.storyboard?Nr`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:Nr``}
1642
+ ${t.storyboard?Ur`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:Ur``}
1642
1643
  <slot></slot>
1643
1644
  </mux-video>
1644
1645
  <slot name="poster" slot="poster">
@@ -1646,11 +1647,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1646
1647
  part="poster"
1647
1648
  exportparts="poster, img"
1648
1649
  src="${t.poster?t.poster:!1}"
1649
- placeholdersrc="${(Ba=t.placeholder)!=null?Ba:!1}"
1650
+ placeholdersrc="${($a=t.placeholder)!=null?$a:!1}"
1650
1651
  ></media-poster-image>
1651
1652
  </slot>
1652
1653
  </media-theme>
1653
- `};var A=require("@mux/playback-core"),ym=t=>t.charAt(0).toUpperCase()+t.slice(1),Rv=(t,e=!1)=>{var i,a;if(t.muxCode){let r=ym((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);if(t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE)return(0,A.i18n)("Your device appears to be offline",e);if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,A.i18n)("{category} URL has expired",e).format({category:r});if([A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,A.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,A.i18n)("Invalid {categoryName} URL",e).format({categoryName:o});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return(0,A.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_READY){let s=t.streamType==="live"?"Live stream":"Video";return(0,A.i18n)("{mediaType} is not currently available",e).format({mediaType:s})}}if(t.code){if(t.code===A.MediaError.MEDIA_ERR_NETWORK)return(0,A.i18n)("Network Error",e);if(t.code===A.MediaError.MEDIA_ERR_DECODE)return(0,A.i18n)("Media Error",e);if(t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,A.i18n)("Source Not Supported",e)}return(0,A.i18n)("Error",e)},xv=(t,e=!1)=>{var i,a;if(t.muxCode){let r=ym((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);return t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE?(0,A.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,A.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,A.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,A.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:o}):[A.MuxErrorCode.NETWORK_TOKEN_MISSING,A.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,A.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND?"":t.message}return t.code&&(t.code===A.MediaError.MEDIA_ERR_NETWORK||t.code===A.MediaError.MEDIA_ERR_DECODE||t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},km=(t,e=!1)=>{let i=Rv(t,e).toString(),a=xv(t,e).toString();return{title:i,message:a}},Dv=t=>{if(t.muxCode){if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===A.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===A.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},zl=(t,e)=>{let i=Dv(t);return{message:t.message,context:t.context,file:i}};var Sm=`<template id="media-theme-gerwig">
1654
+ `};var A=require("@mux/playback-core"),ym=t=>t.charAt(0).toUpperCase()+t.slice(1),Rv=(t,e=!1)=>{var i,a;if(t.muxCode){let r=ym((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);if(t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE)return(0,A.i18n)("Your device appears to be offline",e);if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,A.i18n)("{category} URL has expired",e).format({category:r});if([A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,A.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,A.i18n)("Invalid {categoryName} URL",e).format({categoryName:o});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return(0,A.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_READY){let s=t.streamType==="live"?"Live stream":"Video";return(0,A.i18n)("{mediaType} is not currently available",e).format({mediaType:s})}}if(t.code){if(t.code===A.MediaError.MEDIA_ERR_NETWORK)return(0,A.i18n)("Network Error",e);if(t.code===A.MediaError.MEDIA_ERR_DECODE)return(0,A.i18n)("Media Error",e);if(t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,A.i18n)("Source Not Supported",e)}return(0,A.i18n)("Error",e)},xv=(t,e=!1)=>{var i,a;if(t.muxCode){let r=ym((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);return t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE?(0,A.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,A.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,A.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,A.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:o}):[A.MuxErrorCode.NETWORK_TOKEN_MISSING,A.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,A.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND?"":t.message}return t.code&&(t.code===A.MediaError.MEDIA_ERR_NETWORK||t.code===A.MediaError.MEDIA_ERR_DECODE||t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},km=(t,e=!1)=>{let i=Rv(t,e).toString(),a=xv(t,e).toString();return{title:i,message:a}},Dv=t=>{if(t.muxCode){if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===A.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===A.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},Xl=(t,e)=>{let i=Dv(t);return{message:t.message,context:t.context,file:i}};var Sm=`<template id="media-theme-gerwig">
1654
1655
  <style>
1655
1656
  @keyframes pre-play-hide {
1656
1657
  0% {
@@ -2782,7 +2783,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2782
2783
  <slot></slot>
2783
2784
  </media-controller>
2784
2785
  </template>
2785
- `;function Im({anchor:t,floating:e,placement:i}){let a=Pv({anchor:t,floating:e}),{x:r,y:o}=Uv(a,i);return{x:r,y:o}}function Pv({anchor:t,floating:e}){return{anchor:Nv(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Nv(t,e){var i;let a=t.getBoundingClientRect(),r=(i=e==null?void 0:e.getBoundingClientRect())!=null?i:{x:0,y:0};return{x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}function Uv({anchor:t,floating:e},i){let a=Hv(i)==="x"?"y":"x",r=a==="y"?"height":"width",o=Mm(i),s=t.x+t.width/2-e.width/2,d=t.y+t.height/2-e.height/2,u=t[r]/2-e[r]/2,p;switch(o){case"top":p={x:s,y:t.y-e.height};break;case"bottom":p={x:s,y:t.y+t.height};break;case"right":p={x:t.x+t.width,y:d};break;case"left":p={x:t.x-e.width,y:d};break;default:p={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":p[a]-=u;break;case"end":p[a]+=u;break}return p}function Mm(t){return t.split("-")[0]}function Hv(t){return["top","bottom"].includes(Mm(t))?"y":"x"}var Bt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},Kn=class extends Event{constructor({newState:e,oldState:i,...a}){super("toggle",a),this.newState=e,this.oldState=i}};var ld=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},B=(t,e,i)=>(ld(t,e,"read from private field"),i?i.call(t):e.get(t)),K=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},rt=(t,e,i,a)=>(ld(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),G=(t,e,i)=>(ld(t,e,"access private method"),i),ot,_i,$t,Gn,Yn,Ai,$r,Xl,Cm,Qn,dd,zn,qn,Jl,jl,Lm,ed,wm,td,Rm,la,da,ua,Wr,Xn,ud,id,xm,cd,Dm,ad,Om,md,Pm,rd,Nm,od,Um,Hr,Jn,nd,Hm,Br,jn,Zn,sd;function nt({type:t,text:e,value:i,checked:a}){let r=V.createElement("media-chrome-menu-item");r.type=t!=null?t:"",r.part.add("menu-item"),t&&r.part.add(t),r.value=i,r.checked=a;let o=V.createElement("span");return o.textContent=e,r.append(o),r}function We(t,e){let i=t.querySelector(`:scope > [slot="${e}"]`);if((i==null?void 0:i.nodeName)=="SLOT"&&(i=i.assignedElements({flatten:!0})[0]),i)return i=i.cloneNode(!0),i;let a=t.shadowRoot.querySelector(`[name="${e}"] > svg`);return a?a.cloneNode(!0):""}function Bv(t){return`
2786
+ `;function Im({anchor:t,floating:e,placement:i}){let a=Nv({anchor:t,floating:e}),{x:r,y:o}=Uv(a,i);return{x:r,y:o}}function Nv({anchor:t,floating:e}){return{anchor:Pv(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Pv(t,e){var i;let a=t.getBoundingClientRect(),r=(i=e==null?void 0:e.getBoundingClientRect())!=null?i:{x:0,y:0};return{x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}function Uv({anchor:t,floating:e},i){let a=Hv(i)==="x"?"y":"x",r=a==="y"?"height":"width",o=Mm(i),s=t.x+t.width/2-e.width/2,d=t.y+t.height/2-e.height/2,u=t[r]/2-e[r]/2,p;switch(o){case"top":p={x:s,y:t.y-e.height};break;case"bottom":p={x:s,y:t.y+t.height};break;case"right":p={x:t.x+t.width,y:d};break;case"left":p={x:t.x-e.width,y:d};break;default:p={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":p[a]-=u;break;case"end":p[a]+=u;break}return p}function Mm(t){return t.split("-")[0]}function Hv(t){return["top","bottom"].includes(Mm(t))?"y":"x"}var Bt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},Gn=class extends Event{constructor({newState:e,oldState:i,...a}){super("toggle",a),this.newState=e,this.oldState=i}};var dd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},B=(t,e,i)=>(dd(t,e,"read from private field"),i?i.call(t):e.get(t)),K=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},rt=(t,e,i,a)=>(dd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),G=(t,e,i)=>(dd(t,e,"access private method"),i),ot,_i,$t,Yn,qn,Ai,Wr,Jl,Cm,zn,ud,Xn,Zn,jl,ed,Lm,td,wm,id,Rm,la,da,ua,Fr,Jn,cd,ad,xm,md,Dm,rd,Om,hd,Nm,od,Pm,nd,Um,Br,jn,sd,Hm,$r,es,Qn,ld;function nt({type:t,text:e,value:i,checked:a}){let r=V.createElement("media-chrome-menu-item");r.type=t!=null?t:"",r.part.add("menu-item"),t&&r.part.add(t),r.value=i,r.checked=a;let o=V.createElement("span");return o.textContent=e,r.append(o),r}function We(t,e){let i=t.querySelector(`:scope > [slot="${e}"]`);if((i==null?void 0:i.nodeName)=="SLOT"&&(i=i.assignedElements({flatten:!0})[0]),i)return i=i.cloneNode(!0),i;let a=t.shadowRoot.querySelector(`[name="${e}"] > svg`);return a?a.cloneNode(!0):""}function Bv(t){return`
2786
2787
  <style>
2787
2788
  :host {
2788
2789
  font: var(--media-font,
@@ -2957,7 +2958,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2957
2958
  <slot></slot>
2958
2959
  </div>
2959
2960
  <slot name="checked-indicator" hidden></slot>
2960
- `}var gi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},j=class extends l.HTMLElement{constructor(){if(super(),K(this,Xl),K(this,Qn),K(this,qn),K(this,jl),K(this,ed),K(this,td),K(this,ua),K(this,Xn),K(this,id),K(this,cd),K(this,ad),K(this,md),K(this,rd),K(this,od),K(this,Hr),K(this,nd),K(this,Br),K(this,Zn),K(this,ot,null),K(this,_i,null),K(this,$t,null),K(this,Gn,new Set),K(this,Yn,void 0),K(this,Ai,!1),K(this,$r,null),K(this,zn,()=>{let e=B(this,Gn),i=new Set(this.items);for(let a of e)i.has(a)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:a}));for(let a of i)e.has(a)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:a}));rt(this,Gn,i)}),K(this,la,()=>{G(this,ua,Wr).call(this),G(this,Xn,ud).call(this,!1)}),K(this,da,()=>{G(this,ua,Wr).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),rt(this,Yn,new MutationObserver(B(this,zn))),B(this,Yn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[gi.DISABLED,gi.HIDDEN,gi.STYLE,gi.ANCHOR,x.MEDIA_CONTROLLER]}static formatMenuItemText(e,i){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":G(this,Xl,Cm).call(this,e);break;case"invoke":G(this,jl,Lm).call(this,e);break;case"click":G(this,id,xm).call(this,e);break;case"toggle":G(this,ad,Om).call(this,e);break;case"focusout":G(this,rd,Nm).call(this,e);break;case"keydown":G(this,od,Um).call(this,e);break}}connectedCallback(){var e,i;rt(this,$r,Ga(this.shadowRoot,":host")),G(this,qn,Jl).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),rt(this,ot,po(this)),(i=(e=B(this,ot))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(ht(Fr(this),B(this,la)),ht(this,B(this,da))),G(this,Qn,dd).call(this)}disconnectedCallback(){var e,i;pt(Fr(this),B(this,la)),pt(this,B(this,da)),this.disable(),(i=(e=B(this,ot))==null?void 0:e.unassociateElement)==null||i.call(e,this),rt(this,ot,null)}attributeChangedCallback(e,i,a){var r,o,s,d;e===gi.HIDDEN&&a!==i?(B(this,Ai)||rt(this,Ai,!0),this.hidden?G(this,td,Rm).call(this):G(this,ed,wm).call(this),this.dispatchEvent(new Kn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===x.MEDIA_CONTROLLER?(i&&((o=(r=B(this,ot))==null?void 0:r.unassociateElement)==null||o.call(r,this),rt(this,ot,null)),a&&this.isConnected&&(rt(this,ot,po(this)),(d=(s=B(this,ot))==null?void 0:s.associateElement)==null||d.call(s,this))):e===gi.DISABLED&&a!==i?a==null?this.enable():this.disable():e===gi.STYLE&&a!==i&&G(this,qn,Jl).call(this)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=qt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter($v)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,i;return(i=(e=this.checkedItems[0])==null?void 0:e.value)!=null?i:""}set value(e){let i=this.items.find(a=>a.value===e);i&&G(this,Zn,sd).call(this,i)}focus(){if(rt(this,_i,Ka()),this.items.length){G(this,Br,jn).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var i;let a=G(this,Hr,Jn).call(this,e);a&&(G(this,Zn,sd).call(this,a,a.type==="checkbox"),B(this,$t)&&!this.hidden&&((i=B(this,_i))==null||i.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var i,a;let{key:r}=e,o=this.items,s=(a=(i=G(this,Hr,Jn).call(this,e))!=null?i:G(this,nd,Hm).call(this))!=null?a:o[0],d=o.indexOf(s),u=Math.max(0,d);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=o.length-1),u<0&&(u=o.length-1),u>o.length-1&&(u=0),G(this,Br,jn).call(this,o[u]),o[u].focus()}};ot=new WeakMap;_i=new WeakMap;$t=new WeakMap;Gn=new WeakMap;Yn=new WeakMap;Ai=new WeakMap;$r=new WeakMap;Xl=new WeakSet;Cm=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:!0}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();["header","title"].includes(e.name)&&G(this,Qn,dd).call(this),e.name||B(this,zn).call(this)};Qn=new WeakSet;dd=function(){let t=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');t.hidden=e.assignedNodes().length===0&&t.assignedNodes().length===0};zn=new WeakMap;qn=new WeakSet;Jl=function(){var t;let e=this.shadowRoot.querySelector("#layout-row"),i=(t=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:t.trim();e.setAttribute("media",i==="row"?"":"width:0")};jl=new WeakSet;Lm=function(t){rt(this,$t,t.relatedTarget),ue(this,t.relatedTarget)||(this.hidden=!this.hidden)};ed=new WeakSet;wm=function(){var t;(t=B(this,$t))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),ht(Fr(this),B(this,la)),ht(this,B(this,da))};td=new WeakSet;Rm=function(){var t;(t=B(this,$t))==null||t.setAttribute("aria-expanded","false"),pt(Fr(this),B(this,la)),pt(this,B(this,da))};la=new WeakMap;da=new WeakMap;ua=new WeakSet;Wr=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=Im({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=Fr(this).getBoundingClientRect(),o=r.width-e-t,s=r.height-i-this.offsetHeight,{style:d}=B(this,$r);d.setProperty("position","absolute"),d.setProperty("right",`${Math.max(0,o)}px`),d.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),T=d.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),_=r.height-T-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${_}px`)};Xn=new WeakSet;ud=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=B(this,$r);if(t||a.setProperty("--media-menu-transition-in","none"),i){let r=i.offsetHeight,o=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${r}px`),G(this,ua,Wr).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,ua,Wr).call(this);a.removeProperty("--media-menu-transition-in")};id=new WeakSet;xm=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(B(this,cd,Dm))){(e=B(this,_i))==null||e.focus(),this.hidden=!0;return}let i=G(this,Hr,Jn).call(this,t);!i||i.hasAttribute("disabled")||(G(this,Br,jn).call(this,i),this.handleSelect(t))};cd=new WeakSet;Dm=function(){var t;return(t=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:t.find(i=>i.matches('button[part~="back"]'))};ad=new WeakSet;Om=function(t){if(t.target===this)return;G(this,md,Pm).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let i of e)i.invokeTargetElement!=t.target&&t.newState=="open"&&i.getAttribute("aria-expanded")=="true"&&!i.invokeTargetElement.hidden&&i.invokeTargetElement.dispatchEvent(new Bt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);G(this,Xn,ud).call(this,!0)};md=new WeakSet;Pm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};rd=new WeakSet;Nm=function(t){var e;ue(this,t.relatedTarget)||(B(this,Ai)&&((e=B(this,_i))==null||e.focus()),B(this,$t)&&B(this,$t)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};od=new WeakSet;Um=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:p}=t;if(!(d||u||p)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if(B(this,Ai)){this.hidden=!0;return}t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else s==="Escape"?((o=B(this,_i))==null||o.focus(),B(this,Ai)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};Hr=new WeakSet;Jn=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};nd=new WeakSet;Hm=function(){return this.items.find(t=>t.tabIndex===0)};Br=new WeakSet;jn=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};Zn=new WeakSet;sd=function(t,e){let i=[...this.checkedItems];t.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?t.checked=!t.checked:t.checked=!0,this.checkedItems.some((a,r)=>a!=i[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};j.shadowRootOptions={mode:"open"};j.getTemplateHTML=Bv;function $v(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function Fr(t){var e;return(e=t.getAttribute("bounds")?Ve(t,`#${t.getAttribute("bounds")}`):Y(t)||t.parentElement)!=null?e:t}l.customElements.get("media-chrome-menu")||l.customElements.define("media-chrome-menu",j);var bd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},st=(t,e,i)=>(bd(t,e,"read from private field"),i?i.call(t):e.get(t)),Tt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},hd=(t,e,i,a)=>(bd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Fe=(t,e,i)=>(bd(t,e,"access private method"),i),es,Kr,pd,Bm,is,gd,_d,$m,lt,ca,Gr,fd,Wm,ts,vd;function Wv(t){return`
2961
+ `}var gi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},j=class extends l.HTMLElement{constructor(){if(super(),K(this,Jl),K(this,zn),K(this,Zn),K(this,ed),K(this,td),K(this,id),K(this,ua),K(this,Jn),K(this,ad),K(this,md),K(this,rd),K(this,hd),K(this,od),K(this,nd),K(this,Br),K(this,sd),K(this,$r),K(this,Qn),K(this,ot,null),K(this,_i,null),K(this,$t,null),K(this,Yn,new Set),K(this,qn,void 0),K(this,Ai,!1),K(this,Wr,null),K(this,Xn,()=>{let e=B(this,Yn),i=new Set(this.items);for(let a of e)i.has(a)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:a}));for(let a of i)e.has(a)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:a}));rt(this,Yn,i)}),K(this,la,()=>{G(this,ua,Fr).call(this),G(this,Jn,cd).call(this,!1)}),K(this,da,()=>{G(this,ua,Fr).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),rt(this,qn,new MutationObserver(B(this,Xn))),B(this,qn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[gi.DISABLED,gi.HIDDEN,gi.STYLE,gi.ANCHOR,x.MEDIA_CONTROLLER]}static formatMenuItemText(e,i){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":G(this,Jl,Cm).call(this,e);break;case"invoke":G(this,ed,Lm).call(this,e);break;case"click":G(this,ad,xm).call(this,e);break;case"toggle":G(this,rd,Om).call(this,e);break;case"focusout":G(this,od,Pm).call(this,e);break;case"keydown":G(this,nd,Um).call(this,e);break}}connectedCallback(){var e,i;rt(this,Wr,Ya(this.shadowRoot,":host")),G(this,Zn,jl).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),rt(this,ot,fo(this)),(i=(e=B(this,ot))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(ht(Vr(this),B(this,la)),ht(this,B(this,da))),G(this,zn,ud).call(this)}disconnectedCallback(){var e,i;pt(Vr(this),B(this,la)),pt(this,B(this,da)),this.disable(),(i=(e=B(this,ot))==null?void 0:e.unassociateElement)==null||i.call(e,this),rt(this,ot,null)}attributeChangedCallback(e,i,a){var r,o,s,d;e===gi.HIDDEN&&a!==i?(B(this,Ai)||rt(this,Ai,!0),this.hidden?G(this,id,Rm).call(this):G(this,td,wm).call(this),this.dispatchEvent(new Gn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===x.MEDIA_CONTROLLER?(i&&((o=(r=B(this,ot))==null?void 0:r.unassociateElement)==null||o.call(r,this),rt(this,ot,null)),a&&this.isConnected&&(rt(this,ot,fo(this)),(d=(s=B(this,ot))==null?void 0:s.associateElement)==null||d.call(s,this))):e===gi.DISABLED&&a!==i?a==null?this.enable():this.disable():e===gi.STYLE&&a!==i&&G(this,Zn,jl).call(this)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=qt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter($v)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,i;return(i=(e=this.checkedItems[0])==null?void 0:e.value)!=null?i:""}set value(e){let i=this.items.find(a=>a.value===e);i&&G(this,Qn,ld).call(this,i)}focus(){if(rt(this,_i,Ga()),this.items.length){G(this,$r,es).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var i;let a=G(this,Br,jn).call(this,e);a&&(G(this,Qn,ld).call(this,a,a.type==="checkbox"),B(this,$t)&&!this.hidden&&((i=B(this,_i))==null||i.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var i,a;let{key:r}=e,o=this.items,s=(a=(i=G(this,Br,jn).call(this,e))!=null?i:G(this,sd,Hm).call(this))!=null?a:o[0],d=o.indexOf(s),u=Math.max(0,d);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=o.length-1),u<0&&(u=o.length-1),u>o.length-1&&(u=0),G(this,$r,es).call(this,o[u]),o[u].focus()}};ot=new WeakMap;_i=new WeakMap;$t=new WeakMap;Yn=new WeakMap;qn=new WeakMap;Ai=new WeakMap;Wr=new WeakMap;Jl=new WeakSet;Cm=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:!0}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();["header","title"].includes(e.name)&&G(this,zn,ud).call(this),e.name||B(this,Xn).call(this)};zn=new WeakSet;ud=function(){let t=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');t.hidden=e.assignedNodes().length===0&&t.assignedNodes().length===0};Xn=new WeakMap;Zn=new WeakSet;jl=function(){var t;let e=this.shadowRoot.querySelector("#layout-row"),i=(t=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:t.trim();e.setAttribute("media",i==="row"?"":"width:0")};ed=new WeakSet;Lm=function(t){rt(this,$t,t.relatedTarget),ue(this,t.relatedTarget)||(this.hidden=!this.hidden)};td=new WeakSet;wm=function(){var t;(t=B(this,$t))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),ht(Vr(this),B(this,la)),ht(this,B(this,da))};id=new WeakSet;Rm=function(){var t;(t=B(this,$t))==null||t.setAttribute("aria-expanded","false"),pt(Vr(this),B(this,la)),pt(this,B(this,da))};la=new WeakMap;da=new WeakMap;ua=new WeakSet;Fr=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=Im({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=Vr(this).getBoundingClientRect(),o=r.width-e-t,s=r.height-i-this.offsetHeight,{style:d}=B(this,Wr);d.setProperty("position","absolute"),d.setProperty("right",`${Math.max(0,o)}px`),d.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),T=d.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),_=r.height-T-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${_}px`)};Jn=new WeakSet;cd=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=B(this,Wr);if(t||a.setProperty("--media-menu-transition-in","none"),i){let r=i.offsetHeight,o=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${r}px`),G(this,ua,Fr).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,ua,Fr).call(this);a.removeProperty("--media-menu-transition-in")};ad=new WeakSet;xm=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(B(this,md,Dm))){(e=B(this,_i))==null||e.focus(),this.hidden=!0;return}let i=G(this,Br,jn).call(this,t);!i||i.hasAttribute("disabled")||(G(this,$r,es).call(this,i),this.handleSelect(t))};md=new WeakSet;Dm=function(){var t;return(t=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:t.find(i=>i.matches('button[part~="back"]'))};rd=new WeakSet;Om=function(t){if(t.target===this)return;G(this,hd,Nm).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let i of e)i.invokeTargetElement!=t.target&&t.newState=="open"&&i.getAttribute("aria-expanded")=="true"&&!i.invokeTargetElement.hidden&&i.invokeTargetElement.dispatchEvent(new Bt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);G(this,Jn,cd).call(this,!0)};hd=new WeakSet;Nm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};od=new WeakSet;Pm=function(t){var e;ue(this,t.relatedTarget)||(B(this,Ai)&&((e=B(this,_i))==null||e.focus()),B(this,$t)&&B(this,$t)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};nd=new WeakSet;Um=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:p}=t;if(!(d||u||p)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if(B(this,Ai)){this.hidden=!0;return}t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else s==="Escape"?((o=B(this,_i))==null||o.focus(),B(this,Ai)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};Br=new WeakSet;jn=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};sd=new WeakSet;Hm=function(){return this.items.find(t=>t.tabIndex===0)};$r=new WeakSet;es=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};Qn=new WeakSet;ld=function(t,e){let i=[...this.checkedItems];t.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?t.checked=!t.checked:t.checked=!0,this.checkedItems.some((a,r)=>a!=i[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};j.shadowRootOptions={mode:"open"};j.getTemplateHTML=Bv;function $v(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function Vr(t){var e;return(e=t.getAttribute("bounds")?Ve(t,`#${t.getAttribute("bounds")}`):Y(t)||t.parentElement)!=null?e:t}l.customElements.get("media-chrome-menu")||l.customElements.define("media-chrome-menu",j);var gd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},st=(t,e,i)=>(gd(t,e,"read from private field"),i?i.call(t):e.get(t)),Tt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},pd=(t,e,i,a)=>(gd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Fe=(t,e,i)=>(gd(t,e,"access private method"),i),ts,Gr,fd,Bm,as,_d,Ad,$m,lt,ca,Yr,vd,Wm,is,Ed;function Wv(t){return`
2961
2962
  <style>
2962
2963
  :host {
2963
2964
  transition: var(--media-menu-item-transition,
@@ -3075,7 +3076,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3075
3076
  ${this.getSuffixSlotInnerHTML(t)}
3076
3077
  </slot>
3077
3078
  <slot name="submenu"></slot>
3078
- `}function Fv(t){return""}var xe={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Ce=class extends l.HTMLElement{constructor(){if(super(),Tt(this,pd),Tt(this,is),Tt(this,_d),Tt(this,ca),Tt(this,fd),Tt(this,ts),Tt(this,es,!1),Tt(this,Kr,void 0),Tt(this,lt,()=>{var e,i;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let a=this.shadowRoot.querySelector('slot[name="description"]'),r=(e=this.submenuElement.checkedItems)==null?void 0:e[0],o=(i=r==null?void 0:r.dataset.description)!=null?i:r==null?void 0:r.text,s=V.createElement("span");s.textContent=o!=null?o:"",a.replaceChildren(s)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[xe.TYPE,xe.DISABLED,xe.CHECKED,xe.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Vr(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":Fe(this,pd,Bm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":Fe(this,fd,Wm).call(this,e);break;case"keyup":Fe(this,ca,Gr).call(this,e);break}}attributeChangedCallback(e,i,a){e===xe.CHECKED&&Vr(this)&&!st(this,es)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===xe.TYPE&&a!==i?this.role="menuitem"+a:e===xe.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(xe.DISABLED)||this.enable(),this.role="menuitem"+this.type,hd(this,Kr,Ed(this,this.parentNode)),Fe(this,ts,vd).call(this),this.submenuElement&&Fe(this,is,gd).call(this)}disconnectedCallback(){this.disable(),Fe(this,ts,vd).call(this),hd(this,Kr,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=qt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(xe.TYPE))!=null?e:""}set type(e){this.setAttribute(xe.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(xe.VALUE))!=null?e:this.text}set value(e){this.setAttribute(xe.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Vr(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Vr(this)&&(hd(this,es,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Vr(this)||this.invokeTargetElement&&ue(this,e.target)&&this.invokeTargetElement.dispatchEvent(new Bt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};es=new WeakMap;Kr=new WeakMap;pd=new WeakSet;Bm=function(t){let e=t.target;if(!(e!=null&&e.name))for(let a of e.assignedNodes({flatten:!0}))a instanceof Text&&a.textContent.trim()===""&&a.remove();e.name==="submenu"&&(this.submenuElement?Fe(this,is,gd).call(this):Fe(this,_d,$m).call(this))};is=new WeakSet;gd=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",st(this,lt)),this.submenuElement.addEventListener("addmenuitem",st(this,lt)),this.submenuElement.addEventListener("removemenuitem",st(this,lt)),st(this,lt).call(this)};_d=new WeakSet;$m=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",st(this,lt)),this.submenuElement.removeEventListener("addmenuitem",st(this,lt)),this.submenuElement.removeEventListener("removemenuitem",st(this,lt)),st(this,lt).call(this)};lt=new WeakMap;ca=new WeakSet;Gr=function(t){let{key:e}=t;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",Fe(this,ca,Gr));return}this.handleClick(t)};fd=new WeakSet;Wm=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!this.keysUsed.includes(a)){this.removeEventListener("keyup",Fe(this,ca,Gr));return}this.addEventListener("keyup",Fe(this,ca,Gr),{once:!0})};ts=new WeakSet;vd=function(){var t;let e=(t=st(this,Kr))==null?void 0:t.radioGroupItems;if(!e)return;let i=e.filter(a=>a.getAttribute("aria-checked")==="true").pop();i||(i=e[0]);for(let a of e)a.setAttribute("aria-checked","false");i==null||i.setAttribute("aria-checked","true")};Ce.shadowRootOptions={mode:"open"};Ce.getTemplateHTML=Wv;Ce.getSuffixSlotInnerHTML=Fv;function Vr(t){return t.type==="radio"||t.type==="checkbox"}function Ed(t,e){if(!t)return null;let{host:i}=t.getRootNode();return!e&&i?Ed(t,i):e!=null&&e.items?e:Ed(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-menu-item")||l.customElements.define("media-chrome-menu-item",Ce);function Vv(t){return`
3079
+ `}function Fv(t){return""}var xe={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Ce=class extends l.HTMLElement{constructor(){if(super(),Tt(this,fd),Tt(this,as),Tt(this,Ad),Tt(this,ca),Tt(this,vd),Tt(this,is),Tt(this,ts,!1),Tt(this,Gr,void 0),Tt(this,lt,()=>{var e,i;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let a=this.shadowRoot.querySelector('slot[name="description"]'),r=(e=this.submenuElement.checkedItems)==null?void 0:e[0],o=(i=r==null?void 0:r.dataset.description)!=null?i:r==null?void 0:r.text,s=V.createElement("span");s.textContent=o!=null?o:"",a.replaceChildren(s)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[xe.TYPE,xe.DISABLED,xe.CHECKED,xe.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Kr(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":Fe(this,fd,Bm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":Fe(this,vd,Wm).call(this,e);break;case"keyup":Fe(this,ca,Yr).call(this,e);break}}attributeChangedCallback(e,i,a){e===xe.CHECKED&&Kr(this)&&!st(this,ts)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===xe.TYPE&&a!==i?this.role="menuitem"+a:e===xe.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(xe.DISABLED)||this.enable(),this.role="menuitem"+this.type,pd(this,Gr,bd(this,this.parentNode)),Fe(this,is,Ed).call(this),this.submenuElement&&Fe(this,as,_d).call(this)}disconnectedCallback(){this.disable(),Fe(this,is,Ed).call(this),pd(this,Gr,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=qt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(xe.TYPE))!=null?e:""}set type(e){this.setAttribute(xe.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(xe.VALUE))!=null?e:this.text}set value(e){this.setAttribute(xe.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Kr(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Kr(this)&&(pd(this,ts,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Kr(this)||this.invokeTargetElement&&ue(this,e.target)&&this.invokeTargetElement.dispatchEvent(new Bt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};ts=new WeakMap;Gr=new WeakMap;fd=new WeakSet;Bm=function(t){let e=t.target;if(!(e!=null&&e.name))for(let a of e.assignedNodes({flatten:!0}))a instanceof Text&&a.textContent.trim()===""&&a.remove();e.name==="submenu"&&(this.submenuElement?Fe(this,as,_d).call(this):Fe(this,Ad,$m).call(this))};as=new WeakSet;_d=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",st(this,lt)),this.submenuElement.addEventListener("addmenuitem",st(this,lt)),this.submenuElement.addEventListener("removemenuitem",st(this,lt)),st(this,lt).call(this)};Ad=new WeakSet;$m=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",st(this,lt)),this.submenuElement.removeEventListener("addmenuitem",st(this,lt)),this.submenuElement.removeEventListener("removemenuitem",st(this,lt)),st(this,lt).call(this)};lt=new WeakMap;ca=new WeakSet;Yr=function(t){let{key:e}=t;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",Fe(this,ca,Yr));return}this.handleClick(t)};vd=new WeakSet;Wm=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!this.keysUsed.includes(a)){this.removeEventListener("keyup",Fe(this,ca,Yr));return}this.addEventListener("keyup",Fe(this,ca,Yr),{once:!0})};is=new WeakSet;Ed=function(){var t;let e=(t=st(this,Gr))==null?void 0:t.radioGroupItems;if(!e)return;let i=e.filter(a=>a.getAttribute("aria-checked")==="true").pop();i||(i=e[0]);for(let a of e)a.setAttribute("aria-checked","false");i==null||i.setAttribute("aria-checked","true")};Ce.shadowRootOptions={mode:"open"};Ce.getTemplateHTML=Wv;Ce.getSuffixSlotInnerHTML=Fv;function Kr(t){return t.type==="radio"||t.type==="checkbox"}function bd(t,e){if(!t)return null;let{host:i}=t.getRootNode();return!e&&i?bd(t,i):e!=null&&e.items?e:bd(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-menu-item")||l.customElements.define("media-chrome-menu-item",Ce);function Vv(t){return`
3079
3080
  ${j.getTemplateHTML(t)}
3080
3081
  <style>
3081
3082
  :host {
@@ -3110,7 +3111,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3110
3111
  --media-settings-menu-item-opacity: 0;
3111
3112
  }
3112
3113
  </style>
3113
- `}var Yr=class extends j{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-settings-menu-button")}};Yr.getTemplateHTML=Vv;l.customElements.get("media-settings-menu")||l.customElements.define("media-settings-menu",Yr);function Kv(t){return`
3114
+ `}var qr=class extends j{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-settings-menu-button")}};qr.getTemplateHTML=Vv;l.customElements.get("media-settings-menu")||l.customElements.define("media-settings-menu",qr);function Kv(t){return`
3114
3115
  ${Ce.getTemplateHTML.call(this,t)}
3115
3116
  <style>
3116
3117
  slot:not([name="submenu"]) {
@@ -3136,7 +3137,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3136
3137
  <path d="M4.5 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"/>
3137
3138
  </svg>
3138
3139
  </slot>
3139
- `}function qv(){return h("Settings")}var ma=class extends _e{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-settings-menu")}};ma.getSlotTemplateHTML=Yv;ma.getTooltipContentHTML=qv;l.customElements.get("media-settings-menu-button")||l.customElements.define("media-settings-menu-button",ma);var kd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Fm=(t,e,i)=>(kd(t,e,"read from private field"),i?i.call(t):e.get(t)),as=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ad=(t,e,i,a)=>(kd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),rs=(t,e,i)=>(kd(t,e,"access private method"),i),qr,ss,os,Td,ns,yd,ls=class extends j{constructor(){super(...arguments),as(this,os),as(this,ns),as(this,qr,[]),as(this,ss,void 0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_LIST,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_AUDIO_TRACK_ENABLED&&i!==a?this.value=a:e===n.MEDIA_AUDIO_TRACK_LIST&&i!==a&&(Ad(this,qr,fu(a!=null?a:"")),rs(this,os,Td).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",rs(this,ns,yd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",rs(this,ns,yd))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=Y(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Fm(this,qr)}set mediaAudioTrackList(e){Ad(this,qr,e),rs(this,os,Td).call(this)}get mediaAudioTrackEnabled(){var e;return(e=w(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){R(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};qr=new WeakMap;ss=new WeakMap;os=new WeakSet;Td=function(){if(Fm(this,ss)===JSON.stringify(this.mediaAudioTrackList))return;Ad(this,ss,JSON.stringify(this.mediaAudioTrackList));let t=this.mediaAudioTrackList;this.defaultSlot.textContent="",t.sort((e,i)=>e.id.localeCompare(i.id,void 0,{numeric:!0}));for(let e of t){let i=this.formatMenuItemText(e.label,e),a=nt({type:"radio",text:i,value:`${e.id}`,checked:e.enabled});a.prepend(We(this,"checked-indicator")),this.defaultSlot.append(a)}};ns=new WeakSet;yd=function(){if(this.value==null)return;let t=new l.CustomEvent(m.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};l.customElements.get("media-audio-track-menu")||l.customElements.define("media-audio-track-menu",ls);var Zv=`<svg aria-hidden="true" viewBox="0 0 24 24">
3140
+ `}function qv(){return h("Settings")}var ma=class extends _e{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-settings-menu")}};ma.getSlotTemplateHTML=Yv;ma.getTooltipContentHTML=qv;l.customElements.get("media-settings-menu-button")||l.customElements.define("media-settings-menu-button",ma);var Sd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Fm=(t,e,i)=>(Sd(t,e,"read from private field"),i?i.call(t):e.get(t)),rs=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Td=(t,e,i,a)=>(Sd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),os=(t,e,i)=>(Sd(t,e,"access private method"),i),Zr,ls,ns,yd,ss,kd,ds=class extends j{constructor(){super(...arguments),rs(this,ns),rs(this,ss),rs(this,Zr,[]),rs(this,ls,void 0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_LIST,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_AUDIO_TRACK_ENABLED&&i!==a?this.value=a:e===n.MEDIA_AUDIO_TRACK_LIST&&i!==a&&(Td(this,Zr,fu(a!=null?a:"")),os(this,ns,yd).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",os(this,ss,kd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",os(this,ss,kd))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=Y(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Fm(this,Zr)}set mediaAudioTrackList(e){Td(this,Zr,e),os(this,ns,yd).call(this)}get mediaAudioTrackEnabled(){var e;return(e=w(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){R(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};Zr=new WeakMap;ls=new WeakMap;ns=new WeakSet;yd=function(){if(Fm(this,ls)===JSON.stringify(this.mediaAudioTrackList))return;Td(this,ls,JSON.stringify(this.mediaAudioTrackList));let t=this.mediaAudioTrackList;this.defaultSlot.textContent="",t.sort((e,i)=>e.id.localeCompare(i.id,void 0,{numeric:!0}));for(let e of t){let i=this.formatMenuItemText(e.label,e),a=nt({type:"radio",text:i,value:`${e.id}`,checked:e.enabled});a.prepend(We(this,"checked-indicator")),this.defaultSlot.append(a)}};ss=new WeakSet;kd=function(){if(this.value==null)return;let t=new l.CustomEvent(m.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};l.customElements.get("media-audio-track-menu")||l.customElements.define("media-audio-track-menu",ds);var Zv=`<svg aria-hidden="true" viewBox="0 0 24 24">
3140
3141
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
3141
3142
  <path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>
3142
3143
  </svg>`;function Qv(){return`
@@ -3146,13 +3147,13 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3146
3147
  }
3147
3148
  </style>
3148
3149
  <slot name="icon">${Zv}</slot>
3149
- `}function zv(){return h("Audio")}var Vm=t=>{let e=h("Audio");t.setAttribute("aria-label",e)},ha=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Vm(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LANG&&Vm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Y(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=w(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){R(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};ha.getSlotTemplateHTML=Qv;ha.getTooltipContentHTML=zv;l.customElements.get("media-audio-track-menu-button")||l.customElements.define("media-audio-track-menu-button",ha);var Cd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Xv=(t,e,i)=>(Cd(t,e,"read from private field"),i?i.call(t):e.get(t)),Sd=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Jv=(t,e,i,a)=>(Cd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ds=(t,e,i)=>(Cd(t,e,"access private method"),i),ms,us,Id,cs,Md,jv=`
3150
+ `}function zv(){return h("Audio")}var Vm=t=>{let e=h("Audio");t.setAttribute("aria-label",e)},ha=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Vm(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LANG&&Vm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Y(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=w(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){R(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};ha.getSlotTemplateHTML=Qv;ha.getTooltipContentHTML=zv;l.customElements.get("media-audio-track-menu-button")||l.customElements.define("media-audio-track-menu-button",ha);var Ld=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Xv=(t,e,i)=>(Ld(t,e,"read from private field"),i?i.call(t):e.get(t)),Id=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Jv=(t,e,i,a)=>(Ld(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),us=(t,e,i)=>(Ld(t,e,"access private method"),i),hs,cs,Md,ms,Cd,jv=`
3150
3151
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
3151
3152
  <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"/>
3152
3153
  </svg>`;function eE(t){return`
3153
3154
  ${j.getTemplateHTML(t)}
3154
3155
  <slot name="captions-indicator" hidden>${jv}</slot>
3155
- `}var Zr=class extends j{constructor(){super(...arguments),Sd(this,us),Sd(this,cs),Sd(this,ms,void 0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_LIST&&i!==a?ds(this,us,Id).call(this):e===n.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a||"",ds(this,us,Id).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ds(this,cs,Md))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ds(this,cs,Md))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Km(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Gm(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Km(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Gm(this,n.MEDIA_SUBTITLES_SHOWING,e)}};ms=new WeakMap;us=new WeakSet;Id=function(){var t;let e=Xv(this,ms)!==JSON.stringify(this.mediaSubtitlesList),i=this.value!==this.getAttribute(n.MEDIA_SUBTITLES_SHOWING);if(!e&&!i)return;Jv(this,ms,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let a=!this.value,r=nt({type:"radio",text:this.formatMenuItemText(h("Off")),value:"off",checked:a});r.prepend(We(this,"checked-indicator")),this.defaultSlot.append(r);let o=this.mediaSubtitlesList;for(let s of o){let d=nt({type:"radio",text:this.formatMenuItemText(s.label,s),value:Mo(s),checked:this.value==Mo(s)});d.prepend(We(this,"checked-indicator")),((t=s.kind)!=null?t:"subs")==="captions"&&d.append(We(this,"captions-indicator")),this.defaultSlot.append(d)}};cs=new WeakSet;Md=function(){let t=this.mediaSubtitlesShowing,e=this.getAttribute(n.MEDIA_SUBTITLES_SHOWING),i=this.value!==e;if(t!=null&&t.length&&i&&this.dispatchEvent(new l.CustomEvent(m.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t})),!this.value||!i)return;let a=new l.CustomEvent(m.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};Zr.getTemplateHTML=eE;var Km=(t,e)=>{let i=t.getAttribute(e);return i?Xt(i):[]},Gm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=vt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-menu")||l.customElements.define("media-captions-menu",Zr);var tE=`<svg aria-hidden="true" viewBox="0 0 26 24">
3156
+ `}var Qr=class extends j{constructor(){super(...arguments),Id(this,cs),Id(this,ms),Id(this,hs,void 0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_LIST&&i!==a?us(this,cs,Md).call(this):e===n.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a||"",us(this,cs,Md).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",us(this,ms,Cd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",us(this,ms,Cd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Km(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Gm(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Km(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Gm(this,n.MEDIA_SUBTITLES_SHOWING,e)}};hs=new WeakMap;cs=new WeakSet;Md=function(){var t;let e=Xv(this,hs)!==JSON.stringify(this.mediaSubtitlesList),i=this.value!==this.getAttribute(n.MEDIA_SUBTITLES_SHOWING);if(!e&&!i)return;Jv(this,hs,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let a=!this.value,r=nt({type:"radio",text:this.formatMenuItemText(h("Off")),value:"off",checked:a});r.prepend(We(this,"checked-indicator")),this.defaultSlot.append(r);let o=this.mediaSubtitlesList;for(let s of o){let d=nt({type:"radio",text:this.formatMenuItemText(s.label,s),value:Co(s),checked:this.value==Co(s)});d.prepend(We(this,"checked-indicator")),((t=s.kind)!=null?t:"subs")==="captions"&&d.append(We(this,"captions-indicator")),this.defaultSlot.append(d)}};ms=new WeakSet;Cd=function(){let t=this.mediaSubtitlesShowing,e=this.getAttribute(n.MEDIA_SUBTITLES_SHOWING),i=this.value!==e;if(t!=null&&t.length&&i&&this.dispatchEvent(new l.CustomEvent(m.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t})),!this.value||!i)return;let a=new l.CustomEvent(m.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};Qr.getTemplateHTML=eE;var Km=(t,e)=>{let i=t.getAttribute(e);return i?Xt(i):[]},Gm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=vt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-menu")||l.customElements.define("media-captions-menu",Qr);var tE=`<svg aria-hidden="true" viewBox="0 0 26 24">
3156
3157
  <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"/>
3157
3158
  </svg>`,iE=`<svg aria-hidden="true" viewBox="0 0 26 24">
3158
3159
  <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"/>
@@ -3176,7 +3177,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3176
3177
  <slot name="on">${tE}</slot>
3177
3178
  <slot name="off">${iE}</slot>
3178
3179
  </slot>
3179
- `}function rE(){return h("Captions")}var Ym=t=>{t.setAttribute("data-captions-enabled",Co(t).toString())},qm=t=>{t.setAttribute("aria-label",h("closed captions"))},pa=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING,n.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),qm(this),Ym(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING?Ym(this):e===n.MEDIA_LANG&&qm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Y(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Zm(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Qm(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Zm(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Qm(this,n.MEDIA_SUBTITLES_SHOWING,e)}};pa.getSlotTemplateHTML=aE;pa.getTooltipContentHTML=rE;var Zm=(t,e)=>{let i=t.getAttribute(e);return i?Xt(i):[]},Qm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=vt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-menu-button")||l.customElements.define("media-captions-menu-button",pa);var zm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},va=(t,e,i)=>(zm(t,e,"read from private field"),i?i.call(t):e.get(t)),Ld=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},fa=(t,e,i)=>(zm(t,e,"access private method"),i),Wt,Ea,Qr,hs,Rd,wd={RATES:"rates"},ps=class extends j{constructor(){super(),Ld(this,Ea),Ld(this,hs),Ld(this,Wt,new Ct(this,wd.RATES,{defaultValue:gl})),fa(this,Ea,Qr).call(this)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,wd.RATES]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PLAYBACK_RATE&&i!=a?(this.value=a,fa(this,Ea,Qr).call(this)):e===wd.RATES&&i!=a&&(va(this,Wt).value=a,fa(this,Ea,Qr).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",fa(this,hs,Rd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",fa(this,hs,Rd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-playback-rate-menu-button")}get rates(){return va(this,Wt)}set rates(e){e?Array.isArray(e)?va(this,Wt).value=e.join(" "):typeof e=="string"&&(va(this,Wt).value=e):va(this,Wt).value="",fa(this,Ea,Qr).call(this)}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,ni)}set mediaPlaybackRate(e){N(this,n.MEDIA_PLAYBACK_RATE,e)}};Wt=new WeakMap;Ea=new WeakSet;Qr=function(){this.defaultSlot.textContent="";let t=this.mediaPlaybackRate,e=new Set(Array.from(va(this,Wt)).map(a=>Number(a)));t>0&&!e.has(t)&&e.add(t);let i=Array.from(e).sort((a,r)=>a-r);for(let a of i){let r=nt({type:"radio",text:this.formatMenuItemText(`${a}x`,a),value:a.toString(),checked:t===a});r.prepend(We(this,"checked-indicator")),this.defaultSlot.append(r)}};hs=new WeakSet;Rd=function(){if(!this.value)return;let t=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};l.customElements.get("media-playback-rate-menu")||l.customElements.define("media-playback-rate-menu",ps);var fs=1;function oE(t){return`
3180
+ `}function rE(){return h("Captions")}var Ym=t=>{t.setAttribute("data-captions-enabled",Lo(t).toString())},qm=t=>{t.setAttribute("aria-label",h("closed captions"))},pa=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING,n.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),qm(this),Ym(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING?Ym(this):e===n.MEDIA_LANG&&qm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Y(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Zm(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Qm(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Zm(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Qm(this,n.MEDIA_SUBTITLES_SHOWING,e)}};pa.getSlotTemplateHTML=aE;pa.getTooltipContentHTML=rE;var Zm=(t,e)=>{let i=t.getAttribute(e);return i?Xt(i):[]},Qm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=vt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-menu-button")||l.customElements.define("media-captions-menu-button",pa);var zm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},va=(t,e,i)=>(zm(t,e,"read from private field"),i?i.call(t):e.get(t)),wd=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},fa=(t,e,i)=>(zm(t,e,"access private method"),i),Wt,Ea,zr,ps,xd,Rd={RATES:"rates"},fs=class extends j{constructor(){super(),wd(this,Ea),wd(this,ps),wd(this,Wt,new Ct(this,Rd.RATES,{defaultValue:_l})),fa(this,Ea,zr).call(this)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,Rd.RATES]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PLAYBACK_RATE&&i!=a?(this.value=a,fa(this,Ea,zr).call(this)):e===Rd.RATES&&i!=a&&(va(this,Wt).value=a,fa(this,Ea,zr).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",fa(this,ps,xd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",fa(this,ps,xd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-playback-rate-menu-button")}get rates(){return va(this,Wt)}set rates(e){e?Array.isArray(e)?va(this,Wt).value=e.join(" "):typeof e=="string"&&(va(this,Wt).value=e):va(this,Wt).value="",fa(this,Ea,zr).call(this)}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,ni)}set mediaPlaybackRate(e){P(this,n.MEDIA_PLAYBACK_RATE,e)}};Wt=new WeakMap;Ea=new WeakSet;zr=function(){this.defaultSlot.textContent="";let t=this.mediaPlaybackRate,e=new Set(Array.from(va(this,Wt)).map(a=>Number(a)));t>0&&!e.has(t)&&e.add(t);let i=Array.from(e).sort((a,r)=>a-r);for(let a of i){let r=nt({type:"radio",text:this.formatMenuItemText(`${a}x`,a),value:a.toString(),checked:t===a});r.prepend(We(this,"checked-indicator")),this.defaultSlot.append(r)}};ps=new WeakSet;xd=function(){if(!this.value)return;let t=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};l.customElements.get("media-playback-rate-menu")||l.customElements.define("media-playback-rate-menu",fs);var vs=1;function oE(t){return`
3180
3181
  <style>
3181
3182
  :host {
3182
3183
  min-width: 5ch;
@@ -3187,8 +3188,8 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3187
3188
  display: none;
3188
3189
  }
3189
3190
  </style>
3190
- <slot name="icon">${t.mediaplaybackrate||fs}x</slot>
3191
- `}function nE(){return h("Playback rate")}var ba=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:fs}x`}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===n.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,o=Number.isNaN(r)?fs:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",h("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,fs)}set mediaPlaybackRate(e){N(this,n.MEDIA_PLAYBACK_RATE,e)}};ba.getSlotTemplateHTML=oE;ba.getTooltipContentHTML=nE;l.customElements.get("media-playback-rate-menu-button")||l.customElements.define("media-playback-rate-menu-button",ba);var Dd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},zr=(t,e,i)=>(Dd(t,e,"read from private field"),i?i.call(t):e.get(t)),vs=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Xm=(t,e,i,a)=>(Dd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ga=(t,e,i)=>(Dd(t,e,"access private method"),i),Xr,Aa,_a,Jr,Es,xd,bs=class extends j{constructor(){super(...arguments),vs(this,_a),vs(this,Es),vs(this,Xr,[]),vs(this,Aa,{})}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_LIST,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}static formatMenuItemText(e,i){return super.formatMenuItemText(e,i)}static formatRendition(e,{showBitrate:i=!1}={}){let a=`${Math.min(e.width,e.height)}p`;if(i&&e.bitrate){let r=e.bitrate/1e6,o=`${r.toFixed(r<1?1:0)} Mbps`;return`${a} (${o})`}return this.formatMenuItemText(a,e)}static compareRendition(e,i){var a,r;return i.height===e.height?((a=i.bitrate)!=null?a:0)-((r=e.bitrate)!=null?r:0):i.height-e.height}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_RENDITION_SELECTED&&i!==a?(this.value=a!=null?a:"auto",ga(this,_a,Jr).call(this)):e===n.MEDIA_RENDITION_LIST&&i!==a?(Xm(this,Xr,hu(a)),ga(this,_a,Jr).call(this)):e===n.MEDIA_HEIGHT&&i!==a&&ga(this,_a,Jr).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ga(this,Es,xd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ga(this,Es,xd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return zr(this,Xr)}set mediaRenditionList(e){Xm(this,Xr,e),ga(this,_a,Jr).call(this)}get mediaRenditionSelected(){return w(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){R(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return O(this,n.MEDIA_HEIGHT)}set mediaHeight(e){N(this,n.MEDIA_HEIGHT,e)}compareRendition(e,i){return this.constructor.compareRendition(e,i)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}formatRendition(e,i){return this.constructor.formatRendition(e,i)}showRenditionBitrate(e){return this.mediaRenditionList.some(i=>i!==e&&i.height===e.height&&i.bitrate!==e.bitrate)}};Xr=new WeakMap;Aa=new WeakMap;_a=new WeakSet;Jr=function(){if(zr(this,Aa).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&zr(this,Aa).mediaHeight===this.mediaHeight)return;zr(this,Aa).mediaRenditionList=JSON.stringify(this.mediaRenditionList),zr(this,Aa).mediaHeight=this.mediaHeight;let t=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=t.find(s=>s.id===this.mediaRenditionSelected);for(let s of t)s.selected=s===e;this.defaultSlot.textContent="";let i=!this.mediaRenditionSelected;for(let s of t){let d=this.formatRendition(s,{showBitrate:this.showRenditionBitrate(s)}),u=nt({type:"radio",text:d,value:`${s.id}`,checked:s.selected&&!i});u.prepend(We(this,"checked-indicator")),this.defaultSlot.append(u)}let a=e&&this.showRenditionBitrate(e),r=i?e?this.formatMenuItemText(`${h("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:a})}`,e):this.formatMenuItemText(`${h("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(h("Auto")),o=nt({type:"radio",text:r,value:"auto",checked:i});o.dataset.description=r,o.prepend(We(this,"checked-indicator")),this.defaultSlot.append(o)};Es=new WeakSet;xd=function(){if(this.value==null)return;let t=new l.CustomEvent(m.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};l.customElements.get("media-rendition-menu")||l.customElements.define("media-rendition-menu",bs);var sE=`<svg aria-hidden="true" viewBox="0 0 24 24">
3191
+ <slot name="icon">${t.mediaplaybackrate||vs}x</slot>
3192
+ `}function nE(){return h("Playback rate")}var ba=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:vs}x`}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===n.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,o=Number.isNaN(r)?vs:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",h("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,vs)}set mediaPlaybackRate(e){P(this,n.MEDIA_PLAYBACK_RATE,e)}};ba.getSlotTemplateHTML=oE;ba.getTooltipContentHTML=nE;l.customElements.get("media-playback-rate-menu-button")||l.customElements.define("media-playback-rate-menu-button",ba);var Od=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Xr=(t,e,i)=>(Od(t,e,"read from private field"),i?i.call(t):e.get(t)),Es=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Xm=(t,e,i,a)=>(Od(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ga=(t,e,i)=>(Od(t,e,"access private method"),i),Jr,Aa,_a,jr,bs,Dd,gs=class extends j{constructor(){super(...arguments),Es(this,_a),Es(this,bs),Es(this,Jr,[]),Es(this,Aa,{})}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_LIST,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}static formatMenuItemText(e,i){return super.formatMenuItemText(e,i)}static formatRendition(e,{showBitrate:i=!1}={}){let a=`${Math.min(e.width,e.height)}p`;if(i&&e.bitrate){let r=e.bitrate/1e6,o=`${r.toFixed(r<1?1:0)} Mbps`;return`${a} (${o})`}return this.formatMenuItemText(a,e)}static compareRendition(e,i){var a,r;return i.height===e.height?((a=i.bitrate)!=null?a:0)-((r=e.bitrate)!=null?r:0):i.height-e.height}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_RENDITION_SELECTED&&i!==a?(this.value=a!=null?a:"auto",ga(this,_a,jr).call(this)):e===n.MEDIA_RENDITION_LIST&&i!==a?(Xm(this,Jr,hu(a)),ga(this,_a,jr).call(this)):e===n.MEDIA_HEIGHT&&i!==a&&ga(this,_a,jr).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ga(this,bs,Dd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ga(this,bs,Dd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return Xr(this,Jr)}set mediaRenditionList(e){Xm(this,Jr,e),ga(this,_a,jr).call(this)}get mediaRenditionSelected(){return w(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){R(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return O(this,n.MEDIA_HEIGHT)}set mediaHeight(e){P(this,n.MEDIA_HEIGHT,e)}compareRendition(e,i){return this.constructor.compareRendition(e,i)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}formatRendition(e,i){return this.constructor.formatRendition(e,i)}showRenditionBitrate(e){return this.mediaRenditionList.some(i=>i!==e&&i.height===e.height&&i.bitrate!==e.bitrate)}};Jr=new WeakMap;Aa=new WeakMap;_a=new WeakSet;jr=function(){if(Xr(this,Aa).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&Xr(this,Aa).mediaHeight===this.mediaHeight)return;Xr(this,Aa).mediaRenditionList=JSON.stringify(this.mediaRenditionList),Xr(this,Aa).mediaHeight=this.mediaHeight;let t=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=t.find(s=>s.id===this.mediaRenditionSelected);for(let s of t)s.selected=s===e;this.defaultSlot.textContent="";let i=!this.mediaRenditionSelected;for(let s of t){let d=this.formatRendition(s,{showBitrate:this.showRenditionBitrate(s)}),u=nt({type:"radio",text:d,value:`${s.id}`,checked:s.selected&&!i});u.prepend(We(this,"checked-indicator")),this.defaultSlot.append(u)}let a=e&&this.showRenditionBitrate(e),r=i?e?this.formatMenuItemText(`${h("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:a})}`,e):this.formatMenuItemText(`${h("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(h("Auto")),o=nt({type:"radio",text:r,value:"auto",checked:i});o.dataset.description=r,o.prepend(We(this,"checked-indicator")),this.defaultSlot.append(o)};bs=new WeakSet;Dd=function(){if(this.value==null)return;let t=new l.CustomEvent(m.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};l.customElements.get("media-rendition-menu")||l.customElements.define("media-rendition-menu",gs);var sE=`<svg aria-hidden="true" viewBox="0 0 24 24">
3192
3193
  <path d="M13.5 2.5h2v6h-2v-2h-11v-2h11v-2Zm4 2h4v2h-4v-2Zm-12 4h2v6h-2v-2h-3v-2h3v-2Zm4 2h12v2h-12v-2Zm1 4h2v6h-2v-2h-8v-2h8v-2Zm4 2h7v2h-7v-2Z" />
3193
3194
  </svg>`;function lE(){return`
3194
3195
  <style>
@@ -3197,7 +3198,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3197
3198
  }
3198
3199
  </style>
3199
3200
  <slot name="icon">${sE}</slot>
3200
- `}function dE(){return h("Quality")}var Ta=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return w(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){R(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return O(this,n.MEDIA_HEIGHT)}set mediaHeight(e){N(this,n.MEDIA_HEIGHT,e)}};Ta.getSlotTemplateHTML=lE;Ta.getTooltipContentHTML=dE;l.customElements.get("media-rendition-menu-button")||l.customElements.define("media-rendition-menu-button",Ta);var Nd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ut=(t,e,i)=>(Nd(t,e,"read from private field"),i?i.call(t):e.get(t)),dt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Jm=(t,e,i,a)=>(Nd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),De=(t,e,i)=>(Nd(t,e,"access private method"),i),ka,jr,ks,yi,ya,Ud,jm,gs,Od,_s,Pd,eh,Ts,ys,As;function uE(t){return`
3201
+ `}function dE(){return h("Quality")}var Ta=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return w(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){R(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return O(this,n.MEDIA_HEIGHT)}set mediaHeight(e){P(this,n.MEDIA_HEIGHT,e)}};Ta.getSlotTemplateHTML=lE;Ta.getTooltipContentHTML=dE;l.customElements.get("media-rendition-menu-button")||l.customElements.define("media-rendition-menu-button",Ta);var Ud=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ut=(t,e,i)=>(Ud(t,e,"read from private field"),i?i.call(t):e.get(t)),dt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Jm=(t,e,i,a)=>(Ud(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),De=(t,e,i)=>(Ud(t,e,"access private method"),i),ka,eo,Ss,yi,ya,Hd,jm,_s,Nd,As,Pd,eh,ys,ks,Ts;function uE(t){return`
3201
3202
  ${j.getTemplateHTML(t)}
3202
3203
  <style>
3203
3204
  :host {
@@ -3211,7 +3212,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3211
3212
  overflow: hidden;
3212
3213
  }
3213
3214
  </style>
3214
- `}var eo=class extends j{constructor(){super(),dt(this,jr),dt(this,yi),dt(this,Ud),dt(this,gs),dt(this,Pd),dt(this,ka,!1),dt(this,_s,e=>{let i=e.target,a=(i==null?void 0:i.nodeName)==="VIDEO",r=De(this,gs,Od).call(this,i);(a||r)&&(ut(this,ka)?De(this,yi,ya).call(this):De(this,Pd,eh).call(this,e))}),dt(this,Ts,e=>{let i=e.target,a=this.contains(i),r=e.button===2,o=(i==null?void 0:i.nodeName)==="VIDEO",s=De(this,gs,Od).call(this,i);a||r&&(o||s)||De(this,yi,ya).call(this)}),dt(this,ys,e=>{e.key==="Escape"&&De(this,yi,ya).call(this)}),dt(this,As,e=>{var i,a;let r=e.target;if((i=r.matches)!=null&&i.call(r,'button[invoke="copy"]')){let o=(a=r.closest("media-context-menu-item"))==null?void 0:a.querySelector('input[slot="copy"]');o&&navigator.clipboard.writeText(o.value)}De(this,yi,ya).call(this)}),this.setAttribute("noautohide",""),De(this,jr,ks).call(this)}connectedCallback(){super.connectedCallback(),Y(this).addEventListener("contextmenu",ut(this,_s)),this.addEventListener("click",ut(this,As))}disconnectedCallback(){super.disconnectedCallback(),Y(this).removeEventListener("contextmenu",ut(this,_s)),this.removeEventListener("click",ut(this,As)),document.removeEventListener("mousedown",ut(this,Ts)),document.removeEventListener("keydown",ut(this,ys))}};ka=new WeakMap;jr=new WeakSet;ks=function(){this.hidden=!ut(this,ka)};yi=new WeakSet;ya=function(){Jm(this,ka,!1),De(this,jr,ks).call(this)};Ud=new WeakSet;jm=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var i;e!==this&&De(i=e,yi,ya).call(i)})};gs=new WeakSet;Od=function(t){return t?t.hasAttribute("slot")&&t.getAttribute("slot")==="media"?!0:t.nodeName.includes("-")&&t.tagName.includes("-")?t.hasAttribute("src")||t.hasAttribute("poster")||t.hasAttribute("preload")||t.hasAttribute("playsinline"):!1:!1};_s=new WeakMap;Pd=new WeakSet;eh=function(t){t.preventDefault(),De(this,Ud,jm).call(this),Jm(this,ka,!0),this.style.position="fixed",this.style.left=`${t.clientX}px`,this.style.top=`${t.clientY}px`,De(this,jr,ks).call(this),document.addEventListener("mousedown",ut(this,Ts),{once:!0}),document.addEventListener("keydown",ut(this,ys),{once:!0})};Ts=new WeakMap;ys=new WeakMap;As=new WeakMap;eo.getTemplateHTML=uE;l.customElements.get("media-context-menu")||l.customElements.define("media-context-menu",eo);function cE(t){return`
3215
+ `}var to=class extends j{constructor(){super(),dt(this,eo),dt(this,yi),dt(this,Hd),dt(this,_s),dt(this,Pd),dt(this,ka,!1),dt(this,As,e=>{let i=e.target,a=(i==null?void 0:i.nodeName)==="VIDEO",r=De(this,_s,Nd).call(this,i);(a||r)&&(ut(this,ka)?De(this,yi,ya).call(this):De(this,Pd,eh).call(this,e))}),dt(this,ys,e=>{let i=e.target,a=this.contains(i),r=e.button===2,o=(i==null?void 0:i.nodeName)==="VIDEO",s=De(this,_s,Nd).call(this,i);a||r&&(o||s)||De(this,yi,ya).call(this)}),dt(this,ks,e=>{e.key==="Escape"&&De(this,yi,ya).call(this)}),dt(this,Ts,e=>{var i,a;let r=e.target;if((i=r.matches)!=null&&i.call(r,'button[invoke="copy"]')){let o=(a=r.closest("media-context-menu-item"))==null?void 0:a.querySelector('input[slot="copy"]');o&&navigator.clipboard.writeText(o.value)}De(this,yi,ya).call(this)}),this.setAttribute("noautohide",""),De(this,eo,Ss).call(this)}connectedCallback(){super.connectedCallback(),Y(this).addEventListener("contextmenu",ut(this,As)),this.addEventListener("click",ut(this,Ts))}disconnectedCallback(){super.disconnectedCallback(),Y(this).removeEventListener("contextmenu",ut(this,As)),this.removeEventListener("click",ut(this,Ts)),document.removeEventListener("mousedown",ut(this,ys)),document.removeEventListener("keydown",ut(this,ks))}};ka=new WeakMap;eo=new WeakSet;Ss=function(){this.hidden=!ut(this,ka)};yi=new WeakSet;ya=function(){Jm(this,ka,!1),De(this,eo,Ss).call(this)};Hd=new WeakSet;jm=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var i;e!==this&&De(i=e,yi,ya).call(i)})};_s=new WeakSet;Nd=function(t){return t?t.hasAttribute("slot")&&t.getAttribute("slot")==="media"?!0:t.nodeName.includes("-")&&t.tagName.includes("-")?t.hasAttribute("src")||t.hasAttribute("poster")||t.hasAttribute("preload")||t.hasAttribute("playsinline"):!1:!1};As=new WeakMap;Pd=new WeakSet;eh=function(t){t.preventDefault(),De(this,Hd,jm).call(this),Jm(this,ka,!0),this.style.position="fixed",this.style.left=`${t.clientX}px`,this.style.top=`${t.clientY}px`,De(this,eo,Ss).call(this),document.addEventListener("mousedown",ut(this,ys),{once:!0}),document.addEventListener("keydown",ut(this,ks),{once:!0})};ys=new WeakMap;ks=new WeakMap;Ts=new WeakMap;to.getTemplateHTML=uE;l.customElements.get("media-context-menu")||l.customElements.define("media-context-menu",to);function cE(t){return`
3215
3216
  ${Ce.getTemplateHTML.call(this,t)}
3216
3217
  <style>
3217
3218
  ::slotted(*) {
@@ -3224,7 +3225,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3224
3225
  min-height: var(--media-control-height, 24px);
3225
3226
  }
3226
3227
  </style>
3227
- `}var Sa=class extends Ce{};Sa.shadowRootOptions={mode:"open"};Sa.getTemplateHTML=cE;l.customElements.get("media-context-menu-item")||l.customElements.define("media-context-menu-item",Sa);var Hd=Gt.createElement("template");"innerHTML"in Hd&&(Hd.innerHTML=Sm);var th,ih,Ss=class extends bi{};Ss.template=(ih=(th=Hd.content)==null?void 0:th.children)==null?void 0:ih[0];ke.customElements.get("media-theme-gerwig")||ke.customElements.define("media-theme-gerwig",Ss);var mE="gerwig",yt={SRC:"src",POSTER:"poster"},c={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-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",FULLSCREEN_ELEMENT:"fullscreen-element",DRM_TOKEN:"drm-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",VIDEO_TITLE:"video-title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref",NO_MUTED_PREF:"no-muted-pref",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge",DISABLE_PSEUDO_ENDED:"disable-pseudo-ended"},Bd=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","videotitle","novolumepref","nomutedpref","proudlydisplaymuxbadge"];function hE(t,e){var a,r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:t.storyboard,storyboardSrc:t.getAttribute(c.STORYBOARD_SRC),fullscreenElement:t.getAttribute(c.FULLSCREEN_ELEMENT),placeholder:t.getAttribute("placeholder"),themeTemplate:fE(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(c.NOHOTKEYS),hotKeys:t.getAttribute(c.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,programStartTime:t.programStartTime,programEndTime:t.programEndTime,assetStartTime:t.assetStartTime,assetEndTime:t.assetEndTime,renditionOrder:t.renditionOrder,metadata:t.metadata,playerInitTime:t.playerInitTime,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:Cr(t.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:t.getAttribute(c.PRIMARY_COLOR),secondaryColor:t.getAttribute(c.SECONDARY_COLOR),accentColor:t.getAttribute(c.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:vE(t),playbackRates:t.getAttribute(c.PLAYBACK_RATES),customDomain:(a=t.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:t.getAttribute(c.TITLE),videoTitle:(r=t.getAttribute(c.VIDEO_TITLE))!=null?r:t.getAttribute(c.TITLE),novolumepref:t.hasAttribute(c.NO_VOLUME_PREF),nomutedpref:t.hasAttribute(c.NO_MUTED_PREF),proudlyDisplayMuxBadge:t.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE),castReceiver:t.castReceiver,disablePseudoEnded:t.hasAttribute(c.DISABLE_PSEUDO_ENDED),...e,extraSourceParams:t.extraSourceParams}}var pE=on.formatErrorMessage;on.formatErrorMessage=t=>{var e,i;if(t instanceof g.MediaError){let a=km(t,!1);return`
3228
+ `}var Sa=class extends Ce{};Sa.shadowRootOptions={mode:"open"};Sa.getTemplateHTML=cE;l.customElements.get("media-context-menu-item")||l.customElements.define("media-context-menu-item",Sa);var Bd=Gt.createElement("template");"innerHTML"in Bd&&(Bd.innerHTML=Sm);var th,ih,Is=class extends bi{};Is.template=(ih=(th=Bd.content)==null?void 0:th.children)==null?void 0:ih[0];ke.customElements.get("media-theme-gerwig")||ke.customElements.define("media-theme-gerwig",Is);var mE="gerwig",yt={SRC:"src",POSTER:"poster"},c={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-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",FULLSCREEN_ELEMENT:"fullscreen-element",DRM_TOKEN:"drm-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",VIDEO_TITLE:"video-title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref",NO_MUTED_PREF:"no-muted-pref",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge",DISABLE_PSEUDO_ENDED:"disable-pseudo-ended"},$d=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","videotitle","novolumepref","nomutedpref","proudlydisplaymuxbadge"];function hE(t,e){var a,r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:t.storyboard,storyboardSrc:t.getAttribute(c.STORYBOARD_SRC),fullscreenElement:t.getAttribute(c.FULLSCREEN_ELEMENT),placeholder:t.getAttribute("placeholder"),themeTemplate:fE(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(c.NOHOTKEYS),hotKeys:t.getAttribute(c.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,maxAutoResolution:t.maxAutoResolution,programStartTime:t.programStartTime,programEndTime:t.programEndTime,assetStartTime:t.assetStartTime,assetEndTime:t.assetEndTime,renditionOrder:t.renditionOrder,metadata:t.metadata,playerInitTime:t.playerInitTime,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:Lr(t.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:t.getAttribute(c.PRIMARY_COLOR),secondaryColor:t.getAttribute(c.SECONDARY_COLOR),accentColor:t.getAttribute(c.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:vE(t),playbackRates:t.getAttribute(c.PLAYBACK_RATES),customDomain:(a=t.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:t.getAttribute(c.TITLE),videoTitle:(r=t.getAttribute(c.VIDEO_TITLE))!=null?r:t.getAttribute(c.TITLE),novolumepref:t.hasAttribute(c.NO_VOLUME_PREF),nomutedpref:t.hasAttribute(c.NO_MUTED_PREF),proudlyDisplayMuxBadge:t.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE),castReceiver:t.castReceiver,disablePseudoEnded:t.hasAttribute(c.DISABLE_PSEUDO_ENDED),...e,extraSourceParams:t.extraSourceParams}}var pE=nn.formatErrorMessage;nn.formatErrorMessage=t=>{var e,i;if(t instanceof g.MediaError){let a=km(t,!1);return`
3228
3229
  ${a!=null&&a.title?`<h3>${a.title}</h3>`:""}
3229
3230
  ${a!=null&&a.message||a!=null&&a.linkUrl?`<p>
3230
3231
  ${a==null?void 0:a.message}
@@ -3236,5 +3237,5 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3236
3237
  >${(i=a.linkText)!=null?i:a.linkUrl}</a
3237
3238
  >`:""}
3238
3239
  </p>`:""}
3239
- `}return pE(t)};function fE(t){var i,a;let e=t.theme;if(e){let r=(a=(i=t.getRootNode())==null?void 0:i.getElementById)==null?void 0:a.call(i,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let o=ke.customElements.get(e);if(o!=null&&o.template)return o.template}}function vE(t){var i;let e=(i=t.mediaController)==null?void 0:i.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function ah(t){let e=t.videoTitle?{video_title:t.videoTitle}:{};return t.getAttributeNames().filter(i=>i.startsWith("metadata-")).reduce((i,a)=>{let r=t.getAttribute(a);return r!==null&&(i[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),i},e)}var EE=Object.values(g.Attributes),bE=Object.values(yt),gE=Object.values(c),$d=On(),Wd="mux-player",rh={isDialogOpen:!1},_E={redundant_streams:!0},to,io,ao,Kt,ro,Si,W,Ft,oh,Vd,ki,nh,sh,lh,dh,Fd=class extends Bl{constructor(){super();pe(this,W);pe(this,to);pe(this,io,!1);pe(this,ao,{});pe(this,Kt,!0);pe(this,ro,new Dn(this,"hotkeys"));pe(this,Si,{...rh,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&X(this,W,Vd).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var o;if(((o=i.composedPath()[0])==null?void 0:o.localName)!=="media-error-dialog")return;Nl(this,Gt.activeElement)||i.preventDefault()}});ye(this,to,(0,D.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),X(this,W,oh).call(this),this.isConnected&&X(this,W,Ft).call(this)}static get NAME(){return Wd}static get VERSION(){return $d}static get observedAttributes(){var i;return[...(i=Bl.observedAttributes)!=null?i:[],...bE,...EE,...gE]}get mediaTheme(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("media-theme")}get mediaController(){var i,a;return(a=(i=this.mediaTheme)==null?void 0:i.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){let i=this.media;i&&(i.metadata=ah(this))}attributeChangedCallback(i,a,r){switch(X(this,W,Ft).call(this),super.attributeChangedCallback(i,a,r),i){case c.HOTKEYS:H(this,ro).value=r;break;case c.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&it((0,D.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case c.THUMBNAIL_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.THUMBNAIL;d!==u&&it((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case c.STORYBOARD_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.STORYBOARD;d!==u&&it((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case c.DRM_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.DRM;d!==u&&it((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&ge((0,D.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:{r&&![D.StreamTypes.LIVE,D.StreamTypes.ON_DEMAND,D.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Ul({file:"invalid-stream-type.md",message:(0,D.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===D.StreamTypes.LIVE?this.getAttribute(c.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case c.FULLSCREEN_ELEMENT:{if(r!=null||r!==a){let s=Gt.getElementById(r),d=s==null?void 0:s.querySelector("mux-player");this.mediaController&&s&&d&&(this.mediaController.fullscreenElement=s)}break}}[g.Attributes.PLAYBACK_ID,yt.SRC,c.PLAYBACK_TOKEN].includes(i)&&a!==r&&ye(this,Si,{...H(this,Si),...rh}),X(this,W,ki).call(this,{[tm(i)]:r})}async requestFullscreen(i){var a;if(!(!this.mediaController||this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(a=this.mediaController)==null||a.dispatchEvent(new ke.CustomEvent(m.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,o)=>{var s;(s=this.mediaController)==null||s.addEventListener(Le.MEDIA_IS_FULLSCREEN,()=>r(),{once:!0})})}async exitFullscreen(){var i;if(!(!this.mediaController||!this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(i=this.mediaController)==null||i.dispatchEvent(new ke.CustomEvent(m.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((a,r)=>{var o;(o=this.mediaController)==null||o.addEventListener(Le.MEDIA_IS_FULLSCREEN,()=>a(),{once:!0})})}get preferCmcd(){var i;return(i=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?D.CmcdTypeValues.includes(i)?this.setAttribute(g.Attributes.PREFER_CMCD,i):it(`Invalid value for preferCmcd. Must be one of ${D.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var i,a;return(a=(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var i;return(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_TIME_IS_LIVE)}get _hls(){var i;return(i=this.media)==null?void 0:i._hls}get mux(){var i;return(i=this.media)==null?void 0:i.mux}get theme(){var i;return(i=this.getAttribute(c.THEME))!=null?i:mE}set theme(i){this.setAttribute(c.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(Bd.includes(r))continue;let o=i.getAttribute(r);a[xn(r)]=o===""?!0:o}return a}set themeProps(i){var r,o;X(this,W,Ft).call(this);let a={...this.themeProps,...i};for(let s in a){if(Bd.includes(s))continue;let d=i==null?void 0:i[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(Rn(s),!!d):(o=this.mediaTheme)==null||o.setAttribute(Rn(s),d)}}get playbackId(){var i;return(i=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(g.Attributes.PLAYBACK_ID,i):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Vt(this,yt.SRC))!=null?i:void 0:(a=this.getAttribute(yt.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(yt.SRC,i):this.removeAttribute(yt.SRC)}get poster(){var r;let i=this.getAttribute(yt.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){it("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return jc(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(i){i||i===""?this.setAttribute(yt.POSTER,i):this.removeAttribute(yt.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(c.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(c.STORYBOARD_SRC,i):this.removeAttribute(c.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[D.StreamTypes.LIVE,D.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return em(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(c.AUDIO)}set audio(i){if(!i){this.removeAttribute(c.AUDIO);return}this.setAttribute(c.AUDIO,"")}get hotkeys(){return H(this,ro)}get nohotkeys(){return this.hasAttribute(c.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(c.NOHOTKEYS);return}this.setAttribute(c.NOHOTKEYS,"")}get thumbnailTime(){return ce(this.getAttribute(c.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(c.THUMBNAIL_TIME,`${i}`)}get videoTitle(){var i,a;return(a=(i=this.getAttribute(c.VIDEO_TITLE))!=null?i:this.getAttribute(c.TITLE))!=null?a:""}set videoTitle(i){i!==this.videoTitle&&(i?this.setAttribute(c.VIDEO_TITLE,i):this.removeAttribute(c.VIDEO_TITLE))}get placeholder(){var i;return(i=Vt(this,c.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(c.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(c.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(c.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(c.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(c.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(c.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(c.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(c.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(c.PLAYBACK_RATES))return this.getAttribute(c.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(i=>Number(i)).filter(i=>!Number.isNaN(i)).sort((i,a)=>i-a)}set playbackRates(i){if(!i){this.removeAttribute(c.PLAYBACK_RATES);return}this.setAttribute(c.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=ce(this.getAttribute(c.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(c.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=ce(this.getAttribute(c.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(c.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(c.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return ce(this.getAttribute(c.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(c.DEFAULT_DURATION):this.setAttribute(c.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(g.Attributes.PLAYER_INIT_TIME)?ce(this.getAttribute(g.Attributes.PLAYER_INIT_TIME)):H(this,to)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(g.Attributes.PLAYER_INIT_TIME):this.setAttribute(g.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:Wd}get playerSoftwareVersion(){var i;return(i=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:$d}get beaconCollectionDomain(){var i;return(i=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(g.Attributes.MAX_RESOLUTION,i):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(g.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(g.Attributes.MIN_RESOLUTION,i):this.removeAttribute(g.Attributes.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(g.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(g.Attributes.RENDITION_ORDER,i):this.removeAttribute(g.Attributes.RENDITION_ORDER))}get programStartTime(){return ce(this.getAttribute(g.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(g.Attributes.PROGRAM_START_TIME):this.setAttribute(g.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return ce(this.getAttribute(g.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(g.Attributes.PROGRAM_END_TIME):this.setAttribute(g.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return ce(this.getAttribute(g.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(g.Attributes.ASSET_START_TIME):this.setAttribute(g.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return ce(this.getAttribute(g.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(g.Attributes.ASSET_END_TIME):this.setAttribute(g.Attributes.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(c.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(c.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):_E}set extraSourceParams(i){i==null?this.removeAttribute(c.EXTRA_SOURCE_PARAMS):this.setAttribute(c.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Vt(this,g.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(g.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(c.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(c.NO_VOLUME_PREF,""):this.removeAttribute(c.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(c.NO_MUTED_PREF)}set noMutedPref(i){i?this.setAttribute(c.NO_MUTED_PREF,""):this.removeAttribute(c.NO_MUTED_PREF)}get debug(){return Vt(this,g.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableTracking(){return Vt(this,g.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(g.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Vt(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:D.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(g.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?r:D.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(c.DEFAULT_STREAM_TYPE,i):this.removeAttribute(c.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(c.TARGET_LIVE_WINDOW)?+this.getAttribute(c.TARGET_LIVE_WINDOW):(a=(i=this.media)==null?void 0:i.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(i){i==this.targetLiveWindow||Number.isNaN(i)&&Number.isNaN(this.targetLiveWindow)||(i==null?this.removeAttribute(c.TARGET_LIVE_WINDOW):this.setAttribute(c.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return ce(Vt(this,g.Attributes.START_TIME))}set startTime(i){this.setAttribute(g.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(i===D.PlaybackTypes.MSE||i===D.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===D.PlaybackTypes.MSE||i===D.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...ah(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=i}async addCuePoints(i){var a;if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(i)}get activeCuePoint(){var i;return(i=this.media)==null?void 0:i.activeCuePoint}get cuePoints(){var i,a;return(a=(i=this.media)==null?void 0:i.cuePoints)!=null?a:[]}addChapters(i){var a;if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(i)}get activeChapter(){var i;return(i=this.media)==null?void 0:i.activeChapter}get chapters(){var i,a;return(a=(i=this.media)==null?void 0:i.chapters)!=null?a:[]}getStartDate(){var i;return(i=this.media)==null?void 0:i.getStartDate()}get currentPdt(){var i;return(i=this.media)==null?void 0:i.currentPdt}get tokens(){let i=this.getAttribute(c.PLAYBACK_TOKEN),a=this.getAttribute(c.DRM_TOKEN),r=this.getAttribute(c.THUMBNAIL_TOKEN),o=this.getAttribute(c.STORYBOARD_TOKEN);return{...H(this,ao),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(i){ye(this,ao,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(c.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(c.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(c.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(c.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(c.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(c.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(c.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(c.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,o){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,D.addTextTrack)(s,i,a,r,o)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,D.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(c.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(c.CAST_RECEIVER,i):this.removeAttribute(c.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){ge("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(c.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(c.NO_TOOLTIPS);return}this.setAttribute(c.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(c.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}};to=new WeakMap,io=new WeakMap,ao=new WeakMap,Kt=new WeakMap,ro=new WeakMap,Si=new WeakMap,W=new WeakSet,Ft=function(){var i,a,r,o;if(!H(this,io)){ye(this,io,!0),X(this,W,ki).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof ke.HTMLElement))throw""}catch{ge("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{ge("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Xs))throw""}catch{ge("<media-controller> failed to upgrade!")}X(this,W,nh).call(this),X(this,W,sh).call(this),X(this,W,lh).call(this),ye(this,Kt,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(y.USER_INACTIVE))!=null?a:!0),X(this,W,dh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>X(this,W,ki).call(this)),(o=this.media)==null||o.addEventListener("loadstart",()=>X(this,W,ki).call(this))}},oh=function(){var i,a;try{(i=window==null?void 0:window.CSS)==null||i.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Vd=function(i){Object.assign(H(this,Si),i),X(this,W,ki).call(this)},ki=function(i={}){Am(Tm(hE(this,{...H(this,Si),...i})),this.shadowRoot)},nh=function(){let i=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let o=r.replace(/^theme-/,"");if(Bd.includes(o))return;let s=this.getAttribute(r);s!=null?(d=this.mediaTheme)==null||d.setAttribute(o,s):(u=this.mediaTheme)==null||u.removeAttribute(o)};new MutationObserver(r=>{for(let{attributeName:o}of r)i(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},sh=function(){let i=a=>{var s;let r=(s=this.media)==null?void 0:s.error;if(!(r instanceof g.MediaError)){let{message:d,code:u}=r!=null?r:{};r=new g.MediaError(d,u)}if(!(r!=null&&r.fatal)){it(r),r.data&&it(`${r.name} data:`,r.data);return}let o=zl(r,!1);o.message&&Ul(o),ge(r),r.data&&ge(`${r.name} data:`,r.data),X(this,W,Vd).call(this,{isDialogOpen:!0})};this.addEventListener("error",i),this.media&&(this.media.errorTranslator=(a={})=>{var o,s,d;if(!(((o=this.media)==null?void 0:o.error)instanceof g.MediaError))return a;let r=zl((s=this.media)==null?void 0:s.error,!1);return{player_error_code:(d=this.media)==null?void 0:d.error.code,player_error_message:r.message?String(r.message):a.player_error_message,player_error_context:r.context?String(r.context):a.player_error_context}})},lh=function(){var a,r,o,s;let i=()=>X(this,W,ki).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",i),(s=(o=this.media)==null?void 0:o.textTracks)==null||s.addEventListener("removetrack",i)},dh=function(){var p,T;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===D.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(_,E,f=!1)=>{if(o())return;Array.from(_&&_.activeCues||[]).forEach(b=>{if(!(!b.snapToLines||b.line<-5||b.line>=0&&b.line<10))if(!E||this.paused){let M=b.text.split(`
3240
- `).length,C=-3;this.streamType===D.StreamTypes.LIVE&&(C=-2);let ie=C-M;if(b.line===ie&&!f)return;r.has(b)||r.set(b,b.line),b.line=ie}else setTimeout(()=>{b.line=r.get(b)||"auto"},500)})},d=()=>{var _,E;s(a,(E=(_=this.mediaController)==null?void 0:_.hasAttribute(y.USER_INACTIVE))!=null?E:!1)},u=()=>{var f,I;let E=Array.from(((I=(f=this.mediaController)==null?void 0:f.media)==null?void 0:I.textTracks)||[]).filter(b=>["subtitles","captions"].includes(b.kind)&&b.mode==="showing")[0];E!==a&&(a==null||a.removeEventListener("cuechange",d)),a=E,a==null||a.addEventListener("cuechange",d),s(a,H(this,Kt))};u(),(p=this.textTracks)==null||p.addEventListener("change",u),(T=this.textTracks)==null||T.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var E,f;let _=(f=(E=this.mediaController)==null?void 0:E.hasAttribute(y.USER_INACTIVE))!=null?f:!0;H(this,Kt)!==_&&(ye(this,Kt,_),s(a,H(this,Kt)))})};function Vt(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var AE=Fd;
3240
+ `}return pE(t)};function fE(t){var i,a;let e=t.theme;if(e){let r=(a=(i=t.getRootNode())==null?void 0:i.getElementById)==null?void 0:a.call(i,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let o=ke.customElements.get(e);if(o!=null&&o.template)return o.template}}function vE(t){var i;let e=(i=t.mediaController)==null?void 0:i.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function ah(t){let e=t.videoTitle?{video_title:t.videoTitle}:{};return t.getAttributeNames().filter(i=>i.startsWith("metadata-")).reduce((i,a)=>{let r=t.getAttribute(a);return r!==null&&(i[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),i},e)}var EE=Object.values(g.Attributes),bE=Object.values(yt),gE=Object.values(c),Wd=Nn(),Fd="mux-player",rh={isDialogOpen:!1},_E={redundant_streams:!0},io,ao,ro,Kt,oo,Si,W,Ft,oh,Kd,ki,nh,sh,lh,dh,Vd=class extends $l{constructor(){super();pe(this,W);pe(this,io);pe(this,ao,!1);pe(this,ro,{});pe(this,Kt,!0);pe(this,oo,new On(this,"hotkeys"));pe(this,Si,{...rh,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&X(this,W,Kd).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var o;if(((o=i.composedPath()[0])==null?void 0:o.localName)!=="media-error-dialog")return;Ul(this,Gt.activeElement)||i.preventDefault()}});ye(this,io,(0,D.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),X(this,W,oh).call(this),this.isConnected&&X(this,W,Ft).call(this)}static get NAME(){return Fd}static get VERSION(){return Wd}static get observedAttributes(){var i;return[...(i=$l.observedAttributes)!=null?i:[],...bE,...EE,...gE]}get mediaTheme(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("media-theme")}get mediaController(){var i,a;return(a=(i=this.mediaTheme)==null?void 0:i.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){let i=this.media;i&&(i.metadata=ah(this))}attributeChangedCallback(i,a,r){switch(X(this,W,Ft).call(this),super.attributeChangedCallback(i,a,r),i){case c.HOTKEYS:H(this,oo).value=r;break;case c.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&it((0,D.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case c.THUMBNAIL_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.THUMBNAIL;d!==u&&it((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case c.STORYBOARD_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.STORYBOARD;d!==u&&it((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case c.DRM_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.DRM;d!==u&&it((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&ge((0,D.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:{r&&![D.StreamTypes.LIVE,D.StreamTypes.ON_DEMAND,D.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Hl({file:"invalid-stream-type.md",message:(0,D.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===D.StreamTypes.LIVE?this.getAttribute(c.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case c.FULLSCREEN_ELEMENT:{if(r!=null||r!==a){let s=Gt.getElementById(r),d=s==null?void 0:s.querySelector("mux-player");this.mediaController&&s&&d&&(this.mediaController.fullscreenElement=s)}break}}[g.Attributes.PLAYBACK_ID,yt.SRC,c.PLAYBACK_TOKEN].includes(i)&&a!==r&&ye(this,Si,{...H(this,Si),...rh}),X(this,W,ki).call(this,{[tm(i)]:r})}async requestFullscreen(i){var a;if(!(!this.mediaController||this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(a=this.mediaController)==null||a.dispatchEvent(new ke.CustomEvent(m.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,o)=>{var s;(s=this.mediaController)==null||s.addEventListener(Le.MEDIA_IS_FULLSCREEN,()=>r(),{once:!0})})}async exitFullscreen(){var i;if(!(!this.mediaController||!this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(i=this.mediaController)==null||i.dispatchEvent(new ke.CustomEvent(m.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((a,r)=>{var o;(o=this.mediaController)==null||o.addEventListener(Le.MEDIA_IS_FULLSCREEN,()=>a(),{once:!0})})}get preferCmcd(){var i;return(i=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?D.CmcdTypeValues.includes(i)?this.setAttribute(g.Attributes.PREFER_CMCD,i):it(`Invalid value for preferCmcd. Must be one of ${D.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var i,a;return(a=(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var i;return(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_TIME_IS_LIVE)}get _hls(){var i;return(i=this.media)==null?void 0:i._hls}get mux(){var i;return(i=this.media)==null?void 0:i.mux}get theme(){var i;return(i=this.getAttribute(c.THEME))!=null?i:mE}set theme(i){this.setAttribute(c.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if($d.includes(r))continue;let o=i.getAttribute(r);a[Dn(r)]=o===""?!0:o}return a}set themeProps(i){var r,o;X(this,W,Ft).call(this);let a={...this.themeProps,...i};for(let s in a){if($d.includes(s))continue;let d=i==null?void 0:i[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(xn(s),!!d):(o=this.mediaTheme)==null||o.setAttribute(xn(s),d)}}get playbackId(){var i;return(i=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(g.Attributes.PLAYBACK_ID,i):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Vt(this,yt.SRC))!=null?i:void 0:(a=this.getAttribute(yt.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(yt.SRC,i):this.removeAttribute(yt.SRC)}get poster(){var r;let i=this.getAttribute(yt.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){it("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return jc(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(i){i||i===""?this.setAttribute(yt.POSTER,i):this.removeAttribute(yt.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(c.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(c.STORYBOARD_SRC,i):this.removeAttribute(c.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[D.StreamTypes.LIVE,D.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return em(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(c.AUDIO)}set audio(i){if(!i){this.removeAttribute(c.AUDIO);return}this.setAttribute(c.AUDIO,"")}get hotkeys(){return H(this,oo)}get nohotkeys(){return this.hasAttribute(c.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(c.NOHOTKEYS);return}this.setAttribute(c.NOHOTKEYS,"")}get thumbnailTime(){return ce(this.getAttribute(c.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(c.THUMBNAIL_TIME,`${i}`)}get videoTitle(){var i,a;return(a=(i=this.getAttribute(c.VIDEO_TITLE))!=null?i:this.getAttribute(c.TITLE))!=null?a:""}set videoTitle(i){i!==this.videoTitle&&(i?this.setAttribute(c.VIDEO_TITLE,i):this.removeAttribute(c.VIDEO_TITLE))}get placeholder(){var i;return(i=Vt(this,c.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(c.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(c.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(c.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(c.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(c.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(c.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(c.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(c.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(c.PLAYBACK_RATES))return this.getAttribute(c.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(i=>Number(i)).filter(i=>!Number.isNaN(i)).sort((i,a)=>i-a)}set playbackRates(i){if(!i){this.removeAttribute(c.PLAYBACK_RATES);return}this.setAttribute(c.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=ce(this.getAttribute(c.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(c.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=ce(this.getAttribute(c.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(c.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(c.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return ce(this.getAttribute(c.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(c.DEFAULT_DURATION):this.setAttribute(c.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(g.Attributes.PLAYER_INIT_TIME)?ce(this.getAttribute(g.Attributes.PLAYER_INIT_TIME)):H(this,io)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(g.Attributes.PLAYER_INIT_TIME):this.setAttribute(g.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:Fd}get playerSoftwareVersion(){var i;return(i=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:Wd}get beaconCollectionDomain(){var i;return(i=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(g.Attributes.MAX_RESOLUTION,i):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(g.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(g.Attributes.MIN_RESOLUTION,i):this.removeAttribute(g.Attributes.MIN_RESOLUTION))}get maxAutoResolution(){var i;return(i=this.getAttribute(g.Attributes.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(g.Attributes.MAX_AUTO_RESOLUTION):this.setAttribute(g.Attributes.MAX_AUTO_RESOLUTION,i)}get renditionOrder(){var i;return(i=this.getAttribute(g.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(g.Attributes.RENDITION_ORDER,i):this.removeAttribute(g.Attributes.RENDITION_ORDER))}get programStartTime(){return ce(this.getAttribute(g.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(g.Attributes.PROGRAM_START_TIME):this.setAttribute(g.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return ce(this.getAttribute(g.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(g.Attributes.PROGRAM_END_TIME):this.setAttribute(g.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return ce(this.getAttribute(g.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(g.Attributes.ASSET_START_TIME):this.setAttribute(g.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return ce(this.getAttribute(g.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(g.Attributes.ASSET_END_TIME):this.setAttribute(g.Attributes.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(c.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(c.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):_E}set extraSourceParams(i){i==null?this.removeAttribute(c.EXTRA_SOURCE_PARAMS):this.setAttribute(c.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Vt(this,g.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(g.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(c.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(c.NO_VOLUME_PREF,""):this.removeAttribute(c.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(c.NO_MUTED_PREF)}set noMutedPref(i){i?this.setAttribute(c.NO_MUTED_PREF,""):this.removeAttribute(c.NO_MUTED_PREF)}get debug(){return Vt(this,g.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableTracking(){return Vt(this,g.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(g.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Vt(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:D.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(g.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?r:D.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(c.DEFAULT_STREAM_TYPE,i):this.removeAttribute(c.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(c.TARGET_LIVE_WINDOW)?+this.getAttribute(c.TARGET_LIVE_WINDOW):(a=(i=this.media)==null?void 0:i.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(i){i==this.targetLiveWindow||Number.isNaN(i)&&Number.isNaN(this.targetLiveWindow)||(i==null?this.removeAttribute(c.TARGET_LIVE_WINDOW):this.setAttribute(c.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return ce(Vt(this,g.Attributes.START_TIME))}set startTime(i){this.setAttribute(g.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(i===D.PlaybackTypes.MSE||i===D.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===D.PlaybackTypes.MSE||i===D.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...ah(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=i}async addCuePoints(i){var a;if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(i)}get activeCuePoint(){var i;return(i=this.media)==null?void 0:i.activeCuePoint}get cuePoints(){var i,a;return(a=(i=this.media)==null?void 0:i.cuePoints)!=null?a:[]}addChapters(i){var a;if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(i)}get activeChapter(){var i;return(i=this.media)==null?void 0:i.activeChapter}get chapters(){var i,a;return(a=(i=this.media)==null?void 0:i.chapters)!=null?a:[]}getStartDate(){var i;return(i=this.media)==null?void 0:i.getStartDate()}get currentPdt(){var i;return(i=this.media)==null?void 0:i.currentPdt}get tokens(){let i=this.getAttribute(c.PLAYBACK_TOKEN),a=this.getAttribute(c.DRM_TOKEN),r=this.getAttribute(c.THUMBNAIL_TOKEN),o=this.getAttribute(c.STORYBOARD_TOKEN);return{...H(this,ro),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(i){ye(this,ro,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(c.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(c.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(c.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(c.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(c.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(c.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(c.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(c.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,o){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,D.addTextTrack)(s,i,a,r,o)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,D.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(c.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(c.CAST_RECEIVER,i):this.removeAttribute(c.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){ge("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(c.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(c.NO_TOOLTIPS);return}this.setAttribute(c.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(c.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}};io=new WeakMap,ao=new WeakMap,ro=new WeakMap,Kt=new WeakMap,oo=new WeakMap,Si=new WeakMap,W=new WeakSet,Ft=function(){var i,a,r,o;if(!H(this,ao)){ye(this,ao,!0),X(this,W,ki).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof ke.HTMLElement))throw""}catch{ge("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{ge("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Js))throw""}catch{ge("<media-controller> failed to upgrade!")}X(this,W,nh).call(this),X(this,W,sh).call(this),X(this,W,lh).call(this),ye(this,Kt,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(y.USER_INACTIVE))!=null?a:!0),X(this,W,dh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>X(this,W,ki).call(this)),(o=this.media)==null||o.addEventListener("loadstart",()=>X(this,W,ki).call(this))}},oh=function(){var i,a;try{(i=window==null?void 0:window.CSS)==null||i.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Kd=function(i){Object.assign(H(this,Si),i),X(this,W,ki).call(this)},ki=function(i={}){Am(Tm(hE(this,{...H(this,Si),...i})),this.shadowRoot)},nh=function(){let i=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let o=r.replace(/^theme-/,"");if($d.includes(o))return;let s=this.getAttribute(r);s!=null?(d=this.mediaTheme)==null||d.setAttribute(o,s):(u=this.mediaTheme)==null||u.removeAttribute(o)};new MutationObserver(r=>{for(let{attributeName:o}of r)i(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},sh=function(){let i=a=>{var s;let r=(s=this.media)==null?void 0:s.error;if(!(r instanceof g.MediaError)){let{message:d,code:u}=r!=null?r:{};r=new g.MediaError(d,u)}if(!(r!=null&&r.fatal)){it(r),r.data&&it(`${r.name} data:`,r.data);return}let o=Xl(r,!1);o.message&&Hl(o),ge(r),r.data&&ge(`${r.name} data:`,r.data),X(this,W,Kd).call(this,{isDialogOpen:!0})};this.addEventListener("error",i),this.media&&(this.media.errorTranslator=(a={})=>{var o,s,d;if(!(((o=this.media)==null?void 0:o.error)instanceof g.MediaError))return a;let r=Xl((s=this.media)==null?void 0:s.error,!1);return{player_error_code:(d=this.media)==null?void 0:d.error.code,player_error_message:r.message?String(r.message):a.player_error_message,player_error_context:r.context?String(r.context):a.player_error_context}})},lh=function(){var a,r,o,s;let i=()=>X(this,W,ki).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",i),(s=(o=this.media)==null?void 0:o.textTracks)==null||s.addEventListener("removetrack",i)},dh=function(){var p,T;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===D.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(_,E,f=!1)=>{if(o())return;Array.from(_&&_.activeCues||[]).forEach(b=>{if(!(!b.snapToLines||b.line<-5||b.line>=0&&b.line<10))if(!E||this.paused){let M=b.text.split(`
3241
+ `).length,C=-3;this.streamType===D.StreamTypes.LIVE&&(C=-2);let ie=C-M;if(b.line===ie&&!f)return;r.has(b)||r.set(b,b.line),b.line=ie}else setTimeout(()=>{b.line=r.get(b)||"auto"},500)})},d=()=>{var _,E;s(a,(E=(_=this.mediaController)==null?void 0:_.hasAttribute(y.USER_INACTIVE))!=null?E:!1)},u=()=>{var f,I;let E=Array.from(((I=(f=this.mediaController)==null?void 0:f.media)==null?void 0:I.textTracks)||[]).filter(b=>["subtitles","captions"].includes(b.kind)&&b.mode==="showing")[0];E!==a&&(a==null||a.removeEventListener("cuechange",d)),a=E,a==null||a.addEventListener("cuechange",d),s(a,H(this,Kt))};u(),(p=this.textTracks)==null||p.addEventListener("change",u),(T=this.textTracks)==null||T.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var E,f;let _=(f=(E=this.mediaController)==null?void 0:E.hasAttribute(y.USER_INACTIVE))!=null?f:!0;H(this,Kt)!==_&&(ye(this,Kt,_),s(a,H(this,Kt)))})};function Vt(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var AE=Vd;