@mux/mux-player 3.10.2 → 3.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.cjs.js +74 -73
- package/dist/base.mjs +23 -22
- package/dist/mux-player.js +168 -167
- package/dist/mux-player.mjs +168 -167
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/base.d.ts +2 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types-ts3.4/base.d.ts +1 -0
- package/dist/types-ts3.4/types.d.ts +1 -0
- package/package.json +3 -3
package/dist/base.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var Ls=Object.defineProperty;var bh=Object.getOwnPropertyDescriptor;var gh=Object.getOwnPropertyNames;var _h=Object.prototype.hasOwnProperty;var su=t=>{throw TypeError(t)};var Ah=(t,e)=>{for(var i in e)Ls(t,i,{get:e[i],enumerable:!0})},Th=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of gh(e))!_h.call(t,r)&&r!==i&&Ls(t,r,{get:()=>e[r],enumerable:!(a=bh(e,r))||a.enumerable});return t};var yh=t=>Th(Ls({},"__esModule",{value:!0}),t);var ws=(t,e,i)=>e.has(t)||su("Cannot "+i);var B=(t,e,i)=>(ws(t,e,"read from private field"),i?i.call(t):e.get(t)),pe=(t,e,i)=>e.has(t)?su("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),ye=(t,e,i,a)=>(ws(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),X=(t,e,i)=>(ws(t,e,"access private method"),i);var kE={};Ah(kE,{MediaError:()=>g.MediaError,default:()=>yE,generatePlayerInitTime:()=>D.generatePlayerInitTime,getVideoAttribute:()=>Vt,playerSoftwareName:()=>Vd,playerSoftwareVersion:()=>Fd});module.exports=yh(kE);var Mi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Mi{}globalThis.DocumentFragment=t}var Fa=class extends Mi{},Rs=class extends Mi{},kh={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Fa)}},Va,xs=class{constructor(e,i={}){pe(this,Va);ye(this,Va,i==null?void 0:i.detail)}get detail(){return B(this,Va)}initCustomEvent(){}};Va=new WeakMap;function Sh(t,e){return new Fa}var lu={document:{createElement:Sh},DocumentFragment,customElements:kh,CustomEvent:xs,EventTarget:Mi,HTMLElement:Fa,HTMLVideoElement:Rs},du=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ke=du?lu:globalThis,Gt=du?lu.document:globalThis.document;var m={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},x={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Ds={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},uu=Object.entries(Ds),n=uu.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Ih={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Le=uu.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Ih}),LE=Object.entries(Le).reduce((t,[e,i])=>{let a=n[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),cu=Object.entries(n).reduce((t,[e,i])=>{let a=Le[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),fe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},St={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var uo={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ve={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Pe={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var mu={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function hu(t){return t==null?void 0:t.map(Ch).join(" ")}function pu(t){return t==null?void 0:t.split(/\s+/).map(Lh)}function Ch(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function Lh(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function fu(t){return t==null?void 0:t.map(wh).join(" ")}function vu(t){return t==null?void 0:t.split(/\s+/).map(Rh)}function wh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(o=>o!=null).join(":")}}function Rh(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function Eu(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function Ci(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function co(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var mo=t=>new Promise(e=>setTimeout(e,t));var bu=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],xh=(t,e)=>{let i=t===1?bu[e].singular:bu[e].plural;return`${t} ${i}`},Yt=t=>{if(!Ci(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&xh(d,u)).filter(d=>d).join(", ")}${i?" remaining":""}`};function Ue(t,e){let i=!1;t<0&&(i=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),o=Math.floor(t/3600),s=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(o=r=a="0"),o=o>0||d>0?o+":":"",r=((o||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(i?"-":"")+o+r+a}var xE=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 gu={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var _u,Os={en:gu},Ns=((_u=globalThis.navigator)==null?void 0:_u.language)||"en",Au=t=>{Ns=t};var Oh=t=>{var e,i,a;let[r]=Ns.split("-");return((e=Os[Ns])==null?void 0:e[t])||((i=Os[r])==null?void 0:i[t])||((a=Os.en)==null?void 0:a[t])||t},h=(t,e={})=>Oh(t).replace(/\{(\w+)\}/g,(i,a)=>a in e?String(e[a]):`{${a}}`);var ho=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},po=class extends ho{},fo=class extends po{constructor(){super(...arguments),this.role=null}},Ps=class{observe(){}unobserve(){}disconnect(){}},Tu={createElement:function(){return new Ka.HTMLElement},createElementNS:function(){return new Ka.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},Ka={ResizeObserver:Ps,document:Tu,Node:po,Element:fo,HTMLElement:class extends fo{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Ka.DocumentFragment}},DocumentFragment:class extends ho{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(t){return null},setItem(t,e){},removeItem(t){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(t){return{matches:!1,media:t}},DOMParser:class{parseFromString(e,i){return{body:{textContent:e}}}}},yu="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window=="undefined"||typeof window.customElements=="undefined",ku=Object.keys(Ka).every(t=>t in globalThis),l=yu&&!ku?Ka:globalThis,V=yu&&!ku?Tu:globalThis.document;var Su=new WeakMap,Us=t=>{let e=Su.get(t);return e||Su.set(t,e=new Set),e},Iu=new l.ResizeObserver(t=>{for(let e of t)for(let i of Us(e.target))i(e)});function pt(t,e){Us(t).add(e),Iu.observe(t)}function ft(t,e){let i=Us(t);i.delete(e),i.size||Iu.unobserve(t)}function Z(t){let e={};for(let i of t)e[i.name]=i.value;return e}function Y(t){var e;return(e=vo(t))!=null?e:Ve(t,"media-controller")}function vo(t){var e;let{MEDIA_CONTROLLER:i}=x,a=t.getAttribute(i);if(a)return(e=qt(t))==null?void 0:e.getElementById(a)}var Eo=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},Nh=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},bo=(t,e)=>Nh(t,e)[0],ue=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:ue(t,e.getRootNode().host),Ve=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Ve(t.getRootNode().host,e)};function Ga(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=Ga(i.shadowRoot))!=null?e:i:null}function qt(t){var e;let i=(e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t);return i instanceof ShadowRoot||i instanceof Document?i:null}function go(t,{depth:e=3,checkOpacity:i=!0,checkVisibilityCSS:a=!0}={}){if(t.checkVisibility)return t.checkVisibility({checkOpacity:i,checkVisibilityCSS:a});let r=t;for(;r&&e>0;){let o=getComputedStyle(r);if(i&&o.opacity==="0"||a&&o.visibility==="hidden"||o.display==="none")return!1;r=r.parentElement,e--}return!0}function Mu(t,e,i,a){let r=a.x-i.x,o=a.y-i.y,s=r*r+o*o;if(s===0)return 0;let d=((t-i.x)*r+(e-i.y)*o)/s;return Math.max(0,Math.min(1,d))}function q(t,e){let i=Ph(t,a=>a===e);return i||Ya(t,e)}function Ph(t,e){var i,a;let r;for(r of(i=t.querySelectorAll("style:not([media])"))!=null?i:[]){let o;try{o=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of o!=null?o:[])if(e(s.selectorText))return s}}function Ya(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],o=r==null?void 0:r[r.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(a=o.sheet.cssRules)==null?void 0:a[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function O(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function P(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}O(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function k(t,e){return t.hasAttribute(e)}function S(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}k(t,e)!=i&&t.toggleAttribute(e,i)}function w(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function R(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;w(t,e,void 0)!==a&&t.setAttribute(e,a)}var Cu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},It=(t,e,i)=>(Cu(t,e,"read from private field"),i?i.call(t):e.get(t)),Uh=(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)},_o=(t,e,i,a)=>(Cu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ee;function Hh(t){return`
|
|
1
|
+
"use strict";var ws=Object.defineProperty;var bh=Object.getOwnPropertyDescriptor;var gh=Object.getOwnPropertyNames;var _h=Object.prototype.hasOwnProperty;var su=t=>{throw TypeError(t)};var Ah=(t,e)=>{for(var i in e)ws(t,i,{get:e[i],enumerable:!0})},Th=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of gh(e))!_h.call(t,r)&&r!==i&&ws(t,r,{get:()=>e[r],enumerable:!(a=bh(e,r))||a.enumerable});return t};var yh=t=>Th(ws({},"__esModule",{value:!0}),t);var Rs=(t,e,i)=>e.has(t)||su("Cannot "+i);var B=(t,e,i)=>(Rs(t,e,"read from private field"),i?i.call(t):e.get(t)),fe=(t,e,i)=>e.has(t)?su("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),ye=(t,e,i,a)=>(Rs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),X=(t,e,i)=>(Rs(t,e,"access private method"),i);var kE={};Ah(kE,{MediaError:()=>g.MediaError,default:()=>yE,generatePlayerInitTime:()=>D.generatePlayerInitTime,getVideoAttribute:()=>Vt,playerSoftwareName:()=>Kd,playerSoftwareVersion:()=>Vd});module.exports=yh(kE);var Mi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Mi{}globalThis.DocumentFragment=t}var Va=class extends Mi{},xs=class extends Mi{},kh={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Va)}},Ka,Ds=class{constructor(e,i={}){fe(this,Ka);ye(this,Ka,i==null?void 0:i.detail)}get detail(){return B(this,Ka)}initCustomEvent(){}};Ka=new WeakMap;function Sh(t,e){return new Va}var lu={document:{createElement:Sh},DocumentFragment,customElements:kh,CustomEvent:Ds,EventTarget:Mi,HTMLElement:Va,HTMLVideoElement:xs},du=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ke=du?lu:globalThis,Gt=du?lu.document:globalThis.document;var m={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},x={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Os={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},uu=Object.entries(Os),n=uu.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Ih={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Le=uu.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Ih}),LE=Object.entries(Le).reduce((t,[e,i])=>{let a=n[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),cu=Object.entries(n).reduce((t,[e,i])=>{let a=Le[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),ve={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},St={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var co={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Ee={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ne={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var mu={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function hu(t){return t==null?void 0:t.map(Ch).join(" ")}function pu(t){return t==null?void 0:t.split(/\s+/).map(Lh)}function Ch(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function Lh(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function fu(t){return t==null?void 0:t.map(wh).join(" ")}function vu(t){return t==null?void 0:t.split(/\s+/).map(Rh)}function wh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(o=>o!=null).join(":")}}function Rh(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function Eu(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function Ci(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function mo(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var ho=t=>new Promise(e=>setTimeout(e,t));var bu=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],xh=(t,e)=>{let i=t===1?bu[e].singular:bu[e].plural;return`${t} ${i}`},Yt=t=>{if(!Ci(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&xh(d,u)).filter(d=>d).join(", ")}${i?" remaining":""}`};function Ue(t,e){let i=!1;t<0&&(i=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),o=Math.floor(t/3600),s=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(o=r=a="0"),o=o>0||d>0?o+":":"",r=((o||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(i?"-":"")+o+r+a}var xE=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 gu={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var _u,Ps={en:gu},Ns=((_u=globalThis.navigator)==null?void 0:_u.language)||"en",Au=t=>{Ns=t};var Oh=t=>{var e,i,a;let[r]=Ns.split("-");return((e=Ps[Ns])==null?void 0:e[t])||((i=Ps[r])==null?void 0:i[t])||((a=Ps.en)==null?void 0:a[t])||t},h=(t,e={})=>Oh(t).replace(/\{(\w+)\}/g,(i,a)=>a in e?String(e[a]):`{${a}}`);var po=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},fo=class extends po{},vo=class extends fo{constructor(){super(...arguments),this.role=null}},Us=class{observe(){}unobserve(){}disconnect(){}},Tu={createElement:function(){return new Ga.HTMLElement},createElementNS:function(){return new Ga.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},Ga={ResizeObserver:Us,document:Tu,Node:fo,Element:vo,HTMLElement:class extends vo{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Ga.DocumentFragment}},DocumentFragment:class extends po{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(t){return null},setItem(t,e){},removeItem(t){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(t){return{matches:!1,media:t}},DOMParser:class{parseFromString(e,i){return{body:{textContent:e}}}}},yu="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window=="undefined"||typeof window.customElements=="undefined",ku=Object.keys(Ga).every(t=>t in globalThis),l=yu&&!ku?Ga:globalThis,V=yu&&!ku?Tu:globalThis.document;var Su=new WeakMap,Hs=t=>{let e=Su.get(t);return e||Su.set(t,e=new Set),e},Iu=new l.ResizeObserver(t=>{for(let e of t)for(let i of Hs(e.target))i(e)});function pt(t,e){Hs(t).add(e),Iu.observe(t)}function ft(t,e){let i=Hs(t);i.delete(e),i.size||Iu.unobserve(t)}function Z(t){let e={};for(let i of t)e[i.name]=i.value;return e}function Y(t){var e;return(e=Eo(t))!=null?e:Ve(t,"media-controller")}function Eo(t){var e;let{MEDIA_CONTROLLER:i}=x,a=t.getAttribute(i);if(a)return(e=qt(t))==null?void 0:e.getElementById(a)}var bo=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},Ph=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},go=(t,e)=>Ph(t,e)[0],ue=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:ue(t,e.getRootNode().host),Ve=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Ve(t.getRootNode().host,e)};function Ya(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=Ya(i.shadowRoot))!=null?e:i:null}function qt(t){var e;let i=(e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t);return i instanceof ShadowRoot||i instanceof Document?i:null}function _o(t,{depth:e=3,checkOpacity:i=!0,checkVisibilityCSS:a=!0}={}){if(t.checkVisibility)return t.checkVisibility({checkOpacity:i,checkVisibilityCSS:a});let r=t;for(;r&&e>0;){let o=getComputedStyle(r);if(i&&o.opacity==="0"||a&&o.visibility==="hidden"||o.display==="none")return!1;r=r.parentElement,e--}return!0}function Mu(t,e,i,a){let r=a.x-i.x,o=a.y-i.y,s=r*r+o*o;if(s===0)return 0;let d=((t-i.x)*r+(e-i.y)*o)/s;return Math.max(0,Math.min(1,d))}function q(t,e){let i=Nh(t,a=>a===e);return i||qa(t,e)}function Nh(t,e){var i,a;let r;for(r of(i=t.querySelectorAll("style:not([media])"))!=null?i:[]){let o;try{o=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of o!=null?o:[])if(e(s.selectorText))return s}}function qa(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],o=r==null?void 0:r[r.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(a=o.sheet.cssRules)==null?void 0:a[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function O(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function N(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}O(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function k(t,e){return t.hasAttribute(e)}function S(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}k(t,e)!=i&&t.toggleAttribute(e,i)}function w(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function R(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;w(t,e,void 0)!==a&&t.setAttribute(e,a)}var Cu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},It=(t,e,i)=>(Cu(t,e,"read from private field"),i?i.call(t):e.get(t)),Uh=(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)},Ao=(t,e,i,a)=>(Cu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),be;function Hh(t){return`
|
|
2
2
|
<style>
|
|
3
3
|
:host {
|
|
4
4
|
display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
|
|
5
5
|
box-sizing: border-box;
|
|
6
6
|
}
|
|
7
7
|
</style>
|
|
8
|
-
`}var Li=class extends l.HTMLElement{constructor(){if(super(),Uh(this,
|
|
8
|
+
`}var Li=class extends l.HTMLElement{constructor(){if(super(),Uh(this,be,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER,n.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER&&(i&&((o=(r=It(this,be))==null?void 0:r.unassociateElement)==null||o.call(r,this),Ao(this,be,null)),a&&this.isConnected&&(Ao(this,be,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=It(this,be))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Ao(this,be,Bh(this)),this.getAttribute(x.MEDIA_CONTROLLER)&&((i=(e=It(this,be))==null?void 0:e.associateElement)==null||i.call(e,this)),(a=It(this,be))==null||a.addEventListener("pointerdown",this),(r=It(this,be))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,i,a,r;this.getAttribute(x.MEDIA_CONTROLLER)&&((i=(e=It(this,be))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=It(this,be))==null||a.removeEventListener("pointerdown",this),(r=It(this,be))==null||r.removeEventListener("click",this),Ao(this,be,null)}handleEvent(e){var i;let a=(i=e.composedPath())==null?void 0:i[0];if(["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:o,clientY:s}=e,{left:d,top:u,width:p,height:T}=this.getBoundingClientRect(),_=o-d,E=s-u;if(_<0||E<0||_>p||E>T||p===0&&T===0)return;let f=this._pointerType||"mouse";if(this._pointerType=void 0,f===co.TOUCH){this.handleTap(e);return}else if(f===co.MOUSE||f===co.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let i=this.mediaPaused?m.MEDIA_PLAY_REQUEST:m.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(i,{composed:!0,bubbles:!0}))}};be=new WeakMap;Li.shadowRootOptions={mode:"open"};Li.getTemplateHTML=Hh;function Bh(t){var e;let i=t.getAttribute(x.MEDIA_CONTROLLER);return i?(e=t.getRootNode())==null?void 0:e.getElementById(i):Ve(t,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Li);var To=Li;var Fs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ie=(t,e,i)=>(Fs(t,e,"read from private field"),i?i.call(t):e.get(t)),Se=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Zt=(t,e,i,a)=>(Fs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),we=(t,e,i)=>(Fs(t,e,"access private method"),i),So,wi,za,Ri,yo,Bs,Lu,Za,ko,$s,wu,Ws,Ru,Qa,Io,Mo,Vs,xi,Xa,y={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function $h(t){return`
|
|
9
9
|
<style>
|
|
10
10
|
|
|
11
11
|
:host([${n.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
|
|
@@ -143,8 +143,8 @@
|
|
|
143
143
|
<slot name="poster" part="layer poster-layer"></slot>
|
|
144
144
|
<slot name="gestures-chrome" part="layer gesture-layer">
|
|
145
145
|
<media-gesture-receiver slot="gestures-chrome">
|
|
146
|
-
<template shadowrootmode="${
|
|
147
|
-
${
|
|
146
|
+
<template shadowrootmode="${To.shadowRootOptions.mode}">
|
|
147
|
+
${To.getTemplateHTML({})}
|
|
148
148
|
</template>
|
|
149
149
|
</media-gesture-receiver>
|
|
150
150
|
</slot>
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
<slot part="bottom chrome"></slot>
|
|
157
157
|
</span>
|
|
158
158
|
<slot name="dialog" part="layer dialog-layer"></slot>
|
|
159
|
-
`}var Wh=Object.values(n),Fh="sm:384 md:576 lg:768 xl:960";function Vh(t){xu(t.target,t.contentRect.width)}function xu(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(y.BREAKPOINTS))!=null?i:Fh,r=Kh(a),o=Gh(r,e),s=!1;if(Object.keys(r).forEach(d=>{if(o.includes(d)){t.hasAttribute(`breakpoint${d}`)||(t.setAttribute(`breakpoint${d}`,""),s=!0);return}t.hasAttribute(`breakpoint${d}`)&&(t.removeAttribute(`breakpoint${d}`),s=!0)}),s){let d=new CustomEvent(Le.BREAKPOINTS_CHANGE,{detail:o});t.dispatchEvent(d)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(Le.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Kh(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function Gh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var Qt=class extends l.HTMLElement{constructor(){if(super(),Se(this,Hs),Se(this,Bs),Se(this,$s),Se(this,Qa),Se(this,Io),Se(this,xi),Se(this,ko,0),Se(this,wi,null),Se(this,Za,null),Se(this,Ri,void 0),this.breakpointsComputed=!1,Se(this,To,new MutationObserver(we(this,Hs,Lu).bind(this))),Se(this,qa,!1),Se(this,yo,i=>{Ie(this,qa)||(setTimeout(()=>{Vh(i),Zt(this,qa,!1)},0),Zt(this,qa,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let i=Z(this.attributes),a=this.constructor.getTemplateHTML(i);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(a):this.shadowRoot.innerHTML=a}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){Ie(this,wi)&&this.mediaUnsetCallback(Ie(this,wi));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[y.AUTOHIDE,y.GESTURES_DISABLED].concat(Wh).filter(e=>![n.MEDIA_RENDITION_LIST,n.MEDIA_AUDIO_TRACK_LIST,n.MEDIA_CHAPTERS_CUES,n.MEDIA_WIDTH,n.MEDIA_HEIGHT,n.MEDIA_ERROR,n.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,i,a){e.toLowerCase()==y.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Zt(this,wi,e),e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Ie(this,To).observe(this,{childList:!0,subtree:!0}),pt(this,Ie(this,yo));let a=this.getAttribute(y.AUDIO)!=null?h("audio player"):h("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(y.USER_INACTIVE,""),xu(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=l.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Ie(this,To).disconnect(),ft(this,Ie(this,yo)),this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Zt(this,wi,null)}handleEvent(e){switch(e.type){case"pointerdown":Zt(this,ko,e.timeStamp);break;case"pointermove":we(this,Bs,wu).call(this,e);break;case"pointerup":we(this,$s,Ru).call(this,e);break;case"mouseleave":we(this,Qa,So).call(this);break;case"mouseup":this.removeAttribute(y.KEYBOARD_CONTROL);break;case"keyup":we(this,xi,za).call(this),this.setAttribute(y.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Zt(this,Ri,isNaN(i)?0:i)}get autohide(){return(Ie(this,Ri)===void 0?2:Ie(this,Ri)).toString()}get breakpoints(){return w(this,y.BREAKPOINTS)}set breakpoints(e){R(this,y.BREAKPOINTS,e)}get audio(){return k(this,y.AUDIO)}set audio(e){S(this,y.AUDIO,e)}get gesturesDisabled(){return k(this,y.GESTURES_DISABLED)}set gesturesDisabled(e){S(this,y.GESTURES_DISABLED,e)}get keyboardControl(){return k(this,y.KEYBOARD_CONTROL)}set keyboardControl(e){S(this,y.KEYBOARD_CONTROL,e)}get noAutohide(){return k(this,y.NO_AUTOHIDE)}set noAutohide(e){S(this,y.NO_AUTOHIDE,e)}get autohideOverControls(){return k(this,y.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){S(this,y.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return k(this,y.USER_INACTIVE)}set userInteractive(e){S(this,y.USER_INACTIVE,e)}};ko=new WeakMap;wi=new WeakMap;Za=new WeakMap;Ri=new WeakMap;To=new WeakMap;Hs=new WeakSet;Lu=function(t){let e=this.media;for(let i of t){if(i.type!=="childList")continue;let a=i.removedNodes;for(let r of a){if(r.slot!="media"||i.target!=this)continue;let o=i.previousSibling&&i.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(r);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(r)}}if(e)for(let r of i.addedNodes)r===e&&this.handleMediaUpdated(e)}};qa=new WeakMap;yo=new WeakMap;Bs=new WeakSet;wu=function(t){if(t.pointerType!=="mouse"&&t.timeStamp-Ie(this,ko)<250)return;we(this,Io,Fs).call(this),clearTimeout(Ie(this,Za));let e=this.hasAttribute(y.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(t.target)||e)&&we(this,xi,za).call(this)};$s=new WeakSet;Ru=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(y.USER_INACTIVE);[this,this.media].includes(t.target)&&e?we(this,Qa,So).call(this):we(this,xi,za).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&we(this,xi,za).call(this)};Qa=new WeakSet;So=function(){if(Ie(this,Ri)<0||this.hasAttribute(y.USER_INACTIVE))return;this.setAttribute(y.USER_INACTIVE,"");let t=new l.CustomEvent(Le.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};Io=new WeakSet;Fs=function(){if(!this.hasAttribute(y.USER_INACTIVE))return;this.removeAttribute(y.USER_INACTIVE);let t=new l.CustomEvent(Le.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};xi=new WeakSet;za=function(){we(this,Io,Fs).call(this),clearTimeout(Ie(this,Za));let t=parseInt(this.autohide);t<0||Zt(this,Za,setTimeout(()=>{we(this,Qa,So).call(this)},t*1e3))};Qt.shadowRootOptions={mode:"open"};Qt.getTemplateHTML=$h;l.customElements.get("media-container")||l.customElements.define("media-container",Qt);var Du=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},oe=(t,e,i)=>(Du(t,e,"read from private field"),i?i.call(t):e.get(t)),Xa=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Mo=(t,e,i,a)=>(Du(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Di,Oi,Co,zt,vt,Mt,Ct=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){Xa(this,vt),Xa(this,Di,void 0),Xa(this,Oi,void 0),Xa(this,Co,void 0),Xa(this,zt,new Set),Mo(this,Di,e),Mo(this,Oi,i),Mo(this,Co,new Set(a))}[Symbol.iterator](){return oe(this,vt,Mt).values()}get length(){return oe(this,vt,Mt).size}get value(){var e;return(e=[...oe(this,vt,Mt)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Mo(this,zt,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...oe(this,vt,Mt)][e]}values(){return oe(this,vt,Mt).values()}forEach(e,i){oe(this,vt,Mt).forEach(e,i)}add(...e){var i,a;e.forEach(r=>oe(this,zt).add(r)),!(this.value===""&&!((i=oe(this,Di))!=null&&i.hasAttribute(`${oe(this,Oi)}`)))&&((a=oe(this,Di))==null||a.setAttribute(`${oe(this,Oi)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>oe(this,zt).delete(a)),(i=oe(this,Di))==null||i.setAttribute(`${oe(this,Oi)}`,`${this.value}`)}contains(e){return oe(this,vt,Mt).has(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){return this.remove(e),this.add(i),e===i}};Di=new WeakMap;Oi=new WeakMap;Co=new WeakMap;zt=new WeakMap;vt=new WeakSet;Mt=function(){return oe(this,zt).size?oe(this,zt):oe(this,Co)};var Yh=(t="")=>t.split(/\s+/),Ou=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?fe.CAPTIONS:fe.SUBTITLES,language:i,label:r}},Xt=(t="",e={})=>Yh(t).map(i=>{let a=Ou(i);return{...e,...a}}),Vs=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?Ou(e):e):typeof t=="string"?Xt(t):[t]:[],Lo=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,Et=(t=[])=>Array.prototype.map.call(t,Lo).join(" "),qh=(t,e)=>i=>i[t]===e,Nu=t=>{let e=Object.entries(t).map(([i,a])=>qh(i,a));return i=>e.every(a=>a(i))},Jt=(t,e=[],i=[])=>{let a=Vs(i).map(Nu),r=o=>a.some(s=>s(o));Array.from(e).filter(r).forEach(o=>{o.mode=t})},jt=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:Nu(e);return Array.from(t.textTracks).filter(i)},wo=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(n.MEDIA_SUBTITLES_SHOWING)};var Uu=t=>{var e;let{media:i,fullscreenElement:a}=t;try{let r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let o=(e=a[r])==null?void 0:e.call(a);if(o instanceof Promise)return o.catch(()=>{})}else i!=null&&i.webkitEnterFullscreen?i.webkitEnterFullscreen():i!=null&&i.requestFullscreen&&i.requestFullscreen()}catch(r){console.error(r)}},Pu="exitFullscreen"in V?"exitFullscreen":"webkitExitFullscreen"in V?"webkitExitFullscreen":"webkitCancelFullScreen"in V?"webkitCancelFullScreen":void 0,Hu=t=>{var e;let{documentElement:i}=t;if(Pu){let a=(e=i==null?void 0:i[Pu])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},Ja="fullscreenElement"in V?"fullscreenElement":"webkitFullscreenElement"in V?"webkitFullscreenElement":void 0,Zh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[Ja];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===mu.FULLSCREEN?i:a},Bu=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let o=Zh(t);if(!o)return!1;if(o===r||o===i)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(Ja in s))return ue(o,r);for(;s!=null&&s[Ja];){if(s[Ja]===r)return!0;s=(e=s[Ja])==null?void 0:e.shadowRoot}}return!1},Qh="fullscreenEnabled"in V?"fullscreenEnabled":"webkitFullscreenEnabled"in V?"webkitFullscreenEnabled":void 0,$u=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[Qh])||i&&"webkitSupportsFullscreen"in i};var Ro,Ks=()=>{var t,e;return Ro||(Ro=(e=(t=V)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Ro)},Wu=async(t=Ks())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([zh(t,i.signal),Xh(t,e)]);return i.abort(),a},zh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),Xh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await mo(10)}return t.volume!==e},Jh=/.*Version\/.*Safari\/.*/.test(l.navigator.userAgent),Gs=(t=Ks())=>l.matchMedia("(display-mode: standalone)").matches&&Jh?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",Ys=(t=Ks())=>$u({documentElement:V,media:t}),Fu=Ys(),Vu=Gs(),Ku=!!l.WebKitPlaybackTargetAvailabilityEvent,Gu=!!l.chrome;var Ni=t=>jt(t.media,e=>[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),qs=t=>jt(t.media,e=>e.mode===St.SHOWING&&[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)),xo=(t,e)=>{let i=Ni(t),a=qs(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)Jt(St.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let o=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let T=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),_=T?[T,...globalThis.navigator.languages]:globalThis.navigator.languages,E=i.filter(f=>_.some(M=>f.language.toLowerCase().startsWith(M.split("-")[0]))).sort((f,M)=>{let b=_.findIndex(L=>f.language.toLowerCase().startsWith(L.split("-")[0])),C=_.findIndex(L=>M.language.toLowerCase().startsWith(L.split("-")[0]));return b-C});E[0]&&(o=E[0])}let{language:d,label:u,kind:p}=o;Jt(St.DISABLED,i,a),Jt(St.SHOWING,i,[{language:d,label:u,kind:p}])}}},Do=(t,e)=>t===e?!0:t==null||e==null||typeof t!=typeof e?!1:typeof t=="number"&&Number.isNaN(t)&&Number.isNaN(e)?!0:typeof t!="object"?!1:Array.isArray(t)?jh(t,e):Object.entries(t).every(([i,a])=>i in e&&Do(a,e[i])),jh=(t,e)=>{let i=Array.isArray(t),a=Array.isArray(e);return i!==a?!1:i||a?t.length!==e.length?!1:t.every((r,o)=>Do(r,e[o])):!0};var ep=Object.values(Pe),Oo,tp=Wu().then(t=>(Oo=t,Oo)),Yu=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof l.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=l.customElements.get(i);a&&e instanceof a||(await l.customElements.whenDefined(i),l.customElements.upgrade(e))}))},ip=new l.DOMParser,ap=t=>t&&(ip.parseFromString(t,"text/html").body.textContent||t),Pi={mediaError:{get(t,e){let{media:i}=t;if((e==null?void 0:e.type)!=="playing")return i==null?void 0:i.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(t,e){var i;let{media:a}=t;if((e==null?void 0:e.type)!=="playing")return(i=a==null?void 0:a.error)==null?void 0:i.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(t,e){var i,a;let{media:r}=t;if((e==null?void 0:e.type)!=="playing")return(a=(i=r==null?void 0:r.error)==null?void 0:i.message)!=null?a:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.paused)!=null?e:!0},set(t,e){var i;let{media:a}=e;a&&(t?a.pause():(i=a.play())==null||i.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(t,e){let{media:i}=t;return i?e?e.type==="playing":!i.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.playbackRate)!=null?e:1},set(t,e){let{media:i}=e;i&&Number.isFinite(+t)&&(i.playbackRate=+t)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.muted)!=null?e:!1},set(t,e){let{media:i,options:{noMutedPref:a}={}}=e;if(i){i.muted=t;try{let r=l.localStorage.getItem("media-chrome-pref-muted")!==null,o=i.hasAttribute("muted");if(a){r&&l.localStorage.removeItem("media-chrome-pref-muted");return}if(o&&!r)return;l.localStorage.setItem("media-chrome-pref-muted",t?"true":"false")}catch(r){console.debug("Error setting muted pref",r)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noMutedPref:i}}=e,{media:a}=e;if(!(!a||a.muted||i))try{let r=l.localStorage.getItem("media-chrome-pref-muted")==="true";Pi.mediaMuted.set(r,e),t(r)}catch(r){console.debug("Error getting muted pref",r)}}]},mediaLoop:{get(t){let{media:e}=t;return e==null?void 0:e.loop},set(t,e){let{media:i}=e;i&&(i.loop=t)},mediaEvents:["medialooprequest"]},mediaVolume:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.volume)!=null?e:1},set(t,e){let{media:i,options:{noVolumePref:a}={}}=e;if(i){try{t==null?l.localStorage.removeItem("media-chrome-pref-volume"):!i.hasAttribute("muted")&&!a&&l.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch(r){console.debug("Error setting volume pref",r)}Number.isFinite(+t)&&(i.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noVolumePref:i}}=e;if(!i)try{let{media:a}=e;if(!a)return;let r=l.localStorage.getItem("media-chrome-pref-volume");if(r==null)return;Pi.mediaVolume.set(+r,e),t(+r)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(t){let{media:e}=t;return typeof(e==null?void 0:e.volume)=="undefined"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.currentTime)!=null?e:0},set(t,e){let{media:i}=e;!i||!Ci(t)||(i.currentTime=t)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(t){let{media:e,options:{defaultDuration:i}={}}=t;return i&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?i:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(t){let{media:e}=t;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(t){var e;let{media:i}=t;if(!((e=i==null?void 0:i.seekable)!=null&&e.length))return;let a=i.seekable.start(0),r=i.seekable.end(i.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(t){var e;let{media:i}=t,a=(e=i==null?void 0:i.buffered)!=null?e:[];return Array.from(a).map((r,o)=>[Number(a.start(o).toFixed(3)),Number(a.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(t){let{media:e,options:{defaultStreamType:i}={}}=t,a=[Pe.LIVE,Pe.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(ep.includes(r))return r===Pe.UNKNOWN?a:r;let o=e.duration;return o===1/0?Pe.LIVE:Number.isFinite(o)?Pe.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(t){let{media:e}=t;if(!e)return Number.NaN;let{targetLiveWindow:i}=e,a=Pi.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===Pe.LIVE?0:i},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(t){let{media:e,options:{liveEdgeOffset:i=10}={}}=t;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Pi.mediaStreamType.get(t)===Pe.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let o=r.end(r.length-1)-i;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(t){return Ni(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return qs(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i,a;let{media:r,options:o}=e;if(!r)return;let s=d=>{var u;!o.defaultSubtitles||d&&![fe.CAPTIONS,fe.SUBTITLES].includes((u=d==null?void 0:d.track)==null?void 0:u.kind)||xo(e,!0)};return r.addEventListener("loadstart",s),(i=r.textTracks)==null||i.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),()=>{var d,u;r.removeEventListener("loadstart",s),(d=r.textTracks)==null||d.removeEventListener("addtrack",s),(u=r.textTracks)==null||u.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(t){var e;let{media:i}=t;if(!i)return[];let[a]=jt(i,{kind:fe.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:o,endTime:s})=>({text:ap(r),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;if(!a)return;let r=a.querySelector('track[kind="chapters"][default][src]'),o=(i=a.shadowRoot)==null?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",t),o==null||o.addEventListener("load",t),()=>{r==null||r.removeEventListener("load",t),o==null||o.removeEventListener("load",t)}}]},mediaIsPip:{get(t){var e,i;let{media:a,documentElement:r}=t;if(!a||!r||!r.pictureInPictureElement)return!1;if(r.pictureInPictureElement===a)return!0;if(r.pictureInPictureElement instanceof HTMLMediaElement)return(e=a.localName)!=null&&e.includes("-")?ue(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let o=r.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===a)return!0;o=(i=o.pictureInPictureElement)==null?void 0:i.shadowRoot}}return!1},set(t,e){let{media:i}=e;if(i)if(t){if(!V.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(r=>{if(r.code===11){if(!i.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(i.readyState===0&&i.preload==="none"){let o=()=>{i.removeEventListener("loadedmetadata",s),i.preload="none"},s=()=>{i.requestPictureInPicture().catch(a),o()};i.addEventListener("loadedmetadata",s),i.preload="metadata",setTimeout(()=>{i.readyState===0&&a(),o()},1e3)}else throw r}else throw r})}else V.pictureInPictureElement&&V.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(t){var e,i,a;let{media:r}=t;return(a=(i=r==null?void 0:r.videoRenditions)==null?void 0:i[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=t,r=Array.prototype.findIndex.call(i.videoRenditions,o=>o.id==a);i.videoRenditions.selectedIndex!=r&&(i.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(t){var e,i;let{media:a}=t;return(i=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:i.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=t;for(let r of i.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(t){return Bu(t)},set(t,e,i){var a;t?(Uu(e),i.detail&&((a=e.media)==null||a.focus())):Hu(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(t){var e;let{media:i}=t;return!(i!=null&&i.remote)||((e=i.remote)==null?void 0:e.state)==="disconnected"?!1:!!i.remote.state},set(t,e){var i,a;let{media:r}=e;if(r&&!(t&&((i=r.remote)==null?void 0:i.state)!=="disconnected")&&!(!t&&((a=r.remote)==null?void 0:a.state)!=="connected")){if(typeof r.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}r.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(t,e){let{media:i}=e;if(i){if(!(i.webkitShowPlaybackTargetPicker&&l.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(t){let{media:e}=t;if(!Fu||!Ys(e))return ve.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!Vu||!Gs(e))return ve.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return ve.UNAVAILABLE}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(Oo===!1||(e==null?void 0:e.volume)==null)return ve.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{Oo==null&&tp.then(e=>t(e?void 0:ve.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!Gu||!((i=a==null?void 0:a.remote)!=null&&i.state))return ve.UNSUPPORTED;if(!(e==null||e==="available"))return ve.UNAVAILABLE},stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(t,e){if(!Ku)return ve.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return ve.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(t){var e;let{media:i}=t;if(!(i!=null&&i.videoRenditions))return ve.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return ve.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return ve.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return ve.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(t){let{options:{mediaLang:e}={}}=t;return e!=null?e:"en"}}};var qu={[m.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,o;let{media:s}=e,d=i!=null?i:void 0,u,p;if(s&&d!=null){let[f]=jt(s,{kind:fe.METADATA,label:"thumbnails"}),M=Array.prototype.find.call((a=f==null?void 0:f.cues)!=null?a:[],(b,C,L)=>C===0?b.endTime>d:C===L.length-1?b.startTime<=d:b.startTime<=d&&b.endTime>d);if(M){let b=/'^(?:[a-z]+:)?\/\//i.test(M.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,C=new URL(M.text,b);p=new URLSearchParams(C.hash).get("#xywh").split(",").map(ie=>+ie),u=C.href}}let T=t.mediaDuration.get(e),E=(o=t.mediaChaptersCues.get(e).find((f,M,b)=>M===b.length-1&&T===f.endTime?f.startTime<=d&&f.endTime>=d:f.startTime<=d&&f.endTime>d))==null?void 0:o.text;return i!=null&&E==null&&(E=""),{mediaPreviewTime:d,mediaPreviewImage:u,mediaPreviewCoords:p,mediaPreviewChapter:E}},[m.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[m.MEDIA_PLAY_REQUEST](t,e){var i,a,r,o;let s="mediaPaused",u=t.mediaStreamType.get(e)===Pe.LIVE,p=!((i=e.options)!=null&&i.noAutoSeekToLive),T=t.mediaTargetLiveWindow.get(e)>0;if(u&&p&&!T){let _=(a=t.mediaSeekable.get(e))==null?void 0:a[1];if(_){let E=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,f=_-E;t.mediaCurrentTime.set(f,e)}}t[s].set(!1,e)},[m.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[m.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[m.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[m.MEDIA_LOOP_REQUEST](t,e,{detail:i}){let a="mediaLoop",r=!!i;return t[a].set(r,e),{mediaLoop:r}},[m.MEDIA_VOLUME_REQUEST](t,e,{detail:i}){let a="mediaVolume",r=i;r&&t.mediaMuted.get(e)&&t.mediaMuted.set(!1,e),t[a].set(r,e)},[m.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[m.MEDIA_SEEK_TO_LIVE_REQUEST](t,e){var i,a,r;let o="mediaCurrentTime",s=(i=t.mediaSeekable.get(e))==null?void 0:i[1];if(Number.isNaN(Number(s)))return;let d=(r=(a=e.options)==null?void 0:a.seekToLiveOffset)!=null?r:0,u=s-d;t[o].set(u,e)},[m.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,o=Ni(e),s=Vs(i),d=(a=s[0])==null?void 0:a.language;d&&!r.noSubtitlesLangPref&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),Jt(St.SHOWING,o,s)},[m.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=Ni(e),r=i!=null?i:[];Jt(St.DISABLED,a,r)},[m.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){xo(e,i)},[m.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[m.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[m.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[m.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[m.MEDIA_ENTER_FULLSCREEN_REQUEST](t,e,i){let a="mediaIsFullscreen";t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t[a].set(!0,e,i)},[m.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[m.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[m.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[m.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var Zu=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Pi,requestMap:r=qu,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let d=[],u={options:{...o}},p=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),T=b=>{b!=null&&(Do(b,p)||(p=Object.freeze({...p,...b}),d.forEach(C=>C(p))))},_=()=>{let b=Object.entries(a).reduce((C,[L,{get:ie}])=>(C[L]=ie(u),C),{});T(b)},E={},f,M=async(b,C)=>{var L,ie,Ae,kt,mt,Ia,Ma,Ca,La,wa,Ra,xa,Da,Oa,Na,Pa;let so=!!f;if(f={...u,...f!=null?f:{},...b},so)return;await Yu(...Object.values(b));let ht=d.length>0&&C===0&&s,Ua=u.media!==f.media,Ha=((L=u.media)==null?void 0:L.textTracks)!==((ie=f.media)==null?void 0:ie.textTracks),Ba=((Ae=u.media)==null?void 0:Ae.videoRenditions)!==((kt=f.media)==null?void 0:kt.videoRenditions),$a=((mt=u.media)==null?void 0:mt.audioTracks)!==((Ia=f.media)==null?void 0:Ia.audioTracks),Yd=((Ma=u.media)==null?void 0:Ma.remote)!==((Ca=f.media)==null?void 0:Ca.remote),qd=u.documentElement!==f.documentElement,Zd=!!u.media&&(Ua||ht),Qd=!!((La=u.media)!=null&&La.textTracks)&&(Ha||ht),zd=!!((wa=u.media)!=null&&wa.videoRenditions)&&(Ba||ht),Xd=!!((Ra=u.media)!=null&&Ra.audioTracks)&&($a||ht),Jd=!!((xa=u.media)!=null&&xa.remote)&&(Yd||ht),jd=!!u.documentElement&&(qd||ht),Cs=Zd||Qd||zd||Xd||Jd||jd,Ii=d.length===0&&C===1&&s,eu=!!f.media&&(Ua||Ii),tu=!!((Da=f.media)!=null&&Da.textTracks)&&(Ha||Ii),iu=!!((Oa=f.media)!=null&&Oa.videoRenditions)&&(Ba||Ii),au=!!((Na=f.media)!=null&&Na.audioTracks)&&($a||Ii),ru=!!((Pa=f.media)!=null&&Pa.remote)&&(Yd||Ii),ou=!!f.documentElement&&(qd||Ii),nu=eu||tu||iu||au||ru||ou;if(!(Cs||nu)){Object.entries(f).forEach(([F,Wa])=>{u[F]=Wa}),_(),f=void 0;return}Object.entries(a).forEach(([F,{get:Wa,mediaEvents:ch=[],textTracksEvents:mh=[],videoRenditionsEvents:hh=[],audioTracksEvents:ph=[],remoteEvents:fh=[],rootEvents:vh=[],stateOwnersUpdateHandlers:Eh=[]}])=>{E[F]||(E[F]={});let Te=Q=>{let ee=Wa(u,Q);T({[F]:ee})},re;re=E[F].mediaEvents,ch.forEach(Q=>{re&&Zd&&(u.media.removeEventListener(Q,re),E[F].mediaEvents=void 0),eu&&(f.media.addEventListener(Q,Te),E[F].mediaEvents=Te)}),re=E[F].textTracksEvents,mh.forEach(Q=>{var ee,Ne;re&&Qd&&((ee=u.media.textTracks)==null||ee.removeEventListener(Q,re),E[F].textTracksEvents=void 0),tu&&((Ne=f.media.textTracks)==null||Ne.addEventListener(Q,Te),E[F].textTracksEvents=Te)}),re=E[F].videoRenditionsEvents,hh.forEach(Q=>{var ee,Ne;re&&zd&&((ee=u.media.videoRenditions)==null||ee.removeEventListener(Q,re),E[F].videoRenditionsEvents=void 0),iu&&((Ne=f.media.videoRenditions)==null||Ne.addEventListener(Q,Te),E[F].videoRenditionsEvents=Te)}),re=E[F].audioTracksEvents,ph.forEach(Q=>{var ee,Ne;re&&Xd&&((ee=u.media.audioTracks)==null||ee.removeEventListener(Q,re),E[F].audioTracksEvents=void 0),au&&((Ne=f.media.audioTracks)==null||Ne.addEventListener(Q,Te),E[F].audioTracksEvents=Te)}),re=E[F].remoteEvents,fh.forEach(Q=>{var ee,Ne;re&&Jd&&((ee=u.media.remote)==null||ee.removeEventListener(Q,re),E[F].remoteEvents=void 0),ru&&((Ne=f.media.remote)==null||Ne.addEventListener(Q,Te),E[F].remoteEvents=Te)}),re=E[F].rootEvents,vh.forEach(Q=>{re&&jd&&(u.documentElement.removeEventListener(Q,re),E[F].rootEvents=void 0),ou&&(f.documentElement.addEventListener(Q,Te),E[F].rootEvents=Te)});let lo=E[F].stateOwnersUpdateHandlers;if(lo&&Cs&&(Array.isArray(lo)?lo:[lo]).forEach(ee=>{typeof ee=="function"&&ee()}),nu){let Q=Eh.map(ee=>ee(Te,f)).filter(ee=>typeof ee=="function");E[F].stateOwnersUpdateHandlers=Q.length===1?Q[0]:Q}else Cs&&(E[F].stateOwnersUpdateHandlers=void 0)}),Object.entries(f).forEach(([F,Wa])=>{u[F]=Wa}),_(),f=void 0};return M({media:t,fullscreenElement:e,documentElement:i,options:o}),{dispatch(b){let{type:C,detail:L}=b;if(r[C]&&p.mediaErrorCode==null){T(r[C](a,u,b));return}C==="mediaelementchangerequest"?M({media:L}):C==="fullscreenelementchangerequest"?M({fullscreenElement:L}):C==="documentelementchangerequest"?M({documentElement:L}):C==="optionschangerequest"&&(Object.entries(L!=null?L:{}).forEach(([ie,Ae])=>{u.options[ie]=Ae}),_())},getState(){return p},subscribe(b){return M({},d.length+1),d.push(b),b(p),()=>{let C=d.indexOf(b);C>=0&&(M({},d.length-1),d.splice(C,1))}}}};var Js=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},I=(t,e,i)=>(Js(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)},Ke=(t,e,i,a)=>(Js(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ye=(t,e,i)=>(Js(t,e,"access private method"),i),Lt,ja,U,ti,er,Ge,No,tr,Po,Zs,ii,Ui,Uo,Qs,zs,tc,ic=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],Qu=10,zu=.025,Xu=.25,rp=.25,op=2,v={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},Ho=class extends Qt{constructor(){super(),Re(this,Po),Re(this,ii),Re(this,Uo),Re(this,zs),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Re(this,Lt,new Ct(this,v.HOTKEYS)),Re(this,ja,void 0),Re(this,U,void 0),Re(this,ti,null),Re(this,er,void 0),Re(this,Ge,void 0),Re(this,No,i=>{var a;(a=I(this,U))==null||a.dispatch(i)}),Re(this,tr,void 0),this.associateElement(this);let e={};Ke(this,er,i=>{Object.entries(i).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let o=a.toLowerCase(),s=new l.CustomEvent(cu[o],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.hasAttribute(v.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(v.NO_HOTKEYS,v.HOTKEYS,v.DEFAULT_STREAM_TYPE,v.DEFAULT_SUBTITLES,v.DEFAULT_DURATION,v.NO_MUTED_PREF,v.NO_VOLUME_PREF,v.LANG,v.LOOP)}get mediaStore(){return I(this,U)}set mediaStore(e){var i,a;if(I(this,U)&&((i=I(this,Ge))==null||i.call(this),Ke(this,Ge,void 0)),Ke(this,U,e),!I(this,U)&&!this.hasAttribute(v.NO_DEFAULT_STORE)){Ye(this,Po,Zs).call(this);return}Ke(this,Ge,(a=I(this,U))==null?void 0:a.subscribe(I(this,er)))}get fullscreenElement(){var e;return(e=I(this,ja))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(v.FULLSCREEN_ELEMENT)&&this.removeAttribute(v.FULLSCREEN_ELEMENT),Ke(this,ja,e),(i=I(this,U))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return k(this,v.DEFAULT_SUBTITLES)}set defaultSubtitles(e){S(this,v.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return w(this,v.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){R(this,v.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return O(this,v.DEFAULT_DURATION)}set defaultDuration(e){P(this,v.DEFAULT_DURATION,e)}get noHotkeys(){return k(this,v.NO_HOTKEYS)}set noHotkeys(e){S(this,v.NO_HOTKEYS,e)}get keysUsed(){return w(this,v.KEYS_USED)}set keysUsed(e){R(this,v.KEYS_USED,e)}get liveEdgeOffset(){return O(this,v.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){P(this,v.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return k(this,v.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){S(this,v.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return k(this,v.NO_VOLUME_PREF)}set noVolumePref(e){S(this,v.NO_VOLUME_PREF,e)}get noMutedPref(){return k(this,v.NO_MUTED_PREF)}set noMutedPref(e){S(this,v.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return k(this,v.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){S(this,v.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return k(this,v.NO_DEFAULT_STORE)}set noDefaultStore(e){S(this,v.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,o,s,d,u,p,T,_,E,f,M,b;if(super.attributeChangedCallback(e,i,a),e===v.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(v.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==i&&a===null&&this.enableHotkeys();else if(e===v.HOTKEYS)I(this,Lt).value=a;else if(e===v.DEFAULT_SUBTITLES&&a!==i)(r=I(this,U))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(v.DEFAULT_SUBTITLES)}});else if(e===v.DEFAULT_STREAM_TYPE)(s=I(this,U))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(v.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===v.LIVE_EDGE_OFFSET)(d=I(this,U))==null||d.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(v.LIVE_EDGE_OFFSET)}});else if(e===v.SEEK_TO_LIVE_OFFSET)(u=I(this,U))==null||u.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(v.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===v.NO_AUTO_SEEK_TO_LIVE)(p=I(this,U))==null||p.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(v.NO_AUTO_SEEK_TO_LIVE)}});else if(e===v.FULLSCREEN_ELEMENT){let C=a?(T=this.getRootNode())==null?void 0:T.getElementById(a):void 0;Ke(this,ja,C),(_=I(this,U))==null||_.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===v.LANG&&a!==i?(Au(a),(E=I(this,U))==null||E.dispatch({type:"optionschangerequest",detail:{mediaLang:a}})):e===v.LOOP&&a!==i?(f=I(this,U))==null||f.dispatch({type:m.MEDIA_LOOP_REQUEST,detail:a!=null}):e===v.NO_VOLUME_PREF&&a!==i?(M=I(this,U))==null||M.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(v.NO_VOLUME_PREF)}}):e===v.NO_MUTED_PREF&&a!==i&&((b=I(this,U))==null||b.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(v.NO_MUTED_PREF)}}))}connectedCallback(){var e,i;!I(this,U)&&!this.hasAttribute(v.NO_DEFAULT_STORE)&&Ye(this,Po,Zs).call(this),(e=I(this,U))==null||e.dispatch({type:"documentelementchangerequest",detail:V}),super.connectedCallback(),I(this,U)&&!I(this,Ge)&&Ke(this,Ge,(i=I(this,U))==null?void 0:i.subscribe(I(this,er))),I(this,tr)!==void 0&&I(this,U)&&this.media&&setTimeout(()=>{var a,r,o;(r=(a=this.media)==null?void 0:a.textTracks)!=null&&r.length&&((o=I(this,U))==null||o.dispatch({type:m.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:I(this,tr)}))},0),this.hasAttribute(v.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,i,a,r,o;if((e=super.disconnectedCallback)==null||e.call(this),I(this,U)){let s=I(this,U).getState();Ke(this,tr,!!((i=s.mediaSubtitlesShowing)!=null&&i.length)),(a=I(this,U))==null||a.dispatch({type:"documentelementchangerequest",detail:void 0}),(r=I(this,U))==null||r.dispatch({type:m.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}I(this,Ge)&&((o=I(this,Ge))==null||o.call(this),Ke(this,Ge,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=I(this,U))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=I(this,U))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){ec(this.mediaStateReceivers,e,i)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(i.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),o=cp(e,a,r);Object.values(m).forEach(s=>{e.addEventListener(s,I(this,No))}),i.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(!i.has(e))return;i.get(e)(),i.delete(e),Object.values(m).forEach(r=>{e.removeEventListener(r,I(this,No))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),I(this,U)&&Object.entries(I(this,U).getState()).forEach(([r,o])=>{ec([e],r,o)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Ye(this,Uo,Qs))}disableHotkeys(){this.removeEventListener("keydown",Ye(this,Uo,Qs)),this.removeEventListener("keyup",Ye(this,ii,Ui))}get hotkeys(){return w(this,v.HOTKEYS)}set hotkeys(e){R(this,v.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,o,s,d,u,p,T;let _=e.target;if(((r=(a=(i=_.getAttribute(v.KEYS_USED))==null?void 0:i.split(" "))!=null?a:_==null?void 0:_.keysUsed)!=null?r:[]).map(L=>L==="Space"?" ":L).filter(Boolean).includes(e.key))return;let f,M,b;if(!(I(this,Lt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&I(this,Lt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&I(this,Lt).contains("noshift+/")))switch(e.key){case" ":case"k":f=I(this,U).getState().mediaPaused?m.MEDIA_PLAY_REQUEST:m.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"m":f=this.mediaStore.getState().mediaVolumeLevel==="off"?m.MEDIA_UNMUTE_REQUEST:m.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"f":f=this.mediaStore.getState().mediaIsFullscreen?m.MEDIA_EXIT_FULLSCREEN_REQUEST:m.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(m.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let L=this.hasAttribute(v.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(v.KEYBOARD_BACKWARD_SEEK_OFFSET):Qu;M=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-L,0),b=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:M}),this.dispatchEvent(b);break}case"ArrowRight":case"l":{let L=this.hasAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET):Qu;M=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+L,0),b=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:M}),this.dispatchEvent(b);break}case"ArrowUp":{let L=this.hasAttribute(v.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_UP_VOLUME_STEP):zu;M=Math.min(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)+L,1),b=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:M}),this.dispatchEvent(b);break}case"ArrowDown":{let L=this.hasAttribute(v.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_DOWN_VOLUME_STEP):zu;M=Math.max(((u=this.mediaStore.getState().mediaVolume)!=null?u:1)-L,0),b=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:M}),this.dispatchEvent(b);break}case"<":{let L=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;M=Math.max(L-Xu,rp).toFixed(2),b=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:M}),this.dispatchEvent(b);break}case">":{let L=(T=this.mediaStore.getState().mediaPlaybackRate)!=null?T:1;M=Math.min(L+Xu,op).toFixed(2),b=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:M}),this.dispatchEvent(b);break}case"/":case"?":{e.shiftKey&&Ye(this,zs,tc).call(this);break}case"p":{f=this.mediaStore.getState().mediaIsPip?m.MEDIA_EXIT_PIP_REQUEST:m.MEDIA_ENTER_PIP_REQUEST,b=new l.CustomEvent(f,{composed:!0,bubbles:!0}),this.dispatchEvent(b);break}default:break}}};Lt=new WeakMap;ja=new WeakMap;U=new WeakMap;ti=new WeakMap;er=new WeakMap;Ge=new WeakMap;No=new WeakMap;tr=new WeakMap;Po=new WeakSet;Zs=function(){var t;this.mediaStore=Zu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(v.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(v.DEFAULT_DURATION)?+this.getAttribute(v.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(v.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(v.SEEK_TO_LIVE_OFFSET):this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(v.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(v.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(v.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(v.NO_SUBTITLES_LANG_PREF)}})};ii=new WeakSet;Ui=function(t){let{key:e,shiftKey:i}=t;if(!(i&&(e==="/"||e==="?")||ic.includes(e))){this.removeEventListener("keyup",Ye(this,ii,Ui));return}this.keyboardShortcutHandler(t)};Uo=new WeakSet;Qs=function(t){var e;let{metaKey:i,altKey:a,key:r,shiftKey:o}=t,s=o&&(r==="/"||r==="?");if(s&&((e=I(this,ti))!=null&&e.open)){this.removeEventListener("keyup",Ye(this,ii,Ui));return}if(i||a||!s&&!ic.includes(r)){this.removeEventListener("keyup",Ye(this,ii,Ui));return}let d=t.target,u=d instanceof HTMLElement&&(d.tagName.toLowerCase()==="media-volume-range"||d.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(r)&&!(I(this,Lt).contains(`no${r.toLowerCase()}`)||r===" "&&I(this,Lt).contains("nospace"))&&!u&&t.preventDefault(),this.addEventListener("keyup",Ye(this,ii,Ui),{once:!0})};zs=new WeakSet;tc=function(){I(this,ti)||(Ke(this,ti,V.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(I(this,ti))),I(this,ti).open=!0};var np=Object.values(n),sp=Object.values(Ds),ac=t=>{var e,i,a,r;let{observedAttributes:o}=t.constructor;!o&&((e=t.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(t),{observedAttributes:o}=t.constructor);let s=(r=(a=(i=t==null?void 0:t.getAttribute)==null?void 0:i.call(t,x.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(o||s)?(o||s).filter(d=>np.includes(d)):[]},lp=t=>{var e,i;return(e=t.nodeName)!=null&&e.includes("-")&&l.customElements.get((i=t.nodeName)==null?void 0:i.toLowerCase())&&!(t instanceof l.customElements.get(t.nodeName.toLowerCase()))&&l.customElements.upgrade(t),sp.some(a=>a in t)},Xs=t=>lp(t)||!!ac(t).length,Ju=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},ju={[n.MEDIA_SUBTITLES_LIST]:Et,[n.MEDIA_SUBTITLES_SHOWING]:Et,[n.MEDIA_SEEKABLE]:Ju,[n.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(Ju).join(" "),[n.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[n.MEDIA_RENDITION_LIST]:hu,[n.MEDIA_AUDIO_TRACK_LIST]:fu},dp=async(t,e,i)=>{var a,r;if(t.isConnected||await mo(0),typeof i=="boolean"||i==null)return S(t,e,i);if(typeof i=="number")return P(t,e,i);if(typeof i=="string")return R(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let o=(r=(a=ju[e])==null?void 0:a.call(ju,i))!=null?r:i;return t.setAttribute(e,o)},up=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},ei=(t,e)=>{if(up(t))return;let i=(r,o)=>{var s,d;Xs(r)&&o(r);let{children:u=[]}=r!=null?r:{},p=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...u,...p].forEach(_=>ei(_,o))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Xs(t)){l.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},ec=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=ac(a),o=e.toLowerCase();r.includes(o)&&dp(a,o,i)})},cp=(t,e,i)=>{ei(t,e);let a=T=>{var _;let E=(_=T==null?void 0:T.composedPath()[0])!=null?_:T.target;e(E)},r=T=>{var _;let E=(_=T==null?void 0:T.composedPath()[0])!=null?_:T.target;i(E)};t.addEventListener(m.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(m.UNREGISTER_MEDIA_STATE_RECEIVER,r);let o=T=>{T.forEach(_=>{let{addedNodes:E=[],removedNodes:f=[],type:M,target:b,attributeName:C}=_;M==="childList"?(Array.prototype.forEach.call(E,L=>ei(L,e)),Array.prototype.forEach.call(f,L=>ei(L,i))):M==="attributes"&&C===x.MEDIA_CHROME_ATTRIBUTES&&(Xs(b)?e(b):i(b))})},s=[],d=T=>{let _=T.target;_.name!=="media"&&(s.forEach(E=>ei(E,i)),s=[..._.assignedElements({flatten:!0})],s.forEach(E=>ei(E,e)))};t.addEventListener("slotchange",d);let u=new MutationObserver(o);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{ei(t,i),t.removeEventListener("slotchange",d),u.disconnect(),t.removeEventListener(m.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(m.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",Ho);var js=Ho;var Hi={PLACEMENT:"placement",BOUNDS:"bounds"};function mp(t){return`
|
|
159
|
+
`}var Wh=Object.values(n),Fh="sm:384 md:576 lg:768 xl:960";function Vh(t){xu(t.target,t.contentRect.width)}function xu(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(y.BREAKPOINTS))!=null?i:Fh,r=Kh(a),o=Gh(r,e),s=!1;if(Object.keys(r).forEach(d=>{if(o.includes(d)){t.hasAttribute(`breakpoint${d}`)||(t.setAttribute(`breakpoint${d}`,""),s=!0);return}t.hasAttribute(`breakpoint${d}`)&&(t.removeAttribute(`breakpoint${d}`),s=!0)}),s){let d=new CustomEvent(Le.BREAKPOINTS_CHANGE,{detail:o});t.dispatchEvent(d)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(Le.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Kh(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function Gh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var zt=class extends l.HTMLElement{constructor(){if(super(),Se(this,Bs),Se(this,$s),Se(this,Ws),Se(this,Qa),Se(this,Mo),Se(this,xi),Se(this,So,0),Se(this,wi,null),Se(this,za,null),Se(this,Ri,void 0),this.breakpointsComputed=!1,Se(this,yo,new MutationObserver(we(this,Bs,Lu).bind(this))),Se(this,Za,!1),Se(this,ko,i=>{Ie(this,Za)||(setTimeout(()=>{Vh(i),Zt(this,Za,!1)},0),Zt(this,Za,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let i=Z(this.attributes),a=this.constructor.getTemplateHTML(i);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(a):this.shadowRoot.innerHTML=a}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){Ie(this,wi)&&this.mediaUnsetCallback(Ie(this,wi));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[y.AUTOHIDE,y.GESTURES_DISABLED].concat(Wh).filter(e=>![n.MEDIA_RENDITION_LIST,n.MEDIA_AUDIO_TRACK_LIST,n.MEDIA_CHAPTERS_CUES,n.MEDIA_WIDTH,n.MEDIA_HEIGHT,n.MEDIA_ERROR,n.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,i,a){e.toLowerCase()==y.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Zt(this,wi,e),e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Ie(this,yo).observe(this,{childList:!0,subtree:!0}),pt(this,Ie(this,ko));let a=this.getAttribute(y.AUDIO)!=null?h("audio player"):h("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(y.USER_INACTIVE,""),xu(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=l.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Ie(this,yo).disconnect(),ft(this,Ie(this,ko)),this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Zt(this,wi,null)}handleEvent(e){switch(e.type){case"pointerdown":Zt(this,So,e.timeStamp);break;case"pointermove":we(this,$s,wu).call(this,e);break;case"pointerup":we(this,Ws,Ru).call(this,e);break;case"mouseleave":we(this,Qa,Io).call(this);break;case"mouseup":this.removeAttribute(y.KEYBOARD_CONTROL);break;case"keyup":we(this,xi,Xa).call(this),this.setAttribute(y.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Zt(this,Ri,isNaN(i)?0:i)}get autohide(){return(Ie(this,Ri)===void 0?2:Ie(this,Ri)).toString()}get breakpoints(){return w(this,y.BREAKPOINTS)}set breakpoints(e){R(this,y.BREAKPOINTS,e)}get audio(){return k(this,y.AUDIO)}set audio(e){S(this,y.AUDIO,e)}get gesturesDisabled(){return k(this,y.GESTURES_DISABLED)}set gesturesDisabled(e){S(this,y.GESTURES_DISABLED,e)}get keyboardControl(){return k(this,y.KEYBOARD_CONTROL)}set keyboardControl(e){S(this,y.KEYBOARD_CONTROL,e)}get noAutohide(){return k(this,y.NO_AUTOHIDE)}set noAutohide(e){S(this,y.NO_AUTOHIDE,e)}get autohideOverControls(){return k(this,y.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){S(this,y.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return k(this,y.USER_INACTIVE)}set userInteractive(e){S(this,y.USER_INACTIVE,e)}};So=new WeakMap;wi=new WeakMap;za=new WeakMap;Ri=new WeakMap;yo=new WeakMap;Bs=new WeakSet;Lu=function(t){let e=this.media;for(let i of t){if(i.type!=="childList")continue;let a=i.removedNodes;for(let r of a){if(r.slot!="media"||i.target!=this)continue;let o=i.previousSibling&&i.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(r);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(r)}}if(e)for(let r of i.addedNodes)r===e&&this.handleMediaUpdated(e)}};Za=new WeakMap;ko=new WeakMap;$s=new WeakSet;wu=function(t){if(t.pointerType!=="mouse"&&t.timeStamp-Ie(this,So)<250)return;we(this,Mo,Vs).call(this),clearTimeout(Ie(this,za));let e=this.hasAttribute(y.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(t.target)||e)&&we(this,xi,Xa).call(this)};Ws=new WeakSet;Ru=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(y.USER_INACTIVE);[this,this.media].includes(t.target)&&e?we(this,Qa,Io).call(this):we(this,xi,Xa).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&we(this,xi,Xa).call(this)};Qa=new WeakSet;Io=function(){if(Ie(this,Ri)<0||this.hasAttribute(y.USER_INACTIVE))return;this.setAttribute(y.USER_INACTIVE,"");let t=new l.CustomEvent(Le.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};Mo=new WeakSet;Vs=function(){if(!this.hasAttribute(y.USER_INACTIVE))return;this.removeAttribute(y.USER_INACTIVE);let t=new l.CustomEvent(Le.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};xi=new WeakSet;Xa=function(){we(this,Mo,Vs).call(this),clearTimeout(Ie(this,za));let t=parseInt(this.autohide);t<0||Zt(this,za,setTimeout(()=>{we(this,Qa,Io).call(this)},t*1e3))};zt.shadowRootOptions={mode:"open"};zt.getTemplateHTML=$h;l.customElements.get("media-container")||l.customElements.define("media-container",zt);var Du=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},oe=(t,e,i)=>(Du(t,e,"read from private field"),i?i.call(t):e.get(t)),Ja=(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)},Co=(t,e,i,a)=>(Du(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Di,Oi,Lo,Qt,vt,Mt,Ct=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){Ja(this,vt),Ja(this,Di,void 0),Ja(this,Oi,void 0),Ja(this,Lo,void 0),Ja(this,Qt,new Set),Co(this,Di,e),Co(this,Oi,i),Co(this,Lo,new Set(a))}[Symbol.iterator](){return oe(this,vt,Mt).values()}get length(){return oe(this,vt,Mt).size}get value(){var e;return(e=[...oe(this,vt,Mt)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Co(this,Qt,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...oe(this,vt,Mt)][e]}values(){return oe(this,vt,Mt).values()}forEach(e,i){oe(this,vt,Mt).forEach(e,i)}add(...e){var i,a;e.forEach(r=>oe(this,Qt).add(r)),!(this.value===""&&!((i=oe(this,Di))!=null&&i.hasAttribute(`${oe(this,Oi)}`)))&&((a=oe(this,Di))==null||a.setAttribute(`${oe(this,Oi)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>oe(this,Qt).delete(a)),(i=oe(this,Di))==null||i.setAttribute(`${oe(this,Oi)}`,`${this.value}`)}contains(e){return oe(this,vt,Mt).has(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){return this.remove(e),this.add(i),e===i}};Di=new WeakMap;Oi=new WeakMap;Lo=new WeakMap;Qt=new WeakMap;vt=new WeakSet;Mt=function(){return oe(this,Qt).size?oe(this,Qt):oe(this,Lo)};var Yh=(t="")=>t.split(/\s+/),Ou=(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}},Xt=(t="",e={})=>Yh(t).map(i=>{let a=Ou(i);return{...e,...a}}),Ks=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?Ou(e):e):typeof t=="string"?Xt(t):[t]:[],wo=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,Et=(t=[])=>Array.prototype.map.call(t,wo).join(" "),qh=(t,e)=>i=>i[t]===e,Pu=t=>{let e=Object.entries(t).map(([i,a])=>qh(i,a));return i=>e.every(a=>a(i))},Jt=(t,e=[],i=[])=>{let a=Ks(i).map(Pu),r=o=>a.some(s=>s(o));Array.from(e).filter(r).forEach(o=>{o.mode=t})},jt=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:Pu(e);return Array.from(t.textTracks).filter(i)},Ro=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(n.MEDIA_SUBTITLES_SHOWING)};var Uu=t=>{var e;let{media:i,fullscreenElement:a}=t;try{let r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let o=(e=a[r])==null?void 0:e.call(a);if(o instanceof Promise)return o.catch(()=>{})}else i!=null&&i.webkitEnterFullscreen?i.webkitEnterFullscreen():i!=null&&i.requestFullscreen&&i.requestFullscreen()}catch(r){console.error(r)}},Nu="exitFullscreen"in V?"exitFullscreen":"webkitExitFullscreen"in V?"webkitExitFullscreen":"webkitCancelFullScreen"in V?"webkitCancelFullScreen":void 0,Hu=t=>{var e;let{documentElement:i}=t;if(Nu){let a=(e=i==null?void 0:i[Nu])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},ja="fullscreenElement"in V?"fullscreenElement":"webkitFullscreenElement"in V?"webkitFullscreenElement":void 0,Zh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[ja];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===mu.FULLSCREEN?i:a},Bu=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let o=Zh(t);if(!o)return!1;if(o===r||o===i)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(ja in s))return ue(o,r);for(;s!=null&&s[ja];){if(s[ja]===r)return!0;s=(e=s[ja])==null?void 0:e.shadowRoot}}return!1},zh="fullscreenEnabled"in V?"fullscreenEnabled":"webkitFullscreenEnabled"in V?"webkitFullscreenEnabled":void 0,$u=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[zh])||i&&"webkitSupportsFullscreen"in i};var xo,Gs=()=>{var t,e;return xo||(xo=(e=(t=V)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),xo)},Wu=async(t=Gs())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([Qh(t,i.signal),Xh(t,e)]);return i.abort(),a},Qh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),Xh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await ho(10)}return t.volume!==e},Jh=/.*Version\/.*Safari\/.*/.test(l.navigator.userAgent),Ys=(t=Gs())=>l.matchMedia("(display-mode: standalone)").matches&&Jh?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",qs=(t=Gs())=>$u({documentElement:V,media:t}),Fu=qs(),Vu=Ys(),Ku=!!l.WebKitPlaybackTargetAvailabilityEvent,Gu=!!l.chrome;var Pi=t=>jt(t.media,e=>[ve.SUBTITLES,ve.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),Zs=t=>jt(t.media,e=>e.mode===St.SHOWING&&[ve.SUBTITLES,ve.CAPTIONS].includes(e.kind)),Do=(t,e)=>{let i=Pi(t),a=Zs(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)Jt(St.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let o=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let T=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),_=T?[T,...globalThis.navigator.languages]:globalThis.navigator.languages,E=i.filter(f=>_.some(M=>f.language.toLowerCase().startsWith(M.split("-")[0]))).sort((f,M)=>{let b=_.findIndex(L=>f.language.toLowerCase().startsWith(L.split("-")[0])),C=_.findIndex(L=>M.language.toLowerCase().startsWith(L.split("-")[0]));return b-C});E[0]&&(o=E[0])}let{language:d,label:u,kind:p}=o;Jt(St.DISABLED,i,a),Jt(St.SHOWING,i,[{language:d,label:u,kind:p}])}}},Oo=(t,e)=>t===e?!0:t==null||e==null||typeof t!=typeof e?!1:typeof t=="number"&&Number.isNaN(t)&&Number.isNaN(e)?!0:typeof t!="object"?!1:Array.isArray(t)?jh(t,e):Object.entries(t).every(([i,a])=>i in e&&Oo(a,e[i])),jh=(t,e)=>{let i=Array.isArray(t),a=Array.isArray(e);return i!==a?!1:i||a?t.length!==e.length?!1:t.every((r,o)=>Oo(r,e[o])):!0};var ep=Object.values(Ne),Po,tp=Wu().then(t=>(Po=t,Po)),Yu=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof l.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=l.customElements.get(i);a&&e instanceof a||(await l.customElements.whenDefined(i),l.customElements.upgrade(e))}))},ip=new l.DOMParser,ap=t=>t&&(ip.parseFromString(t,"text/html").body.textContent||t),Ni={mediaError:{get(t,e){let{media:i}=t;if((e==null?void 0:e.type)!=="playing")return i==null?void 0:i.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(t,e){var i;let{media:a}=t;if((e==null?void 0:e.type)!=="playing")return(i=a==null?void 0:a.error)==null?void 0:i.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(t,e){var i,a;let{media:r}=t;if((e==null?void 0:e.type)!=="playing")return(a=(i=r==null?void 0:r.error)==null?void 0:i.message)!=null?a:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.paused)!=null?e:!0},set(t,e){var i;let{media:a}=e;a&&(t?a.pause():(i=a.play())==null||i.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(t,e){let{media:i}=t;return i?e?e.type==="playing":!i.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.playbackRate)!=null?e:1},set(t,e){let{media:i}=e;i&&Number.isFinite(+t)&&(i.playbackRate=+t)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.muted)!=null?e:!1},set(t,e){let{media:i,options:{noMutedPref:a}={}}=e;if(i){i.muted=t;try{let r=l.localStorage.getItem("media-chrome-pref-muted")!==null,o=i.hasAttribute("muted");if(a){r&&l.localStorage.removeItem("media-chrome-pref-muted");return}if(o&&!r)return;l.localStorage.setItem("media-chrome-pref-muted",t?"true":"false")}catch(r){console.debug("Error setting muted pref",r)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noMutedPref:i}}=e,{media:a}=e;if(!(!a||a.muted||i))try{let r=l.localStorage.getItem("media-chrome-pref-muted")==="true";Ni.mediaMuted.set(r,e),t(r)}catch(r){console.debug("Error getting muted pref",r)}}]},mediaLoop:{get(t){let{media:e}=t;return e==null?void 0:e.loop},set(t,e){let{media:i}=e;i&&(i.loop=t)},mediaEvents:["medialooprequest"]},mediaVolume:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.volume)!=null?e:1},set(t,e){let{media:i,options:{noVolumePref:a}={}}=e;if(i){try{t==null?l.localStorage.removeItem("media-chrome-pref-volume"):!i.hasAttribute("muted")&&!a&&l.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch(r){console.debug("Error setting volume pref",r)}Number.isFinite(+t)&&(i.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noVolumePref:i}}=e;if(!i)try{let{media:a}=e;if(!a)return;let r=l.localStorage.getItem("media-chrome-pref-volume");if(r==null)return;Ni.mediaVolume.set(+r,e),t(+r)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(t){let{media:e}=t;return typeof(e==null?void 0:e.volume)=="undefined"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.currentTime)!=null?e:0},set(t,e){let{media:i}=e;!i||!Ci(t)||(i.currentTime=t)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(t){let{media:e,options:{defaultDuration:i}={}}=t;return i&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?i:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(t){let{media:e}=t;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(t){var e;let{media:i}=t;if(!((e=i==null?void 0:i.seekable)!=null&&e.length))return;let a=i.seekable.start(0),r=i.seekable.end(i.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(t){var e;let{media:i}=t,a=(e=i==null?void 0:i.buffered)!=null?e:[];return Array.from(a).map((r,o)=>[Number(a.start(o).toFixed(3)),Number(a.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(t){let{media:e,options:{defaultStreamType:i}={}}=t,a=[Ne.LIVE,Ne.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(ep.includes(r))return r===Ne.UNKNOWN?a:r;let o=e.duration;return o===1/0?Ne.LIVE:Number.isFinite(o)?Ne.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(t){let{media:e}=t;if(!e)return Number.NaN;let{targetLiveWindow:i}=e,a=Ni.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===Ne.LIVE?0:i},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(t){let{media:e,options:{liveEdgeOffset:i=10}={}}=t;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Ni.mediaStreamType.get(t)===Ne.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let o=r.end(r.length-1)-i;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(t){return Pi(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return Zs(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i,a;let{media:r,options:o}=e;if(!r)return;let s=d=>{var u;!o.defaultSubtitles||d&&![ve.CAPTIONS,ve.SUBTITLES].includes((u=d==null?void 0:d.track)==null?void 0:u.kind)||Do(e,!0)};return r.addEventListener("loadstart",s),(i=r.textTracks)==null||i.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),()=>{var d,u;r.removeEventListener("loadstart",s),(d=r.textTracks)==null||d.removeEventListener("addtrack",s),(u=r.textTracks)==null||u.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(t){var e;let{media:i}=t;if(!i)return[];let[a]=jt(i,{kind:ve.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:o,endTime:s})=>({text:ap(r),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;if(!a)return;let r=a.querySelector('track[kind="chapters"][default][src]'),o=(i=a.shadowRoot)==null?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",t),o==null||o.addEventListener("load",t),()=>{r==null||r.removeEventListener("load",t),o==null||o.removeEventListener("load",t)}}]},mediaIsPip:{get(t){var e,i;let{media:a,documentElement:r}=t;if(!a||!r||!r.pictureInPictureElement)return!1;if(r.pictureInPictureElement===a)return!0;if(r.pictureInPictureElement instanceof HTMLMediaElement)return(e=a.localName)!=null&&e.includes("-")?ue(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let o=r.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===a)return!0;o=(i=o.pictureInPictureElement)==null?void 0:i.shadowRoot}}return!1},set(t,e){let{media:i}=e;if(i)if(t){if(!V.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(r=>{if(r.code===11){if(!i.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(i.readyState===0&&i.preload==="none"){let o=()=>{i.removeEventListener("loadedmetadata",s),i.preload="none"},s=()=>{i.requestPictureInPicture().catch(a),o()};i.addEventListener("loadedmetadata",s),i.preload="metadata",setTimeout(()=>{i.readyState===0&&a(),o()},1e3)}else throw r}else throw r})}else V.pictureInPictureElement&&V.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(t){var e,i,a;let{media:r}=t;return(a=(i=r==null?void 0:r.videoRenditions)==null?void 0:i[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=t,r=Array.prototype.findIndex.call(i.videoRenditions,o=>o.id==a);i.videoRenditions.selectedIndex!=r&&(i.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(t){var e,i;let{media:a}=t;return(i=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:i.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=t;for(let r of i.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(t){return Bu(t)},set(t,e,i){var a;t?(Uu(e),i.detail&&((a=e.media)==null||a.focus())):Hu(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(t){var e;let{media:i}=t;return!(i!=null&&i.remote)||((e=i.remote)==null?void 0:e.state)==="disconnected"?!1:!!i.remote.state},set(t,e){var i,a;let{media:r}=e;if(r&&!(t&&((i=r.remote)==null?void 0:i.state)!=="disconnected")&&!(!t&&((a=r.remote)==null?void 0:a.state)!=="connected")){if(typeof r.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}r.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(t,e){let{media:i}=e;if(i){if(!(i.webkitShowPlaybackTargetPicker&&l.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(t){let{media:e}=t;if(!Fu||!qs(e))return Ee.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!Vu||!Ys(e))return Ee.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Ee.UNAVAILABLE}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(Po===!1||(e==null?void 0:e.volume)==null)return Ee.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{Po==null&&tp.then(e=>t(e?void 0:Ee.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!Gu||!((i=a==null?void 0:a.remote)!=null&&i.state))return Ee.UNSUPPORTED;if(!(e==null||e==="available"))return Ee.UNAVAILABLE},stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(t,e){if(!Ku)return Ee.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Ee.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(t){var e;let{media:i}=t;if(!(i!=null&&i.videoRenditions))return Ee.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return Ee.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return Ee.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return Ee.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(t){let{options:{mediaLang:e}={}}=t;return e!=null?e:"en"}}};var qu={[m.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,o;let{media:s}=e,d=i!=null?i:void 0,u,p;if(s&&d!=null){let[f]=jt(s,{kind:ve.METADATA,label:"thumbnails"}),M=Array.prototype.find.call((a=f==null?void 0:f.cues)!=null?a:[],(b,C,L)=>C===0?b.endTime>d:C===L.length-1?b.startTime<=d:b.startTime<=d&&b.endTime>d);if(M){let b=/'^(?:[a-z]+:)?\/\//i.test(M.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,C=new URL(M.text,b);p=new URLSearchParams(C.hash).get("#xywh").split(",").map(ie=>+ie),u=C.href}}let T=t.mediaDuration.get(e),E=(o=t.mediaChaptersCues.get(e).find((f,M,b)=>M===b.length-1&&T===f.endTime?f.startTime<=d&&f.endTime>=d:f.startTime<=d&&f.endTime>d))==null?void 0:o.text;return i!=null&&E==null&&(E=""),{mediaPreviewTime:d,mediaPreviewImage:u,mediaPreviewCoords:p,mediaPreviewChapter:E}},[m.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[m.MEDIA_PLAY_REQUEST](t,e){var i,a,r,o;let s="mediaPaused",u=t.mediaStreamType.get(e)===Ne.LIVE,p=!((i=e.options)!=null&&i.noAutoSeekToLive),T=t.mediaTargetLiveWindow.get(e)>0;if(u&&p&&!T){let _=(a=t.mediaSeekable.get(e))==null?void 0:a[1];if(_){let E=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,f=_-E;t.mediaCurrentTime.set(f,e)}}t[s].set(!1,e)},[m.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[m.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[m.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[m.MEDIA_LOOP_REQUEST](t,e,{detail:i}){let a="mediaLoop",r=!!i;return t[a].set(r,e),{mediaLoop:r}},[m.MEDIA_VOLUME_REQUEST](t,e,{detail:i}){let a="mediaVolume",r=i;r&&t.mediaMuted.get(e)&&t.mediaMuted.set(!1,e),t[a].set(r,e)},[m.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[m.MEDIA_SEEK_TO_LIVE_REQUEST](t,e){var i,a,r;let o="mediaCurrentTime",s=(i=t.mediaSeekable.get(e))==null?void 0:i[1];if(Number.isNaN(Number(s)))return;let d=(r=(a=e.options)==null?void 0:a.seekToLiveOffset)!=null?r:0,u=s-d;t[o].set(u,e)},[m.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,o=Pi(e),s=Ks(i),d=(a=s[0])==null?void 0:a.language;d&&!r.noSubtitlesLangPref&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),Jt(St.SHOWING,o,s)},[m.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=Pi(e),r=i!=null?i:[];Jt(St.DISABLED,a,r)},[m.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){Do(e,i)},[m.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[m.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[m.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[m.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[m.MEDIA_ENTER_FULLSCREEN_REQUEST](t,e,i){let a="mediaIsFullscreen";t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t[a].set(!0,e,i)},[m.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[m.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[m.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[m.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var Zu=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Ni,requestMap:r=qu,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let d=[],u={options:{...o}},p=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),T=b=>{b!=null&&(Oo(b,p)||(p=Object.freeze({...p,...b}),d.forEach(C=>C(p))))},_=()=>{let b=Object.entries(a).reduce((C,[L,{get:ie}])=>(C[L]=ie(u),C),{});T(b)},E={},f,M=async(b,C)=>{var L,ie,Ae,kt,mt,Ia,Ma,Ca,La,wa,Ra,xa,Da,Oa,Pa,Na;let lo=!!f;if(f={...u,...f!=null?f:{},...b},lo)return;await Yu(...Object.values(b));let ht=d.length>0&&C===0&&s,Ua=u.media!==f.media,Ha=((L=u.media)==null?void 0:L.textTracks)!==((ie=f.media)==null?void 0:ie.textTracks),Ba=((Ae=u.media)==null?void 0:Ae.videoRenditions)!==((kt=f.media)==null?void 0:kt.videoRenditions),$a=((mt=u.media)==null?void 0:mt.audioTracks)!==((Ia=f.media)==null?void 0:Ia.audioTracks),Wa=((Ma=u.media)==null?void 0:Ma.remote)!==((Ca=f.media)==null?void 0:Ca.remote),qd=u.documentElement!==f.documentElement,Zd=!!u.media&&(Ua||ht),zd=!!((La=u.media)!=null&&La.textTracks)&&(Ha||ht),Qd=!!((wa=u.media)!=null&&wa.videoRenditions)&&(Ba||ht),Xd=!!((Ra=u.media)!=null&&Ra.audioTracks)&&($a||ht),Jd=!!((xa=u.media)!=null&&xa.remote)&&(Wa||ht),jd=!!u.documentElement&&(qd||ht),Ls=Zd||zd||Qd||Xd||Jd||jd,Ii=d.length===0&&C===1&&s,eu=!!f.media&&(Ua||Ii),tu=!!((Da=f.media)!=null&&Da.textTracks)&&(Ha||Ii),iu=!!((Oa=f.media)!=null&&Oa.videoRenditions)&&(Ba||Ii),au=!!((Pa=f.media)!=null&&Pa.audioTracks)&&($a||Ii),ru=!!((Na=f.media)!=null&&Na.remote)&&(Wa||Ii),ou=!!f.documentElement&&(qd||Ii),nu=eu||tu||iu||au||ru||ou;if(!(Ls||nu)){Object.entries(f).forEach(([F,Fa])=>{u[F]=Fa}),_(),f=void 0;return}Object.entries(a).forEach(([F,{get:Fa,mediaEvents:ch=[],textTracksEvents:mh=[],videoRenditionsEvents:hh=[],audioTracksEvents:ph=[],remoteEvents:fh=[],rootEvents:vh=[],stateOwnersUpdateHandlers:Eh=[]}])=>{E[F]||(E[F]={});let Te=z=>{let ee=Fa(u,z);T({[F]:ee})},re;re=E[F].mediaEvents,ch.forEach(z=>{re&&Zd&&(u.media.removeEventListener(z,re),E[F].mediaEvents=void 0),eu&&(f.media.addEventListener(z,Te),E[F].mediaEvents=Te)}),re=E[F].textTracksEvents,mh.forEach(z=>{var ee,Pe;re&&zd&&((ee=u.media.textTracks)==null||ee.removeEventListener(z,re),E[F].textTracksEvents=void 0),tu&&((Pe=f.media.textTracks)==null||Pe.addEventListener(z,Te),E[F].textTracksEvents=Te)}),re=E[F].videoRenditionsEvents,hh.forEach(z=>{var ee,Pe;re&&Qd&&((ee=u.media.videoRenditions)==null||ee.removeEventListener(z,re),E[F].videoRenditionsEvents=void 0),iu&&((Pe=f.media.videoRenditions)==null||Pe.addEventListener(z,Te),E[F].videoRenditionsEvents=Te)}),re=E[F].audioTracksEvents,ph.forEach(z=>{var ee,Pe;re&&Xd&&((ee=u.media.audioTracks)==null||ee.removeEventListener(z,re),E[F].audioTracksEvents=void 0),au&&((Pe=f.media.audioTracks)==null||Pe.addEventListener(z,Te),E[F].audioTracksEvents=Te)}),re=E[F].remoteEvents,fh.forEach(z=>{var ee,Pe;re&&Jd&&((ee=u.media.remote)==null||ee.removeEventListener(z,re),E[F].remoteEvents=void 0),ru&&((Pe=f.media.remote)==null||Pe.addEventListener(z,Te),E[F].remoteEvents=Te)}),re=E[F].rootEvents,vh.forEach(z=>{re&&jd&&(u.documentElement.removeEventListener(z,re),E[F].rootEvents=void 0),ou&&(f.documentElement.addEventListener(z,Te),E[F].rootEvents=Te)});let uo=E[F].stateOwnersUpdateHandlers;if(uo&&Ls&&(Array.isArray(uo)?uo:[uo]).forEach(ee=>{typeof ee=="function"&&ee()}),nu){let z=Eh.map(ee=>ee(Te,f)).filter(ee=>typeof ee=="function");E[F].stateOwnersUpdateHandlers=z.length===1?z[0]:z}else Ls&&(E[F].stateOwnersUpdateHandlers=void 0)}),Object.entries(f).forEach(([F,Fa])=>{u[F]=Fa}),_(),f=void 0};return M({media:t,fullscreenElement:e,documentElement:i,options:o}),{dispatch(b){let{type:C,detail:L}=b;if(r[C]&&p.mediaErrorCode==null){T(r[C](a,u,b));return}C==="mediaelementchangerequest"?M({media:L}):C==="fullscreenelementchangerequest"?M({fullscreenElement:L}):C==="documentelementchangerequest"?M({documentElement:L}):C==="optionschangerequest"&&(Object.entries(L!=null?L:{}).forEach(([ie,Ae])=>{u.options[ie]=Ae}),_())},getState(){return p},subscribe(b){return M({},d.length+1),d.push(b),b(p),()=>{let C=d.indexOf(b);C>=0&&(M({},d.length-1),d.splice(C,1))}}}};var js=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},I=(t,e,i)=>(js(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)},Ke=(t,e,i,a)=>(js(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ye=(t,e,i)=>(js(t,e,"access private method"),i),Lt,er,U,ti,tr,Ge,No,ir,Uo,zs,ii,Ui,Ho,Qs,Xs,tc,ic=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],zu=10,Qu=.025,Xu=.25,rp=.25,op=2,v={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},Bo=class extends zt{constructor(){super(),Re(this,Uo),Re(this,ii),Re(this,Ho),Re(this,Xs),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Re(this,Lt,new Ct(this,v.HOTKEYS)),Re(this,er,void 0),Re(this,U,void 0),Re(this,ti,null),Re(this,tr,void 0),Re(this,Ge,void 0),Re(this,No,i=>{var a;(a=I(this,U))==null||a.dispatch(i)}),Re(this,ir,void 0),this.associateElement(this);let e={};Ke(this,tr,i=>{Object.entries(i).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let o=a.toLowerCase(),s=new l.CustomEvent(cu[o],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.hasAttribute(v.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(v.NO_HOTKEYS,v.HOTKEYS,v.DEFAULT_STREAM_TYPE,v.DEFAULT_SUBTITLES,v.DEFAULT_DURATION,v.NO_MUTED_PREF,v.NO_VOLUME_PREF,v.LANG,v.LOOP)}get mediaStore(){return I(this,U)}set mediaStore(e){var i,a;if(I(this,U)&&((i=I(this,Ge))==null||i.call(this),Ke(this,Ge,void 0)),Ke(this,U,e),!I(this,U)&&!this.hasAttribute(v.NO_DEFAULT_STORE)){Ye(this,Uo,zs).call(this);return}Ke(this,Ge,(a=I(this,U))==null?void 0:a.subscribe(I(this,tr)))}get fullscreenElement(){var e;return(e=I(this,er))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(v.FULLSCREEN_ELEMENT)&&this.removeAttribute(v.FULLSCREEN_ELEMENT),Ke(this,er,e),(i=I(this,U))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return k(this,v.DEFAULT_SUBTITLES)}set defaultSubtitles(e){S(this,v.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return w(this,v.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){R(this,v.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return O(this,v.DEFAULT_DURATION)}set defaultDuration(e){N(this,v.DEFAULT_DURATION,e)}get noHotkeys(){return k(this,v.NO_HOTKEYS)}set noHotkeys(e){S(this,v.NO_HOTKEYS,e)}get keysUsed(){return w(this,v.KEYS_USED)}set keysUsed(e){R(this,v.KEYS_USED,e)}get liveEdgeOffset(){return O(this,v.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){N(this,v.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return k(this,v.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){S(this,v.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return k(this,v.NO_VOLUME_PREF)}set noVolumePref(e){S(this,v.NO_VOLUME_PREF,e)}get noMutedPref(){return k(this,v.NO_MUTED_PREF)}set noMutedPref(e){S(this,v.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return k(this,v.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){S(this,v.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return k(this,v.NO_DEFAULT_STORE)}set noDefaultStore(e){S(this,v.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,o,s,d,u,p,T,_,E,f,M,b;if(super.attributeChangedCallback(e,i,a),e===v.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(v.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==i&&a===null&&this.enableHotkeys();else if(e===v.HOTKEYS)I(this,Lt).value=a;else if(e===v.DEFAULT_SUBTITLES&&a!==i)(r=I(this,U))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(v.DEFAULT_SUBTITLES)}});else if(e===v.DEFAULT_STREAM_TYPE)(s=I(this,U))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(v.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===v.LIVE_EDGE_OFFSET)(d=I(this,U))==null||d.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(v.LIVE_EDGE_OFFSET)}});else if(e===v.SEEK_TO_LIVE_OFFSET)(u=I(this,U))==null||u.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(v.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===v.NO_AUTO_SEEK_TO_LIVE)(p=I(this,U))==null||p.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(v.NO_AUTO_SEEK_TO_LIVE)}});else if(e===v.FULLSCREEN_ELEMENT){let C=a?(T=this.getRootNode())==null?void 0:T.getElementById(a):void 0;Ke(this,er,C),(_=I(this,U))==null||_.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===v.LANG&&a!==i?(Au(a),(E=I(this,U))==null||E.dispatch({type:"optionschangerequest",detail:{mediaLang:a}})):e===v.LOOP&&a!==i?(f=I(this,U))==null||f.dispatch({type:m.MEDIA_LOOP_REQUEST,detail:a!=null}):e===v.NO_VOLUME_PREF&&a!==i?(M=I(this,U))==null||M.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(v.NO_VOLUME_PREF)}}):e===v.NO_MUTED_PREF&&a!==i&&((b=I(this,U))==null||b.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(v.NO_MUTED_PREF)}}))}connectedCallback(){var e,i;!I(this,U)&&!this.hasAttribute(v.NO_DEFAULT_STORE)&&Ye(this,Uo,zs).call(this),(e=I(this,U))==null||e.dispatch({type:"documentelementchangerequest",detail:V}),super.connectedCallback(),I(this,U)&&!I(this,Ge)&&Ke(this,Ge,(i=I(this,U))==null?void 0:i.subscribe(I(this,tr))),I(this,ir)!==void 0&&I(this,U)&&this.media&&setTimeout(()=>{var a,r,o;(r=(a=this.media)==null?void 0:a.textTracks)!=null&&r.length&&((o=I(this,U))==null||o.dispatch({type:m.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:I(this,ir)}))},0),this.hasAttribute(v.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,i,a,r,o;if((e=super.disconnectedCallback)==null||e.call(this),I(this,U)){let s=I(this,U).getState();Ke(this,ir,!!((i=s.mediaSubtitlesShowing)!=null&&i.length)),(a=I(this,U))==null||a.dispatch({type:"documentelementchangerequest",detail:void 0}),(r=I(this,U))==null||r.dispatch({type:m.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}I(this,Ge)&&((o=I(this,Ge))==null||o.call(this),Ke(this,Ge,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=I(this,U))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=I(this,U))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){ec(this.mediaStateReceivers,e,i)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(i.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),o=cp(e,a,r);Object.values(m).forEach(s=>{e.addEventListener(s,I(this,No))}),i.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(!i.has(e))return;i.get(e)(),i.delete(e),Object.values(m).forEach(r=>{e.removeEventListener(r,I(this,No))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),I(this,U)&&Object.entries(I(this,U).getState()).forEach(([r,o])=>{ec([e],r,o)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Ye(this,Ho,Qs))}disableHotkeys(){this.removeEventListener("keydown",Ye(this,Ho,Qs)),this.removeEventListener("keyup",Ye(this,ii,Ui))}get hotkeys(){return w(this,v.HOTKEYS)}set hotkeys(e){R(this,v.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,o,s,d,u,p,T;let _=e.target;if(((r=(a=(i=_.getAttribute(v.KEYS_USED))==null?void 0:i.split(" "))!=null?a:_==null?void 0:_.keysUsed)!=null?r:[]).map(L=>L==="Space"?" ":L).filter(Boolean).includes(e.key))return;let f,M,b;if(!(I(this,Lt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&I(this,Lt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&I(this,Lt).contains("noshift+/")))switch(e.key){case" ":case"k":f=I(this,U).getState().mediaPaused?m.MEDIA_PLAY_REQUEST:m.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"m":f=this.mediaStore.getState().mediaVolumeLevel==="off"?m.MEDIA_UNMUTE_REQUEST:m.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"f":f=this.mediaStore.getState().mediaIsFullscreen?m.MEDIA_EXIT_FULLSCREEN_REQUEST:m.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(m.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let L=this.hasAttribute(v.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(v.KEYBOARD_BACKWARD_SEEK_OFFSET):zu;M=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-L,0),b=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:M}),this.dispatchEvent(b);break}case"ArrowRight":case"l":{let L=this.hasAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET):zu;M=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+L,0),b=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:M}),this.dispatchEvent(b);break}case"ArrowUp":{let L=this.hasAttribute(v.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_UP_VOLUME_STEP):Qu;M=Math.min(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)+L,1),b=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:M}),this.dispatchEvent(b);break}case"ArrowDown":{let L=this.hasAttribute(v.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_DOWN_VOLUME_STEP):Qu;M=Math.max(((u=this.mediaStore.getState().mediaVolume)!=null?u:1)-L,0),b=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:M}),this.dispatchEvent(b);break}case"<":{let L=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;M=Math.max(L-Xu,rp).toFixed(2),b=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:M}),this.dispatchEvent(b);break}case">":{let L=(T=this.mediaStore.getState().mediaPlaybackRate)!=null?T:1;M=Math.min(L+Xu,op).toFixed(2),b=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:M}),this.dispatchEvent(b);break}case"/":case"?":{e.shiftKey&&Ye(this,Xs,tc).call(this);break}case"p":{f=this.mediaStore.getState().mediaIsPip?m.MEDIA_EXIT_PIP_REQUEST:m.MEDIA_ENTER_PIP_REQUEST,b=new l.CustomEvent(f,{composed:!0,bubbles:!0}),this.dispatchEvent(b);break}default:break}}};Lt=new WeakMap;er=new WeakMap;U=new WeakMap;ti=new WeakMap;tr=new WeakMap;Ge=new WeakMap;No=new WeakMap;ir=new WeakMap;Uo=new WeakSet;zs=function(){var t;this.mediaStore=Zu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(v.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(v.DEFAULT_DURATION)?+this.getAttribute(v.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(v.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(v.SEEK_TO_LIVE_OFFSET):this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(v.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(v.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(v.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(v.NO_SUBTITLES_LANG_PREF)}})};ii=new WeakSet;Ui=function(t){let{key:e,shiftKey:i}=t;if(!(i&&(e==="/"||e==="?")||ic.includes(e))){this.removeEventListener("keyup",Ye(this,ii,Ui));return}this.keyboardShortcutHandler(t)};Ho=new WeakSet;Qs=function(t){var e;let{metaKey:i,altKey:a,key:r,shiftKey:o}=t,s=o&&(r==="/"||r==="?");if(s&&((e=I(this,ti))!=null&&e.open)){this.removeEventListener("keyup",Ye(this,ii,Ui));return}if(i||a||!s&&!ic.includes(r)){this.removeEventListener("keyup",Ye(this,ii,Ui));return}let d=t.target,u=d instanceof HTMLElement&&(d.tagName.toLowerCase()==="media-volume-range"||d.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(r)&&!(I(this,Lt).contains(`no${r.toLowerCase()}`)||r===" "&&I(this,Lt).contains("nospace"))&&!u&&t.preventDefault(),this.addEventListener("keyup",Ye(this,ii,Ui),{once:!0})};Xs=new WeakSet;tc=function(){I(this,ti)||(Ke(this,ti,V.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(I(this,ti))),I(this,ti).open=!0};var np=Object.values(n),sp=Object.values(Os),ac=t=>{var e,i,a,r;let{observedAttributes:o}=t.constructor;!o&&((e=t.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(t),{observedAttributes:o}=t.constructor);let s=(r=(a=(i=t==null?void 0:t.getAttribute)==null?void 0:i.call(t,x.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(o||s)?(o||s).filter(d=>np.includes(d)):[]},lp=t=>{var e,i;return(e=t.nodeName)!=null&&e.includes("-")&&l.customElements.get((i=t.nodeName)==null?void 0:i.toLowerCase())&&!(t instanceof l.customElements.get(t.nodeName.toLowerCase()))&&l.customElements.upgrade(t),sp.some(a=>a in t)},Js=t=>lp(t)||!!ac(t).length,Ju=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},ju={[n.MEDIA_SUBTITLES_LIST]:Et,[n.MEDIA_SUBTITLES_SHOWING]:Et,[n.MEDIA_SEEKABLE]:Ju,[n.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(Ju).join(" "),[n.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[n.MEDIA_RENDITION_LIST]:hu,[n.MEDIA_AUDIO_TRACK_LIST]:fu},dp=async(t,e,i)=>{var a,r;if(t.isConnected||await ho(0),typeof i=="boolean"||i==null)return S(t,e,i);if(typeof i=="number")return N(t,e,i);if(typeof i=="string")return R(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let o=(r=(a=ju[e])==null?void 0:a.call(ju,i))!=null?r:i;return t.setAttribute(e,o)},up=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},ei=(t,e)=>{if(up(t))return;let i=(r,o)=>{var s,d;Js(r)&&o(r);let{children:u=[]}=r!=null?r:{},p=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...u,...p].forEach(_=>ei(_,o))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Js(t)){l.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},ec=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=ac(a),o=e.toLowerCase();r.includes(o)&&dp(a,o,i)})},cp=(t,e,i)=>{ei(t,e);let a=T=>{var _;let E=(_=T==null?void 0:T.composedPath()[0])!=null?_:T.target;e(E)},r=T=>{var _;let E=(_=T==null?void 0:T.composedPath()[0])!=null?_:T.target;i(E)};t.addEventListener(m.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(m.UNREGISTER_MEDIA_STATE_RECEIVER,r);let o=T=>{T.forEach(_=>{let{addedNodes:E=[],removedNodes:f=[],type:M,target:b,attributeName:C}=_;M==="childList"?(Array.prototype.forEach.call(E,L=>ei(L,e)),Array.prototype.forEach.call(f,L=>ei(L,i))):M==="attributes"&&C===x.MEDIA_CHROME_ATTRIBUTES&&(Js(b)?e(b):i(b))})},s=[],d=T=>{let _=T.target;_.name!=="media"&&(s.forEach(E=>ei(E,i)),s=[..._.assignedElements({flatten:!0})],s.forEach(E=>ei(E,e)))};t.addEventListener("slotchange",d);let u=new MutationObserver(o);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{ei(t,i),t.removeEventListener("slotchange",d),u.disconnect(),t.removeEventListener(m.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(m.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",Bo);var el=Bo;var Hi={PLACEMENT:"placement",BOUNDS:"bounds"};function mp(t){return`
|
|
160
160
|
<style>
|
|
161
161
|
:host {
|
|
162
162
|
--_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
</style>
|
|
266
266
|
<slot></slot>
|
|
267
267
|
<div id="arrow"></div>
|
|
268
|
-
`}var Bi=class extends l.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!
|
|
268
|
+
`}var Bi=class extends l.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!_o(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let i=this.placement;if(i==="left"||i==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ve(this,"#"+this.bounds))!=null?e:Y(this);if(!r)return;let{x:o,width:s}=r.getBoundingClientRect(),{x:d,width:u}=this.getBoundingClientRect(),p=d+u,T=o+s,_=a.getPropertyValue("--media-tooltip-offset-x"),E=_?parseFloat(_.replace("px","")):0,f=a.getPropertyValue("--media-tooltip-container-margin"),M=f?parseFloat(f.replace("px","")):0,b=d-o+E-M,C=p-T+E+M;if(b<0){this.style.setProperty("--media-tooltip-offset-x",`${b}px`);return}if(C>0){this.style.setProperty("--media-tooltip-offset-x",`${C}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Hi.PLACEMENT,Hi.BOUNDS]}get placement(){return w(this,Hi.PLACEMENT)}set placement(e){R(this,Hi.PLACEMENT,e)}get bounds(){return w(this,Hi.BOUNDS)}set bounds(e){R(this,Hi.BOUNDS,e)}};Bi.shadowRootOptions={mode:"open"};Bi.getTemplateHTML=mp;l.customElements.get("media-tooltip")||l.customElements.define("media-tooltip",Bi);var $o=Bi;var il=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},te=(t,e,i)=>(il(t,e,"read from private field"),i?i.call(t):e.get(t)),$i=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Wo=(t,e,i,a)=>(il(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),hp=(t,e,i)=>(il(t,e,"access private method"),i),qe,Fi,Rt,Wi,Fo,tl,rc,wt={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function pp(t,e={}){return`
|
|
269
269
|
<style>
|
|
270
270
|
:host {
|
|
271
271
|
position: relative;
|
|
@@ -339,8 +339,8 @@
|
|
|
339
339
|
|
|
340
340
|
<slot name="tooltip">
|
|
341
341
|
<media-tooltip part="tooltip" aria-hidden="true">
|
|
342
|
-
<template shadowrootmode="${
|
|
343
|
-
${
|
|
342
|
+
<template shadowrootmode="${$o.shadowRootOptions.mode}">
|
|
343
|
+
${$o.getTemplateHTML({})}
|
|
344
344
|
</template>
|
|
345
345
|
<slot name="tooltip-content">
|
|
346
346
|
${this.getTooltipContentHTML(t)}
|
|
@@ -349,7 +349,7 @@
|
|
|
349
349
|
</slot>
|
|
350
350
|
`}function fp(t,e){return`
|
|
351
351
|
<slot></slot>
|
|
352
|
-
`}function vp(){return""}var H=class extends l.HTMLElement{constructor(){if(super(),$i(this,
|
|
352
|
+
`}function vp(){return""}var H=class extends l.HTMLElement{constructor(){if(super(),$i(this,tl),$i(this,qe,void 0),this.preventClick=!1,this.tooltipEl=null,$i(this,Fi,e=>{this.preventClick||this.handleClick(e),setTimeout(te(this,Rt),0)}),$i(this,Rt,()=>{var e,i;(i=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||i.call(e)}),$i(this,Wi,e=>{let{key:i}=e;if(!this.keysUsed.includes(i)){this.removeEventListener("keyup",te(this,Wi));return}this.preventClick||this.handleClick(e)}),$i(this,Fo,e=>{let{metaKey:i,altKey:a,key:r}=e;if(i||a||!this.keysUsed.includes(r)){this.removeEventListener("keyup",te(this,Wi));return}this.addEventListener("keyup",te(this,Wi),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes),i=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(i):this.shadowRoot.innerHTML=i}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",wt.TOOLTIP_PLACEMENT,x.MEDIA_CONTROLLER,n.MEDIA_LANG]}enable(){this.addEventListener("click",te(this,Fi)),this.addEventListener("keydown",te(this,Fo)),this.tabIndex=0}disable(){this.removeEventListener("click",te(this,Fi)),this.removeEventListener("keydown",te(this,Fo)),this.removeEventListener("keyup",te(this,Wi)),this.tabIndex=-1}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER?(i&&((o=(r=te(this,qe))==null?void 0:r.unassociateElement)==null||o.call(r,this),Wo(this,qe,null)),a&&this.isConnected&&(Wo(this,qe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=te(this,qe))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===wt.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==i?this.tooltipEl.placement=a:e===n.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),te(this,Rt).call(this)}connectedCallback(){var e,i,a;let{style:r}=q(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let o=this.getAttribute(x.MEDIA_CONTROLLER);o&&(Wo(this,qe,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=te(this,qe))==null?void 0:i.associateElement)==null||a.call(i,this)),l.customElements.whenDefined("media-tooltip").then(()=>hp(this,tl,rc).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=te(this,qe))==null?void 0:e.unassociateElement)==null||i.call(e,this),Wo(this,qe,null),this.removeEventListener("mouseenter",te(this,Rt)),this.removeEventListener("focus",te(this,Rt)),this.removeEventListener("click",te(this,Fi))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return w(this,wt.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){R(this,wt.TOOLTIP_PLACEMENT,e)}get mediaController(){return w(this,x.MEDIA_CONTROLLER)}set mediaController(e){R(this,x.MEDIA_CONTROLLER,e)}get disabled(){return k(this,wt.DISABLED)}set disabled(e){S(this,wt.DISABLED,e)}get noTooltip(){return k(this,wt.NO_TOOLTIP)}set noTooltip(e){S(this,wt.NO_TOOLTIP,e)}handleClick(e){}};qe=new WeakMap;Fi=new WeakMap;Rt=new WeakMap;Wi=new WeakMap;Fo=new WeakMap;tl=new WeakSet;rc=function(){this.addEventListener("mouseenter",te(this,Rt)),this.addEventListener("focus",te(this,Rt)),this.addEventListener("click",te(this,Fi));let t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)};H.shadowRootOptions={mode:"open"};H.getTemplateHTML=pp;H.getSlotTemplateHTML=fp;H.getTooltipContentHTML=vp;l.customElements.get("media-chrome-button")||l.customElements.define("media-chrome-button",H);var oc=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
353
353
|
<path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
|
|
354
354
|
</svg>
|
|
355
355
|
`;function Ep(t){return`
|
|
@@ -376,7 +376,7 @@
|
|
|
376
376
|
`}function bp(){return`
|
|
377
377
|
<slot name="tooltip-enter">${h("start airplay")}</slot>
|
|
378
378
|
<slot name="tooltip-exit">${h("stop airplay")}</slot>
|
|
379
|
-
`}var nc=t=>{let e=t.mediaIsAirplaying?h("stop airplay"):h("start airplay");t.setAttribute("aria-label",e)},
|
|
379
|
+
`}var nc=t=>{let e=t.mediaIsAirplaying?h("stop airplay"):h("start airplay");t.setAttribute("aria-label",e)},ar=class extends H{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_AIRPLAYING,n.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),nc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_AIRPLAYING&&nc(this)}get mediaIsAirplaying(){return k(this,n.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){S(this,n.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return w(this,n.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){R(this,n.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new l.CustomEvent(m.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};ar.getSlotTemplateHTML=Ep;ar.getTooltipContentHTML=bp;l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",ar);var gp=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
380
380
|
<path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
|
|
381
381
|
</svg>`,_p=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
382
382
|
<path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
|
|
@@ -404,7 +404,7 @@
|
|
|
404
404
|
`}function Tp(){return`
|
|
405
405
|
<slot name="tooltip-enable">${h("Enable captions")}</slot>
|
|
406
406
|
<slot name="tooltip-disable">${h("Disable captions")}</slot>
|
|
407
|
-
`}var sc=t=>{t.setAttribute("aria-checked",
|
|
407
|
+
`}var sc=t=>{t.setAttribute("aria-checked",Ro(t).toString())},rr=class extends H{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",h("closed captions")),sc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING&&sc(this)}get mediaSubtitlesList(){return lc(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){dc(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return lc(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){dc(this,n.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(m.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};rr.getSlotTemplateHTML=Ap;rr.getTooltipContentHTML=Tp;var lc=(t,e)=>{let i=t.getAttribute(e);return i?Xt(i):[]},dc=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=Et(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",rr);var yp='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',kp='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>';function Sp(t){return`
|
|
408
408
|
<style>
|
|
409
409
|
:host([${n.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
|
|
410
410
|
display: none !important;
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
`}function Ip(){return`
|
|
429
429
|
<slot name="tooltip-enter">${h("Start casting")}</slot>
|
|
430
430
|
<slot name="tooltip-exit">${h("Stop casting")}</slot>
|
|
431
|
-
`}var uc=t=>{let e=t.mediaIsCasting?h("stop casting"):h("start casting");t.setAttribute("aria-label",e)},
|
|
431
|
+
`}var uc=t=>{let e=t.mediaIsCasting?h("stop casting"):h("start casting");t.setAttribute("aria-label",e)},or=class extends H{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_CASTING,n.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),uc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_CASTING&&uc(this)}get mediaIsCasting(){return k(this,n.MEDIA_IS_CASTING)}set mediaIsCasting(e){S(this,n.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return w(this,n.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){R(this,n.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?m.MEDIA_EXIT_CAST_REQUEST:m.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};or.getSlotTemplateHTML=Sp;or.getTooltipContentHTML=Ip;l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",or);var dl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ri=(t,e,i)=>(dl(t,e,"read from private field"),i?i.call(t):e.get(t)),bt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ul=(t,e,i,a)=>(dl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ai=(t,e,i)=>(dl(t,e,"access private method"),i),Ko,sr,oi,Vo,al,rl,cc,ol,mc,nl,hc,sl,pc,ll,fc;function Mp(t){return`
|
|
432
432
|
<style>
|
|
433
433
|
:host {
|
|
434
434
|
font: var(--media-font,
|
|
@@ -471,7 +471,7 @@
|
|
|
471
471
|
${this.getSlotTemplateHTML(t)}
|
|
472
472
|
`}function Cp(t){return`
|
|
473
473
|
<slot id="content"></slot>
|
|
474
|
-
`}var
|
|
474
|
+
`}var nr={OPEN:"open",ANCHOR:"anchor"},Ze=class extends l.HTMLElement{constructor(){super(),bt(this,Vo),bt(this,rl),bt(this,ol),bt(this,nl),bt(this,sl),bt(this,ll),bt(this,Ko,!1),bt(this,sr,null),bt(this,oi,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[nr.OPEN,nr.ANCHOR]}get open(){return k(this,nr.OPEN)}set open(e){S(this,nr.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":ai(this,nl,hc).call(this,e);break;case"focusout":ai(this,sl,pc).call(this,e);break;case"keydown":ai(this,ll,fc).call(this,e);break}}connectedCallback(){ai(this,Vo,al).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,i,a){ai(this,Vo,al).call(this),e===nr.OPEN&&a!==i&&(this.open?ai(this,rl,cc).call(this):ai(this,ol,mc).call(this))}focus(){ul(this,sr,Ya());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"]}};Ko=new WeakMap;sr=new WeakMap;oi=new WeakMap;Vo=new WeakSet;al=function(){if(!ri(this,Ko)&&(ul(this,Ko,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let t=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(t),queueMicrotask(()=>{let{style:e}=q(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};rl=new WeakSet;cc=function(){var t;(t=ri(this,oi))==null||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};ol=new WeakSet;mc=function(){var t;(t=ri(this,oi))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};nl=new WeakSet;hc=function(t){ul(this,oi,t.relatedTarget),ue(this,t.relatedTarget)||(this.open=!this.open)};sl=new WeakSet;pc=function(t){var e;ue(this,t.relatedTarget)||((e=ri(this,sr))==null||e.focus(),ri(this,oi)&&ri(this,oi)!==t.relatedTarget&&this.open&&(this.open=!1))};ll=new WeakSet;fc=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:p}=t;d||u||p||this.keysUsed.includes(s)&&(t.preventDefault(),t.stopPropagation(),s==="Tab"?(t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()):s==="Escape"&&((o=ri(this,sr))==null||o.focus(),this.open=!1))};Ze.shadowRootOptions={mode:"open"};Ze.getTemplateHTML=Mp;Ze.getSlotTemplateHTML=Cp;l.customElements.get("media-chrome-dialog")||l.customElements.define("media-chrome-dialog",Ze);var El=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Q=(t,e,i)=>(El(t,e,"read from private field"),i?i.call(t):e.get(t)),se=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},xt=(t,e,i,a)=>(El(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),He=(t,e,i)=>(El(t,e,"access private method"),i),ze,en,Go,Yo,Be,Jo,qo,Zo,zo,bl,vc,Qo,cl,Xo,ml,jo,gl,hl,Ec,pl,bc,fl,gc,vl,_c;function Lp(t){return`
|
|
475
475
|
<style>
|
|
476
476
|
:host {
|
|
477
477
|
--_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
@@ -701,7 +701,7 @@
|
|
|
701
701
|
${this.getContainerTemplateHTML(t)}
|
|
702
702
|
</div>
|
|
703
703
|
<div id="rightgap"></div>
|
|
704
|
-
`}function wp(t){return""}var
|
|
704
|
+
`}function wp(t){return""}var Qe=class extends l.HTMLElement{constructor(){if(super(),se(this,bl),se(this,Qo),se(this,Xo),se(this,jo),se(this,hl),se(this,pl),se(this,fl),se(this,vl),se(this,ze,void 0),se(this,en,void 0),se(this,Go,void 0),se(this,Yo,void 0),se(this,Be,{}),se(this,Jo,[]),se(this,qo,()=>{if(this.range.matches(":focus-visible")){let{style:e}=q(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),se(this,Zo,()=>{let{style:e}=q(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),se(this,zo,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes),i=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(i):this.shadowRoot.innerHTML=i}this.container=this.shadowRoot.querySelector("#container"),xt(this,Go,this.shadowRoot.querySelector("#startpoint")),xt(this,Yo,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",x.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER?(i&&((o=(r=Q(this,ze))==null?void 0:r.unassociateElement)==null||o.call(r,this),xt(this,ze,null)),a&&this.isConnected&&(xt(this,ze,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=Q(this,ze))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),He(this,Qo,cl).call(this)):(this.range.setAttribute(e,a),He(this,Xo,ml).call(this)))}connectedCallback(){var e,i,a;let{style:r}=q(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),Q(this,Be).pointer=q(this.shadowRoot,"#pointer"),Q(this,Be).progress=q(this.shadowRoot,"#progress"),Q(this,Be).thumb=q(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),Q(this,Be).activeSegment=q(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(x.MEDIA_CONTROLLER);o&&(xt(this,ze,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=Q(this,ze))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Q(this,qo)),this.shadowRoot.addEventListener("focusout",Q(this,Zo)),He(this,Qo,cl).call(this),pt(this.container,Q(this,zo))}disconnectedCallback(){var e,i;He(this,Xo,ml).call(this),(i=(e=Q(this,ze))==null?void 0:e.unassociateElement)==null||i.call(e,this),xt(this,ze,null),this.shadowRoot.removeEventListener("focusin",Q(this,qo)),this.shadowRoot.removeEventListener("focusout",Q(this,Zo)),ft(this.container,Q(this,zo))}updatePointerBar(e){var i;(i=Q(this,Be).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=Q(this,Be).progress)==null||e.style.setProperty("width",`${a}%`),(i=Q(this,Be).thumb)==null||i.style.setProperty("left",`${a}%`)}updateSegments(e){let i=this.shadowRoot.querySelector("#segments-clipping");if(i.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let a=[...new Set([+this.range.min,...e.flatMap(o=>[o.start,o.end]),+this.range.max])];xt(this,Jo,[...a]);let r=a.pop();for(let[o,s]of a.entries()){let[d,u]=[o===0,o===a.length-1],p=d?"calc(var(--segments-gap) / -1)":`${s*100}%`,_=`calc(${((u?r:a[o+1])-s)*100}%${d||u?"":" - var(--segments-gap)"})`,E=V.createElementNS("http://www.w3.org/2000/svg","rect"),f=qa(this.shadowRoot,`#segments-clipping rect:nth-child(${o+1})`);f.style.setProperty("x",p),f.style.setProperty("width",_),i.append(E)}}getPointerRatio(e){return Mu(e.clientX,e.clientY,Q(this,Go).getBoundingClientRect(),Q(this,Yo).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":He(this,vl,_c).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":He(this,hl,Ec).call(this,e);break;case"pointerdown":He(this,jo,gl).call(this,e);break;case"pointerup":He(this,pl,bc).call(this);break;case"pointerleave":He(this,fl,gc).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};ze=new WeakMap;en=new WeakMap;Go=new WeakMap;Yo=new WeakMap;Be=new WeakMap;Jo=new WeakMap;qo=new WeakMap;Zo=new WeakMap;zo=new WeakMap;bl=new WeakSet;vc=function(t){let e=Q(this,Be).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${Q(this,Jo).findIndex((o,s,d)=>{let u=d[s+1];return u!=null&&i>=o&&i<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Qo=new WeakSet;cl=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Xo=new WeakSet;ml=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(t=l.window)==null||t.removeEventListener("pointerup",this),(e=l.window)==null||e.removeEventListener("pointermove",this)};jo=new WeakSet;gl=function(t){var e;xt(this,en,t.composedPath().includes(this.range)),(e=l.window)==null||e.addEventListener("pointerup",this)};hl=new WeakSet;Ec=function(t){var e;t.pointerType!=="mouse"&&He(this,jo,gl).call(this,t),this.addEventListener("pointerleave",this),(e=l.window)==null||e.addEventListener("pointermove",this)};pl=new WeakSet;bc=function(){var t;(t=l.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};fl=new WeakSet;gc=function(){var t,e;this.removeEventListener("pointerleave",this),(t=l.window)==null||t.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=Q(this,Be).activeSegment)==null||e.style.removeProperty("transform")};vl=new WeakSet;_c=function(t){t.pointerType==="pen"&&t.buttons===0||(this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),He(this,bl,vc).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!Q(this,en))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};Qe.shadowRootOptions={mode:"open"};Qe.getTemplateHTML=Lp;Qe.getContainerTemplateHTML=wp;l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",Qe);var Ac=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},tn=(t,e,i)=>(Ac(t,e,"read from private field"),i?i.call(t):e.get(t)),Rp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},an=(t,e,i,a)=>(Ac(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Xe;function xp(t){return`
|
|
705
705
|
<style>
|
|
706
706
|
:host {
|
|
707
707
|
|
|
@@ -727,7 +727,7 @@
|
|
|
727
727
|
</style>
|
|
728
728
|
|
|
729
729
|
<slot></slot>
|
|
730
|
-
`}var
|
|
730
|
+
`}var lr=class extends l.HTMLElement{constructor(){if(super(),Rp(this,Xe,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER&&(i&&((o=(r=tn(this,Xe))==null?void 0:r.unassociateElement)==null||o.call(r,this),an(this,Xe,null)),a&&this.isConnected&&(an(this,Xe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=tn(this,Xe))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(x.MEDIA_CONTROLLER);r&&(an(this,Xe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=tn(this,Xe))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=tn(this,Xe))==null?void 0:e.unassociateElement)==null||i.call(e,this),an(this,Xe,null)}};Xe=new WeakMap;lr.shadowRootOptions={mode:"open"};lr.getTemplateHTML=xp;l.customElements.get("media-control-bar")||l.customElements.define("media-control-bar",lr);var Tc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},rn=(t,e,i)=>(Tc(t,e,"read from private field"),i?i.call(t):e.get(t)),Dp=(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)},on=(t,e,i,a)=>(Tc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Je;function Op(t,e={}){return`
|
|
731
731
|
<style>
|
|
732
732
|
:host {
|
|
733
733
|
font: var(--media-font,
|
|
@@ -761,11 +761,11 @@
|
|
|
761
761
|
</style>
|
|
762
762
|
|
|
763
763
|
${this.getSlotTemplateHTML(t,e)}
|
|
764
|
-
`}function
|
|
764
|
+
`}function Pp(t,e){return`
|
|
765
765
|
<slot></slot>
|
|
766
|
-
`}var
|
|
766
|
+
`}var ge=class extends l.HTMLElement{constructor(){if(super(),Dp(this,Je,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER&&(i&&((o=(r=rn(this,Je))==null?void 0:r.unassociateElement)==null||o.call(r,this),on(this,Je,null)),a&&this.isConnected&&(on(this,Je,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=rn(this,Je))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let{style:r}=q(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let o=this.getAttribute(x.MEDIA_CONTROLLER);o&&(on(this,Je,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=rn(this,Je))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=rn(this,Je))==null?void 0:e.unassociateElement)==null||i.call(e,this),on(this,Je,null)}};Je=new WeakMap;ge.shadowRootOptions={mode:"open"};ge.getTemplateHTML=Op;ge.getSlotTemplateHTML=Pp;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",ge);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)),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)},Up=(t,e,i,a)=>(kc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),dr;function Hp(t,e){return`
|
|
767
767
|
<slot>${Ue(e.mediaDuration)}</slot>
|
|
768
|
-
`}var
|
|
768
|
+
`}var nn=class extends ge{constructor(){var e;super(),Np(this,dr,void 0),Up(this,dr,this.shadowRoot.querySelector("slot")),yc(this,dr).textContent=Ue((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===n.MEDIA_DURATION&&(yc(this,dr).textContent=Ue(+a)),super.attributeChangedCallback(e,i,a)}get mediaDuration(){return O(this,n.MEDIA_DURATION)}set mediaDuration(e){N(this,n.MEDIA_DURATION,e)}};dr=new WeakMap;nn.getSlotTemplateHTML=Hp;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",nn);var Bp={2:h("Network Error"),3:h("Decode Error"),4:h("Source Not Supported"),5:h("Encryption Error")},$p={2:h("A network error caused the media download to fail."),3:h("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:h("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:h("The media is encrypted and there are no keys to decrypt it.")},_l=t=>{var e,i;return t.code===1?null:{title:(e=Bp[t.code])!=null?e:`Error ${t.code}`,message:(i=$p[t.code])!=null?i:t.message}};var Ic=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Wp=(t,e,i)=>(Ic(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)=>(Ic(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),sn;function Kp(t){return`
|
|
769
769
|
<style>
|
|
770
770
|
:host {
|
|
771
771
|
background: rgb(20 20 30 / .8);
|
|
@@ -784,7 +784,7 @@
|
|
|
784
784
|
<slot name="error-${t.mediaerrorcode}" id="content">
|
|
785
785
|
${Mc({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
|
|
786
786
|
</slot>
|
|
787
|
-
`}function Gp(t){return t.code&&
|
|
787
|
+
`}function Gp(t){return t.code&&_l(t)!==null}function Mc(t){var e;let{title:i,message:a}=(e=_l(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 Sc=[n.MEDIA_ERROR_CODE,n.MEDIA_ERROR_MESSAGE],Vi=class extends Ze{constructor(){super(...arguments),Fp(this,sn,null)}static get observedAttributes(){return[...super.observedAttributes,...Sc]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,i,a){var r;if(super.attributeChangedCallback(e,i,a),!Sc.includes(e))return;let o=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=Gp(o),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(o))}get mediaError(){return Wp(this,sn)}set mediaError(e){Vp(this,sn,e)}get mediaErrorCode(){return O(this,"mediaerrorcode")}set mediaErrorCode(e){N(this,"mediaerrorcode",e)}get mediaErrorMessage(){return w(this,"mediaerrormessage")}set mediaErrorMessage(e){R(this,"mediaerrormessage",e)}};sn=new WeakMap;Vi.getSlotTemplateHTML=Kp;Vi.formatErrorMessage=Mc;l.customElements.get("media-error-dialog")||l.customElements.define("media-error-dialog",Vi);var ln=Vi;var Yp=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Dt=(t,e,i)=>(Yp(t,e,"read from private field"),i?i.call(t):e.get(t)),Cc=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ki,Gi;function qp(t){return`
|
|
788
788
|
<style>
|
|
789
789
|
:host {
|
|
790
790
|
position: fixed;
|
|
@@ -881,7 +881,7 @@
|
|
|
881
881
|
<td class="description">${a}</td>
|
|
882
882
|
</tr>
|
|
883
883
|
`).join("")}</table>
|
|
884
|
-
`}var
|
|
884
|
+
`}var dn=class extends Ze{constructor(){super(...arguments),Cc(this,Ki,e=>{var i;if(!this.open)return;let a=(i=this.shadowRoot)==null?void 0:i.querySelector("#content");if(!a)return;let r=e.composedPath(),o=r[0]===this||r.includes(this),s=r.includes(a);o&&!s&&(this.open=!1)}),Cc(this,Gi,e=>{if(!this.open)return;let i=e.shiftKey&&(e.key==="/"||e.key==="?");(e.key==="Escape"||i)&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(this.open=!1,e.preventDefault(),e.stopPropagation())})}connectedCallback(){super.connectedCallback(),this.open&&(this.addEventListener("click",Dt(this,Ki)),document.addEventListener("keydown",Dt(this,Gi)))}disconnectedCallback(){this.removeEventListener("click",Dt(this,Ki)),document.removeEventListener("keydown",Dt(this,Gi))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e==="open"&&(this.open?(this.addEventListener("click",Dt(this,Ki)),document.addEventListener("keydown",Dt(this,Gi))):(this.removeEventListener("click",Dt(this,Ki)),document.removeEventListener("keydown",Dt(this,Gi))))}};Ki=new WeakMap;Gi=new WeakMap;dn.getSlotTemplateHTML=qp;l.customElements.get("media-keyboard-shortcuts-dialog")||l.customElements.define("media-keyboard-shortcuts-dialog",dn);var wc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},zp=(t,e,i)=>(wc(t,e,"read from private field"),i?i.call(t):e.get(t)),Qp=(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)},Xp=(t,e,i,a)=>(wc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),un,Jp=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
885
885
|
<path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
|
|
886
886
|
</svg>`,jp=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
887
887
|
<path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
|
|
@@ -909,7 +909,7 @@
|
|
|
909
909
|
`}function tf(){return`
|
|
910
910
|
<slot name="tooltip-enter">${h("Enter fullscreen mode")}</slot>
|
|
911
911
|
<slot name="tooltip-exit">${h("Exit fullscreen mode")}</slot>
|
|
912
|
-
`}var Lc=t=>{let e=t.mediaIsFullscreen?h("exit fullscreen mode"):h("enter fullscreen mode");t.setAttribute("aria-label",e)},
|
|
912
|
+
`}var Lc=t=>{let e=t.mediaIsFullscreen?h("exit fullscreen mode"):h("enter fullscreen mode");t.setAttribute("aria-label",e)},ur=class extends H{constructor(){super(...arguments),Qp(this,un,null)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_FULLSCREEN,n.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Lc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_FULLSCREEN&&Lc(this)}get mediaFullscreenUnavailable(){return w(this,n.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){R(this,n.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return k(this,n.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){S(this,n.MEDIA_IS_FULLSCREEN,e)}handleClick(e){Xp(this,un,e);let i=zp(this,un)instanceof PointerEvent,a=this.mediaIsFullscreen?new l.CustomEvent(m.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new l.CustomEvent(m.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:i});this.dispatchEvent(a)}};un=new WeakMap;ur.getSlotTemplateHTML=ef;ur.getTooltipContentHTML=tf;l.customElements.get("media-fullscreen-button")||l.customElements.define("media-fullscreen-button",ur);var{MEDIA_TIME_IS_LIVE:cn,MEDIA_PAUSED:cr}=n,{MEDIA_SEEK_TO_LIVE_REQUEST:af,MEDIA_PLAY_REQUEST:rf}=m,of='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function nf(t){return`
|
|
913
913
|
<style>
|
|
914
914
|
:host { --media-tooltip-display: none; }
|
|
915
915
|
|
|
@@ -921,13 +921,13 @@
|
|
|
921
921
|
color: var(--media-live-button-icon-color, rgb(140, 140, 140));
|
|
922
922
|
}
|
|
923
923
|
|
|
924
|
-
:host([${
|
|
925
|
-
:host([${
|
|
924
|
+
:host([${cn}]:not([${cr}])) slot[name=indicator] > *,
|
|
925
|
+
:host([${cn}]:not([${cr}])) ::slotted([slot=indicator]) {
|
|
926
926
|
fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
927
927
|
color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
928
928
|
}
|
|
929
929
|
|
|
930
|
-
:host([${
|
|
930
|
+
:host([${cn}]:not([${cr}])) {
|
|
931
931
|
cursor: var(--media-cursor, not-allowed);
|
|
932
932
|
}
|
|
933
933
|
|
|
@@ -940,7 +940,7 @@
|
|
|
940
940
|
<slot name="indicator">${of}</slot>
|
|
941
941
|
|
|
942
942
|
<slot name="spacer"> </slot><slot name="text">${h("live")}</slot>
|
|
943
|
-
`}var Rc=t=>{var e;let i=t.mediaPaused||!t.mediaTimeIsLive,a=i?h("seek to live"):h("playing live");t.setAttribute("aria-label",a);let r=(e=t.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');r&&(r.textContent=h("live")),i?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},
|
|
943
|
+
`}var Rc=t=>{var e;let i=t.mediaPaused||!t.mediaTimeIsLive,a=i?h("seek to live"):h("playing live");t.setAttribute("aria-label",a);let r=(e=t.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');r&&(r.textContent=h("live")),i?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},mn=class extends H{static get observedAttributes(){return[...super.observedAttributes,cn,cr]}connectedCallback(){super.connectedCallback(),Rc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),Rc(this)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return k(this,n.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){S(this,n.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new l.CustomEvent(af,{composed:!0,bubbles:!0})),this.hasAttribute(cr)&&this.dispatchEvent(new l.CustomEvent(rf,{composed:!0,bubbles:!0})))}};mn.getSlotTemplateHTML=nf;l.customElements.get("media-live-button")||l.customElements.define("media-live-button",mn);var Dc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},mr=(t,e,i)=>(Dc(t,e,"read from private field"),i?i.call(t):e.get(t)),xc=(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)},hr=(t,e,i,a)=>(Dc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),je,pn,hn={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},Oc=500,sf=`
|
|
944
944
|
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
945
945
|
<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">
|
|
946
946
|
<animateTransform
|
|
@@ -1000,9 +1000,9 @@
|
|
|
1000
1000
|
|
|
1001
1001
|
<slot name="icon">${sf}</slot>
|
|
1002
1002
|
<div id="status" role="status" aria-live="polite">${h("media loading")}</div>
|
|
1003
|
-
`}var
|
|
1003
|
+
`}var pr=class extends l.HTMLElement{constructor(){if(super(),xc(this,je,void 0),xc(this,pn,Oc),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER,n.MEDIA_PAUSED,n.MEDIA_LOADING,hn.LOADING_DELAY]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===hn.LOADING_DELAY&&i!==a?this.loadingDelay=Number(a):e===x.MEDIA_CONTROLLER&&(i&&((o=(r=mr(this,je))==null?void 0:r.unassociateElement)==null||o.call(r,this),hr(this,je,null)),a&&this.isConnected&&(hr(this,je,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=mr(this,je))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(x.MEDIA_CONTROLLER);r&&(hr(this,je,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=mr(this,je))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=mr(this,je))==null?void 0:e.unassociateElement)==null||i.call(e,this),hr(this,je,null)}get loadingDelay(){return mr(this,pn)}set loadingDelay(e){hr(this,pn,e);let{style:i}=q(this.shadowRoot,":host");i.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaController(){return w(this,x.MEDIA_CONTROLLER)}set mediaController(e){R(this,x.MEDIA_CONTROLLER,e)}get noAutohide(){return k(this,hn.NO_AUTOHIDE)}set noAutohide(e){S(this,hn.NO_AUTOHIDE,e)}};je=new WeakMap;pn=new WeakMap;pr.shadowRootOptions={mode:"open"};pr.getTemplateHTML=lf;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",pr);var df=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1004
1004
|
<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"/>
|
|
1005
|
-
</svg>`,
|
|
1005
|
+
</svg>`,Pc=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1006
1006
|
<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"/>
|
|
1007
1007
|
</svg>`,uf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1008
1008
|
<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"/>
|
|
@@ -1033,14 +1033,14 @@
|
|
|
1033
1033
|
|
|
1034
1034
|
<slot name="icon">
|
|
1035
1035
|
<slot name="off">${df}</slot>
|
|
1036
|
-
<slot name="low">${
|
|
1037
|
-
<slot name="medium">${
|
|
1036
|
+
<slot name="low">${Pc}</slot>
|
|
1037
|
+
<slot name="medium">${Pc}</slot>
|
|
1038
1038
|
<slot name="high">${uf}</slot>
|
|
1039
1039
|
</slot>
|
|
1040
1040
|
`}function mf(){return`
|
|
1041
1041
|
<slot name="tooltip-mute">${h("Mute")}</slot>
|
|
1042
1042
|
<slot name="tooltip-unmute">${h("Unmute")}</slot>
|
|
1043
|
-
`}var
|
|
1043
|
+
`}var Nc=t=>{let i=t.mediaVolumeLevel==="off"?h("unmute"):h("mute");t.setAttribute("aria-label",i)},fr=class extends H{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),Nc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_VOLUME_LEVEL&&Nc(this)}get mediaVolumeLevel(){return w(this,n.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){R(this,n.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?m.MEDIA_UNMUTE_REQUEST:m.MEDIA_MUTE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};fr.getSlotTemplateHTML=cf;fr.getTooltipContentHTML=mf;l.customElements.get("media-mute-button")||l.customElements.define("media-mute-button",fr);var Uc=`<svg aria-hidden="true" viewBox="0 0 28 24">
|
|
1044
1044
|
<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"/>
|
|
1045
1045
|
</svg>`;function hf(t){return`
|
|
1046
1046
|
<style>
|
|
@@ -1065,7 +1065,7 @@
|
|
|
1065
1065
|
`}function pf(){return`
|
|
1066
1066
|
<slot name="tooltip-enter">${h("Enter picture in picture mode")}</slot>
|
|
1067
1067
|
<slot name="tooltip-exit">${h("Exit picture in picture mode")}</slot>
|
|
1068
|
-
`}var Hc=t=>{let e=t.mediaIsPip?h("exit picture in picture mode"):h("enter picture in picture mode");t.setAttribute("aria-label",e)},
|
|
1068
|
+
`}var Hc=t=>{let e=t.mediaIsPip?h("exit picture in picture mode"):h("enter picture in picture mode");t.setAttribute("aria-label",e)},vr=class extends H{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_PIP,n.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Hc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_PIP&&Hc(this)}get mediaPipUnavailable(){return w(this,n.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){R(this,n.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return k(this,n.MEDIA_IS_PIP)}set mediaIsPip(e){S(this,n.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?m.MEDIA_EXIT_PIP_REQUEST:m.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};vr.getSlotTemplateHTML=hf;vr.getTooltipContentHTML=pf;l.customElements.get("media-pip-button")||l.customElements.define("media-pip-button",vr);var ff=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Yi=(t,e,i)=>(ff(t,e,"read from private field"),i?i.call(t):e.get(t)),vf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ot,Al={RATES:"rates"},Tl=[1,1.2,1.5,1.7,2],ni=1;function Ef(t){return`
|
|
1069
1069
|
<style>
|
|
1070
1070
|
:host {
|
|
1071
1071
|
min-width: 5ch;
|
|
@@ -1073,7 +1073,7 @@
|
|
|
1073
1073
|
}
|
|
1074
1074
|
</style>
|
|
1075
1075
|
<slot name="icon">${t.mediaplaybackrate||ni}x</slot>
|
|
1076
|
-
`}function bf(){return h("Playback rate")}var
|
|
1076
|
+
`}function bf(){return h("Playback rate")}var Er=class extends H{constructor(){var e;super(),vf(this,Ot,new Ct(this,Al.RATES,{defaultValue:Tl})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:ni}x`}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,Al.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===Al.RATES&&(Yi(this,Ot).value=a),e===n.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,o=Number.isNaN(r)?ni:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",h("Playback rate {playbackRate}",{playbackRate:o}))}}get rates(){return Yi(this,Ot)}set rates(e){e?Array.isArray(e)?Yi(this,Ot).value=e.join(" "):typeof e=="string"&&(Yi(this,Ot).value=e):Yi(this,Ot).value=""}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,ni)}set mediaPlaybackRate(e){N(this,n.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,i;let a=Array.from(Yi(this,Ot).values(),s=>+s).sort((s,d)=>s-d),r=(i=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?i:ni,o=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(o)}};Ot=new WeakMap;Er.getSlotTemplateHTML=Ef;Er.getTooltipContentHTML=bf;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",Er);var gf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1077
1077
|
<path d="m6 21 15-9L6 3v18Z"/>
|
|
1078
1078
|
</svg>`,_f=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1079
1079
|
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
@@ -1097,7 +1097,7 @@
|
|
|
1097
1097
|
`}function Tf(){return`
|
|
1098
1098
|
<slot name="tooltip-play">${h("Play")}</slot>
|
|
1099
1099
|
<slot name="tooltip-pause">${h("Pause")}</slot>
|
|
1100
|
-
`}var Bc=t=>{let e=t.mediaPaused?h("play"):h("pause");t.setAttribute("aria-label",e)},
|
|
1100
|
+
`}var Bc=t=>{let e=t.mediaPaused?h("play"):h("pause");t.setAttribute("aria-label",e)},br=class extends H{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),Bc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_PAUSED||e===n.MEDIA_LANG)&&Bc(this)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?m.MEDIA_PLAY_REQUEST:m.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};br.getSlotTemplateHTML=Af;br.getTooltipContentHTML=Tf;l.customElements.get("media-play-button")||l.customElements.define("media-play-button",br);var et={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function yf(t){return`
|
|
1101
1101
|
<style>
|
|
1102
1102
|
:host {
|
|
1103
1103
|
pointer-events: none;
|
|
@@ -1119,7 +1119,7 @@
|
|
|
1119
1119
|
</style>
|
|
1120
1120
|
|
|
1121
1121
|
<img part="poster img" aria-hidden="true" id="image"/>
|
|
1122
|
-
`}var kf=t=>{t.style.removeProperty("background-image")},Sf=(t,e)=>{t.style["background-image"]=`url('${e}')`},
|
|
1122
|
+
`}var kf=t=>{t.style.removeProperty("background-image")},Sf=(t,e)=>{t.style["background-image"]=`url('${e}')`},gr=class extends l.HTMLElement{static get observedAttributes(){return[et.PLACEHOLDER_SRC,et.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,i,a){e===et.SRC&&(a==null?this.image.removeAttribute(et.SRC):this.image.setAttribute(et.SRC,a)),e===et.PLACEHOLDER_SRC&&(a==null?kf(this.image):Sf(this.image,a))}get placeholderSrc(){return w(this,et.PLACEHOLDER_SRC)}set placeholderSrc(e){R(this,et.SRC,e)}get src(){return w(this,et.SRC)}set src(e){R(this,et.SRC,e)}};gr.shadowRootOptions={mode:"open"};gr.getTemplateHTML=yf;l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",gr);var $c=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},If=(t,e,i)=>($c(t,e,"read from private field"),i?i.call(t):e.get(t)),Mf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Cf=(t,e,i,a)=>($c(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),fn,yl=class extends ge{constructor(){super(),Mf(this,fn,void 0),Cf(this,fn,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_LANG]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),(e===n.MEDIA_PREVIEW_CHAPTER||e===n.MEDIA_LANG)&&a!==i&&a!=null)if(If(this,fn).textContent=a,a!==""){let r=h("chapter: {chapterName}",{chapterName:a});this.setAttribute("aria-valuetext",r)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return w(this,n.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){R(this,n.MEDIA_PREVIEW_CHAPTER,e)}};fn=new WeakMap;l.customElements.get("media-preview-chapter-display")||l.customElements.define("media-preview-chapter-display",yl);var Wc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},vn=(t,e,i)=>(Wc(t,e,"read from private field"),i?i.call(t):e.get(t)),Lf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},En=(t,e,i,a)=>(Wc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),tt;function wf(t){return`
|
|
1123
1123
|
<style>
|
|
1124
1124
|
:host {
|
|
1125
1125
|
box-sizing: border-box;
|
|
@@ -1133,7 +1133,7 @@
|
|
|
1133
1133
|
}
|
|
1134
1134
|
</style>
|
|
1135
1135
|
<img crossorigin loading="eager" decoding="async">
|
|
1136
|
-
`}var qi=class extends l.HTMLElement{constructor(){if(super(),Lf(this,tt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(x.MEDIA_CONTROLLER);r&&(
|
|
1136
|
+
`}var qi=class extends l.HTMLElement{constructor(){if(super(),Lf(this,tt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(x.MEDIA_CONTROLLER);r&&(En(this,tt,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=vn(this,tt))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=vn(this,tt))==null?void 0:e.unassociateElement)==null||i.call(e,this),En(this,tt,null)}attributeChangedCallback(e,i,a){var r,o,s,d,u;[n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===x.MEDIA_CONTROLLER&&(i&&((o=(r=vn(this,tt))==null?void 0:r.unassociateElement)==null||o.call(r,this),En(this,tt,null)),a&&this.isConnected&&(En(this,tt,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=vn(this,tt))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return w(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(n.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(i=>+i)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(n.MEDIA_PREVIEW_COORDS);return}this.setAttribute(n.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,i=this.mediaPreviewImage;if(!(e&&i))return;let[a,r,o,s]=e,d=i.split("#")[0],u=getComputedStyle(this),{maxWidth:p,maxHeight:T,minWidth:_,minHeight:E}=u,f=Math.min(parseInt(p)/o,parseInt(T)/s),M=Math.max(parseInt(_)/o,parseInt(E)/s),b=f<1,C=b?f:M>1?M:1,{style:L}=q(this.shadowRoot,":host"),ie=q(this.shadowRoot,"img").style,Ae=this.shadowRoot.querySelector("img"),kt=b?"min":"max";L.setProperty(`${kt}-width`,"initial","important"),L.setProperty(`${kt}-height`,"initial","important"),L.width=`${o*C}px`,L.height=`${s*C}px`;let mt=()=>{ie.width=`${this.imgWidth*C}px`,ie.height=`${this.imgHeight*C}px`,ie.display="block"};Ae.src!==d&&(Ae.onload=()=>{this.imgWidth=Ae.naturalWidth,this.imgHeight=Ae.naturalHeight,mt()},Ae.src=d,mt()),mt(),ie.transform=`translate(-${a*C}px, -${r*C}px)`}};tt=new WeakMap;qi.shadowRootOptions={mode:"open"};qi.getTemplateHTML=wf;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",qi);var bn=qi;var Vc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Fc=(t,e,i)=>(Vc(t,e,"read from private field"),i?i.call(t):e.get(t)),Rf=(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)=>(Vc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),_r,kl=class extends ge{constructor(){super(),Rf(this,_r,void 0),xf(this,_r,this.shadowRoot.querySelector("slot")),Fc(this,_r).textContent=Ue(0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PREVIEW_TIME&&a!=null&&(Fc(this,_r).textContent=Ue(parseFloat(a)))}get mediaPreviewTime(){return O(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){N(this,n.MEDIA_PREVIEW_TIME,e)}};_r=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",kl);var Zi={SEEK_OFFSET:"seekoffset"},Sl=30,Df=t=>`
|
|
1137
1137
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1138
1138
|
<defs>
|
|
1139
1139
|
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
@@ -1142,7 +1142,7 @@
|
|
|
1142
1142
|
<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"/>
|
|
1143
1143
|
</svg>`;function Of(t,e){return`
|
|
1144
1144
|
<slot name="icon">${Df(e.seekOffset)}</slot>
|
|
1145
|
-
`}function
|
|
1145
|
+
`}function Pf(){return h("Seek backward")}var Nf=0,Ar=class extends H{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,Zi.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=O(this,Zi.SEEK_OFFSET,Sl)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===Zi.SEEK_OFFSET&&(this.seekOffset=O(this,Zi.SEEK_OFFSET,Sl))}get seekOffset(){return O(this,Zi.SEEK_OFFSET,Sl)}set seekOffset(e){N(this,Zi.SEEK_OFFSET,e),this.setAttribute("aria-label",h("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),bo(go(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME,Nf)}set mediaCurrentTime(e){N(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),i=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Ar.getSlotTemplateHTML=Of;Ar.getTooltipContentHTML=Pf;l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",Ar);var zi={SEEK_OFFSET:"seekoffset"},Il=30,Uf=t=>`
|
|
1146
1146
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1147
1147
|
<defs>
|
|
1148
1148
|
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
@@ -1151,9 +1151,9 @@
|
|
|
1151
1151
|
<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"/>
|
|
1152
1152
|
</svg>`;function Hf(t,e){return`
|
|
1153
1153
|
<slot name="icon">${Uf(e.seekOffset)}</slot>
|
|
1154
|
-
`}function Bf(){return h("Seek forward")}var $f=0,
|
|
1155
|
-
<slot>${
|
|
1156
|
-
`}var
|
|
1154
|
+
`}function Bf(){return h("Seek forward")}var $f=0,Tr=class extends H{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,zi.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=O(this,zi.SEEK_OFFSET,Il)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===zi.SEEK_OFFSET&&(this.seekOffset=O(this,zi.SEEK_OFFSET,Il))}get seekOffset(){return O(this,zi.SEEK_OFFSET,Il)}set seekOffset(e){N(this,zi.SEEK_OFFSET,e),this.setAttribute("aria-label",h("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),bo(go(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME,$f)}set mediaCurrentTime(e){N(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,i=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Tr.getSlotTemplateHTML=Hf;Tr.getTooltipContentHTML=Bf;l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",Tr);var Yc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ml=(t,e,i)=>(Yc(t,e,"read from private field"),i?i.call(t):e.get(t)),Wf=(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)},Ff=(t,e,i,a)=>(Yc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Qi,si={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Kc=[...Object.values(si),n.MEDIA_CURRENT_TIME,n.MEDIA_DURATION,n.MEDIA_SEEKABLE],Gc=["Enter"," "],Vf=" / ",Cl=(t,{timesSep:e=Vf}={})=>{var i,a;let r=(i=t.mediaCurrentTime)!=null?i:0,[,o]=(a=t.mediaSeekable)!=null?a:[],s=0;Number.isFinite(t.mediaDuration)?s=t.mediaDuration:Number.isFinite(o)&&(s=o);let d=t.remaining?Ue(0-(s-r)):Ue(r);return t.showDuration?`${d}${e}${Ue(s)}`:d},Kf="video not loaded, unknown time.",Gf=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",Kf);return}let o=t.remaining?Yt(0-(r-i)):Yt(i);if(!t.showDuration){t.setAttribute("aria-valuetext",o);return}let s=Yt(r),d=`${o} of ${s}`;t.setAttribute("aria-valuetext",d)};function Yf(t,e){return`
|
|
1155
|
+
<slot>${Cl(e)}</slot>
|
|
1156
|
+
`}var gn=class extends ge{constructor(){super(),Wf(this,Qi,void 0),Ff(this,Qi,this.shadowRoot.querySelector("slot")),Ml(this,Qi).innerHTML=`${Cl(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Kc,"disabled"]}connectedCallback(){let{style:e}=q(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",h("playback time"));let i=a=>{let{key:r}=a;if(!Gc.includes(r)){this.removeEventListener("keyup",i);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:o,key:s}=a;if(r||o||!Gc.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){Kc.includes(e)?this.update():e==="disabled"&&a!==i&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,i,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return k(this,si.REMAINING)}set remaining(e){S(this,si.REMAINING,e)}get showDuration(){return k(this,si.SHOW_DURATION)}set showDuration(e){S(this,si.SHOW_DURATION,e)}get noToggle(){return k(this,si.NO_TOGGLE)}set noToggle(e){S(this,si.NO_TOGGLE,e)}get mediaDuration(){return O(this,n.MEDIA_DURATION)}set mediaDuration(e){N(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){N(this,n.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Cl(this);Gf(this),e!==Ml(this,Qi).innerHTML&&(Ml(this,Qi).innerHTML=e)}};Qi=new WeakMap;gn.getSlotTemplateHTML=Yf;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",gn);var qc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ne=(t,e,i)=>(qc(t,e,"read from private field"),i?i.call(t):e.get(t)),it=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Me=(t,e,i,a)=>(qc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),qf=(t,e,i,a)=>({set _(r){Me(t,e,r,i)},get _(){return ne(t,e,a)}}),Xi,_n,Ji,yr,An,Tn,yn,ji,li,kn,Sn=class{constructor(e,i,a){it(this,Xi,void 0),it(this,_n,void 0),it(this,Ji,void 0),it(this,yr,void 0),it(this,An,void 0),it(this,Tn,void 0),it(this,yn,void 0),it(this,ji,void 0),it(this,li,0),it(this,kn,(r=performance.now())=>{Me(this,li,requestAnimationFrame(ne(this,kn))),Me(this,yr,performance.now()-ne(this,Ji));let o=1e3/this.fps;if(ne(this,yr)>o){Me(this,Ji,r-ne(this,yr)%o);let s=1e3/((r-ne(this,_n))/++qf(this,An)._),d=(r-ne(this,Tn))/1e3/this.duration,u=ne(this,yn)+d*this.playbackRate;u-ne(this,Xi).valueAsNumber>0?Me(this,ji,this.playbackRate/this.duration/s):(Me(this,ji,.995*ne(this,ji)),u=ne(this,Xi).valueAsNumber+ne(this,ji)),this.callback(u)}}),Me(this,Xi,e),this.callback=i,this.fps=a}start(){ne(this,li)===0&&(Me(this,Ji,performance.now()),Me(this,_n,ne(this,Ji)),Me(this,An,0),ne(this,kn).call(this))}stop(){ne(this,li)!==0&&(cancelAnimationFrame(ne(this,li)),Me(this,li,0))}update({start:e,duration:i,playbackRate:a}){let r=e-ne(this,Xi).valueAsNumber,o=Math.abs(i-this.duration);(r>0||r<-.03||o>=.5)&&this.callback(e),Me(this,yn,e),Me(this,Tn,performance.now()),this.duration=i,this.playbackRate=a}};Xi=new WeakMap;_n=new WeakMap;Ji=new WeakMap;yr=new WeakMap;An=new WeakMap;Tn=new WeakMap;yn=new WeakMap;ji=new WeakMap;li=new WeakMap;kn=new WeakMap;var xl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},J=(t,e,i)=>(xl(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)},xe=(t,e,i,a)=>(xl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),de=(t,e,i)=>(xl(t,e,"access private method"),i),ea,di,Cn,Sr,Ln,Mn,Ir,Mr,ta,ia,aa,kr,Dl,Zc,Ll,wn,Ol,Rn,Pl,xn,Nl,wl,zc,Cr,Dn,Rl,Qc,Zf="video not loaded, unknown time.",zf=t=>{let e=t.range,i=Yt(+Xc(t)),a=Yt(+t.mediaSeekableEnd),r=i&&a?`${i} of ${a}`:Zf;e.setAttribute("aria-valuetext",r)};function Qf(t){return`
|
|
1157
1157
|
<style>
|
|
1158
1158
|
:host {
|
|
1159
1159
|
--media-box-border-radius: 4px;
|
|
@@ -1356,8 +1356,8 @@
|
|
|
1356
1356
|
<div id="preview-rail">
|
|
1357
1357
|
<slot name="preview" part="box preview-box">
|
|
1358
1358
|
<media-preview-thumbnail>
|
|
1359
|
-
<template shadowrootmode="${
|
|
1360
|
-
${
|
|
1359
|
+
<template shadowrootmode="${bn.shadowRootOptions.mode}">
|
|
1360
|
+
${bn.getTemplateHTML({})}
|
|
1361
1361
|
</template>
|
|
1362
1362
|
</media-preview-thumbnail>
|
|
1363
1363
|
<media-preview-chapter-display></media-preview-chapter-display>
|
|
@@ -1370,7 +1370,7 @@
|
|
|
1370
1370
|
|
|
1371
1371
|
</slot>
|
|
1372
1372
|
</div>
|
|
1373
|
-
`}var
|
|
1373
|
+
`}var In=(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))},Xc=(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},Lr=class extends Qe{constructor(){super(),ae(this,aa),ae(this,Dl),ae(this,wn),ae(this,Rn),ae(this,xn),ae(this,wl),ae(this,Cr),ae(this,Rl),ae(this,ea,void 0),ae(this,di,void 0),ae(this,Cn,void 0),ae(this,Sr,void 0),ae(this,Ln,void 0),ae(this,Mn,void 0),ae(this,Ir,void 0),ae(this,Mr,void 0),ae(this,ta,void 0),ae(this,ia,void 0),ae(this,Ll,a=>{this.dragging||(Ci(a)&&(this.range.valueAsNumber=a),J(this,ia)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),xe(this,Cn,this.shadowRoot.querySelectorAll('[part~="box"]')),xe(this,Ln,this.shadowRoot.querySelector('[part~="preview-box"]')),xe(this,Mn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);xe(this,Ir,parseInt(i.getPropertyValue("--media-box-padding-left"))),xe(this,Mr,parseInt(i.getPropertyValue("--media-box-padding-right"))),xe(this,di,new Sn(this.range,J(this,Ll),60))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_DURATION,n.MEDIA_SEEKABLE,n.MEDIA_CURRENT_TIME,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_TIME,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_BUFFERED,n.MEDIA_PLAYBACK_RATE,n.MEDIA_LOADING,n.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",h("seek")),de(this,aa,kr).call(this),xe(this,ea,this.getRootNode()),(e=J(this,ea))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),de(this,aa,kr).call(this),(e=J(this,ea))==null||e.removeEventListener("transitionstart",this),xe(this,ea,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===n.MEDIA_CURRENT_TIME||e===n.MEDIA_PAUSED||e===n.MEDIA_ENDED||e===n.MEDIA_LOADING||e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE?(J(this,di).update({start:In(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),de(this,aa,kr).call(this),zf(this)):e===n.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=J(this,ta),this.updateBar()))}get mediaChaptersCues(){return J(this,ta)}set mediaChaptersCues(e){var i;xe(this,ta,e),this.updateSegments((i=J(this,ta))==null?void 0:i.map(a=>({start:In(this,a.startTime),end:In(this,a.endTime)})))}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaDuration(){return O(this,n.MEDIA_DURATION)}set mediaDuration(e){N(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){N(this,n.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){N(this,n.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(n.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(n.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(n.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,i=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaSeekableStart(){var e;let[i=0]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaPreviewImage(){return w(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return O(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){N(this,n.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return k(this,n.MEDIA_ENDED)}set mediaEnded(e){S(this,n.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let i=this.mediaBuffered;if(!i.length)return;let a;if(this.mediaEnded)a=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([d,u])=>d<=o&&o<=u))!=null?e:[];a=In(this,s)}let{style:r}=q(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=q(this.shadowRoot,"#current-rail"),a=q(this.shadowRoot,'[part~="current-box"]'),r=de(this,wn,Ol).call(this,J(this,Mn)),o=de(this,Rn,Pl).call(this,r,this.range.valueAsNumber),s=de(this,xn,Nl).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${o})`,i.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":de(this,Rl,Qc).call(this);break;case"pointermove":de(this,wl,zc).call(this,e);break;case"pointerup":J(this,ia)&&xe(this,ia,!1);break;case"pointerdown":xe(this,ia,!0);break;case"pointerleave":de(this,Cr,Dn).call(this,null);break;case"transitionstart":ue(e.target,this)&&setTimeout(()=>de(this,aa,kr).call(this),0);break}}};ea=new WeakMap;di=new WeakMap;Cn=new WeakMap;Sr=new WeakMap;Ln=new WeakMap;Mn=new WeakMap;Ir=new WeakMap;Mr=new WeakMap;ta=new WeakMap;ia=new WeakMap;aa=new WeakSet;kr=function(){de(this,Dl,Zc).call(this)?J(this,di).start():J(this,di).stop()};Dl=new WeakSet;Zc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&_o(this)};Ll=new WeakMap;wn=new WeakSet;Ol=function(t){var e;let a=((e=this.getAttribute("bounds")?Ve(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),o=t.offsetWidth,s=-(r.left-a.left-o/2),d=a.right-r.left-o/2;return{box:{width:o,min:s,max:d},bounds:a,range:r}};Rn=new WeakSet;Pl=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:o}=t.box;if(!a)return i;if(Number.isNaN(r)||(i=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${i})`),!Number.isNaN(o)){let d=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;i=`min(${i}, ${d})`}return i};xn=new WeakSet;Nl=function(t,e){let{width:i,min:a,max:r}=t.box,o=e*t.range.width;if(o<a+J(this,Ir)){let s=t.range.left-t.bounds.left-J(this,Ir);return`${o-i/2+s}px`}if(o>r-J(this,Mr)){let s=t.bounds.right-t.range.right-J(this,Mr);return`${o+i/2-s-t.range.width}px`}return 0};wl=new WeakSet;zc=function(t){let e=[...J(this,Cn)].some(T=>t.composedPath().includes(T));if(!this.dragging&&(e||!t.composedPath().includes(this))){de(this,Cr,Dn).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=q(this.shadowRoot,"#preview-rail"),r=q(this.shadowRoot,'[part~="preview-box"]'),o=de(this,wn,Ol).call(this,J(this,Ln)),s=(t.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let d=de(this,Rn,Pl).call(this,o,s),u=de(this,xn,Nl).call(this,o,s);a.style.transform=`translateX(${d})`,a.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${o.box.width}px`);let p=Math.round(J(this,Sr))-Math.round(s*i);Math.abs(p)<1&&s>.01&&s<.99||(xe(this,Sr,s*i),de(this,Cr,Dn).call(this,J(this,Sr)))};Cr=new WeakSet;Dn=function(t){this.dispatchEvent(new l.CustomEvent(m.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Rl=new WeakSet;Qc=function(){J(this,di).stop();let t=Xc(this);this.dispatchEvent(new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Lr.shadowRootOptions={mode:"open"};Lr.getContainerTemplateHTML=Qf;l.customElements.get("media-time-range")||l.customElements.define("media-time-range",Lr);var Xf=1,Jf=t=>t.mediaMuted?0:t.mediaVolume,jf=t=>`${Math.round(t*100)}%`,Ul=class extends Qe{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME,n.MEDIA_MUTED,n.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",h("volume"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_VOLUME||e===n.MEDIA_MUTED)&&(this.range.valueAsNumber=Jf(this),this.range.setAttribute("aria-valuetext",jf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return O(this,n.MEDIA_VOLUME,Xf)}set mediaVolume(e){N(this,n.MEDIA_VOLUME,e)}get mediaMuted(){return k(this,n.MEDIA_MUTED)}set mediaMuted(e){S(this,n.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return w(this,n.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){R(this,n.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",Ul);function ev(t){return`
|
|
1374
1374
|
<style>
|
|
1375
1375
|
:host {
|
|
1376
1376
|
min-width: 4ch;
|
|
@@ -1399,8 +1399,8 @@
|
|
|
1399
1399
|
<path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
|
|
1400
1400
|
</svg>
|
|
1401
1401
|
</div>
|
|
1402
|
-
`}function tv(){return h("Loop")}var
|
|
1403
|
-
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),at(e)}var le={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Nt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},lA={...le,...Nt},nm=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}}),nv=Object.values(le).filter(t=>le.PLAYSINLINE!==t),sv=Object.values(Nt),lv=[...nv,...sv],$l=class extends ke.HTMLElement{static get observedAttributes(){return lv}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case Nt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Nt.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Nt.PLAYBACKRATE:{let s=(o=ce(a))!=null?o:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,i;return(i=(e=this.media)==null?void 0:e.play())!=null?i:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,i;return(i=(e=this.media)==null?void 0:e.paused)!=null?i:!0}get duration(){var e,i;return(i=(e=this.media)==null?void 0:e.duration)!=null?i:NaN}get ended(){var e,i;return(i=(e=this.media)==null?void 0:e.ended)!=null?i:!1}get buffered(){var e,i;return(i=(e=this.media)==null?void 0:e.buffered)!=null?i:nm}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:nm}get readyState(){var e,i;return(i=(e=this.media)==null?void 0:e.readyState)!=null?i:0}get videoWidth(){var e,i;return(i=(e=this.media)==null?void 0:e.videoWidth)!=null?i:0}get videoHeight(){var e,i;return(i=(e=this.media)==null?void 0:e.videoHeight)!=null?i:0}get currentSrc(){var e,i;return(i=(e=this.media)==null?void 0:e.currentSrc)!=null?i:""}get currentTime(){var e,i;return(i=(e=this.media)==null?void 0:e.currentTime)!=null?i:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,i;return(i=(e=this.media)==null?void 0:e.volume)!=null?i:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,i;return(i=(e=this.media)==null?void 0:e.playbackRate)!=null?i:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=ce(this.getAttribute(Nt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Nt.PLAYBACKRATE,`${e}`):this.removeAttribute(Nt.PLAYBACKRATE)}get crossOrigin(){return Rr(this,le.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(le.CROSSORIGIN,`${e}`)}get autoplay(){return Rr(this,le.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(le.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(le.AUTOPLAY)}get loop(){return Rr(this,le.LOOP)!=null}set loop(e){e?this.setAttribute(le.LOOP,""):this.removeAttribute(le.LOOP)}get muted(){var e,i;return(i=(e=this.media)==null?void 0:e.muted)!=null?i:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return Rr(this,le.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(le.MUTED,""):this.removeAttribute(le.MUTED)}get playsInline(){return Rr(this,le.PLAYSINLINE)!=null}set playsInline(e){ge("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(le.PRELOAD,e):this.removeAttribute(le.PRELOAD)}};function Rr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var Wl=$l;var cm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},N=(t,e,i)=>(cm(t,e,"read from private field"),i?i.call(t):e.get(t)),rt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},gt=(t,e,i,a)=>(cm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ra,Un,hi,xr,Pt,Ut,Ht,pi,oa,Hn,$e,sm=1,lm=0,dv=1,uv={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let o=i[a];typeof o=="boolean"&&r instanceof he&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof he?r.element[r.attributeName]=o:r.value=o}}}},_t=class extends l.DocumentFragment{constructor(e,i,a=uv){var r;super(),rt(this,ra,void 0),rt(this,Un,void 0),this.append(e.content.cloneNode(!0)),gt(this,ra,mm(this)),gt(this,Un,a),(r=a.createCallback)==null||r.call(a,this,N(this,ra),i),a.processCallback(this,N(this,ra),i)}update(e){N(this,Un).processCallback(this,N(this,ra),e)}};ra=new WeakMap;Un=new WeakMap;var mm=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new Fl;for([i,a]of um(r.value))if(!i)o.append(a);else{let s=new he(t,r.name,r.namespaceURI);o.append(s),e.push([a,s])}r.value=o.toString()}for(let r of t.childNodes)if(r.nodeType===sm&&!(r instanceof HTMLTemplateElement))mm(r,e);else{let o=r.data;if(r.nodeType===sm||o.includes("{{")){let s=[];if(o)for([i,a]of um(o))if(!i)s.push(new Text(a));else{let d=new At(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new Dr(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},dm={},um=t=>{let e="",i=0,a=dm[t],r=0,o;if(a)return a;for(a=[];o=t[r];r++)o==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([lm,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([dv,e.trim()]),e="",r++):e+=o||"";return e&&a.push([lm,(i>0?"{{":"")+e]),dm[t]=a},cv=11,Bn=class{get value(){return""}set value(e){}toString(){return this.value}},hm=new WeakMap,Fl=class{constructor(){rt(this,hi,[])}[Symbol.iterator](){return N(this,hi).values()}get length(){return N(this,hi).length}item(e){return N(this,hi)[e]}append(...e){for(let i of e)i instanceof he&&hm.set(i,this),N(this,hi).push(i)}toString(){return N(this,hi).join("")}};hi=new WeakMap;var he=class extends Bn{constructor(e,i,a){super(),rt(this,pi),rt(this,xr,""),rt(this,Pt,void 0),rt(this,Ut,void 0),rt(this,Ht,void 0),gt(this,Pt,e),gt(this,Ut,i),gt(this,Ht,a)}get attributeName(){return N(this,Ut)}get attributeNamespace(){return N(this,Ht)}get element(){return N(this,Pt)}get value(){return N(this,xr)}set value(e){N(this,xr)!==e&&(gt(this,xr,e),!N(this,pi,oa)||N(this,pi,oa).length===1?e==null?N(this,Pt).removeAttributeNS(N(this,Ht),N(this,Ut)):N(this,Pt).setAttributeNS(N(this,Ht),N(this,Ut),e):N(this,Pt).setAttributeNS(N(this,Ht),N(this,Ut),N(this,pi,oa).toString()))}get booleanValue(){return N(this,Pt).hasAttributeNS(N(this,Ht),N(this,Ut))}set booleanValue(e){if(!N(this,pi,oa)||N(this,pi,oa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};xr=new WeakMap;Pt=new WeakMap;Ut=new WeakMap;Ht=new WeakMap;pi=new WeakSet;oa=function(){return hm.get(this)};var At=class extends Bn{constructor(e,i){super(),rt(this,Hn,void 0),rt(this,$e,void 0),gt(this,Hn,e),gt(this,$e,i?[...i]:[new Text])}get replacementNodes(){return N(this,$e)}get parentNode(){return N(this,Hn)}get nextSibling(){return N(this,$e)[N(this,$e).length-1].nextSibling}get previousSibling(){return N(this,$e)[0].previousSibling}get value(){return N(this,$e).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let i=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===cv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),gt(this,$e,mv(N(this,$e)[0].parentNode,N(this,$e),i,this.nextSibling))}};Hn=new WeakMap;$e=new WeakMap;var Dr=class extends At{constructor(e,i){let a=i.getAttribute("directive")||i.getAttribute("type"),r=i.getAttribute("expression")||i.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=i,this.directive=a}};function mv(t,e,i,a=null){let r=0,o,s,d,u=i.length,p=e.length;for(;r<u&&r<p&&e[r]==i[r];)r++;for(;r<u&&r<p&&i[u-1]==e[p-1];)a=i[--p,--u];if(r==p)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<p;)t.removeChild(e[r++]);else{for(o=e[r];r<u;)d=i[r++],s=o?o.nextSibling:a,o==d?o=s:r<u&&i[r]==s?(t.replaceChild(d,o),o=s):t.insertBefore(d,o);for(;o!=a;)s=o.nextSibling,t.removeChild(o),o=s}return i}var pm={string:t=>String(t)},Wn=class{constructor(e){this.template=e,this.state=void 0}},fi=new WeakMap,vi=new WeakMap,Vl={partial:(t,e)=>{e[t.expression]=new Wn(t.template)},if:(t,e)=>{var i;if(vm(t.expression,e))if(fi.get(t)!==t.template){fi.set(t,t.template);let a=new _t(t.template,e,Fn);t.replace(a),vi.set(t,a)}else(i=vi.get(t))==null||i.update(e);else t.replace(""),fi.delete(t),vi.delete(t)}},hv=Object.keys(Vl),Fn={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof Dr){if(!s.directive){let u=hv.find(p=>s.template.hasAttribute(p));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=Vl[s.directive])==null||a.call(Vl,s,i);continue}let d=vm(o,i);if(d instanceof Wn){fi.get(s)!==d.template?(fi.set(s,d.template),d=new _t(d.template,d.state,Fn),s.value=d,vi.set(s,d)):(r=vi.get(s))==null||r.update(d.state);continue}d?(s instanceof he&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof he?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,fi.delete(s),vi.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,fi.delete(s),vi.delete(s))}}},fm={"!":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=pm[e])==null?void 0:i.call(pm,t)}};function pv(t){return fv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function vm(t,e={}){var i,a,r,o,s,d,u;let p=pv(t);if(p.length===0||p.some(({type:T})=>!T))return Or(t);if(((i=p[0])==null?void 0:i.token)===">"){let T=e[(a=p[1])==null?void 0:a.token];if(!T)return Or(t);let _={...e};T.state=_;let E=p.slice(2);for(let f=0;f<E.length;f+=3){let M=(r=E[f])==null?void 0:r.token,b=(o=E[f+1])==null?void 0:o.token,C=(s=E[f+2])==null?void 0:s.token;M&&b==="="&&(_[M]=Nr(C,e))}return T}if(p.length===1)return $n(p[0])?Nr(p[0].token,e):Or(t);if(p.length===2){let T=(d=p[0])==null?void 0:d.token,_=fm[T];if(!_||!$n(p[1]))return Or(t);let E=Nr(p[1].token,e);return _(E)}if(p.length===3){let T=(u=p[1])==null?void 0:u.token,_=fm[T];if(!_||!$n(p[0])||!$n(p[2]))return Or(t);let E=Nr(p[0].token,e);if(T==="|")return _(E,p[2].token);let f=Nr(p[2].token,e);return _(E,f)}}function Or(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function $n({type:t}){return["number","boolean","string","param"].includes(t)}function Nr(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):co(t)?parseFloat(t):e[t]}function fv(t,e){let i,a,r,o=[];for(;t;){r=null,i=t.length;for(let s in e)a=e[s].exec(t),a&&a.index<i&&(r={token:a[0],type:s,matches:a.slice(1)},i=a.index);i&&o.push({token:t.substr(0,i),type:void 0}),r&&o.push(r),t=t.substr(i+(r?r.token.length:0))}return o}var Ql=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Yl=(t,e,i)=>(Ql(t,e,"read from private field"),i?i.call(t):e.get(t)),Pr=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ei=(t,e,i,a)=>(Ql(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Kl=(t,e,i)=>(Ql(t,e,"access private method"),i),na,Vn,sa,ql,Em,Kn,Zl,Gl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},bm=V.createElement("template");bm.innerHTML=`
|
|
1402
|
+
`}function tv(){return h("Loop")}var wr=class extends H{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=h("Loop"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return k(this,n.MEDIA_LOOP)}set mediaLoop(e){S(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(m.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};wr.getSlotTemplateHTML=ev;wr.getTooltipContentHTML=tv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",wr);var g=require("@mux/mux-video/base"),D=require("@mux/playback-core");var am=require("@mux/playback-core");var mi=require("@mux/playback-core");function Jc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${On(i)}: ${a}; `)}),e?e.trim():void 0}function On(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Pn(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 Hl(t){let e=iv(t).toString();return e?"?"+e:""}function iv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var Bl=(t,e)=>!t||!e?!1:t.contains(e)?!0:Bl(t,e.getRootNode().host);var jc="mux.com",av=()=>{try{return"3.11.4"}catch{}return"UNKNOWN"},rv=av(),Un=()=>rv,em=(t,{token:e,customDomain:i=jc,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,mi.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${Hl({token:e,time:o,program_time:r})}`},tm=(t,{token:e,customDomain:i=jc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,mi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${Hl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Rr=t=>{if(t){if([mi.StreamTypes.LIVE,mi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return mi.StreamTypes.LIVE}};var ov={crossorigin:"crossOrigin",playsinline:"playsInline"};function im(t){var e;return(e=ov[t])!=null?e:Pn(t)}var ui,ci,me,Nn=class{constructor(e,i){fe(this,ui);fe(this,ci);fe(this,me,[]);ye(this,ui,e),ye(this,ci,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,ui))!=null&&i.hasAttribute(`${B(this,ci)}`)))&&((a=B(this,ui))==null||a.setAttribute(`${B(this,ci)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{B(this,me).splice(B(this,me).indexOf(a),1)}),(i=B(this,ui))==null||i.setAttribute(`${B(this,ci)}`,`${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)}};ui=new WeakMap,ci=new WeakMap,me=new WeakMap;var rm=`[mux-player ${Un()}]`;function at(...t){console.warn(rm,...t)}function he(...t){console.error(rm,...t)}function $l(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,am.i18n)("Read more: ")}
|
|
1403
|
+
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),at(e)}var le={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Pt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},lA={...le,...Pt},nm=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}}),nv=Object.values(le).filter(t=>le.PLAYSINLINE!==t),sv=Object.values(Pt),lv=[...nv,...sv],Wl=class extends ke.HTMLElement{static get observedAttributes(){return lv}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case Pt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Pt.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Pt.PLAYBACKRATE:{let s=(o=ce(a))!=null?o:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,i;return(i=(e=this.media)==null?void 0:e.play())!=null?i:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,i;return(i=(e=this.media)==null?void 0:e.paused)!=null?i:!0}get duration(){var e,i;return(i=(e=this.media)==null?void 0:e.duration)!=null?i:NaN}get ended(){var e,i;return(i=(e=this.media)==null?void 0:e.ended)!=null?i:!1}get buffered(){var e,i;return(i=(e=this.media)==null?void 0:e.buffered)!=null?i:nm}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:nm}get readyState(){var e,i;return(i=(e=this.media)==null?void 0:e.readyState)!=null?i:0}get videoWidth(){var e,i;return(i=(e=this.media)==null?void 0:e.videoWidth)!=null?i:0}get videoHeight(){var e,i;return(i=(e=this.media)==null?void 0:e.videoHeight)!=null?i:0}get currentSrc(){var e,i;return(i=(e=this.media)==null?void 0:e.currentSrc)!=null?i:""}get currentTime(){var e,i;return(i=(e=this.media)==null?void 0:e.currentTime)!=null?i:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,i;return(i=(e=this.media)==null?void 0:e.volume)!=null?i:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,i;return(i=(e=this.media)==null?void 0:e.playbackRate)!=null?i:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=ce(this.getAttribute(Pt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Pt.PLAYBACKRATE,`${e}`):this.removeAttribute(Pt.PLAYBACKRATE)}get crossOrigin(){return xr(this,le.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(le.CROSSORIGIN,`${e}`)}get autoplay(){return xr(this,le.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(le.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(le.AUTOPLAY)}get loop(){return xr(this,le.LOOP)!=null}set loop(e){e?this.setAttribute(le.LOOP,""):this.removeAttribute(le.LOOP)}get muted(){var e,i;return(i=(e=this.media)==null?void 0:e.muted)!=null?i:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return xr(this,le.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(le.MUTED,""):this.removeAttribute(le.MUTED)}get playsInline(){return xr(this,le.PLAYSINLINE)!=null}set playsInline(e){he("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(le.PRELOAD,e):this.removeAttribute(le.PRELOAD)}};function xr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var Fl=Wl;var cm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},P=(t,e,i)=>(cm(t,e,"read from private field"),i?i.call(t):e.get(t)),rt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},gt=(t,e,i,a)=>(cm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ra,Hn,hi,Dr,Nt,Ut,Ht,pi,oa,Bn,$e,sm=1,lm=0,dv=1,uv={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let o=i[a];typeof o=="boolean"&&r instanceof pe&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof pe?r.element[r.attributeName]=o:r.value=o}}}},_t=class extends l.DocumentFragment{constructor(e,i,a=uv){var r;super(),rt(this,ra,void 0),rt(this,Hn,void 0),this.append(e.content.cloneNode(!0)),gt(this,ra,mm(this)),gt(this,Hn,a),(r=a.createCallback)==null||r.call(a,this,P(this,ra),i),a.processCallback(this,P(this,ra),i)}update(e){P(this,Hn).processCallback(this,P(this,ra),e)}};ra=new WeakMap;Hn=new WeakMap;var mm=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new Vl;for([i,a]of um(r.value))if(!i)o.append(a);else{let s=new pe(t,r.name,r.namespaceURI);o.append(s),e.push([a,s])}r.value=o.toString()}for(let r of t.childNodes)if(r.nodeType===sm&&!(r instanceof HTMLTemplateElement))mm(r,e);else{let o=r.data;if(r.nodeType===sm||o.includes("{{")){let s=[];if(o)for([i,a]of um(o))if(!i)s.push(new Text(a));else{let d=new At(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new Or(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},dm={},um=t=>{let e="",i=0,a=dm[t],r=0,o;if(a)return a;for(a=[];o=t[r];r++)o==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([lm,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([dv,e.trim()]),e="",r++):e+=o||"";return e&&a.push([lm,(i>0?"{{":"")+e]),dm[t]=a},cv=11,$n=class{get value(){return""}set value(e){}toString(){return this.value}},hm=new WeakMap,Vl=class{constructor(){rt(this,hi,[])}[Symbol.iterator](){return P(this,hi).values()}get length(){return P(this,hi).length}item(e){return P(this,hi)[e]}append(...e){for(let i of e)i instanceof pe&&hm.set(i,this),P(this,hi).push(i)}toString(){return P(this,hi).join("")}};hi=new WeakMap;var pe=class extends $n{constructor(e,i,a){super(),rt(this,pi),rt(this,Dr,""),rt(this,Nt,void 0),rt(this,Ut,void 0),rt(this,Ht,void 0),gt(this,Nt,e),gt(this,Ut,i),gt(this,Ht,a)}get attributeName(){return P(this,Ut)}get attributeNamespace(){return P(this,Ht)}get element(){return P(this,Nt)}get value(){return P(this,Dr)}set value(e){P(this,Dr)!==e&&(gt(this,Dr,e),!P(this,pi,oa)||P(this,pi,oa).length===1?e==null?P(this,Nt).removeAttributeNS(P(this,Ht),P(this,Ut)):P(this,Nt).setAttributeNS(P(this,Ht),P(this,Ut),e):P(this,Nt).setAttributeNS(P(this,Ht),P(this,Ut),P(this,pi,oa).toString()))}get booleanValue(){return P(this,Nt).hasAttributeNS(P(this,Ht),P(this,Ut))}set booleanValue(e){if(!P(this,pi,oa)||P(this,pi,oa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Dr=new WeakMap;Nt=new WeakMap;Ut=new WeakMap;Ht=new WeakMap;pi=new WeakSet;oa=function(){return hm.get(this)};var At=class extends $n{constructor(e,i){super(),rt(this,Bn,void 0),rt(this,$e,void 0),gt(this,Bn,e),gt(this,$e,i?[...i]:[new Text])}get replacementNodes(){return P(this,$e)}get parentNode(){return P(this,Bn)}get nextSibling(){return P(this,$e)[P(this,$e).length-1].nextSibling}get previousSibling(){return P(this,$e)[0].previousSibling}get value(){return P(this,$e).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let i=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===cv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),gt(this,$e,mv(P(this,$e)[0].parentNode,P(this,$e),i,this.nextSibling))}};Bn=new WeakMap;$e=new WeakMap;var Or=class extends At{constructor(e,i){let a=i.getAttribute("directive")||i.getAttribute("type"),r=i.getAttribute("expression")||i.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=i,this.directive=a}};function mv(t,e,i,a=null){let r=0,o,s,d,u=i.length,p=e.length;for(;r<u&&r<p&&e[r]==i[r];)r++;for(;r<u&&r<p&&i[u-1]==e[p-1];)a=i[--p,--u];if(r==p)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<p;)t.removeChild(e[r++]);else{for(o=e[r];r<u;)d=i[r++],s=o?o.nextSibling:a,o==d?o=s:r<u&&i[r]==s?(t.replaceChild(d,o),o=s):t.insertBefore(d,o);for(;o!=a;)s=o.nextSibling,t.removeChild(o),o=s}return i}var pm={string:t=>String(t)},Fn=class{constructor(e){this.template=e,this.state=void 0}},fi=new WeakMap,vi=new WeakMap,Kl={partial:(t,e)=>{e[t.expression]=new Fn(t.template)},if:(t,e)=>{var i;if(vm(t.expression,e))if(fi.get(t)!==t.template){fi.set(t,t.template);let a=new _t(t.template,e,Vn);t.replace(a),vi.set(t,a)}else(i=vi.get(t))==null||i.update(e);else t.replace(""),fi.delete(t),vi.delete(t)}},hv=Object.keys(Kl),Vn={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof Or){if(!s.directive){let u=hv.find(p=>s.template.hasAttribute(p));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=Kl[s.directive])==null||a.call(Kl,s,i);continue}let d=vm(o,i);if(d instanceof Fn){fi.get(s)!==d.template?(fi.set(s,d.template),d=new _t(d.template,d.state,Vn),s.value=d,vi.set(s,d)):(r=vi.get(s))==null||r.update(d.state);continue}d?(s instanceof pe&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof pe?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,fi.delete(s),vi.delete(s))):s instanceof pe?s.value=void 0:(s.value=void 0,fi.delete(s),vi.delete(s))}}},fm={"!":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=pm[e])==null?void 0:i.call(pm,t)}};function pv(t){return fv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function vm(t,e={}){var i,a,r,o,s,d,u;let p=pv(t);if(p.length===0||p.some(({type:T})=>!T))return Pr(t);if(((i=p[0])==null?void 0:i.token)===">"){let T=e[(a=p[1])==null?void 0:a.token];if(!T)return Pr(t);let _={...e};T.state=_;let E=p.slice(2);for(let f=0;f<E.length;f+=3){let M=(r=E[f])==null?void 0:r.token,b=(o=E[f+1])==null?void 0:o.token,C=(s=E[f+2])==null?void 0:s.token;M&&b==="="&&(_[M]=Nr(C,e))}return T}if(p.length===1)return Wn(p[0])?Nr(p[0].token,e):Pr(t);if(p.length===2){let T=(d=p[0])==null?void 0:d.token,_=fm[T];if(!_||!Wn(p[1]))return Pr(t);let E=Nr(p[1].token,e);return _(E)}if(p.length===3){let T=(u=p[1])==null?void 0:u.token,_=fm[T];if(!_||!Wn(p[0])||!Wn(p[2]))return Pr(t);let E=Nr(p[0].token,e);if(T==="|")return _(E,p[2].token);let f=Nr(p[2].token,e);return _(E,f)}}function Pr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Wn({type:t}){return["number","boolean","string","param"].includes(t)}function Nr(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):mo(t)?parseFloat(t):e[t]}function fv(t,e){let i,a,r,o=[];for(;t;){r=null,i=t.length;for(let s in e)a=e[s].exec(t),a&&a.index<i&&(r={token:a[0],type:s,matches:a.slice(1)},i=a.index);i&&o.push({token:t.substr(0,i),type:void 0}),r&&o.push(r),t=t.substr(i+(r?r.token.length:0))}return o}var Ql=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ql=(t,e,i)=>(Ql(t,e,"read from private field"),i?i.call(t):e.get(t)),Ur=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ei=(t,e,i,a)=>(Ql(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Gl=(t,e,i)=>(Ql(t,e,"access private method"),i),na,Kn,sa,Zl,Em,Gn,zl,Yl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},bm=V.createElement("template");bm.innerHTML=`
|
|
1404
1404
|
<style>
|
|
1405
1405
|
:host {
|
|
1406
1406
|
display: inline-block;
|
|
@@ -1427,7 +1427,7 @@ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),at(e)}var le={AU
|
|
|
1427
1427
|
display: none;
|
|
1428
1428
|
}
|
|
1429
1429
|
</style>
|
|
1430
|
-
`;var bi=class extends l.HTMLElement{constructor(){super(),
|
|
1430
|
+
`;var bi=class extends l.HTMLElement{constructor(){super(),Ur(this,Zl),Ur(this,Gn),Ur(this,na,void 0),Ur(this,Kn,void 0),Ur(this,sa,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(i=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||i.some(r=>{let o=r.target;return o===this?!0:o.localName!=="media-controller"?!1:!!(Yl[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(Le.BREAKPOINTS_COMPUTED,this.render),Gl(this,Zl,Em).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=ql(this,na))!=null?e:this.constructor.template}set template(e){if(e===null){this.removeAttribute("template");return}typeof e=="string"?this.setAttribute("template",e):e instanceof HTMLTemplateElement&&(Ei(this,na,e),Ei(this,sa,null),this.createRenderer())}get props(){var e,i,a;let r=[...Array.from((i=(e=this.mediaController)==null?void 0:e.attributes)!=null?i:[]).filter(({name:s})=>Yl[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],o={};for(let s of r){let d=(a=Yl[s.name])!=null?a:Eu(s.name),{value:u}=s;u!=null?(mo(u)&&(u=parseFloat(u)),o[d]=u===""?!0:u):o[d]=!1}return o}attributeChangedCallback(e,i,a){e==="template"&&i!=a&&Gl(this,Gn,zl).call(this)}connectedCallback(){Gl(this,Gn,zl).call(this)}createRenderer(){this.template instanceof HTMLTemplateElement&&this.template!==ql(this,Kn)&&(Ei(this,Kn,this.template),this.renderer=new _t(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(bm.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};na=new WeakMap;Kn=new WeakMap;sa=new WeakMap;Zl=new WeakSet;Em=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}};Gn=new WeakSet;zl=function(){var t;let e=this.getAttribute("template");if(!e||e===ql(this,sa))return;let i=this.getRootNode(),a=(t=i==null?void 0:i.getElementById)==null?void 0:t.call(i,e);if(a){Ei(this,sa,e),Ei(this,na,a),this.createRenderer();return}vv(e)&&(Ei(this,sa,e),Ev(e).then(r=>{let o=V.createElement("template");o.innerHTML=r,Ei(this,na,o),this.createRenderer()}).catch(console.error))};bi.observedAttributes=["template"];bi.processor=Vn;function vv(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 Ev(t){let e=await fetch(t);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}l.customElements.get("media-theme")||l.customElements.define("media-theme",bi);var gm=`:host {
|
|
1431
1431
|
--media-control-display: var(--controls);
|
|
1432
1432
|
--media-loading-indicator-display: var(--loading-indicator);
|
|
1433
1433
|
--media-dialog-display: var(--dialog);
|
|
@@ -1577,19 +1577,19 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1577
1577
|
:host([no-tooltips]) {
|
|
1578
1578
|
--media-tooltip-display: none;
|
|
1579
1579
|
}
|
|
1580
|
-
`;var
|
|
1580
|
+
`;var Hr=new WeakMap,Jl=class t{constructor(e,i){this.element=e;this.type=i;this.element.addEventListener(this.type,this);let a=Hr.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=Hr.get(this.element);i&&i.delete(this.type)}}static for(e){Hr.has(e.element)||Hr.set(e.element,new Map);let i=e.attributeName.slice(2),a=Hr.get(e.element);return a&&a.has(i)?a.get(i):new t(e.element,i)}};function gv(t,e){return t instanceof pe&&t.attributeName.startsWith("on")?(Jl.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function _v(t,e){return e instanceof Yn&&t instanceof At?(e.renderInto(t),!0):!1}function Av(t,e){return e instanceof DocumentFragment&&t instanceof At?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function Tv(t,e){if(t instanceof pe){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 yv(t,e){if(t instanceof pe&&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 kv(t,e){if(typeof e=="boolean"&&t instanceof pe){let i=t.attributeNamespace,a=t.element.hasAttributeNS(i,t.attributeName);return e!==a&&(t.booleanValue=e),!0}return!1}function Sv(t,e){return e===!1&&t instanceof At?(t.replace(""),!0):!1}function Iv(t,e){yv(t,e)||kv(t,e)||gv(t,e)||Sv(t,e)||_v(t,e)||Av(t,e)||Tv(t,e)}var Xl=new Map,_m=new WeakMap,Am=new WeakMap,Yn=class{constructor(e,i,a){this.strings=e;this.values=i;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Xl.has(this.stringsKey))return Xl.get(this.stringsKey);{let e=Gt.createElement("template"),i=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,o)=>a+r+(o<i?`{{ ${o} }}`:""),""),Xl.set(this.stringsKey,e),e}}renderInto(e){var r;let i=this.template;if(_m.get(e)!==i){_m.set(e,i);let o=new _t(i,this.values,this.processor);Am.set(e,o),e instanceof At?e.replace(...o.children):e.appendChild(o);return}let a=Am.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Mv={processCallback(t,e,i){var a;if(i){for(let[r,o]of e)if(r in i){let s=(a=i[r])!=null?a:"";Iv(o,s)}}}};function Br(t,...e){return new Yn(t,e,Mv)}function Tm(t,e){t.renderInto(e)}var $r=require("@mux/playback-core"),Cv=t=>{let{tokens:e}=t;return e.drm?":host(:not([cast-receiver])) { --_cast-button-drm-display: none; }":""},ym=t=>Br`
|
|
1581
1581
|
<style>
|
|
1582
1582
|
${Cv(t)}
|
|
1583
1583
|
${gm}
|
|
1584
1584
|
</style>
|
|
1585
1585
|
${xv(t)}
|
|
1586
|
-
`,Lv=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return
|
|
1586
|
+
`,Lv=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Rr(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},wv={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",THUMB:"thumb",DISPLAY:"display",CONTROL_BAR:"control-bar",MENU_BUTTON:"menu-button",MENU:"menu",MENU_ITEM:"menu-item",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},Rv=Object.values(wv).join(", "),xv=t=>{var e,i,a,r,o,s,d,u,p,T,_,E,f,M,b,C,L,ie,Ae,kt,mt,Ia,Ma,Ca,La,wa,Ra,xa,Da,Oa,Pa,Na,lo,ht,Ua,Ha,Ba,$a,Wa;return Br`
|
|
1587
1587
|
<media-theme
|
|
1588
1588
|
template="${t.themeTemplate||!1}"
|
|
1589
1589
|
defaultstreamtype="${(e=t.defaultStreamType)!=null?e:!1}"
|
|
1590
1590
|
hotkeys="${Lv(t)||!1}"
|
|
1591
1591
|
nohotkeys="${t.noHotKeys||!t.hasSrc||!1}"
|
|
1592
|
-
noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(
|
|
1592
|
+
noautoseektolive="${!!((i=t.streamType)!=null&&i.includes($r.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
|
|
1593
1593
|
novolumepref="${t.novolumepref||!1}"
|
|
1594
1594
|
nomutedpref="${t.nomutedpref||!1}"
|
|
1595
1595
|
disabled="${!t.hasSrc||t.isDialogOpen}"
|
|
@@ -1613,7 +1613,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1613
1613
|
slot="media"
|
|
1614
1614
|
inert="${(M=t.noHotKeys)!=null?M:!1}"
|
|
1615
1615
|
target-live-window="${(b=t.targetLiveWindow)!=null?b:!1}"
|
|
1616
|
-
stream-type="${(C=
|
|
1616
|
+
stream-type="${(C=Rr(t.streamType))!=null?C:!1}"
|
|
1617
1617
|
crossorigin="${(L=t.crossOrigin)!=null?L:""}"
|
|
1618
1618
|
playsinline
|
|
1619
1619
|
autoplay="${(ie=t.autoplay)!=null?ie:!1}"
|
|
@@ -1630,17 +1630,18 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1630
1630
|
player-init-time="${(xa=t.playerInitTime)!=null?xa:!1}"
|
|
1631
1631
|
player-software-name="${(Da=t.playerSoftwareName)!=null?Da:!1}"
|
|
1632
1632
|
player-software-version="${(Oa=t.playerSoftwareVersion)!=null?Oa:!1}"
|
|
1633
|
-
env-key="${(
|
|
1634
|
-
custom-domain="${(
|
|
1635
|
-
src="${t.src?t.src:t.playbackId?(0
|
|
1636
|
-
cast-src="${t.src?t.src:t.playbackId?(0
|
|
1637
|
-
cast-receiver="${(
|
|
1633
|
+
env-key="${(Pa=t.envKey)!=null?Pa:!1}"
|
|
1634
|
+
custom-domain="${(Na=t.customDomain)!=null?Na:!1}"
|
|
1635
|
+
src="${t.src?t.src:t.playbackId?(0,$r.toMuxVideoURL)(t):!1}"
|
|
1636
|
+
cast-src="${t.src?t.src:t.playbackId?(0,$r.toMuxVideoURL)(t):!1}"
|
|
1637
|
+
cast-receiver="${(lo=t.castReceiver)!=null?lo:!1}"
|
|
1638
1638
|
drm-token="${(Ua=(ht=t.tokens)==null?void 0:ht.drm)!=null?Ua:!1}"
|
|
1639
1639
|
exportparts="video"
|
|
1640
1640
|
disable-pseudo-ended="${(Ha=t.disablePseudoEnded)!=null?Ha:!1}"
|
|
1641
1641
|
max-auto-resolution="${(Ba=t.maxAutoResolution)!=null?Ba:!1}"
|
|
1642
|
+
cap-rendition-to-player-size="${($a=t.capRenditionToPlayerSize)!=null?$a:!1}"
|
|
1642
1643
|
>
|
|
1643
|
-
${t.storyboard?
|
|
1644
|
+
${t.storyboard?Br`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:Br``}
|
|
1644
1645
|
<slot></slot>
|
|
1645
1646
|
</mux-video>
|
|
1646
1647
|
<slot name="poster" slot="poster">
|
|
@@ -1648,11 +1649,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1648
1649
|
part="poster"
|
|
1649
1650
|
exportparts="poster, img"
|
|
1650
1651
|
src="${t.poster?t.poster:!1}"
|
|
1651
|
-
placeholdersrc="${(
|
|
1652
|
+
placeholdersrc="${(Wa=t.placeholder)!=null?Wa:!1}"
|
|
1652
1653
|
></media-poster-image>
|
|
1653
1654
|
</slot>
|
|
1654
1655
|
</media-theme>
|
|
1655
|
-
`};var A=require("@mux/playback-core"),km=t=>t.charAt(0).toUpperCase()+t.slice(1),Dv=(t,e=!1)=>{var i,a;if(t.muxCode){let r=km((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);if(t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE)return(0,A.i18n)("Your device appears to be offline",e);if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,A.i18n)("{category} URL has expired",e).format({category:r});if([A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,A.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,A.i18n)("Invalid {categoryName} URL",e).format({categoryName:o});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return(0,A.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_READY){let s=t.streamType==="live"?"Live stream":"Video";return(0,A.i18n)("{mediaType} is not currently available",e).format({mediaType:s})}}if(t.code){if(t.code===A.MediaError.MEDIA_ERR_NETWORK)return(0,A.i18n)("Network Error",e);if(t.code===A.MediaError.MEDIA_ERR_DECODE)return(0,A.i18n)("Media Error",e);if(t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,A.i18n)("Source Not Supported",e)}return(0,A.i18n)("Error",e)},Ov=(t,e=!1)=>{var i,a;if(t.muxCode){let r=km((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);return t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE?(0,A.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,A.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,A.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,A.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:o}):[A.MuxErrorCode.NETWORK_TOKEN_MISSING,A.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,A.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND?"":t.message}return t.code&&(t.code===A.MediaError.MEDIA_ERR_NETWORK||t.code===A.MediaError.MEDIA_ERR_DECODE||t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},Sm=(t,e=!1)=>{let i=Dv(t,e).toString(),a=Ov(t,e).toString();return{title:i,message:a}},
|
|
1656
|
+
`};var A=require("@mux/playback-core"),km=t=>t.charAt(0).toUpperCase()+t.slice(1),Dv=(t,e=!1)=>{var i,a;if(t.muxCode){let r=km((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);if(t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE)return(0,A.i18n)("Your device appears to be offline",e);if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,A.i18n)("{category} URL has expired",e).format({category:r});if([A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,A.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,A.i18n)("Invalid {categoryName} URL",e).format({categoryName:o});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return(0,A.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_READY){let s=t.streamType==="live"?"Live stream":"Video";return(0,A.i18n)("{mediaType} is not currently available",e).format({mediaType:s})}}if(t.code){if(t.code===A.MediaError.MEDIA_ERR_NETWORK)return(0,A.i18n)("Network Error",e);if(t.code===A.MediaError.MEDIA_ERR_DECODE)return(0,A.i18n)("Media Error",e);if(t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,A.i18n)("Source Not Supported",e)}return(0,A.i18n)("Error",e)},Ov=(t,e=!1)=>{var i,a;if(t.muxCode){let r=km((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);return t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE?(0,A.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,A.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,A.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,A.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:o}):[A.MuxErrorCode.NETWORK_TOKEN_MISSING,A.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,A.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND?"":t.message}return t.code&&(t.code===A.MediaError.MEDIA_ERR_NETWORK||t.code===A.MediaError.MEDIA_ERR_DECODE||t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},Sm=(t,e=!1)=>{let i=Dv(t,e).toString(),a=Ov(t,e).toString();return{title:i,message:a}},Pv=t=>{if(t.muxCode){if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===A.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===A.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},jl=(t,e)=>{let i=Pv(t);return{message:t.message,context:t.context,file:i}};var Im=`<template id="media-theme-gerwig">
|
|
1656
1657
|
<style>
|
|
1657
1658
|
@keyframes pre-play-hide {
|
|
1658
1659
|
0% {
|
|
@@ -2784,7 +2785,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2784
2785
|
<slot></slot>
|
|
2785
2786
|
</media-controller>
|
|
2786
2787
|
</template>
|
|
2787
|
-
`;function Mm({anchor:t,floating:e,placement:i}){let a=Uv({anchor:t,floating:e}),{x:r,y:o}=Bv(a,i);return{x:r,y:o}}function Uv({anchor:t,floating:e}){return{anchor:Hv(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Hv(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 Bv({anchor:t,floating:e},i){let a=$v(i)==="x"?"y":"x",r=a==="y"?"height":"width",o=Cm(i),s=t.x+t.width/2-e.width/2,d=t.y+t.height/2-e.height/2,u=t[r]/2-e[r]/2,p;switch(o){case"top":p={x:s,y:t.y-e.height};break;case"bottom":p={x:s,y:t.y+t.height};break;case"right":p={x:t.x+t.width,y:d};break;case"left":p={x:t.x-e.width,y:d};break;default:p={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":p[a]-=u;break;case"end":p[a]+=u;break}return p}function Cm(t){return t.split("-")[0]}function $v(t){return["top","bottom"].includes(Cm(t))?"y":"x"}var Bt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},
|
|
2788
|
+
`;function Mm({anchor:t,floating:e,placement:i}){let a=Uv({anchor:t,floating:e}),{x:r,y:o}=Bv(a,i);return{x:r,y:o}}function Uv({anchor:t,floating:e}){return{anchor:Hv(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Hv(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 Bv({anchor:t,floating:e},i){let a=$v(i)==="x"?"y":"x",r=a==="y"?"height":"width",o=Cm(i),s=t.x+t.width/2-e.width/2,d=t.y+t.height/2-e.height/2,u=t[r]/2-e[r]/2,p;switch(o){case"top":p={x:s,y:t.y-e.height};break;case"bottom":p={x:s,y:t.y+t.height};break;case"right":p={x:t.x+t.width,y:d};break;case"left":p={x:t.x-e.width,y:d};break;default:p={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":p[a]-=u;break;case"end":p[a]+=u;break}return p}function Cm(t){return t.split("-")[0]}function $v(t){return["top","bottom"].includes(Cm(t))?"y":"x"}var Bt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},qn=class extends Event{constructor({newState:e,oldState:i,...a}){super("toggle",a),this.newState=e,this.oldState=i}};var cd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},$=(t,e,i)=>(cd(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)},ot=(t,e,i,a)=>(cd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),G=(t,e,i)=>(cd(t,e,"access private method"),i),nt,_i,$t,Zn,zn,Ai,Vr,ed,Lm,Jn,md,jn,Qn,td,id,wm,ad,Rm,rd,xm,la,da,ua,Kr,es,hd,od,Dm,pd,Om,nd,Pm,fd,Nm,sd,Um,ld,Hm,Wr,ts,dd,Bm,Fr,is,Xn,ud;function st({type:t,text:e,value:i,checked:a}){let r=V.createElement("media-chrome-menu-item");r.type=t!=null?t:"",r.part.add("menu-item"),t&&r.part.add(t),r.value=i,r.checked=a;let o=V.createElement("span");return o.textContent=e,r.append(o),r}function We(t,e){let i=t.querySelector(`:scope > [slot="${e}"]`);if((i==null?void 0:i.nodeName)=="SLOT"&&(i=i.assignedElements({flatten:!0})[0]),i)return i=i.cloneNode(!0),i;let a=t.shadowRoot.querySelector(`[name="${e}"] > svg`);return a?a.cloneNode(!0):""}function Wv(t){return`
|
|
2788
2789
|
<style>
|
|
2789
2790
|
:host {
|
|
2790
2791
|
font: var(--media-font,
|
|
@@ -2959,7 +2960,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2959
2960
|
<slot></slot>
|
|
2960
2961
|
</div>
|
|
2961
2962
|
<slot name="checked-indicator" hidden></slot>
|
|
2962
|
-
`}var gi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},j=class extends l.HTMLElement{constructor(){if(super(),K(this,jl),K(this,Xn),K(this,Qn),K(this,td),K(this,id),K(this,ad),K(this,ua),K(this,jn),K(this,rd),K(this,hd),K(this,od),K(this,pd),K(this,nd),K(this,sd),K(this,$r),K(this,ld),K(this,Wr),K(this,zn),K(this,nt,null),K(this,_i,null),K(this,$t,null),K(this,qn,new Set),K(this,Zn,void 0),K(this,Ai,!1),K(this,Fr,null),K(this,Jn,()=>{let e=$(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}));ot(this,qn,i)}),K(this,la,()=>{G(this,ua,Vr).call(this),G(this,jn,md).call(this,!1)}),K(this,da,()=>{G(this,ua,Vr).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),ot(this,Zn,new MutationObserver($(this,Jn))),$(this,Zn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[gi.DISABLED,gi.HIDDEN,gi.STYLE,gi.ANCHOR,x.MEDIA_CONTROLLER]}static formatMenuItemText(e,i){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":G(this,jl,Lm).call(this,e);break;case"invoke":G(this,td,wm).call(this,e);break;case"click":G(this,rd,Dm).call(this,e);break;case"toggle":G(this,od,Nm).call(this,e);break;case"focusout":G(this,nd,Um).call(this,e);break;case"keydown":G(this,sd,Hm).call(this,e);break}}connectedCallback(){var e,i;ot(this,Fr,Ya(this.shadowRoot,":host")),G(this,Qn,ed).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),ot(this,nt,vo(this)),(i=(e=$(this,nt))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(pt(Kr(this),$(this,la)),pt(this,$(this,da))),G(this,Xn,cd).call(this)}disconnectedCallback(){var e,i;ft(Kr(this),$(this,la)),ft(this,$(this,da)),this.disable(),(i=(e=$(this,nt))==null?void 0:e.unassociateElement)==null||i.call(e,this),ot(this,nt,null)}attributeChangedCallback(e,i,a){var r,o,s,d;e===gi.HIDDEN&&a!==i?($(this,Ai)||ot(this,Ai,!0),this.hidden?G(this,ad,xm).call(this):G(this,id,Rm).call(this),this.dispatchEvent(new Yn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===x.MEDIA_CONTROLLER?(i&&((o=(r=$(this,nt))==null?void 0:r.unassociateElement)==null||o.call(r,this),ot(this,nt,null)),a&&this.isConnected&&(ot(this,nt,vo(this)),(d=(s=$(this,nt))==null?void 0:s.associateElement)==null||d.call(s,this))):e===gi.DISABLED&&a!==i?a==null?this.enable():this.disable():e===gi.STYLE&&a!==i&&G(this,Qn,ed).call(this)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=qt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Fv)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,i;return(i=(e=this.checkedItems[0])==null?void 0:e.value)!=null?i:""}set value(e){let i=this.items.find(a=>a.value===e);i&&G(this,zn,dd).call(this,i)}focus(){if(ot(this,_i,Ga()),this.items.length){G(this,Wr,ts).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,$r,es).call(this,e);a&&(G(this,zn,dd).call(this,a,a.type==="checkbox"),$(this,$t)&&!this.hidden&&((i=$(this,_i))==null||i.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var i,a;let{key:r}=e,o=this.items,s=(a=(i=G(this,$r,es).call(this,e))!=null?i:G(this,ld,Bm).call(this))!=null?a:o[0],d=o.indexOf(s),u=Math.max(0,d);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=o.length-1),u<0&&(u=o.length-1),u>o.length-1&&(u=0),G(this,Wr,ts).call(this,o[u]),o[u].focus()}};nt=new WeakMap;_i=new WeakMap;$t=new WeakMap;qn=new WeakMap;Zn=new WeakMap;Ai=new WeakMap;Fr=new WeakMap;jl=new WeakSet;Lm=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:!0}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();["header","title"].includes(e.name)&&G(this,Xn,cd).call(this),e.name||$(this,Jn).call(this)};Xn=new WeakSet;cd=function(){let t=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');t.hidden=e.assignedNodes().length===0&&t.assignedNodes().length===0};Jn=new WeakMap;Qn=new WeakSet;ed=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")};td=new WeakSet;wm=function(t){ot(this,$t,t.relatedTarget),ue(this,t.relatedTarget)||(this.hidden=!this.hidden)};id=new WeakSet;Rm=function(){var t;(t=$(this,$t))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),pt(Kr(this),$(this,la)),pt(this,$(this,da))};ad=new WeakSet;xm=function(){var t;(t=$(this,$t))==null||t.setAttribute("aria-expanded","false"),ft(Kr(this),$(this,la)),ft(this,$(this,da))};la=new WeakMap;da=new WeakMap;ua=new WeakSet;Vr=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=Mm({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=Kr(this).getBoundingClientRect(),o=r.width-e-t,s=r.height-i-this.offsetHeight,{style:d}=$(this,Fr);d.setProperty("position","absolute"),d.setProperty("right",`${Math.max(0,o)}px`),d.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),T=d.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),_=r.height-T-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${_}px`)};jn=new WeakSet;md=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=$(this,Fr);if(t||a.setProperty("--media-menu-transition-in","none"),i){let r=i.offsetHeight,o=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${r}px`),G(this,ua,Vr).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,ua,Vr).call(this);a.removeProperty("--media-menu-transition-in")};rd=new WeakSet;Dm=function(t){var e;if(t.stopPropagation(),t.composedPath().includes($(this,hd,Om))){(e=$(this,_i))==null||e.focus(),this.hidden=!0;return}let i=G(this,$r,es).call(this,t);!i||i.hasAttribute("disabled")||(G(this,Wr,ts).call(this,i),this.handleSelect(t))};hd=new WeakSet;Om=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"]'))};od=new WeakSet;Nm=function(t){if(t.target===this)return;G(this,pd,Pm).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let i of e)i.invokeTargetElement!=t.target&&t.newState=="open"&&i.getAttribute("aria-expanded")=="true"&&!i.invokeTargetElement.hidden&&i.invokeTargetElement.dispatchEvent(new Bt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);G(this,jn,md).call(this,!0)};pd=new WeakSet;Pm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};nd=new WeakSet;Um=function(t){var e;ue(this,t.relatedTarget)||($(this,Ai)&&((e=$(this,_i))==null||e.focus()),$(this,$t)&&$(this,$t)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};sd=new WeakSet;Hm=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:p}=t;if(!(d||u||p)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if($(this,Ai)){this.hidden=!0;return}t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else s==="Escape"?((o=$(this,_i))==null||o.focus(),$(this,Ai)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};$r=new WeakSet;es=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};ld=new WeakSet;Bm=function(){return this.items.find(t=>t.tabIndex===0)};Wr=new WeakSet;ts=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};zn=new WeakSet;dd=function(t,e){let i=[...this.checkedItems];t.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?t.checked=!t.checked:t.checked=!0,this.checkedItems.some((a,r)=>a!=i[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};j.shadowRootOptions={mode:"open"};j.getTemplateHTML=Wv;function Fv(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function Kr(t){var e;return(e=t.getAttribute("bounds")?Ve(t,`#${t.getAttribute("bounds")}`):Y(t)||t.parentElement)!=null?e:t}l.customElements.get("media-chrome-menu")||l.customElements.define("media-chrome-menu",j);var _d=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},lt=(t,e,i)=>(_d(t,e,"read from private field"),i?i.call(t):e.get(t)),Tt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},fd=(t,e,i,a)=>(_d(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Fe=(t,e,i)=>(_d(t,e,"access private method"),i),is,Yr,vd,$m,rs,Ad,Td,Wm,dt,ca,qr,Ed,Fm,as,bd;function Vv(t){return`
|
|
2963
|
+
`}var gi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},j=class extends l.HTMLElement{constructor(){if(super(),K(this,ed),K(this,Jn),K(this,Qn),K(this,id),K(this,ad),K(this,rd),K(this,ua),K(this,es),K(this,od),K(this,pd),K(this,nd),K(this,fd),K(this,sd),K(this,ld),K(this,Wr),K(this,dd),K(this,Fr),K(this,Xn),K(this,nt,null),K(this,_i,null),K(this,$t,null),K(this,Zn,new Set),K(this,zn,void 0),K(this,Ai,!1),K(this,Vr,null),K(this,jn,()=>{let e=$(this,Zn),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}));ot(this,Zn,i)}),K(this,la,()=>{G(this,ua,Kr).call(this),G(this,es,hd).call(this,!1)}),K(this,da,()=>{G(this,ua,Kr).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),ot(this,zn,new MutationObserver($(this,jn))),$(this,zn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[gi.DISABLED,gi.HIDDEN,gi.STYLE,gi.ANCHOR,x.MEDIA_CONTROLLER]}static formatMenuItemText(e,i){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":G(this,ed,Lm).call(this,e);break;case"invoke":G(this,id,wm).call(this,e);break;case"click":G(this,od,Dm).call(this,e);break;case"toggle":G(this,nd,Pm).call(this,e);break;case"focusout":G(this,sd,Um).call(this,e);break;case"keydown":G(this,ld,Hm).call(this,e);break}}connectedCallback(){var e,i;ot(this,Vr,qa(this.shadowRoot,":host")),G(this,Qn,td).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),ot(this,nt,Eo(this)),(i=(e=$(this,nt))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(pt(Gr(this),$(this,la)),pt(this,$(this,da))),G(this,Jn,md).call(this)}disconnectedCallback(){var e,i;ft(Gr(this),$(this,la)),ft(this,$(this,da)),this.disable(),(i=(e=$(this,nt))==null?void 0:e.unassociateElement)==null||i.call(e,this),ot(this,nt,null)}attributeChangedCallback(e,i,a){var r,o,s,d;e===gi.HIDDEN&&a!==i?($(this,Ai)||ot(this,Ai,!0),this.hidden?G(this,rd,xm).call(this):G(this,ad,Rm).call(this),this.dispatchEvent(new qn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===x.MEDIA_CONTROLLER?(i&&((o=(r=$(this,nt))==null?void 0:r.unassociateElement)==null||o.call(r,this),ot(this,nt,null)),a&&this.isConnected&&(ot(this,nt,Eo(this)),(d=(s=$(this,nt))==null?void 0:s.associateElement)==null||d.call(s,this))):e===gi.DISABLED&&a!==i?a==null?this.enable():this.disable():e===gi.STYLE&&a!==i&&G(this,Qn,td).call(this)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=qt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Fv)}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,Xn,ud).call(this,i)}focus(){if(ot(this,_i,Ya()),this.items.length){G(this,Fr,is).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,Wr,ts).call(this,e);a&&(G(this,Xn,ud).call(this,a,a.type==="checkbox"),$(this,$t)&&!this.hidden&&((i=$(this,_i))==null||i.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var i,a;let{key:r}=e,o=this.items,s=(a=(i=G(this,Wr,ts).call(this,e))!=null?i:G(this,dd,Bm).call(this))!=null?a:o[0],d=o.indexOf(s),u=Math.max(0,d);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=o.length-1),u<0&&(u=o.length-1),u>o.length-1&&(u=0),G(this,Fr,is).call(this,o[u]),o[u].focus()}};nt=new WeakMap;_i=new WeakMap;$t=new WeakMap;Zn=new WeakMap;zn=new WeakMap;Ai=new WeakMap;Vr=new WeakMap;ed=new WeakSet;Lm=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:!0}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();["header","title"].includes(e.name)&&G(this,Jn,md).call(this),e.name||$(this,jn).call(this)};Jn=new WeakSet;md=function(){let t=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');t.hidden=e.assignedNodes().length===0&&t.assignedNodes().length===0};jn=new WeakMap;Qn=new WeakSet;td=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")};id=new WeakSet;wm=function(t){ot(this,$t,t.relatedTarget),ue(this,t.relatedTarget)||(this.hidden=!this.hidden)};ad=new WeakSet;Rm=function(){var t;(t=$(this,$t))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),pt(Gr(this),$(this,la)),pt(this,$(this,da))};rd=new WeakSet;xm=function(){var t;(t=$(this,$t))==null||t.setAttribute("aria-expanded","false"),ft(Gr(this),$(this,la)),ft(this,$(this,da))};la=new WeakMap;da=new WeakMap;ua=new WeakSet;Kr=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=Mm({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=Gr(this).getBoundingClientRect(),o=r.width-e-t,s=r.height-i-this.offsetHeight,{style:d}=$(this,Vr);d.setProperty("position","absolute"),d.setProperty("right",`${Math.max(0,o)}px`),d.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),T=d.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),_=r.height-T-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${_}px`)};es=new WeakSet;hd=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=$(this,Vr);if(t||a.setProperty("--media-menu-transition-in","none"),i){let r=i.offsetHeight,o=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${r}px`),G(this,ua,Kr).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,ua,Kr).call(this);a.removeProperty("--media-menu-transition-in")};od=new WeakSet;Dm=function(t){var e;if(t.stopPropagation(),t.composedPath().includes($(this,pd,Om))){(e=$(this,_i))==null||e.focus(),this.hidden=!0;return}let i=G(this,Wr,ts).call(this,t);!i||i.hasAttribute("disabled")||(G(this,Fr,is).call(this,i),this.handleSelect(t))};pd=new WeakSet;Om=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"]'))};nd=new WeakSet;Pm=function(t){if(t.target===this)return;G(this,fd,Nm).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let i of e)i.invokeTargetElement!=t.target&&t.newState=="open"&&i.getAttribute("aria-expanded")=="true"&&!i.invokeTargetElement.hidden&&i.invokeTargetElement.dispatchEvent(new Bt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);G(this,es,hd).call(this,!0)};fd=new WeakSet;Nm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};sd=new WeakSet;Um=function(t){var e;ue(this,t.relatedTarget)||($(this,Ai)&&((e=$(this,_i))==null||e.focus()),$(this,$t)&&$(this,$t)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};ld=new WeakSet;Hm=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:p}=t;if(!(d||u||p)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if($(this,Ai)){this.hidden=!0;return}t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else s==="Escape"?((o=$(this,_i))==null||o.focus(),$(this,Ai)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};Wr=new WeakSet;ts=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};dd=new WeakSet;Bm=function(){return this.items.find(t=>t.tabIndex===0)};Fr=new WeakSet;is=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};Xn=new WeakSet;ud=function(t,e){let i=[...this.checkedItems];t.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?t.checked=!t.checked:t.checked=!0,this.checkedItems.some((a,r)=>a!=i[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};j.shadowRootOptions={mode:"open"};j.getTemplateHTML=Wv;function Fv(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function Gr(t){var e;return(e=t.getAttribute("bounds")?Ve(t,`#${t.getAttribute("bounds")}`):Y(t)||t.parentElement)!=null?e:t}l.customElements.get("media-chrome-menu")||l.customElements.define("media-chrome-menu",j);var Ad=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},lt=(t,e,i)=>(Ad(t,e,"read from private field"),i?i.call(t):e.get(t)),Tt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},vd=(t,e,i,a)=>(Ad(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Fe=(t,e,i)=>(Ad(t,e,"access private method"),i),as,qr,Ed,$m,os,Td,yd,Wm,dt,ca,Zr,bd,Fm,rs,gd;function Vv(t){return`
|
|
2963
2964
|
<style>
|
|
2964
2965
|
:host {
|
|
2965
2966
|
transition: var(--media-menu-item-transition,
|
|
@@ -3077,7 +3078,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3077
3078
|
${this.getSuffixSlotInnerHTML(t)}
|
|
3078
3079
|
</slot>
|
|
3079
3080
|
<slot name="submenu"></slot>
|
|
3080
|
-
`}function Kv(t){return""}var De={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Ce=class extends l.HTMLElement{constructor(){if(super(),Tt(this,
|
|
3081
|
+
`}function Kv(t){return""}var De={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Ce=class extends l.HTMLElement{constructor(){if(super(),Tt(this,Ed),Tt(this,os),Tt(this,yd),Tt(this,ca),Tt(this,bd),Tt(this,rs),Tt(this,as,!1),Tt(this,qr,void 0),Tt(this,dt,()=>{var e,i;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let a=this.shadowRoot.querySelector('slot[name="description"]'),r=(e=this.submenuElement.checkedItems)==null?void 0:e[0],o=(i=r==null?void 0:r.dataset.description)!=null?i:r==null?void 0:r.text,s=V.createElement("span");s.textContent=o!=null?o:"",a.replaceChildren(s)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[De.TYPE,De.DISABLED,De.CHECKED,De.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Yr(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":Fe(this,Ed,$m).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":Fe(this,bd,Fm).call(this,e);break;case"keyup":Fe(this,ca,Zr).call(this,e);break}}attributeChangedCallback(e,i,a){e===De.CHECKED&&Yr(this)&&!lt(this,as)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===De.TYPE&&a!==i?this.role="menuitem"+a:e===De.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(De.DISABLED)||this.enable(),this.role="menuitem"+this.type,vd(this,qr,_d(this,this.parentNode)),Fe(this,rs,gd).call(this),this.submenuElement&&Fe(this,os,Td).call(this)}disconnectedCallback(){this.disable(),Fe(this,rs,gd).call(this),vd(this,qr,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=qt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(De.TYPE))!=null?e:""}set type(e){this.setAttribute(De.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(De.VALUE))!=null?e:this.text}set value(e){this.setAttribute(De.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Yr(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Yr(this)&&(vd(this,as,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Yr(this)||this.invokeTargetElement&&ue(this,e.target)&&this.invokeTargetElement.dispatchEvent(new Bt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};as=new WeakMap;qr=new WeakMap;Ed=new WeakSet;$m=function(t){let e=t.target;if(!(e!=null&&e.name))for(let a of e.assignedNodes({flatten:!0}))a instanceof Text&&a.textContent.trim()===""&&a.remove();e.name==="submenu"&&(this.submenuElement?Fe(this,os,Td).call(this):Fe(this,yd,Wm).call(this))};os=new WeakSet;Td=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",lt(this,dt)),this.submenuElement.addEventListener("addmenuitem",lt(this,dt)),this.submenuElement.addEventListener("removemenuitem",lt(this,dt)),lt(this,dt).call(this)};yd=new WeakSet;Wm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",lt(this,dt)),this.submenuElement.removeEventListener("addmenuitem",lt(this,dt)),this.submenuElement.removeEventListener("removemenuitem",lt(this,dt)),lt(this,dt).call(this)};dt=new WeakMap;ca=new WeakSet;Zr=function(t){let{key:e}=t;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",Fe(this,ca,Zr));return}this.handleClick(t)};bd=new WeakSet;Fm=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!this.keysUsed.includes(a)){this.removeEventListener("keyup",Fe(this,ca,Zr));return}this.addEventListener("keyup",Fe(this,ca,Zr),{once:!0})};rs=new WeakSet;gd=function(){var t;let e=(t=lt(this,qr))==null?void 0:t.radioGroupItems;if(!e)return;let i=e.filter(a=>a.getAttribute("aria-checked")==="true").pop();i||(i=e[0]);for(let a of e)a.setAttribute("aria-checked","false");i==null||i.setAttribute("aria-checked","true")};Ce.shadowRootOptions={mode:"open"};Ce.getTemplateHTML=Vv;Ce.getSuffixSlotInnerHTML=Kv;function Yr(t){return t.type==="radio"||t.type==="checkbox"}function _d(t,e){if(!t)return null;let{host:i}=t.getRootNode();return!e&&i?_d(t,i):e!=null&&e.items?e:_d(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-menu-item")||l.customElements.define("media-chrome-menu-item",Ce);function Gv(t){return`
|
|
3081
3082
|
${j.getTemplateHTML(t)}
|
|
3082
3083
|
<style>
|
|
3083
3084
|
:host {
|
|
@@ -3112,7 +3113,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3112
3113
|
--media-settings-menu-item-opacity: 0;
|
|
3113
3114
|
}
|
|
3114
3115
|
</style>
|
|
3115
|
-
`}var
|
|
3116
|
+
`}var zr=class extends j{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-settings-menu-button")}};zr.getTemplateHTML=Gv;l.customElements.get("media-settings-menu")||l.customElements.define("media-settings-menu",zr);function Yv(t){return`
|
|
3116
3117
|
${Ce.getTemplateHTML.call(this,t)}
|
|
3117
3118
|
<style>
|
|
3118
3119
|
slot:not([name="submenu"]) {
|
|
@@ -3138,7 +3139,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3138
3139
|
<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"/>
|
|
3139
3140
|
</svg>
|
|
3140
3141
|
</slot>
|
|
3141
|
-
`}function
|
|
3142
|
+
`}function zv(){return h("Settings")}var ma=class extends _e{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-settings-menu")}};ma.getSlotTemplateHTML=Zv;ma.getTooltipContentHTML=zv;l.customElements.get("media-settings-menu-button")||l.customElements.define("media-settings-menu-button",ma);var Md=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Vm=(t,e,i)=>(Md(t,e,"read from private field"),i?i.call(t):e.get(t)),ns=(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)},kd=(t,e,i,a)=>(Md(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ss=(t,e,i)=>(Md(t,e,"access private method"),i),Qr,us,ls,Sd,ds,Id,cs=class extends j{constructor(){super(...arguments),ns(this,ls),ns(this,ds),ns(this,Qr,[]),ns(this,us,void 0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_LIST,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_AUDIO_TRACK_ENABLED&&i!==a?this.value=a:e===n.MEDIA_AUDIO_TRACK_LIST&&i!==a&&(kd(this,Qr,vu(a!=null?a:"")),ss(this,ls,Sd).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ss(this,ds,Id))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ss(this,ds,Id))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=Y(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Vm(this,Qr)}set mediaAudioTrackList(e){kd(this,Qr,e),ss(this,ls,Sd).call(this)}get mediaAudioTrackEnabled(){var e;return(e=w(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){R(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};Qr=new WeakMap;us=new WeakMap;ls=new WeakSet;Sd=function(){if(Vm(this,us)===JSON.stringify(this.mediaAudioTrackList))return;kd(this,us,JSON.stringify(this.mediaAudioTrackList));let t=this.mediaAudioTrackList;this.defaultSlot.textContent="",t.sort((e,i)=>e.id.localeCompare(i.id,void 0,{numeric:!0}));for(let e of t){let i=this.formatMenuItemText(e.label,e),a=st({type:"radio",text:i,value:`${e.id}`,checked:e.enabled});a.prepend(We(this,"checked-indicator")),this.defaultSlot.append(a)}};ds=new WeakSet;Id=function(){if(this.value==null)return;let t=new l.CustomEvent(m.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};l.customElements.get("media-audio-track-menu")||l.customElements.define("media-audio-track-menu",cs);var Qv=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
3142
3143
|
<path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
|
|
3143
3144
|
<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"/>
|
|
3144
3145
|
</svg>`;function Xv(){return`
|
|
@@ -3147,14 +3148,14 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3147
3148
|
display: none;
|
|
3148
3149
|
}
|
|
3149
3150
|
</style>
|
|
3150
|
-
<slot name="icon">${
|
|
3151
|
-
`}function Jv(){return h("Audio")}var Km=t=>{let e=h("Audio");t.setAttribute("aria-label",e)},ha=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Km(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LANG&&Km(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Y(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=w(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){R(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};ha.getSlotTemplateHTML=Xv;ha.getTooltipContentHTML=Jv;l.customElements.get("media-audio-track-menu-button")||l.customElements.define("media-audio-track-menu-button",ha);var
|
|
3151
|
+
<slot name="icon">${Qv}</slot>
|
|
3152
|
+
`}function Jv(){return h("Audio")}var Km=t=>{let e=h("Audio");t.setAttribute("aria-label",e)},ha=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Km(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LANG&&Km(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Y(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=w(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){R(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};ha.getSlotTemplateHTML=Xv;ha.getTooltipContentHTML=Jv;l.customElements.get("media-audio-track-menu-button")||l.customElements.define("media-audio-track-menu-button",ha);var Rd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},jv=(t,e,i)=>(Rd(t,e,"read from private field"),i?i.call(t):e.get(t)),Cd=(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)},eE=(t,e,i,a)=>(Rd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ms=(t,e,i)=>(Rd(t,e,"access private method"),i),fs,hs,Ld,ps,wd,tE=`
|
|
3152
3153
|
<svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
|
|
3153
3154
|
<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"/>
|
|
3154
3155
|
</svg>`;function iE(t){return`
|
|
3155
3156
|
${j.getTemplateHTML(t)}
|
|
3156
3157
|
<slot name="captions-indicator" hidden>${tE}</slot>
|
|
3157
|
-
`}var
|
|
3158
|
+
`}var Xr=class extends j{constructor(){super(...arguments),Cd(this,hs),Cd(this,ps),Cd(this,fs,void 0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_LIST&&i!==a?ms(this,hs,Ld).call(this):e===n.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a||"",ms(this,hs,Ld).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ms(this,ps,wd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ms(this,ps,wd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Gm(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Ym(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Gm(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Ym(this,n.MEDIA_SUBTITLES_SHOWING,e)}};fs=new WeakMap;hs=new WeakSet;Ld=function(){var t;let e=jv(this,fs)!==JSON.stringify(this.mediaSubtitlesList),i=this.value!==this.getAttribute(n.MEDIA_SUBTITLES_SHOWING);if(!e&&!i)return;eE(this,fs,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let a=!this.value,r=st({type:"radio",text:this.formatMenuItemText(h("Off")),value:"off",checked:a});r.prepend(We(this,"checked-indicator")),this.defaultSlot.append(r);let o=this.mediaSubtitlesList;for(let s of o){let d=st({type:"radio",text:this.formatMenuItemText(s.label,s),value:wo(s),checked:this.value==wo(s)});d.prepend(We(this,"checked-indicator")),((t=s.kind)!=null?t:"subs")==="captions"&&d.append(We(this,"captions-indicator")),this.defaultSlot.append(d)}};ps=new WeakSet;wd=function(){let t=this.mediaSubtitlesShowing,e=this.getAttribute(n.MEDIA_SUBTITLES_SHOWING),i=this.value!==e;if(t!=null&&t.length&&i&&this.dispatchEvent(new l.CustomEvent(m.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t})),!this.value||!i)return;let a=new l.CustomEvent(m.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};Xr.getTemplateHTML=iE;var Gm=(t,e)=>{let i=t.getAttribute(e);return i?Xt(i):[]},Ym=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=Et(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-menu")||l.customElements.define("media-captions-menu",Xr);var aE=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
3158
3159
|
<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"/>
|
|
3159
3160
|
</svg>`,rE=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
3160
3161
|
<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"/>
|
|
@@ -3178,7 +3179,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3178
3179
|
<slot name="on">${aE}</slot>
|
|
3179
3180
|
<slot name="off">${rE}</slot>
|
|
3180
3181
|
</slot>
|
|
3181
|
-
`}function nE(){return h("Captions")}var qm=t=>{t.setAttribute("data-captions-enabled",
|
|
3182
|
+
`}function nE(){return h("Captions")}var qm=t=>{t.setAttribute("data-captions-enabled",Ro(t).toString())},Zm=t=>{t.setAttribute("aria-label",h("closed captions"))},pa=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING,n.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),Zm(this),qm(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING?qm(this):e===n.MEDIA_LANG&&Zm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Y(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return zm(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Qm(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return zm(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Qm(this,n.MEDIA_SUBTITLES_SHOWING,e)}};pa.getSlotTemplateHTML=oE;pa.getTooltipContentHTML=nE;var zm=(t,e)=>{let i=t.getAttribute(e);return i?Xt(i):[]},Qm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=Et(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-menu-button")||l.customElements.define("media-captions-menu-button",pa);var Xm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},va=(t,e,i)=>(Xm(t,e,"read from private field"),i?i.call(t):e.get(t)),xd=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},fa=(t,e,i)=>(Xm(t,e,"access private method"),i),Wt,Ea,Jr,vs,Od,Dd={RATES:"rates"},Es=class extends j{constructor(){super(),xd(this,Ea),xd(this,vs),xd(this,Wt,new Ct(this,Dd.RATES,{defaultValue:Tl})),fa(this,Ea,Jr).call(this)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,Dd.RATES]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PLAYBACK_RATE&&i!=a?(this.value=a,fa(this,Ea,Jr).call(this)):e===Dd.RATES&&i!=a&&(va(this,Wt).value=a,fa(this,Ea,Jr).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",fa(this,vs,Od))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",fa(this,vs,Od))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-playback-rate-menu-button")}get rates(){return va(this,Wt)}set rates(e){e?Array.isArray(e)?va(this,Wt).value=e.join(" "):typeof e=="string"&&(va(this,Wt).value=e):va(this,Wt).value="",fa(this,Ea,Jr).call(this)}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,ni)}set mediaPlaybackRate(e){N(this,n.MEDIA_PLAYBACK_RATE,e)}};Wt=new WeakMap;Ea=new WeakSet;Jr=function(){this.defaultSlot.textContent="";let t=this.mediaPlaybackRate,e=new Set(Array.from(va(this,Wt)).map(a=>Number(a)));t>0&&!e.has(t)&&e.add(t);let i=Array.from(e).sort((a,r)=>a-r);for(let a of i){let r=st({type:"radio",text:this.formatMenuItemText(`${a}x`,a),value:a.toString(),checked:t===a});r.prepend(We(this,"checked-indicator")),this.defaultSlot.append(r)}};vs=new WeakSet;Od=function(){if(!this.value)return;let t=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};l.customElements.get("media-playback-rate-menu")||l.customElements.define("media-playback-rate-menu",Es);var bs=1;function sE(t){return`
|
|
3182
3183
|
<style>
|
|
3183
3184
|
:host {
|
|
3184
3185
|
min-width: 5ch;
|
|
@@ -3193,8 +3194,8 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3193
3194
|
display: none;
|
|
3194
3195
|
}
|
|
3195
3196
|
</style>
|
|
3196
|
-
<slot name="icon">${t.mediaplaybackrate||
|
|
3197
|
-
`}function lE(){return h("Playback rate")}var ba=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:
|
|
3197
|
+
<slot name="icon">${t.mediaplaybackrate||bs}x</slot>
|
|
3198
|
+
`}function lE(){return h("Playback rate")}var ba=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:bs}x`}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===n.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,o=Number.isNaN(r)?bs:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",h("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,bs)}set mediaPlaybackRate(e){N(this,n.MEDIA_PLAYBACK_RATE,e)}};ba.getSlotTemplateHTML=sE;ba.getTooltipContentHTML=lE;l.customElements.get("media-playback-rate-menu-button")||l.customElements.define("media-playback-rate-menu-button",ba);var Nd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},jr=(t,e,i)=>(Nd(t,e,"read from private field"),i?i.call(t):e.get(t)),gs=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Jm=(t,e,i,a)=>(Nd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ga=(t,e,i)=>(Nd(t,e,"access private method"),i),eo,Aa,_a,to,_s,Pd,As=class extends j{constructor(){super(...arguments),gs(this,_a),gs(this,_s),gs(this,eo,[]),gs(this,Aa,{})}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_LIST,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}static formatMenuItemText(e,i){return super.formatMenuItemText(e,i)}static formatRendition(e,{showBitrate:i=!1}={}){let a=`${Math.min(e.width,e.height)}p`;if(i&&e.bitrate){let r=e.bitrate/1e6,o=`${r.toFixed(r<1?1:0)} Mbps`;return`${a} (${o})`}return this.formatMenuItemText(a,e)}static compareRendition(e,i){var a,r;return i.height===e.height?((a=i.bitrate)!=null?a:0)-((r=e.bitrate)!=null?r:0):i.height-e.height}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_RENDITION_SELECTED&&i!==a?(this.value=a!=null?a:"auto",ga(this,_a,to).call(this)):e===n.MEDIA_RENDITION_LIST&&i!==a?(Jm(this,eo,pu(a)),ga(this,_a,to).call(this)):e===n.MEDIA_HEIGHT&&i!==a&&ga(this,_a,to).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ga(this,_s,Pd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ga(this,_s,Pd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return jr(this,eo)}set mediaRenditionList(e){Jm(this,eo,e),ga(this,_a,to).call(this)}get mediaRenditionSelected(){return w(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){R(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return O(this,n.MEDIA_HEIGHT)}set mediaHeight(e){N(this,n.MEDIA_HEIGHT,e)}compareRendition(e,i){return this.constructor.compareRendition(e,i)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}formatRendition(e,i){return this.constructor.formatRendition(e,i)}showRenditionBitrate(e){return this.mediaRenditionList.some(i=>i!==e&&i.height===e.height&&i.bitrate!==e.bitrate)}};eo=new WeakMap;Aa=new WeakMap;_a=new WeakSet;to=function(){if(jr(this,Aa).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&jr(this,Aa).mediaHeight===this.mediaHeight)return;jr(this,Aa).mediaRenditionList=JSON.stringify(this.mediaRenditionList),jr(this,Aa).mediaHeight=this.mediaHeight;let t=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=t.find(s=>s.id===this.mediaRenditionSelected);for(let s of t)s.selected=s===e;this.defaultSlot.textContent="";let i=!this.mediaRenditionSelected;for(let s of t){let d=this.formatRendition(s,{showBitrate:this.showRenditionBitrate(s)}),u=st({type:"radio",text:d,value:`${s.id}`,checked:s.selected&&!i});u.prepend(We(this,"checked-indicator")),this.defaultSlot.append(u)}let a=e&&this.showRenditionBitrate(e),r=i?e?this.formatMenuItemText(`${h("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:a})}`,e):this.formatMenuItemText(`${h("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(h("Auto")),o=st({type:"radio",text:r,value:"auto",checked:i});o.dataset.description=r,o.prepend(We(this,"checked-indicator")),this.defaultSlot.append(o)};_s=new WeakSet;Pd=function(){if(this.value==null)return;let t=new l.CustomEvent(m.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};l.customElements.get("media-rendition-menu")||l.customElements.define("media-rendition-menu",As);var dE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
3198
3199
|
<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" />
|
|
3199
3200
|
</svg>`;function uE(){return`
|
|
3200
3201
|
<style>
|
|
@@ -3203,7 +3204,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3203
3204
|
}
|
|
3204
3205
|
</style>
|
|
3205
3206
|
<slot name="icon">${dE}</slot>
|
|
3206
|
-
`}function cE(){return h("Quality")}var Ta=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return w(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){R(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return O(this,n.MEDIA_HEIGHT)}set mediaHeight(e){
|
|
3207
|
+
`}function cE(){return h("Quality")}var Ta=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return w(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){R(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return O(this,n.MEDIA_HEIGHT)}set mediaHeight(e){N(this,n.MEDIA_HEIGHT,e)}};Ta.getSlotTemplateHTML=uE;Ta.getTooltipContentHTML=cE;l.customElements.get("media-rendition-menu-button")||l.customElements.define("media-rendition-menu-button",Ta);var Bd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ct=(t,e,i)=>(Bd(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)},jm=(t,e,i,a)=>(Bd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Oe=(t,e,i)=>(Bd(t,e,"access private method"),i),ka,io,Ms,yi,ya,$d,eh,Ts,Ud,ys,Hd,th,Ss,Is,ks;function mE(t){return`
|
|
3207
3208
|
${j.getTemplateHTML(t)}
|
|
3208
3209
|
<style>
|
|
3209
3210
|
:host {
|
|
@@ -3217,7 +3218,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3217
3218
|
overflow: hidden;
|
|
3218
3219
|
}
|
|
3219
3220
|
</style>
|
|
3220
|
-
`}var
|
|
3221
|
+
`}var ao=class extends j{constructor(){super(),ut(this,io),ut(this,yi),ut(this,$d),ut(this,Ts),ut(this,Hd),ut(this,ka,!1),ut(this,ys,e=>{let i=e.target,a=(i==null?void 0:i.nodeName)==="VIDEO",r=Oe(this,Ts,Ud).call(this,i);(a||r)&&(ct(this,ka)?Oe(this,yi,ya).call(this):Oe(this,Hd,th).call(this,e))}),ut(this,Ss,e=>{let i=e.target,a=this.contains(i),r=e.button===2,o=(i==null?void 0:i.nodeName)==="VIDEO",s=Oe(this,Ts,Ud).call(this,i);a||r&&(o||s)||Oe(this,yi,ya).call(this)}),ut(this,Is,e=>{e.key==="Escape"&&Oe(this,yi,ya).call(this)}),ut(this,ks,e=>{var i,a;let r=e.target;if((i=r.matches)!=null&&i.call(r,'button[invoke="copy"]')){let o=(a=r.closest("media-context-menu-item"))==null?void 0:a.querySelector('input[slot="copy"]');o&&navigator.clipboard.writeText(o.value)}Oe(this,yi,ya).call(this)}),this.setAttribute("noautohide",""),Oe(this,io,Ms).call(this)}connectedCallback(){super.connectedCallback(),Y(this).addEventListener("contextmenu",ct(this,ys)),this.addEventListener("click",ct(this,ks))}disconnectedCallback(){super.disconnectedCallback(),Y(this).removeEventListener("contextmenu",ct(this,ys)),this.removeEventListener("click",ct(this,ks)),document.removeEventListener("mousedown",ct(this,Ss)),document.removeEventListener("keydown",ct(this,Is))}};ka=new WeakMap;io=new WeakSet;Ms=function(){this.hidden=!ct(this,ka)};yi=new WeakSet;ya=function(){jm(this,ka,!1),Oe(this,io,Ms).call(this)};$d=new WeakSet;eh=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var i;e!==this&&Oe(i=e,yi,ya).call(i)})};Ts=new WeakSet;Ud=function(t){return t?t.hasAttribute("slot")&&t.getAttribute("slot")==="media"?!0:t.nodeName.includes("-")&&t.tagName.includes("-")?t.hasAttribute("src")||t.hasAttribute("poster")||t.hasAttribute("preload")||t.hasAttribute("playsinline"):!1:!1};ys=new WeakMap;Hd=new WeakSet;th=function(t){t.preventDefault(),Oe(this,$d,eh).call(this),jm(this,ka,!0),this.style.position="fixed",this.style.left=`${t.clientX}px`,this.style.top=`${t.clientY}px`,Oe(this,io,Ms).call(this),document.addEventListener("mousedown",ct(this,Ss),{once:!0}),document.addEventListener("keydown",ct(this,Is),{once:!0})};Ss=new WeakMap;Is=new WeakMap;ks=new WeakMap;ao.getTemplateHTML=mE;l.customElements.get("media-context-menu")||l.customElements.define("media-context-menu",ao);function hE(t){return`
|
|
3221
3222
|
${Ce.getTemplateHTML.call(this,t)}
|
|
3222
3223
|
<style>
|
|
3223
3224
|
::slotted(*) {
|
|
@@ -3230,7 +3231,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3230
3231
|
min-height: var(--media-control-height, 24px);
|
|
3231
3232
|
}
|
|
3232
3233
|
</style>
|
|
3233
|
-
`}var Sa=class extends Ce{};Sa.shadowRootOptions={mode:"open"};Sa.getTemplateHTML=hE;l.customElements.get("media-context-menu-item")||l.customElements.define("media-context-menu-item",Sa);var
|
|
3234
|
+
`}var Sa=class extends Ce{};Sa.shadowRootOptions={mode:"open"};Sa.getTemplateHTML=hE;l.customElements.get("media-context-menu-item")||l.customElements.define("media-context-menu-item",Sa);var Wd=Gt.createElement("template");"innerHTML"in Wd&&(Wd.innerHTML=Im);var ih,ah,Cs=class extends bi{};Cs.template=(ah=(ih=Wd.content)==null?void 0:ih.children)==null?void 0:ah[0];ke.customElements.get("media-theme-gerwig")||ke.customElements.define("media-theme-gerwig",Cs);var pE="gerwig",yt={SRC:"src",POSTER:"poster"},c={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",FULLSCREEN_ELEMENT:"fullscreen-element",DRM_TOKEN:"drm-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",VIDEO_TITLE:"video-title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref",NO_MUTED_PREF:"no-muted-pref",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge",DISABLE_PSEUDO_ENDED:"disable-pseudo-ended"},Fd=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","videotitle","novolumepref","nomutedpref","proudlydisplaymuxbadge"];function fE(t,e){var a,r,o;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:((a=t.media)==null?void 0:a.currentSrc)&&t.storyboard,storyboardSrc:t.getAttribute(c.STORYBOARD_SRC),fullscreenElement:t.getAttribute(c.FULLSCREEN_ELEMENT),placeholder:t.getAttribute("placeholder"),themeTemplate:EE(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(c.NOHOTKEYS),hotKeys:t.getAttribute(c.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,maxAutoResolution:t.maxAutoResolution,programStartTime:t.programStartTime,programEndTime:t.programEndTime,assetStartTime:t.assetStartTime,assetEndTime:t.assetEndTime,renditionOrder:t.renditionOrder,metadata:t.metadata,playerInitTime:t.playerInitTime,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:Rr(t.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:t.getAttribute(c.PRIMARY_COLOR),secondaryColor:t.getAttribute(c.SECONDARY_COLOR),accentColor:t.getAttribute(c.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:bE(t),playbackRates:t.getAttribute(c.PLAYBACK_RATES),customDomain:(r=t.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?r:void 0,title:t.getAttribute(c.TITLE),videoTitle:(o=t.getAttribute(c.VIDEO_TITLE))!=null?o:t.getAttribute(c.TITLE),novolumepref:t.hasAttribute(c.NO_VOLUME_PREF),nomutedpref:t.hasAttribute(c.NO_MUTED_PREF),proudlyDisplayMuxBadge:t.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE),castReceiver:t.castReceiver,disablePseudoEnded:t.hasAttribute(c.DISABLE_PSEUDO_ENDED),capRenditionToPlayerSize:t.capRenditionToPlayerSize,...e,extraSourceParams:t.extraSourceParams}}var vE=ln.formatErrorMessage;ln.formatErrorMessage=t=>{var e,i;if(t instanceof g.MediaError){let a=Sm(t,!1);return`
|
|
3234
3235
|
${a!=null&&a.title?`<h3>${a.title}</h3>`:""}
|
|
3235
3236
|
${a!=null&&a.message||a!=null&&a.linkUrl?`<p>
|
|
3236
3237
|
${a==null?void 0:a.message}
|
|
@@ -3242,5 +3243,5 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3242
3243
|
>${(i=a.linkText)!=null?i:a.linkUrl}</a
|
|
3243
3244
|
>`:""}
|
|
3244
3245
|
</p>`:""}
|
|
3245
|
-
`}return vE(t)};function EE(t){var i,a;let e=t.theme;if(e){let r=(a=(i=t.getRootNode())==null?void 0:i.getElementById)==null?void 0:a.call(i,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let o=ke.customElements.get(e);if(o!=null&&o.template)return o.template}}function bE(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 rh(t){let e=t.videoTitle?{video_title:t.videoTitle}:{};return t.getAttributeNames().filter(i=>i.startsWith("metadata-")).reduce((i,a)=>{let r=t.getAttribute(a);return r!==null&&(i[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),i},e)}var gE=Object.values(g.Attributes),_E=Object.values(yt),AE=Object.values(c),Fd=Pn(),Vd="mux-player",oh={isDialogOpen:!1},TE={redundant_streams:!0},ao,ro,oo,Kt,no,Si,W,Ft,nh,Gd,ki,sh,lh,dh,uh,Kd=class extends Wl{constructor(){super();pe(this,W);pe(this,ao);pe(this,ro,!1);pe(this,oo,{});pe(this,Kt,!0);pe(this,no,new Nn(this,"hotkeys"));pe(this,Si,{...oh,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&X(this,W,Gd).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var o;if(((o=i.composedPath()[0])==null?void 0:o.localName)!=="media-error-dialog")return;Hl(this,Gt.activeElement)||i.preventDefault()}});ye(this,ao,(0,D.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),X(this,W,nh).call(this),this.isConnected&&X(this,W,Ft).call(this)}static get NAME(){return Vd}static get VERSION(){return Fd}static get observedAttributes(){var i;return[...(i=Wl.observedAttributes)!=null?i:[],..._E,...gE,...AE]}get mediaTheme(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("media-theme")}get mediaController(){var i,a;return(a=(i=this.mediaTheme)==null?void 0:i.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){let i=this.media;i&&(i.metadata=rh(this))}attributeChangedCallback(i,a,r){switch(X(this,W,Ft).call(this),super.attributeChangedCallback(i,a,r),i){case c.HOTKEYS:B(this,no).value=r;break;case c.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&at((0,D.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case c.THUMBNAIL_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.THUMBNAIL;d!==u&&at((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case c.STORYBOARD_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.STORYBOARD;d!==u&&at((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case c.DRM_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.DRM;d!==u&&at((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&ge((0,D.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:{r&&![D.StreamTypes.LIVE,D.StreamTypes.ON_DEMAND,D.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Bl({file:"invalid-stream-type.md",message:(0,D.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===D.StreamTypes.LIVE?this.getAttribute(c.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case c.FULLSCREEN_ELEMENT:{if(r!=null||r!==a){let s=Gt.getElementById(r),d=s==null?void 0:s.querySelector("mux-player");this.mediaController&&s&&d&&(this.mediaController.fullscreenElement=s)}break}}[g.Attributes.PLAYBACK_ID,yt.SRC,c.PLAYBACK_TOKEN].includes(i)&&a!==r&&ye(this,Si,{...B(this,Si),...oh}),X(this,W,ki).call(this,{[im(i)]:r})}async requestFullscreen(i){var a;if(!(!this.mediaController||this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(a=this.mediaController)==null||a.dispatchEvent(new ke.CustomEvent(m.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,o)=>{var s;(s=this.mediaController)==null||s.addEventListener(Le.MEDIA_IS_FULLSCREEN,()=>r(),{once:!0})})}async exitFullscreen(){var i;if(!(!this.mediaController||!this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(i=this.mediaController)==null||i.dispatchEvent(new ke.CustomEvent(m.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((a,r)=>{var o;(o=this.mediaController)==null||o.addEventListener(Le.MEDIA_IS_FULLSCREEN,()=>a(),{once:!0})})}get preferCmcd(){var i;return(i=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?D.CmcdTypeValues.includes(i)?this.setAttribute(g.Attributes.PREFER_CMCD,i):at(`Invalid value for preferCmcd. Must be one of ${D.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var i,a;return(a=(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var i;return(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_TIME_IS_LIVE)}get _hls(){var i;return(i=this.media)==null?void 0:i._hls}get mux(){var i;return(i=this.media)==null?void 0:i.mux}get theme(){var i;return(i=this.getAttribute(c.THEME))!=null?i:pE}set theme(i){this.setAttribute(c.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(Wd.includes(r))continue;let o=i.getAttribute(r);a[On(r)]=o===""?!0:o}return a}set themeProps(i){var r,o;X(this,W,Ft).call(this);let a={...this.themeProps,...i};for(let s in a){if(Wd.includes(s))continue;let d=i==null?void 0:i[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(Dn(s),!!d):(o=this.mediaTheme)==null||o.setAttribute(Dn(s),d)}}get playbackId(){var i;return(i=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(g.Attributes.PLAYBACK_ID,i):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Vt(this,yt.SRC))!=null?i:void 0:(a=this.getAttribute(yt.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(yt.SRC,i):this.removeAttribute(yt.SRC)}get poster(){var r;let i=this.getAttribute(yt.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){at("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return em(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(i){i||i===""?this.setAttribute(yt.POSTER,i):this.removeAttribute(yt.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(c.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(c.STORYBOARD_SRC,i):this.removeAttribute(c.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[D.StreamTypes.LIVE,D.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return tm(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(c.AUDIO)}set audio(i){if(!i){this.removeAttribute(c.AUDIO);return}this.setAttribute(c.AUDIO,"")}get hotkeys(){return B(this,no)}get nohotkeys(){return this.hasAttribute(c.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(c.NOHOTKEYS);return}this.setAttribute(c.NOHOTKEYS,"")}get thumbnailTime(){return ce(this.getAttribute(c.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(c.THUMBNAIL_TIME,`${i}`)}get videoTitle(){var i,a;return(a=(i=this.getAttribute(c.VIDEO_TITLE))!=null?i:this.getAttribute(c.TITLE))!=null?a:""}set videoTitle(i){i!==this.videoTitle&&(i?this.setAttribute(c.VIDEO_TITLE,i):this.removeAttribute(c.VIDEO_TITLE))}get placeholder(){var i;return(i=Vt(this,c.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(c.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(c.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(c.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(c.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(c.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(c.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(c.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(c.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(c.PLAYBACK_RATES))return this.getAttribute(c.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(i=>Number(i)).filter(i=>!Number.isNaN(i)).sort((i,a)=>i-a)}set playbackRates(i){if(!i){this.removeAttribute(c.PLAYBACK_RATES);return}this.setAttribute(c.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=ce(this.getAttribute(c.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(c.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=ce(this.getAttribute(c.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(c.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(c.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return ce(this.getAttribute(c.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(c.DEFAULT_DURATION):this.setAttribute(c.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(g.Attributes.PLAYER_INIT_TIME)?ce(this.getAttribute(g.Attributes.PLAYER_INIT_TIME)):B(this,ao)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(g.Attributes.PLAYER_INIT_TIME):this.setAttribute(g.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:Vd}get playerSoftwareVersion(){var i;return(i=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:Fd}get beaconCollectionDomain(){var i;return(i=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(g.Attributes.MAX_RESOLUTION,i):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(g.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(g.Attributes.MIN_RESOLUTION,i):this.removeAttribute(g.Attributes.MIN_RESOLUTION))}get maxAutoResolution(){var i;return(i=this.getAttribute(g.Attributes.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(g.Attributes.MAX_AUTO_RESOLUTION):this.setAttribute(g.Attributes.MAX_AUTO_RESOLUTION,i)}get renditionOrder(){var i;return(i=this.getAttribute(g.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(g.Attributes.RENDITION_ORDER,i):this.removeAttribute(g.Attributes.RENDITION_ORDER))}get programStartTime(){return ce(this.getAttribute(g.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(g.Attributes.PROGRAM_START_TIME):this.setAttribute(g.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return ce(this.getAttribute(g.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(g.Attributes.PROGRAM_END_TIME):this.setAttribute(g.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return ce(this.getAttribute(g.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(g.Attributes.ASSET_START_TIME):this.setAttribute(g.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return ce(this.getAttribute(g.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(g.Attributes.ASSET_END_TIME):this.setAttribute(g.Attributes.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(c.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(c.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):TE}set extraSourceParams(i){i==null?this.removeAttribute(c.EXTRA_SOURCE_PARAMS):this.setAttribute(c.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Vt(this,g.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(g.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(c.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(c.NO_VOLUME_PREF,""):this.removeAttribute(c.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(c.NO_MUTED_PREF)}set noMutedPref(i){i?this.setAttribute(c.NO_MUTED_PREF,""):this.removeAttribute(c.NO_MUTED_PREF)}get debug(){return Vt(this,g.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableTracking(){return Vt(this,g.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(g.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Vt(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:D.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(g.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?r:D.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(c.DEFAULT_STREAM_TYPE,i):this.removeAttribute(c.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(c.TARGET_LIVE_WINDOW)?+this.getAttribute(c.TARGET_LIVE_WINDOW):(a=(i=this.media)==null?void 0:i.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(i){i==this.targetLiveWindow||Number.isNaN(i)&&Number.isNaN(this.targetLiveWindow)||(i==null?this.removeAttribute(c.TARGET_LIVE_WINDOW):this.setAttribute(c.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return ce(Vt(this,g.Attributes.START_TIME))}set startTime(i){this.setAttribute(g.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(i===D.PlaybackTypes.MSE||i===D.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===D.PlaybackTypes.MSE||i===D.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...rh(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=i}async addCuePoints(i){var a;if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(i)}get activeCuePoint(){var i;return(i=this.media)==null?void 0:i.activeCuePoint}get cuePoints(){var i,a;return(a=(i=this.media)==null?void 0:i.cuePoints)!=null?a:[]}addChapters(i){var a;if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(i)}get activeChapter(){var i;return(i=this.media)==null?void 0:i.activeChapter}get chapters(){var i,a;return(a=(i=this.media)==null?void 0:i.chapters)!=null?a:[]}getStartDate(){var i;return(i=this.media)==null?void 0:i.getStartDate()}get currentPdt(){var i;return(i=this.media)==null?void 0:i.currentPdt}get tokens(){let i=this.getAttribute(c.PLAYBACK_TOKEN),a=this.getAttribute(c.DRM_TOKEN),r=this.getAttribute(c.THUMBNAIL_TOKEN),o=this.getAttribute(c.STORYBOARD_TOKEN);return{...B(this,oo),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(i){ye(this,oo,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(c.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(c.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(c.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(c.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(c.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(c.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(c.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(c.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,o){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,D.addTextTrack)(s,i,a,r,o)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,D.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(c.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(c.CAST_RECEIVER,i):this.removeAttribute(c.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){ge("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(c.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(c.NO_TOOLTIPS);return}this.setAttribute(c.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(c.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}};ao=new WeakMap,ro=new WeakMap,oo=new WeakMap,Kt=new WeakMap,no=new WeakMap,Si=new WeakMap,W=new WeakSet,Ft=function(){var i,a,r,o;if(!B(this,ro)){ye(this,ro,!0),X(this,W,ki).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof ke.HTMLElement))throw""}catch{ge("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{ge("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof js))throw""}catch{ge("<media-controller> failed to upgrade!")}X(this,W,sh).call(this),X(this,W,lh).call(this),X(this,W,dh).call(this),ye(this,Kt,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(y.USER_INACTIVE))!=null?a:!0),X(this,W,uh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>X(this,W,ki).call(this)),(o=this.media)==null||o.addEventListener("loadstart",()=>X(this,W,ki).call(this))}},nh=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{}},Gd=function(i){Object.assign(B(this,Si),i),X(this,W,ki).call(this)},ki=function(i={}){Tm(ym(fE(this,{...B(this,Si),...i})),this.shadowRoot)},sh=function(){let i=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let o=r.replace(/^theme-/,"");if(Wd.includes(o))return;let s=this.getAttribute(r);s!=null?(d=this.mediaTheme)==null||d.setAttribute(o,s):(u=this.mediaTheme)==null||u.removeAttribute(o)};new MutationObserver(r=>{for(let{attributeName:o}of r)i(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},lh=function(){let i=a=>{var s;let r=(s=this.media)==null?void 0:s.error;if(!(r instanceof g.MediaError)){let{message:d,code:u}=r!=null?r:{};r=new g.MediaError(d,u)}if(!(r!=null&&r.fatal)){at(r),r.data&&at(`${r.name} data:`,r.data);return}let o=Jl(r,!1);o.message&&Bl(o),ge(r),r.data&&ge(`${r.name} data:`,r.data),X(this,W,Gd).call(this,{isDialogOpen:!0})};this.addEventListener("error",i),this.media&&(this.media.errorTranslator=(a={})=>{var o,s,d;if(!(((o=this.media)==null?void 0:o.error)instanceof g.MediaError))return a;let r=Jl((s=this.media)==null?void 0:s.error,!1);return{player_error_code:(d=this.media)==null?void 0:d.error.code,player_error_message:r.message?String(r.message):a.player_error_message,player_error_context:r.context?String(r.context):a.player_error_context}})},dh=function(){var a,r,o,s;let i=()=>X(this,W,ki).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",i),(s=(o=this.media)==null?void 0:o.textTracks)==null||s.addEventListener("removetrack",i)},uh=function(){var p,T;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===D.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(_,E,f=!1)=>{if(o())return;Array.from(_&&_.activeCues||[]).forEach(b=>{if(!(!b.snapToLines||b.line<-5||b.line>=0&&b.line<10))if(!E||this.paused){let C=b.text.split(`
|
|
3246
|
-
`).length,L=-3;this.streamType===D.StreamTypes.LIVE&&(L=-2);let ie=L-C;if(b.line===ie&&!f)return;r.has(b)||r.set(b,b.line),b.line=ie}else setTimeout(()=>{b.line=r.get(b)||"auto"},500)})},d=()=>{var _,E;s(a,(E=(_=this.mediaController)==null?void 0:_.hasAttribute(y.USER_INACTIVE))!=null?E:!1)},u=()=>{var f,M;let E=Array.from(((M=(f=this.mediaController)==null?void 0:f.media)==null?void 0:M.textTracks)||[]).filter(b=>["subtitles","captions"].includes(b.kind)&&b.mode==="showing")[0];E!==a&&(a==null||a.removeEventListener("cuechange",d)),a=E,a==null||a.addEventListener("cuechange",d),s(a,B(this,Kt))};u(),(p=this.textTracks)==null||p.addEventListener("change",u),(T=this.textTracks)==null||T.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var E,f;let _=(f=(E=this.mediaController)==null?void 0:E.hasAttribute(y.USER_INACTIVE))!=null?f:!0;B(this,Kt)!==_&&(ye(this,Kt,_),s(a,B(this,Kt)))})};function Vt(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var yE=
|
|
3246
|
+
`}return vE(t)};function EE(t){var i,a;let e=t.theme;if(e){let r=(a=(i=t.getRootNode())==null?void 0:i.getElementById)==null?void 0:a.call(i,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let o=ke.customElements.get(e);if(o!=null&&o.template)return o.template}}function bE(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 rh(t){let e=t.videoTitle?{video_title:t.videoTitle}:{};return t.getAttributeNames().filter(i=>i.startsWith("metadata-")).reduce((i,a)=>{let r=t.getAttribute(a);return r!==null&&(i[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),i},e)}var gE=Object.values(g.Attributes),_E=Object.values(yt),AE=Object.values(c),Vd=Un(),Kd="mux-player",oh={isDialogOpen:!1},TE={redundant_streams:!0},ro,oo,no,Kt,so,Si,W,Ft,nh,Yd,ki,sh,lh,dh,uh,Gd=class extends Fl{constructor(){super();fe(this,W);fe(this,ro);fe(this,oo,!1);fe(this,no,{});fe(this,Kt,!0);fe(this,so,new Nn(this,"hotkeys"));fe(this,Si,{...oh,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&X(this,W,Yd).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var o;if(((o=i.composedPath()[0])==null?void 0:o.localName)!=="media-error-dialog")return;Bl(this,Gt.activeElement)||i.preventDefault()}});ye(this,ro,(0,D.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),X(this,W,nh).call(this),this.isConnected&&X(this,W,Ft).call(this)}static get NAME(){return Kd}static get VERSION(){return Vd}static get observedAttributes(){var i;return[...(i=Fl.observedAttributes)!=null?i:[],..._E,...gE,...AE]}get mediaTheme(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("media-theme")}get mediaController(){var i,a;return(a=(i=this.mediaTheme)==null?void 0:i.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){let i=this.media;i&&(i.metadata=rh(this))}attributeChangedCallback(i,a,r){switch(X(this,W,Ft).call(this),super.attributeChangedCallback(i,a,r),i){case c.HOTKEYS:B(this,so).value=r;break;case c.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&at((0,D.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case c.THUMBNAIL_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.THUMBNAIL;d!==u&&at((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case c.STORYBOARD_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.STORYBOARD;d!==u&&at((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case c.DRM_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.DRM;d!==u&&at((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&he((0,D.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:{r&&![D.StreamTypes.LIVE,D.StreamTypes.ON_DEMAND,D.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:$l({file:"invalid-stream-type.md",message:(0,D.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===D.StreamTypes.LIVE?this.getAttribute(c.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case c.FULLSCREEN_ELEMENT:{if(r!=null||r!==a){let s=Gt.getElementById(r),d=s==null?void 0:s.querySelector("mux-player");this.mediaController&&s&&d&&(this.mediaController.fullscreenElement=s)}break}case g.Attributes.CAP_RENDITION_TO_PLAYER_SIZE:{(r==null||r!==a)&&(this.capRenditionToPlayerSize=r!=null?!0:void 0);break}}[g.Attributes.PLAYBACK_ID,yt.SRC,c.PLAYBACK_TOKEN].includes(i)&&a!==r&&ye(this,Si,{...B(this,Si),...oh}),X(this,W,ki).call(this,{[im(i)]:r})}async requestFullscreen(i){var a;if(!(!this.mediaController||this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(a=this.mediaController)==null||a.dispatchEvent(new ke.CustomEvent(m.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,o)=>{var s;(s=this.mediaController)==null||s.addEventListener(Le.MEDIA_IS_FULLSCREEN,()=>r(),{once:!0})})}async exitFullscreen(){var i;if(!(!this.mediaController||!this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(i=this.mediaController)==null||i.dispatchEvent(new ke.CustomEvent(m.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((a,r)=>{var o;(o=this.mediaController)==null||o.addEventListener(Le.MEDIA_IS_FULLSCREEN,()=>a(),{once:!0})})}get preferCmcd(){var i;return(i=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?D.CmcdTypeValues.includes(i)?this.setAttribute(g.Attributes.PREFER_CMCD,i):at(`Invalid value for preferCmcd. Must be one of ${D.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var i,a;return(a=(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var i;return(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_TIME_IS_LIVE)}get _hls(){var i;return(i=this.media)==null?void 0:i._hls}get mux(){var i;return(i=this.media)==null?void 0:i.mux}get theme(){var i;return(i=this.getAttribute(c.THEME))!=null?i:pE}set theme(i){this.setAttribute(c.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(Fd.includes(r))continue;let o=i.getAttribute(r);a[Pn(r)]=o===""?!0:o}return a}set themeProps(i){var r,o;X(this,W,Ft).call(this);let a={...this.themeProps,...i};for(let s in a){if(Fd.includes(s))continue;let d=i==null?void 0:i[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(On(s),!!d):(o=this.mediaTheme)==null||o.setAttribute(On(s),d)}}get playbackId(){var i;return(i=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(g.Attributes.PLAYBACK_ID,i):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Vt(this,yt.SRC))!=null?i:void 0:(a=this.getAttribute(yt.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(yt.SRC,i):this.removeAttribute(yt.SRC)}get poster(){var r;let i=this.getAttribute(yt.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){at("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return em(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(i){i||i===""?this.setAttribute(yt.POSTER,i):this.removeAttribute(yt.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(c.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(c.STORYBOARD_SRC,i):this.removeAttribute(c.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[D.StreamTypes.LIVE,D.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return tm(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(c.AUDIO)}set audio(i){if(!i){this.removeAttribute(c.AUDIO);return}this.setAttribute(c.AUDIO,"")}get hotkeys(){return B(this,so)}get nohotkeys(){return this.hasAttribute(c.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(c.NOHOTKEYS);return}this.setAttribute(c.NOHOTKEYS,"")}get thumbnailTime(){return ce(this.getAttribute(c.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(c.THUMBNAIL_TIME,`${i}`)}get videoTitle(){var i,a;return(a=(i=this.getAttribute(c.VIDEO_TITLE))!=null?i:this.getAttribute(c.TITLE))!=null?a:""}set videoTitle(i){i!==this.videoTitle&&(i?this.setAttribute(c.VIDEO_TITLE,i):this.removeAttribute(c.VIDEO_TITLE))}get placeholder(){var i;return(i=Vt(this,c.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(c.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(c.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(c.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(c.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(c.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(c.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(c.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(c.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(c.PLAYBACK_RATES))return this.getAttribute(c.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(i=>Number(i)).filter(i=>!Number.isNaN(i)).sort((i,a)=>i-a)}set playbackRates(i){if(!i){this.removeAttribute(c.PLAYBACK_RATES);return}this.setAttribute(c.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=ce(this.getAttribute(c.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(c.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=ce(this.getAttribute(c.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(c.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(c.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return ce(this.getAttribute(c.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(c.DEFAULT_DURATION):this.setAttribute(c.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(g.Attributes.PLAYER_INIT_TIME)?ce(this.getAttribute(g.Attributes.PLAYER_INIT_TIME)):B(this,ro)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(g.Attributes.PLAYER_INIT_TIME):this.setAttribute(g.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:Kd}get playerSoftwareVersion(){var i;return(i=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:Vd}get beaconCollectionDomain(){var i;return(i=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(g.Attributes.MAX_RESOLUTION,i):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(g.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(g.Attributes.MIN_RESOLUTION,i):this.removeAttribute(g.Attributes.MIN_RESOLUTION))}get maxAutoResolution(){var i;return(i=this.getAttribute(g.Attributes.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(g.Attributes.MAX_AUTO_RESOLUTION):this.setAttribute(g.Attributes.MAX_AUTO_RESOLUTION,i)}get renditionOrder(){var i;return(i=this.getAttribute(g.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(g.Attributes.RENDITION_ORDER,i):this.removeAttribute(g.Attributes.RENDITION_ORDER))}get programStartTime(){return ce(this.getAttribute(g.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(g.Attributes.PROGRAM_START_TIME):this.setAttribute(g.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return ce(this.getAttribute(g.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(g.Attributes.PROGRAM_END_TIME):this.setAttribute(g.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return ce(this.getAttribute(g.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(g.Attributes.ASSET_START_TIME):this.setAttribute(g.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return ce(this.getAttribute(g.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(g.Attributes.ASSET_END_TIME):this.setAttribute(g.Attributes.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(c.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(c.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):TE}set extraSourceParams(i){i==null?this.removeAttribute(c.EXTRA_SOURCE_PARAMS):this.setAttribute(c.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Vt(this,g.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(g.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(c.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(c.NO_VOLUME_PREF,""):this.removeAttribute(c.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(c.NO_MUTED_PREF)}set noMutedPref(i){i?this.setAttribute(c.NO_MUTED_PREF,""):this.removeAttribute(c.NO_MUTED_PREF)}get debug(){return Vt(this,g.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableTracking(){return Vt(this,g.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(g.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Vt(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:D.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(g.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?r:D.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(c.DEFAULT_STREAM_TYPE,i):this.removeAttribute(c.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(c.TARGET_LIVE_WINDOW)?+this.getAttribute(c.TARGET_LIVE_WINDOW):(a=(i=this.media)==null?void 0:i.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(i){i==this.targetLiveWindow||Number.isNaN(i)&&Number.isNaN(this.targetLiveWindow)||(i==null?this.removeAttribute(c.TARGET_LIVE_WINDOW):this.setAttribute(c.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return ce(Vt(this,g.Attributes.START_TIME))}set startTime(i){this.setAttribute(g.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(i===D.PlaybackTypes.MSE||i===D.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===D.PlaybackTypes.MSE||i===D.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(X(this,W,Ft).call(this),!this.media){he("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...rh(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(X(this,W,Ft).call(this),!this.media){he("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=i}async addCuePoints(i){var a;if(X(this,W,Ft).call(this),!this.media){he("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(i)}get activeCuePoint(){var i;return(i=this.media)==null?void 0:i.activeCuePoint}get cuePoints(){var i,a;return(a=(i=this.media)==null?void 0:i.cuePoints)!=null?a:[]}addChapters(i){var a;if(X(this,W,Ft).call(this),!this.media){he("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(i)}get activeChapter(){var i;return(i=this.media)==null?void 0:i.activeChapter}get chapters(){var i,a;return(a=(i=this.media)==null?void 0:i.chapters)!=null?a:[]}getStartDate(){var i;return(i=this.media)==null?void 0:i.getStartDate()}get currentPdt(){var i;return(i=this.media)==null?void 0:i.currentPdt}get tokens(){let i=this.getAttribute(c.PLAYBACK_TOKEN),a=this.getAttribute(c.DRM_TOKEN),r=this.getAttribute(c.THUMBNAIL_TOKEN),o=this.getAttribute(c.STORYBOARD_TOKEN);return{...B(this,no),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(i){ye(this,no,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(c.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(c.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(c.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(c.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(c.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(c.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(c.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(c.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,o){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,D.addTextTrack)(s,i,a,r,o)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,D.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(c.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(c.CAST_RECEIVER,i):this.removeAttribute(c.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){he("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(c.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(c.NO_TOOLTIPS);return}this.setAttribute(c.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(c.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}get capRenditionToPlayerSize(){var i;return(i=this.media)==null?void 0:i.capRenditionToPlayerSize}set capRenditionToPlayerSize(i){if(!this.media){he("underlying media element missing when trying to set capRenditionToPlayerSize");return}this.media.capRenditionToPlayerSize=i}};ro=new WeakMap,oo=new WeakMap,no=new WeakMap,Kt=new WeakMap,so=new WeakMap,Si=new WeakMap,W=new WeakSet,Ft=function(){var i,a,r,o;if(!B(this,oo)){ye(this,oo,!0),X(this,W,ki).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof ke.HTMLElement))throw""}catch{he("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{he("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof el))throw""}catch{he("<media-controller> failed to upgrade!")}X(this,W,sh).call(this),X(this,W,lh).call(this),X(this,W,dh).call(this),ye(this,Kt,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(y.USER_INACTIVE))!=null?a:!0),X(this,W,uh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>X(this,W,ki).call(this)),(o=this.media)==null||o.addEventListener("loadstart",()=>X(this,W,ki).call(this))}},nh=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{}},Yd=function(i){Object.assign(B(this,Si),i),X(this,W,ki).call(this)},ki=function(i={}){Tm(ym(fE(this,{...B(this,Si),...i})),this.shadowRoot)},sh=function(){let i=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let o=r.replace(/^theme-/,"");if(Fd.includes(o))return;let s=this.getAttribute(r);s!=null?(d=this.mediaTheme)==null||d.setAttribute(o,s):(u=this.mediaTheme)==null||u.removeAttribute(o)};new MutationObserver(r=>{for(let{attributeName:o}of r)i(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},lh=function(){let i=a=>{var s;let r=(s=this.media)==null?void 0:s.error;if(!(r instanceof g.MediaError)){let{message:d,code:u}=r!=null?r:{};r=new g.MediaError(d,u)}if(!(r!=null&&r.fatal)){at(r),r.data&&at(`${r.name} data:`,r.data);return}let o=jl(r,!1);o.message&&$l(o),he(r),r.data&&he(`${r.name} data:`,r.data),X(this,W,Yd).call(this,{isDialogOpen:!0})};this.addEventListener("error",i),this.media&&(this.media.errorTranslator=(a={})=>{var o,s,d;if(!(((o=this.media)==null?void 0:o.error)instanceof g.MediaError))return a;let r=jl((s=this.media)==null?void 0:s.error,!1);return{player_error_code:(d=this.media)==null?void 0:d.error.code,player_error_message:r.message?String(r.message):a.player_error_message,player_error_context:r.context?String(r.context):a.player_error_context}})},dh=function(){var a,r,o,s;let i=()=>X(this,W,ki).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",i),(s=(o=this.media)==null?void 0:o.textTracks)==null||s.addEventListener("removetrack",i)},uh=function(){var p,T;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===D.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(_,E,f=!1)=>{if(o())return;Array.from(_&&_.activeCues||[]).forEach(b=>{if(!(!b.snapToLines||b.line<-5||b.line>=0&&b.line<10))if(!E||this.paused){let C=b.text.split(`
|
|
3247
|
+
`).length,L=-3;this.streamType===D.StreamTypes.LIVE&&(L=-2);let ie=L-C;if(b.line===ie&&!f)return;r.has(b)||r.set(b,b.line),b.line=ie}else setTimeout(()=>{b.line=r.get(b)||"auto"},500)})},d=()=>{var _,E;s(a,(E=(_=this.mediaController)==null?void 0:_.hasAttribute(y.USER_INACTIVE))!=null?E:!1)},u=()=>{var f,M;let E=Array.from(((M=(f=this.mediaController)==null?void 0:f.media)==null?void 0:M.textTracks)||[]).filter(b=>["subtitles","captions"].includes(b.kind)&&b.mode==="showing")[0];E!==a&&(a==null||a.removeEventListener("cuechange",d)),a=E,a==null||a.addEventListener("cuechange",d),s(a,B(this,Kt))};u(),(p=this.textTracks)==null||p.addEventListener("change",u),(T=this.textTracks)==null||T.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var E,f;let _=(f=(E=this.mediaController)==null?void 0:E.hasAttribute(y.USER_INACTIVE))!=null?f:!0;B(this,Kt)!==_&&(ye(this,Kt,_),s(a,B(this,Kt)))})};function Vt(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var yE=Gd;
|