@mux/mux-player 3.11.5 → 3.11.6
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 +207 -198
- package/dist/base.mjs +49 -49
- package/dist/mux-player.js +242 -233
- package/dist/mux-player.mjs +242 -233
- package/dist/themes/classic/index.cjs.js +66 -47
- package/dist/themes/classic/index.js +66 -47
- package/dist/themes/classic/index.mjs +66 -47
- package/dist/themes/gerwig/index.cjs.js +66 -47
- package/dist/themes/gerwig/index.js +66 -47
- package/dist/themes/gerwig/index.mjs +66 -47
- package/dist/themes/news/index.cjs.js +66 -47
- package/dist/themes/news/index.js +66 -47
- package/dist/themes/news/index.mjs +66 -47
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/base.d.ts +1 -0
- package/dist/types-ts3.4/base.d.ts +1 -0
- package/package.json +4 -4
package/dist/base.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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`
|
|
1
|
+
"use strict";var zs=Object.defineProperty;var Hh=Object.getOwnPropertyDescriptor;var Bh=Object.getOwnPropertyNames;var $h=Object.prototype.hasOwnProperty;var Lu=t=>{throw TypeError(t)};var Wh=(t,e)=>{for(var i in e)zs(t,i,{get:e[i],enumerable:!0})},Fh=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Bh(e))!$h.call(t,r)&&r!==i&&zs(t,r,{get:()=>e[r],enumerable:!(a=Hh(e,r))||a.enumerable});return t};var Vh=t=>Fh(zs({},"__esModule",{value:!0}),t);var Qs=(t,e,i)=>e.has(t)||Lu("Cannot "+i);var R=(t,e,i)=>(Qs(t,e,"read from private field"),i?i.call(t):e.get(t)),ae=(t,e,i)=>e.has(t)?Lu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),de=(t,e,i,a)=>(Qs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),J=(t,e,i)=>(Qs(t,e,"access private method"),i);var GE={};Wh(GE,{MediaError:()=>b.MediaError,default:()=>KE,generatePlayerInitTime:()=>O.generatePlayerInitTime,getVideoAttribute:()=>ii,playerSoftwareName:()=>cu,playerSoftwareVersion:()=>uu});module.exports=Vh(GE);var Ui=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Ui{}globalThis.DocumentFragment=t}var er=class extends Ui{},Xs=class extends Ui{},Kh={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(er)}},tr,Js=class{constructor(e,i={}){ae(this,tr);de(this,tr,i==null?void 0:i.detail)}get detail(){return R(this,tr)}initCustomEvent(){}};tr=new WeakMap;function Gh(t,e){return new er}var Cu={document:{createElement:Gh},DocumentFragment,customElements:Kh,CustomEvent:Js,EventTarget:Ui,HTMLElement:er,HTMLVideoElement:Xs},wu=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Se=wu?Cu:globalThis,ri=wu?Cu.document:globalThis.document;var h={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"},D={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},js={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"},Ru=Object.entries(js),n=Ru.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Yh={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Ie=Ru.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Yh}),QE=Object.entries(Ie).reduce((t,[e,i])=>{let a=n[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),xu=Object.entries(n).reduce((t,[e,i])=>{let a=Ie[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),_e={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Nt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var So={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Ae={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Be={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Du={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Ou(t){return t==null?void 0:t.map(Zh).join(" ")}function Pu(t){return t==null?void 0:t.split(/\s+/).map(zh)}function Zh(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function zh(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function Nu(t){return t==null?void 0:t.map(Qh).join(" ")}function Uu(t){return t==null?void 0:t.split(/\s+/).map(Xh)}function Qh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(o=>o!=null).join(":")}}function Xh(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function Hu(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function Hi(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function Io(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var Mo=t=>new Promise(e=>setTimeout(e,t));var Bu={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it.",hour:"hour",hours:"hours",minute:"minute",minutes:"minutes",second:"second",seconds:"seconds","{time} remaining":"{time} remaining","{currentTime} of {totalTime}":"{currentTime} of {totalTime}","video not loaded, unknown time.":"video not loaded, unknown time."};var $u,el={en:Bu},tl=(($u=globalThis.navigator)==null?void 0:$u.language)||"en",Wu=t=>{tl=t};var Jh=t=>{var e,i,a;let[r]=tl.split("-");return((e=el[tl])==null?void 0:e[t])||((i=el[r])==null?void 0:i[t])||((a=el.en)==null?void 0:a[t])||t},c=(t,e={})=>Jh(t).replace(/\{(\w+)\}/g,(i,a)=>a in e?String(e[a]):`{${a}}`);var Fu=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],jh=(t,e)=>{let i=t===1?c(Fu[e].singular):c(Fu[e].plural);return`${t} ${i}`},oi=t=>{if(!Hi(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0),o=[a.getHours(),a.getMinutes(),a.getSeconds()].map((s,d)=>s&&jh(s,d)).filter(s=>s).join(", ");return i?c("{time} remaining",{time:o}):o};function $e(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 ab=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 Lo=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Co=class extends Lo{},wo=class extends Co{constructor(){super(...arguments),this.role=null}},il=class{observe(){}unobserve(){}disconnect(){}},Vu={createElement:function(){return new ir.HTMLElement},createElementNS:function(){return new ir.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},ir={ResizeObserver:il,document:Vu,Node:Co,Element:wo,HTMLElement:class extends wo{constructor(){super(...arguments),this.innerHTML=""}get content(){return new ir.DocumentFragment}},DocumentFragment:class extends Lo{},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}}}}},Ku="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window=="undefined"||typeof window.customElements=="undefined",Gu=Object.keys(ir).every(t=>t in globalThis),l=Ku&&!Gu?ir:globalThis,V=Ku&&!Gu?Vu:globalThis.document;var Yu=new WeakMap,al=t=>{let e=Yu.get(t);return e||Yu.set(t,e=new Set),e},qu=new l.ResizeObserver(t=>{for(let e of t)for(let i of al(e.target))i(e)});function _t(t,e){al(t).add(e),qu.observe(t)}function At(t,e){let i=al(t);i.delete(e),i.size||qu.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=Ro(t))!=null?e:Xe(t,"media-controller")}function Ro(t){var e;let{MEDIA_CONTROLLER:i}=D,a=t.getAttribute(i);if(a)return(e=ni(t))==null?void 0:e.getElementById(a)}var xo=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},tp=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},Do=(t,e)=>tp(t,e)[0],he=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:he(t,e.getRootNode().host),Xe=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Xe(t.getRootNode().host,e)};function ar(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=ar(i.shadowRoot))!=null?e:i:null}function ni(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 Oo(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 Zu(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=ip(t,a=>a===e);return i||rr(t,e)}function ip(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 rr(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],o=r==null?void 0:r[r.length-1];if(!(o!=null&&o.sheet))return console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}};let s=o==null?void 0:o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length);return(a=o.sheet.cssRules)==null?void 0:a[s]}function P(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function U(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}P(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function M(t,e){return t.hasAttribute(e)}function L(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}M(t,e)!=i&&t.toggleAttribute(e,i)}function x(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function w(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;x(t,e,void 0)!==a&&t.setAttribute(e,a)}var zu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},We=(t,e,i)=>(zu(t,e,"read from private field"),i?i.call(t):e.get(t)),ap=(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)},Po=(t,e,i,a)=>(zu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ue;function rp(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
|
|
8
|
+
`}var Bi=class extends l.HTMLElement{constructor(){if(super(),ap(this,ue,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[D.MEDIA_CONTROLLER,n.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===D.MEDIA_CONTROLLER&&(i&&((o=(r=We(this,ue))==null?void 0:r.unassociateElement)==null||o.call(r,this),Po(this,ue,null)),a&&this.isConnected&&(Po(this,ue,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=We(this,ue))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Po(this,ue,op(this)),this.getAttribute(D.MEDIA_CONTROLLER)&&((i=(e=We(this,ue))==null?void 0:e.associateElement)==null||i.call(e,this)),We(this,ue)&&(We(this,ue).addEventListener("pointerdown",this),We(this,ue).addEventListener("click",this),We(this,ue).hasAttribute("tabindex")||(We(this,ue).tabIndex=0))}disconnectedCallback(){var e,i,a,r;this.getAttribute(D.MEDIA_CONTROLLER)&&((i=(e=We(this,ue))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=We(this,ue))==null||a.removeEventListener("pointerdown",this),(r=We(this,ue))==null||r.removeEventListener("click",this),Po(this,ue,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:v,height:y}=this.getBoundingClientRect(),A=o-d,E=s-u;if(A<0||E<0||A>v||E>y||v===0&&y===0)return;let p=this._pointerType||"mouse";if(this._pointerType=void 0,p===So.TOUCH){this.handleTap(e);return}else if(p===So.MOUSE||p===So.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return M(this,n.MEDIA_PAUSED)}set mediaPaused(e){L(this,n.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let i=this.mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(i,{composed:!0,bubbles:!0}))}};ue=new WeakMap;Bi.shadowRootOptions={mode:"open"};Bi.getTemplateHTML=rp;function op(t){var e;let i=t.getAttribute(D.MEDIA_CONTROLLER);return i?(e=t.getRootNode())==null?void 0:e.getElementById(i):Xe(t,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Bi);var No=Bi;var sl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ee=(t,e,i)=>(sl(t,e,"read from private field"),i?i.call(t):e.get(t)),pe=(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)},Fe=(t,e,i,a)=>(sl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ve=(t,e,i)=>(sl(t,e,"access private method"),i),or,Bo,$i,Vi,Fi,rl,Wi,Uo,ol,Qu,nl,Xu,nr,$o,Wo,ll,Ki,sr,Ut,Ho,I={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function np(t){return`
|
|
9
9
|
<style>
|
|
10
10
|
|
|
11
11
|
:host([${n.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
overflow: hidden;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
:host(:not([${
|
|
24
|
+
:host(:not([${I.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
|
|
25
25
|
position: absolute;
|
|
26
26
|
top: 0;
|
|
27
27
|
left: 0;
|
|
@@ -39,19 +39,19 @@
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
:host([${
|
|
42
|
+
:host([${I.AUDIO}]) slot[name=media] {
|
|
43
43
|
display: var(--media-slot-display, none);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
:host([${
|
|
47
|
+
:host([${I.AUDIO}]) [part~=layer][part~=gesture-layer] {
|
|
48
48
|
height: 0;
|
|
49
49
|
display: block;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
:host(:not([${
|
|
54
|
-
:host(:not([${
|
|
53
|
+
:host(:not([${I.AUDIO}])[${I.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
|
|
54
|
+
:host(:not([${I.AUDIO}])[${I.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
|
|
55
55
|
display: none;
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
pointer-events: auto;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
:host(:not([${
|
|
63
|
+
:host(:not([${I.AUDIO}])) *[part~=layer][part~=centered-layer] {
|
|
64
64
|
align-items: center;
|
|
65
65
|
justify-content: center;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
:host(:not([${
|
|
69
|
-
:host(:not([${
|
|
68
|
+
:host(:not([${I.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
|
|
69
|
+
:host(:not([${I.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
|
|
70
70
|
align-self: stretch;
|
|
71
71
|
flex-grow: 1;
|
|
72
72
|
}
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
:host(:not([${
|
|
89
|
+
:host(:not([${I.AUDIO}])) .spacer {
|
|
90
90
|
flex-grow: 1;
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -98,22 +98,22 @@
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
|
|
101
|
-
::slotted(:not([slot=media]):not([slot=poster]):not([${
|
|
101
|
+
::slotted(:not([slot=media]):not([slot=poster]):not([${I.NO_AUTOHIDE}]):not([hidden]):not([role=dialog])) {
|
|
102
102
|
opacity: 1;
|
|
103
103
|
transition: var(--media-control-transition-in, opacity 0.25s);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
:host([${
|
|
107
|
+
:host([${I.USER_INACTIVE}]:not([${n.MEDIA_PAUSED}]):not([${n.MEDIA_IS_AIRPLAYING}]):not([${n.MEDIA_IS_CASTING}]):not([${I.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${I.NO_AUTOHIDE}]):not([role=dialog])) {
|
|
108
108
|
opacity: 0;
|
|
109
109
|
transition: var(--media-control-transition-out, opacity 1s);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
:host([${
|
|
112
|
+
:host([${I.USER_INACTIVE}]:not([${I.NO_AUTOHIDE}]):not([${n.MEDIA_PAUSED}]):not([${n.MEDIA_IS_CASTING}]):not([${I.AUDIO}])) ::slotted([slot=media]) {
|
|
113
113
|
cursor: none;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
:host([${
|
|
116
|
+
:host([${I.USER_INACTIVE}][${I.AUTOHIDE_OVER_CONTROLS}]:not([${I.NO_AUTOHIDE}]):not([${n.MEDIA_PAUSED}]):not([${n.MEDIA_IS_CASTING}]):not([${I.AUDIO}])) * {
|
|
117
117
|
--media-cursor: none;
|
|
118
118
|
cursor: none;
|
|
119
119
|
}
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
:host(:not([${
|
|
127
|
+
:host(:not([${I.AUDIO}])[${n.MEDIA_HAS_PLAYED}]) slot[name=poster] {
|
|
128
128
|
display: none;
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -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="${No.shadowRootOptions.mode}">
|
|
147
|
+
${No.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 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`
|
|
159
|
+
`}var sp=Object.values(n),lp="sm:384 md:576 lg:768 xl:960";function dp(t){Ju(t.target,t.contentRect.width)}function Ju(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(I.BREAKPOINTS))!=null?i:lp,r=up(a),o=cp(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(Ie.BREAKPOINTS_CHANGE,{detail:o});t.dispatchEvent(d)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(Ie.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function up(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function cp(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var si=class extends l.HTMLElement{constructor(){if(super(),pe(this,ol),pe(this,nl),pe(this,nr),pe(this,Wo),pe(this,Ki),pe(this,or,void 0),pe(this,Bo,0),pe(this,$i,null),pe(this,Vi,null),pe(this,Fi,void 0),this.breakpointsComputed=!1,pe(this,rl,e=>{let i=this.media;for(let a of e){if(a.type!=="childList")continue;let r=a.removedNodes;for(let o of r){if(o.slot!="media"||a.target!=this)continue;let s=a.previousSibling&&a.previousSibling.previousElementSibling;if(!s||!i)this.mediaUnsetCallback(o);else{let d=s.slot!=="media";for(;(s=s.previousSibling)!==null;)s.slot=="media"&&(d=!1);d&&this.mediaUnsetCallback(o)}}if(i)for(let o of a.addedNodes)o===i&&this.handleMediaUpdated(i)}}),pe(this,Wi,!1),pe(this,Uo,e=>{ee(this,Wi)||(setTimeout(()=>{dp(e),Fe(this,Wi,!1)},0),Fe(this,Wi,!0))}),pe(this,Ut,void 0),pe(this,Ho,()=>{if(!ee(this,Ut).assignedElements({flatten:!0}).length){ee(this,$i)&&this.mediaUnsetCallback(ee(this,$i));return}this.handleMediaUpdated(this.media)}),!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}Fe(this,or,new MutationObserver(ee(this,rl)))}static get observedAttributes(){return[I.AUTOHIDE,I.GESTURES_DISABLED].concat(sp).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()==I.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Fe(this,$i,e),e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;ee(this,or).observe(this,{childList:!0,subtree:!0}),_t(this,ee(this,Uo));let a=this.getAttribute(I.AUDIO)!=null?c("audio player"):c("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(I.USER_INACTIVE,""),Ju(this,this.getBoundingClientRect().width);let r=this.querySelector(":scope > slot[slot=media]");r&&(Fe(this,Ut,r),ee(this,Ut).addEventListener("slotchange",ee(this,Ho))),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;At(this,ee(this,Uo)),clearTimeout(ee(this,Vi)),ee(this,or).disconnect(),this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointermove",this),this.removeEventListener("pointerup",this),this.removeEventListener("mouseleave",this),this.removeEventListener("keyup",this),ee(this,Ut)&&(ee(this,Ut).removeEventListener("slotchange",ee(this,Ho)),Fe(this,Ut,null)),Fe(this,Wi,!1)}mediaSetCallback(e){}mediaUnsetCallback(e){Fe(this,$i,null)}handleEvent(e){switch(e.type){case"pointerdown":Fe(this,Bo,e.timeStamp);break;case"pointermove":Ve(this,ol,Qu).call(this,e);break;case"pointerup":Ve(this,nl,Xu).call(this,e);break;case"mouseleave":Ve(this,nr,$o).call(this);break;case"mouseup":this.removeAttribute(I.KEYBOARD_CONTROL);break;case"keyup":Ve(this,Ki,sr).call(this),this.setAttribute(I.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Fe(this,Fi,isNaN(i)?0:i)}get autohide(){return(ee(this,Fi)===void 0?2:ee(this,Fi)).toString()}get breakpoints(){return x(this,I.BREAKPOINTS)}set breakpoints(e){w(this,I.BREAKPOINTS,e)}get audio(){return M(this,I.AUDIO)}set audio(e){L(this,I.AUDIO,e)}get gesturesDisabled(){return M(this,I.GESTURES_DISABLED)}set gesturesDisabled(e){L(this,I.GESTURES_DISABLED,e)}get keyboardControl(){return M(this,I.KEYBOARD_CONTROL)}set keyboardControl(e){L(this,I.KEYBOARD_CONTROL,e)}get noAutohide(){return M(this,I.NO_AUTOHIDE)}set noAutohide(e){L(this,I.NO_AUTOHIDE,e)}get autohideOverControls(){return M(this,I.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){L(this,I.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return M(this,I.USER_INACTIVE)}set userInteractive(e){L(this,I.USER_INACTIVE,e)}};or=new WeakMap;Bo=new WeakMap;$i=new WeakMap;Vi=new WeakMap;Fi=new WeakMap;rl=new WeakMap;Wi=new WeakMap;Uo=new WeakMap;ol=new WeakSet;Qu=function(t){if(t.pointerType!=="mouse"&&t.timeStamp-ee(this,Bo)<250)return;Ve(this,Wo,ll).call(this),clearTimeout(ee(this,Vi));let e=this.hasAttribute(I.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(t.target)||e)&&Ve(this,Ki,sr).call(this)};nl=new WeakSet;Xu=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(I.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Ve(this,nr,$o).call(this):Ve(this,Ki,sr).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Ve(this,Ki,sr).call(this)};nr=new WeakSet;$o=function(){if(ee(this,Fi)<0||this.hasAttribute(I.USER_INACTIVE))return;this.setAttribute(I.USER_INACTIVE,"");let t=new l.CustomEvent(Ie.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};Wo=new WeakSet;ll=function(){if(!this.hasAttribute(I.USER_INACTIVE))return;this.removeAttribute(I.USER_INACTIVE);let t=new l.CustomEvent(Ie.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};Ki=new WeakSet;sr=function(){Ve(this,Wo,ll).call(this),clearTimeout(ee(this,Vi));let t=parseInt(this.autohide);t<0||Fe(this,Vi,setTimeout(()=>{Ve(this,nr,$o).call(this)},t*1e3))};Ut=new WeakMap;Ho=new WeakMap;si.shadowRootOptions={mode:"open"};si.getTemplateHTML=np;l.customElements.get("media-container")||l.customElements.define("media-container",si);var ju=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},se=(t,e,i)=>(ju(t,e,"read from private field"),i?i.call(t):e.get(t)),lr=(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)},Fo=(t,e,i,a)=>(ju(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Gi,Yi,Vo,li,Tt,Ht,Bt=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){lr(this,Tt),lr(this,Gi,void 0),lr(this,Yi,void 0),lr(this,Vo,void 0),lr(this,li,new Set),Fo(this,Gi,e),Fo(this,Yi,i),Fo(this,Vo,new Set(a))}[Symbol.iterator](){return se(this,Tt,Ht).values()}get length(){return se(this,Tt,Ht).size}get value(){var e;return(e=[...se(this,Tt,Ht)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Fo(this,li,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...se(this,Tt,Ht)][e]}values(){return se(this,Tt,Ht).values()}forEach(e,i){se(this,Tt,Ht).forEach(e,i)}add(...e){var i,a;e.forEach(r=>se(this,li).add(r)),!(this.value===""&&!((i=se(this,Gi))!=null&&i.hasAttribute(`${se(this,Yi)}`)))&&((a=se(this,Gi))==null||a.setAttribute(`${se(this,Yi)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>se(this,li).delete(a)),(i=se(this,Gi))==null||i.setAttribute(`${se(this,Yi)}`,`${this.value}`)}contains(e){return se(this,Tt,Ht).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}};Gi=new WeakMap;Yi=new WeakMap;Vo=new WeakMap;li=new WeakMap;Tt=new WeakSet;Ht=function(){return se(this,li).size?se(this,li):se(this,Vo)};var mp=(t="")=>t.split(/\s+/),ec=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?_e.CAPTIONS:_e.SUBTITLES,language:i,label:r}},di=(t="",e={})=>mp(t).map(i=>{let a=ec(i);return{...e,...a}}),dl=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?ec(e):e):typeof t=="string"?di(t):[t]:[],Ko=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,yt=(t=[])=>Array.prototype.map.call(t,Ko).join(" "),hp=(t,e)=>i=>i[t]===e,tc=t=>{let e=Object.entries(t).map(([i,a])=>hp(i,a));return i=>e.every(a=>a(i))},ui=(t,e=[],i=[])=>{let a=dl(i).map(tc),r=o=>a.some(s=>s(o));Array.from(e).filter(r).forEach(o=>{o.mode=t})},ci=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:tc(e);return Array.from(t.textTracks).filter(i)},Go=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(n.MEDIA_SUBTITLES_SHOWING)};var ac=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)}},ic="exitFullscreen"in V?"exitFullscreen":"webkitExitFullscreen"in V?"webkitExitFullscreen":"webkitCancelFullScreen"in V?"webkitCancelFullScreen":void 0,rc=t=>{var e;let{documentElement:i}=t;if(ic){let a=(e=i==null?void 0:i[ic])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},dr="fullscreenElement"in V?"fullscreenElement":"webkitFullscreenElement"in V?"webkitFullscreenElement":void 0,pp=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[dr];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===Du.FULLSCREEN?i:a},oc=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let o=pp(t);if(!o)return!1;if(o===r||o===i)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(dr in s))return he(o,r);for(;s!=null&&s[dr];){if(s[dr]===r)return!0;s=(e=s[dr])==null?void 0:e.shadowRoot}}return!1},fp="fullscreenEnabled"in V?"fullscreenEnabled":"webkitFullscreenEnabled"in V?"webkitFullscreenEnabled":void 0,nc=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[fp])||i&&"webkitSupportsFullscreen"in i};var Yo,ul=()=>{var t,e;return Yo||(Yo=(e=(t=V)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Yo)},sc=async(t=ul())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([vp(t,i.signal),Ep(t,e)]);return i.abort(),a},vp=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),Ep=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await Mo(10)}return t.volume!==e},bp=/.*Version\/.*Safari\/.*/.test(l.navigator.userAgent),cl=(t=ul())=>l.matchMedia("(display-mode: standalone)").matches&&bp?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",ml=(t=ul())=>nc({documentElement:V,media:t}),lc=ml(),dc=cl(),uc=!!l.WebKitPlaybackTargetAvailabilityEvent,cc=!!l.chrome;var qi=t=>ci(t.media,e=>[_e.SUBTITLES,_e.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),hl=t=>ci(t.media,e=>e.mode===Nt.SHOWING&&[_e.SUBTITLES,_e.CAPTIONS].includes(e.kind)),qo=(t,e)=>{let i=qi(t),a=hl(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)ui(Nt.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let o=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let y=l.localStorage.getItem("media-chrome-pref-subtitles-lang"),A=y?[y,...l.navigator.languages]:l.navigator.languages,E=i.filter(p=>A.some(k=>p.language.toLowerCase().startsWith(k.split("-")[0]))).sort((p,k)=>{let g=A.findIndex(C=>p.language.toLowerCase().startsWith(C.split("-")[0])),S=A.findIndex(C=>k.language.toLowerCase().startsWith(C.split("-")[0]));return g-S});E[0]&&(o=E[0])}let{language:d,label:u,kind:v}=o;ui(Nt.DISABLED,i,a),ui(Nt.SHOWING,i,[{language:d,label:u,kind:v}])}}},Zo=(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)?gp(t,e):Object.entries(t).every(([i,a])=>i in e&&Zo(a,e[i])),gp=(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)=>Zo(r,e[o])):!0};var _p=Object.values(Be),zo,Ap=sc().then(t=>(zo=t,zo)),mc=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof l.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=l.customElements.get(i);a&&e instanceof a||(await l.customElements.whenDefined(i),l.customElements.upgrade(e))}))},Tp=new l.DOMParser,yp=t=>t&&(Tp.parseFromString(t,"text/html").body.textContent||t),Zi={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";Zi.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;Zi.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||!Hi(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=[Be.LIVE,Be.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(_p.includes(r))return r===Be.UNKNOWN?a:r;let o=e.duration;return o===1/0?Be.LIVE:Number.isFinite(o)?Be.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=Zi.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===Be.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(!(Zi.mediaStreamType.get(t)===Be.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 qi(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return hl(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&&![_e.CAPTIONS,_e.SUBTITLES].includes((u=d==null?void 0:d.track)==null?void 0:u.kind)||qo(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]=ci(i,{kind:_e.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:o,endTime:s})=>({text:yp(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("-")?he(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 oc(t)},set(t,e,i){var a,r;t?(ac(e),i.detail&&!((a=e.media)!=null&&a.inert)&&((r=e.media)==null||r.focus())):rc(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(!lc||!ml(e))return Ae.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!dc||!cl(e))return Ae.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Ae.UNAVAILABLE}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(zo===!1||(e==null?void 0:e.volume)==null)return Ae.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{zo==null&&Ap.then(e=>t(e?void 0:Ae.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!cc||!((i=a==null?void 0:a.remote)!=null&&i.state))return Ae.UNSUPPORTED;if(!(e==null||e==="available"))return Ae.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(!uc)return Ae.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Ae.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 Ae.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return Ae.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return Ae.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return Ae.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(t){let{options:{mediaLang:e}={}}=t;return e!=null?e:"en"}}};var hc={[h.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,o;let{media:s}=e,d=i!=null?i:void 0,u,v;if(s&&d!=null){let[p]=ci(s,{kind:_e.METADATA,label:"thumbnails"}),k=Array.prototype.find.call((a=p==null?void 0:p.cues)!=null?a:[],(g,S,C)=>S===0?g.endTime>d:S===C.length-1?g.startTime<=d:g.startTime<=d&&g.endTime>d);if(k){let g=/'^(?:[a-z]+:)?\/\//i.test(k.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,S=new URL(k.text,g);v=new URLSearchParams(S.hash).get("#xywh").split(",").map(j=>+j),u=S.href}}let y=t.mediaDuration.get(e),E=(o=t.mediaChaptersCues.get(e).find((p,k,g)=>k===g.length-1&&y===p.endTime?p.startTime<=d&&p.endTime>=d:p.startTime<=d&&p.endTime>d))==null?void 0:o.text;return i!=null&&E==null&&(E=""),{mediaPreviewTime:d,mediaPreviewImage:u,mediaPreviewCoords:v,mediaPreviewChapter:E}},[h.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[h.MEDIA_PLAY_REQUEST](t,e){var i,a,r,o;let s="mediaPaused",u=t.mediaStreamType.get(e)===Be.LIVE,v=!((i=e.options)!=null&&i.noAutoSeekToLive),y=t.mediaTargetLiveWindow.get(e)>0;if(u&&v&&!y){let A=(a=t.mediaSeekable.get(e))==null?void 0:a[1];if(A){let E=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,p=A-E;t.mediaCurrentTime.set(p,e)}}t[s].set(!1,e)},[h.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[h.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[h.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[h.MEDIA_LOOP_REQUEST](t,e,{detail:i}){let a="mediaLoop",r=!!i;return t[a].set(r,e),{mediaLoop:r}},[h.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)},[h.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[h.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)},[h.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,o=qi(e),s=dl(i),d=(a=s[0])==null?void 0:a.language;d&&!r.noSubtitlesLangPref&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),ui(Nt.SHOWING,o,s)},[h.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=qi(e),r=i!=null?i:[];ui(Nt.DISABLED,a,r)},[h.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){qo(e,i)},[h.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[h.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[h.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[h.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[h.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)},[h.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[h.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[h.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[h.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var pc=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Zi,requestMap:r=hc,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let d=[],u={options:{...o}},v=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),y=g=>{g!=null&&(Zo(g,v)||(v=Object.freeze({...v,...g}),d.forEach(S=>S(v))))},A=()=>{let g=Object.entries(a).reduce((S,[C,{get:j}])=>(S[C]=j(u),S),{});y(g)},E={},p,k=async(g,S)=>{var C,j,Ue,Ot,bt,Ce,we,Pt,Qe,Wa,Fa,Va,Ka,Ga,Ya,qa;let yo=!!p;if(p={...u,...p!=null?p:{},...g},yo)return;await mc(...Object.values(g));let gt=d.length>0&&S===0&&s,Za=u.media!==p.media,za=((C=u.media)==null?void 0:C.textTracks)!==((j=p.media)==null?void 0:j.textTracks),Qa=((Ue=u.media)==null?void 0:Ue.videoRenditions)!==((Ot=p.media)==null?void 0:Ot.videoRenditions),Xa=((bt=u.media)==null?void 0:bt.audioTracks)!==((Ce=p.media)==null?void 0:Ce.audioTracks),Ja=((we=u.media)==null?void 0:we.remote)!==((Pt=p.media)==null?void 0:Pt.remote),pu=u.documentElement!==p.documentElement,fu=!!u.media&&(Za||gt),vu=!!((Qe=u.media)!=null&&Qe.textTracks)&&(za||gt),Eu=!!((Wa=u.media)!=null&&Wa.videoRenditions)&&(Qa||gt),bu=!!((Fa=u.media)!=null&&Fa.audioTracks)&&(Xa||gt),gu=!!((Va=u.media)!=null&&Va.remote)&&(Ja||gt),_u=!!u.documentElement&&(pu||gt),Zs=fu||vu||Eu||bu||gu||_u,Ni=d.length===0&&S===1&&s,Au=!!p.media&&(Za||Ni),Tu=!!((Ka=p.media)!=null&&Ka.textTracks)&&(za||Ni),yu=!!((Ga=p.media)!=null&&Ga.videoRenditions)&&(Qa||Ni),ku=!!((Ya=p.media)!=null&&Ya.audioTracks)&&(Xa||Ni),Su=!!((qa=p.media)!=null&&qa.remote)&&(Ja||Ni),Iu=!!p.documentElement&&(pu||Ni),Mu=Au||Tu||yu||ku||Su||Iu;if(!(Zs||Mu)){Object.entries(p).forEach(([F,ja])=>{u[F]=ja}),A(),p=void 0;return}Object.entries(a).forEach(([F,{get:ja,mediaEvents:Rh=[],textTracksEvents:xh=[],videoRenditionsEvents:Dh=[],audioTracksEvents:Oh=[],remoteEvents:Ph=[],rootEvents:Nh=[],stateOwnersUpdateHandlers:Uh=[]}])=>{E[F]||(E[F]={});let ke=Q=>{let ie=ja(u,Q);y({[F]:ie})},ne;ne=E[F].mediaEvents,Rh.forEach(Q=>{ne&&fu&&(u.media.removeEventListener(Q,ne),E[F].mediaEvents=void 0),Au&&(p.media.addEventListener(Q,ke),E[F].mediaEvents=ke)}),ne=E[F].textTracksEvents,xh.forEach(Q=>{var ie,He;ne&&vu&&((ie=u.media.textTracks)==null||ie.removeEventListener(Q,ne),E[F].textTracksEvents=void 0),Tu&&((He=p.media.textTracks)==null||He.addEventListener(Q,ke),E[F].textTracksEvents=ke)}),ne=E[F].videoRenditionsEvents,Dh.forEach(Q=>{var ie,He;ne&&Eu&&((ie=u.media.videoRenditions)==null||ie.removeEventListener(Q,ne),E[F].videoRenditionsEvents=void 0),yu&&((He=p.media.videoRenditions)==null||He.addEventListener(Q,ke),E[F].videoRenditionsEvents=ke)}),ne=E[F].audioTracksEvents,Oh.forEach(Q=>{var ie,He;ne&&bu&&((ie=u.media.audioTracks)==null||ie.removeEventListener(Q,ne),E[F].audioTracksEvents=void 0),ku&&((He=p.media.audioTracks)==null||He.addEventListener(Q,ke),E[F].audioTracksEvents=ke)}),ne=E[F].remoteEvents,Ph.forEach(Q=>{var ie,He;ne&&gu&&((ie=u.media.remote)==null||ie.removeEventListener(Q,ne),E[F].remoteEvents=void 0),Su&&((He=p.media.remote)==null||He.addEventListener(Q,ke),E[F].remoteEvents=ke)}),ne=E[F].rootEvents,Nh.forEach(Q=>{ne&&_u&&(u.documentElement.removeEventListener(Q,ne),E[F].rootEvents=void 0),Iu&&(p.documentElement.addEventListener(Q,ke),E[F].rootEvents=ke)});let ko=E[F].stateOwnersUpdateHandlers;if(ko&&Zs&&(Array.isArray(ko)?ko:[ko]).forEach(ie=>{typeof ie=="function"&&ie()}),Mu){let Q=Uh.map(ie=>ie(ke,p)).filter(ie=>typeof ie=="function");E[F].stateOwnersUpdateHandlers=Q.length===1?Q[0]:Q}else Zs&&(E[F].stateOwnersUpdateHandlers=void 0)}),Object.entries(p).forEach(([F,ja])=>{u[F]=ja}),A(),p=void 0};return k({media:t,fullscreenElement:e,documentElement:i,options:o}),{dispatch(g){let{type:S,detail:C}=g;if(r[S]&&v.mediaErrorCode==null){y(r[S](a,u,g));return}S==="mediaelementchangerequest"?k({media:C}):S==="fullscreenelementchangerequest"?k({fullscreenElement:C}):S==="documentelementchangerequest"?k({documentElement:C}):S==="optionschangerequest"&&(Object.entries(C!=null?C:{}).forEach(([j,Ue])=>{u.options[j]=Ue}),A())},getState(){return v},subscribe(g){return k({},d.length+1),d.push(g),g(v),()=>{let S=d.indexOf(g);S>=0&&(k({},d.length-1),d.splice(S,1))}}}};var bl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_=(t,e,i)=>(bl(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)=>(bl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ur=(t,e,i)=>(bl(t,e,"access private method"),i),kt,cr,H,je,mr,Je,Qo,hr,Xo,pl,hi,Jo,fl,vl,Ac,Tc=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],fc=10,vc=.025,Ec=.25,kp=.25,Sp=2,f={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"},jo=class extends si{constructor(){super(),Re(this,Xo),Re(this,Jo),Re(this,vl),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Re(this,kt,new Bt(this,f.HOTKEYS)),Re(this,cr,void 0),Re(this,H,void 0),Re(this,je,null),Re(this,mr,void 0),Re(this,Je,void 0),Re(this,Qo,i=>{var a;(a=_(this,H))==null||a.dispatch(i)}),Re(this,hr,void 0),Re(this,hi,i=>{let{key:a,shiftKey:r}=i;if(!(r&&(a==="/"||a==="?")||Tc.includes(a))){this.removeEventListener("keyup",_(this,hi));return}this.keyboardShortcutHandler(i)}),this.associateElement(this);let e={};Ke(this,mr,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(xu[o],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.hasAttribute(f.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(f.NO_HOTKEYS,f.HOTKEYS,f.DEFAULT_STREAM_TYPE,f.DEFAULT_SUBTITLES,f.DEFAULT_DURATION,f.NO_MUTED_PREF,f.NO_VOLUME_PREF,f.LANG,f.LOOP,f.LIVE_EDGE_OFFSET,f.SEEK_TO_LIVE_OFFSET,f.NO_AUTO_SEEK_TO_LIVE)}get mediaStore(){return _(this,H)}set mediaStore(e){var i,a;if(_(this,H)&&((i=_(this,Je))==null||i.call(this),Ke(this,Je,void 0)),Ke(this,H,e),!_(this,H)&&!this.hasAttribute(f.NO_DEFAULT_STORE)){ur(this,Xo,pl).call(this);return}Ke(this,Je,(a=_(this,H))==null?void 0:a.subscribe(_(this,mr)))}get fullscreenElement(){var e;return(e=_(this,cr))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(f.FULLSCREEN_ELEMENT)&&this.removeAttribute(f.FULLSCREEN_ELEMENT),Ke(this,cr,e),(i=_(this,H))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return M(this,f.DEFAULT_SUBTITLES)}set defaultSubtitles(e){L(this,f.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return x(this,f.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){w(this,f.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return P(this,f.DEFAULT_DURATION)}set defaultDuration(e){U(this,f.DEFAULT_DURATION,e)}get noHotkeys(){return M(this,f.NO_HOTKEYS)}set noHotkeys(e){L(this,f.NO_HOTKEYS,e)}get keysUsed(){return x(this,f.KEYS_USED)}set keysUsed(e){w(this,f.KEYS_USED,e)}get liveEdgeOffset(){return P(this,f.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){U(this,f.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return M(this,f.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){L(this,f.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return M(this,f.NO_VOLUME_PREF)}set noVolumePref(e){L(this,f.NO_VOLUME_PREF,e)}get noMutedPref(){return M(this,f.NO_MUTED_PREF)}set noMutedPref(e){L(this,f.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return M(this,f.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){L(this,f.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return M(this,f.NO_DEFAULT_STORE)}set noDefaultStore(e){L(this,f.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,o,s,d,u,v,y,A,E,p,k,g;if(super.attributeChangedCallback(e,i,a),e===f.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(f.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===f.HOTKEYS)_(this,kt).value=a;else if(e===f.DEFAULT_SUBTITLES&&a!==i)(r=_(this,H))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(f.DEFAULT_SUBTITLES)}});else if(e===f.DEFAULT_STREAM_TYPE)(s=_(this,H))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(f.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===f.LIVE_EDGE_OFFSET&&a!==i)(d=_(this,H))==null||d.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(f.LIVE_EDGE_OFFSET)?+this.getAttribute(f.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(f.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(f.SEEK_TO_LIVE_OFFSET):this.hasAttribute(f.LIVE_EDGE_OFFSET)?+this.getAttribute(f.LIVE_EDGE_OFFSET):void 0}});else if(e===f.SEEK_TO_LIVE_OFFSET&&a!==i)(u=_(this,H))==null||u.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(f.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(f.SEEK_TO_LIVE_OFFSET):this.hasAttribute(f.LIVE_EDGE_OFFSET)?+this.getAttribute(f.LIVE_EDGE_OFFSET):void 0}});else if(e===f.NO_AUTO_SEEK_TO_LIVE)(v=_(this,H))==null||v.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(f.NO_AUTO_SEEK_TO_LIVE)}});else if(e===f.FULLSCREEN_ELEMENT){let S=a?(y=this.getRootNode())==null?void 0:y.getElementById(a):void 0;Ke(this,cr,S),(A=_(this,H))==null||A.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===f.LANG&&a!==i?(Wu(a),(E=_(this,H))==null||E.dispatch({type:"optionschangerequest",detail:{mediaLang:a}})):e===f.LOOP&&a!==i?(p=_(this,H))==null||p.dispatch({type:h.MEDIA_LOOP_REQUEST,detail:a!=null}):e===f.NO_VOLUME_PREF&&a!==i?(k=_(this,H))==null||k.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(f.NO_VOLUME_PREF)}}):e===f.NO_MUTED_PREF&&a!==i&&((g=_(this,H))==null||g.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(f.NO_MUTED_PREF)}}))}connectedCallback(){var e,i,a;!_(this,H)&&!this.hasAttribute(f.NO_DEFAULT_STORE)&&ur(this,Xo,pl).call(this),(e=_(this,H))==null||e.dispatch({type:"documentelementchangerequest",detail:V}),(i=_(this,H))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement}),super.connectedCallback(),_(this,H)&&!_(this,Je)&&Ke(this,Je,(a=_(this,H))==null?void 0:a.subscribe(_(this,mr))),_(this,hr)!==void 0&&_(this,H)&&this.media&&setTimeout(()=>{var r,o,s;(o=(r=this.media)==null?void 0:r.textTracks)!=null&&o.length&&((s=_(this,H))==null||s.dispatch({type:h.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:_(this,hr)}))},0),this.hasAttribute(f.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,i,a,r,o,s;if((e=super.disconnectedCallback)==null||e.call(this),this.disableHotkeys(),_(this,H)){let d=_(this,H).getState();Ke(this,hr,!!((i=d.mediaSubtitlesShowing)!=null&&i.length)),(a=_(this,H))==null||a.dispatch({type:"fullscreenelementchangerequest",detail:void 0}),(r=_(this,H))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(o=_(this,H))==null||o.dispatch({type:h.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}_(this,Je)&&((s=_(this,Je))==null||s.call(this),Ke(this,Je,void 0)),this.unassociateElement(this),_(this,je)&&(_(this,je).remove(),Ke(this,je,null))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=_(this,H))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=_(this,H))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){_c(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=Rp(e,a,r);Object.values(h).forEach(s=>{e.addEventListener(s,_(this,Qo))}),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(h).forEach(r=>{e.removeEventListener(r,_(this,Qo))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),_(this,H)&&Object.entries(_(this,H).getState()).forEach(([r,o])=>{_c([e],r,o)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",ur(this,Jo,fl))}disableHotkeys(){this.removeEventListener("keydown",ur(this,Jo,fl)),this.removeEventListener("keyup",_(this,hi))}get hotkeys(){return _(this,kt)}set hotkeys(e){w(this,f.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,o,s,d,u,v,y;let A=e.target;if(((r=(a=(i=A.getAttribute(f.KEYS_USED))==null?void 0:i.split(" "))!=null?a:A==null?void 0:A.keysUsed)!=null?r:[]).map(C=>C==="Space"?" ":C).filter(Boolean).includes(e.key))return;let p,k,g;if(!(_(this,kt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&_(this,kt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&_(this,kt).contains("noshift+/")))switch(e.key){case" ":case"k":p=_(this,H).getState().mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"m":p=this.mediaStore.getState().mediaVolumeLevel==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"f":p=this.mediaStore.getState().mediaIsFullscreen?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(h.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let C=this.hasAttribute(f.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(f.KEYBOARD_BACKWARD_SEEK_OFFSET):fc;k=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-C,0),g=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"ArrowRight":case"l":{let C=this.hasAttribute(f.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(f.KEYBOARD_FORWARD_SEEK_OFFSET):fc;k=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+C,0),g=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"ArrowUp":{let C=this.hasAttribute(f.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(f.KEYBOARD_UP_VOLUME_STEP):vc;k=Math.min(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)+C,1),g=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"ArrowDown":{let C=this.hasAttribute(f.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(f.KEYBOARD_DOWN_VOLUME_STEP):vc;k=Math.max(((u=this.mediaStore.getState().mediaVolume)!=null?u:1)-C,0),g=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"<":{let C=(v=this.mediaStore.getState().mediaPlaybackRate)!=null?v:1;k=Math.max(C-Ec,kp).toFixed(2),g=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case">":{let C=(y=this.mediaStore.getState().mediaPlaybackRate)!=null?y:1;k=Math.min(C+Ec,Sp).toFixed(2),g=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"/":case"?":{e.shiftKey&&ur(this,vl,Ac).call(this);break}case"p":{p=this.mediaStore.getState().mediaIsPip?h.MEDIA_EXIT_PIP_REQUEST:h.MEDIA_ENTER_PIP_REQUEST,g=new l.CustomEvent(p,{composed:!0,bubbles:!0}),this.dispatchEvent(g);break}default:break}}};kt=new WeakMap;cr=new WeakMap;H=new WeakMap;je=new WeakMap;mr=new WeakMap;Je=new WeakMap;Qo=new WeakMap;hr=new WeakMap;Xo=new WeakSet;pl=function(){var t;this.mediaStore=pc({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(f.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(f.DEFAULT_DURATION)?+this.getAttribute(f.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(f.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(f.LIVE_EDGE_OFFSET)?+this.getAttribute(f.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(f.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(f.SEEK_TO_LIVE_OFFSET):this.hasAttribute(f.LIVE_EDGE_OFFSET)?+this.getAttribute(f.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(f.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(f.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(f.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(f.NO_SUBTITLES_LANG_PREF)}})};hi=new WeakMap;Jo=new WeakSet;fl=function(t){var e;let{metaKey:i,altKey:a,key:r,shiftKey:o}=t,s=o&&(r==="/"||r==="?");if(s&&((e=_(this,je))!=null&&e.open)){this.removeEventListener("keyup",_(this,hi));return}if(i||a||!s&&!Tc.includes(r)){this.removeEventListener("keyup",_(this,hi));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)&&!(_(this,kt).contains(`no${r.toLowerCase()}`)||r===" "&&_(this,kt).contains("nospace"))&&!u&&t.preventDefault(),this.addEventListener("keyup",_(this,hi),{once:!0})};vl=new WeakSet;Ac=function(){_(this,je)||(Ke(this,je,V.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(_(this,je))),_(this,je).open=!0};var Ip=Object.values(n),Mp=Object.values(js),yc=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,D.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(o||s)?(o||s).filter(d=>Ip.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),Mp.some(a=>a in t)},El=t=>Lp(t)||!!yc(t).length,bc=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},gc={[n.MEDIA_SUBTITLES_LIST]:yt,[n.MEDIA_SUBTITLES_SHOWING]:yt,[n.MEDIA_SEEKABLE]:bc,[n.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(bc).join(" "),[n.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[n.MEDIA_RENDITION_LIST]:Ou,[n.MEDIA_AUDIO_TRACK_LIST]:Nu},Cp=async(t,e,i)=>{var a,r;if(t.isConnected||await Mo(0),typeof i=="boolean"||i==null)return L(t,e,i);if(typeof i=="number")return U(t,e,i);if(typeof i=="string")return w(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let o=(r=(a=gc[e])==null?void 0:a.call(gc,i))!=null?r:i;return t.setAttribute(e,o)},wp=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},mi=(t,e)=>{if(wp(t))return;let i=(r,o)=>{var s,d;El(r)&&o(r);let{children:u=[]}=r!=null?r:{},v=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...u,...v].forEach(A=>mi(A,o))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!El(t)){l.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},_c=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=yc(a),o=e.toLowerCase();r.includes(o)&&Cp(a,o,i)})},Rp=(t,e,i)=>{mi(t,e);let a=y=>{var A;let E=(A=y==null?void 0:y.composedPath()[0])!=null?A:y.target;e(E)},r=y=>{var A;let E=(A=y==null?void 0:y.composedPath()[0])!=null?A:y.target;i(E)};t.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let o=y=>{y.forEach(A=>{let{addedNodes:E=[],removedNodes:p=[],type:k,target:g,attributeName:S}=A;k==="childList"?(Array.prototype.forEach.call(E,C=>mi(C,e)),Array.prototype.forEach.call(p,C=>mi(C,i))):k==="attributes"&&S===D.MEDIA_CHROME_ATTRIBUTES&&(El(g)?e(g):i(g))})},s=[],d=y=>{let A=y.target;A.name!=="media"&&(s.forEach(E=>mi(E,i)),s=[...A.assignedElements({flatten:!0})],s.forEach(E=>mi(E,e)))};t.addEventListener("slotchange",d);let u=new MutationObserver(o);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{mi(t,i),t.removeEventListener("slotchange",d),u.disconnect(),t.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",jo);var gl=jo;var zi={PLACEMENT:"placement",BOUNDS:"bounds"};function xp(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
|
|
268
|
+
`}var Qi=class extends l.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Oo(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=Xe(this,"#"+this.bounds))!=null?e:Y(this);if(!r)return;let{x:o,width:s}=r.getBoundingClientRect(),{x:d,width:u}=this.getBoundingClientRect(),v=d+u,y=o+s,A=a.getPropertyValue("--media-tooltip-offset-x"),E=A?parseFloat(A.replace("px","")):0,p=a.getPropertyValue("--media-tooltip-container-margin"),k=p?parseFloat(p.replace("px","")):0,g=d-o+E-k,S=v-y+E+k;if(g<0){this.style.setProperty("--media-tooltip-offset-x",`${g}px`);return}if(S>0){this.style.setProperty("--media-tooltip-offset-x",`${S}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[zi.PLACEMENT,zi.BOUNDS]}get placement(){return x(this,zi.PLACEMENT)}set placement(e){w(this,zi.PLACEMENT,e)}get bounds(){return x(this,zi.BOUNDS)}set bounds(e){w(this,zi.BOUNDS,e)}};Qi.shadowRootOptions={mode:"open"};Qi.getTemplateHTML=xp;l.customElements.get("media-tooltip")||l.customElements.define("media-tooltip",Qi);var en=Qi;var Al=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},re=(t,e,i)=>(Al(t,e,"read from private field"),i?i.call(t):e.get(t)),Xi=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},tn=(t,e,i,a)=>(Al(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Dp=(t,e,i)=>(Al(t,e,"access private method"),i),et,ji,Wt,Ji,an,_l,kc,$t={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Op(t,e={}){return`
|
|
269
269
|
<style>
|
|
270
270
|
:host {
|
|
271
271
|
position: relative;
|
|
@@ -339,20 +339,20 @@
|
|
|
339
339
|
|
|
340
340
|
<slot name="tooltip">
|
|
341
341
|
<media-tooltip part="tooltip" aria-hidden="true">
|
|
342
|
-
<template shadowrootmode="${
|
|
343
|
-
${
|
|
342
|
+
<template shadowrootmode="${en.shadowRootOptions.mode}">
|
|
343
|
+
${en.getTemplateHTML({})}
|
|
344
344
|
</template>
|
|
345
345
|
<slot name="tooltip-content">
|
|
346
346
|
${this.getTooltipContentHTML(t)}
|
|
347
347
|
</slot>
|
|
348
348
|
</media-tooltip>
|
|
349
349
|
</slot>
|
|
350
|
-
`}function
|
|
350
|
+
`}function Pp(t,e){return`
|
|
351
351
|
<slot></slot>
|
|
352
|
-
`}function
|
|
352
|
+
`}function Np(){return""}var B=class extends l.HTMLElement{constructor(){if(super(),Xi(this,_l),Xi(this,et,void 0),this.preventClick=!1,this.tooltipEl=null,Xi(this,ji,e=>{this.preventClick||this.handleClick(e),setTimeout(re(this,Wt),0)}),Xi(this,Wt,()=>{var e,i;(i=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||i.call(e)}),Xi(this,Ji,e=>{let{key:i}=e;if(!this.keysUsed.includes(i)){this.removeEventListener("keyup",re(this,Ji));return}this.preventClick||this.handleClick(e)}),Xi(this,an,e=>{let{metaKey:i,altKey:a,key:r}=e;if(i||a||!this.keysUsed.includes(r)){this.removeEventListener("keyup",re(this,Ji));return}this.addEventListener("keyup",re(this,Ji),{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",$t.TOOLTIP_PLACEMENT,D.MEDIA_CONTROLLER,n.MEDIA_LANG]}enable(){this.addEventListener("click",re(this,ji)),this.addEventListener("keydown",re(this,an)),this.tabIndex=0}disable(){this.removeEventListener("click",re(this,ji)),this.removeEventListener("keydown",re(this,an)),this.removeEventListener("keyup",re(this,Ji)),this.tabIndex=-1}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===D.MEDIA_CONTROLLER?(i&&((o=(r=re(this,et))==null?void 0:r.unassociateElement)==null||o.call(r,this),tn(this,et,null)),a&&this.isConnected&&(tn(this,et,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=re(this,et))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===$t.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()),re(this,Wt).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(D.MEDIA_CONTROLLER);o&&(tn(this,et,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=re(this,et))==null?void 0:i.associateElement)==null||a.call(i,this)),l.customElements.whenDefined("media-tooltip").then(()=>Dp(this,_l,kc).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=re(this,et))==null?void 0:e.unassociateElement)==null||i.call(e,this),tn(this,et,null),this.removeEventListener("mouseenter",re(this,Wt)),this.removeEventListener("focus",re(this,Wt)),this.removeEventListener("click",re(this,ji))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return x(this,$t.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){w(this,$t.TOOLTIP_PLACEMENT,e)}get mediaController(){return x(this,D.MEDIA_CONTROLLER)}set mediaController(e){w(this,D.MEDIA_CONTROLLER,e)}get disabled(){return M(this,$t.DISABLED)}set disabled(e){L(this,$t.DISABLED,e)}get noTooltip(){return M(this,$t.NO_TOOLTIP)}set noTooltip(e){L(this,$t.NO_TOOLTIP,e)}handleClick(e){}};et=new WeakMap;ji=new WeakMap;Wt=new WeakMap;Ji=new WeakMap;an=new WeakMap;_l=new WeakSet;kc=function(){this.addEventListener("mouseenter",re(this,Wt)),this.addEventListener("focus",re(this,Wt)),this.addEventListener("click",re(this,ji));let t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)};B.shadowRootOptions={mode:"open"};B.getTemplateHTML=Op;B.getSlotTemplateHTML=Pp;B.getTooltipContentHTML=Np;l.customElements.get("media-chrome-button")||l.customElements.define("media-chrome-button",B);var Sc=`<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
|
-
`;function
|
|
355
|
+
`;function Up(t){return`
|
|
356
356
|
<style>
|
|
357
357
|
:host([${n.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
|
|
358
358
|
display: none !important;
|
|
@@ -370,17 +370,17 @@
|
|
|
370
370
|
</style>
|
|
371
371
|
|
|
372
372
|
<slot name="icon">
|
|
373
|
-
<slot name="enter">${
|
|
374
|
-
<slot name="exit">${
|
|
373
|
+
<slot name="enter">${Sc}</slot>
|
|
374
|
+
<slot name="exit">${Sc}</slot>
|
|
375
375
|
</slot>
|
|
376
|
-
`}function
|
|
377
|
-
<slot name="tooltip-enter">${
|
|
378
|
-
<slot name="tooltip-exit">${
|
|
379
|
-
`}var
|
|
376
|
+
`}function Hp(){return`
|
|
377
|
+
<slot name="tooltip-enter">${c("start airplay")}</slot>
|
|
378
|
+
<slot name="tooltip-exit">${c("stop airplay")}</slot>
|
|
379
|
+
`}var Ic=t=>{let e=t.mediaIsAirplaying?c("stop airplay"):c("start airplay");t.setAttribute("aria-label",e)},pr=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_AIRPLAYING,n.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Ic(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_AIRPLAYING&&Ic(this)}get mediaIsAirplaying(){return M(this,n.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){L(this,n.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return x(this,n.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){w(this,n.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new l.CustomEvent(h.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};pr.getSlotTemplateHTML=Up;pr.getTooltipContentHTML=Hp;l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",pr);var Bp=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
380
380
|
<path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
|
|
381
|
-
</svg
|
|
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"/>
|
|
383
|
-
</svg>`;function
|
|
383
|
+
</svg>`;function Wp(t){return`
|
|
384
384
|
<style>
|
|
385
385
|
:host([aria-checked="true"]) slot[name=off] {
|
|
386
386
|
display: none !important;
|
|
@@ -398,13 +398,13 @@
|
|
|
398
398
|
</style>
|
|
399
399
|
|
|
400
400
|
<slot name="icon">
|
|
401
|
-
<slot name="on">${
|
|
402
|
-
<slot name="off">${
|
|
401
|
+
<slot name="on">${Bp}</slot>
|
|
402
|
+
<slot name="off">${$p}</slot>
|
|
403
403
|
</slot>
|
|
404
|
-
`}function
|
|
405
|
-
<slot name="tooltip-enable">${
|
|
406
|
-
<slot name="tooltip-disable">${
|
|
407
|
-
`}var
|
|
404
|
+
`}function Fp(){return`
|
|
405
|
+
<slot name="tooltip-enable">${c("Enable captions")}</slot>
|
|
406
|
+
<slot name="tooltip-disable">${c("Disable captions")}</slot>
|
|
407
|
+
`}var Mc=t=>{t.setAttribute("aria-checked",Go(t).toString())},fr=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","button"),this.setAttribute("aria-label",c("closed captions")),Mc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING&&Mc(this)}get mediaSubtitlesList(){return Lc(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Cc(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Lc(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Cc(this,n.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(h.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};fr.getSlotTemplateHTML=Wp;fr.getTooltipContentHTML=Fp;var Lc=(t,e)=>{let i=t.getAttribute(e);return i?di(i):[]},Cc=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=yt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",fr);var Vp='<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 Gp(t){return`
|
|
408
408
|
<style>
|
|
409
409
|
:host([${n.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
|
|
410
410
|
display: none !important;
|
|
@@ -422,13 +422,13 @@
|
|
|
422
422
|
</style>
|
|
423
423
|
|
|
424
424
|
<slot name="icon">
|
|
425
|
-
<slot name="enter">${
|
|
426
|
-
<slot name="exit">${
|
|
425
|
+
<slot name="enter">${Vp}</slot>
|
|
426
|
+
<slot name="exit">${Kp}</slot>
|
|
427
427
|
</slot>
|
|
428
|
-
`}function
|
|
429
|
-
<slot name="tooltip-enter">${
|
|
430
|
-
<slot name="tooltip-exit">${
|
|
431
|
-
`}var
|
|
428
|
+
`}function Yp(){return`
|
|
429
|
+
<slot name="tooltip-enter">${c("Start casting")}</slot>
|
|
430
|
+
<slot name="tooltip-exit">${c("Stop casting")}</slot>
|
|
431
|
+
`}var wc=t=>{let e=t.mediaIsCasting?c("stop casting"):c("start casting");t.setAttribute("aria-label",e)},vr=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_CASTING,n.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),wc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_CASTING&&wc(this)}get mediaIsCasting(){return M(this,n.MEDIA_IS_CASTING)}set mediaIsCasting(e){L(this,n.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return x(this,n.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){w(this,n.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?h.MEDIA_EXIT_CAST_REQUEST:h.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};vr.getSlotTemplateHTML=Gp;vr.getTooltipContentHTML=Yp;l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",vr);var Ll=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},fi=(t,e,i)=>(Ll(t,e,"read from private field"),i?i.call(t):e.get(t)),St=(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)},Cl=(t,e,i,a)=>(Ll(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),pi=(t,e,i)=>(Ll(t,e,"access private method"),i),on,br,vi,rn,Tl,yl,Rc,kl,xc,Sl,Dc,Il,Oc,Ml,Pc;function qp(t){return`
|
|
432
432
|
<style>
|
|
433
433
|
:host {
|
|
434
434
|
font: var(--media-font,
|
|
@@ -469,9 +469,9 @@
|
|
|
469
469
|
}
|
|
470
470
|
</style>
|
|
471
471
|
${this.getSlotTemplateHTML(t)}
|
|
472
|
-
`}function
|
|
472
|
+
`}function Zp(t){return`
|
|
473
473
|
<slot id="content"></slot>
|
|
474
|
-
`}var
|
|
474
|
+
`}var Er={OPEN:"open",ANCHOR:"anchor"},tt=class extends l.HTMLElement{constructor(){super(),St(this,rn),St(this,yl),St(this,kl),St(this,Sl),St(this,Il),St(this,Ml),St(this,on,!1),St(this,br,null),St(this,vi,null)}static get observedAttributes(){return[Er.OPEN,Er.ANCHOR]}get open(){return M(this,Er.OPEN)}set open(e){L(this,Er.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":pi(this,Sl,Dc).call(this,e);break;case"focusout":pi(this,Il,Oc).call(this,e);break;case"keydown":pi(this,Ml,Pc).call(this,e);break}}connectedCallback(){pi(this,rn,Tl).call(this),this.role||(this.role="dialog"),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}disconnectedCallback(){this.removeEventListener("invoke",this),this.removeEventListener("focusout",this),this.removeEventListener("keydown",this)}attributeChangedCallback(e,i,a){pi(this,rn,Tl).call(this),e===Er.OPEN&&a!==i&&(this.open?pi(this,yl,Rc).call(this):pi(this,kl,xc).call(this))}focus(){Cl(this,br,ar());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"]}};on=new WeakMap;br=new WeakMap;vi=new WeakMap;rn=new WeakSet;Tl=function(){if(!fi(this,on)&&(Cl(this,on,!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")})}};yl=new WeakSet;Rc=function(){var t;(t=fi(this,vi))==null||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};kl=new WeakSet;xc=function(){var t;(t=fi(this,vi))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};Sl=new WeakSet;Dc=function(t){Cl(this,vi,t.relatedTarget),he(this,t.relatedTarget)||(this.open=!this.open)};Il=new WeakSet;Oc=function(t){var e;he(this,t.relatedTarget)||((e=fi(this,br))==null||e.focus(),fi(this,vi)&&fi(this,vi)!==t.relatedTarget&&this.open&&(this.open=!1))};Ml=new WeakSet;Pc=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:v}=t;d||u||v||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=fi(this,br))==null||o.focus(),this.open=!1))};tt.shadowRootOptions={mode:"open"};tt.getTemplateHTML=qp;tt.getSlotTemplateHTML=Zp;l.customElements.get("media-chrome-dialog")||l.customElements.define("media-chrome-dialog",tt);var Nl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},X=(t,e,i)=>(Nl(t,e,"read from private field"),i?i.call(t):e.get(t)),ce=(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)},Ft=(t,e,i,a)=>(Nl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ge=(t,e,i)=>(Nl(t,e,"access private method"),i),it,fn,nn,sn,Ye,hn,ln,dn,un,Ul,Nc,cn,wl,mn,Rl,pn,Hl,xl,Uc,Dl,Hc,Ol,Bc,Pl,$c;function zp(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));
|
|
@@ -681,6 +681,14 @@
|
|
|
681
681
|
transform: var(--media-range-segment-transform, scaleY(1));
|
|
682
682
|
transform-origin: center;
|
|
683
683
|
}
|
|
684
|
+
|
|
685
|
+
/* Visible label for accessibility - positioned off-screen but technically visible (Firefox requires visible labels) */
|
|
686
|
+
#range-label {
|
|
687
|
+
position: absolute;
|
|
688
|
+
left: -10000px;
|
|
689
|
+
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
690
|
+
pointer-events: none;
|
|
691
|
+
}
|
|
684
692
|
</style>
|
|
685
693
|
<div id="leftgap"></div>
|
|
686
694
|
<div id="container">
|
|
@@ -694,14 +702,15 @@
|
|
|
694
702
|
<slot name="thumb">
|
|
695
703
|
<div id="thumb" part="thumb"></div>
|
|
696
704
|
</slot>
|
|
697
|
-
<svg id="segments"><clipPath id="segments-clipping"></clipPath></svg>
|
|
705
|
+
<svg id="segments" aria-hidden="true"><clipPath id="segments-clipping"></clipPath></svg>
|
|
698
706
|
</div>
|
|
699
|
-
|
|
707
|
+
<input id="range" type="range" min="0" max="1" step="any" value="0">
|
|
708
|
+
<label for="range" id="range-label"></label>
|
|
700
709
|
|
|
701
710
|
${this.getContainerTemplateHTML(t)}
|
|
702
711
|
</div>
|
|
703
712
|
<div id="rightgap"></div>
|
|
704
|
-
`}function
|
|
713
|
+
`}function Qp(t){return""}var at=class extends l.HTMLElement{constructor(){if(super(),ce(this,Ul),ce(this,cn),ce(this,mn),ce(this,pn),ce(this,xl),ce(this,Dl),ce(this,Ol),ce(this,Pl),ce(this,it,void 0),ce(this,fn,void 0),ce(this,nn,void 0),ce(this,sn,void 0),ce(this,Ye,{}),ce(this,hn,[]),ce(this,ln,()=>{if(this.range.matches(":focus-visible")){let{style:e}=q(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),ce(this,dn,()=>{let{style:e}=q(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),ce(this,un,()=>{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"),Ft(this,nn,this.shadowRoot.querySelector("#startpoint")),Ft(this,sn,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",D.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===D.MEDIA_CONTROLLER?(i&&((o=(r=X(this,it))==null?void 0:r.unassociateElement)==null||o.call(r,this),Ft(this,it,null)),a&&this.isConnected&&(Ft(this,it,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=X(this,it))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),Ge(this,cn,wl).call(this)):(this.range.setAttribute(e,a),Ge(this,mn,Rl).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))`),X(this,Ye).pointer=q(this.shadowRoot,"#pointer"),X(this,Ye).progress=q(this.shadowRoot,"#progress"),X(this,Ye).thumb=q(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),X(this,Ye).activeSegment=q(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(D.MEDIA_CONTROLLER);o&&(Ft(this,it,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=X(this,it))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",X(this,ln)),this.shadowRoot.addEventListener("focusout",X(this,dn)),Ge(this,cn,wl).call(this),_t(this.container,X(this,un))}disconnectedCallback(){var e,i;Ge(this,mn,Rl).call(this),(i=(e=X(this,it))==null?void 0:e.unassociateElement)==null||i.call(e,this),Ft(this,it,null),this.shadowRoot.removeEventListener("focusin",X(this,ln)),this.shadowRoot.removeEventListener("focusout",X(this,dn)),At(this.container,X(this,un))}updatePointerBar(e){var i;(i=X(this,Ye).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=X(this,Ye).progress)==null||e.style.setProperty("width",`${a}%`),(i=X(this,Ye).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])];Ft(this,hn,[...a]);let r=a.pop();for(let[o,s]of a.entries()){let[d,u]=[o===0,o===a.length-1],v=d?"calc(var(--segments-gap) / -1)":`${s*100}%`,A=`calc(${((u?r:a[o+1])-s)*100}%${d||u?"":" - var(--segments-gap)"})`,E=V.createElementNS("http://www.w3.org/2000/svg","rect"),p=rr(this.shadowRoot,`#segments-clipping rect:nth-child(${o+1})`);p.style.setProperty("x",v),p.style.setProperty("width",A),i.append(E)}}getPointerRatio(e){return Zu(e.clientX,e.clientY,X(this,nn).getBoundingClientRect(),X(this,sn).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Ge(this,Pl,$c).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Ge(this,xl,Uc).call(this,e);break;case"pointerdown":Ge(this,pn,Hl).call(this,e);break;case"pointerup":Ge(this,Dl,Hc).call(this);break;case"pointerleave":Ge(this,Ol,Bc).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};it=new WeakMap;fn=new WeakMap;nn=new WeakMap;sn=new WeakMap;Ye=new WeakMap;hn=new WeakMap;ln=new WeakMap;dn=new WeakMap;un=new WeakMap;Ul=new WeakSet;Nc=function(t){let e=X(this,Ye).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${X(this,hn).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))"))};cn=new WeakSet;wl=function(){this.hasAttribute("disabled")||!this.isConnected||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};mn=new WeakSet;Rl=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),this.removeEventListener("pointerleave",this),(t=l.window)==null||t.removeEventListener("pointerup",this),(e=l.window)==null||e.removeEventListener("pointermove",this)};pn=new WeakSet;Hl=function(t){var e;Ft(this,fn,t.composedPath().includes(this.range)),(e=l.window)==null||e.addEventListener("pointerup",this,{once:!0})};xl=new WeakSet;Uc=function(t){var e;t.pointerType!=="mouse"&&Ge(this,pn,Hl).call(this,t),this.addEventListener("pointerleave",this,{once:!0}),(e=l.window)==null||e.addEventListener("pointermove",this)};Dl=new WeakSet;Hc=function(){var t;(t=l.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};Ol=new WeakSet;Bc=function(){var t,e;this.removeEventListener("pointerleave",this),(t=l.window)==null||t.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=X(this,Ye).activeSegment)==null||e.style.removeProperty("transform")};Pl=new WeakSet;$c=function(t){t.pointerType==="pen"&&t.buttons===0||(this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),Ge(this,Ul,Nc).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!X(this,fn))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};at.shadowRootOptions={mode:"open"};at.getTemplateHTML=zp;at.getContainerTemplateHTML=Qp;l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",at);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)),Xp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},En=(t,e,i,a)=>(Wc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),rt;function Jp(t){return`
|
|
705
714
|
<style>
|
|
706
715
|
:host {
|
|
707
716
|
|
|
@@ -727,7 +736,7 @@
|
|
|
727
736
|
</style>
|
|
728
737
|
|
|
729
738
|
<slot></slot>
|
|
730
|
-
`}var
|
|
739
|
+
`}var gr=class extends l.HTMLElement{constructor(){if(super(),Xp(this,rt,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[D.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===D.MEDIA_CONTROLLER&&(i&&((o=(r=vn(this,rt))==null?void 0:r.unassociateElement)==null||o.call(r,this),En(this,rt,null)),a&&this.isConnected&&(En(this,rt,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=vn(this,rt))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(D.MEDIA_CONTROLLER);r&&(En(this,rt,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=vn(this,rt))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=vn(this,rt))==null?void 0:e.unassociateElement)==null||i.call(e,this),En(this,rt,null)}};rt=new WeakMap;gr.shadowRootOptions={mode:"open"};gr.getTemplateHTML=Jp;l.customElements.get("media-control-bar")||l.customElements.define("media-control-bar",gr);var Fc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bn=(t,e,i)=>(Fc(t,e,"read from private field"),i?i.call(t):e.get(t)),jp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},gn=(t,e,i,a)=>(Fc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ot;function ef(t,e={}){return`
|
|
731
740
|
<style>
|
|
732
741
|
:host {
|
|
733
742
|
font: var(--media-font,
|
|
@@ -761,11 +770,11 @@
|
|
|
761
770
|
</style>
|
|
762
771
|
|
|
763
772
|
${this.getSlotTemplateHTML(t,e)}
|
|
764
|
-
`}function
|
|
773
|
+
`}function tf(t,e){return`
|
|
765
774
|
<slot></slot>
|
|
766
|
-
`}var
|
|
767
|
-
<slot>${
|
|
768
|
-
`}var
|
|
775
|
+
`}var Te=class extends l.HTMLElement{constructor(){if(super(),jp(this,ot,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[D.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===D.MEDIA_CONTROLLER&&(i&&((o=(r=bn(this,ot))==null?void 0:r.unassociateElement)==null||o.call(r,this),gn(this,ot,null)),a&&this.isConnected&&(gn(this,ot,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=bn(this,ot))==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(D.MEDIA_CONTROLLER);o&&(gn(this,ot,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=bn(this,ot))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=bn(this,ot))==null?void 0:e.unassociateElement)==null||i.call(e,this),gn(this,ot,null)}};ot=new WeakMap;Te.shadowRootOptions={mode:"open"};Te.getTemplateHTML=ef;Te.getSlotTemplateHTML=tf;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",Te);var Kc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Vc=(t,e,i)=>(Kc(t,e,"read from private field"),i?i.call(t):e.get(t)),af=(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)},rf=(t,e,i,a)=>(Kc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),_r;function of(t,e){return`
|
|
776
|
+
<slot>${$e(e.mediaDuration)}</slot>
|
|
777
|
+
`}var _n=class extends Te{constructor(){var e;super(),af(this,_r,void 0),rf(this,_r,this.shadowRoot.querySelector("slot")),Vc(this,_r).textContent=$e((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===n.MEDIA_DURATION&&(Vc(this,_r).textContent=$e(+a)),super.attributeChangedCallback(e,i,a)}get mediaDuration(){return P(this,n.MEDIA_DURATION)}set mediaDuration(e){U(this,n.MEDIA_DURATION,e)}};_r=new WeakMap;_n.getSlotTemplateHTML=of;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",_n);var nf={2:c("Network Error"),3:c("Decode Error"),4:c("Source Not Supported"),5:c("Encryption Error")},sf={2:c("A network error caused the media download to fail."),3:c("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:c("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:c("The media is encrypted and there are no keys to decrypt it.")},An=t=>{var e,i;return t.code===1?null:{title:(e=nf[t.code])!=null?e:`Error ${t.code}`,message:(i=sf[t.code])!=null?i:t.message}};var Yc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},lf=(t,e,i)=>(Yc(t,e,"read from private field"),i?i.call(t):e.get(t)),df=(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)},uf=(t,e,i,a)=>(Yc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Tn;function cf(t){return`
|
|
769
778
|
<style>
|
|
770
779
|
:host {
|
|
771
780
|
background: rgb(20 20 30 / .8);
|
|
@@ -782,9 +791,9 @@
|
|
|
782
791
|
}
|
|
783
792
|
</style>
|
|
784
793
|
<slot name="error-${t.mediaerrorcode}" id="content">
|
|
785
|
-
${
|
|
794
|
+
${qc({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
|
|
786
795
|
</slot>
|
|
787
|
-
`}function
|
|
796
|
+
`}function mf(t){return t.code&&An(t)!==null}function qc(t){var e;let{title:i,message:a}=(e=An(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 Gc=[n.MEDIA_ERROR_CODE,n.MEDIA_ERROR_MESSAGE],ea=class extends tt{constructor(){super(...arguments),df(this,Tn,null)}static get observedAttributes(){return[...super.observedAttributes,...Gc]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,i,a){var r;if(super.attributeChangedCallback(e,i,a),!Gc.includes(e))return;let o=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};if(this.open=mf(o),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(o),!this.hasAttribute("aria-label"))){let{title:s}=An(o);s&&this.setAttribute("aria-label",s)}}get mediaError(){return lf(this,Tn)}set mediaError(e){uf(this,Tn,e)}get mediaErrorCode(){return P(this,"mediaerrorcode")}set mediaErrorCode(e){U(this,"mediaerrorcode",e)}get mediaErrorMessage(){return x(this,"mediaerrormessage")}set mediaErrorMessage(e){w(this,"mediaerrormessage",e)}};Tn=new WeakMap;ea.getSlotTemplateHTML=cf;ea.formatErrorMessage=qc;l.customElements.get("media-error-dialog")||l.customElements.define("media-error-dialog",ea);var yn=ea;var hf=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Vt=(t,e,i)=>(hf(t,e,"read from private field"),i?i.call(t):e.get(t)),Zc=(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)},ta,ia;function pf(t){return`
|
|
788
797
|
<style>
|
|
789
798
|
:host {
|
|
790
799
|
position: fixed;
|
|
@@ -869,9 +878,9 @@
|
|
|
869
878
|
}
|
|
870
879
|
</style>
|
|
871
880
|
<slot id="content">
|
|
872
|
-
${
|
|
881
|
+
${ff()}
|
|
873
882
|
</slot>
|
|
874
|
-
`}function
|
|
883
|
+
`}function ff(){return`
|
|
875
884
|
<h2>Keyboard Shortcuts</h2>
|
|
876
885
|
<table class="shortcuts-table">${[{keys:["Space","k"],description:"Toggle Playback"},{keys:["m"],description:"Toggle mute"},{keys:["f"],description:"Toggle fullscreen"},{keys:["c"],description:"Toggle captions or subtitles, if available"},{keys:["p"],description:"Toggle Picture in Picture"},{keys:["\u2190","j"],description:"Seek back 10s"},{keys:["\u2192","l"],description:"Seek forward 10s"},{keys:["\u2191"],description:"Turn volume up"},{keys:["\u2193"],description:"Turn volume down"},{keys:["< (SHIFT+,)"],description:"Decrease playback rate"},{keys:["> (SHIFT+.)"],description:"Increase playback rate"}].map(({keys:i,description:a})=>`
|
|
877
886
|
<tr>
|
|
@@ -881,11 +890,11 @@
|
|
|
881
890
|
<td class="description">${a}</td>
|
|
882
891
|
</tr>
|
|
883
892
|
`).join("")}</table>
|
|
884
|
-
`}var
|
|
893
|
+
`}var kn=class extends tt{constructor(){super(...arguments),Zc(this,ta,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)}),Zc(this,ia,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",Vt(this,ta)),document.addEventListener("keydown",Vt(this,ia)))}disconnectedCallback(){this.removeEventListener("click",Vt(this,ta)),document.removeEventListener("keydown",Vt(this,ia))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e==="open"&&(this.open?(this.addEventListener("click",Vt(this,ta)),document.addEventListener("keydown",Vt(this,ia))):(this.removeEventListener("click",Vt(this,ta)),document.removeEventListener("keydown",Vt(this,ia))))}};ta=new WeakMap;ia=new WeakMap;kn.getSlotTemplateHTML=pf;l.customElements.get("media-keyboard-shortcuts-dialog")||l.customElements.define("media-keyboard-shortcuts-dialog",kn);var Qc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},vf=(t,e,i)=>(Qc(t,e,"read from private field"),i?i.call(t):e.get(t)),Ef=(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)},bf=(t,e,i,a)=>(Qc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Sn,gf=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
885
894
|
<path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
|
|
886
|
-
</svg>`,
|
|
895
|
+
</svg>`,_f=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
887
896
|
<path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
|
|
888
|
-
</svg>`;function
|
|
897
|
+
</svg>`;function Af(t){return`
|
|
889
898
|
<style>
|
|
890
899
|
:host([${n.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
|
|
891
900
|
display: none !important;
|
|
@@ -903,13 +912,13 @@
|
|
|
903
912
|
</style>
|
|
904
913
|
|
|
905
914
|
<slot name="icon">
|
|
906
|
-
<slot name="enter">${
|
|
907
|
-
<slot name="exit">${
|
|
915
|
+
<slot name="enter">${gf}</slot>
|
|
916
|
+
<slot name="exit">${_f}</slot>
|
|
908
917
|
</slot>
|
|
909
|
-
`}function
|
|
910
|
-
<slot name="tooltip-enter">${
|
|
911
|
-
<slot name="tooltip-exit">${
|
|
912
|
-
`}var
|
|
918
|
+
`}function Tf(){return`
|
|
919
|
+
<slot name="tooltip-enter">${c("Enter fullscreen mode")}</slot>
|
|
920
|
+
<slot name="tooltip-exit">${c("Exit fullscreen mode")}</slot>
|
|
921
|
+
`}var zc=t=>{let e=t.mediaIsFullscreen?c("exit fullscreen mode"):c("enter fullscreen mode");t.setAttribute("aria-label",e)},Ar=class extends B{constructor(){super(...arguments),Ef(this,Sn,null)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_FULLSCREEN,n.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),zc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_FULLSCREEN&&zc(this)}get mediaFullscreenUnavailable(){return x(this,n.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){w(this,n.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return M(this,n.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){L(this,n.MEDIA_IS_FULLSCREEN,e)}handleClick(e){bf(this,Sn,e);let i=vf(this,Sn)instanceof PointerEvent,a=this.mediaIsFullscreen?new l.CustomEvent(h.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new l.CustomEvent(h.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:i});this.dispatchEvent(a)}};Sn=new WeakMap;Ar.getSlotTemplateHTML=Af;Ar.getTooltipContentHTML=Tf;l.customElements.get("media-fullscreen-button")||l.customElements.define("media-fullscreen-button",Ar);var{MEDIA_TIME_IS_LIVE:In,MEDIA_PAUSED:Tr}=n,{MEDIA_SEEK_TO_LIVE_REQUEST:yf,MEDIA_PLAY_REQUEST:kf}=h,Sf='<svg viewBox="0 0 6 12" aria-hidden="true"><circle cx="3" cy="6" r="2"></circle></svg>';function If(t){return`
|
|
913
922
|
<style>
|
|
914
923
|
:host { --media-tooltip-display: none; }
|
|
915
924
|
|
|
@@ -921,13 +930,13 @@
|
|
|
921
930
|
color: var(--media-live-button-icon-color, rgb(140, 140, 140));
|
|
922
931
|
}
|
|
923
932
|
|
|
924
|
-
:host([${
|
|
925
|
-
:host([${
|
|
933
|
+
:host([${In}]:not([${Tr}])) slot[name=indicator] > *,
|
|
934
|
+
:host([${In}]:not([${Tr}])) ::slotted([slot=indicator]) {
|
|
926
935
|
fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
927
936
|
color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
928
937
|
}
|
|
929
938
|
|
|
930
|
-
:host([${
|
|
939
|
+
:host([${In}]:not([${Tr}])) {
|
|
931
940
|
cursor: var(--media-cursor, not-allowed);
|
|
932
941
|
}
|
|
933
942
|
|
|
@@ -937,10 +946,10 @@
|
|
|
937
946
|
|
|
938
947
|
</style>
|
|
939
948
|
|
|
940
|
-
<slot name="indicator">${
|
|
949
|
+
<slot name="indicator">${Sf}</slot>
|
|
941
950
|
|
|
942
|
-
<slot name="spacer"> </slot><slot name="text">${
|
|
943
|
-
`}var
|
|
951
|
+
<slot name="spacer"> </slot><slot name="text">${c("live")}</slot>
|
|
952
|
+
`}var Xc=t=>{var e;let i=t.mediaPaused||!t.mediaTimeIsLive,a=i?c("seek to live"):c("playing live");t.setAttribute("aria-label",a);let r=(e=t.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');r&&(r.textContent=c("live")),i?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},Mn=class extends B{static get observedAttributes(){return[...super.observedAttributes,In,Tr]}connectedCallback(){super.connectedCallback(),Xc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),Xc(this)}get mediaPaused(){return M(this,n.MEDIA_PAUSED)}set mediaPaused(e){L(this,n.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return M(this,n.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){L(this,n.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new l.CustomEvent(yf,{composed:!0,bubbles:!0})),this.hasAttribute(Tr)&&this.dispatchEvent(new l.CustomEvent(kf,{composed:!0,bubbles:!0})))}};Mn.getSlotTemplateHTML=If;l.customElements.get("media-live-button")||l.customElements.define("media-live-button",Mn);var jc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},yr=(t,e,i)=>(jc(t,e,"read from private field"),i?i.call(t):e.get(t)),Jc=(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)},kr=(t,e,i,a)=>(jc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),nt,Cn,Ln={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},em=500,Mf=`
|
|
944
953
|
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
945
954
|
<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
955
|
<animateTransform
|
|
@@ -953,13 +962,13 @@
|
|
|
953
962
|
repeatCount="indefinite" />
|
|
954
963
|
</path>
|
|
955
964
|
</svg>
|
|
956
|
-
`;function
|
|
965
|
+
`;function Lf(t){return`
|
|
957
966
|
<style>
|
|
958
967
|
:host {
|
|
959
968
|
display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
|
|
960
969
|
vertical-align: middle;
|
|
961
970
|
box-sizing: border-box;
|
|
962
|
-
--_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${
|
|
971
|
+
--_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${em}ms);
|
|
963
972
|
}
|
|
964
973
|
|
|
965
974
|
#status {
|
|
@@ -998,15 +1007,15 @@
|
|
|
998
1007
|
}
|
|
999
1008
|
</style>
|
|
1000
1009
|
|
|
1001
|
-
<slot name="icon">${
|
|
1002
|
-
<div id="status" role="status" aria-live="polite">${
|
|
1003
|
-
`}var
|
|
1010
|
+
<slot name="icon">${Mf}</slot>
|
|
1011
|
+
<div id="status" role="status" aria-live="polite">${c("media loading")}</div>
|
|
1012
|
+
`}var Sr=class extends l.HTMLElement{constructor(){if(super(),Jc(this,nt,void 0),Jc(this,Cn,em),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[D.MEDIA_CONTROLLER,n.MEDIA_PAUSED,n.MEDIA_LOADING,Ln.LOADING_DELAY]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===Ln.LOADING_DELAY&&i!==a?this.loadingDelay=Number(a):e===D.MEDIA_CONTROLLER&&(i&&((o=(r=yr(this,nt))==null?void 0:r.unassociateElement)==null||o.call(r,this),kr(this,nt,null)),a&&this.isConnected&&(kr(this,nt,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=yr(this,nt))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(D.MEDIA_CONTROLLER);r&&(kr(this,nt,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=yr(this,nt))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=yr(this,nt))==null?void 0:e.unassociateElement)==null||i.call(e,this),kr(this,nt,null)}get loadingDelay(){return yr(this,Cn)}set loadingDelay(e){kr(this,Cn,e);let{style:i}=q(this.shadowRoot,":host");i.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return M(this,n.MEDIA_PAUSED)}set mediaPaused(e){L(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return M(this,n.MEDIA_LOADING)}set mediaLoading(e){L(this,n.MEDIA_LOADING,e)}get mediaController(){return x(this,D.MEDIA_CONTROLLER)}set mediaController(e){w(this,D.MEDIA_CONTROLLER,e)}get noAutohide(){return M(this,Ln.NO_AUTOHIDE)}set noAutohide(e){L(this,Ln.NO_AUTOHIDE,e)}};nt=new WeakMap;Cn=new WeakMap;Sr.shadowRootOptions={mode:"open"};Sr.getTemplateHTML=Lf;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",Sr);var Cf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1004
1013
|
<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>`,
|
|
1014
|
+
</svg>`,tm=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1006
1015
|
<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
|
-
</svg>`,
|
|
1016
|
+
</svg>`,wf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1008
1017
|
<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"/>
|
|
1009
|
-
</svg>`;function
|
|
1018
|
+
</svg>`;function Rf(t){return`
|
|
1010
1019
|
<style>
|
|
1011
1020
|
:host(:not([${n.MEDIA_VOLUME_LEVEL}])) slot[name=icon] slot:not([name=high]),
|
|
1012
1021
|
:host([${n.MEDIA_VOLUME_LEVEL}=high]) slot[name=icon] slot:not([name=high]) {
|
|
@@ -1032,17 +1041,17 @@
|
|
|
1032
1041
|
</style>
|
|
1033
1042
|
|
|
1034
1043
|
<slot name="icon">
|
|
1035
|
-
<slot name="off">${
|
|
1036
|
-
<slot name="low">${
|
|
1037
|
-
<slot name="medium">${
|
|
1038
|
-
<slot name="high">${
|
|
1044
|
+
<slot name="off">${Cf}</slot>
|
|
1045
|
+
<slot name="low">${tm}</slot>
|
|
1046
|
+
<slot name="medium">${tm}</slot>
|
|
1047
|
+
<slot name="high">${wf}</slot>
|
|
1039
1048
|
</slot>
|
|
1040
|
-
`}function
|
|
1041
|
-
<slot name="tooltip-mute">${
|
|
1042
|
-
<slot name="tooltip-unmute">${
|
|
1043
|
-
`}var
|
|
1049
|
+
`}function xf(){return`
|
|
1050
|
+
<slot name="tooltip-mute">${c("Mute")}</slot>
|
|
1051
|
+
<slot name="tooltip-unmute">${c("Unmute")}</slot>
|
|
1052
|
+
`}var im=t=>{let i=t.mediaVolumeLevel==="off"?c("unmute"):c("mute");t.setAttribute("aria-label",i)},Ir=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),im(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_VOLUME_LEVEL&&im(this)}get mediaVolumeLevel(){return x(this,n.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){w(this,n.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};Ir.getSlotTemplateHTML=Rf;Ir.getTooltipContentHTML=xf;l.customElements.get("media-mute-button")||l.customElements.define("media-mute-button",Ir);var am=`<svg aria-hidden="true" viewBox="0 0 28 24">
|
|
1044
1053
|
<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
|
-
</svg>`;function
|
|
1054
|
+
</svg>`;function Df(t){return`
|
|
1046
1055
|
<style>
|
|
1047
1056
|
:host([${n.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
|
|
1048
1057
|
display: none !important;
|
|
@@ -1059,25 +1068,25 @@
|
|
|
1059
1068
|
</style>
|
|
1060
1069
|
|
|
1061
1070
|
<slot name="icon">
|
|
1062
|
-
<slot name="enter">${
|
|
1063
|
-
<slot name="exit">${
|
|
1071
|
+
<slot name="enter">${am}</slot>
|
|
1072
|
+
<slot name="exit">${am}</slot>
|
|
1064
1073
|
</slot>
|
|
1065
|
-
`}function
|
|
1066
|
-
<slot name="tooltip-enter">${
|
|
1067
|
-
<slot name="tooltip-exit">${
|
|
1068
|
-
`}var
|
|
1074
|
+
`}function Of(){return`
|
|
1075
|
+
<slot name="tooltip-enter">${c("Enter picture in picture mode")}</slot>
|
|
1076
|
+
<slot name="tooltip-exit">${c("Exit picture in picture mode")}</slot>
|
|
1077
|
+
`}var rm=t=>{let e=t.mediaIsPip?c("exit picture in picture mode"):c("enter picture in picture mode");t.setAttribute("aria-label",e)},Mr=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_PIP,n.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),rm(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_PIP&&rm(this)}get mediaPipUnavailable(){return x(this,n.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){w(this,n.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return M(this,n.MEDIA_IS_PIP)}set mediaIsPip(e){L(this,n.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?h.MEDIA_EXIT_PIP_REQUEST:h.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};Mr.getSlotTemplateHTML=Df;Mr.getTooltipContentHTML=Of;l.customElements.get("media-pip-button")||l.customElements.define("media-pip-button",Mr);var Pf=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},aa=(t,e,i)=>(Pf(t,e,"read from private field"),i?i.call(t):e.get(t)),Nf=(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)},Kt,Bl={RATES:"rates"},$l=[1,1.2,1.5,1.7,2],Ei=1;function Uf(t){return`
|
|
1069
1078
|
<style>
|
|
1070
1079
|
:host {
|
|
1071
1080
|
min-width: 5ch;
|
|
1072
1081
|
padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
|
|
1073
1082
|
}
|
|
1074
1083
|
</style>
|
|
1075
|
-
<slot name="icon">${t.mediaplaybackrate||
|
|
1076
|
-
`}function
|
|
1084
|
+
<slot name="icon">${t.mediaplaybackrate||Ei}x</slot>
|
|
1085
|
+
`}function Hf(){return c("Playback rate")}var Lr=class extends B{constructor(){var e;super(),Nf(this,Kt,new Bt(this,Bl.RATES,{defaultValue:$l})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Ei}x`}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,Bl.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===Bl.RATES&&(aa(this,Kt).value=a),e===n.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,o=Number.isNaN(r)?Ei:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",c("Playback rate {playbackRate}",{playbackRate:o}))}}get rates(){return aa(this,Kt)}set rates(e){e?Array.isArray(e)?aa(this,Kt).value=e.join(" "):typeof e=="string"&&(aa(this,Kt).value=e):aa(this,Kt).value=""}get mediaPlaybackRate(){return P(this,n.MEDIA_PLAYBACK_RATE,Ei)}set mediaPlaybackRate(e){U(this,n.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,i;let a=Array.from(aa(this,Kt).values(),s=>+s).sort((s,d)=>s-d),r=(i=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?i:Ei,o=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(o)}};Kt=new WeakMap;Lr.getSlotTemplateHTML=Uf;Lr.getTooltipContentHTML=Hf;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",Lr);var Bf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1077
1086
|
<path d="m6 21 15-9L6 3v18Z"/>
|
|
1078
|
-
</svg
|
|
1087
|
+
</svg>`,$f=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1079
1088
|
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
1080
|
-
</svg>`;function
|
|
1089
|
+
</svg>`;function Wf(t){return`
|
|
1081
1090
|
<style>
|
|
1082
1091
|
:host([${n.MEDIA_PAUSED}]) slot[name=pause],
|
|
1083
1092
|
:host(:not([${n.MEDIA_PAUSED}])) slot[name=play] {
|
|
@@ -1091,13 +1100,13 @@
|
|
|
1091
1100
|
</style>
|
|
1092
1101
|
|
|
1093
1102
|
<slot name="icon">
|
|
1094
|
-
<slot name="play">${
|
|
1095
|
-
<slot name="pause">${
|
|
1103
|
+
<slot name="play">${Bf}</slot>
|
|
1104
|
+
<slot name="pause">${$f}</slot>
|
|
1096
1105
|
</slot>
|
|
1097
|
-
`}function
|
|
1098
|
-
<slot name="tooltip-play">${
|
|
1099
|
-
<slot name="tooltip-pause">${
|
|
1100
|
-
`}var
|
|
1106
|
+
`}function Ff(){return`
|
|
1107
|
+
<slot name="tooltip-play">${c("Play")}</slot>
|
|
1108
|
+
<slot name="tooltip-pause">${c("Pause")}</slot>
|
|
1109
|
+
`}var om=t=>{let e=t.mediaPaused?c("play"):c("pause");t.setAttribute("aria-label",e)},Cr=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),om(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_PAUSED||e===n.MEDIA_LANG)&&om(this)}get mediaPaused(){return M(this,n.MEDIA_PAUSED)}set mediaPaused(e){L(this,n.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};Cr.getSlotTemplateHTML=Wf;Cr.getTooltipContentHTML=Ff;l.customElements.get("media-play-button")||l.customElements.define("media-play-button",Cr);var st={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function Vf(t){return`
|
|
1101
1110
|
<style>
|
|
1102
1111
|
:host {
|
|
1103
1112
|
pointer-events: none;
|
|
@@ -1119,7 +1128,7 @@
|
|
|
1119
1128
|
</style>
|
|
1120
1129
|
|
|
1121
1130
|
<img part="poster img" aria-hidden="true" id="image"/>
|
|
1122
|
-
`}var
|
|
1131
|
+
`}var Kf=t=>{t.style.removeProperty("background-image")},Gf=(t,e)=>{t.style["background-image"]=`url('${e}')`},wr=class extends l.HTMLElement{static get observedAttributes(){return[st.PLACEHOLDER_SRC,st.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===st.SRC&&(a==null?this.image.removeAttribute(st.SRC):this.image.setAttribute(st.SRC,a)),e===st.PLACEHOLDER_SRC&&(a==null?Kf(this.image):Gf(this.image,a))}get placeholderSrc(){return x(this,st.PLACEHOLDER_SRC)}set placeholderSrc(e){w(this,st.SRC,e)}get src(){return x(this,st.SRC)}set src(e){w(this,st.SRC,e)}};wr.shadowRootOptions={mode:"open"};wr.getTemplateHTML=Vf;l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",wr);var nm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Yf=(t,e,i)=>(nm(t,e,"read from private field"),i?i.call(t):e.get(t)),qf=(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)},Zf=(t,e,i,a)=>(nm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),wn,Wl=class extends Te{constructor(){super(),qf(this,wn,void 0),Zf(this,wn,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(Yf(this,wn).textContent=a,a!==""){let r=c("chapter: {chapterName}",{chapterName:a});this.setAttribute("aria-valuetext",r)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return x(this,n.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){w(this,n.MEDIA_PREVIEW_CHAPTER,e)}};wn=new WeakMap;l.customElements.get("media-preview-chapter-display")||l.customElements.define("media-preview-chapter-display",Wl);var sm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Rn=(t,e,i)=>(sm(t,e,"read from private field"),i?i.call(t):e.get(t)),zf=(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)},xn=(t,e,i,a)=>(sm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),lt;function Qf(t){return`
|
|
1123
1132
|
<style>
|
|
1124
1133
|
:host {
|
|
1125
1134
|
box-sizing: border-box;
|
|
@@ -1133,27 +1142,27 @@
|
|
|
1133
1142
|
}
|
|
1134
1143
|
</style>
|
|
1135
1144
|
<img crossorigin loading="eager" decoding="async">
|
|
1136
|
-
`}var
|
|
1145
|
+
`}var ra=class extends l.HTMLElement{constructor(){if(super(),zf(this,lt,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[D.MEDIA_CONTROLLER,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(D.MEDIA_CONTROLLER);r&&(xn(this,lt,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=Rn(this,lt))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=Rn(this,lt))==null?void 0:e.unassociateElement)==null||i.call(e,this),xn(this,lt,null)}attributeChangedCallback(e,i,a){var r,o,s,d,u;[n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===D.MEDIA_CONTROLLER&&(i&&((o=(r=Rn(this,lt))==null?void 0:r.unassociateElement)==null||o.call(r,this),xn(this,lt,null)),a&&this.isConnected&&(xn(this,lt,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=Rn(this,lt))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return x(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){w(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:v,maxHeight:y,minWidth:A,minHeight:E}=u,p=u.getPropertyValue("--media-preview-thumbnail-object-fit").trim()||"contain",k,g;if(p==="fill"){let Ce=parseInt(v)/o,we=parseInt(y)/s,Pt=parseInt(A)/o,Qe=parseInt(E)/s;k=Ce<1?Ce:Math.max(Ce,Pt),g=we<1?we:Math.max(we,Qe)}else{let Ce=Math.min(parseInt(v)/o,parseInt(y)/s),we=Math.max(parseInt(A)/o,parseInt(E)/s),Qe=Ce<1?Ce:we>1?we:1;k=Qe,g=Qe}let{style:S}=q(this.shadowRoot,":host"),C=q(this.shadowRoot,"img").style,j=this.shadowRoot.querySelector("img"),Ot=Math.min(k,g)<1?"min":"max";S.setProperty(`${Ot}-width`,"initial","important"),S.setProperty(`${Ot}-height`,"initial","important"),S.width=`${o*k}px`,S.height=`${s*g}px`;let bt=()=>{C.width=`${this.imgWidth*k}px`,C.height=`${this.imgHeight*g}px`,C.display="block"};j.src!==d&&(j.onload=()=>{this.imgWidth=j.naturalWidth,this.imgHeight=j.naturalHeight,bt(),j.onload=null},j.src=d,bt()),bt(),C.transform=`translate(-${a*k}px, -${r*g}px)`}};lt=new WeakMap;ra.shadowRootOptions={mode:"open"};ra.getTemplateHTML=Qf;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",ra);var Dn=ra;var dm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},lm=(t,e,i)=>(dm(t,e,"read from private field"),i?i.call(t):e.get(t)),Xf=(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)},Jf=(t,e,i,a)=>(dm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Rr,Fl=class extends Te{constructor(){super(),Xf(this,Rr,void 0),Jf(this,Rr,this.shadowRoot.querySelector("slot")),lm(this,Rr).textContent=$e(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&&(lm(this,Rr).textContent=$e(parseFloat(a)))}get mediaPreviewTime(){return P(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){U(this,n.MEDIA_PREVIEW_TIME,e)}};Rr=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",Fl);var oa={SEEK_OFFSET:"seekoffset"},Vl=30,jf=t=>`
|
|
1137
1146
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1138
1147
|
<defs>
|
|
1139
1148
|
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
1140
1149
|
</defs>
|
|
1141
1150
|
<text class="text value" transform="translate(2.18 19.87)">${t}</text>
|
|
1142
1151
|
<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
|
-
</svg>`;function
|
|
1144
|
-
<slot name="icon">${
|
|
1145
|
-
`}function
|
|
1152
|
+
</svg>`;function ev(t,e){return`
|
|
1153
|
+
<slot name="icon">${jf(e.seekOffset)}</slot>
|
|
1154
|
+
`}var tv=(t,e)=>{t.setAttribute("aria-label",c("seek back {seekOffset} seconds",{seekOffset:e}))};function iv(){return c("Seek backward")}var av=0,xr=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,oa.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=P(this,oa.SEEK_OFFSET,Vl)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),tv(this,this.seekOffset),e===oa.SEEK_OFFSET&&(this.seekOffset=P(this,oa.SEEK_OFFSET,Vl))}get seekOffset(){return P(this,oa.SEEK_OFFSET,Vl)}set seekOffset(e){U(this,oa.SEEK_OFFSET,e),this.setAttribute("aria-label",c("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),xo(Do(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return P(this,n.MEDIA_CURRENT_TIME,av)}set mediaCurrentTime(e){U(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),i=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};xr.getSlotTemplateHTML=ev;xr.getTooltipContentHTML=iv;l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",xr);var na={SEEK_OFFSET:"seekoffset"},Kl=30,rv=t=>`
|
|
1146
1155
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1147
1156
|
<defs>
|
|
1148
1157
|
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
1149
1158
|
</defs>
|
|
1150
1159
|
<text class="text value" transform="translate(8.9 19.87)">${t}</text>
|
|
1151
1160
|
<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
|
-
</svg>`;function
|
|
1153
|
-
<slot name="icon">${
|
|
1154
|
-
`}function
|
|
1155
|
-
<slot>${
|
|
1156
|
-
`}var
|
|
1161
|
+
</svg>`;function ov(t,e){return`
|
|
1162
|
+
<slot name="icon">${rv(e.seekOffset)}</slot>
|
|
1163
|
+
`}var nv=(t,e)=>{t.setAttribute("aria-label",c("seek forward {seekOffset} seconds",{seekOffset:e}))};function sv(){return c("Seek forward")}var lv=0,Dr=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,na.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=P(this,na.SEEK_OFFSET,Kl)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),nv(this,this.seekOffset),e===na.SEEK_OFFSET&&(this.seekOffset=P(this,na.SEEK_OFFSET,Kl))}get seekOffset(){return P(this,na.SEEK_OFFSET,Kl)}set seekOffset(e){U(this,na.SEEK_OFFSET,e),this.setAttribute("aria-label",c("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),xo(Do(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return P(this,n.MEDIA_CURRENT_TIME,lv)}set mediaCurrentTime(e){U(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,i=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Dr.getSlotTemplateHTML=ov;Dr.getTooltipContentHTML=sv;l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",Dr);var ql=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},qe=(t,e,i)=>(ql(t,e,"read from private field"),i?i.call(t):e.get(t)),bi=(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)},Zl=(t,e,i,a)=>(ql(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Yt=(t,e,i)=>(ql(t,e,"access private method"),i),sa,dt,Hn,zl,cm,Nn,Ql,Or,On,Pn,Gl,Gt={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},um=[...Object.values(Gt),n.MEDIA_CURRENT_TIME,n.MEDIA_DURATION,n.MEDIA_SEEKABLE],mm=["Enter"," "],dv=" / ",Yl=(t,{timesSep:e=dv}={})=>{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?$e(0-(s-r)):$e(r);return t.showDuration?`${d}${e}${$e(s)}`:d},uv=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",c("video not loaded, unknown time."));return}let o=t.remaining?oi(0-(r-i)):oi(i);if(!t.showDuration){t.setAttribute("aria-valuetext",o);return}let s=oi(r),d=c("{currentTime} of {totalTime}",{currentTime:o,totalTime:s});t.setAttribute("aria-valuetext",d)};function cv(t,e){return`
|
|
1164
|
+
<slot>${Yl(e)}</slot>
|
|
1165
|
+
`}var mv=t=>{t.setAttribute("aria-label",c("playback time"))},Un=class extends Te{constructor(){super(),bi(this,zl),bi(this,Nn),bi(this,Or),bi(this,Pn),bi(this,sa,void 0),bi(this,dt,null),bi(this,Hn,e=>{let{metaKey:i,altKey:a,key:r}=e;if(i||a||!mm.includes(r)){this.removeEventListener("keyup",qe(this,dt));return}this.addEventListener("keyup",qe(this,dt))}),Zl(this,sa,this.shadowRoot.querySelector("slot")),qe(this,sa).innerHTML=`${Yl(this)}`}static get observedAttributes(){return[...super.observedAttributes,...um,"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.setAttribute("aria-label",c("playback time")),Yt(this,Or,On).call(this),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),Yt(this,Nn,Ql).call(this),super.disconnectedCallback()}attributeChangedCallback(e,i,a){mv(this),um.includes(e)?this.update():e==="disabled"&&a!==i?a==null?Yt(this,Or,On).call(this):Yt(this,Pn,Gl).call(this):e===Gt.NO_TOGGLE&&a!==i&&(this.noToggle?Yt(this,Pn,Gl).call(this):Yt(this,Or,On).call(this)),super.attributeChangedCallback(e,i,a)}enable(){this.noToggle||(this.tabIndex=0)}disable(){this.tabIndex=-1}get remaining(){return M(this,Gt.REMAINING)}set remaining(e){L(this,Gt.REMAINING,e)}get showDuration(){return M(this,Gt.SHOW_DURATION)}set showDuration(e){L(this,Gt.SHOW_DURATION,e)}get noToggle(){return M(this,Gt.NO_TOGGLE)}set noToggle(e){L(this,Gt.NO_TOGGLE,e)}get mediaDuration(){return P(this,n.MEDIA_DURATION)}set mediaDuration(e){U(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return P(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){U(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=Yl(this);uv(this),e!==qe(this,sa).innerHTML&&(qe(this,sa).innerHTML=e)}};sa=new WeakMap;dt=new WeakMap;Hn=new WeakMap;zl=new WeakSet;cm=function(){qe(this,dt)||(Zl(this,dt,t=>{let{key:e}=t;if(!mm.includes(e)){this.removeEventListener("keyup",qe(this,dt));return}this.toggleTimeDisplay()}),this.addEventListener("keydown",qe(this,Hn)),this.addEventListener("click",this.toggleTimeDisplay))};Nn=new WeakSet;Ql=function(){qe(this,dt)&&(this.removeEventListener("keyup",qe(this,dt)),this.removeEventListener("keydown",qe(this,Hn)),this.removeEventListener("click",this.toggleTimeDisplay),Zl(this,dt,null))};Or=new WeakSet;On=function(){!this.noToggle&&!this.hasAttribute("disabled")&&(this.setAttribute("role","button"),this.enable(),Yt(this,zl,cm).call(this))};Pn=new WeakSet;Gl=function(){this.removeAttribute("role"),this.disable(),Yt(this,Nn,Ql).call(this)};Un.getSlotTemplateHTML=cv;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",Un);var hm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},le=(t,e,i)=>(hm(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)},Me=(t,e,i,a)=>(hm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),hv=(t,e,i,a)=>({set _(r){Me(t,e,r,i)},get _(){return le(t,e,a)}}),la,Bn,da,Pr,$n,Wn,Fn,ua,gi,Vn,Kn=class{constructor(e,i,a){ut(this,la,void 0),ut(this,Bn,void 0),ut(this,da,void 0),ut(this,Pr,void 0),ut(this,$n,void 0),ut(this,Wn,void 0),ut(this,Fn,void 0),ut(this,ua,void 0),ut(this,gi,0),ut(this,Vn,(r=performance.now())=>{Me(this,gi,requestAnimationFrame(le(this,Vn))),Me(this,Pr,performance.now()-le(this,da));let o=1e3/this.fps;if(le(this,Pr)>o){Me(this,da,r-le(this,Pr)%o);let s=1e3/((r-le(this,Bn))/++hv(this,$n)._),d=(r-le(this,Wn))/1e3/this.duration,u=le(this,Fn)+d*this.playbackRate;u-le(this,la).valueAsNumber>0?Me(this,ua,this.playbackRate/this.duration/s):(Me(this,ua,.995*le(this,ua)),u=le(this,la).valueAsNumber+le(this,ua)),this.callback(u)}}),Me(this,la,e),this.callback=i,this.fps=a}start(){le(this,gi)===0&&(Me(this,da,performance.now()),Me(this,Bn,le(this,da)),Me(this,$n,0),le(this,Vn).call(this))}stop(){le(this,gi)!==0&&(cancelAnimationFrame(le(this,gi)),Me(this,gi,0))}update({start:e,duration:i,playbackRate:a}){let r=e-le(this,la).valueAsNumber,o=Math.abs(i-this.duration);(r>0||r<-.03||o>=.5)&&this.callback(e),Me(this,Fn,e),Me(this,Wn,performance.now()),this.duration=i,this.playbackRate=a}};la=new WeakMap;Bn=new WeakMap;da=new WeakMap;Pr=new WeakMap;$n=new WeakMap;Wn=new WeakMap;Fn=new WeakMap;ua=new WeakMap;gi=new WeakMap;Vn=new WeakMap;var td=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},z=(t,e,i)=>(td(t,e,"read from private field"),i?i.call(t):e.get(t)),oe=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},xe=(t,e,i,a)=>(td(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),De=(t,e,i)=>(td(t,e,"access private method"),i),ca,qt,qn,Ur,Zn,Yn,Hr,Br,ma,ha,Nr,Xl,pm,Jl,zn,id,Qn,ad,Xn,rd,jl,fm,$r,Jn,ed,vm,pv=t=>{let e=t.range,i=oi(+Em(t)),a=oi(+t.mediaSeekableEnd),r=i&&a?c("{currentTime} of {totalTime}",{currentTime:i,totalTime:a}):c("video not loaded, unknown time.");e.setAttribute("aria-valuetext",r)};function fv(t){return`
|
|
1157
1166
|
<style>
|
|
1158
1167
|
:host {
|
|
1159
1168
|
--media-box-border-radius: 4px;
|
|
@@ -1356,8 +1365,8 @@
|
|
|
1356
1365
|
<div id="preview-rail">
|
|
1357
1366
|
<slot name="preview" part="box preview-box">
|
|
1358
1367
|
<media-preview-thumbnail>
|
|
1359
|
-
<template shadowrootmode="${
|
|
1360
|
-
${
|
|
1368
|
+
<template shadowrootmode="${Dn.shadowRootOptions.mode}">
|
|
1369
|
+
${Dn.getTemplateHTML({})}
|
|
1361
1370
|
</template>
|
|
1362
1371
|
</media-preview-thumbnail>
|
|
1363
1372
|
<media-preview-chapter-display></media-preview-chapter-display>
|
|
@@ -1370,7 +1379,7 @@
|
|
|
1370
1379
|
|
|
1371
1380
|
</slot>
|
|
1372
1381
|
</div>
|
|
1373
|
-
`}var
|
|
1382
|
+
`}var Gn=(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))},Em=(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},Wr=class extends at{constructor(){super(),oe(this,Xl),oe(this,zn),oe(this,Qn),oe(this,Xn),oe(this,jl),oe(this,$r),oe(this,ed),oe(this,ca,null),oe(this,qt,void 0),oe(this,qn,void 0),oe(this,Ur,void 0),oe(this,Zn,void 0),oe(this,Yn,void 0),oe(this,Hr,void 0),oe(this,Br,void 0),oe(this,ma,void 0),oe(this,ha,void 0),oe(this,Nr,()=>{De(this,Xl,pm).call(this)?z(this,qt).start():z(this,qt).stop()}),oe(this,Jl,a=>{this.dragging||(Hi(a)&&(this.range.valueAsNumber=a),z(this,ha)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),xe(this,qn,this.shadowRoot.querySelectorAll('[part~="box"]')),xe(this,Zn,this.shadowRoot.querySelector('[part~="preview-box"]')),xe(this,Yn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);xe(this,Hr,parseInt(i.getPropertyValue("--media-box-padding-left"))),xe(this,Br,parseInt(i.getPropertyValue("--media-box-padding-right"))),xe(this,qt,new Kn(this.range,z(this,Jl),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",c("seek")),z(this,Nr).call(this),xe(this,ca,this.getRootNode()),(e=z(this,ca))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),z(this,qt).stop(),(e=z(this,ca))==null||e.removeEventListener("transitionstart",this),xe(this,ca,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?(z(this,qt).update({start:Gn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),z(this,Nr).call(this),pv(this)):e===n.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=z(this,ma),this.updateBar()))}get mediaChaptersCues(){return z(this,ma)}set mediaChaptersCues(e){var i;xe(this,ma,e),this.updateSegments((i=z(this,ma))==null?void 0:i.map(a=>({start:Gn(this,a.startTime),end:Gn(this,a.endTime)})))}get mediaPaused(){return M(this,n.MEDIA_PAUSED)}set mediaPaused(e){L(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return M(this,n.MEDIA_LOADING)}set mediaLoading(e){L(this,n.MEDIA_LOADING,e)}get mediaDuration(){return P(this,n.MEDIA_DURATION)}set mediaDuration(e){U(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return P(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){U(this,n.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return P(this,n.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){U(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 x(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){w(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return P(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){U(this,n.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return M(this,n.MEDIA_ENDED)}set mediaEnded(e){L(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=Gn(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,zn,id).call(this,z(this,Yn)),o=De(this,Qn,ad).call(this,r,this.range.valueAsNumber),s=De(this,Xn,rd).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,ed,vm).call(this);break;case"pointermove":De(this,jl,fm).call(this,e);break;case"pointerup":z(this,ha)&&xe(this,ha,!1);break;case"pointerdown":xe(this,ha,!0);break;case"pointerleave":De(this,$r,Jn).call(this,null);break;case"transitionstart":he(e.target,this)&&setTimeout(()=>z(this,Nr).call(this),0);break}}};ca=new WeakMap;qt=new WeakMap;qn=new WeakMap;Ur=new WeakMap;Zn=new WeakMap;Yn=new WeakMap;Hr=new WeakMap;Br=new WeakMap;ma=new WeakMap;ha=new WeakMap;Nr=new WeakMap;Xl=new WeakSet;pm=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Oo(this)};Jl=new WeakMap;zn=new WeakSet;id=function(t){var e;let a=((e=this.getAttribute("bounds")?Xe(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}};Qn=new WeakSet;ad=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;rd=function(t,e){let{width:i,min:a,max:r}=t.box,o=e*t.range.width;if(o<a+z(this,Hr)){let s=t.range.left-t.bounds.left-z(this,Hr);return`${o-i/2+s}px`}if(o>r-z(this,Br)){let s=t.bounds.right-t.range.right-z(this,Br);return`${o+i/2-s-t.range.width}px`}return 0};jl=new WeakSet;fm=function(t){let e=[...z(this,qn)].some(y=>t.composedPath().includes(y));if(!this.dragging&&(e||!t.composedPath().includes(this))){De(this,$r,Jn).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,zn,id).call(this,z(this,Zn)),s=(t.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let d=De(this,Qn,ad).call(this,o,s),u=De(this,Xn,rd).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 v=Math.round(z(this,Ur))-Math.round(s*i);Math.abs(v)<1&&s>.01&&s<.99||(xe(this,Ur,s*i),De(this,$r,Jn).call(this,z(this,Ur)))};$r=new WeakSet;Jn=function(t){this.dispatchEvent(new l.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};ed=new WeakSet;vm=function(){z(this,qt).stop();let t=Em(this);this.dispatchEvent(new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Wr.shadowRootOptions={mode:"open"};Wr.getContainerTemplateHTML=fv;l.customElements.get("media-time-range")||l.customElements.define("media-time-range",Wr);var vv=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bm=(t,e,i)=>(vv(t,e,"read from private field"),i?i.call(t):e.get(t)),Ev=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},jn,bv=1,gv=t=>t.mediaMuted?0:t.mediaVolume,_v=t=>`${Math.round(t*100)}%`,od=class extends at{constructor(){super(...arguments),Ev(this,jn,()=>{let e=this.range.value,i=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME,n.MEDIA_MUTED,n.MEDIA_VOLUME_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",c("volume")),this.range.addEventListener("input",bm(this,jn))}disconnectedCallback(){this.range.removeEventListener("input",bm(this,jn)),super.disconnectedCallback()}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_VOLUME||e===n.MEDIA_MUTED)&&(this.range.valueAsNumber=gv(this),this.range.setAttribute("aria-valuetext",_v(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return P(this,n.MEDIA_VOLUME,bv)}set mediaVolume(e){U(this,n.MEDIA_VOLUME,e)}get mediaMuted(){return M(this,n.MEDIA_MUTED)}set mediaMuted(e){L(this,n.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return x(this,n.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){w(this,n.MEDIA_VOLUME_UNAVAILABLE,e)}};jn=new WeakMap;l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",od);function Av(t){return`
|
|
1374
1383
|
<style>
|
|
1375
1384
|
:host {
|
|
1376
1385
|
min-width: 4ch;
|
|
@@ -1399,8 +1408,8 @@
|
|
|
1399
1408
|
<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
1409
|
</svg>
|
|
1401
1410
|
</div>
|
|
1402
|
-
`}function
|
|
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=`
|
|
1411
|
+
`}function Tv(){return c("Loop")}var Fr=class extends B{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=c("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 M(this,n.MEDIA_LOOP)}set mediaLoop(e){L(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(h.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Fr.getSlotTemplateHTML=Av;Fr.getTooltipContentHTML=Tv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",Fr);var b=require("@mux/mux-video/base"),O=require("@mux/playback-core");var km=require("@mux/playback-core");var Ti=require("@mux/playback-core");function gm(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${es(i)}: ${a}; `)}),e?e.trim():void 0}function es(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ts(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function fe(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function nd(t){let e=yv(t).toString();return e?"?"+e:""}function yv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var sd=(t,e)=>!t||!e?!1:t.contains(e)?!0:sd(t,e.getRootNode().host);var _m="mux.com",kv=()=>{try{return"3.11.6"}catch{}return"UNKNOWN"},Sv=kv(),as=()=>Sv,Am=(t,{token:e,customDomain:i=_m,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,Ti.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${nd({token:e,time:o,program_time:r})}`},Tm=(t,{token:e,customDomain:i=_m,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,Ti.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${nd({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Vr=t=>{if(t){if([Ti.StreamTypes.LIVE,Ti.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Ti.StreamTypes.LIVE}};var Iv={crossorigin:"crossOrigin",playsinline:"playsInline"};function ym(t){var e;return(e=Iv[t])!=null?e:ts(t)}var _i,Ai,ve,is=class{constructor(e,i){ae(this,_i);ae(this,Ai);ae(this,ve,[]);de(this,_i,e),de(this,Ai,i)}[Symbol.iterator](){return R(this,ve).values()}get length(){return R(this,ve).length}get value(){var e;return(e=R(this,ve).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(de(this,ve,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return R(this,ve)[e]}values(){return R(this,ve).values()}keys(){return R(this,ve).keys()}forEach(e){R(this,ve).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||R(this,ve).push(r)}),!(this.value===""&&!((i=R(this,_i))!=null&&i.hasAttribute(`${R(this,Ai)}`)))&&((a=R(this,_i))==null||a.setAttribute(`${R(this,Ai)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{R(this,ve).splice(R(this,ve).indexOf(a),1)}),(i=R(this,_i))==null||i.setAttribute(`${R(this,Ai)}`,`${this.value}`)}contains(e){return R(this,ve).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)}};_i=new WeakMap,Ai=new WeakMap,ve=new WeakMap;var Sm=`[mux-player ${as()}]`;function ct(...t){console.warn(Sm,...t)}function Ee(...t){console.error(Sm,...t)}function ld(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,km.i18n)("Read more: ")}
|
|
1412
|
+
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),ct(e)}var me={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Zt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},RA={...me,...Zt},Mm=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}}),Mv=Object.values(me).filter(t=>me.PLAYSINLINE!==t),Lv=Object.values(Zt),Cv=[...Mv,...Lv],dd=class extends Se.HTMLElement{static get observedAttributes(){return Cv}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case Zt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Zt.VOLUME:{let s=(r=fe(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Zt.PLAYBACKRATE:{let s=(o=fe(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:Mm}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Mm}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=fe(this.getAttribute(Zt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Zt.PLAYBACKRATE,`${e}`):this.removeAttribute(Zt.PLAYBACKRATE)}get crossOrigin(){return Kr(this,me.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(me.CROSSORIGIN,`${e}`)}get autoplay(){return Kr(this,me.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(me.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(me.AUTOPLAY)}get loop(){return Kr(this,me.LOOP)!=null}set loop(e){e?this.setAttribute(me.LOOP,""):this.removeAttribute(me.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 Kr(this,me.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(me.MUTED,""):this.removeAttribute(me.MUTED)}get playsInline(){return Kr(this,me.PLAYSINLINE)!=null}set playsInline(e){Ee("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(me.PRELOAD,e):this.removeAttribute(me.PRELOAD)}};function Kr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var ud=dd;var xm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},N=(t,e,i)=>(xm(t,e,"read from private field"),i?i.call(t):e.get(t)),mt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},It=(t,e,i,a)=>(xm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),pa,rs,yi,Gr,zt,Qt,Xt,ki,fa,os,Ze,Lm=1,Cm=0,wv=1,Rv={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 be&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof be?r.element[r.attributeName]=o:r.value=o}}}},Mt=class extends l.DocumentFragment{constructor(e,i,a=Rv){var r;super(),mt(this,pa,void 0),mt(this,rs,void 0),this.append(e.content.cloneNode(!0)),It(this,pa,Dm(this)),It(this,rs,a),(r=a.createCallback)==null||r.call(a,this,N(this,pa),i),a.processCallback(this,N(this,pa),i)}update(e){N(this,rs).processCallback(this,N(this,pa),e)}};pa=new WeakMap;rs=new WeakMap;var Dm=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new cd;for([i,a]of Rm(r.value))if(!i)o.append(a);else{let s=new be(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===Lm&&!(r instanceof HTMLTemplateElement))Dm(r,e);else{let o=r.data;if(r.nodeType===Lm||o.includes("{{")){let s=[];if(o)for([i,a]of Rm(o))if(!i)s.push(new Text(a));else{let d=new Lt(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new Yr(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},wm={},Rm=t=>{let e="",i=0,a=wm[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([Cm,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([wv,e.trim()]),e="",r++):e+=o||"";return e&&a.push([Cm,(i>0?"{{":"")+e]),wm[t]=a},xv=11,ns=class{get value(){return""}set value(e){}toString(){return this.value}},Om=new WeakMap,cd=class{constructor(){mt(this,yi,[])}[Symbol.iterator](){return N(this,yi).values()}get length(){return N(this,yi).length}item(e){return N(this,yi)[e]}append(...e){for(let i of e)i instanceof be&&Om.set(i,this),N(this,yi).push(i)}toString(){return N(this,yi).join("")}};yi=new WeakMap;var be=class extends ns{constructor(e,i,a){super(),mt(this,ki),mt(this,Gr,""),mt(this,zt,void 0),mt(this,Qt,void 0),mt(this,Xt,void 0),It(this,zt,e),It(this,Qt,i),It(this,Xt,a)}get attributeName(){return N(this,Qt)}get attributeNamespace(){return N(this,Xt)}get element(){return N(this,zt)}get value(){return N(this,Gr)}set value(e){N(this,Gr)!==e&&(It(this,Gr,e),!N(this,ki,fa)||N(this,ki,fa).length===1?e==null?N(this,zt).removeAttributeNS(N(this,Xt),N(this,Qt)):N(this,zt).setAttributeNS(N(this,Xt),N(this,Qt),e):N(this,zt).setAttributeNS(N(this,Xt),N(this,Qt),N(this,ki,fa).toString()))}get booleanValue(){return N(this,zt).hasAttributeNS(N(this,Xt),N(this,Qt))}set booleanValue(e){if(!N(this,ki,fa)||N(this,ki,fa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Gr=new WeakMap;zt=new WeakMap;Qt=new WeakMap;Xt=new WeakMap;ki=new WeakSet;fa=function(){return Om.get(this)};var Lt=class extends ns{constructor(e,i){super(),mt(this,os,void 0),mt(this,Ze,void 0),It(this,os,e),It(this,Ze,i?[...i]:[new Text])}get replacementNodes(){return N(this,Ze)}get parentNode(){return N(this,os)}get nextSibling(){return N(this,Ze)[N(this,Ze).length-1].nextSibling}get previousSibling(){return N(this,Ze)[0].previousSibling}get value(){return N(this,Ze).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===xv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),It(this,Ze,Dv(N(this,Ze)[0].parentNode,N(this,Ze),i,this.nextSibling))}};os=new WeakMap;Ze=new WeakMap;var Yr=class extends Lt{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 Dv(t,e,i,a=null){let r=0,o,s,d,u=i.length,v=e.length;for(;r<u&&r<v&&e[r]==i[r];)r++;for(;r<u&&r<v&&i[u-1]==e[v-1];)a=i[--v,--u];if(r==v)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<v;)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)},ls=class{constructor(e){this.template=e,this.state=void 0}},Si=new WeakMap,Ii=new WeakMap,md={partial:(t,e)=>{e[t.expression]=new ls(t.template)},if:(t,e)=>{var i;if(Um(t.expression,e))if(Si.get(t)!==t.template){Si.set(t,t.template);let a=new Mt(t.template,e,ds);t.replace(a),Ii.set(t,a)}else(i=Ii.get(t))==null||i.update(e);else t.replace(""),Si.delete(t),Ii.delete(t)}},Ov=Object.keys(md),ds={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof Yr){if(!s.directive){let u=Ov.find(v=>s.template.hasAttribute(v));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=md[s.directive])==null||a.call(md,s,i);continue}let d=Um(o,i);if(d instanceof ls){Si.get(s)!==d.template?(Si.set(s,d.template),d=new Mt(d.template,d.state,ds),s.value=d,Ii.set(s,d)):(r=Ii.get(s))==null||r.update(d.state);continue}d?(s instanceof be&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof be?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,Si.delete(s),Ii.delete(s))):s instanceof be?s.value=void 0:(s.value=void 0,Si.delete(s),Ii.delete(s))}}},Nm={"!":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 Nv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Um(t,e={}){var i,a,r,o,s,d,u;let v=Pv(t);if(v.length===0||v.some(({type:y})=>!y))return qr(t);if(((i=v[0])==null?void 0:i.token)===">"){let y=e[(a=v[1])==null?void 0:a.token];if(!y)return qr(t);let A={...e};y.state=A;let E=v.slice(2);for(let p=0;p<E.length;p+=3){let k=(r=E[p])==null?void 0:r.token,g=(o=E[p+1])==null?void 0:o.token,S=(s=E[p+2])==null?void 0:s.token;k&&g==="="&&(A[k]=Zr(S,e))}return y}if(v.length===1)return ss(v[0])?Zr(v[0].token,e):qr(t);if(v.length===2){let y=(d=v[0])==null?void 0:d.token,A=Nm[y];if(!A||!ss(v[1]))return qr(t);let E=Zr(v[1].token,e);return A(E)}if(v.length===3){let y=(u=v[1])==null?void 0:u.token,A=Nm[y];if(!A||!ss(v[0])||!ss(v[2]))return qr(t);let E=Zr(v[0].token,e);if(y==="|")return A(E,v[2].token);let p=Zr(v[2].token,e);return A(E,p)}}function qr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function ss({type:t}){return["number","boolean","string","param"].includes(t)}function Zr(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):Io(t)?parseFloat(t):e[t]}function Nv(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 Ed=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Jt=(t,e,i)=>(Ed(t,e,"read from private field"),i?i.call(t):e.get(t)),Mi=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ct=(t,e,i,a)=>(Ed(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),hd=(t,e,i)=>(Ed(t,e,"access private method"),i),Ea,us,ba,va,fd,Hm,cs,vd,zr,pd={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Bm=V.createElement("template");Bm.innerHTML=`
|
|
1404
1413
|
<style>
|
|
1405
1414
|
:host {
|
|
1406
1415
|
display: inline-block;
|
|
@@ -1427,7 +1436,7 @@ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),at(e)}var le={AU
|
|
|
1427
1436
|
display: none;
|
|
1428
1437
|
}
|
|
1429
1438
|
</style>
|
|
1430
|
-
`;var
|
|
1439
|
+
`;var Li=class extends l.HTMLElement{constructor(){super(),Mi(this,fd),Mi(this,cs),Mi(this,Ea,void 0),Mi(this,us,void 0),Mi(this,ba,void 0),Mi(this,va,void 0),Mi(this,zr,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer()),Ct(this,va,new MutationObserver(e=>{var i;this.mediaController&&!((i=this.mediaController)!=null&&i.breakpointsComputed)||e.some(a=>{let r=a.target;return r===this?!0:r.localName!=="media-controller"?!1:!!(pd[a.attributeName]||a.attributeName.startsWith("breakpoint"))})&&this.render()})),Ct(this,zr,this.render.bind(this)),hd(this,fd,Hm).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Jt(this,Ea))!=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&&(Ct(this,Ea,e),Ct(this,ba,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})=>pd[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],o={};for(let s of r){let d=(a=pd[s.name])!=null?a:Hu(s.name),{value:u}=s;u!=null?(Io(u)&&(u=parseFloat(u)),o[d]=u===""?!0:u):o[d]=!1}return o}attributeChangedCallback(e,i,a){e==="template"&&i!=a&&hd(this,cs,vd).call(this)}connectedCallback(){this.addEventListener(Ie.BREAKPOINTS_COMPUTED,Jt(this,zr)),Jt(this,va).observe(this,{attributes:!0}),Jt(this,va).observe(this.renderRoot,{attributes:!0,subtree:!0}),hd(this,cs,vd).call(this)}disconnectedCallback(){this.removeEventListener(Ie.BREAKPOINTS_COMPUTED,Jt(this,zr)),Jt(this,va).disconnect()}createRenderer(){this.template instanceof HTMLTemplateElement&&this.template!==Jt(this,us)&&(Ct(this,us,this.template),this.renderer=new Mt(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)}};Ea=new WeakMap;us=new WeakMap;ba=new WeakMap;va=new WeakMap;fd=new WeakSet;Hm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}};cs=new WeakSet;vd=function(){var t;let e=this.getAttribute("template");if(!e||e===Jt(this,ba))return;let i=this.getRootNode(),a=(t=i==null?void 0:i.getElementById)==null?void 0:t.call(i,e);if(a){Ct(this,ba,e),Ct(this,Ea,a),this.createRenderer();return}Uv(e)&&(Ct(this,ba,e),Hv(e).then(r=>{let o=V.createElement("template");o.innerHTML=r,Ct(this,Ea,o),this.createRenderer()}).catch(console.error))};zr=new WeakMap;Li.observedAttributes=["template"];Li.processor=ds;function Uv(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 Hv(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",Li);var $m=`:host {
|
|
1431
1440
|
--media-control-display: var(--controls);
|
|
1432
1441
|
--media-loading-indicator-display: var(--loading-indicator);
|
|
1433
1442
|
--media-dialog-display: var(--dialog);
|
|
@@ -1577,71 +1586,71 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1577
1586
|
:host([no-tooltips]) {
|
|
1578
1587
|
--media-tooltip-display: none;
|
|
1579
1588
|
}
|
|
1580
|
-
`;var
|
|
1589
|
+
`;var Qr=new WeakMap,gd=class t{constructor(e,i){this.element=e;this.type=i;this.element.addEventListener(this.type,this);let a=Qr.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=Qr.get(this.element);i&&i.delete(this.type)}}static for(e){Qr.has(e.element)||Qr.set(e.element,new Map);let i=e.attributeName.slice(2),a=Qr.get(e.element);return a&&a.has(i)?a.get(i):new t(e.element,i)}};function $v(t,e){return t instanceof be&&t.attributeName.startsWith("on")?(gd.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function Wv(t,e){return e instanceof ms&&t instanceof Lt?(e.renderInto(t),!0):!1}function Fv(t,e){return e instanceof DocumentFragment&&t instanceof Lt?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function Vv(t,e){if(t instanceof be){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 Kv(t,e){if(t instanceof be&&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 Gv(t,e){if(typeof e=="boolean"&&t instanceof be){let i=t.attributeNamespace,a=t.element.hasAttributeNS(i,t.attributeName);return e!==a&&(t.booleanValue=e),!0}return!1}function Yv(t,e){return e===!1&&t instanceof Lt?(t.replace(""),!0):!1}function qv(t,e){Kv(t,e)||Gv(t,e)||$v(t,e)||Yv(t,e)||Wv(t,e)||Fv(t,e)||Vv(t,e)}var bd=new Map,Wm=new WeakMap,Fm=new WeakMap,ms=class{constructor(e,i,a){this.strings=e;this.values=i;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(bd.has(this.stringsKey))return bd.get(this.stringsKey);{let e=ri.createElement("template"),i=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,o)=>a+r+(o<i?`{{ ${o} }}`:""),""),bd.set(this.stringsKey,e),e}}renderInto(e){var r;let i=this.template;if(Wm.get(e)!==i){Wm.set(e,i);let o=new Mt(i,this.values,this.processor);Fm.set(e,o),e instanceof Lt?e.replace(...o.children):e.appendChild(o);return}let a=Fm.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Zv={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:"";qv(o,s)}}}};function Xr(t,...e){return new ms(t,e,Zv)}function Vm(t,e){t.renderInto(e)}var Jr=require("@mux/playback-core"),zv=t=>{let{tokens:e}=t;return e.drm?":host(:not([cast-receiver])) { --_cast-button-drm-display: none; }":""},Km=t=>Xr`
|
|
1581
1590
|
<style>
|
|
1582
|
-
${
|
|
1583
|
-
${
|
|
1591
|
+
${zv(t)}
|
|
1592
|
+
${$m}
|
|
1584
1593
|
</style>
|
|
1585
|
-
${
|
|
1586
|
-
`,
|
|
1594
|
+
${jv(t)}
|
|
1595
|
+
`,Qv=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Vr(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Xv={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"},Jv=Object.values(Xv).join(", "),jv=t=>{var e,i,a,r,o,s,d,u,v,y,A,E,p,k,g,S,C,j,Ue,Ot,bt,Ce,we,Pt,Qe,Wa,Fa,Va,Ka,Ga,Ya,qa,yo,gt,Za,za,Qa,Xa,Ja;return Xr`
|
|
1587
1596
|
<media-theme
|
|
1588
1597
|
template="${t.themeTemplate||!1}"
|
|
1589
1598
|
defaultstreamtype="${(e=t.defaultStreamType)!=null?e:!1}"
|
|
1590
|
-
hotkeys="${
|
|
1599
|
+
hotkeys="${Qv(t)||!1}"
|
|
1591
1600
|
nohotkeys="${t.noHotKeys||!t.hasSrc||!1}"
|
|
1592
|
-
noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(
|
|
1601
|
+
noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(Jr.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
|
|
1593
1602
|
novolumepref="${t.novolumepref||!1}"
|
|
1594
1603
|
nomutedpref="${t.nomutedpref||!1}"
|
|
1595
1604
|
disabled="${!t.hasSrc||t.isDialogOpen}"
|
|
1596
1605
|
audio="${(a=t.audio)!=null?a:!1}"
|
|
1597
|
-
style="${(r=
|
|
1606
|
+
style="${(r=gm({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor,"--media-accent-color":t.accentColor}))!=null?r:!1}"
|
|
1598
1607
|
defaultsubtitles="${!t.defaultHiddenCaptions}"
|
|
1599
1608
|
forwardseekoffset="${(o=t.forwardSeekOffset)!=null?o:!1}"
|
|
1600
1609
|
backwardseekoffset="${(s=t.backwardSeekOffset)!=null?s:!1}"
|
|
1601
1610
|
playbackrates="${(d=t.playbackRates)!=null?d:!1}"
|
|
1602
1611
|
defaultshowremainingtime="${(u=t.defaultShowRemainingTime)!=null?u:!1}"
|
|
1603
|
-
defaultduration="${(
|
|
1604
|
-
hideduration="${(
|
|
1605
|
-
title="${(
|
|
1612
|
+
defaultduration="${(v=t.defaultDuration)!=null?v:!1}"
|
|
1613
|
+
hideduration="${(y=t.hideDuration)!=null?y:!1}"
|
|
1614
|
+
title="${(A=t.title)!=null?A:!1}"
|
|
1606
1615
|
videotitle="${(E=t.videoTitle)!=null?E:!1}"
|
|
1607
|
-
proudlydisplaymuxbadge="${(
|
|
1608
|
-
exportparts="${
|
|
1616
|
+
proudlydisplaymuxbadge="${(p=t.proudlyDisplayMuxBadge)!=null?p:!1}"
|
|
1617
|
+
exportparts="${Jv}"
|
|
1609
1618
|
onclose="${t.onCloseErrorDialog}"
|
|
1610
1619
|
onfocusin="${t.onFocusInErrorDialog}"
|
|
1611
1620
|
>
|
|
1612
1621
|
<mux-video
|
|
1613
1622
|
slot="media"
|
|
1614
|
-
inert="${(
|
|
1615
|
-
target-live-window="${(
|
|
1616
|
-
stream-type="${(
|
|
1617
|
-
crossorigin="${(
|
|
1623
|
+
inert="${(k=t.noHotKeys)!=null?k:!1}"
|
|
1624
|
+
target-live-window="${(g=t.targetLiveWindow)!=null?g:!1}"
|
|
1625
|
+
stream-type="${(S=Vr(t.streamType))!=null?S:!1}"
|
|
1626
|
+
crossorigin="${(C=t.crossOrigin)!=null?C:""}"
|
|
1618
1627
|
playsinline
|
|
1619
|
-
autoplay="${(
|
|
1620
|
-
muted="${(
|
|
1621
|
-
loop="${(
|
|
1622
|
-
preload="${(
|
|
1623
|
-
debug="${(
|
|
1624
|
-
prefer-cmcd="${(
|
|
1625
|
-
disable-tracking="${(
|
|
1626
|
-
disable-cookies="${(
|
|
1627
|
-
prefer-playback="${(
|
|
1628
|
+
autoplay="${(j=t.autoplay)!=null?j:!1}"
|
|
1629
|
+
muted="${(Ue=t.muted)!=null?Ue:!1}"
|
|
1630
|
+
loop="${(Ot=t.loop)!=null?Ot:!1}"
|
|
1631
|
+
preload="${(bt=t.preload)!=null?bt:!1}"
|
|
1632
|
+
debug="${(Ce=t.debug)!=null?Ce:!1}"
|
|
1633
|
+
prefer-cmcd="${(we=t.preferCmcd)!=null?we:!1}"
|
|
1634
|
+
disable-tracking="${(Pt=t.disableTracking)!=null?Pt:!1}"
|
|
1635
|
+
disable-cookies="${(Qe=t.disableCookies)!=null?Qe:!1}"
|
|
1636
|
+
prefer-playback="${(Wa=t.preferPlayback)!=null?Wa:!1}"
|
|
1628
1637
|
start-time="${t.startTime!=null?t.startTime:!1}"
|
|
1629
|
-
beacon-collection-domain="${(
|
|
1630
|
-
player-init-time="${(
|
|
1631
|
-
player-software-name="${(
|
|
1632
|
-
player-software-version="${(
|
|
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="${(
|
|
1638
|
-
drm-token="${(
|
|
1638
|
+
beacon-collection-domain="${(Fa=t.beaconCollectionDomain)!=null?Fa:!1}"
|
|
1639
|
+
player-init-time="${(Va=t.playerInitTime)!=null?Va:!1}"
|
|
1640
|
+
player-software-name="${(Ka=t.playerSoftwareName)!=null?Ka:!1}"
|
|
1641
|
+
player-software-version="${(Ga=t.playerSoftwareVersion)!=null?Ga:!1}"
|
|
1642
|
+
env-key="${(Ya=t.envKey)!=null?Ya:!1}"
|
|
1643
|
+
custom-domain="${(qa=t.customDomain)!=null?qa:!1}"
|
|
1644
|
+
src="${t.src?t.src:t.playbackId?(0,Jr.toMuxVideoURL)(t):!1}"
|
|
1645
|
+
cast-src="${t.src?t.src:t.playbackId?(0,Jr.toMuxVideoURL)(t):!1}"
|
|
1646
|
+
cast-receiver="${(yo=t.castReceiver)!=null?yo:!1}"
|
|
1647
|
+
drm-token="${(Za=(gt=t.tokens)==null?void 0:gt.drm)!=null?Za:!1}"
|
|
1639
1648
|
exportparts="video"
|
|
1640
|
-
disable-pseudo-ended="${(
|
|
1641
|
-
max-auto-resolution="${(
|
|
1642
|
-
cap-rendition-to-player-size="${(
|
|
1649
|
+
disable-pseudo-ended="${(za=t.disablePseudoEnded)!=null?za:!1}"
|
|
1650
|
+
max-auto-resolution="${(Qa=t.maxAutoResolution)!=null?Qa:!1}"
|
|
1651
|
+
cap-rendition-to-player-size="${(Xa=t.capRenditionToPlayerSize)!=null?Xa:!1}"
|
|
1643
1652
|
>
|
|
1644
|
-
${t.storyboard?
|
|
1653
|
+
${t.storyboard?Xr`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:Xr``}
|
|
1645
1654
|
<slot></slot>
|
|
1646
1655
|
</mux-video>
|
|
1647
1656
|
<slot name="poster" slot="poster">
|
|
@@ -1649,11 +1658,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1649
1658
|
part="poster"
|
|
1650
1659
|
exportparts="poster, img"
|
|
1651
1660
|
src="${t.poster?t.poster:!1}"
|
|
1652
|
-
placeholdersrc="${(
|
|
1661
|
+
placeholdersrc="${(Ja=t.placeholder)!=null?Ja:!1}"
|
|
1653
1662
|
></media-poster-image>
|
|
1654
1663
|
</slot>
|
|
1655
1664
|
</media-theme>
|
|
1656
|
-
`};var
|
|
1665
|
+
`};var T=require("@mux/playback-core"),Gm=t=>t.charAt(0).toUpperCase()+t.slice(1),eE=(t,e=!1)=>{var i,a;if(t.muxCode){let r=Gm((i=t.errorCategory)!=null?i:"video"),o=(0,T.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:T.MuxErrorCategory.VIDEO);if(t.muxCode===T.MuxErrorCode.NETWORK_OFFLINE)return(0,T.i18n)("Your device appears to be offline",e);if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,T.i18n)("{category} URL has expired",e).format({category:r});if([T.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,T.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,T.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,T.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,T.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,T.i18n)("Invalid {categoryName} URL",e).format({categoryName:o});if(t.muxCode===T.MuxErrorCode.NETWORK_NOT_FOUND)return(0,T.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===T.MuxErrorCode.NETWORK_NOT_READY){let s=t.streamType==="live"?"Live stream":"Video";return(0,T.i18n)("{mediaType} is not currently available",e).format({mediaType:s})}}if(t.code){if(t.code===T.MediaError.MEDIA_ERR_NETWORK)return(0,T.i18n)("Network Error",e);if(t.code===T.MediaError.MEDIA_ERR_DECODE)return(0,T.i18n)("Media Error",e);if(t.code===T.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,T.i18n)("Source Not Supported",e)}return(0,T.i18n)("Error",e)},tE=(t,e=!1)=>{var i,a;if(t.muxCode){let r=Gm((i=t.errorCategory)!=null?i:"video"),o=(0,T.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:T.MuxErrorCategory.VIDEO);return t.muxCode===T.MuxErrorCode.NETWORK_OFFLINE?(0,T.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,T.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:o}):t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,T.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:o}):t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,T.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[T.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,T.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,T.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:o}):[T.MuxErrorCode.NETWORK_TOKEN_MISSING,T.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,T.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:o}):t.muxCode===T.MuxErrorCode.NETWORK_NOT_FOUND?"":t.message}return t.code&&(t.code===T.MediaError.MEDIA_ERR_NETWORK||t.code===T.MediaError.MEDIA_ERR_DECODE||t.code===T.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},Ym=(t,e=!1)=>{let i=eE(t,e).toString(),a=tE(t,e).toString();return{title:i,message:a}},iE=t=>{if(t.muxCode){if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([T.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,T.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===T.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===T.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===T.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===T.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===T.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},_d=(t,e)=>{let i=iE(t);return{message:t.message,context:t.context,file:i}};var qm=`<template id="media-theme-gerwig">
|
|
1657
1666
|
<style>
|
|
1658
1667
|
@keyframes pre-play-hide {
|
|
1659
1668
|
0% {
|
|
@@ -2785,7 +2794,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2785
2794
|
<slot></slot>
|
|
2786
2795
|
</media-controller>
|
|
2787
2796
|
</template>
|
|
2788
|
-
`;function
|
|
2797
|
+
`;function Zm({anchor:t,floating:e,placement:i}){let a=rE({anchor:t,floating:e}),{x:r,y:o}=nE(a,i);return{x:r,y:o}}function rE({anchor:t,floating:e}){return{anchor:oE(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function oE(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 nE({anchor:t,floating:e},i){let a=sE(i)==="x"?"y":"x",r=a==="y"?"height":"width",o=zm(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,v;switch(o){case"top":v={x:s,y:t.y-e.height};break;case"bottom":v={x:s,y:t.y+t.height};break;case"right":v={x:t.x+t.width,y:d};break;case"left":v={x:t.x-e.width,y:d};break;default:v={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":v[a]-=u;break;case"end":v[a]+=u;break}return v}function zm(t){return t.split("-")[0]}function sE(t){return["top","bottom"].includes(zm(t))?"y":"x"}var jt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},hs=class extends Event{constructor({newState:e,oldState:i,...a}){super("toggle",a),this.newState=e,this.oldState=i}};var xd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},$=(t,e,i)=>(xd(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)},Oe=(t,e,i,a)=>(xd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),G=(t,e,i)=>(xd(t,e,"access private method"),i),ht,ei,wt,ps,jr,wi,io,Ad,Qm,Es,Dd,bs,fs,Td,yd,Xm,kd,Jm,Sd,jm,ga,_a,Aa,ao,gs,Od,Id,eh,Pd,th,Md,ih,Nd,ah,Ld,rh,Cd,oh,eo,_s,wd,nh,to,As,vs,Rd;function pt({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 ze(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 lE(t){return`
|
|
2789
2798
|
<style>
|
|
2790
2799
|
:host {
|
|
2791
2800
|
font: var(--media-font,
|
|
@@ -2960,7 +2969,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2960
2969
|
<slot></slot>
|
|
2961
2970
|
</div>
|
|
2962
2971
|
<slot name="checked-indicator" hidden></slot>
|
|
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`
|
|
2972
|
+
`}var Ci={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},te=class extends l.HTMLElement{constructor(){if(super(),K(this,Ad),K(this,Es),K(this,fs),K(this,yd),K(this,kd),K(this,Sd),K(this,Aa),K(this,gs),K(this,Id),K(this,Pd),K(this,Md),K(this,Nd),K(this,Ld),K(this,Cd),K(this,eo),K(this,wd),K(this,to),K(this,vs),K(this,ht,null),K(this,ei,null),K(this,wt,null),K(this,ps,new Set),K(this,jr,void 0),K(this,wi,!1),K(this,io,null),K(this,bs,()=>{let e=$(this,ps),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}));Oe(this,ps,i)}),K(this,ga,()=>{G(this,Aa,ao).call(this),G(this,gs,Od).call(this,!1)}),K(this,_a,()=>{G(this,Aa,ao).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])"),Oe(this,jr,new MutationObserver($(this,bs)))}static get observedAttributes(){return[Ci.DISABLED,Ci.HIDDEN,Ci.STYLE,Ci.ANCHOR,D.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,Ad,Qm).call(this,e);break;case"invoke":G(this,yd,Xm).call(this,e);break;case"click":G(this,Id,eh).call(this,e);break;case"toggle":G(this,Md,ih).call(this,e);break;case"focusout":G(this,Ld,rh).call(this,e);break;case"keydown":G(this,Cd,oh).call(this,e);break}}connectedCallback(){var e,i;$(this,jr).observe(this.defaultSlot,{childList:!0}),Oe(this,io,rr(this.shadowRoot,":host")),G(this,fs,Td).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Oe(this,ht,Ro(this)),(i=(e=$(this,ht))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(_t(ro(this),$(this,ga)),_t(this,$(this,_a))),G(this,Es,Dd).call(this),this.shadowRoot.addEventListener("slotchange",this)}disconnectedCallback(){var e,i;$(this,jr).disconnect(),At(ro(this),$(this,ga)),At(this,$(this,_a)),this.disable(),(i=(e=$(this,ht))==null?void 0:e.unassociateElement)==null||i.call(e,this),Oe(this,ht,null),Oe(this,ei,null),Oe(this,wt,null),this.shadowRoot.removeEventListener("slotchange",this)}attributeChangedCallback(e,i,a){var r,o,s,d;e===Ci.HIDDEN&&a!==i?($(this,wi)||Oe(this,wi,!0),this.hidden?G(this,Sd,jm).call(this):G(this,kd,Jm).call(this),this.dispatchEvent(new hs({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===D.MEDIA_CONTROLLER?(i&&((o=(r=$(this,ht))==null?void 0:r.unassociateElement)==null||o.call(r,this),Oe(this,ht,null)),a&&this.isConnected&&(Oe(this,ht,Ro(this)),(d=(s=$(this,ht))==null?void 0:s.associateElement)==null||d.call(s,this))):e===Ci.DISABLED&&a!==i?a==null?this.enable():this.disable():e===Ci.STYLE&&a!==i&&G(this,fs,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=ni(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(dE)}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,vs,Rd).call(this,i)}focus(){if(Oe(this,ei,ar()),this.items.length){G(this,to,As).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,eo,_s).call(this,e);a&&(G(this,vs,Rd).call(this,a,a.type==="checkbox"),$(this,wt)&&!this.hidden&&((i=$(this,ei))==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,eo,_s).call(this,e))!=null?i:G(this,wd,nh).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,to,As).call(this,o[u]),o[u].focus()}};ht=new WeakMap;ei=new WeakMap;wt=new WeakMap;ps=new WeakMap;jr=new WeakMap;wi=new WeakMap;io=new WeakMap;Ad=new WeakSet;Qm=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,Es,Dd).call(this),e.name||$(this,bs).call(this)};Es=new WeakSet;Dd=function(){let t=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');t.hidden=e.assignedNodes().length===0&&t.assignedNodes().length===0};bs=new WeakMap;fs=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")};yd=new WeakSet;Xm=function(t){Oe(this,wt,t.relatedTarget),he(this,t.relatedTarget)||(this.hidden=!this.hidden)};kd=new WeakSet;Jm=function(){var t;(t=$(this,wt))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),_t(ro(this),$(this,ga)),_t(this,$(this,_a))};Sd=new WeakSet;jm=function(){var t;(t=$(this,wt))==null||t.setAttribute("aria-expanded","false"),At(ro(this),$(this,ga)),At(this,$(this,_a))};ga=new WeakMap;_a=new WeakMap;Aa=new WeakSet;ao=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=Zm({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=ro(this).getBoundingClientRect(),o=r.width-e-t,s=r.height-i-this.offsetHeight,{style:d}=$(this,io);d.setProperty("position","absolute"),d.setProperty("right",`${Math.max(0,o)}px`),d.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),y=d.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),A=r.height-y-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${A}px`)};gs=new WeakSet;Od=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,io);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,Aa,ao).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,Aa,ao).call(this);a.removeProperty("--media-menu-transition-in")};Id=new WeakSet;eh=function(t){var e;if(t.stopPropagation(),t.composedPath().includes($(this,Pd,th))){(e=$(this,ei))==null||e.focus(),this.hidden=!0;return}let i=G(this,eo,_s).call(this,t);!i||i.hasAttribute("disabled")||(G(this,to,As).call(this,i),this.handleSelect(t))};Pd=new WeakSet;th=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"]'))};Md=new WeakSet;ih=function(t){if(t.target===this)return;G(this,Nd,ah).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 jt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);G(this,gs,Od).call(this,!0)};Nd=new WeakSet;ah=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Ld=new WeakSet;rh=function(t){var e;he(this,t.relatedTarget)||($(this,wi)&&((e=$(this,ei))==null||e.focus()),$(this,wt)&&$(this,wt)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};Cd=new WeakSet;oh=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:v}=t;if(!(d||u||v)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if($(this,wi)){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,ei))==null||o.focus(),$(this,wi)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};eo=new WeakSet;_s=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};wd=new WeakSet;nh=function(){return this.items.find(t=>t.tabIndex===0)};to=new WeakSet;As=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};vs=new WeakSet;Rd=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}))};te.shadowRootOptions={mode:"open"};te.getTemplateHTML=lE;function dE(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function ro(t){var e;return(e=t.getAttribute("bounds")?Xe(t,`#${t.getAttribute("bounds")}`):Y(t)||t.parentElement)!=null?e:t}l.customElements.get("media-chrome-menu")||l.customElements.define("media-chrome-menu",te);var Fd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ge=(t,e,i)=>(Fd(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)},Ud=(t,e,i,a)=>(Fd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ya=(t,e,i)=>(Fd(t,e,"access private method"),i),Ts,no,Hd,sh,ks,Vd,Kd,lh,ft,Ta,Bd,ys,$d;function uE(t){return`
|
|
2964
2973
|
<style>
|
|
2965
2974
|
:host {
|
|
2966
2975
|
transition: var(--media-menu-item-transition,
|
|
@@ -3078,8 +3087,8 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3078
3087
|
${this.getSuffixSlotInnerHTML(t)}
|
|
3079
3088
|
</slot>
|
|
3080
3089
|
<slot name="submenu"></slot>
|
|
3081
|
-
`}function
|
|
3082
|
-
${
|
|
3090
|
+
`}function cE(t){return""}var Pe={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Le=class extends l.HTMLElement{constructor(){if(super(),Rt(this,Hd),Rt(this,ks),Rt(this,Kd),Rt(this,ys),Rt(this,Ts,!1),Rt(this,no,void 0),Rt(this,ft,()=>{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)}),Rt(this,Ta,e=>{let{key:i}=e;if(!this.keysUsed.includes(i)){this.removeEventListener("keyup",ge(this,Ta));return}this.handleClick(e)}),Rt(this,Bd,e=>{let{metaKey:i,altKey:a,key:r}=e;if(i||a||!this.keysUsed.includes(r)){this.removeEventListener("keyup",ge(this,Ta));return}this.addEventListener("keyup",ge(this,Ta),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[Pe.TYPE,Pe.DISABLED,Pe.CHECKED,Pe.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),oo(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":ya(this,Hd,sh).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":ge(this,Bd).call(this,e);break;case"keyup":ge(this,Ta).call(this,e);break}}attributeChangedCallback(e,i,a){e===Pe.CHECKED&&oo(this)&&!ge(this,Ts)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===Pe.TYPE&&a!==i?this.role="menuitem"+a:e===Pe.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Pe.DISABLED)||this.enable(),this.role="menuitem"+this.type,Ud(this,no,Wd(this,this.parentNode)),ya(this,ys,$d).call(this),this.submenuElement&&ya(this,ks,Vd).call(this),this.shadowRoot.addEventListener("slotchange",this)}disconnectedCallback(){this.disable(),ya(this,ys,$d).call(this),Ud(this,no,null),this.shadowRoot.removeEventListener("slotchange",this)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=ni(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(Pe.TYPE))!=null?e:""}set type(e){this.setAttribute(Pe.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Pe.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Pe.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(oo(this))return this.getAttribute("aria-checked")==="true"}set checked(e){oo(this)&&(Ud(this,Ts,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){oo(this)||this.invokeTargetElement&&he(this,e.target)&&this.invokeTargetElement.dispatchEvent(new jt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};Ts=new WeakMap;no=new WeakMap;Hd=new WeakSet;sh=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?ya(this,ks,Vd).call(this):ya(this,Kd,lh).call(this))};ks=new WeakSet;Vd=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",ge(this,ft)),this.submenuElement.addEventListener("addmenuitem",ge(this,ft)),this.submenuElement.addEventListener("removemenuitem",ge(this,ft)),ge(this,ft).call(this)};Kd=new WeakSet;lh=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",ge(this,ft)),this.submenuElement.removeEventListener("addmenuitem",ge(this,ft)),this.submenuElement.removeEventListener("removemenuitem",ge(this,ft)),ge(this,ft).call(this)};ft=new WeakMap;Ta=new WeakMap;Bd=new WeakMap;ys=new WeakSet;$d=function(){var t;let e=(t=ge(this,no))==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")};Le.shadowRootOptions={mode:"open"};Le.getTemplateHTML=uE;Le.getSuffixSlotInnerHTML=cE;function oo(t){return t.type==="radio"||t.type==="checkbox"}function Wd(t,e){if(!t)return null;let{host:i}=t.getRootNode();return!e&&i?Wd(t,i):e!=null&&e.items?e:Wd(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-menu-item")||l.customElements.define("media-chrome-menu-item",Le);function mE(t){return`
|
|
3091
|
+
${te.getTemplateHTML(t)}
|
|
3083
3092
|
<style>
|
|
3084
3093
|
:host {
|
|
3085
3094
|
--_menu-bg: rgb(20 20 30 / .8);
|
|
@@ -3113,8 +3122,8 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3113
3122
|
--media-settings-menu-item-opacity: 0;
|
|
3114
3123
|
}
|
|
3115
3124
|
</style>
|
|
3116
|
-
`}var
|
|
3117
|
-
${
|
|
3125
|
+
`}var so=class extends te{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-settings-menu-button")}};so.getTemplateHTML=mE;l.customElements.get("media-settings-menu")||l.customElements.define("media-settings-menu",so);function hE(t){return`
|
|
3126
|
+
${Le.getTemplateHTML.call(this,t)}
|
|
3118
3127
|
<style>
|
|
3119
3128
|
slot:not([name="submenu"]) {
|
|
3120
3129
|
opacity: var(--media-settings-menu-item-opacity, var(--media-menu-item-opacity));
|
|
@@ -3124,11 +3133,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3124
3133
|
background: transparent;
|
|
3125
3134
|
}
|
|
3126
3135
|
</style>
|
|
3127
|
-
`}function
|
|
3136
|
+
`}function pE(t){return`
|
|
3128
3137
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
3129
3138
|
<path d="m8.12 17.585-.742-.669 4.2-4.665-4.2-4.666.743-.669 4.803 5.335-4.803 5.334Z"/>
|
|
3130
3139
|
</svg>
|
|
3131
|
-
`}var
|
|
3140
|
+
`}var Ri=class extends Le{};Ri.shadowRootOptions={mode:"open"};Ri.getTemplateHTML=hE;Ri.getSuffixSlotInnerHTML=pE;l.customElements.get("media-settings-menu-item")||l.customElements.define("media-settings-menu-item",Ri);var ye=class extends B{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=ni(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new jt({relatedTarget:this}))}};l.customElements.get("media-chrome-menu-button")||l.customElements.define("media-chrome-menu-button",ye);function fE(){return`
|
|
3132
3141
|
<style>
|
|
3133
3142
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
3134
3143
|
display: none;
|
|
@@ -3139,27 +3148,27 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3139
3148
|
<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"/>
|
|
3140
3149
|
</svg>
|
|
3141
3150
|
</slot>
|
|
3142
|
-
`}function
|
|
3151
|
+
`}function vE(){return c("Settings")}var ka=class extends ye{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",c("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-settings-menu")}};ka.getSlotTemplateHTML=fE;ka.getTooltipContentHTML=vE;l.customElements.get("media-settings-menu-button")||l.customElements.define("media-settings-menu-button",ka);var Zd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},dh=(t,e,i)=>(Zd(t,e,"read from private field"),i?i.call(t):e.get(t)),Ss=(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)},Gd=(t,e,i,a)=>(Zd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Is=(t,e,i)=>(Zd(t,e,"access private method"),i),lo,Cs,Ms,Yd,Ls,qd,ws=class extends te{constructor(){super(...arguments),Ss(this,Ms),Ss(this,Ls),Ss(this,lo,[]),Ss(this,Cs,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&&(Gd(this,lo,Uu(a!=null?a:"")),Is(this,Ms,Yd).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Is(this,Ls,qd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Is(this,Ls,qd))}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 dh(this,lo)}set mediaAudioTrackList(e){Gd(this,lo,e),Is(this,Ms,Yd).call(this)}get mediaAudioTrackEnabled(){var e;return(e=x(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){w(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};lo=new WeakMap;Cs=new WeakMap;Ms=new WeakSet;Yd=function(){if(dh(this,Cs)===JSON.stringify(this.mediaAudioTrackList))return;Gd(this,Cs,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=pt({type:"radio",text:i,value:`${e.id}`,checked:e.enabled});a.prepend(ze(this,"checked-indicator")),this.defaultSlot.append(a)}};Ls=new WeakSet;qd=function(){if(this.value==null)return;let t=new l.CustomEvent(h.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",ws);var EE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
3143
3152
|
<path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
|
|
3144
3153
|
<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"/>
|
|
3145
|
-
</svg>`;function
|
|
3154
|
+
</svg>`;function bE(){return`
|
|
3146
3155
|
<style>
|
|
3147
3156
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
3148
3157
|
display: none;
|
|
3149
3158
|
}
|
|
3150
3159
|
</style>
|
|
3151
|
-
<slot name="icon">${
|
|
3152
|
-
`}function
|
|
3160
|
+
<slot name="icon">${EE}</slot>
|
|
3161
|
+
`}function gE(){return c("Audio")}var uh=t=>{let e=c("Audio");t.setAttribute("aria-label",e)},Sa=class extends ye{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),uh(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LANG&&uh(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=x(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){w(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};Sa.getSlotTemplateHTML=bE;Sa.getTooltipContentHTML=gE;l.customElements.get("media-audio-track-menu-button")||l.customElements.define("media-audio-track-menu-button",Sa);var Jd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_E=(t,e,i)=>(Jd(t,e,"read from private field"),i?i.call(t):e.get(t)),zd=(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)},AE=(t,e,i,a)=>(Jd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Rs=(t,e,i)=>(Jd(t,e,"access private method"),i),Os,xs,Qd,Ds,Xd,TE=`
|
|
3153
3162
|
<svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
|
|
3154
3163
|
<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"/>
|
|
3155
|
-
</svg>`;function
|
|
3156
|
-
${
|
|
3157
|
-
<slot name="captions-indicator" hidden>${
|
|
3158
|
-
`}var
|
|
3164
|
+
</svg>`;function yE(t){return`
|
|
3165
|
+
${te.getTemplateHTML(t)}
|
|
3166
|
+
<slot name="captions-indicator" hidden>${TE}</slot>
|
|
3167
|
+
`}var uo=class extends te{constructor(){super(...arguments),zd(this,xs),zd(this,Ds),zd(this,Os,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?Rs(this,xs,Qd).call(this):e===n.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a||"",Rs(this,xs,Qd).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Rs(this,Ds,Xd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Rs(this,Ds,Xd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return ch(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){mh(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return ch(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){mh(this,n.MEDIA_SUBTITLES_SHOWING,e)}};Os=new WeakMap;xs=new WeakSet;Qd=function(){var t;let e=_E(this,Os)!==JSON.stringify(this.mediaSubtitlesList),i=this.value!==this.getAttribute(n.MEDIA_SUBTITLES_SHOWING);if(!e&&!i)return;AE(this,Os,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let a=!this.value,r=pt({type:"radio",text:this.formatMenuItemText(c("Off")),value:"off",checked:a});r.prepend(ze(this,"checked-indicator")),this.defaultSlot.append(r);let o=this.mediaSubtitlesList;for(let s of o){let d=pt({type:"radio",text:this.formatMenuItemText(s.label,s),value:Ko(s),checked:this.value==Ko(s)});d.prepend(ze(this,"checked-indicator")),((t=s.kind)!=null?t:"subs")==="captions"&&d.append(ze(this,"captions-indicator")),this.defaultSlot.append(d)}};Ds=new WeakSet;Xd=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(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t})),!this.value||!i)return;let a=new l.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};uo.getTemplateHTML=yE;var ch=(t,e)=>{let i=t.getAttribute(e);return i?di(i):[]},mh=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=yt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-menu")||l.customElements.define("media-captions-menu",uo);var kE=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
3159
3168
|
<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"/>
|
|
3160
|
-
</svg>`,
|
|
3169
|
+
</svg>`,SE=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
3161
3170
|
<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"/>
|
|
3162
|
-
</svg>`;function
|
|
3171
|
+
</svg>`;function IE(){return`
|
|
3163
3172
|
<style>
|
|
3164
3173
|
:host([data-captions-enabled="true"]) slot[name=off] {
|
|
3165
3174
|
display: none !important;
|
|
@@ -3176,10 +3185,10 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3176
3185
|
</style>
|
|
3177
3186
|
|
|
3178
3187
|
<slot name="icon">
|
|
3179
|
-
<slot name="on">${
|
|
3180
|
-
<slot name="off">${
|
|
3188
|
+
<slot name="on">${kE}</slot>
|
|
3189
|
+
<slot name="off">${SE}</slot>
|
|
3181
3190
|
</slot>
|
|
3182
|
-
`}function
|
|
3191
|
+
`}function ME(){return c("Captions")}var hh=t=>{t.setAttribute("data-captions-enabled",Go(t).toString())},ph=t=>{t.setAttribute("aria-label",c("closed captions"))},Ia=class extends ye{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING,n.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),ph(this),hh(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING?hh(this):e===n.MEDIA_LANG&&ph(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 fh(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){vh(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return fh(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){vh(this,n.MEDIA_SUBTITLES_SHOWING,e)}};Ia.getSlotTemplateHTML=IE;Ia.getTooltipContentHTML=ME;var fh=(t,e)=>{let i=t.getAttribute(e);return i?di(i):[]},vh=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=yt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-menu-button")||l.customElements.define("media-captions-menu-button",Ia);var Eh=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},La=(t,e,i)=>(Eh(t,e,"read from private field"),i?i.call(t):e.get(t)),jd=(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)},Ma=(t,e,i)=>(Eh(t,e,"access private method"),i),ti,Ca,co,Ps,tu,eu={RATES:"rates"},Ns=class extends te{constructor(){super(),jd(this,Ca),jd(this,Ps),jd(this,ti,new Bt(this,eu.RATES,{defaultValue:$l})),Ma(this,Ca,co).call(this)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,eu.RATES]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PLAYBACK_RATE&&i!=a?(this.value=a,Ma(this,Ca,co).call(this)):e===eu.RATES&&i!=a&&(La(this,ti).value=a,Ma(this,Ca,co).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Ma(this,Ps,tu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Ma(this,Ps,tu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-playback-rate-menu-button")}get rates(){return La(this,ti)}set rates(e){e?Array.isArray(e)?La(this,ti).value=e.join(" "):typeof e=="string"&&(La(this,ti).value=e):La(this,ti).value="",Ma(this,Ca,co).call(this)}get mediaPlaybackRate(){return P(this,n.MEDIA_PLAYBACK_RATE,Ei)}set mediaPlaybackRate(e){U(this,n.MEDIA_PLAYBACK_RATE,e)}};ti=new WeakMap;Ca=new WeakSet;co=function(){this.defaultSlot.textContent="";let t=this.mediaPlaybackRate,e=new Set(Array.from(La(this,ti)).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=pt({type:"radio",text:this.formatMenuItemText(`${a}x`,a),value:a.toString(),checked:t===a});r.prepend(ze(this,"checked-indicator")),this.defaultSlot.append(r)}};Ps=new WeakSet;tu=function(){if(!this.value)return;let t=new l.CustomEvent(h.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",Ns);var Us=1;function LE(t){return`
|
|
3183
3192
|
<style>
|
|
3184
3193
|
:host {
|
|
3185
3194
|
min-width: 5ch;
|
|
@@ -3194,18 +3203,18 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3194
3203
|
display: none;
|
|
3195
3204
|
}
|
|
3196
3205
|
</style>
|
|
3197
|
-
<slot name="icon">${t.mediaplaybackrate||
|
|
3198
|
-
`}function
|
|
3206
|
+
<slot name="icon">${t.mediaplaybackrate||Us}x</slot>
|
|
3207
|
+
`}function CE(){return c("Playback rate")}var wa=class extends ye{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:Us}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)?Us:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",c("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return P(this,n.MEDIA_PLAYBACK_RATE,Us)}set mediaPlaybackRate(e){U(this,n.MEDIA_PLAYBACK_RATE,e)}};wa.getSlotTemplateHTML=LE;wa.getTooltipContentHTML=CE;l.customElements.get("media-playback-rate-menu-button")||l.customElements.define("media-playback-rate-menu-button",wa);var au=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},mo=(t,e,i)=>(au(t,e,"read from private field"),i?i.call(t):e.get(t)),Hs=(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)},bh=(t,e,i,a)=>(au(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ra=(t,e,i)=>(au(t,e,"access private method"),i),ho,Da,xa,po,Bs,iu,$s=class extends te{constructor(){super(...arguments),Hs(this,xa),Hs(this,Bs),Hs(this,ho,[]),Hs(this,Da,{})}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",Ra(this,xa,po).call(this)):e===n.MEDIA_RENDITION_LIST&&i!==a?(bh(this,ho,Pu(a)),Ra(this,xa,po).call(this)):e===n.MEDIA_HEIGHT&&i!==a&&Ra(this,xa,po).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Ra(this,Bs,iu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Ra(this,Bs,iu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return mo(this,ho)}set mediaRenditionList(e){bh(this,ho,e),Ra(this,xa,po).call(this)}get mediaRenditionSelected(){return x(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){w(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return P(this,n.MEDIA_HEIGHT)}set mediaHeight(e){U(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)}};ho=new WeakMap;Da=new WeakMap;xa=new WeakSet;po=function(){if(mo(this,Da).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&mo(this,Da).mediaHeight===this.mediaHeight)return;mo(this,Da).mediaRenditionList=JSON.stringify(this.mediaRenditionList),mo(this,Da).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=pt({type:"radio",text:d,value:`${s.id}`,checked:s.selected&&!i});u.prepend(ze(this,"checked-indicator")),this.defaultSlot.append(u)}let a=e&&this.showRenditionBitrate(e),r=i?e?this.formatMenuItemText(`${c("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:a})}`,e):this.formatMenuItemText(`${c("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(c("Auto")),o=pt({type:"radio",text:r,value:"auto",checked:i});o.dataset.description=r,o.prepend(ze(this,"checked-indicator")),this.defaultSlot.append(o)};Bs=new WeakSet;iu=function(){if(this.value==null)return;let t=new l.CustomEvent(h.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",$s);var wE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
3199
3208
|
<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" />
|
|
3200
|
-
</svg>`;function
|
|
3209
|
+
</svg>`;function RE(){return`
|
|
3201
3210
|
<style>
|
|
3202
3211
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
3203
3212
|
display: none;
|
|
3204
3213
|
}
|
|
3205
3214
|
</style>
|
|
3206
|
-
<slot name="icon">${
|
|
3207
|
-
`}function
|
|
3208
|
-
${
|
|
3215
|
+
<slot name="icon">${wE}</slot>
|
|
3216
|
+
`}function xE(){return c("Quality")}var Oa=class extends ye{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",c("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return x(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){w(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return P(this,n.MEDIA_HEIGHT)}set mediaHeight(e){U(this,n.MEDIA_HEIGHT,e)}};Oa.getSlotTemplateHTML=RE;Oa.getTooltipContentHTML=xE;l.customElements.get("media-rendition-menu-button")||l.customElements.define("media-rendition-menu-button",Oa);var nu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Et=(t,e,i)=>(nu(t,e,"read from private field"),i?i.call(t):e.get(t)),vt=(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)},gh=(t,e,i,a)=>(nu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ne=(t,e,i)=>(nu(t,e,"access private method"),i),Na,fo,Ys,xi,Pa,su,_h,Ws,ru,Fs,ou,Ah,Ks,Gs,Vs;function DE(t){return`
|
|
3217
|
+
${te.getTemplateHTML(t)}
|
|
3209
3218
|
<style>
|
|
3210
3219
|
:host {
|
|
3211
3220
|
--_menu-bg: rgb(20 20 30 / .8);
|
|
@@ -3218,8 +3227,8 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3218
3227
|
overflow: hidden;
|
|
3219
3228
|
}
|
|
3220
3229
|
</style>
|
|
3221
|
-
`}var
|
|
3222
|
-
${
|
|
3230
|
+
`}var vo=class extends te{constructor(){super(),vt(this,fo),vt(this,xi),vt(this,su),vt(this,Ws),vt(this,ou),vt(this,Na,!1),vt(this,Fs,e=>{let i=e.target,a=(i==null?void 0:i.nodeName)==="VIDEO",r=Ne(this,Ws,ru).call(this,i);(a||r)&&(Et(this,Na)?Ne(this,xi,Pa).call(this):Ne(this,ou,Ah).call(this,e))}),vt(this,Ks,e=>{let i=e.target,a=this.contains(i),r=e.button===2,o=(i==null?void 0:i.nodeName)==="VIDEO",s=Ne(this,Ws,ru).call(this,i);a||r&&(o||s)||Ne(this,xi,Pa).call(this)}),vt(this,Gs,e=>{e.key==="Escape"&&Ne(this,xi,Pa).call(this)}),vt(this,Vs,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)}Ne(this,xi,Pa).call(this)}),this.setAttribute("noautohide",""),Ne(this,fo,Ys).call(this)}connectedCallback(){super.connectedCallback(),Y(this).addEventListener("contextmenu",Et(this,Fs)),this.addEventListener("click",Et(this,Vs))}disconnectedCallback(){super.disconnectedCallback(),Y(this).removeEventListener("contextmenu",Et(this,Fs)),this.removeEventListener("click",Et(this,Vs)),document.removeEventListener("mousedown",Et(this,Ks)),document.removeEventListener("keydown",Et(this,Gs))}};Na=new WeakMap;fo=new WeakSet;Ys=function(){this.hidden=!Et(this,Na)};xi=new WeakSet;Pa=function(){gh(this,Na,!1),Ne(this,fo,Ys).call(this)};su=new WeakSet;_h=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var i;e!==this&&Ne(i=e,xi,Pa).call(i)})};Ws=new WeakSet;ru=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};Fs=new WeakMap;ou=new WeakSet;Ah=function(t){t.preventDefault(),Ne(this,su,_h).call(this),gh(this,Na,!0),this.style.position="fixed",this.style.left=`${t.clientX}px`,this.style.top=`${t.clientY}px`,Ne(this,fo,Ys).call(this),document.addEventListener("mousedown",Et(this,Ks),{once:!0}),document.addEventListener("keydown",Et(this,Gs),{once:!0})};Ks=new WeakMap;Gs=new WeakMap;Vs=new WeakMap;vo.getTemplateHTML=DE;l.customElements.get("media-context-menu")||l.customElements.define("media-context-menu",vo);function OE(t){return`
|
|
3231
|
+
${Le.getTemplateHTML.call(this,t)}
|
|
3223
3232
|
<style>
|
|
3224
3233
|
::slotted(*) {
|
|
3225
3234
|
color: var(--media-text-color, white);
|
|
@@ -3231,7 +3240,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3231
3240
|
min-height: var(--media-control-height, 24px);
|
|
3232
3241
|
}
|
|
3233
3242
|
</style>
|
|
3234
|
-
`}var
|
|
3243
|
+
`}var Ua=class extends Le{};Ua.shadowRootOptions={mode:"open"};Ua.getTemplateHTML=OE;l.customElements.get("media-context-menu-item")||l.customElements.define("media-context-menu-item",Ua);var lu=ri.createElement("template");"innerHTML"in lu&&(lu.innerHTML=qm);var Th,yh,qs=class extends Li{};qs.template=(yh=(Th=lu.content)==null?void 0:Th.children)==null?void 0:yh[0];Se.customElements.get("media-theme-gerwig")||Se.customElements.define("media-theme-gerwig",qs);var PE="gerwig",xt={SRC:"src",POSTER:"poster"},m={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",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"},du=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","videotitle","novolumepref","nomutedpref","proudlydisplaymuxbadge"];function NE(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(m.STORYBOARD_SRC),fullscreenElement:t.getAttribute(m.FULLSCREEN_ELEMENT),placeholder:t.getAttribute("placeholder"),themeTemplate:HE(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(m.NOHOTKEYS),hotKeys:t.getAttribute(m.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,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(b.Attributes.TARGET_LIVE_WINDOW),streamType:Vr(t.getAttribute(b.Attributes.STREAM_TYPE)),primaryColor:t.getAttribute(m.PRIMARY_COLOR),secondaryColor:t.getAttribute(m.SECONDARY_COLOR),accentColor:t.getAttribute(m.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:BE(t),playbackRates:t.getAttribute(m.PLAYBACK_RATES),customDomain:(r=t.getAttribute(b.Attributes.CUSTOM_DOMAIN))!=null?r:void 0,title:t.getAttribute(m.TITLE),videoTitle:(o=t.getAttribute(m.VIDEO_TITLE))!=null?o:t.getAttribute(m.TITLE),novolumepref:t.hasAttribute(m.NO_VOLUME_PREF),nomutedpref:t.hasAttribute(m.NO_MUTED_PREF),proudlyDisplayMuxBadge:t.hasAttribute(m.PROUDLY_DISPLAY_MUX_BADGE),castReceiver:t.castReceiver,disablePseudoEnded:t.hasAttribute(m.DISABLE_PSEUDO_ENDED),capRenditionToPlayerSize:t.capRenditionToPlayerSize,...e,extraSourceParams:t.extraSourceParams}}var UE=yn.formatErrorMessage;yn.formatErrorMessage=t=>{var e,i;if(t instanceof b.MediaError){let a=Ym(t,!1);return`
|
|
3235
3244
|
${a!=null&&a.title?`<h3>${a.title}</h3>`:""}
|
|
3236
3245
|
${a!=null&&a.message||a!=null&&a.linkUrl?`<p>
|
|
3237
3246
|
${a==null?void 0:a.message}
|
|
@@ -3239,9 +3248,9 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3239
3248
|
href="${a.linkUrl}"
|
|
3240
3249
|
target="_blank"
|
|
3241
3250
|
rel="external noopener"
|
|
3242
|
-
aria-label="${(e=a.linkText)!=null?e:""} ${(0,
|
|
3251
|
+
aria-label="${(e=a.linkText)!=null?e:""} ${(0,O.i18n)("(opens in a new window)")}"
|
|
3243
3252
|
>${(i=a.linkText)!=null?i:a.linkUrl}</a
|
|
3244
3253
|
>`:""}
|
|
3245
3254
|
</p>`:""}
|
|
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,
|
|
3255
|
+
`}return UE(t)};function HE(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=Se.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 kh(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 $E=Object.values(b.Attributes),WE=Object.values(xt),FE=Object.values(m),uu=as(),cu="mux-player",Sh={isDialogOpen:!1},VE={redundant_streams:!0},Eo,Ha,bo,ai,go,Ba,_o,Ao,Oi,$a,Pi,To,W,Dt,Ih,hu,Di,Mh,Lh,Ch,wh,mu=class extends ud{constructor(){super();ae(this,W);ae(this,Eo);ae(this,Ha,!1);ae(this,bo,{});ae(this,ai,!0);ae(this,go,new is(this,"hotkeys"));ae(this,Ba);ae(this,_o,()=>J(this,W,Di).call(this));ae(this,Ao,()=>J(this,W,Di).call(this));ae(this,Oi,()=>J(this,W,Di).call(this));ae(this,$a);ae(this,Pi,{...Sh,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&J(this,W,hu).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var o;if(((o=i.composedPath()[0])==null?void 0:o.localName)!=="media-error-dialog")return;sd(this,ri.activeElement)||i.preventDefault()}});ae(this,To,i=>{var o;let a=(o=this.media)==null?void 0:o.error;if(!(a instanceof b.MediaError)){let{message:s,code:d}=a!=null?a:{};a=new b.MediaError(s,d)}if(!(a!=null&&a.fatal)){ct(a),a.data&&ct(`${a.name} data:`,a.data);return}let r=_d(a,!1);r.message&&ld(r),Ee(a),a.data&&Ee(`${a.name} data:`,a.data),J(this,W,hu).call(this,{isDialogOpen:!0})});de(this,Eo,(0,O.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),J(this,W,Ih).call(this),this.isConnected&&J(this,W,Dt).call(this)}static get NAME(){return cu}static get VERSION(){return uu}static get observedAttributes(){var i;return[...(i=ud.observedAttributes)!=null?i:[],...WE,...$E,...FE]}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(){J(this,W,Dt).call(this);let i=this.media;i&&(i.metadata=kh(this))}disconnectedCallback(){var i,a,r,o,s,d,u,v;(i=R(this,Ba))==null||i.disconnect(),(a=this.media)==null||a.removeEventListener("streamtypechange",R(this,_o)),(r=this.media)==null||r.removeEventListener("loadstart",R(this,Ao)),this.removeEventListener("error",R(this,To)),this.media&&(this.media.errorTranslator=void 0),(s=(o=this.media)==null?void 0:o.textTracks)==null||s.removeEventListener("addtrack",R(this,Oi)),(u=(d=this.media)==null?void 0:d.textTracks)==null||u.removeEventListener("removetrack",R(this,Oi)),(v=R(this,$a))==null||v.call(this),de(this,$a,void 0),de(this,Ha,!1)}attributeChangedCallback(i,a,r){switch(J(this,W,Dt).call(this),super.attributeChangedCallback(i,a,r),i){case m.HOTKEYS:R(this,go).value=r;break;case m.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&ct((0,O.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case m.THUMBNAIL_TOKEN:{if(r){let s=(0,O.parseJwt)(r);if(s){let{aud:d}=s,u=O.MuxJWTAud.THUMBNAIL;d!==u&&ct((0,O.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case m.STORYBOARD_TOKEN:{if(r){let s=(0,O.parseJwt)(r);if(s){let{aud:d}=s,u=O.MuxJWTAud.STORYBOARD;d!==u&&ct((0,O.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case m.DRM_TOKEN:{if(r){let s=(0,O.parseJwt)(r);if(s){let{aud:d}=s,u=O.MuxJWTAud.DRM;d!==u&&ct((0,O.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case b.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&Ee((0,O.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case b.Attributes.STREAM_TYPE:{r&&![O.StreamTypes.LIVE,O.StreamTypes.ON_DEMAND,O.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:ld({file:"invalid-stream-type.md",message:(0,O.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===O.StreamTypes.LIVE?this.getAttribute(m.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case m.FULLSCREEN_ELEMENT:{if(r!=null||r!==a){let s=ri.getElementById(r),d=s==null?void 0:s.querySelector("mux-player");this.mediaController&&s&&d&&(this.mediaController.fullscreenElement=s)}break}case b.Attributes.CAP_RENDITION_TO_PLAYER_SIZE:{(r==null||r!==a)&&(this.capRenditionToPlayerSize=r!=null?!0:void 0);break}}[b.Attributes.PLAYBACK_ID,xt.SRC,m.PLAYBACK_TOKEN].includes(i)&&a!==r&&de(this,Pi,{...R(this,Pi),...Sh}),J(this,W,Di).call(this,{[ym(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 Se.CustomEvent(h.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,o)=>{var s;(s=this.mediaController)==null||s.addEventListener(Ie.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 Se.CustomEvent(h.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((a,r)=>{var o;(o=this.mediaController)==null||o.addEventListener(Ie.MEDIA_IS_FULLSCREEN,()=>a(),{once:!0})})}get preferCmcd(){var i;return(i=this.getAttribute(b.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?O.CmcdTypeValues.includes(i)?this.setAttribute(b.Attributes.PREFER_CMCD,i):ct(`Invalid value for preferCmcd. Must be one of ${O.CmcdTypeValues.join()}`):this.removeAttribute(b.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(m.THEME))!=null?i:PE}set theme(i){this.setAttribute(m.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(du.includes(r))continue;let o=i.getAttribute(r);a[ts(r)]=o===""?!0:o}return a}set themeProps(i){var r,o;J(this,W,Dt).call(this);let a={...this.themeProps,...i};for(let s in a){if(du.includes(s))continue;let d=i==null?void 0:i[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(es(s),!!d):(o=this.mediaTheme)==null||o.setAttribute(es(s),d)}}get playbackId(){var i;return(i=this.getAttribute(b.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(b.Attributes.PLAYBACK_ID,i):this.removeAttribute(b.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=ii(this,xt.SRC))!=null?i:void 0:(a=this.getAttribute(xt.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(xt.SRC,i):this.removeAttribute(xt.SRC)}get poster(){var r;let i=this.getAttribute(xt.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){ct("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return Am(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(xt.POSTER,i):this.removeAttribute(xt.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(m.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(m.STORYBOARD_SRC,i):this.removeAttribute(m.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[O.StreamTypes.LIVE,O.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(m.AUDIO)}set audio(i){if(!i){this.removeAttribute(m.AUDIO);return}this.setAttribute(m.AUDIO,"")}get hotkeys(){return R(this,go)}get nohotkeys(){return this.hasAttribute(m.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(m.NOHOTKEYS);return}this.setAttribute(m.NOHOTKEYS,"")}get thumbnailTime(){return fe(this.getAttribute(m.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(m.THUMBNAIL_TIME,`${i}`)}get videoTitle(){var i,a;return(a=(i=this.getAttribute(m.VIDEO_TITLE))!=null?i:this.getAttribute(m.TITLE))!=null?a:""}set videoTitle(i){i!==this.videoTitle&&(i?this.setAttribute(m.VIDEO_TITLE,i):this.removeAttribute(m.VIDEO_TITLE))}get placeholder(){var i;return(i=ii(this,m.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(m.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(m.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=Se.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(m.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(m.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=Se.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(m.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(m.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=Se.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(m.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(m.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(m.PLAYBACK_RATES))return this.getAttribute(m.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(i=>Number(i)).filter(i=>!Number.isNaN(i)).sort((i,a)=>i-a)}set playbackRates(i){if(!i){this.removeAttribute(m.PLAYBACK_RATES);return}this.setAttribute(m.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=fe(this.getAttribute(m.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(m.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=fe(this.getAttribute(m.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(m.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(m.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return fe(this.getAttribute(m.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(m.DEFAULT_DURATION):this.setAttribute(m.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(b.Attributes.PLAYER_INIT_TIME)?fe(this.getAttribute(b.Attributes.PLAYER_INIT_TIME)):R(this,Eo)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(b.Attributes.PLAYER_INIT_TIME):this.setAttribute(b.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:cu}get playerSoftwareVersion(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:uu}get beaconCollectionDomain(){var i;return(i=this.getAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(b.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(b.Attributes.MAX_RESOLUTION,i):this.removeAttribute(b.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(b.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(b.Attributes.MIN_RESOLUTION,i):this.removeAttribute(b.Attributes.MIN_RESOLUTION))}get maxAutoResolution(){var i;return(i=this.getAttribute(b.Attributes.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(b.Attributes.MAX_AUTO_RESOLUTION):this.setAttribute(b.Attributes.MAX_AUTO_RESOLUTION,i)}get renditionOrder(){var i;return(i=this.getAttribute(b.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(b.Attributes.RENDITION_ORDER,i):this.removeAttribute(b.Attributes.RENDITION_ORDER))}get programStartTime(){return fe(this.getAttribute(b.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(b.Attributes.PROGRAM_START_TIME):this.setAttribute(b.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return fe(this.getAttribute(b.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(b.Attributes.PROGRAM_END_TIME):this.setAttribute(b.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return fe(this.getAttribute(b.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(b.Attributes.ASSET_START_TIME):this.setAttribute(b.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return fe(this.getAttribute(b.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(b.Attributes.ASSET_END_TIME):this.setAttribute(b.Attributes.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(m.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(m.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):VE}set extraSourceParams(i){i==null?this.removeAttribute(m.EXTRA_SOURCE_PARAMS):this.setAttribute(m.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(b.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(b.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(b.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=ii(this,b.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(b.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(m.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(m.NO_VOLUME_PREF,""):this.removeAttribute(m.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(m.NO_MUTED_PREF)}set noMutedPref(i){i?this.setAttribute(m.NO_MUTED_PREF,""):this.removeAttribute(m.NO_MUTED_PREF)}get debug(){return ii(this,b.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(b.Attributes.DEBUG,""):this.removeAttribute(b.Attributes.DEBUG)}get disableTracking(){return ii(this,b.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(b.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return ii(this,b.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(b.Attributes.DISABLE_COOKIES,""):this.removeAttribute(b.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(b.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:O.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(b.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?r:O.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(m.DEFAULT_STREAM_TYPE,i):this.removeAttribute(m.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(m.TARGET_LIVE_WINDOW)?+this.getAttribute(m.TARGET_LIVE_WINDOW):(a=(i=this.media)==null?void 0:i.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(i){i==this.targetLiveWindow||Number.isNaN(i)&&Number.isNaN(this.targetLiveWindow)||(i==null?this.removeAttribute(m.TARGET_LIVE_WINDOW):this.setAttribute(m.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return fe(ii(this,b.Attributes.START_TIME))}set startTime(i){this.setAttribute(b.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(b.Attributes.PREFER_PLAYBACK);if(i===O.PlaybackTypes.MSE||i===O.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===O.PlaybackTypes.MSE||i===O.PlaybackTypes.NATIVE?this.setAttribute(b.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(b.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(J(this,W,Dt).call(this),!this.media){Ee("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...kh(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(J(this,W,Dt).call(this),!this.media){Ee("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=i}async addCuePoints(i){var a;if(J(this,W,Dt).call(this),!this.media){Ee("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(i)}get activeCuePoint(){var i;return(i=this.media)==null?void 0:i.activeCuePoint}get cuePoints(){var i,a;return(a=(i=this.media)==null?void 0:i.cuePoints)!=null?a:[]}addChapters(i){var a;if(J(this,W,Dt).call(this),!this.media){Ee("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(i)}get activeChapter(){var i;return(i=this.media)==null?void 0:i.activeChapter}get chapters(){var i,a;return(a=(i=this.media)==null?void 0:i.chapters)!=null?a:[]}getStartDate(){var i;return(i=this.media)==null?void 0:i.getStartDate()}get currentPdt(){var i;return(i=this.media)==null?void 0:i.currentPdt}get tokens(){let i=this.getAttribute(m.PLAYBACK_TOKEN),a=this.getAttribute(m.DRM_TOKEN),r=this.getAttribute(m.THUMBNAIL_TOKEN),o=this.getAttribute(m.STORYBOARD_TOKEN);return{...R(this,bo),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(i){de(this,bo,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(m.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(m.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(m.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(m.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(m.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(m.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(m.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(m.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,o){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,O.addTextTrack)(s,i,a,r,o)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,O.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(m.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(m.CAST_RECEIVER,i):this.removeAttribute(m.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){Ee("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(m.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(m.NO_TOOLTIPS);return}this.setAttribute(m.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(m.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}get capRenditionToPlayerSize(){var i;return(i=this.media)==null?void 0:i.capRenditionToPlayerSize}set capRenditionToPlayerSize(i){if(!this.media){Ee("underlying media element missing when trying to set capRenditionToPlayerSize");return}this.media.capRenditionToPlayerSize=i}};Eo=new WeakMap,Ha=new WeakMap,bo=new WeakMap,ai=new WeakMap,go=new WeakMap,Ba=new WeakMap,_o=new WeakMap,Ao=new WeakMap,Oi=new WeakMap,$a=new WeakMap,Pi=new WeakMap,To=new WeakMap,W=new WeakSet,Dt=function(){var i,a,r,o;if(!R(this,Ha)){de(this,Ha,!0),J(this,W,Di).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof Se.HTMLElement))throw""}catch{Ee("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{Ee("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof gl))throw""}catch{Ee("<media-controller> failed to upgrade!")}J(this,W,Mh).call(this),J(this,W,Lh).call(this),J(this,W,Ch).call(this),de(this,ai,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(I.USER_INACTIVE))!=null?a:!0),J(this,W,wh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",R(this,_o)),(o=this.media)==null||o.addEventListener("loadstart",R(this,Ao))}},Ih=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{}},hu=function(i){Object.assign(R(this,Pi),i),J(this,W,Di).call(this)},Di=function(i={}){Vm(Km(NE(this,{...R(this,Pi),...i})),this.shadowRoot)},Mh=function(){let i=a=>{var s,d;if(!(a!=null&&a.startsWith("theme-")))return;let r=a.replace(/^theme-/,"");if(du.includes(r))return;let o=this.getAttribute(a);o!=null?(s=this.mediaTheme)==null||s.setAttribute(r,o):(d=this.mediaTheme)==null||d.removeAttribute(r)};de(this,Ba,new MutationObserver(a=>{for(let{attributeName:r}of a)i(r)})),R(this,Ba).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},Lh=function(){this.addEventListener("error",R(this,To)),this.media&&(this.media.errorTranslator=(i={})=>{var r,o,s;if(!(((r=this.media)==null?void 0:r.error)instanceof b.MediaError))return i;let a=_d((o=this.media)==null?void 0:o.error,!1);return{player_error_code:(s=this.media)==null?void 0:s.error.code,player_error_message:a.message?String(a.message):i.player_error_message,player_error_context:a.context?String(a.context):i.player_error_context}})},Ch=function(){var i,a,r,o;(a=(i=this.media)==null?void 0:i.textTracks)==null||a.addEventListener("addtrack",R(this,Oi)),(o=(r=this.media)==null?void 0:r.textTracks)==null||o.addEventListener("removetrack",R(this,Oi))},wh=function(){var y,A;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===O.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(E,p,k=!1)=>{if(o())return;Array.from(E&&E.activeCues||[]).forEach(S=>{if(!(!S.snapToLines||S.line<-5||S.line>=0&&S.line<10))if(!p||this.paused){let C=S.text.split(`
|
|
3256
|
+
`).length,j=-3;this.streamType===O.StreamTypes.LIVE&&(j=-2);let Ue=j-C;if(S.line===Ue&&!k)return;r.has(S)||r.set(S,S.line),S.line=Ue}else setTimeout(()=>{S.line=r.get(S)||"auto"},500)})},d=()=>{var E,p;s(a,(p=(E=this.mediaController)==null?void 0:E.hasAttribute(I.USER_INACTIVE))!=null?p:!1)},u=()=>{var k,g;let p=Array.from(((g=(k=this.mediaController)==null?void 0:k.media)==null?void 0:g.textTracks)||[]).filter(S=>["subtitles","captions"].includes(S.kind)&&S.mode==="showing")[0];p!==a&&(a==null||a.removeEventListener("cuechange",d)),a=p,a==null||a.addEventListener("cuechange",d),s(a,R(this,ai))};u(),(y=this.textTracks)==null||y.addEventListener("change",u),(A=this.textTracks)==null||A.addEventListener("addtrack",u);let v=()=>{var p,k;let E=(k=(p=this.mediaController)==null?void 0:p.hasAttribute(I.USER_INACTIVE))!=null?k:!0;R(this,ai)!==E&&(de(this,ai,E),s(a,R(this,ai)))};this.addEventListener("userinactivechange",v),de(this,$a,()=>{var E,p;a==null||a.removeEventListener("cuechange",d),(E=this.textTracks)==null||E.removeEventListener("change",u),(p=this.textTracks)==null||p.removeEventListener("addtrack",u),this.removeEventListener("userinactivechange",v)})};function ii(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var KE=mu;
|