@mux/mux-player 0.1.0-beta.23 → 0.1.0-beta.26

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.
Files changed (73) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +38 -36
  3. package/coverage/lcov-report/index.html +31 -31
  4. package/coverage/lcov-report/src/dialog.ts.html +1 -1
  5. package/coverage/lcov-report/src/errors.ts.html +1 -1
  6. package/coverage/lcov-report/src/helpers.ts.html +30 -9
  7. package/coverage/lcov-report/src/html.ts.html +159 -9
  8. package/coverage/lcov-report/src/index.html +52 -52
  9. package/coverage/lcov-report/src/index.ts.html +156 -27
  10. package/coverage/lcov-report/src/logger.ts.html +1 -1
  11. package/coverage/lcov-report/src/media-chrome/dialog.ts.html +1 -1
  12. package/coverage/lcov-report/src/media-chrome/index.html +1 -1
  13. package/coverage/lcov-report/src/media-chrome/time-display.ts.html +1 -1
  14. package/coverage/lcov-report/src/media-theme-mux/icons/airplay.svg.html +1 -1
  15. package/coverage/lcov-report/src/media-theme-mux/icons/captions-off.svg.html +1 -1
  16. package/coverage/lcov-report/src/media-theme-mux/icons/captions-on.svg.html +1 -1
  17. package/coverage/lcov-report/src/media-theme-mux/icons/cast-enter.svg.html +103 -0
  18. package/coverage/lcov-report/src/media-theme-mux/icons/cast-exit.svg.html +106 -0
  19. package/coverage/lcov-report/src/media-theme-mux/icons/fullscreen-enter.svg.html +1 -1
  20. package/coverage/lcov-report/src/media-theme-mux/icons/fullscreen-exit.svg.html +1 -1
  21. package/coverage/lcov-report/src/media-theme-mux/icons/index.html +33 -3
  22. package/coverage/lcov-report/src/media-theme-mux/icons/pause.svg.html +1 -1
  23. package/coverage/lcov-report/src/media-theme-mux/icons/pip-enter.svg.html +1 -1
  24. package/coverage/lcov-report/src/media-theme-mux/icons/pip-exit.svg.html +1 -1
  25. package/coverage/lcov-report/src/media-theme-mux/icons/play.svg.html +1 -1
  26. package/coverage/lcov-report/src/media-theme-mux/icons/seek-backward.svg.html +1 -1
  27. package/coverage/lcov-report/src/media-theme-mux/icons/seek-forward.svg.html +1 -1
  28. package/coverage/lcov-report/src/media-theme-mux/icons/volume-high.svg.html +1 -1
  29. package/coverage/lcov-report/src/media-theme-mux/icons/volume-low.svg.html +1 -1
  30. package/coverage/lcov-report/src/media-theme-mux/icons/volume-medium.svg.html +1 -1
  31. package/coverage/lcov-report/src/media-theme-mux/icons/volume-off.svg.html +1 -1
  32. package/coverage/lcov-report/src/media-theme-mux/icons.ts.html +18 -6
  33. package/coverage/lcov-report/src/media-theme-mux/index.html +26 -26
  34. package/coverage/lcov-report/src/media-theme-mux/media-theme-mux.ts.html +342 -177
  35. package/coverage/lcov-report/src/media-theme-mux/styles.css.html +117 -18
  36. package/coverage/lcov-report/src/styles.css.html +1 -1
  37. package/coverage/lcov-report/src/template.ts.html +128 -65
  38. package/coverage/lcov-report/src/utils.ts.html +1 -1
  39. package/coverage/lcov-report/src/video-api.ts.html +91 -13
  40. package/coverage/lcov.info +1595 -1273
  41. package/dist/index.cjs.js +503 -343
  42. package/dist/index.mjs +296 -228
  43. package/dist/mux-player.js +556 -396
  44. package/dist/mux-player.mjs +556 -396
  45. package/dist/tsconfig.tsbuildinfo +1 -1
  46. package/dist/types/helpers.d.ts +1 -0
  47. package/dist/types/html.d.ts +5 -0
  48. package/dist/types/index.d.ts +5 -3
  49. package/dist/types/media-theme-mux/icons.d.ts +2 -0
  50. package/dist/types/media-theme-mux/media-theme-mux.d.ts +32 -12
  51. package/dist/types/template.d.ts +0 -1
  52. package/dist/types/video-api.d.ts +4 -0
  53. package/dist/types-ts3.4/helpers.d.ts +1 -0
  54. package/dist/types-ts3.4/html.d.ts +5 -0
  55. package/dist/types-ts3.4/index.d.ts +4 -3
  56. package/dist/types-ts3.4/media-theme-mux/icons.d.ts +2 -0
  57. package/dist/types-ts3.4/media-theme-mux/media-theme-mux.d.ts +32 -12
  58. package/dist/types-ts3.4/template.d.ts +0 -1
  59. package/dist/types-ts3.4/video-api.d.ts +2 -0
  60. package/package.json +5 -5
  61. package/src/helpers.ts +7 -0
  62. package/src/html.ts +50 -0
  63. package/src/index.ts +58 -15
  64. package/src/media-theme-mux/icons/cast-enter.svg +6 -0
  65. package/src/media-theme-mux/icons/cast-exit.svg +7 -0
  66. package/src/media-theme-mux/icons.ts +4 -0
  67. package/src/media-theme-mux/media-theme-mux.ts +179 -124
  68. package/src/media-theme-mux/styles.css +47 -14
  69. package/src/template.ts +78 -57
  70. package/src/types.d.ts +3 -0
  71. package/src/video-api.ts +27 -1
  72. package/test/player.test.js +34 -0
  73. package/test/template.test.js +6 -4
package/dist/index.mjs CHANGED
@@ -1,34 +1,59 @@
1
- var we=(t,e,a)=>{if(!e.has(t))throw TypeError("Cannot "+a)};var y=(t,e,a)=>(we(t,e,"read from private field"),a?a.call(t):e.get(t)),f=(t,e,a)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,a)},N=(t,e,a,o)=>(we(t,e,"write to private field"),o?o.call(t,a):e.set(t,a),a);var h=(t,e,a)=>(we(t,e,"access private method"),a);import"@mux/playback-core";import{MediaController as ri}from"media-chrome";import"media-chrome";import{TemplateInstance as Ge,NodeTemplatePart as de,createProcessor as da,AttributeTemplatePart as Me}from"@github/template-parts";var J=new WeakMap,le=class{constructor(e,a){this.element=e;this.type=a;this.element.addEventListener(this.type,this);let o=J.get(this.element);o&&o.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let a=J.get(this.element);a&&a.delete(this.type)}}static for(e){J.has(e.element)||J.set(e.element,new Map);let a=e.attributeName.slice(2),o=J.get(e.element);return o&&o.has(a)?o.get(a):new le(e.element,a)}};function la(t,e){return t instanceof Me&&t.attributeName.startsWith("on")?(le.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function ma(t,e){return e instanceof Oe&&t instanceof de?(e.renderInto(t),!0):!1}function ca(t,e){return e instanceof DocumentFragment&&t instanceof de?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function ua(t,e){if(t instanceof Me){let a=t.attributeNamespace,o=t.element.getAttributeNS(a,t.attributeName);return String(e)!==o&&(t.value=String(e)),!0}return t.value=String(e),!0}function pa(t,e){if(typeof e=="boolean"&&t instanceof Me){let a=t.attributeNamespace,o=t.element.hasAttributeNS(a,t.attributeName);return e!==o&&(t.booleanValue=e),!0}return!1}function ha(t,e){return e===!1&&t instanceof de?(t.replace(""),!0):!1}function ga(t,e){pa(t,e)||la(t,e)||ha(t,e)||ma(t,e)||ca(t,e)||ua(t,e)}var Se=new WeakMap,Xe=new WeakMap,Je=new WeakMap,Oe=class{constructor(e,a,o){this.strings=e;this.values=a;this.processor=o}get template(){if(Se.has(this.strings))return Se.get(this.strings);{let e=document.createElement("template"),a=this.strings.length-1;return e.innerHTML=this.strings.reduce((o,i,n)=>o+i+(n<a?`{{ ${n} }}`:""),""),Se.set(this.strings,e),e}}renderInto(e){let a=this.template;if(Xe.get(e)!==a){Xe.set(e,a);let i=new Ge(a,this.values,this.processor);Je.set(e,i),e instanceof de?e.replace(...i.children):e.appendChild(i);return}let o=Je.get(e);o&&o.update(this.values)}},fa=da(ga);function d(t,...e){return new Oe(t,e,fa)}function Q(t,e){t.renderInto(e)}function b(t,e){let a=document.createElement("template");return a.innerHTML=t,new Ge(a,e)}var Qe=`
1
+ var Ie=(t,e,a)=>{if(!e.has(t))throw TypeError("Cannot "+a)};var v=(t,e,a)=>(Ie(t,e,"read from private field"),a?a.call(t):e.get(t)),k=(t,e,a)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,a)},U=(t,e,a,o)=>(Ie(t,e,"write to private field"),o?o.call(t,a):e.set(t,a),a);var f=(t,e,a)=>(Ie(t,e,"access private method"),a);import"@mux/playback-core";import{MediaController as yi}from"media-chrome";import vi,{MediaError as ze}from"@mux/mux-video";import{StreamTypes as P,addTextTrack as ki,removeTextTrack as Ei}from"@mux/playback-core";import{VideoEvents as xa}from"@mux/mux-video";var ga="en",F={code:ga};var at="en";function s(t,e=!0){var i,r;let a=e&&(r=(i=F)==null?void 0:i[t])!=null?r:t,o=e?F.code:at;return new it(a,o)}var it=class{constructor(e,a=(o=>(o=F.code)!=null?o:at)()){this.message=e,this.locale=a}format(e){return this.message.replace(/\{(\w+)\}/g,(a,o)=>{var i;return(i=e[o])!=null?i:""})}toString(){return this.message}};function ot(t){let e="";return Object.entries(t).forEach(([a,o])=>{o!=null&&(e+=`${fa(a)}: ${o}; `)}),e?e.trim():void 0}function fa(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function rt(t){return t.replace(/[-_]([a-z])/g,(e,a)=>a.toUpperCase())}function K(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function ue(t){let e=ba(t).toString();return e?"?"+e:""}function ba(t){let e={};for(let a in t)t[a]!=null&&(e[a]=t[a]);return new URLSearchParams(e)}function re(t){let a=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(atob(a).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(o)}var Pe=(t,e)=>!t||!e?!1:t.contains(e)?!0:Pe(t,e.getRootNode().host);import{StreamTypes as pe}from"@mux/playback-core";var _e="mux.com",ya=()=>{try{return"0.1.0-beta.26"}catch{}return"UNKNOWN"},va=ya(),he=()=>va,De=(t,{token:e,domain:a=_e}={})=>`https://stream.${a}/${t}.m3u8${ue(!!e?{token:e}:{redundant_streams:!0})}`,nt=(t,{token:e,thumbnailTime:a,domain:o=_e}={})=>{let i=e==null?a:void 0;return`https://image.${o}/${t}/thumbnail.jpg${ue({token:e,time:i})}`},st=(t,{token:e,domain:a=_e}={})=>`https://image.${a}/${t}/storyboard.vtt${ue({token:e})}`;function Ne(t){if(t&&/^media-theme-[\w-]+$/.test(t))return t}var ka={crossorigin:"crossOrigin",playsinline:"playsInline"};function lt(t){var e;return(e=ka[t])!=null?e:rt(t)}var dt=t=>{var a,o;let{media:e}=t;return(o=(a=e==null?void 0:e._hls)==null?void 0:a.liveSyncPosition)!=null?o:(e==null?void 0:e.seekable.length)?e==null?void 0:e.seekable.end(e.seekable.length-1):void 0},Ve=t=>{let e=dt(t);if(e==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}t.currentTime=e},Ea=1,Ta=5,mt=3,ct=.5,ut=t=>{var r;let{streamType:e}=t,a=dt(t),o=(r=t.media)==null?void 0:r.currentTime;if(a==null||o==null)return!1;let i=a-o;return e===pe.LL_LIVE||e===pe.LL_DVR?i<=Ea*(mt+ct):e===pe.LIVE||e===pe.DVR?i<=Ta*(mt+ct):!1};var pt=`[mux-player ${he()}]`;function w(...t){console.warn(pt,...t)}function D(...t){console.error(pt,...t)}function ge(t){var a;let e=(a=t.message)!=null?a:"";if(t.file){let o="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${s("Read more: ")}
2
+ ${o}${t.file}`}w(e)}var p={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",SRC:"src",POSTER:"poster",PRELOAD:"preload"},Y={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Aa=xa.filter(t=>t!=="error"),wa=Object.values(p),La=Object.values(Y);function ht(t){t.querySelectorAll(":scope > track").forEach(e=>{var a;(a=t.media)==null||a.append(e.cloneNode())}),Aa.forEach(e=>{var a;(a=t.media)==null||a.addEventListener(e,o=>{t.dispatchEvent(new Event(o.type))})})}var gt=class extends HTMLElement{static get observedAttributes(){return[...wa,...La]}constructor(){super();this.querySelectorAll(":scope > track").forEach(o=>{var i;(i=this.media)==null||i.append(o.cloneNode())});let e=o=>{for(let i of o)i.type==="childList"&&(i.removedNodes.forEach(r=>{var m,g;let n=(m=this.media)==null?void 0:m.querySelector(`track[src="${r.src}"]`);n&&((g=this.media)==null||g.removeChild(n))}),i.addedNodes.forEach(r=>{var n;(n=this.media)==null||n.append(r.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,a,o){switch(e){case Y.MUTED:{this.media&&(this.media.muted=o!=null,this.media.defaultMuted=o!=null);return}case Y.VOLUME:{let i=+o;this.media&&!Number.isNaN(i)&&(this.media.volume=i);return}case Y.PLAYBACKRATE:{let i=+o;this.media&&!Number.isNaN(i)&&(this.media.playbackRate=i,this.media.defaultPlaybackRate=i);return}}}play(){var e;return(e=this.media)==null?void 0:e.play()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var a;return(a=this.media)==null?void 0:a.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get video(){return w("<mux-player>.video is deprecated, please use .media instead"),this.media}get paused(){var e,a;return(a=(e=this.media)==null?void 0:e.paused)!=null?a:!0}get duration(){var e,a;return(a=(e=this.media)==null?void 0:e.duration)!=null?a:NaN}get ended(){var e,a;return(a=(e=this.media)==null?void 0:e.ended)!=null?a:!1}get buffered(){var e;return(e=this.media)==null?void 0:e.buffered}get readyState(){var e,a;return(a=(e=this.media)==null?void 0:e.readyState)!=null?a:0}get videoWidth(){var e;return(e=this.media)==null?void 0:e.videoWidth}get videoHeight(){var e;return(e=this.media)==null?void 0:e.videoHeight}get currentTime(){var e,a;return(a=(e=this.media)==null?void 0:e.currentTime)!=null?a:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,a;return(a=(e=this.media)==null?void 0:e.volume)!=null?a:1}set volume(e){this.media&&(this.media.volume=Number(e))}get src(){return N(this,p.SRC)}set src(e){this.setAttribute(p.SRC,`${e}`)}get poster(){var e;return(e=N(this,p.POSTER))!=null?e:""}set poster(e){this.setAttribute(p.POSTER,`${e}`)}get playbackRate(){var e,a;return(a=(e=this.media)==null?void 0:e.playbackRate)!=null?a:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=K(this.getAttribute(Y.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Y.PLAYBACKRATE,`${e}`):this.removeAttribute(Y.PLAYBACKRATE)}get crossOrigin(){return N(this,p.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(p.CROSSORIGIN,`${e}`)}get autoplay(){return N(this,p.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(p.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(p.AUTOPLAY)}get loop(){return N(this,p.LOOP)!=null}set loop(e){e?this.setAttribute(p.LOOP,""):this.removeAttribute(p.LOOP)}get muted(){var e,a;return(a=(e=this.media)==null?void 0:e.muted)!=null?a:!1}set muted(e){this.media&&(this.media.muted=Boolean(e))}get defaultMuted(){return N(this,p.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(p.MUTED,""):this.removeAttribute(p.MUTED)}get playsInline(){return N(this,p.PLAYSINLINE)!=null}set playsInline(e){e?this.setAttribute(p.PLAYSINLINE,""):this.removeAttribute(p.PLAYSINLINE)}get preload(){return N(this,p.PRELOAD)}set preload(e){e?this.setAttribute(p.PRELOAD,e):this.removeAttribute(p.PRELOAD)}};function N(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var Be=gt;import{MediaTheme as ei}from"media-chrome";import{TemplateInstance as ft,NodeTemplatePart as fe,createProcessor as Sa,AttributeTemplatePart as He}from"@github/template-parts";var ne=new WeakMap,be=class{constructor(e,a){this.element=e;this.type=a;this.element.addEventListener(this.type,this);let o=ne.get(this.element);o&&o.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let a=ne.get(this.element);a&&a.delete(this.type)}}static for(e){ne.has(e.element)||ne.set(e.element,new Map);let a=e.attributeName.slice(2),o=ne.get(e.element);return o&&o.has(a)?o.get(a):new be(e.element,a)}};function $a(t,e){return t instanceof He&&t.attributeName.startsWith("on")?(be.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function Ma(t,e){return e instanceof ye&&t instanceof fe?(e.renderInto(t),!0):!1}function Ca(t,e){return e instanceof DocumentFragment&&t instanceof fe?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function Oa(t,e){if(t instanceof He){let a=t.attributeNamespace,o=t.element.getAttributeNS(a,t.attributeName);return String(e)!==o&&(t.value=String(e)),!0}return t.value=String(e),!0}function Ra(t,e){if(typeof e=="boolean"&&t instanceof He){let a=t.attributeNamespace,o=t.element.hasAttributeNS(a,t.attributeName);return e!==o&&(t.booleanValue=e),!0}return!1}function Ia(t,e){return e===!1&&t instanceof fe?(t.replace(""),!0):!1}function Pa(t,e){Ra(t,e)||$a(t,e)||Ia(t,e)||Ma(t,e)||Ca(t,e)||Oa(t,e)}var Ue=new WeakMap,bt=new WeakMap,yt=new WeakMap,ye=class{constructor(e,a,o){this.strings=e;this.values=a;this.processor=o}get template(){if(Ue.has(this.strings))return Ue.get(this.strings);{let e=document.createElement("template"),a=this.strings.length-1;return e.innerHTML=this.strings.reduce((o,i,r)=>o+i+(r<a?`{{ ${r} }}`:""),""),Ue.set(this.strings,e),e}}renderInto(e){let a=this.template;if(bt.get(e)!==a){bt.set(e,a);let i=new ft(a,this.values,this.processor);yt.set(e,i),e instanceof fe?e.replace(...i.children):e.appendChild(i);return}let o=yt.get(e);o&&o.update(this.values)}},vt=new Map,_a=Sa(Pa);function l(t,...e){let a=[""],o=[],i,r=!1,n=(m,g=[])=>{a[a.length-1]=a[a.length-1]+m[0],g.forEach((T,y)=>{(i=T==null?void 0:T.$static$)!==void 0?(i.forEach(A=>{n(A.strings,A.values)}),a[a.length-1]=a[a.length-1]+m[y+1],r=!0):(o.push(T),a.push(m[y+1]))})};if(n(t,e),r){let m=a.join("$$html$$");t=vt.get(m),t===void 0&&(a.raw=a,vt.set(m,t=a)),e=o}return new ye(t,e,_a)}function ve(t,e){t.renderInto(e)}function b(t,e){let a=document.createElement("template");return a.innerHTML=t,new ft(a,e)}var Fe=(...t)=>({$static$:t.map(e=>e instanceof ye?e:/\w-/.test(e)?{strings:[e]}:{strings:[]})});var kt=`
2
3
  :host {
3
4
  cursor: pointer;
4
5
  }
5
6
  media-time-display {
6
7
  color: inherit;
7
8
  }
8
- `,et=document.createElement("template");et.innerHTML=`
9
+ `,Et=document.createElement("template");Et.innerHTML=`
9
10
  <style>
10
- ${Qe}
11
+ ${kt}
11
12
  </style>
12
13
  <media-time-display show-duration></media-time-display>
13
- `;var tt=["Enter"," "],ee=class extends HTMLElement{constructor(){super();var e,a;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")}toggleTimeDisplay(){var e,a,o;((e=this.timeDisplayEl)==null?void 0:e.hasAttribute("remaining"))?(a=this.timeDisplayEl)==null||a.removeAttribute("remaining"):(o=this.timeDisplayEl)==null||o.setAttribute("remaining","")}connectedCallback(){let e=a=>{let{key:o}=a;if(!tt.includes(o)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:o,altKey:i,key:n}=a;if(o||i||!tt.includes(n)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay)}};ee.styles=Qe,ee.template=et;globalThis.customElements.get("mxp-time-display")||(globalThis.customElements.define("mxp-time-display",ee),globalThis.MxpTimeDisplay=ee);var at=`:host(:not([audio])) {
14
+ `;var Tt=["Enter"," "],se=class extends HTMLElement{constructor(){super();var e,a;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")}toggleTimeDisplay(){var e,a,o;((e=this.timeDisplayEl)==null?void 0:e.hasAttribute("remaining"))?(a=this.timeDisplayEl)==null||a.removeAttribute("remaining"):(o=this.timeDisplayEl)==null||o.setAttribute("remaining","")}connectedCallback(){let e=a=>{let{key:o}=a;if(!Tt.includes(o)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:o,altKey:i,key:r}=a;if(o||i||!Tt.includes(r)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay)}};se.styles=kt,se.template=Et;globalThis.customElements.get("mxp-time-display")||(globalThis.customElements.define("mxp-time-display",se),globalThis.MxpTimeDisplay=se);var xt=`:host(:not([audio])) {
14
15
  --secondary-color: transparent;
15
16
  }
16
17
 
17
18
  :host {
18
- color: var(--primary-color);
19
- --media-icon-color: var(--primary-color);
20
- --media-range-thumb-background: var(--primary-color);
21
- --media-range-bar-color: var(--primary-color);
19
+ --_primary-color: var(--primary-color, #fff);
20
+
21
+ --media-icon-color: var(--_primary-color);
22
+ --media-range-thumb-background: var(--_primary-color);
23
+ --media-range-bar-color: var(--_primary-color);
22
24
  --media-control-background: var(--secondary-color);
23
25
  --media-control-hover-background: var(--secondary-color);
24
- --media-time-buffered-color: rgba(255, 255, 255, 0.7);
26
+ --media-time-buffered-color: rgba(255, 255, 255, 0.4);
25
27
  --media-range-track-background: rgba(255, 255, 255, 0.5);
26
28
  --media-range-track-border-radius: 3px;
29
+ --media-preview-thumbnail-border: 1px solid #fff;
30
+ --media-preview-thumbnail-border-radius: 2px;
31
+ --media-preview-time-margin: 5px 0 2px;
32
+ color: var(--_primary-color);
27
33
  display: inline-block;
28
34
  width: 100%;
29
35
  height: 100%;
30
36
  }
31
37
 
38
+ :host(.two-tone:not([audio])) {
39
+ --mux-time-range-padding: 0px; /* px is needed in calc() */
40
+ --media-preview-thumbnail-border: 0;
41
+ --media-preview-thumbnail-border-radius: 2px 2px 0 0;
42
+ --media-preview-time-border-radius: 0 0 2px 2px;
43
+ --media-preview-time-margin: 0 0 8px;
44
+ --media-preview-time-text-shadow: none;
45
+ }
46
+
47
+ :host([audio]) {
48
+ --media-preview-time-border-radius: 3px;
49
+ --media-preview-time-margin: 0 0 5px;
50
+ --media-preview-time-text-shadow: none;
51
+ }
52
+
53
+ :host(.two-tone:not([audio])) media-time-range {
54
+ --media-range-track-border-radius: 0;
55
+ }
56
+
32
57
  :host([audio]) ::slotted([slot='media']) {
33
58
  height: 0px;
34
59
  }
@@ -66,13 +91,26 @@ media-controller {
66
91
  height: 100%;
67
92
  }
68
93
 
94
+ :host media-time-range {
95
+ color: var(--_primary-color);
96
+ }
97
+
69
98
  :host(:not([audio])) media-time-range {
70
- padding: var(--mux-time-range-padding, 0 10px);
71
- z-index: 10;
99
+ --media-range-padding-left: var(--mux-time-range-padding, 10px);
100
+ --media-range-padding-right: var(--mux-time-range-padding, 10px);
72
101
  width: 100%;
73
- height: 22px;
74
- --media-range-track-translate-y: 6px;
75
- background: linear-gradient(180deg, transparent, transparent 15px, var(--media-control-background) 15px);
102
+ z-index: 10;
103
+ height: 10px;
104
+ bottom: -2px;
105
+ background: linear-gradient(
106
+ 180deg,
107
+ transparent,
108
+ transparent 3px,
109
+ var(--media-control-background) 3px,
110
+ var(--media-control-background) 8px,
111
+ transparent 8px,
112
+ transparent
113
+ );
76
114
  }
77
115
 
78
116
  media-control-bar {
@@ -83,10 +121,6 @@ media-control-bar :is([role='button'], [role='switch'], button) {
83
121
  height: 44px;
84
122
  }
85
123
 
86
- media-cast-button {
87
- width: 40px;
88
- }
89
-
90
124
  .size-extra-small media-control-bar [role='button'],
91
125
  .size-extra-small media-control-bar [role='switch'] {
92
126
  height: auto;
@@ -178,7 +212,7 @@ media-time-display {
178
212
  :is(media-time-display, media-text-display, media-playback-rate-button) {
179
213
  color: inherit;
180
214
  }
181
- `;var it=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="airplay">
215
+ `;var At=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="airplay">
182
216
  <path
183
217
  d="M10.19 11.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-.41Z"
184
218
  />
@@ -186,47 +220,60 @@ media-time-display {
186
220
  d="M19 0H1a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h2.94L5 13.75H1.25V1.25h17.5v12.5H15L16.06 15H19a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1Z"
187
221
  />
188
222
  </svg>
189
- `;var ot=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="off">
223
+ `;var wt=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="off">
190
224
  <path
191
225
  d="M19.83 2.68a2.58 2.58 0 0 0-2.3-2.5C15.72.06 12.86 0 10 0S4.28.06 2.47.18a2.58 2.58 0 0 0-2.3 2.5 115.86 115.86 0 0 0 0 12.64 2.58 2.58 0 0 0 2.3 2.5c1.81.12 4.67.18 7.53.18s5.72-.06 7.53-.18a2.58 2.58 0 0 0 2.3-2.5 115.86 115.86 0 0 0 0-12.64Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18s-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11 122.5 122.5 0 0 1 0-12.42 1.11 1.11 0 0 1 .91-1.11C4.24 1.57 7 1.5 10 1.5s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11 122.5 122.5 0 0 1 0 12.42ZM7.84 11a1.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.1 2.1 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-.42 1.81 1.81 0 0 1 .73-.16 1.68 1.68 0 0 1 .7.14 1.39 1.39 0 0 1 .51.39l1.08-.89a2.18 2.18 0 0 0-.47-.44A2.81 2.81 0 0 0 8.4 6a2.91 2.91 0 0 0-.58-.15 2.71 2.71 0 0 0-.56 0A4.08 4.08 0 0 0 5.88 6a3.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.06 3.27 3.27 0 0 0 1.09.67 3.85 3.85 0 0 0 1.38.23 3.2 3.2 0 0 0 1.28-.27 2.49 2.49 0 0 0 1-.83l-1.17-.88a1.42 1.42 0 0 1-.53.52Zm6.62 0a1.58 1.58 0 0 1-.76.18A1.54 1.54 0 0 1 13 11a1.69 1.69 0 0 1-.57-.42A2.12 2.12 0 0 1 12 10a2.29 2.29 0 0 1 .39-2.3 1.84 1.84 0 0 1 1.32-.58 1.71 1.71 0 0 1 .7.14 1.39 1.39 0 0 1 .51.39L16 6.73a2.43 2.43 0 0 0-.47-.44A3.22 3.22 0 0 0 15 6a3 3 0 0 0-.57-.15 2.87 2.87 0 0 0-.57 0A4.06 4.06 0 0 0 12.5 6a3.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.38 2.93 2.93 0 0 0 .72 1.06 3.17 3.17 0 0 0 1.09.67 3.83 3.83 0 0 0 1.37.23 3.16 3.16 0 0 0 1.28-.27 2.45 2.45 0 0 0 1-.83L15 10.51a1.49 1.49 0 0 1-.54.49Z"
192
226
  />
193
227
  </svg>
194
- `;var nt=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="on">
228
+ `;var Lt=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="on">
195
229
  <path
196
230
  d="M19.83 2.68a2.58 2.58 0 0 0-2.3-2.5C13.91-.06 6.09-.06 2.47.18a2.58 2.58 0 0 0-2.3 2.5 115.86 115.86 0 0 0 0 12.64 2.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.5 115.86 115.86 0 0 0 0-12.64ZM8.42 12.78a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27A4 4 0 0 1 4 12a3.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.64A3.53 3.53 0 0 1 4 6.26a3.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 .67.06 4.57 4.57 0 0 1 .68.18 3.59 3.59 0 0 1 .64.34 2.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 1 2.74 2.74 0 0 0 .16 1 2.39 2.39 0 0 0 .46.77 2.07 2.07 0 0 0 .67.5 2 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 .67.06 4.27 4.27 0 0 1 .68.18 3.59 3.59 0 0 1 .64.34 2.46 2.46 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 3 3 0 0 0-.16 1 3 3 0 0 0 .16 1 2.58 2.58 0 0 0 .46.77 2.07 2.07 0 0 0 .67.5 2 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"
197
231
  />
198
232
  </svg>
199
- `;var rt=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="enter">
233
+ `;var St=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="enter">
234
+ <path d="M0 12.5V14C2.2056 14 4 15.7944 4 18H5.5C5.5 14.9624 3.0376 12.5 0 12.5Z"/>
235
+ <path d="M0 15.5V18H2.5C2.5 16.6193 1.3807 15.5 0 15.5Z"/>
236
+ <path d="M0 9.5V11C3.8599 11 7 14.1402 7 18H8.5C8.5 13.3055 4.6945 9.5 0 9.5Z"/>
237
+ <path d="M19 -0.000213623H1C0.4478 -0.000213623 0 0.447386 0 0.999786V7.98359C0.4243 7.98359 0.8396 8.01859 1.25 8.06979V1.24979H18.75V16.75H9.9302C9.9814 17.1604 10.0164 17.5757 10.0164 18H19C19.5523 18 20 17.5522 20 17V0.999786C20 0.447386 19.5523 -0.000213623 19 -0.000213623Z"/>
238
+ </svg>
239
+ `;var $t=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="exit">
240
+ <path d="M0 12.5V14C2.2056 14 4 15.7944 4 18H5.5C5.5 14.9624 3.0376 12.5 0 12.5Z" />
241
+ <path d="M0 15.5V18H2.5C2.5 16.6193 1.3807 15.5 0 15.5Z" />
242
+ <path d="M0 9.5V11C3.8599 11 7 14.1402 7 18H8.5C8.5 13.3055 4.6945 9.5 0 9.5Z" />
243
+ <path d="M19 -0.000198364H1C0.4478 -0.000198364 0 0.447402 0 0.999802V7.9836C0.4243 7.9836 0.8396 8.0186 1.25 8.0698V1.2498H18.75V16.75H9.9302C9.9814 17.1604 10.0164 17.5757 10.0164 18H19C19.5523 18 20 17.5522 20 17V0.999802C20 0.447402 19.5523 -0.000198364 19 -0.000198364Z" />
244
+ <path d="M17.5 2.4998H2.5V8.311C6.0193 9.2171 8.783 11.9807 9.689 15.5001H17.5V2.4998Z" />
245
+ </svg>
246
+ `;var Mt=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="enter">
200
247
  <path
201
248
  d="M17.25 11.5a.76.76 0 0 0-.75.75v4.25h-4.25a.75.75 0 0 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 0 0 1.5 0v-5a.76.76 0 0 0-.75-.75ZM5.75 16.5H1.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 0 0 0-1.5Zm0-16.5h-5A.76.76 0 0 0 0 .75v5a.76.76 0 0 0 .75.75.76.76 0 0 0 .75-.75V1.5h4.25A.76.76 0 0 0 6.5.75.76.76 0 0 0 5.75 0Z"
202
249
  />
203
250
  </svg>
204
- `;var st=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="exit">
251
+ `;var Ct=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="exit">
205
252
  <path
206
253
  d="M17.25 11.5h-5a.76.76 0 0 0-.75.75v5a.75.75 0 0 0 1.5 0V13h4.25a.75.75 0 0 0 0-1.5Zm-5-5h5a.75.75 0 0 0 0-1.5H13V.75a.75.75 0 0 0-1.5 0v5a.76.76 0 0 0 .75.75Zm-6.5 5h-5a.75.75 0 0 0 0 1.5H5v4.25a.75.75 0 0 0 1.5 0v-5a.76.76 0 0 0-.75-.75Zm0-11.5A.76.76 0 0 0 5 .75V5H.75a.75.75 0 0 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5A.76.76 0 0 0 5.75 0Z"
207
254
  />
208
255
  </svg>
209
- `;var dt=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="pause">
256
+ `;var Ot=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="pause">
210
257
  <path
211
258
  d="M3 16.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.5v15ZM11.5 1a.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"
212
259
  />
213
260
  </svg>
214
- `;var lt=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="enter">
261
+ `;var Rt=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="enter">
215
262
  <path
216
263
  d="M19 0H1a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V1.25h17.5v6.5H20V1a1 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-5h7Z"
217
264
  />
218
265
  </svg>
219
- `;var mt=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="exit">
266
+ `;var It=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="exit">
220
267
  <path
221
268
  d="M19 0H1a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V1.25h17.5v6.5H20V1a1 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-5h7Z"
222
269
  />
223
270
  </svg>
224
- `;var ct=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="play">
271
+ `;var Pt=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="play">
225
272
  <path
226
273
  d="m3.73 17.93 14.05-8.54a.46.46 0 0 0 0-.78L3.73.07A.48.48 0 0 0 3 .46v17.07a.48.48 0 0 0 .73.4Z"
227
274
  />
228
275
  </svg>
229
- `;var ut=`<svg aria-hidden="true" viewBox="0 0 16 18" slot="backward">
276
+ `;var _t=`<svg aria-hidden="true" viewBox="0 0 16 18" slot="backward">
230
277
  <path
231
278
  d="M8.75 3.42H4.68l2.14-2.14A.75.75 0 0 0 5.76.22L2.22 3.75a.77.77 0 0 0 0 1.07l3.54 3.53a.75.75 0 0 0 1.06 0 .75.75 0 0 0 0-1.06L4.45 4.92h4.3A5.75 5.75 0 0 1 11 16a.75.75 0 0 0 .29 1.44.72.72 0 0 0 .29-.06A7.25 7.25 0 0 0 8.75 3.42Z"
232
279
  />
@@ -239,7 +286,7 @@ media-time-display {
239
286
  </text>
240
287
  <path style="fill: none" d="M0 0h16v18H0z" />
241
288
  </svg>
242
- `;var pt=`<svg aria-hidden="true" viewBox="0 0 16 18" slot="forward">
289
+ `;var Dt=`<svg aria-hidden="true" viewBox="0 0 16 18" slot="forward">
243
290
  <path
244
291
  d="M7.25 3.42h4.07L9.18 1.28A.75.75 0 0 1 10.24.22l3.54 3.53a.77.77 0 0 1 0 1.07l-3.54 3.53a.75.75 0 0 1-1.06 0 .75.75 0 0 1 0-1.06l2.37-2.37h-4.3A5.75 5.75 0 0 0 5 16a.75.75 0 0 1-.29 1.44.72.72 0 0 1-.29-.06A7.25 7.25 0 0 1 7.25 3.42Z"
245
292
  />
@@ -252,246 +299,264 @@ media-time-display {
252
299
  </text>
253
300
  <path style="fill: none" d="M0 0h16v18H0z" />
254
301
  </svg>
255
- `;var ht=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="high">
302
+ `;var Nt=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="high">
256
303
  <path
257
304
  d="m8.14 1.86-4 4a.49.49 0 0 1-.35.14H.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-.36V2.21a.5.5 0 0 0-.86-.35ZM10.88.3v1.52A7.52 7.52 0 0 1 16.47 9a7.52 7.52 0 0 1-5.59 7.18v1.52A9 9 0 0 0 18 9 9 9 0 0 0 10.88.3ZM14.44 9a5.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 14.44 9Z"
258
305
  />
259
306
  <path style="fill: none" d="M0 0h18v18H0z" />
260
307
  </svg>
261
- `;var gt=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="low">
308
+ `;var Vt=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="low">
262
309
  <path
263
310
  d="m8.14 1.86-4 4a.49.49 0 0 1-.35.14H.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-.36V2.21a.5.5 0 0 0-.86-.35ZM14.44 9a5.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 14.44 9Z"
264
311
  />
265
312
  <path style="fill: none" d="M0 0h18v18H0z" />
266
313
  </svg>
267
- `;var ft=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="medium">
314
+ `;var Bt=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="medium">
268
315
  <path
269
316
  d="m8.14 1.86-4 4a.49.49 0 0 1-.35.14H.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-.36V2.21a.5.5 0 0 0-.86-.35ZM14.44 9a5.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 14.44 9Z"
270
317
  />
271
318
  <path style="fill: none" d="M0 0h18v18H0z" />
272
319
  </svg>
273
- `;var bt=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="off">
320
+ `;var Ht=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="off">
274
321
  <path
275
322
  d="m0 1.05 4.48 4.47-.33.33a.49.49 0 0 1-.36.15H.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.91L17 18l1-1L1.06 0Zm5.36 5.36L7.75 8.8V14L5 11.26a1.74 1.74 0 0 0-1.24-.51H1.25v-3.5h2.54A1.74 1.74 0 0 0 5 6.74ZM16.47 9a7.19 7.19 0 0 1-.89 3.47l1.11 1.1A8.64 8.64 0 0 0 18 9 9 9 0 0 0 10.88.3v1.52A7.52 7.52 0 0 1 16.47 9ZM9 5.88V2.21a.5.5 0 0 0-.5-.5.48.48 0 0 0-.36.15L6.56 3.44ZM12.91 9a4.28 4.28 0 0 1-.07.72l1.22 1.22A5.2 5.2 0 0 0 14.44 9a5.49 5.49 0 0 0-3.56-5.1v1.66A4 4 0 0 1 12.91 9Z"
276
323
  />
277
324
  <path style="fill: none" d="M0 0h18v18H0z" />
278
325
  </svg>
279
- `;var vt=()=>b(it),yt=()=>b(ot),Et=()=>b(nt),Tt=()=>b(rt),kt=()=>b(st),xt=()=>b(dt),At=()=>b(lt),Lt=()=>b(mt),wt=()=>b(ct),Mt=t=>b(ut,t),St=t=>b(pt,t),Ot=()=>b(ht),Ct=()=>b(gt),It=()=>b(ft),$t=()=>b(bt);import{StreamTypes as k}from"@mux/playback-core";var O={LG:"large",SM:"small",XS:"extra-small"},Rt=t=>d`
280
- <style>
281
- ${at}
282
- </style>
283
-
284
- <media-controller audio="${t.audio||!1}" class="size-${t.playerSize}">
285
- <slot name="media" slot="media"></slot>
286
- <media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
287
- ${Ra(t)}
288
- <slot></slot>
289
- </media-controller>
290
- `,Ra=t=>{let{streamType:e,playerSize:a,audio:o}=t;if(o)switch(e){case k.LIVE:case k.LL_LIVE:return Pa(t);case k.DVR:case k.LL_DVR:return Da(t);case k.ON_DEMAND:default:return _a(t)}switch(e){case k.LIVE:case k.LL_LIVE:switch(a){case O.LG:return Ua(t);case O.SM:return Ba(t);case O.XS:return Ha(t)}case k.DVR:case k.LL_DVR:switch(a){case O.LG:return Ya(t);case O.SM:return Ka(t);case O.XS:return Fa(t)}case k.ON_DEMAND:default:switch(a){case O.LG:return Va(t);case O.SM:return Na(t);case O.XS:return Ce(t)}}},T=()=>d`
291
- <media-play-button>
292
- ${wt()}
293
- ${xt()}
326
+ `;var Ut=()=>b(At),Ft=()=>b(wt),Kt=()=>b(Lt),Yt=()=>b(St),Zt=()=>b($t),zt=()=>b(Mt),Wt=()=>b(Ct),jt=()=>b(Ot),qt=()=>b(Rt),Gt=()=>b(It),Xt=()=>b(Pt),Jt=t=>b(_t,t),Qt=t=>b(Dt,t),ea=()=>b(Nt),ta=()=>b(Vt),aa=()=>b(Bt),ia=()=>b(Ht);import{StreamTypes as L}from"@mux/playback-core";var R={LG:"large",SM:"small",XS:"extra-small"},u={mediaChrome:"layer media-layer poster-layer vertical-layer centered-layer",centerPlay:"center play button",centerSeekBackward:"center seek-backward button",centerSeekForward:"center seek-forward button",play:"play button",seekBackward:"seek-backward button",seekForward:"seek-forward button",mute:"mute button",captions:"captions button",airplay:"airplay button",pip:"pip button",fullscreen:"fullscreen button",cast:"cast button",playbackRate:"playbackrate button",volumeRange:"volume range",timeRange:"time range",timeDisplay:"time display"},Ke=class extends ei{static get observedAttributes(){return["audio","nohotkeys","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset"]}attributeChangedCallback(){this.render()}render(){let e={audio:this.hasAttribute("audio"),nohotkeys:this.hasAttribute("nohotkeys"),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")};ve(l`
327
+ <style>
328
+ ${xt}
329
+ </style>
330
+ <media-controller
331
+ nohotkeys="${e.nohotkeys||!1}"
332
+ audio="${e.audio||!1}"
333
+ class="size-${e.playerSize}"
334
+ exportparts="${u.mediaChrome.split(" ").join(", ")}"
335
+ >
336
+ <slot name="media" slot="media"></slot>
337
+ <media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
338
+ ${ti(e)}
339
+ <slot></slot>
340
+ </media-controller>
341
+ `,this.shadowRoot)}};customElements.get("media-theme-mux")||customElements.define("media-theme-mux",Ke);var ti=t=>{let{streamType:e,playerSize:a,audio:o}=t;if(o)switch(e){case L.LIVE:case L.LL_LIVE:return oi();case L.DVR:case L.LL_DVR:return ii(t);case L.ON_DEMAND:default:return ai(t)}switch(e){case L.LIVE:case L.LL_LIVE:switch(a){case R.LG:return di(t);case R.SM:return li(t);case R.XS:return si(t)}case L.DVR:case L.LL_DVR:switch(a){case R.LG:return ui(t);case R.SM:return ci(t);case R.XS:return mi(t)}case L.ON_DEMAND:default:switch(a){case R.LG:return ni(t);case R.SM:return ri(t);case R.XS:return Ye(t)}}},x=({part:t=u.play}={})=>l`
342
+ <media-play-button part="${t}">
343
+ ${Xt()}
344
+ ${jt()}
294
345
  </media-play-button>
295
- `,Y=t=>d`
296
- <media-seek-backward-button seek-offset="${t.backwardSeekOffset}">
297
- ${Mt({value:t.backwardSeekOffset})}
346
+ `,G=({backwardSeekOffset:t,part:e=u.seekBackward})=>l`
347
+ <media-seek-backward-button seek-offset="${t}" part="${e}">
348
+ ${Jt({value:t})}
298
349
  </media-seek-backward-button>
299
- `,z=t=>d`
300
- <media-seek-forward-button seek-offset="${t.forwardSeekOffset}">
301
- ${St({value:t.forwardSeekOffset})}
350
+ `,X=({forwardSeekOffset:t,part:e=u.seekForward})=>l`
351
+ <media-seek-forward-button seek-offset="${t}" part="${e}">
352
+ ${Qt({value:t})}
302
353
  </media-seek-forward-button>
303
- `,x=()=>d`
304
- <media-mute-button>
305
- ${Ot()}
306
- ${It()}
307
- ${Ct()}
308
- ${$t()}
354
+ `,S=()=>l`
355
+ <media-mute-button part="${u.mute}">
356
+ ${ea()}
357
+ ${aa()}
358
+ ${ta()}
359
+ ${ia()}
309
360
  </media-mute-button>
310
- `,V=t=>d`
311
- <media-captions-button default-showing="${!t.defaultHiddenCaptions}" >
312
- ${yt()}
313
- ${Et()}
314
- </media-captions-button>`,A=()=>d`
315
- <media-airplay-button>
316
- ${vt()}
317
- </media-airplay-button>`,H=()=>d`
318
- <media-pip-button>
319
- ${At()}
320
- ${Lt()}
321
- </media-pip-button>`,B=()=>d`
322
- <media-fullscreen-button>
323
- ${Tt()}
324
- ${kt()}
325
- </media-fullscreen-button>`,_a=t=>d`
361
+ `,Z=t=>l`
362
+ <media-captions-button default-showing="${!t.defaultHiddenCaptions}" part="${u.captions}">
363
+ ${Ft()}
364
+ ${Kt()}
365
+ </media-captions-button>`,$=()=>l`
366
+ <media-airplay-button part="${u.airplay}">
367
+ ${Ut()}
368
+ </media-airplay-button>`,z=()=>l`
369
+ <media-pip-button part="${u.pip}">
370
+ ${qt()}
371
+ ${Gt()}
372
+ </media-pip-button>`,W=()=>l`
373
+ <media-fullscreen-button part="${u.fullscreen}">
374
+ ${zt()}
375
+ ${Wt()}
376
+ </media-fullscreen-button>`,M=()=>l`
377
+ <media-cast-button part="${u.cast}">
378
+ ${Yt()}
379
+ ${Zt()}
380
+ </media-cast-button>`,ke=()=>l`
381
+ <media-playback-rate-button part="${u.playbackRate}">
382
+ </media-playback-rate-button>`,I=()=>l`
383
+ <media-volume-range part="${u.volumeRange}">
384
+ </media-volume-range>`,J=()=>l`
385
+ <media-time-range part="${u.timeRange}">
386
+ </media-time-range>`,Ee=()=>l`
387
+ <mxp-time-display part="${u.timeDisplay}">
388
+ </mxp-time-display>`,ai=t=>l`
326
389
  <media-control-bar>
327
- ${T()} ${Y(t)} ${z(t)}
328
- <mxp-time-display></mxp-time-display>
329
- <media-time-range></media-time-range>
330
390
  ${x()}
331
- <media-volume-range></media-volume-range>
332
- <media-playback-rate-button></media-playback-rate-button>
333
- ${A()}
334
- <media-cast-button></media-cast-button>
391
+ ${G(t)}
392
+ ${X(t)}
393
+ ${Ee()}
394
+ ${J()}
395
+ ${S()}
396
+ ${I()}
397
+ ${ke()}
398
+ ${$()}
399
+ ${M()}
335
400
  </media-control-bar>
336
- `,Da=t=>d`
401
+ `,ii=t=>l`
337
402
  <media-control-bar>
338
- ${T()}
339
- <slot name="seek-to-live-button"></slot>
340
- ${Y(t)} ${z(t)}
341
- <mxp-time-display></mxp-time-display>
342
- <media-time-range></media-time-range>
343
403
  ${x()}
344
- <media-volume-range></media-volume-range>
345
- <media-playback-rate-button></media-playback-rate-button>
346
- ${A()}
347
- <media-cast-button></media-cast-button>
404
+ <slot name="seek-to-live-button"></slot>
405
+ ${G(t)}
406
+ ${X(t)}
407
+ ${Ee()}
408
+ ${J()}
409
+ ${S()}
410
+ ${I()}
411
+ ${ke()}
412
+ ${$()}
413
+ ${M()}
348
414
  </media-control-bar>
349
- `,Pa=t=>d`
415
+ `,oi=()=>l`
350
416
  <media-control-bar>
351
- ${T()}
352
- <slot name="seek-to-live-button"></slot>
353
417
  ${x()}
354
- <media-volume-range></media-volume-range>
355
- ${A()}
356
- <media-cast-button></media-cast-button>
418
+ <slot name="seek-to-live-button"></slot>
419
+ ${S()}
420
+ ${I()}
421
+ ${$()}
422
+ ${M()}
357
423
  </media-control-bar>
358
- `,Ce=t=>d`
424
+ `,Ye=t=>l`
359
425
  <media-control-bar slot="top-chrome">
360
- ${V(t)}
426
+ ${Z(t)}
361
427
  <div class="mxp-spacer"></div>
362
- ${A()}
363
- <media-cast-button></media-cast-button>
364
- ${H()}
428
+ ${$()}
429
+ ${M()}
430
+ ${z()}
365
431
  </media-control-bar>
366
432
  <div slot="centered-chrome" class="mxp-center-controls">
367
- ${T()}
433
+ ${x({part:u.centerPlay})}
368
434
  </div>
369
435
  <media-control-bar>
370
- ${x()}
436
+ ${S()}
371
437
  <div class="mxp-spacer"></div>
372
- ${B()}
438
+ ${W()}
373
439
  </media-control-bar>
374
- `,Na=t=>d`
440
+ `,ri=t=>l`
375
441
  <media-control-bar slot="top-chrome" style="justify-content: flex-end;">
376
- ${V(t)}
377
- ${A()}
378
- <media-cast-button></media-cast-button>
379
- ${H()}
442
+ ${Z(t)}
443
+ ${$()}
444
+ ${M()}
445
+ ${z()}
380
446
  </media-control-bar>
381
447
  <div slot="centered-chrome" class="mxp-center-controls">
382
- ${Y(t)}
383
- ${T()}
384
- ${z(t)}
448
+ ${G({...t,part:u.centerSeekBackward})}
449
+ ${x({part:u.centerPlay})}
450
+ ${X({...t,part:u.centerSeekForward})}
385
451
  </div>
386
- <media-time-range></media-time-range>
452
+ ${J()}
387
453
  <media-control-bar>
388
- <mxp-time-display></mxp-time-display>
389
- ${x()}
390
- <media-volume-range></media-volume-range>
454
+ ${Ee()}
455
+ ${S()}
456
+ ${I()}
391
457
  <div class="mxp-spacer"></div>
392
- <media-playback-rate-button></media-playback-rate-button>
393
- ${B()}
458
+ ${ke()}
459
+ ${W()}
394
460
  <div class="mxp-padding-2"></div>
395
461
  </media-control-bar>
396
- `,Va=t=>d`
462
+ `,ni=t=>l`
397
463
  <div slot="centered-chrome" class="mxp-center-controls">
398
- ${T()}
464
+ ${x({part:u.centerPlay})}
399
465
  </div>
400
- <media-time-range></media-time-range>
466
+ ${J()}
401
467
  <media-control-bar>
402
- ${T()}
403
- ${Y(t)}
404
- ${z(t)}
405
- <mxp-time-display></mxp-time-display>
406
468
  ${x()}
407
- <media-volume-range></media-volume-range>
469
+ ${G(t)}
470
+ ${X(t)}
471
+ ${Ee()}
472
+ ${S()}
473
+ ${I()}
408
474
  <div class="mxp-spacer"></div>
409
- <media-playback-rate-button></media-playback-rate-button>
410
- ${V(t)}
411
- ${A()}
412
- <media-cast-button></media-cast-button>
413
- ${H()}
414
- ${B()}
475
+ ${ke()}
476
+ ${Z(t)}
477
+ ${$()}
478
+ ${M()}
479
+ ${z()}
480
+ ${W()}
415
481
  <div class="mxp-padding-2"></div>
416
482
  </media-control-bar>
417
- `,Ha=Ce,Ba=t=>d`
483
+ `,si=Ye,li=t=>l`
418
484
  <media-control-bar slot="top-chrome">
419
485
  <slot name="seek-to-live-button"></slot>
420
486
  <div class="mxp-spacer"></div>
421
- ${V(t)}
422
- ${A()}
423
- <media-cast-button></media-cast-button>
424
- ${H()}
487
+ ${Z(t)}
488
+ ${$()}
489
+ ${M()}
490
+ ${z()}
425
491
  </media-control-bar>
426
492
  <div slot="centered-chrome" class="mxp-center-controls">
427
- ${T()}
493
+ ${x({part:u.centerPlay})}
428
494
  </div>
429
495
  <media-control-bar>
430
- ${x()}
431
- <media-volume-range></media-volume-range>
496
+ ${S()}
497
+ ${I()}
432
498
  <div class="mxp-spacer"></div>
433
- ${B()}
499
+ ${W()}
434
500
  </media-control-bar>
435
- `,Ua=t=>d`
501
+ `,di=t=>l`
436
502
  <media-control-bar slot="top-chrome">
437
503
  <slot name="seek-to-live-button"></slot>
438
504
  </media-control-bar>
439
505
  <div slot="centered-chrome" class="mxp-center-controls">
440
- ${T()}
506
+ ${x({part:u.centerPlay})}
441
507
  </div>
442
508
  <media-control-bar>
443
- ${x()}
444
- <media-volume-range></media-volume-range>
509
+ ${S()}
510
+ ${I()}
445
511
  <div class="mxp-spacer"></div>
446
- ${V(t)}
447
- ${A()}
448
- <media-cast-button></media-cast-button>
449
- ${H()}
450
- ${B()}
512
+ ${Z(t)}
513
+ ${$()}
514
+ ${M()}
515
+ ${z()}
516
+ ${W()}
451
517
  </media-control-bar>
452
- `,Fa=Ce,Ka=t=>d`
518
+ `,mi=Ye,ci=t=>l`
453
519
  <media-control-bar slot="top-chrome" style="justify-content: flex-end;">
454
- ${V(t)}
455
- ${A()}
456
- <media-cast-button></media-cast-button>
457
- ${H()}
520
+ ${Z(t)}
521
+ ${$()}
522
+ ${M()}
523
+ ${z()}
458
524
  </media-control-bar>
459
525
  <div slot="centered-chrome" class="mxp-center-controls">
460
- ${Y(t)}
461
- ${T()}
462
- ${z(t)}
526
+ ${G({...t,part:u.centerSeekBackward})}
527
+ ${x({part:u.centerPlay})}
528
+ ${X({...t,part:u.centerSeekForward})}
463
529
  </div>
464
- <media-time-range></media-time-range>
530
+ ${J()}
465
531
  <media-control-bar>
466
- ${x()}
467
- <media-volume-range></media-volume-range>
532
+ ${S()}
533
+ ${I()}
468
534
  <slot name="seek-to-live-button"></slot>
469
535
  <div class="mxp-spacer"></div>
470
- ${B()}
536
+ ${W()}
471
537
  <div class="mxp-padding-2"></div>
472
538
  </media-control-bar>
473
- `,Ya=t=>d`
539
+ `,ui=t=>l`
474
540
  <div slot="centered-chrome" class="mxp-center-controls">
475
- ${T()}
541
+ ${x({part:u.centerPlay})}
476
542
  </div>
477
- <media-time-range></media-time-range>
543
+ ${J()}
478
544
  <media-control-bar>
479
- ${T()}
480
- ${Y(t)}
481
- ${z(t)}
482
545
  ${x()}
483
- <media-volume-range></media-volume-range>
546
+ ${G(t)}
547
+ ${X(t)}
548
+ ${S()}
549
+ ${I()}
484
550
  <slot name="seek-to-live-button"></slot>
485
551
  <div class="mxp-spacer"></div>
486
- ${V(t)}
487
- ${A()}
488
- <media-cast-button></media-cast-button>
489
- ${H()}
490
- ${B()}
552
+ ${Z(t)}
553
+ ${$()}
554
+ ${M()}
555
+ ${z()}
556
+ ${W()}
491
557
  <div class="mxp-padding-2"></div>
492
558
  </media-control-bar>
493
- `;function _t(t,e){return{audio:t.hasAttribute("audio"),streamType:t.getAttribute("stream-type"),playerSize:t.getAttribute("player-size"),defaultHiddenCaptions:t.hasAttribute("default-hidden-captions"),forwardSeekOffset:t.getAttribute("forward-seek-offset"),backwardSeekOffset:t.getAttribute("backward-seek-offset"),...e}}var Ie=class extends HTMLElement{static get observedAttributes(){return["audio","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset"]}constructor(){super();this.attachShadow({mode:"open"}),Q(Rt(_t(this)),this.shadowRoot)}attributeChangedCallback(){Q(Rt(_t(this)),this.shadowRoot)}};customElements.get("media-theme-mux")||customElements.define("media-theme-mux",Ie);var Dt=Ie;import si,{MediaError as Ve}from"@mux/mux-video";import{StreamTypes as C}from"@mux/playback-core";import{VideoEvents as Qa}from"@mux/mux-video";var za="en",U={code:za};var Pt="en";function s(t,e=!0){var i,n;let a=e&&(n=(i=U)==null?void 0:i[t])!=null?n:t,o=e?U.code:Pt;return new Nt(a,o)}var Nt=class{constructor(e,a=(o=>(o=U.code)!=null?o:Pt)()){this.message=e,this.locale=a}format(e){return this.message.replace(/\{(\w+)\}/g,(a,o)=>{var i;return(i=e[o])!=null?i:""})}toString(){return this.message}};function Vt(t){let e="";return Object.entries(t).forEach(([a,o])=>{o!=null&&(e+=`${Za(a)}: ${o}; `)}),e?e.trim():void 0}function Za(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ht(t){return t.replace(/[-_]([a-z])/g,(e,a)=>a.toUpperCase())}function te(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function me(t){let e=Wa(t).toString();return e?"?"+e:""}function Wa(t){let e={};for(let a in t)t[a]!=null&&(e[a]=t[a]);return new URLSearchParams(e)}function ae(t){let a=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(atob(a).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(o)}var $e=(t,e)=>!t||!e?!1:t.contains(e)?!0:$e(t,e.getRootNode().host);import{StreamTypes as ce}from"@mux/playback-core";var Re="mux.com",qa=()=>{try{return"0.1.0-beta.23"}catch{}return"UNKNOWN"},ja=qa(),ue=()=>ja,_e=(t,{token:e,domain:a=Re}={})=>`https://stream.${a}/${t}.m3u8${me(!!e?{token:e}:{redundant_streams:!0})}`,Bt=(t,{token:e,thumbnailTime:a,domain:o=Re}={})=>{let i=e==null?a:void 0;return`https://image.${o}/${t}/thumbnail.jpg${me({token:e,time:i})}`},Ut=(t,{token:e,domain:a=Re}={})=>`https://image.${a}/${t}/storyboard.vtt${me({token:e})}`,Ga={crossorigin:"crossOrigin",playsinline:"playsInline"};function Ft(t){var e;return(e=Ga[t])!=null?e:Ht(t)}var Kt=t=>{var a,o;let{media:e}=t;return(o=(a=e==null?void 0:e._hls)==null?void 0:a.liveSyncPosition)!=null?o:(e==null?void 0:e.seekable.length)?e==null?void 0:e.seekable.end(e.seekable.length-1):void 0},De=t=>{let e=Kt(t);if(e==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}t.currentTime=e},Xa=1,Ja=5,Yt=3,zt=.5,Zt=t=>{var n;let{streamType:e}=t,a=Kt(t),o=(n=t.media)==null?void 0:n.currentTime;if(a==null||o==null)return!1;let i=a-o;return e===ce.LL_LIVE||e===ce.LL_DVR?i<=Xa*(Yt+zt):e===ce.LIVE||e===ce.DVR?i<=Ja*(Yt+zt):!1};var Wt=`[mux-player ${ue()}]`;function L(...t){console.warn(Wt,...t)}function F(...t){console.error(Wt,...t)}function pe(t){var a;let e=(a=t.message)!=null?a:"";if(t.file){let o="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${s("Read more: ")}
494
- ${o}${t.file}`}L(e)}var u={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",SRC:"src",POSTER:"poster",PRELOAD:"preload"},he={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},ei=Qa.filter(t=>t!=="error"),ti=Object.values(u),ai=Object.values(he);function qt(t){t.querySelectorAll(":scope > track").forEach(e=>{var a;(a=t.media)==null||a.append(e.cloneNode())}),ei.forEach(e=>{var a;(a=t.media)==null||a.addEventListener(e,o=>{t.dispatchEvent(new Event(o.type))})})}var jt=class extends HTMLElement{static get observedAttributes(){return[...ti,...ai]}constructor(){super();this.querySelectorAll(":scope > track").forEach(o=>{var i;(i=this.media)==null||i.append(o.cloneNode())});let e=o=>{for(let i of o)i.type==="childList"&&(i.removedNodes.forEach(n=>{var c,g;let r=(c=this.media)==null?void 0:c.querySelector(`track[src="${n.src}"]`);r&&((g=this.media)==null||g.removeChild(r))}),i.addedNodes.forEach(n=>{var r;(r=this.media)==null||r.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,a,o){switch(e){case he.MUTED:{this.media&&(this.media.muted=o!=null);return}case he.VOLUME:{let i=+o;this.media&&!Number.isNaN(i)&&(this.media.volume=i);return}case he.PLAYBACKRATE:{let i=+o;this.media&&!Number.isNaN(i)&&(this.media.playbackRate=i);return}}}play(){var e;return(e=this.media)==null?void 0:e.play()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var a;return(a=this.media)==null?void 0:a.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get video(){return L("<mux-player>.video is deprecated, please use .media instead"),this.media}get paused(){var e,a;return(a=(e=this.media)==null?void 0:e.paused)!=null?a:!0}get duration(){var e,a;return(a=(e=this.media)==null?void 0:e.duration)!=null?a:NaN}get ended(){var e,a;return(a=(e=this.media)==null?void 0:e.ended)!=null?a:!1}get buffered(){var e;return(e=this.media)==null?void 0:e.buffered}get readyState(){var e,a;return(a=(e=this.media)==null?void 0:e.readyState)!=null?a:0}get videoWidth(){var e;return(e=this.media)==null?void 0:e.videoWidth}get videoHeight(){var e;return(e=this.media)==null?void 0:e.videoHeight}get currentTime(){var e,a;return(a=(e=this.media)==null?void 0:e.currentTime)!=null?a:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,a;return(a=(e=this.media)==null?void 0:e.volume)!=null?a:1}set volume(e){this.media&&(this.media.volume=Number(e))}get src(){return R(this,u.SRC)}set src(e){this.setAttribute(u.SRC,`${e}`)}get poster(){var e;return(e=R(this,u.POSTER))!=null?e:""}set poster(e){this.setAttribute(u.POSTER,`${e}`)}get playbackRate(){var e,a;return(a=(e=this.media)==null?void 0:e.playbackRate)!=null?a:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get crossOrigin(){return R(this,u.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(u.CROSSORIGIN,`${e}`)}get autoplay(){return R(this,u.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(u.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(u.AUTOPLAY)}get loop(){return R(this,u.LOOP)!=null}set loop(e){e?this.setAttribute(u.LOOP,""):this.removeAttribute(u.LOOP)}get muted(){return R(this,u.MUTED)!=null}set muted(e){e?this.setAttribute(u.MUTED,""):this.removeAttribute(u.MUTED)}get playsInline(){return R(this,u.PLAYSINLINE)!=null}set playsInline(e){e?this.setAttribute(u.PLAYSINLINE,""):this.removeAttribute(u.PLAYSINLINE)}get preload(){return R(this,u.PRELOAD)}set preload(e){e?this.setAttribute(u.PRELOAD,e):this.removeAttribute(u.PRELOAD)}};function R(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var Pe=jt;var Gt=`
559
+ `;var oa=`
495
560
  :host {
496
561
  z-index: 100;
497
562
  display: flex;
@@ -549,17 +614,17 @@ ${o}${t.file}`}L(e)}var u={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"l
549
614
  text-align: center;
550
615
  line-height: 1.4;
551
616
  }
552
- `,Xt=document.createElement("template");Xt.innerHTML=`
617
+ `,ra=document.createElement("template");ra.innerHTML=`
553
618
  <style>
554
- ${Gt}
619
+ ${oa}
555
620
  </style>
556
621
 
557
622
  <div class="dialog">
558
623
  <slot></slot>
559
624
  </div>
560
- `;var K=class extends HTMLElement{constructor(){super();var e;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})),Jt(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),ii(this))}attributeChangedCallback(e,a,o){e==="open"&&a!==o&&(o!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&Jt(this)}};K.styles=Gt,K.template=Xt,K.observedAttributes=["open"];function Jt(t){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(t.dispatchEvent(e),e.defaultPrevented)return;let a=t.querySelector("[autofocus]:not([disabled])");!a&&t.tabIndex>=0&&(a=t),a||(a=Qt(t.shadowRoot)),t._previouslyFocusedElement=document.activeElement,document.activeElement instanceof HTMLElement&&document.activeElement.blur(),t.addEventListener("transitionend",()=>{a instanceof HTMLElement&&a.focus({preventScroll:!0})},{once:!0})}function Qt(t){let a=["button","input","keygen","select","textarea"].map(function(i){return i+":not([disabled])"});a.push('[tabindex]:not([disabled]):not([tabindex=""])');let o=t==null?void 0:t.querySelector(a.join(", "));if(!o&&"attachShadow"in Element.prototype){let i=(t==null?void 0:t.querySelectorAll("*"))||[];for(let n=0;n<i.length&&!(i[n].tagName&&i[n].shadowRoot&&(o=Qt(i[n].shadowRoot),o));n++);}return o}function ii(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}globalThis.customElements.get("media-dialog")||(globalThis.customElements.define("media-dialog",K),globalThis.MediaDialog=K);var Ne=K;var ea=document.createElement("template");ea.innerHTML=`
625
+ `;var j=class extends HTMLElement{constructor(){super();var e;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})),na(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),pi(this))}attributeChangedCallback(e,a,o){e==="open"&&a!==o&&(o!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&na(this)}};j.styles=oa,j.template=ra,j.observedAttributes=["open"];function na(t){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(t.dispatchEvent(e),e.defaultPrevented)return;let a=t.querySelector("[autofocus]:not([disabled])");!a&&t.tabIndex>=0&&(a=t),a||(a=sa(t.shadowRoot)),t._previouslyFocusedElement=document.activeElement,document.activeElement instanceof HTMLElement&&document.activeElement.blur(),t.addEventListener("transitionend",()=>{a instanceof HTMLElement&&a.focus({preventScroll:!0})},{once:!0})}function sa(t){let a=["button","input","keygen","select","textarea"].map(function(i){return i+":not([disabled])"});a.push('[tabindex]:not([disabled]):not([tabindex=""])');let o=t==null?void 0:t.querySelector(a.join(", "));if(!o&&"attachShadow"in Element.prototype){let i=(t==null?void 0:t.querySelectorAll("*"))||[];for(let r=0;r<i.length&&!(i[r].tagName&&i[r].shadowRoot&&(o=sa(i[r].shadowRoot),o));r++);}return o}function pi(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}globalThis.customElements.get("media-dialog")||(globalThis.customElements.define("media-dialog",j),globalThis.MediaDialog=j);var Ze=j;var la=document.createElement("template");la.innerHTML=`
561
626
  <style>
562
- ${Ne.styles}
627
+ ${Ze.styles}
563
628
 
564
629
  .close {
565
630
  background: none;
@@ -588,7 +653,7 @@ ${o}${t.file}`}L(e)}var u={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"l
588
653
  </svg>
589
654
  </button>
590
655
  </slot>
591
- `;var ge=class extends Ne{constructor(){super();var e,a;(a=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||a.addEventListener("click",()=>{this.close()})}};ge.template=ea;globalThis.customElements.get("mxp-dialog")||(globalThis.customElements.define("mxp-dialog",ge),globalThis.MxpDialog=ge);var ta=`:host {
656
+ `;var Te=class extends Ze{constructor(){super();var e,a;(a=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||a.addEventListener("click",()=>{this.close()})}};Te.template=la;globalThis.customElements.get("mxp-dialog")||(globalThis.customElements.define("mxp-dialog",Te),globalThis.MxpDialog=Te);var da=`:host {
592
657
  display: inline-block;
593
658
  }
594
659
 
@@ -630,59 +695,62 @@ media-controller {
630
695
  .mxp-seek-to-live-button[aria-disabled]::before {
631
696
  color: #fb3c4d;
632
697
  }
633
- `;import{StreamTypes as Z}from"@mux/playback-core";var aa=t=>d`
698
+ `;import{StreamTypes as Q}from"@mux/playback-core";var ma=t=>l`
634
699
  <style>
635
- ${ta}
700
+ ${da}
636
701
  </style>
637
- ${ni(t)}
638
- `,ni=t=>{var e,a,o,i,n,r,c,g,M,E,I,v,S,$,p,P,G,X,Ue,Fe,Ke,Ye,ze,Ze,We,qe;return d`
639
- <media-theme-mux
702
+ ${bi(t)}
703
+ `,gi=Object.values(u).flatMap(t=>t.split(" ")),fi=[...new Set(gi)].join(", "),bi=t=>{var e,a,o,i,r,n,m,g,T,y,A,E,O,_,h,H,ie,oe,Ge,Xe,Je,Qe,et;return l`
704
+ <${Fe((e=Ne(t.theme))!=null?e:"media-theme-mux")}
705
+ nohotkeys="${(a=t.noHotKeys)!=null?a:!1}"
640
706
  audio="${t.audio||!1}"
641
- style="${(e=Vt({"--primary-color":t.primaryColor,"--secondary-color":t.secondaryColor,"--mux-time-range-padding":t.secondaryColor?"0":null,"--media-range-track-border-radius":t.secondaryColor?"0":null}))!=null?e:!1}"
642
- class="size-${t.playerSize}"
707
+ style="${(o=ot({"--primary-color":t.primaryColor,"--secondary-color":t.secondaryColor}))!=null?o:!1}"
708
+ class="size-${t.playerSize}${t.secondaryColor?" two-tone":""}"
643
709
  stream-type="${t.streamType}"
644
710
  player-size="${t.playerSize}"
645
711
  default-hidden-captions="${t.defaultHiddenCaptions}"
646
712
  forward-seek-offset="${t.forwardSeekOffset}"
647
713
  backward-seek-offset="${t.backwardSeekOffset}"
714
+ exportparts="seek-live, ${fi}"
648
715
  >
649
716
  <mux-video
650
717
  slot="media"
651
718
  crossorigin
652
719
  playsinline
653
- autoplay="${(a=t.autoplay)!=null?a:!1}"
654
- muted="${(o=t.muted)!=null?o:!1}"
655
- loop="${(i=t.loop)!=null?i:!1}"
656
- preload="${(n=t.preload)!=null?n:!1}"
657
- debug="${(r=t.debug)!=null?r:!1}"
658
- prefer-mse="${(c=t.preferMse)!=null?c:!1}"
720
+ autoplay="${(i=t.autoplay)!=null?i:!1}"
721
+ muted="${(r=t.muted)!=null?r:!1}"
722
+ loop="${(n=t.loop)!=null?n:!1}"
723
+ preload="${(m=t.preload)!=null?m:!1}"
724
+ debug="${(g=t.debug)!=null?g:!1}"
725
+ prefer-mse="${(T=t.preferMse)!=null?T:!1}"
659
726
  start-time="${t.startTime!=null?t.startTime:!1}"
660
- metadata-video-id="${(E=(M=t.metadataVideoId)!=null?M:(g=t.metadata)==null?void 0:g.video_id)!=null?E:!1}"
661
- metadata-video-title="${(S=(v=t.metadataVideoTitle)!=null?v:(I=t.metadata)==null?void 0:I.video_title)!=null?S:!1}"
662
- metadata-viewer-user-id="${(P=(p=t.metadataViewerUserId)!=null?p:($=t.metadata)==null?void 0:$.viewer_user_id)!=null?P:!1}"
663
- beacon-collection-domain="${(G=t.beaconCollectionDomain)!=null?G:!1}"
727
+ metadata-video-id="${(y=t.metadataVideoId)!=null?y:!1}"
728
+ metadata-video-title="${(A=t.metadataVideoTitle)!=null?A:!1}"
729
+ metadata-viewer-user-id="${(E=t.metadataViewerUserId)!=null?E:!1}"
730
+ beacon-collection-domain="${(O=t.beaconCollectionDomain)!=null?O:!1}"
664
731
  player-software-name="${t.playerSoftwareName}"
665
732
  player-software-version="${t.playerSoftwareVersion}"
666
- env-key="${(X=t.envKey)!=null?X:!1}"
667
- stream-type="${(Ue=t.streamType)!=null?Ue:!1}"
668
- custom-domain="${(Fe=t.customDomain)!=null?Fe:!1}"
669
- src="${t.src?t.src:t.playbackId?_e(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
670
- poster="${t.poster?t.poster:t.playbackId&&!t.audio?Bt(t.playbackId,{domain:t.customDomain,thumbnailTime:(Ke=t.thumbnailTime)!=null?Ke:t.startTime,token:t.tokens.thumbnail}):!1}"
671
- cast-src="${t.src?t.src:t.playbackId?_e(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
672
- cast-stream-type="${[Z.LIVE,Z.LL_LIVE].includes(t.streamType)?"live":!1}"
733
+ env-key="${(_=t.envKey)!=null?_:!1}"
734
+ stream-type="${(h=t.streamType)!=null?h:!1}"
735
+ custom-domain="${(H=t.customDomain)!=null?H:!1}"
736
+ src="${t.src?t.src:t.playbackId?De(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
737
+ poster="${t.poster?t.poster:t.playbackId&&!t.audio?nt(t.playbackId,{domain:t.customDomain,thumbnailTime:(ie=t.thumbnailTime)!=null?ie:t.startTime,token:t.tokens.thumbnail}):!1}"
738
+ cast-src="${t.src?t.src:t.playbackId?De(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
739
+ cast-stream-type="${[Q.LIVE,Q.LL_LIVE].includes(t.streamType)?"live":!1}"
673
740
  >
674
- ${t.playbackId&&!t.audio&&![Z.LIVE,Z.LL_LIVE,Z.DVR,Z.LL_DVR].includes(t.streamType)?d`<track
675
- label="thumbnails"
676
- default
677
- kind="metadata"
678
- src="${Ut(t.playbackId,{domain:t.customDomain,token:t.tokens.storyboard})}"
679
- />`:d``}
741
+ ${t.playbackId&&!t.audio&&![Q.LIVE,Q.LL_LIVE,Q.DVR,Q.LL_DVR].includes(t.streamType)?l`<track
742
+ label="thumbnails"
743
+ default
744
+ kind="metadata"
745
+ src="${st(t.playbackId,{domain:t.customDomain,token:t.tokens.storyboard})}"
746
+ />`:l``}
680
747
  </mux-video>
681
748
  <button
682
749
  slot="seek-to-live-button"
683
- aria-disabled="${t.inLiveWindow}"
684
- onclick="${function(ra){var je;if((je=t.onSeekToLive)==null||je.call(t,ra),t.paused){let sa=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(sa)}}}"
750
+ part="seek-live button"
685
751
  class="mxp-seek-to-live-button"
752
+ aria-disabled="${t.inLiveWindow}"
753
+ onclick="${function(pa){var tt;if((tt=t.onSeekToLive)==null||tt.call(t,pa),t.paused){let ha=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(ha)}}}"
686
754
  >
687
755
  Live
688
756
  </button>
@@ -692,18 +760,18 @@ media-controller {
692
760
  onclose="${t.onCloseErrorDialog}"
693
761
  oninitfocus="${t.onInitFocusDialog}"
694
762
  >
695
- ${((Ye=t.dialog)==null?void 0:Ye.title)?d`<h3>${t.dialog.title}</h3>`:d``}
763
+ ${((oe=t.dialog)==null?void 0:oe.title)?l`<h3>${t.dialog.title}</h3>`:l``}
696
764
  <p>
697
- ${(ze=t.dialog)==null?void 0:ze.message}
698
- ${((Ze=t.dialog)==null?void 0:Ze.linkUrl)?d`<a
699
- href="${t.dialog.linkUrl}"
700
- target="_blank"
701
- rel="external noopener"
702
- aria-label="${(We=t.dialog.linkText)!=null?We:""} ${s("(opens in a new window)")}"
703
- >${(qe=t.dialog.linkText)!=null?qe:t.dialog.linkUrl}</a
704
- >`:d``}
765
+ ${(Ge=t.dialog)==null?void 0:Ge.message}
766
+ ${((Xe=t.dialog)==null?void 0:Xe.linkUrl)?l`<a
767
+ href="${t.dialog.linkUrl}"
768
+ target="_blank"
769
+ rel="external noopener"
770
+ aria-label="${(Je=t.dialog.linkText)!=null?Je:""} ${s("(opens in a new window)")}"
771
+ >${(Qe=t.dialog.linkText)!=null?Qe:t.dialog.linkUrl}</a
772
+ >`:l``}
705
773
  </p>
706
774
  </mxp-dialog>
707
- </media-theme-mux>
708
- `};import{MediaError as fe}from"@mux/mux-video";function be(t,e,a,o,i){var c,g,M;let n={},r={};switch(t.code){case fe.MEDIA_ERR_NETWORK:{switch(n.title=s("Network Error",i),n.message=t.message,(c=t.data)==null?void 0:c.response.code){case 412:{n.title=s("Video is not currently available",i),n.message=s("The live stream or video file are not yet ready.",i),r.message=s("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",i),r.file="412-not-playable.md";break}case 404:{n.title=s("Video does not exist",i),n.message="",r.message=s("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",i),r.file="404-not-found.md";break}case 403:{if(n.title=s("Invalid playback URL",i),n.message=s("The video URL or playback-token are formatted with incorrect or incomplete information.",i),r.message=s("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",i),r.file="missing-signed-tokens.md",!o)break;let{exp:E,aud:I,sub:v}=ae(o),S=Date.now()>E*1e3,$=v!==a,p=I!=="v",P={timeStyle:"medium",dateStyle:"medium"};if(S){n.title=s("Video URL has expired",i),n.message=s("The video\u2019s secured playback-token has expired.",i),r.message=s("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",i).format({expiredDate:new Intl.DateTimeFormat(U.code,P).format(E*1e3),currentDate:new Intl.DateTimeFormat(U.code,P).format(Date.now())}),r.file="403-expired-token.md";break}if($){n.title=s("Video URL is formatted incorrectly",i),n.message=s("The video\u2019s playback ID does not match the one encoded in the playback-token.",i),r.message=s("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",i).format({playbackId:a,tokenPlaybackId:v}),r.file="403-playback-id-mismatch.md";break}if(p){n.title=s("Video URL is formatted incorrectly",i),n.message=s("The playback-token is formatted with incorrect information.",i),r.message=s("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",i).format({tokenType:I}),r.file="403-incorrect-aud-value.md";break}r.message=s("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",i),r.file="403-malformatted-token.md";break}}break}case fe.MEDIA_ERR_DECODE:{let{message:E}=t;n={title:s("Media Error",i),message:E},r.file="media-decode-error.md";break}case fe.MEDIA_ERR_SRC_NOT_SUPPORTED:{let E=(M=(g=t.data)==null?void 0:g.response)==null?void 0:M.code;if(E>=400&&E<500){t.code=fe.MEDIA_ERR_NETWORK,t.data={response:{code:E}},{dialog:n,devlog:r}=be(t,e,a,o);break}n={title:s("Source Not Supported",i),message:t.message},r.file="media-src-not-supported.md";break}default:n={title:s("Error",i),message:t.message};break}return e&&(n={title:s("Your device appears to be offline",i),message:s("Check your internet connection and try reloading this video.",i)}),{dialog:n,devlog:r}}var di=Object.values(C),li=700,mi=300,He={LG:"large",SM:"small",XS:"extra-small"};function ve(t){let e=t.getBoundingClientRect();return e.width<mi?He.XS:e.width<li?He.SM:He.LG}var ci={SRC:"src"},l={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_MSE:"prefer-mse",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_SOFTWARE_NAME:"player-software-name",METADATA_VIDEO_ID:"metadata-video-id",METADATA_VIDEO_TITLE:"metadata-video-title",METADATA_VIEWER_USER_ID:"metadata-viewer-user-id",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},m={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"};function ui(t,e){var a,o;return{src:!t.playbackId&&t.src,poster:t.getAttribute("poster"),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,muted:t.muted,paused:t.paused,playsInline:t.playsInline,preload:t.preload,playbackId:t.playbackId,envKey:t.envKey,debug:t.debug,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferMse:t.preferMse,audio:t.audio,streamType:t.streamType,primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,customDomain:(a=t.getAttribute(l.CUSTOM_DOMAIN))!=null?a:void 0,playerSize:ve((o=t.mediaController)!=null?o:t),metadataVideoId:t.getAttribute(l.METADATA_VIDEO_ID),metadataVideoTitle:t.getAttribute(l.METADATA_VIDEO_TITLE),metadataViewerUserId:t.getAttribute(l.METADATA_VIEWER_USER_ID),...e}}var pi=Object.values(l),hi=Object.values(m),gi=ue(),fi="mux-player",ia={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},W,ne,_,q,w,re,oa,D,ie,j,Be,se,na,Ee,bi,Te,vi,ke,yi,xe,Ei,Ae,Ti,Le,ki,ye=class extends Pe{constructor(){super();f(this,re);f(this,D);f(this,j);f(this,se);f(this,Ee);f(this,Te);f(this,ke);f(this,xe);f(this,Ae);f(this,Le);f(this,W,!1);f(this,ne,{});f(this,_,!0);f(this,q,void 0);f(this,w,{...ia,onCloseErrorDialog:()=>h(this,D,ie).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{$e(this,document.activeElement)||e.preventDefault()},onSeekToLive:()=>De(this)});this.attachShadow({mode:"open"}),this.isConnected&&h(this,re,oa).call(this)}static get observedAttributes(){var e;return[...(e=Pe.observedAttributes)!=null?e:[],...pi,...hi]}get theme(){var e,a;return Array.from((a=(e=this.shadowRoot)==null?void 0:e.children)!=null?a:[]).find(({localName:o})=>o.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(){h(this,se,na).call(this),h(this,Ee,bi).call(this)}disconnectedCallback(){h(this,Te,vi).call(this)}attributeChangedCallback(e,a,o){switch(y(this,W)||h(this,re,oa).call(this),super.attributeChangedCallback(e,a,o),[l.PLAYBACK_ID,ci.SRC,m.PLAYBACK_TOKEN].includes(e)&&a!==o&&N(this,w,{...y(this,w),...ia}),h(this,j,Be).call(this,{[Ft(e)]:o}),e){case m.THUMBNAIL_TIME:{o!=null&&this.tokens.thumbnail&&L(s("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case m.THUMBNAIL_TOKEN:{let{aud:n}=ae(o);o&&n!=="t"&&L(s("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:n}));break}case m.STORYBOARD_TOKEN:{let{aud:n}=ae(o);o&&n!=="s"&&L(s("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:n}));break}case l.PLAYBACK_ID:{o.includes("?token")&&F(s("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:o})),this.streamType?this.streamType!=null&&!di.includes(this.streamType)&&pe({file:"invalid-stream-type.md",message:s("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live` or `ll-live`").format({streamType:this.streamType})}):pe({file:"invalid-stream-type.md",message:String(s("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live` or `ll-live`"))});break}}}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){return y(this,w).inLiveWindow}get hls(){return L("<mux-player>.hls is deprecated, please use ._hls instead"),this._hls}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 audio(){return this.hasAttribute(m.AUDIO)}set audio(e){e||this.removeAttribute(m.AUDIO),this.setAttribute(m.AUDIO,"")}get thumbnailTime(){return te(this.getAttribute(m.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(m.THUMBNAIL_TIME,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(m.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(m.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(m.SECONDARY_COLOR))!=null?e:void 0}set secondaryColor(e){this.setAttribute(m.SECONDARY_COLOR,`${e}`)}get forwardSeekOffset(){var e;return(e=te(this.getAttribute(m.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(m.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=te(this.getAttribute(m.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(m.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(l.PLAYER_SOFTWARE_NAME))!=null?e:fi}get playerSoftwareVersion(){var e;return(e=this.getAttribute(l.PLAYER_SOFTWARE_VERSION))!=null?e:gi}get beaconCollectionDomain(){var e;return(e=this.getAttribute(l.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(l.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(l.BEACON_COLLECTION_DOMAIN))}get playbackId(){var e;return(e=this.getAttribute(l.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){this.setAttribute(l.PLAYBACK_ID,`${e}`)}get customDomain(){var e;return(e=this.getAttribute(l.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(l.CUSTOM_DOMAIN,e):this.removeAttribute(l.CUSTOM_DOMAIN))}get envKey(){var e;return(e=oe(this,l.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(l.ENV_KEY,`${e}`)}get debug(){return oe(this,l.DEBUG)!=null}set debug(e){e?this.setAttribute(l.DEBUG,""):this.removeAttribute(l.DEBUG)}get streamType(){return oe(this,l.STREAM_TYPE)}set streamType(e){this.setAttribute(l.STREAM_TYPE,`${e}`)}get startTime(){return te(oe(this,l.START_TIME))}set startTime(e){this.setAttribute(l.START_TIME,`${e}`)}get preferMse(){return oe(this,l.PREFER_MSE)!=null}set preferMse(e){e?this.setAttribute(l.PREFER_MSE,""):this.removeAttribute(l.PREFER_MSE)}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){this.media&&(this.media.metadata=e)}get tokens(){let e=this.getAttribute(m.PLAYBACK_TOKEN),a=this.getAttribute(m.THUMBNAIL_TOKEN),o=this.getAttribute(m.STORYBOARD_TOKEN);return{...y(this,ne),...e!=null?{playback:e}:{},...a!=null?{thumbnail:a}:{},...o!=null?{storyboard:o}:{}}}set tokens(e){N(this,ne,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(m.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(m.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(m.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(m.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(m.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(m.STORYBOARD_TOKEN,`${e}`)}};W=new WeakMap,ne=new WeakMap,_=new WeakMap,q=new WeakMap,w=new WeakMap,re=new WeakSet,oa=function(){var e,a;y(this,W)||(N(this,W,!0),h(this,D,ie).call(this,{playerSize:ve(this)}),customElements.upgrade(this.theme),this.theme instanceof Dt||F("<media-theme-mux> failed to upgrade!"),customElements.upgrade(this.media),this.media instanceof si||F("<mux-video> failed to upgrade!"),customElements.upgrade(this.mediaController),this.mediaController instanceof ri||F("<media-controller> failed to upgrade!"),qt(this),h(this,xe,Ei).call(this),h(this,Ae,Ti).call(this),h(this,ke,yi).call(this),N(this,_,(a=(e=this.mediaController)==null?void 0:e.hasAttribute("user-inactive"))!=null?a:!0),h(this,Le,ki).call(this))},D=new WeakSet,ie=function(e){Object.assign(y(this,w),e),h(this,j,Be).call(this)},j=new WeakSet,Be=function(e={}){Q(aa(ui(this,{...y(this,w),...e})),this.shadowRoot)},se=new WeakSet,na=function(){var e,a;y(this,w).playerSize!=ve((e=this.mediaController)!=null?e:this)&&h(this,D,ie).call(this,{playerSize:ve((a=this.mediaController)!=null?a:this)})},Ee=new WeakSet,bi=function(){var e;N(this,q,new ResizeObserver(()=>h(this,se,na).call(this))),y(this,q).observe((e=this.mediaController)!=null?e:this)},Te=new WeakSet,vi=function(){var e;(e=y(this,q))==null||e.disconnect()},ke=new WeakSet,yi=function(){var a,o,i,n,r;(a=this.mediaController)==null||a.addEventListener("mediaplayrequest",c=>{var g;((g=c.target)==null?void 0:g.localName)==="media-play-button"&&this.streamType&&[C.LIVE,C.LL_LIVE,C.DVR,C.LL_DVR].includes(this.streamType)&&this.hasPlayed&&De(this)});let e=()=>{let c=Zt(this),g=y(this,w).inLiveWindow;c!==g&&(h(this,D,ie).call(this,{inLiveWindow:c}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(o=this.media)==null||o.addEventListener("progress",e),(i=this.media)==null||i.addEventListener("waiting",e),(n=this.media)==null||n.addEventListener("timeupdate",e),(r=this.media)==null||r.addEventListener("emptied",e)},xe=new WeakSet,Ei=function(){var a;let e=o=>{let{detail:i}=o;if(i instanceof Ve||(i=new Ve(i.message,i.code,i.fatal)),!(i==null?void 0:i.fatal)){L(i),i.data&&L(`${i.name} data:`,i.data);return}let{dialog:n,devlog:r}=be(i,!window.navigator.onLine,this.playbackId,this.playbackToken);r.message&&pe(r),F(i),i.data&&F(`${i.name} data:`,i.data),h(this,D,ie).call(this,{isDialogOpen:!0,dialog:n})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(o={})=>{var n,r,c;if(!((n=this.media)==null?void 0:n.error))return o;let{devlog:i}=be((r=this.media)==null?void 0:r.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:i.message?String(i.message):o.player_error_message}}),(a=this.media)==null||a.addEventListener("error",o=>{var n,r;let{detail:i}=o;if(!i){let{message:c,code:g}=(r=(n=this.media)==null?void 0:n.error)!=null?r:{};i=new Ve(c,g)}!(i==null?void 0:i.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:i}))})},Ae=new WeakSet,Ti=function(){var a,o,i,n;let e=()=>h(this,j,Be).call(this);(o=(a=this.media)==null?void 0:a.textTracks)==null||o.addEventListener("addtrack",e),(n=(i=this.media)==null?void 0:i.textTracks)==null||n.addEventListener("removetrack",e)},Le=new WeakSet,ki=function(){var E,I;let e=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(/.*iPhone.*/.test(navigator.userAgent))return;let i,n=new WeakMap,r=()=>this.streamType&&[C.LIVE,C.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,c=(v,S)=>{if(r())return;Array.from(v&&v.activeCues||[]).forEach(p=>{if(!(!p.snapToLines||p.line<-5||p.line>=0&&p.line<10))if(!S||this.paused){let P=p.text.split(`
709
- `).length,G=a?-2:-3;this.streamType&&[C.LIVE,C.LL_LIVE].includes(this.streamType)&&(G=a?-1:-2);let X=G-P;if(p.line===X)return;n.has(p)||n.set(p,p.line),p.line=0,p.line=X}else setTimeout(()=>{p.line=n.get(p)||"auto"},500)})},g=()=>{var v;c(i,(v=e==null?void 0:e.hasAttribute("user-inactive"))!=null?v:!1)},M=()=>{var $;let S=Array.from((($=e==null?void 0:e.media)==null?void 0:$.textTracks)||[]).filter(p=>["subtitles","captions"].includes(p.kind)&&p.mode==="showing")[0];S!==i&&(i==null||i.removeEventListener("cuechange",g)),i=S,i==null||i.addEventListener("cuechange",g),c(i,y(this,_))};M(),(E=e==null?void 0:e.media)==null||E.textTracks.addEventListener("change",M),(I=e==null?void 0:e.media)==null||I.textTracks.addEventListener("addtrack",M),e==null||e.addEventListener("userinactivechange",()=>{let v=e==null?void 0:e.hasAttribute("user-inactive");y(this,_)!==v&&(N(this,_,v),c(i,y(this,_)))})};function oe(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}globalThis.customElements.get("mux-player")||(globalThis.customElements.define("mux-player",ye),globalThis.MuxPlayerElement=ye);var tn=ye;export{Ve as MediaError,tn as default,oe as getVideoAttribute};
775
+ </${Fe((et=Ne(t.theme))!=null?et:"media-theme-mux")}>
776
+ `};import{MediaError as xe}from"@mux/mux-video";function Ae(t,e,a,o,i){var m,g,T;let r={},n={};switch(t.code){case xe.MEDIA_ERR_NETWORK:{switch(r.title=s("Network Error",i),r.message=t.message,(m=t.data)==null?void 0:m.response.code){case 412:{r.title=s("Video is not currently available",i),r.message=s("The live stream or video file are not yet ready.",i),n.message=s("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",i),n.file="412-not-playable.md";break}case 404:{r.title=s("Video does not exist",i),r.message="",n.message=s("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",i),n.file="404-not-found.md";break}case 403:{if(r.title=s("Invalid playback URL",i),r.message=s("The video URL or playback-token are formatted with incorrect or incomplete information.",i),n.message=s("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",i),n.file="missing-signed-tokens.md",!o)break;let{exp:y,aud:A,sub:E}=re(o),O=Date.now()>y*1e3,_=E!==a,h=A!=="v",H={timeStyle:"medium",dateStyle:"medium"};if(O){r.title=s("Video URL has expired",i),r.message=s("The video\u2019s secured playback-token has expired.",i),n.message=s("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",i).format({expiredDate:new Intl.DateTimeFormat(F.code,H).format(y*1e3),currentDate:new Intl.DateTimeFormat(F.code,H).format(Date.now())}),n.file="403-expired-token.md";break}if(_){r.title=s("Video URL is formatted incorrectly",i),r.message=s("The video\u2019s playback ID does not match the one encoded in the playback-token.",i),n.message=s("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",i).format({playbackId:a,tokenPlaybackId:E}),n.file="403-playback-id-mismatch.md";break}if(h){r.title=s("Video URL is formatted incorrectly",i),r.message=s("The playback-token is formatted with incorrect information.",i),n.message=s("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",i).format({tokenType:A}),n.file="403-incorrect-aud-value.md";break}n.message=s("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",i),n.file="403-malformatted-token.md";break}}break}case xe.MEDIA_ERR_DECODE:{let{message:y}=t;r={title:s("Media Error",i),message:y},n.file="media-decode-error.md";break}case xe.MEDIA_ERR_SRC_NOT_SUPPORTED:{let y=(T=(g=t.data)==null?void 0:g.response)==null?void 0:T.code;if(y>=400&&y<500){t.code=xe.MEDIA_ERR_NETWORK,t.data={response:{code:y}},{dialog:r,devlog:n}=Ae(t,e,a,o);break}r={title:s("Source Not Supported",i),message:t.message},n.file="media-src-not-supported.md";break}default:r={title:s("Error",i),message:t.message};break}return e&&(r={title:s("Your device appears to be offline",i),message:s("Check your internet connection and try reloading this video.",i)}),{dialog:r,devlog:n}}var Ti=Object.values(P),xi=700,Ai=300,We={LG:"large",SM:"small",XS:"extra-small"};function we(t){let e=t.getBoundingClientRect();return e.width<Ai?We.XS:e.width<xi?We.SM:We.LG}var wi={SRC:"src"},c={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_MSE:"prefer-mse",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_SOFTWARE_NAME:"player-software-name",METADATA_VIDEO_ID:"metadata-video-id",METADATA_VIDEO_TITLE:"metadata-video-title",METADATA_VIEWER_USER_ID:"metadata-viewer-user-id",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},d={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"};function Li(t,e){var a,o;return{src:!t.playbackId&&t.src,poster:t.getAttribute("poster"),theme:t.getAttribute("theme"),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(d.NOHOTKEYS),muted:t.muted,paused:t.paused,playsInline:t.playsInline,preload:t.preload,playbackId:t.playbackId,envKey:t.envKey,debug:t.debug,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferMse:t.preferMse,audio:t.audio,streamType:t.streamType,primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,customDomain:(a=t.getAttribute(c.CUSTOM_DOMAIN))!=null?a:void 0,playerSize:we((o=t.mediaController)!=null?o:t),metadataVideoId:t.getAttribute(c.METADATA_VIDEO_ID),metadataVideoTitle:t.getAttribute(c.METADATA_VIDEO_TITLE),metadataViewerUserId:t.getAttribute(c.METADATA_VIEWER_USER_ID),...e}}var Si=Object.values(c),$i=Object.values(d),Mi=he(),Ci="mux-player",ca={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},q,me,V,ee,C,te,je,B,le,ae,qe,ce,ua,Se,Oi,$e,Ri,Me,Ii,Ce,Pi,Oe,_i,Re,Di,Le=class extends Be{constructor(){super();k(this,te);k(this,B);k(this,ae);k(this,ce);k(this,Se);k(this,$e);k(this,Me);k(this,Ce);k(this,Oe);k(this,Re);k(this,q,!1);k(this,me,{});k(this,V,!0);k(this,ee,void 0);k(this,C,{...ca,onCloseErrorDialog:()=>f(this,B,le).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Pe(this,document.activeElement)||e.preventDefault()},onSeekToLive:()=>Ve(this)});this.attachShadow({mode:"open"}),this.isConnected&&f(this,te,je).call(this)}static get observedAttributes(){var e;return[...(e=Be.observedAttributes)!=null?e:[],...Si,...$i]}get theme(){var e,a;return Array.from((a=(e=this.shadowRoot)==null?void 0:e.children)!=null?a:[]).find(({localName:o})=>o.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(){f(this,ce,ua).call(this),f(this,Se,Oi).call(this)}disconnectedCallback(){f(this,$e,Ri).call(this)}attributeChangedCallback(e,a,o){switch(v(this,q)||f(this,te,je).call(this),super.attributeChangedCallback(e,a,o),[c.PLAYBACK_ID,wi.SRC,d.PLAYBACK_TOKEN].includes(e)&&a!==o&&U(this,C,{...v(this,C),...ca}),f(this,ae,qe).call(this,{[lt(e)]:o}),e){case d.THUMBNAIL_TIME:{o!=null&&this.tokens.thumbnail&&w(s("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case d.THUMBNAIL_TOKEN:{let{aud:r}=re(o);o&&r!=="t"&&w(s("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:r}));break}case d.STORYBOARD_TOKEN:{let{aud:r}=re(o);o&&r!=="s"&&w(s("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:r}));break}case c.PLAYBACK_ID:{o.includes("?token")&&D(s("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:o})),this.streamType?this.streamType!=null&&!Ti.includes(this.streamType)&&ge({file:"invalid-stream-type.md",message:s("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})}):ge({file:"invalid-stream-type.md",message:String(s("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}}}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,C).inLiveWindow}get hls(){return w("<mux-player>.hls is deprecated, please use ._hls instead"),this._hls}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 audio(){return this.hasAttribute(d.AUDIO)}set audio(e){e||this.removeAttribute(d.AUDIO),this.setAttribute(d.AUDIO,"")}get nohotkeys(){return this.hasAttribute(d.NOHOTKEYS)}set nohotkeys(e){e||this.removeAttribute(d.NOHOTKEYS),this.setAttribute(d.NOHOTKEYS,"")}get thumbnailTime(){return K(this.getAttribute(d.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(d.THUMBNAIL_TIME,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(d.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(d.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(d.SECONDARY_COLOR))!=null?e:void 0}set secondaryColor(e){this.setAttribute(d.SECONDARY_COLOR,`${e}`)}get forwardSeekOffset(){var e;return(e=K(this.getAttribute(d.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(d.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=K(this.getAttribute(d.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(d.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(d.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(c.PLAYER_SOFTWARE_NAME))!=null?e:Ci}get playerSoftwareVersion(){var e;return(e=this.getAttribute(c.PLAYER_SOFTWARE_VERSION))!=null?e:Mi}get beaconCollectionDomain(){var e;return(e=this.getAttribute(c.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(c.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(c.BEACON_COLLECTION_DOMAIN))}get playbackId(){var e;return(e=this.getAttribute(c.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){this.setAttribute(c.PLAYBACK_ID,`${e}`)}get customDomain(){var e;return(e=this.getAttribute(c.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(c.CUSTOM_DOMAIN,e):this.removeAttribute(c.CUSTOM_DOMAIN))}get envKey(){var e;return(e=de(this,c.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(c.ENV_KEY,`${e}`)}get debug(){return de(this,c.DEBUG)!=null}set debug(e){e?this.setAttribute(c.DEBUG,""):this.removeAttribute(c.DEBUG)}get streamType(){return de(this,c.STREAM_TYPE)}set streamType(e){this.setAttribute(c.STREAM_TYPE,`${e}`)}get startTime(){return K(de(this,c.START_TIME))}set startTime(e){this.setAttribute(c.START_TIME,`${e}`)}get preferMse(){return de(this,c.PREFER_MSE)!=null}set preferMse(e){e?this.setAttribute(c.PREFER_MSE,""):this.removeAttribute(c.PREFER_MSE)}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(v(this,q)||f(this,te,je).call(this),!this.media){D("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(d.PLAYBACK_TOKEN),a=this.getAttribute(d.THUMBNAIL_TOKEN),o=this.getAttribute(d.STORYBOARD_TOKEN);return{...v(this,me),...e!=null?{playback:e}:{},...a!=null?{thumbnail:a}:{},...o!=null?{storyboard:o}:{}}}set tokens(e){U(this,me,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(d.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(d.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(d.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(d.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(d.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(d.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,o,i){var n;let r=(n=this.media)==null?void 0:n.nativeEl;if(!!r)return ki(r,e,a,o,i)}removeTextTrack(e){var o;let a=(o=this.media)==null?void 0:o.nativeEl;if(!!a)return Ei(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};q=new WeakMap,me=new WeakMap,V=new WeakMap,ee=new WeakMap,C=new WeakMap,te=new WeakSet,je=function(){var e,a,o;if(!v(this,q)){U(this,q,!0),f(this,B,le).call(this,{playerSize:we(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof HTMLElement))throw""}catch{D(`<${(e=this.theme)==null?void 0:e.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof vi))throw""}catch{D("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof yi))throw""}catch{D("<media-controller> failed to upgrade!")}ht(this),f(this,Ce,Pi).call(this),f(this,Oe,_i).call(this),f(this,Me,Ii).call(this),U(this,V,(o=(a=this.mediaController)==null?void 0:a.hasAttribute("user-inactive"))!=null?o:!0),f(this,Re,Di).call(this)}},B=new WeakSet,le=function(e){Object.assign(v(this,C),e),f(this,ae,qe).call(this)},ae=new WeakSet,qe=function(e={}){ve(ma(Li(this,{...v(this,C),...e})),this.shadowRoot)},ce=new WeakSet,ua=function(){var e,a;v(this,C).playerSize!=we((e=this.mediaController)!=null?e:this)&&f(this,B,le).call(this,{playerSize:we((a=this.mediaController)!=null?a:this)})},Se=new WeakSet,Oi=function(){var e;U(this,ee,new ResizeObserver(()=>f(this,ce,ua).call(this))),v(this,ee).observe((e=this.mediaController)!=null?e:this)},$e=new WeakSet,Ri=function(){var e;(e=v(this,ee))==null||e.disconnect()},Me=new WeakSet,Ii=function(){var a,o,i,r,n;(a=this.mediaController)==null||a.addEventListener("mediaplayrequest",m=>{var g;((g=m.target)==null?void 0:g.localName)==="media-play-button"&&this.streamType&&[P.LIVE,P.LL_LIVE,P.DVR,P.LL_DVR].includes(this.streamType)&&this.hasPlayed&&Ve(this)});let e=()=>{let m=ut(this),g=v(this,C).inLiveWindow;m!==g&&(f(this,B,le).call(this,{inLiveWindow:m}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(o=this.media)==null||o.addEventListener("progress",e),(i=this.media)==null||i.addEventListener("waiting",e),(r=this.media)==null||r.addEventListener("timeupdate",e),(n=this.media)==null||n.addEventListener("emptied",e)},Ce=new WeakSet,Pi=function(){var a;let e=o=>{let{detail:i}=o;if(i instanceof ze||(i=new ze(i.message,i.code,i.fatal)),!(i==null?void 0:i.fatal)){w(i),i.data&&w(`${i.name} data:`,i.data);return}let{dialog:r,devlog:n}=Ae(i,!window.navigator.onLine,this.playbackId,this.playbackToken);n.message&&ge(n),D(i),i.data&&D(`${i.name} data:`,i.data),f(this,B,le).call(this,{isDialogOpen:!0,dialog:r})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(o={})=>{var r,n,m;if(!((r=this.media)==null?void 0:r.error))return o;let{devlog:i}=Ae((n=this.media)==null?void 0:n.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(m=this.media)==null?void 0:m.error.code,player_error_message:i.message?String(i.message):o.player_error_message}}),(a=this.media)==null||a.addEventListener("error",o=>{var r,n;let{detail:i}=o;if(!i){let{message:m,code:g}=(n=(r=this.media)==null?void 0:r.error)!=null?n:{};i=new ze(m,g)}!(i==null?void 0:i.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:i}))})},Oe=new WeakSet,_i=function(){var a,o,i,r;let e=()=>f(this,ae,qe).call(this);(o=(a=this.media)==null?void 0:a.textTracks)==null||o.addEventListener("addtrack",e),(r=(i=this.media)==null?void 0:i.textTracks)==null||r.addEventListener("removetrack",e)},Re=new WeakSet,Di=function(){var y,A;let e=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(/.*iPhone.*/.test(navigator.userAgent))return;let i,r=new WeakMap,n=()=>this.streamType&&[P.LIVE,P.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,m=(E,O)=>{if(n())return;Array.from(E&&E.activeCues||[]).forEach(h=>{if(!(!h.snapToLines||h.line<-5||h.line>=0&&h.line<10))if(!O||this.paused){let H=h.text.split(`
777
+ `).length,ie=a?-2:-3;this.streamType&&[P.LIVE,P.LL_LIVE].includes(this.streamType)&&(ie=a?-1:-2);let oe=ie-H;if(h.line===oe)return;r.has(h)||r.set(h,h.line),h.line=0,h.line=oe}else setTimeout(()=>{h.line=r.get(h)||"auto"},500)})},g=()=>{var E;m(i,(E=e==null?void 0:e.hasAttribute("user-inactive"))!=null?E:!1)},T=()=>{var _;let O=Array.from(((_=e==null?void 0:e.media)==null?void 0:_.textTracks)||[]).filter(h=>["subtitles","captions"].includes(h.kind)&&h.mode==="showing")[0];O!==i&&(i==null||i.removeEventListener("cuechange",g)),i=O,i==null||i.addEventListener("cuechange",g),m(i,v(this,V))};T(),(y=e==null?void 0:e.media)==null||y.textTracks.addEventListener("change",T),(A=e==null?void 0:e.media)==null||A.textTracks.addEventListener("addtrack",T),e==null||e.addEventListener("userinactivechange",()=>{let E=e==null?void 0:e.hasAttribute("user-inactive");v(this,V)!==E&&(U(this,V,E),m(i,v(this,V)))})};function de(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}globalThis.customElements.get("mux-player")||(globalThis.customElements.define("mux-player",Le),globalThis.MuxPlayerElement=Le);var vr=Le;export{ze as MediaError,vr as default,de as getVideoAttribute};