@mux/mux-player 3.3.1-canary.8 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,11 +1,11 @@
1
- "use strict";var mh=Object.create;var _r=Object.defineProperty;var hh=Object.getOwnPropertyDescriptor;var ph=Object.getOwnPropertyNames;var fh=Object.getPrototypeOf,vh=Object.prototype.hasOwnProperty;var Ld=t=>{throw TypeError(t)};var Eh=(t,e)=>{for(var i in e)_r(t,i,{get:e[i],enumerable:!0})},wd=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ph(e))!vh.call(t,r)&&r!==i&&_r(t,r,{get:()=>e[r],enumerable:!(a=hh(e,r))||a.enumerable});return t};var bh=(t,e,i)=>(i=t!=null?mh(fh(t)):{},wd(e||!t||!t.__esModule?_r(i,"default",{value:t,enumerable:!0}):i,t)),gh=t=>wd(_r({},"__esModule",{value:!0}),t);var xo=(t,e,i)=>e.has(t)||Ld("Cannot "+i);var B=(t,e,i)=>(xo(t,e,"read from private field"),i?i.call(t):e.get(t)),pe=(t,e,i)=>e.has(t)?Ld("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),ye=(t,e,i,a)=>(xo(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),J=(t,e,i)=>(xo(t,e,"access private method"),i);var bv={};Eh(bv,{MediaError:()=>E.MediaError,default:()=>Ev,generatePlayerInitTime:()=>L.generatePlayerInitTime,getVideoAttribute:()=>Nt,playerSoftwareName:()=>sd,playerSoftwareVersion:()=>od});module.exports=gh(bv);var vi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends vi{}globalThis.DocumentFragment=t}var ha=class extends vi{},Do=class extends vi{},_h={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(ha)}},pa,Oo=class{constructor(e,i={}){pe(this,pa);ye(this,pa,i==null?void 0:i.detail)}get detail(){return B(this,pa)}initCustomEvent(){}};pa=new WeakMap;function Ah(t,e){return new ha}var xd={document:{createElement:Ah},DocumentFragment,customElements:_h,CustomEvent:Oo,EventTarget:vi,HTMLElement:ha,HTMLVideoElement:Do},Dd=typeof window=="undefined"||typeof globalThis.customElements=="undefined",fe=Dd?xd:globalThis,Ei=Dd?xd.document:globalThis.document;var p={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_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"},R={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},No={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_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_WIDTH:"mediaWidth"},Od=Object.entries(No),o=Od.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Th={USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},st=Od.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Th}),yv=Object.entries(st).reduce((t,[e,i])=>{let a=o[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),Nd=Object.entries(o).reduce((t,[e,i])=>{let a=st[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),ve={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},_t={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Po={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ke={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},we={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Pd={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var kh={2:"Network Error",3:"Decode Error",4:"Source Not Supported",5:"Encryption Error"},Sh={2:"A network error caused the media download to fail.",3:"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",4:"An unsupported error occurred. The server or network failed, or your browser does not support this format.",5:"The media is encrypted and there are no keys to decrypt it."},Uo=t=>{var e,i;return t.code===1?null:{title:(e=kh[t.code])!=null?e:`Error ${t.code}`,message:(i=Sh[t.code])!=null?i:t.message}},D={ENTER_AIRPLAY:"Start airplay",EXIT_AIRPLAY:"Stop airplay",AUDIO_TRACK_MENU:"Audio",CAPTIONS:"Captions",ENABLE_CAPTIONS:"Enable captions",DISABLE_CAPTIONS:"Disable captions",START_CAST:"Start casting",STOP_CAST:"Stop casting",ENTER_FULLSCREEN:"Enter fullscreen mode",EXIT_FULLSCREEN:"Exit fullscreen mode",MUTE:"Mute",UNMUTE:"Unmute",ENTER_PIP:"Enter picture in picture mode",EXIT_PIP:"Enter picture in picture mode",PLAY:"Play",PAUSE:"Pause",PLAYBACK_RATE:"Playback rate",RENDITIONS:"Quality",SEEK_BACKWARD:"Seek backward",SEEK_FORWARD:"Seek forward",SETTINGS:"Settings"},Y={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:t=1}={})=>`current playback rate ${t}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading",SETTINGS:()=>"settings",AUDIO_TRACKS:()=>"audio tracks",QUALITY:()=>"quality"},G={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:t=30}={})=>`seek forward ${t} seconds`,SEEK_BACK_N_SECS:({seekOffset:t=30}={})=>`seek back ${t} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},Ih={...Y,...G};function Ud(t){return t==null?void 0:t.map(Ch).join(" ")}function Bd(t){return t==null?void 0:t.split(/\s+/).map(Mh)}function Ch(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function Mh(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function Hd(t){return t==null?void 0:t.map(Rh).join(" ")}function $d(t){return t==null?void 0:t.split(/\s+/).map(Lh)}function Rh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(n=>n!=null).join(":")}}function Lh(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function Wd(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function bi(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function Ar(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var Tr=t=>new Promise(e=>setTimeout(e,t));var Fd=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],wh=(t,e)=>{let i=t===1?Fd[e].singular:Fd[e].plural;return`${t} ${i}`},Ut=t=>{if(!bi(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((l,u)=>l&&wh(l,u)).filter(l=>l).join(", ")}${i?" remaining":""}`};function Be(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),n=Math.floor(t/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(n=r=a="0"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(i?"-":"")+n+r+a}var Cv=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 yr=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},kr=class extends yr{},Sr=class extends kr{constructor(){super(...arguments),this.role=null}},Bo=class{observe(){}unobserve(){}disconnect(){}},Kd={createElement:function(){return new fa.HTMLElement},createElementNS:function(){return new fa.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},fa={ResizeObserver:Bo,document:Kd,Node:kr,Element:Sr,HTMLElement:class extends Sr{constructor(){super(...arguments),this.innerHTML=""}get content(){return new fa.DocumentFragment}},DocumentFragment:class extends yr{},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}}},Vd=typeof window=="undefined"||typeof window.customElements=="undefined",Yd=Object.keys(fa).every(t=>t in globalThis),d=Vd&&!Yd?fa:globalThis,h=Vd&&!Yd?Kd:globalThis.document;var Gd=new WeakMap,Ho=t=>{let e=Gd.get(t);return e||Gd.set(t,e=new Set),e},qd=new d.ResizeObserver(t=>{for(let e of t)for(let i of Ho(e.target))i(e)});function lt(t,e){Ho(t).add(e),qd.observe(t)}function dt(t,e){let i=Ho(t);i.delete(e),i.size||qd.unobserve(t)}function Zd(t){let e={};for(let i of t)e[i.name]=i.value;return e}function z(t){var e;return(e=Ir(t))!=null?e:He(t,"media-controller")}function Ir(t){var e;let{MEDIA_CONTROLLER:i}=R,a=t.getAttribute(i);if(a)return(e=Bt(t))==null?void 0:e.getElementById(a)}var Cr=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},Dh=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},Mr=(t,e)=>Dh(t,e)[0],ue=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:ue(t,e.getRootNode().host),He=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||He(t.getRootNode().host,e)};function va(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=va(i.shadowRoot))!=null?e:i:null}function Bt(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 Rr(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 n=getComputedStyle(r);if(i&&n.opacity==="0"||a&&n.visibility==="hidden"||n.display==="none")return!1;r=r.parentElement,e--}return!0}function zd(t,e,i,a){let r=$o(i,a),n=$o(i,{x:t,y:e}),s=$o(a,{x:t,y:e});return n>r||s>r?n>s?1:0:n/r}function $o(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function W(t,e){let i=Oh(t,a=>a===e);return i||Wo(t,e)}function Oh(t,e){var i,a;let r;for(r of(i=t.querySelectorAll("style:not([media])"))!=null?i:[]){let n;try{n=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of n!=null?n:[])if(e(s.selectorText))return s}}function Wo(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],n=r==null?void 0:r[r.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(a=n.sheet.cssRules)==null?void 0:a[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function w(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function O(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}w(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function y(t,e){return t.hasAttribute(e)}function k(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}y(t,e)!=i&&t.toggleAttribute(e,i)}function I(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function C(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;I(t,e,void 0)!==a&&t.setAttribute(e,a)}var Qd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},At=(t,e,i)=>(Qd(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)},Lr=(t,e,i,a)=>(Qd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ee,Xd=h.createElement("template");Xd.innerHTML=`
1
+ "use strict";var ch=Object.create;var br=Object.defineProperty;var mh=Object.getOwnPropertyDescriptor;var hh=Object.getOwnPropertyNames;var ph=Object.getPrototypeOf,fh=Object.prototype.hasOwnProperty;var wd=t=>{throw TypeError(t)};var vh=(t,e)=>{for(var i in e)br(t,i,{get:e[i],enumerable:!0})},Rd=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of hh(e))!fh.call(t,r)&&r!==i&&br(t,r,{get:()=>e[r],enumerable:!(a=mh(e,r))||a.enumerable});return t};var Eh=(t,e,i)=>(i=t!=null?ch(ph(t)):{},Rd(e||!t||!t.__esModule?br(i,"default",{value:t,enumerable:!0}):i,t)),bh=t=>Rd(br({},"__esModule",{value:!0}),t);var Ro=(t,e,i)=>e.has(t)||wd("Cannot "+i);var B=(t,e,i)=>(Ro(t,e,"read from private field"),i?i.call(t):e.get(t)),me=(t,e,i)=>e.has(t)?wd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Ae=(t,e,i,a)=>(Ro(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Q=(t,e,i)=>(Ro(t,e,"access private method"),i);var bv={};vh(bv,{MediaError:()=>b.MediaError,default:()=>Ev,generatePlayerInitTime:()=>L.generatePlayerInitTime,getVideoAttribute:()=>Dt,playerSoftwareName:()=>od,playerSoftwareVersion:()=>nd});module.exports=bh(bv);var pi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends pi{}globalThis.DocumentFragment=t}var ma=class extends pi{},Lo=class extends pi{},gh={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(ma)}},ha,xo=class{constructor(e,i={}){me(this,ha);Ae(this,ha,i==null?void 0:i.detail)}get detail(){return B(this,ha)}initCustomEvent(){}};ha=new WeakMap;function _h(t,e){return new ma}var Ld={document:{createElement:_h},DocumentFragment,customElements:gh,CustomEvent:xo,EventTarget:pi,HTMLElement:ma,HTMLVideoElement:Lo},xd=typeof window=="undefined"||typeof globalThis.customElements=="undefined",he=xd?Ld:globalThis,fi=xd?Ld.document:globalThis.document;var p={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_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"},R={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Do={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_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_WIDTH:"mediaWidth"},Dd=Object.entries(Do),o=Dd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Ah={USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},nt=Dd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Ah}),Tv=Object.entries(nt).reduce((t,[e,i])=>{let a=o[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),Od=Object.entries(o).reduce((t,[e,i])=>{let a=nt[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),pe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},bt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Oo={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ye={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},we={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Nd={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Pd(t){return t==null?void 0:t.map(Th).join(" ")}function Ud(t){return t==null?void 0:t.split(/\s+/).map(kh)}function Th(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function kh(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function Bd(t){return t==null?void 0:t.map(Sh).join(" ")}function Hd(t){return t==null?void 0:t.split(/\s+/).map(Ih)}function Sh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(n=>n!=null).join(":")}}function Ih(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function $d(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function vi(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function gr(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var _r=t=>new Promise(e=>setTimeout(e,t));var Wd=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Ch=(t,e)=>{let i=t===1?Wd[e].singular:Wd[e].plural;return`${t} ${i}`},Nt=t=>{if(!vi(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((l,u)=>l&&Ch(l,u)).filter(l=>l).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),n=Math.floor(t/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(n=r=a="0"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(i?"-":"")+n+r+a}var Iv=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 No={"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","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","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",live:"live","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 wh={en:No};var Rh=()=>{var t;return((t=globalThis.navigator)==null?void 0:t.language.split("-")[0])||"en"},f=(t,e={})=>{var i;return(((i=wh[Rh()])==null?void 0:i[t])||No[t]).replace(/\{(\w+)\}/g,(r,n)=>e[n]!==void 0?String(e[n]):`{${n}}`)};var Ar=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},yr=class extends Ar{},Tr=class extends yr{constructor(){super(...arguments),this.role=null}},Po=class{observe(){}unobserve(){}disconnect(){}},Fd={createElement:function(){return new pa.HTMLElement},createElementNS:function(){return new pa.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},pa={ResizeObserver:Po,document:Fd,Node:yr,Element:Tr,HTMLElement:class extends Tr{constructor(){super(...arguments),this.innerHTML=""}get content(){return new pa.DocumentFragment}},DocumentFragment:class extends Ar{},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}}},Vd=typeof window=="undefined"||typeof window.customElements=="undefined",Kd=Object.keys(pa).every(t=>t in globalThis),d=Vd&&!Kd?pa:globalThis,h=Vd&&!Kd?Fd:globalThis.document;var Gd=new WeakMap,Uo=t=>{let e=Gd.get(t);return e||Gd.set(t,e=new Set),e},Yd=new d.ResizeObserver(t=>{for(let e of t)for(let i of Uo(e.target))i(e)});function ot(t,e){Uo(t).add(e),Yd.observe(t)}function st(t,e){let i=Uo(t);i.delete(e),i.size||Yd.unobserve(t)}function qd(t){let e={};for(let i of t)e[i.name]=i.value;return e}function q(t){var e;return(e=kr(t))!=null?e:Ue(t,"media-controller")}function kr(t){var e;let{MEDIA_CONTROLLER:i}=R,a=t.getAttribute(i);if(a)return(e=Pt(t))==null?void 0:e.getElementById(a)}var Sr=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},Lh=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},Ir=(t,e)=>Lh(t,e)[0],le=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:le(t,e.getRootNode().host),Ue=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Ue(t.getRootNode().host,e)};function fa(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=fa(i.shadowRoot))!=null?e:i:null}function Pt(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 Cr(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 n=getComputedStyle(r);if(i&&n.opacity==="0"||a&&n.visibility==="hidden"||n.display==="none")return!1;r=r.parentElement,e--}return!0}function Zd(t,e,i,a){let r=Bo(i,a),n=Bo(i,{x:t,y:e}),s=Bo(a,{x:t,y:e});return n>r||s>r?n>s?1:0:n/r}function Bo(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function W(t,e){let i=xh(t,a=>a===e);return i||Ho(t,e)}function xh(t,e){var i,a;let r;for(r of(i=t.querySelectorAll("style:not([media])"))!=null?i:[]){let n;try{n=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of n!=null?n:[])if(e(s.selectorText))return s}}function Ho(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],n=r==null?void 0:r[r.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(a=n.sheet.cssRules)==null?void 0:a[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function x(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function O(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}x(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 C(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function M(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;C(t,e,void 0)!==a&&t.setAttribute(e,a)}var zd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},gt=(t,e,i)=>(zd(t,e,"read from private field"),i?i.call(t):e.get(t)),Dh=(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)},Mr=(t,e,i,a)=>(zd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),fe,Qd=h.createElement("template");Qd.innerHTML=`
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 Fo=class extends d.HTMLElement{constructor(e={}){if(super(),Nh(this,Ee,void 0),!this.shadowRoot){let i=this.attachShadow({mode:"open"}),a=Xd.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=h.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),i.appendChild(a)}}static get observedAttributes(){return[R.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER&&(i&&((n=(r=At(this,Ee))==null?void 0:r.unassociateElement)==null||n.call(r,this),Lr(this,Ee,null)),a&&this.isConnected&&(Lr(this,Ee,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=At(this,Ee))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Lr(this,Ee,Ph(this)),this.getAttribute(R.MEDIA_CONTROLLER)&&((i=(e=At(this,Ee))==null?void 0:e.associateElement)==null||i.call(e,this)),(a=At(this,Ee))==null||a.addEventListener("pointerdown",this),(r=At(this,Ee))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,i,a,r;this.getAttribute(R.MEDIA_CONTROLLER)&&((i=(e=At(this,Ee))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=At(this,Ee))==null||a.removeEventListener("pointerdown",this),(r=At(this,Ee))==null||r.removeEventListener("click",this),Lr(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:n,clientY:s}=e,{left:l,top:u,width:c,height:_}=this.getBoundingClientRect(),g=n-l,f=s-u;if(g<0||f<0||g>c||f>_||c===0&&_===0)return;let{pointerType:v=this._pointerType}=e;if(this._pointerType=void 0,v===Po.TOUCH){this.handleTap(e);return}else if(v===Po.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return y(this,o.MEDIA_PAUSED)}set mediaPaused(e){k(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let i=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(i,{composed:!0,bubbles:!0}))}};Ee=new WeakMap;function Ph(t){var e;let i=t.getAttribute(R.MEDIA_CONTROLLER);return i?(e=t.getRootNode())==null?void 0:e.getElementById(i):He(t,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",Fo);var Go=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ie=(t,e,i)=>(Go(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)},Ht=(t,e,i,a)=>(Go(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Me=(t,e,i)=>(Go(t,e,"access private method"),i),Dr,gi,ba,_i,wr,Ko,Jd,Ea,xr,Vo,jd,Yo,eu,ga,Or,Nr,qo,Ai,_a,S={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},tu=h.createElement("template");tu.innerHTML=`
8
+ `;var $o=class extends d.HTMLElement{constructor(e={}){if(super(),Dh(this,fe,void 0),!this.shadowRoot){let i=this.attachShadow({mode:"open"}),a=Qd.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=h.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),i.appendChild(a)}}static get observedAttributes(){return[R.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER&&(i&&((n=(r=gt(this,fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),Mr(this,fe,null)),a&&this.isConnected&&(Mr(this,fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=gt(this,fe))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Mr(this,fe,Oh(this)),this.getAttribute(R.MEDIA_CONTROLLER)&&((i=(e=gt(this,fe))==null?void 0:e.associateElement)==null||i.call(e,this)),(a=gt(this,fe))==null||a.addEventListener("pointerdown",this),(r=gt(this,fe))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,i,a,r;this.getAttribute(R.MEDIA_CONTROLLER)&&((i=(e=gt(this,fe))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=gt(this,fe))==null||a.removeEventListener("pointerdown",this),(r=gt(this,fe))==null||r.removeEventListener("click",this),Mr(this,fe,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:n,clientY:s}=e,{left:l,top:u,width:c,height:A}=this.getBoundingClientRect(),_=n-l,v=s-u;if(_<0||v<0||_>c||v>A||c===0&&A===0)return;let{pointerType:E=this._pointerType}=e;if(this._pointerType=void 0,E===Oo.TOUCH){this.handleTap(e);return}else if(E===Oo.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return k(this,o.MEDIA_PAUSED)}set mediaPaused(e){S(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let i=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(i,{composed:!0,bubbles:!0}))}};fe=new WeakMap;function Oh(t){var e;let i=t.getAttribute(R.MEDIA_CONTROLLER);return i?(e=t.getRootNode())==null?void 0:e.getElementById(i):Ue(t,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",$o);var Ko=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ke=(t,e,i)=>(Ko(t,e,"read from private field"),i?i.call(t):e.get(t)),Te=(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)},Ut=(t,e,i,a)=>(Ko(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ie=(t,e,i)=>(Ko(t,e,"access private method"),i),Lr,Ei,Ea,bi,wr,Wo,Xd,va,Rr,Fo,Jd,Vo,jd,ba,xr,Dr,Go,gi,ga,I={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},eu=h.createElement("template");eu.innerHTML=`
9
9
  <style>
10
10
 
11
11
  :host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -20,7 +20,7 @@
20
20
  background-color: var(--media-background-color, #000);
21
21
  }
22
22
 
23
- :host(:not([${S.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
23
+ :host(:not([${I.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
24
24
  position: absolute;
25
25
  top: 0;
26
26
  left: 0;
@@ -38,19 +38,19 @@
38
38
  }
39
39
 
40
40
 
41
- :host([${S.AUDIO}]) slot[name=media] {
41
+ :host([${I.AUDIO}]) slot[name=media] {
42
42
  display: var(--media-slot-display, none);
43
43
  }
44
44
 
45
45
 
46
- :host([${S.AUDIO}]) [part~=layer][part~=gesture-layer] {
46
+ :host([${I.AUDIO}]) [part~=layer][part~=gesture-layer] {
47
47
  height: 0;
48
48
  display: block;
49
49
  }
50
50
 
51
51
 
52
- :host(:not([${S.AUDIO}])[${S.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
53
- :host(:not([${S.AUDIO}])[${S.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
52
+ :host(:not([${I.AUDIO}])[${I.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
53
+ :host(:not([${I.AUDIO}])[${I.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
54
54
  display: none;
55
55
  }
56
56
 
@@ -59,13 +59,13 @@
59
59
  pointer-events: auto;
60
60
  }
61
61
 
62
- :host(:not([${S.AUDIO}])) *[part~=layer][part~=centered-layer] {
62
+ :host(:not([${I.AUDIO}])) *[part~=layer][part~=centered-layer] {
63
63
  align-items: center;
64
64
  justify-content: center;
65
65
  }
66
66
 
67
- :host(:not([${S.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
68
- :host(:not([${S.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
67
+ :host(:not([${I.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
68
+ :host(:not([${I.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
69
69
  align-self: stretch;
70
70
  flex-grow: 1;
71
71
  }
@@ -85,7 +85,7 @@
85
85
  }
86
86
 
87
87
 
88
- :host(:not([${S.AUDIO}])) .spacer {
88
+ :host(:not([${I.AUDIO}])) .spacer {
89
89
  flex-grow: 1;
90
90
  }
91
91
 
@@ -97,18 +97,18 @@
97
97
  }
98
98
 
99
99
 
100
- ::slotted(:not([slot=media]):not([slot=poster]):not([${S.NO_AUTOHIDE}]):not([hidden]):not([role=dialog])) {
100
+ ::slotted(:not([slot=media]):not([slot=poster]):not([${I.NO_AUTOHIDE}]):not([hidden]):not([role=dialog])) {
101
101
  opacity: 1;
102
102
  transition: var(--media-control-transition-in, opacity 0.25s);
103
103
  }
104
104
 
105
105
 
106
- :host([${S.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_AIRPLAYING}]):not([${o.MEDIA_IS_CASTING}]):not([${S.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${S.NO_AUTOHIDE}]):not([role=dialog])) {
106
+ :host([${I.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_AIRPLAYING}]):not([${o.MEDIA_IS_CASTING}]):not([${I.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${I.NO_AUTOHIDE}]):not([role=dialog])) {
107
107
  opacity: 0;
108
108
  transition: var(--media-control-transition-out, opacity 1s);
109
109
  }
110
110
 
111
- :host([${S.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_CASTING}]):not([${S.AUDIO}])) ::slotted([slot=media]) {
111
+ :host([${I.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_CASTING}]):not([${I.AUDIO}])) ::slotted([slot=media]) {
112
112
  cursor: none;
113
113
  }
114
114
 
@@ -117,7 +117,7 @@
117
117
  }
118
118
 
119
119
 
120
- :host(:not([${S.AUDIO}])[${o.MEDIA_HAS_PLAYED}]) slot[name=poster] {
120
+ :host(:not([${I.AUDIO}])[${o.MEDIA_HAS_PLAYED}]) slot[name=poster] {
121
121
  display: none;
122
122
  }
123
123
 
@@ -145,7 +145,7 @@
145
145
  <slot part="bottom chrome"></slot>
146
146
  </span>
147
147
  <slot name="dialog" part="layer dialog-layer"></slot>
148
- `;var Uh=Object.values(o),Bh="sm:384 md:576 lg:768 xl:960";function Hh(t){iu(t.target,t.contentRect.width)}function iu(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(S.BREAKPOINTS))!=null?i:Bh,r=$h(a),n=Wh(r,e),s=!1;if(Object.keys(r).forEach(l=>{if(n.includes(l)){t.hasAttribute(`breakpoint${l}`)||(t.setAttribute(`breakpoint${l}`,""),s=!0);return}t.hasAttribute(`breakpoint${l}`)&&(t.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(st.BREAKPOINTS_CHANGE,{detail:n});t.dispatchEvent(l)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(st.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function $h(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function Wh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var Aa=class extends d.HTMLElement{constructor(){super(),Se(this,Ko),Se(this,Vo),Se(this,Yo),Se(this,ga),Se(this,Nr),Se(this,Ai),Se(this,Dr,0),Se(this,gi,null),Se(this,ba,null),Se(this,_i,void 0),this.breakpointsComputed=!1,Se(this,wr,new MutationObserver(Me(this,Ko,Jd).bind(this))),Se(this,Ea,!1),Se(this,xr,i=>{Ie(this,Ea)||(setTimeout(()=>{Hh(i),Ht(this,Ea,!1)},0),Ht(this,Ea,!0))}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(tu.content.cloneNode(!0)));let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){Ie(this,gi)&&this.mediaUnsetCallback(Ie(this,gi));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[S.AUTOHIDE,S.GESTURES_DISABLED].concat(Uh).filter(e=>![o.MEDIA_RENDITION_LIST,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_CHAPTERS_CUES,o.MEDIA_WIDTH,o.MEDIA_HEIGHT,o.MEDIA_ERROR,o.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,i,a){e.toLowerCase()==S.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&&(Ht(this,gi,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Ie(this,wr).observe(this,{childList:!0,subtree:!0}),lt(this,Ie(this,xr));let a=this.getAttribute(S.AUDIO)!=null?Y.AUDIO_PLAYER():Y.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(S.USER_INACTIVE,""),iu(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=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Ie(this,wr).disconnect(),dt(this,Ie(this,xr)),this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ht(this,gi,null)}handleEvent(e){switch(e.type){case"pointerdown":Ht(this,Dr,e.timeStamp);break;case"pointermove":Me(this,Vo,jd).call(this,e);break;case"pointerup":Me(this,Yo,eu).call(this,e);break;case"mouseleave":Me(this,ga,Or).call(this);break;case"mouseup":this.removeAttribute(S.KEYBOARD_CONTROL);break;case"keyup":Me(this,Ai,_a).call(this),this.setAttribute(S.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Ht(this,_i,isNaN(i)?0:i)}get autohide(){return(Ie(this,_i)===void 0?2:Ie(this,_i)).toString()}get breakpoints(){return I(this,S.BREAKPOINTS)}set breakpoints(e){C(this,S.BREAKPOINTS,e)}get audio(){return y(this,S.AUDIO)}set audio(e){k(this,S.AUDIO,e)}get gesturesDisabled(){return y(this,S.GESTURES_DISABLED)}set gesturesDisabled(e){k(this,S.GESTURES_DISABLED,e)}get keyboardControl(){return y(this,S.KEYBOARD_CONTROL)}set keyboardControl(e){k(this,S.KEYBOARD_CONTROL,e)}get noAutohide(){return y(this,S.NO_AUTOHIDE)}set noAutohide(e){k(this,S.NO_AUTOHIDE,e)}get userInteractive(){return y(this,S.USER_INACTIVE)}set userInteractive(e){k(this,S.USER_INACTIVE,e)}};Dr=new WeakMap;gi=new WeakMap;ba=new WeakMap;_i=new WeakMap;wr=new WeakMap;Ko=new WeakSet;Jd=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 n=i.previousSibling&&i.previousSibling.previousElementSibling;if(!n||!e)this.mediaUnsetCallback(r);else{let s=n.slot!=="media";for(;(n=n.previousSibling)!==null;)n.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(r)}}if(e)for(let r of i.addedNodes)r===e&&this.handleMediaUpdated(e)}};Ea=new WeakMap;xr=new WeakMap;Vo=new WeakSet;jd=function(t){t.pointerType!=="mouse"&&t.timeStamp-Ie(this,Dr)<250||(Me(this,Nr,qo).call(this),clearTimeout(Ie(this,ba)),[this,this.media].includes(t.target)&&Me(this,Ai,_a).call(this))};Yo=new WeakSet;eu=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(S.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Me(this,ga,Or).call(this):Me(this,Ai,_a).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Me(this,Ai,_a).call(this)};ga=new WeakSet;Or=function(){if(Ie(this,_i)<0||this.hasAttribute(S.USER_INACTIVE))return;this.setAttribute(S.USER_INACTIVE,"");let t=new d.CustomEvent(st.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};Nr=new WeakSet;qo=function(){if(!this.hasAttribute(S.USER_INACTIVE))return;this.removeAttribute(S.USER_INACTIVE);let t=new d.CustomEvent(st.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};Ai=new WeakSet;_a=function(){Me(this,Nr,qo).call(this),clearTimeout(Ie(this,ba));let t=parseInt(this.autohide);t<0||Ht(this,ba,setTimeout(()=>{Me(this,ga,Or).call(this)},t*1e3))};d.customElements.get("media-container")||d.customElements.define("media-container",Aa);var au=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ae=(t,e,i)=>(au(t,e,"read from private field"),i?i.call(t):e.get(t)),Ta=(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)},Pr=(t,e,i,a)=>(au(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ti,yi,Ur,$t,ut,Tt,$e=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){Ta(this,ut),Ta(this,Ti,void 0),Ta(this,yi,void 0),Ta(this,Ur,void 0),Ta(this,$t,new Set),Pr(this,Ti,e),Pr(this,yi,i),Pr(this,Ur,new Set(a))}[Symbol.iterator](){return ae(this,ut,Tt).values()}get length(){return ae(this,ut,Tt).size}get value(){var e;return(e=[...ae(this,ut,Tt)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Pr(this,$t,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...ae(this,ut,Tt)][e]}values(){return ae(this,ut,Tt).values()}forEach(e,i){ae(this,ut,Tt).forEach(e,i)}add(...e){var i,a;e.forEach(r=>ae(this,$t).add(r)),!(this.value===""&&!((i=ae(this,Ti))!=null&&i.hasAttribute(`${ae(this,yi)}`)))&&((a=ae(this,Ti))==null||a.setAttribute(`${ae(this,yi)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>ae(this,$t).delete(a)),(i=ae(this,Ti))==null||i.setAttribute(`${ae(this,yi)}`,`${this.value}`)}contains(e){return ae(this,ut,Tt).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}};Ti=new WeakMap;yi=new WeakMap;Ur=new WeakMap;$t=new WeakMap;ut=new WeakSet;Tt=function(){return ae(this,$t).size?ae(this,$t):ae(this,Ur)};var Fh=(t="")=>t.split(/\s+/),ru=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?ve.CAPTIONS:ve.SUBTITLES,language:i,label:r}},Wt=(t="",e={})=>Fh(t).map(i=>{let a=ru(i);return{...e,...a}}),Zo=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?ru(e):e):typeof t=="string"?Wt(t):[t]:[],Br=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,ct=(t=[])=>Array.prototype.map.call(t,Br).join(" "),Kh=(t,e)=>i=>i[t]===e,nu=t=>{let e=Object.entries(t).map(([i,a])=>Kh(i,a));return i=>e.every(a=>a(i))},Ft=(t,e=[],i=[])=>{let a=Zo(i).map(nu),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=t})},Kt=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:nu(e);return Array.from(t.textTracks).filter(i)},Hr=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)};var su=t=>{var e;let{media:i,fullscreenElement:a}=t,r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let n=(e=a[r])==null?void 0:e.call(a);if(n instanceof Promise)return n.catch(()=>{})}else i!=null&&i.webkitEnterFullscreen?i.webkitEnterFullscreen():i!=null&&i.requestFullscreen&&i.requestFullscreen()},ou="exitFullscreen"in h?"exitFullscreen":"webkitExitFullscreen"in h?"webkitExitFullscreen":"webkitCancelFullScreen"in h?"webkitCancelFullScreen":void 0,lu=t=>{var e;let{documentElement:i}=t;if(ou){let a=(e=i==null?void 0:i[ou])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},ya="fullscreenElement"in h?"fullscreenElement":"webkitFullscreenElement"in h?"webkitFullscreenElement":void 0,Vh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[ya];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===Pd.FULLSCREEN?i:a},du=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let n=Vh(t);if(!n)return!1;if(n===r||n===i)return!0;if(n.localName.includes("-")){let s=n.shadowRoot;if(!(ya in s))return ue(n,r);for(;s!=null&&s[ya];){if(s[ya]===r)return!0;s=(e=s[ya])==null?void 0:e.shadowRoot}}return!1},Yh="fullscreenEnabled"in h?"fullscreenEnabled":"webkitFullscreenEnabled"in h?"webkitFullscreenEnabled":void 0,uu=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[Yh])||i&&"webkitSupportsFullscreen"in i};var $r,zo=()=>{var t,e;return $r||($r=(e=(t=h)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),$r)},cu=async(t=zo())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([Gh(t,i.signal),qh(t,e)]);return i.abort(),a},Gh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),qh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await Tr(10)}return t.volume!==e},Zh=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),Qo=(t=zo())=>d.matchMedia("(display-mode: standalone)").matches&&Zh?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",Xo=(t=zo())=>uu({documentElement:h,media:t}),mu=Xo(),hu=Qo(),pu=!!d.WebKitPlaybackTargetAvailabilityEvent,fu=!!d.chrome;var ki=t=>Kt(t.media,e=>[ve.SUBTITLES,ve.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),Jo=t=>Kt(t.media,e=>e.mode===_t.SHOWING&&[ve.SUBTITLES,ve.CAPTIONS].includes(e.kind)),Wr=(t,e)=>{let i=ki(t),a=Jo(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)Ft(_t.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let n=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let _=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=_?[_,...globalThis.navigator.languages]:globalThis.navigator.languages,f=i.filter(v=>g.some(P=>v.language.toLowerCase().startsWith(P.split("-")[0]))).sort((v,P)=>{let A=g.findIndex(U=>v.language.toLowerCase().startsWith(U.split("-")[0])),M=g.findIndex(U=>P.language.toLowerCase().startsWith(U.split("-")[0]));return A-M});f[0]&&(n=f[0])}let{language:l,label:u,kind:c}=n;Ft(_t.DISABLED,i,a),Ft(_t.SHOWING,i,[{language:l,label:u,kind:c}])}}},Fr=(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)?zh(t,e):Object.entries(t).every(([i,a])=>i in e&&Fr(a,e[i])),zh=(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,n)=>Fr(r,e[n])):!0};var Qh=Object.values(we),Kr,Xh=cu().then(t=>(Kr=t,Kr)),vu=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=d.customElements.get(i);a&&e instanceof a||(await d.customElements.whenDefined(i),d.customElements.upgrade(e))}))},ka={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}=e;i&&(i.muted=t)},mediaEvents:["volumechange"]},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}=e;if(i){try{t==null?d.localStorage.removeItem("media-chrome-pref-volume"):d.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch{}Number.isFinite(+t)&&(i.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noVolumePref:i}}=e;if(!i)try{let a=d.localStorage.getItem("media-chrome-pref-volume");if(a==null)return;ka.mediaVolume.set(+a,e),t(+a)}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||!bi(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,n)=>[Number(a.start(n).toFixed(3)),Number(a.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(t){let{media:e,options:{defaultStreamType:i}={}}=t,a=[we.LIVE,we.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(Qh.includes(r))return r===we.UNKNOWN?a:r;let n=e.duration;return n===1/0?we.LIVE:Number.isFinite(n)?we.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=ka.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===we.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(!(ka.mediaStreamType.get(t)===we.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let n=r.end(r.length-1)-i;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(t){return ki(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return Jo(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:n}=e;if(!r)return;let s=l=>{var u;!n.defaultSubtitles||l&&![ve.CAPTIONS,ve.SUBTITLES].includes((u=l==null?void 0:l.track)==null?void 0:u.kind)||Wr(e,!0)};return(i=r.textTracks)==null||i.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),s(),()=>{var l,u;(l=r.textTracks)==null||l.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]=Kt(i,{kind:ve.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:n,endTime:s})=>({text:r,startTime:n,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]'),n=(i=a.shadowRoot)==null?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",t),n==null||n.addEventListener("load",t),()=>{r==null||r.removeEventListener("load",t),n==null||n.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 n=r.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===a)return!0;n=(i=n.pictureInPictureElement)==null?void 0:i.shadowRoot}}return!1},set(t,e){let{media:i}=e;if(i)if(t){if(!h.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 n=()=>{i.removeEventListener("loadedmetadata",s),i.preload="none"},s=()=>{i.requestPictureInPicture().catch(a),n()};i.addEventListener("loadedmetadata",s),i.preload="metadata",setTimeout(()=>{i.readyState===0&&a(),n()},1e3)}else throw r}else throw r})}else h.pictureInPictureElement&&h.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,n=>n.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 du(t)},set(t,e){t?su(e):lu(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&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("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(!mu||!Xo(e))return ke.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!hu||!Qo(e))return ke.UNSUPPORTED}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(Kr===!1||(e==null?void 0:e.volume)==null)return ke.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{Kr==null&&Xh.then(e=>t(e?void 0:ke.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!fu||!((i=a==null?void 0:a.remote)!=null&&i.state))return ke.UNSUPPORTED;if(!(e==null||e==="available"))return ke.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(n=>{t({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(t,e){if(!pu)return ke.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return ke.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(n=>{t({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(t){var e;let{media:i}=t;if(!(i!=null&&i.videoRenditions))return ke.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return ke.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return ke.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return ke.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}};var Eu={[p.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,n;let{media:s}=e,l=i!=null?i:void 0,u,c;if(s&&l!=null){let[v]=Kt(s,{kind:ve.METADATA,label:"thumbnails"}),P=Array.prototype.find.call((a=v==null?void 0:v.cues)!=null?a:[],(A,M,U)=>M===0?A.endTime>l:M===U.length-1?A.startTime<=l:A.startTime<=l&&A.endTime>l);if(P){let A=/'^(?:[a-z]+:)?\/\//i.test(P.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,M=new URL(P.text,A);c=new URLSearchParams(M.hash).get("#xywh").split(",").map(ee=>+ee),u=M.href}}let _=t.mediaDuration.get(e),f=(n=t.mediaChaptersCues.get(e).find((v,P,A)=>P===A.length-1&&_===v.endTime?v.startTime<=l&&v.endTime>=l:v.startTime<=l&&v.endTime>l))==null?void 0:n.text;return i!=null&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:u,mediaPreviewCoords:c,mediaPreviewChapter:f}},[p.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[p.MEDIA_PLAY_REQUEST](t,e){var i;let a="mediaPaused";if(t.mediaStreamType.get(e)===we.LIVE){let s=!(t.mediaTargetLiveWindow.get(e)>0),l=(i=t.mediaSeekable.get(e))==null?void 0:i[1];s&&l&&t.mediaCurrentTime.set(l,e)}t[a].set(!1,e)},[p.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[p.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[p.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[p.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)},[p.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[p.MEDIA_SEEK_TO_LIVE_REQUEST](t,e){var i;let a="mediaCurrentTime",r=(i=t.mediaSeekable.get(e))==null?void 0:i[1];Number.isNaN(Number(r))||t[a].set(r,e)},[p.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,n=ki(e),s=Zo(i),l=(a=s[0])==null?void 0:a.language;l&&!r.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Ft(_t.SHOWING,n,s)},[p.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=ki(e),r=i!=null?i:[];Ft(_t.DISABLED,a,r)},[p.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){Wr(e,i)},[p.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[p.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[p.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[p.MEDIA_ENTER_FULLSCREEN_REQUEST](t,e){let i="mediaIsFullscreen";t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[p.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[p.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var bu=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=ka,requestMap:r=Eu,options:n={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],u={options:{...n}},c=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),_=A=>{A!=null&&(Fr(A,c)||(c=Object.freeze({...c,...A}),l.forEach(M=>M(c))))},g=()=>{let A=Object.entries(a).reduce((M,[U,{get:ee}])=>(M[U]=ee(u),M),{});_(A)},f={},v,P=async(A,M)=>{var U,ee,_e,gt,nt,ta,ia,aa,ra,na,oa,sa,la,da,ua,ca;let gr=!!v;if(v={...u,...v!=null?v:{},...A},gr)return;await vu(...Object.values(A));let ot=l.length>0&&M===0&&s,dd=u.media!==v.media,ud=((U=u.media)==null?void 0:U.textTracks)!==((ee=v.media)==null?void 0:ee.textTracks),cd=((_e=u.media)==null?void 0:_e.videoRenditions)!==((gt=v.media)==null?void 0:gt.videoRenditions),md=((nt=u.media)==null?void 0:nt.audioTracks)!==((ta=v.media)==null?void 0:ta.audioTracks),hd=((ia=u.media)==null?void 0:ia.remote)!==((aa=v.media)==null?void 0:aa.remote),pd=u.documentElement!==v.documentElement,fd=!!u.media&&(dd||ot),vd=!!((ra=u.media)!=null&&ra.textTracks)&&(ud||ot),Ed=!!((na=u.media)!=null&&na.videoRenditions)&&(cd||ot),bd=!!((oa=u.media)!=null&&oa.audioTracks)&&(md||ot),gd=!!((sa=u.media)!=null&&sa.remote)&&(hd||ot),_d=!!u.documentElement&&(pd||ot),Ad=fd||vd||Ed||bd||gd||_d,fi=l.length===0&&M===1&&s,Td=!!v.media&&(dd||fi),yd=!!((la=v.media)!=null&&la.textTracks)&&(ud||fi),kd=!!((da=v.media)!=null&&da.videoRenditions)&&(cd||fi),Sd=!!((ua=v.media)!=null&&ua.audioTracks)&&(md||fi),Id=!!((ca=v.media)!=null&&ca.remote)&&(hd||fi),Cd=!!v.documentElement&&(pd||fi),Md=Td||yd||kd||Sd||Id||Cd;if(!(Ad||Md)){Object.entries(v).forEach(([F,ma])=>{u[F]=ma}),g(),v=void 0;return}Object.entries(a).forEach(([F,{get:ma,mediaEvents:nh=[],textTracksEvents:oh=[],videoRenditionsEvents:sh=[],audioTracksEvents:lh=[],remoteEvents:dh=[],rootEvents:uh=[],stateOwnersUpdateHandlers:ch=[]}])=>{f[F]||(f[F]={});let Ae=X=>{let Te=ma(u,X);_({[F]:Te})},ie;ie=f[F].mediaEvents,nh.forEach(X=>{ie&&fd&&(u.media.removeEventListener(X,ie),f[F].mediaEvents=void 0),Td&&(v.media.addEventListener(X,Ae),f[F].mediaEvents=Ae)}),ie=f[F].textTracksEvents,oh.forEach(X=>{var Te,Le;ie&&vd&&((Te=u.media.textTracks)==null||Te.removeEventListener(X,ie),f[F].textTracksEvents=void 0),yd&&((Le=v.media.textTracks)==null||Le.addEventListener(X,Ae),f[F].textTracksEvents=Ae)}),ie=f[F].videoRenditionsEvents,sh.forEach(X=>{var Te,Le;ie&&Ed&&((Te=u.media.videoRenditions)==null||Te.removeEventListener(X,ie),f[F].videoRenditionsEvents=void 0),kd&&((Le=v.media.videoRenditions)==null||Le.addEventListener(X,Ae),f[F].videoRenditionsEvents=Ae)}),ie=f[F].audioTracksEvents,lh.forEach(X=>{var Te,Le;ie&&bd&&((Te=u.media.audioTracks)==null||Te.removeEventListener(X,ie),f[F].audioTracksEvents=void 0),Sd&&((Le=v.media.audioTracks)==null||Le.addEventListener(X,Ae),f[F].audioTracksEvents=Ae)}),ie=f[F].remoteEvents,dh.forEach(X=>{var Te,Le;ie&&gd&&((Te=u.media.remote)==null||Te.removeEventListener(X,ie),f[F].remoteEvents=void 0),Id&&((Le=v.media.remote)==null||Le.addEventListener(X,Ae),f[F].remoteEvents=Ae)}),ie=f[F].rootEvents,uh.forEach(X=>{ie&&_d&&(u.documentElement.removeEventListener(X,ie),f[F].rootEvents=void 0),Cd&&(v.documentElement.addEventListener(X,Ae),f[F].rootEvents=Ae)});let Rd=f[F].stateOwnersUpdateHandlers;ch.forEach(X=>{Rd&&Ad&&Rd(),Md&&(f[F].stateOwnersUpdateHandlers=X(Ae,v))})}),Object.entries(v).forEach(([F,ma])=>{u[F]=ma}),g(),v=void 0};return P({media:t,fullscreenElement:e,documentElement:i,options:n}),{dispatch(A){let{type:M,detail:U}=A;if(r[M]&&c.mediaErrorCode==null){_(r[M](a,u,A));return}M==="mediaelementchangerequest"?P({media:U}):M==="fullscreenelementchangerequest"?P({fullscreenElement:U}):M==="documentelementchangerequest"?P({documentElement:U}):M==="optionschangerequest"&&Object.entries(U!=null?U:{}).forEach(([ee,_e])=>{u.options[ee]=_e})},getState(){return c},subscribe(A){return P({},l.length+1),l.push(A),A(c),()=>{let M=l.indexOf(A);M>=0&&(P({},l.length-1),l.splice(M,1))}}}};var is=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},N=(t,e,i)=>(is(t,e,"read from private field"),i?i.call(t):e.get(t)),mt=(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)},yt=(t,e,i,a)=>(is(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),kt=(t,e,i)=>(is(t,e,"access private method"),i),Yt,Sa,Z,Ia,We,Vr,Yr,jo,Si,Ca,Gr,es,yu=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],gu=10,T={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys",NO_VOLUME_PREF:"novolumepref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_DEFAULT_STORE:"nodefaultstore",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset"},qr=class extends Aa{constructor(){super(),mt(this,Yr),mt(this,Si),mt(this,Gr),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,mt(this,Yt,new $e(this,T.HOTKEYS)),mt(this,Sa,void 0),mt(this,Z,void 0),mt(this,Ia,void 0),mt(this,We,void 0),mt(this,Vr,i=>{var a;(a=N(this,Z))==null||a.dispatch(i)}),this.associateElement(this);let e={};yt(this,Ia,i=>{Object.entries(i).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let n=a.toLowerCase(),s=new d.CustomEvent(Nd[n],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(T.NO_HOTKEYS,T.HOTKEYS,T.DEFAULT_STREAM_TYPE,T.DEFAULT_SUBTITLES,T.DEFAULT_DURATION)}get mediaStore(){return N(this,Z)}set mediaStore(e){var i,a;if(N(this,Z)&&((i=N(this,We))==null||i.call(this),yt(this,We,void 0)),yt(this,Z,e),!N(this,Z)&&!this.hasAttribute(T.NO_DEFAULT_STORE)){kt(this,Yr,jo).call(this);return}yt(this,We,(a=N(this,Z))==null?void 0:a.subscribe(N(this,Ia)))}get fullscreenElement(){var e;return(e=N(this,Sa))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(T.FULLSCREEN_ELEMENT)&&this.removeAttribute(T.FULLSCREEN_ELEMENT),yt(this,Sa,e),(i=N(this,Z))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return y(this,T.DEFAULT_SUBTITLES)}set defaultSubtitles(e){k(this,T.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return I(this,T.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){C(this,T.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return w(this,T.DEFAULT_DURATION)}set defaultDuration(e){O(this,T.DEFAULT_DURATION,e)}get noHotkeys(){return y(this,T.NO_HOTKEYS)}set noHotkeys(e){k(this,T.NO_HOTKEYS,e)}get keysUsed(){return I(this,T.KEYS_USED)}set keysUsed(e){C(this,T.KEYS_USED,e)}get liveEdgeOffset(){return w(this,T.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){O(this,T.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return y(this,T.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){k(this,T.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return y(this,T.NO_VOLUME_PREF)}set noVolumePref(e){k(this,T.NO_VOLUME_PREF,e)}get noSubtitlesLangPref(){return y(this,T.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){k(this,T.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return y(this,T.NO_DEFAULT_STORE)}set noDefaultStore(e){k(this,T.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,n,s,l,u,c;if(super.attributeChangedCallback(e,i,a),e===T.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(T.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===T.HOTKEYS)N(this,Yt).value=a;else if(e===T.DEFAULT_SUBTITLES&&a!==i)(r=N(this,Z))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES)}});else if(e===T.DEFAULT_STREAM_TYPE)(s=N(this,Z))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===T.LIVE_EDGE_OFFSET)(l=N(this,Z))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0}});else if(e===T.FULLSCREEN_ELEMENT){let _=a?(u=this.getRootNode())==null?void 0:u.getElementById(a):void 0;yt(this,Sa,_),(c=N(this,Z))==null||c.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,i;!N(this,Z)&&!this.hasAttribute(T.NO_DEFAULT_STORE)&&kt(this,Yr,jo).call(this),(e=N(this,Z))==null||e.dispatch({type:"documentelementchangerequest",detail:h}),super.connectedCallback(),N(this,Z)&&!N(this,We)&&yt(this,We,(i=N(this,Z))==null?void 0:i.subscribe(N(this,Ia))),this.enableHotkeys()}disconnectedCallback(){var e,i,a,r;(e=super.disconnectedCallback)==null||e.call(this),N(this,Z)&&((i=N(this,Z))==null||i.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=N(this,Z))==null||a.dispatch({type:p.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),N(this,We)&&((r=N(this,We))==null||r.call(this),yt(this,We,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=N(this,Z))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=N(this,Z))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){Tu(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),n=ap(e,a,r);Object.values(p).forEach(s=>{e.addEventListener(s,N(this,Vr))}),i.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(!i.has(e))return;i.get(e)(),i.delete(e),Object.values(p).forEach(r=>{e.removeEventListener(r,N(this,Vr))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),N(this,Z)&&Object.entries(N(this,Z).getState()).forEach(([r,n])=>{Tu([e],r,n)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",kt(this,Gr,es))}disableHotkeys(){this.removeEventListener("keydown",kt(this,Gr,es)),this.removeEventListener("keyup",kt(this,Si,Ca))}get hotkeys(){return I(this,T.HOTKEYS)}set hotkeys(e){C(this,T.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,n,s;let l=e.target;if(((r=(a=(i=l.getAttribute(T.KEYS_USED))==null?void 0:i.split(" "))!=null?a:l==null?void 0:l.keysUsed)!=null?r:[]).map(f=>f==="Space"?" ":f).filter(Boolean).includes(e.key))return;let c,_,g;if(!N(this,Yt).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&N(this,Yt).contains("nospace")))switch(e.key){case" ":case"k":c=N(this,Z).getState().mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"m":c=this.mediaStore.getState().mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"f":c=this.mediaStore.getState().mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{let f=this.hasAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET):gu;_=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-f,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowRight":{let f=this.hasAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET):gu;_=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+f,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}default:break}}};Yt=new WeakMap;Sa=new WeakMap;Z=new WeakMap;Ia=new WeakMap;We=new WeakMap;Vr=new WeakMap;Yr=new WeakSet;jo=function(){var t;this.mediaStore=bu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(T.DEFAULT_DURATION)?+this.getAttribute(T.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,noVolumePref:this.hasAttribute(T.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(T.NO_SUBTITLES_LANG_PREF)}})};Si=new WeakSet;Ca=function(t){let{key:e}=t;if(!yu.includes(e)){this.removeEventListener("keyup",kt(this,Si,Ca));return}this.keyboardShortcutHandler(t)};Gr=new WeakSet;es=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!yu.includes(a)){this.removeEventListener("keyup",kt(this,Si,Ca));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(N(this,Yt).contains(`no${a.toLowerCase()}`)||a===" "&&N(this,Yt).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",kt(this,Si,Ca),{once:!0})};var Jh=Object.values(o),jh=Object.values(No),ku=t=>{var e,i,a,r;let{observedAttributes:n}=t.constructor;!n&&((e=t.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(t),{observedAttributes:n}=t.constructor);let s=(r=(a=(i=t==null?void 0:t.getAttribute)==null?void 0:i.call(t,R.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>Jh.includes(l)):[]},ep=t=>{var e,i;return(e=t.nodeName)!=null&&e.includes("-")&&d.customElements.get((i=t.nodeName)==null?void 0:i.toLowerCase())&&!(t instanceof d.customElements.get(t.nodeName.toLowerCase()))&&d.customElements.upgrade(t),jh.some(a=>a in t)},ts=t=>ep(t)||!!ku(t).length,_u=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},Au={[o.MEDIA_SUBTITLES_LIST]:ct,[o.MEDIA_SUBTITLES_SHOWING]:ct,[o.MEDIA_SEEKABLE]:_u,[o.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(_u).join(" "),[o.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[o.MEDIA_RENDITION_LIST]:Ud,[o.MEDIA_AUDIO_TRACK_LIST]:Hd},tp=async(t,e,i)=>{var a,r;if(t.isConnected||await Tr(0),typeof i=="boolean"||i==null)return k(t,e,i);if(typeof i=="number")return O(t,e,i);if(typeof i=="string")return C(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let n=(r=(a=Au[e])==null?void 0:a.call(Au,i))!=null?r:i;return t.setAttribute(e,n)},ip=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},Vt=(t,e)=>{if(ip(t))return;let i=(r,n)=>{var s,l;ts(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...u,...c].forEach(g=>Vt(g,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!ts(t)){d.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},Tu=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=ku(a),n=e.toLowerCase();r.includes(n)&&tp(a,n,i)})},ap=(t,e,i)=>{Vt(t,e);let a=_=>{var g;let f=(g=_==null?void 0:_.composedPath()[0])!=null?g:_.target;e(f)},r=_=>{var g;let f=(g=_==null?void 0:_.composedPath()[0])!=null?g:_.target;i(f)};t.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=_=>{_.forEach(g=>{let{addedNodes:f=[],removedNodes:v=[],type:P,target:A,attributeName:M}=g;P==="childList"?(Array.prototype.forEach.call(f,U=>Vt(U,e)),Array.prototype.forEach.call(v,U=>Vt(U,i))):P==="attributes"&&M===R.MEDIA_CHROME_ATTRIBUTES&&(ts(A)?e(A):i(A))})},s=[],l=_=>{let g=_.target;g.name!=="media"&&(s.forEach(f=>Vt(f,i)),s=[...g.assignedElements({flatten:!0})],s.forEach(f=>Vt(f,e)))};t.addEventListener("slotchange",l);let u=new MutationObserver(n);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{Vt(t,i),t.removeEventListener("slotchange",l),u.disconnect(),t.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",qr);var as=qr;var ns=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},j=(t,e,i)=>(ns(t,e,"read from private field"),i?i.call(t):e.get(t)),Ii=(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)},Zr=(t,e,i,a)=>(ns(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),rp=(t,e,i)=>(ns(t,e,"access private method"),i),Fe,Mi,It,Ci,zr,rs,Su,St={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"},Iu=h.createElement("template");Iu.innerHTML=`
148
+ `;var Nh=Object.values(o),Ph="sm:384 md:576 lg:768 xl:960";function Uh(t){tu(t.target,t.contentRect.width)}function tu(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(I.BREAKPOINTS))!=null?i:Ph,r=Bh(a),n=Hh(r,e),s=!1;if(Object.keys(r).forEach(l=>{if(n.includes(l)){t.hasAttribute(`breakpoint${l}`)||(t.setAttribute(`breakpoint${l}`,""),s=!0);return}t.hasAttribute(`breakpoint${l}`)&&(t.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(nt.BREAKPOINTS_CHANGE,{detail:n});t.dispatchEvent(l)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(nt.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Bh(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function Hh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var _a=class extends d.HTMLElement{constructor(){super(),Te(this,Wo),Te(this,Fo),Te(this,Vo),Te(this,ba),Te(this,Dr),Te(this,gi),Te(this,Lr,0),Te(this,Ei,null),Te(this,Ea,null),Te(this,bi,void 0),this.breakpointsComputed=!1,Te(this,wr,new MutationObserver(Ie(this,Wo,Xd).bind(this))),Te(this,va,!1),Te(this,Rr,i=>{ke(this,va)||(setTimeout(()=>{Uh(i),Ut(this,va,!1)},0),Ut(this,va,!0))}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(eu.content.cloneNode(!0)));let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){ke(this,Ei)&&this.mediaUnsetCallback(ke(this,Ei));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[I.AUTOHIDE,I.GESTURES_DISABLED].concat(Nh).filter(e=>![o.MEDIA_RENDITION_LIST,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_CHAPTERS_CUES,o.MEDIA_WIDTH,o.MEDIA_HEIGHT,o.MEDIA_ERROR,o.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,i,a){e.toLowerCase()==I.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&&(Ut(this,Ei,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;ke(this,wr).observe(this,{childList:!0,subtree:!0}),ot(this,ke(this,Rr));let a=this.getAttribute(I.AUDIO)!=null?f("audio player"):f("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(I.USER_INACTIVE,""),tu(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=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;ke(this,wr).disconnect(),st(this,ke(this,Rr)),this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ut(this,Ei,null)}handleEvent(e){switch(e.type){case"pointerdown":Ut(this,Lr,e.timeStamp);break;case"pointermove":Ie(this,Fo,Jd).call(this,e);break;case"pointerup":Ie(this,Vo,jd).call(this,e);break;case"mouseleave":Ie(this,ba,xr).call(this);break;case"mouseup":this.removeAttribute(I.KEYBOARD_CONTROL);break;case"keyup":Ie(this,gi,ga).call(this),this.setAttribute(I.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Ut(this,bi,isNaN(i)?0:i)}get autohide(){return(ke(this,bi)===void 0?2:ke(this,bi)).toString()}get breakpoints(){return C(this,I.BREAKPOINTS)}set breakpoints(e){M(this,I.BREAKPOINTS,e)}get audio(){return k(this,I.AUDIO)}set audio(e){S(this,I.AUDIO,e)}get gesturesDisabled(){return k(this,I.GESTURES_DISABLED)}set gesturesDisabled(e){S(this,I.GESTURES_DISABLED,e)}get keyboardControl(){return k(this,I.KEYBOARD_CONTROL)}set keyboardControl(e){S(this,I.KEYBOARD_CONTROL,e)}get noAutohide(){return k(this,I.NO_AUTOHIDE)}set noAutohide(e){S(this,I.NO_AUTOHIDE,e)}get userInteractive(){return k(this,I.USER_INACTIVE)}set userInteractive(e){S(this,I.USER_INACTIVE,e)}};Lr=new WeakMap;Ei=new WeakMap;Ea=new WeakMap;bi=new WeakMap;wr=new WeakMap;Wo=new WeakSet;Xd=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 n=i.previousSibling&&i.previousSibling.previousElementSibling;if(!n||!e)this.mediaUnsetCallback(r);else{let s=n.slot!=="media";for(;(n=n.previousSibling)!==null;)n.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(r)}}if(e)for(let r of i.addedNodes)r===e&&this.handleMediaUpdated(e)}};va=new WeakMap;Rr=new WeakMap;Fo=new WeakSet;Jd=function(t){t.pointerType!=="mouse"&&t.timeStamp-ke(this,Lr)<250||(Ie(this,Dr,Go).call(this),clearTimeout(ke(this,Ea)),[this,this.media].includes(t.target)&&Ie(this,gi,ga).call(this))};Vo=new WeakSet;jd=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(I.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Ie(this,ba,xr).call(this):Ie(this,gi,ga).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Ie(this,gi,ga).call(this)};ba=new WeakSet;xr=function(){if(ke(this,bi)<0||this.hasAttribute(I.USER_INACTIVE))return;this.setAttribute(I.USER_INACTIVE,"");let t=new d.CustomEvent(nt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};Dr=new WeakSet;Go=function(){if(!this.hasAttribute(I.USER_INACTIVE))return;this.removeAttribute(I.USER_INACTIVE);let t=new d.CustomEvent(nt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};gi=new WeakSet;ga=function(){Ie(this,Dr,Go).call(this),clearTimeout(ke(this,Ea));let t=parseInt(this.autohide);t<0||Ut(this,Ea,setTimeout(()=>{Ie(this,ba,xr).call(this)},t*1e3))};d.customElements.get("media-container")||d.customElements.define("media-container",_a);var iu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},te=(t,e,i)=>(iu(t,e,"read from private field"),i?i.call(t):e.get(t)),Aa=(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)},Or=(t,e,i,a)=>(iu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),_i,Ai,Nr,Bt,lt,_t,Be=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){Aa(this,lt),Aa(this,_i,void 0),Aa(this,Ai,void 0),Aa(this,Nr,void 0),Aa(this,Bt,new Set),Or(this,_i,e),Or(this,Ai,i),Or(this,Nr,new Set(a))}[Symbol.iterator](){return te(this,lt,_t).values()}get length(){return te(this,lt,_t).size}get value(){var e;return(e=[...te(this,lt,_t)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Or(this,Bt,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...te(this,lt,_t)][e]}values(){return te(this,lt,_t).values()}forEach(e,i){te(this,lt,_t).forEach(e,i)}add(...e){var i,a;e.forEach(r=>te(this,Bt).add(r)),!(this.value===""&&!((i=te(this,_i))!=null&&i.hasAttribute(`${te(this,Ai)}`)))&&((a=te(this,_i))==null||a.setAttribute(`${te(this,Ai)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>te(this,Bt).delete(a)),(i=te(this,_i))==null||i.setAttribute(`${te(this,Ai)}`,`${this.value}`)}contains(e){return te(this,lt,_t).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}};_i=new WeakMap;Ai=new WeakMap;Nr=new WeakMap;Bt=new WeakMap;lt=new WeakSet;_t=function(){return te(this,Bt).size?te(this,Bt):te(this,Nr)};var $h=(t="")=>t.split(/\s+/),au=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?pe.CAPTIONS:pe.SUBTITLES,language:i,label:r}},Ht=(t="",e={})=>$h(t).map(i=>{let a=au(i);return{...e,...a}}),Yo=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?au(e):e):typeof t=="string"?Ht(t):[t]:[],Pr=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,dt=(t=[])=>Array.prototype.map.call(t,Pr).join(" "),Wh=(t,e)=>i=>i[t]===e,ru=t=>{let e=Object.entries(t).map(([i,a])=>Wh(i,a));return i=>e.every(a=>a(i))},$t=(t,e=[],i=[])=>{let a=Yo(i).map(ru),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=t})},Wt=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:ru(e);return Array.from(t.textTracks).filter(i)},Ur=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)};var ou=t=>{var e;let{media:i,fullscreenElement:a}=t,r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let n=(e=a[r])==null?void 0:e.call(a);if(n instanceof Promise)return n.catch(()=>{})}else i!=null&&i.webkitEnterFullscreen?i.webkitEnterFullscreen():i!=null&&i.requestFullscreen&&i.requestFullscreen()},nu="exitFullscreen"in h?"exitFullscreen":"webkitExitFullscreen"in h?"webkitExitFullscreen":"webkitCancelFullScreen"in h?"webkitCancelFullScreen":void 0,su=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(()=>{})}},ya="fullscreenElement"in h?"fullscreenElement":"webkitFullscreenElement"in h?"webkitFullscreenElement":void 0,Fh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[ya];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===Nd.FULLSCREEN?i:a},lu=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let n=Fh(t);if(!n)return!1;if(n===r||n===i)return!0;if(n.localName.includes("-")){let s=n.shadowRoot;if(!(ya in s))return le(n,r);for(;s!=null&&s[ya];){if(s[ya]===r)return!0;s=(e=s[ya])==null?void 0:e.shadowRoot}}return!1},Vh="fullscreenEnabled"in h?"fullscreenEnabled":"webkitFullscreenEnabled"in h?"webkitFullscreenEnabled":void 0,du=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[Vh])||i&&"webkitSupportsFullscreen"in i};var Br,qo=()=>{var t,e;return Br||(Br=(e=(t=h)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Br)},uu=async(t=qo())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([Kh(t,i.signal),Gh(t,e)]);return i.abort(),a},Kh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),Gh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await _r(10)}return t.volume!==e},Yh=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),Zo=(t=qo())=>d.matchMedia("(display-mode: standalone)").matches&&Yh?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",zo=(t=qo())=>du({documentElement:h,media:t}),cu=zo(),mu=Zo(),hu=!!d.WebKitPlaybackTargetAvailabilityEvent,pu=!!d.chrome;var yi=t=>Wt(t.media,e=>[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),Qo=t=>Wt(t.media,e=>e.mode===bt.SHOWING&&[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)),Hr=(t,e)=>{let i=yi(t),a=Qo(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)$t(bt.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let n=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let A=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),_=A?[A,...globalThis.navigator.languages]:globalThis.navigator.languages,v=i.filter(E=>_.some(P=>E.language.toLowerCase().startsWith(P.split("-")[0]))).sort((E,P)=>{let y=_.findIndex(U=>E.language.toLowerCase().startsWith(U.split("-")[0])),w=_.findIndex(U=>P.language.toLowerCase().startsWith(U.split("-")[0]));return y-w});v[0]&&(n=v[0])}let{language:l,label:u,kind:c}=n;$t(bt.DISABLED,i,a),$t(bt.SHOWING,i,[{language:l,label:u,kind:c}])}}},$r=(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)?qh(t,e):Object.entries(t).every(([i,a])=>i in e&&$r(a,e[i])),qh=(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,n)=>$r(r,e[n])):!0};var Zh=Object.values(we),Wr,zh=uu().then(t=>(Wr=t,Wr)),fu=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=d.customElements.get(i);a&&e instanceof a||(await d.customElements.whenDefined(i),d.customElements.upgrade(e))}))},Ti={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}=e;if(i){try{d.localStorage.setItem("media-chrome-pref-muted",t?"true":"false")}catch(a){console.debug("Error setting muted pref",a)}i.muted=t}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noMutedPref:i}}=e,{media:a}=e;if(!(!a||a.muted||i))try{let r=d.localStorage.getItem("media-chrome-pref-muted")==="true";Ti.mediaMuted.set(r,e),t(r)}catch(r){console.debug("Error getting muted pref",r)}}]},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}=e;if(i){try{t==null?d.localStorage.removeItem("media-chrome-pref-volume"):d.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch(a){console.debug("Error setting volume pref",a)}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=d.localStorage.getItem("media-chrome-pref-volume");if(r==null)return;Ti.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||!vi(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,n)=>[Number(a.start(n).toFixed(3)),Number(a.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(t){let{media:e,options:{defaultStreamType:i}={}}=t,a=[we.LIVE,we.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(Zh.includes(r))return r===we.UNKNOWN?a:r;let n=e.duration;return n===1/0?we.LIVE:Number.isFinite(n)?we.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=Ti.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===we.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(!(Ti.mediaStreamType.get(t)===we.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let n=r.end(r.length-1)-i;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(t){return yi(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return Qo(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:n}=e;if(!r)return;let s=l=>{var u;!n.defaultSubtitles||l&&![pe.CAPTIONS,pe.SUBTITLES].includes((u=l==null?void 0:l.track)==null?void 0:u.kind)||Hr(e,!0)};return(i=r.textTracks)==null||i.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),s(),()=>{var l,u;(l=r.textTracks)==null||l.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]=Wt(i,{kind:pe.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:n,endTime:s})=>({text:r,startTime:n,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]'),n=(i=a.shadowRoot)==null?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",t),n==null||n.addEventListener("load",t),()=>{r==null||r.removeEventListener("load",t),n==null||n.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("-")?le(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let n=r.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===a)return!0;n=(i=n.pictureInPictureElement)==null?void 0:i.shadowRoot}}return!1},set(t,e){let{media:i}=e;if(i)if(t){if(!h.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 n=()=>{i.removeEventListener("loadedmetadata",s),i.preload="none"},s=()=>{i.requestPictureInPicture().catch(a),n()};i.addEventListener("loadedmetadata",s),i.preload="metadata",setTimeout(()=>{i.readyState===0&&a(),n()},1e3)}else throw r}else throw r})}else h.pictureInPictureElement&&h.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,n=>n.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 lu(t)},set(t,e){t?ou(e):su(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&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("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(!cu||!zo(e))return ye.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!mu||!Zo(e))return ye.UNSUPPORTED}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(Wr===!1||(e==null?void 0:e.volume)==null)return ye.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{Wr==null&&zh.then(e=>t(e?void 0:ye.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!pu||!((i=a==null?void 0:a.remote)!=null&&i.state))return ye.UNSUPPORTED;if(!(e==null||e==="available"))return ye.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(n=>{t({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(t,e){if(!hu)return ye.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return ye.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(n=>{t({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(t){var e;let{media:i}=t;if(!(i!=null&&i.videoRenditions))return ye.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return ye.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return ye.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return ye.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}};var vu={[p.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,n;let{media:s}=e,l=i!=null?i:void 0,u,c;if(s&&l!=null){let[E]=Wt(s,{kind:pe.METADATA,label:"thumbnails"}),P=Array.prototype.find.call((a=E==null?void 0:E.cues)!=null?a:[],(y,w,U)=>w===0?y.endTime>l:w===U.length-1?y.startTime<=l:y.startTime<=l&&y.endTime>l);if(P){let y=/'^(?:[a-z]+:)?\/\//i.test(P.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,w=new URL(P.text,y);c=new URLSearchParams(w.hash).get("#xywh").split(",").map(J=>+J),u=w.href}}let A=t.mediaDuration.get(e),v=(n=t.mediaChaptersCues.get(e).find((E,P,y)=>P===y.length-1&&A===E.endTime?E.startTime<=l&&E.endTime>=l:E.startTime<=l&&E.endTime>l))==null?void 0:n.text;return i!=null&&v==null&&(v=""),{mediaPreviewTime:l,mediaPreviewImage:u,mediaPreviewCoords:c,mediaPreviewChapter:v}},[p.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[p.MEDIA_PLAY_REQUEST](t,e){var i;let a="mediaPaused";if(t.mediaStreamType.get(e)===we.LIVE){let s=!(t.mediaTargetLiveWindow.get(e)>0),l=(i=t.mediaSeekable.get(e))==null?void 0:i[1];s&&l&&t.mediaCurrentTime.set(l,e)}t[a].set(!1,e)},[p.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[p.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[p.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[p.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)},[p.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[p.MEDIA_SEEK_TO_LIVE_REQUEST](t,e){var i;let a="mediaCurrentTime",r=(i=t.mediaSeekable.get(e))==null?void 0:i[1];Number.isNaN(Number(r))||t[a].set(r,e)},[p.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,n=yi(e),s=Yo(i),l=(a=s[0])==null?void 0:a.language;l&&!r.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),$t(bt.SHOWING,n,s)},[p.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=yi(e),r=i!=null?i:[];$t(bt.DISABLED,a,r)},[p.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){Hr(e,i)},[p.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[p.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[p.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[p.MEDIA_ENTER_FULLSCREEN_REQUEST](t,e){let i="mediaIsFullscreen";t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[p.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[p.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var Eu=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Ti,requestMap:r=vu,options:n={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],u={options:{...n}},c=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),A=y=>{y!=null&&($r(y,c)||(c=Object.freeze({...c,...y}),l.forEach(w=>w(c))))},_=()=>{let y=Object.entries(a).reduce((w,[U,{get:J}])=>(w[U]=J(u),w),{});A(y)},v={},E,P=async(y,w)=>{var U,J,be,Et,at,ea,ta,ia,aa,ra,na,oa,sa,la,da,ua;let Er=!!E;if(E={...u,...E!=null?E:{},...y},Er)return;await fu(...Object.values(y));let rt=l.length>0&&w===0&&s,ld=u.media!==E.media,dd=((U=u.media)==null?void 0:U.textTracks)!==((J=E.media)==null?void 0:J.textTracks),ud=((be=u.media)==null?void 0:be.videoRenditions)!==((Et=E.media)==null?void 0:Et.videoRenditions),cd=((at=u.media)==null?void 0:at.audioTracks)!==((ea=E.media)==null?void 0:ea.audioTracks),md=((ta=u.media)==null?void 0:ta.remote)!==((ia=E.media)==null?void 0:ia.remote),hd=u.documentElement!==E.documentElement,pd=!!u.media&&(ld||rt),fd=!!((aa=u.media)!=null&&aa.textTracks)&&(dd||rt),vd=!!((ra=u.media)!=null&&ra.videoRenditions)&&(ud||rt),Ed=!!((na=u.media)!=null&&na.audioTracks)&&(cd||rt),bd=!!((oa=u.media)!=null&&oa.remote)&&(md||rt),gd=!!u.documentElement&&(hd||rt),_d=pd||fd||vd||Ed||bd||gd,hi=l.length===0&&w===1&&s,Ad=!!E.media&&(ld||hi),yd=!!((sa=E.media)!=null&&sa.textTracks)&&(dd||hi),Td=!!((la=E.media)!=null&&la.videoRenditions)&&(ud||hi),kd=!!((da=E.media)!=null&&da.audioTracks)&&(cd||hi),Sd=!!((ua=E.media)!=null&&ua.remote)&&(md||hi),Id=!!E.documentElement&&(hd||hi),Cd=Ad||yd||Td||kd||Sd||Id;if(!(_d||Cd)){Object.entries(E).forEach(([F,ca])=>{u[F]=ca}),_(),E=void 0;return}Object.entries(a).forEach(([F,{get:ca,mediaEvents:rh=[],textTracksEvents:nh=[],videoRenditionsEvents:oh=[],audioTracksEvents:sh=[],remoteEvents:lh=[],rootEvents:dh=[],stateOwnersUpdateHandlers:uh=[]}])=>{v[F]||(v[F]={});let ge=z=>{let _e=ca(u,z);A({[F]:_e})},ee;ee=v[F].mediaEvents,rh.forEach(z=>{ee&&pd&&(u.media.removeEventListener(z,ee),v[F].mediaEvents=void 0),Ad&&(E.media.addEventListener(z,ge),v[F].mediaEvents=ge)}),ee=v[F].textTracksEvents,nh.forEach(z=>{var _e,Me;ee&&fd&&((_e=u.media.textTracks)==null||_e.removeEventListener(z,ee),v[F].textTracksEvents=void 0),yd&&((Me=E.media.textTracks)==null||Me.addEventListener(z,ge),v[F].textTracksEvents=ge)}),ee=v[F].videoRenditionsEvents,oh.forEach(z=>{var _e,Me;ee&&vd&&((_e=u.media.videoRenditions)==null||_e.removeEventListener(z,ee),v[F].videoRenditionsEvents=void 0),Td&&((Me=E.media.videoRenditions)==null||Me.addEventListener(z,ge),v[F].videoRenditionsEvents=ge)}),ee=v[F].audioTracksEvents,sh.forEach(z=>{var _e,Me;ee&&Ed&&((_e=u.media.audioTracks)==null||_e.removeEventListener(z,ee),v[F].audioTracksEvents=void 0),kd&&((Me=E.media.audioTracks)==null||Me.addEventListener(z,ge),v[F].audioTracksEvents=ge)}),ee=v[F].remoteEvents,lh.forEach(z=>{var _e,Me;ee&&bd&&((_e=u.media.remote)==null||_e.removeEventListener(z,ee),v[F].remoteEvents=void 0),Sd&&((Me=E.media.remote)==null||Me.addEventListener(z,ge),v[F].remoteEvents=ge)}),ee=v[F].rootEvents,dh.forEach(z=>{ee&&gd&&(u.documentElement.removeEventListener(z,ee),v[F].rootEvents=void 0),Id&&(E.documentElement.addEventListener(z,ge),v[F].rootEvents=ge)});let Md=v[F].stateOwnersUpdateHandlers;uh.forEach(z=>{Md&&_d&&Md(),Cd&&(v[F].stateOwnersUpdateHandlers=z(ge,E))})}),Object.entries(E).forEach(([F,ca])=>{u[F]=ca}),_(),E=void 0};return P({media:t,fullscreenElement:e,documentElement:i,options:n}),{dispatch(y){let{type:w,detail:U}=y;if(r[w]&&c.mediaErrorCode==null){A(r[w](a,u,y));return}w==="mediaelementchangerequest"?P({media:U}):w==="fullscreenelementchangerequest"?P({fullscreenElement:U}):w==="documentelementchangerequest"?P({documentElement:U}):w==="optionschangerequest"&&Object.entries(U!=null?U:{}).forEach(([J,be])=>{u.options[J]=be})},getState(){return c},subscribe(y){return P({},l.length+1),l.push(y),y(c),()=>{let w=l.indexOf(y);w>=0&&(P({},l.length-1),l.splice(w,1))}}}};var es=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},N=(t,e,i)=>(es(t,e,"read from private field"),i?i.call(t):e.get(t)),ut=(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)},At=(t,e,i,a)=>(es(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),yt=(t,e,i)=>(es(t,e,"access private method"),i),Vt,Ta,Y,ka,He,Fr,Vr,Xo,ki,Sa,Kr,Jo,yu=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],bu=10,T={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys",NO_VOLUME_PREF:"novolumepref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_DEFAULT_STORE:"nodefaultstore",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset"},Gr=class extends _a{constructor(){super(),ut(this,Vr),ut(this,ki),ut(this,Kr),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,ut(this,Vt,new Be(this,T.HOTKEYS)),ut(this,Ta,void 0),ut(this,Y,void 0),ut(this,ka,void 0),ut(this,He,void 0),ut(this,Fr,i=>{var a;(a=N(this,Y))==null||a.dispatch(i)}),this.associateElement(this);let e={};At(this,ka,i=>{Object.entries(i).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let n=a.toLowerCase(),s=new d.CustomEvent(Od[n],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(T.NO_HOTKEYS,T.HOTKEYS,T.DEFAULT_STREAM_TYPE,T.DEFAULT_SUBTITLES,T.DEFAULT_DURATION)}get mediaStore(){return N(this,Y)}set mediaStore(e){var i,a;if(N(this,Y)&&((i=N(this,He))==null||i.call(this),At(this,He,void 0)),At(this,Y,e),!N(this,Y)&&!this.hasAttribute(T.NO_DEFAULT_STORE)){yt(this,Vr,Xo).call(this);return}At(this,He,(a=N(this,Y))==null?void 0:a.subscribe(N(this,ka)))}get fullscreenElement(){var e;return(e=N(this,Ta))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(T.FULLSCREEN_ELEMENT)&&this.removeAttribute(T.FULLSCREEN_ELEMENT),At(this,Ta,e),(i=N(this,Y))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return k(this,T.DEFAULT_SUBTITLES)}set defaultSubtitles(e){S(this,T.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return C(this,T.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){M(this,T.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return x(this,T.DEFAULT_DURATION)}set defaultDuration(e){O(this,T.DEFAULT_DURATION,e)}get noHotkeys(){return k(this,T.NO_HOTKEYS)}set noHotkeys(e){S(this,T.NO_HOTKEYS,e)}get keysUsed(){return C(this,T.KEYS_USED)}set keysUsed(e){M(this,T.KEYS_USED,e)}get liveEdgeOffset(){return x(this,T.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){O(this,T.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return k(this,T.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){S(this,T.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return k(this,T.NO_VOLUME_PREF)}set noVolumePref(e){S(this,T.NO_VOLUME_PREF,e)}get noSubtitlesLangPref(){return k(this,T.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){S(this,T.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return k(this,T.NO_DEFAULT_STORE)}set noDefaultStore(e){S(this,T.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,n,s,l,u,c;if(super.attributeChangedCallback(e,i,a),e===T.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(T.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===T.HOTKEYS)N(this,Vt).value=a;else if(e===T.DEFAULT_SUBTITLES&&a!==i)(r=N(this,Y))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES)}});else if(e===T.DEFAULT_STREAM_TYPE)(s=N(this,Y))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===T.LIVE_EDGE_OFFSET)(l=N(this,Y))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0}});else if(e===T.FULLSCREEN_ELEMENT){let A=a?(u=this.getRootNode())==null?void 0:u.getElementById(a):void 0;At(this,Ta,A),(c=N(this,Y))==null||c.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,i;!N(this,Y)&&!this.hasAttribute(T.NO_DEFAULT_STORE)&&yt(this,Vr,Xo).call(this),(e=N(this,Y))==null||e.dispatch({type:"documentelementchangerequest",detail:h}),super.connectedCallback(),N(this,Y)&&!N(this,He)&&At(this,He,(i=N(this,Y))==null?void 0:i.subscribe(N(this,ka))),this.enableHotkeys()}disconnectedCallback(){var e,i,a,r;(e=super.disconnectedCallback)==null||e.call(this),N(this,Y)&&((i=N(this,Y))==null||i.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=N(this,Y))==null||a.dispatch({type:p.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),N(this,He)&&((r=N(this,He))==null||r.call(this),At(this,He,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=N(this,Y))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=N(this,Y))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){Au(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),n=tp(e,a,r);Object.values(p).forEach(s=>{e.addEventListener(s,N(this,Fr))}),i.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(!i.has(e))return;i.get(e)(),i.delete(e),Object.values(p).forEach(r=>{e.removeEventListener(r,N(this,Fr))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),N(this,Y)&&Object.entries(N(this,Y).getState()).forEach(([r,n])=>{Au([e],r,n)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",yt(this,Kr,Jo))}disableHotkeys(){this.removeEventListener("keydown",yt(this,Kr,Jo)),this.removeEventListener("keyup",yt(this,ki,Sa))}get hotkeys(){return C(this,T.HOTKEYS)}set hotkeys(e){M(this,T.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,n,s;let l=e.target;if(((r=(a=(i=l.getAttribute(T.KEYS_USED))==null?void 0:i.split(" "))!=null?a:l==null?void 0:l.keysUsed)!=null?r:[]).map(v=>v==="Space"?" ":v).filter(Boolean).includes(e.key))return;let c,A,_;if(!N(this,Vt).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&N(this,Vt).contains("nospace")))switch(e.key){case" ":case"k":c=N(this,Y).getState().mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"m":c=this.mediaStore.getState().mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"f":c=this.mediaStore.getState().mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{let v=this.hasAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET):bu;A=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-v,0),_=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(_);break}case"ArrowRight":{let v=this.hasAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET):bu;A=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+v,0),_=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(_);break}default:break}}};Vt=new WeakMap;Ta=new WeakMap;Y=new WeakMap;ka=new WeakMap;He=new WeakMap;Fr=new WeakMap;Vr=new WeakSet;Xo=function(){var t;this.mediaStore=Eu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(T.DEFAULT_DURATION)?+this.getAttribute(T.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,noVolumePref:this.hasAttribute(T.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(T.NO_SUBTITLES_LANG_PREF)}})};ki=new WeakSet;Sa=function(t){let{key:e}=t;if(!yu.includes(e)){this.removeEventListener("keyup",yt(this,ki,Sa));return}this.keyboardShortcutHandler(t)};Kr=new WeakSet;Jo=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!yu.includes(a)){this.removeEventListener("keyup",yt(this,ki,Sa));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(N(this,Vt).contains(`no${a.toLowerCase()}`)||a===" "&&N(this,Vt).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",yt(this,ki,Sa),{once:!0})};var Qh=Object.values(o),Xh=Object.values(Do),Tu=t=>{var e,i,a,r;let{observedAttributes:n}=t.constructor;!n&&((e=t.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(t),{observedAttributes:n}=t.constructor);let s=(r=(a=(i=t==null?void 0:t.getAttribute)==null?void 0:i.call(t,R.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>Qh.includes(l)):[]},Jh=t=>{var e,i;return(e=t.nodeName)!=null&&e.includes("-")&&d.customElements.get((i=t.nodeName)==null?void 0:i.toLowerCase())&&!(t instanceof d.customElements.get(t.nodeName.toLowerCase()))&&d.customElements.upgrade(t),Xh.some(a=>a in t)},jo=t=>Jh(t)||!!Tu(t).length,gu=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},_u={[o.MEDIA_SUBTITLES_LIST]:dt,[o.MEDIA_SUBTITLES_SHOWING]:dt,[o.MEDIA_SEEKABLE]:gu,[o.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(gu).join(" "),[o.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[o.MEDIA_RENDITION_LIST]:Pd,[o.MEDIA_AUDIO_TRACK_LIST]:Bd},jh=async(t,e,i)=>{var a,r;if(t.isConnected||await _r(0),typeof i=="boolean"||i==null)return S(t,e,i);if(typeof i=="number")return O(t,e,i);if(typeof i=="string")return M(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let n=(r=(a=_u[e])==null?void 0:a.call(_u,i))!=null?r:i;return t.setAttribute(e,n)},ep=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},Ft=(t,e)=>{if(ep(t))return;let i=(r,n)=>{var s,l;jo(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...u,...c].forEach(_=>Ft(_,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!jo(t)){d.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},Au=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=Tu(a),n=e.toLowerCase();r.includes(n)&&jh(a,n,i)})},tp=(t,e,i)=>{Ft(t,e);let a=A=>{var _;let v=(_=A==null?void 0:A.composedPath()[0])!=null?_:A.target;e(v)},r=A=>{var _;let v=(_=A==null?void 0:A.composedPath()[0])!=null?_:A.target;i(v)};t.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=A=>{A.forEach(_=>{let{addedNodes:v=[],removedNodes:E=[],type:P,target:y,attributeName:w}=_;P==="childList"?(Array.prototype.forEach.call(v,U=>Ft(U,e)),Array.prototype.forEach.call(E,U=>Ft(U,i))):P==="attributes"&&w===R.MEDIA_CHROME_ATTRIBUTES&&(jo(y)?e(y):i(y))})},s=[],l=A=>{let _=A.target;_.name!=="media"&&(s.forEach(v=>Ft(v,i)),s=[..._.assignedElements({flatten:!0})],s.forEach(v=>Ft(v,e)))};t.addEventListener("slotchange",l);let u=new MutationObserver(n);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{Ft(t,i),t.removeEventListener("slotchange",l),u.disconnect(),t.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",Gr);var ts=Gr;var as=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},X=(t,e,i)=>(as(t,e,"read from private field"),i?i.call(t):e.get(t)),Si=(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)},Yr=(t,e,i,a)=>(as(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ip=(t,e,i)=>(as(t,e,"access private method"),i),$e,Ci,kt,Ii,qr,is,ku,Tt={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"},Su=h.createElement("template");Su.innerHTML=`
149
149
  <style>
150
150
  :host {
151
151
  position: relative;
@@ -220,10 +220,10 @@
220
220
  <slot name="tooltip-content"></slot>
221
221
  </media-tooltip>
222
222
  </slot>
223
- `;var K=class extends d.HTMLElement{constructor(e={}){var i;if(super(),Ii(this,rs),Ii(this,Fe,void 0),this.preventClick=!1,this.tooltipEl=null,this.tooltipContent="",Ii(this,Mi,a=>{this.preventClick||this.handleClick(a),setTimeout(j(this,It),0)}),Ii(this,It,()=>{var a,r;(r=(a=this.tooltipEl)==null?void 0:a.updateXOffset)==null||r.call(a)}),Ii(this,Ci,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",j(this,Ci));return}this.preventClick||this.handleClick(a)}),Ii(this,zr,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",j(this,Ci));return}this.addEventListener("keyup",j(this,Ci),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let a=Iu.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=h.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),e.tooltipContent&&(a.querySelector('slot[name="tooltip-content"]').innerHTML=(i=e.tooltipContent)!=null?i:"",this.tooltipContent=e.tooltipContent),this.nativeEl.appendChild(r.content.cloneNode(!0)),this.shadowRoot.appendChild(a)}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",St.TOOLTIP_PLACEMENT,R.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",j(this,Mi)),this.addEventListener("keydown",j(this,zr)),this.tabIndex=0}disable(){this.removeEventListener("click",j(this,Mi)),this.removeEventListener("keydown",j(this,zr)),this.removeEventListener("keyup",j(this,Ci)),this.tabIndex=-1}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER?(i&&((n=(r=j(this,Fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),Zr(this,Fe,null)),a&&this.isConnected&&(Zr(this,Fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=j(this,Fe))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===St.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==i&&(this.tooltipEl.placement=a),j(this,It).call(this)}connectedCallback(){var e,i,a;let{style:r}=W(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 n=this.getAttribute(R.MEDIA_CONTROLLER);n&&(Zr(this,Fe,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=j(this,Fe))==null?void 0:i.associateElement)==null||a.call(i,this)),d.customElements.whenDefined("media-tooltip").then(()=>rp(this,rs,Su).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=j(this,Fe))==null?void 0:e.unassociateElement)==null||i.call(e,this),Zr(this,Fe,null),this.removeEventListener("mouseenter",j(this,It)),this.removeEventListener("focus",j(this,It)),this.removeEventListener("click",j(this,Mi))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return I(this,St.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){C(this,St.TOOLTIP_PLACEMENT,e)}get mediaController(){return I(this,R.MEDIA_CONTROLLER)}set mediaController(e){C(this,R.MEDIA_CONTROLLER,e)}get disabled(){return y(this,St.DISABLED)}set disabled(e){k(this,St.DISABLED,e)}get noTooltip(){return y(this,St.NO_TOOLTIP)}set noTooltip(e){k(this,St.NO_TOOLTIP,e)}handleClick(e){}};Fe=new WeakMap;Mi=new WeakMap;It=new WeakMap;Ci=new WeakMap;zr=new WeakMap;rs=new WeakSet;Su=function(){this.addEventListener("mouseenter",j(this,It)),this.addEventListener("focus",j(this,It)),this.addEventListener("click",j(this,Mi));let t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)};d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",K);var Cu=`<svg aria-hidden="true" viewBox="0 0 26 24">
223
+ `;var V=class extends d.HTMLElement{constructor(e={}){var i;if(super(),Si(this,is),Si(this,$e,void 0),this.preventClick=!1,this.tooltipEl=null,this.tooltipContent="",Si(this,Ci,a=>{this.preventClick||this.handleClick(a),setTimeout(X(this,kt),0)}),Si(this,kt,()=>{var a,r;(r=(a=this.tooltipEl)==null?void 0:a.updateXOffset)==null||r.call(a)}),Si(this,Ii,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",X(this,Ii));return}this.preventClick||this.handleClick(a)}),Si(this,qr,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",X(this,Ii));return}this.addEventListener("keyup",X(this,Ii),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let a=Su.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=h.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),e.tooltipContent&&(a.querySelector('slot[name="tooltip-content"]').innerHTML=(i=e.tooltipContent)!=null?i:"",this.tooltipContent=e.tooltipContent),this.nativeEl.appendChild(r.content.cloneNode(!0)),this.shadowRoot.appendChild(a)}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",Tt.TOOLTIP_PLACEMENT,R.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",X(this,Ci)),this.addEventListener("keydown",X(this,qr)),this.tabIndex=0}disable(){this.removeEventListener("click",X(this,Ci)),this.removeEventListener("keydown",X(this,qr)),this.removeEventListener("keyup",X(this,Ii)),this.tabIndex=-1}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER?(i&&((n=(r=X(this,$e))==null?void 0:r.unassociateElement)==null||n.call(r,this),Yr(this,$e,null)),a&&this.isConnected&&(Yr(this,$e,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=X(this,$e))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===Tt.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==i&&(this.tooltipEl.placement=a),X(this,kt).call(this)}connectedCallback(){var e,i,a;let{style:r}=W(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 n=this.getAttribute(R.MEDIA_CONTROLLER);n&&(Yr(this,$e,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=X(this,$e))==null?void 0:i.associateElement)==null||a.call(i,this)),d.customElements.whenDefined("media-tooltip").then(()=>ip(this,is,ku).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=X(this,$e))==null?void 0:e.unassociateElement)==null||i.call(e,this),Yr(this,$e,null),this.removeEventListener("mouseenter",X(this,kt)),this.removeEventListener("focus",X(this,kt)),this.removeEventListener("click",X(this,Ci))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return C(this,Tt.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){M(this,Tt.TOOLTIP_PLACEMENT,e)}get mediaController(){return C(this,R.MEDIA_CONTROLLER)}set mediaController(e){M(this,R.MEDIA_CONTROLLER,e)}get disabled(){return k(this,Tt.DISABLED)}set disabled(e){S(this,Tt.DISABLED,e)}get noTooltip(){return k(this,Tt.NO_TOOLTIP)}set noTooltip(e){S(this,Tt.NO_TOOLTIP,e)}handleClick(e){}};$e=new WeakMap;Ci=new WeakMap;kt=new WeakMap;Ii=new WeakMap;qr=new WeakMap;is=new WeakSet;ku=function(){this.addEventListener("mouseenter",X(this,kt)),this.addEventListener("focus",X(this,kt)),this.addEventListener("click",X(this,Ci));let t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)};d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",V);var Iu=`<svg aria-hidden="true" viewBox="0 0 26 24">
224
224
  <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"/>
225
225
  </svg>
226
- `,Ru=h.createElement("template");Ru.innerHTML=`
226
+ `,Mu=h.createElement("template");Mu.innerHTML=`
227
227
  <style>
228
228
  :host([${o.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
229
229
  display: none !important;
@@ -241,17 +241,17 @@
241
241
  </style>
242
242
 
243
243
  <slot name="icon">
244
- <slot name="enter">${Cu}</slot>
245
- <slot name="exit">${Cu}</slot>
244
+ <slot name="enter">${Iu}</slot>
245
+ <slot name="exit">${Iu}</slot>
246
246
  </slot>
247
- `;var np=`
248
- <slot name="tooltip-enter">${D.ENTER_AIRPLAY}</slot>
249
- <slot name="tooltip-exit">${D.EXIT_AIRPLAY}</slot>
250
- `,Mu=t=>{let e=t.mediaIsAirplaying?G.EXIT_AIRPLAY():G.ENTER_AIRPLAY();t.setAttribute("aria-label",e)},os=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_AIRPLAYING,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ru,tooltipContent:np,...e})}connectedCallback(){super.connectedCallback(),Mu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_AIRPLAYING&&Mu(this)}get mediaIsAirplaying(){return y(this,o.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){k(this,o.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return I(this,o.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){C(this,o.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(p.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",os);var op=`<svg aria-hidden="true" viewBox="0 0 26 24">
247
+ `;var ap=`
248
+ <slot name="tooltip-enter">${f("start airplay")}</slot>
249
+ <slot name="tooltip-exit">${f("stop airplay")}</slot>
250
+ `,Cu=t=>{let e=t.mediaIsAirplaying?f("stop airplay"):f("start airplay");t.setAttribute("aria-label",e)},rs=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_AIRPLAYING,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Mu,tooltipContent:ap,...e})}connectedCallback(){super.connectedCallback(),Cu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_AIRPLAYING&&Cu(this)}get mediaIsAirplaying(){return k(this,o.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){S(this,o.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return C(this,o.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){M(this,o.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(p.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",rs);var rp=`<svg aria-hidden="true" viewBox="0 0 26 24">
251
251
  <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"/>
252
- </svg>`,sp=`<svg aria-hidden="true" viewBox="0 0 26 24">
252
+ </svg>`,np=`<svg aria-hidden="true" viewBox="0 0 26 24">
253
253
  <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"/>
254
- </svg>`,Du=h.createElement("template");Du.innerHTML=`
254
+ </svg>`,xu=h.createElement("template");xu.innerHTML=`
255
255
  <style>
256
256
  :host([aria-checked="true"]) slot[name=off] {
257
257
  display: none !important;
@@ -269,13 +269,13 @@
269
269
  </style>
270
270
 
271
271
  <slot name="icon">
272
- <slot name="on">${op}</slot>
273
- <slot name="off">${sp}</slot>
272
+ <slot name="on">${rp}</slot>
273
+ <slot name="off">${np}</slot>
274
274
  </slot>
275
- `;var lp=`
276
- <slot name="tooltip-enable">${D.ENABLE_CAPTIONS}</slot>
277
- <slot name="tooltip-disable">${D.DISABLE_CAPTIONS}</slot>
278
- `,Lu=t=>{t.setAttribute("aria-checked",Hr(t).toString())},ss=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Du,tooltipContent:lp,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",Y.CLOSED_CAPTIONS()),Lu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_SHOWING&&Lu(this)}get mediaSubtitlesList(){return wu(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){xu(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return wu(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){xu(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},wu=(t,e)=>{let i=t.getAttribute(e);return i?Wt(i):[]},xu=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=ct(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",ss);var dp='<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>',up='<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>',Nu=h.createElement("template");Nu.innerHTML=`
275
+ `;var op=`
276
+ <slot name="tooltip-enable">${f("Enable captions")}</slot>
277
+ <slot name="tooltip-disable">${f("Disable captions")}</slot>
278
+ `,wu=t=>{t.setAttribute("aria-checked",Ur(t).toString())},ns=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:xu,tooltipContent:op,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",f("closed captions")),wu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_SHOWING&&wu(this)}get mediaSubtitlesList(){return Ru(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Lu(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Ru(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Lu(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},Ru=(t,e)=>{let i=t.getAttribute(e);return i?Ht(i):[]},Lu=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=dt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",ns);var sp='<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>',lp='<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>',Ou=h.createElement("template");Ou.innerHTML=`
279
279
  <style>
280
280
  :host([${o.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
281
281
  display: none !important;
@@ -293,13 +293,13 @@
293
293
  </style>
294
294
 
295
295
  <slot name="icon">
296
- <slot name="enter">${dp}</slot>
297
- <slot name="exit">${up}</slot>
296
+ <slot name="enter">${sp}</slot>
297
+ <slot name="exit">${lp}</slot>
298
298
  </slot>
299
- `;var cp=`
300
- <slot name="tooltip-enter">${D.START_CAST}</slot>
301
- <slot name="tooltip-exit">${D.STOP_CAST}</slot>
302
- `,Ou=t=>{let e=t.mediaIsCasting?G.EXIT_CAST():G.ENTER_CAST();t.setAttribute("aria-label",e)},ls=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Nu,tooltipContent:cp,...e})}connectedCallback(){super.connectedCallback(),Ou(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_CASTING&&Ou(this)}get mediaIsCasting(){return y(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){k(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return I(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){C(this,o.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?p.MEDIA_EXIT_CAST_REQUEST:p.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",ls);var fs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},qt=(t,e,i)=>(fs(t,e,"read from private field"),i?i.call(t):e.get(t)),ht=(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)},vs=(t,e,i,a)=>(fs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Gt=(t,e,i)=>(fs(t,e,"access private method"),i),Xr,Ra,Zt,Qr,ds,us,Pu,cs,Uu,ms,Bu,hs,Hu,ps,$u;function mp(t){return`
299
+ `;var dp=`
300
+ <slot name="tooltip-enter">${f("Start casting")}</slot>
301
+ <slot name="tooltip-exit">${f("Stop casting")}</slot>
302
+ `,Du=t=>{let e=t.mediaIsCasting?f("stop casting"):f("start casting");t.setAttribute("aria-label",e)},os=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ou,tooltipContent:dp,...e})}connectedCallback(){super.connectedCallback(),Du(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_CASTING&&Du(this)}get mediaIsCasting(){return k(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){S(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return C(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){M(this,o.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?p.MEDIA_EXIT_CAST_REQUEST:p.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",os);var hs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Gt=(t,e,i)=>(hs(t,e,"read from private field"),i?i.call(t):e.get(t)),ct=(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)},ps=(t,e,i,a)=>(hs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Kt=(t,e,i)=>(hs(t,e,"access private method"),i),zr,Ca,Yt,Zr,ss,ls,Nu,ds,Pu,us,Uu,cs,Bu,ms,Hu;function up(t){return`
303
303
  <style>
304
304
  :host {
305
305
  font: var(--media-font,
@@ -340,11 +340,11 @@
340
340
  }
341
341
  </style>
342
342
  ${this.getSlotTemplateHTML(t)}
343
- `}function hp(t){return`
343
+ `}function cp(t){return`
344
344
  <slot id="content"></slot>
345
- `}var Ma={OPEN:"open",ANCHOR:"anchor"},zt=class extends d.HTMLElement{constructor(){super(),ht(this,Qr),ht(this,us),ht(this,cs),ht(this,ms),ht(this,hs),ht(this,ps),ht(this,Xr,!1),ht(this,Ra,null),ht(this,Zt,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Ma.OPEN,Ma.ANCHOR]}get open(){return y(this,Ma.OPEN)}set open(e){k(this,Ma.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":Gt(this,ms,Bu).call(this,e);break;case"focusout":Gt(this,hs,Hu).call(this,e);break;case"keydown":Gt(this,ps,$u).call(this,e);break}}connectedCallback(){Gt(this,Qr,ds).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,i,a){Gt(this,Qr,ds).call(this),e===Ma.OPEN&&a!==i&&(this.open?Gt(this,us,Pu).call(this):Gt(this,cs,Uu).call(this))}focus(){vs(this,Ra,va());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"]}};Xr=new WeakMap;Ra=new WeakMap;Zt=new WeakMap;Qr=new WeakSet;ds=function(){if(!qt(this,Xr)&&(vs(this,Xr,!0),!this.shadowRoot)){this.attachShadow({mode:"open"});let t=Zd(this.attributes);this.shadowRoot.innerHTML=`
345
+ `}var Ia={OPEN:"open",ANCHOR:"anchor"},qt=class extends d.HTMLElement{constructor(){super(),ct(this,Zr),ct(this,ls),ct(this,ds),ct(this,us),ct(this,cs),ct(this,ms),ct(this,zr,!1),ct(this,Ca,null),ct(this,Yt,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Ia.OPEN,Ia.ANCHOR]}get open(){return k(this,Ia.OPEN)}set open(e){S(this,Ia.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":Kt(this,us,Uu).call(this,e);break;case"focusout":Kt(this,cs,Bu).call(this,e);break;case"keydown":Kt(this,ms,Hu).call(this,e);break}}connectedCallback(){Kt(this,Zr,ss).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,i,a){Kt(this,Zr,ss).call(this),e===Ia.OPEN&&a!==i&&(this.open?Kt(this,ls,Nu).call(this):Kt(this,ds,Pu).call(this))}focus(){ps(this,Ca,fa());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"]}};zr=new WeakMap;Ca=new WeakMap;Yt=new WeakMap;Zr=new WeakSet;ss=function(){if(!Gt(this,zr)&&(ps(this,zr,!0),!this.shadowRoot)){this.attachShadow({mode:"open"});let t=qd(this.attributes);this.shadowRoot.innerHTML=`
346
346
  ${this.constructor.getTemplateHTML(t)}
347
- `,queueMicrotask(()=>{let{style:e}=W(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};us=new WeakSet;Pu=function(){var t;(t=qt(this,Zt))==null||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};cs=new WeakSet;Uu=function(){var t;(t=qt(this,Zt))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};ms=new WeakSet;Bu=function(t){vs(this,Zt,t.relatedTarget),ue(this,t.relatedTarget)||(this.open=!this.open)};hs=new WeakSet;Hu=function(t){var e;ue(this,t.relatedTarget)||((e=qt(this,Ra))==null||e.focus(),qt(this,Zt)&&qt(this,Zt)!==t.relatedTarget&&this.open&&(this.open=!1))};ps=new WeakSet;$u=function(t){var e,i,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=t;l||u||c||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"&&((n=qt(this,Ra))==null||n.focus(),this.open=!1))};zt.getTemplateHTML=mp;zt.getSlotTemplateHTML=hp;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",zt);var ys=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Q=(t,e,i)=>(ys(t,e,"read from private field"),i?i.call(t):e.get(t)),oe=(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)},Ct=(t,e,i,a)=>(ys(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),xe=(t,e,i)=>(ys(t,e,"access private method"),i),Ke,ln,Jr,jr,De,on,en,tn,an,ks,Wu,rn,Es,nn,bs,sn,Ss,gs,Fu,_s,Ku,As,Vu,Ts,Yu,Gu=h.createElement("template");Gu.innerHTML=`
347
+ `,queueMicrotask(()=>{let{style:e}=W(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};ls=new WeakSet;Nu=function(){var t;(t=Gt(this,Yt))==null||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};ds=new WeakSet;Pu=function(){var t;(t=Gt(this,Yt))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};us=new WeakSet;Uu=function(t){ps(this,Yt,t.relatedTarget),le(this,t.relatedTarget)||(this.open=!this.open)};cs=new WeakSet;Bu=function(t){var e;le(this,t.relatedTarget)||((e=Gt(this,Ca))==null||e.focus(),Gt(this,Yt)&&Gt(this,Yt)!==t.relatedTarget&&this.open&&(this.open=!1))};ms=new WeakSet;Hu=function(t){var e,i,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=t;l||u||c||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"&&((n=Gt(this,Ca))==null||n.focus(),this.open=!1))};qt.getTemplateHTML=up;qt.getSlotTemplateHTML=cp;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",qt);var As=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Z=(t,e,i)=>(As(t,e,"read from private field"),i?i.call(t):e.get(t)),re=(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)},St=(t,e,i,a)=>(As(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Re=(t,e,i)=>(As(t,e,"access private method"),i),We,on,Qr,Xr,Le,rn,Jr,jr,en,ys,$u,tn,fs,an,vs,nn,Ts,Es,Wu,bs,Fu,gs,Vu,_s,Ku,Gu=h.createElement("template");Gu.innerHTML=`
348
348
  <style>
349
349
  :host {
350
350
  --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
@@ -572,7 +572,7 @@
572
572
  <input id="range" type="range" min="0" max="1" step="any" value="0">
573
573
  </div>
574
574
  <div id="rightgap"></div>
575
- `;var Qt=class extends d.HTMLElement{constructor(){super(),oe(this,ks),oe(this,rn),oe(this,nn),oe(this,sn),oe(this,gs),oe(this,_s),oe(this,As),oe(this,Ts),oe(this,Ke,void 0),oe(this,ln,void 0),oe(this,Jr,void 0),oe(this,jr,void 0),oe(this,De,{}),oe(this,on,[]),oe(this,en,()=>{if(this.range.matches(":focus-visible")){let{style:e}=W(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),oe(this,tn,()=>{let{style:e}=W(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),oe(this,an,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Gu.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),Ct(this,Jr,this.shadowRoot.querySelector("#startpoint")),Ct(this,jr,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",R.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER?(i&&((n=(r=Q(this,Ke))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ct(this,Ke,null)),a&&this.isConnected&&(Ct(this,Ke,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Q(this,Ke))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),xe(this,rn,Es).call(this)):(this.range.setAttribute(e,a),xe(this,nn,bs).call(this)))}connectedCallback(){var e,i,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),Q(this,De).pointer=W(this.shadowRoot,"#pointer"),Q(this,De).progress=W(this.shadowRoot,"#progress"),Q(this,De).thumb=W(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),Q(this,De).activeSegment=W(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(R.MEDIA_CONTROLLER);n&&(Ct(this,Ke,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=Q(this,Ke))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Q(this,en)),this.shadowRoot.addEventListener("focusout",Q(this,tn)),xe(this,rn,Es).call(this),lt(this.container,Q(this,an))}disconnectedCallback(){var e,i;xe(this,nn,bs).call(this),(i=(e=Q(this,Ke))==null?void 0:e.unassociateElement)==null||i.call(e,this),Ct(this,Ke,null),this.shadowRoot.removeEventListener("focusin",Q(this,en)),this.shadowRoot.removeEventListener("focusout",Q(this,tn)),dt(this.container,Q(this,an))}updatePointerBar(e){var i;(i=Q(this,De).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=Q(this,De).progress)==null||e.style.setProperty("width",`${a}%`),(i=Q(this,De).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(n=>[n.start,n.end]),+this.range.max])];Ct(this,on,[...a]);let r=a.pop();for(let[n,s]of a.entries()){let[l,u]=[n===0,n===a.length-1],c=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,g=`calc(${((u?r:a[n+1])-s)*100}%${l||u?"":" - var(--segments-gap)"})`,f=h.createElementNS("http://www.w3.org/2000/svg","rect"),v=W(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);v.style.setProperty("x",c),v.style.setProperty("width",g),i.append(f)}}getPointerRatio(e){let i=zd(e.clientX,e.clientY,Q(this,Jr).getBoundingClientRect(),Q(this,jr).getBoundingClientRect());return Math.max(0,Math.min(1,i))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":xe(this,Ts,Yu).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":xe(this,gs,Fu).call(this,e);break;case"pointerdown":xe(this,sn,Ss).call(this,e);break;case"pointerup":xe(this,_s,Ku).call(this);break;case"pointerleave":xe(this,As,Vu).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};Ke=new WeakMap;ln=new WeakMap;Jr=new WeakMap;jr=new WeakMap;De=new WeakMap;on=new WeakMap;en=new WeakMap;tn=new WeakMap;an=new WeakMap;ks=new WeakSet;Wu=function(t){let e=Q(this,De).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${Q(this,on).findIndex((n,s,l)=>{let u=l[s+1];return u!=null&&i>=n&&i<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};rn=new WeakSet;Es=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};nn=new WeakSet;bs=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(t=d.window)==null||t.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};sn=new WeakSet;Ss=function(t){var e;Ct(this,ln,t.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};gs=new WeakSet;Fu=function(t){var e;t.pointerType!=="mouse"&&xe(this,sn,Ss).call(this,t),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};_s=new WeakSet;Ku=function(){var t;(t=d.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};As=new WeakSet;Vu=function(){var t,e;this.removeEventListener("pointerleave",this),(t=d.window)==null||t.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=Q(this,De).activeSegment)==null||e.style.removeProperty("transform")};Ts=new WeakSet;Yu=function(t){this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),xe(this,ks,Wu).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!Q(this,ln))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",Qt);var qu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},dn=(t,e,i)=>(qu(t,e,"read from private field"),i?i.call(t):e.get(t)),pp=(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)},un=(t,e,i,a)=>(qu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ve,Zu=h.createElement("template");Zu.innerHTML=`
575
+ `;var Zt=class extends d.HTMLElement{constructor(){super(),re(this,ys),re(this,tn),re(this,an),re(this,nn),re(this,Es),re(this,bs),re(this,gs),re(this,_s),re(this,We,void 0),re(this,on,void 0),re(this,Qr,void 0),re(this,Xr,void 0),re(this,Le,{}),re(this,rn,[]),re(this,Jr,()=>{if(this.range.matches(":focus-visible")){let{style:e}=W(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),re(this,jr,()=>{let{style:e}=W(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),re(this,en,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Gu.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),St(this,Qr,this.shadowRoot.querySelector("#startpoint")),St(this,Xr,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",R.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER?(i&&((n=(r=Z(this,We))==null?void 0:r.unassociateElement)==null||n.call(r,this),St(this,We,null)),a&&this.isConnected&&(St(this,We,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Z(this,We))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),Re(this,tn,fs).call(this)):(this.range.setAttribute(e,a),Re(this,an,vs).call(this)))}connectedCallback(){var e,i,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),Z(this,Le).pointer=W(this.shadowRoot,"#pointer"),Z(this,Le).progress=W(this.shadowRoot,"#progress"),Z(this,Le).thumb=W(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),Z(this,Le).activeSegment=W(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(R.MEDIA_CONTROLLER);n&&(St(this,We,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=Z(this,We))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Z(this,Jr)),this.shadowRoot.addEventListener("focusout",Z(this,jr)),Re(this,tn,fs).call(this),ot(this.container,Z(this,en))}disconnectedCallback(){var e,i;Re(this,an,vs).call(this),(i=(e=Z(this,We))==null?void 0:e.unassociateElement)==null||i.call(e,this),St(this,We,null),this.shadowRoot.removeEventListener("focusin",Z(this,Jr)),this.shadowRoot.removeEventListener("focusout",Z(this,jr)),st(this.container,Z(this,en))}updatePointerBar(e){var i;(i=Z(this,Le).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=Z(this,Le).progress)==null||e.style.setProperty("width",`${a}%`),(i=Z(this,Le).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(n=>[n.start,n.end]),+this.range.max])];St(this,rn,[...a]);let r=a.pop();for(let[n,s]of a.entries()){let[l,u]=[n===0,n===a.length-1],c=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,_=`calc(${((u?r:a[n+1])-s)*100}%${l||u?"":" - var(--segments-gap)"})`,v=h.createElementNS("http://www.w3.org/2000/svg","rect"),E=W(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);E.style.setProperty("x",c),E.style.setProperty("width",_),i.append(v)}}getPointerRatio(e){let i=Zd(e.clientX,e.clientY,Z(this,Qr).getBoundingClientRect(),Z(this,Xr).getBoundingClientRect());return Math.max(0,Math.min(1,i))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Re(this,_s,Ku).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Re(this,Es,Wu).call(this,e);break;case"pointerdown":Re(this,nn,Ts).call(this,e);break;case"pointerup":Re(this,bs,Fu).call(this);break;case"pointerleave":Re(this,gs,Vu).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};We=new WeakMap;on=new WeakMap;Qr=new WeakMap;Xr=new WeakMap;Le=new WeakMap;rn=new WeakMap;Jr=new WeakMap;jr=new WeakMap;en=new WeakMap;ys=new WeakSet;$u=function(t){let e=Z(this,Le).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${Z(this,rn).findIndex((n,s,l)=>{let u=l[s+1];return u!=null&&i>=n&&i<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};tn=new WeakSet;fs=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};an=new WeakSet;vs=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(t=d.window)==null||t.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};nn=new WeakSet;Ts=function(t){var e;St(this,on,t.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};Es=new WeakSet;Wu=function(t){var e;t.pointerType!=="mouse"&&Re(this,nn,Ts).call(this,t),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};bs=new WeakSet;Fu=function(){var t;(t=d.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};gs=new WeakSet;Vu=function(){var t,e;this.removeEventListener("pointerleave",this),(t=d.window)==null||t.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=Z(this,Le).activeSegment)==null||e.style.removeProperty("transform")};_s=new WeakSet;Ku=function(t){this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),Re(this,ys,$u).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!Z(this,on))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",Zt);var Yu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},sn=(t,e,i)=>(Yu(t,e,"read from private field"),i?i.call(t):e.get(t)),mp=(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)},ln=(t,e,i,a)=>(Yu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Fe,qu=h.createElement("template");qu.innerHTML=`
576
576
  <style>
577
577
  :host {
578
578
 
@@ -598,7 +598,7 @@
598
598
  </style>
599
599
 
600
600
  <slot></slot>
601
- `;var Is=class extends d.HTMLElement{constructor(){super(),pp(this,Ve,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Zu.content.cloneNode(!0)))}static get observedAttributes(){return[R.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER&&(i&&((n=(r=dn(this,Ve))==null?void 0:r.unassociateElement)==null||n.call(r,this),un(this,Ve,null)),a&&this.isConnected&&(un(this,Ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=dn(this,Ve))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(R.MEDIA_CONTROLLER);r&&(un(this,Ve,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=dn(this,Ve))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=dn(this,Ve))==null?void 0:e.unassociateElement)==null||i.call(e,this),un(this,Ve,null)}};Ve=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",Is);var zu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},cn=(t,e,i)=>(zu(t,e,"read from private field"),i?i.call(t):e.get(t)),fp=(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)},mn=(t,e,i,a)=>(zu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ye,Qu=h.createElement("template");Qu.innerHTML=`
601
+ `;var ks=class extends d.HTMLElement{constructor(){super(),mp(this,Fe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(qu.content.cloneNode(!0)))}static get observedAttributes(){return[R.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER&&(i&&((n=(r=sn(this,Fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),ln(this,Fe,null)),a&&this.isConnected&&(ln(this,Fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=sn(this,Fe))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(R.MEDIA_CONTROLLER);r&&(ln(this,Fe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=sn(this,Fe))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=sn(this,Fe))==null?void 0:e.unassociateElement)==null||i.call(e,this),ln(this,Fe,null)}};Fe=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",ks);var Zu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},dn=(t,e,i)=>(Zu(t,e,"read from private field"),i?i.call(t):e.get(t)),hp=(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)},un=(t,e,i,a)=>(Zu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ve,zu=h.createElement("template");zu.innerHTML=`
602
602
  <style>
603
603
  :host {
604
604
  font: var(--media-font,
@@ -631,7 +631,7 @@
631
631
  }
632
632
  </style>
633
633
  <slot></slot>
634
- `;var Oe=class extends d.HTMLElement{constructor(){super(),fp(this,Ye,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Qu.content.cloneNode(!0)))}static get observedAttributes(){return[R.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER&&(i&&((n=(r=cn(this,Ye))==null?void 0:r.unassociateElement)==null||n.call(r,this),mn(this,Ye,null)),a&&this.isConnected&&(mn(this,Ye,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=cn(this,Ye))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(R.MEDIA_CONTROLLER);n&&(mn(this,Ye,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=cn(this,Ye))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=cn(this,Ye))==null?void 0:e.unassociateElement)==null||i.call(e,this),mn(this,Ye,null)}};Ye=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",Oe);var Ju=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Xu=(t,e,i)=>(Ju(t,e,"read from private field"),i?i.call(t):e.get(t)),vp=(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)},Ep=(t,e,i,a)=>(Ju(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),La,Cs=class extends Oe{constructor(){super(),vp(this,La,void 0),Ep(this,La,this.shadowRoot.querySelector("slot")),Xu(this,La).textContent=Be(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===o.MEDIA_DURATION&&(Xu(this,La).textContent=Be(+a)),super.attributeChangedCallback(e,i,a)}get mediaDuration(){return w(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}};La=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",Cs);var ec=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bp=(t,e,i)=>(ec(t,e,"read from private field"),i?i.call(t):e.get(t)),gp=(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)},_p=(t,e,i,a)=>(ec(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),hn;function Ap(t){return`
634
+ `;var xe=class extends d.HTMLElement{constructor(){super(),hp(this,Ve,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(zu.content.cloneNode(!0)))}static get observedAttributes(){return[R.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER&&(i&&((n=(r=dn(this,Ve))==null?void 0:r.unassociateElement)==null||n.call(r,this),un(this,Ve,null)),a&&this.isConnected&&(un(this,Ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=dn(this,Ve))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(R.MEDIA_CONTROLLER);n&&(un(this,Ve,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=dn(this,Ve))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=dn(this,Ve))==null?void 0:e.unassociateElement)==null||i.call(e,this),un(this,Ve,null)}};Ve=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",xe);var Xu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Qu=(t,e,i)=>(Xu(t,e,"read from private field"),i?i.call(t):e.get(t)),pp=(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)},fp=(t,e,i,a)=>(Xu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ma,Ss=class extends xe{constructor(){super(),pp(this,Ma,void 0),fp(this,Ma,this.shadowRoot.querySelector("slot")),Qu(this,Ma).textContent=Pe(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===o.MEDIA_DURATION&&(Qu(this,Ma).textContent=Pe(+a)),super.attributeChangedCallback(e,i,a)}get mediaDuration(){return x(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}};Ma=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",Ss);var vp={2:f("Network Error"),3:f("Decode Error"),4:f("Source Not Supported"),5:f("Encryption Error")},Ep={2:f("A network error caused the media download to fail."),3:f("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:f("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:f("The media is encrypted and there are no keys to decrypt it.")},Is=t=>{var e,i;return t.code===1?null:{title:(e=vp[t.code])!=null?e:`Error ${t.code}`,message:(i=Ep[t.code])!=null?i:t.message}};var ju=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bp=(t,e,i)=>(ju(t,e,"read from private field"),i?i.call(t):e.get(t)),gp=(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)},_p=(t,e,i,a)=>(ju(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),cn;function Ap(t){return`
635
635
  <style>
636
636
  :host {
637
637
  background: rgb(20 20 30 / .8);
@@ -648,13 +648,13 @@
648
648
  }
649
649
  </style>
650
650
  <slot name="error-${t.mediaerrorcode}" id="content">
651
- ${tc({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
651
+ ${ec({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
652
652
  </slot>
653
- `}function Tp(t){return t.code&&Uo(t)!==null}function tc(t){var e;let{title:i,message:a}=(e=Uo(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 ju=[o.MEDIA_ERROR_CODE,o.MEDIA_ERROR_MESSAGE],Ri=class extends zt{constructor(){super(...arguments),gp(this,hn,null)}static get observedAttributes(){return[...super.observedAttributes,...ju]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,i,a){var r;if(super.attributeChangedCallback(e,i,a),!ju.includes(e))return;let n=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=Tp(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return bp(this,hn)}set mediaError(e){_p(this,hn,e)}get mediaErrorCode(){return w(this,"mediaerrorcode")}set mediaErrorCode(e){O(this,"mediaerrorcode",e)}get mediaErrorMessage(){return I(this,"mediaerrormessage")}set mediaErrorMessage(e){C(this,"mediaerrormessage",e)}};hn=new WeakMap;Ri.getSlotTemplateHTML=Ap;Ri.formatErrorMessage=tc;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",Ri);var pn=Ri;var yp=`<svg aria-hidden="true" viewBox="0 0 26 24">
653
+ `}function yp(t){return t.code&&Is(t)!==null}function ec(t){var e;let{title:i,message:a}=(e=Is(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 Ju=[o.MEDIA_ERROR_CODE,o.MEDIA_ERROR_MESSAGE],Mi=class extends qt{constructor(){super(...arguments),gp(this,cn,null)}static get observedAttributes(){return[...super.observedAttributes,...Ju]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,i,a){var r;if(super.attributeChangedCallback(e,i,a),!Ju.includes(e))return;let n=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=yp(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return bp(this,cn)}set mediaError(e){_p(this,cn,e)}get mediaErrorCode(){return x(this,"mediaerrorcode")}set mediaErrorCode(e){O(this,"mediaerrorcode",e)}get mediaErrorMessage(){return C(this,"mediaerrormessage")}set mediaErrorMessage(e){M(this,"mediaerrormessage",e)}};cn=new WeakMap;Mi.getSlotTemplateHTML=Ap;Mi.formatErrorMessage=ec;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",Mi);var mn=Mi;var Tp=`<svg aria-hidden="true" viewBox="0 0 26 24">
654
654
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
655
655
  </svg>`,kp=`<svg aria-hidden="true" viewBox="0 0 26 24">
656
656
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
657
- </svg>`,ac=h.createElement("template");ac.innerHTML=`
657
+ </svg>`,ic=h.createElement("template");ic.innerHTML=`
658
658
  <style>
659
659
  :host([${o.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
660
660
  display: none !important;
@@ -672,13 +672,13 @@
672
672
  </style>
673
673
 
674
674
  <slot name="icon">
675
- <slot name="enter">${yp}</slot>
675
+ <slot name="enter">${Tp}</slot>
676
676
  <slot name="exit">${kp}</slot>
677
677
  </slot>
678
678
  `;var Sp=`
679
- <slot name="tooltip-enter">${D.ENTER_FULLSCREEN}</slot>
680
- <slot name="tooltip-exit">${D.EXIT_FULLSCREEN}</slot>
681
- `,ic=t=>{let e=t.mediaIsFullscreen?G.EXIT_FULLSCREEN():G.ENTER_FULLSCREEN();t.setAttribute("aria-label",e)},Ms=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:ac,tooltipContent:Sp,...e})}connectedCallback(){super.connectedCallback(),ic(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_FULLSCREEN&&ic(this)}get mediaFullscreenUnavailable(){return I(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){C(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return y(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){k(this,o.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",Ms);var{MEDIA_TIME_IS_LIVE:fn,MEDIA_PAUSED:wa}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:Ip,MEDIA_PLAY_REQUEST:Cp}=p,Mp='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',nc=h.createElement("template");nc.innerHTML=`
679
+ <slot name="tooltip-enter">${f("Enter fullscreen mode")}</slot>
680
+ <slot name="tooltip-exit">${f("Exit fullscreen mode")}</slot>
681
+ `,tc=t=>{let e=t.mediaIsFullscreen?f("exit fullscreen mode"):f("enter fullscreen mode");t.setAttribute("aria-label",e)},Cs=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:ic,tooltipContent:Sp,...e})}connectedCallback(){super.connectedCallback(),tc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_FULLSCREEN&&tc(this)}get mediaFullscreenUnavailable(){return C(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){M(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return k(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){S(this,o.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",Cs);var{MEDIA_TIME_IS_LIVE:hn,MEDIA_PAUSED:wa}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:Ip,MEDIA_PLAY_REQUEST:Cp}=p,Mp='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',rc=h.createElement("template");rc.innerHTML=`
682
682
  <style>
683
683
  :host { --media-tooltip-display: none; }
684
684
 
@@ -690,22 +690,26 @@
690
690
  color: var(--media-live-button-icon-color, rgb(140, 140, 140));
691
691
  }
692
692
 
693
- :host([${fn}]:not([${wa}])) slot[name=indicator] > *,
694
- :host([${fn}]:not([${wa}])) ::slotted([slot=indicator]) {
693
+ :host([${hn}]:not([${wa}])) slot[name=indicator] > *,
694
+ :host([${hn}]:not([${wa}])) ::slotted([slot=indicator]) {
695
695
  fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
696
696
  color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
697
697
  }
698
698
 
699
- :host([${fn}]:not([${wa}])) {
699
+ :host([${hn}]:not([${wa}])) {
700
700
  cursor: not-allowed;
701
701
  }
702
702
 
703
+ slot[name=text]{
704
+ text-transform: uppercase;
705
+ }
706
+
703
707
  </style>
704
708
 
705
709
  <slot name="indicator">${Mp}</slot>
706
710
 
707
- <slot name="spacer">&nbsp;</slot><slot name="text">LIVE</slot>
708
- `;var rc=t=>{let e=t.mediaPaused||!t.mediaTimeIsLive,i=e?G.SEEK_LIVE():G.PLAYING_LIVE();t.setAttribute("aria-label",i),e?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},Rs=class extends K{static get observedAttributes(){return[...super.observedAttributes,wa,fn]}constructor(e={}){super({slotTemplate:nc,...e})}connectedCallback(){rc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),rc(this)}get mediaPaused(){return y(this,o.MEDIA_PAUSED)}set mediaPaused(e){k(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return y(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){k(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(Ip,{composed:!0,bubbles:!0})),this.hasAttribute(wa)&&this.dispatchEvent(new d.CustomEvent(Cp,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",Rs);var sc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},xa=(t,e,i)=>(sc(t,e,"read from private field"),i?i.call(t):e.get(t)),oc=(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)},Da=(t,e,i,a)=>(sc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ge,En,vn={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},lc=500,dc=h.createElement("template"),Rp=`
711
+ <slot name="spacer">&nbsp;</slot><slot name="text">${f("live")}</slot>
712
+ `;var ac=t=>{let e=t.mediaPaused||!t.mediaTimeIsLive,i=e?f("seek to live"):f("playing live");t.setAttribute("aria-label",i),e?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},Ms=class extends V{static get observedAttributes(){return[...super.observedAttributes,wa,hn]}constructor(e={}){super({slotTemplate:rc,...e})}connectedCallback(){ac(this),super.connectedCallback()}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),ac(this)}get mediaPaused(){return k(this,o.MEDIA_PAUSED)}set mediaPaused(e){S(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return k(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){S(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(Ip,{composed:!0,bubbles:!0})),this.hasAttribute(wa)&&this.dispatchEvent(new d.CustomEvent(Cp,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",Ms);var oc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ra=(t,e,i)=>(oc(t,e,"read from private field"),i?i.call(t):e.get(t)),nc=(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)},La=(t,e,i,a)=>(oc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ke,fn,pn={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},sc=500,lc=h.createElement("template"),wp=`
709
713
  <svg aria-hidden="true" viewBox="0 0 100 100">
710
714
  <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">
711
715
  <animateTransform
@@ -718,13 +722,13 @@
718
722
  repeatCount="indefinite" />
719
723
  </path>
720
724
  </svg>
721
- `;dc.innerHTML=`
725
+ `;lc.innerHTML=`
722
726
  <style>
723
727
  :host {
724
728
  display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
725
729
  vertical-align: middle;
726
730
  box-sizing: border-box;
727
- --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${lc}ms);
731
+ --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${sc}ms);
728
732
  }
729
733
 
730
734
  #status {
@@ -763,52 +767,52 @@ svg, img, ::slotted(svg), ::slotted(img) {
763
767
  }
764
768
  </style>
765
769
 
766
- <slot name="icon">${Rp}</slot>
767
- <div id="status" role="status" aria-live="polite">${Y.MEDIA_LOADING()}</div>
768
- `;var Ls=class extends d.HTMLElement{constructor(){if(super(),oc(this,Ge,void 0),oc(this,En,lc),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),i=dc.content.cloneNode(!0);e.appendChild(i)}}static get observedAttributes(){return[R.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,vn.LOADING_DELAY]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===vn.LOADING_DELAY&&i!==a?this.loadingDelay=Number(a):e===R.MEDIA_CONTROLLER&&(i&&((n=(r=xa(this,Ge))==null?void 0:r.unassociateElement)==null||n.call(r,this),Da(this,Ge,null)),a&&this.isConnected&&(Da(this,Ge,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=xa(this,Ge))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(R.MEDIA_CONTROLLER);r&&(Da(this,Ge,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=xa(this,Ge))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=xa(this,Ge))==null?void 0:e.unassociateElement)==null||i.call(e,this),Da(this,Ge,null)}get loadingDelay(){return xa(this,En)}set loadingDelay(e){Da(this,En,e);let{style:i}=W(this.shadowRoot,":host");i.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return y(this,o.MEDIA_PAUSED)}set mediaPaused(e){k(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return y(this,o.MEDIA_LOADING)}set mediaLoading(e){k(this,o.MEDIA_LOADING,e)}get mediaController(){return I(this,R.MEDIA_CONTROLLER)}set mediaController(e){C(this,R.MEDIA_CONTROLLER,e)}get noAutohide(){return y(this,vn.NO_AUTOHIDE)}set noAutohide(e){k(this,vn.NO_AUTOHIDE,e)}};Ge=new WeakMap;En=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",Ls);var{MEDIA_VOLUME_LEVEL:Xt}=o,Lp=`<svg aria-hidden="true" viewBox="0 0 24 24">
770
+ <slot name="icon">${wp}</slot>
771
+ <div id="status" role="status" aria-live="polite">${f("media loading")}</div>
772
+ `;var ws=class extends d.HTMLElement{constructor(){if(super(),nc(this,Ke,void 0),nc(this,fn,sc),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),i=lc.content.cloneNode(!0);e.appendChild(i)}}static get observedAttributes(){return[R.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,pn.LOADING_DELAY]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===pn.LOADING_DELAY&&i!==a?this.loadingDelay=Number(a):e===R.MEDIA_CONTROLLER&&(i&&((n=(r=Ra(this,Ke))==null?void 0:r.unassociateElement)==null||n.call(r,this),La(this,Ke,null)),a&&this.isConnected&&(La(this,Ke,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Ra(this,Ke))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(R.MEDIA_CONTROLLER);r&&(La(this,Ke,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=Ra(this,Ke))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=Ra(this,Ke))==null?void 0:e.unassociateElement)==null||i.call(e,this),La(this,Ke,null)}get loadingDelay(){return Ra(this,fn)}set loadingDelay(e){La(this,fn,e);let{style:i}=W(this.shadowRoot,":host");i.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return k(this,o.MEDIA_PAUSED)}set mediaPaused(e){S(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,o.MEDIA_LOADING)}set mediaLoading(e){S(this,o.MEDIA_LOADING,e)}get mediaController(){return C(this,R.MEDIA_CONTROLLER)}set mediaController(e){M(this,R.MEDIA_CONTROLLER,e)}get noAutohide(){return k(this,pn.NO_AUTOHIDE)}set noAutohide(e){S(this,pn.NO_AUTOHIDE,e)}};Ke=new WeakMap;fn=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",ws);var{MEDIA_VOLUME_LEVEL:zt}=o,Rp=`<svg aria-hidden="true" viewBox="0 0 24 24">
769
773
  <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"/>
770
- </svg>`,uc=`<svg aria-hidden="true" viewBox="0 0 24 24">
774
+ </svg>`,dc=`<svg aria-hidden="true" viewBox="0 0 24 24">
771
775
  <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"/>
772
- </svg>`,wp=`<svg aria-hidden="true" viewBox="0 0 24 24">
776
+ </svg>`,Lp=`<svg aria-hidden="true" viewBox="0 0 24 24">
773
777
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
774
- </svg>`,mc=h.createElement("template");mc.innerHTML=`
778
+ </svg>`,cc=h.createElement("template");cc.innerHTML=`
775
779
  <style>
776
780
 
777
- :host(:not([${Xt}])) slot[name=icon] slot:not([name=high]),
778
- :host([${Xt}=high]) slot[name=icon] slot:not([name=high]) {
781
+ :host(:not([${zt}])) slot[name=icon] slot:not([name=high]),
782
+ :host([${zt}=high]) slot[name=icon] slot:not([name=high]) {
779
783
  display: none !important;
780
784
  }
781
785
 
782
- :host([${Xt}=off]) slot[name=icon] slot:not([name=off]) {
786
+ :host([${zt}=off]) slot[name=icon] slot:not([name=off]) {
783
787
  display: none !important;
784
788
  }
785
789
 
786
- :host([${Xt}=low]) slot[name=icon] slot:not([name=low]) {
790
+ :host([${zt}=low]) slot[name=icon] slot:not([name=low]) {
787
791
  display: none !important;
788
792
  }
789
793
 
790
- :host([${Xt}=medium]) slot[name=icon] slot:not([name=medium]) {
794
+ :host([${zt}=medium]) slot[name=icon] slot:not([name=medium]) {
791
795
  display: none !important;
792
796
  }
793
797
 
794
- :host(:not([${Xt}=off])) slot[name=tooltip-unmute],
795
- :host([${Xt}=off]) slot[name=tooltip-mute] {
798
+ :host(:not([${zt}=off])) slot[name=tooltip-unmute],
799
+ :host([${zt}=off]) slot[name=tooltip-mute] {
796
800
  display: none;
797
801
  }
798
802
  </style>
799
803
 
800
804
  <slot name="icon">
801
- <slot name="off">${Lp}</slot>
802
- <slot name="low">${uc}</slot>
803
- <slot name="medium">${uc}</slot>
804
- <slot name="high">${wp}</slot>
805
+ <slot name="off">${Rp}</slot>
806
+ <slot name="low">${dc}</slot>
807
+ <slot name="medium">${dc}</slot>
808
+ <slot name="high">${Lp}</slot>
805
809
  </slot>
806
810
  `;var xp=`
807
- <slot name="tooltip-mute">${D.MUTE}</slot>
808
- <slot name="tooltip-unmute">${D.UNMUTE}</slot>
809
- `,cc=t=>{let i=t.mediaVolumeLevel==="off"?G.UNMUTE():G.MUTE();t.setAttribute("aria-label",i)},ws=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:mc,tooltipContent:xp,...e})}connectedCallback(){cc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_VOLUME_LEVEL&&cc(this),super.attributeChangedCallback(e,i,a)}get mediaVolumeLevel(){return I(this,o.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){C(this,o.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",ws);var hc=`<svg aria-hidden="true" viewBox="0 0 28 24">
811
+ <slot name="tooltip-mute">${f("Mute")}</slot>
812
+ <slot name="tooltip-unmute">${f("Unmute")}</slot>
813
+ `,uc=t=>{let i=t.mediaVolumeLevel==="off"?f("unmute"):f("mute");t.setAttribute("aria-label",i)},Rs=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:cc,tooltipContent:xp,...e})}connectedCallback(){uc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_VOLUME_LEVEL&&uc(this),super.attributeChangedCallback(e,i,a)}get mediaVolumeLevel(){return C(this,o.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){M(this,o.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",Rs);var mc=`<svg aria-hidden="true" viewBox="0 0 28 24">
810
814
  <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"/>
811
- </svg>`,fc=h.createElement("template");fc.innerHTML=`
815
+ </svg>`,pc=h.createElement("template");pc.innerHTML=`
812
816
  <style>
813
817
  :host([${o.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
814
818
  display: none !important;
@@ -826,13 +830,13 @@ svg, img, ::slotted(svg), ::slotted(img) {
826
830
  </style>
827
831
 
828
832
  <slot name="icon">
829
- <slot name="enter">${hc}</slot>
830
- <slot name="exit">${hc}</slot>
833
+ <slot name="enter">${mc}</slot>
834
+ <slot name="exit">${mc}</slot>
831
835
  </slot>
832
836
  `;var Dp=`
833
- <slot name="tooltip-enter">${D.ENTER_PIP}</slot>
834
- <slot name="tooltip-exit">${D.EXIT_PIP}</slot>
835
- `,pc=t=>{let e=t.mediaIsPip?G.EXIT_PIP():G.ENTER_PIP();t.setAttribute("aria-label",e)},xs=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:fc,tooltipContent:Dp,...e})}connectedCallback(){pc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_IS_PIP&&pc(this),super.attributeChangedCallback(e,i,a)}get mediaPipUnavailable(){return I(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){C(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return y(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){k(this,o.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?p.MEDIA_EXIT_PIP_REQUEST:p.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",xs);var Op=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bn=(t,e,i)=>(Op(t,e,"read from private field"),i?i.call(t):e.get(t)),Np=(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)},Li,Ds={RATES:"rates"},Ns=[1,1.2,1.5,1.7,2],wi=1,vc=h.createElement("template");vc.innerHTML=`
837
+ <slot name="tooltip-enter">${f("Enter picture in picture mode")}</slot>
838
+ <slot name="tooltip-exit">${f("Exit picture in picture mode")}</slot>
839
+ `,hc=t=>{let e=t.mediaIsPip?f("exit picture in picture mode"):f("enter picture in picture mode");t.setAttribute("aria-label",e)},Ls=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:pc,tooltipContent:Dp,...e})}connectedCallback(){hc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_IS_PIP&&hc(this),super.attributeChangedCallback(e,i,a)}get mediaPipUnavailable(){return C(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){M(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return k(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){S(this,o.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?p.MEDIA_EXIT_PIP_REQUEST:p.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",Ls);var Op=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},vn=(t,e,i)=>(Op(t,e,"read from private field"),i?i.call(t):e.get(t)),Np=(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)},wi,xs={RATES:"rates"},Os=[1,1.2,1.5,1.7,2],Ri=1,fc=h.createElement("template");fc.innerHTML=`
836
840
  <style>
837
841
  :host {
838
842
  min-width: 5ch;
@@ -840,11 +844,11 @@ svg, img, ::slotted(svg), ::slotted(img) {
840
844
  }
841
845
  </style>
842
846
  <slot name="icon"></slot>
843
- `;var Os=class extends K{constructor(e={}){super({slotTemplate:vc,tooltipContent:D.PLAYBACK_RATE,...e}),Np(this,Li,new $e(this,Ds.RATES,{defaultValue:Ns})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${wi}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Ds.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===Ds.RATES&&(bn(this,Li).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?wi:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",Y.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return bn(this,Li)}set rates(e){e?Array.isArray(e)&&(bn(this,Li).value=e.join(" ")):bn(this,Li).value=""}get mediaPlaybackRate(){return w(this,o.MEDIA_PLAYBACK_RATE,wi)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,i;let a=Array.from(this.rates.values(),s=>+s).sort((s,l)=>s-l),r=(i=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?i:wi,n=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};Li=new WeakMap;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",Os);var Pp=`<svg aria-hidden="true" viewBox="0 0 24 24">
847
+ `;var Ds=class extends V{constructor(e={}){super({slotTemplate:fc,tooltipContent:f("Playback rate"),...e}),Np(this,wi,new Be(this,xs.RATES,{defaultValue:Os})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${Ri}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,xs.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===xs.RATES&&(vn(this,wi).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Ri:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",f("Playback rate {playbackRate}",{playbackRate:n}))}}get rates(){return vn(this,wi)}set rates(e){e?Array.isArray(e)&&(vn(this,wi).value=e.join(" ")):vn(this,wi).value=""}get mediaPlaybackRate(){return x(this,o.MEDIA_PLAYBACK_RATE,Ri)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,i;let a=Array.from(this.rates.values(),s=>+s).sort((s,l)=>s-l),r=(i=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?i:Ri,n=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};wi=new WeakMap;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",Ds);var Pp=`<svg aria-hidden="true" viewBox="0 0 24 24">
844
848
  <path d="m6 21 15-9L6 3v18Z"/>
845
849
  </svg>`,Up=`<svg aria-hidden="true" viewBox="0 0 24 24">
846
850
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
847
- </svg>`,bc=h.createElement("template");bc.innerHTML=`
851
+ </svg>`,Ec=h.createElement("template");Ec.innerHTML=`
848
852
  <style>
849
853
  :host([${o.MEDIA_PAUSED}]) slot[name=pause],
850
854
  :host(:not([${o.MEDIA_PAUSED}])) slot[name=play] {
@@ -862,9 +866,9 @@ svg, img, ::slotted(svg), ::slotted(img) {
862
866
  <slot name="pause">${Up}</slot>
863
867
  </slot>
864
868
  `;var Bp=`
865
- <slot name="tooltip-play">${D.PLAY}</slot>
866
- <slot name="tooltip-pause">${D.PAUSE}</slot>
867
- `,Ec=t=>{let e=t.mediaPaused?G.PLAY():G.PAUSE();t.setAttribute("aria-label",e)},Ps=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:bc,tooltipContent:Bp,...e})}connectedCallback(){Ec(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_PAUSED&&Ec(this),super.attributeChangedCallback(e,i,a)}get mediaPaused(){return y(this,o.MEDIA_PAUSED)}set mediaPaused(e){k(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-play-button")||d.customElements.define("media-play-button",Ps);var qe={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},gc=h.createElement("template");gc.innerHTML=`
869
+ <slot name="tooltip-play">${f("Play")}</slot>
870
+ <slot name="tooltip-pause">${f("Pause")}</slot>
871
+ `,vc=t=>{let e=t.mediaPaused?f("play"):f("pause");t.setAttribute("aria-label",e)},Ns=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:Ec,tooltipContent:Bp,...e})}connectedCallback(){vc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_PAUSED&&vc(this),super.attributeChangedCallback(e,i,a)}get mediaPaused(){return k(this,o.MEDIA_PAUSED)}set mediaPaused(e){S(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-play-button")||d.customElements.define("media-play-button",Ns);var Ge={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},bc=h.createElement("template");bc.innerHTML=`
868
872
  <style>
869
873
  :host {
870
874
  pointer-events: none;
@@ -886,7 +890,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
886
890
  </style>
887
891
 
888
892
  <img part="poster img" aria-hidden="true" id="image"/>
889
- `;var Hp=t=>{t.style.removeProperty("background-image")},$p=(t,e)=>{t.style["background-image"]=`url('${e}')`},Us=class extends d.HTMLElement{static get observedAttributes(){return[qe.PLACEHOLDER_SRC,qe.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(gc.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,i,a){e===qe.SRC&&(a==null?this.image.removeAttribute(qe.SRC):this.image.setAttribute(qe.SRC,a)),e===qe.PLACEHOLDER_SRC&&(a==null?Hp(this.image):$p(this.image,a))}get placeholderSrc(){return I(this,qe.PLACEHOLDER_SRC)}set placeholderSrc(e){C(this,qe.SRC,e)}get src(){return I(this,qe.SRC)}set src(e){C(this,qe.SRC,e)}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Us);var _c=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Wp=(t,e,i)=>(_c(t,e,"read from private field"),i?i.call(t):e.get(t)),Fp=(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)},Kp=(t,e,i,a)=>(_c(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),gn,Bs=class extends Oe{constructor(){super(),Fp(this,gn,void 0),Kp(this,gn,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PREVIEW_CHAPTER&&a!==i&&a!=null&&(Wp(this,gn).textContent=a,a!==""?this.setAttribute("aria-valuetext",`chapter: ${a}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return I(this,o.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){C(this,o.MEDIA_PREVIEW_CHAPTER,e)}};gn=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",Bs);var Ac=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_n=(t,e,i)=>(Ac(t,e,"read from private field"),i?i.call(t):e.get(t)),Vp=(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),Ze,Tc=h.createElement("template");Tc.innerHTML=`
893
+ `;var Hp=t=>{t.style.removeProperty("background-image")},$p=(t,e)=>{t.style["background-image"]=`url('${e}')`},Ps=class extends d.HTMLElement{static get observedAttributes(){return[Ge.PLACEHOLDER_SRC,Ge.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(bc.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,i,a){e===Ge.SRC&&(a==null?this.image.removeAttribute(Ge.SRC):this.image.setAttribute(Ge.SRC,a)),e===Ge.PLACEHOLDER_SRC&&(a==null?Hp(this.image):$p(this.image,a))}get placeholderSrc(){return C(this,Ge.PLACEHOLDER_SRC)}set placeholderSrc(e){M(this,Ge.SRC,e)}get src(){return C(this,Ge.SRC)}set src(e){M(this,Ge.SRC,e)}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Ps);var gc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Wp=(t,e,i)=>(gc(t,e,"read from private field"),i?i.call(t):e.get(t)),Fp=(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)},Vp=(t,e,i,a)=>(gc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),En,Us=class extends xe{constructor(){super(),Fp(this,En,void 0),Vp(this,En,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PREVIEW_CHAPTER&&a!==i&&a!=null&&(Wp(this,En).textContent=a,a!==""?this.setAttribute("aria-valuetext",`chapter: ${a}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return C(this,o.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){M(this,o.MEDIA_PREVIEW_CHAPTER,e)}};En=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",Us);var _c=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bn=(t,e,i)=>(_c(t,e,"read from private field"),i?i.call(t):e.get(t)),Kp=(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)},gn=(t,e,i,a)=>(_c(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ye,Ac=h.createElement("template");Ac.innerHTML=`
890
894
  <style>
891
895
  :host {
892
896
  box-sizing: border-box;
@@ -900,11 +904,11 @@ svg, img, ::slotted(svg), ::slotted(img) {
900
904
  }
901
905
  </style>
902
906
  <img crossorigin loading="eager" decoding="async">
903
- `;var Hs=class extends d.HTMLElement{constructor(){super(),Vp(this,Ze,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Tc.content.cloneNode(!0)))}static get observedAttributes(){return[R.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(R.MEDIA_CONTROLLER);r&&(An(this,Ze,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=_n(this,Ze))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=_n(this,Ze))==null?void 0:e.unassociateElement)==null||i.call(e,this),An(this,Ze,null)}attributeChangedCallback(e,i,a){var r,n,s,l,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===R.MEDIA_CONTROLLER&&(i&&((n=(r=_n(this,Ze))==null?void 0:r.unassociateElement)==null||n.call(r,this),An(this,Ze,null)),a&&this.isConnected&&(An(this,Ze,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=_n(this,Ze))==null?void 0:l.associateElement)==null||u.call(l,this)))}get mediaPreviewImage(){return I(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){C(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(i=>+i)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(o.MEDIA_PREVIEW_COORDS);return}this.setAttribute(o.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,i=this.mediaPreviewImage;if(!(e&&i))return;let[a,r,n,s]=e,l=i.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:_,minWidth:g,minHeight:f}=u,v=Math.min(parseInt(c)/n,parseInt(_)/s),P=Math.max(parseInt(g)/n,parseInt(f)/s),A=v<1,M=A?v:P>1?P:1,{style:U}=W(this.shadowRoot,":host"),ee=W(this.shadowRoot,"img").style,_e=this.shadowRoot.querySelector("img"),gt=A?"min":"max";U.setProperty(`${gt}-width`,"initial","important"),U.setProperty(`${gt}-height`,"initial","important"),U.width=`${n*M}px`,U.height=`${s*M}px`;let nt=()=>{ee.width=`${this.imgWidth*M}px`,ee.height=`${this.imgHeight*M}px`,ee.display="block"};_e.src!==l&&(_e.onload=()=>{this.imgWidth=_e.naturalWidth,this.imgHeight=_e.naturalHeight,nt()},_e.src=l,nt()),nt(),ee.transform=`translate(-${a*M}px, -${r*M}px)`}};Ze=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Hs);var kc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},yc=(t,e,i)=>(kc(t,e,"read from private field"),i?i.call(t):e.get(t)),Yp=(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)},Gp=(t,e,i,a)=>(kc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Oa,$s=class extends Oe{constructor(){super(),Yp(this,Oa,void 0),Gp(this,Oa,this.shadowRoot.querySelector("slot")),yc(this,Oa).textContent=Be(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PREVIEW_TIME&&a!=null&&(yc(this,Oa).textContent=Be(parseFloat(a)))}get mediaPreviewTime(){return w(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}};Oa=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",$s);var xi={SEEK_OFFSET:"seekoffset"},Tn=30,qp=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${Tn}</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg>`,Sc=h.createElement("template");Sc.innerHTML=`
907
+ `;var Bs=class extends d.HTMLElement{constructor(){super(),Kp(this,Ye,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ac.content.cloneNode(!0)))}static get observedAttributes(){return[R.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(R.MEDIA_CONTROLLER);r&&(gn(this,Ye,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=bn(this,Ye))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=bn(this,Ye))==null?void 0:e.unassociateElement)==null||i.call(e,this),gn(this,Ye,null)}attributeChangedCallback(e,i,a){var r,n,s,l,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===R.MEDIA_CONTROLLER&&(i&&((n=(r=bn(this,Ye))==null?void 0:r.unassociateElement)==null||n.call(r,this),gn(this,Ye,null)),a&&this.isConnected&&(gn(this,Ye,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=bn(this,Ye))==null?void 0:l.associateElement)==null||u.call(l,this)))}get mediaPreviewImage(){return C(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(i=>+i)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(o.MEDIA_PREVIEW_COORDS);return}this.setAttribute(o.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,i=this.mediaPreviewImage;if(!(e&&i))return;let[a,r,n,s]=e,l=i.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:A,minWidth:_,minHeight:v}=u,E=Math.min(parseInt(c)/n,parseInt(A)/s),P=Math.max(parseInt(_)/n,parseInt(v)/s),y=E<1,w=y?E:P>1?P:1,{style:U}=W(this.shadowRoot,":host"),J=W(this.shadowRoot,"img").style,be=this.shadowRoot.querySelector("img"),Et=y?"min":"max";U.setProperty(`${Et}-width`,"initial","important"),U.setProperty(`${Et}-height`,"initial","important"),U.width=`${n*w}px`,U.height=`${s*w}px`;let at=()=>{J.width=`${this.imgWidth*w}px`,J.height=`${this.imgHeight*w}px`,J.display="block"};be.src!==l&&(be.onload=()=>{this.imgWidth=be.naturalWidth,this.imgHeight=be.naturalHeight,at()},be.src=l,at()),at(),J.transform=`translate(-${a*w}px, -${r*w}px)`}};Ye=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Bs);var Tc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},yc=(t,e,i)=>(Tc(t,e,"read from private field"),i?i.call(t):e.get(t)),Gp=(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)},Yp=(t,e,i,a)=>(Tc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),xa,Hs=class extends xe{constructor(){super(),Gp(this,xa,void 0),Yp(this,xa,this.shadowRoot.querySelector("slot")),yc(this,xa).textContent=Pe(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PREVIEW_TIME&&a!=null&&(yc(this,xa).textContent=Pe(parseFloat(a)))}get mediaPreviewTime(){return x(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}};xa=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Hs);var Li={SEEK_OFFSET:"seekoffset"},_n=30,qp=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${_n}</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg>`,kc=h.createElement("template");kc.innerHTML=`
904
908
  <slot name="icon">${qp}</slot>
905
- `;var Zp=0,Ws=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,xi.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Sc,tooltipContent:D.SEEK_BACKWARD,...e})}connectedCallback(){this.seekOffset=w(this,xi.SEEK_OFFSET,Tn),super.connectedCallback()}attributeChangedCallback(e,i,a){e===xi.SEEK_OFFSET&&(this.seekOffset=w(this,xi.SEEK_OFFSET,Tn)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return w(this,xi.SEEK_OFFSET,Tn)}set seekOffset(e){O(this,xi.SEEK_OFFSET,e),this.setAttribute("aria-label",G.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),Cr(Mr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return w(this,o.MEDIA_CURRENT_TIME,Zp)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),i=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",Ws);var Di={SEEK_OFFSET:"seekoffset"},yn=30,zp=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${yn}</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg>`,Ic=h.createElement("template");Ic.innerHTML=`
909
+ `;var Zp=0,$s=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,Li.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:kc,tooltipContent:f("Seek backward"),...e})}connectedCallback(){this.seekOffset=x(this,Li.SEEK_OFFSET,_n),super.connectedCallback()}attributeChangedCallback(e,i,a){e===Li.SEEK_OFFSET&&(this.seekOffset=x(this,Li.SEEK_OFFSET,_n)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return x(this,Li.SEEK_OFFSET,_n)}set seekOffset(e){O(this,Li.SEEK_OFFSET,e),this.setAttribute("aria-label",f("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Sr(Ir(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return x(this,o.MEDIA_CURRENT_TIME,Zp)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),i=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",$s);var xi={SEEK_OFFSET:"seekoffset"},An=30,zp=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${An}</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg>`,Sc=h.createElement("template");Sc.innerHTML=`
906
910
  <slot name="icon">${zp}</slot>
907
- `;var Qp=0,Fs=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,Di.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Ic,tooltipContent:D.SEEK_FORWARD,...e})}connectedCallback(){this.seekOffset=w(this,Di.SEEK_OFFSET,yn),super.connectedCallback()}attributeChangedCallback(e,i,a){e===Di.SEEK_OFFSET&&(this.seekOffset=w(this,Di.SEEK_OFFSET,yn)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return w(this,Di.SEEK_OFFSET,yn)}set seekOffset(e){O(this,Di.SEEK_OFFSET,e),this.setAttribute("aria-label",G.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),Cr(Mr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return w(this,o.MEDIA_CURRENT_TIME,Qp)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,i=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",Fs);var Lc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ks=(t,e,i)=>(Lc(t,e,"read from private field"),i?i.call(t):e.get(t)),Xp=(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)},Jp=(t,e,i,a)=>(Lc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Oi,Ne={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Cc=[...Object.values(Ne),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],Mc=["Enter"," "],jp="&nbsp;/&nbsp;",Rc=(t,{timesSep:e=jp}={})=>{var i,a;let r=t.hasAttribute(Ne.REMAINING),n=t.hasAttribute(Ne.SHOW_DURATION),s=(i=t.mediaCurrentTime)!=null?i:0,[,l]=(a=t.mediaSeekable)!=null?a:[],u=0;Number.isFinite(t.mediaDuration)?u=t.mediaDuration:Number.isFinite(l)&&(u=l);let c=r?Be(0-(u-s)):Be(s);return n?`${c}${e}${Be(u)}`:c},ef="video not loaded, unknown time.",tf=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",ef);return}let n=t.hasAttribute(Ne.REMAINING),s=t.hasAttribute(Ne.SHOW_DURATION),l=n?Ut(0-(r-i)):Ut(i);if(!s){t.setAttribute("aria-valuetext",l);return}let u=Ut(r),c=`${l} of ${u}`;t.setAttribute("aria-valuetext",c)},Vs=class extends Oe{constructor(){super(),Xp(this,Oi,void 0),Jp(this,Oi,this.shadowRoot.querySelector("slot")),Ks(this,Oi).innerHTML=`${Rc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Cc,"disabled"]}connectedCallback(){let{style:e}=W(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("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",Y.PLAYBACK_TIME());let i=a=>{let{key:r}=a;if(!Mc.includes(r)){this.removeEventListener("keyup",i);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!Mc.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){Cc.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 y(this,Ne.REMAINING)}set remaining(e){k(this,Ne.REMAINING,e)}get showDuration(){return y(this,Ne.SHOW_DURATION)}set showDuration(e){k(this,Ne.SHOW_DURATION,e)}get noToggle(){return y(this,Ne.NO_TOGGLE)}set noToggle(e){k(this,Ne.NO_TOGGLE,e)}get mediaDuration(){return w(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return w(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Rc(this);tf(this),e!==Ks(this,Oi).innerHTML&&(Ks(this,Oi).innerHTML=e)}};Oi=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",Vs);var wc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},re=(t,e,i)=>(wc(t,e,"read from private field"),i?i.call(t):e.get(t)),ze=(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)},Ce=(t,e,i,a)=>(wc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),af=(t,e,i,a)=>({set _(r){Ce(t,e,r,i)},get _(){return re(t,e,a)}}),Ni,kn,Pi,Na,Sn,In,Cn,Ui,Jt,Mn,Rn=class{constructor(e,i,a){ze(this,Ni,void 0),ze(this,kn,void 0),ze(this,Pi,void 0),ze(this,Na,void 0),ze(this,Sn,void 0),ze(this,In,void 0),ze(this,Cn,void 0),ze(this,Ui,void 0),ze(this,Jt,0),ze(this,Mn,(r=performance.now())=>{Ce(this,Jt,requestAnimationFrame(re(this,Mn))),Ce(this,Na,performance.now()-re(this,Pi));let n=1e3/this.fps;if(re(this,Na)>n){Ce(this,Pi,r-re(this,Na)%n);let s=1e3/((r-re(this,kn))/++af(this,Sn)._),l=(r-re(this,In))/1e3/this.duration,u=re(this,Cn)+l*this.playbackRate;u-re(this,Ni).valueAsNumber>0?Ce(this,Ui,this.playbackRate/this.duration/s):(Ce(this,Ui,.995*re(this,Ui)),u=re(this,Ni).valueAsNumber+re(this,Ui)),this.callback(u)}}),Ce(this,Ni,e),this.callback=i,this.fps=a}start(){re(this,Jt)===0&&(Ce(this,Pi,performance.now()),Ce(this,kn,re(this,Pi)),Ce(this,Sn,0),re(this,Mn).call(this))}stop(){re(this,Jt)!==0&&(cancelAnimationFrame(re(this,Jt)),Ce(this,Jt,0))}update({start:e,duration:i,playbackRate:a}){let r=e-re(this,Ni).valueAsNumber,n=Math.abs(i-this.duration);(r>0||r<-.03||n>=.5)&&this.callback(e),Ce(this,Cn,e),Ce(this,In,performance.now()),this.duration=i,this.playbackRate=a}};Ni=new WeakMap;kn=new WeakMap;Pi=new WeakMap;Na=new WeakMap;Sn=new WeakMap;In=new WeakMap;Cn=new WeakMap;Ui=new WeakMap;Jt=new WeakMap;Mn=new WeakMap;var zs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},te=(t,e,i)=>(zs(t,e,"read from private field"),i?i.call(t):e.get(t)),ne=(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)},Qe=(t,e,i,a)=>(zs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),le=(t,e,i)=>(zs(t,e,"access private method"),i),Bi,jt,xn,Ua,Dn,wn,Ba,Ha,Hi,$i,Pa,Qs,xc,Ys,On,Xs,Nn,Js,Pn,js,Gs,Dc,$a,Un,qs,Oc,rf="video not loaded, unknown time.",nf=t=>{let e=t.range,i=Ut(+Pc(t)),a=Ut(+t.mediaSeekableEnd),r=i&&a?`${i} of ${a}`:rf;e.setAttribute("aria-valuetext",r)},Nc=h.createElement("template");Nc.innerHTML=`
911
+ `;var Qp=0,Ws=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,xi.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Sc,tooltipContent:f("Seek forward"),...e})}connectedCallback(){this.seekOffset=x(this,xi.SEEK_OFFSET,An),super.connectedCallback()}attributeChangedCallback(e,i,a){e===xi.SEEK_OFFSET&&(this.seekOffset=x(this,xi.SEEK_OFFSET,An)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return x(this,xi.SEEK_OFFSET,An)}set seekOffset(e){O(this,xi.SEEK_OFFSET,e),this.setAttribute("aria-label",f("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Sr(Ir(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return x(this,o.MEDIA_CURRENT_TIME,Qp)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,i=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",Ws);var wc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Fs=(t,e,i)=>(wc(t,e,"read from private field"),i?i.call(t):e.get(t)),Xp=(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)},Jp=(t,e,i,a)=>(wc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Di,De={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Ic=[...Object.values(De),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],Cc=["Enter"," "],jp="&nbsp;/&nbsp;",Mc=(t,{timesSep:e=jp}={})=>{var i,a;let r=t.hasAttribute(De.REMAINING),n=t.hasAttribute(De.SHOW_DURATION),s=(i=t.mediaCurrentTime)!=null?i:0,[,l]=(a=t.mediaSeekable)!=null?a:[],u=0;Number.isFinite(t.mediaDuration)?u=t.mediaDuration:Number.isFinite(l)&&(u=l);let c=r?Pe(0-(u-s)):Pe(s);return n?`${c}${e}${Pe(u)}`:c},ef="video not loaded, unknown time.",tf=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",ef);return}let n=t.hasAttribute(De.REMAINING),s=t.hasAttribute(De.SHOW_DURATION),l=n?Nt(0-(r-i)):Nt(i);if(!s){t.setAttribute("aria-valuetext",l);return}let u=Nt(r),c=`${l} of ${u}`;t.setAttribute("aria-valuetext",c)},Vs=class extends xe{constructor(){super(),Xp(this,Di,void 0),Jp(this,Di,this.shadowRoot.querySelector("slot")),Fs(this,Di).innerHTML=`${Mc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Ic,"disabled"]}connectedCallback(){let{style:e}=W(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("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",f("playback time"));let i=a=>{let{key:r}=a;if(!Cc.includes(r)){this.removeEventListener("keyup",i);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!Cc.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){Ic.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,De.REMAINING)}set remaining(e){S(this,De.REMAINING,e)}get showDuration(){return k(this,De.SHOW_DURATION)}set showDuration(e){S(this,De.SHOW_DURATION,e)}get noToggle(){return k(this,De.NO_TOGGLE)}set noToggle(e){S(this,De.NO_TOGGLE,e)}get mediaDuration(){return x(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return x(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Mc(this);tf(this),e!==Fs(this,Di).innerHTML&&(Fs(this,Di).innerHTML=e)}};Di=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",Vs);var Rc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ie=(t,e,i)=>(Rc(t,e,"read from private field"),i?i.call(t):e.get(t)),qe=(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)},Se=(t,e,i,a)=>(Rc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),af=(t,e,i,a)=>({set _(r){Se(t,e,r,i)},get _(){return ie(t,e,a)}}),Oi,yn,Ni,Da,Tn,kn,Sn,Pi,Qt,In,Cn=class{constructor(e,i,a){qe(this,Oi,void 0),qe(this,yn,void 0),qe(this,Ni,void 0),qe(this,Da,void 0),qe(this,Tn,void 0),qe(this,kn,void 0),qe(this,Sn,void 0),qe(this,Pi,void 0),qe(this,Qt,0),qe(this,In,(r=performance.now())=>{Se(this,Qt,requestAnimationFrame(ie(this,In))),Se(this,Da,performance.now()-ie(this,Ni));let n=1e3/this.fps;if(ie(this,Da)>n){Se(this,Ni,r-ie(this,Da)%n);let s=1e3/((r-ie(this,yn))/++af(this,Tn)._),l=(r-ie(this,kn))/1e3/this.duration,u=ie(this,Sn)+l*this.playbackRate;u-ie(this,Oi).valueAsNumber>0?Se(this,Pi,this.playbackRate/this.duration/s):(Se(this,Pi,.995*ie(this,Pi)),u=ie(this,Oi).valueAsNumber+ie(this,Pi)),this.callback(u)}}),Se(this,Oi,e),this.callback=i,this.fps=a}start(){ie(this,Qt)===0&&(Se(this,Ni,performance.now()),Se(this,yn,ie(this,Ni)),Se(this,Tn,0),ie(this,In).call(this))}stop(){ie(this,Qt)!==0&&(cancelAnimationFrame(ie(this,Qt)),Se(this,Qt,0))}update({start:e,duration:i,playbackRate:a}){let r=e-ie(this,Oi).valueAsNumber,n=Math.abs(i-this.duration);(r>0||r<-.03||n>=.5)&&this.callback(e),Se(this,Sn,e),Se(this,kn,performance.now()),this.duration=i,this.playbackRate=a}};Oi=new WeakMap;yn=new WeakMap;Ni=new WeakMap;Da=new WeakMap;Tn=new WeakMap;kn=new WeakMap;Sn=new WeakMap;Pi=new WeakMap;Qt=new WeakMap;In=new WeakMap;var Zs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},j=(t,e,i)=>(Zs(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)},Ze=(t,e,i,a)=>(Zs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),oe=(t,e,i)=>(Zs(t,e,"access private method"),i),Ui,Xt,Rn,Na,Ln,wn,Pa,Ua,Bi,Hi,Oa,zs,Lc,Ks,xn,Qs,Dn,Xs,On,Js,Gs,xc,Ba,Nn,Ys,Dc,rf="video not loaded, unknown time.",nf=t=>{let e=t.range,i=Nt(+Nc(t)),a=Nt(+t.mediaSeekableEnd),r=i&&a?`${i} of ${a}`:rf;e.setAttribute("aria-valuetext",r)},Oc=h.createElement("template");Oc.innerHTML=`
908
912
  <style>
909
913
  :host {
910
914
  --media-box-border-radius: 4px;
@@ -1117,7 +1121,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1117
1121
 
1118
1122
  </slot>
1119
1123
  </div>
1120
- `;var Ln=(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))},Pc=(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},Zs=class extends Qt{constructor(){super(),ne(this,$i),ne(this,Qs),ne(this,On),ne(this,Nn),ne(this,Pn),ne(this,Gs),ne(this,$a),ne(this,qs),ne(this,Bi,void 0),ne(this,jt,void 0),ne(this,xn,void 0),ne(this,Ua,void 0),ne(this,Dn,void 0),ne(this,wn,void 0),ne(this,Ba,void 0),ne(this,Ha,void 0),ne(this,Hi,void 0),ne(this,Ys,a=>{this.dragging||(bi(a)&&(this.range.valueAsNumber=a),this.updateBar())}),this.container.appendChild(Nc.content.cloneNode(!0)),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Qe(this,xn,this.shadowRoot.querySelectorAll('[part~="box"]')),Qe(this,Dn,this.shadowRoot.querySelector('[part~="preview-box"]')),Qe(this,wn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);Qe(this,Ba,parseInt(i.getPropertyValue("--media-box-padding-left"))),Qe(this,Ha,parseInt(i.getPropertyValue("--media-box-padding-right"))),Qe(this,jt,new Rn(this.range,te(this,Ys),60))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_PREVIEW_CHAPTER,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING,o.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",Y.SEEK()),le(this,$i,Pa).call(this),Qe(this,Bi,this.getRootNode()),(e=te(this,Bi))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),le(this,$i,Pa).call(this),(e=te(this,Bi))==null||e.removeEventListener("transitionstart",this),Qe(this,Bi,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_ENDED||e===o.MEDIA_LOADING||e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE?(te(this,jt).update({start:Ln(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),le(this,$i,Pa).call(this),nf(this)):e===o.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=te(this,Hi),this.updateBar()))}get mediaChaptersCues(){return te(this,Hi)}set mediaChaptersCues(e){var i;Qe(this,Hi,e),this.updateSegments((i=te(this,Hi))==null?void 0:i.map(a=>({start:Ln(this,a.startTime),end:Ln(this,a.endTime)})))}get mediaPaused(){return y(this,o.MEDIA_PAUSED)}set mediaPaused(e){k(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return y(this,o.MEDIA_LOADING)}set mediaLoading(e){k(this,o.MEDIA_LOADING,e)}get mediaDuration(){return w(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return w(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return w(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(o.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(o.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.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 I(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){C(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return w(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return y(this,o.MEDIA_ENDED)}set mediaEnded(e){k(this,o.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 n=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([l,u])=>l<=n&&n<=u))!=null?e:[];a=Ln(this,s)}let{style:r}=W(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=W(this.shadowRoot,"#current-rail"),a=W(this.shadowRoot,'[part~="current-box"]'),r=le(this,On,Xs).call(this,te(this,wn)),n=le(this,Nn,Js).call(this,r,this.range.valueAsNumber),s=le(this,Pn,js).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${n})`,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":le(this,qs,Oc).call(this);break;case"pointermove":le(this,Gs,Dc).call(this,e);break;case"pointerup":case"pointerleave":le(this,$a,Un).call(this,null);break;case"transitionstart":ue(e.target,this)&&setTimeout(()=>le(this,$i,Pa).call(this),0);break}}};Bi=new WeakMap;jt=new WeakMap;xn=new WeakMap;Ua=new WeakMap;Dn=new WeakMap;wn=new WeakMap;Ba=new WeakMap;Ha=new WeakMap;Hi=new WeakMap;$i=new WeakSet;Pa=function(){le(this,Qs,xc).call(this)?te(this,jt).start():te(this,jt).stop()};Qs=new WeakSet;xc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Rr(this)};Ys=new WeakMap;On=new WeakSet;Xs=function(t){var e;let a=((e=this.getAttribute("bounds")?He(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),n=t.offsetWidth,s=-(r.left-a.left-n/2),l=a.right-r.left-n/2;return{box:{width:n,min:s,max:l},bounds:a,range:r}};Nn=new WeakSet;Js=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:n}=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(n)){let l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;i=`min(${i}, ${l})`}return i};Pn=new WeakSet;js=function(t,e){let{width:i,min:a,max:r}=t.box,n=e*t.range.width;if(n<a+te(this,Ba)){let s=t.range.left-t.bounds.left-te(this,Ba);return`${n-i/2+s}px`}if(n>r-te(this,Ha)){let s=t.bounds.right-t.range.right-te(this,Ha);return`${n+i/2-s-t.range.width}px`}return 0};Gs=new WeakSet;Dc=function(t){let e=[...te(this,xn)].some(_=>t.composedPath().includes(_));if(!this.dragging&&(e||!t.composedPath().includes(this))){le(this,$a,Un).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=W(this.shadowRoot,"#preview-rail"),r=W(this.shadowRoot,'[part~="preview-box"]'),n=le(this,On,Xs).call(this,te(this,Dn)),s=(t.clientX-n.range.left)/n.range.width;s=Math.max(0,Math.min(1,s));let l=le(this,Nn,Js).call(this,n,s),u=le(this,Pn,js).call(this,n,s);a.style.transform=`translateX(${l})`,a.style.setProperty("--_range-width",`${n.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${n.box.width}px`);let c=Math.round(te(this,Ua))-Math.round(s*i);Math.abs(c)<1&&s>.01&&s<.99||(Qe(this,Ua,s*i),le(this,$a,Un).call(this,te(this,Ua)))};$a=new WeakSet;Un=function(t){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};qs=new WeakSet;Oc=function(){te(this,jt).stop();let t=Pc(this);this.dispatchEvent(new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",Zs);var Wi={PLACEMENT:"placement",BOUNDS:"bounds"},Uc=h.createElement("template");Uc.innerHTML=`
1124
+ `;var Mn=(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))},Nc=(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},qs=class extends Zt{constructor(){super(),ae(this,Hi),ae(this,zs),ae(this,xn),ae(this,Dn),ae(this,On),ae(this,Gs),ae(this,Ba),ae(this,Ys),ae(this,Ui,void 0),ae(this,Xt,void 0),ae(this,Rn,void 0),ae(this,Na,void 0),ae(this,Ln,void 0),ae(this,wn,void 0),ae(this,Pa,void 0),ae(this,Ua,void 0),ae(this,Bi,void 0),ae(this,Ks,a=>{this.dragging||(vi(a)&&(this.range.valueAsNumber=a),this.updateBar())}),this.container.appendChild(Oc.content.cloneNode(!0)),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Ze(this,Rn,this.shadowRoot.querySelectorAll('[part~="box"]')),Ze(this,Ln,this.shadowRoot.querySelector('[part~="preview-box"]')),Ze(this,wn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);Ze(this,Pa,parseInt(i.getPropertyValue("--media-box-padding-left"))),Ze(this,Ua,parseInt(i.getPropertyValue("--media-box-padding-right"))),Ze(this,Xt,new Cn(this.range,j(this,Ks),60))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_PREVIEW_CHAPTER,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING,o.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",f("seek")),oe(this,Hi,Oa).call(this),Ze(this,Ui,this.getRootNode()),(e=j(this,Ui))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),oe(this,Hi,Oa).call(this),(e=j(this,Ui))==null||e.removeEventListener("transitionstart",this),Ze(this,Ui,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_ENDED||e===o.MEDIA_LOADING||e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE?(j(this,Xt).update({start:Mn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),oe(this,Hi,Oa).call(this),nf(this)):e===o.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=j(this,Bi),this.updateBar()))}get mediaChaptersCues(){return j(this,Bi)}set mediaChaptersCues(e){var i;Ze(this,Bi,e),this.updateSegments((i=j(this,Bi))==null?void 0:i.map(a=>({start:Mn(this,a.startTime),end:Mn(this,a.endTime)})))}get mediaPaused(){return k(this,o.MEDIA_PAUSED)}set mediaPaused(e){S(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,o.MEDIA_LOADING)}set mediaLoading(e){S(this,o.MEDIA_LOADING,e)}get mediaDuration(){return x(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return x(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return x(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(o.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(o.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.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 C(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return x(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return k(this,o.MEDIA_ENDED)}set mediaEnded(e){S(this,o.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 n=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([l,u])=>l<=n&&n<=u))!=null?e:[];a=Mn(this,s)}let{style:r}=W(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=W(this.shadowRoot,"#current-rail"),a=W(this.shadowRoot,'[part~="current-box"]'),r=oe(this,xn,Qs).call(this,j(this,wn)),n=oe(this,Dn,Xs).call(this,r,this.range.valueAsNumber),s=oe(this,On,Js).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${n})`,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":oe(this,Ys,Dc).call(this);break;case"pointermove":oe(this,Gs,xc).call(this,e);break;case"pointerup":case"pointerleave":oe(this,Ba,Nn).call(this,null);break;case"transitionstart":le(e.target,this)&&setTimeout(()=>oe(this,Hi,Oa).call(this),0);break}}};Ui=new WeakMap;Xt=new WeakMap;Rn=new WeakMap;Na=new WeakMap;Ln=new WeakMap;wn=new WeakMap;Pa=new WeakMap;Ua=new WeakMap;Bi=new WeakMap;Hi=new WeakSet;Oa=function(){oe(this,zs,Lc).call(this)?j(this,Xt).start():j(this,Xt).stop()};zs=new WeakSet;Lc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Cr(this)};Ks=new WeakMap;xn=new WeakSet;Qs=function(t){var e;let a=((e=this.getAttribute("bounds")?Ue(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),n=t.offsetWidth,s=-(r.left-a.left-n/2),l=a.right-r.left-n/2;return{box:{width:n,min:s,max:l},bounds:a,range:r}};Dn=new WeakSet;Xs=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:n}=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(n)){let l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;i=`min(${i}, ${l})`}return i};On=new WeakSet;Js=function(t,e){let{width:i,min:a,max:r}=t.box,n=e*t.range.width;if(n<a+j(this,Pa)){let s=t.range.left-t.bounds.left-j(this,Pa);return`${n-i/2+s}px`}if(n>r-j(this,Ua)){let s=t.bounds.right-t.range.right-j(this,Ua);return`${n+i/2-s-t.range.width}px`}return 0};Gs=new WeakSet;xc=function(t){let e=[...j(this,Rn)].some(A=>t.composedPath().includes(A));if(!this.dragging&&(e||!t.composedPath().includes(this))){oe(this,Ba,Nn).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=W(this.shadowRoot,"#preview-rail"),r=W(this.shadowRoot,'[part~="preview-box"]'),n=oe(this,xn,Qs).call(this,j(this,Ln)),s=(t.clientX-n.range.left)/n.range.width;s=Math.max(0,Math.min(1,s));let l=oe(this,Dn,Xs).call(this,n,s),u=oe(this,On,Js).call(this,n,s);a.style.transform=`translateX(${l})`,a.style.setProperty("--_range-width",`${n.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${n.box.width}px`);let c=Math.round(j(this,Na))-Math.round(s*i);Math.abs(c)<1&&s>.01&&s<.99||(Ze(this,Na,s*i),oe(this,Ba,Nn).call(this,j(this,Na)))};Ba=new WeakSet;Nn=function(t){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Ys=new WeakSet;Dc=function(){j(this,Xt).stop();let t=Nc(this);this.dispatchEvent(new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",qs);var $i={PLACEMENT:"placement",BOUNDS:"bounds"},Pc=h.createElement("template");Pc.innerHTML=`
1121
1125
  <style>
1122
1126
  :host {
1123
1127
  --_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
@@ -1227,8 +1231,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
1227
1231
  </style>
1228
1232
  <slot></slot>
1229
1233
  <div id="arrow"></div>
1230
- `;var el=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Rr(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=He(this,"#"+this.bounds))!=null?e:z(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,_=n+s,g=a.getPropertyValue("--media-tooltip-offset-x"),f=g?parseFloat(g.replace("px","")):0,v=a.getPropertyValue("--media-tooltip-container-margin"),P=v?parseFloat(v.replace("px","")):0,A=l-n+f-P,M=c-_+f+P;if(A<0){this.style.setProperty("--media-tooltip-offset-x",`${A}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({mode:"open"}),this.shadowRoot.appendChild(Uc.content.cloneNode(!0))),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[Wi.PLACEMENT,Wi.BOUNDS]}get placement(){return I(this,Wi.PLACEMENT)}set placement(e){C(this,Wi.PLACEMENT,e)}get bounds(){return I(this,Wi.BOUNDS)}set bounds(e){C(this,Wi.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",el);var of=1,sf=t=>t.mediaMuted?0:t.mediaVolume,lf=t=>`${Math.round(t*100)}%`,tl=class extends Qt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",Y.VOLUME())}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=sf(this),this.range.setAttribute("aria-valuetext",lf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return w(this,o.MEDIA_VOLUME,of)}set mediaVolume(e){O(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return y(this,o.MEDIA_MUTED)}set mediaMuted(e){k(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return I(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){C(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",tl);var E=bh(require("@mux/mux-video")),L=require("@mux/playback-core");var qc=require("@mux/mux-video");var Kc=require("@mux/playback-core");var ii=require("@mux/playback-core");function Bc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Bn(i)}: ${a}; `)}),e?e.trim():void 0}function Bn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Hn(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 il(t){let e=df(t).toString();return e?"?"+e:""}function df(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var al=(t,e)=>!t||!e?!1:t.contains(e)?!0:al(t,e.getRootNode().host);var Hc="mux.com",uf=()=>{try{return"3.3.0"}catch{}return"UNKNOWN"},cf=uf(),Wn=()=>cf,$c=(t,{token:e,customDomain:i=Hc,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ii.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${il({token:e,time:n,program_time:r})}`},Wc=(t,{token:e,customDomain:i=Hc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ii.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${i}/${t}/storyboard.vtt${il({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Wa=t=>{if(t){if([ii.StreamTypes.LIVE,ii.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return ii.StreamTypes.LIVE}};var mf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Fc(t){var e;return(e=mf[t])!=null?e:Hn(t)}var ei,ti,me,$n=class{constructor(e,i){pe(this,ei);pe(this,ti);pe(this,me,[]);ye(this,ei,e),ye(this,ti,i)}[Symbol.iterator](){return B(this,me).values()}get length(){return B(this,me).length}get value(){var e;return(e=B(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 B(this,me)[e]}values(){return B(this,me).values()}keys(){return B(this,me).keys()}forEach(e){B(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||B(this,me).push(r)}),!(this.value===""&&!((i=B(this,ei))!=null&&i.hasAttribute(`${B(this,ti)}`)))&&((a=B(this,ei))==null||a.setAttribute(`${B(this,ti)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{B(this,me).splice(B(this,me).indexOf(a),1)}),(i=B(this,ei))==null||i.setAttribute(`${B(this,ti)}`,`${this.value}`)}contains(e){return B(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)}};ei=new WeakMap,ti=new WeakMap,me=new WeakMap;var Vc=`[mux-player ${Wn()}]`;function Xe(...t){console.warn(Vc,...t)}function be(...t){console.error(Vc,...t)}function rl(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,Kc.i18n)("Read more: ")}
1231
- https://github.com/muxinc/elements/blob/main/errors/${t.file}`),Xe(e)}var de={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ai={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Gc=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}}),hf=qc.VideoEvents.filter(t=>t!=="error"),pf=Object.values(de).filter(t=>![de.PLAYSINLINE].includes(t)),ff=Object.values(ai),nl=class extends fe.HTMLElement{static get observedAttributes(){return[...pf,...ff]}constructor(){super()}init(){hf.forEach(e=>{var i;(i=this.media)==null||i.addEventListener(e,a=>{this.dispatchEvent(new Event(a.type))})})}attributeChangedCallback(e,i,a){var r,n;switch(e){case ai.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ai.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ai.PLAYBACKRATE:{let s=(n=ce(a))!=null?n: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()}requestCast(e){var i;return(i=this.media)==null?void 0:i.requestCast(e)}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:Gc}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Gc}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(ai.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ai.PLAYBACKRATE,`${e}`):this.removeAttribute(ai.PLAYBACKRATE)}get crossOrigin(){return Fa(this,de.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(de.CROSSORIGIN,`${e}`)}get autoplay(){return Fa(this,de.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(de.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(de.AUTOPLAY)}get loop(){return Fa(this,de.LOOP)!=null}set loop(e){e?this.setAttribute(de.LOOP,""):this.removeAttribute(de.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 Fa(this,de.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(de.MUTED,""):this.removeAttribute(de.MUTED)}get playsInline(){return Fa(this,de.PLAYSINLINE)!=null}set playsInline(e){be("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(de.PRELOAD,e):this.removeAttribute(de.PRELOAD)}};function Fa(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var ol=nl;var Jc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},x=(t,e,i)=>(Jc(t,e,"read from private field"),i?i.call(t):e.get(t)),Je=(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)},pt=(t,e,i,a)=>(Jc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Fi,Fn,ri,Ka,Mt,Rt,Lt,ni,Ki,Kn,Pe,Zc=1,zc=0,vf=1,Ef={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let n=i[a];typeof n=="boolean"&&r instanceof he&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof he?r.element[r.attributeName]=n:r.value=n}}}},ft=class extends d.DocumentFragment{constructor(e,i,a=Ef){var r;super(),Je(this,Fi,void 0),Je(this,Fn,void 0),this.append(e.content.cloneNode(!0)),pt(this,Fi,jc(this)),pt(this,Fn,a),(r=a.createCallback)==null||r.call(a,this,x(this,Fi),i),a.processCallback(this,x(this,Fi),i)}update(e){x(this,Fn).processCallback(this,x(this,Fi),e)}};Fi=new WeakMap;Fn=new WeakMap;var jc=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let n=new sl;for([i,a]of Xc(r.value))if(!i)n.append(a);else{let s=new he(t,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of t.childNodes)if(r.nodeType===Zc&&!(r instanceof HTMLTemplateElement))jc(r,e);else{let n=r.data;if(r.nodeType===Zc||n.includes("{{")){let s=[];if(n)for([i,a]of Xc(n))if(!i)s.push(new Text(a));else{let l=new vt(t);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new Va(t,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},Qc={},Xc=t=>{let e="",i=0,a=Qc[t],r=0,n;if(a)return a;for(a=[];n=t[r];r++)n==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([zc,e]),e="",r++):n==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([vf,e.trim()]),e="",r++):e+=n||"";return e&&a.push([zc,(i>0?"{{":"")+e]),Qc[t]=a},bf=11,Vn=class{get value(){return""}set value(e){}toString(){return this.value}},em=new WeakMap,sl=class{constructor(){Je(this,ri,[])}[Symbol.iterator](){return x(this,ri).values()}get length(){return x(this,ri).length}item(e){return x(this,ri)[e]}append(...e){for(let i of e)i instanceof he&&em.set(i,this),x(this,ri).push(i)}toString(){return x(this,ri).join("")}};ri=new WeakMap;var he=class extends Vn{constructor(e,i,a){super(),Je(this,ni),Je(this,Ka,""),Je(this,Mt,void 0),Je(this,Rt,void 0),Je(this,Lt,void 0),pt(this,Mt,e),pt(this,Rt,i),pt(this,Lt,a)}get attributeName(){return x(this,Rt)}get attributeNamespace(){return x(this,Lt)}get element(){return x(this,Mt)}get value(){return x(this,Ka)}set value(e){x(this,Ka)!==e&&(pt(this,Ka,e),!x(this,ni,Ki)||x(this,ni,Ki).length===1?e==null?x(this,Mt).removeAttributeNS(x(this,Lt),x(this,Rt)):x(this,Mt).setAttributeNS(x(this,Lt),x(this,Rt),e):x(this,Mt).setAttributeNS(x(this,Lt),x(this,Rt),x(this,ni,Ki).toString()))}get booleanValue(){return x(this,Mt).hasAttributeNS(x(this,Lt),x(this,Rt))}set booleanValue(e){if(!x(this,ni,Ki)||x(this,ni,Ki).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Ka=new WeakMap;Mt=new WeakMap;Rt=new WeakMap;Lt=new WeakMap;ni=new WeakSet;Ki=function(){return em.get(this)};var vt=class extends Vn{constructor(e,i){super(),Je(this,Kn,void 0),Je(this,Pe,void 0),pt(this,Kn,e),pt(this,Pe,i?[...i]:[new Text])}get replacementNodes(){return x(this,Pe)}get parentNode(){return x(this,Kn)}get nextSibling(){return x(this,Pe)[x(this,Pe).length-1].nextSibling}get previousSibling(){return x(this,Pe)[0].previousSibling}get value(){return x(this,Pe).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===bf?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),pt(this,Pe,gf(x(this,Pe)[0].parentNode,x(this,Pe),i,this.nextSibling))}};Kn=new WeakMap;Pe=new WeakMap;var Va=class extends vt{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 gf(t,e,i,a=null){let r=0,n,s,l,u=i.length,c=e.length;for(;r<u&&r<c&&e[r]==i[r];)r++;for(;r<u&&r<c&&i[u-1]==e[c-1];)a=i[--c,--u];if(r==c)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<c;)t.removeChild(e[r++]);else{for(n=e[r];r<u;)l=i[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&i[r]==s?(t.replaceChild(l,n),n=s):t.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,t.removeChild(n),n=s}return i}var tm={string:t=>String(t)},Gn=class{constructor(e){this.template=e,this.state=void 0}},oi=new WeakMap,si=new WeakMap,ll={partial:(t,e)=>{e[t.expression]=new Gn(t.template)},if:(t,e)=>{var i;if(am(t.expression,e))if(oi.get(t)!==t.template){oi.set(t,t.template);let a=new ft(t.template,e,qn);t.replace(a),si.set(t,a)}else(i=si.get(t))==null||i.update(e);else t.replace(""),oi.delete(t),si.delete(t)}},_f=Object.keys(ll),qn={processCallback(t,e,i){var a,r;if(i)for(let[n,s]of e){if(s instanceof Va){if(!s.directive){let u=_f.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=ll[s.directive])==null||a.call(ll,s,i);continue}let l=am(n,i);if(l instanceof Gn){oi.get(s)!==l.template?(oi.set(s,l.template),l=new ft(l.template,l.state,qn),s.value=l,si.set(s,l)):(r=si.get(s))==null||r.update(l.state);continue}l?(s instanceof he&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof he?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,oi.delete(s),si.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,oi.delete(s),si.delete(s))}}},im={"!":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=tm[e])==null?void 0:i.call(tm,t)}};function Af(t){return Tf(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function am(t,e={}){var i,a,r,n,s,l,u;let c=Af(t);if(c.length===0||c.some(({type:_})=>!_))return Ya(t);if(((i=c[0])==null?void 0:i.token)===">"){let _=e[(a=c[1])==null?void 0:a.token];if(!_)return Ya(t);let g={...e};_.state=g;let f=c.slice(2);for(let v=0;v<f.length;v+=3){let P=(r=f[v])==null?void 0:r.token,A=(n=f[v+1])==null?void 0:n.token,M=(s=f[v+2])==null?void 0:s.token;P&&A==="="&&(g[P]=Ga(M,e))}return _}if(c.length===1)return Yn(c[0])?Ga(c[0].token,e):Ya(t);if(c.length===2){let _=(l=c[0])==null?void 0:l.token,g=im[_];if(!g||!Yn(c[1]))return Ya(t);let f=Ga(c[1].token,e);return g(f)}if(c.length===3){let _=(u=c[1])==null?void 0:u.token,g=im[_];if(!g||!Yn(c[0])||!Yn(c[2]))return Ya(t);let f=Ga(c[0].token,e);if(_==="|")return g(f,c[2].token);let v=Ga(c[2].token,e);return g(f,v)}}function Ya(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Yn({type:t}){return["number","boolean","string","param"].includes(t)}function Ga(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):Ar(t)?parseFloat(t):e[t]}function Tf(t,e){let i,a,r,n=[];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&&n.push({token:t.substr(0,i),type:void 0}),r&&n.push(r),t=t.substr(i+(r?r.token.length:0))}return n}var pl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},cl=(t,e,i)=>(pl(t,e,"read from private field"),i?i.call(t):e.get(t)),qa=(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)},li=(t,e,i,a)=>(pl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),dl=(t,e,i)=>(pl(t,e,"access private method"),i),Vi,Zn,Yi,ml,rm,zn,hl,ul={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},nm=h.createElement("template");nm.innerHTML=`
1234
+ `;var js=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Cr(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=Ue(this,"#"+this.bounds))!=null?e:q(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,A=n+s,_=a.getPropertyValue("--media-tooltip-offset-x"),v=_?parseFloat(_.replace("px","")):0,E=a.getPropertyValue("--media-tooltip-container-margin"),P=E?parseFloat(E.replace("px","")):0,y=l-n+v-P,w=c-A+v+P;if(y<0){this.style.setProperty("--media-tooltip-offset-x",`${y}px`);return}if(w>0){this.style.setProperty("--media-tooltip-offset-x",`${w}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Pc.content.cloneNode(!0))),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[$i.PLACEMENT,$i.BOUNDS]}get placement(){return C(this,$i.PLACEMENT)}set placement(e){M(this,$i.PLACEMENT,e)}get bounds(){return C(this,$i.BOUNDS)}set bounds(e){M(this,$i.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",js);var of=1,sf=t=>t.mediaMuted?0:t.mediaVolume,lf=t=>`${Math.round(t*100)}%`,el=class extends Zt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",f("volume"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=sf(this),this.range.setAttribute("aria-valuetext",lf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return x(this,o.MEDIA_VOLUME,of)}set mediaVolume(e){O(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return k(this,o.MEDIA_MUTED)}set mediaMuted(e){S(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return C(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",el);var b=Eh(require("@mux/mux-video")),L=require("@mux/playback-core");var Yc=require("@mux/mux-video");var Fc=require("@mux/playback-core");var ei=require("@mux/playback-core");function Uc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Pn(i)}: ${a}; `)}),e?e.trim():void 0}function Pn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Un(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function de(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function tl(t){let e=df(t).toString();return e?"?"+e:""}function df(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var il=(t,e)=>!t||!e?!1:t.contains(e)?!0:il(t,e.getRootNode().host);var Bc="mux.com",uf=()=>{try{return"3.3.1"}catch{}return"UNKNOWN"},cf=uf(),Hn=()=>cf,Hc=(t,{token:e,customDomain:i=Bc,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ei.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${tl({token:e,time:n,program_time:r})}`},$c=(t,{token:e,customDomain:i=Bc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ei.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${i}/${t}/storyboard.vtt${tl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ha=t=>{if(t){if([ei.StreamTypes.LIVE,ei.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return ei.StreamTypes.LIVE}};var mf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Wc(t){var e;return(e=mf[t])!=null?e:Un(t)}var Jt,jt,ue,Bn=class{constructor(e,i){me(this,Jt);me(this,jt);me(this,ue,[]);Ae(this,Jt,e),Ae(this,jt,i)}[Symbol.iterator](){return B(this,ue).values()}get length(){return B(this,ue).length}get value(){var e;return(e=B(this,ue).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Ae(this,ue,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return B(this,ue)[e]}values(){return B(this,ue).values()}keys(){return B(this,ue).keys()}forEach(e){B(this,ue).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||B(this,ue).push(r)}),!(this.value===""&&!((i=B(this,Jt))!=null&&i.hasAttribute(`${B(this,jt)}`)))&&((a=B(this,Jt))==null||a.setAttribute(`${B(this,jt)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{B(this,ue).splice(B(this,ue).indexOf(a),1)}),(i=B(this,Jt))==null||i.setAttribute(`${B(this,jt)}`,`${this.value}`)}contains(e){return B(this,ue).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)}};Jt=new WeakMap,jt=new WeakMap,ue=new WeakMap;var Vc=`[mux-player ${Hn()}]`;function ze(...t){console.warn(Vc,...t)}function ve(...t){console.error(Vc,...t)}function al(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,Fc.i18n)("Read more: ")}
1235
+ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),ze(e)}var se={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ti={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Gc=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}}),hf=Yc.VideoEvents.filter(t=>t!=="error"),pf=Object.values(se).filter(t=>![se.PLAYSINLINE].includes(t)),ff=Object.values(ti),rl=class extends he.HTMLElement{static get observedAttributes(){return[...pf,...ff]}constructor(){super()}init(){hf.forEach(e=>{var i;(i=this.media)==null||i.addEventListener(e,a=>{this.dispatchEvent(new Event(a.type))})})}attributeChangedCallback(e,i,a){var r,n;switch(e){case ti.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ti.VOLUME:{let s=(r=de(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ti.PLAYBACKRATE:{let s=(n=de(a))!=null?n: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()}requestCast(e){var i;return(i=this.media)==null?void 0:i.requestCast(e)}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:Gc}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Gc}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=de(this.getAttribute(ti.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ti.PLAYBACKRATE,`${e}`):this.removeAttribute(ti.PLAYBACKRATE)}get crossOrigin(){return $a(this,se.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(se.CROSSORIGIN,`${e}`)}get autoplay(){return $a(this,se.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(se.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(se.AUTOPLAY)}get loop(){return $a(this,se.LOOP)!=null}set loop(e){e?this.setAttribute(se.LOOP,""):this.removeAttribute(se.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 $a(this,se.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(se.MUTED,""):this.removeAttribute(se.MUTED)}get playsInline(){return $a(this,se.PLAYSINLINE)!=null}set playsInline(e){ve("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(se.PRELOAD,e):this.removeAttribute(se.PRELOAD)}};function $a(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var nl=rl;var Xc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},D=(t,e,i)=>(Xc(t,e,"read from private field"),i?i.call(t):e.get(t)),Qe=(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)},mt=(t,e,i,a)=>(Xc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Wi,$n,ii,Wa,It,Ct,Mt,ai,Fi,Wn,Oe,qc=1,Zc=0,vf=1,Ef={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let n=i[a];typeof n=="boolean"&&r instanceof ce&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof ce?r.element[r.attributeName]=n:r.value=n}}}},ht=class extends d.DocumentFragment{constructor(e,i,a=Ef){var r;super(),Qe(this,Wi,void 0),Qe(this,$n,void 0),this.append(e.content.cloneNode(!0)),mt(this,Wi,Jc(this)),mt(this,$n,a),(r=a.createCallback)==null||r.call(a,this,D(this,Wi),i),a.processCallback(this,D(this,Wi),i)}update(e){D(this,$n).processCallback(this,D(this,Wi),e)}};Wi=new WeakMap;$n=new WeakMap;var Jc=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let n=new ol;for([i,a]of Qc(r.value))if(!i)n.append(a);else{let s=new ce(t,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of t.childNodes)if(r.nodeType===qc&&!(r instanceof HTMLTemplateElement))Jc(r,e);else{let n=r.data;if(r.nodeType===qc||n.includes("{{")){let s=[];if(n)for([i,a]of Qc(n))if(!i)s.push(new Text(a));else{let l=new pt(t);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new Fa(t,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},zc={},Qc=t=>{let e="",i=0,a=zc[t],r=0,n;if(a)return a;for(a=[];n=t[r];r++)n==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([Zc,e]),e="",r++):n==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([vf,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Zc,(i>0?"{{":"")+e]),zc[t]=a},bf=11,Fn=class{get value(){return""}set value(e){}toString(){return this.value}},jc=new WeakMap,ol=class{constructor(){Qe(this,ii,[])}[Symbol.iterator](){return D(this,ii).values()}get length(){return D(this,ii).length}item(e){return D(this,ii)[e]}append(...e){for(let i of e)i instanceof ce&&jc.set(i,this),D(this,ii).push(i)}toString(){return D(this,ii).join("")}};ii=new WeakMap;var ce=class extends Fn{constructor(e,i,a){super(),Qe(this,ai),Qe(this,Wa,""),Qe(this,It,void 0),Qe(this,Ct,void 0),Qe(this,Mt,void 0),mt(this,It,e),mt(this,Ct,i),mt(this,Mt,a)}get attributeName(){return D(this,Ct)}get attributeNamespace(){return D(this,Mt)}get element(){return D(this,It)}get value(){return D(this,Wa)}set value(e){D(this,Wa)!==e&&(mt(this,Wa,e),!D(this,ai,Fi)||D(this,ai,Fi).length===1?e==null?D(this,It).removeAttributeNS(D(this,Mt),D(this,Ct)):D(this,It).setAttributeNS(D(this,Mt),D(this,Ct),e):D(this,It).setAttributeNS(D(this,Mt),D(this,Ct),D(this,ai,Fi).toString()))}get booleanValue(){return D(this,It).hasAttributeNS(D(this,Mt),D(this,Ct))}set booleanValue(e){if(!D(this,ai,Fi)||D(this,ai,Fi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Wa=new WeakMap;It=new WeakMap;Ct=new WeakMap;Mt=new WeakMap;ai=new WeakSet;Fi=function(){return jc.get(this)};var pt=class extends Fn{constructor(e,i){super(),Qe(this,Wn,void 0),Qe(this,Oe,void 0),mt(this,Wn,e),mt(this,Oe,i?[...i]:[new Text])}get replacementNodes(){return D(this,Oe)}get parentNode(){return D(this,Wn)}get nextSibling(){return D(this,Oe)[D(this,Oe).length-1].nextSibling}get previousSibling(){return D(this,Oe)[0].previousSibling}get value(){return D(this,Oe).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===bf?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),mt(this,Oe,gf(D(this,Oe)[0].parentNode,D(this,Oe),i,this.nextSibling))}};Wn=new WeakMap;Oe=new WeakMap;var Fa=class extends pt{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 gf(t,e,i,a=null){let r=0,n,s,l,u=i.length,c=e.length;for(;r<u&&r<c&&e[r]==i[r];)r++;for(;r<u&&r<c&&i[u-1]==e[c-1];)a=i[--c,--u];if(r==c)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<c;)t.removeChild(e[r++]);else{for(n=e[r];r<u;)l=i[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&i[r]==s?(t.replaceChild(l,n),n=s):t.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,t.removeChild(n),n=s}return i}var em={string:t=>String(t)},Kn=class{constructor(e){this.template=e,this.state=void 0}},ri=new WeakMap,ni=new WeakMap,sl={partial:(t,e)=>{e[t.expression]=new Kn(t.template)},if:(t,e)=>{var i;if(im(t.expression,e))if(ri.get(t)!==t.template){ri.set(t,t.template);let a=new ht(t.template,e,Gn);t.replace(a),ni.set(t,a)}else(i=ni.get(t))==null||i.update(e);else t.replace(""),ri.delete(t),ni.delete(t)}},_f=Object.keys(sl),Gn={processCallback(t,e,i){var a,r;if(i)for(let[n,s]of e){if(s instanceof Fa){if(!s.directive){let u=_f.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=sl[s.directive])==null||a.call(sl,s,i);continue}let l=im(n,i);if(l instanceof Kn){ri.get(s)!==l.template?(ri.set(s,l.template),l=new ht(l.template,l.state,Gn),s.value=l,ni.set(s,l)):(r=ni.get(s))==null||r.update(l.state);continue}l?(s instanceof ce&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof ce?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,ri.delete(s),ni.delete(s))):s instanceof ce?s.value=void 0:(s.value=void 0,ri.delete(s),ni.delete(s))}}},tm={"!":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=em[e])==null?void 0:i.call(em,t)}};function Af(t){return yf(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function im(t,e={}){var i,a,r,n,s,l,u;let c=Af(t);if(c.length===0||c.some(({type:A})=>!A))return Va(t);if(((i=c[0])==null?void 0:i.token)===">"){let A=e[(a=c[1])==null?void 0:a.token];if(!A)return Va(t);let _={...e};A.state=_;let v=c.slice(2);for(let E=0;E<v.length;E+=3){let P=(r=v[E])==null?void 0:r.token,y=(n=v[E+1])==null?void 0:n.token,w=(s=v[E+2])==null?void 0:s.token;P&&y==="="&&(_[P]=Ka(w,e))}return A}if(c.length===1)return Vn(c[0])?Ka(c[0].token,e):Va(t);if(c.length===2){let A=(l=c[0])==null?void 0:l.token,_=tm[A];if(!_||!Vn(c[1]))return Va(t);let v=Ka(c[1].token,e);return _(v)}if(c.length===3){let A=(u=c[1])==null?void 0:u.token,_=tm[A];if(!_||!Vn(c[0])||!Vn(c[2]))return Va(t);let v=Ka(c[0].token,e);if(A==="|")return _(v,c[2].token);let E=Ka(c[2].token,e);return _(v,E)}}function Va(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Vn({type:t}){return["number","boolean","string","param"].includes(t)}function Ka(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):gr(t)?parseFloat(t):e[t]}function yf(t,e){let i,a,r,n=[];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&&n.push({token:t.substr(0,i),type:void 0}),r&&n.push(r),t=t.substr(i+(r?r.token.length:0))}return n}var hl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ul=(t,e,i)=>(hl(t,e,"read from private field"),i?i.call(t):e.get(t)),Ga=(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)},oi=(t,e,i,a)=>(hl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ll=(t,e,i)=>(hl(t,e,"access private method"),i),Vi,Yn,Ki,cl,am,qn,ml,dl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},rm=h.createElement("template");rm.innerHTML=`
1232
1236
  <style>
1233
1237
  :host {
1234
1238
  display: inline-block;
@@ -1255,7 +1259,7 @@ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),Xe(e)}var de={AU
1255
1259
  display: none;
1256
1260
  }
1257
1261
  </style>
1258
- `;var di=class extends d.HTMLElement{constructor(){super(),qa(this,ml),qa(this,zn),qa(this,Vi,void 0),qa(this,Zn,void 0),qa(this,Yi,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 n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(ul[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(st.BREAKPOINTS_COMPUTED,this.render),dl(this,ml,rm).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=cl(this,Vi))!=null?e:this.constructor.template}set template(e){li(this,Yi,null),li(this,Vi,e),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})=>ul[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let l=(a=ul[s.name])!=null?a:Wd(s.name),{value:u}=s;u!=null?(Ar(u)&&(u=parseFloat(u)),n[l]=u===""?!0:u):n[l]=!1}return n}attributeChangedCallback(e,i,a){e==="template"&&i!=a&&dl(this,zn,hl).call(this)}connectedCallback(){dl(this,zn,hl).call(this)}createRenderer(){this.template&&this.template!==cl(this,Zn)&&(li(this,Zn,this.template),this.renderer=new ft(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(nm.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Vi=new WeakMap;Zn=new WeakMap;Yi=new WeakMap;ml=new WeakSet;rm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}};zn=new WeakSet;hl=function(){var t;let e=this.getAttribute("template");if(!e||e===cl(this,Yi))return;let i=this.getRootNode(),a=(t=i==null?void 0:i.getElementById)==null?void 0:t.call(i,e);if(a){li(this,Yi,e),li(this,Vi,a),this.createRenderer();return}yf(e)&&(li(this,Yi,e),kf(e).then(r=>{let n=h.createElement("template");n.innerHTML=r,li(this,Vi,n),this.createRenderer()}).catch(console.error))};di.observedAttributes=["template"];di.processor=qn;function yf(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 kf(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()}d.customElements.get("media-theme")||d.customElements.define("media-theme",di);var om=`:host {
1262
+ `;var si=class extends d.HTMLElement{constructor(){super(),Ga(this,cl),Ga(this,qn),Ga(this,Vi,void 0),Ga(this,Yn,void 0),Ga(this,Ki,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 n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(dl[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(nt.BREAKPOINTS_COMPUTED,this.render),ll(this,cl,am).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=ul(this,Vi))!=null?e:this.constructor.template}set template(e){oi(this,Ki,null),oi(this,Vi,e),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})=>dl[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let l=(a=dl[s.name])!=null?a:$d(s.name),{value:u}=s;u!=null?(gr(u)&&(u=parseFloat(u)),n[l]=u===""?!0:u):n[l]=!1}return n}attributeChangedCallback(e,i,a){e==="template"&&i!=a&&ll(this,qn,ml).call(this)}connectedCallback(){ll(this,qn,ml).call(this)}createRenderer(){this.template&&this.template!==ul(this,Yn)&&(oi(this,Yn,this.template),this.renderer=new ht(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(rm.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Vi=new WeakMap;Yn=new WeakMap;Ki=new WeakMap;cl=new WeakSet;am=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}};qn=new WeakSet;ml=function(){var t;let e=this.getAttribute("template");if(!e||e===ul(this,Ki))return;let i=this.getRootNode(),a=(t=i==null?void 0:i.getElementById)==null?void 0:t.call(i,e);if(a){oi(this,Ki,e),oi(this,Vi,a),this.createRenderer();return}Tf(e)&&(oi(this,Ki,e),kf(e).then(r=>{let n=h.createElement("template");n.innerHTML=r,oi(this,Vi,n),this.createRenderer()}).catch(console.error))};si.observedAttributes=["template"];si.processor=Gn;function Tf(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 kf(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()}d.customElements.get("media-theme")||d.customElements.define("media-theme",si);var nm=`:host {
1259
1263
  --media-control-display: var(--controls);
1260
1264
  --media-loading-indicator-display: var(--loading-indicator);
1261
1265
  --media-dialog-display: var(--dialog);
@@ -1405,65 +1409,65 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1405
1409
  :host([no-tooltips]) {
1406
1410
  --media-tooltip-display: none;
1407
1411
  }
1408
- `;var Za=new WeakMap,vl=class t{constructor(e,i){this.element=e;this.type=i;this.element.addEventListener(this.type,this);let a=Za.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=Za.get(this.element);i&&i.delete(this.type)}}static for(e){Za.has(e.element)||Za.set(e.element,new Map);let i=e.attributeName.slice(2),a=Za.get(e.element);return a&&a.has(i)?a.get(i):new t(e.element,i)}};function If(t,e){return t instanceof he&&t.attributeName.startsWith("on")?(vl.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function Cf(t,e){return e instanceof Qn&&t instanceof vt?(e.renderInto(t),!0):!1}function Mf(t,e){return e instanceof DocumentFragment&&t instanceof vt?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function Rf(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 Lf(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 wf(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 xf(t,e){return e===!1&&t instanceof vt?(t.replace(""),!0):!1}function Df(t,e){Lf(t,e)||wf(t,e)||If(t,e)||xf(t,e)||Cf(t,e)||Mf(t,e)||Rf(t,e)}var fl=new Map,sm=new WeakMap,lm=new WeakMap,Qn=class{constructor(e,i,a){this.strings=e;this.values=i;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(fl.has(this.stringsKey))return fl.get(this.stringsKey);{let e=Ei.createElement("template"),i=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<i?`{{ ${n} }}`:""),""),fl.set(this.stringsKey,e),e}}renderInto(e){var r;let i=this.template;if(sm.get(e)!==i){sm.set(e,i);let n=new ft(i,this.values,this.processor);lm.set(e,n),e instanceof vt?e.replace(...n.children):e.appendChild(n);return}let a=lm.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Of={processCallback(t,e,i){var a;if(i){for(let[r,n]of e)if(r in i){let s=(a=i[r])!=null?a:"";Df(n,s)}}}};function za(t,...e){return new Qn(t,e,Of)}function dm(t,e){t.renderInto(e)}var Qa=require("@mux/playback-core"),Nf=t=>{let{tokens:e}=t;return e.drm?":host { --_cast-button-drm-display: none; }":""},um=t=>za`
1412
+ `;var Ya=new WeakMap,fl=class t{constructor(e,i){this.element=e;this.type=i;this.element.addEventListener(this.type,this);let a=Ya.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=Ya.get(this.element);i&&i.delete(this.type)}}static for(e){Ya.has(e.element)||Ya.set(e.element,new Map);let i=e.attributeName.slice(2),a=Ya.get(e.element);return a&&a.has(i)?a.get(i):new t(e.element,i)}};function If(t,e){return t instanceof ce&&t.attributeName.startsWith("on")?(fl.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function Cf(t,e){return e instanceof Zn&&t instanceof pt?(e.renderInto(t),!0):!1}function Mf(t,e){return e instanceof DocumentFragment&&t instanceof pt?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function wf(t,e){if(t instanceof ce){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 Rf(t,e){if(t instanceof ce&&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 Lf(t,e){if(typeof e=="boolean"&&t instanceof ce){let i=t.attributeNamespace,a=t.element.hasAttributeNS(i,t.attributeName);return e!==a&&(t.booleanValue=e),!0}return!1}function xf(t,e){return e===!1&&t instanceof pt?(t.replace(""),!0):!1}function Df(t,e){Rf(t,e)||Lf(t,e)||If(t,e)||xf(t,e)||Cf(t,e)||Mf(t,e)||wf(t,e)}var pl=new Map,om=new WeakMap,sm=new WeakMap,Zn=class{constructor(e,i,a){this.strings=e;this.values=i;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(pl.has(this.stringsKey))return pl.get(this.stringsKey);{let e=fi.createElement("template"),i=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<i?`{{ ${n} }}`:""),""),pl.set(this.stringsKey,e),e}}renderInto(e){var r;let i=this.template;if(om.get(e)!==i){om.set(e,i);let n=new ht(i,this.values,this.processor);sm.set(e,n),e instanceof pt?e.replace(...n.children):e.appendChild(n);return}let a=sm.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Of={processCallback(t,e,i){var a;if(i){for(let[r,n]of e)if(r in i){let s=(a=i[r])!=null?a:"";Df(n,s)}}}};function qa(t,...e){return new Zn(t,e,Of)}function lm(t,e){t.renderInto(e)}var Za=require("@mux/playback-core"),Nf=t=>{let{tokens:e}=t;return e.drm?":host { --_cast-button-drm-display: none; }":""},dm=t=>qa`
1409
1413
  <style>
1410
1414
  ${Nf(t)}
1411
- ${om}
1415
+ ${nm}
1412
1416
  </style>
1413
1417
  ${Hf(t)}
1414
- `,Pf=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Wa(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Uf={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",DISPLAY:"display",CONTROL_BAR:"control-bar",MENU_BUTTON:"menu-button",MENU:"menu",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"},Bf=Object.values(Uf).join(", "),Hf=t=>{var e,i,a,r,n,s,l,u,c,_,g,f,v,P,A,M,U,ee,_e,gt,nt,ta,ia,aa,ra,na,oa,sa,la,da,ua,ca,gr,ot;return za`
1418
+ `,Pf=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Ha(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Uf={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",DISPLAY:"display",CONTROL_BAR:"control-bar",MENU_BUTTON:"menu-button",MENU:"menu",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"},Bf=Object.values(Uf).join(", "),Hf=t=>{var e,i,a,r,n,s,l,u,c,A,_,v,E,P,y,w,U,J,be,Et,at,ea,ta,ia,aa,ra,na,oa,sa,la,da,ua,Er,rt;return qa`
1415
1419
  <media-theme
1416
1420
  template="${t.themeTemplate||!1}"
1417
1421
  defaultstreamtype="${(e=t.defaultStreamType)!=null?e:!1}"
1418
1422
  hotkeys="${Pf(t)||!1}"
1419
1423
  nohotkeys="${t.noHotKeys||!t.hasSrc||!1}"
1420
- noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(Qa.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
1424
+ noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(Za.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
1421
1425
  novolumepref="${t.novolumepref||!1}"
1422
1426
  disabled="${!t.hasSrc||t.isDialogOpen}"
1423
1427
  audio="${(a=t.audio)!=null?a:!1}"
1424
- style="${(r=Bc({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor,"--media-accent-color":t.accentColor}))!=null?r:!1}"
1428
+ style="${(r=Uc({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor,"--media-accent-color":t.accentColor}))!=null?r:!1}"
1425
1429
  defaultsubtitles="${!t.defaultHiddenCaptions}"
1426
1430
  forwardseekoffset="${(n=t.forwardSeekOffset)!=null?n:!1}"
1427
1431
  backwardseekoffset="${(s=t.backwardSeekOffset)!=null?s:!1}"
1428
1432
  playbackrates="${(l=t.playbackRates)!=null?l:!1}"
1429
1433
  defaultshowremainingtime="${(u=t.defaultShowRemainingTime)!=null?u:!1}"
1430
1434
  defaultduration="${(c=t.defaultDuration)!=null?c:!1}"
1431
- hideduration="${(_=t.hideDuration)!=null?_:!1}"
1432
- title="${(g=t.title)!=null?g:!1}"
1433
- proudlydisplaymuxbadge="${(f=t.proudlyDisplayMuxBadge)!=null?f:!1}"
1435
+ hideduration="${(A=t.hideDuration)!=null?A:!1}"
1436
+ title="${(_=t.title)!=null?_:!1}"
1437
+ proudlydisplaymuxbadge="${(v=t.proudlyDisplayMuxBadge)!=null?v:!1}"
1434
1438
  exportparts="${Bf}"
1435
1439
  onclose="${t.onCloseErrorDialog}"
1436
1440
  onfocusin="${t.onFocusInErrorDialog}"
1437
1441
  >
1438
1442
  <mux-video
1439
1443
  slot="media"
1440
- target-live-window="${(v=t.targetLiveWindow)!=null?v:!1}"
1441
- stream-type="${(P=Wa(t.streamType))!=null?P:!1}"
1442
- crossorigin="${(A=t.crossOrigin)!=null?A:""}"
1444
+ target-live-window="${(E=t.targetLiveWindow)!=null?E:!1}"
1445
+ stream-type="${(P=Ha(t.streamType))!=null?P:!1}"
1446
+ crossorigin="${(y=t.crossOrigin)!=null?y:""}"
1443
1447
  playsinline
1444
- autoplay="${(M=t.autoplay)!=null?M:!1}"
1448
+ autoplay="${(w=t.autoplay)!=null?w:!1}"
1445
1449
  muted="${(U=t.muted)!=null?U:!1}"
1446
- loop="${(ee=t.loop)!=null?ee:!1}"
1447
- preload="${(_e=t.preload)!=null?_e:!1}"
1448
- debug="${(gt=t.debug)!=null?gt:!1}"
1449
- prefer-cmcd="${(nt=t.preferCmcd)!=null?nt:!1}"
1450
- disable-tracking="${(ta=t.disableTracking)!=null?ta:!1}"
1451
- disable-cookies="${(ia=t.disableCookies)!=null?ia:!1}"
1452
- prefer-playback="${(aa=t.preferPlayback)!=null?aa:!1}"
1450
+ loop="${(J=t.loop)!=null?J:!1}"
1451
+ preload="${(be=t.preload)!=null?be:!1}"
1452
+ debug="${(Et=t.debug)!=null?Et:!1}"
1453
+ prefer-cmcd="${(at=t.preferCmcd)!=null?at:!1}"
1454
+ disable-tracking="${(ea=t.disableTracking)!=null?ea:!1}"
1455
+ disable-cookies="${(ta=t.disableCookies)!=null?ta:!1}"
1456
+ prefer-playback="${(ia=t.preferPlayback)!=null?ia:!1}"
1453
1457
  start-time="${t.startTime!=null?t.startTime:!1}"
1454
- beacon-collection-domain="${(ra=t.beaconCollectionDomain)!=null?ra:!1}"
1455
- player-init-time="${(na=t.playerInitTime)!=null?na:!1}"
1456
- player-software-name="${(oa=t.playerSoftwareName)!=null?oa:!1}"
1457
- player-software-version="${(sa=t.playerSoftwareVersion)!=null?sa:!1}"
1458
- env-key="${(la=t.envKey)!=null?la:!1}"
1459
- custom-domain="${(da=t.customDomain)!=null?da:!1}"
1460
- src="${t.src?t.src:t.playbackId?(0,Qa.toMuxVideoURL)(t):!1}"
1461
- cast-src="${t.src?t.src:t.playbackId?(0,Qa.toMuxVideoURL)(t):!1}"
1462
- cast-receiver="${(ua=t.castReceiver)!=null?ua:!1}"
1463
- drm-token="${(gr=(ca=t.tokens)==null?void 0:ca.drm)!=null?gr:!1}"
1458
+ beacon-collection-domain="${(aa=t.beaconCollectionDomain)!=null?aa:!1}"
1459
+ player-init-time="${(ra=t.playerInitTime)!=null?ra:!1}"
1460
+ player-software-name="${(na=t.playerSoftwareName)!=null?na:!1}"
1461
+ player-software-version="${(oa=t.playerSoftwareVersion)!=null?oa:!1}"
1462
+ env-key="${(sa=t.envKey)!=null?sa:!1}"
1463
+ custom-domain="${(la=t.customDomain)!=null?la:!1}"
1464
+ src="${t.src?t.src:t.playbackId?(0,Za.toMuxVideoURL)(t):!1}"
1465
+ cast-src="${t.src?t.src:t.playbackId?(0,Za.toMuxVideoURL)(t):!1}"
1466
+ cast-receiver="${(da=t.castReceiver)!=null?da:!1}"
1467
+ drm-token="${(Er=(ua=t.tokens)==null?void 0:ua.drm)!=null?Er:!1}"
1464
1468
  exportparts="video"
1465
1469
  >
1466
- ${t.storyboard?za`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:za``}
1470
+ ${t.storyboard?qa`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:qa``}
1467
1471
  <slot></slot>
1468
1472
  </mux-video>
1469
1473
  <slot name="poster" slot="poster">
@@ -1471,11 +1475,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1471
1475
  part="poster"
1472
1476
  exportparts="poster, img"
1473
1477
  src="${t.poster?t.poster:!1}"
1474
- placeholdersrc="${(ot=t.placeholder)!=null?ot:!1}"
1478
+ placeholdersrc="${(rt=t.placeholder)!=null?rt:!1}"
1475
1479
  ></media-poster-image>
1476
1480
  </slot>
1477
1481
  </media-theme>
1478
- `};var b=require("@mux/playback-core"),cm=t=>t.charAt(0).toUpperCase()+t.slice(1),$f=(t,e=!1)=>{var i,a;if(t.muxCode){let r=cm((i=t.errorCategory)!=null?i:"video"),n=(0,b.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:b.MuxErrorCategory.VIDEO);if(t.muxCode===b.MuxErrorCode.NETWORK_OFFLINE)return(0,b.i18n)("Your device appears to be offline",e);if(t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,b.i18n)("{category} URL has expired",e).format({category:r});if([b.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,b.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,b.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,b.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,b.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,b.i18n)("Invalid {categoryName} URL",e).format({categoryName:n});if(t.muxCode===b.MuxErrorCode.NETWORK_NOT_FOUND)return(0,b.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===b.MuxErrorCode.NETWORK_NOT_READY)return(0,b.i18n)("{category} is not currently available",e).format({category:r})}if(t.code){if(t.code===b.MediaError.MEDIA_ERR_NETWORK)return(0,b.i18n)("Network Error",e);if(t.code===b.MediaError.MEDIA_ERR_DECODE)return(0,b.i18n)("Media Error",e);if(t.code===b.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,b.i18n)("Source Not Supported",e)}return(0,b.i18n)("Error",e)},Wf=(t,e=!1)=>{var i,a;if(t.muxCode){let r=cm((i=t.errorCategory)!=null?i:"video"),n=(0,b.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:b.MuxErrorCategory.VIDEO);return t.muxCode===b.MuxErrorCode.NETWORK_OFFLINE?(0,b.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,b.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:n}):t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,b.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:n}):t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,b.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[b.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,b.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,b.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:n}):[b.MuxErrorCode.NETWORK_TOKEN_MISSING,b.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,b.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:n}):t.muxCode===b.MuxErrorCode.NETWORK_NOT_FOUND?"":t.muxCode===b.MuxErrorCode.NETWORK_NOT_READY?(0,b.i18n)("The live stream or video file are not yet ready.",e):t.message}return t.code&&(t.code===b.MediaError.MEDIA_ERR_NETWORK||t.code===b.MediaError.MEDIA_ERR_DECODE||t.code===b.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},mm=(t,e=!1)=>{let i=$f(t,e),a=Wf(t,e);return{title:i,message:a}},Ff=t=>{if(t.muxCode){if(t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([b.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,b.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===b.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===b.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===b.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===b.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===b.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},El=(t,e)=>{let i=Ff(t);return{message:t.message,context:t.context,file:i}};var hm=`<template id="media-theme-gerwig">
1482
+ `};var g=require("@mux/playback-core"),um=t=>t.charAt(0).toUpperCase()+t.slice(1),$f=(t,e=!1)=>{var i,a;if(t.muxCode){let r=um((i=t.errorCategory)!=null?i:"video"),n=(0,g.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:g.MuxErrorCategory.VIDEO);if(t.muxCode===g.MuxErrorCode.NETWORK_OFFLINE)return(0,g.i18n)("Your device appears to be offline",e);if(t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,g.i18n)("{category} URL has expired",e).format({category:r});if([g.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,g.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,g.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,g.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,g.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,g.i18n)("Invalid {categoryName} URL",e).format({categoryName:n});if(t.muxCode===g.MuxErrorCode.NETWORK_NOT_FOUND)return(0,g.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===g.MuxErrorCode.NETWORK_NOT_READY)return(0,g.i18n)("{category} is not currently available",e).format({category:r})}if(t.code){if(t.code===g.MediaError.MEDIA_ERR_NETWORK)return(0,g.i18n)("Network Error",e);if(t.code===g.MediaError.MEDIA_ERR_DECODE)return(0,g.i18n)("Media Error",e);if(t.code===g.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,g.i18n)("Source Not Supported",e)}return(0,g.i18n)("Error",e)},Wf=(t,e=!1)=>{var i,a;if(t.muxCode){let r=um((i=t.errorCategory)!=null?i:"video"),n=(0,g.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:g.MuxErrorCategory.VIDEO);return t.muxCode===g.MuxErrorCode.NETWORK_OFFLINE?(0,g.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,g.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:n}):t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,g.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:n}):t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,g.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[g.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,g.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,g.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:n}):[g.MuxErrorCode.NETWORK_TOKEN_MISSING,g.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,g.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:n}):t.muxCode===g.MuxErrorCode.NETWORK_NOT_FOUND?"":t.muxCode===g.MuxErrorCode.NETWORK_NOT_READY?(0,g.i18n)("The live stream or video file are not yet ready.",e):t.message}return t.code&&(t.code===g.MediaError.MEDIA_ERR_NETWORK||t.code===g.MediaError.MEDIA_ERR_DECODE||t.code===g.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},cm=(t,e=!1)=>{let i=$f(t,e),a=Wf(t,e);return{title:i,message:a}},Ff=t=>{if(t.muxCode){if(t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([g.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,g.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===g.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===g.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===g.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===g.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===g.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},vl=(t,e)=>{let i=Ff(t);return{message:t.message,context:t.context,file:i}};var mm=`<template id="media-theme-gerwig">
1479
1483
  <style>
1480
1484
  @keyframes pre-play-hide {
1481
1485
  0% {
@@ -2592,7 +2596,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2592
2596
  <slot></slot>
2593
2597
  </media-controller>
2594
2598
  </template>
2595
- `;function pm({anchor:t,floating:e,placement:i}){let a=Vf({anchor:t,floating:e}),{x:r,y:n}=Gf(a,i);return{x:r,y:n}}function Vf({anchor:t,floating:e}){return{anchor:Yf(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Yf(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 Gf({anchor:t,floating:e},i){let a=qf(i)==="x"?"y":"x",r=a==="y"?"height":"width",n=fm(i),s=t.x+t.width/2-e.width/2,l=t.y+t.height/2-e.height/2,u=t[r]/2-e[r]/2,c;switch(n){case"top":c={x:s,y:t.y-e.height};break;case"bottom":c={x:s,y:t.y+t.height};break;case"right":c={x:t.x+t.width,y:l};break;case"left":c={x:t.x-e.width,y:l};break;default:c={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":c[a]-=u;break;case"end":c[a]+=u;break}return c}function fm(t){return t.split("-")[0]}function qf(t){return["top","bottom"].includes(fm(t))?"y":"x"}var wt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},Xn=class extends Event{constructor({newState:e,oldState:i,...a}){super("toggle",a),this.newState=e,this.oldState=i}};var Rl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},H=(t,e,i)=>(Rl(t,e,"read from private field"),i?i.call(t):e.get(t)),V=(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)},je=(t,e,i,a)=>(Rl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),q=(t,e,i)=>(Rl(t,e,"access private method"),i),et,ci,xt,Jn,jn,mi,ja,bl,vm,io,eo,gl,_l,Em,Al,bm,Tl,gm,Gi,qi,Zi,er,ao,Ll,yl,_m,wl,Am,kl,Tm,xl,ym,Sl,km,Il,Sm,Xa,ro,Cl,Im,Ja,no,to,Ml;function tt({type:t,text:e,value:i,checked:a}){let r=h.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 n=h.createElement("span");return n.textContent=e,r.append(n),r}function Ue(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):""}var Cm=h.createElement("template");Cm.innerHTML=`
2599
+ `;function hm({anchor:t,floating:e,placement:i}){let a=Kf({anchor:t,floating:e}),{x:r,y:n}=Yf(a,i);return{x:r,y:n}}function Kf({anchor:t,floating:e}){return{anchor:Gf(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Gf(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 Yf({anchor:t,floating:e},i){let a=qf(i)==="x"?"y":"x",r=a==="y"?"height":"width",n=pm(i),s=t.x+t.width/2-e.width/2,l=t.y+t.height/2-e.height/2,u=t[r]/2-e[r]/2,c;switch(n){case"top":c={x:s,y:t.y-e.height};break;case"bottom":c={x:s,y:t.y+t.height};break;case"right":c={x:t.x+t.width,y:l};break;case"left":c={x:t.x-e.width,y:l};break;default:c={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":c[a]-=u;break;case"end":c[a]+=u;break}return c}function pm(t){return t.split("-")[0]}function qf(t){return["top","bottom"].includes(pm(t))?"y":"x"}var wt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},zn=class extends Event{constructor({newState:e,oldState:i,...a}){super("toggle",a),this.newState=e,this.oldState=i}};var Ml=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},H=(t,e,i)=>(Ml(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)},Xe=(t,e,i,a)=>(Ml(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),G=(t,e,i)=>(Ml(t,e,"access private method"),i),Je,di,Rt,Qn,Xn,ui,Xa,El,fm,eo,Jn,bl,gl,vm,_l,Em,Al,bm,Gi,Yi,qi,Ja,to,wl,yl,gm,Rl,_m,Tl,Am,Ll,ym,kl,Tm,Sl,km,za,io,Il,Sm,Qa,ao,jn,Cl;function je({type:t,text:e,value:i,checked:a}){let r=h.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 n=h.createElement("span");return n.textContent=e,r.append(n),r}function Ne(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):""}var Im=h.createElement("template");Im.innerHTML=`
2596
2600
  <style>
2597
2601
  :host {
2598
2602
  font: var(--media-font,
@@ -2766,7 +2770,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2766
2770
  <slot></slot>
2767
2771
  </div>
2768
2772
  <slot name="checked-indicator" hidden></slot>
2769
- `;var ui={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},se=class extends d.HTMLElement{constructor(){super(),V(this,bl),V(this,eo),V(this,_l),V(this,Al),V(this,Tl),V(this,Zi),V(this,ao),V(this,yl),V(this,wl),V(this,kl),V(this,xl),V(this,Sl),V(this,Il),V(this,Xa),V(this,Cl),V(this,Ja),V(this,to),V(this,et,null),V(this,ci,null),V(this,xt,null),V(this,Jn,new Set),V(this,jn,void 0),V(this,mi,!1),V(this,ja,null),V(this,io,()=>{let e=H(this,Jn),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}));je(this,Jn,i)}),V(this,Gi,()=>{q(this,Zi,er).call(this),q(this,ao,Ll).call(this,!1)}),V(this,qi,()=>{q(this,Zi,er).call(this)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=this.constructor.template.content.cloneNode(!0),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),je(this,jn,new MutationObserver(H(this,io))),H(this,jn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[ui.DISABLED,ui.HIDDEN,ui.STYLE,ui.ANCHOR,R.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":q(this,bl,vm).call(this,e);break;case"invoke":q(this,_l,Em).call(this,e);break;case"click":q(this,yl,_m).call(this,e);break;case"toggle":q(this,kl,Tm).call(this,e);break;case"focusout":q(this,Sl,km).call(this,e);break;case"keydown":q(this,Il,Sm).call(this,e);break}}connectedCallback(){var e,i;je(this,ja,Wo(this.shadowRoot,":host")),q(this,eo,gl).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),je(this,et,Ir(this)),(i=(e=H(this,et))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(lt(tr(this),H(this,Gi)),lt(this,H(this,qi)))}disconnectedCallback(){var e,i;dt(tr(this),H(this,Gi)),dt(this,H(this,qi)),this.disable(),(i=(e=H(this,et))==null?void 0:e.unassociateElement)==null||i.call(e,this),je(this,et,null)}attributeChangedCallback(e,i,a){var r,n,s,l;e===ui.HIDDEN&&a!==i?(H(this,mi)||je(this,mi,!0),this.hidden?q(this,Tl,gm).call(this):q(this,Al,bm).call(this),this.dispatchEvent(new Xn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===R.MEDIA_CONTROLLER?(i&&((n=(r=H(this,et))==null?void 0:r.unassociateElement)==null||n.call(r,this),je(this,et,null)),a&&this.isConnected&&(je(this,et,Ir(this)),(l=(s=H(this,et))==null?void 0:s.associateElement)==null||l.call(s,this))):e===ui.DISABLED&&a!==i?a==null?this.enable():this.disable():e===ui.STYLE&&a!==i&&q(this,eo,gl).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=Bt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Zf)}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&&q(this,to,Ml).call(this,i)}focus(){if(je(this,ci,va()),this.items.length){q(this,Ja,no).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=q(this,Xa,ro).call(this,e);a&&(q(this,to,Ml).call(this,a,a.type==="checkbox"),H(this,xt)&&!this.hidden&&((i=H(this,ci))==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,n=this.items,s=(a=(i=q(this,Xa,ro).call(this,e))!=null?i:q(this,Cl,Im).call(this))!=null?a:n[0],l=n.indexOf(s),u=Math.max(0,l);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=n.length-1),u<0&&(u=n.length-1),u>n.length-1&&(u=0),q(this,Ja,no).call(this,n[u]),n[u].focus()}};et=new WeakMap;ci=new WeakMap;xt=new WeakMap;Jn=new WeakMap;jn=new WeakMap;mi=new WeakMap;ja=new WeakMap;bl=new WeakSet;vm=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:!0}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();if(["header","title"].includes(e.name)){let i=this.shadowRoot.querySelector('slot[name="header"]');i.hidden=e.assignedNodes().length===0}e.name||H(this,io).call(this)};io=new WeakMap;eo=new WeakSet;gl=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")};_l=new WeakSet;Em=function(t){je(this,xt,t.relatedTarget),ue(this,t.relatedTarget)||(this.hidden=!this.hidden)};Al=new WeakSet;bm=function(){var t;(t=H(this,xt))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),lt(tr(this),H(this,Gi)),lt(this,H(this,qi))};Tl=new WeakSet;gm=function(){var t;(t=H(this,xt))==null||t.setAttribute("aria-expanded","false"),dt(tr(this),H(this,Gi)),dt(this,H(this,qi))};Gi=new WeakMap;qi=new WeakMap;Zi=new WeakSet;er=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=pm({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=tr(this).getBoundingClientRect(),n=r.width-e-t,s=r.height-i-this.offsetHeight,{style:l}=H(this,ja);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),_=l.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),g=r.height-_-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};ao=new WeakSet;Ll=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=H(this,ja);if(t||a.setProperty("--media-menu-transition-in","none"),i){let r=i.offsetHeight,n=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${r}px`),q(this,Zi,er).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),q(this,Zi,er).call(this);a.removeProperty("--media-menu-transition-in")};yl=new WeakSet;_m=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(H(this,wl,Am))){(e=H(this,ci))==null||e.focus(),this.hidden=!0;return}let i=q(this,Xa,ro).call(this,t);!i||i.hasAttribute("disabled")||(q(this,Ja,no).call(this,i),this.handleSelect(t))};wl=new WeakSet;Am=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"]'))};kl=new WeakSet;Tm=function(t){if(t.target===this)return;q(this,xl,ym).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 wt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);q(this,ao,Ll).call(this,!0)};xl=new WeakSet;ym=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Sl=new WeakSet;km=function(t){var e;ue(this,t.relatedTarget)||(H(this,mi)&&((e=H(this,ci))==null||e.focus()),H(this,xt)&&H(this,xt)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};Il=new WeakSet;Sm=function(t){var e,i,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=t;if(!(l||u||c)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if(H(this,mi)){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"?((n=H(this,ci))==null||n.focus(),H(this,mi)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};Xa=new WeakSet;ro=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Cl=new WeakSet;Im=function(){return this.items.find(t=>t.tabIndex===0)};Ja=new WeakSet;no=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};to=new WeakSet;Ml=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}))};se.template=Cm;function Zf(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function tr(t){var e;return(e=t.getAttribute("bounds")?He(t,`#${t.getAttribute("bounds")}`):z(t)||t.parentElement)!=null?e:t}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",se);var Bl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},at=(t,e,i)=>(Bl(t,e,"read from private field"),i?i.call(t):e.get(t)),Et=(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)},Dl=(t,e,i,a)=>(Bl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),it=(t,e,i)=>(Bl(t,e,"access private method"),i),oo,ar,Ol,Mm,Hl,Rm,$l,Lm,rt,zi,rr,Nl,wm,so,Pl,xm=h.createElement("template");xm.innerHTML=`
2773
+ `;var li={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},ne=class extends d.HTMLElement{constructor(){super(),K(this,El),K(this,Jn),K(this,gl),K(this,_l),K(this,Al),K(this,qi),K(this,to),K(this,yl),K(this,Rl),K(this,Tl),K(this,Ll),K(this,kl),K(this,Sl),K(this,za),K(this,Il),K(this,Qa),K(this,jn),K(this,Je,null),K(this,di,null),K(this,Rt,null),K(this,Qn,new Set),K(this,Xn,void 0),K(this,ui,!1),K(this,Xa,null),K(this,eo,()=>{let e=H(this,Qn),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}));Xe(this,Qn,i)}),K(this,Gi,()=>{G(this,qi,Ja).call(this),G(this,to,wl).call(this,!1)}),K(this,Yi,()=>{G(this,qi,Ja).call(this)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=this.constructor.template.content.cloneNode(!0),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),Xe(this,Xn,new MutationObserver(H(this,eo))),H(this,Xn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[li.DISABLED,li.HIDDEN,li.STYLE,li.ANCHOR,R.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,El,fm).call(this,e);break;case"invoke":G(this,gl,vm).call(this,e);break;case"click":G(this,yl,gm).call(this,e);break;case"toggle":G(this,Tl,Am).call(this,e);break;case"focusout":G(this,kl,Tm).call(this,e);break;case"keydown":G(this,Sl,km).call(this,e);break}}connectedCallback(){var e,i;Xe(this,Xa,Ho(this.shadowRoot,":host")),G(this,Jn,bl).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Xe(this,Je,kr(this)),(i=(e=H(this,Je))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(ot(ja(this),H(this,Gi)),ot(this,H(this,Yi)))}disconnectedCallback(){var e,i;st(ja(this),H(this,Gi)),st(this,H(this,Yi)),this.disable(),(i=(e=H(this,Je))==null?void 0:e.unassociateElement)==null||i.call(e,this),Xe(this,Je,null)}attributeChangedCallback(e,i,a){var r,n,s,l;e===li.HIDDEN&&a!==i?(H(this,ui)||Xe(this,ui,!0),this.hidden?G(this,Al,bm).call(this):G(this,_l,Em).call(this),this.dispatchEvent(new zn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===R.MEDIA_CONTROLLER?(i&&((n=(r=H(this,Je))==null?void 0:r.unassociateElement)==null||n.call(r,this),Xe(this,Je,null)),a&&this.isConnected&&(Xe(this,Je,kr(this)),(l=(s=H(this,Je))==null?void 0:s.associateElement)==null||l.call(s,this))):e===li.DISABLED&&a!==i?a==null?this.enable():this.disable():e===li.STYLE&&a!==i&&G(this,Jn,bl).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=Pt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Zf)}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,jn,Cl).call(this,i)}focus(){if(Xe(this,di,fa()),this.items.length){G(this,Qa,ao).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,za,io).call(this,e);a&&(G(this,jn,Cl).call(this,a,a.type==="checkbox"),H(this,Rt)&&!this.hidden&&((i=H(this,di))==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,n=this.items,s=(a=(i=G(this,za,io).call(this,e))!=null?i:G(this,Il,Sm).call(this))!=null?a:n[0],l=n.indexOf(s),u=Math.max(0,l);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=n.length-1),u<0&&(u=n.length-1),u>n.length-1&&(u=0),G(this,Qa,ao).call(this,n[u]),n[u].focus()}};Je=new WeakMap;di=new WeakMap;Rt=new WeakMap;Qn=new WeakMap;Xn=new WeakMap;ui=new WeakMap;Xa=new WeakMap;El=new WeakSet;fm=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:!0}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();if(["header","title"].includes(e.name)){let i=this.shadowRoot.querySelector('slot[name="header"]');i.hidden=e.assignedNodes().length===0}e.name||H(this,eo).call(this)};eo=new WeakMap;Jn=new WeakSet;bl=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")};gl=new WeakSet;vm=function(t){Xe(this,Rt,t.relatedTarget),le(this,t.relatedTarget)||(this.hidden=!this.hidden)};_l=new WeakSet;Em=function(){var t;(t=H(this,Rt))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),ot(ja(this),H(this,Gi)),ot(this,H(this,Yi))};Al=new WeakSet;bm=function(){var t;(t=H(this,Rt))==null||t.setAttribute("aria-expanded","false"),st(ja(this),H(this,Gi)),st(this,H(this,Yi))};Gi=new WeakMap;Yi=new WeakMap;qi=new WeakSet;Ja=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=hm({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=ja(this).getBoundingClientRect(),n=r.width-e-t,s=r.height-i-this.offsetHeight,{style:l}=H(this,Xa);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),A=l.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),_=r.height-A-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${_}px`)};to=new WeakSet;wl=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=H(this,Xa);if(t||a.setProperty("--media-menu-transition-in","none"),i){let r=i.offsetHeight,n=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${r}px`),G(this,qi,Ja).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,qi,Ja).call(this);a.removeProperty("--media-menu-transition-in")};yl=new WeakSet;gm=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(H(this,Rl,_m))){(e=H(this,di))==null||e.focus(),this.hidden=!0;return}let i=G(this,za,io).call(this,t);!i||i.hasAttribute("disabled")||(G(this,Qa,ao).call(this,i),this.handleSelect(t))};Rl=new WeakSet;_m=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"]'))};Tl=new WeakSet;Am=function(t){if(t.target===this)return;G(this,Ll,ym).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 wt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);G(this,to,wl).call(this,!0)};Ll=new WeakSet;ym=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};kl=new WeakSet;Tm=function(t){var e;le(this,t.relatedTarget)||(H(this,ui)&&((e=H(this,di))==null||e.focus()),H(this,Rt)&&H(this,Rt)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};Sl=new WeakSet;km=function(t){var e,i,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=t;if(!(l||u||c)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if(H(this,ui)){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"?((n=H(this,di))==null||n.focus(),H(this,ui)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};za=new WeakSet;io=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Il=new WeakSet;Sm=function(){return this.items.find(t=>t.tabIndex===0)};Qa=new WeakSet;ao=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};jn=new WeakSet;Cl=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}))};ne.template=Im;function Zf(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function ja(t){var e;return(e=t.getAttribute("bounds")?Ue(t,`#${t.getAttribute("bounds")}`):q(t)||t.parentElement)!=null?e:t}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",ne);var Ul=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},tt=(t,e,i)=>(Ul(t,e,"read from private field"),i?i.call(t):e.get(t)),ft=(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)},xl=(t,e,i,a)=>(Ul(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),et=(t,e,i)=>(Ul(t,e,"access private method"),i),ro,tr,Dl,Cm,Bl,Mm,Hl,wm,it,Zi,ir,Ol,Rm,no,Nl,Lm=h.createElement("template");Lm.innerHTML=`
2770
2774
  <style>
2771
2775
  :host {
2772
2776
  transition: var(--media-menu-item-transition,
@@ -2882,7 +2886,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2882
2886
  <slot name="description"></slot>
2883
2887
  <slot name="suffix"></slot>
2884
2888
  <slot name="submenu"></slot>
2885
- `;var Re={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Dt=class extends d.HTMLElement{constructor(){super(),Et(this,Ol),Et(this,Hl),Et(this,$l),Et(this,zi),Et(this,Nl),Et(this,so),Et(this,oo,!1),Et(this,ar,void 0),Et(this,rt,()=>{var e,i;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],n=(i=r==null?void 0:r.dataset.description)!=null?i:r==null?void 0:r.text,s=h.createElement("span");s.textContent=n!=null?n:"",a.replaceChildren(s)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0))),this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Re.TYPE,Re.DISABLED,Re.CHECKED,Re.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),ir(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":it(this,Ol,Mm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":it(this,Nl,wm).call(this,e);break;case"keyup":it(this,zi,rr).call(this,e);break}}attributeChangedCallback(e,i,a){e===Re.CHECKED&&ir(this)&&!at(this,oo)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===Re.TYPE&&a!==i?this.role="menuitem"+a:e===Re.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Re.DISABLED)||this.enable(),this.role="menuitem"+this.type,Dl(this,ar,Ul(this,this.parentNode)),it(this,so,Pl).call(this)}disconnectedCallback(){this.disable(),it(this,so,Pl).call(this),Dl(this,ar,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Bt(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(Re.TYPE))!=null?e:""}set type(e){this.setAttribute(Re.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Re.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Re.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(ir(this))return this.getAttribute("aria-checked")==="true"}set checked(e){ir(this)&&(Dl(this,oo,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){ir(this)||this.invokeTargetElement&&ue(this,e.target)&&this.invokeTargetElement.dispatchEvent(new wt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};oo=new WeakMap;ar=new WeakMap;Ol=new WeakSet;Mm=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?it(this,Hl,Rm).call(this):it(this,$l,Lm).call(this))};Hl=new WeakSet;Rm=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",at(this,rt)),this.submenuElement.addEventListener("addmenuitem",at(this,rt)),this.submenuElement.addEventListener("removemenuitem",at(this,rt)),at(this,rt).call(this)};$l=new WeakSet;Lm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",at(this,rt)),this.submenuElement.removeEventListener("addmenuitem",at(this,rt)),this.submenuElement.removeEventListener("removemenuitem",at(this,rt)),at(this,rt).call(this)};rt=new WeakMap;zi=new WeakSet;rr=function(t){let{key:e}=t;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",it(this,zi,rr));return}this.handleClick(t)};Nl=new WeakSet;wm=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!this.keysUsed.includes(a)){this.removeEventListener("keyup",it(this,zi,rr));return}this.addEventListener("keyup",it(this,zi,rr),{once:!0})};so=new WeakSet;Pl=function(){var t;let e=(t=at(this,ar))==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")};Dt.template=xm;function ir(t){return t.type==="radio"||t.type==="checkbox"}function Ul(t,e){if(!t)return null;let{host:i}=t.getRootNode();return!e&&i?Ul(t,i):e!=null&&e.items?e:Ul(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",Dt);var Dm=h.createElement("template");Dm.innerHTML=se.template.innerHTML+`
2889
+ `;var Ce={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Lt=class extends d.HTMLElement{constructor(){super(),ft(this,Dl),ft(this,Bl),ft(this,Hl),ft(this,Zi),ft(this,Ol),ft(this,no),ft(this,ro,!1),ft(this,tr,void 0),ft(this,it,()=>{var e,i;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],n=(i=r==null?void 0:r.dataset.description)!=null?i:r==null?void 0:r.text,s=h.createElement("span");s.textContent=n!=null?n:"",a.replaceChildren(s)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0))),this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Ce.TYPE,Ce.DISABLED,Ce.CHECKED,Ce.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),er(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":et(this,Dl,Cm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":et(this,Ol,Rm).call(this,e);break;case"keyup":et(this,Zi,ir).call(this,e);break}}attributeChangedCallback(e,i,a){e===Ce.CHECKED&&er(this)&&!tt(this,ro)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===Ce.TYPE&&a!==i?this.role="menuitem"+a:e===Ce.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Ce.DISABLED)||this.enable(),this.role="menuitem"+this.type,xl(this,tr,Pl(this,this.parentNode)),et(this,no,Nl).call(this)}disconnectedCallback(){this.disable(),et(this,no,Nl).call(this),xl(this,tr,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Pt(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(Ce.TYPE))!=null?e:""}set type(e){this.setAttribute(Ce.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Ce.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Ce.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(er(this))return this.getAttribute("aria-checked")==="true"}set checked(e){er(this)&&(xl(this,ro,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){er(this)||this.invokeTargetElement&&le(this,e.target)&&this.invokeTargetElement.dispatchEvent(new wt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};ro=new WeakMap;tr=new WeakMap;Dl=new WeakSet;Cm=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?et(this,Bl,Mm).call(this):et(this,Hl,wm).call(this))};Bl=new WeakSet;Mm=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",tt(this,it)),this.submenuElement.addEventListener("addmenuitem",tt(this,it)),this.submenuElement.addEventListener("removemenuitem",tt(this,it)),tt(this,it).call(this)};Hl=new WeakSet;wm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",tt(this,it)),this.submenuElement.removeEventListener("addmenuitem",tt(this,it)),this.submenuElement.removeEventListener("removemenuitem",tt(this,it)),tt(this,it).call(this)};it=new WeakMap;Zi=new WeakSet;ir=function(t){let{key:e}=t;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",et(this,Zi,ir));return}this.handleClick(t)};Ol=new WeakSet;Rm=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!this.keysUsed.includes(a)){this.removeEventListener("keyup",et(this,Zi,ir));return}this.addEventListener("keyup",et(this,Zi,ir),{once:!0})};no=new WeakSet;Nl=function(){var t;let e=(t=tt(this,tr))==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")};Lt.template=Lm;function er(t){return t.type==="radio"||t.type==="checkbox"}function Pl(t,e){if(!t)return null;let{host:i}=t.getRootNode();return!e&&i?Pl(t,i):e!=null&&e.items?e:Pl(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",Lt);var xm=h.createElement("template");xm.innerHTML=ne.template.innerHTML+`
2886
2890
  <style>
2887
2891
  :host {
2888
2892
  --_menu-bg: rgb(20 20 30 / .8);
@@ -2916,7 +2920,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2916
2920
  --media-settings-menu-item-opacity: 0;
2917
2921
  }
2918
2922
  </style>
2919
- `;var nr=class extends se{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:z(this).querySelector("media-settings-menu-button")}};nr.template=Dm;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",nr);var Om,lo=h.createElement("template");lo.innerHTML=Dt.template.innerHTML+`
2923
+ `;var ar=class extends ne{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:q(this).querySelector("media-settings-menu-button")}};ar.template=xm;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",ar);var Dm,oo=h.createElement("template");oo.innerHTML=Lt.template.innerHTML+`
2920
2924
  <style>
2921
2925
  slot:not([name="submenu"]) {
2922
2926
  opacity: var(--media-settings-menu-item-opacity, var(--media-menu-item-opacity));
@@ -2926,11 +2930,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2926
2930
  background: transparent;
2927
2931
  }
2928
2932
  </style>
2929
- `;(Om=lo.content)!=null&&Om.querySelector&&(lo.content.querySelector('slot[name="suffix"]').innerHTML=`
2933
+ `;(Dm=oo.content)!=null&&Dm.querySelector&&(oo.content.querySelector('slot[name="suffix"]').innerHTML=`
2930
2934
  <svg aria-hidden="true" viewBox="0 0 20 24">
2931
2935
  <path d="m8.12 17.585-.742-.669 4.2-4.665-4.2-4.666.743-.669 4.803 5.335-4.803 5.334Z"/>
2932
2936
  </svg>
2933
- `);var or=class extends Dt{};or.template=lo;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",or);var ge=class extends K{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Bt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new wt({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",ge);var Nm=h.createElement("template");Nm.innerHTML=`
2937
+ `);var rr=class extends Lt{};rr.template=oo;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",rr);var Ee=class extends V{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Pt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new wt({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",Ee);var Om=h.createElement("template");Om.innerHTML=`
2934
2938
  <style>
2935
2939
  :host([aria-expanded="true"]) slot[name=tooltip] {
2936
2940
  display: none;
@@ -2941,25 +2945,25 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2941
2945
  <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"/>
2942
2946
  </svg>
2943
2947
  </slot>
2944
- `;var uo=class extends ge{static get observedAttributes(){return[...super.observedAttributes,"target"]}constructor(){super({slotTemplate:Nm,tooltipContent:D.SETTINGS})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",Y.SETTINGS())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:z(this).querySelector("media-settings-menu")}};d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",uo);var Vl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Pm=(t,e,i)=>(Vl(t,e,"read from private field"),i?i.call(t):e.get(t)),co=(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)},Wl=(t,e,i,a)=>(Vl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),mo=(t,e,i)=>(Vl(t,e,"access private method"),i),sr,fo,ho,Fl,po,Kl,vo=class extends se{constructor(){super(...arguments),co(this,ho),co(this,po),co(this,sr,[]),co(this,fo,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_AUDIO_TRACK_ENABLED&&i!==a?this.value=a:e===o.MEDIA_AUDIO_TRACK_LIST&&i!==a&&(Wl(this,sr,$d(a!=null?a:"")),mo(this,ho,Fl).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",mo(this,po,Kl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",mo(this,po,Kl))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=z(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Pm(this,sr)}set mediaAudioTrackList(e){Wl(this,sr,e),mo(this,ho,Fl).call(this)}get mediaAudioTrackEnabled(){var e;return(e=I(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){C(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};sr=new WeakMap;fo=new WeakMap;ho=new WeakSet;Fl=function(){if(Pm(this,fo)===JSON.stringify(this.mediaAudioTrackList))return;Wl(this,fo,JSON.stringify(this.mediaAudioTrackList));let t=this.mediaAudioTrackList;this.defaultSlot.textContent="";for(let e of t){let i=this.formatMenuItemText(e.label,e),a=tt({type:"radio",text:i,value:`${e.id}`,checked:e.enabled});a.prepend(Ue(this,"checked-indicator")),this.defaultSlot.append(a)}};po=new WeakSet;Kl=function(){if(this.value==null)return;let t=new d.CustomEvent(p.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-audio-track-menu")||d.customElements.define("media-audio-track-menu",vo);var zf=`<svg aria-hidden="true" viewBox="0 0 24 24">
2948
+ `;var so=class extends Ee{static get observedAttributes(){return[...super.observedAttributes,"target"]}constructor(){super({slotTemplate:Om,tooltipContent:f("Settings")})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",f("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:q(this).querySelector("media-settings-menu")}};d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",so);var Vl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Nm=(t,e,i)=>(Vl(t,e,"read from private field"),i?i.call(t):e.get(t)),lo=(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)},$l=(t,e,i,a)=>(Vl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),uo=(t,e,i)=>(Vl(t,e,"access private method"),i),nr,ho,co,Wl,mo,Fl,po=class extends ne{constructor(){super(...arguments),lo(this,co),lo(this,mo),lo(this,nr,[]),lo(this,ho,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_AUDIO_TRACK_ENABLED&&i!==a?this.value=a:e===o.MEDIA_AUDIO_TRACK_LIST&&i!==a&&($l(this,nr,Hd(a!=null?a:"")),uo(this,co,Wl).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",uo(this,mo,Fl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",uo(this,mo,Fl))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=q(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Nm(this,nr)}set mediaAudioTrackList(e){$l(this,nr,e),uo(this,co,Wl).call(this)}get mediaAudioTrackEnabled(){var e;return(e=C(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){M(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};nr=new WeakMap;ho=new WeakMap;co=new WeakSet;Wl=function(){if(Nm(this,ho)===JSON.stringify(this.mediaAudioTrackList))return;$l(this,ho,JSON.stringify(this.mediaAudioTrackList));let t=this.mediaAudioTrackList;this.defaultSlot.textContent="";for(let e of t){let i=this.formatMenuItemText(e.label,e),a=je({type:"radio",text:i,value:`${e.id}`,checked:e.enabled});a.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(a)}};mo=new WeakSet;Fl=function(){if(this.value==null)return;let t=new d.CustomEvent(p.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-audio-track-menu")||d.customElements.define("media-audio-track-menu",po);var zf=`<svg aria-hidden="true" viewBox="0 0 24 24">
2945
2949
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
2946
2950
  <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"/>
2947
- </svg>`,Um=h.createElement("template");Um.innerHTML=`
2951
+ </svg>`,Pm=h.createElement("template");Pm.innerHTML=`
2948
2952
  <style>
2949
2953
  :host([aria-expanded="true"]) slot[name=tooltip] {
2950
2954
  display: none;
2951
2955
  }
2952
2956
  </style>
2953
2957
  <slot name="icon">${zf}</slot>
2954
- `;var Eo=class extends ge{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Um,tooltipContent:D.AUDIO_TRACK_MENU})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",Y.AUDIO_TRACKS())}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=z(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=I(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){C(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",Eo);var zl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Qf=(t,e,i)=>(zl(t,e,"read from private field"),i?i.call(t):e.get(t)),Yl=(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)},Xf=(t,e,i,a)=>(zl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Gl=(t,e,i)=>(zl(t,e,"access private method"),i),go,ql,$m,bo,Zl,Jf=`
2958
+ `;var fo=class extends Ee{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Pm,tooltipContent:f("Audio")})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",f("Audio"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=q(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=C(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){M(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",fo);var Zl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Qf=(t,e,i)=>(Zl(t,e,"read from private field"),i?i.call(t):e.get(t)),Kl=(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)},Xf=(t,e,i,a)=>(Zl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Gl=(t,e,i)=>(Zl(t,e,"access private method"),i),Eo,Yl,Hm,vo,ql,Jf=`
2955
2959
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
2956
2960
  <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"/>
2957
- </svg>`,Wm=h.createElement("template");Wm.innerHTML=se.template.innerHTML+`
2958
- <slot name="captions-indicator" hidden>${Jf}</slot>`;var lr=class extends se{constructor(){super(...arguments),Yl(this,ql),Yl(this,bo),Yl(this,go,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_LIST&&i!==a?Gl(this,ql,$m).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Gl(this,bo,Zl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Gl(this,bo,Zl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:z(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Bm(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Hm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Bm(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Hm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};go=new WeakMap;ql=new WeakSet;$m=function(){var t;if(Qf(this,go)===JSON.stringify(this.mediaSubtitlesList))return;Xf(this,go,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let e=!this.value,i=tt({type:"radio",text:this.formatMenuItemText("Off"),value:"off",checked:e});i.prepend(Ue(this,"checked-indicator")),this.defaultSlot.append(i);let a=this.mediaSubtitlesList;for(let r of a){let n=tt({type:"radio",text:this.formatMenuItemText(r.label,r),value:Br(r),checked:this.value==Br(r)});n.prepend(Ue(this,"checked-indicator")),((t=r.kind)!=null?t:"subs")==="captions"&&n.append(Ue(this,"captions-indicator")),this.defaultSlot.append(n)}};bo=new WeakSet;Zl=function(){let t=this.mediaSubtitlesShowing,e=this.getAttribute(o.MEDIA_SUBTITLES_SHOWING),i=this.value!==e;if(t!=null&&t.length&&i&&this.dispatchEvent(new d.CustomEvent(p.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t})),!this.value||!i)return;let a=new d.CustomEvent(p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};lr.template=Wm;var Bm=(t,e)=>{let i=t.getAttribute(e);return i?Wt(i):[]},Hm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=ct(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",lr);var jf=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ev=(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)},tv=(t,e,i,a)=>(jf(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ql,iv=`<svg aria-hidden="true" viewBox="0 0 26 24">
2961
+ </svg>`,$m=h.createElement("template");$m.innerHTML=ne.template.innerHTML+`
2962
+ <slot name="captions-indicator" hidden>${Jf}</slot>`;var or=class extends ne{constructor(){super(...arguments),Kl(this,Yl),Kl(this,vo),Kl(this,Eo,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_LIST&&i!==a?Gl(this,Yl,Hm).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Gl(this,vo,ql))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Gl(this,vo,ql))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:q(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Um(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Bm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Um(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Bm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};Eo=new WeakMap;Yl=new WeakSet;Hm=function(){var t;if(Qf(this,Eo)===JSON.stringify(this.mediaSubtitlesList))return;Xf(this,Eo,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let e=!this.value,i=je({type:"radio",text:this.formatMenuItemText("Off"),value:"off",checked:e});i.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(i);let a=this.mediaSubtitlesList;for(let r of a){let n=je({type:"radio",text:this.formatMenuItemText(r.label,r),value:Pr(r),checked:this.value==Pr(r)});n.prepend(Ne(this,"checked-indicator")),((t=r.kind)!=null?t:"subs")==="captions"&&n.append(Ne(this,"captions-indicator")),this.defaultSlot.append(n)}};vo=new WeakSet;ql=function(){let t=this.mediaSubtitlesShowing,e=this.getAttribute(o.MEDIA_SUBTITLES_SHOWING),i=this.value!==e;if(t!=null&&t.length&&i&&this.dispatchEvent(new d.CustomEvent(p.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t})),!this.value||!i)return;let a=new d.CustomEvent(p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};or.template=$m;var Um=(t,e)=>{let i=t.getAttribute(e);return i?Ht(i):[]},Bm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=dt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",or);var jf=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ev=(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)},tv=(t,e,i,a)=>(jf(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),zl,iv=`<svg aria-hidden="true" viewBox="0 0 26 24">
2959
2963
  <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"/>
2960
2964
  </svg>`,av=`<svg aria-hidden="true" viewBox="0 0 26 24">
2961
2965
  <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"/>
2962
- </svg>`,Ym=h.createElement("template");Ym.innerHTML=`
2966
+ </svg>`,Km=h.createElement("template");Km.innerHTML=`
2963
2967
  <style>
2964
2968
  :host([aria-checked="true"]) slot[name=off] {
2965
2969
  display: none !important;
@@ -2979,7 +2983,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2979
2983
  <slot name="on">${iv}</slot>
2980
2984
  <slot name="off">${av}</slot>
2981
2985
  </slot>
2982
- `;var Fm=t=>{t.setAttribute("aria-checked",Hr(t).toString())},_o=class extends ge{constructor(e={}){super({slotTemplate:Ym,tooltipContent:D.CAPTIONS,...e}),ev(this,Ql,void 0),tv(this,Ql,!1)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",Y.CLOSED_CAPTIONS()),Fm(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_SHOWING&&Fm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=z(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Km(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Vm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Km(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Vm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};Ql=new WeakMap;var Km=(t,e)=>{let i=t.getAttribute(e);return i?Wt(i):[]},Vm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=ct(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",_o);var Gm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ao=(t,e,i)=>(Gm(t,e,"read from private field"),i?i.call(t):e.get(t)),Xl=(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)},dr=(t,e,i)=>(Gm(t,e,"access private method"),i),Qi,ur,To,yo,jl,Jl={RATES:"rates"},ko=class extends se{constructor(){super(),Xl(this,ur),Xl(this,yo),Xl(this,Qi,new $e(this,Jl.RATES,{defaultValue:Ns})),dr(this,ur,To).call(this)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Jl.RATES]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PLAYBACK_RATE&&i!=a?this.value=a:e===Jl.RATES&&i!=a&&(Ao(this,Qi).value=a,dr(this,ur,To).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",dr(this,yo,jl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",dr(this,yo,jl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:z(this).querySelector("media-playback-rate-menu-button")}get rates(){return Ao(this,Qi)}set rates(e){e?Array.isArray(e)&&(Ao(this,Qi).value=e.join(" ")):Ao(this,Qi).value="",dr(this,ur,To).call(this)}get mediaPlaybackRate(){return w(this,o.MEDIA_PLAYBACK_RATE,wi)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}};Qi=new WeakMap;ur=new WeakSet;To=function(){this.defaultSlot.textContent="";for(let t of this.rates){let e=tt({type:"radio",text:this.formatMenuItemText(`${t}x`,t),value:t,checked:this.mediaPlaybackRate==t});e.prepend(Ue(this,"checked-indicator")),this.defaultSlot.append(e)}};yo=new WeakSet;jl=function(){if(!this.value)return;let t=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-playback-rate-menu")||d.customElements.define("media-playback-rate-menu",ko);var rv=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},So=(t,e,i)=>(rv(t,e,"read from private field"),i?i.call(t):e.get(t)),nv=(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)},Xi,ed={RATES:"rates"},ov=[1,1.2,1.5,1.7,2],td=1,qm=h.createElement("template");qm.innerHTML=`
2986
+ `;var Wm=t=>{t.setAttribute("aria-checked",Ur(t).toString())},bo=class extends Ee{constructor(e={}){super({slotTemplate:Km,tooltipContent:f("Captions"),...e}),ev(this,zl,void 0),tv(this,zl,!1)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",f("closed captions")),Wm(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_SHOWING&&Wm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=q(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Fm(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Vm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Fm(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Vm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};zl=new WeakMap;var Fm=(t,e)=>{let i=t.getAttribute(e);return i?Ht(i):[]},Vm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=dt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",bo);var Gm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},go=(t,e,i)=>(Gm(t,e,"read from private field"),i?i.call(t):e.get(t)),Ql=(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)},sr=(t,e,i)=>(Gm(t,e,"access private method"),i),zi,lr,_o,Ao,Jl,Xl={RATES:"rates"},yo=class extends ne{constructor(){super(),Ql(this,lr),Ql(this,Ao),Ql(this,zi,new Be(this,Xl.RATES,{defaultValue:Os})),sr(this,lr,_o).call(this)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Xl.RATES]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PLAYBACK_RATE&&i!=a?this.value=a:e===Xl.RATES&&i!=a&&(go(this,zi).value=a,sr(this,lr,_o).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",sr(this,Ao,Jl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",sr(this,Ao,Jl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:q(this).querySelector("media-playback-rate-menu-button")}get rates(){return go(this,zi)}set rates(e){e?Array.isArray(e)&&(go(this,zi).value=e.join(" ")):go(this,zi).value="",sr(this,lr,_o).call(this)}get mediaPlaybackRate(){return x(this,o.MEDIA_PLAYBACK_RATE,Ri)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}};zi=new WeakMap;lr=new WeakSet;_o=function(){this.defaultSlot.textContent="";for(let t of this.rates){let e=je({type:"radio",text:this.formatMenuItemText(`${t}x`,t),value:t,checked:this.mediaPlaybackRate==t});e.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(e)}};Ao=new WeakSet;Jl=function(){if(!this.value)return;let t=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-playback-rate-menu")||d.customElements.define("media-playback-rate-menu",yo);var rv=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},To=(t,e,i)=>(rv(t,e,"read from private field"),i?i.call(t):e.get(t)),nv=(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)},Qi,jl={RATES:"rates"},ov=[1,1.2,1.5,1.7,2],ed=1,Ym=h.createElement("template");Ym.innerHTML=`
2983
2987
  <style>
2984
2988
  :host {
2985
2989
  min-width: 5ch;
@@ -2991,16 +2995,16 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2991
2995
  }
2992
2996
  </style>
2993
2997
  <slot name="icon"></slot>
2994
- `;var Io=class extends ge{constructor(e={}){super({slotTemplate:qm,tooltipContent:D.PLAYBACK_RATE,...e}),nv(this,Xi,new $e(this,ed.RATES,{defaultValue:ov})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${td}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,ed.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===ed.RATES&&(So(this,Xi).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?td:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",Y.PLAYBACK_RATE({playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:z(this).querySelector("media-playback-rate-menu")}get rates(){return So(this,Xi)}set rates(e){e?Array.isArray(e)&&(So(this,Xi).value=e.join(" ")):So(this,Xi).value=""}get mediaPlaybackRate(){return w(this,o.MEDIA_PLAYBACK_RATE,td)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}};Xi=new WeakMap;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",Io);var ad=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},cr=(t,e,i)=>(ad(t,e,"read from private field"),i?i.call(t):e.get(t)),Co=(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)},Zm=(t,e,i,a)=>(ad(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ji=(t,e,i)=>(ad(t,e,"access private method"),i),mr,ea,ji,hr,Mo,id,Ro=class extends se{constructor(){super(...arguments),Co(this,ji),Co(this,Mo),Co(this,mr,[]),Co(this,ea,{})}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_LIST,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_RENDITION_SELECTED&&i!==a?(this.value=a!=null?a:"auto",Ji(this,ji,hr).call(this)):e===o.MEDIA_RENDITION_LIST&&i!==a?(Zm(this,mr,Bd(a)),Ji(this,ji,hr).call(this)):e===o.MEDIA_HEIGHT&&i!==a&&Ji(this,ji,hr).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Ji(this,Mo,id))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Ji(this,Mo,id))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:z(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return cr(this,mr)}set mediaRenditionList(e){Zm(this,mr,e),Ji(this,ji,hr).call(this)}get mediaRenditionSelected(){return I(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){C(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return w(this,o.MEDIA_HEIGHT)}set mediaHeight(e){O(this,o.MEDIA_HEIGHT,e)}};mr=new WeakMap;ea=new WeakMap;ji=new WeakSet;hr=function(){if(cr(this,ea).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&cr(this,ea).mediaHeight===this.mediaHeight)return;cr(this,ea).mediaRenditionList=JSON.stringify(this.mediaRenditionList),cr(this,ea).mediaHeight=this.mediaHeight;let t=this.mediaRenditionList.sort((n,s)=>s.height-n.height);for(let n of t)n.selected=n.id===this.mediaRenditionSelected;this.defaultSlot.textContent="";let e=!this.mediaRenditionSelected;for(let n of t){let s=this.formatMenuItemText(`${Math.min(n.width,n.height)}p`,n),l=tt({type:"radio",text:s,value:`${n.id}`,checked:n.selected&&!e});l.prepend(Ue(this,"checked-indicator")),this.defaultSlot.append(l)}let i=e?this.formatMenuItemText(`Auto (${this.mediaHeight}p)`):this.formatMenuItemText("Auto"),a=tt({type:"radio",text:i,value:"auto",checked:e}),r=this.mediaHeight>0?`Auto (${this.mediaHeight}p)`:"Auto";a.dataset.description=r,a.prepend(Ue(this,"checked-indicator")),this.defaultSlot.append(a)};Mo=new WeakSet;id=function(){if(this.value==null)return;let t=new d.CustomEvent(p.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",Ro);var sv=`<svg aria-hidden="true" viewBox="0 0 24 24">
2998
+ `;var ko=class extends Ee{constructor(e={}){super({slotTemplate:Ym,tooltipContent:f("Playback rate"),...e}),nv(this,Qi,new Be(this,jl.RATES,{defaultValue:ov})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${ed}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,jl.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===jl.RATES&&(To(this,Qi).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?ed:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",f("Playback rate {playbackRate}",{playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:q(this).querySelector("media-playback-rate-menu")}get rates(){return To(this,Qi)}set rates(e){e?Array.isArray(e)&&(To(this,Qi).value=e.join(" ")):To(this,Qi).value=""}get mediaPlaybackRate(){return x(this,o.MEDIA_PLAYBACK_RATE,ed)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}};Qi=new WeakMap;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",ko);var id=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},dr=(t,e,i)=>(id(t,e,"read from private field"),i?i.call(t):e.get(t)),So=(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)},qm=(t,e,i,a)=>(id(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Xi=(t,e,i)=>(id(t,e,"access private method"),i),ur,ji,Ji,cr,Io,td,Co=class extends ne{constructor(){super(...arguments),So(this,Ji),So(this,Io),So(this,ur,[]),So(this,ji,{})}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_LIST,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_RENDITION_SELECTED&&i!==a?(this.value=a!=null?a:"auto",Xi(this,Ji,cr).call(this)):e===o.MEDIA_RENDITION_LIST&&i!==a?(qm(this,ur,Ud(a)),Xi(this,Ji,cr).call(this)):e===o.MEDIA_HEIGHT&&i!==a&&Xi(this,Ji,cr).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Xi(this,Io,td))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Xi(this,Io,td))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:q(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return dr(this,ur)}set mediaRenditionList(e){qm(this,ur,e),Xi(this,Ji,cr).call(this)}get mediaRenditionSelected(){return C(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return x(this,o.MEDIA_HEIGHT)}set mediaHeight(e){O(this,o.MEDIA_HEIGHT,e)}};ur=new WeakMap;ji=new WeakMap;Ji=new WeakSet;cr=function(){if(dr(this,ji).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&dr(this,ji).mediaHeight===this.mediaHeight)return;dr(this,ji).mediaRenditionList=JSON.stringify(this.mediaRenditionList),dr(this,ji).mediaHeight=this.mediaHeight;let t=this.mediaRenditionList.sort((n,s)=>s.height-n.height);for(let n of t)n.selected=n.id===this.mediaRenditionSelected;this.defaultSlot.textContent="";let e=!this.mediaRenditionSelected;for(let n of t){let s=this.formatMenuItemText(`${Math.min(n.width,n.height)}p`,n),l=je({type:"radio",text:s,value:`${n.id}`,checked:n.selected&&!e});l.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(l)}let i=e?this.formatMenuItemText(`Auto (${this.mediaHeight}p)`):this.formatMenuItemText("Auto"),a=je({type:"radio",text:i,value:"auto",checked:e}),r=this.mediaHeight>0?`Auto (${this.mediaHeight}p)`:"Auto";a.dataset.description=r,a.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(a)};Io=new WeakSet;td=function(){if(this.value==null)return;let t=new d.CustomEvent(p.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",Co);var sv=`<svg aria-hidden="true" viewBox="0 0 24 24">
2995
2999
  <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" />
2996
- </svg>`,zm=h.createElement("template");zm.innerHTML=`
3000
+ </svg>`,Zm=h.createElement("template");Zm.innerHTML=`
2997
3001
  <style>
2998
3002
  :host([aria-expanded="true"]) slot[name=tooltip] {
2999
3003
  display: none;
3000
3004
  }
3001
3005
  </style>
3002
3006
  <slot name="icon">${sv}</slot>
3003
- `;var Lo=class extends ge{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}constructor(){super({slotTemplate:zm,tooltipContent:D.RENDITIONS})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",Y.QUALITY())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:z(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return I(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){C(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return w(this,o.MEDIA_HEIGHT)}set mediaHeight(e){O(this,o.MEDIA_HEIGHT,e)}};d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",Lo);var rd=Ei.createElement("template");"innerHTML"in rd&&(rd.innerHTML=hm);var Qm,Xm,wo=class extends di{};wo.template=(Xm=(Qm=rd.content)==null?void 0:Qm.children)==null?void 0:Xm[0];fe.customElements.get("media-theme-gerwig")||fe.customElements.define("media-theme-gerwig",wo);var lv="gerwig";var bt={SRC:"src",POSTER:"poster"},m={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",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",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",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge"},nd=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref","proudlydisplaymuxbadge"];function dv(t,e){var a;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(m.STORYBOARD_SRC),placeholder:t.getAttribute("placeholder"),themeTemplate:cv(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(m.NOHOTKEYS),hotKeys:t.getAttribute(m.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(E.Attributes.TARGET_LIVE_WINDOW),streamType:Wa(t.getAttribute(E.Attributes.STREAM_TYPE)),primaryColor:t.getAttribute(m.PRIMARY_COLOR),secondaryColor:t.getAttribute(m.SECONDARY_COLOR),accentColor:t.getAttribute(m.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:mv(t),playbackRates:t.getAttribute(m.PLAYBACK_RATES),customDomain:(a=t.getAttribute(E.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:t.getAttribute(m.TITLE),novolumepref:t.hasAttribute(m.NO_VOLUME_PREF),castReceiver:t.castReceiver,proudlyDisplayMuxBadge:t.hasAttribute(m.PROUDLY_DISPLAY_MUX_BADGE),...e,extraSourceParams:t.extraSourceParams}}var uv=pn.formatErrorMessage;pn.formatErrorMessage=t=>{var e,i;if(t instanceof E.MediaError){let a=mm(t,!1);return`
3007
+ `;var Mo=class extends Ee{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}constructor(){super({slotTemplate:Zm,tooltipContent:f("Quality")})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",f("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:q(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return C(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return x(this,o.MEDIA_HEIGHT)}set mediaHeight(e){O(this,o.MEDIA_HEIGHT,e)}};d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",Mo);var ad=fi.createElement("template");"innerHTML"in ad&&(ad.innerHTML=mm);var zm,Qm,wo=class extends si{};wo.template=(Qm=(zm=ad.content)==null?void 0:zm.children)==null?void 0:Qm[0];he.customElements.get("media-theme-gerwig")||he.customElements.define("media-theme-gerwig",wo);var lv="gerwig";var vt={SRC:"src",POSTER:"poster"},m={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",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",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",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge"},rd=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref","proudlydisplaymuxbadge"];function dv(t,e){var a;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(m.STORYBOARD_SRC),placeholder:t.getAttribute("placeholder"),themeTemplate:cv(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(m.NOHOTKEYS),hotKeys:t.getAttribute(m.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(b.Attributes.TARGET_LIVE_WINDOW),streamType:Ha(t.getAttribute(b.Attributes.STREAM_TYPE)),primaryColor:t.getAttribute(m.PRIMARY_COLOR),secondaryColor:t.getAttribute(m.SECONDARY_COLOR),accentColor:t.getAttribute(m.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:mv(t),playbackRates:t.getAttribute(m.PLAYBACK_RATES),customDomain:(a=t.getAttribute(b.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:t.getAttribute(m.TITLE),novolumepref:t.hasAttribute(m.NO_VOLUME_PREF),castReceiver:t.castReceiver,proudlyDisplayMuxBadge:t.hasAttribute(m.PROUDLY_DISPLAY_MUX_BADGE),...e,extraSourceParams:t.extraSourceParams}}var uv=mn.formatErrorMessage;mn.formatErrorMessage=t=>{var e,i;if(t instanceof b.MediaError){let a=cm(t,!1);return`
3004
3008
  ${a!=null&&a.title?`<h3>${a.title}</h3>`:""}
3005
3009
  ${a!=null&&a.message||a!=null&&a.linkUrl?`<p>
3006
3010
  ${a==null?void 0:a.message}
@@ -3012,5 +3016,5 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3012
3016
  >${(i=a.linkText)!=null?i:a.linkUrl}</a
3013
3017
  >`:""}
3014
3018
  </p>`:""}
3015
- `}return uv(t)};function cv(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 n=fe.customElements.get(e);if(n!=null&&n.template)return n.template}}function mv(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 Jm(t){let e=t.hasAttribute(m.TITLE)?{video_title:t.getAttribute(m.TITLE)}:{};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 hv=Object.values(E.Attributes),pv=Object.values(bt),fv=Object.values(m),od=Wn(),sd="mux-player",jm={isDialogOpen:!1},vv={redundant_streams:!0},fr,vr,Er,Pt,br,pi,$,Ot,eh,ld,hi,th,ih,ah,rh,pr=class extends ol{constructor(){super();pe(this,$);pe(this,fr);pe(this,vr,!1);pe(this,Er,{});pe(this,Pt,!0);pe(this,br,new $n(this,"hotkeys"));pe(this,pi,{...jm,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&J(this,$,ld).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var n;if(((n=i.composedPath()[0])==null?void 0:n.localName)!=="media-error-dialog")return;al(this,Ei.activeElement)||i.preventDefault()}});ye(this,fr,(0,L.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),J(this,$,eh).call(this),this.isConnected&&J(this,$,Ot).call(this)}static get NAME(){return sd}static get VERSION(){return od}static get observedAttributes(){var i;return[...(i=ol.observedAttributes)!=null?i:[],...pv,...hv,...fv]}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(){var a;let i=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");i&&(i.metadata=Jm(this))}attributeChangedCallback(i,a,r){switch(J(this,$,Ot).call(this),super.attributeChangedCallback(i,a,r),i){case m.HOTKEYS:B(this,br).value=r;break;case m.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Xe((0,L.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time."));break}case m.THUMBNAIL_TOKEN:{if(r){let s=(0,L.parseJwt)(r);if(s){let{aud:l}=s,u=L.MuxJWTAud.THUMBNAIL;l!==u&&Xe((0,L.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case m.STORYBOARD_TOKEN:{if(r){let s=(0,L.parseJwt)(r);if(s){let{aud:l}=s,u=L.MuxJWTAud.STORYBOARD;l!==u&&Xe((0,L.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case m.DRM_TOKEN:{if(r){let s=(0,L.parseJwt)(r);if(s){let{aud:l}=s,u=L.MuxJWTAud.DRM;l!==u&&Xe((0,L.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case E.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&be((0,L.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case E.Attributes.STREAM_TYPE:r&&![L.StreamTypes.LIVE,L.StreamTypes.ON_DEMAND,L.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:rl({file:"invalid-stream-type.md",message:(0,L.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===L.StreamTypes.LIVE?this.getAttribute(m.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[E.Attributes.PLAYBACK_ID,bt.SRC,m.PLAYBACK_TOKEN].includes(i)&&a!==r&&ye(this,pi,{...B(this,pi),...jm}),J(this,$,hi).call(this,{[Fc(i)]:r})}get preferCmcd(){var i;return(i=this.getAttribute(E.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?L.CmcdTypeValues.includes(i)?this.setAttribute(E.Attributes.PREFER_CMCD,i):Xe(`Invalid value for preferCmcd. Must be one of ${L.CmcdTypeValues.join()}`):this.removeAttribute(E.Attributes.PREFER_CMCD))}get hasPlayed(){var i,a;return(a=(i=this.mediaController)==null?void 0:i.hasAttribute(o.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var i;return(i=this.mediaController)==null?void 0:i.hasAttribute(o.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(m.THEME))!=null?i:lv}set theme(i){this.setAttribute(m.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(nd.includes(r))continue;let n=i.getAttribute(r);a[Hn(r)]=n===""?!0:n}return a}set themeProps(i){var r,n;J(this,$,Ot).call(this);let a={...this.themeProps,...i};for(let s in a){if(nd.includes(s))continue;let l=i==null?void 0:i[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(Bn(s),!!l):(n=this.mediaTheme)==null||n.setAttribute(Bn(s),l)}}get playbackId(){var i;return(i=this.getAttribute(E.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(E.Attributes.PLAYBACK_ID,i):this.removeAttribute(E.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Nt(this,bt.SRC))!=null?i:void 0:(a=this.getAttribute(bt.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(bt.SRC,i):this.removeAttribute(bt.SRC)}get poster(){var r;let i=this.getAttribute(bt.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){Xe("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return $c(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(bt.POSTER,i):this.removeAttribute(bt.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(m.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(m.STORYBOARD_SRC,i):this.removeAttribute(m.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[L.StreamTypes.LIVE,L.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return Wc(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(m.AUDIO)}set audio(i){if(!i){this.removeAttribute(m.AUDIO);return}this.setAttribute(m.AUDIO,"")}get hotkeys(){return B(this,br)}get nohotkeys(){return this.hasAttribute(m.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(m.NOHOTKEYS);return}this.setAttribute(m.NOHOTKEYS,"")}get thumbnailTime(){return ce(this.getAttribute(m.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(m.THUMBNAIL_TIME,`${i}`)}get title(){var i;return(i=this.getAttribute(m.TITLE))!=null?i:""}set title(i){i!==this.title&&(i?this.setAttribute(m.TITLE,i):this.removeAttribute("title"),super.title=i)}get placeholder(){var i;return(i=Nt(this,m.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(m.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(m.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=fe.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(m.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(m.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=fe.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(m.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(m.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=fe.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(m.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(m.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(m.PLAYBACK_RATES))return this.getAttribute(m.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(m.PLAYBACK_RATES);return}this.setAttribute(m.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=ce(this.getAttribute(m.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(m.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=ce(this.getAttribute(m.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(m.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(m.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return ce(this.getAttribute(m.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(m.DEFAULT_DURATION):this.setAttribute(m.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(E.Attributes.PLAYER_INIT_TIME)?ce(this.getAttribute(E.Attributes.PLAYER_INIT_TIME)):B(this,fr)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(E.Attributes.PLAYER_INIT_TIME):this.setAttribute(E.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:sd}get playerSoftwareVersion(){var i;return(i=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:od}get beaconCollectionDomain(){var i;return(i=this.getAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(E.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(E.Attributes.MAX_RESOLUTION,i):this.removeAttribute(E.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(E.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(E.Attributes.MIN_RESOLUTION,i):this.removeAttribute(E.Attributes.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(E.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(E.Attributes.RENDITION_ORDER,i):this.removeAttribute(E.Attributes.RENDITION_ORDER))}get programStartTime(){return ce(this.getAttribute(E.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(E.Attributes.PROGRAM_START_TIME):this.setAttribute(E.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return ce(this.getAttribute(E.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(E.Attributes.PROGRAM_END_TIME):this.setAttribute(E.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return ce(this.getAttribute(E.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(E.Attributes.ASSET_START_TIME):this.setAttribute(E.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return ce(this.getAttribute(E.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(E.Attributes.ASSET_END_TIME):this.setAttribute(E.Attributes.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(m.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(m.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):vv}set extraSourceParams(i){i==null?this.removeAttribute(m.EXTRA_SOURCE_PARAMS):this.setAttribute(m.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(E.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(E.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(E.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Nt(this,E.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(E.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(m.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(m.NO_VOLUME_PREF,""):this.removeAttribute(m.NO_VOLUME_PREF)}get debug(){return Nt(this,E.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(E.Attributes.DEBUG,""):this.removeAttribute(E.Attributes.DEBUG)}get disableTracking(){return Nt(this,E.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(E.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Nt(this,E.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(E.Attributes.DISABLE_COOKIES,""):this.removeAttribute(E.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(E.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:L.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(E.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?r:L.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(m.DEFAULT_STREAM_TYPE,i):this.removeAttribute(m.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(m.TARGET_LIVE_WINDOW)?+this.getAttribute(m.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(m.TARGET_LIVE_WINDOW):this.setAttribute(m.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return ce(Nt(this,E.Attributes.START_TIME))}set startTime(i){this.setAttribute(E.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(E.Attributes.PREFER_PLAYBACK);if(i===L.PlaybackTypes.MSE||i===L.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===L.PlaybackTypes.MSE||i===L.PlaybackTypes.NATIVE?this.setAttribute(E.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(E.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(J(this,$,Ot).call(this),!this.media){be("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Jm(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(J(this,$,Ot).call(this),!this.media){be("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(J(this,$,Ot).call(this),!this.media){be("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(J(this,$,Ot).call(this),!this.media){be("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(m.PLAYBACK_TOKEN),a=this.getAttribute(m.DRM_TOKEN),r=this.getAttribute(m.THUMBNAIL_TOKEN),n=this.getAttribute(m.STORYBOARD_TOKEN);return{...B(this,Er),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...n!=null?{storyboard:n}:{}}}set tokens(i){ye(this,Er,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(m.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(m.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(m.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(m.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(m.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(m.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(m.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(m.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(s)return(0,L.addTextTrack)(s,i,a,r,n)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,L.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(m.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(m.CAST_RECEIVER,i):this.removeAttribute(m.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){be("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(m.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(m.NO_TOOLTIPS);return}this.setAttribute(m.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(m.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}};fr=new WeakMap,vr=new WeakMap,Er=new WeakMap,Pt=new WeakMap,br=new WeakMap,pi=new WeakMap,$=new WeakSet,Ot=function(){var i,a,r,n;if(!B(this,vr)){ye(this,vr,!0),J(this,$,hi).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof fe.HTMLElement))throw""}catch{be("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof E.default))throw""}catch{be("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof as))throw""}catch{be("<media-controller> failed to upgrade!")}this.init(),J(this,$,th).call(this),J(this,$,ih).call(this),J(this,$,ah).call(this),ye(this,Pt,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(S.USER_INACTIVE))!=null?a:!0),J(this,$,rh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>J(this,$,hi).call(this)),(n=this.media)==null||n.addEventListener("loadstart",()=>J(this,$,hi).call(this))}},eh=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{}},ld=function(i){Object.assign(B(this,pi),i),J(this,$,hi).call(this)},hi=function(i={}){dm(um(dv(this,{...B(this,pi),...i})),this.shadowRoot)},th=function(){let i=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(nd.includes(n))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(n,s):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)i(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},ih=function(){var a;let i=r=>{let{detail:n}=r;if(n instanceof E.MediaError||(n=new E.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Xe(n),n.data&&Xe(`${n.name} data:`,n.data);return}let s=El(n,!1);s.message&&rl(s),be(n),n.data&&be(`${n.name} data:`,n.data),J(this,$,ld).call(this,{isDialogOpen:!0})};this.addEventListener("error",i),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,u;if(!(((s=this.media)==null?void 0:s.error)instanceof E.MediaError))return r;let n=El((l=this.media)==null?void 0:l.error,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:u,code:c}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new E.MediaError(u,c)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},ah=function(){var a,r,n,s;let i=()=>J(this,$,hi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",i),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",i)},rh=function(){var c,_;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===L.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(g,f,v=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(A=>{if(!(!A.snapToLines||A.line<-5||A.line>=0&&A.line<10))if(!f||this.paused){let M=A.text.split(`
3016
- `).length,U=-3;this.streamType===L.StreamTypes.LIVE&&(U=-2);let ee=U-M;if(A.line===ee&&!v)return;r.has(A)||r.set(A,A.line),A.line=ee}else setTimeout(()=>{A.line=r.get(A)||"auto"},500)})},l=()=>{var g,f;s(a,(f=(g=this.mediaController)==null?void 0:g.hasAttribute(S.USER_INACTIVE))!=null?f:!1)},u=()=>{var v,P;let f=Array.from(((P=(v=this.mediaController)==null?void 0:v.media)==null?void 0:P.textTracks)||[]).filter(A=>["subtitles","captions"].includes(A.kind)&&A.mode==="showing")[0];f!==a&&(a==null||a.removeEventListener("cuechange",l)),a=f,a==null||a.addEventListener("cuechange",l),s(a,B(this,Pt))};u(),(c=this.textTracks)==null||c.addEventListener("change",u),(_=this.textTracks)==null||_.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var f,v;let g=(v=(f=this.mediaController)==null?void 0:f.hasAttribute(S.USER_INACTIVE))!=null?v:!0;B(this,Pt)!==g&&(ye(this,Pt,g),s(a,B(this,Pt)))})};function Nt(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}fe.customElements.get("mux-player")||(fe.customElements.define("mux-player",pr),fe.MuxPlayerElement=pr);var Ev=pr;
3019
+ `}return uv(t)};function cv(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 n=he.customElements.get(e);if(n!=null&&n.template)return n.template}}function mv(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 Xm(t){let e=t.hasAttribute(m.TITLE)?{video_title:t.getAttribute(m.TITLE)}:{};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 hv=Object.values(b.Attributes),pv=Object.values(vt),fv=Object.values(m),nd=Hn(),od="mux-player",Jm={isDialogOpen:!1},vv={redundant_streams:!0},hr,pr,fr,Ot,vr,mi,$,xt,jm,sd,ci,eh,th,ih,ah,mr=class extends nl{constructor(){super();me(this,$);me(this,hr);me(this,pr,!1);me(this,fr,{});me(this,Ot,!0);me(this,vr,new Bn(this,"hotkeys"));me(this,mi,{...Jm,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&Q(this,$,sd).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var n;if(((n=i.composedPath()[0])==null?void 0:n.localName)!=="media-error-dialog")return;il(this,fi.activeElement)||i.preventDefault()}});Ae(this,hr,(0,L.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),Q(this,$,jm).call(this),this.isConnected&&Q(this,$,xt).call(this)}static get NAME(){return od}static get VERSION(){return nd}static get observedAttributes(){var i;return[...(i=nl.observedAttributes)!=null?i:[],...pv,...hv,...fv]}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(){var a;let i=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");i&&(i.metadata=Xm(this))}attributeChangedCallback(i,a,r){switch(Q(this,$,xt).call(this),super.attributeChangedCallback(i,a,r),i){case m.HOTKEYS:B(this,vr).value=r;break;case m.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&ze((0,L.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time."));break}case m.THUMBNAIL_TOKEN:{if(r){let s=(0,L.parseJwt)(r);if(s){let{aud:l}=s,u=L.MuxJWTAud.THUMBNAIL;l!==u&&ze((0,L.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case m.STORYBOARD_TOKEN:{if(r){let s=(0,L.parseJwt)(r);if(s){let{aud:l}=s,u=L.MuxJWTAud.STORYBOARD;l!==u&&ze((0,L.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case m.DRM_TOKEN:{if(r){let s=(0,L.parseJwt)(r);if(s){let{aud:l}=s,u=L.MuxJWTAud.DRM;l!==u&&ze((0,L.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case b.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&ve((0,L.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case b.Attributes.STREAM_TYPE:r&&![L.StreamTypes.LIVE,L.StreamTypes.ON_DEMAND,L.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:al({file:"invalid-stream-type.md",message:(0,L.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===L.StreamTypes.LIVE?this.getAttribute(m.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[b.Attributes.PLAYBACK_ID,vt.SRC,m.PLAYBACK_TOKEN].includes(i)&&a!==r&&Ae(this,mi,{...B(this,mi),...Jm}),Q(this,$,ci).call(this,{[Wc(i)]:r})}get preferCmcd(){var i;return(i=this.getAttribute(b.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?L.CmcdTypeValues.includes(i)?this.setAttribute(b.Attributes.PREFER_CMCD,i):ze(`Invalid value for preferCmcd. Must be one of ${L.CmcdTypeValues.join()}`):this.removeAttribute(b.Attributes.PREFER_CMCD))}get hasPlayed(){var i,a;return(a=(i=this.mediaController)==null?void 0:i.hasAttribute(o.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var i;return(i=this.mediaController)==null?void 0:i.hasAttribute(o.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(m.THEME))!=null?i:lv}set theme(i){this.setAttribute(m.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(rd.includes(r))continue;let n=i.getAttribute(r);a[Un(r)]=n===""?!0:n}return a}set themeProps(i){var r,n;Q(this,$,xt).call(this);let a={...this.themeProps,...i};for(let s in a){if(rd.includes(s))continue;let l=i==null?void 0:i[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(Pn(s),!!l):(n=this.mediaTheme)==null||n.setAttribute(Pn(s),l)}}get playbackId(){var i;return(i=this.getAttribute(b.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(b.Attributes.PLAYBACK_ID,i):this.removeAttribute(b.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Dt(this,vt.SRC))!=null?i:void 0:(a=this.getAttribute(vt.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(vt.SRC,i):this.removeAttribute(vt.SRC)}get poster(){var r;let i=this.getAttribute(vt.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){ze("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return Hc(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(vt.POSTER,i):this.removeAttribute(vt.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(m.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(m.STORYBOARD_SRC,i):this.removeAttribute(m.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[L.StreamTypes.LIVE,L.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return $c(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(m.AUDIO)}set audio(i){if(!i){this.removeAttribute(m.AUDIO);return}this.setAttribute(m.AUDIO,"")}get hotkeys(){return B(this,vr)}get nohotkeys(){return this.hasAttribute(m.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(m.NOHOTKEYS);return}this.setAttribute(m.NOHOTKEYS,"")}get thumbnailTime(){return de(this.getAttribute(m.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(m.THUMBNAIL_TIME,`${i}`)}get title(){var i;return(i=this.getAttribute(m.TITLE))!=null?i:""}set title(i){i!==this.title&&(i?this.setAttribute(m.TITLE,i):this.removeAttribute("title"),super.title=i)}get placeholder(){var i;return(i=Dt(this,m.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(m.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(m.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=he.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(m.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(m.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=he.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(m.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(m.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=he.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(m.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(m.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(m.PLAYBACK_RATES))return this.getAttribute(m.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(m.PLAYBACK_RATES);return}this.setAttribute(m.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=de(this.getAttribute(m.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(m.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=de(this.getAttribute(m.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(m.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(m.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return de(this.getAttribute(m.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(m.DEFAULT_DURATION):this.setAttribute(m.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(b.Attributes.PLAYER_INIT_TIME)?de(this.getAttribute(b.Attributes.PLAYER_INIT_TIME)):B(this,hr)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(b.Attributes.PLAYER_INIT_TIME):this.setAttribute(b.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:od}get playerSoftwareVersion(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:nd}get beaconCollectionDomain(){var i;return(i=this.getAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(b.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(b.Attributes.MAX_RESOLUTION,i):this.removeAttribute(b.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(b.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(b.Attributes.MIN_RESOLUTION,i):this.removeAttribute(b.Attributes.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(b.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(b.Attributes.RENDITION_ORDER,i):this.removeAttribute(b.Attributes.RENDITION_ORDER))}get programStartTime(){return de(this.getAttribute(b.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(b.Attributes.PROGRAM_START_TIME):this.setAttribute(b.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return de(this.getAttribute(b.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(b.Attributes.PROGRAM_END_TIME):this.setAttribute(b.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return de(this.getAttribute(b.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(b.Attributes.ASSET_START_TIME):this.setAttribute(b.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return de(this.getAttribute(b.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(b.Attributes.ASSET_END_TIME):this.setAttribute(b.Attributes.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(m.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(m.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):vv}set extraSourceParams(i){i==null?this.removeAttribute(m.EXTRA_SOURCE_PARAMS):this.setAttribute(m.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(b.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(b.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(b.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Dt(this,b.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(b.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(m.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(m.NO_VOLUME_PREF,""):this.removeAttribute(m.NO_VOLUME_PREF)}get debug(){return Dt(this,b.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(b.Attributes.DEBUG,""):this.removeAttribute(b.Attributes.DEBUG)}get disableTracking(){return Dt(this,b.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(b.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Dt(this,b.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(b.Attributes.DISABLE_COOKIES,""):this.removeAttribute(b.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(b.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:L.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(b.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?r:L.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(m.DEFAULT_STREAM_TYPE,i):this.removeAttribute(m.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(m.TARGET_LIVE_WINDOW)?+this.getAttribute(m.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(m.TARGET_LIVE_WINDOW):this.setAttribute(m.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return de(Dt(this,b.Attributes.START_TIME))}set startTime(i){this.setAttribute(b.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(b.Attributes.PREFER_PLAYBACK);if(i===L.PlaybackTypes.MSE||i===L.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===L.PlaybackTypes.MSE||i===L.PlaybackTypes.NATIVE?this.setAttribute(b.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(b.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(Q(this,$,xt).call(this),!this.media){ve("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Xm(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(Q(this,$,xt).call(this),!this.media){ve("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(Q(this,$,xt).call(this),!this.media){ve("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(Q(this,$,xt).call(this),!this.media){ve("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(m.PLAYBACK_TOKEN),a=this.getAttribute(m.DRM_TOKEN),r=this.getAttribute(m.THUMBNAIL_TOKEN),n=this.getAttribute(m.STORYBOARD_TOKEN);return{...B(this,fr),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...n!=null?{storyboard:n}:{}}}set tokens(i){Ae(this,fr,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(m.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(m.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(m.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(m.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(m.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(m.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(m.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(m.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(s)return(0,L.addTextTrack)(s,i,a,r,n)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,L.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(m.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(m.CAST_RECEIVER,i):this.removeAttribute(m.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){ve("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(m.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(m.NO_TOOLTIPS);return}this.setAttribute(m.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(m.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}};hr=new WeakMap,pr=new WeakMap,fr=new WeakMap,Ot=new WeakMap,vr=new WeakMap,mi=new WeakMap,$=new WeakSet,xt=function(){var i,a,r,n;if(!B(this,pr)){Ae(this,pr,!0),Q(this,$,ci).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof he.HTMLElement))throw""}catch{ve("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof b.default))throw""}catch{ve("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ts))throw""}catch{ve("<media-controller> failed to upgrade!")}this.init(),Q(this,$,eh).call(this),Q(this,$,th).call(this),Q(this,$,ih).call(this),Ae(this,Ot,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(I.USER_INACTIVE))!=null?a:!0),Q(this,$,ah).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>Q(this,$,ci).call(this)),(n=this.media)==null||n.addEventListener("loadstart",()=>Q(this,$,ci).call(this))}},jm=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{}},sd=function(i){Object.assign(B(this,mi),i),Q(this,$,ci).call(this)},ci=function(i={}){lm(dm(dv(this,{...B(this,mi),...i})),this.shadowRoot)},eh=function(){let i=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(rd.includes(n))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(n,s):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)i(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},th=function(){var a;let i=r=>{let{detail:n}=r;if(n instanceof b.MediaError||(n=new b.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){ze(n),n.data&&ze(`${n.name} data:`,n.data);return}let s=vl(n,!1);s.message&&al(s),ve(n),n.data&&ve(`${n.name} data:`,n.data),Q(this,$,sd).call(this,{isDialogOpen:!0})};this.addEventListener("error",i),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,u;if(!(((s=this.media)==null?void 0:s.error)instanceof b.MediaError))return r;let n=vl((l=this.media)==null?void 0:l.error,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:u,code:c}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new b.MediaError(u,c)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},ih=function(){var a,r,n,s;let i=()=>Q(this,$,ci).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",i),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",i)},ah=function(){var c,A;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===L.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(_,v,E=!1)=>{if(n())return;Array.from(_&&_.activeCues||[]).forEach(y=>{if(!(!y.snapToLines||y.line<-5||y.line>=0&&y.line<10))if(!v||this.paused){let w=y.text.split(`
3020
+ `).length,U=-3;this.streamType===L.StreamTypes.LIVE&&(U=-2);let J=U-w;if(y.line===J&&!E)return;r.has(y)||r.set(y,y.line),y.line=J}else setTimeout(()=>{y.line=r.get(y)||"auto"},500)})},l=()=>{var _,v;s(a,(v=(_=this.mediaController)==null?void 0:_.hasAttribute(I.USER_INACTIVE))!=null?v:!1)},u=()=>{var E,P;let v=Array.from(((P=(E=this.mediaController)==null?void 0:E.media)==null?void 0:P.textTracks)||[]).filter(y=>["subtitles","captions"].includes(y.kind)&&y.mode==="showing")[0];v!==a&&(a==null||a.removeEventListener("cuechange",l)),a=v,a==null||a.addEventListener("cuechange",l),s(a,B(this,Ot))};u(),(c=this.textTracks)==null||c.addEventListener("change",u),(A=this.textTracks)==null||A.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var v,E;let _=(E=(v=this.mediaController)==null?void 0:v.hasAttribute(I.USER_INACTIVE))!=null?E:!0;B(this,Ot)!==_&&(Ae(this,Ot,_),s(a,B(this,Ot)))})};function Dt(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}he.customElements.get("mux-player")||(he.customElements.define("mux-player",mr),he.MuxPlayerElement=mr);var Ev=mr;