@mux/mux-player 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +197 -200
- package/dist/index.mjs +188 -191
- package/dist/mux-player.js +369 -359
- package/dist/mux-player.mjs +369 -359
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/helpers.d.ts +2 -2
- package/dist/types/index.d.ts +15 -0
- package/dist/types/utils.d.ts +1 -1
- package/dist/types-ts3.4/helpers.d.ts +2 -2
- package/dist/types-ts3.4/index.d.ts +13 -0
- package/dist/types-ts3.4/utils.d.ts +1 -1
- package/package.json +6 -5
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Vo=Object.create;var Rt=Object.defineProperty;var Ho=Object.getOwnPropertyDescriptor;var Wo=Object.getOwnPropertyNames;var Fo=Object.getPrototypeOf,Ko=Object.prototype.hasOwnProperty;var Yo=(t,i)=>{for(var e in i)Rt(t,e,{get:i[e],enumerable:!0})},or=(t,i,e,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Wo(i))!Ko.call(t,r)&&r!==e&&Rt(t,r,{get:()=>i[r],enumerable:!(a=Ho(i,r))||a.enumerable});return t};var Go=(t,i,e)=>(e=t!=null?Vo(Fo(t)):{},or(i||!t||!t.__esModule?Rt(e,"default",{value:t,enumerable:!0}):e,t)),Zo=t=>or(Rt({},"__esModule",{value:!0}),t);var Si=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var v=(t,i,e)=>(Si(t,i,"read from private field"),e?e.call(t):i.get(t)),T=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},B=(t,i,e,a)=>(Si(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e);var I=(t,i,e)=>(Si(t,i,"access private method"),e);var cd={};Yo(cd,{MediaError:()=>g.MediaError,default:()=>dd,getVideoAttribute:()=>ve});module.exports=Zo(cd);var Ne=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Ne{}globalThis.DocumentFragment=t}var it=class extends Ne{},ki=class extends Ne{},Qo={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(it)}},at,Li=class{constructor(i,e={}){T(this,at,void 0);B(this,at,e==null?void 0:e.detail)}get detail(){return v(this,at)}initCustomEvent(){}};at=new WeakMap;function qo(t,i){return new it}var sr={document:{createElement:qo},DocumentFragment,customElements:Qo,CustomEvent:Li,EventTarget:Ne,HTMLElement:it,HTMLVideoElement:ki},lr=typeof window=="undefined"||typeof globalThis.customElements=="undefined",M=lr?sr:globalThis,G=lr?sr.document:globalThis.document;var h={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_CAPTIONS_REQUEST:"mediashowcaptionsrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_CAPTIONS_REQUEST:"mediadisablecaptionsrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},rt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaairplayunavailablechange",MEDIA_PIP_UNAVAILABLE:"mediapipunavailablechange",MEDIA_PAUSED:"mediapausedchange",MEDIA_HAS_PLAYED:"mediahasplayedchange",MEDIA_MUTED:"mediamutedchange",MEDIA_VOLUME_LEVEL:"mediavolumelevelchange",MEDIA_VOLUME:"mediavolumechange",MEDIA_VOLUME_UNAVAILABLE:"mediavolumeunavailablechange",MEDIA_IS_PIP:"mediaispipchange",MEDIA_IS_CASTING:"mediaiscastingchange",MEDIA_CAPTIONS_LIST:"mediacaptionslistchange",MEDIA_SUBTITLES_LIST:"mediasubtitleslistchange",MEDIA_CAPTIONS_SHOWING:"mediacaptionsshowingchange",MEDIA_SUBTITLES_SHOWING:"mediasubtitlesshowingchange",MEDIA_IS_FULLSCREEN:"mediaisfullscreenchange",MEDIA_PLAYBACK_RATE:"mediaplaybackratechange",MEDIA_CURRENT_TIME:"mediacurrenttimechange",MEDIA_DURATION:"mediadurationchange",MEDIA_SEEKABLE:"mediaseekablechange",MEDIA_PREVIEW_IMAGE:"mediapreviewimagechange",MEDIA_PREVIEW_COORDS:"mediapreviewcoordschange",MEDIA_LOADING:"medialoadingchange",USER_INACTIVE:"userinactivechange"},o={MEDIA_AIRPLAY_UNAVAILABLE:"media-airplay-unavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"media-fullscreen-unavailable",MEDIA_PIP_UNAVAILABLE:"media-pip-unavailable",MEDIA_CAST_UNAVAILABLE:"media-cast-unavailable",MEDIA_PAUSED:"media-paused",MEDIA_HAS_PLAYED:"media-has-played",MEDIA_MUTED:"media-muted",MEDIA_VOLUME_LEVEL:"media-volume-level",MEDIA_VOLUME:"media-volume",MEDIA_VOLUME_UNAVAILABLE:"media-volume-unavailable",MEDIA_IS_PIP:"media-is-pip",MEDIA_IS_CASTING:"media-is-casting",MEDIA_CAPTIONS_LIST:"media-captions-list",MEDIA_SUBTITLES_LIST:"media-subtitles-list",MEDIA_CAPTIONS_SHOWING:"media-captions-showing",MEDIA_SUBTITLES_SHOWING:"media-subtitles-showing",MEDIA_IS_FULLSCREEN:"media-is-fullscreen",MEDIA_PLAYBACK_RATE:"media-playback-rate",MEDIA_CURRENT_TIME:"media-current-time",MEDIA_DURATION:"media-duration",MEDIA_SEEKABLE:"media-seekable",MEDIA_PREVIEW_TIME:"media-preview-time",MEDIA_PREVIEW_IMAGE:"media-preview-image",MEDIA_PREVIEW_COORDS:"media-preview-coords",MEDIA_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered"},hd=Object.entries(rt).reduce((t,[i,e])=>{let a=o[i];return a&&(t[e]=a),t},{userinactivechange:"user-inactive"}),dr=Object.entries(o).reduce((t,[i,e])=>{let a=rt[i];return a&&(t[e]=a),t},{"user-inactive":"userinactivechange"}),$e={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},_e={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ci={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Z={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"};var N={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:t=1}={})=>`current playback rate ${t}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},L={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:t=30}={})=>`seek forward ${t} seconds`,SEEK_BACK_N_SECS:({seekOffset:t=30}={})=>`seek back ${t} seconds`},jo={...N,...L};var Xo=t=>typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t),cr=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Jo=(t,i)=>{let e=t===1?cr[i].singular:cr[i].plural;return`${t} ${e}`},ye=t=>{if(!Xo(t))return"";let i=Math.abs(t),e=i!==t,a=new Date(0,0,0,0,0,i,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,c)=>l&&Jo(l,c)).filter(l=>l).join(", ")}${e?" remaining":""}`};function z(t,i){let e=!1;t<0&&(e=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),n=Math.floor(t/3600),s=Math.floor(i/60%60),l=Math.floor(i/3600);return(isNaN(t)||t===1/0)&&(n=r=a="-"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(e?"-":"")+n+r+a}var ur={HTMLElement:function(){this.addEventListener=()=>{},this.removeEventListener=()=>{},this.dispatchEvent=()=>{}},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},ts={createElement:function(){return new ur.HTMLElement}},mr=typeof window=="undefined"||typeof window.customElements=="undefined",u=mr?ur:window,d=mr?ts:window.document;function p(t,i){u.customElements.get(t)||(u.customElements.define(t,i),u[i.name]=i)}var is=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},Te=(t,i,e)=>(is(t,i,"read from private field"),e?e.call(t):i.get(t)),wi=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Pt,Be,Di,hr=d.createElement("template");hr.innerHTML=`
|
|
2
2
|
<style>
|
|
3
3
|
:host {
|
|
4
4
|
display: inline-flex;
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
min-width: 100%;
|
|
51
51
|
}
|
|
52
52
|
</style>
|
|
53
|
-
`;var
|
|
53
|
+
`;var Ut=class extends u.HTMLElement{constructor(i={}){super(),wi(this,Pt,n=>{this.handleClick(n)}),wi(this,Be,n=>{let{key:s}=n;if(!this.keysUsed.includes(s)){this.removeEventListener("keyup",Te(this,Be));return}this.handleClick(n)}),wi(this,Di,n=>{let{metaKey:s,altKey:l,key:c}=n;if(s||l||!this.keysUsed.includes(c)){this.removeEventListener("keyup",Te(this,Be));return}this.addEventListener("keyup",Te(this,Be),{once:!0})});let e=this.attachShadow({mode:"open"}),a=hr.content.cloneNode(!0);this.nativeEl=a;let r=i.slotTemplate;r||(r=d.createElement("template"),r.innerHTML=`<slot>${i.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),e.appendChild(a)}static get observedAttributes(){return["disabled",o.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",Te(this,Pt)),this.addEventListener("keydown",Te(this,Di)),this.setAttribute("tabindex",0)}disable(){this.removeEventListener("click",Te(this,Pt)),this.removeEventListener("keyup",Te(this,Be)),this.removeAttribute("tabindex")}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else i==="disabled"&&a!==e&&(a==null?this.enable():this.disable())}connectedCallback(){var i;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;this.disable();let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}get keysUsed(){return["Enter"," "]}handleClick(){}};Pt=new WeakMap;Be=new WeakMap;Di=new WeakMap;p("media-chrome-button",Ut);var w=Ut;var as=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
54
54
|
<path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
|
|
55
55
|
</svg>
|
|
56
|
-
`,
|
|
57
|
-
<slot name="airplay">${
|
|
58
|
-
`;var
|
|
56
|
+
`,pr=d.createElement("template");pr.innerHTML=`
|
|
57
|
+
<slot name="airplay">${as}</slot>
|
|
58
|
+
`;var xi=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(i={}){super({slotTemplate:pr,...i})}connectedCallback(){this.setAttribute("aria-label",L.AIRPLAY()),super.connectedCallback()}handleClick(i){let e=new u.CustomEvent(h.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};p("media-airplay-button",xi);var rs='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',ns='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>',Er=d.createElement("template");Er.innerHTML=`
|
|
59
59
|
<style>
|
|
60
60
|
:host([${o.MEDIA_IS_CASTING}]) slot:not([name=exit]) > *,
|
|
61
61
|
:host([${o.MEDIA_IS_CASTING}]) ::slotted(:not([slot=exit])) {
|
|
@@ -69,16 +69,16 @@
|
|
|
69
69
|
}
|
|
70
70
|
</style>
|
|
71
71
|
|
|
72
|
-
<slot name="enter">${
|
|
73
|
-
<slot name="exit">${
|
|
74
|
-
`;var
|
|
72
|
+
<slot name="enter">${rs}</slot>
|
|
73
|
+
<slot name="exit">${ns}</slot>
|
|
74
|
+
`;var br=t=>{let e=t.getAttribute(o.MEDIA_IS_CASTING)!=null?L.EXIT_CAST():L.ENTER_CAST();t.setAttribute("aria-label",e)},Ri=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(i={}){super({slotTemplate:Er,...i})}connectedCallback(){br(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_CASTING&&br(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_IS_CASTING)!=null?h.MEDIA_EXIT_CAST_REQUEST:h.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-cast-button",Ri);var Ot=(t,i,e=".value")=>{let a=t.querySelector(e);!a||(a.textContent=i)},os=(t,i)=>{let e=`slot[name="${i}"]`,a=t.shadowRoot.querySelector(e);return a?a.children:[]},Nt=(t,i)=>os(t,i)[0],nt=(t,i)=>!t||!i?!1:t.contains(i)?!0:nt(t,i.getRootNode().host),ot=(t,i)=>{if(!t)return null;let e=t.closest(i);return e||ot(t.getRootNode().host,i)};function oe(t,i){var e,a;let r;for(r of t.querySelectorAll("style"))for(let n of(a=(e=r.sheet)==null?void 0:e.cssRules)!=null?a:[])if(n.selectorText===i)return n;return r!=null&&r.sheet?(r.sheet.insertRule(`${i}{}`,r.sheet.cssRules.length),r.sheet.cssRules[r.sheet.cssRules.length-1]):{style:{setProperty:()=>{}}}}var gr=d.createElement("template");gr.innerHTML=`
|
|
75
75
|
<style>
|
|
76
76
|
:host {
|
|
77
77
|
display: inline-block;
|
|
78
78
|
box-sizing: border-box;
|
|
79
79
|
}
|
|
80
80
|
</style>
|
|
81
|
-
`;var Pi=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}constructor(i={}){super();let e=this.attachShadow({mode:"open"}),a=
|
|
81
|
+
`;var Pi=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}constructor(i={}){super();let e=this.attachShadow({mode:"open"}),a=gr.content.cloneNode(!0);this.nativeEl=a;let r=i.slotTemplate;r||(r=d.createElement("template"),r.innerHTML=`<slot>${i.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),e.appendChild(a)}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var i;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0);let e=fr(this);this.getAttribute(o.MEDIA_CONTROLLER)&&((i=e==null?void 0:e.associateElement)==null||i.call(e,this)),e==null||e.addEventListener("pointerdown",this),e==null||e.addEventListener("click",this)}disconnectedCallback(){var i;let e=fr(this);this.getAttribute(o.MEDIA_CONTROLLER)&&((i=e==null?void 0:e.unassociateElement)==null||i.call(e,this)),e==null||e.removeEventListener("pointerdown",this),e==null||e.removeEventListener("click",this)}handleEvent(i){var e;let a=(e=i.composedPath())==null?void 0:e[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(i.type==="pointerdown")this._pointerType=i.pointerType;else if(i.type==="click"){let{clientX:n,clientY:s}=i,{left:l,top:c,width:m,height:E}=this.getBoundingClientRect(),y=n-l,k=s-c;if(y<0||k<0||y>m||k>E||m===0&&E===0)return;let{pointerType:_=this._pointerType}=i;if(this._pointerType=void 0,_===Ci.TOUCH){this.handleTap(i);return}else if(_===Ci.MOUSE){this.handleMouseClick(i);return}}}}handleTap(){}handleMouseClick(){let i=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(i,{composed:!0,bubbles:!0}))}};function fr(t){let i=t.getAttribute(o.MEDIA_CONTROLLER);return i?d.getElementById(i):ot(t,"media-controller")}p("media-gesture-receiver",Pi);var vr=d.createElement("template");vr.innerHTML=`
|
|
82
82
|
<style>
|
|
83
83
|
|
|
84
84
|
:host([media-is-fullscreen]) ::slotted([slot=media]) {
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
|
|
190
190
|
<slot part="bottom chrome"></slot>
|
|
191
191
|
</span>
|
|
192
|
-
`;var ns=Object.values(o),Nt=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Er.content.cloneNode(!0));let i=n=>{let s=this.media;for(let l of n)l.type==="childList"&&(l.removedNodes.forEach(c=>{if(c.slot=="media"&&l.target==this){let m=l.previousSibling&&l.previousSibling.previousElementSibling;if(!m||!s)this.mediaUnsetCallback(c);else{let E=m.slot!=="media";for(;(m=m.previousSibling)!==null;)m.slot=="media"&&(E=!1);E&&this.mediaUnsetCallback(c)}}}),s&&l.addedNodes.forEach(c=>{c==s&&this.handleMediaUpdated(s).then(m=>this.mediaSetCallback(m))}))};new MutationObserver(i).observe(this,{childList:!0,subtree:!0});let a=this.media,r=this.querySelector(":scope > slot[slot=media]");r&&r.addEventListener("slotchange",()=>{if(!r.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(a);return}this.media&&(a=this.media,this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(ns)}attributeChangedCallback(i,e,a){i.toLowerCase()=="autohide"&&(this.autohide=a)}get media(){let i=this.querySelector(":scope > [slot=media]");return(i==null?void 0:i.nodeName)=="SLOT"&&(i=i.assignedElements({flatten:!0})[0]),i}mediaSetCallback(i){this._mediaClickPlayToggle=()=>{let e=i.paused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}}handleMediaUpdated(i){let e=n=>Promise.resolve(n),a=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!i)return a(i);let r=i.nodeName.toLowerCase();return r.includes("-")?u.customElements.whenDefined(r).then(()=>e(i)):e(i)}mediaUnsetCallback(){}connectedCallback(){let e=this.getAttribute("audio")!=null?N.AUDIO_PLAYER():N.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",e),this.media&&this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0)return;this.setAttribute("user-inactive","user-inactive");let s=new u.CustomEvent(at.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{this.removeAttribute("user-inactive");let s=new u.CustomEvent(at.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(s)},n=()=>{r(),u.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=u.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{n()}),this.addEventListener("pointerup",s=>{s.pointerType==="touch"&&([this,this.media].includes(s.target)&&!this.hasAttribute("user-inactive")?a():n())}),this.addEventListener("pointermove",s=>{s.pointerType==="mouse"&&s.target!==this&&(r(),u.clearTimeout(this._inactiveTimeout),[this,this.media].includes(s.target)&&n())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),this.addEventListener("mouseup",()=>{this.removeAttribute("media-keyboard-control")})}set autohide(i){i=Number(i),this._autohide=isNaN(i)?0:i}get autohide(){return this._autohide===void 0?2:this._autohide}};p("media-container-temp",Nt);var fr=Nt;var gr=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},U=(t,i,e)=>(gr(t,i,"read from private field"),e?e.call(t):i.get(t)),Ui=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Oi=(t,i,e,a)=>(gr(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),Be,Ve,W,$t=class{constructor(i,e){Ui(this,Be,void 0),Ui(this,Ve,void 0),Ui(this,W,[]),Oi(this,Be,i),Oi(this,Ve,e)}[Symbol.iterator](){return U(this,W).values()}get length(){return U(this,W).length}get value(){var i;return(i=U(this,W).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(Oi(this,W,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return U(this,W)[i]}values(){return U(this,W).values()}keys(){return U(this,W).keys()}forEach(i){U(this,W).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||U(this,W).push(r)}),!(this.value===""&&!((e=U(this,Be))!=null&&e.hasAttribute(`${U(this,Ve)}`)))&&((a=U(this,Be))==null||a.setAttribute(`${U(this,Ve)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{U(this,W).splice(U(this,W).indexOf(a),1)}),(e=U(this,Be))==null||e.setAttribute(`${U(this,Ve)}`,`${this.value}`)}contains(i){return U(this,W).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Be=new WeakMap;Ve=new WeakMap;W=new WeakMap;var w={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};d.fullscreenElement===void 0&&(w.enter="webkitRequestFullScreen",w.exit=d.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",w.event="webkitfullscreenchange",w.element="webkitFullscreenElement",w.error="webkitfullscreenerror",w.enabled="webkitFullscreenEnabled");function Bt(t,i=!1){return t.split("_").map(function(e,a){return(a||i?e[0].toUpperCase():e[0].toLowerCase())+e.slice(1).toLowerCase()}).join("")}var Ni=(t="")=>t.split(/\s+/),vr=(t="")=>{let[i,e]=t.split(":"),a=e?decodeURIComponent(e):void 0;return{language:i,label:a}},os=(t="",i={})=>Ni(t).map(e=>{let a=vr(e);return{...i,...a}}),ss=t=>Array.isArray(t)?t.map(i=>typeof i=="string"?vr(i):i):typeof t=="string"?os(t):[t],ls=({label:t,language:i}={})=>t?`${i}:${encodeURIComponent(t)}`:i,Q=(t=[])=>Array.prototype.map.call(t,ls).join(" "),ds=(t,i)=>e=>e[t]===i,Ar=t=>{let i=Object.entries(t).map(([e,a])=>ds(e,a));return e=>i.every(a=>a(e))},nt=(t,i=[],e=[])=>{let a=ss(e).map(Ar),r=n=>a.some(s=>s(n));Array.from(i).filter(r).forEach(n=>{n.mode=t})},He=(t,i=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let e=typeof i=="function"?i:Ar(i);return Array.from(t.textTracks).filter(e)},$i=t=>{let i=!!t.getAttribute(o.MEDIA_CAPTIONS_SHOWING),e=!t.hasAttribute("no-subtitles-fallback")&&!!t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return i||e},Vt=t=>{var i,e,a,r;if($i(t)){let s=t.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(s){let c=new window.CustomEvent(h.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});t.dispatchEvent(c)}let l=t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(l&&!t.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});t.dispatchEvent(c)}}else{let[s]=(e=Ni((i=t.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?i:""))!=null?e:[];if(s){let l=new window.CustomEvent(h.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});t.dispatchEvent(l)}else if(t.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[l]=(r=Ni((a=t.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?r:[];if(l){let c=new window.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});t.dispatchEvent(c)}}}};var Ir=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},We=(t,i,e)=>(Ir(t,i,"read from private field"),e?e.call(t):i.get(t)),Bi=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Fe=(t,i,e)=>(Ir(t,i,"access private method"),e),pe,Ke,dt,Wt,Hi,Mr=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],cs=10,_r=0,Kt=class extends fr{constructor(){super(),Bi(this,Ke),Bi(this,Wt),Bi(this,pe,new $t(this,"hotkeys")),vs||(this._airplayUnavailable=Z.UNSUPPORTED),Tr||(this._fullscreenUnavailable=Z.UNAVAILABLE),As||(this._castUnavailable=Z.UNSUPPORTED),fs||(this._pipUnavailable=Z.UNSUPPORTED),lt!==void 0?lt||(this._volumeUnavailable=Z.UNSUPPORTED):gs.then(()=>{lt||(this._volumeUnavailable=Z.UNSUPPORTED,this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associatedElements=[],this.associateElement(this);let i={MEDIA_PLAY_REQUEST:()=>this.media.play(),MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let e=this.media;e.muted=!1,e.volume===0&&(e.volume=.25)},MEDIA_VOLUME_REQUEST:e=>{let a=this.media,r=e.detail;a.volume=r,r>0&&a.muted&&(a.muted=!1);try{u.localStorage.setItem("media-chrome-pref-volume",r.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{if(!Tr){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let e=this.media;d.pictureInPictureElement&&d.exitPictureInPicture(),super[w.enter]?super[w.enter]():e.webkitEnterFullscreen?e.webkitEnterFullscreen():e.requestFullscreen?e.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{d[w.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let e=this.media;if(!d.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!e.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}d[w.element]&&d[w.exit]();let a=r=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};e.requestPictureInPicture().catch(r=>{if(r.code===11)if(e.readyState===0&&e.preload==="none"){let n=function(){e.removeEventListener("loadedmetadata",s),e.preload="none"},s=function(){e.requestPictureInPicture().catch(a),n()};e.addEventListener("loadedmetadata",s),e.preload="metadata",setTimeout(()=>{e.readyState===0&&a(),n()},1e3)}else throw r;else throw r})},MEDIA_EXIT_PIP_REQUEST:()=>{d.pictureInPictureElement&&d.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var e;let a=this.media;!((e=globalThis.CastableVideoElement)!=null&&e.castEnabled)||(d[w.element]&&d[w.exit](),a.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var e;(e=globalThis.CastableVideoElement)!=null&&e.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:e=>{let a=this.media,r=e.detail;(a.readyState>0||a.readyState===void 0)&&(a.currentTime=r)},MEDIA_PLAYBACK_RATE_REQUEST:e=>{this.media.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:e=>{var a;let r=this.media;if(!r)return;let n=e.detail;n===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,n);let[s]=He(r,{kind:Ne.METADATA,label:"thumbnails"});if(!(s&&s.cues))return;if(n===null){this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let l=Array.prototype.find.call(s.cues,y=>y.startTime>=n);if(!l)return;let c=/'^(?:[a-z]+:)?\/\//i.test(l.text)||(a=r.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,m=new URL(l.text,c),E=new URLSearchParams(m.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,m.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,E.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:e=>{let a=Ft(this),{detail:r=[]}=e;nt(ve.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:e=>{let a=Ft(this),{detail:r=[]}=e;nt(ve.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:e=>{let a=st(this),{detail:r=[]}=e;nt(ve.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:e=>{let a=st(this),{detail:r=[]}=e;nt(ve.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:e}=this;if(!!e){if(!(e.webkitShowPlaybackTargetPicker&&u.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}e.webkitShowPlaybackTargetPicker()}}};if(Object.keys(i).forEach(e=>{let a=`_handle${Bt(e,!0)}`;this[a]=r=>{if(r.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}i[e](r,this.media)},this.addEventListener(h[e],this[a])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(o.MEDIA_PAUSED,Sr(this))},"playing,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((e=this.media)!=null&&e.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,kr(this)),this.propagateMediaState(o.MEDIA_VOLUME,Lr(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,Cr(this))},[w.event]:e=>{let r=!!d[w.element]&&(e==null?void 0:e.target),n=rt(this,r);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,n)},"enterpictureinpicture,leavepictureinpicture":e=>{var a;let r;if(e)r=e.type=="enterpictureinpicture";else{let n=(a=this.getRootNode().pictureInPictureElement)!=null?a:d.pictureInPictureElement;r=this.media&&rt(this.media,n)}this.propagateMediaState(o.MEDIA_IS_PIP,r)},"entercast,leavecast,castchange":e=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,n=this.media&&rt(this.media,r);(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(n="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,n)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,wr(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,Dr(this))},"loadedmetadata,emptied,progress":()=>{var e;this.propagateMediaState(o.MEDIA_SEEKABLE,(e=xr(this))==null?void 0:e.join(":"))},"progress,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_BUFFERED,ys((e=this.media)==null?void 0:e.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Rr(this))},"waiting,playing,emptied":()=>{var e;let a=((e=this.media)==null?void 0:e.readyState)<3;this.propagateMediaState(o.MEDIA_LOADING,a)}},this._airplayUnavailable!==Z.UNSUPPORTED){let e=a=>{(a==null?void 0:a.availability)==="available"?this._airplayUnavailable=void 0:(a==null?void 0:a.availability)==="not-available"&&(this._airplayUnavailable=Z.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=e}if(this._castUnavailable!==Z.UNSUPPORTED){let e=()=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castState;r!=null&&r.includes("CONNECT")?this._castUnavailable=void 0:this._castUnavailable=Z.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=e}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,Q(Ft(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,Q(st(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,Q(Wi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,Q(yr(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,Q(Wi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,Q(yr(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys")}attributeChangedCallback(i,e,a){i==="nohotkeys"?a!==e&&a===""?(this.hasAttribute("hotkeys")&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==e&&a===null&&this.enableHotkeys():i==="hotkeys"&&(We(this,pe).value=a),super.attributeChangedCallback(i,e,a)}mediaSetCallback(i){super.mediaSetCallback(i),i.hasAttribute("tabindex")||i.setAttribute("tabindex",-1),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),r=this._mediaStatePropagators[e];a.forEach(n=>{(n==w.event?this.getRootNode():i).addEventListener(n,r)}),r()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(n=>{i.textTracks&&i.textTracks.addEventListener(n,a)}),a()});try{let e=u.localStorage.getItem("media-chrome-pref-volume");e!==null&&(i.volume=e)}catch(e){console.debug("Error getting volume pref",e)}}mediaUnsetCallback(i){super.mediaUnsetCallback(i),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),r=this._mediaStatePropagators[e];a.forEach(n=>{(n==w.event?this.getRootNode():i).removeEventListener(n,r)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(n=>{i.textTracks&&i.textTracks.removeEventListener(n,a)}),a()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(i,e){ye(this.mediaStateReceivers,i,e);let a=new u.CustomEvent(or[i],{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}associateElement(i){if(!i)return;let{associatedElementSubscriptions:e}=this;if(e.has(i))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=ps(i,a,r);Object.keys(h).forEach(s=>{i.addEventListener(h[s],this[`_handle${Bt(s,!0)}`])}),e.set(i,n)}unassociateElement(i){if(!i)return;let{associatedElementSubscriptions:e}=this;if(!e.has(i))return;e.get(i)(),e.delete(i),Object.keys(h).forEach(r=>{i.removeEventListener(h[r],this[`_handle${Bt(r,!0)}`])})}registerMediaStateReceiver(i){if(!i)return;let e=this.mediaStateReceivers;e.indexOf(i)>-1||(e.push(i),ye([i],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),ye([i],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),ye([i],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),ye([i],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),ye([i],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||ye([i],o[r],Vi[o[r]]?Vi[o[r]](this):Vi.default(this,o[r]))}))}unregisterMediaStateReceiver(i){let e=this.mediaStateReceivers,a=e.indexOf(i);a<0||e.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Fe(this,Wt,Hi))}disableHotkeys(){this.removeEventListener("keydown",Fe(this,Wt,Hi)),this.removeEventListener("keyup",Fe(this,Ke,dt))}get hotkeys(){return We(this,pe)}keyboardShortcutHandler(i){var e,a,r,n;if(((n=(r=(e=i.target.getAttribute("keysused"))==null?void 0:e.split(" "))!=null?r:(a=i.target)==null?void 0:a.keysUsed)!=null?n:[]).map(_=>_==="Space"?" ":_).filter(Boolean).includes(i.key))return;let l,c,m,E,y,S=cs;if(!We(this,pe).contains(`no${i.key.toLowerCase()}`)&&!(i.key===" "&&We(this,pe).contains("nospace")))switch(i.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":Vt(this);break;case"ArrowLeft":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:_r,E=Math.max(m-S,0),y=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(y);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:_r,E=Math.max(m+S,0),y=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(y);break;default:break}}};pe=new WeakMap;Ke=new WeakSet;dt=function(t){let{key:i}=t;if(!Mr.includes(i)){this.removeEventListener("keyup",Fe(this,Ke,dt));return}this.keyboardShortcutHandler(t)};Wt=new WeakSet;Hi=function(t){let{metaKey:i,altKey:e,key:a}=t;if(i||e||!Mr.includes(a)){this.removeEventListener("keyup",Fe(this,Ke,dt));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(We(this,pe).contains(`no${a.toLowerCase()}`)||a===" "&&We(this,pe).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",Fe(this,Ke,dt),{once:!0})};var Vi={default(t,i){return t.getAttribute(i)},[o.MEDIA_CAPTIONS_LIST](t){return Q(Ft(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return Q(st(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return Q(st(t))||void 0},[o.MEDIA_CAPTIONS_SHOWING](t){return Q(Wi(t))||void 0},[o.MEDIA_PAUSED](t){return Sr(t)},[o.MEDIA_MUTED](t){return kr(t)},[o.MEDIA_VOLUME](t){return Lr(t)},[o.MEDIA_VOLUME_LEVEL](t){return Cr(t)},[o.MEDIA_CURRENT_TIME](t){return wr(t)},[o.MEDIA_DURATION](t){return Dr(t)},[o.MEDIA_SEEKABLE](t){var i;return(i=xr(t))==null?void 0:i.join(":")},[o.MEDIA_PLAYBACK_RATE](t){return Rr(t)}},Sr=t=>t.media?t.media.paused:!0,kr=t=>!!(t.media&&t.media.muted),Lr=t=>{let i=t.media;return i?i.volume:1},Cr=t=>{let i="high";if(!t.media)return i;let{muted:e,volume:a}=t.media;return a===0||e?i="off":a<.5?i="low":a<.75&&(i="medium"),i},wr=t=>{let i=t.media;return i?i.currentTime:0},Dr=t=>{let i=t==null?void 0:t.media;return Number.isFinite(i==null?void 0:i.duration)?i.duration:NaN},xr=t=>{var i;let e=t==null?void 0:t.media;if(!((i=e==null?void 0:e.seekable)!=null&&i.length))return;let a=e.seekable.start(0),r=e.seekable.end(e.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},Rr=t=>{let i=t.media;return i?i.playbackRate:1},st=t=>He(t.media,{kind:Ne.SUBTITLES}),Ft=t=>He(t.media,{kind:Ne.CAPTIONS}),yr=t=>He(t.media,{kind:Ne.SUBTITLES,mode:ve.SHOWING}),Wi=t=>He(t.media,{kind:Ne.CAPTIONS,mode:ve.SHOWING}),us=Object.values(o),Pr=t=>{var i,e,a,r;let{observedAttributes:n}=t.constructor;!n&&((i=t.nodeName)==null?void 0:i.includes("-"))&&(u.customElements.upgrade(t),{observedAttributes:n}=t.constructor);let s=(r=(a=(e=t==null?void 0:t.getAttribute)==null?void 0:e.call(t,o.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>us.includes(l)):[]},Fi=t=>!!Pr(t).length,ms=async(t,i,e)=>(t.isConnected||await Ur(0),e==null?t.removeAttribute(i):typeof e=="boolean"?e?t.setAttribute(i,""):t.removeAttribute(i):Number.isNaN(e)?t.removeAttribute(i):t.setAttribute(i,e)),hs=t=>{var i;return!!((i=t.closest)!=null&&i.call(t,'*[slot="media"]'))},ot=(t,i)=>{if(hs(t))return;let e=(r,n)=>{var s,l;Fi(r)&&n(r);let{children:c=[]}=r!=null?r:{},m=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...c,...m].forEach(y=>ot(y,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Fi(t)){u.customElements.whenDefined(a).then(()=>{e(t,i)});return}e(t,i)},ye=(t,i,e)=>{t.forEach(a=>{!Pr(a).includes(i)||ms(a,i,e)})},ps=(t,i,e)=>{ot(t,i);let a=c=>{var m;let E=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;i(E)},r=c=>{var m;let E=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(E)};t.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=c=>{c.forEach(m=>{let{addedNodes:E=[],removedNodes:y=[],type:S,target:_,attributeName:O}=m;S==="childList"?(Array.prototype.forEach.call(E,x=>ot(x,i)),Array.prototype.forEach.call(y,x=>ot(x,e))):S==="attributes"&&O===o.MEDIA_CHROME_ATTRIBUTES&&(Fi(_)?i(_):e(_))})},s=new MutationObserver(n);return s.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{ot(t,e),s.disconnect(),t.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Ht,Ki=()=>{var t,i;return Ht||(Ht=(i=(t=d)==null?void 0:t.createElement)==null?void 0:i.call(t,"video"),Ht)},bs=async(t=Ki())=>{if(!t)return!1;let i=t.volume;return t.volume=i/2+.1,await Ur(0),t.volume!==i},Ur=t=>new Promise(i=>setTimeout(i,t)),Es=(t=Ki())=>typeof(t==null?void 0:t.requestPictureInPicture)=="function",fs=Es(),lt,gs=bs().then(t=>(lt=t,lt)),vs=!!u.WebKitPlaybackTargetAvailabilityEvent,As=!!u.chrome,_s=(t=Ki())=>{let i=d[w.enabled];return!i&&t&&(i="webkitSupportsFullscreen"in t),i},Tr=_s();function ys(t=[]){return Array.from(t).map((i,e)=>[Number(t.start(e).toFixed(3)),Number(t.end(e).toFixed(3))].join(":")).join(" ")}p("media-controller",Kt);var ct=Kt;var Nr=d.createElement("template"),Or=`
|
|
192
|
+
`;var ss=Object.values(o),$t=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(vr.content.cloneNode(!0));let i=n=>{let s=this.media;for(let l of n)l.type==="childList"&&(l.removedNodes.forEach(c=>{if(c.slot=="media"&&l.target==this){let m=l.previousSibling&&l.previousSibling.previousElementSibling;if(!m||!s)this.mediaUnsetCallback(c);else{let E=m.slot!=="media";for(;(m=m.previousSibling)!==null;)m.slot=="media"&&(E=!1);E&&this.mediaUnsetCallback(c)}}}),s&&l.addedNodes.forEach(c=>{c==s&&this.handleMediaUpdated(s).then(m=>this.mediaSetCallback(m))}))};new MutationObserver(i).observe(this,{childList:!0,subtree:!0});let a=this.media,r=this.querySelector(":scope > slot[slot=media]");r&&r.addEventListener("slotchange",()=>{if(!r.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(a);return}this.media&&(a=this.media,this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(ss)}attributeChangedCallback(i,e,a){i.toLowerCase()=="autohide"&&(this.autohide=a)}get media(){let i=this.querySelector(":scope > [slot=media]");return(i==null?void 0:i.nodeName)=="SLOT"&&(i=i.assignedElements({flatten:!0})[0]),i}mediaSetCallback(i){this._mediaClickPlayToggle=()=>{let e=i.paused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}}handleMediaUpdated(i){let e=n=>Promise.resolve(n),a=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!i)return a(i);let r=i.nodeName.toLowerCase();return r.includes("-")?u.customElements.whenDefined(r).then(()=>e(i)):e(i)}mediaUnsetCallback(){}connectedCallback(){let e=this.getAttribute("audio")!=null?N.AUDIO_PLAYER():N.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",e),this.media&&this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0)return;this.setAttribute("user-inactive","user-inactive");let s=new u.CustomEvent(rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{this.removeAttribute("user-inactive");let s=new u.CustomEvent(rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(s)},n=()=>{r(),u.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=u.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{n()}),this.addEventListener("pointerup",s=>{s.pointerType==="touch"?[this,this.media].includes(s.target)&&!this.hasAttribute("user-inactive")?a():n():s.composedPath().some(l=>{var c;return["media-play-button","media-fullscreen-button"].includes((c=l==null?void 0:l.nodeName)==null?void 0:c.toLowerCase())})&&n()}),this.addEventListener("pointermove",s=>{s.pointerType==="mouse"&&s.target!==this&&(r(),u.clearTimeout(this._inactiveTimeout),[this,this.media].includes(s.target)&&n())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),this.addEventListener("mouseup",()=>{this.removeAttribute("media-keyboard-control")})}set autohide(i){i=Number(i),this._autohide=isNaN(i)?0:i}get autohide(){return this._autohide===void 0?2:this._autohide}};p("media-container-temp",$t);var Ar=$t;var _r=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},U=(t,i,e)=>(_r(t,i,"read from private field"),e?e.call(t):i.get(t)),Ui=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Oi=(t,i,e,a)=>(_r(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),Ve,He,W,Bt=class{constructor(i,e){Ui(this,Ve,void 0),Ui(this,He,void 0),Ui(this,W,[]),Oi(this,Ve,i),Oi(this,He,e)}[Symbol.iterator](){return U(this,W).values()}get length(){return U(this,W).length}get value(){var i;return(i=U(this,W).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(Oi(this,W,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return U(this,W)[i]}values(){return U(this,W).values()}keys(){return U(this,W).keys()}forEach(i){U(this,W).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||U(this,W).push(r)}),!(this.value===""&&!((e=U(this,Ve))!=null&&e.hasAttribute(`${U(this,He)}`)))&&((a=U(this,Ve))==null||a.setAttribute(`${U(this,He)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{U(this,W).splice(U(this,W).indexOf(a),1)}),(e=U(this,Ve))==null||e.setAttribute(`${U(this,He)}`,`${this.value}`)}contains(i){return U(this,W).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Ve=new WeakMap;He=new WeakMap;W=new WeakMap;var D={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};d.fullscreenElement===void 0&&(D.enter="webkitRequestFullScreen",D.exit=d.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",D.event="webkitfullscreenchange",D.element="webkitFullscreenElement",D.error="webkitfullscreenerror",D.enabled="webkitFullscreenEnabled");function Vt(t,i=!1){return t.split("_").map(function(e,a){return(a||i?e[0].toUpperCase():e[0].toLowerCase())+e.slice(1).toLowerCase()}).join("")}var Ni=(t="")=>t.split(/\s+/),yr=(t="")=>{let[i,e]=t.split(":"),a=e?decodeURIComponent(e):void 0;return{language:i,label:a}},ls=(t="",i={})=>Ni(t).map(e=>{let a=yr(e);return{...i,...a}}),ds=t=>Array.isArray(t)?t.map(i=>typeof i=="string"?yr(i):i):typeof t=="string"?ls(t):[t],cs=({label:t,language:i}={})=>t?`${i}:${encodeURIComponent(t)}`:i,Q=(t=[])=>Array.prototype.map.call(t,cs).join(" "),us=(t,i)=>e=>e[t]===i,Tr=t=>{let i=Object.entries(t).map(([e,a])=>us(e,a));return e=>i.every(a=>a(e))},st=(t,i=[],e=[])=>{let a=ds(e).map(Tr),r=n=>a.some(s=>s(n));Array.from(i).filter(r).forEach(n=>{n.mode=t})},We=(t,i=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let e=typeof i=="function"?i:Tr(i);return Array.from(t.textTracks).filter(e)},$i=t=>{let i=!!t.getAttribute(o.MEDIA_CAPTIONS_SHOWING),e=!t.hasAttribute("no-subtitles-fallback")&&!!t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return i||e},Ht=t=>{var i,e,a,r;if($i(t)){let s=t.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(s){let c=new window.CustomEvent(h.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});t.dispatchEvent(c)}let l=t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(l&&!t.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});t.dispatchEvent(c)}}else{let[s]=(e=Ni((i=t.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?i:""))!=null?e:[];if(s){let l=new window.CustomEvent(h.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});t.dispatchEvent(l)}else if(t.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[l]=(r=Ni((a=t.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?r:[];if(l){let c=new window.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});t.dispatchEvent(c)}}}};var kr=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},Fe=(t,i,e)=>(kr(t,i,"read from private field"),e?e.call(t):i.get(t)),Bi=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Ke=(t,i,e)=>(kr(t,i,"access private method"),e),pe,Ye,ut,Ft,Hi,Lr=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],ms=10,Ir=0,Yt=class extends Ar{constructor(){super(),Bi(this,Ye),Bi(this,Ft),Bi(this,pe,new Bt(this,"hotkeys")),_s||(this._airplayUnavailable=Z.UNSUPPORTED),Sr||(this._fullscreenUnavailable=Z.UNAVAILABLE),ys||(this._castUnavailable=Z.UNSUPPORTED),vs||(this._pipUnavailable=Z.UNSUPPORTED),ct!==void 0?ct||(this._volumeUnavailable=Z.UNSUPPORTED):As.then(()=>{ct||(this._volumeUnavailable=Z.UNSUPPORTED,this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associatedElements=[],this.associateElement(this);let i={MEDIA_PLAY_REQUEST:()=>this.media.play(),MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let e=this.media;e.muted=!1,e.volume===0&&(e.volume=.25)},MEDIA_VOLUME_REQUEST:e=>{let a=this.media,r=e.detail;a.volume=r,r>0&&a.muted&&(a.muted=!1);try{u.localStorage.setItem("media-chrome-pref-volume",r.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{if(!Sr){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let e=this.media;d.pictureInPictureElement&&d.exitPictureInPicture(),super[D.enter]?super[D.enter]():e.webkitEnterFullscreen?e.webkitEnterFullscreen():e.requestFullscreen?e.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{d[D.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let e=this.media;if(!d.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!e.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}d[D.element]&&d[D.exit]();let a=r=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};e.requestPictureInPicture().catch(r=>{if(r.code===11)if(e.readyState===0&&e.preload==="none"){let n=function(){e.removeEventListener("loadedmetadata",s),e.preload="none"},s=function(){e.requestPictureInPicture().catch(a),n()};e.addEventListener("loadedmetadata",s),e.preload="metadata",setTimeout(()=>{e.readyState===0&&a(),n()},1e3)}else throw r;else throw r})},MEDIA_EXIT_PIP_REQUEST:()=>{d.pictureInPictureElement&&d.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var e;let a=this.media;!((e=globalThis.CastableVideoElement)!=null&&e.castEnabled)||(d[D.element]&&d[D.exit](),a.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var e;(e=globalThis.CastableVideoElement)!=null&&e.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:e=>{let a=this.media,r=e.detail;(a.readyState>0||a.readyState===void 0)&&(a.currentTime=r)},MEDIA_PLAYBACK_RATE_REQUEST:e=>{this.media.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:e=>{var a;let r=this.media;if(!r)return;let n=e.detail;n===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,n);let[s]=We(r,{kind:$e.METADATA,label:"thumbnails"});if(!(s&&s.cues))return;if(n===null){this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let l=Array.prototype.find.call(s.cues,y=>y.startTime>=n);if(!l)return;let c=/'^(?:[a-z]+:)?\/\//i.test(l.text)||(a=r.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,m=new URL(l.text,c),E=new URLSearchParams(m.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,m.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,E.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:e=>{let a=Kt(this),{detail:r=[]}=e;st(_e.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:e=>{let a=Kt(this),{detail:r=[]}=e;st(_e.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:e=>{let a=dt(this),{detail:r=[]}=e;st(_e.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:e=>{let a=dt(this),{detail:r=[]}=e;st(_e.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:e}=this;if(!!e){if(!(e.webkitShowPlaybackTargetPicker&&u.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}e.webkitShowPlaybackTargetPicker()}}};if(Object.keys(i).forEach(e=>{let a=`_handle${Vt(e,!0)}`;this[a]=r=>{if(r.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}i[e](r,this.media)},this.addEventListener(h[e],this[a])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(o.MEDIA_PAUSED,Cr(this))},"playing,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((e=this.media)!=null&&e.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,wr(this)),this.propagateMediaState(o.MEDIA_VOLUME,Dr(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,xr(this))},[D.event]:e=>{let r=!!d[D.element]&&(e==null?void 0:e.target),n=nt(this,r);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,n)},"enterpictureinpicture,leavepictureinpicture":e=>{var a;let r;if(e)r=e.type=="enterpictureinpicture";else{let n=(a=this.getRootNode().pictureInPictureElement)!=null?a:d.pictureInPictureElement;r=this.media&&nt(this.media,n)}this.propagateMediaState(o.MEDIA_IS_PIP,r)},"entercast,leavecast,castchange":e=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,n=this.media&&nt(this.media,r);(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(n="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,n)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,Rr(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,Pr(this))},"loadedmetadata,emptied,progress":()=>{var e;this.propagateMediaState(o.MEDIA_SEEKABLE,(e=Ur(this))==null?void 0:e.join(":"))},"progress,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_BUFFERED,Is((e=this.media)==null?void 0:e.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Or(this))},"waiting,playing,emptied":()=>{var e;let a=((e=this.media)==null?void 0:e.readyState)<3;this.propagateMediaState(o.MEDIA_LOADING,a)}},this._airplayUnavailable!==Z.UNSUPPORTED){let e=a=>{(a==null?void 0:a.availability)==="available"?this._airplayUnavailable=void 0:(a==null?void 0:a.availability)==="not-available"&&(this._airplayUnavailable=Z.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=e}if(this._castUnavailable!==Z.UNSUPPORTED){let e=()=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castState;r!=null&&r.includes("CONNECT")?this._castUnavailable=void 0:this._castUnavailable=Z.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=e}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,Q(Kt(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,Q(dt(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,Q(Wi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,Q(Mr(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,Q(Wi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,Q(Mr(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys")}attributeChangedCallback(i,e,a){i==="nohotkeys"?a!==e&&a===""?(this.hasAttribute("hotkeys")&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==e&&a===null&&this.enableHotkeys():i==="hotkeys"&&(Fe(this,pe).value=a),super.attributeChangedCallback(i,e,a)}mediaSetCallback(i){super.mediaSetCallback(i),i.hasAttribute("tabindex")||i.setAttribute("tabindex",-1),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),r=this._mediaStatePropagators[e];a.forEach(n=>{(n==D.event?this.getRootNode():i).addEventListener(n,r)}),r()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(n=>{i.textTracks&&i.textTracks.addEventListener(n,a)}),a()});try{let e=u.localStorage.getItem("media-chrome-pref-volume");e!==null&&(i.volume=e)}catch(e){console.debug("Error getting volume pref",e)}}mediaUnsetCallback(i){super.mediaUnsetCallback(i),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),r=this._mediaStatePropagators[e];a.forEach(n=>{(n==D.event?this.getRootNode():i).removeEventListener(n,r)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(n=>{i.textTracks&&i.textTracks.removeEventListener(n,a)}),a()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(i,e){Ie(this.mediaStateReceivers,i,e);let a=new u.CustomEvent(dr[i],{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}associateElement(i){if(!i)return;let{associatedElementSubscriptions:e}=this;if(e.has(i))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=Es(i,a,r);Object.keys(h).forEach(s=>{i.addEventListener(h[s],this[`_handle${Vt(s,!0)}`])}),e.set(i,n)}unassociateElement(i){if(!i)return;let{associatedElementSubscriptions:e}=this;if(!e.has(i))return;e.get(i)(),e.delete(i),Object.keys(h).forEach(r=>{i.removeEventListener(h[r],this[`_handle${Vt(r,!0)}`])})}registerMediaStateReceiver(i){if(!i)return;let e=this.mediaStateReceivers;e.indexOf(i)>-1||(e.push(i),Ie([i],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Ie([i],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Ie([i],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Ie([i],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Ie([i],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||Ie([i],o[r],Vi[o[r]]?Vi[o[r]](this):Vi.default(this,o[r]))}))}unregisterMediaStateReceiver(i){let e=this.mediaStateReceivers,a=e.indexOf(i);a<0||e.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Ke(this,Ft,Hi))}disableHotkeys(){this.removeEventListener("keydown",Ke(this,Ft,Hi)),this.removeEventListener("keyup",Ke(this,Ye,ut))}get hotkeys(){return Fe(this,pe)}keyboardShortcutHandler(i){var e,a,r,n;if(((n=(r=(e=i.target.getAttribute("keysused"))==null?void 0:e.split(" "))!=null?r:(a=i.target)==null?void 0:a.keysUsed)!=null?n:[]).map(_=>_==="Space"?" ":_).filter(Boolean).includes(i.key))return;let l,c,m,E,y,k=ms;if(!Fe(this,pe).contains(`no${i.key.toLowerCase()}`)&&!(i.key===" "&&Fe(this,pe).contains("nospace")))switch(i.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":Ht(this);break;case"ArrowLeft":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:Ir,E=Math.max(m-k,0),y=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(y);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:Ir,E=Math.max(m+k,0),y=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(y);break;default:break}}};pe=new WeakMap;Ye=new WeakSet;ut=function(t){let{key:i}=t;if(!Lr.includes(i)){this.removeEventListener("keyup",Ke(this,Ye,ut));return}this.keyboardShortcutHandler(t)};Ft=new WeakSet;Hi=function(t){let{metaKey:i,altKey:e,key:a}=t;if(i||e||!Lr.includes(a)){this.removeEventListener("keyup",Ke(this,Ye,ut));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Fe(this,pe).contains(`no${a.toLowerCase()}`)||a===" "&&Fe(this,pe).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",Ke(this,Ye,ut),{once:!0})};var Vi={default(t,i){return t.getAttribute(i)},[o.MEDIA_CAPTIONS_LIST](t){return Q(Kt(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return Q(dt(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return Q(dt(t))||void 0},[o.MEDIA_CAPTIONS_SHOWING](t){return Q(Wi(t))||void 0},[o.MEDIA_PAUSED](t){return Cr(t)},[o.MEDIA_MUTED](t){return wr(t)},[o.MEDIA_VOLUME](t){return Dr(t)},[o.MEDIA_VOLUME_LEVEL](t){return xr(t)},[o.MEDIA_CURRENT_TIME](t){return Rr(t)},[o.MEDIA_DURATION](t){return Pr(t)},[o.MEDIA_SEEKABLE](t){var i;return(i=Ur(t))==null?void 0:i.join(":")},[o.MEDIA_PLAYBACK_RATE](t){return Or(t)}},Cr=t=>t.media?t.media.paused:!0,wr=t=>!!(t.media&&t.media.muted),Dr=t=>{let i=t.media;return i?i.volume:1},xr=t=>{let i="high";if(!t.media)return i;let{muted:e,volume:a}=t.media;return a===0||e?i="off":a<.5?i="low":a<.75&&(i="medium"),i},Rr=t=>{let i=t.media;return i?i.currentTime:0},Pr=t=>{let i=t==null?void 0:t.media;return Number.isFinite(i==null?void 0:i.duration)?i.duration:NaN},Ur=t=>{var i;let e=t==null?void 0:t.media;if(!((i=e==null?void 0:e.seekable)!=null&&i.length))return;let a=e.seekable.start(0),r=e.seekable.end(e.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},Or=t=>{let i=t.media;return i?i.playbackRate:1},dt=t=>We(t.media,{kind:$e.SUBTITLES}),Kt=t=>We(t.media,{kind:$e.CAPTIONS}),Mr=t=>We(t.media,{kind:$e.SUBTITLES,mode:_e.SHOWING}),Wi=t=>We(t.media,{kind:$e.CAPTIONS,mode:_e.SHOWING}),hs=Object.values(o),Nr=t=>{var i,e,a,r;let{observedAttributes:n}=t.constructor;!n&&((i=t.nodeName)==null?void 0:i.includes("-"))&&(u.customElements.upgrade(t),{observedAttributes:n}=t.constructor);let s=(r=(a=(e=t==null?void 0:t.getAttribute)==null?void 0:e.call(t,o.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>hs.includes(l)):[]},Fi=t=>!!Nr(t).length,ps=async(t,i,e)=>(t.isConnected||await $r(0),e==null?t.removeAttribute(i):typeof e=="boolean"?e?t.setAttribute(i,""):t.removeAttribute(i):Number.isNaN(e)?t.removeAttribute(i):t.setAttribute(i,e)),bs=t=>{var i;return!!((i=t.closest)!=null&&i.call(t,'*[slot="media"]'))},lt=(t,i)=>{if(bs(t))return;let e=(r,n)=>{var s,l;Fi(r)&&n(r);let{children:c=[]}=r!=null?r:{},m=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...c,...m].forEach(y=>lt(y,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Fi(t)){u.customElements.whenDefined(a).then(()=>{e(t,i)});return}e(t,i)},Ie=(t,i,e)=>{t.forEach(a=>{!Nr(a).includes(i)||ps(a,i,e)})},Es=(t,i,e)=>{lt(t,i);let a=c=>{var m;let E=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;i(E)},r=c=>{var m;let E=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(E)};t.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=c=>{c.forEach(m=>{let{addedNodes:E=[],removedNodes:y=[],type:k,target:_,attributeName:O}=m;k==="childList"?(Array.prototype.forEach.call(E,x=>lt(x,i)),Array.prototype.forEach.call(y,x=>lt(x,e))):k==="attributes"&&O===o.MEDIA_CHROME_ATTRIBUTES&&(Fi(_)?i(_):e(_))})},s=new MutationObserver(n);return s.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{lt(t,e),s.disconnect(),t.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Wt,Ki=()=>{var t,i;return Wt||(Wt=(i=(t=d)==null?void 0:t.createElement)==null?void 0:i.call(t,"video"),Wt)},fs=async(t=Ki())=>{if(!t)return!1;let i=t.volume;return t.volume=i/2+.1,await $r(0),t.volume!==i},$r=t=>new Promise(i=>setTimeout(i,t)),gs=(t=Ki())=>typeof(t==null?void 0:t.requestPictureInPicture)=="function",vs=gs(),ct,As=fs().then(t=>(ct=t,ct)),_s=!!u.WebKitPlaybackTargetAvailabilityEvent,ys=!!u.chrome,Ts=(t=Ki())=>{let i=d[D.enabled];return!i&&t&&(i="webkitSupportsFullscreen"in t),i},Sr=Ts();function Is(t=[]){return Array.from(t).map((i,e)=>[Number(t.start(e).toFixed(3)),Number(t.end(e).toFixed(3))].join(":")).join(" ")}p("media-controller",Yt);var mt=Yt;var Vr=d.createElement("template"),Br=`
|
|
193
193
|
height: var(--thumb-height);
|
|
194
194
|
width: var(--media-range-thumb-width, 10px);
|
|
195
195
|
border: var(--media-range-thumb-border, none);
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
transition: var(--media-range-thumb-transition, none);
|
|
201
201
|
transform: var(--media-range-thumb-transform, none);
|
|
202
202
|
opacity: var(--media-range-thumb-opacity, 1);
|
|
203
|
-
`,
|
|
203
|
+
`,Gt=`
|
|
204
204
|
width: var(--media-range-track-width, 100%);
|
|
205
205
|
min-width: 40px;
|
|
206
206
|
height: var(--track-height);
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
transition: var(--media-range-track-transition, none);
|
|
212
212
|
transform: translate(var(--media-range-track-translate-x, 0), var(--media-range-track-translate-y, 0));
|
|
213
213
|
cursor: pointer;
|
|
214
|
-
`;
|
|
214
|
+
`;Vr.innerHTML=`
|
|
215
215
|
<style>
|
|
216
216
|
:host {
|
|
217
217
|
--thumb-height: var(--media-range-thumb-height, 10px);
|
|
@@ -257,19 +257,19 @@
|
|
|
257
257
|
|
|
258
258
|
input[type=range]::-webkit-slider-thumb {
|
|
259
259
|
-webkit-appearance: none;
|
|
260
|
-
${
|
|
260
|
+
${Br}
|
|
261
261
|
|
|
262
262
|
margin-top: calc(calc(0px - var(--thumb-height) + var(--track-height)) / 2);
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
|
|
266
266
|
input[type=range]::-moz-range-thumb {
|
|
267
|
-
${
|
|
267
|
+
${Br}
|
|
268
268
|
translate: var(--media-range-track-translate-x, 0) var(--media-range-track-translate-y, 0);
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
input[type=range]::-webkit-slider-runnable-track { ${
|
|
272
|
-
input[type=range]::-moz-range-track { ${
|
|
271
|
+
input[type=range]::-webkit-slider-runnable-track { ${Gt} }
|
|
272
|
+
input[type=range]::-moz-range-track { ${Gt} }
|
|
273
273
|
input[type=range]::-ms-track {
|
|
274
274
|
|
|
275
275
|
width: 100%;
|
|
@@ -279,12 +279,12 @@
|
|
|
279
279
|
border-color: transparent;
|
|
280
280
|
color: transparent;
|
|
281
281
|
|
|
282
|
-
${
|
|
282
|
+
${Gt}
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
#background,
|
|
286
286
|
#pointer {
|
|
287
|
-
${
|
|
287
|
+
${Gt}
|
|
288
288
|
width: auto;
|
|
289
289
|
position: absolute;
|
|
290
290
|
top: 50%;
|
|
@@ -358,7 +358,7 @@
|
|
|
358
358
|
<div id="pointer"></div>
|
|
359
359
|
<div id="hoverzone"></div>
|
|
360
360
|
<input id="range" type="range" min="0" max="1000" step="any" value="0">
|
|
361
|
-
`;var
|
|
361
|
+
`;var Zt=class extends u.HTMLElement{static get observedAttributes(){return["disabled","aria-disabled",o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Vr.content.cloneNode(!0)),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this))}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else(i==="disabled"||i==="aria-disabled"&&e!==a)&&(a==null?this.range.removeAttribute(i):this.range.setAttribute(i,a))}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}this.updateBar()}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}updatePointerBar(i){let e=this.range.getBoundingClientRect(),a=(i.clientX-e.left)/e.width;a=Math.max(0,Math.min(1,a));let{style:r}=oe(this.shadowRoot,"#pointer");r.setProperty("width",`${a*e.width}px`)}updateBar(){let i=this.getBarColors(),e="linear-gradient(to right, ",a=0;i.forEach(n=>{n[1]<a||(e=e+`${n[0]} ${a}%, ${n[0]} ${n[1]}%,`,a=n[1])}),e=e.slice(0,e.length-1)+")";let{style:r}=oe(this.shadowRoot,":host");r.setProperty("--media-range-track-progress-internal",e)}getBarColors(){let i=this.range,e=i.value-i.min,a=i.max-i.min,r=e/a*100,n=0;if(i.value>i.min&&i.value<i.max){let l=getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10px";n=parseInt(l)*(.5-r/100)/i.offsetWidth*100}return[["var(--media-range-bar-color, #fff)",r+n],["transparent",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};p("media-chrome-range",Zt);var ht=Zt;var Hr=d.createElement("template");Hr.innerHTML=`
|
|
362
362
|
<style>
|
|
363
363
|
:host {
|
|
364
364
|
|
|
@@ -377,7 +377,7 @@
|
|
|
377
377
|
</style>
|
|
378
378
|
|
|
379
379
|
<slot></slot>
|
|
380
|
-
`;var Yi=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(
|
|
380
|
+
`;var Yi=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Hr.content.cloneNode(!0))}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-control-bar",Yi);var Wr=d.createElement("template");Wr.innerHTML=`
|
|
381
381
|
<style>
|
|
382
382
|
:host {
|
|
383
383
|
display: inline-flex;
|
|
@@ -412,11 +412,11 @@
|
|
|
412
412
|
<span id="container">
|
|
413
413
|
<slot></slot>
|
|
414
414
|
</span>
|
|
415
|
-
`;var
|
|
415
|
+
`;var Qt=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Wr.content.cloneNode(!0)),this.container=this.shadowRoot.querySelector("#container")}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-text-display",Qt);var be=Qt;var Gi=class extends be{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}attributeChangedCallback(i,e,a){i===o.MEDIA_CURRENT_TIME&&(this.container.innerHTML=z(a)),super.attributeChangedCallback(i,e,a)}};p("media-current-time-display",Gi);var Zi=class extends be{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(i,e,a){i===o.MEDIA_DURATION&&(this.container.innerHTML=z(a)),super.attributeChangedCallback(i,e,a)}};p("media-duration-display",Zi);var Ms=" / ",Ss=(t,{timesSep:i=Ms}={})=>{var e,a,r;let n=t.getAttribute("remaining")!=null,s=t.getAttribute("show-duration")!=null,l=(e=t.mediaCurrentTime)!=null?e:0,c=(r=(a=t.mediaDuration)!=null?a:t.mediaSeekableEnd)!=null?r:0,m=n?z(0-(c-l)):z(l);return s?`${m}${i}${z(c)}`:m},ks="video not loaded, unknown time.",Ls=t=>{let i=t.mediaCurrentTime,e=t.mediaDuration||t.mediaSeekableEnd;if(i==null||e==null){t.setAttribute("aria-valuetext",ks);return}let a=t.hasAttribute("remaining"),r=t.hasAttribute("show-duration"),n=a?ye(0-(e-i)):ye(i);if(!r){t.setAttribute("aria-valuetext",n);return}let s=ye(e),l=`${n} of ${s}`;t.setAttribute("aria-valuetext",l)},Qi=class extends be{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration","disabled"]}constructor(){super()}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",N.PLAYBACK_TIME()),super.connectedCallback()}disconnectedCallback(){this.disable()}attributeChangedCallback(i,e,a){if([o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"].includes(i)){let r=Ss(this);Ls(this),this.container.innerHTML=r}else i==="disabled"&&a!==e&&(a==null?this.enable():this.disable());super.attributeChangedCallback(i,e,a)}enable(){this.setAttribute("tabindex",0)}disable(){this.removeAttribute("tabindex")}get mediaDuration(){let i=this.getAttribute(o.MEDIA_DURATION);return i!=null?+i:void 0}get mediaCurrentTime(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME);return i!=null?+i:void 0}get mediaSeekable(){let i=this.getAttribute(o.MEDIA_SEEKABLE);if(!!i)return i.split(":").map(e=>+e)}get mediaSeekableEnd(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e}get mediaSeekableStart(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e}};p("media-time-display",Qi);var Cs=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
416
416
|
<path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
|
|
417
|
-
</svg>`,
|
|
417
|
+
</svg>`,ws=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
418
418
|
<path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
|
|
419
|
-
</svg>`,
|
|
419
|
+
</svg>`,Kr=d.createElement("template");Kr.innerHTML=`
|
|
420
420
|
<style>
|
|
421
421
|
:host([aria-checked="true"]) slot:not([name=on]) > *,
|
|
422
422
|
:host([aria-checked="true"]) ::slotted(:not([slot=on])) {
|
|
@@ -430,15 +430,15 @@
|
|
|
430
430
|
}
|
|
431
431
|
</style>
|
|
432
432
|
|
|
433
|
-
<slot name="on">${
|
|
434
|
-
<slot name="off">${
|
|
435
|
-
`;var
|
|
436
|
-
<slot name="forward">${
|
|
437
|
-
`;var
|
|
433
|
+
<slot name="on">${Cs}</slot>
|
|
434
|
+
<slot name="off">${ws}</slot>
|
|
435
|
+
`;var Fr=t=>{t.setAttribute("aria-checked",$i(t))},qi=class extends w{static get observedAttributes(){return[...super.observedAttributes,"no-subtitles-fallback","default-showing",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(i={}){super({slotTemplate:Kr,...i}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",N.CLOSED_CAPTIONS()),Fr(this)}attributeChangedCallback(i,e,a){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(i)&&Fr(this),this.hasAttribute("default-showing")&&this.getAttribute("aria-checked")!=="true"){let r=!this.hasAttribute("no-subtitles-fallback");if((r?[o.MEDIA_CAPTIONS_LIST,o.MEDIA_SUBTITLES_LIST]:[o.MEDIA_CAPTIONS_LIST]).includes(i)){let s=!!this.getAttribute(o.MEDIA_CAPTIONS_LIST)||!!(r&&this.getAttribute(o.MEDIA_SUBTITLES_LIST));this._captionsReady!==s&&(this._captionsReady=s,this._captionsReady&&this.handleClick())}}super.attributeChangedCallback(i,e,a)}handleClick(i){Ht(this)}};p("media-captions-button",qi);var zi=30,Ds=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${zi}</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg>`,Zr=d.createElement("template");Zr.innerHTML=`
|
|
436
|
+
<slot name="forward">${Ds}</slot>
|
|
437
|
+
`;var xs=0,Yr=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=L.SEEK_FORWARD_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},Gr=t=>{let i=Nt(t,"forward"),e=t.getAttribute("seek-offset");Ot(i,e)},ji=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(i={}){super({slotTemplate:Zr,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",zi),Yr(this),Gr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",zi),Gr(this),Yr(this)),super.attributeChangedCallback(i,e,a)}handleClick(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME),e=+this.getAttribute("seek-offset"),r=(i&&!Number.isNaN(+i)?+i:xs)+e,n=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};p("media-seek-forward-button",ji);var Rs=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
438
438
|
<path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
|
|
439
|
-
</svg>`,
|
|
439
|
+
</svg>`,Ps=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
440
440
|
<path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
|
|
441
|
-
</svg>`,
|
|
441
|
+
</svg>`,qr=d.createElement("template");qr.innerHTML=`
|
|
442
442
|
<style>
|
|
443
443
|
:host([${o.MEDIA_IS_FULLSCREEN}]) slot:not([name=exit]) > *,
|
|
444
444
|
:host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted(:not([slot=exit])) {
|
|
@@ -452,15 +452,15 @@
|
|
|
452
452
|
}
|
|
453
453
|
</style>
|
|
454
454
|
|
|
455
|
-
<slot name="enter">${
|
|
456
|
-
<slot name="exit">${
|
|
457
|
-
`;var
|
|
455
|
+
<slot name="enter">${Rs}</slot>
|
|
456
|
+
<slot name="exit">${Ps}</slot>
|
|
457
|
+
`;var Qr=t=>{let e=t.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?L.EXIT_FULLSCREEN():L.ENTER_FULLSCREEN();t.setAttribute("aria-label",e)},Xi=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(i={}){super({slotTemplate:qr,...i})}connectedCallback(){Qr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_FULLSCREEN&&Qr(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-fullscreen-button",Xi);var Us=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
458
458
|
<path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
|
|
459
|
-
</svg>`,
|
|
459
|
+
</svg>`,zr=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
460
460
|
<path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
|
|
461
|
-
</svg>`,
|
|
461
|
+
</svg>`,Os=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
462
462
|
<path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
|
|
463
|
-
</svg>`,
|
|
463
|
+
</svg>`,Xr=d.createElement("template");Xr.innerHTML=`
|
|
464
464
|
<style>
|
|
465
465
|
|
|
466
466
|
:host(:not([${o.MEDIA_VOLUME_LEVEL}])) slot:not([name=high]) > *,
|
|
@@ -486,13 +486,13 @@
|
|
|
486
486
|
}
|
|
487
487
|
</style>
|
|
488
488
|
|
|
489
|
-
<slot name="off">${
|
|
490
|
-
<slot name="low">${
|
|
491
|
-
<slot name="medium">${
|
|
492
|
-
<slot name="high">${
|
|
493
|
-
`;var
|
|
489
|
+
<slot name="off">${Us}</slot>
|
|
490
|
+
<slot name="low">${zr}</slot>
|
|
491
|
+
<slot name="medium">${zr}</slot>
|
|
492
|
+
<slot name="high">${Os}</slot>
|
|
493
|
+
`;var jr=t=>{let e=t.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?L.UNMUTE():L.MUTE();t.setAttribute("aria-label",e)},Ji=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(i={}){super({slotTemplate:Xr,...i})}connectedCallback(){jr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_VOLUME_LEVEL&&jr(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-mute-button",Ji);var Jr=`<svg aria-hidden="true" viewBox="0 0 28 24">
|
|
494
494
|
<path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
|
|
495
|
-
</svg>`,
|
|
495
|
+
</svg>`,tn=d.createElement("template");tn.innerHTML=`
|
|
496
496
|
<style>
|
|
497
497
|
:host([${o.MEDIA_IS_PIP}]) slot:not([name=exit]) > *,
|
|
498
498
|
:host([${o.MEDIA_IS_PIP}]) ::slotted(:not([slot=exit])) {
|
|
@@ -506,13 +506,13 @@
|
|
|
506
506
|
}
|
|
507
507
|
</style>
|
|
508
508
|
|
|
509
|
-
<slot name="enter">${
|
|
510
|
-
<slot name="exit">${
|
|
511
|
-
`;var
|
|
509
|
+
<slot name="enter">${Jr}</slot>
|
|
510
|
+
<slot name="exit">${Jr}</slot>
|
|
511
|
+
`;var en=t=>{let e=t.getAttribute(o.MEDIA_IS_PIP)!=null?L.EXIT_PIP():L.ENTER_PIP();t.setAttribute("aria-label",e)},ea=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(i={}){super({slotTemplate:tn,...i})}connectedCallback(){en(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_PIP&&en(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_IS_PIP)!=null?h.MEDIA_EXIT_PIP_REQUEST:h.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-pip-button",ea);var Ns=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
512
512
|
<path d="m6 21 15-9L6 3v18Z"/>
|
|
513
|
-
</svg
|
|
513
|
+
</svg>`,$s=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
514
514
|
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
515
|
-
</svg>`,
|
|
515
|
+
</svg>`,rn=d.createElement("template");rn.innerHTML=`
|
|
516
516
|
<style>
|
|
517
517
|
:host([${o.MEDIA_PAUSED}]) slot[name=pause] > *,
|
|
518
518
|
:host([${o.MEDIA_PAUSED}]) ::slotted([slot=pause]) {
|
|
@@ -525,11 +525,11 @@
|
|
|
525
525
|
}
|
|
526
526
|
</style>
|
|
527
527
|
|
|
528
|
-
<slot name="play">${
|
|
529
|
-
<slot name="pause">${
|
|
530
|
-
`;var
|
|
528
|
+
<slot name="play">${Ns}</slot>
|
|
529
|
+
<slot name="pause">${$s}</slot>
|
|
530
|
+
`;var an=t=>{let e=t.getAttribute(o.MEDIA_PAUSED)!=null?L.PLAY():L.PAUSE();t.setAttribute("aria-label",e)},ta=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED]}constructor(i={}){super({slotTemplate:rn,...i})}connectedCallback(){an(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_PAUSED&&an(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-play-button",ta);var nn=[1,1.25,1.5,1.75,2],qt=1,on=d.createElement("template");on.innerHTML=`
|
|
531
531
|
<span id="container"></span>
|
|
532
|
-
`;var ia=class extends
|
|
532
|
+
`;var ia=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,"rates"]}constructor(i={}){super({slotTemplate:on,...i}),this._rates=nn,this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${qt}x`}attributeChangedCallback(i,e,a){if(i==="rates"){let r=(a!=null?a:"").trim().split(/\s*,?\s+/).map(n=>Number(n)).filter(n=>!Number.isNaN(n)).sort((n,s)=>n-s);this._rates=r.length?r:nn;return}if(i===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?qt:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",N.PLAYBACK_RATE({playbackRate:n}));return}super.attributeChangedCallback(i,e,a)}handleClick(i){var e,a;let r=+this.getAttribute(o.MEDIA_PLAYBACK_RATE)||qt,n=(a=(e=this._rates.find(l=>l>r))!=null?e:this._rates[0])!=null?a:qt,s=new u.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(s)}};p("media-playback-rate-button",ia);var sn=d.createElement("template");sn.innerHTML=`
|
|
533
533
|
<style>
|
|
534
534
|
:host {
|
|
535
535
|
pointer-events: none;
|
|
@@ -555,7 +555,7 @@
|
|
|
555
555
|
</style>
|
|
556
556
|
|
|
557
557
|
<img aria-hidden="true" id="image"/>
|
|
558
|
-
`;var
|
|
558
|
+
`;var Bs=t=>{t.style.removeProperty("background-image")},Vs=(t,i)=>{t.style["background-image"]=`url('${i}')`},aa=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_HAS_PLAYED,"placeholder-src","src"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(sn.content.cloneNode(!0)),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(i,e,a){i==="src"&&(a==null?this.image.removeAttribute("src"):this.image.setAttribute("src",a)),i==="placeholder-src"&&(a==null?Bs(this.image):Vs(this.image,a))}};p("media-poster-image",aa);var da=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},F=(t,i,e)=>(da(t,i,"read from private field"),e?e.call(t):i.get(t)),j=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},pt=(t,i,e,a)=>(da(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),ra=(t,i,e)=>(da(t,i,"access private method"),e),bt,zt,jt,Ge,Et,oa,Jt,ti,Xt,sa,la,dn,Hs="video not loaded, unknown time.",na=t=>{let i=t.range,e=ye(+i.value),a=ye(+i.max),r=e&&a?`${e} of ${a}`:Hs;i.setAttribute("aria-valuetext",r)},cn=d.createElement("template");cn.innerHTML=`
|
|
559
559
|
<style>
|
|
560
560
|
:host {
|
|
561
561
|
--media-preview-background-color: rgba(20,20,30, .5);
|
|
@@ -648,9 +648,9 @@
|
|
|
648
648
|
|
|
649
649
|
</slot>
|
|
650
650
|
</span>
|
|
651
|
-
`;var
|
|
652
|
-
<slot name="backward">${
|
|
653
|
-
`;var
|
|
651
|
+
`;var ei=class extends ht{constructor(){super(),j(this,Xt),j(this,la),j(this,bt,void 0),j(this,zt,void 0),j(this,jt,i=>{if([...F(this,bt)].some(m=>i.composedPath().includes(m)))return;this.updatePointerBar(i);let e=+this.getAttribute(o.MEDIA_DURATION);if(!e)return;let a=this.range.getBoundingClientRect(),r=(i.clientX-a.left)/a.width;r=Math.max(0,Math.min(1,r));let n=ln(this,F(this,zt),r),{style:s}=oe(this.shadowRoot,'[part~="preview-box"]');s.transform=`translateX(${n}px)`;let l=r*e,c=new u.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:l});this.dispatchEvent(c)}),j(this,Ge,!1),j(this,Et,i=>{(!i.composedPath().includes(this)||[...F(this,bt)].some(e=>i.composedPath().includes(e)))&&(u.removeEventListener("pointermove",F(this,Et)),pt(this,Ge,!1),F(this,Jt).call(this))}),j(this,oa,()=>{u.addEventListener("pointermove",F(this,jt),!1)}),j(this,Jt,()=>{u.removeEventListener("pointermove",F(this,jt));let i=new u.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(i)}),j(this,ti,()=>{let i=this.getAttribute(o.MEDIA_DURATION);!F(this,Ge)&&i&&(pt(this,Ge,!0),F(this,oa).call(this),u.addEventListener("pointermove",F(this,Et),!1))}),this.shadowRoot.appendChild(cn.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let e=this.range.value,a=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}),this._refreshBar=()=>{let i=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+i*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},pt(this,bt,this.shadowRoot.querySelectorAll('[part~="box"]')),pt(this,zt,this.shadowRoot.querySelector('[part~="preview-box"]')),ra(this,Xt,sa).call(this)}static get observedAttributes(){return[...super.observedAttributes,"thumbnails","disabled",o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING]}connectedCallback(){this.range.setAttribute("aria-label",N.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(i,e,a){var r,n,s,l,c;(i===o.MEDIA_CURRENT_TIME||i===o.MEDIA_PAUSED||i===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,na(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),i===o.MEDIA_DURATION&&(this.range.max=Math.floor((n=(r=this.mediaSeekableEnd)!=null?r:this.mediaDuration)!=null?n:1e3),na(this),this.updateBar(),this.updateCurrentBox()),i===o.MEDIA_SEEKABLE&&(this.range.min=(s=this.mediaSeekableStart)!=null?s:0,this.range.max=Math.floor((c=(l=this.mediaSeekableEnd)!=null?l:this.mediaDuration)!=null?c:1e3),na(this),this.updateBar()),i===o.MEDIA_BUFFERED&&this.updateBar(),i==="disabled"&&(a==null?ra(this,Xt,sa).call(this):ra(this,la,dn).call(this)),super.attributeChangedCallback(i,e,a)}get mediaPaused(){return this.hasAttribute(o.MEDIA_PAUSED)}get mediaLoading(){return this.hasAttribute(o.MEDIA_LOADING)}get mediaDuration(){let i=this.getAttribute(o.MEDIA_DURATION);return i!=null?+i:void 0}get mediaCurrentTime(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME);return i!=null?+i:void 0}get mediaPlaybackRate(){let i=this.getAttribute(o.MEDIA_PLAYBACK_RATE);return i!=null?+i:1}get mediaBuffered(){let i=this.getAttribute(o.MEDIA_BUFFERED);return i?i.split(" ").map(e=>e.split(":").map(a=>+a)):[]}get mediaSeekable(){let i=this.getAttribute(o.MEDIA_SEEKABLE);if(!!i)return i.split(":").map(e=>+e)}get mediaSeekableEnd(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e}get mediaSeekableStart(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e}getBarColors(){var i;let e=super.getBarColors(),{range:a}=this,r=a.max-a.min,n=this.mediaBuffered;if(!n.length||!Number.isFinite(r)||r<=0)return e;let s=this.mediaCurrentTime,[,l=a.min]=(i=n.find(([E,y])=>E<=s&&s<=y))!=null?i:[],m=(l-a.min)/r*100;return e.splice(1,0,["var(--media-time-buffered-color, rgba(255,255,255, .4))",m]),e}updateCurrentBox(){let i=this.shadowRoot.querySelector('[part~="current-box"]'),e=this.range.value/(this.range.max-this.range.min),a=ln(this,i,e),{style:r}=oe(this.shadowRoot,'[part~="current-box"]');r.transform=`translateX(${a}px)`}};bt=new WeakMap;zt=new WeakMap;jt=new WeakMap;Ge=new WeakMap;Et=new WeakMap;oa=new WeakMap;Jt=new WeakMap;ti=new WeakMap;Xt=new WeakSet;sa=function(){this.addEventListener("pointermove",F(this,ti),!1)};la=new WeakSet;dn=function(){u.removeEventListener("pointermove",F(this,Et)),this.removeEventListener("pointermove",F(this,ti)),pt(this,Ge,!1),F(this,Jt).call(this)};function ln(t,i,e){var a;let r=t.getBoundingClientRect(),n=t.range.getBoundingClientRect(),s=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-left")),l=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-right")),c=s+e*n.width,m=i.offsetWidth,E=c-m/2,k=((a=t.getAttribute("media-bounds")?ot(t,`#${t.getAttribute("media-bounds")}`):t.parentElement)!=null?a:t).getBoundingClientRect(),_=r.left-k.left,O=k.right-r.left-m-l,x=s-_;return Math.max(x,Math.min(E,O))}p("media-time-range",ei);var ca=ei;var ua=class extends ca{constructor(){super(),console.warn("MediaChrome: <media-progress-range> is deprecated. Use <media-time-range> instead.")}};p("media-progress-range",ua);var ma=30,Ws=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${ma}</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg>`,hn=d.createElement("template");hn.innerHTML=`
|
|
652
|
+
<slot name="backward">${Ws}</slot>
|
|
653
|
+
`;var Fs=0,un=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=L.SEEK_BACK_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},mn=t=>{let i=Nt(t,"backward"),e=t.getAttribute("seek-offset");Ot(i,e)},ha=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(i={}){super({slotTemplate:hn,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",ma),un(this),mn(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",ma),mn(this),un(this)),super.attributeChangedCallback(i,e,a)}handleClick(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME),e=+this.getAttribute("seek-offset"),a=i&&!Number.isNaN(+i)?+i:Fs,r=Math.max(a-e,0),n=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};p("media-seek-backward-button",ha);var pa=class extends be{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(i,e,a){i===o.MEDIA_PREVIEW_TIME&&a!=null&&(this.container.textContent=z(a)),super.attributeChangedCallback(i,e,a)}};p("media-preview-time-display",pa);var pn=d.createElement("template");pn.innerHTML=`
|
|
654
654
|
<style>
|
|
655
655
|
:host {
|
|
656
656
|
box-sizing: border-box;
|
|
@@ -664,7 +664,7 @@
|
|
|
664
664
|
}
|
|
665
665
|
</style>
|
|
666
666
|
<img crossorigin loading="eager" decoding="async" />
|
|
667
|
-
`;var ba=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(
|
|
667
|
+
`;var ba=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(pn.content.cloneNode(!0))}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}attributeChangedCallback(i,e,a){var r,n;if(["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(i)&&this.update(),i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}update(){let i=this.getAttribute(o.MEDIA_PREVIEW_COORDS),e=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(i&&e))return;let[a,r,n,s]=i.split(/\s+/).map(xt=>+xt),l=e.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:E,minWidth:y,minHeight:k}=c,_=Math.min(parseInt(m)/n,parseInt(E)/s),O=Math.max(parseInt(y)/n,parseInt(k)/s),x=_<1,P=x?_:O>1?O:1,{style:C}=oe(this.shadowRoot,":host"),re=oe(this.shadowRoot,"img").style,Y=this.shadowRoot.querySelector("img"),ne=x?"min":"max";C.setProperty(`${ne}-width`,"initial","important"),C.setProperty(`${ne}-height`,"initial","important"),C.width=`${n*P}px`,C.height=`${s*P}px`;let Oe=()=>{re.width=`${this.imgWidth*P}px`,re.height=`${this.imgHeight*P}px`,re.display="block"};Y.src!==l&&(Y.onload=()=>{this.imgWidth=Y.naturalWidth,this.imgHeight=Y.naturalHeight,Oe()},Y.src=l,Oe()),Oe(),re.transform=`translate(-${a*P}px, -${r*P}px)`}};p("media-preview-thumbnail",ba);var bn=d.createElement("template"),Ks=`
|
|
668
668
|
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
669
669
|
<path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
|
|
670
670
|
<animateTransform
|
|
@@ -677,7 +677,7 @@
|
|
|
677
677
|
repeatCount="indefinite" />
|
|
678
678
|
</path>
|
|
679
679
|
</svg>
|
|
680
|
-
`;
|
|
680
|
+
`;bn.innerHTML=`
|
|
681
681
|
<style>
|
|
682
682
|
:host {
|
|
683
683
|
display: inline-block;
|
|
@@ -714,28 +714,28 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
714
714
|
}
|
|
715
715
|
</style>
|
|
716
716
|
|
|
717
|
-
<slot name="loading">${
|
|
717
|
+
<slot name="loading">${Ks}</slot>
|
|
718
718
|
<div id="status" role="status" aria-live="polite">${N.MEDIA_LOADING()}</div>
|
|
719
|
-
`;var
|
|
719
|
+
`;var Ys=500,Ea=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,"loading-delay"]}constructor(){super();let i=this.attachShadow({mode:"open"}),e=bn.content.cloneNode(!0);i.appendChild(e)}attributeChangedCallback(i,e,a){var r,n,s;if(i===o.MEDIA_LOADING||i===o.MEDIA_PAUSED){let l=this.getAttribute(o.MEDIA_PAUSED)!=null,c=this.getAttribute(o.MEDIA_LOADING)!=null,m=!l&&c;if(!m)this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),this.removeAttribute("is-loading");else if(!this.loadingDelayHandle&&m){let E=+((r=this.getAttribute("loading-delay"))!=null?r:Ys);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},E)}}else if(i===o.MEDIA_CONTROLLER){if(e){let l=d.getElementById(e);(n=l==null?void 0:l.unassociateElement)==null||n.call(l,this)}if(a){let l=d.getElementById(a);(s=l==null?void 0:l.associateElement)==null||s.call(l,this)}}}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0);let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-loading-indicator",Ea);var En=d.createElement("template");En.innerHTML=`
|
|
720
720
|
<style>
|
|
721
721
|
:host {
|
|
722
722
|
}
|
|
723
723
|
</style>
|
|
724
724
|
<slot></slot>
|
|
725
|
-
`;var fa=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(
|
|
726
|
-
${a}${t.file}`}Se(i)}var $={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ke={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Sn=Object.freeze({length:0,start(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),rl=kn.VideoEvents.filter(t=>t!=="error"),nl=Object.values($).filter(t=>![$.PLAYSINLINE].includes(t)),ol=Object.values(ke);function Ln(t){t.querySelectorAll(":scope > track").forEach(i=>{var e;(e=t.media)==null||e.append(i.cloneNode())}),rl.forEach(i=>{var e;(e=t.media)==null||e.addEventListener(i,a=>{t.dispatchEvent(new Event(a.type))})})}var La=class extends M.HTMLElement{static get observedAttributes(){return[...nl,...ol]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let i=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var l,c;let s=(l=this.media)==null?void 0:l.querySelector(`track[src="${n.src}"]`);s&&((c=this.media)==null||c.removeChild(s))}),r.addedNodes.forEach(n=>{var s;(s=this.media)==null||s.append(n.cloneNode())}))};new MutationObserver(i).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(i,e,a){var r,n;switch(i){case ke.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ke.VOLUME:{let s=(r=se(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ke.PLAYBACKRATE:{let s=(n=se(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var i,e;return(e=(i=this.media)==null?void 0:i.play())!=null?e:Promise.reject()}pause(){var i;(i=this.media)==null||i.pause()}requestCast(i){var e;return(e=this.media)==null?void 0:e.requestCast(i)}get media(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("mux-video")}get paused(){var i,e;return(e=(i=this.media)==null?void 0:i.paused)!=null?e:!0}get duration(){var i,e;return(e=(i=this.media)==null?void 0:i.duration)!=null?e:NaN}get ended(){var i,e;return(e=(i=this.media)==null?void 0:i.ended)!=null?e:!1}get buffered(){var i,e;return(e=(i=this.media)==null?void 0:i.buffered)!=null?e:Sn}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:Sn}get readyState(){var i,e;return(e=(i=this.media)==null?void 0:i.readyState)!=null?e:0}get videoWidth(){var i,e;return(e=(i=this.media)==null?void 0:i.videoWidth)!=null?e:0}get videoHeight(){var i,e;return(e=(i=this.media)==null?void 0:i.videoHeight)!=null?e:0}get currentTime(){var i,e;return(e=(i=this.media)==null?void 0:i.currentTime)!=null?e:0}set currentTime(i){this.media&&(this.media.currentTime=Number(i))}get volume(){var i,e;return(e=(i=this.media)==null?void 0:i.volume)!=null?e:1}set volume(i){this.media&&(this.media.volume=Number(i))}get playbackRate(){var i,e;return(e=(i=this.media)==null?void 0:i.playbackRate)!=null?e:1}set playbackRate(i){this.media&&(this.media.playbackRate=Number(i))}get defaultPlaybackRate(){var i;return(i=se(this.getAttribute(ke.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(ke.PLAYBACKRATE,`${i}`):this.removeAttribute(ke.PLAYBACKRATE)}get crossOrigin(){return gt(this,$.CROSSORIGIN)}set crossOrigin(i){this.setAttribute($.CROSSORIGIN,`${i}`)}get autoplay(){return gt(this,$.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute($.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute($.AUTOPLAY)}get loop(){return gt(this,$.LOOP)!=null}set loop(i){i?this.setAttribute($.LOOP,""):this.removeAttribute($.LOOP)}get muted(){var i,e;return(e=(i=this.media)==null?void 0:i.muted)!=null?e:!1}set muted(i){this.media&&(this.media.muted=Boolean(i))}get defaultMuted(){return gt(this,$.MUTED)!=null}set defaultMuted(i){i?this.setAttribute($.MUTED,""):this.removeAttribute($.MUTED)}get playsInline(){return gt(this,$.PLAYSINLINE)!=null}set playsInline(i){X("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(i){["","none","metadata","auto"].includes(i)?this.setAttribute($.PRELOAD,i):this.removeAttribute($.PRELOAD)}};function gt(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}var Ca=La;var ni=new Map;function oi(t){if(ni.has(t))return ni.get(t);let i=t.length,e=0,a=0,r=0,n=[];for(let s=0;s<i;s+=1){let l=t[s],c=t[s+1],m=t[s-1];l==="{"&&c==="{"&&m!=="\\"?(r+=1,r===1&&(a=s),s+=1):l==="}"&&c==="}"&&m!=="\\"&&r&&(r-=1,r===0&&(a>e&&(n.push(Object.freeze({type:"string",start:e,end:a,value:t.slice(e,a)})),e=a),n.push(Object.freeze({type:"part",start:a,end:s+2,value:t.slice(e+2,s).trim()})),s+=1,e=s+1))}return e<i&&n.push(Object.freeze({type:"string",start:e,end:i,value:t.slice(e,i)})),ni.set(t,Object.freeze(n)),ni.get(t)}var Le=new WeakMap,Cn=new WeakMap,q=class{constructor(i,e){this.expression=e,Le.set(this,i),i.updateParent("")}get attributeName(){return Le.get(this).attr.name}get attributeNamespace(){return Le.get(this).attr.namespaceURI}get value(){return Cn.get(this)}set value(i){Cn.set(this,i||""),Le.get(this).updateParent(i)}get element(){return Le.get(this).element}get booleanValue(){return Le.get(this).booleanValue}set booleanValue(i){Le.get(this).booleanValue=i}},vt=class{constructor(i,e){this.element=i,this.attr=e,this.partList=[]}get booleanValue(){return this.element.hasAttributeNS(this.attr.namespaceURI,this.attr.name)}set booleanValue(i){if(this.partList.length!==1)throw new DOMException("Operation not supported","NotSupportedError");this.partList[0].value=i?"":null}append(i){this.partList.push(i)}updateParent(i){if(this.partList.length===1&&i===null)this.element.removeAttributeNS(this.attr.namespaceURI,this.attr.name);else{let e=this.partList.map(a=>typeof a=="string"?a:a.value).join("");this.element.setAttributeNS(this.attr.namespaceURI,this.attr.name,e)}}};var Ee=new WeakMap,J=class{constructor(i,e){this.expression=e,Ee.set(this,[i]),i.textContent=""}get value(){return Ee.get(this).map(i=>i.textContent).join("")}set value(i){this.replace(i)}get previousSibling(){return Ee.get(this)[0].previousSibling}get nextSibling(){return Ee.get(this)[Ee.get(this).length-1].nextSibling}replace(...i){let e=i.map(a=>typeof a=="string"?new Text(a):a);e.length||e.push(new Text("")),Ee.get(this)[0].before(...e);for(let a of Ee.get(this))a.remove();Ee.set(this,e)}};function At(t){return{processCallback(i,e,a){var r;if(!(typeof a!="object"||!a)){for(let n of e)if(n.expression in a){let s=(r=a[n.expression])!==null&&r!==void 0?r:"";t(n,s)}}}}}function wa(t,i){t.value=String(i)}function wn(t,i){return typeof i=="boolean"&&t instanceof q&&typeof t.element[t.attributeName]=="boolean"?(t.booleanValue=i,!0):!1}var Da=At(wa),sl=At((t,i)=>{wn(t,i)||wa(t,i)});function*ll(t){let i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null,!1),e;for(;e=i.nextNode();)if(e instanceof Element&&e.hasAttributes())for(let a=0;a<e.attributes.length;a+=1){let r=e.attributes.item(a);if(r&&r.value.includes("{{")){let n=new vt(e,r);for(let s of oi(r.value))if(s.type==="string")n.append(s.value);else{let l=new q(n,s.value);n.append(l),yield l}}}else if(e instanceof Text&&e.textContent&&e.textContent.includes("{{")){let a=oi(e.textContent);for(let r=0;r<a.length;r+=1){let n=a[r];n.end<e.textContent.length&&e.splitText(n.end),n.type==="part"&&(yield new J(e,n.value));break}}}var si=new WeakMap,li=new WeakMap,le=class extends DocumentFragment{constructor(i,e,a=Da){var r,n;super(),Object.getPrototypeOf(this)!==le.prototype&&Object.setPrototypeOf(this,le.prototype),this.appendChild(i.content.cloneNode(!0)),li.set(this,Array.from(ll(this))),si.set(this,a),(n=(r=si.get(this)).createCallback)===null||n===void 0||n.call(r,this,li.get(this),e),si.get(this).processCallback(this,li.get(this),e)}update(i){si.get(this).processCallback(this,li.get(this),i)}};var _t=new WeakMap,yt=class{constructor(i,e){this.element=i;this.type=e;this.element.addEventListener(this.type,this);let a=_t.get(this.element);a&&a.set(this.type,this)}set(i){if(typeof i=="function")this.handleEvent=i.bind(this.element);else if(typeof i=="object"&&typeof i.handleEvent=="function")this.handleEvent=i.handleEvent.bind(i);else{this.element.removeEventListener(this.type,this);let e=_t.get(this.element);e&&e.delete(this.type)}}static for(i){_t.has(i.element)||_t.set(i.element,new Map);let e=i.attributeName.slice(2),a=_t.get(i.element);return a&&a.has(e)?a.get(e):new yt(i.element,e)}};function dl(t,i){return t instanceof q&&t.attributeName.startsWith("on")?(yt.for(t).set(i),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function cl(t,i){return i instanceof Tt&&t instanceof J?(i.renderInto(t),!0):!1}function ul(t,i){return i instanceof DocumentFragment&&t instanceof J?(i.childNodes.length&&t.replace(...i.childNodes),!0):!1}function ml(t,i){if(t instanceof q){let e=t.attributeNamespace,a=t.element.getAttributeNS(e,t.attributeName);return String(i)!==a&&(t.value=String(i)),!0}return t.value=String(i),!0}function hl(t,i){if(typeof i=="boolean"&&t instanceof q){let e=t.attributeNamespace,a=t.element.hasAttributeNS(e,t.attributeName);return i!==a&&(t.booleanValue=i),!0}return!1}function pl(t,i){return i===!1&&t instanceof J?(t.replace(""),!0):!1}function bl(t,i){hl(t,i)||dl(t,i)||pl(t,i)||cl(t,i)||ul(t,i)||ml(t,i)}var xa=new WeakMap,Dn=new WeakMap,xn=new WeakMap,Tt=class{constructor(i,e,a){this.strings=i;this.values=e;this.processor=a}get template(){if(xa.has(this.strings))return xa.get(this.strings);{let i=document.createElement("template"),e=this.strings.length-1;return i.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<e?`{{ ${n} }}`:""),""),xa.set(this.strings,i),i}}renderInto(i){let e=this.template;if(Dn.get(i)!==e){Dn.set(i,e);let r=new le(e,this.values,this.processor);xn.set(i,r),i instanceof J?i.replace(...r.children):i.appendChild(r);return}let a=xn.get(i);a&&a.update(this.values)}},Rn=new Map,El=At(bl);function f(t,...i){let e=[""],a=[],r,n=!1,s=(l,c=[])=>{e[e.length-1]=e[e.length-1]+l[0],c.forEach((m,E)=>{(r=m==null?void 0:m.$static$)!==void 0?(r.forEach(y=>{s(y.strings,y.values)}),e[e.length-1]=e[e.length-1]+l[E+1],n=!0):(a.push(m),e.push(l[E+1]))})};if(s(t,i),n){let l=e.join("$$html$$");t=Rn.get(l),t===void 0&&(e.raw=e,Rn.set(l,t=e)),i=a}return new Tt(t,i,El)}function di(t,i){t.renderInto(i)}function R(t,i){let e=document.createElement("template");return e.innerHTML=t,new le(e,i)}var Ra=(...t)=>({$static$:t.map(i=>i instanceof Tt?i:/\w-/.test(i)?{strings:[i]}:{strings:[]})});var Un=`
|
|
725
|
+
`;var fa=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(En.content.cloneNode(!0))}};p("media-title-bar",fa);var Gs=100,Zs=t=>{var i;if(t.getAttribute(o.MEDIA_MUTED)!=null)return 0;let a=+((i=t.getAttribute(o.MEDIA_VOLUME))!=null?i:1);return Math.round(a*t.range.max)},Qs=({value:t,max:i})=>`${Math.round(t/i*100)}%`,ga=class extends ht{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=Gs,this.range.addEventListener("input",()=>{let e=this.range.value/this.range.max,a=new u.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",N.VOLUME()),super.connectedCallback()}attributeChangedCallback(i,e,a){if(i===o.MEDIA_VOLUME||i===o.MEDIA_MUTED){let r=Zs(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Qs(this.range)),this.updateBar()}super.attributeChangedCallback(i,e,a)}};p("media-volume-range",ga);var qs=Object.defineProperty,zs=(t,i,e)=>i in t?qs(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,js=(t,i,e)=>(zs(t,typeof i!="symbol"?i+"":i,e),e),ft=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render()}render(){this.shadowRoot.textContent="";let i=d.createElement("template");i.innerHTML=this.constructor.template,this.shadowRoot.append(i.content.cloneNode(!0))}get mediaController(){return this.shadowRoot.querySelector("media-controller")}};js(ft,"template","");p("media-theme",ft);var va=ft;var Aa=class extends mt{};u.customElements.get("media-chrome")||u.customElements.define("media-chrome",Aa);var _a=class extends mt{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};u.customElements.get("media-container")||u.customElements.define("media-container",_a);var g=Go(require("@mux/mux-video")),S=require("@mux/playback-core");var wn=require("@mux/mux-video");var Xs="en",Me={code:Xs};var fn="en";function A(t,i=!0){var r,n;let e=i&&(n=(r=Me)==null?void 0:r[t])!=null?n:t,a=i?Me.code:fn;return new ya(e,a)}var ya=class{constructor(i,e=(a=>(a=Me.code)!=null?a:fn)()){this.message=i,this.locale=e}format(i){return this.message.replace(/\{(\w+)\}/g,(e,a)=>{var r;return(r=i[a])!=null?r:""})}toString(){return this.message}};function gn(t){let i="";return Object.entries(t).forEach(([e,a])=>{a!=null&&(i+=`${Js(e)}: ${a}; `)}),i?i.trim():void 0}function Js(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function vn(t){return t.replace(/[-_]([a-z])/g,(i,e)=>e.toUpperCase())}function se(t){if(t==null)return;let i=+t;return Number.isNaN(i)?void 0:i}function ii(t){let i=el(t).toString();return i?"?"+i:""}function el(t){let i={};for(let e in t)t[e]!=null&&(i[e]=t[e]);return new URLSearchParams(i)}function Ee(t){let i=(t!=null?t:"").split(".")[1];if(!i)return{};let e=i.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var Ta=(t,i)=>!t||!i?!1:t.contains(i)?!0:Ta(t,i.getRootNode().host);var gt=require("@mux/playback-core");var Ia="mux.com",tl=()=>{try{return"1.3.0"}catch{}return"UNKNOWN"},il=tl(),ri=()=>il,Ma=(t,{token:i,domain:e=Ia}={})=>`https://stream.${e}/${t}.m3u8${ii(!!i?{token:i}:{redundant_streams:!0})}`,yn=(t,{token:i,thumbnailTime:e,domain:a=Ia}={})=>{let r=i==null?e:void 0,{aud:n}=Ee(i);if(!(i&&n!=="t"))return`https://image.${a}/${t}/thumbnail.jpg${ii({token:i,time:r})}`},Tn=(t,{token:i,domain:e=Ia}={})=>{let{aud:a}=Ee(i);if(!(i&&a!=="s"))return`https://image.${e}/${t}/storyboard.vtt${ii({token:i})}`};function Sa(t){if(t&&/^media-theme-[\w-]+$/.test(t))return t}var al={crossorigin:"crossOrigin",playsinline:"playsInline"};function In(t){var i;return(i=al[t])!=null?i:vn(t)}var Mn=t=>{var e,a;let{media:i}=t;return(a=(e=i==null?void 0:i._hls)==null?void 0:e.liveSyncPosition)!=null?a:i!=null&&i.seekable.length?i==null?void 0:i.seekable.end(i.seekable.length-1):void 0},ka=t=>{let i=Mn(t);if(i==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}t.currentTime=i},rl=1,nl=5,An=3,_n=.5,Sn=t=>{var n;let{streamType:i}=t,e=Mn(t),a=(n=t.media)==null?void 0:n.currentTime;if(e==null||a==null)return!1;let r=e-a;return i===gt.StreamTypes.LL_LIVE||i===gt.StreamTypes.LL_DVR?r<=rl*(An+_n):i===gt.StreamTypes.LIVE||i===gt.StreamTypes.DVR?r<=nl*(An+_n):!1},Se,ke,V,ai=class{constructor(i,e){T(this,Se,void 0);T(this,ke,void 0);T(this,V,[]);B(this,Se,i),B(this,ke,e)}[Symbol.iterator](){return v(this,V).values()}get length(){return v(this,V).length}get value(){var i;return(i=v(this,V).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(B(this,V,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return v(this,V)[i]}values(){return v(this,V).values()}keys(){return v(this,V).keys()}forEach(i){v(this,V).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||v(this,V).push(r)}),!(this.value===""&&!((e=v(this,Se))!=null&&e.hasAttribute(`${v(this,ke)}`)))&&((a=v(this,Se))==null||a.setAttribute(`${v(this,ke)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{v(this,V).splice(v(this,V).indexOf(a),1)}),(e=v(this,Se))==null||e.setAttribute(`${v(this,ke)}`,`${this.value}`)}contains(i){return v(this,V).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Se=new WeakMap,ke=new WeakMap,V=new WeakMap;var kn=`[mux-player ${ri()}]`;function Le(...t){console.warn(kn,...t)}function X(...t){console.error(kn,...t)}function ni(t){var e;let i=(e=t.message)!=null?e:"";if(t.file){let a="https://github.com/muxinc/elements/blob/main/errors/";i+=` ${A("Read more: ")}
|
|
726
|
+
${a}${t.file}`}Le(i)}var $={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Ce={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Cn=Object.freeze({length:0,start(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),ol=wn.VideoEvents.filter(t=>t!=="error"),sl=Object.values($).filter(t=>![$.PLAYSINLINE].includes(t)),ll=Object.values(Ce);function Dn(t){t.querySelectorAll(":scope > track").forEach(i=>{var e;(e=t.media)==null||e.append(i.cloneNode())}),ol.forEach(i=>{var e;(e=t.media)==null||e.addEventListener(i,a=>{t.dispatchEvent(new Event(a.type))})})}var La=class extends M.HTMLElement{static get observedAttributes(){return[...sl,...ll]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let i=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var l,c;let s=(l=this.media)==null?void 0:l.querySelector(`track[src="${n.src}"]`);s&&((c=this.media)==null||c.removeChild(s))}),r.addedNodes.forEach(n=>{var s;(s=this.media)==null||s.append(n.cloneNode())}))};new MutationObserver(i).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(i,e,a){var r,n;switch(i){case Ce.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Ce.VOLUME:{let s=(r=se(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Ce.PLAYBACKRATE:{let s=(n=se(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var i,e;return(e=(i=this.media)==null?void 0:i.play())!=null?e:Promise.reject()}pause(){var i;(i=this.media)==null||i.pause()}requestCast(i){var e;return(e=this.media)==null?void 0:e.requestCast(i)}get media(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("mux-video")}get paused(){var i,e;return(e=(i=this.media)==null?void 0:i.paused)!=null?e:!0}get duration(){var i,e;return(e=(i=this.media)==null?void 0:i.duration)!=null?e:NaN}get ended(){var i,e;return(e=(i=this.media)==null?void 0:i.ended)!=null?e:!1}get buffered(){var i,e;return(e=(i=this.media)==null?void 0:i.buffered)!=null?e:Cn}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:Cn}get readyState(){var i,e;return(e=(i=this.media)==null?void 0:i.readyState)!=null?e:0}get videoWidth(){var i,e;return(e=(i=this.media)==null?void 0:i.videoWidth)!=null?e:0}get videoHeight(){var i,e;return(e=(i=this.media)==null?void 0:i.videoHeight)!=null?e:0}get currentTime(){var i,e;return(e=(i=this.media)==null?void 0:i.currentTime)!=null?e:0}set currentTime(i){this.media&&(this.media.currentTime=Number(i))}get volume(){var i,e;return(e=(i=this.media)==null?void 0:i.volume)!=null?e:1}set volume(i){this.media&&(this.media.volume=Number(i))}get playbackRate(){var i,e;return(e=(i=this.media)==null?void 0:i.playbackRate)!=null?e:1}set playbackRate(i){this.media&&(this.media.playbackRate=Number(i))}get defaultPlaybackRate(){var i;return(i=se(this.getAttribute(Ce.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(Ce.PLAYBACKRATE,`${i}`):this.removeAttribute(Ce.PLAYBACKRATE)}get crossOrigin(){return vt(this,$.CROSSORIGIN)}set crossOrigin(i){this.setAttribute($.CROSSORIGIN,`${i}`)}get autoplay(){return vt(this,$.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute($.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute($.AUTOPLAY)}get loop(){return vt(this,$.LOOP)!=null}set loop(i){i?this.setAttribute($.LOOP,""):this.removeAttribute($.LOOP)}get muted(){var i,e;return(e=(i=this.media)==null?void 0:i.muted)!=null?e:!1}set muted(i){this.media&&(this.media.muted=Boolean(i))}get defaultMuted(){return vt(this,$.MUTED)!=null}set defaultMuted(i){i?this.setAttribute($.MUTED,""):this.removeAttribute($.MUTED)}get playsInline(){return vt(this,$.PLAYSINLINE)!=null}set playsInline(i){X("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(i){["","none","metadata","auto"].includes(i)?this.setAttribute($.PRELOAD,i):this.removeAttribute($.PRELOAD)}};function vt(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}var Ca=La;var oi=new Map;function si(t){if(oi.has(t))return oi.get(t);let i=t.length,e=0,a=0,r=0,n=[];for(let s=0;s<i;s+=1){let l=t[s],c=t[s+1],m=t[s-1];l==="{"&&c==="{"&&m!=="\\"?(r+=1,r===1&&(a=s),s+=1):l==="}"&&c==="}"&&m!=="\\"&&r&&(r-=1,r===0&&(a>e&&(n.push(Object.freeze({type:"string",start:e,end:a,value:t.slice(e,a)})),e=a),n.push(Object.freeze({type:"part",start:a,end:s+2,value:t.slice(e+2,s).trim()})),s+=1,e=s+1))}return e<i&&n.push(Object.freeze({type:"string",start:e,end:i,value:t.slice(e,i)})),oi.set(t,Object.freeze(n)),oi.get(t)}var we=new WeakMap,xn=new WeakMap,q=class{constructor(i,e){this.expression=e,we.set(this,i),i.updateParent("")}get attributeName(){return we.get(this).attr.name}get attributeNamespace(){return we.get(this).attr.namespaceURI}get value(){return xn.get(this)}set value(i){xn.set(this,i||""),we.get(this).updateParent(i)}get element(){return we.get(this).element}get booleanValue(){return we.get(this).booleanValue}set booleanValue(i){we.get(this).booleanValue=i}},At=class{constructor(i,e){this.element=i,this.attr=e,this.partList=[]}get booleanValue(){return this.element.hasAttributeNS(this.attr.namespaceURI,this.attr.name)}set booleanValue(i){if(this.partList.length!==1)throw new DOMException("Operation not supported","NotSupportedError");this.partList[0].value=i?"":null}append(i){this.partList.push(i)}updateParent(i){if(this.partList.length===1&&i===null)this.element.removeAttributeNS(this.attr.namespaceURI,this.attr.name);else{let e=this.partList.map(a=>typeof a=="string"?a:a.value).join("");this.element.setAttributeNS(this.attr.namespaceURI,this.attr.name,e)}}};var fe=new WeakMap,J=class{constructor(i,e){this.expression=e,fe.set(this,[i]),i.textContent=""}get value(){return fe.get(this).map(i=>i.textContent).join("")}set value(i){this.replace(i)}get previousSibling(){return fe.get(this)[0].previousSibling}get nextSibling(){return fe.get(this)[fe.get(this).length-1].nextSibling}replace(...i){let e=i.map(a=>typeof a=="string"?new Text(a):a);e.length||e.push(new Text("")),fe.get(this)[0].before(...e);for(let a of fe.get(this))a.remove();fe.set(this,e)}};function _t(t){return{processCallback(i,e,a){var r;if(!(typeof a!="object"||!a)){for(let n of e)if(n.expression in a){let s=(r=a[n.expression])!==null&&r!==void 0?r:"";t(n,s)}}}}}function wa(t,i){t.value=String(i)}function Rn(t,i){return typeof i=="boolean"&&t instanceof q&&typeof t.element[t.attributeName]=="boolean"?(t.booleanValue=i,!0):!1}var Da=_t(wa),dl=_t((t,i)=>{Rn(t,i)||wa(t,i)});function*cl(t){let i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null,!1),e;for(;e=i.nextNode();)if(e instanceof Element&&e.hasAttributes())for(let a=0;a<e.attributes.length;a+=1){let r=e.attributes.item(a);if(r&&r.value.includes("{{")){let n=new At(e,r);for(let s of si(r.value))if(s.type==="string")n.append(s.value);else{let l=new q(n,s.value);n.append(l),yield l}}}else if(e instanceof Text&&e.textContent&&e.textContent.includes("{{")){let a=si(e.textContent);for(let r=0;r<a.length;r+=1){let n=a[r];n.end<e.textContent.length&&e.splitText(n.end),n.type==="part"&&(yield new J(e,n.value));break}}}var li=new WeakMap,di=new WeakMap,le=class extends DocumentFragment{constructor(i,e,a=Da){var r,n;super(),Object.getPrototypeOf(this)!==le.prototype&&Object.setPrototypeOf(this,le.prototype),this.appendChild(i.content.cloneNode(!0)),di.set(this,Array.from(cl(this))),li.set(this,a),(n=(r=li.get(this)).createCallback)===null||n===void 0||n.call(r,this,di.get(this),e),li.get(this).processCallback(this,di.get(this),e)}update(i){li.get(this).processCallback(this,di.get(this),i)}};var yt=new WeakMap,Tt=class{constructor(i,e){this.element=i;this.type=e;this.element.addEventListener(this.type,this);let a=yt.get(this.element);a&&a.set(this.type,this)}set(i){if(typeof i=="function")this.handleEvent=i.bind(this.element);else if(typeof i=="object"&&typeof i.handleEvent=="function")this.handleEvent=i.handleEvent.bind(i);else{this.element.removeEventListener(this.type,this);let e=yt.get(this.element);e&&e.delete(this.type)}}static for(i){yt.has(i.element)||yt.set(i.element,new Map);let e=i.attributeName.slice(2),a=yt.get(i.element);return a&&a.has(e)?a.get(e):new Tt(i.element,e)}};function ul(t,i){return t instanceof q&&t.attributeName.startsWith("on")?(Tt.for(t).set(i),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function ml(t,i){return i instanceof It&&t instanceof J?(i.renderInto(t),!0):!1}function hl(t,i){return i instanceof DocumentFragment&&t instanceof J?(i.childNodes.length&&t.replace(...i.childNodes),!0):!1}function pl(t,i){if(t instanceof q){let e=t.attributeNamespace,a=t.element.getAttributeNS(e,t.attributeName);return String(i)!==a&&(t.value=String(i)),!0}return t.value=String(i),!0}function bl(t,i){if(typeof i=="boolean"&&t instanceof q){let e=t.attributeNamespace,a=t.element.hasAttributeNS(e,t.attributeName);return i!==a&&(t.booleanValue=i),!0}return!1}function El(t,i){return i===!1&&t instanceof J?(t.replace(""),!0):!1}function fl(t,i){bl(t,i)||ul(t,i)||El(t,i)||ml(t,i)||hl(t,i)||pl(t,i)}var xa=new WeakMap,Pn=new WeakMap,Un=new WeakMap,It=class{constructor(i,e,a){this.strings=i;this.values=e;this.processor=a}get template(){if(xa.has(this.strings))return xa.get(this.strings);{let i=document.createElement("template"),e=this.strings.length-1;return i.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<e?`{{ ${n} }}`:""),""),xa.set(this.strings,i),i}}renderInto(i){let e=this.template;if(Pn.get(i)!==e){Pn.set(i,e);let r=new le(e,this.values,this.processor);Un.set(i,r),i instanceof J?i.replace(...r.children):i.appendChild(r);return}let a=Un.get(i);a&&a.update(this.values)}},On=new Map,gl=_t(fl);function f(t,...i){let e=[""],a=[],r,n=!1,s=(l,c=[])=>{e[e.length-1]=e[e.length-1]+l[0],c.forEach((m,E)=>{(r=m==null?void 0:m.$static$)!==void 0?(r.forEach(y=>{s(y.strings,y.values)}),e[e.length-1]=e[e.length-1]+l[E+1],n=!0):(a.push(m),e.push(l[E+1]))})};if(s(t,i),n){let l=e.join("$$html$$");t=On.get(l),t===void 0&&(e.raw=e,On.set(l,t=e)),i=a}return new It(t,i,gl)}function ci(t,i){t.renderInto(i)}function R(t,i){let e=document.createElement("template");return e.innerHTML=t,new le(e,i)}var Ra=(...t)=>({$static$:t.map(i=>i instanceof It?i:/\w-/.test(i)?{strings:[i]}:{strings:[]})});var $n=`
|
|
727
727
|
:host {
|
|
728
728
|
cursor: pointer;
|
|
729
729
|
}
|
|
730
730
|
media-time-display {
|
|
731
731
|
color: inherit;
|
|
732
732
|
}
|
|
733
|
-
`,
|
|
733
|
+
`,Bn=G.createElement("template");Bn.innerHTML=`
|
|
734
734
|
<style>
|
|
735
|
-
${
|
|
735
|
+
${$n}
|
|
736
736
|
</style>
|
|
737
737
|
<media-time-display show-duration></media-time-display>
|
|
738
|
-
`;var
|
|
738
|
+
`;var Nn=["Enter"," "],Mt,Qe,ui,Ze=class extends M.HTMLElement{constructor(){var e,a;super();T(this,Qe);T(this,Mt,void 0);this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(a=this.shadowRoot)==null?void 0:a.querySelector("media-time-display")}static get observedAttributes(){return["hide-duration","remaining","disabled","aria-disabled"]}toggleTimeDisplay(){var e,a,r;(e=this.timeDisplayEl)!=null&&e.hasAttribute("remaining")?(a=this.timeDisplayEl)==null||a.removeAttribute("remaining"):(r=this.timeDisplayEl)==null||r.setAttribute("remaining","")}connectedCallback(){let e=a=>{let{key:r}=a;if(!Nn.includes(r)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!Nn.includes(s)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),B(this,Mt,setInterval(I(this,Qe,ui).bind(this),200)),requestAnimationFrame(()=>I(this,Qe,ui).call(this))}disconnectedCallback(){clearInterval(v(this,Mt))}attributeChangedCallback(e,a,r){var n,s;e==="hide-duration"&&I(this,Qe,ui).call(this),["remaining","disabled","aria-disabled"].includes(e)&&a!==r&&(r==null?(n=this.timeDisplayEl)==null||n.removeAttribute(e):(s=this.timeDisplayEl)==null||s.setAttribute(e,r))}};Mt=new WeakMap,Qe=new WeakSet,ui=function(){var a,r,n,s;getComputedStyle(this).getPropertyValue("--media-duration-display").trim()==="none"||this.getAttribute("hide-duration")!=null?(a=this.timeDisplayEl)!=null&&a.hasAttribute("show-duration")&&((r=this.timeDisplayEl)==null||r.removeAttribute("show-duration")):(n=this.timeDisplayEl)!=null&&n.hasAttribute("show-duration")||(s=this.timeDisplayEl)==null||s.setAttribute("show-duration","")},Ze.styles=$n,Ze.template=Bn;M.customElements.get("mxp-time-display")||(M.customElements.define("mxp-time-display",Ze),M.MxpTimeDisplay=Ze);var Vn=`:host(:not([audio])) {
|
|
739
739
|
--secondary-color: transparent;
|
|
740
740
|
}
|
|
741
741
|
|
|
@@ -961,46 +961,46 @@ media-time-display {
|
|
|
961
961
|
flex-grow: 1;
|
|
962
962
|
font-size: 21px;
|
|
963
963
|
}
|
|
964
|
-
`;var
|
|
964
|
+
`;var Hn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
|
|
965
965
|
<path d="M13.19 14.22a.25.25 0 0 0-.38 0l-5.46 6.37a.25.25 0 0 0 .19.41h10.92a.25.25 0 0 0 .19-.41l-5.46-6.37Z"/>
|
|
966
966
|
<path d="M22 3H4a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h2.94L8 16.75H4.25V4.25h17.5v12.5H18L19.06 18H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
|
|
967
967
|
</svg>
|
|
968
|
-
`;var
|
|
968
|
+
`;var Wn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
|
|
969
969
|
<path d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-1.81-.12-4.67-.18-7.53-.18-2.86 0-5.72.06-7.53.18a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c1.81.12 4.67.18 7.53.18 2.86 0 5.72-.06 7.53-.18a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.137-.21-8.283 0-12.42a1.11 1.11 0 0 1 .91-1.11c1.67-.11 4.43-.18 7.43-.18s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.137.21 8.283 0 12.42ZM10.843 14a1.55 1.55 0 0 1-.76.18 1.57 1.57 0 0 1-.71-.18 1.69 1.69 0 0 1-.57-.42 2.099 2.099 0 0 1-.38-.58 2.47 2.47 0 0 1 0-1.64 2 2 0 0 1 .39-.66 1.73 1.73 0 0 1 .58-.42c.23-.103.479-.158.73-.16.241-.004.48.044.7.14.199.088.373.222.51.39l1.08-.89a2.179 2.179 0 0 0-.47-.44 2.81 2.81 0 0 0-.54-.32 2.91 2.91 0 0 0-.58-.15 2.71 2.71 0 0 0-.56 0 4.08 4.08 0 0 0-1.38.15 3.27 3.27 0 0 0-1.09.67 3.14 3.14 0 0 0-.71 1.06 3.62 3.62 0 0 0-.26 1.39 3.57 3.57 0 0 0 .26 1.38 3 3 0 0 0 .71 1.06c.316.293.687.52 1.09.67.443.16.91.238 1.38.23a3.2 3.2 0 0 0 1.28-.27c.401-.183.747-.47 1-.83l-1.17-.88a1.42 1.42 0 0 1-.53.52Zm6.62 0a1.58 1.58 0 0 1-.76.18 1.54 1.54 0 0 1-.7-.18 1.69 1.69 0 0 1-.57-.42 2.12 2.12 0 0 1-.43-.58 2.29 2.29 0 0 1 .39-2.3 1.84 1.84 0 0 1 1.32-.58c.241-.003.48.045.7.14.199.088.373.222.51.39l1.08-.92a2.43 2.43 0 0 0-.47-.44 3.22 3.22 0 0 0-.53-.29 2.999 2.999 0 0 0-.57-.15 2.87 2.87 0 0 0-.57 0 4.06 4.06 0 0 0-1.36.15 3.17 3.17 0 0 0-1.09.67 3 3 0 0 0-.72 1.06 3.62 3.62 0 0 0-.25 1.39 3.57 3.57 0 0 0 .25 1.38c.16.402.405.764.72 1.06a3.17 3.17 0 0 0 1.09.67c.44.16.904.237 1.37.23.441 0 .877-.092 1.28-.27a2.45 2.45 0 0 0 1-.83l-1.15-.85a1.49 1.49 0 0 1-.54.49Z"/>
|
|
970
970
|
</svg>
|
|
971
|
-
`;var
|
|
971
|
+
`;var Fn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
|
|
972
972
|
<path d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.41 10.1a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 4 4 0 0 1-1.28-.83 3.67 3.67 0 0 1-.84-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.53 3.53 0 0 1 .84-1.21 3.89 3.89 0 0 1 1.29-.8 4.76 4.76 0 0 1 1.63-.27 4.06 4.06 0 0 1 1.35.24c.225.091.44.205.64.34a2.7 2.7 0 0 1 .55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.35 2.35 0 0 0-.46.77 2.78 2.78 0 0 0-.16 1c-.009.34.046.68.16 1 .104.283.26.545.46.77.188.21.415.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.88 2.88 0 0 1-1.22 1.01Zm7.52 0a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 3.89 3.89 0 0 1-1.28-.83 3.55 3.55 0 0 1-.85-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.43 3.43 0 0 1 .85-1.25 3.75 3.75 0 0 1 1.28-.8 4.76 4.76 0 0 1 1.63-.27 4 4 0 0 1 1.35.24c.225.091.44.205.64.34.21.144.395.32.55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.352 2.352 0 0 0-.46.77 3.01 3.01 0 0 0-.16 1c-.003.34.05.678.16 1 .108.282.263.542.46.77.188.21.416.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.82 2.82 0 0 1-1.21 1.05Z"/>
|
|
973
973
|
</svg>
|
|
974
|
-
`;var
|
|
974
|
+
`;var Kn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
|
|
975
975
|
<path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z"/>
|
|
976
976
|
<path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
|
|
977
977
|
<path d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
|
|
978
978
|
</svg>
|
|
979
|
-
`;var
|
|
979
|
+
`;var Yn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
|
|
980
980
|
<path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z"/>
|
|
981
981
|
<path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
|
|
982
982
|
<path d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
|
|
983
983
|
<path d="M20.5 5.5h-15v5.811c3.52.906 6.283 3.67 7.189 7.19H20.5V5.5Z"/>
|
|
984
984
|
</svg>
|
|
985
|
-
`;var
|
|
985
|
+
`;var Gn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
|
|
986
986
|
<path d="M20.25 14.5a.76.76 0 0 0-.75.75v4.25h-4.25a.75.75 0 1 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5a.76.76 0 0 0-.75-.75Zm0-11.5h-5a.76.76 0 0 0-.75.75.76.76 0 0 0 .75.75h4.25v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75ZM8.75 19.5H4.5v-4.25a.76.76 0 0 0-.75-.75.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75h5a.75.75 0 1 0 0-1.5Zm0-16.5h-5a.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75.76.76 0 0 0 .75-.75V4.5h4.25a.76.76 0 0 0 .75-.75.76.76 0 0 0-.75-.75Z"/>
|
|
987
987
|
</svg>
|
|
988
|
-
`;var
|
|
988
|
+
`;var Zn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
|
|
989
989
|
<path d="M20.25 14.5h-5a.76.76 0 0 0-.75.75v5a.75.75 0 1 0 1.5 0V16h4.25a.75.75 0 1 0 0-1.5Zm-5-5h5a.75.75 0 1 0 0-1.5H16V3.75a.75.75 0 1 0-1.5 0v5a.76.76 0 0 0 .75.75Zm-6.5 5h-5a.75.75 0 1 0 0 1.5H8v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75Zm0-11.5a.76.76 0 0 0-.75.75V8H3.75a.75.75 0 0 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5A.76.76 0 0 0 8.75 3Z"/>
|
|
990
990
|
</svg>
|
|
991
|
-
`;var
|
|
991
|
+
`;var Qn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
|
|
992
992
|
<path d="M6 19.5a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v15ZM14.5 4a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3Z"/>
|
|
993
993
|
</svg>
|
|
994
|
-
`;var
|
|
994
|
+
`;var qn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
|
|
995
995
|
<path d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"/>
|
|
996
996
|
</svg>
|
|
997
|
-
`;var
|
|
997
|
+
`;var zn=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
|
|
998
998
|
<path d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"/>
|
|
999
999
|
</svg>
|
|
1000
|
-
`;var
|
|
1000
|
+
`;var jn=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
|
|
1001
1001
|
<path d="m6.73 20.93 14.05-8.54a.46.46 0 0 0 0-.78L6.73 3.07a.48.48 0 0 0-.73.39v17.07a.48.48 0 0 0 .73.4Z"/>
|
|
1002
1002
|
</svg>
|
|
1003
|
-
`;var
|
|
1003
|
+
`;var Xn=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
|
|
1004
1004
|
<path d="M11 6V3L5.37 7 11 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 11 6Z"/>
|
|
1005
1005
|
<text
|
|
1006
1006
|
class="value"
|
|
@@ -1010,7 +1010,7 @@ media-time-display {
|
|
|
1010
1010
|
{{value}}
|
|
1011
1011
|
</text>
|
|
1012
1012
|
</svg>
|
|
1013
|
-
`;var
|
|
1013
|
+
`;var Jn=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
|
|
1014
1014
|
<path d="M11 6V3l5.61 4L11 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 11 6Z"/>
|
|
1015
1015
|
<text
|
|
1016
1016
|
class="value"
|
|
@@ -1020,21 +1020,21 @@ media-time-display {
|
|
|
1020
1020
|
{{value}}
|
|
1021
1021
|
</text>
|
|
1022
1022
|
</svg>
|
|
1023
|
-
`;var
|
|
1023
|
+
`;var eo=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
|
|
1024
1024
|
<path d="m11.14 4.86-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.21a.5.5 0 0 0-.86-.35Zm2.74-1.56v1.52A7.52 7.52 0 0 1 19.47 12a7.52 7.52 0 0 1-5.59 7.18v1.52A9 9 0 0 0 21 12a9 9 0 0 0-7.12-8.7Zm3.56 8.7a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
|
|
1025
1025
|
</svg>
|
|
1026
|
-
`;var
|
|
1026
|
+
`;var to=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
|
|
1027
1027
|
<path d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
|
|
1028
1028
|
</svg>
|
|
1029
|
-
`;var
|
|
1029
|
+
`;var io=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
|
|
1030
1030
|
<path d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
|
|
1031
1031
|
</svg>
|
|
1032
|
-
`;var
|
|
1032
|
+
`;var ao=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
|
|
1033
1033
|
<path d="m3 4.05 4.48 4.47-.33.33a.49.49 0 0 1-.36.15H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.48.48 0 0 0 .36.15.5.5 0 0 0 .5-.5v-5.75l4.67 4.66a7.71 7.71 0 0 1-2.79 1.47v1.52a9.32 9.32 0 0 0 3.87-1.91L20 21l1-1L4.06 3 3 4.05Zm5.36 5.36 2.39 2.39V17L8 14.26a1.74 1.74 0 0 0-1.24-.51H4.25v-3.5h2.54A1.74 1.74 0 0 0 8 9.74l.36-.33ZM19.47 12a7.19 7.19 0 0 1-.89 3.47l1.11 1.1A8.64 8.64 0 0 0 21 12a9 9 0 0 0-7.12-8.7v1.52A7.52 7.52 0 0 1 19.47 12ZM12 8.88V5.21a.5.5 0 0 0-.5-.5.48.48 0 0 0-.36.15L9.56 6.44 12 8.88ZM15.91 12a4.284 4.284 0 0 1-.07.72l1.22 1.22a5.2 5.2 0 0 0 .38-1.94 5.49 5.49 0 0 0-3.56-5.1v1.66A4 4 0 0 1 15.91 12Z"/>
|
|
1034
1034
|
</svg>
|
|
1035
|
-
`;var
|
|
1035
|
+
`;var ro=()=>R(Hn),no=()=>R(Wn),oo=()=>R(Fn),so=()=>R(Kn),lo=()=>R(Yn),co=()=>R(Gn),uo=()=>R(Zn),mo=()=>R(Qn),ho=()=>R(qn),po=()=>R(zn),bo=()=>R(jn),Eo=t=>R(Xn,t),fo=t=>R(Jn,t),go=()=>R(eo),vo=()=>R(to),Ao=()=>R(io),_o=()=>R(ao);var H=require("@mux/playback-core");var de={LG:"large",SM:"small",XS:"extra-small"},hi,yo,mi=class extends va{constructor(){super();T(this,hi);I(this,hi,yo).call(this)}static get observedAttributes(){return["audio","has-open-dialog","has-src","nohotkeys","hotkeys","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset","playbackrates","default-show-remaining-time","poster","placeholder","title"]}attributeChangedCallback(){this.render()}render(){var a,r,n;let e={hasSrc:this.hasAttribute("has-src"),isDialogOpen:this.hasAttribute("has-open-dialog"),audio:this.hasAttribute("audio"),nohotkeys:this.hasAttribute("nohotkeys"),hotkeys:this.getAttribute("hotkeys"),streamType:this.getAttribute("stream-type"),playerSize:this.getAttribute("player-size"),defaultHiddenCaptions:this.hasAttribute("default-hidden-captions"),forwardSeekOffset:this.getAttribute("forward-seek-offset"),backwardSeekOffset:this.getAttribute("backward-seek-offset"),playbackRates:this.getAttribute("playbackrates"),defaultShowRemainingTime:this.hasAttribute("default-show-remaining-time"),poster:this.getAttribute("poster"),placeholder:this.getAttribute("placeholder"),title:this.getAttribute("title")};e.nohotkeys=e.nohotkeys||!e.hasSrc||e.isDialogOpen,[H.StreamTypes.LIVE,H.StreamTypes.LL_LIVE,H.StreamTypes.DVR,H.StreamTypes.LL_DVR].includes(e.streamType)&&(e.hotkeys=e.hotkeys||"",e.hotkeys+=" noarrowleft noarrowright"),ci(f`
|
|
1036
1036
|
<style>
|
|
1037
|
-
${
|
|
1037
|
+
${Vn}
|
|
1038
1038
|
</style>
|
|
1039
1039
|
<media-controller
|
|
1040
1040
|
gestures-disabled="${!e.hasSrc||e.isDialogOpen}"
|
|
@@ -1052,83 +1052,83 @@ media-time-display {
|
|
|
1052
1052
|
placeholder-src="${(r=e.placeholder)!=null?r:!1}"
|
|
1053
1053
|
></media-poster-image>
|
|
1054
1054
|
<media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
|
|
1055
|
-
${
|
|
1055
|
+
${$l(e)}
|
|
1056
1056
|
<slot></slot>
|
|
1057
1057
|
</media-controller>
|
|
1058
|
-
`,this.shadowRoot),(n=this.shadowRoot)==null||n.querySelectorAll("*").forEach(s=>{if(!s.localName.includes("-"))return;let l=s.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!l)return;let[,,c,m]=l;c==="text"&&s.classList.contains("title-display")&&(c="title");let E=s.closest('[slot="top-chrome"]')?"top":s.closest('[slot="centered-chrome"]')?"center":"bottom";s.setAttribute("part",`${E} ${c} ${m}`)})}};
|
|
1058
|
+
`,this.shadowRoot),(n=this.shadowRoot)==null||n.querySelectorAll("*").forEach(s=>{if(!s.localName.includes("-"))return;let l=s.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!l)return;let[,,c,m]=l;c==="text"&&s.classList.contains("title-display")&&(c="title");let E=s.closest('[slot="top-chrome"]')?"top":s.closest('[slot="centered-chrome"]')?"center":"bottom";s.setAttribute("part",`${E} ${c} ${m}`)})}};hi=new WeakSet,yo=function(){var e,a;try{(e=window==null?void 0:window.CSS)==null||e.registerProperty({name:"--primary-color",syntax:"<color>",inherits:!0,initialValue:"white"}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--secondary-color",syntax:"<color>",inherits:!0,initialValue:"transparent"})}catch{}};M.customElements.get("media-theme-mux")||M.customElements.define("media-theme-mux",mi);var $l=t=>{let{streamType:i,playerSize:e,audio:a}=t;if(a)switch(i){case H.StreamTypes.LIVE:case H.StreamTypes.LL_LIVE:return Hl(t);case H.StreamTypes.DVR:case H.StreamTypes.LL_DVR:return Vl(t);case H.StreamTypes.ON_DEMAND:default:return Bl(t)}switch(i){case H.StreamTypes.LIVE:case H.StreamTypes.LL_LIVE:switch(e){case de.LG:return Gl(t);case de.SM:return Yl(t);case de.XS:return Kl(t)}case H.StreamTypes.DVR:case H.StreamTypes.LL_DVR:switch(e){case de.LG:return ql(t);case de.SM:return Ql(t);case de.XS:return Zl(t)}case H.StreamTypes.ON_DEMAND:default:switch(e){case de.LG:return Fl(t);case de.SM:return Wl(t);case de.XS:return Pa(t)}}},K=t=>f`
|
|
1059
1059
|
<media-play-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
|
|
1060
|
+
${bo()}
|
|
1060
1061
|
${mo()}
|
|
1061
|
-
|
|
1062
|
-
</media-play-button>`,Qe=({backwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>f`
|
|
1062
|
+
</media-play-button>`,qe=({backwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>f`
|
|
1063
1063
|
<media-seek-backward-button seek-offset="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
|
|
1064
|
-
${
|
|
1065
|
-
</media-seek-backward-button>`,
|
|
1064
|
+
${Eo({value:t})}
|
|
1065
|
+
</media-seek-backward-button>`,ze=({forwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>f`
|
|
1066
1066
|
<media-seek-forward-button seek-offset="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
|
|
1067
|
-
${
|
|
1067
|
+
${fo({value:t})}
|
|
1068
1068
|
</media-seek-forward-button>`,ee=({isDialogOpen:t})=>f`
|
|
1069
1069
|
<media-mute-button disabled="${t}" aria-disabled="${t&&"true"}">
|
|
1070
|
-
${bo()}
|
|
1071
|
-
${fo()}
|
|
1072
|
-
${Eo()}
|
|
1073
1070
|
${go()}
|
|
1074
|
-
|
|
1071
|
+
${Ao()}
|
|
1072
|
+
${vo()}
|
|
1073
|
+
${_o()}
|
|
1074
|
+
</media-mute-button>`,De=({defaultHiddenCaptions:t,isDialogOpen:i})=>f`
|
|
1075
1075
|
<media-captions-button default-showing="${!t}" disabled="${i}" aria-disabled="${i&&"true"}">
|
|
1076
|
-
${
|
|
1077
|
-
${
|
|
1076
|
+
${no()}
|
|
1077
|
+
${oo()}
|
|
1078
1078
|
</media-captions-button>`,te=t=>f`
|
|
1079
1079
|
<media-airplay-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
|
|
1080
|
-
${
|
|
1081
|
-
</media-airplay-button>`,
|
|
1080
|
+
${ro()}
|
|
1081
|
+
</media-airplay-button>`,xe=t=>f`
|
|
1082
1082
|
<media-pip-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
|
|
1083
|
+
${ho()}
|
|
1084
|
+
${po()}
|
|
1085
|
+
</media-pip-button>`,Re=t=>f`
|
|
1086
|
+
<media-fullscreen-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
|
|
1083
1087
|
${co()}
|
|
1084
1088
|
${uo()}
|
|
1085
|
-
</media-pip-button>`,De=t=>f`
|
|
1086
|
-
<media-fullscreen-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
|
|
1087
|
-
${oo()}
|
|
1088
|
-
${so()}
|
|
1089
1089
|
</media-fullscreen-button>`,ie=t=>f`
|
|
1090
1090
|
<media-cast-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
|
|
1091
|
-
${
|
|
1092
|
-
${
|
|
1093
|
-
</media-cast-button>`,
|
|
1091
|
+
${so()}
|
|
1092
|
+
${lo()}
|
|
1093
|
+
</media-cast-button>`,pi=({playbackRates:t,isDialogOpen:i})=>f`
|
|
1094
1094
|
<media-playback-rate-button rates="${t!=null?t:!1}" disabled="${i}" aria-disabled="${i&&"true"}">
|
|
1095
1095
|
</media-playback-rate-button>`,ce=({isDialogOpen:t})=>f`
|
|
1096
1096
|
<media-volume-range disabled="${t}" aria-disabled="${t&&"true"}">
|
|
1097
|
-
</media-volume-range>`,
|
|
1097
|
+
</media-volume-range>`,je=t=>f`
|
|
1098
1098
|
<media-time-range disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
|
|
1099
|
-
</media-time-range>`,
|
|
1099
|
+
</media-time-range>`,bi=({defaultShowRemainingTime:t,hasSrc:i,isDialogOpen:e})=>f`
|
|
1100
1100
|
<mxp-time-display remaining="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
|
|
1101
1101
|
</mxp-time-display>`,ue=({title:t})=>f`
|
|
1102
|
-
<media-text-display part="title" class="title-display">${t}</media-text-display>`,
|
|
1102
|
+
<media-text-display part="title" class="title-display">${t}</media-text-display>`,Bl=t=>f`
|
|
1103
1103
|
${t.title?`<media-control-bar>${ue(t)}</media-control-bar>`:f``}
|
|
1104
1104
|
<media-control-bar>
|
|
1105
1105
|
${K(t)}
|
|
1106
|
-
${Qe(t)}
|
|
1107
1106
|
${qe(t)}
|
|
1108
|
-
${pi(t)}
|
|
1109
1107
|
${ze(t)}
|
|
1108
|
+
${bi(t)}
|
|
1109
|
+
${je(t)}
|
|
1110
1110
|
${ee(t)}
|
|
1111
1111
|
${ce(t)}
|
|
1112
|
-
${
|
|
1112
|
+
${pi(t)}
|
|
1113
1113
|
${te(t)}
|
|
1114
1114
|
${ie(t)}
|
|
1115
1115
|
</media-control-bar>
|
|
1116
|
-
|
|
1116
|
+
`,Vl=t=>f`
|
|
1117
1117
|
${t.title?`<media-control-bar>${ue(t)}</media-control-bar>`:f``}
|
|
1118
1118
|
<media-control-bar>
|
|
1119
1119
|
${K(t)}
|
|
1120
1120
|
<slot name="seek-live"></slot>
|
|
1121
|
-
${Qe(t)}
|
|
1122
1121
|
${qe(t)}
|
|
1123
|
-
${pi(t)}
|
|
1124
1122
|
${ze(t)}
|
|
1123
|
+
${bi(t)}
|
|
1124
|
+
${je(t)}
|
|
1125
1125
|
${ee(t)}
|
|
1126
1126
|
${ce(t)}
|
|
1127
|
-
${
|
|
1127
|
+
${pi(t)}
|
|
1128
1128
|
${te(t)}
|
|
1129
1129
|
${ie(t)}
|
|
1130
1130
|
</media-control-bar>
|
|
1131
|
-
`,
|
|
1131
|
+
`,Hl=t=>f`
|
|
1132
1132
|
${t.title?`<media-control-bar>${ue(t)}</media-control-bar>`:f``}
|
|
1133
1133
|
<media-control-bar>
|
|
1134
1134
|
${K(t)}
|
|
@@ -1140,11 +1140,11 @@ media-time-display {
|
|
|
1140
1140
|
</media-control-bar>
|
|
1141
1141
|
`,Pa=t=>f`
|
|
1142
1142
|
<media-control-bar slot="top-chrome">
|
|
1143
|
-
${
|
|
1143
|
+
${De(t)}
|
|
1144
1144
|
<div class="spacer"></div>
|
|
1145
1145
|
${te(t)}
|
|
1146
1146
|
${ie(t)}
|
|
1147
|
-
${
|
|
1147
|
+
${xe(t)}
|
|
1148
1148
|
</media-control-bar>
|
|
1149
1149
|
<div slot="centered-chrome" class="center-controls">
|
|
1150
1150
|
${K(t)}
|
|
@@ -1152,64 +1152,64 @@ media-time-display {
|
|
|
1152
1152
|
<media-control-bar>
|
|
1153
1153
|
${ee(t)}
|
|
1154
1154
|
<div class="spacer"></div>
|
|
1155
|
-
${
|
|
1155
|
+
${Re(t)}
|
|
1156
1156
|
</media-control-bar>
|
|
1157
|
-
`,
|
|
1157
|
+
`,Wl=t=>f`
|
|
1158
1158
|
<media-control-bar slot="top-chrome">
|
|
1159
1159
|
${t.title?ue(t):f``}
|
|
1160
1160
|
<div class="spacer"></div>
|
|
1161
|
-
${
|
|
1161
|
+
${De(t)}
|
|
1162
1162
|
${te(t)}
|
|
1163
1163
|
${ie(t)}
|
|
1164
|
-
${
|
|
1164
|
+
${xe(t)}
|
|
1165
1165
|
</media-control-bar>
|
|
1166
1166
|
<div slot="centered-chrome" class="center-controls">
|
|
1167
|
-
${Qe(t)}
|
|
1168
|
-
${K(t)}
|
|
1169
1167
|
${qe(t)}
|
|
1168
|
+
${K(t)}
|
|
1169
|
+
${ze(t)}
|
|
1170
1170
|
</div>
|
|
1171
|
-
${
|
|
1171
|
+
${je(t)}
|
|
1172
1172
|
<media-control-bar>
|
|
1173
|
-
${
|
|
1173
|
+
${bi(t)}
|
|
1174
1174
|
${ee(t)}
|
|
1175
1175
|
${ce(t)}
|
|
1176
1176
|
<div class="spacer"></div>
|
|
1177
|
-
${
|
|
1178
|
-
${
|
|
1177
|
+
${pi(t)}
|
|
1178
|
+
${Re(t)}
|
|
1179
1179
|
<div class="padding-2"></div>
|
|
1180
1180
|
</media-control-bar>
|
|
1181
|
-
`,
|
|
1181
|
+
`,Fl=t=>f`
|
|
1182
1182
|
<media-control-bar slot="top-chrome">
|
|
1183
1183
|
${t.title?ue(t):f``}
|
|
1184
1184
|
</media-control-bar>
|
|
1185
1185
|
<div slot="centered-chrome" class="center-controls">
|
|
1186
1186
|
${K(t)}
|
|
1187
1187
|
</div>
|
|
1188
|
-
${
|
|
1188
|
+
${je(t)}
|
|
1189
1189
|
<media-control-bar>
|
|
1190
1190
|
${K(t)}
|
|
1191
|
-
${Qe(t)}
|
|
1192
1191
|
${qe(t)}
|
|
1193
|
-
${
|
|
1192
|
+
${ze(t)}
|
|
1193
|
+
${bi(t)}
|
|
1194
1194
|
${ee(t)}
|
|
1195
1195
|
${ce(t)}
|
|
1196
1196
|
<div class="spacer"></div>
|
|
1197
|
-
${
|
|
1198
|
-
${
|
|
1197
|
+
${pi(t)}
|
|
1198
|
+
${De(t)}
|
|
1199
1199
|
${te(t)}
|
|
1200
1200
|
${ie(t)}
|
|
1201
|
-
${
|
|
1202
|
-
${
|
|
1201
|
+
${xe(t)}
|
|
1202
|
+
${Re(t)}
|
|
1203
1203
|
<div class="padding-2"></div>
|
|
1204
1204
|
</media-control-bar>
|
|
1205
|
-
`,
|
|
1205
|
+
`,Kl=Pa,Yl=t=>f`
|
|
1206
1206
|
<media-control-bar slot="top-chrome">
|
|
1207
1207
|
${t.title?ue(t):f``}
|
|
1208
1208
|
<div class="spacer"></div>
|
|
1209
|
-
${
|
|
1209
|
+
${De(t)}
|
|
1210
1210
|
${te(t)}
|
|
1211
1211
|
${ie(t)}
|
|
1212
|
-
${
|
|
1212
|
+
${xe(t)}
|
|
1213
1213
|
</media-control-bar>
|
|
1214
1214
|
<div slot="centered-chrome" class="center-controls">
|
|
1215
1215
|
${K(t)}
|
|
@@ -1219,9 +1219,9 @@ media-time-display {
|
|
|
1219
1219
|
${ce(t)}
|
|
1220
1220
|
<slot name="seek-live"></slot>
|
|
1221
1221
|
<div class="spacer"></div>
|
|
1222
|
-
${
|
|
1222
|
+
${Re(t)}
|
|
1223
1223
|
</media-control-bar>
|
|
1224
|
-
`,
|
|
1224
|
+
`,Gl=t=>f`
|
|
1225
1225
|
<media-control-bar slot="top-chrome">
|
|
1226
1226
|
${t.title?ue(t):f``}
|
|
1227
1227
|
</media-control-bar>
|
|
@@ -1233,59 +1233,59 @@ media-time-display {
|
|
|
1233
1233
|
${ce(t)}
|
|
1234
1234
|
<slot name="seek-live"></slot>
|
|
1235
1235
|
<div class="spacer"></div>
|
|
1236
|
-
${
|
|
1236
|
+
${De(t)}
|
|
1237
1237
|
${te(t)}
|
|
1238
1238
|
${ie(t)}
|
|
1239
|
-
${
|
|
1240
|
-
${
|
|
1239
|
+
${xe(t)}
|
|
1240
|
+
${Re(t)}
|
|
1241
1241
|
</media-control-bar>
|
|
1242
|
-
`,
|
|
1242
|
+
`,Zl=Pa,Ql=t=>f`
|
|
1243
1243
|
<media-control-bar slot="top-chrome">
|
|
1244
1244
|
${t.title?ue(t):f``}
|
|
1245
1245
|
<div class="spacer"></div>
|
|
1246
|
-
${
|
|
1246
|
+
${De(t)}
|
|
1247
1247
|
${te(t)}
|
|
1248
1248
|
${ie(t)}
|
|
1249
|
-
${
|
|
1249
|
+
${xe(t)}
|
|
1250
1250
|
</media-control-bar>
|
|
1251
1251
|
<div slot="centered-chrome" class="center-controls">
|
|
1252
|
-
${Qe(t)}
|
|
1253
|
-
${K(t)}
|
|
1254
1252
|
${qe(t)}
|
|
1253
|
+
${K(t)}
|
|
1254
|
+
${ze(t)}
|
|
1255
1255
|
</div>
|
|
1256
|
-
${
|
|
1256
|
+
${je(t)}
|
|
1257
1257
|
<media-control-bar>
|
|
1258
1258
|
${ee(t)}
|
|
1259
1259
|
${ce(t)}
|
|
1260
1260
|
<slot name="seek-live"></slot>
|
|
1261
1261
|
<div class="spacer"></div>
|
|
1262
|
-
${
|
|
1262
|
+
${Re(t)}
|
|
1263
1263
|
<div class="padding-2"></div>
|
|
1264
1264
|
</media-control-bar>
|
|
1265
|
-
`,
|
|
1265
|
+
`,ql=t=>f`
|
|
1266
1266
|
<media-control-bar slot="top-chrome">
|
|
1267
1267
|
${t.title?ue(t):f``}
|
|
1268
1268
|
</media-control-bar>
|
|
1269
1269
|
<div slot="centered-chrome" class="center-controls">
|
|
1270
1270
|
${K(t)}
|
|
1271
1271
|
</div>
|
|
1272
|
-
${
|
|
1272
|
+
${je(t)}
|
|
1273
1273
|
<media-control-bar>
|
|
1274
1274
|
${K(t)}
|
|
1275
|
-
${Qe(t)}
|
|
1276
1275
|
${qe(t)}
|
|
1276
|
+
${ze(t)}
|
|
1277
1277
|
${ee(t)}
|
|
1278
1278
|
${ce(t)}
|
|
1279
1279
|
<slot name="seek-live"></slot>
|
|
1280
1280
|
<div class="spacer"></div>
|
|
1281
|
-
${
|
|
1281
|
+
${De(t)}
|
|
1282
1282
|
${te(t)}
|
|
1283
1283
|
${ie(t)}
|
|
1284
|
-
${
|
|
1285
|
-
${
|
|
1284
|
+
${xe(t)}
|
|
1285
|
+
${Re(t)}
|
|
1286
1286
|
<div class="padding-2"></div>
|
|
1287
1287
|
</media-control-bar>
|
|
1288
|
-
`;var
|
|
1288
|
+
`;var Io=`
|
|
1289
1289
|
:host {
|
|
1290
1290
|
z-index: 100;
|
|
1291
1291
|
display: flex;
|
|
@@ -1337,15 +1337,15 @@ media-time-display {
|
|
|
1337
1337
|
text-align: center;
|
|
1338
1338
|
line-height: 1.4;
|
|
1339
1339
|
}
|
|
1340
|
-
`,
|
|
1340
|
+
`,Mo=G.createElement("template");Mo.innerHTML=`
|
|
1341
1341
|
<style>
|
|
1342
|
-
${
|
|
1342
|
+
${Io}
|
|
1343
1343
|
</style>
|
|
1344
1344
|
|
|
1345
1345
|
<div class="dialog">
|
|
1346
1346
|
<slot></slot>
|
|
1347
1347
|
</div>
|
|
1348
|
-
`;var
|
|
1348
|
+
`;var ge=class extends M.HTMLElement{constructor(){var e;super();this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),To(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),zl(this))}attributeChangedCallback(e,a,r){e==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&To(this)}};ge.styles=Io,ge.template=Mo,ge.observedAttributes=["open"];function To(t){let i=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(t.dispatchEvent(i),i.defaultPrevented)return;let e=t.querySelector("[autofocus]:not([disabled])");!e&&t.tabIndex>=0&&(e=t),e||(e=So(t.shadowRoot)),t._previouslyFocusedElement=G.activeElement,G.activeElement instanceof HTMLElement&&G.activeElement.blur(),t.addEventListener("transitionend",()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},{once:!0})}function So(t){let e=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=t==null?void 0:t.querySelector(e.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(t==null?void 0:t.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=So(r[n].shadowRoot),a));n++);}return a}function zl(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}M.customElements.get("media-dialog")||(M.customElements.define("media-dialog",ge),M.MediaDialog=ge);var Ua=ge;var ko=G.createElement("template");ko.innerHTML=`
|
|
1349
1349
|
<style>
|
|
1350
1350
|
${Ua.styles}
|
|
1351
1351
|
|
|
@@ -1376,7 +1376,7 @@ media-time-display {
|
|
|
1376
1376
|
</svg>
|
|
1377
1377
|
</button>
|
|
1378
1378
|
</slot>
|
|
1379
|
-
`;var
|
|
1379
|
+
`;var St=class extends Ua{constructor(){var i,e;super(),(e=(i=this.shadowRoot)==null?void 0:i.querySelector(".close"))==null||e.addEventListener("click",()=>{this.close()})}};St.template=ko;M.customElements.get("mxp-dialog")||(M.customElements.define("mxp-dialog",St),M.MxpDialog=St);var Lo=`:host {
|
|
1380
1380
|
display: inline-block;
|
|
1381
1381
|
width: 100%;
|
|
1382
1382
|
}
|
|
@@ -1527,30 +1527,30 @@ a {
|
|
|
1527
1527
|
::part(title display) {
|
|
1528
1528
|
display: var(--media-controls, var(--media-title-display));
|
|
1529
1529
|
}
|
|
1530
|
-
`;var
|
|
1530
|
+
`;var Pe=require("@mux/playback-core"),wo=t=>f`
|
|
1531
1531
|
<style>
|
|
1532
|
-
${
|
|
1532
|
+
${Lo}
|
|
1533
1533
|
</style>
|
|
1534
|
-
${
|
|
1535
|
-
`,
|
|
1534
|
+
${Jl(t)}
|
|
1535
|
+
`,Co=t=>[Pe.StreamTypes.LIVE,Pe.StreamTypes.LL_LIVE].includes(t.streamType),Xl=t=>[Pe.StreamTypes.LIVE,Pe.StreamTypes.LL_LIVE,Pe.StreamTypes.DVR,Pe.StreamTypes.LL_DVR].includes(t.streamType),Jl=t=>{var i,e,a,r,n,s,l,c,m,E,y,k,_,O,x,P,C,re,Y,ne,Oe,xt,$a,Ba,Va,Ha,Wa,Fa,Ka,Ya,Ga,Za,Qa,qa,za,ja,Xa,Ja,er,tr,ir,ar,rr;return f`
|
|
1536
1536
|
<${Ra((i=Sa(t.theme))!=null?i:"media-theme-mux")}
|
|
1537
1537
|
has-src="${(e=t.hasSrc)!=null?e:!1}"
|
|
1538
1538
|
has-open-dialog="${(a=t.isDialogOpen)!=null?a:!1}"
|
|
1539
1539
|
nohotkeys="${(r=t.noHotKeys)!=null?r:!1}"
|
|
1540
1540
|
audio="${(n=t.audio)!=null?n:!1}"
|
|
1541
|
-
style="${(s=
|
|
1541
|
+
style="${(s=gn({"--primary-color":t.primaryColor,"--secondary-color":t.secondaryColor}))!=null?s:!1}"
|
|
1542
1542
|
class="size-${t.playerSize}${t.secondaryColor?" two-tone":""}"
|
|
1543
1543
|
stream-type="${(l=t.streamType)!=null?l:!1}"
|
|
1544
1544
|
player-size="${(c=t.playerSize)!=null?c:!1}"
|
|
1545
1545
|
default-hidden-captions="${(m=t.defaultHiddenCaptions)!=null?m:!1}"
|
|
1546
1546
|
forward-seek-offset="${(E=t.forwardSeekOffset)!=null?E:!1}"
|
|
1547
1547
|
backward-seek-offset="${(y=t.backwardSeekOffset)!=null?y:!1}"
|
|
1548
|
-
playbackrates="${(
|
|
1548
|
+
playbackrates="${(k=t.playbackRates)!=null?k:!1}"
|
|
1549
1549
|
default-show-remaining-time="${(_=t.defaultShowRemainingTime)!=null?_:!1}"
|
|
1550
1550
|
title="${(O=t.title)!=null?O:!1}"
|
|
1551
1551
|
hotkeys="${(x=t.hotKeys)!=null?x:!1}"
|
|
1552
1552
|
poster="${t.poster===""?!1:(P=t.poster)!=null?P:!1}"
|
|
1553
|
-
placeholder="${(
|
|
1553
|
+
placeholder="${(C=t.placeholder)!=null?C:!1}"
|
|
1554
1554
|
exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, poster, seek-live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
|
|
1555
1555
|
>
|
|
1556
1556
|
<mux-video
|
|
@@ -1559,60 +1559,57 @@ a {
|
|
|
1559
1559
|
playsinline
|
|
1560
1560
|
autoplay="${(Y=t.autoplay)!=null?Y:!1}"
|
|
1561
1561
|
muted="${(ne=t.muted)!=null?ne:!1}"
|
|
1562
|
-
loop="${(
|
|
1563
|
-
preload="${(
|
|
1562
|
+
loop="${(Oe=t.loop)!=null?Oe:!1}"
|
|
1563
|
+
preload="${(xt=t.preload)!=null?xt:!1}"
|
|
1564
1564
|
debug="${($a=t.debug)!=null?$a:!1}"
|
|
1565
|
-
|
|
1565
|
+
experimental-cmcd="${(Ba=t.experimentalCmcd)!=null?Ba:!1}"
|
|
1566
|
+
disable-cookies="${(Va=t.disableCookies)!=null?Va:!1}"
|
|
1567
|
+
prefer-playback="${(Ha=t.preferPlayback)!=null?Ha:!1}"
|
|
1566
1568
|
start-time="${t.startTime!=null?t.startTime:!1}"
|
|
1567
|
-
metadata-video-id="${(
|
|
1568
|
-
metadata-video-title="${(
|
|
1569
|
-
metadata-viewer-user-id="${(
|
|
1570
|
-
beacon-collection-domain="${(
|
|
1571
|
-
player-software-name="${(
|
|
1572
|
-
player-software-version="${(
|
|
1573
|
-
env-key="${(
|
|
1574
|
-
stream-type="${(
|
|
1575
|
-
custom-domain="${(
|
|
1569
|
+
metadata-video-id="${(Wa=t.metadataVideoId)!=null?Wa:!1}"
|
|
1570
|
+
metadata-video-title="${(Ka=(Fa=t.metadataVideoTitle)!=null?Fa:t.title)!=null?Ka:!1}"
|
|
1571
|
+
metadata-viewer-user-id="${(Ya=t.metadataViewerUserId)!=null?Ya:!1}"
|
|
1572
|
+
beacon-collection-domain="${(Ga=t.beaconCollectionDomain)!=null?Ga:!1}"
|
|
1573
|
+
player-software-name="${(Za=t.playerSoftwareName)!=null?Za:!1}"
|
|
1574
|
+
player-software-version="${(Qa=t.playerSoftwareVersion)!=null?Qa:!1}"
|
|
1575
|
+
env-key="${(qa=t.envKey)!=null?qa:!1}"
|
|
1576
|
+
stream-type="${(za=t.streamType)!=null?za:!1}"
|
|
1577
|
+
custom-domain="${(ja=t.customDomain)!=null?ja:!1}"
|
|
1576
1578
|
src="${t.src?t.src:t.playbackId?Ma(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
|
|
1577
1579
|
cast-src="${t.src?t.src:t.playbackId?Ma(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
|
|
1578
|
-
cast-stream-type="${
|
|
1580
|
+
cast-stream-type="${Co(t)?"live":!1}"
|
|
1579
1581
|
exportparts="video"
|
|
1580
1582
|
>
|
|
1581
|
-
${t.
|
|
1582
|
-
label="thumbnails"
|
|
1583
|
-
default
|
|
1584
|
-
kind="metadata"
|
|
1585
|
-
src="${An(t.playbackId,{domain:t.customDomain,token:t.tokens.storyboard})}"
|
|
1586
|
-
/>`:f``}
|
|
1583
|
+
${t.storyboard?f`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:f``}
|
|
1587
1584
|
</mux-video>
|
|
1588
|
-
${
|
|
1585
|
+
${Xl(t)?f`<button
|
|
1589
1586
|
slot="seek-live"
|
|
1590
|
-
part="${
|
|
1587
|
+
part="${Co(t)?"top":"bottom"} seek-live button"
|
|
1591
1588
|
disabled="${t.inLiveWindow||!t.hasSrc||t.isDialogOpen}"
|
|
1592
1589
|
aria-disabled="${(t.inLiveWindow||!t.hasSrc||t.isDialogOpen)&&"true"}"
|
|
1593
1590
|
in-live-window="${t.inLiveWindow}"
|
|
1594
|
-
onclick="${function(
|
|
1591
|
+
onclick="${function($o){var nr;if((nr=t.onSeekToLive)==null||nr.call(t,$o),t.paused){let Bo=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(Bo)}}}"
|
|
1595
1592
|
>
|
|
1596
1593
|
Live
|
|
1597
1594
|
</button>`:f``}
|
|
1598
1595
|
<mxp-dialog
|
|
1599
1596
|
no-auto-hide
|
|
1600
|
-
open="${(
|
|
1597
|
+
open="${(Xa=t.isDialogOpen)!=null?Xa:!1}"
|
|
1601
1598
|
onclose="${t.onCloseErrorDialog}"
|
|
1602
1599
|
oninitfocus="${t.onInitFocusDialog}"
|
|
1603
1600
|
>
|
|
1604
|
-
${(
|
|
1601
|
+
${(Ja=t.dialog)!=null&&Ja.title?f`<h3>${t.dialog.title}</h3>`:f``}
|
|
1605
1602
|
<p>
|
|
1606
|
-
${(
|
|
1607
|
-
${(
|
|
1603
|
+
${(er=t.dialog)==null?void 0:er.message}
|
|
1604
|
+
${(tr=t.dialog)!=null&&tr.linkUrl?f`<a
|
|
1608
1605
|
href="${t.dialog.linkUrl}"
|
|
1609
1606
|
target="_blank"
|
|
1610
1607
|
rel="external noopener"
|
|
1611
|
-
aria-label="${(
|
|
1612
|
-
>${(
|
|
1608
|
+
aria-label="${(ir=t.dialog.linkText)!=null?ir:""} ${A("(opens in a new window)")}"
|
|
1609
|
+
>${(ar=t.dialog.linkText)!=null?ar:t.dialog.linkUrl}</a
|
|
1613
1610
|
>`:f``}
|
|
1614
1611
|
</p>
|
|
1615
1612
|
</mxp-dialog>
|
|
1616
|
-
</${Ra((
|
|
1617
|
-
`};var St=require("@mux/mux-video");function bi(t,i,e,a,r){var l,c,m;let n={},s={};switch(t.code){case St.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=A("Network Error",r),n.message=t.message,(l=t.data)==null?void 0:l.response.code){case 412:{n.title=A("Video is not currently available",r),n.message=A("The live stream or video file are not yet ready.",r),s.message=A("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),s.file="412-not-playable.md";break}case 404:{n.title=A("Video does not exist",r),n.message="",s.message=A("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),s.file="404-not-found.md";break}case 403:{if(n.title=A("Invalid playback URL",r),n.message=A("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=A("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),s.file="missing-signed-tokens.md",!a)break;let{exp:E,aud:y,sub:S}=Et(a),_=Date.now()>E*1e3,O=S!==e,x=y!=="v",P={timeStyle:"medium",dateStyle:"medium"};if(_){n.title=A("Video URL has expired",r),n.message=A("The video\u2019s secured playback-token has expired.",r),s.message=A("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(Te.code,P).format(E*1e3),currentDate:new Intl.DateTimeFormat(Te.code,P).format(Date.now())}),s.file="403-expired-token.md";break}if(O){n.title=A("Video URL is formatted incorrectly",r),n.message=A("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=A("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:e,tokenPlaybackId:S}),s.file="403-playback-id-mismatch.md";break}if(x){n.title=A("Video URL is formatted incorrectly",r),n.message=A("The playback-token is formatted with incorrect information.",r),s.message=A("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:y}),s.file="403-incorrect-aud-value.md";break}s.message=A("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),s.file="403-malformatted-token.md";break}}break}case St.MediaError.MEDIA_ERR_DECODE:{let{message:E}=t;n={title:A("Media Error",r),message:E},s.file="media-decode-error.md";break}case St.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let E=(m=(c=t.data)==null?void 0:c.response)==null?void 0:m.code;if(E>=400&&E<500){t.code=St.MediaError.MEDIA_ERR_NETWORK,t.data={response:{code:E}},{dialog:n,devlog:s}=bi(t,i,e,a);break}n={title:A("Source Not Supported",r),message:t.message},s.file="media-src-not-supported.md";break}default:n={title:A("Error",r),message:t.message};break}return i&&(n={title:A("Your device appears to be offline",r),message:A("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var jl=Object.values(D.StreamTypes),Xl=700,Jl=300,Oa={LG:"large",SM:"small",XS:"extra-small"};function Ei(t){let i=t.getBoundingClientRect();return i.width<Jl?Oa.XS:i.width<Xl?Oa.SM:Oa.LG}var me={SRC:"src",POSTER:"poster"},b={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder"};function ed(t,i){var e,a;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src,poster:t.poster,placeholder:t.getAttribute("placeholder"),theme:t.getAttribute("theme"),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(b.NOHOTKEYS),hotKeys:t.getAttribute(b.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,debug:t.debug,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,streamType:t.streamType,primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultShowRemainingTime:t.defaultShowRemainingTime,playbackRates:t.getAttribute(b.PLAYBACK_RATES),customDomain:(e=t.getAttribute(v.Attributes.CUSTOM_DOMAIN))!=null?e:void 0,playerSize:Ei((a=t.mediaController)!=null?a:t),metadataVideoId:t.getAttribute(v.Attributes.METADATA_VIDEO_ID),metadataVideoTitle:t.getAttribute(v.Attributes.METADATA_VIDEO_TITLE),metadataViewerUserId:t.getAttribute(v.Attributes.METADATA_VIEWER_USER_ID),title:t.getAttribute(b.TITLE),...i}}var td=Object.values(v.Attributes),id=Object.values(me),ad=Object.values(b),rd=ai(),nd="mux-player",Co={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},Pe,Lt,he,Ct,Xe,ae,Je,fi,ge,je,et,gi,wt,Na,vi,wo,Ai,Do,_i,xo,yi,Ro,Ti,Po,Ii,Uo,kt=class extends Ca{constructor(){super();T(this,Je);T(this,ge);T(this,et);T(this,wt);T(this,vi);T(this,Ai);T(this,_i);T(this,yi);T(this,Ti);T(this,Ii);T(this,Pe,!1);T(this,Lt,{});T(this,he,!0);T(this,Ct,new ii(this,"hotkeys"));T(this,Xe,void 0);T(this,ae,{...Co,onCloseErrorDialog:()=>I(this,ge,je).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Ta(this,G.activeElement)||e.preventDefault()},onSeekToLive:()=>ka(this)});this.attachShadow({mode:"open"}),this.isConnected&&I(this,Je,fi).call(this)}static get observedAttributes(){var e;return[...(e=Ca.observedAttributes)!=null?e:[],...id,...td,...ad]}get theme(){var e,a;return Array.from((a=(e=this.shadowRoot)==null?void 0:e.children)!=null?a:[]).find(({localName:r})=>r.startsWith("media-theme-"))}get mediaController(){var e,a;return(a=(e=this.theme)==null?void 0:e.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){I(this,wt,Na).call(this),I(this,vi,wo).call(this)}disconnectedCallback(){I(this,Ai,Do).call(this)}attributeChangedCallback(e,a,r){switch(g(this,Pe)||I(this,Je,fi).call(this),super.attributeChangedCallback(e,a,r),e){case b.HOTKEYS:g(this,Ct).value=r;break;case b.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Se(A("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case b.THUMBNAIL_TOKEN:{let{aud:s}=Et(r);r&&s!=="t"&&Se(A("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case b.STORYBOARD_TOKEN:{let{aud:s}=Et(r);r&&s!=="s"&&Se(A("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case v.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&X(A("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r})),this.streamType?this.streamType!=null&&!jl.includes(this.streamType)&&ri({file:"invalid-stream-type.md",message:A("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):ri({file:"invalid-stream-type.md",message:String(A("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[v.Attributes.PLAYBACK_ID,me.SRC,b.PLAYBACK_TOKEN].includes(e)&&a!==r&&B(this,ae,{...g(this,ae),...Co}),I(this,et,gi).call(this,{[_n(e)]:r})}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){return g(this,ae).inLiveWindow}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get playbackId(){var e;return(e=this.getAttribute(v.Attributes.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(v.Attributes.PLAYBACK_ID,e):this.removeAttribute(v.Attributes.PLAYBACK_ID)}get src(){var e,a;return this.playbackId?(e=Re(this,me.SRC))!=null?e:void 0:(a=this.getAttribute(me.SRC))!=null?a:void 0}set src(e){e?this.setAttribute(me.SRC,e):this.removeAttribute(me.SRC)}get poster(){var a;let e=this.getAttribute(me.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return vn(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(me.POSTER,e):this.removeAttribute(me.POSTER)}get audio(){return this.hasAttribute(b.AUDIO)}set audio(e){if(!e){this.removeAttribute(b.AUDIO);return}this.setAttribute(b.AUDIO,"")}get hotkeys(){return g(this,Ct)}get nohotkeys(){return this.hasAttribute(b.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(b.NOHOTKEYS);return}this.setAttribute(b.NOHOTKEYS,"")}get thumbnailTime(){return se(this.getAttribute(b.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(b.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(b.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(b.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=Re(this,b.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(b.PLACEHOLDER,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(b.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(b.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(b.SECONDARY_COLOR))!=null?e:void 0}set secondaryColor(e){this.setAttribute(b.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(b.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(b.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(b.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(b.PLAYBACK_RATES))return this.getAttribute(b.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,a)=>e-a)}set playbackRates(e){if(!e){this.removeAttribute(b.PLAYBACK_RATES);return}this.setAttribute(b.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=se(this.getAttribute(b.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(b.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=se(this.getAttribute(b.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(b.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(b.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(b.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(b.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_NAME))!=null?e:nd}get playerSoftwareVersion(){var e;return(e=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_VERSION))!=null?e:rd}get beaconCollectionDomain(){var e;return(e=this.getAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN))}get customDomain(){var e;return(e=this.getAttribute(v.Attributes.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(v.Attributes.CUSTOM_DOMAIN,e):this.removeAttribute(v.Attributes.CUSTOM_DOMAIN))}get envKey(){var e;return(e=Re(this,v.Attributes.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(v.Attributes.ENV_KEY,`${e}`)}get debug(){return Re(this,v.Attributes.DEBUG)!=null}set debug(e){e?this.setAttribute(v.Attributes.DEBUG,""):this.removeAttribute(v.Attributes.DEBUG)}get streamType(){return Re(this,v.Attributes.STREAM_TYPE)}set streamType(e){this.setAttribute(v.Attributes.STREAM_TYPE,`${e}`)}get startTime(){return se(Re(this,v.Attributes.START_TIME))}set startTime(e){this.setAttribute(v.Attributes.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(v.Attributes.PREFER_PLAYBACK);if(e===D.PlaybackTypes.MSE||e===D.PlaybackTypes.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===D.PlaybackTypes.MSE||e===D.PlaybackTypes.NATIVE?this.setAttribute(v.Attributes.PREFER_PLAYBACK,e):this.removeAttribute(v.Attributes.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(g(this,Pe)||I(this,Je,fi).call(this),!this.media){X("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=e}get tokens(){let e=this.getAttribute(b.PLAYBACK_TOKEN),a=this.getAttribute(b.THUMBNAIL_TOKEN),r=this.getAttribute(b.STORYBOARD_TOKEN);return{...g(this,Lt),...e!=null?{playback:e}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(e){B(this,Lt,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(b.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(b.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(b.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(b.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(b.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(b.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(!!s)return(0,D.addTextTrack)(s,e,a,r,n)}removeTextTrack(e){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,D.removeTextTrack)(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};Pe=new WeakMap,Lt=new WeakMap,he=new WeakMap,Ct=new WeakMap,Xe=new WeakMap,ae=new WeakMap,Je=new WeakSet,fi=function(){var e,a,r;if(!g(this,Pe)){B(this,Pe,!0),I(this,ge,je).call(this,{playerSize:Ei(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof M.HTMLElement))throw""}catch{X(`<${(e=this.theme)==null?void 0:e.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof v.default))throw""}catch{X("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ct))throw""}catch{X("<media-controller> failed to upgrade!")}Ln(this),I(this,yi,Ro).call(this),I(this,Ti,Po).call(this),I(this,_i,xo).call(this),B(this,he,(r=(a=this.mediaController)==null?void 0:a.hasAttribute("user-inactive"))!=null?r:!0),I(this,Ii,Uo).call(this)}},ge=new WeakSet,je=function(e){Object.assign(g(this,ae),e),I(this,et,gi).call(this)},et=new WeakSet,gi=function(e={}){di(Lo(ed(this,{...g(this,ae),...e})),this.shadowRoot)},wt=new WeakSet,Na=function(){var e,a;g(this,ae).playerSize!=Ei((e=this.mediaController)!=null?e:this)&&I(this,ge,je).call(this,{playerSize:Ei((a=this.mediaController)!=null?a:this)})},vi=new WeakSet,wo=function(){var e;B(this,Xe,new ResizeObserver(()=>I(this,wt,Na).call(this))),g(this,Xe).observe((e=this.mediaController)!=null?e:this)},Ai=new WeakSet,Do=function(){var e;(e=g(this,Xe))==null||e.disconnect()},_i=new WeakSet,xo=function(){var a,r,n,s,l;(a=this.mediaController)==null||a.addEventListener("mediaplayrequest",c=>{var m;((m=c.target)==null?void 0:m.localName)==="media-play-button"&&this.streamType&&[D.StreamTypes.LIVE,D.StreamTypes.LL_LIVE,D.StreamTypes.DVR,D.StreamTypes.LL_DVR].includes(this.streamType)&&this.hasPlayed&&ka(this)});let e=()=>{let c=Tn(this),m=g(this,ae).inLiveWindow;c!==m&&(I(this,ge,je).call(this,{inLiveWindow:c}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(r=this.media)==null||r.addEventListener("progress",e),(n=this.media)==null||n.addEventListener("waiting",e),(s=this.media)==null||s.addEventListener("timeupdate",e),(l=this.media)==null||l.addEventListener("emptied",e)},yi=new WeakSet,Ro=function(){var a;let e=r=>{let{detail:n}=r;if(n instanceof v.MediaError||(n=new v.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Se(n),n.data&&Se(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=bi(n,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&ri(l),X(n),n.data&&X(`${n.name} data:`,n.data),I(this,ge,je).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,c;if(!((s=this.media)!=null&&s.error))return r;let{devlog:n}=bi((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(c=this.media)==null?void 0:c.error.code,player_error_message:n.message?String(n.message):r.player_error_message}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:c,code:m}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new v.MediaError(c,m)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Ti=new WeakSet,Po=function(){var a,r,n,s;let e=()=>I(this,et,gi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",e),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",e)},Ii=new WeakSet,Uo=function(){var E,y,S;let e=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(a)return;let r,n=new WeakMap,s=()=>this.streamType&&[D.StreamTypes.LIVE,D.StreamTypes.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,l=(_,O,x=!1)=>{if(s())return;Array.from(_&&_.activeCues||[]).forEach(L=>{if(!(!L.snapToLines||L.line<-5||L.line>=0&&L.line<10))if(!O||this.paused){let re=L.text.split(`
|
|
1618
|
-
`).length,Y=a?-2:-3;this.streamType&&[
|
|
1613
|
+
</${Ra((rr=Sa(t.theme))!=null?rr:"media-theme-mux")}>
|
|
1614
|
+
`};var kt=require("@mux/mux-video");function Ei(t,i,e,a,r){var l,c,m;let n={},s={};switch(t.code){case kt.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=A("Network Error",r),n.message=t.message,(l=t.data)==null?void 0:l.response.code){case 412:{n.title=A("Video is not currently available",r),n.message=A("The live stream or video file are not yet ready.",r),s.message=A("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),s.file="412-not-playable.md";break}case 404:{n.title=A("Video does not exist",r),n.message="",s.message=A("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),s.file="404-not-found.md";break}case 403:{if(n.title=A("Invalid playback URL",r),n.message=A("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=A("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),s.file="missing-signed-tokens.md",!a)break;let{exp:E,aud:y,sub:k}=Ee(a),_=Date.now()>E*1e3,O=k!==e,x=y!=="v",P={timeStyle:"medium",dateStyle:"medium"};if(_){n.title=A("Video URL has expired",r),n.message=A("The video\u2019s secured playback-token has expired.",r),s.message=A("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(Me.code,P).format(E*1e3),currentDate:new Intl.DateTimeFormat(Me.code,P).format(Date.now())}),s.file="403-expired-token.md";break}if(O){n.title=A("Video URL is formatted incorrectly",r),n.message=A("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=A("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:e,tokenPlaybackId:k}),s.file="403-playback-id-mismatch.md";break}if(x){n.title=A("Video URL is formatted incorrectly",r),n.message=A("The playback-token is formatted with incorrect information.",r),s.message=A("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:y}),s.file="403-incorrect-aud-value.md";break}s.message=A("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),s.file="403-malformatted-token.md";break}}break}case kt.MediaError.MEDIA_ERR_DECODE:{let{message:E}=t;n={title:A("Media Error",r),message:E},s.file="media-decode-error.md";break}case kt.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let E=(m=(c=t.data)==null?void 0:c.response)==null?void 0:m.code;if(E>=400&&E<500){t.code=kt.MediaError.MEDIA_ERR_NETWORK,t.data={response:{code:E}},{dialog:n,devlog:s}=Ei(t,i,e,a);break}n={title:A("Source Not Supported",r),message:t.message},s.file="media-src-not-supported.md";break}default:n={title:A("Error",r),message:t.message};break}return i&&(n={title:A("Your device appears to be offline",r),message:A("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var ed=Object.values(S.StreamTypes),td=700,id=300,Oa={LG:"large",SM:"small",XS:"extra-small"};function fi(t){let i=t.getBoundingClientRect();return i.width<id?Oa.XS:i.width<td?Oa.SM:Oa.LG}var me={SRC:"src",POSTER:"poster"},b={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder"};function ad(t,i){var a,r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src,poster:t.poster,storyboard:t.storyboard,placeholder:t.getAttribute("placeholder"),theme:t.getAttribute("theme"),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(b.NOHOTKEYS),hotKeys:t.getAttribute(b.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,experimentalCmcd:t.experimentalCmcd,debug:t.debug,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,streamType:t.streamType,primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultShowRemainingTime:t.defaultShowRemainingTime,playbackRates:t.getAttribute(b.PLAYBACK_RATES),customDomain:(a=t.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,playerSize:fi((r=t.mediaController)!=null?r:t),metadataVideoId:t.getAttribute(g.Attributes.METADATA_VIDEO_ID),metadataVideoTitle:t.getAttribute(g.Attributes.METADATA_VIDEO_TITLE),metadataViewerUserId:t.getAttribute(g.Attributes.METADATA_VIEWER_USER_ID),title:t.getAttribute(b.TITLE),...i}}var rd=Object.values(g.Attributes),nd=Object.values(me),od=Object.values(b),sd=ri(),ld="mux-player",Do={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},Ue,Ct,he,wt,Je,ae,et,gi,Ae,Xe,tt,vi,Dt,Na,Ai,xo,_i,Ro,yi,Po,Ti,Uo,Ii,Oo,Mi,No,Lt=class extends Ca{constructor(){super();T(this,et);T(this,Ae);T(this,tt);T(this,Dt);T(this,Ai);T(this,_i);T(this,yi);T(this,Ti);T(this,Ii);T(this,Mi);T(this,Ue,!1);T(this,Ct,{});T(this,he,!0);T(this,wt,new ai(this,"hotkeys"));T(this,Je,void 0);T(this,ae,{...Do,onCloseErrorDialog:()=>I(this,Ae,Xe).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Ta(this,G.activeElement)||e.preventDefault()},onSeekToLive:()=>ka(this)});this.attachShadow({mode:"open"}),this.isConnected&&I(this,et,gi).call(this)}static get observedAttributes(){var e;return[...(e=Ca.observedAttributes)!=null?e:[],...nd,...rd,...od]}get theme(){var e,a;return Array.from((a=(e=this.shadowRoot)==null?void 0:e.children)!=null?a:[]).find(({localName:r})=>r.startsWith("media-theme-"))}get mediaController(){var e,a;return(a=(e=this.theme)==null?void 0:e.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){I(this,Dt,Na).call(this),I(this,Ai,xo).call(this)}disconnectedCallback(){I(this,_i,Ro).call(this)}attributeChangedCallback(e,a,r){switch(v(this,Ue)||I(this,et,gi).call(this),super.attributeChangedCallback(e,a,r),e){case b.HOTKEYS:v(this,wt).value=r;break;case b.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Le(A("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case b.THUMBNAIL_TOKEN:{let{aud:s}=Ee(r);r&&s!=="t"&&Le(A("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case b.STORYBOARD_TOKEN:{let{aud:s}=Ee(r);r&&s!=="s"&&Le(A("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&X(A("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r})),this.streamType?this.streamType!=null&&!ed.includes(this.streamType)&&ni({file:"invalid-stream-type.md",message:A("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):ni({file:"invalid-stream-type.md",message:String(A("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[g.Attributes.PLAYBACK_ID,me.SRC,b.PLAYBACK_TOKEN].includes(e)&&a!==r&&B(this,ae,{...v(this,ae),...Do}),I(this,tt,vi).call(this,{[In(e)]:r})}get experimentalCmcd(){return this.hasAttribute(g.Attributes.EXPERIMENTAL_CMCD)}set experimentalCmcd(e){!!e!==this.experimentalCmcd&&(e?this.setAttribute(g.Attributes.EXPERIMENTAL_CMCD,""):this.removeAttribute(g.Attributes.EXPERIMENTAL_CMCD))}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){return v(this,ae).inLiveWindow}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get playbackId(){var e;return(e=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(g.Attributes.PLAYBACK_ID,e):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var e,a;return this.playbackId?(e=ve(this,me.SRC))!=null?e:void 0:(a=this.getAttribute(me.SRC))!=null?a:void 0}set src(e){e?this.setAttribute(me.SRC,e):this.removeAttribute(me.SRC)}get poster(){var a;let e=this.getAttribute(me.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return yn(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(me.POSTER,e):this.removeAttribute(me.POSTER)}get storyboard(){if(this.playbackId&&!this.audio&&(!this.streamType||![S.StreamTypes.LIVE,S.StreamTypes.LL_LIVE,S.StreamTypes.DVR,S.StreamTypes.LL_DVR].includes(this.streamType)))return Tn(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(b.AUDIO)}set audio(e){if(!e){this.removeAttribute(b.AUDIO);return}this.setAttribute(b.AUDIO,"")}get hotkeys(){return v(this,wt)}get nohotkeys(){return this.hasAttribute(b.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(b.NOHOTKEYS);return}this.setAttribute(b.NOHOTKEYS,"")}get thumbnailTime(){return se(this.getAttribute(b.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(b.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(b.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(b.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=ve(this,b.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(b.PLACEHOLDER,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(b.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(b.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(b.SECONDARY_COLOR))!=null?e:void 0}set secondaryColor(e){this.setAttribute(b.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(b.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(b.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(b.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(b.PLAYBACK_RATES))return this.getAttribute(b.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,a)=>e-a)}set playbackRates(e){if(!e){this.removeAttribute(b.PLAYBACK_RATES);return}this.setAttribute(b.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=se(this.getAttribute(b.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(b.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=se(this.getAttribute(b.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(b.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(b.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(b.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(b.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?e:ld}get playerSoftwareVersion(){var e;return(e=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?e:sd}get beaconCollectionDomain(){var e;return(e=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get customDomain(){var e;return(e=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,e):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var e;return(e=ve(this,g.Attributes.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(g.Attributes.ENV_KEY,`${e}`)}get debug(){return ve(this,g.Attributes.DEBUG)!=null}set debug(e){e?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return ve(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){return ve(this,g.Attributes.STREAM_TYPE)}set streamType(e){this.setAttribute(g.Attributes.STREAM_TYPE,`${e}`)}get startTime(){return se(ve(this,g.Attributes.START_TIME))}set startTime(e){this.setAttribute(g.Attributes.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(e===S.PlaybackTypes.MSE||e===S.PlaybackTypes.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===S.PlaybackTypes.MSE||e===S.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,e):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(v(this,Ue)||I(this,et,gi).call(this),!this.media){X("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=e}get tokens(){let e=this.getAttribute(b.PLAYBACK_TOKEN),a=this.getAttribute(b.THUMBNAIL_TOKEN),r=this.getAttribute(b.STORYBOARD_TOKEN);return{...v(this,Ct),...e!=null?{playback:e}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(e){B(this,Ct,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(b.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(b.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(b.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(b.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(b.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(b.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(!!s)return(0,S.addTextTrack)(s,e,a,r,n)}removeTextTrack(e){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,S.removeTextTrack)(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};Ue=new WeakMap,Ct=new WeakMap,he=new WeakMap,wt=new WeakMap,Je=new WeakMap,ae=new WeakMap,et=new WeakSet,gi=function(){var e,a,r;if(!v(this,Ue)){B(this,Ue,!0),I(this,Ae,Xe).call(this,{playerSize:fi(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof M.HTMLElement))throw""}catch{X(`<${(e=this.theme)==null?void 0:e.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{X("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof mt))throw""}catch{X("<media-controller> failed to upgrade!")}Dn(this),I(this,Ti,Uo).call(this),I(this,Ii,Oo).call(this),I(this,yi,Po).call(this),B(this,he,(r=(a=this.mediaController)==null?void 0:a.hasAttribute("user-inactive"))!=null?r:!0),I(this,Mi,No).call(this)}},Ae=new WeakSet,Xe=function(e){Object.assign(v(this,ae),e),I(this,tt,vi).call(this)},tt=new WeakSet,vi=function(e={}){ci(wo(ad(this,{...v(this,ae),...e})),this.shadowRoot)},Dt=new WeakSet,Na=function(){var e,a;v(this,ae).playerSize!=fi((e=this.mediaController)!=null?e:this)&&I(this,Ae,Xe).call(this,{playerSize:fi((a=this.mediaController)!=null?a:this)})},Ai=new WeakSet,xo=function(){var e;B(this,Je,new ResizeObserver(()=>I(this,Dt,Na).call(this))),v(this,Je).observe((e=this.mediaController)!=null?e:this)},_i=new WeakSet,Ro=function(){var e;(e=v(this,Je))==null||e.disconnect()},yi=new WeakSet,Po=function(){var a,r,n,s,l;(a=this.mediaController)==null||a.addEventListener("mediaplayrequest",c=>{var m;((m=c.target)==null?void 0:m.localName)==="media-play-button"&&this.streamType&&[S.StreamTypes.LIVE,S.StreamTypes.LL_LIVE,S.StreamTypes.DVR,S.StreamTypes.LL_DVR].includes(this.streamType)&&this.hasPlayed&&ka(this)});let e=()=>{let c=Sn(this),m=v(this,ae).inLiveWindow;c!==m&&(I(this,Ae,Xe).call(this,{inLiveWindow:c}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(r=this.media)==null||r.addEventListener("progress",e),(n=this.media)==null||n.addEventListener("waiting",e),(s=this.media)==null||s.addEventListener("timeupdate",e),(l=this.media)==null||l.addEventListener("emptied",e)},Ti=new WeakSet,Uo=function(){var a;let e=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Le(n),n.data&&Le(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=Ei(n,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&ni(l),X(n),n.data&&X(`${n.name} data:`,n.data),I(this,Ae,Xe).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,c;if(!((s=this.media)!=null&&s.error))return r;let{devlog:n}=Ei((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(c=this.media)==null?void 0:c.error.code,player_error_message:n.message?String(n.message):r.player_error_message}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:c,code:m}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new g.MediaError(c,m)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Ii=new WeakSet,Oo=function(){var a,r,n,s;let e=()=>I(this,tt,vi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",e),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",e)},Mi=new WeakSet,No=function(){var E,y,k;let e=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(a)return;let r,n=new WeakMap,s=()=>this.streamType&&[S.StreamTypes.LIVE,S.StreamTypes.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,l=(_,O,x=!1)=>{if(s())return;Array.from(_&&_.activeCues||[]).forEach(C=>{if(!(!C.snapToLines||C.line<-5||C.line>=0&&C.line<10))if(!O||this.paused){let re=C.text.split(`
|
|
1615
|
+
`).length,Y=a?-2:-3;this.streamType&&[S.StreamTypes.LIVE,S.StreamTypes.LL_LIVE].includes(this.streamType)&&(Y=a?-1:-2);let ne=Y-re;if(C.line===ne&&!x)return;n.has(C)||n.set(C,C.line),C.line=ne-1,C.line=ne}else setTimeout(()=>{C.line=n.get(C)||"auto"},500)})},c=()=>{var _;l(r,(_=e==null?void 0:e.hasAttribute("user-inactive"))!=null?_:!1)},m=()=>{var x;let O=Array.from(((x=e==null?void 0:e.media)==null?void 0:x.textTracks)||[]).filter(P=>["subtitles","captions"].includes(P.kind)&&P.mode==="showing")[0];O!==r&&(r==null||r.removeEventListener("cuechange",c)),r=O,r==null||r.addEventListener("cuechange",c),l(r,v(this,he))};if(m(),(E=e==null?void 0:e.media)==null||E.textTracks.addEventListener("change",m),(y=e==null?void 0:e.media)==null||y.textTracks.addEventListener("addtrack",m),navigator.userAgent.includes("Chrome/")){let _=()=>{l(r,v(this,he),!0),this.paused||window.requestAnimationFrame(_)};(k=e==null?void 0:e.media)==null||k.addEventListener("playing",()=>{_()})}e==null||e.addEventListener("userinactivechange",()=>{let _=e==null?void 0:e.hasAttribute("user-inactive");v(this,he)!==_&&(B(this,he,_),l(r,v(this,he)))})};function ve(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}M.customElements.get("mux-player")||(M.customElements.define("mux-player",Lt),M.MuxPlayerElement=Lt);var dd=Lt;
|