@mux/mux-player 3.11.6 → 3.11.7-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -135,7 +135,7 @@ Schedule: ${l.map(p=>Ci(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
135
135
  <slot name="logo">
136
136
  ${this.getLogoHTML((e=i[w.LOGO])!=null?e:"")}
137
137
  </slot>
138
- `}get preferCmcd(){var i;return(i=this.getAttribute(w.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?aa.includes(i)?this.setAttribute(w.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${aa.join()}`):this.removeAttribute(w.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(w.PLAYER_INIT_TIME)?+this.getAttribute(w.PLAYER_INIT_TIME):mt(this,Qu)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(w.PLAYER_INIT_TIME):this.setAttribute(w.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=mt(this,ec))!=null?i:o_}set playerSoftwareName(i){Pi(this,ec,i)}get playerSoftwareVersion(){var i;return(i=mt(this,Ju))!=null?i:a_}set playerSoftwareVersion(i){Pi(this,Ju,i)}get _hls(){var i;return(i=mt(this,Ei,tn))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=Cg(this.nativeEl))!=null?i:null}get errorTranslator(){return mt(this,tc)}set errorTranslator(i){Pi(this,tc,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(w.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(w.TYPE,i):this.removeAttribute(w.TYPE))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(w.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(w.DEBUG,""):this.removeAttribute(w.DEBUG))}get disableTracking(){return this.hasAttribute(w.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(w.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(w.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(w.DISABLE_COOKIES,""):this.removeAttribute(w.DISABLE_COOKIES))}get disablePseudoEnded(){return this.hasAttribute(w.DISABLE_PSEUDO_ENDED)}set disablePseudoEnded(i){i!==this.disablePseudoEnded&&(i?this.setAttribute(w.DISABLE_PSEUDO_ENDED,""):this.removeAttribute(w.DISABLE_PSEUDO_ENDED))}get startTime(){let i=this.getAttribute(w.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(w.START_TIME):this.setAttribute(w.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(w.PLAYBACK_ID)?this.getAttribute(w.PLAYBACK_ID):(i=Yu(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(w.PLAYBACK_ID,i):this.removeAttribute(w.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(w.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(w.MAX_RESOLUTION,i):this.removeAttribute(w.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(w.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(w.MIN_RESOLUTION,i):this.removeAttribute(w.MIN_RESOLUTION))}get maxAutoResolution(){var i;return(i=this.getAttribute(w.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(w.MAX_AUTO_RESOLUTION):this.setAttribute(w.MAX_AUTO_RESOLUTION,i)}get renditionOrder(){var i;return(i=this.getAttribute(w.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(w.RENDITION_ORDER,i):this.removeAttribute(w.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(w.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(w.PROGRAM_START_TIME):this.setAttribute(w.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(w.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(w.PROGRAM_END_TIME):this.setAttribute(w.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(w.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(w.ASSET_START_TIME):this.setAttribute(w.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(w.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(w.ASSET_END_TIME):this.setAttribute(w.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(w.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(w.CUSTOM_DOMAIN,i):this.removeAttribute(w.CUSTOM_DOMAIN))}get capRenditionToPlayerSize(){var i;return((i=this._hlsConfig)==null?void 0:i.capLevelToPlayerSize)!=null?this._hlsConfig.capLevelToPlayerSize:mt(this,sc)}set capRenditionToPlayerSize(i){Pi(this,sc,i)}get drmToken(){var i;return(i=this.getAttribute(w.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(w.DRM_TOKEN,i):this.removeAttribute(w.DRM_TOKEN))}get playbackToken(){var i,e,t,s;if(this.hasAttribute(w.PLAYBACK_TOKEN))return(i=this.getAttribute(w.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(w.PLAYBACK_ID)){let[,r]=Gu((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(r).get("token"))!=null?t:void 0}if(this.src)return(s=new URLSearchParams(this.src).get("token"))!=null?s:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(w.PLAYBACK_TOKEN,i):this.removeAttribute(w.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(w.PLAYBACK_TOKEN),e=this.getAttribute(w.DRM_TOKEN);return{...mt(this,Xu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Pi(this,Xu,i!=null?i:{})}get ended(){return Mg(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(w.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(w.ENV_KEY,i):this.removeAttribute(w.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(w.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(w.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(w.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(w.STREAM_TYPE))!=null?i:Hu(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(w.STREAM_TYPE,i):this.removeAttribute(w.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(w.TARGET_LIVE_WINDOW)?+this.getAttribute(w.TARGET_LIVE_WINDOW):$T(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(w.TARGET_LIVE_WINDOW):this.setAttribute(w.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(w.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,s=(i=this.nativeEl.seekable.end(0))!=null?i:0,r=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(r,s-t)}return HT(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(w.LIVE_EDGE_OFFSET))return+this.getAttribute(w.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(w.LIVE_EDGE_OFFSET):this.setAttribute(w.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return ju(this.nativeEl)}async addCuePoints(i){return Ig(this.nativeEl,i)}get activeCuePoint(){return Lg(this.nativeEl)}get cuePoints(){return wT(this.nativeEl)}async addChapters(i){return Rg(this.nativeEl,i)}get activeChapter(){return kg(this.nativeEl)}get chapters(){return PT(this.nativeEl)}getStartDate(){return OT(this.nativeEl,this._hls)}get currentPdt(){return NT(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(w.PREFER_PLAYBACK);if(i===gi.MSE||i===gi.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===gi.MSE||i===gi.NATIVE?this.setAttribute(w.PREFER_PLAYBACK,i):this.removeAttribute(w.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![w.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...mt(this,nl)}}set metadata(i){Pi(this,nl,i!=null?i:{}),this.mux&&this.mux.emit("hb",mt(this,nl))}get _hlsConfig(){return mt(this,Zu)}set _hlsConfig(i){Pi(this,Zu,i)}get logo(){var i;return(i=this.getAttribute(w.LOGO))!=null?i:mt(this,al)}set logo(i){i?this.setAttribute(w.LOGO,i):this.removeAttribute(w.LOGO)}load(){Pg(this,this.nativeEl,mt(this,Ei,tn))}unload(){Og(this.nativeEl,mt(this,Ei,tn),this)}attributeChangedCallback(i,e,t){var s,r;switch(sl.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case w.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case w.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?zu(this,Ei,ol).call(this):n&&!a?this.unload():n&&a&&(this.unload(),zu(this,Ei,ol).call(this));break}case"autoplay":if(t===e)break;(s=mt(this,Ei,tn))==null||s.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(r=mt(this,Ei,tn))==null||r.setPreload(t);break;case w.PLAYBACK_ID:this.src=il(this);break;case w.DEBUG:{let n=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=n);break}case w.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case w.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case w.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;case w.LOGO:(t==null||t!==e)&&this.updateLogo();break;case w.DISABLE_TRACKING:{if(t==null||t!==e){let n=this.currentTime,a=this.paused;this.unload(),zu(this,Ei,ol).call(this).then(()=>{this.currentTime=n,a||this.play()})}break}case w.DISABLE_COOKIES:{(t==null||t!==e)&&this.disableCookies&&document.cookie.split(";").forEach(n=>{n.trim().startsWith("muxData")&&(document.cookie=n.replace(/^ +/,"").replace(/=.*/,"=;expires="+new Date().toUTCString()+";path=/"))});break}case w.CAP_RENDITION_TO_PLAYER_SIZE:(t==null||t!==e)&&(this.capRenditionToPlayerSize=t!=null?!0:void 0)}}updateLogo(){if(!this.shadowRoot)return;let i=this.shadowRoot.querySelector('slot[name="logo"]');if(!i)return;let e=this.constructor.getLogoHTML(mt(this,al)||this.logo);i.innerHTML=e}connectedCallback(){var i,e;(i=super.connectedCallback)==null||i.call(this),(e=this.nativeEl)==null||e.addEventListener("muxmetadata",mt(this,ic)),this.nativeEl&&this.src&&!mt(this,Ei,tn)&&zu(this,Ei,ol).call(this)}disconnectedCallback(){var i,e;(i=this.nativeEl)==null||i.removeEventListener("muxmetadata",mt(this,ic)),this.unload(),(e=super.disconnectedCallback)==null||e.call(this)}handleEvent(i){i.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(i.type,{composed:!0,detail:i.detail}))}};rl=new WeakMap,Qu=new WeakMap,nl=new WeakMap,Xu=new WeakMap,Zu=new WeakMap,Ju=new WeakMap,ec=new WeakMap,tc=new WeakMap,al=new WeakMap,ic=new WeakMap,Ei=new WeakSet,tn=function(){return GT(this.nativeEl)},sc=new WeakMap,ol=async function(){mt(this,rl)||(await Pi(this,rl,Promise.resolve()),Pi(this,rl,null),this.load())};var ts=new WeakMap,oa=class extends Error{},rc=class extends Error{};var $w=["application/x-mpegURL","application/vnd.apple.mpegurl","audio/mpegurl"],u_=globalThis.WeakRef?class extends Set{add(i){super.add(new WeakRef(i))}forEach(i){super.forEach(e=>{let t=e.deref();t&&i(t)})}}:Set;function c_(i){var e,t,s;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(s=globalThis.cast)!=null&&s.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function h_(){return globalThis.chrome}function f_(){var t;let i="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((t=globalThis.chrome)!=null&&t.cast||document.querySelector(`script[src="${i}"]`))return;let e=document.createElement("script");e.src=i,document.head.append(e)}function Cs(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function ll(){var i;return(i=Cs())==null?void 0:i.getCurrentSession()}function nc(){var i;return(i=ll())==null?void 0:i.getSessionObj().media[0]}function m_(i){return new Promise((e,t)=>{nc().editTracksInfo(i,e,t)})}function p_(i){return new Promise((e,t)=>{nc().getStatus(i,e,t)})}function $g(i){return Cs().setOptions({...Hg(),...i})}function Hg(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}function Hw(i){if(!i)return;let e=/\.([a-zA-Z0-9]+)(?:\?.*)?$/,t=i.match(e);return t?t[1]:null}function Gw(i){let e=i.split(`
138
+ `}get preferCmcd(){var i;return(i=this.getAttribute(w.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?aa.includes(i)?this.setAttribute(w.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${aa.join()}`):this.removeAttribute(w.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(w.PLAYER_INIT_TIME)?+this.getAttribute(w.PLAYER_INIT_TIME):mt(this,Qu)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(w.PLAYER_INIT_TIME):this.setAttribute(w.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=mt(this,ec))!=null?i:o_}set playerSoftwareName(i){Pi(this,ec,i)}get playerSoftwareVersion(){var i;return(i=mt(this,Ju))!=null?i:a_}set playerSoftwareVersion(i){Pi(this,Ju,i)}get _hls(){var i;return(i=mt(this,Ei,tn))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=Cg(this.nativeEl))!=null?i:null}get errorTranslator(){return mt(this,tc)}set errorTranslator(i){Pi(this,tc,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(w.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(w.TYPE,i):this.removeAttribute(w.TYPE))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(w.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(w.DEBUG,""):this.removeAttribute(w.DEBUG))}get disableTracking(){return this.hasAttribute(w.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(w.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(w.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(w.DISABLE_COOKIES,""):this.removeAttribute(w.DISABLE_COOKIES))}get disablePseudoEnded(){return this.hasAttribute(w.DISABLE_PSEUDO_ENDED)}set disablePseudoEnded(i){i!==this.disablePseudoEnded&&(i?this.setAttribute(w.DISABLE_PSEUDO_ENDED,""):this.removeAttribute(w.DISABLE_PSEUDO_ENDED))}get startTime(){let i=this.getAttribute(w.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(w.START_TIME):this.setAttribute(w.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(w.PLAYBACK_ID)?this.getAttribute(w.PLAYBACK_ID):(i=Yu(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(w.PLAYBACK_ID,i):this.removeAttribute(w.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(w.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(w.MAX_RESOLUTION,i):this.removeAttribute(w.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(w.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(w.MIN_RESOLUTION,i):this.removeAttribute(w.MIN_RESOLUTION))}get maxAutoResolution(){var i;return(i=this.getAttribute(w.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(w.MAX_AUTO_RESOLUTION):this.setAttribute(w.MAX_AUTO_RESOLUTION,i)}get renditionOrder(){var i;return(i=this.getAttribute(w.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(w.RENDITION_ORDER,i):this.removeAttribute(w.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(w.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(w.PROGRAM_START_TIME):this.setAttribute(w.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(w.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(w.PROGRAM_END_TIME):this.setAttribute(w.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(w.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(w.ASSET_START_TIME):this.setAttribute(w.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(w.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(w.ASSET_END_TIME):this.setAttribute(w.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(w.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(w.CUSTOM_DOMAIN,i):this.removeAttribute(w.CUSTOM_DOMAIN))}get capRenditionToPlayerSize(){var i;return((i=this._hlsConfig)==null?void 0:i.capLevelToPlayerSize)!=null?this._hlsConfig.capLevelToPlayerSize:mt(this,sc)}set capRenditionToPlayerSize(i){Pi(this,sc,i)}get drmToken(){var i;return(i=this.getAttribute(w.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(w.DRM_TOKEN,i):this.removeAttribute(w.DRM_TOKEN))}get playbackToken(){var i,e,t,s;if(this.hasAttribute(w.PLAYBACK_TOKEN))return(i=this.getAttribute(w.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(w.PLAYBACK_ID)){let[,r]=Gu((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(r).get("token"))!=null?t:void 0}if(this.src)return(s=new URLSearchParams(this.src).get("token"))!=null?s:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(w.PLAYBACK_TOKEN,i):this.removeAttribute(w.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(w.PLAYBACK_TOKEN),e=this.getAttribute(w.DRM_TOKEN);return{...mt(this,Xu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Pi(this,Xu,i!=null?i:{})}get ended(){return Mg(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(w.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(w.ENV_KEY,i):this.removeAttribute(w.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(w.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(w.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(w.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(w.STREAM_TYPE))!=null?i:Hu(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(w.STREAM_TYPE,i):this.removeAttribute(w.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(w.TARGET_LIVE_WINDOW)?+this.getAttribute(w.TARGET_LIVE_WINDOW):$T(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(w.TARGET_LIVE_WINDOW):this.setAttribute(w.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(w.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,s=(i=this.nativeEl.seekable.end(0))!=null?i:0,r=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(r,s-t)}return HT(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(w.LIVE_EDGE_OFFSET))return+this.getAttribute(w.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(w.LIVE_EDGE_OFFSET):this.setAttribute(w.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return ju(this.nativeEl)}async addCuePoints(i){return Ig(this.nativeEl,i)}get activeCuePoint(){return Lg(this.nativeEl)}get cuePoints(){return wT(this.nativeEl)}async addChapters(i){return Rg(this.nativeEl,i)}get activeChapter(){return kg(this.nativeEl)}get chapters(){return PT(this.nativeEl)}getStartDate(){return OT(this.nativeEl,this._hls)}get currentPdt(){return NT(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(w.PREFER_PLAYBACK);if(i===gi.MSE||i===gi.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===gi.MSE||i===gi.NATIVE?this.setAttribute(w.PREFER_PLAYBACK,i):this.removeAttribute(w.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![w.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...mt(this,nl)}}set metadata(i){Pi(this,nl,i!=null?i:{}),this.mux&&this.mux.emit("hb",mt(this,nl))}get _hlsConfig(){return mt(this,Zu)}set _hlsConfig(i){Pi(this,Zu,i)}get logo(){var i;return(i=this.getAttribute(w.LOGO))!=null?i:mt(this,al)}set logo(i){i?this.setAttribute(w.LOGO,i):this.removeAttribute(w.LOGO)}load(){Pg(this,this.nativeEl,mt(this,Ei,tn))}unload(){Og(this.nativeEl,mt(this,Ei,tn),this)}attributeChangedCallback(i,e,t){var s,r;switch(sl.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case w.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case w.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?zu(this,Ei,ol).call(this):n&&!a?this.unload():n&&a&&(this.unload(),zu(this,Ei,ol).call(this));break}case"autoplay":if(t===e)break;(s=mt(this,Ei,tn))==null||s.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(r=mt(this,Ei,tn))==null||r.setPreload(t);break;case w.PLAYBACK_ID:case w.CUSTOM_DOMAIN:case w.MAX_RESOLUTION:case w.MIN_RESOLUTION:case w.RENDITION_ORDER:case w.PROGRAM_START_TIME:case w.PROGRAM_END_TIME:case w.ASSET_START_TIME:case w.ASSET_END_TIME:case w.PLAYBACK_TOKEN:this.src=il(this);break;case w.DEBUG:{let n=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=n);break}case w.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case w.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case w.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;case w.LOGO:(t==null||t!==e)&&this.updateLogo();break;case w.DISABLE_TRACKING:{if(t==null||t!==e){let n=this.currentTime,a=this.paused;this.unload(),zu(this,Ei,ol).call(this).then(()=>{this.currentTime=n,a||this.play()})}break}case w.DISABLE_COOKIES:{(t==null||t!==e)&&this.disableCookies&&document.cookie.split(";").forEach(n=>{n.trim().startsWith("muxData")&&(document.cookie=n.replace(/^ +/,"").replace(/=.*/,"=;expires="+new Date().toUTCString()+";path=/"))});break}case w.CAP_RENDITION_TO_PLAYER_SIZE:(t==null||t!==e)&&(this.capRenditionToPlayerSize=t!=null?!0:void 0)}}updateLogo(){if(!this.shadowRoot)return;let i=this.shadowRoot.querySelector('slot[name="logo"]');if(!i)return;let e=this.constructor.getLogoHTML(mt(this,al)||this.logo);i.innerHTML=e}connectedCallback(){var i,e;(i=super.connectedCallback)==null||i.call(this),(e=this.nativeEl)==null||e.addEventListener("muxmetadata",mt(this,ic)),this.nativeEl&&this.src&&!mt(this,Ei,tn)&&zu(this,Ei,ol).call(this)}disconnectedCallback(){var i,e;(i=this.nativeEl)==null||i.removeEventListener("muxmetadata",mt(this,ic)),this.unload(),(e=super.disconnectedCallback)==null||e.call(this)}handleEvent(i){i.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(i.type,{composed:!0,detail:i.detail}))}};rl=new WeakMap,Qu=new WeakMap,nl=new WeakMap,Xu=new WeakMap,Zu=new WeakMap,Ju=new WeakMap,ec=new WeakMap,tc=new WeakMap,al=new WeakMap,ic=new WeakMap,Ei=new WeakSet,tn=function(){return GT(this.nativeEl)},sc=new WeakMap,ol=async function(){mt(this,rl)||(await Pi(this,rl,Promise.resolve()),Pi(this,rl,null),this.load())};var ts=new WeakMap,oa=class extends Error{},rc=class extends Error{};var $w=["application/x-mpegURL","application/vnd.apple.mpegurl","audio/mpegurl"],u_=globalThis.WeakRef?class extends Set{add(i){super.add(new WeakRef(i))}forEach(i){super.forEach(e=>{let t=e.deref();t&&i(t)})}}:Set;function c_(i){var e,t,s;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(s=globalThis.cast)!=null&&s.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function h_(){return globalThis.chrome}function f_(){var t;let i="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((t=globalThis.chrome)!=null&&t.cast||document.querySelector(`script[src="${i}"]`))return;let e=document.createElement("script");e.src=i,document.head.append(e)}function Cs(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function ll(){var i;return(i=Cs())==null?void 0:i.getCurrentSession()}function nc(){var i;return(i=ll())==null?void 0:i.getSessionObj().media[0]}function m_(i){return new Promise((e,t)=>{nc().editTracksInfo(i,e,t)})}function p_(i){return new Promise((e,t)=>{nc().getStatus(i,e,t)})}function $g(i){return Cs().setOptions({...Hg(),...i})}function Hg(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}function Hw(i){if(!i)return;let e=/\.([a-zA-Z0-9]+)(?:\?.*)?$/,t=i.match(e);return t?t[1]:null}function Gw(i){let e=i.split(`
139
139
  `),t=[];for(let s=0;s<e.length;s++)if(e[s].trim().startsWith("#EXT-X-STREAM-INF")){let n=e[s+1]?e[s+1].trim():"";n&&!n.startsWith("#")&&t.push(n)}return t}function Kw(i){return i.split(`
140
140
  `).find(s=>!s.trim().startsWith("#")&&s.trim()!=="")}async function g_(i){try{let t=(await fetch(i,{method:"HEAD"})).headers.get("Content-Type");return $w.some(s=>t===s)}catch(e){return console.error("Error while trying to get the Content-Type of the manifest",e),!1}}async function v_(i){try{let e=await(await fetch(i)).text(),t=e,s=Gw(e);if(s.length>0){let a=new URL(s[0],i).toString();t=await(await fetch(a)).text()}let r=Kw(t);return Hw(r)}catch(e){console.error("Error while trying to parse the manifest playlist",e);return}}var ac=new u_,ws=new WeakSet,At;c_(()=>{var i,e,t,s;if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable)){console.debug("chrome.cast.isAvailable",(s=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:s.isAvailable);return}At||(At=cast.framework,Cs().addEventListener(At.CastContextEventType.CAST_STATE_CHANGED,r=>{ac.forEach(n=>{var a,o;return(o=(a=ts.get(n)).onCastStateChanged)==null?void 0:o.call(a,r)})}),Cs().addEventListener(At.CastContextEventType.SESSION_STATE_CHANGED,r=>{ac.forEach(n=>{var a,o;return(o=(a=ts.get(n)).onSessionStateChanged)==null?void 0:o.call(a,r)})}),ac.forEach(r=>{var n,a;return(a=(n=ts.get(r)).init)==null?void 0:a.call(n)}))});var E_=0,Ce,la,Ht,Oi,rn,nn,or,lc,dl,ze,sn,y_,b_,Gg,T_,Kg,__,Vg,oc=class extends EventTarget{constructor(t){super();oe(this,ze);oe(this,Ce);oe(this,la);oe(this,Ht);oe(this,Oi);oe(this,rn,"disconnected");oe(this,nn,!1);oe(this,or,new Set);oe(this,lc,new WeakMap);oe(this,dl,()=>Ne(this,ze,Vg).call(this));ee(this,Ce,t),ac.add(this),ts.set(this,{init:()=>Ne(this,ze,Kg).call(this),onCastStateChanged:()=>Ne(this,ze,Gg).call(this),onSessionStateChanged:()=>Ne(this,ze,T_).call(this),getCastPlayer:()=>C(this,ze,sn)}),Ne(this,ze,Kg).call(this)}destroy(){var t,s,r;(s=(t=C(this,Ce))==null?void 0:t.textTracks)==null||s.removeEventListener("change",C(this,dl)),C(this,Oi)&&((r=C(this,Ht))!=null&&r.controller)&&Object.entries(C(this,Oi)).forEach(([n,a])=>{C(this,Ht).controller.removeEventListener(n,a)}),C(this,Ce)&&ws.delete(C(this,Ce)),ee(this,la,!1)}get state(){return C(this,rn)}async watchAvailability(t){if(C(this,Ce).disableRemotePlayback)throw new oa("disableRemotePlayback attribute is present.");return C(this,lc).set(t,++E_),C(this,or).add(t),queueMicrotask(()=>t(Ne(this,ze,b_).call(this))),E_}async cancelWatchAvailability(t){if(C(this,Ce).disableRemotePlayback)throw new oa("disableRemotePlayback attribute is present.");t?C(this,or).delete(t):C(this,or).clear()}async prompt(){var s,r,n,a;if(C(this,Ce).disableRemotePlayback)throw new oa("disableRemotePlayback attribute is present.");if(!((r=(s=globalThis.chrome)==null?void 0:s.cast)!=null&&r.isAvailable))throw new rc("The RemotePlayback API is disabled on this platform.");let t=ws.has(C(this,Ce));ws.add(C(this,Ce)),$g(C(this,Ce).castOptions),Object.entries(C(this,Oi)).forEach(([o,l])=>{C(this,Ht).controller.addEventListener(o,l)});try{await Cs().requestSession()}catch(o){if(t||ws.delete(C(this,Ce)),o==="cancel")return;throw new Error(o)}(a=(n=ts.get(C(this,Ce)))==null?void 0:n.loadOnPrompt)==null||a.call(n)}};Ce=new WeakMap,la=new WeakMap,Ht=new WeakMap,Oi=new WeakMap,rn=new WeakMap,nn=new WeakMap,or=new WeakMap,lc=new WeakMap,dl=new WeakMap,ze=new WeakSet,sn=function(){if(ws.has(C(this,Ce)))return C(this,Ht)},y_=function(){ws.has(C(this,Ce))&&(Object.entries(C(this,Oi)).forEach(([t,s])=>{C(this,Ht).controller.removeEventListener(t,s)}),ws.delete(C(this,Ce)),C(this,Ce).muted=C(this,Ht).isMuted,C(this,Ce).currentTime=C(this,Ht).savedPlayerState.currentTime,C(this,Ht).savedPlayerState.isPaused===!1&&C(this,Ce).play())},b_=function(){var s;let t=(s=Cs())==null?void 0:s.getCastState();return t&&t!=="NO_DEVICES_AVAILABLE"},Gg=function(){let t=Cs().getCastState();if(ws.has(C(this,Ce))&&t==="CONNECTING"&&(ee(this,rn,"connecting"),this.dispatchEvent(new Event("connecting"))),!C(this,nn)&&(t!=null&&t.includes("CONNECT"))){ee(this,nn,!0);for(let s of C(this,or))s(!0)}else if(C(this,nn)&&(!t||t==="NO_DEVICES_AVAILABLE")){ee(this,nn,!1);for(let s of C(this,or))s(!1)}},T_=async function(){var s;let{SESSION_RESUMED:t}=At.SessionState;if(Cs().getSessionState()===t&&C(this,Ce).castSrc===((s=nc())==null?void 0:s.media.contentId)){ws.add(C(this,Ce)),Object.entries(C(this,Oi)).forEach(([r,n])=>{C(this,Ht).controller.addEventListener(r,n)});try{await p_(new chrome.cast.media.GetStatusRequest)}catch(r){console.error(r)}C(this,Oi)[At.RemotePlayerEventType.IS_PAUSED_CHANGED](),C(this,Oi)[At.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Kg=function(){!At||C(this,la)||(ee(this,la,!0),$g(C(this,Ce).castOptions),C(this,Ce).textTracks.addEventListener("change",C(this,dl)),Ne(this,ze,Gg).call(this),ee(this,Ht,new At.RemotePlayer),new At.RemotePlayerController(C(this,Ht)),ee(this,Oi,{[At.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:t})=>{t===!0?(ee(this,rn,"connected"),this.dispatchEvent(new Event("connect"))):(Ne(this,ze,y_).call(this),ee(this,rn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[At.RemotePlayerEventType.DURATION_CHANGED]:()=>{C(this,Ce).dispatchEvent(new Event("durationchange"))},[At.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{C(this,Ce).dispatchEvent(new Event("volumechange"))},[At.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{C(this,Ce).dispatchEvent(new Event("volumechange"))},[At.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var t;(t=C(this,ze,sn))!=null&&t.isMediaLoaded&&C(this,Ce).dispatchEvent(new Event("timeupdate"))},[At.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{C(this,Ce).dispatchEvent(new Event("resize"))},[At.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{C(this,Ce).dispatchEvent(new Event(this.paused?"pause":"play"))},[At.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var t,s;((t=C(this,ze,sn))==null?void 0:t.playerState)!==chrome.cast.media.PlayerState.PAUSED&&C(this,Ce).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(s=C(this,ze,sn))==null?void 0:s.playerState]))},[At.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var t;(t=C(this,ze,sn))!=null&&t.isMediaLoaded&&(await Promise.resolve(),Ne(this,ze,__).call(this))}}))},__=function(){Ne(this,ze,Vg).call(this)},Vg=async function(){var h,f,m,p,g;if(!C(this,ze,sn))return;let s=((f=(h=C(this,Ht).mediaInfo)==null?void 0:h.tracks)!=null?f:[]).filter(({type:v})=>v===chrome.cast.media.TrackType.TEXT),r=[...C(this,Ce).textTracks].filter(({kind:v})=>v==="subtitles"||v==="captions"),n=s.map(({language:v,name:b,trackId:E})=>{var A;let{mode:T}=(A=r.find(x=>x.language===v&&x.label===b))!=null?A:{};return T?{mode:T,trackId:E}:!1}).filter(Boolean),o=n.filter(({mode:v})=>v!=="showing").map(({trackId:v})=>v),l=n.find(({mode:v})=>v==="showing"),d=(g=(p=(m=ll())==null?void 0:m.getSessionObj().media[0])==null?void 0:p.activeTrackIds)!=null?g:[],u=d;if(d.length&&(u=u.filter(v=>!o.includes(v))),l!=null&&l.trackId&&(u=[...u,l.trackId]),u=[...new Set(u)],!((v,b)=>v.length===b.length&&v.every(E=>b.includes(E)))(d,u))try{let v=new chrome.cast.media.EditTracksInfoRequest(u);await m_(v)}catch(v){console.error(v)}};var A_=i=>{var e,t,s,r,n,a,o,Me,S_;return t=class extends i{constructor(){super(...arguments);oe(this,o);oe(this,s,{paused:!1});oe(this,r,Hg());oe(this,n);oe(this,a)}get remote(){return C(this,a)?C(this,a):h_()?this.isConnected?(this.disableRemotePlayback||f_(),ts.set(this,{loadOnPrompt:()=>Ne(this,o,S_).call(this)}),ee(this,a,new oc(this))):void 0:super.remote}disconnectedCallback(){var h,f;(h=C(this,a))==null||h.destroy(),ee(this,a,null),ts.delete(this),(f=super.disconnectedCallback)==null||f.call(this)}attributeChangedCallback(h,f,m){if(super.attributeChangedCallback(h,f,m),h==="cast-receiver"&&m){C(this,r).receiverApplicationId=m;return}if(C(this,o,Me))switch(h){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var v,b;if(!C(this,o,Me))return super.load();let h=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);h.customData=this.castCustomData;let f=[...this.querySelectorAll("track")].filter(({kind:E,src:T})=>T&&(E==="subtitles"||E==="captions")),m=[],p=0;if(f.length&&(h.tracks=f.map(E=>{let T=++p;m.length===0&&E.track.mode==="showing"&&m.push(T);let A=new chrome.cast.media.Track(T,chrome.cast.media.TrackType.TEXT);return A.trackContentId=E.src,A.trackContentType="text/vtt",A.subtype=E.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,A.name=E.label,A.language=E.srclang,A})),this.castStreamType==="live"?h.streamType=chrome.cast.media.StreamType.LIVE:h.streamType=chrome.cast.media.StreamType.BUFFERED,h.metadata=new chrome.cast.media.GenericMediaMetadata,h.metadata.title=this.title,h.metadata.images=[{url:this.poster}],g_(this.castSrc)){let E=await v_(this.castSrc);(E==null?void 0:E.includes("m4s"))||(E==null?void 0:E.includes("mp4"))?(h.hlsSegmentFormat=chrome.cast.media.HlsSegmentFormat.FMP4,h.hlsVideoSegmentFormat=chrome.cast.media.HlsVideoSegmentFormat.FMP4):E!=null&&E.includes("ts")&&(h.hlsSegmentFormat=chrome.cast.media.HlsSegmentFormat.TS,h.hlsVideoSegmentFormat=chrome.cast.media.HlsVideoSegmentFormat.TS)}let g=new chrome.cast.media.LoadRequest(h);g.currentTime=(v=super.currentTime)!=null?v:0,g.autoplay=!C(this,s).paused,g.activeTrackIds=m,await((b=ll())==null?void 0:b.loadMedia(g)),this.dispatchEvent(new Event("volumechange"))}play(){var h;if(C(this,o,Me)){C(this,o,Me).isPaused&&((h=C(this,o,Me).controller)==null||h.playOrPause());return}return super.play()}pause(){var h;if(C(this,o,Me)){C(this,o,Me).isPaused||(h=C(this,o,Me).controller)==null||h.playOrPause();return}super.pause()}get castOptions(){return C(this,r)}get castReceiver(){var h;return(h=this.getAttribute("cast-receiver"))!=null?h:void 0}set castReceiver(h){this.castReceiver!=h&&this.setAttribute("cast-receiver",`${h}`)}get castSrc(){var h,f,m;return(m=(f=this.getAttribute("cast-src"))!=null?f:(h=this.querySelector("source"))==null?void 0:h.src)!=null?m:this.currentSrc}set castSrc(h){this.castSrc!=h&&this.setAttribute("cast-src",`${h}`)}get castContentType(){var h;return(h=this.getAttribute("cast-content-type"))!=null?h:void 0}set castContentType(h){this.setAttribute("cast-content-type",`${h}`)}get castStreamType(){var h,f;return(f=(h=this.getAttribute("cast-stream-type"))!=null?h:this.streamType)!=null?f:void 0}set castStreamType(h){this.setAttribute("cast-stream-type",`${h}`)}get castCustomData(){return C(this,n)}set castCustomData(h){let f=typeof h;if(!["object","undefined"].includes(f)){console.error(`castCustomData must be nullish or an object but value was of type ${f}`);return}ee(this,n,h)}get readyState(){if(C(this,o,Me))switch(C(this,o,Me).playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return C(this,o,Me)?C(this,o,Me).isPaused:super.paused}get muted(){var h;return C(this,o,Me)?(h=C(this,o,Me))==null?void 0:h.isMuted:super.muted}set muted(h){var f;if(C(this,o,Me)){(h&&!C(this,o,Me).isMuted||!h&&C(this,o,Me).isMuted)&&((f=C(this,o,Me).controller)==null||f.muteOrUnmute());return}super.muted=h}get volume(){var h,f;return C(this,o,Me)?(f=(h=C(this,o,Me))==null?void 0:h.volumeLevel)!=null?f:1:super.volume}set volume(h){var f;if(C(this,o,Me)){C(this,o,Me).volumeLevel=+h,(f=C(this,o,Me).controller)==null||f.setVolumeLevel();return}super.volume=h}get duration(){var h,f,m;return C(this,o,Me)&&((h=C(this,o,Me))!=null&&h.isMediaLoaded)?(m=(f=C(this,o,Me))==null?void 0:f.duration)!=null?m:NaN:super.duration}get currentTime(){var h,f,m;return C(this,o,Me)&&((h=C(this,o,Me))!=null&&h.isMediaLoaded)?(m=(f=C(this,o,Me))==null?void 0:f.currentTime)!=null?m:0:super.currentTime}set currentTime(h){var f;if(C(this,o,Me)){C(this,o,Me).currentTime=h,(f=C(this,o,Me).controller)==null||f.seek();return}super.currentTime=h}},s=new WeakMap,r=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakSet,Me=function(){var h,f;return(f=(h=ts.get(this.remote))==null?void 0:h.getCastPlayer)==null?void 0:f.call(h)},S_=async function(){C(this,s).paused=wd(t.prototype,this,"paused"),wd(t.prototype,this,"pause").call(this),this.muted=wd(t.prototype,this,"muted");try{await this.load()}catch(h){console.error(h)}},Ae(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t};var Ms=class extends Event{constructor(t,s){super(t);Ae(this,"track");this.track=s.track}};var Wg=new WeakMap;function X(i){var e;return(e=Wg.get(i))!=null?e:Vw(i,{})}function Vw(i,e){let t=Wg.get(i);return t||Wg.set(i,t={}),Object.assign(t,e)}function dc(i,e){let t=i.videoTracks;X(e).media=new WeakRef(i),X(e).renditionSet||(X(e).renditionSet=new Set);let s=X(t).trackSet;s.add(e);let r=s.size-1;r in on.prototype||Object.defineProperty(on.prototype,r,{get(){return[...X(this).trackSet][r]}}),queueMicrotask(()=>{t.dispatchEvent(new Ms("addtrack",{track:e}))})}function uc(i){var s,r;let e=(r=(s=X(i).media)==null?void 0:s.deref())==null?void 0:r.videoTracks;if(!e)return;X(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ms("removetrack",{track:i}))})}function I_(i){var s,r,n;let e=(n=(r=(s=X(i).media)==null?void 0:s.deref())==null?void 0:r.videoTracks)!=null?n:[],t=!1;for(let a of e)a!==i&&(a.selected=!1,t=!0);if(t){if(X(e).changeRequested)return;X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var lr,dr,ur,an,ul,on=class extends EventTarget{constructor(){super();oe(this,an);oe(this,lr);oe(this,dr);oe(this,ur);X(this).trackSet=new Set}[Symbol.iterator](){return C(this,an,ul).values()}get length(){return C(this,an,ul).size}getTrackById(t){var s;return(s=[...C(this,an,ul)].find(r=>r.id===t))!=null?s:null}get selectedIndex(){return[...C(this,an,ul)].findIndex(t=>t.selected)}get onaddtrack(){return C(this,lr)}set onaddtrack(t){C(this,lr)&&(this.removeEventListener("addtrack",C(this,lr)),ee(this,lr,void 0)),typeof t=="function"&&(ee(this,lr,t),this.addEventListener("addtrack",t))}get onremovetrack(){return C(this,dr)}set onremovetrack(t){C(this,dr)&&(this.removeEventListener("removetrack",C(this,dr)),ee(this,dr,void 0)),typeof t=="function"&&(ee(this,dr,t),this.addEventListener("removetrack",t))}get onchange(){return C(this,ur)}set onchange(t){C(this,ur)&&(this.removeEventListener("change",C(this,ur)),ee(this,ur,void 0)),typeof t=="function"&&(ee(this,ur,t),this.addEventListener("change",t))}};lr=new WeakMap,dr=new WeakMap,ur=new WeakMap,an=new WeakSet,ul=function(){return X(this).trackSet};var Ps=class extends Event{constructor(t,s){super(t);Ae(this,"rendition");this.rendition=s.rendition}};function L_(i,e){var n,a;let t=(a=(n=X(i).media)==null?void 0:n.deref())==null?void 0:a.videoRenditions;X(e).media=X(i).media,X(e).track=i;let s=X(i).renditionSet;s.add(e);let r=s.size-1;r in ln.prototype||Object.defineProperty(ln.prototype,r,{get(){return da(this)[r]}}),queueMicrotask(()=>{!t||!i.selected||t.dispatchEvent(new Ps("addrendition",{rendition:e}))})}function x_(i){var r,n;let e=(n=(r=X(i).media)==null?void 0:r.deref())==null?void 0:n.videoRenditions,t=X(i).track;X(t).renditionSet.delete(i),queueMicrotask(()=>{let a=X(i).track;!e||!a.selected||e.dispatchEvent(new Ps("removerendition",{rendition:i}))})}function R_(i){var t,s;let e=(s=(t=X(i).media)==null?void 0:t.deref())==null?void 0:s.videoRenditions;!e||X(e).changeRequested||(X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,X(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function da(i){var t;let e=(t=X(i).media)==null?void 0:t.deref();return e?[...e.videoTracks].filter(s=>s.selected).flatMap(s=>[...X(s).renditionSet]):[]}var cr,hr,fr,ln=class extends EventTarget{constructor(){super(...arguments);oe(this,cr);oe(this,hr);oe(this,fr)}[Symbol.iterator](){return da(this).values()}get length(){return da(this).length}getRenditionById(t){var s;return(s=da(this).find(r=>`${r.id}`==`${t}`))!=null?s:null}get selectedIndex(){return da(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,r]of da(this).entries())r.selected=s===t}get onaddrendition(){return C(this,cr)}set onaddrendition(t){C(this,cr)&&(this.removeEventListener("addrendition",C(this,cr)),ee(this,cr,void 0)),typeof t=="function"&&(ee(this,cr,t),this.addEventListener("addrendition",t))}get onremoverendition(){return C(this,hr)}set onremoverendition(t){C(this,hr)&&(this.removeEventListener("removerendition",C(this,hr)),ee(this,hr,void 0)),typeof t=="function"&&(ee(this,hr,t),this.addEventListener("removerendition",t))}get onchange(){return C(this,fr)}set onchange(t){C(this,fr)&&(this.removeEventListener("change",C(this,fr)),ee(this,fr,void 0)),typeof t=="function"&&(ee(this,fr,t),this.addEventListener("change",t))}};cr=new WeakMap,hr=new WeakMap,fr=new WeakMap;var ua,cl=class{constructor(){Ae(this,"src");Ae(this,"id");Ae(this,"width");Ae(this,"height");Ae(this,"bitrate");Ae(this,"frameRate");Ae(this,"codec");oe(this,ua,!1)}get selected(){return C(this,ua)}set selected(e){C(this,ua)!==e&&(ee(this,ua,e),R_(this))}};ua=new WeakMap;var ca,ha=class{constructor(){Ae(this,"id");Ae(this,"kind");Ae(this,"label","");Ae(this,"language","");Ae(this,"sourceBuffer");oe(this,ca,!1)}addRendition(e,t,s,r,n,a){let o=new cl;return o.src=e,o.width=t,o.height=s,o.frameRate=a,o.bitrate=n,o.codec=r,L_(this,o),o}removeRendition(e){x_(e)}get selected(){return C(this,ca)}set selected(e){C(this,ca)!==e&&(ee(this,ca,e),e===!0&&I_(this))}};ca=new WeakMap;function k_(i,e){var n,a;let t=(a=(n=X(i).media)==null?void 0:n.deref())==null?void 0:a.audioRenditions;X(e).media=X(i).media,X(e).track=i;let s=X(i).renditionSet;s.add(e);let r=s.size-1;r in dn.prototype||Object.defineProperty(dn.prototype,r,{get(){return fa(this)[r]}}),queueMicrotask(()=>{!t||!i.enabled||t.dispatchEvent(new Ps("addrendition",{rendition:e}))})}function D_(i){var r,n;let e=(n=(r=X(i).media)==null?void 0:r.deref())==null?void 0:n.audioRenditions,t=X(i).track;X(t).renditionSet.delete(i),queueMicrotask(()=>{let a=X(i).track;!e||!a.enabled||e.dispatchEvent(new Ps("removerendition",{rendition:i}))})}function C_(i){var t,s;let e=(s=(t=X(i).media)==null?void 0:t.deref())==null?void 0:s.audioRenditions;!e||X(e).changeRequested||(X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,X(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function fa(i){var t;let e=(t=X(i).media)==null?void 0:t.deref();return e?[...e.audioTracks].filter(s=>s.enabled).flatMap(s=>[...X(s).renditionSet]):[]}var mr,pr,gr,dn=class extends EventTarget{constructor(){super(...arguments);oe(this,mr);oe(this,pr);oe(this,gr)}[Symbol.iterator](){return fa(this).values()}get length(){return fa(this).length}getRenditionById(t){var s;return(s=fa(this).find(r=>`${r.id}`==`${t}`))!=null?s:null}get selectedIndex(){return fa(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,r]of fa(this).entries())r.selected=s===t}get onaddrendition(){return C(this,mr)}set onaddrendition(t){C(this,mr)&&(this.removeEventListener("addrendition",C(this,mr)),ee(this,mr,void 0)),typeof t=="function"&&(ee(this,mr,t),this.addEventListener("addrendition",t))}get onremoverendition(){return C(this,pr)}set onremoverendition(t){C(this,pr)&&(this.removeEventListener("removerendition",C(this,pr)),ee(this,pr,void 0)),typeof t=="function"&&(ee(this,pr,t),this.addEventListener("removerendition",t))}get onchange(){return C(this,gr)}set onchange(t){C(this,gr)&&(this.removeEventListener("change",C(this,gr)),ee(this,gr,void 0)),typeof t=="function"&&(ee(this,gr,t),this.addEventListener("change",t))}};mr=new WeakMap,pr=new WeakMap,gr=new WeakMap;var ma,hl=class{constructor(){Ae(this,"src");Ae(this,"id");Ae(this,"bitrate");Ae(this,"codec");oe(this,ma,!1)}get selected(){return C(this,ma)}set selected(e){C(this,ma)!==e&&(ee(this,ma,e),C_(this))}};ma=new WeakMap;function hc(i,e){let t=i.audioTracks;X(e).media=new WeakRef(i),X(e).renditionSet||(X(e).renditionSet=new Set);let s=X(t).trackSet;s.add(e);let r=s.size-1;r in un.prototype||Object.defineProperty(un.prototype,r,{get(){return[...X(this).trackSet][r]}}),queueMicrotask(()=>{t.dispatchEvent(new Ms("addtrack",{track:e}))})}function fc(i){var s,r;let e=(r=(s=X(i).media)==null?void 0:s.deref())==null?void 0:r.audioTracks;if(!e)return;X(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ms("removetrack",{track:i}))})}function w_(i){var t,s;let e=(s=(t=X(i).media)==null?void 0:t.deref())==null?void 0:s.audioTracks;!e||X(e).changeRequested||(X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var vr,Er,yr,pa,cc,un=class extends EventTarget{constructor(){super();oe(this,pa);oe(this,vr);oe(this,Er);oe(this,yr);X(this).trackSet=new Set}[Symbol.iterator](){return C(this,pa,cc).values()}get length(){return C(this,pa,cc).size}getTrackById(t){var s;return(s=[...C(this,pa,cc)].find(r=>r.id===t))!=null?s:null}get onaddtrack(){return C(this,vr)}set onaddtrack(t){C(this,vr)&&(this.removeEventListener("addtrack",C(this,vr)),ee(this,vr,void 0)),typeof t=="function"&&(ee(this,vr,t),this.addEventListener("addtrack",t))}get onremovetrack(){return C(this,Er)}set onremovetrack(t){C(this,Er)&&(this.removeEventListener("removetrack",C(this,Er)),ee(this,Er,void 0)),typeof t=="function"&&(ee(this,Er,t),this.addEventListener("removetrack",t))}get onchange(){return C(this,yr)}set onchange(t){C(this,yr)&&(this.removeEventListener("change",C(this,yr)),ee(this,yr,void 0)),typeof t=="function"&&(ee(this,yr,t),this.addEventListener("change",t))}};vr=new WeakMap,Er=new WeakMap,yr=new WeakMap,pa=new WeakSet,cc=function(){return X(this).trackSet};var ga,va=class{constructor(){Ae(this,"id");Ae(this,"kind");Ae(this,"label","");Ae(this,"language","");Ae(this,"sourceBuffer");oe(this,ga,!1)}addRendition(e,t,s){let r=new hl;return r.src=e,r.codec=t,r.bitrate=s,k_(this,r),r}removeRendition(e){D_(e)}get enabled(){return C(this,ga)}set enabled(e){C(this,ga)!==e&&(ee(this,ga,e),w_(this))}};ga=new WeakMap;var M_=mc(globalThis.HTMLMediaElement,"video"),P_=mc(globalThis.HTMLMediaElement,"audio");function O_(i){if(!(i!=null&&i.prototype))return i;let e=mc(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return Ww(this)}});let t=mc(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return qw(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new ha;return l.kind=n,l.label=a,l.language=o,dc(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=uc),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new va;return l.kind=n,l.label=a,l.language=o,hc(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=fc),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return s(this)}});let s=n=>{let a=X(n).videoRenditions;return a||(a=new ln,X(a).media=new WeakRef(n),X(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return r(this)}});let r=n=>{let a=X(n).audioRenditions;return a||(a=new dn,X(a).media=new WeakRef(n),X(n).audioRenditions=a),a};return i}function mc(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function Ww(i){var t;let e=X(i).videoTracks;if(!e&&(e=new on,X(i).videoTracks=e,M_)){let s=M_.call((t=i.nativeEl)!=null?t:i);for(let o of s)dc(i,o);let r=()=>{e.dispatchEvent(new Event("change"))},n=o=>{if([...e].some(l=>l instanceof ha)){for(let l of s)uc(l);return}dc(i,o.track)},a=o=>{uc(o.track)};s.addEventListener("change",r),s.addEventListener("addtrack",n),s.addEventListener("removetrack",a)}return e}function qw(i){var t;let e=X(i).audioTracks;if(!e&&(e=new un,X(i).audioTracks=e,P_)){let s=P_.call((t=i.nativeEl)!=null?t:i);for(let o of s)hc(i,o);let r=()=>{e.dispatchEvent(new Event("change"))},n=o=>{if([...e].some(l=>l instanceof va)){for(let l of s)fc(l);return}hc(i,o.track)},a=o=>{fc(o.track)};s.addEventListener("change",r),s.addEventListener("addtrack",n),s.addEventListener("removetrack",a)}return e}var U_=i=>{throw TypeError(i)},F_=(i,e,t)=>e.has(i)||U_("Cannot "+t),B_=(i,e,t)=>(F_(i,e,"read from private field"),t?t.call(i):e.get(i)),$_=(i,e,t)=>e.has(i)?U_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),H_=(i,e,t,s)=>(F_(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),vc=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends vc{}globalThis.DocumentFragment=i}var Yg=class extends vc{},Yw=class extends vc{},jw={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Yg)}},pc,zw=class{constructor(i,e={}){$_(this,pc),H_(this,pc,e==null?void 0:e.detail)}get detail(){return B_(this,pc)}initCustomEvent(){}};pc=new WeakMap;function Qw(i,e){return new Yg}var G_={document:{createElement:Qw},DocumentFragment,customElements:jw,CustomEvent:zw,EventTarget:vc,HTMLElement:Yg,HTMLVideoElement:Yw},K_=typeof window=="undefined"||typeof globalThis.customElements=="undefined",qg=K_?G_:globalThis,W3=K_?G_.document:globalThis.document,gc,N_=class extends A_(O_(d_)){constructor(){super(...arguments),$_(this,gc)}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var i;return(i=B_(this,gc))!=null?i:this.muxCastCustomData}set castCustomData(i){H_(this,gc,i)}};gc=new WeakMap;qg.customElements.get("mux-video")||(qg.customElements.define("mux-video",N_),qg.MuxVideoElement=N_);var K={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"},ge={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},jg={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"},V_=Object.entries(jg),_=V_.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),Xw={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},li=V_.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...Xw}),iU=Object.entries(li).reduce((i,[e,t])=>{let s=_[e];return s&&(i[t]=s),i},{userinactivechange:"userinactive"}),W_=Object.entries(_).reduce((i,[e,t])=>{let s=li[e];return s&&(i[t]=s),i},{userinactive:"userinactivechange"}),Qt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},br={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ec={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Xt={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ni={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var q_={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Y_(i){return i==null?void 0:i.map(Jw).join(" ")}function j_(i){return i==null?void 0:i.split(/\s+/).map(eM)}function Jw(i){if(i){let{id:e,width:t,height:s}=i;return[e,t,s].filter(r=>r!=null).join(":")}}function eM(i){if(i){let[e,t,s]=i.split(":");return{id:e,width:+t,height:+s}}}function z_(i){return i==null?void 0:i.map(tM).join(" ")}function Q_(i){return i==null?void 0:i.split(/\s+/).map(iM)}function tM(i){if(i){let{id:e,kind:t,language:s,label:r}=i;return[e,t,s,r].filter(n=>n!=null).join(":")}}function iM(i){if(i){let[e,t,s,r]=i.split(":");return{id:e,kind:t,language:s,label:r}}}function X_(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ea(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function yc(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var bc=i=>new Promise(e=>setTimeout(e,i));var Z_={"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 J_,zg={en:Z_},Qg=((J_=globalThis.navigator)==null?void 0:J_.language)||"en",eA=i=>{Qg=i};var sM=i=>{var e,t,s;let[r]=Qg.split("-");return((e=zg[Qg])==null?void 0:e[i])||((t=zg[r])==null?void 0:t[i])||((s=zg.en)==null?void 0:s[i])||i},F=(i,e={})=>sM(i).replace(/\{(\w+)\}/g,(t,s)=>s in e?String(e[s]):`{${s}}`);var tA=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],rM=(i,e)=>{let t=i===1?F(tA[e].singular):F(tA[e].plural);return`${i} ${t}`},cn=i=>{if(!Ea(i))return"";let e=Math.abs(i),t=e!==i,s=new Date(0,0,0,0,0,e,0),n=[s.getHours(),s.getMinutes(),s.getSeconds()].map((a,o)=>a&&rM(a,o)).filter(a=>a).join(", ");return t?F("{time} remaining",{time:n}):n};function Ui(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let s=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),a=Math.floor(e/60%60),o=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=s="0"),n=n>0||o>0?n+":":"",r=((n||a>=10)&&r<10?"0"+r:r)+":",s=s<10?"0"+s:s,(t?"-":"")+n+r+s}var dU=Object.freeze({length:0,start(i){let e=i>>>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(i){let e=i>>>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 Tc=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},_c=class extends Tc{},Ac=class extends _c{constructor(){super(...arguments),this.role=null}},Xg=class{observe(){}unobserve(){}disconnect(){}},iA={createElement:function(){return new fl.HTMLElement},createElementNS:function(){return new fl.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},fl={ResizeObserver:Xg,document:iA,Node:_c,Element:Ac,HTMLElement:class extends Ac{constructor(){super(...arguments),this.innerHTML=""}get content(){return new fl.DocumentFragment}},DocumentFragment:class extends Tc{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}},DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},sA="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window=="undefined"||typeof window.customElements=="undefined",rA=Object.keys(fl).every(i=>i in globalThis),L=sA&&!rA?fl:globalThis,He=sA&&!rA?iA:globalThis.document;var nA=new WeakMap,Zg=i=>{let e=nA.get(i);return e||nA.set(i,e=new Set),e},aA=new L.ResizeObserver(i=>{for(let e of i)for(let t of Zg(e.target))t(e)});function Os(i,e){Zg(i).add(e),aA.observe(i)}function Ns(i,e){let t=Zg(i);t.delete(e),t.size||aA.unobserve(i)}function Qe(i){let e={};for(let t of i)e[t.name]=t.value;return e}function Ye(i){var e;return(e=Sc(i))!=null?e:is(i,"media-controller")}function Sc(i){var e;let{MEDIA_CONTROLLER:t}=ge,s=i.getAttribute(t);if(s)return(e=hn(i))==null?void 0:e.getElementById(s)}var Ic=(i,e,t=".value")=>{let s=i.querySelector(t);s&&(s.textContent=e)},aM=(i,e)=>{let t=`slot[name="${e}"]`,s=i.shadowRoot.querySelector(t);return s?s.children:[]},Lc=(i,e)=>aM(i,e)[0],Gt=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Gt(i,e.getRootNode().host),is=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||is(i.getRootNode().host,e)};function ml(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=ml(t.shadowRoot))!=null?e:t:null}function hn(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function xc(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:s=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:s});let r=i;for(;r&&e>0;){let n=getComputedStyle(r);if(t&&n.opacity==="0"||s&&n.visibility==="hidden"||n.display==="none")return!1;r=r.parentElement,e--}return!0}function oA(i,e,t,s){let r=s.x-t.x,n=s.y-t.y,a=r*r+n*n;if(a===0)return 0;let o=((i-t.x)*r+(e-t.y)*n)/a;return Math.max(0,Math.min(1,o))}function je(i,e){let t=oM(i,s=>s===e);return t||pl(i,e)}function oM(i,e){var t,s;let r;for(r of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(s=r.sheet)==null?void 0:s.cssRules}catch{continue}for(let a of n!=null?n:[])if(e(a.selectorText))return a}}function pl(i,e){var t,s;let r=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=r==null?void 0:r[r.length-1];if(!(n!=null&&n.sheet))return console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}};let a=n==null?void 0:n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length);return(s=n.sheet.cssRules)==null?void 0:s[a]}function be(i,e,t=Number.NaN){let s=i.getAttribute(e);return s!=null?+s:t}function Le(i,e,t){let s=+t;if(t==null||Number.isNaN(s)){i.hasAttribute(e)&&i.removeAttribute(e);return}be(i,e,void 0)!==s&&i.setAttribute(e,`${s}`)}function le(i,e){return i.hasAttribute(e)}function de(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}le(i,e)!=t&&i.toggleAttribute(e,t)}function me(i,e,t=null){var s;return(s=i.getAttribute(e))!=null?s:t}function fe(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let s=`${t}`;me(i,e,void 0)!==s&&i.setAttribute(e,s)}var lA=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fi=(i,e,t)=>(lA(i,e,"read from private field"),t?t.call(i):e.get(i)),lM=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Rc=(i,e,t,s)=>(lA(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),wt;function dM(i){return`
141
141
  <style>
@@ -135,7 +135,7 @@ Schedule: ${l.map(p=>Ci(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
135
135
  <slot name="logo">
136
136
  ${this.getLogoHTML((e=i[w.LOGO])!=null?e:"")}
137
137
  </slot>
138
- `}get preferCmcd(){var i;return(i=this.getAttribute(w.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?aa.includes(i)?this.setAttribute(w.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${aa.join()}`):this.removeAttribute(w.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(w.PLAYER_INIT_TIME)?+this.getAttribute(w.PLAYER_INIT_TIME):mt(this,Qu)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(w.PLAYER_INIT_TIME):this.setAttribute(w.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=mt(this,ec))!=null?i:o_}set playerSoftwareName(i){Pi(this,ec,i)}get playerSoftwareVersion(){var i;return(i=mt(this,Ju))!=null?i:a_}set playerSoftwareVersion(i){Pi(this,Ju,i)}get _hls(){var i;return(i=mt(this,Ei,tn))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=Cg(this.nativeEl))!=null?i:null}get errorTranslator(){return mt(this,tc)}set errorTranslator(i){Pi(this,tc,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(w.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(w.TYPE,i):this.removeAttribute(w.TYPE))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(w.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(w.DEBUG,""):this.removeAttribute(w.DEBUG))}get disableTracking(){return this.hasAttribute(w.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(w.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(w.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(w.DISABLE_COOKIES,""):this.removeAttribute(w.DISABLE_COOKIES))}get disablePseudoEnded(){return this.hasAttribute(w.DISABLE_PSEUDO_ENDED)}set disablePseudoEnded(i){i!==this.disablePseudoEnded&&(i?this.setAttribute(w.DISABLE_PSEUDO_ENDED,""):this.removeAttribute(w.DISABLE_PSEUDO_ENDED))}get startTime(){let i=this.getAttribute(w.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(w.START_TIME):this.setAttribute(w.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(w.PLAYBACK_ID)?this.getAttribute(w.PLAYBACK_ID):(i=Yu(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(w.PLAYBACK_ID,i):this.removeAttribute(w.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(w.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(w.MAX_RESOLUTION,i):this.removeAttribute(w.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(w.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(w.MIN_RESOLUTION,i):this.removeAttribute(w.MIN_RESOLUTION))}get maxAutoResolution(){var i;return(i=this.getAttribute(w.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(w.MAX_AUTO_RESOLUTION):this.setAttribute(w.MAX_AUTO_RESOLUTION,i)}get renditionOrder(){var i;return(i=this.getAttribute(w.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(w.RENDITION_ORDER,i):this.removeAttribute(w.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(w.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(w.PROGRAM_START_TIME):this.setAttribute(w.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(w.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(w.PROGRAM_END_TIME):this.setAttribute(w.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(w.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(w.ASSET_START_TIME):this.setAttribute(w.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(w.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(w.ASSET_END_TIME):this.setAttribute(w.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(w.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(w.CUSTOM_DOMAIN,i):this.removeAttribute(w.CUSTOM_DOMAIN))}get capRenditionToPlayerSize(){var i;return((i=this._hlsConfig)==null?void 0:i.capLevelToPlayerSize)!=null?this._hlsConfig.capLevelToPlayerSize:mt(this,sc)}set capRenditionToPlayerSize(i){Pi(this,sc,i)}get drmToken(){var i;return(i=this.getAttribute(w.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(w.DRM_TOKEN,i):this.removeAttribute(w.DRM_TOKEN))}get playbackToken(){var i,e,t,s;if(this.hasAttribute(w.PLAYBACK_TOKEN))return(i=this.getAttribute(w.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(w.PLAYBACK_ID)){let[,r]=Gu((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(r).get("token"))!=null?t:void 0}if(this.src)return(s=new URLSearchParams(this.src).get("token"))!=null?s:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(w.PLAYBACK_TOKEN,i):this.removeAttribute(w.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(w.PLAYBACK_TOKEN),e=this.getAttribute(w.DRM_TOKEN);return{...mt(this,Xu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Pi(this,Xu,i!=null?i:{})}get ended(){return Mg(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(w.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(w.ENV_KEY,i):this.removeAttribute(w.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(w.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(w.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(w.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(w.STREAM_TYPE))!=null?i:Hu(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(w.STREAM_TYPE,i):this.removeAttribute(w.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(w.TARGET_LIVE_WINDOW)?+this.getAttribute(w.TARGET_LIVE_WINDOW):$T(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(w.TARGET_LIVE_WINDOW):this.setAttribute(w.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(w.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,s=(i=this.nativeEl.seekable.end(0))!=null?i:0,r=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(r,s-t)}return HT(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(w.LIVE_EDGE_OFFSET))return+this.getAttribute(w.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(w.LIVE_EDGE_OFFSET):this.setAttribute(w.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return ju(this.nativeEl)}async addCuePoints(i){return Ig(this.nativeEl,i)}get activeCuePoint(){return Lg(this.nativeEl)}get cuePoints(){return wT(this.nativeEl)}async addChapters(i){return Rg(this.nativeEl,i)}get activeChapter(){return kg(this.nativeEl)}get chapters(){return PT(this.nativeEl)}getStartDate(){return OT(this.nativeEl,this._hls)}get currentPdt(){return NT(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(w.PREFER_PLAYBACK);if(i===gi.MSE||i===gi.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===gi.MSE||i===gi.NATIVE?this.setAttribute(w.PREFER_PLAYBACK,i):this.removeAttribute(w.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![w.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...mt(this,nl)}}set metadata(i){Pi(this,nl,i!=null?i:{}),this.mux&&this.mux.emit("hb",mt(this,nl))}get _hlsConfig(){return mt(this,Zu)}set _hlsConfig(i){Pi(this,Zu,i)}get logo(){var i;return(i=this.getAttribute(w.LOGO))!=null?i:mt(this,al)}set logo(i){i?this.setAttribute(w.LOGO,i):this.removeAttribute(w.LOGO)}load(){Pg(this,this.nativeEl,mt(this,Ei,tn))}unload(){Og(this.nativeEl,mt(this,Ei,tn),this)}attributeChangedCallback(i,e,t){var s,r;switch(sl.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case w.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case w.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?zu(this,Ei,ol).call(this):n&&!a?this.unload():n&&a&&(this.unload(),zu(this,Ei,ol).call(this));break}case"autoplay":if(t===e)break;(s=mt(this,Ei,tn))==null||s.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(r=mt(this,Ei,tn))==null||r.setPreload(t);break;case w.PLAYBACK_ID:this.src=il(this);break;case w.DEBUG:{let n=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=n);break}case w.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case w.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case w.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;case w.LOGO:(t==null||t!==e)&&this.updateLogo();break;case w.DISABLE_TRACKING:{if(t==null||t!==e){let n=this.currentTime,a=this.paused;this.unload(),zu(this,Ei,ol).call(this).then(()=>{this.currentTime=n,a||this.play()})}break}case w.DISABLE_COOKIES:{(t==null||t!==e)&&this.disableCookies&&document.cookie.split(";").forEach(n=>{n.trim().startsWith("muxData")&&(document.cookie=n.replace(/^ +/,"").replace(/=.*/,"=;expires="+new Date().toUTCString()+";path=/"))});break}case w.CAP_RENDITION_TO_PLAYER_SIZE:(t==null||t!==e)&&(this.capRenditionToPlayerSize=t!=null?!0:void 0)}}updateLogo(){if(!this.shadowRoot)return;let i=this.shadowRoot.querySelector('slot[name="logo"]');if(!i)return;let e=this.constructor.getLogoHTML(mt(this,al)||this.logo);i.innerHTML=e}connectedCallback(){var i,e;(i=super.connectedCallback)==null||i.call(this),(e=this.nativeEl)==null||e.addEventListener("muxmetadata",mt(this,ic)),this.nativeEl&&this.src&&!mt(this,Ei,tn)&&zu(this,Ei,ol).call(this)}disconnectedCallback(){var i,e;(i=this.nativeEl)==null||i.removeEventListener("muxmetadata",mt(this,ic)),this.unload(),(e=super.disconnectedCallback)==null||e.call(this)}handleEvent(i){i.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(i.type,{composed:!0,detail:i.detail}))}};rl=new WeakMap,Qu=new WeakMap,nl=new WeakMap,Xu=new WeakMap,Zu=new WeakMap,Ju=new WeakMap,ec=new WeakMap,tc=new WeakMap,al=new WeakMap,ic=new WeakMap,Ei=new WeakSet,tn=function(){return GT(this.nativeEl)},sc=new WeakMap,ol=async function(){mt(this,rl)||(await Pi(this,rl,Promise.resolve()),Pi(this,rl,null),this.load())};var ts=new WeakMap,oa=class extends Error{},rc=class extends Error{};var $w=["application/x-mpegURL","application/vnd.apple.mpegurl","audio/mpegurl"],u_=globalThis.WeakRef?class extends Set{add(i){super.add(new WeakRef(i))}forEach(i){super.forEach(e=>{let t=e.deref();t&&i(t)})}}:Set;function c_(i){var e,t,s;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(s=globalThis.cast)!=null&&s.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function h_(){return globalThis.chrome}function f_(){var t;let i="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((t=globalThis.chrome)!=null&&t.cast||document.querySelector(`script[src="${i}"]`))return;let e=document.createElement("script");e.src=i,document.head.append(e)}function Cs(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function ll(){var i;return(i=Cs())==null?void 0:i.getCurrentSession()}function nc(){var i;return(i=ll())==null?void 0:i.getSessionObj().media[0]}function m_(i){return new Promise((e,t)=>{nc().editTracksInfo(i,e,t)})}function p_(i){return new Promise((e,t)=>{nc().getStatus(i,e,t)})}function $g(i){return Cs().setOptions({...Hg(),...i})}function Hg(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}function Hw(i){if(!i)return;let e=/\.([a-zA-Z0-9]+)(?:\?.*)?$/,t=i.match(e);return t?t[1]:null}function Gw(i){let e=i.split(`
138
+ `}get preferCmcd(){var i;return(i=this.getAttribute(w.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?aa.includes(i)?this.setAttribute(w.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${aa.join()}`):this.removeAttribute(w.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(w.PLAYER_INIT_TIME)?+this.getAttribute(w.PLAYER_INIT_TIME):mt(this,Qu)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(w.PLAYER_INIT_TIME):this.setAttribute(w.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=mt(this,ec))!=null?i:o_}set playerSoftwareName(i){Pi(this,ec,i)}get playerSoftwareVersion(){var i;return(i=mt(this,Ju))!=null?i:a_}set playerSoftwareVersion(i){Pi(this,Ju,i)}get _hls(){var i;return(i=mt(this,Ei,tn))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=Cg(this.nativeEl))!=null?i:null}get errorTranslator(){return mt(this,tc)}set errorTranslator(i){Pi(this,tc,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(w.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(w.TYPE,i):this.removeAttribute(w.TYPE))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(w.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(w.DEBUG,""):this.removeAttribute(w.DEBUG))}get disableTracking(){return this.hasAttribute(w.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(w.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(w.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(w.DISABLE_COOKIES,""):this.removeAttribute(w.DISABLE_COOKIES))}get disablePseudoEnded(){return this.hasAttribute(w.DISABLE_PSEUDO_ENDED)}set disablePseudoEnded(i){i!==this.disablePseudoEnded&&(i?this.setAttribute(w.DISABLE_PSEUDO_ENDED,""):this.removeAttribute(w.DISABLE_PSEUDO_ENDED))}get startTime(){let i=this.getAttribute(w.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(w.START_TIME):this.setAttribute(w.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(w.PLAYBACK_ID)?this.getAttribute(w.PLAYBACK_ID):(i=Yu(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(w.PLAYBACK_ID,i):this.removeAttribute(w.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(w.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(w.MAX_RESOLUTION,i):this.removeAttribute(w.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(w.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(w.MIN_RESOLUTION,i):this.removeAttribute(w.MIN_RESOLUTION))}get maxAutoResolution(){var i;return(i=this.getAttribute(w.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(w.MAX_AUTO_RESOLUTION):this.setAttribute(w.MAX_AUTO_RESOLUTION,i)}get renditionOrder(){var i;return(i=this.getAttribute(w.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(w.RENDITION_ORDER,i):this.removeAttribute(w.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(w.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(w.PROGRAM_START_TIME):this.setAttribute(w.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(w.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(w.PROGRAM_END_TIME):this.setAttribute(w.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(w.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(w.ASSET_START_TIME):this.setAttribute(w.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(w.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(w.ASSET_END_TIME):this.setAttribute(w.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(w.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(w.CUSTOM_DOMAIN,i):this.removeAttribute(w.CUSTOM_DOMAIN))}get capRenditionToPlayerSize(){var i;return((i=this._hlsConfig)==null?void 0:i.capLevelToPlayerSize)!=null?this._hlsConfig.capLevelToPlayerSize:mt(this,sc)}set capRenditionToPlayerSize(i){Pi(this,sc,i)}get drmToken(){var i;return(i=this.getAttribute(w.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(w.DRM_TOKEN,i):this.removeAttribute(w.DRM_TOKEN))}get playbackToken(){var i,e,t,s;if(this.hasAttribute(w.PLAYBACK_TOKEN))return(i=this.getAttribute(w.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(w.PLAYBACK_ID)){let[,r]=Gu((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(r).get("token"))!=null?t:void 0}if(this.src)return(s=new URLSearchParams(this.src).get("token"))!=null?s:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(w.PLAYBACK_TOKEN,i):this.removeAttribute(w.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(w.PLAYBACK_TOKEN),e=this.getAttribute(w.DRM_TOKEN);return{...mt(this,Xu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Pi(this,Xu,i!=null?i:{})}get ended(){return Mg(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(w.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(w.ENV_KEY,i):this.removeAttribute(w.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(w.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(w.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(w.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(w.STREAM_TYPE))!=null?i:Hu(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(w.STREAM_TYPE,i):this.removeAttribute(w.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(w.TARGET_LIVE_WINDOW)?+this.getAttribute(w.TARGET_LIVE_WINDOW):$T(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(w.TARGET_LIVE_WINDOW):this.setAttribute(w.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(w.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,s=(i=this.nativeEl.seekable.end(0))!=null?i:0,r=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(r,s-t)}return HT(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(w.LIVE_EDGE_OFFSET))return+this.getAttribute(w.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(w.LIVE_EDGE_OFFSET):this.setAttribute(w.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return ju(this.nativeEl)}async addCuePoints(i){return Ig(this.nativeEl,i)}get activeCuePoint(){return Lg(this.nativeEl)}get cuePoints(){return wT(this.nativeEl)}async addChapters(i){return Rg(this.nativeEl,i)}get activeChapter(){return kg(this.nativeEl)}get chapters(){return PT(this.nativeEl)}getStartDate(){return OT(this.nativeEl,this._hls)}get currentPdt(){return NT(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(w.PREFER_PLAYBACK);if(i===gi.MSE||i===gi.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===gi.MSE||i===gi.NATIVE?this.setAttribute(w.PREFER_PLAYBACK,i):this.removeAttribute(w.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![w.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...mt(this,nl)}}set metadata(i){Pi(this,nl,i!=null?i:{}),this.mux&&this.mux.emit("hb",mt(this,nl))}get _hlsConfig(){return mt(this,Zu)}set _hlsConfig(i){Pi(this,Zu,i)}get logo(){var i;return(i=this.getAttribute(w.LOGO))!=null?i:mt(this,al)}set logo(i){i?this.setAttribute(w.LOGO,i):this.removeAttribute(w.LOGO)}load(){Pg(this,this.nativeEl,mt(this,Ei,tn))}unload(){Og(this.nativeEl,mt(this,Ei,tn),this)}attributeChangedCallback(i,e,t){var s,r;switch(sl.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case w.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case w.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?zu(this,Ei,ol).call(this):n&&!a?this.unload():n&&a&&(this.unload(),zu(this,Ei,ol).call(this));break}case"autoplay":if(t===e)break;(s=mt(this,Ei,tn))==null||s.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(r=mt(this,Ei,tn))==null||r.setPreload(t);break;case w.PLAYBACK_ID:case w.CUSTOM_DOMAIN:case w.MAX_RESOLUTION:case w.MIN_RESOLUTION:case w.RENDITION_ORDER:case w.PROGRAM_START_TIME:case w.PROGRAM_END_TIME:case w.ASSET_START_TIME:case w.ASSET_END_TIME:case w.PLAYBACK_TOKEN:this.src=il(this);break;case w.DEBUG:{let n=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=n);break}case w.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case w.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case w.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;case w.LOGO:(t==null||t!==e)&&this.updateLogo();break;case w.DISABLE_TRACKING:{if(t==null||t!==e){let n=this.currentTime,a=this.paused;this.unload(),zu(this,Ei,ol).call(this).then(()=>{this.currentTime=n,a||this.play()})}break}case w.DISABLE_COOKIES:{(t==null||t!==e)&&this.disableCookies&&document.cookie.split(";").forEach(n=>{n.trim().startsWith("muxData")&&(document.cookie=n.replace(/^ +/,"").replace(/=.*/,"=;expires="+new Date().toUTCString()+";path=/"))});break}case w.CAP_RENDITION_TO_PLAYER_SIZE:(t==null||t!==e)&&(this.capRenditionToPlayerSize=t!=null?!0:void 0)}}updateLogo(){if(!this.shadowRoot)return;let i=this.shadowRoot.querySelector('slot[name="logo"]');if(!i)return;let e=this.constructor.getLogoHTML(mt(this,al)||this.logo);i.innerHTML=e}connectedCallback(){var i,e;(i=super.connectedCallback)==null||i.call(this),(e=this.nativeEl)==null||e.addEventListener("muxmetadata",mt(this,ic)),this.nativeEl&&this.src&&!mt(this,Ei,tn)&&zu(this,Ei,ol).call(this)}disconnectedCallback(){var i,e;(i=this.nativeEl)==null||i.removeEventListener("muxmetadata",mt(this,ic)),this.unload(),(e=super.disconnectedCallback)==null||e.call(this)}handleEvent(i){i.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(i.type,{composed:!0,detail:i.detail}))}};rl=new WeakMap,Qu=new WeakMap,nl=new WeakMap,Xu=new WeakMap,Zu=new WeakMap,Ju=new WeakMap,ec=new WeakMap,tc=new WeakMap,al=new WeakMap,ic=new WeakMap,Ei=new WeakSet,tn=function(){return GT(this.nativeEl)},sc=new WeakMap,ol=async function(){mt(this,rl)||(await Pi(this,rl,Promise.resolve()),Pi(this,rl,null),this.load())};var ts=new WeakMap,oa=class extends Error{},rc=class extends Error{};var $w=["application/x-mpegURL","application/vnd.apple.mpegurl","audio/mpegurl"],u_=globalThis.WeakRef?class extends Set{add(i){super.add(new WeakRef(i))}forEach(i){super.forEach(e=>{let t=e.deref();t&&i(t)})}}:Set;function c_(i){var e,t,s;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(s=globalThis.cast)!=null&&s.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function h_(){return globalThis.chrome}function f_(){var t;let i="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((t=globalThis.chrome)!=null&&t.cast||document.querySelector(`script[src="${i}"]`))return;let e=document.createElement("script");e.src=i,document.head.append(e)}function Cs(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function ll(){var i;return(i=Cs())==null?void 0:i.getCurrentSession()}function nc(){var i;return(i=ll())==null?void 0:i.getSessionObj().media[0]}function m_(i){return new Promise((e,t)=>{nc().editTracksInfo(i,e,t)})}function p_(i){return new Promise((e,t)=>{nc().getStatus(i,e,t)})}function $g(i){return Cs().setOptions({...Hg(),...i})}function Hg(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}function Hw(i){if(!i)return;let e=/\.([a-zA-Z0-9]+)(?:\?.*)?$/,t=i.match(e);return t?t[1]:null}function Gw(i){let e=i.split(`
139
139
  `),t=[];for(let s=0;s<e.length;s++)if(e[s].trim().startsWith("#EXT-X-STREAM-INF")){let n=e[s+1]?e[s+1].trim():"";n&&!n.startsWith("#")&&t.push(n)}return t}function Kw(i){return i.split(`
140
140
  `).find(s=>!s.trim().startsWith("#")&&s.trim()!=="")}async function g_(i){try{let t=(await fetch(i,{method:"HEAD"})).headers.get("Content-Type");return $w.some(s=>t===s)}catch(e){return console.error("Error while trying to get the Content-Type of the manifest",e),!1}}async function v_(i){try{let e=await(await fetch(i)).text(),t=e,s=Gw(e);if(s.length>0){let a=new URL(s[0],i).toString();t=await(await fetch(a)).text()}let r=Kw(t);return Hw(r)}catch(e){console.error("Error while trying to parse the manifest playlist",e);return}}var ac=new u_,ws=new WeakSet,At;c_(()=>{var i,e,t,s;if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable)){console.debug("chrome.cast.isAvailable",(s=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:s.isAvailable);return}At||(At=cast.framework,Cs().addEventListener(At.CastContextEventType.CAST_STATE_CHANGED,r=>{ac.forEach(n=>{var a,o;return(o=(a=ts.get(n)).onCastStateChanged)==null?void 0:o.call(a,r)})}),Cs().addEventListener(At.CastContextEventType.SESSION_STATE_CHANGED,r=>{ac.forEach(n=>{var a,o;return(o=(a=ts.get(n)).onSessionStateChanged)==null?void 0:o.call(a,r)})}),ac.forEach(r=>{var n,a;return(a=(n=ts.get(r)).init)==null?void 0:a.call(n)}))});var E_=0,Ce,la,Ht,Oi,rn,nn,or,lc,dl,ze,sn,y_,b_,Gg,T_,Kg,__,Vg,oc=class extends EventTarget{constructor(t){super();oe(this,ze);oe(this,Ce);oe(this,la);oe(this,Ht);oe(this,Oi);oe(this,rn,"disconnected");oe(this,nn,!1);oe(this,or,new Set);oe(this,lc,new WeakMap);oe(this,dl,()=>Ne(this,ze,Vg).call(this));ee(this,Ce,t),ac.add(this),ts.set(this,{init:()=>Ne(this,ze,Kg).call(this),onCastStateChanged:()=>Ne(this,ze,Gg).call(this),onSessionStateChanged:()=>Ne(this,ze,T_).call(this),getCastPlayer:()=>C(this,ze,sn)}),Ne(this,ze,Kg).call(this)}destroy(){var t,s,r;(s=(t=C(this,Ce))==null?void 0:t.textTracks)==null||s.removeEventListener("change",C(this,dl)),C(this,Oi)&&((r=C(this,Ht))!=null&&r.controller)&&Object.entries(C(this,Oi)).forEach(([n,a])=>{C(this,Ht).controller.removeEventListener(n,a)}),C(this,Ce)&&ws.delete(C(this,Ce)),ee(this,la,!1)}get state(){return C(this,rn)}async watchAvailability(t){if(C(this,Ce).disableRemotePlayback)throw new oa("disableRemotePlayback attribute is present.");return C(this,lc).set(t,++E_),C(this,or).add(t),queueMicrotask(()=>t(Ne(this,ze,b_).call(this))),E_}async cancelWatchAvailability(t){if(C(this,Ce).disableRemotePlayback)throw new oa("disableRemotePlayback attribute is present.");t?C(this,or).delete(t):C(this,or).clear()}async prompt(){var s,r,n,a;if(C(this,Ce).disableRemotePlayback)throw new oa("disableRemotePlayback attribute is present.");if(!((r=(s=globalThis.chrome)==null?void 0:s.cast)!=null&&r.isAvailable))throw new rc("The RemotePlayback API is disabled on this platform.");let t=ws.has(C(this,Ce));ws.add(C(this,Ce)),$g(C(this,Ce).castOptions),Object.entries(C(this,Oi)).forEach(([o,l])=>{C(this,Ht).controller.addEventListener(o,l)});try{await Cs().requestSession()}catch(o){if(t||ws.delete(C(this,Ce)),o==="cancel")return;throw new Error(o)}(a=(n=ts.get(C(this,Ce)))==null?void 0:n.loadOnPrompt)==null||a.call(n)}};Ce=new WeakMap,la=new WeakMap,Ht=new WeakMap,Oi=new WeakMap,rn=new WeakMap,nn=new WeakMap,or=new WeakMap,lc=new WeakMap,dl=new WeakMap,ze=new WeakSet,sn=function(){if(ws.has(C(this,Ce)))return C(this,Ht)},y_=function(){ws.has(C(this,Ce))&&(Object.entries(C(this,Oi)).forEach(([t,s])=>{C(this,Ht).controller.removeEventListener(t,s)}),ws.delete(C(this,Ce)),C(this,Ce).muted=C(this,Ht).isMuted,C(this,Ce).currentTime=C(this,Ht).savedPlayerState.currentTime,C(this,Ht).savedPlayerState.isPaused===!1&&C(this,Ce).play())},b_=function(){var s;let t=(s=Cs())==null?void 0:s.getCastState();return t&&t!=="NO_DEVICES_AVAILABLE"},Gg=function(){let t=Cs().getCastState();if(ws.has(C(this,Ce))&&t==="CONNECTING"&&(ee(this,rn,"connecting"),this.dispatchEvent(new Event("connecting"))),!C(this,nn)&&(t!=null&&t.includes("CONNECT"))){ee(this,nn,!0);for(let s of C(this,or))s(!0)}else if(C(this,nn)&&(!t||t==="NO_DEVICES_AVAILABLE")){ee(this,nn,!1);for(let s of C(this,or))s(!1)}},T_=async function(){var s;let{SESSION_RESUMED:t}=At.SessionState;if(Cs().getSessionState()===t&&C(this,Ce).castSrc===((s=nc())==null?void 0:s.media.contentId)){ws.add(C(this,Ce)),Object.entries(C(this,Oi)).forEach(([r,n])=>{C(this,Ht).controller.addEventListener(r,n)});try{await p_(new chrome.cast.media.GetStatusRequest)}catch(r){console.error(r)}C(this,Oi)[At.RemotePlayerEventType.IS_PAUSED_CHANGED](),C(this,Oi)[At.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Kg=function(){!At||C(this,la)||(ee(this,la,!0),$g(C(this,Ce).castOptions),C(this,Ce).textTracks.addEventListener("change",C(this,dl)),Ne(this,ze,Gg).call(this),ee(this,Ht,new At.RemotePlayer),new At.RemotePlayerController(C(this,Ht)),ee(this,Oi,{[At.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:t})=>{t===!0?(ee(this,rn,"connected"),this.dispatchEvent(new Event("connect"))):(Ne(this,ze,y_).call(this),ee(this,rn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[At.RemotePlayerEventType.DURATION_CHANGED]:()=>{C(this,Ce).dispatchEvent(new Event("durationchange"))},[At.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{C(this,Ce).dispatchEvent(new Event("volumechange"))},[At.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{C(this,Ce).dispatchEvent(new Event("volumechange"))},[At.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var t;(t=C(this,ze,sn))!=null&&t.isMediaLoaded&&C(this,Ce).dispatchEvent(new Event("timeupdate"))},[At.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{C(this,Ce).dispatchEvent(new Event("resize"))},[At.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{C(this,Ce).dispatchEvent(new Event(this.paused?"pause":"play"))},[At.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var t,s;((t=C(this,ze,sn))==null?void 0:t.playerState)!==chrome.cast.media.PlayerState.PAUSED&&C(this,Ce).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(s=C(this,ze,sn))==null?void 0:s.playerState]))},[At.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var t;(t=C(this,ze,sn))!=null&&t.isMediaLoaded&&(await Promise.resolve(),Ne(this,ze,__).call(this))}}))},__=function(){Ne(this,ze,Vg).call(this)},Vg=async function(){var h,f,m,p,g;if(!C(this,ze,sn))return;let s=((f=(h=C(this,Ht).mediaInfo)==null?void 0:h.tracks)!=null?f:[]).filter(({type:v})=>v===chrome.cast.media.TrackType.TEXT),r=[...C(this,Ce).textTracks].filter(({kind:v})=>v==="subtitles"||v==="captions"),n=s.map(({language:v,name:b,trackId:E})=>{var A;let{mode:T}=(A=r.find(x=>x.language===v&&x.label===b))!=null?A:{};return T?{mode:T,trackId:E}:!1}).filter(Boolean),o=n.filter(({mode:v})=>v!=="showing").map(({trackId:v})=>v),l=n.find(({mode:v})=>v==="showing"),d=(g=(p=(m=ll())==null?void 0:m.getSessionObj().media[0])==null?void 0:p.activeTrackIds)!=null?g:[],u=d;if(d.length&&(u=u.filter(v=>!o.includes(v))),l!=null&&l.trackId&&(u=[...u,l.trackId]),u=[...new Set(u)],!((v,b)=>v.length===b.length&&v.every(E=>b.includes(E)))(d,u))try{let v=new chrome.cast.media.EditTracksInfoRequest(u);await m_(v)}catch(v){console.error(v)}};var A_=i=>{var e,t,s,r,n,a,o,Me,S_;return t=class extends i{constructor(){super(...arguments);oe(this,o);oe(this,s,{paused:!1});oe(this,r,Hg());oe(this,n);oe(this,a)}get remote(){return C(this,a)?C(this,a):h_()?this.isConnected?(this.disableRemotePlayback||f_(),ts.set(this,{loadOnPrompt:()=>Ne(this,o,S_).call(this)}),ee(this,a,new oc(this))):void 0:super.remote}disconnectedCallback(){var h,f;(h=C(this,a))==null||h.destroy(),ee(this,a,null),ts.delete(this),(f=super.disconnectedCallback)==null||f.call(this)}attributeChangedCallback(h,f,m){if(super.attributeChangedCallback(h,f,m),h==="cast-receiver"&&m){C(this,r).receiverApplicationId=m;return}if(C(this,o,Me))switch(h){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var v,b;if(!C(this,o,Me))return super.load();let h=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);h.customData=this.castCustomData;let f=[...this.querySelectorAll("track")].filter(({kind:E,src:T})=>T&&(E==="subtitles"||E==="captions")),m=[],p=0;if(f.length&&(h.tracks=f.map(E=>{let T=++p;m.length===0&&E.track.mode==="showing"&&m.push(T);let A=new chrome.cast.media.Track(T,chrome.cast.media.TrackType.TEXT);return A.trackContentId=E.src,A.trackContentType="text/vtt",A.subtype=E.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,A.name=E.label,A.language=E.srclang,A})),this.castStreamType==="live"?h.streamType=chrome.cast.media.StreamType.LIVE:h.streamType=chrome.cast.media.StreamType.BUFFERED,h.metadata=new chrome.cast.media.GenericMediaMetadata,h.metadata.title=this.title,h.metadata.images=[{url:this.poster}],g_(this.castSrc)){let E=await v_(this.castSrc);(E==null?void 0:E.includes("m4s"))||(E==null?void 0:E.includes("mp4"))?(h.hlsSegmentFormat=chrome.cast.media.HlsSegmentFormat.FMP4,h.hlsVideoSegmentFormat=chrome.cast.media.HlsVideoSegmentFormat.FMP4):E!=null&&E.includes("ts")&&(h.hlsSegmentFormat=chrome.cast.media.HlsSegmentFormat.TS,h.hlsVideoSegmentFormat=chrome.cast.media.HlsVideoSegmentFormat.TS)}let g=new chrome.cast.media.LoadRequest(h);g.currentTime=(v=super.currentTime)!=null?v:0,g.autoplay=!C(this,s).paused,g.activeTrackIds=m,await((b=ll())==null?void 0:b.loadMedia(g)),this.dispatchEvent(new Event("volumechange"))}play(){var h;if(C(this,o,Me)){C(this,o,Me).isPaused&&((h=C(this,o,Me).controller)==null||h.playOrPause());return}return super.play()}pause(){var h;if(C(this,o,Me)){C(this,o,Me).isPaused||(h=C(this,o,Me).controller)==null||h.playOrPause();return}super.pause()}get castOptions(){return C(this,r)}get castReceiver(){var h;return(h=this.getAttribute("cast-receiver"))!=null?h:void 0}set castReceiver(h){this.castReceiver!=h&&this.setAttribute("cast-receiver",`${h}`)}get castSrc(){var h,f,m;return(m=(f=this.getAttribute("cast-src"))!=null?f:(h=this.querySelector("source"))==null?void 0:h.src)!=null?m:this.currentSrc}set castSrc(h){this.castSrc!=h&&this.setAttribute("cast-src",`${h}`)}get castContentType(){var h;return(h=this.getAttribute("cast-content-type"))!=null?h:void 0}set castContentType(h){this.setAttribute("cast-content-type",`${h}`)}get castStreamType(){var h,f;return(f=(h=this.getAttribute("cast-stream-type"))!=null?h:this.streamType)!=null?f:void 0}set castStreamType(h){this.setAttribute("cast-stream-type",`${h}`)}get castCustomData(){return C(this,n)}set castCustomData(h){let f=typeof h;if(!["object","undefined"].includes(f)){console.error(`castCustomData must be nullish or an object but value was of type ${f}`);return}ee(this,n,h)}get readyState(){if(C(this,o,Me))switch(C(this,o,Me).playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return C(this,o,Me)?C(this,o,Me).isPaused:super.paused}get muted(){var h;return C(this,o,Me)?(h=C(this,o,Me))==null?void 0:h.isMuted:super.muted}set muted(h){var f;if(C(this,o,Me)){(h&&!C(this,o,Me).isMuted||!h&&C(this,o,Me).isMuted)&&((f=C(this,o,Me).controller)==null||f.muteOrUnmute());return}super.muted=h}get volume(){var h,f;return C(this,o,Me)?(f=(h=C(this,o,Me))==null?void 0:h.volumeLevel)!=null?f:1:super.volume}set volume(h){var f;if(C(this,o,Me)){C(this,o,Me).volumeLevel=+h,(f=C(this,o,Me).controller)==null||f.setVolumeLevel();return}super.volume=h}get duration(){var h,f,m;return C(this,o,Me)&&((h=C(this,o,Me))!=null&&h.isMediaLoaded)?(m=(f=C(this,o,Me))==null?void 0:f.duration)!=null?m:NaN:super.duration}get currentTime(){var h,f,m;return C(this,o,Me)&&((h=C(this,o,Me))!=null&&h.isMediaLoaded)?(m=(f=C(this,o,Me))==null?void 0:f.currentTime)!=null?m:0:super.currentTime}set currentTime(h){var f;if(C(this,o,Me)){C(this,o,Me).currentTime=h,(f=C(this,o,Me).controller)==null||f.seek();return}super.currentTime=h}},s=new WeakMap,r=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakSet,Me=function(){var h,f;return(f=(h=ts.get(this.remote))==null?void 0:h.getCastPlayer)==null?void 0:f.call(h)},S_=async function(){C(this,s).paused=wd(t.prototype,this,"paused"),wd(t.prototype,this,"pause").call(this),this.muted=wd(t.prototype,this,"muted");try{await this.load()}catch(h){console.error(h)}},Ae(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t};var Ms=class extends Event{constructor(t,s){super(t);Ae(this,"track");this.track=s.track}};var Wg=new WeakMap;function X(i){var e;return(e=Wg.get(i))!=null?e:Vw(i,{})}function Vw(i,e){let t=Wg.get(i);return t||Wg.set(i,t={}),Object.assign(t,e)}function dc(i,e){let t=i.videoTracks;X(e).media=new WeakRef(i),X(e).renditionSet||(X(e).renditionSet=new Set);let s=X(t).trackSet;s.add(e);let r=s.size-1;r in on.prototype||Object.defineProperty(on.prototype,r,{get(){return[...X(this).trackSet][r]}}),queueMicrotask(()=>{t.dispatchEvent(new Ms("addtrack",{track:e}))})}function uc(i){var s,r;let e=(r=(s=X(i).media)==null?void 0:s.deref())==null?void 0:r.videoTracks;if(!e)return;X(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ms("removetrack",{track:i}))})}function I_(i){var s,r,n;let e=(n=(r=(s=X(i).media)==null?void 0:s.deref())==null?void 0:r.videoTracks)!=null?n:[],t=!1;for(let a of e)a!==i&&(a.selected=!1,t=!0);if(t){if(X(e).changeRequested)return;X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var lr,dr,ur,an,ul,on=class extends EventTarget{constructor(){super();oe(this,an);oe(this,lr);oe(this,dr);oe(this,ur);X(this).trackSet=new Set}[Symbol.iterator](){return C(this,an,ul).values()}get length(){return C(this,an,ul).size}getTrackById(t){var s;return(s=[...C(this,an,ul)].find(r=>r.id===t))!=null?s:null}get selectedIndex(){return[...C(this,an,ul)].findIndex(t=>t.selected)}get onaddtrack(){return C(this,lr)}set onaddtrack(t){C(this,lr)&&(this.removeEventListener("addtrack",C(this,lr)),ee(this,lr,void 0)),typeof t=="function"&&(ee(this,lr,t),this.addEventListener("addtrack",t))}get onremovetrack(){return C(this,dr)}set onremovetrack(t){C(this,dr)&&(this.removeEventListener("removetrack",C(this,dr)),ee(this,dr,void 0)),typeof t=="function"&&(ee(this,dr,t),this.addEventListener("removetrack",t))}get onchange(){return C(this,ur)}set onchange(t){C(this,ur)&&(this.removeEventListener("change",C(this,ur)),ee(this,ur,void 0)),typeof t=="function"&&(ee(this,ur,t),this.addEventListener("change",t))}};lr=new WeakMap,dr=new WeakMap,ur=new WeakMap,an=new WeakSet,ul=function(){return X(this).trackSet};var Ps=class extends Event{constructor(t,s){super(t);Ae(this,"rendition");this.rendition=s.rendition}};function L_(i,e){var n,a;let t=(a=(n=X(i).media)==null?void 0:n.deref())==null?void 0:a.videoRenditions;X(e).media=X(i).media,X(e).track=i;let s=X(i).renditionSet;s.add(e);let r=s.size-1;r in ln.prototype||Object.defineProperty(ln.prototype,r,{get(){return da(this)[r]}}),queueMicrotask(()=>{!t||!i.selected||t.dispatchEvent(new Ps("addrendition",{rendition:e}))})}function x_(i){var r,n;let e=(n=(r=X(i).media)==null?void 0:r.deref())==null?void 0:n.videoRenditions,t=X(i).track;X(t).renditionSet.delete(i),queueMicrotask(()=>{let a=X(i).track;!e||!a.selected||e.dispatchEvent(new Ps("removerendition",{rendition:i}))})}function R_(i){var t,s;let e=(s=(t=X(i).media)==null?void 0:t.deref())==null?void 0:s.videoRenditions;!e||X(e).changeRequested||(X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,X(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function da(i){var t;let e=(t=X(i).media)==null?void 0:t.deref();return e?[...e.videoTracks].filter(s=>s.selected).flatMap(s=>[...X(s).renditionSet]):[]}var cr,hr,fr,ln=class extends EventTarget{constructor(){super(...arguments);oe(this,cr);oe(this,hr);oe(this,fr)}[Symbol.iterator](){return da(this).values()}get length(){return da(this).length}getRenditionById(t){var s;return(s=da(this).find(r=>`${r.id}`==`${t}`))!=null?s:null}get selectedIndex(){return da(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,r]of da(this).entries())r.selected=s===t}get onaddrendition(){return C(this,cr)}set onaddrendition(t){C(this,cr)&&(this.removeEventListener("addrendition",C(this,cr)),ee(this,cr,void 0)),typeof t=="function"&&(ee(this,cr,t),this.addEventListener("addrendition",t))}get onremoverendition(){return C(this,hr)}set onremoverendition(t){C(this,hr)&&(this.removeEventListener("removerendition",C(this,hr)),ee(this,hr,void 0)),typeof t=="function"&&(ee(this,hr,t),this.addEventListener("removerendition",t))}get onchange(){return C(this,fr)}set onchange(t){C(this,fr)&&(this.removeEventListener("change",C(this,fr)),ee(this,fr,void 0)),typeof t=="function"&&(ee(this,fr,t),this.addEventListener("change",t))}};cr=new WeakMap,hr=new WeakMap,fr=new WeakMap;var ua,cl=class{constructor(){Ae(this,"src");Ae(this,"id");Ae(this,"width");Ae(this,"height");Ae(this,"bitrate");Ae(this,"frameRate");Ae(this,"codec");oe(this,ua,!1)}get selected(){return C(this,ua)}set selected(e){C(this,ua)!==e&&(ee(this,ua,e),R_(this))}};ua=new WeakMap;var ca,ha=class{constructor(){Ae(this,"id");Ae(this,"kind");Ae(this,"label","");Ae(this,"language","");Ae(this,"sourceBuffer");oe(this,ca,!1)}addRendition(e,t,s,r,n,a){let o=new cl;return o.src=e,o.width=t,o.height=s,o.frameRate=a,o.bitrate=n,o.codec=r,L_(this,o),o}removeRendition(e){x_(e)}get selected(){return C(this,ca)}set selected(e){C(this,ca)!==e&&(ee(this,ca,e),e===!0&&I_(this))}};ca=new WeakMap;function k_(i,e){var n,a;let t=(a=(n=X(i).media)==null?void 0:n.deref())==null?void 0:a.audioRenditions;X(e).media=X(i).media,X(e).track=i;let s=X(i).renditionSet;s.add(e);let r=s.size-1;r in dn.prototype||Object.defineProperty(dn.prototype,r,{get(){return fa(this)[r]}}),queueMicrotask(()=>{!t||!i.enabled||t.dispatchEvent(new Ps("addrendition",{rendition:e}))})}function D_(i){var r,n;let e=(n=(r=X(i).media)==null?void 0:r.deref())==null?void 0:n.audioRenditions,t=X(i).track;X(t).renditionSet.delete(i),queueMicrotask(()=>{let a=X(i).track;!e||!a.enabled||e.dispatchEvent(new Ps("removerendition",{rendition:i}))})}function C_(i){var t,s;let e=(s=(t=X(i).media)==null?void 0:t.deref())==null?void 0:s.audioRenditions;!e||X(e).changeRequested||(X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,X(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function fa(i){var t;let e=(t=X(i).media)==null?void 0:t.deref();return e?[...e.audioTracks].filter(s=>s.enabled).flatMap(s=>[...X(s).renditionSet]):[]}var mr,pr,gr,dn=class extends EventTarget{constructor(){super(...arguments);oe(this,mr);oe(this,pr);oe(this,gr)}[Symbol.iterator](){return fa(this).values()}get length(){return fa(this).length}getRenditionById(t){var s;return(s=fa(this).find(r=>`${r.id}`==`${t}`))!=null?s:null}get selectedIndex(){return fa(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,r]of fa(this).entries())r.selected=s===t}get onaddrendition(){return C(this,mr)}set onaddrendition(t){C(this,mr)&&(this.removeEventListener("addrendition",C(this,mr)),ee(this,mr,void 0)),typeof t=="function"&&(ee(this,mr,t),this.addEventListener("addrendition",t))}get onremoverendition(){return C(this,pr)}set onremoverendition(t){C(this,pr)&&(this.removeEventListener("removerendition",C(this,pr)),ee(this,pr,void 0)),typeof t=="function"&&(ee(this,pr,t),this.addEventListener("removerendition",t))}get onchange(){return C(this,gr)}set onchange(t){C(this,gr)&&(this.removeEventListener("change",C(this,gr)),ee(this,gr,void 0)),typeof t=="function"&&(ee(this,gr,t),this.addEventListener("change",t))}};mr=new WeakMap,pr=new WeakMap,gr=new WeakMap;var ma,hl=class{constructor(){Ae(this,"src");Ae(this,"id");Ae(this,"bitrate");Ae(this,"codec");oe(this,ma,!1)}get selected(){return C(this,ma)}set selected(e){C(this,ma)!==e&&(ee(this,ma,e),C_(this))}};ma=new WeakMap;function hc(i,e){let t=i.audioTracks;X(e).media=new WeakRef(i),X(e).renditionSet||(X(e).renditionSet=new Set);let s=X(t).trackSet;s.add(e);let r=s.size-1;r in un.prototype||Object.defineProperty(un.prototype,r,{get(){return[...X(this).trackSet][r]}}),queueMicrotask(()=>{t.dispatchEvent(new Ms("addtrack",{track:e}))})}function fc(i){var s,r;let e=(r=(s=X(i).media)==null?void 0:s.deref())==null?void 0:r.audioTracks;if(!e)return;X(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ms("removetrack",{track:i}))})}function w_(i){var t,s;let e=(s=(t=X(i).media)==null?void 0:t.deref())==null?void 0:s.audioTracks;!e||X(e).changeRequested||(X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var vr,Er,yr,pa,cc,un=class extends EventTarget{constructor(){super();oe(this,pa);oe(this,vr);oe(this,Er);oe(this,yr);X(this).trackSet=new Set}[Symbol.iterator](){return C(this,pa,cc).values()}get length(){return C(this,pa,cc).size}getTrackById(t){var s;return(s=[...C(this,pa,cc)].find(r=>r.id===t))!=null?s:null}get onaddtrack(){return C(this,vr)}set onaddtrack(t){C(this,vr)&&(this.removeEventListener("addtrack",C(this,vr)),ee(this,vr,void 0)),typeof t=="function"&&(ee(this,vr,t),this.addEventListener("addtrack",t))}get onremovetrack(){return C(this,Er)}set onremovetrack(t){C(this,Er)&&(this.removeEventListener("removetrack",C(this,Er)),ee(this,Er,void 0)),typeof t=="function"&&(ee(this,Er,t),this.addEventListener("removetrack",t))}get onchange(){return C(this,yr)}set onchange(t){C(this,yr)&&(this.removeEventListener("change",C(this,yr)),ee(this,yr,void 0)),typeof t=="function"&&(ee(this,yr,t),this.addEventListener("change",t))}};vr=new WeakMap,Er=new WeakMap,yr=new WeakMap,pa=new WeakSet,cc=function(){return X(this).trackSet};var ga,va=class{constructor(){Ae(this,"id");Ae(this,"kind");Ae(this,"label","");Ae(this,"language","");Ae(this,"sourceBuffer");oe(this,ga,!1)}addRendition(e,t,s){let r=new hl;return r.src=e,r.codec=t,r.bitrate=s,k_(this,r),r}removeRendition(e){D_(e)}get enabled(){return C(this,ga)}set enabled(e){C(this,ga)!==e&&(ee(this,ga,e),w_(this))}};ga=new WeakMap;var M_=mc(globalThis.HTMLMediaElement,"video"),P_=mc(globalThis.HTMLMediaElement,"audio");function O_(i){if(!(i!=null&&i.prototype))return i;let e=mc(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return Ww(this)}});let t=mc(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return qw(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new ha;return l.kind=n,l.label=a,l.language=o,dc(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=uc),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new va;return l.kind=n,l.label=a,l.language=o,hc(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=fc),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return s(this)}});let s=n=>{let a=X(n).videoRenditions;return a||(a=new ln,X(a).media=new WeakRef(n),X(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return r(this)}});let r=n=>{let a=X(n).audioRenditions;return a||(a=new dn,X(a).media=new WeakRef(n),X(n).audioRenditions=a),a};return i}function mc(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function Ww(i){var t;let e=X(i).videoTracks;if(!e&&(e=new on,X(i).videoTracks=e,M_)){let s=M_.call((t=i.nativeEl)!=null?t:i);for(let o of s)dc(i,o);let r=()=>{e.dispatchEvent(new Event("change"))},n=o=>{if([...e].some(l=>l instanceof ha)){for(let l of s)uc(l);return}dc(i,o.track)},a=o=>{uc(o.track)};s.addEventListener("change",r),s.addEventListener("addtrack",n),s.addEventListener("removetrack",a)}return e}function qw(i){var t;let e=X(i).audioTracks;if(!e&&(e=new un,X(i).audioTracks=e,P_)){let s=P_.call((t=i.nativeEl)!=null?t:i);for(let o of s)hc(i,o);let r=()=>{e.dispatchEvent(new Event("change"))},n=o=>{if([...e].some(l=>l instanceof va)){for(let l of s)fc(l);return}hc(i,o.track)},a=o=>{fc(o.track)};s.addEventListener("change",r),s.addEventListener("addtrack",n),s.addEventListener("removetrack",a)}return e}var U_=i=>{throw TypeError(i)},F_=(i,e,t)=>e.has(i)||U_("Cannot "+t),B_=(i,e,t)=>(F_(i,e,"read from private field"),t?t.call(i):e.get(i)),$_=(i,e,t)=>e.has(i)?U_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),H_=(i,e,t,s)=>(F_(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),vc=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends vc{}globalThis.DocumentFragment=i}var Yg=class extends vc{},Yw=class extends vc{},jw={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Yg)}},pc,zw=class{constructor(i,e={}){$_(this,pc),H_(this,pc,e==null?void 0:e.detail)}get detail(){return B_(this,pc)}initCustomEvent(){}};pc=new WeakMap;function Qw(i,e){return new Yg}var G_={document:{createElement:Qw},DocumentFragment,customElements:jw,CustomEvent:zw,EventTarget:vc,HTMLElement:Yg,HTMLVideoElement:Yw},K_=typeof window=="undefined"||typeof globalThis.customElements=="undefined",qg=K_?G_:globalThis,W3=K_?G_.document:globalThis.document,gc,N_=class extends A_(O_(d_)){constructor(){super(...arguments),$_(this,gc)}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var i;return(i=B_(this,gc))!=null?i:this.muxCastCustomData}set castCustomData(i){H_(this,gc,i)}};gc=new WeakMap;qg.customElements.get("mux-video")||(qg.customElements.define("mux-video",N_),qg.MuxVideoElement=N_);var K={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"},ge={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},jg={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"},V_=Object.entries(jg),_=V_.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),Xw={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},li=V_.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...Xw}),iU=Object.entries(li).reduce((i,[e,t])=>{let s=_[e];return s&&(i[t]=s),i},{userinactivechange:"userinactive"}),W_=Object.entries(_).reduce((i,[e,t])=>{let s=li[e];return s&&(i[t]=s),i},{userinactive:"userinactivechange"}),Qt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},br={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ec={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Xt={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ni={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var q_={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Y_(i){return i==null?void 0:i.map(Jw).join(" ")}function j_(i){return i==null?void 0:i.split(/\s+/).map(eM)}function Jw(i){if(i){let{id:e,width:t,height:s}=i;return[e,t,s].filter(r=>r!=null).join(":")}}function eM(i){if(i){let[e,t,s]=i.split(":");return{id:e,width:+t,height:+s}}}function z_(i){return i==null?void 0:i.map(tM).join(" ")}function Q_(i){return i==null?void 0:i.split(/\s+/).map(iM)}function tM(i){if(i){let{id:e,kind:t,language:s,label:r}=i;return[e,t,s,r].filter(n=>n!=null).join(":")}}function iM(i){if(i){let[e,t,s,r]=i.split(":");return{id:e,kind:t,language:s,label:r}}}function X_(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ea(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function yc(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var bc=i=>new Promise(e=>setTimeout(e,i));var Z_={"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 J_,zg={en:Z_},Qg=((J_=globalThis.navigator)==null?void 0:J_.language)||"en",eA=i=>{Qg=i};var sM=i=>{var e,t,s;let[r]=Qg.split("-");return((e=zg[Qg])==null?void 0:e[i])||((t=zg[r])==null?void 0:t[i])||((s=zg.en)==null?void 0:s[i])||i},F=(i,e={})=>sM(i).replace(/\{(\w+)\}/g,(t,s)=>s in e?String(e[s]):`{${s}}`);var tA=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],rM=(i,e)=>{let t=i===1?F(tA[e].singular):F(tA[e].plural);return`${i} ${t}`},cn=i=>{if(!Ea(i))return"";let e=Math.abs(i),t=e!==i,s=new Date(0,0,0,0,0,e,0),n=[s.getHours(),s.getMinutes(),s.getSeconds()].map((a,o)=>a&&rM(a,o)).filter(a=>a).join(", ");return t?F("{time} remaining",{time:n}):n};function Ui(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let s=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),a=Math.floor(e/60%60),o=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=s="0"),n=n>0||o>0?n+":":"",r=((n||a>=10)&&r<10?"0"+r:r)+":",s=s<10?"0"+s:s,(t?"-":"")+n+r+s}var dU=Object.freeze({length:0,start(i){let e=i>>>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(i){let e=i>>>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 Tc=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},_c=class extends Tc{},Ac=class extends _c{constructor(){super(...arguments),this.role=null}},Xg=class{observe(){}unobserve(){}disconnect(){}},iA={createElement:function(){return new fl.HTMLElement},createElementNS:function(){return new fl.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},fl={ResizeObserver:Xg,document:iA,Node:_c,Element:Ac,HTMLElement:class extends Ac{constructor(){super(...arguments),this.innerHTML=""}get content(){return new fl.DocumentFragment}},DocumentFragment:class extends Tc{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}},DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},sA="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window=="undefined"||typeof window.customElements=="undefined",rA=Object.keys(fl).every(i=>i in globalThis),L=sA&&!rA?fl:globalThis,He=sA&&!rA?iA:globalThis.document;var nA=new WeakMap,Zg=i=>{let e=nA.get(i);return e||nA.set(i,e=new Set),e},aA=new L.ResizeObserver(i=>{for(let e of i)for(let t of Zg(e.target))t(e)});function Os(i,e){Zg(i).add(e),aA.observe(i)}function Ns(i,e){let t=Zg(i);t.delete(e),t.size||aA.unobserve(i)}function Qe(i){let e={};for(let t of i)e[t.name]=t.value;return e}function Ye(i){var e;return(e=Sc(i))!=null?e:is(i,"media-controller")}function Sc(i){var e;let{MEDIA_CONTROLLER:t}=ge,s=i.getAttribute(t);if(s)return(e=hn(i))==null?void 0:e.getElementById(s)}var Ic=(i,e,t=".value")=>{let s=i.querySelector(t);s&&(s.textContent=e)},aM=(i,e)=>{let t=`slot[name="${e}"]`,s=i.shadowRoot.querySelector(t);return s?s.children:[]},Lc=(i,e)=>aM(i,e)[0],Gt=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Gt(i,e.getRootNode().host),is=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||is(i.getRootNode().host,e)};function ml(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=ml(t.shadowRoot))!=null?e:t:null}function hn(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function xc(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:s=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:s});let r=i;for(;r&&e>0;){let n=getComputedStyle(r);if(t&&n.opacity==="0"||s&&n.visibility==="hidden"||n.display==="none")return!1;r=r.parentElement,e--}return!0}function oA(i,e,t,s){let r=s.x-t.x,n=s.y-t.y,a=r*r+n*n;if(a===0)return 0;let o=((i-t.x)*r+(e-t.y)*n)/a;return Math.max(0,Math.min(1,o))}function je(i,e){let t=oM(i,s=>s===e);return t||pl(i,e)}function oM(i,e){var t,s;let r;for(r of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(s=r.sheet)==null?void 0:s.cssRules}catch{continue}for(let a of n!=null?n:[])if(e(a.selectorText))return a}}function pl(i,e){var t,s;let r=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=r==null?void 0:r[r.length-1];if(!(n!=null&&n.sheet))return console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}};let a=n==null?void 0:n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length);return(s=n.sheet.cssRules)==null?void 0:s[a]}function be(i,e,t=Number.NaN){let s=i.getAttribute(e);return s!=null?+s:t}function Le(i,e,t){let s=+t;if(t==null||Number.isNaN(s)){i.hasAttribute(e)&&i.removeAttribute(e);return}be(i,e,void 0)!==s&&i.setAttribute(e,`${s}`)}function le(i,e){return i.hasAttribute(e)}function de(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}le(i,e)!=t&&i.toggleAttribute(e,t)}function me(i,e,t=null){var s;return(s=i.getAttribute(e))!=null?s:t}function fe(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let s=`${t}`;me(i,e,void 0)!==s&&i.setAttribute(e,s)}var lA=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fi=(i,e,t)=>(lA(i,e,"read from private field"),t?t.call(i):e.get(i)),lM=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Rc=(i,e,t,s)=>(lA(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),wt;function dM(i){return`
141
141
  <style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mux/mux-player",
3
- "version": "3.11.6",
3
+ "version": "3.11.7-canary.0",
4
4
  "description": "An open source Mux player web component that Just Works™",
5
5
  "homepage": "https://mux.com/player",
6
6
  "keywords": [