@theoplayer/web-ui 1.16.2 → 1.16.3

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.
@@ -1,5 +1,5 @@
1
1
  !/*!
2
- * THEOplayer Open Video UI for Web (v1.16.2)
2
+ * THEOplayer Open Video UI for Web (v1.16.3)
3
3
  * License: MIT
4
4
  */function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("theoplayer/chromeless")):"function"==typeof define&&define.amd?define(["exports","theoplayer/chromeless"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).THEOplayerUI={},e.THEOplayer)}(this,function(e,t){"use strict";function r(){return void 0!==window.ShadyCSS&&!1===window.ShadyCSS.nativeShadow}function a(e){r()&&window.ShadyCSS.styleElement(e)}function i(e,t){void 0!==window.ShadyCSS&&!1===window.ShadyCSS.nativeCss?window.ShadyCSS.styleSubtree(e,t):null!=t&&/**
5
5
  * @license
@@ -19,7 +19,7 @@ ${t}`)}customElements.define("theoplayer-button",N);let q=o("theoplayer-link-but
19
19
  </slot></span><span part="high-icon"><slot name="high-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M16.275 20.625q-.575.25-1.1-.15-.525-.4-.525-1.05 0-.35.188-.613.187-.262.512-.387 1.925-.825 3.113-2.575 1.187-1.75 1.187-3.875T18.463 8.1q-1.188-1.75-3.113-2.575-.325-.125-.512-.4-.188-.275-.188-.625 0-.65.525-1.038.525-.387 1.1-.137 2.6 1.1 4.175 3.425 1.575 2.325 1.575 5.225 0 2.9-1.575 5.225-1.575 2.325-4.175 3.425ZM3.55 15.85q-.65 0-1.112-.463-.463-.462-.463-1.112v-4.55q0-.65.463-1.113Q2.9 8.15 3.55 8.15h2.925l3.5-3.5q.75-.75 1.713-.338.962.413.962 1.463v12.45q0 1.05-.962 1.463-.963.412-1.713-.338l-3.5-3.5Zm11.1.45V7.65q1.3.625 2.088 1.8.787 1.175.787 2.55 0 1.375-.787 2.525-.788 1.15-2.088 1.775Z"/></svg>
20
20
  </slot></span>`,":host(:not([volume-level=high])) [part=high-icon],:host(:not([volume-level=low])) [part=low-icon],:host(:not([volume-level=off])) [part=off-icon]{display:none!important}")),K=["volumechange"];class Y extends H(N,["player"]){static get observedAttributes(){return[...N.observedAttributes,p.VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),this._updateFromPlayer(),this._updateAriaLabel()}get volumeLevel(){return this.getAttribute(p.VOLUME_LEVEL)||"off"}get player(){return this._player}set player(e){this._player!==e&&(void 0!==this._player&&this._player.removeEventListener(K,this._updateFromPlayer),this._player=e,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener(K,this._updateFromPlayer))}handleClick(){void 0!==this._player&&(this._player.muted=!this._player.muted,this._updateFromPlayer())}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),Y.observedAttributes.indexOf(e)>=0&&(i(this),this._updateAriaLabel())}_updateAriaLabel(){let e="off"===this.getAttribute(p.VOLUME_LEVEL)?"unmute":"mute";this.setAttribute(p.ARIA_LABEL,e)}constructor(){super({template:$()}),this._updateFromPlayer=()=>{let e="off";if(void 0!==this._player){let t=this._player.volume;e=this._player.muted?"off":t<.5?"low":"high"}this.setAttribute(p.VOLUME_LEVEL,e)},this._upgradeProperty("player")}}customElements.define("theoplayer-mute-button",Y);let W=o("theoplayer-seek-button",I(`<span part="icon"><slot name="icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M12 22.25q-1.925 0-3.6-.738-1.675-.737-2.912-1.974Q4.25 18.3 3.525 16.625q-.725-1.675-.725-3.6 0-1.9.725-3.575.725-1.675 1.963-2.925 1.237-1.25 2.925-1.975Q10.1 3.825 12 3.825h.15l-.7-.7q-.3-.325-.313-.788-.012-.462.313-.812.35-.35.813-.35.462 0 .812.325l2.65 2.675q.325.325.325.8 0 .475-.325.8l-2.65 2.65q-.325.325-.8.325-.475 0-.825-.35-.3-.325-.3-.8 0-.475.3-.8l.7-.7H12q-2.9 0-4.912 2.012-2.013 2.013-2.013 4.913 0 2.9 2.013 4.925Q9.1 19.975 12 19.975q2.6 0 4.55-1.687 1.95-1.688 2.325-4.238.05-.45.4-.738.35-.287.8-.287.45 0 .788.275.337.275.287.7-.375 3.55-2.987 5.9Q15.55 22.25 12 22.25Z"/></svg>
21
21
  </slot></span><span part="offset"></span>`,':host{position:relative}:host([seek-offset^="-"]) [part=icon]{transform:scaleX(-1)}[part=offset]{color:#fff;color:var(--theoplayer-icon-color,#fff);font-size:7.2px;font-size:var(--theoplayer-seek-button-font-size,calc(var(--theoplayer-button-icon-height, var(--theoplayer-control-height, 24px))*.3));left:50%;position:absolute;top:52.5%;transform:translate(-50%,-50%)}'));class Z extends H(N,["player"]){static get observedAttributes(){return[...N.observedAttributes,p.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this._updateAriaLabel()}get seekOffset(){var e;return Number(null!=(e=this.getAttribute(p.SEEK_OFFSET))?e:10)}set seekOffset(e){this.setAttribute(p.SEEK_OFFSET,String(e))}get player(){return this._player}set player(e){this._player=e}handleClick(){if(void 0===this._player)return;let e=this._player.duration;!isNaN(e)&&(this._player.currentTime=Math.max(0,Math.min(e,this._player.currentTime+this.seekOffset)))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),r!==t&&(e===p.SEEK_OFFSET&&w(this._offsetEl,String(Math.abs(this.seekOffset))),Z.observedAttributes.indexOf(e)>=0&&(i(this),this._updateAriaLabel()))}_updateAriaLabel(){let e=this.seekOffset,t=e>=0?`seek forward by ${e} seconds`:`seek backward by ${-e} seconds`;this.setAttribute(p.ARIA_LABEL,t)}constructor(){super({template:W()}),this._offsetEl=this.shadowRoot.querySelector('[part="offset"]'),this._upgradeProperty("player"),this._upgradeProperty("seekOffset")}}customElements.define("theoplayer-seek-button",Z);var j=":host{background:transparent;background:var(--theoplayer-control-background,transparent);box-sizing:border-box;color:#fff;color:var(--theoplayer-text-color,#fff);display:inline-block;font-size:14px;font-size:var(--theoplayer-text-font-size,14px);line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));overflow:hidden;padding:10px;padding:var(--theoplayer-control-padding,10px);pointer-events:auto;text-align:center;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}";function J(e){return!isNaN(e)&&isFinite(e)}function X(e,t=0,r){let a,i=e<0||r&&0===e,o=Math.floor(t/60%60),n=Math.floor(t/3600);if(J(e=Math.abs(e))){let t=Math.floor(e%60),r=Math.floor(e/60%60),i=Math.floor(e/3600),s=i>0||n>0;a=[s?`${i}`:"",(s||o>=0)&&r<10?`0${r}`:`${r}`,t<10?`0${t}`:`${t}`]}else a=[n>0?"--":"","--","--"];let s=a.filter(e=>""!==e).join(":");return`${i?"-":""}${s}`}let ee=[["hour","hours"],["minute","minutes"],["second","seconds"]];function et(e,t){let r=ee[t][+(1!==e)];return`${e} ${r}`}function er(e,t){if(!J(e))return"";let r=e<0||t&&0===e,a=Math.floor((e=Math.abs(e))%60),i=Math.floor(e/60)%60,o=Math.floor(e/3600),n=[0===o?"":et(o,0),0===i?"":et(i,1),0===a&&(o>0||i>0)?"":et(a,2)].filter(e=>""!==e).join(", ");return`${n}${r?" remaining":""}`}let ea=o("theoplayer-time-display",`<style>${j}</style><span></span>`),ei=["timeupdate","seeking","seeked","durationchange"];class eo extends H(HTMLElement,["player","streamType"]){static get observedAttributes(){return[p.REMAINING,p.REMAINING_WHEN_LIVE,p.SHOW_DURATION,p.STREAM_TYPE]}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){a(this),this.hasAttribute("role")||this.setAttribute("role","progressbar"),this.hasAttribute(p.ARIA_LABEL)||this.setAttribute(p.ARIA_LABEL,"playback time"),this.hasAttribute(p.ARIA_LIVE)||this.setAttribute(p.ARIA_LIVE,"off"),this._updateFromPlayer()}get player(){return this._player}set player(e){this._player!==e&&(void 0!==this._player&&this._player.removeEventListener(ei,this._updateFromPlayer),this._player=e,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener(ei,this._updateFromPlayer))}get streamType(){return this.getAttribute(p.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(p.STREAM_TYPE,e)}attributeChangedCallback(e,t,r){r!==t&&eo.observedAttributes.indexOf(e)>=0&&(this._updateFromPlayer(),i(this))}constructor(){super(),this._updateFromPlayer=()=>{var e;let t,r;let a=this._player?this._player.currentTime:0,i=this._player?this._player.duration:NaN,o=null==(e=this._player)?void 0:e.seekable,n=isFinite(i)?i:o&&o.length>0?o.end(0):NaN,s=this.hasAttribute(p.REMAINING)||this.hasAttribute(p.REMAINING_WHEN_LIVE)&&"vod"!==this.streamType,l=a;s&&(l=-((n||0)-a));let h=this.hasAttribute(p.SHOW_DURATION);t=h&&!s?`${X(l,n,s)} / ${X(n)}`:X(l,n,s),r=isNaN(i)?"video not loaded, unknown time":h?`${er(l,s)} of ${er(n)}`:er(l,s),w(this._spanEl,t),this.setAttribute("aria-valuetext",r)};let e=this.attachShadow({mode:"open"});e.appendChild(ea().content.cloneNode(!0)),this._spanEl=e.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-time-display",eo);let en=o("theoplayer-duration-display",`<style>${j}</style><span></span>`),es=["durationchange"];class el extends H(HTMLElement,["player"]){_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){a(this),this.hasAttribute(p.ARIA_LIVE)||this.setAttribute(p.ARIA_LIVE,"off"),this._updateFromPlayer()}get player(){return this._player}set player(e){this._player!==e&&(void 0!==this._player&&this._player.removeEventListener(es,this._updateFromPlayer),this._player=e,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener(es,this._updateFromPlayer))}constructor(){super(),this._updateFromPlayer=()=>{let e=X(this._player?this._player.duration:NaN);w(this._spanEl,e)};let e=this.attachShadow({mode:"open"});e.appendChild(en().content.cloneNode(!0)),this._spanEl=e.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-duration-display",el);let eh=!function(){try{let e=new Event("change");return"change"===e.type}catch(e){}return!1}()?function(e,t){let r=document.createEvent("Event");return r.initEvent(e,(null==t?void 0:t.bubbles)||!1,(null==t?void 0:t.cancelable)||!1),r}:function(e,t){return new Event(e,t)},ed=!function(){try{let e=new CustomEvent("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?function(e,t){let r=document.createEvent("CustomEvent");return r.initCustomEvent(e,(null==t?void 0:t.bubbles)||!1,(null==t?void 0:t.cancelable)||!1,null==t?void 0:t.detail),r}:function(e,t){return new CustomEvent(e,t)},ep=o("theoplayer-radio-button",I("<slot></slot>"));class eu extends N{static get observedAttributes(){return[...N.observedAttributes,p.ARIA_CHECKED,p.VALUE]}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","radio"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),super.connectedCallback()}get checked(){return"true"===this.getAttribute(p.ARIA_CHECKED)}set checked(e){this.setAttribute(p.ARIA_CHECKED,e?"true":"false")}get value(){return this._value}set value(e){this._value=e}handleClick(){this.checked=!0,this.dispatchEvent(eh("input",{bubbles:!0,composed:!0}))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),r!==t&&(e===p.ARIA_CHECKED?this.dispatchEvent(eh("change",{bubbles:!0})):e===p.VALUE&&(this.value=r),eu.observedAttributes.indexOf(e)>=0&&i(this))}constructor(e){super({template:ep(),...e}),this._value=void 0,this._upgradeProperty("checked")}}customElements.define("theoplayer-radio-button",eu);class ec{get left(){return this.x}set left(e){this.x=e}get right(){return this.x+this.width}set right(e){this.x=e-this.width}get top(){return this.y}set top(e){this.y=e}get bottom(){return this.y+this.height}set bottom(e){this.y=e-this.height}static fromRect(e){var t,r,a,i,o,n;return new ec(null!=(r=null!=(t=e.left)?t:e.x)?r:0,null!=(i=null!=(a=e.top)?a:e.y)?i:0,null!=(o=e.width)?o:0,null!=(n=e.height)?n:0)}overlaps(e){return this.x<e.right&&this.right>e.x&&this.y<e.bottom&&this.bottom>e.y}contains(e){return this.x<=e.x&&e.right<=this.right&&this.y<=e.y&&e.bottom<=this.bottom}union(e){let t=Math.min(this.x,e.x),r=Math.min(this.y,e.y),a=Math.max(this.right,e.right)-t,i=Math.max(this.bottom,e.bottom)-r;return new ec(t,r,a,i)}snapToPixels(){return new ec(Math.round(this.x),Math.round(this.y),Math.round(this.width),Math.round(this.height))}clone(){return new ec(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height,left:this.left,right:this.right,top:this.top,bottom:this.bottom}}constructor(e,t,r,a){this.x=e,this.y=t,this.width=r,this.height=a}}function ey(){let e=function(){var e;let t;let r=document.activeElement;if(null==r)return null;for(;null!=(t=null==(e=r.shadowRoot)?void 0:e.activeElement);)r=t;return r}();return e&&e!==document.body&&m(e)?e:null}function eg(e,t,r){var a,i;let o;let n=ey();if(null===n)return!1;let s=ec.fromRect(e.getBoundingClientRect()).snapToPixels(),l=ec.fromRect(n.getBoundingClientRect()).snapToPixels(),h=t.map(e=>({child:e,rect:ec.fromRect(e.getBoundingClientRect()).snapToPixels()})).filter(e=>e.rect.width>0&&e.rect.height>0);if(r===S.LEFT||r===S.RIGHT){let e=l.clone();r===S.LEFT?(e.left=s.left,e.width=l.left-s.left):(e.left=l.right,e.width=s.right-l.right),0===(o=h.filter(t=>e.overlaps(t.rect))).length&&(e.top=s.top,e.height=s.height,o=h.filter(t=>e.overlaps(t.rect)))}else{let e=l.clone();r===S.UP?(e.top=s.top,e.height=l.top-s.top):(e.top=l.bottom,e.height=s.bottom-l.bottom),0===(o=h.filter(t=>e.overlaps(t.rect))).length&&(e.left=s.left,e.width=s.width,o=h.filter(t=>e.overlaps(t.rect)))}let d=(a=o,i=e=>{var t,r;let a;return t=e.rect,r=l,a=0,t.right<r.left?a+=r.left-t.right:r.right<t.left&&(a+=t.left-r.right),t.bottom<r.top?a+=r.top-t.bottom:r.bottom<t.top&&(a+=t.top-r.bottom),a},function(e,t){if(0!==e.length)return e.reduce((e,r)=>0>=t(e,r)?e:r)}(a,(e,t)=>i(e)-i(t)));return void 0!==d&&(d.child.focus(),!0)}let em=o("theoplayer-radio-group","<slot></slot>");class ev extends H(HTMLElement,["deviceType"]){_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){a(this),this.hasAttribute("role")||this.setAttribute("role","radiogroup"),this.addEventListener("keydown",this._onKeyDown),this.shadowRoot.addEventListener("change",this._onButtonChange),this._slot.addEventListener("slotchange",this._onSlotChange),this._onSlotChange()}disconnectedCallback(){this.removeEventListener("keydown",this._onKeyDown),this.shadowRoot.removeEventListener("change",this._onButtonChange),this._slot.removeEventListener("slotchange",this._onSlotChange)}get deviceType(){return this.getAttribute(p.DEVICE_TYPE)||"desktop"}set deviceType(e){this.setAttribute(p.DEVICE_TYPE,e)}get focusedRadioButton(){var e;return null!=(e=_(this._radioButtons,e=>0===e.tabIndex))?e:null}get checkedRadioButton(){var e;return null!=(e=_(this._radioButtons,e=>e.checked))?e:null}get firstRadioButton(){var e;return null!=(e=this._radioButtons[0])?e:null}get lastRadioButton(){let e=this._radioButtons;return e.length>0?e[e.length-1]:null}allRadioButtons(){return this._radioButtons}_prevRadioButton(e){let t=this._radioButtons.indexOf(e);return t>0?this._radioButtons[t-1]:null}_nextRadioButton(e){let t=this._radioButtons.indexOf(e);return t>=0&&t<this._radioButtons.length-1?this._radioButtons[t+1]:null}_focusPrevButton(){let e=this.focusedRadioButton||this.firstRadioButton;return!!e&&(e===this.firstRadioButton?this.setFocusedRadioButton(this.lastRadioButton):this.setFocusedRadioButton(this._prevRadioButton(e)),!0)}_focusNextButton(){let e=this.focusedRadioButton||this.firstRadioButton;return!!e&&(e===this.lastRadioButton?this.setFocusedRadioButton(this.firstRadioButton):this.setFocusedRadioButton(this._nextRadioButton(e)),!0)}setFocusedRadioButton(e){this._unfocusAll(),e&&(e.tabIndex=0,e.focus())}_unfocusAll(){for(let e of this.allRadioButtons())e.tabIndex=-1}setCheckedRadioButton(e){for(let t of this.allRadioButtons())t.checked=t===e;this.dispatchEvent(eh("change",{bubbles:!0}))}constructor(){super(),this._radioButtons=[],this._onSlotChange=()=>{let e=A(this._slot),t=[];for(let r of e)if(!eb(r)){let e=L(r);e&&t.push(e)}if(t.length>0&&Promise.all(t).then(this._onSlotChange,y),this._radioButtons=e.filter(eb),!this.focusedRadioButton){var r;null==(r=this.firstRadioButton)||r.setAttribute("tabindex","0")}},this._onKeyDown=e=>{if("tv"===this.deviceType&&P(e.keyCode)){eg(this,this._radioButtons,e.keyCode)&&(e.preventDefault(),e.stopPropagation());return}switch(e.keyCode){case S.UP:case S.LEFT:this._focusPrevButton()&&e.preventDefault();break;case S.DOWN:case S.RIGHT:this._focusNextButton()&&e.preventDefault();break;case S.HOME:e.preventDefault(),this.setFocusedRadioButton(this.firstRadioButton);break;case S.END:e.preventDefault(),this.setFocusedRadioButton(this.lastRadioButton)}},this._onButtonChange=e=>{let t=e.target;null!==t&&t.checked&&this.setCheckedRadioButton(e.target)};let e=this.attachShadow({mode:"open"});e.appendChild(em().content.cloneNode(!0)),this._slot=e.querySelector("slot"),this._upgradeProperty("deviceType")}}function eb(e){return e instanceof eu}customElements.define("theoplayer-radio-group",ev);let e_="theoplayermenuclose",ef="theoplayermenuchange";function ek(e,t,r=""){return`<style>:host{box-sizing:border-box;color:#fff;color:var(--theoplayer-menu-color,#fff);display:flex;flex-direction:column;font-size:14px;font-size:var(--theoplayer-text-font-size,14px);pointer-events:none}:host([hidden]){display:none!important}[part=heading]{align-items:center;align-self:stretch;display:flex;pointer-events:auto}[part=heading] ::slotted(span),[part=heading]>span{padding:10px;padding:var(--theoplayer-control-padding,10px);padding-left:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part=content],[part=heading]>theoplayer-menu-close-button{pointer-events:auto}[part=content]{--theoplayer-control-hover-background:var(--theoplayer-menu-control-hover-background,hsla(0,0%,100%,.3));align-self:center;display:flex;flex-direction:column;margin:10px;margin:var(--theoplayer-menu-margin,10px);max-height:100%;max-width:100%;max-width:var(--theoplayer-menu-max-width,100%);min-height:0;min-width:80%;min-width:var(--theoplayer-menu-min-width,80%);overflow-y:auto}${r}</style><div part="heading"><theoplayer-menu-close-button></theoplayer-menu-close-button>${e}</div><div part="content">${t}</div>`}let eE=o("theoplayer-menu",ek('<slot name="heading"></slot>',"<slot></slot>"));class ew extends HTMLElement{static get observedAttributes(){return[p.MENU_OPENED,p.MENU_CLOSE_ON_INPUT]}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){a(this),this.hasAttribute(p.MENU_OPENED)||this.setAttribute("hidden",""),this._contentEl.addEventListener("input",this._onContentInput)}disconnectedCallback(){this._contentEl.removeEventListener("input",this._onContentInput)}get closeOnInput(){return this.hasAttribute(p.MENU_CLOSE_ON_INPUT)}set closeOnInput(e){x(this,p.MENU_CLOSE_ON_INPUT,e)}openMenu(){this.setAttribute(p.MENU_OPENED,"")}closeMenu(){this.removeAttribute(p.MENU_OPENED)}attributeChangedCallback(e,t,r){if(r!==t){if(e===p.MENU_OPENED){x(this,p.HIDDEN,null==r);let e=ed(ef,{bubbles:!0});this.dispatchEvent(e)}ew.observedAttributes.indexOf(e)>=0&&i(this)}}constructor(e){var t;super(),this._onContentInput=()=>{if(this.hasAttribute(p.MENU_CLOSE_ON_INPUT)){let e=ed(e_,{bubbles:!0,composed:!0});this.dispatchEvent(e)}};let r=null!=(t=null==e?void 0:e.template)?t:eE(),a=this.attachShadow({mode:"open",delegatesFocus:!0});a.appendChild(r.content.cloneNode(!0)),this._contentEl=a.querySelector('[part="content"]')}}customElements.define("theoplayer-menu",ew);let ex="theoplayermenutoggle";function eT(e,t=""){return`<style>:host{box-sizing:border-box;display:flex;flex-direction:column;min-height:0;pointer-events:none}:host([hidden]){display:none!important}::slotted(*),:host>*{align-self:stretch;flex-grow:1;justify-self:stretch;min-height:0}${t}</style>${e}`}let eA=o("theoplayer-menu-group",eT("<slot></slot>"));class eC extends HTMLElement{static get observedAttributes(){return[p.MENU_OPENED]}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){var e;a(this),this.hasAttribute(p.MENU_OPENED)||this.setAttribute("hidden",""),this._onMenuListChange(),this.shadowRoot.addEventListener(ex,this._onToggleMenu),this.shadowRoot.addEventListener(e_,this._onCloseMenu),this.shadowRoot.addEventListener(ef,this._onMenuChange),null==(e=this._menuSlot)||e.addEventListener("slotchange",this._onMenuListChange)}disconnectedCallback(){var e;this.shadowRoot.removeEventListener(ex,this._onToggleMenu),this.shadowRoot.removeEventListener(e_,this._onCloseMenu),this.shadowRoot.removeEventListener(ef,this._onMenuChange),null==(e=this._menuSlot)||e.removeEventListener("slotchange",this._onMenuListChange)}attributeChangedCallback(e,t,r){if(r!==t){if(e===p.MENU_OPENED){null!=r?(this.removeAttribute("hidden"),this.removeEventListener("keydown",this._onKeyDown),this.addEventListener("keydown",this._onKeyDown)):(this.setAttribute("hidden",""),this.removeEventListener("keydown",this._onKeyDown));let e=ed(ef,{bubbles:!0});this.dispatchEvent(e)}eC.observedAttributes.indexOf(e)>=0&&i(this)}}getMenuById(e){return e&&e!==this.id?_(this._menus,t=>t.id===e):this}openMenu(e,t){let r=this.getMenuById(e);if(r===this&&(r=this._menus[0]),!r)return!1;let a=this.getCurrentMenu_(),i=f(this._openMenuStack,e=>e.menu===r);return i>=0?this.closeMenusFromIndex_(i+1):this._openMenuStack.push({menu:r,opener:t}),a&&a.menu.closeMenu(),r.openMenu(),this.setAttribute(p.MENU_OPENED,""),r.focus(),!0}closeMenu(e){var t,r;let a=this.getMenuById(e);if(a===this&&(a=null==(r=this._openMenuStack[0])?void 0:r.menu),!a)return!1;let i=f(this._openMenuStack,e=>e.menu===a);if(i<0)return!1;let o=this._openMenuStack[i];this.closeMenusFromIndex_(i);let n=this.getCurrentMenu_();return void 0!==n?(n.menu.openMenu(),this.setAttribute(p.MENU_OPENED,""),o.opener&&n.menu.contains(o.opener)?o.opener.focus():n.menu.focus()):(this.removeAttribute(p.MENU_OPENED),null==(t=o.opener)||t.focus()),!0}closeMenusFromIndex_(e){let t=this._openMenuStack.length-e;for(let t=this._openMenuStack.length-1;t>=e;t--)this._openMenuStack[t].menu.closeMenu();this._openMenuStack.splice(e,t)}hasCurrentMenu(){return this._openMenuStack.length>0}getCurrentMenu_(){return this._openMenuStack.length>0?this._openMenuStack[this._openMenuStack.length-1]:void 0}closeCurrentMenu(){let e=this.getCurrentMenu_();return void 0!==e&&(this.closeMenu(e.menu.id),!0)}isMenuOpen(e){let t=this.getMenuById(e);return!!t&&this._openMenuStack.some(e=>e.menu===t)}constructor(e){var t;super(),this._menus=[],this._openMenuStack=[],this._onMenuListChange=()=>{let e=[...b(this.shadowRoot.children),...this._menuSlot?A(this._menuSlot):[]],t=[];for(let r of e)if(!eL(r)){let e=L(r);e&&t.push(e)}t.length>0&&Promise.all(t).then(this._onMenuListChange,y);let r=e.filter(eL);for(let e of this._menus)0>r.indexOf(e)&&this.closeMenu(e.id);for(let e of r)0>this._menus.indexOf(e)&&e.closeMenu();this._menus=r},this._onToggleMenu=e=>{let t=e.detail.menu;if(!this.getMenuById(t))return;e.stopPropagation();let r=m(e.target)?e.target:void 0;this.isMenuOpen(t)?this.closeMenu(t):this.openMenu(t,r)},this._onCloseMenu=e=>{this.closeCurrentMenu()&&(e.preventDefault(),e.stopPropagation())},this._onMenuChange=e=>{let t=this.getCurrentMenu_();t&&t.menu===e.target&&t.menu instanceof eC&&!t.menu.hasCurrentMenu()&&this.closeCurrentMenu()},this._onKeyDown=e=>{!e.altKey&&R(e.keyCode)&&this.closeCurrentMenu()&&(e.preventDefault(),e.stopPropagation())};let r=null!=(t=null==e?void 0:e.template)?t:eA(),a=this.attachShadow({mode:"open",delegatesFocus:!0});a.appendChild(r.content.cloneNode(!0)),this._menuSlot=a.querySelector("slot")}}function eL(e){return!!m(e)&&(e instanceof ew||e instanceof eC)}customElements.define("theoplayer-menu-group",eC);let eS=o("theoplayer-menu-button",I("<slot></slot>"));class eP extends N{static get observedAttributes(){return[...N.observedAttributes,p.MENU]}connectedCallback(){super.connectedCallback(),this.hasAttribute("aria-haspopup")||this.setAttribute("aria-haspopup","true")}get menu(){return this.getAttribute(p.MENU)}set menu(e){e?this.setAttribute(p.MENU,e):this.removeAttribute(p.MENU)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e!==p.MENU||this.hasAttribute("aria-controls")&&this.getAttribute("aria-controls")!==t||this.setAttribute("aria-controls",r)}handleClick(){let e=this.menu;if(e){let t=ed(ex,{bubbles:!0,composed:!0,detail:{menu:e}});this.dispatchEvent(t)}}constructor(e){super({template:eS(),...e}),this._upgradeProperty("menu")}}customElements.define("theoplayer-menu-button",eP);let eR=o("theoplayer-menu-close-button",I(`<span part="icon"><slot><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="m10.525 19.275-6.375-6.35q-.175-.2-.262-.437Q3.8 12.25 3.8 12t.088-.488q.087-.237.262-.437l6.375-6.35q.375-.375.925-.388.55-.012.95.388.375.4.388.937.012.538-.363.938l-4.1 4.075H18.35q.55 0 .938.387.387.388.387.938 0 .55-.387.938-.388.387-.938.387H8.325l4.1 4.075q.35.375.363.925.012.55-.363.95-.4.4-.95.4-.55 0-.95-.4Z"/></svg>
22
- </slot></span>`));class eM extends N{static get observedAttributes(){return[...N.observedAttributes]}connectedCallback(){super.connectedCallback(),this.hasAttribute(p.ARIA_LABEL)||this.setAttribute(p.ARIA_LABEL,"close menu")}handleClick(){let e=ed(e_,{bubbles:!0,composed:!0});this.dispatchEvent(e)}constructor(){super({template:eR()})}}customElements.define("theoplayer-menu-close-button",eM);let eI=o("theoplayer-media-track-radio-button",I("<slot></slot>")),eO=["change","update"];class eN extends eu{get track(){return this._track}set track(e){this._track!==e&&(this._track&&this._track.removeEventListener(eO,this._onTrackChange),this._track=e,this._updateFromTrack(),e&&e.addEventListener(eO,this._onTrackChange))}_updateFromTrack(){w(this._slotEl,this._track?function(e){let t=e.label;if(t)return t;let r=e.language;return r&&(E(r)||r)||""}(this._track):""),this.checked=!!this._track&&this._track.enabled}_updateTrack(){this._track&&(this._track.enabled=this.checked)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===p.ARIA_CHECKED&&t!==r&&this._updateTrack()}constructor(){super({template:eI()}),this._track=void 0,this._onTrackChange=()=>{this._updateFromTrack()},this._slotEl=this.shadowRoot.querySelector("slot"),this._upgradeProperty("track")}}customElements.define("theoplayer-media-track-radio-button",eN);var eD=":host,theoplayer-radio-group{align-items:stretch;display:flex;flex-direction:column}:host([hidden]){display:none!important}";let eq=o("theoplayer-text-track-radio-button",I("<slot></slot>")),eB=["change","update"];class eF extends eu{get track(){return this._track}set track(e){this._track!==e&&(this._track&&this._track.removeEventListener(eB,this._onTrackChange),this._track=e,this._updateFromTrack(),e&&e.addEventListener(eB,this._onTrackChange))}_updateFromTrack(){w(this._slotEl,this._track?function(e){let t=e.label;if(t)return t;let r=e.language;return r&&(E(r)||r)||""}(this._track):""),this.checked=!!this._track&&"showing"===this._track.mode}_updateTrack(){this._track&&(this._track.mode=this.checked?"showing":"disabled")}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===p.ARIA_CHECKED&&t!==r&&this._updateTrack()}constructor(){super({template:eq()}),this._track=void 0,this._onTrackChange=()=>{this._updateFromTrack()},this._slotEl=this.shadowRoot.querySelector("slot"),this._upgradeProperty("track")}}function eU(e){return"subtitles"===e.kind||"captions"===e.kind}function eH(e){return eU(e)&&!e.forced}function eV(e){let t=null==e?void 0:e.targetQuality;return void 0===t||Array.isArray(t)||(t=[t]),t}function ez(e){return e?e.label&&""!==e.label?e.label:e.height?`${e.height}p`:e.bandwidth?function(e){if(e.bandwidth)return e.bandwidth>1e7?`${(e.bandwidth/1e6).toFixed(0)}Mbps`:e.bandwidth>1e6?`${(e.bandwidth/1e6).toFixed(1)}Mbps`:`${(e.bandwidth/1e3).toFixed(0)}kbps`}(e):void 0:void 0}customElements.define("theoplayer-text-track-radio-button",eF);let eG=o("theoplayer-text-track-off-radio-button",I("<slot>Off</slot>")),eQ=["change"];class e$ extends eu{get trackList(){return this._trackList}set trackList(e){this._trackList&&this._trackList.removeEventListener(eQ,this._onTrackChange),this._trackList=e,this._updateFromTrackList(),e&&e.addEventListener(eQ,this._onTrackChange)}_updateFromTrackList(){this.checked=!this._trackList||!this._trackList.some(e=>eH(e)&&"showing"===e.mode)}_updateTrackList(){this._trackList&&this.checked&&function(e){for(let t of e)eU(t)&&"showing"===t.mode&&(t.mode="disabled")}(this._trackList)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===p.ARIA_CHECKED&&t!==r&&this._updateTrackList()}constructor(){super({template:eG()}),this._trackList=void 0,this._onTrackChange=()=>{this._updateFromTrackList()},this._upgradeProperty("trackList")}}customElements.define("theoplayer-text-track-off-radio-button",e$);let eK=o("theoplayer-track-radio-group",`<style>${eD}</style><theoplayer-radio-group></theoplayer-radio-group>`),eY=["addtrack","removetrack"];class eW extends H(HTMLElement,["player"]){static get observedAttributes(){return[p.TRACK_TYPE,p.SHOW_OFF]}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){a(this),this._radioGroup instanceof ev||customElements.upgrade(this._radioGroup),this._updateOffButton(),this._updateTracks(),this.shadowRoot.addEventListener("change",this._onChange)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange)}get trackType(){return this.getAttribute(p.TRACK_TYPE)||"audio"}set trackType(e){this.setAttribute(p.TRACK_TYPE,e||"audio")}get showOffButton(){return this.hasAttribute(p.SHOW_OFF)}set showOffButton(e){x(this,p.SHOW_OFF,e)}get player(){return this._player}set player(e){this._player!==e&&(this._player=e,this._updateTracksList(),this._updateTracks())}_getTracksList(){if(void 0===this._player)return;let e=this.trackType;return"audio"===e?this._player.audioTracks:"video"===e?this._player.videoTracks:"subtitles"===e?this._player.textTracks:void 0}_updateTracksList(){let e=this._tracksList,t=this._getTracksList();e!==t&&(null==e||e.removeEventListener(eY,this._updateTracks),null==t||t.addEventListener(eY,this._updateTracks),this._tracksList=t,this._updateOffButton())}_getTracks(){if(void 0===this._player)return[];let e=this.trackType;return"audio"===e?this._player.audioTracks:"video"===e?this._player.videoTracks:"subtitles"===e?this._player.textTracks.filter(eH):[]}_createTrackButton(e){if("subtitles"===this.trackType){let t=new eF;return t.track=e,t}{let t=new eN;return t.track=e,t}}_updateOffButton(){"subtitles"===this.trackType&&this.showOffButton?(void 0===this._offButton&&(this._offButton=new e$,this._radioGroup.insertBefore(this._offButton,this._radioGroup.firstChild)),this._offButton.trackList=this._tracksList):void 0!==this._offButton&&(this._radioGroup.removeChild(this._offButton),this._offButton=void 0)}attributeChangedCallback(e,t,r){r!==t&&(e===p.TRACK_TYPE?(this._updateTracksList(),this._updateTracks()):e===p.SHOW_OFF&&(this._updateOffButton(),this._updateTracks()),eW.observedAttributes.indexOf(e)>=0&&i(this))}constructor(){super(),this._updateTracks=()=>{let e=b(this._radioGroup.children),t=this._getTracks();for(let r of(void 0!==this._offButton&&(e=e.slice(1)),e))(!r.track||0>t.indexOf(r.track))&&this._radioGroup.removeChild(r);for(let r of t)if(!function(e,t){for(let r=0;r<e.length;r++)if(e[r].track===t)return!0;return!1}(e,r)){let e=this._createTrackButton(r);this._radioGroup.appendChild(e)}},this._onChange=()=>{this.dispatchEvent(eh("change",{bubbles:!0}))};let e=this.attachShadow({mode:"open"});e.appendChild(eK().content.cloneNode(!0)),this._radioGroup=e.querySelector("theoplayer-radio-group"),this._upgradeProperty("trackType"),this._upgradeProperty("showOffButton"),this._upgradeProperty("player")}}customElements.define("theoplayer-track-radio-group",eW);var eZ=".theoplayer-menu-table{border-collapse:collapse;table-layout:auto}.theoplayer-menu-table,.theoplayer-menu-table td,.theoplayer-menu-table tr{margin:0;padding:0}.theoplayer-menu-table td>*{font-size:14px;font-size:var(--theoplayer-text-font-size,14px);line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));padding:10px;padding:var(--theoplayer-control-padding,10px)}.theoplayer-menu-table td:first-child{white-space:nowrap;width:0}.theoplayer-menu-table td:last-child{text-align:center}.theoplayer-menu-table td>theoplayer-menu-button{display:flex}";function ej(e){return e?k(e,"rgb")?function(e){let t=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)$/i);return t?{r_:parseInt(t[1],10),g_:parseInt(t[2],10),b_:parseInt(t[3],10),a_:t[4]?parseFloat(t[4]):1}:null}(e):k(e,"#")?function(e){let t=e.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);return t?{r_:parseInt(t[1],16),g_:parseInt(t[2],16),b_:parseInt(t[3],16),a_:1}:null}(e):null:null}function eJ(e){return`rgba(${e.r_},${e.g_},${e.b_},${e.a_})`}function eX(e){return`rgb(${e.r_},${e.g_},${e.b_})`}function e0(e,t){return{r_:e.r_,g_:e.g_,b_:e.b_,a_:t}}let e1=ej("#ffffff"),e5=ej("#000000"),e2=[["White","rgb(255,255,255)"],["Yellow","rgb(255,255,0)"],["Green","rgb(0,255,0)"],["Cyan","rgb(0,255,255)"],["Blue","rgb(0,0,255)"],["Magenta","rgb(255,0,255)"],["Red","rgb(255,0,0)"],["Black","rgb(0,0,0)"]],e3=[["Monospace Serif",'"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace'],["Proportional Serif",'"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif'],["Monospace Sans",'"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace'],["Proportional Sans",'Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif']],e8=[["None","none"],["Drop shadow","dropshadow"],["Raised","raised"],["Depressed","depressed"],["Uniform","uniform"]];class e4 extends H(HTMLElement,["player"]){static get observedAttributes(){return[p.PROPERTY]}connectedCallback(){a(this),this.hasAttribute(p.PROPERTY)||(this.property="fontColor")}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}get property(){return this.getAttribute(p.PROPERTY)}set property(e){this.setAttribute(p.PROPERTY,e)}get player(){return this._player}set player(e){var t,r;this._player!==e&&(null==(t=this._textTrackStyle)||t.removeEventListener("change",this._updateFromPlayer),this._player=e,this._textTrackStyle=null==e?void 0:e.textTrackStyle,this._updateFromPlayer(),null==(r=this._textTrackStyle)||r.addEventListener("change",this._updateFromPlayer))}attributeChangedCallback(e,t,r){r!==t&&(e===p.PROPERTY&&this._updateFromPlayer(),e4.observedAttributes.indexOf(e)>=0&&i(this))}constructor(){super(),this._updateFromPlayer=()=>{if(void 0===this._player)return;let e=this.property;switch(e){case"fontFamily":w(this._spanEl,function(e){if(!e)return"Default";let t=_(e3,([t,r])=>r===e);return t?t[0]:"Custom"}(this._player.textTrackStyle.fontFamily));break;case"fontColor":case"backgroundColor":case"windowColor":w(this._spanEl,function(e){if(!e)return"Default";let t=ej(e);if(t){let e=eX(t),r=_(e2,([t,r])=>r===e);if(r)return r[0]}return"Custom"}(this._player.textTrackStyle[e]));break;case"fontOpacity":w(this._spanEl,e7(this._player.textTrackStyle.fontColor));break;case"backgroundOpacity":w(this._spanEl,e7(this._player.textTrackStyle.backgroundColor));break;case"windowOpacity":w(this._spanEl,e7(this._player.textTrackStyle.windowColor));break;case"edgeStyle":w(this._spanEl,function(e){if(!e)return"Default";let t=_(e8,([t,r])=>r===e);return t?t[0]:"Custom"}(this._player.textTrackStyle.edgeStyle));break;default:{let t=this._player.textTrackStyle[e];w(this._spanEl,t||"Default")}}};let e=this.attachShadow({mode:"open"});this._spanEl=document.createElement("span"),e.appendChild(this._spanEl),this._upgradeProperty("property"),this._upgradeProperty("player")}}function e7(e){if(!e)return"Default";let t=ej(e);return t?`${100*t.a_}%`:"Custom"}customElements.define("theoplayer-text-track-style-display",e4);let e6=o("theoplayer-text-track-style-radio-group",`<style>${eD}</style><theoplayer-radio-group><slot></slot></theoplayer-radio-group>`);class e9 extends H(HTMLElement,["player"]){static get observedAttributes(){return[p.PROPERTY]}connectedCallback(){a(this),this._radioGroup instanceof ev||customElements.upgrade(this._radioGroup),this._upgradeProperty("property"),this._upgradeProperty("value"),this._upgradeProperty("player"),this.hasAttribute(p.PROPERTY)||(this.property="fontColor"),this._updateChecked(),this.shadowRoot.addEventListener("change",this._onChange),this._optionsSlot.addEventListener("slotchange",this._updateChecked)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange),this._optionsSlot.removeEventListener("slotchange",this._updateChecked)}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}get property(){return this.getAttribute(p.PROPERTY)}set property(e){this.setAttribute(p.PROPERTY,e)}get value(){return this._value}set value(e){this._value!==e&&(this._value=e,this._updateToPlayer(),this._updateChecked(),this.dispatchEvent(eh("change",{bubbles:!0})))}get player(){return this._player}set player(e){var t,r;this._player!==e&&(null==(t=this._textTrackStyle)||t.removeEventListener("change",this._updateFromPlayer),this._player=e,this._textTrackStyle=null==e?void 0:e.textTrackStyle,this._updateFromPlayer(),null==(r=this._textTrackStyle)||r.addEventListener("change",this._updateFromPlayer))}_updateToPlayer(){if(void 0!==this._player)switch(this.property){case"fontColor":this._player.textTrackStyle.fontColor=te(this.value,this._player.textTrackStyle.fontColor,e1);break;case"backgroundColor":this._player.textTrackStyle.backgroundColor=te(this.value,this._player.textTrackStyle.backgroundColor,e5);break;case"windowColor":this._player.textTrackStyle.windowColor=te(this.value,this._player.textTrackStyle.windowColor,e5);break;case"fontOpacity":this._player.textTrackStyle.fontColor=tt(this.value,this._player.textTrackStyle.fontColor,e1);break;case"backgroundOpacity":this._player.textTrackStyle.backgroundColor=tt(this.value,this._player.textTrackStyle.backgroundColor,e5);break;case"windowOpacity":this._player.textTrackStyle.windowColor=tt(this.value,this._player.textTrackStyle.windowColor,e5);break;default:this._player.textTrackStyle[this.property]=""==this.value?void 0:this.value}}attributeChangedCallback(e,t,r){r!==t&&(e===p.PROPERTY&&this._updateFromPlayer(),e9.observedAttributes.indexOf(e)>=0&&i(this))}constructor(){super(),this._updateChecked=()=>{for(let e of this._radioGroup.allRadioButtons())e.checked=e.value===this.value},this._onChange=()=>{let e=this._radioGroup.checkedRadioButton;null!==e&&this.value!==e.value&&(this.value=e.value)},this._updateFromPlayer=()=>{var e,t,r,a,i,o,n,s,l,h;if(void 0!==this._player)switch(this.property){case"fontColor":{let t=this._player.textTrackStyle.fontColor;this.value=t?eX(null!=(e=ej(t))?e:e1):"";break}case"backgroundColor":{let e=this._player.textTrackStyle.backgroundColor;this.value=e?eX(null!=(t=ej(e))?t:e5):"";break}case"windowColor":{let e=this._player.textTrackStyle.windowColor;this.value=e?eX(null!=(r=ej(e))?r:e5):"";break}case"fontOpacity":{let e=this._player.textTrackStyle.fontColor;this.value=e?String((null!=(i=null==(a=ej(e))?void 0:a.a_)?i:1)*100):"";break}case"backgroundOpacity":{let e=this._player.textTrackStyle.backgroundColor;this.value=e?String((null!=(n=null==(o=ej(e))?void 0:o.a_)?n:1)*100):"";break}case"windowOpacity":{let e=this._player.textTrackStyle.windowColor;this.value=e?String((null!=(l=null==(s=ej(e))?void 0:s.a_)?l:1)*100):"";break}default:this.value=null!=(h=this._player.textTrackStyle[this.property])?h:""}};let e=this.attachShadow({mode:"open"});e.appendChild(e6().content.cloneNode(!0)),this._radioGroup=e.querySelector("theoplayer-radio-group"),this._optionsSlot=e.querySelector("slot")}}function te(e,t,r){var a,i,o;let n=null!=(i=null==(a=ej(t))?void 0:a.a_)?i:1;if(""!==e||1!==n)return eJ(e0(null!=(o=ej(e))?o:r,n))}function tt(e,t,r){var a;let i=null!=(a=ej(t))?a:r;if(""!==e||i.r_!==r.r_||i.g_!==r.g_||i.b_!==r.b_)return eJ(e0(i,""==e?1:Number(e)/100))}customElements.define("theoplayer-text-track-style-radio-group",e9);let tr=o("theoplayer-text-track-style-menu",eT('<theoplayer-menu class="theoplayer-text-track-style-menu"><span class="theoplayer-menu-heading" slot="heading"><slot name="heading">Subtitle options</slot></span><theoplayer-text-track-style-reset-button class="theoplayer-menu-heading-button" slot="heading"></theoplayer-text-track-style-reset-button><table class="theoplayer-menu-table"><tr><td><span>Font family</span></td><td><theoplayer-menu-button menu="font-family-menu"><theoplayer-text-track-style-display property="fontFamily"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Font color</span></td><td><theoplayer-menu-button menu="font-color-menu"><theoplayer-text-track-style-display property="fontColor"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Font opacity</span></td><td><theoplayer-menu-button menu="font-opacity-menu"><theoplayer-text-track-style-display property="fontOpacity"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Font size</span></td><td><theoplayer-menu-button menu="font-size-menu"><theoplayer-text-track-style-display property="fontSize"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Background color</span></td><td><theoplayer-menu-button menu="background-color-menu"><theoplayer-text-track-style-display property="backgroundColor"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Background opacity</span></td><td><theoplayer-menu-button menu="background-opacity-menu"><theoplayer-text-track-style-display property="backgroundOpacity"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Window color</span></td><td><theoplayer-menu-button menu="window-color-menu"><theoplayer-text-track-style-display property="windowColor"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Window opacity</span></td><td><theoplayer-menu-button menu="window-opacity-menu"><theoplayer-text-track-style-display property="windowOpacity"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Character edge style</span></td><td><theoplayer-menu-button menu="edge-style-menu"><theoplayer-text-track-style-display property="edgeStyle"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr></table></theoplayer-menu><theoplayer-menu id="font-family-menu" menu-close-on-input hidden><span slot="heading">Font family</span><theoplayer-text-track-style-radio-group property="fontFamily"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value=\'"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace\'>Monospace Serif</theoplayer-radio-button><theoplayer-radio-button value=\'"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif\'>Proportional Serif</theoplayer-radio-button><theoplayer-radio-button value=\'"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace\'>Monospace Sans</theoplayer-radio-button><theoplayer-radio-button value=\'Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif\'>Proportional Sans</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="font-color-menu" menu-close-on-input hidden><span slot="heading">Font color</span><theoplayer-text-track-style-radio-group property="fontColor"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,255)">White</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,0)">Yellow</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,0)">Green</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,255)">Cyan</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,255)">Blue</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,255)">Magenta</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,0)">Red</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,0)">Black</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="font-opacity-menu" menu-close-on-input hidden><span slot="heading">Font opacity</span><theoplayer-text-track-style-radio-group property="fontOpacity"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="25">25%</theoplayer-radio-button><theoplayer-radio-button value="50">50%</theoplayer-radio-button><theoplayer-radio-button value="75">75%</theoplayer-radio-button><theoplayer-radio-button value="100">100%</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="font-size-menu" menu-close-on-input hidden><span slot="heading">Font size</span><theoplayer-text-track-style-radio-group property="fontSize"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="50%">50%</theoplayer-radio-button><theoplayer-radio-button value="75%">75%</theoplayer-radio-button><theoplayer-radio-button value="100%">100%</theoplayer-radio-button><theoplayer-radio-button value="150%">150%</theoplayer-radio-button><theoplayer-radio-button value="200%">200%</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="background-color-menu" menu-close-on-input hidden><span slot="heading">Background color</span><theoplayer-text-track-style-radio-group property="backgroundColor"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,255)">White</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,0)">Yellow</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,0)">Green</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,255)">Cyan</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,255)">Blue</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,255)">Magenta</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,0)">Red</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,0)">Black</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="background-opacity-menu" menu-close-on-input hidden><span slot="heading">Background opacity</span><theoplayer-text-track-style-radio-group property="backgroundOpacity"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="25">25%</theoplayer-radio-button><theoplayer-radio-button value="50">50%</theoplayer-radio-button><theoplayer-radio-button value="75">75%</theoplayer-radio-button><theoplayer-radio-button value="100">100%</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="window-color-menu" menu-close-on-input hidden><span slot="heading">Window color</span><theoplayer-text-track-style-radio-group property="windowColor"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,255)">White</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,0)">Yellow</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,0)">Green</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,255)">Cyan</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,255)">Blue</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,255)">Magenta</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,0)">Red</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,0)">Black</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="window-opacity-menu" menu-close-on-input hidden><span slot="heading">Window opacity</span><theoplayer-text-track-style-radio-group property="windowOpacity"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="25">25%</theoplayer-radio-button><theoplayer-radio-button value="50">50%</theoplayer-radio-button><theoplayer-radio-button value="75">75%</theoplayer-radio-button><theoplayer-radio-button value="100">100%</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="edge-style-menu" menu-close-on-input hidden><span slot="heading">Character edge style</span><theoplayer-text-track-style-radio-group property="edgeStyle"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="none">None</theoplayer-radio-button><theoplayer-radio-button value="dropshadow">Drop shadow</theoplayer-radio-button><theoplayer-radio-button value="raised">Raised</theoplayer-radio-button><theoplayer-radio-button value="depressed">Depressed</theoplayer-radio-button><theoplayer-radio-button value="uniform">Uniform</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu>',`${eZ}
22
+ </slot></span>`));class eM extends N{static get observedAttributes(){return[...N.observedAttributes]}connectedCallback(){super.connectedCallback(),this.hasAttribute(p.ARIA_LABEL)||this.setAttribute(p.ARIA_LABEL,"close menu")}handleClick(){let e=ed(e_,{bubbles:!0,composed:!0});this.dispatchEvent(e)}constructor(){super({template:eR()})}}customElements.define("theoplayer-menu-close-button",eM);let eI=o("theoplayer-media-track-radio-button",I("<slot></slot>")),eO=["change","update"];class eN extends eu{get track(){return this._track}set track(e){this._track!==e&&(this._track&&this._track.removeEventListener(eO,this._onTrackChange),this._track=e,this._updateFromTrack(),e&&e.addEventListener(eO,this._onTrackChange))}_updateFromTrack(){w(this._slotEl,this._track?function(e){let t=e.label,r=e.language;if(t&&t!==r)return t;let a=r&&E(r);return a||r||t||""}(this._track):""),this.checked=!!this._track&&this._track.enabled}_updateTrack(){this._track&&(this._track.enabled=this.checked)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===p.ARIA_CHECKED&&t!==r&&this._updateTrack()}constructor(){super({template:eI()}),this._track=void 0,this._onTrackChange=()=>{this._updateFromTrack()},this._slotEl=this.shadowRoot.querySelector("slot"),this._upgradeProperty("track")}}customElements.define("theoplayer-media-track-radio-button",eN);var eD=":host,theoplayer-radio-group{align-items:stretch;display:flex;flex-direction:column}:host([hidden]){display:none!important}";let eq=o("theoplayer-text-track-radio-button",I("<slot></slot>")),eB=["change","update"];class eF extends eu{get track(){return this._track}set track(e){this._track!==e&&(this._track&&this._track.removeEventListener(eB,this._onTrackChange),this._track=e,this._updateFromTrack(),e&&e.addEventListener(eB,this._onTrackChange))}_updateFromTrack(){w(this._slotEl,this._track?function(e){let t=e.label,r=e.language;if(t){if(t===r);else if(!("cea608"===e.type&&/^CC\d+$/.test(e.label)))return t}let a=r&&E(r);return a||("cea608"===e.type&&"number"==typeof e.captionChannel?`CC${e.captionChannel}`:r||t||"")}(this._track):""),this.checked=!!this._track&&"showing"===this._track.mode}_updateTrack(){this._track&&(this._track.mode=this.checked?"showing":"disabled")}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===p.ARIA_CHECKED&&t!==r&&this._updateTrack()}constructor(){super({template:eq()}),this._track=void 0,this._onTrackChange=()=>{this._updateFromTrack()},this._slotEl=this.shadowRoot.querySelector("slot"),this._upgradeProperty("track")}}function eU(e){return"subtitles"===e.kind||"captions"===e.kind}function eH(e){return eU(e)&&!e.forced}function eV(e){let t=null==e?void 0:e.targetQuality;return void 0===t||Array.isArray(t)||(t=[t]),t}function ez(e){return e?e.label&&""!==e.label?e.label:e.height?`${e.height}p`:e.bandwidth?function(e){if(e.bandwidth)return e.bandwidth>1e7?`${(e.bandwidth/1e6).toFixed(0)}Mbps`:e.bandwidth>1e6?`${(e.bandwidth/1e6).toFixed(1)}Mbps`:`${(e.bandwidth/1e3).toFixed(0)}kbps`}(e):void 0:void 0}customElements.define("theoplayer-text-track-radio-button",eF);let eG=o("theoplayer-text-track-off-radio-button",I("<slot>Off</slot>")),eQ=["change"];class e$ extends eu{get trackList(){return this._trackList}set trackList(e){this._trackList&&this._trackList.removeEventListener(eQ,this._onTrackChange),this._trackList=e,this._updateFromTrackList(),e&&e.addEventListener(eQ,this._onTrackChange)}_updateFromTrackList(){this.checked=!this._trackList||!this._trackList.some(e=>eH(e)&&"showing"===e.mode)}_updateTrackList(){this._trackList&&this.checked&&function(e){for(let t of e)eU(t)&&"showing"===t.mode&&(t.mode="disabled")}(this._trackList)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===p.ARIA_CHECKED&&t!==r&&this._updateTrackList()}constructor(){super({template:eG()}),this._trackList=void 0,this._onTrackChange=()=>{this._updateFromTrackList()},this._upgradeProperty("trackList")}}customElements.define("theoplayer-text-track-off-radio-button",e$);let eK=o("theoplayer-track-radio-group",`<style>${eD}</style><theoplayer-radio-group></theoplayer-radio-group>`),eY=["addtrack","removetrack"];class eW extends H(HTMLElement,["player"]){static get observedAttributes(){return[p.TRACK_TYPE,p.SHOW_OFF]}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){a(this),this._radioGroup instanceof ev||customElements.upgrade(this._radioGroup),this._updateOffButton(),this._updateTracks(),this.shadowRoot.addEventListener("change",this._onChange)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange)}get trackType(){return this.getAttribute(p.TRACK_TYPE)||"audio"}set trackType(e){this.setAttribute(p.TRACK_TYPE,e||"audio")}get showOffButton(){return this.hasAttribute(p.SHOW_OFF)}set showOffButton(e){x(this,p.SHOW_OFF,e)}get player(){return this._player}set player(e){this._player!==e&&(this._player=e,this._updateTracksList(),this._updateTracks())}_getTracksList(){if(void 0===this._player)return;let e=this.trackType;return"audio"===e?this._player.audioTracks:"video"===e?this._player.videoTracks:"subtitles"===e?this._player.textTracks:void 0}_updateTracksList(){let e=this._tracksList,t=this._getTracksList();e!==t&&(null==e||e.removeEventListener(eY,this._updateTracks),null==t||t.addEventListener(eY,this._updateTracks),this._tracksList=t,this._updateOffButton())}_getTracks(){if(void 0===this._player)return[];let e=this.trackType;return"audio"===e?this._player.audioTracks:"video"===e?this._player.videoTracks:"subtitles"===e?this._player.textTracks.filter(eH):[]}_createTrackButton(e){if("subtitles"===this.trackType){let t=new eF;return t.track=e,t}{let t=new eN;return t.track=e,t}}_updateOffButton(){"subtitles"===this.trackType&&this.showOffButton?(void 0===this._offButton&&(this._offButton=new e$,this._radioGroup.insertBefore(this._offButton,this._radioGroup.firstChild)),this._offButton.trackList=this._tracksList):void 0!==this._offButton&&(this._radioGroup.removeChild(this._offButton),this._offButton=void 0)}attributeChangedCallback(e,t,r){r!==t&&(e===p.TRACK_TYPE?(this._updateTracksList(),this._updateTracks()):e===p.SHOW_OFF&&(this._updateOffButton(),this._updateTracks()),eW.observedAttributes.indexOf(e)>=0&&i(this))}constructor(){super(),this._updateTracks=()=>{let e=b(this._radioGroup.children),t=this._getTracks();for(let r of(void 0!==this._offButton&&(e=e.slice(1)),e))(!r.track||0>t.indexOf(r.track))&&this._radioGroup.removeChild(r);for(let r of t)if(!function(e,t){for(let r=0;r<e.length;r++)if(e[r].track===t)return!0;return!1}(e,r)){let e=this._createTrackButton(r);this._radioGroup.appendChild(e)}},this._onChange=()=>{this.dispatchEvent(eh("change",{bubbles:!0}))};let e=this.attachShadow({mode:"open"});e.appendChild(eK().content.cloneNode(!0)),this._radioGroup=e.querySelector("theoplayer-radio-group"),this._upgradeProperty("trackType"),this._upgradeProperty("showOffButton"),this._upgradeProperty("player")}}customElements.define("theoplayer-track-radio-group",eW);var eZ=".theoplayer-menu-table{border-collapse:collapse;table-layout:auto}.theoplayer-menu-table,.theoplayer-menu-table td,.theoplayer-menu-table tr{margin:0;padding:0}.theoplayer-menu-table td>*{font-size:14px;font-size:var(--theoplayer-text-font-size,14px);line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));padding:10px;padding:var(--theoplayer-control-padding,10px)}.theoplayer-menu-table td:first-child{white-space:nowrap;width:0}.theoplayer-menu-table td:last-child{text-align:center}.theoplayer-menu-table td>theoplayer-menu-button{display:flex}";function ej(e){return e?k(e,"rgb")?function(e){let t=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)$/i);return t?{r_:parseInt(t[1],10),g_:parseInt(t[2],10),b_:parseInt(t[3],10),a_:t[4]?parseFloat(t[4]):1}:null}(e):k(e,"#")?function(e){let t=e.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);return t?{r_:parseInt(t[1],16),g_:parseInt(t[2],16),b_:parseInt(t[3],16),a_:1}:null}(e):null:null}function eJ(e){return`rgba(${e.r_},${e.g_},${e.b_},${e.a_})`}function eX(e){return`rgb(${e.r_},${e.g_},${e.b_})`}function e0(e,t){return{r_:e.r_,g_:e.g_,b_:e.b_,a_:t}}let e1=ej("#ffffff"),e5=ej("#000000"),e2=[["White","rgb(255,255,255)"],["Yellow","rgb(255,255,0)"],["Green","rgb(0,255,0)"],["Cyan","rgb(0,255,255)"],["Blue","rgb(0,0,255)"],["Magenta","rgb(255,0,255)"],["Red","rgb(255,0,0)"],["Black","rgb(0,0,0)"]],e3=[["Monospace Serif",'"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace'],["Proportional Serif",'"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif'],["Monospace Sans",'"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace'],["Proportional Sans",'Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif']],e8=[["None","none"],["Drop shadow","dropshadow"],["Raised","raised"],["Depressed","depressed"],["Uniform","uniform"]];class e4 extends H(HTMLElement,["player"]){static get observedAttributes(){return[p.PROPERTY]}connectedCallback(){a(this),this.hasAttribute(p.PROPERTY)||(this.property="fontColor")}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}get property(){return this.getAttribute(p.PROPERTY)}set property(e){this.setAttribute(p.PROPERTY,e)}get player(){return this._player}set player(e){var t,r;this._player!==e&&(null==(t=this._textTrackStyle)||t.removeEventListener("change",this._updateFromPlayer),this._player=e,this._textTrackStyle=null==e?void 0:e.textTrackStyle,this._updateFromPlayer(),null==(r=this._textTrackStyle)||r.addEventListener("change",this._updateFromPlayer))}attributeChangedCallback(e,t,r){r!==t&&(e===p.PROPERTY&&this._updateFromPlayer(),e4.observedAttributes.indexOf(e)>=0&&i(this))}constructor(){super(),this._updateFromPlayer=()=>{if(void 0===this._player)return;let e=this.property;switch(e){case"fontFamily":w(this._spanEl,function(e){if(!e)return"Default";let t=_(e3,([t,r])=>r===e);return t?t[0]:"Custom"}(this._player.textTrackStyle.fontFamily));break;case"fontColor":case"backgroundColor":case"windowColor":w(this._spanEl,function(e){if(!e)return"Default";let t=ej(e);if(t){let e=eX(t),r=_(e2,([t,r])=>r===e);if(r)return r[0]}return"Custom"}(this._player.textTrackStyle[e]));break;case"fontOpacity":w(this._spanEl,e7(this._player.textTrackStyle.fontColor));break;case"backgroundOpacity":w(this._spanEl,e7(this._player.textTrackStyle.backgroundColor));break;case"windowOpacity":w(this._spanEl,e7(this._player.textTrackStyle.windowColor));break;case"edgeStyle":w(this._spanEl,function(e){if(!e)return"Default";let t=_(e8,([t,r])=>r===e);return t?t[0]:"Custom"}(this._player.textTrackStyle.edgeStyle));break;default:{let t=this._player.textTrackStyle[e];w(this._spanEl,t||"Default")}}};let e=this.attachShadow({mode:"open"});this._spanEl=document.createElement("span"),e.appendChild(this._spanEl),this._upgradeProperty("property"),this._upgradeProperty("player")}}function e7(e){if(!e)return"Default";let t=ej(e);return t?`${100*t.a_}%`:"Custom"}customElements.define("theoplayer-text-track-style-display",e4);let e6=o("theoplayer-text-track-style-radio-group",`<style>${eD}</style><theoplayer-radio-group><slot></slot></theoplayer-radio-group>`);class e9 extends H(HTMLElement,["player"]){static get observedAttributes(){return[p.PROPERTY]}connectedCallback(){a(this),this._radioGroup instanceof ev||customElements.upgrade(this._radioGroup),this._upgradeProperty("property"),this._upgradeProperty("value"),this._upgradeProperty("player"),this.hasAttribute(p.PROPERTY)||(this.property="fontColor"),this._updateChecked(),this.shadowRoot.addEventListener("change",this._onChange),this._optionsSlot.addEventListener("slotchange",this._updateChecked)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange),this._optionsSlot.removeEventListener("slotchange",this._updateChecked)}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}get property(){return this.getAttribute(p.PROPERTY)}set property(e){this.setAttribute(p.PROPERTY,e)}get value(){return this._value}set value(e){this._value!==e&&(this._value=e,this._updateToPlayer(),this._updateChecked(),this.dispatchEvent(eh("change",{bubbles:!0})))}get player(){return this._player}set player(e){var t,r;this._player!==e&&(null==(t=this._textTrackStyle)||t.removeEventListener("change",this._updateFromPlayer),this._player=e,this._textTrackStyle=null==e?void 0:e.textTrackStyle,this._updateFromPlayer(),null==(r=this._textTrackStyle)||r.addEventListener("change",this._updateFromPlayer))}_updateToPlayer(){if(void 0!==this._player)switch(this.property){case"fontColor":this._player.textTrackStyle.fontColor=te(this.value,this._player.textTrackStyle.fontColor,e1);break;case"backgroundColor":this._player.textTrackStyle.backgroundColor=te(this.value,this._player.textTrackStyle.backgroundColor,e5);break;case"windowColor":this._player.textTrackStyle.windowColor=te(this.value,this._player.textTrackStyle.windowColor,e5);break;case"fontOpacity":this._player.textTrackStyle.fontColor=tt(this.value,this._player.textTrackStyle.fontColor,e1);break;case"backgroundOpacity":this._player.textTrackStyle.backgroundColor=tt(this.value,this._player.textTrackStyle.backgroundColor,e5);break;case"windowOpacity":this._player.textTrackStyle.windowColor=tt(this.value,this._player.textTrackStyle.windowColor,e5);break;default:this._player.textTrackStyle[this.property]=""==this.value?void 0:this.value}}attributeChangedCallback(e,t,r){r!==t&&(e===p.PROPERTY&&this._updateFromPlayer(),e9.observedAttributes.indexOf(e)>=0&&i(this))}constructor(){super(),this._updateChecked=()=>{for(let e of this._radioGroup.allRadioButtons())e.checked=e.value===this.value},this._onChange=()=>{let e=this._radioGroup.checkedRadioButton;null!==e&&this.value!==e.value&&(this.value=e.value)},this._updateFromPlayer=()=>{var e,t,r,a,i,o,n,s,l,h;if(void 0!==this._player)switch(this.property){case"fontColor":{let t=this._player.textTrackStyle.fontColor;this.value=t?eX(null!=(e=ej(t))?e:e1):"";break}case"backgroundColor":{let e=this._player.textTrackStyle.backgroundColor;this.value=e?eX(null!=(t=ej(e))?t:e5):"";break}case"windowColor":{let e=this._player.textTrackStyle.windowColor;this.value=e?eX(null!=(r=ej(e))?r:e5):"";break}case"fontOpacity":{let e=this._player.textTrackStyle.fontColor;this.value=e?String((null!=(i=null==(a=ej(e))?void 0:a.a_)?i:1)*100):"";break}case"backgroundOpacity":{let e=this._player.textTrackStyle.backgroundColor;this.value=e?String((null!=(n=null==(o=ej(e))?void 0:o.a_)?n:1)*100):"";break}case"windowOpacity":{let e=this._player.textTrackStyle.windowColor;this.value=e?String((null!=(l=null==(s=ej(e))?void 0:s.a_)?l:1)*100):"";break}default:this.value=null!=(h=this._player.textTrackStyle[this.property])?h:""}};let e=this.attachShadow({mode:"open"});e.appendChild(e6().content.cloneNode(!0)),this._radioGroup=e.querySelector("theoplayer-radio-group"),this._optionsSlot=e.querySelector("slot")}}function te(e,t,r){var a,i,o;let n=null!=(i=null==(a=ej(t))?void 0:a.a_)?i:1;if(""!==e||1!==n)return eJ(e0(null!=(o=ej(e))?o:r,n))}function tt(e,t,r){var a;let i=null!=(a=ej(t))?a:r;if(""!==e||i.r_!==r.r_||i.g_!==r.g_||i.b_!==r.b_)return eJ(e0(i,""==e?1:Number(e)/100))}customElements.define("theoplayer-text-track-style-radio-group",e9);let tr=o("theoplayer-text-track-style-menu",eT('<theoplayer-menu class="theoplayer-text-track-style-menu"><span class="theoplayer-menu-heading" slot="heading"><slot name="heading">Subtitle options</slot></span><theoplayer-text-track-style-reset-button class="theoplayer-menu-heading-button" slot="heading"></theoplayer-text-track-style-reset-button><table class="theoplayer-menu-table"><tr><td><span>Font family</span></td><td><theoplayer-menu-button menu="font-family-menu"><theoplayer-text-track-style-display property="fontFamily"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Font color</span></td><td><theoplayer-menu-button menu="font-color-menu"><theoplayer-text-track-style-display property="fontColor"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Font opacity</span></td><td><theoplayer-menu-button menu="font-opacity-menu"><theoplayer-text-track-style-display property="fontOpacity"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Font size</span></td><td><theoplayer-menu-button menu="font-size-menu"><theoplayer-text-track-style-display property="fontSize"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Background color</span></td><td><theoplayer-menu-button menu="background-color-menu"><theoplayer-text-track-style-display property="backgroundColor"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Background opacity</span></td><td><theoplayer-menu-button menu="background-opacity-menu"><theoplayer-text-track-style-display property="backgroundOpacity"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Window color</span></td><td><theoplayer-menu-button menu="window-color-menu"><theoplayer-text-track-style-display property="windowColor"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Window opacity</span></td><td><theoplayer-menu-button menu="window-opacity-menu"><theoplayer-text-track-style-display property="windowOpacity"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr><tr><td><span>Character edge style</span></td><td><theoplayer-menu-button menu="edge-style-menu"><theoplayer-text-track-style-display property="edgeStyle"></theoplayer-text-track-style-display></theoplayer-menu-button></td></tr></table></theoplayer-menu><theoplayer-menu id="font-family-menu" menu-close-on-input hidden><span slot="heading">Font family</span><theoplayer-text-track-style-radio-group property="fontFamily"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value=\'"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace\'>Monospace Serif</theoplayer-radio-button><theoplayer-radio-button value=\'"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif\'>Proportional Serif</theoplayer-radio-button><theoplayer-radio-button value=\'"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace\'>Monospace Sans</theoplayer-radio-button><theoplayer-radio-button value=\'Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif\'>Proportional Sans</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="font-color-menu" menu-close-on-input hidden><span slot="heading">Font color</span><theoplayer-text-track-style-radio-group property="fontColor"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,255)">White</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,0)">Yellow</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,0)">Green</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,255)">Cyan</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,255)">Blue</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,255)">Magenta</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,0)">Red</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,0)">Black</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="font-opacity-menu" menu-close-on-input hidden><span slot="heading">Font opacity</span><theoplayer-text-track-style-radio-group property="fontOpacity"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="25">25%</theoplayer-radio-button><theoplayer-radio-button value="50">50%</theoplayer-radio-button><theoplayer-radio-button value="75">75%</theoplayer-radio-button><theoplayer-radio-button value="100">100%</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="font-size-menu" menu-close-on-input hidden><span slot="heading">Font size</span><theoplayer-text-track-style-radio-group property="fontSize"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="50%">50%</theoplayer-radio-button><theoplayer-radio-button value="75%">75%</theoplayer-radio-button><theoplayer-radio-button value="100%">100%</theoplayer-radio-button><theoplayer-radio-button value="150%">150%</theoplayer-radio-button><theoplayer-radio-button value="200%">200%</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="background-color-menu" menu-close-on-input hidden><span slot="heading">Background color</span><theoplayer-text-track-style-radio-group property="backgroundColor"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,255)">White</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,0)">Yellow</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,0)">Green</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,255)">Cyan</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,255)">Blue</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,255)">Magenta</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,0)">Red</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,0)">Black</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="background-opacity-menu" menu-close-on-input hidden><span slot="heading">Background opacity</span><theoplayer-text-track-style-radio-group property="backgroundOpacity"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="25">25%</theoplayer-radio-button><theoplayer-radio-button value="50">50%</theoplayer-radio-button><theoplayer-radio-button value="75">75%</theoplayer-radio-button><theoplayer-radio-button value="100">100%</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="window-color-menu" menu-close-on-input hidden><span slot="heading">Window color</span><theoplayer-text-track-style-radio-group property="windowColor"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,255)">White</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,0)">Yellow</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,0)">Green</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,255)">Cyan</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,255)">Blue</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,255)">Magenta</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,0)">Red</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,0)">Black</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="window-opacity-menu" menu-close-on-input hidden><span slot="heading">Window opacity</span><theoplayer-text-track-style-radio-group property="windowOpacity"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="25">25%</theoplayer-radio-button><theoplayer-radio-button value="50">50%</theoplayer-radio-button><theoplayer-radio-button value="75">75%</theoplayer-radio-button><theoplayer-radio-button value="100">100%</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="edge-style-menu" menu-close-on-input hidden><span slot="heading">Character edge style</span><theoplayer-text-track-style-radio-group property="edgeStyle"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="none">None</theoplayer-radio-button><theoplayer-radio-button value="dropshadow">Drop shadow</theoplayer-radio-button><theoplayer-radio-button value="raised">Raised</theoplayer-radio-button><theoplayer-radio-button value="depressed">Depressed</theoplayer-radio-button><theoplayer-radio-button value="uniform">Uniform</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu>',`${eZ}
23
23
  .theoplayer-menu-heading{flex-grow:1}.theoplayer-menu-heading-button{align-self:flex-end}`));class ta extends eC{constructor(){super({template:tr()})}}customElements.define("theoplayer-text-track-style-menu",ta);let ti=o("theoplayer-language-menu",eT('<theoplayer-menu><span class="theoplayer-menu-heading" slot="heading"><slot name="heading">Language</slot></span><theoplayer-settings-menu-button class="theoplayer-menu-heading-button" menu="subtitle-options-menu" slot="heading"></theoplayer-settings-menu-button><div part="content"><div part="audio"><h2>Audio</h2><theoplayer-track-radio-group track-type="audio"></theoplayer-track-radio-group></div><div part="subtitles"><h2>Subtitles</h2><theoplayer-track-radio-group track-type="subtitles" show-off></theoplayer-track-radio-group></div></div></theoplayer-menu><theoplayer-text-track-style-menu id="subtitle-options-menu"></theoplayer-text-track-style-menu>',".theoplayer-menu-heading{flex-grow:1}.theoplayer-menu-heading-button{align-self:flex-end}[part=audio],[part=subtitles],theoplayer-track-radio-group{display:flex;min-height:0}[part=content]{display:grid;grid-template-columns:1fr;min-height:0}:host([has-audio][has-subtitles]) [part=content]{grid-template-columns:1fr 10px 1fr}:host([has-audio][has-subtitles]) [part=audio]{grid-column:1}:host([has-audio][has-subtitles]) [part=subtitles]{grid-column:3}:host(:not([has-audio])) [part=audio],:host(:not([has-subtitles])) [part=subtitles]{display:none!important}[part=audio],[part=subtitles]{align-self:stretch;flex-direction:column;text-align:center}h2{margin:0 0 .5em}theoplayer-track-radio-group{overflow-y:auto}")),to=["addtrack","removetrack"];class tn extends H(eC,["player"]){static get observedAttributes(){return[...eC.observedAttributes,p.HAS_AUDIO,p.HAS_SUBTITLES]}get player(){return this._player}set player(e){var t,r,a,i;this._player!==e&&(null==(t=this._audioTrackList)||t.removeEventListener(to,this._updateAudioTracks),null==(r=this._textTrackList)||r.removeEventListener(to,this._updateTextTracks),this._player=e,this._audioTrackList=null==e?void 0:e.audioTracks,this._textTrackList=null==e?void 0:e.textTracks,this._updateAudioTracks(),this._updateTextTracks(),null==(a=this._audioTrackList)||a.addEventListener(to,this._updateAudioTracks),null==(i=this._textTrackList)||i.addEventListener(to,this._updateTextTracks))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),tn.observedAttributes.indexOf(e)>=0&&i(this)}constructor(){super({template:ti()}),this._updateAudioTracks=()=>{var e,t;let r=null!=(t=null==(e=this._player)?void 0:e.audioTracks)?t:[];x(this,p.HAS_AUDIO,r.length>1)},this._updateTextTracks=()=>{var e,t;let r=null!=(t=null==(e=this._player)?void 0:e.textTracks.filter(eH))?t:[];x(this,p.HAS_SUBTITLES,r.length>0)},this._upgradeProperty("player")}}customElements.define("theoplayer-language-menu",tn);let ts=o("theoplayer-language-menu-button",I(`<span part="icon"><slot><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M17.469 15.446a6.892 6.892 310 1 0-4.772 3.342l2.872.986q1.9.626 1.9-1.374v-2.954l2.598 1.5V22q0 2-1.899 1.374l-4.95-1.632a9.892 9.892 310 1 1 6.849-4.796zM7 10a1 1 180 1 0 0 2 1 1 180 1 0 0-2zm4 0a1 1 180 1 0 0 2h5a1 1 180 1 0 0-2zm-3 4a1 1 180 1 0 0 2h3a1 1 180 1 0 0-2zm7 0a1 1 180 1 0 0 2 1 1 180 1 0 0-2z"/></svg>
24
24
  </slot></span>`)),tl=["addtrack","removetrack"];class th extends H(eP,["player"]){connectedCallback(){super.connectedCallback(),this.hasAttribute(p.ARIA_LABEL)||this.setAttribute(p.ARIA_LABEL,"open language menu")}get player(){return this._player}set player(e){var t,r,a,i;this._player!==e&&(null==(t=this._audioTrackList)||t.removeEventListener(tl,this._updateTracks),null==(r=this._textTrackList)||r.removeEventListener(tl,this._updateTracks),this._player=e,this._audioTrackList=null==e?void 0:e.audioTracks,this._textTrackList=null==e?void 0:e.textTracks,this._updateTracks(),null==(a=this._audioTrackList)||a.addEventListener(tl,this._updateTracks),null==(i=this._textTrackList)||i.addEventListener(tl,this._updateTracks))}constructor(){super({template:ts()}),this._updateTracks=()=>{let e=void 0!==this._player&&(this._player.audioTracks.length>=2||this._player.textTracks.some(eH));x(this,p.HIDDEN,!e)},this._upgradeProperty("player")}}customElements.define("theoplayer-language-menu-button",th);let td=o("theoplayer-playback-rate-radio-group",`<style>${eD}</style><theoplayer-radio-group><slot></slot></theoplayer-radio-group>`);class tp extends H(HTMLElement,["player"]){_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){a(this),this._radioGroup instanceof ev||customElements.upgrade(this._radioGroup),this._updateChecked(),this.shadowRoot.addEventListener("change",this._onChange),this._optionsSlot.addEventListener("slotchange",this._updateChecked)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange),this._optionsSlot.removeEventListener("slotchange",this._updateChecked)}get value(){return this._value}set value(e){e=Number(e),this._value!==e&&(this._value=e,void 0!==this._player&&(this._player.playbackRate=e),this._updateChecked(),this.dispatchEvent(eh("change",{bubbles:!0})))}get player(){return this._player}set player(e){this._player!==e&&(void 0!==this._player&&this._player.removeEventListener("ratechange",this._updateFromPlayer),this._player=e,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener("ratechange",this._updateFromPlayer))}constructor(){super(),this._value=1,this._updateChecked=()=>{for(let e of this._radioGroup.allRadioButtons())e.checked=Number(e.value)===this.value},this._onChange=()=>{let e=this._radioGroup.checkedRadioButton;null!==e&&this.value!==Number(e.value)&&(this.value=e.value)},this._updateFromPlayer=()=>{void 0!==this._player&&(this.value=this._player.playbackRate)};let e=this.attachShadow({mode:"open"});e.appendChild(td().content.cloneNode(!0)),this._radioGroup=e.querySelector("theoplayer-radio-group"),this._optionsSlot=e.querySelector("slot"),this._upgradeProperty("value"),this._upgradeProperty("player")}}customElements.define("theoplayer-playback-rate-radio-group",tp);let tu=o("theoplayer-playback-rate-button",I(`<span part="icon"><slot><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 96 960 960" height="24" width="24"><path d="M418 716q24 24 61.435 23.5T536 712l171.826-250.174q12.392-19.087-1.652-32.283-14.044-13.195-33.131-.804L424 600q-27 19.13-28.5 55.565T418 716ZM204 915.218q-25.522 0-49.609-12.826-24.087-12.826-36.783-34.783-26.565-46.696-41.696-100.022Q60.782 714.261 60.782 656q0-86.391 32.913-162.566 32.913-76.174 89.956-133.217 57.044-57.044 133.436-90.24Q393.478 236.782 480 236.782q43.87 0 85.87 8.934 42 8.935 81 26.239 28.913 12.696 33.826 38.762 4.913 26.065-13.044 48.153-10.261 12.391-28.217 15.521-17.957 3.131-32.914-3.565-31.434-14.869-62.043-21.456-30.608-6.587-64.478-6.587-129.043 0-221.13 91.522Q166.783 525.826 166.783 656q0 42 10.935 79.891 10.934 37.891 30.804 73.326h542.956q23-38 32.37-75.608Q793.217 696 793.217 652q0-31.609-6.804-62.565-6.804-30.956-20.543-60.826-7.566-16.957-3.718-35.196 3.848-18.239 17.674-29.5 21.653-18.522 47.153-10.261t36.761 35.609q16.305 38 25.457 78.217 9.152 40.218 10.021 82.522 0 58.696-14.348 113.522-14.347 54.826-42.478 104.087-14.391 23.087-37.631 35.348-23.239 12.261-48.761 12.261H204ZM480 576Z"/></svg>
25
25
  </slot></span>`));class tc extends eP{connectedCallback(){super.connectedCallback(),this.hasAttribute(p.ARIA_LABEL)||this.setAttribute(p.ARIA_LABEL,"open playback speed menu")}constructor(){super({template:tu()})}}customElements.define("theoplayer-playback-rate-menu-button",tc);let ty=o("theoplayer-playback-rate-menu",ek('<span slot="heading"><slot name="heading">Playback speed</slot></span>','<theoplayer-playback-rate-radio-group><theoplayer-radio-button value="0.25">0.25x</theoplayer-radio-button><theoplayer-radio-button value="0.5">0.5x</theoplayer-radio-button><theoplayer-radio-button value="1">Normal</theoplayer-radio-button><theoplayer-radio-button value="1.25">1.25x</theoplayer-radio-button><theoplayer-radio-button value="1.5">1.5x</theoplayer-radio-button><theoplayer-radio-button value="2">2x</theoplayer-radio-button></theoplayer-playback-rate-radio-group>'));class tg extends ew{constructor(){super({template:ty()})}}customElements.define("theoplayer-playback-rate-menu",tg);class tm extends H(HTMLElement,["playbackRate"]){connectedCallback(){a(this)}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,w(this._spanEl,1===e?"Normal":`${e}x`)}constructor(){super(),this._playbackRate=1;let e=this.attachShadow({mode:"open"});this._spanEl=document.createElement("span"),e.appendChild(this._spanEl),this._upgradeProperty("playbackRate")}}customElements.define("theoplayer-playback-rate-display",tm);class tv extends H(HTMLElement,["activeVideoQuality","targetVideoQualities"]){connectedCallback(){a(this)}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}get activeVideoQuality(){return this._activeVideoQuality}set activeVideoQuality(e){this._activeVideoQuality=e,this.update_()}get targetVideoQualities(){return this._targetVideoQualities}set targetVideoQualities(e){this._targetVideoQualities=e,this.update_()}update_(){let e;let t=void 0!==this._targetVideoQualities&&1===this._targetVideoQualities.length,r=t?this._targetVideoQualities[0]:void 0,a=ez(null!=r?r:this._activeVideoQuality);e=t?null!=a?a:"Unknown":`Automatic${a?` (${a})`:""}`,w(this._spanEl,e)}constructor(){super(),this._activeVideoQuality=void 0,this._targetVideoQualities=void 0;let e=this.attachShadow({mode:"open"});this._spanEl=document.createElement("span"),e.appendChild(this._spanEl),this._upgradeProperty("activeVideoQuality"),this._upgradeProperty("targetVideoQualities")}}customElements.define("theoplayer-active-quality-display",tv);let tb=o("theoplayer-quality-radio-button",I("<slot></slot>")),t_=["activequalitychanged","targetqualitychanged"],tf=["update"];class tk extends eu{get track(){return this._track}set track(e){this._track!==e&&(this._track&&this._track.removeEventListener(t_,this._updateFromTrack),this._track=e,this._updateFromTrack(),e&&e.addEventListener(t_,this._updateFromTrack))}get quality(){return this._quality}set quality(e){this._quality!==e&&(this._quality&&this._quality.removeEventListener(tf,this._updateFromQuality),this._quality=e,this._updateFromTrack(),e&&e.addEventListener(tf,this._updateFromQuality))}_updateTargetQuality(){this._track&&this.checked&&(this._track.targetQuality=this._quality)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),r!==t&&(e===p.ARIA_CHECKED&&this._updateTargetQuality(),tk.observedAttributes.indexOf(e)>=0&&i(this))}constructor(){super({template:tb()}),this._track=void 0,this._quality=void 0,this._updateFromTrack=()=>{if(void 0!==this._track){let e=this._track.targetQuality;Array.isArray(e)&&(e=1===e.length?e[0]:void 0),void 0===this._quality?this.checked=void 0===e:this.checked=e===this._quality}this._updateFromQuality()},this._updateFromQuality=()=>{var e;w(this._slotEl,null!=(e=ez(this._quality))?e:"Automatic")},this._slotEl=this.shadowRoot.querySelector("slot"),this._upgradeProperty("track"),this._upgradeProperty("quality")}}customElements.define("theoplayer-quality-radio-button",tk);let tE=o("theoplayer-quality-radio-group",`<style>${eD}</style><theoplayer-radio-group></theoplayer-radio-group>`),tw=["addtrack","removetrack","change"];class tx extends H(HTMLElement,["player"]){_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){a(this),this._radioGroup instanceof ev||customElements.upgrade(this._radioGroup),this._updateTrack(),this.shadowRoot.addEventListener("change",this._onChange)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange)}get player(){return this._player}set player(e){var t,r;this._player!==e&&(null==(t=this._videoTracks)||t.removeEventListener(tw,this._updateTrack),this._player=e,this._videoTracks=null==e?void 0:e.videoTracks,this._updateTrack(),null==(r=this._videoTracks)||r.addEventListener(tw,this._updateTrack))}constructor(){super(),this._onChange=()=>{this.dispatchEvent(eh("change",{bubbles:!0}))},this._updateTrack=()=>{var e,t;let r=this._player?_(this._player.videoTracks,e=>e.enabled):void 0;this._track!==r&&(null==(e=this._track)||e.removeEventListener("update",this._update),this._track=r,null==(t=this._track)||t.addEventListener("update",this._update),this._update())},this._update=()=>{let e=b(this._radioGroup.children),t=this._track?this._track.qualities:[],r=1===t.length?[void 0]:[void 0,...t],a=0;for(;a<e.length&&a<r.length;){let t=e[a];t.track=this._track,t.quality=r[a],a++}for(;a<e.length;)this._radioGroup.removeChild(e[a]),a++;for(;a<r.length;){let e=new tk;e.track=this._track,e.quality=r[a],this._radioGroup.appendChild(e),a++}};let e=this.attachShadow({mode:"open"});e.appendChild(tE().content.cloneNode(!0)),this._radioGroup=e.querySelector("theoplayer-radio-group"),this._upgradeProperty("player")}}customElements.define("theoplayer-quality-radio-group",tx);let tT=o("theoplayer-text-track-style-reset-button",I("<slot>Reset</slot>"));class tA extends H(N,["player"]){static get observedAttributes(){return[...N.observedAttributes]}get player(){return this._player}set player(e){this._player=e}handleClick(){if(void 0===this._player)return;let{textTrackStyle:e}=this._player;e.fontFamily=void 0,e.fontColor=void 0,e.fontSize=void 0,e.backgroundColor=void 0,e.windowColor=void 0,e.edgeStyle=void 0}constructor(){super({template:tT()})}}customElements.define("theoplayer-text-track-style-reset-button",tA);let tC=o("theoplayer-settings-menu",eT('<theoplayer-menu><span slot="heading"><slot name="heading">Settings</slot></span><table class="theoplayer-menu-table"><tr><td><span>Quality</span></td><td><theoplayer-menu-button menu="quality-menu"><theoplayer-active-quality-display></theoplayer-active-quality-display></theoplayer-menu-button></td></tr><tr><td><span>Playback speed</span></td><td><theoplayer-menu-button menu="playback-rate-menu"><theoplayer-playback-rate-display></theoplayer-playback-rate-display></theoplayer-menu-button></td></tr></table></theoplayer-menu><theoplayer-menu id="quality-menu" menu-close-on-input hidden><span slot="heading">Quality</span><theoplayer-quality-radio-group></theoplayer-quality-radio-group></theoplayer-menu><theoplayer-playback-rate-menu id="playback-rate-menu" menu-close-on-input hidden><span slot="heading">Playback speed</span></theoplayer-playback-rate-menu>',eZ));class tL extends eC{constructor(){super({template:tC()})}}customElements.define("theoplayer-settings-menu",tL);var tS='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M14 22.475h-4q-.475 0-.863-.337-.387-.338-.437-.813l-.3-2.2q-.2-.075-.4-.2t-.375-.25l-2.05.85q-.475.2-.937.05-.463-.15-.738-.6l-1.975-3.45q-.25-.45-.162-.95.087-.5.487-.775l1.775-1.35Q4 12.325 4 12.225v-.45q0-.1.025-.225L2.25 10.2q-.4-.3-.487-.8-.088-.5.162-.925L3.9 5.025q.25-.45.725-.588.475-.137.95.038l2.075.875q.175-.15.363-.263.187-.112.387-.187l.3-2.225q.05-.5.425-.825.375-.325.875-.325h4q.5 0 .875.325t.425.825l.3 2.225q.2.075.4.187.2.113.375.263l2.05-.875q.475-.175.938-.025.462.15.737.575l2 3.45q.25.45.15.95-.1.5-.5.775l-1.775 1.35v.675q0 .1-.025.225l1.775 1.35q.4.275.487.775.088.5-.162.95l-2 3.45q-.25.425-.725.587-.475.163-.95-.037l-2.025-.85q-.175.125-.362.25-.188.125-.388.2l-.3 2.2q-.05.475-.425.813-.375.337-.875.337ZM12 15.5q1.45 0 2.475-1.025Q15.5 13.45 15.5 12q0-1.45-1.025-2.475Q13.45 8.5 12 8.5q-1.45 0-2.475 1.025Q8.5 10.55 8.5 12q0 1.45 1.025 2.475Q10.55 15.5 12 15.5Z"/></svg>\n';let tP=o("theoplayer-settings-menu-button",I(`<span part="icon"><slot>${tS}</slot></span>`));class tR extends eP{connectedCallback(){super.connectedCallback(),this.hasAttribute(p.ARIA_LABEL)||this.setAttribute(p.ARIA_LABEL,"open settings menu")}constructor(){super({template:tP()})}}customElements.define("theoplayer-settings-menu-button",tR);let tM="theoplayerfullscreenenter",tI="theoplayerfullscreenexit",tO=o("theoplayer-fullscreen-button",I(`<span part="enter-icon"><slot name="enter-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M5.9 19.225q-.475 0-.8-.325-.325-.325-.325-.8V15q0-.475.325-.812.325-.338.8-.338.5 0 .825.338.325.337.325.812v1.95H9q.475 0 .812.325.338.325.338.825 0 .475-.338.8-.337.325-.812.325Zm0-9.075q-.475 0-.8-.338-.325-.337-.325-.812V5.9q0-.475.325-.8.325-.325.8-.325H9q.475 0 .812.325.338.325.338.8 0 .5-.338.825-.337.325-.812.325H7.05V9q0 .475-.325.812-.325.338-.825.338Zm9.1 9.075q-.475 0-.812-.325-.338-.325-.338-.8 0-.5.338-.825.337-.325.812-.325h1.95V15q0-.475.325-.812.325-.338.825-.338.475 0 .8.338.325.337.325.812v3.1q0 .475-.325.8-.325.325-.8.325Zm3.1-9.075q-.5 0-.825-.338-.325-.337-.325-.812V7.05H15q-.475 0-.812-.325-.338-.325-.338-.825 0-.475.338-.8.337-.325.812-.325h3.1q.475 0 .8.325.325.325.325.8V9q0 .475-.325.812-.325.338-.8.338Z"/></svg>
@@ -38,5 +38,5 @@ ${t}</style><div part="container"><div part="background"></div><div part="pointe
38
38
  <theolive-automatic-quality-selector></theolive-automatic-quality-selector>
39
39
  <theolive-bad-network-quality-selector></theolive-bad-network-quality-selector>
40
40
  </theoplayer-radio-group>
41
- `);class r$ extends HTMLElement{_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){a(this),this._radioGroup instanceof ev||customElements.upgrade(this._radioGroup),this.shadowRoot.addEventListener("change",this._onChange)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange)}constructor(){super(),this._onChange=()=>{this.dispatchEvent(new Event("change",{bubbles:!0}))};let e=this.attachShadow({mode:"open"});e.appendChild(rQ().content.cloneNode(!0)),this._radioGroup=e.querySelector("theoplayer-radio-group")}}customElements.define("theolive-bad-network-menu",r$);let rK=o("theolive-default-ui",'<style>:host{box-sizing:border-box;display:inline-block;font-family:Helvetica,Arial,sans-serif;position:relative;width:100%}:host([hidden]){display:none!important}theoplayer-ui{--theoplayer-loading-delay:0.1s;display:block;font-family:Helvetica,Arial,sans-serif;width:100%}:host(:-webkit-full-screen),:host(:-webkit-full-screen) theoplayer-ui{height:100%!important;width:100%!important}:host(:fullscreen),:host(:fullscreen) theoplayer-ui{height:100%!important;width:100%!important}theoplayer-menu::part(heading){display:none!important}[part=centered-chrome]{display:flex}[part=centered-chrome] *{--theoplayer-control-height:48px}[part=middle-chrome]{flex-grow:1;justify-content:flex-end;pointer-events:none}[part=bottom-chrome],[part=middle-chrome]{display:flex;flex-flow:column nowrap;position:relative}[part=bottom-chrome]{align-items:stretch}:host([mobile]) theoplayer-ui{--theoplayer-control-backdrop-background:rgba(0,0,0,.5)}:host{--theoplayer-control-background-gradient-stops:transparent 0%,rgba(0,0,0,.01) 8.1%,rgba(0,0,0,.037) 15.5%,rgba(0,0,0,.078) 22.5%,rgba(0,0,0,.131) 29%,rgba(0,0,0,.195) 35.3%,rgba(0,0,0,.264) 41.2%,rgba(0,0,0,.337) 47.1%,rgba(0,0,0,.413) 52.9%,rgba(0,0,0,.486) 58.8%,rgba(0,0,0,.555) 64.7%,rgba(0,0,0,.619) 71%,rgba(0,0,0,.672) 77.5%,rgba(0,0,0,.713) 84.5%,rgba(0,0,0,.74) 91.9%,rgba(0,0,0,.75) 100%}:host(:not([mobile])) [part=bottom-chrome]:before,:host(:not([mobile])) [part=top-chrome]:before{bottom:0;content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:-1}:host(:not([mobile])) [part=top-chrome]:before{background:linear-gradient(to top,var(--theoplayer-control-background-gradient-stops))}:host(:not([mobile])) [part=bottom-chrome]:before{background:linear-gradient(to bottom,var(--theoplayer-control-background-gradient-stops))}.theoplayer-spacer{flex-grow:1}theoplayer-time-range{--theoplayer-control-height:12px;--theoplayer-range-track-pointer-background:hsla(0,0%,100%,.5)}:host(:not([mobile])) [mobile-only],:host([mobile]) [mobile-hidden]{display:none!important}:host(:not([stream-type=vod])) [live-hidden],:host(:not([stream-type=vod])) theoplayer-control-bar ::slotted([live-hidden]),:host([stream-type=vod]) [live-only],:host([stream-type=vod]) theoplayer-control-bar ::slotted([live-only]){display:none!important}theoplayer-ui:not([has-first-play]) [part=centered-chrome] :not(theoplayer-play-button),theoplayer-ui:not([has-first-play]) theoplayer-control-bar,theoplayer-ui:not([playing-ad]) [ad-only],theoplayer-ui[playing-ad] [ad-hidden]{display:none!important}:host(:not([mobile])) theoplayer-ui[has-first-play] [part=centered-chrome] theoplayer-play-button{display:none!important}theoplayer-volume-range{--theoplayer-range-padding-left:0}theoplayer-mute-button+theoplayer-volume-range{--theoplayer-range-padding-right:0;--theoplayer-range-track-width:70px;overflow:hidden;transition:width .2s ease-in;width:0}theoplayer-mute-button+theoplayer-volume-range:focus,theoplayer-mute-button+theoplayer-volume-range:hover,theoplayer-mute-button:focus+theoplayer-volume-range,theoplayer-mute-button:hover+theoplayer-volume-range{width:70px}theoplayer-mute-button+theoplayer-volume-range:focus-within,theoplayer-mute-button:focus-within+theoplayer-volume-range{width:70px}theoplayer-live-button+theoplayer-time-display{padding-left:0}theoplayer-live-button[live]+theoplayer-time-display{display:none!important}p{color:#fff;color:var(--theoplayer-text-color,#fff);font-size:20px;font-size:var(--theoplayer-text-font-size,20px)}#announcement,#loading-announcement,#offline-announcement{display:none}theolive-bad-network-button{display:none;display:var(--theolive-bad-network-button-display,none)}theoplayer-settings-menu-button{display:inline-flex;display:var(--theolive-quality-button-display,inline-flex)}</style><theoplayer-ui><p id="loading-announcement" no-auto-hide slot="centered-chrome"><slot name="loading-announcement">Loading...</slot></p><p id="offline-announcement" no-auto-hide slot="centered-chrome"><slot name="offline-announcement">The live stream hasn\'t started yet</slot></p><p id="announcement" no-auto-hide slot="centered-chrome"></p><theoplayer-loading-indicator slot="centered-loading" no-auto-hide part="loading-indicator"></theoplayer-loading-indicator><div slot="centered-chrome" part="centered-chrome"><theoplayer-play-button part="center-play-button play-button center-button"></theoplayer-play-button></div><div part="bottom-chrome"><theoplayer-control-bar><theoplayer-play-button mobile-hidden part="play-button"></theoplayer-play-button><theoplayer-mute-button part="mute-button"></theoplayer-mute-button><theoplayer-volume-range mobile-hidden part="volume-range"></theoplayer-volume-range><theoplayer-live-button ad-hidden live-only part="live-button"></theoplayer-live-button><span class="theoplayer-spacer"></span><theoplayer-settings-menu-button ad-hidden menu="all-quality-menu" part="quality-button"></theoplayer-settings-menu-button><theolive-bad-network-button ad-hidden menu="quality-menu" part="theolive-bad-network-button"></theolive-bad-network-button><theoplayer-fullscreen-button part="fullscreen-button"></theoplayer-fullscreen-button></theoplayer-control-bar></div><theoplayer-menu id="quality-menu" slot="menu" menu-close-on-input hidden><theolive-bad-network-menu></theolive-bad-network-menu></theoplayer-menu><theoplayer-menu id="all-quality-menu" slot="menu" menu-close-on-input hidden><theoplayer-quality-radio-group></theoplayer-quality-radio-group></theoplayer-menu><theoplayer-error-display slot="error" part="error-display"></theoplayer-error-display></theoplayer-ui>');class rY extends rF{initShadowRoot(){let e=this.attachShadow({mode:"open",delegatesFocus:!0});return e.appendChild(rK().content.cloneNode(!0)),e}hidePlayerError(){this._root.removeAttribute("has-error"),this._errorDisplay.style.display="none"}stopHidingPlayerError(){this._root.setAttribute("has-error",""),this._errorDisplay.style.display="flex"}hidePlayerPlayButton_(){this._playButton.style.display="none"}stopHidingPlayerPlayButton(){this._playButton.style.display="inline-flex"}showMessage_(e,t){this.hidePlayerError(),this._loading.style.display="none",this._offline.style.display="none",this._announcement.style.display="none","loading"===e?this._loading.style.display="block":"offline"===e?this._offline.style.display="block":(this._announcement.textContent=null!=t?t:"",this._announcement.style.display="block"),this.hidePlayerPlayButton_()}hideMessage_(){this._loading.style.display="none",this._offline.style.display="none",this._announcement.style.display="none",this.stopHidingPlayerPlayButton()}constructor(e={}){super(e),this.onReady=()=>{this._ui.removeEventListener(rR,this.onReady);let e=this.player;if(e){var t,r,a;null==(t=e.theoLive)||t.addEventListener(["distributionloadstart","publicationloadstart"],this.onLoadChannelStart),null==(r=e.theoLive)||r.addEventListener(["distributionoffline","publicationoffline"],this.onChannelOffline),null==(a=e.theoLive)||a.addEventListener(["endpointloaded","publicationloaded"],this.onChannelLoaded),e.addEventListener("error",this.onError)}},this.onLoadChannelStart=()=>{this.showMessage_("loading",void 0)},this.onChannelOffline=()=>{this.showMessage_("offline",void 0)},this.onChannelLoaded=()=>{this.hidePlayerError(),this.hideMessage_()},this.onError=e=>{let t=e.errorObject.code;if(t<13e3||t>=14e3){this.showMessage_("offline",void 0);return}this.stopHidingPlayerError(),this.hideMessage_()},this._loading=this._shadowRoot.querySelector("#loading-announcement"),this._offline=this._shadowRoot.querySelector("#offline-announcement"),this._announcement=this._shadowRoot.querySelector("#announcement"),this._errorDisplay=this._shadowRoot.querySelector("theoplayer-error-display"),this._playButton=this._shadowRoot.querySelector("theoplayer-play-button"),this._root=this._shadowRoot.querySelector("theoplayer-ui"),this._ui.addEventListener(rR,this.onReady)}}customElements.define("theolive-default-ui",rY),e.ActiveQualityDisplay=tv,e.AdClickThroughButton=rf,e.AdCountdown=rv,e.AdDisplay=ry,e.AdSkipButton=rw,e.AirPlayButton=rr,e.Attribute=p,e.Button=N,e.CastButton=t2,e.ChromecastButton=t7,e.ChromecastDisplay=re,e.CloseMenuButton=eM,e.ColorStops=tD,e.ControlBar=s,e.DefaultUI=rF,e.DurationDisplay=el,e.ErrorDisplay=t5,e.ExtensionSlot=rx,e.FullscreenButton=tN,e.GestureReceiver=rs,e.LanguageMenu=tn,e.LanguageMenuButton=th,e.LinkButton=B,e.LiveButton=rp,e.LoadingIndicator=ro,e.MediaTrackRadioButton=eN,e.Menu=ew,e.MenuButton=eP,e.MenuGroup=eC,e.MuteButton=Y,e.PlayButton=Q,e.PlaybackRateDisplay=tm,e.PlaybackRateMenu=tg,e.PlaybackRateMenuButton=tc,e.PlaybackRateRadioGroup=tp,e.PreviewThumbnail=tz,e.PreviewTimeDisplay=tK,e.QualityRadioButton=tk,e.QualityRadioGroup=tx,e.RadioButton=eu,e.RadioGroup=ev,e.Range=tB,e.SeekButton=Z,e.SettingsMenu=tL,e.SettingsMenuButton=tR,e.SlotContainer=c,e.StateReceiverMixin=H,e.THEOliveDefaultUI=rY,e.TextTrackOffRadioButton=e$,e.TextTrackRadioButton=eF,e.TextTrackStyleDisplay=e4,e.TextTrackStyleMenu=ta,e.TextTrackStyleRadioGroup=e9,e.TextTrackStyleResetButton=tA,e.TimeDisplay=eo,e.TimeRange=tJ,e.TrackRadioGroup=eW,e.UIContainer=rD,e.VolumeRange=t0,e.buttonTemplate=I,e.linkButtonTemplate=D,e.menuGroupTemplate=eT,e.menuTemplate=ek,e.rangeTemplate=tq,e.registerExtension=function(e){rT.push(e)},e.version="1.16.2"});
41
+ `);class r$ extends HTMLElement{_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){a(this),this._radioGroup instanceof ev||customElements.upgrade(this._radioGroup),this.shadowRoot.addEventListener("change",this._onChange)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange)}constructor(){super(),this._onChange=()=>{this.dispatchEvent(new Event("change",{bubbles:!0}))};let e=this.attachShadow({mode:"open"});e.appendChild(rQ().content.cloneNode(!0)),this._radioGroup=e.querySelector("theoplayer-radio-group")}}customElements.define("theolive-bad-network-menu",r$);let rK=o("theolive-default-ui",'<style>:host{box-sizing:border-box;display:inline-block;font-family:Helvetica,Arial,sans-serif;position:relative;width:100%}:host([hidden]){display:none!important}theoplayer-ui{--theoplayer-loading-delay:0.1s;display:block;font-family:Helvetica,Arial,sans-serif;width:100%}:host(:-webkit-full-screen),:host(:-webkit-full-screen) theoplayer-ui{height:100%!important;width:100%!important}:host(:fullscreen),:host(:fullscreen) theoplayer-ui{height:100%!important;width:100%!important}theoplayer-menu::part(heading){display:none!important}[part=centered-chrome]{display:flex}[part=centered-chrome] *{--theoplayer-control-height:48px}[part=middle-chrome]{flex-grow:1;justify-content:flex-end;pointer-events:none}[part=bottom-chrome],[part=middle-chrome]{display:flex;flex-flow:column nowrap;position:relative}[part=bottom-chrome]{align-items:stretch}:host([mobile]) theoplayer-ui{--theoplayer-control-backdrop-background:rgba(0,0,0,.5)}:host{--theoplayer-control-background-gradient-stops:transparent 0%,rgba(0,0,0,.01) 8.1%,rgba(0,0,0,.037) 15.5%,rgba(0,0,0,.078) 22.5%,rgba(0,0,0,.131) 29%,rgba(0,0,0,.195) 35.3%,rgba(0,0,0,.264) 41.2%,rgba(0,0,0,.337) 47.1%,rgba(0,0,0,.413) 52.9%,rgba(0,0,0,.486) 58.8%,rgba(0,0,0,.555) 64.7%,rgba(0,0,0,.619) 71%,rgba(0,0,0,.672) 77.5%,rgba(0,0,0,.713) 84.5%,rgba(0,0,0,.74) 91.9%,rgba(0,0,0,.75) 100%}:host(:not([mobile])) [part=bottom-chrome]:before,:host(:not([mobile])) [part=top-chrome]:before{bottom:0;content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:-1}:host(:not([mobile])) [part=top-chrome]:before{background:linear-gradient(to top,var(--theoplayer-control-background-gradient-stops))}:host(:not([mobile])) [part=bottom-chrome]:before{background:linear-gradient(to bottom,var(--theoplayer-control-background-gradient-stops))}.theoplayer-spacer{flex-grow:1}theoplayer-time-range{--theoplayer-control-height:12px;--theoplayer-range-track-pointer-background:hsla(0,0%,100%,.5)}:host(:not([mobile])) [mobile-only],:host([mobile]) [mobile-hidden]{display:none!important}:host(:not([stream-type=vod])) [live-hidden],:host(:not([stream-type=vod])) theoplayer-control-bar ::slotted([live-hidden]),:host([stream-type=vod]) [live-only],:host([stream-type=vod]) theoplayer-control-bar ::slotted([live-only]){display:none!important}theoplayer-ui:not([has-first-play]) [part=centered-chrome] :not(theoplayer-play-button),theoplayer-ui:not([has-first-play]) theoplayer-control-bar,theoplayer-ui:not([playing-ad]) [ad-only],theoplayer-ui[playing-ad] [ad-hidden]{display:none!important}:host(:not([mobile])) theoplayer-ui[has-first-play] [part=centered-chrome] theoplayer-play-button{display:none!important}theoplayer-volume-range{--theoplayer-range-padding-left:0}theoplayer-mute-button+theoplayer-volume-range{--theoplayer-range-padding-right:0;--theoplayer-range-track-width:70px;overflow:hidden;transition:width .2s ease-in;width:0}theoplayer-mute-button+theoplayer-volume-range:focus,theoplayer-mute-button+theoplayer-volume-range:hover,theoplayer-mute-button:focus+theoplayer-volume-range,theoplayer-mute-button:hover+theoplayer-volume-range{width:70px}theoplayer-mute-button+theoplayer-volume-range:focus-within,theoplayer-mute-button:focus-within+theoplayer-volume-range{width:70px}theoplayer-live-button+theoplayer-time-display{padding-left:0}theoplayer-live-button[live]+theoplayer-time-display{display:none!important}p{color:#fff;color:var(--theoplayer-text-color,#fff);font-size:20px;font-size:var(--theoplayer-text-font-size,20px)}#announcement,#loading-announcement,#offline-announcement{display:none}theolive-bad-network-button{display:none;display:var(--theolive-bad-network-button-display,none)}theoplayer-settings-menu-button{display:inline-flex;display:var(--theolive-quality-button-display,inline-flex)}</style><theoplayer-ui><p id="loading-announcement" no-auto-hide slot="centered-chrome"><slot name="loading-announcement">Loading...</slot></p><p id="offline-announcement" no-auto-hide slot="centered-chrome"><slot name="offline-announcement">The live stream hasn\'t started yet</slot></p><p id="announcement" no-auto-hide slot="centered-chrome"></p><theoplayer-loading-indicator slot="centered-loading" no-auto-hide part="loading-indicator"></theoplayer-loading-indicator><div slot="centered-chrome" part="centered-chrome"><theoplayer-play-button part="center-play-button play-button center-button"></theoplayer-play-button></div><div part="bottom-chrome"><theoplayer-control-bar><theoplayer-play-button mobile-hidden part="play-button"></theoplayer-play-button><theoplayer-mute-button part="mute-button"></theoplayer-mute-button><theoplayer-volume-range mobile-hidden part="volume-range"></theoplayer-volume-range><theoplayer-live-button ad-hidden live-only part="live-button"></theoplayer-live-button><span class="theoplayer-spacer"></span><theoplayer-settings-menu-button ad-hidden menu="all-quality-menu" part="quality-button"></theoplayer-settings-menu-button><theolive-bad-network-button ad-hidden menu="quality-menu" part="theolive-bad-network-button"></theolive-bad-network-button><theoplayer-fullscreen-button part="fullscreen-button"></theoplayer-fullscreen-button></theoplayer-control-bar></div><theoplayer-menu id="quality-menu" slot="menu" menu-close-on-input hidden><theolive-bad-network-menu></theolive-bad-network-menu></theoplayer-menu><theoplayer-menu id="all-quality-menu" slot="menu" menu-close-on-input hidden><theoplayer-quality-radio-group></theoplayer-quality-radio-group></theoplayer-menu><theoplayer-error-display slot="error" part="error-display"></theoplayer-error-display></theoplayer-ui>');class rY extends rF{initShadowRoot(){let e=this.attachShadow({mode:"open",delegatesFocus:!0});return e.appendChild(rK().content.cloneNode(!0)),e}hidePlayerError(){this._root.removeAttribute("has-error"),this._errorDisplay.style.display="none"}stopHidingPlayerError(){this._root.setAttribute("has-error",""),this._errorDisplay.style.display="flex"}hidePlayerPlayButton_(){this._playButton.style.display="none"}stopHidingPlayerPlayButton(){this._playButton.style.display="inline-flex"}showMessage_(e,t){this.hidePlayerError(),this._loading.style.display="none",this._offline.style.display="none",this._announcement.style.display="none","loading"===e?this._loading.style.display="block":"offline"===e?this._offline.style.display="block":(this._announcement.textContent=null!=t?t:"",this._announcement.style.display="block"),this.hidePlayerPlayButton_()}hideMessage_(){this._loading.style.display="none",this._offline.style.display="none",this._announcement.style.display="none",this.stopHidingPlayerPlayButton()}constructor(e={}){super(e),this.onReady=()=>{this._ui.removeEventListener(rR,this.onReady);let e=this.player;if(e){var t,r,a;null==(t=e.theoLive)||t.addEventListener(["distributionloadstart","publicationloadstart"],this.onLoadChannelStart),null==(r=e.theoLive)||r.addEventListener(["distributionoffline","publicationoffline"],this.onChannelOffline),null==(a=e.theoLive)||a.addEventListener(["endpointloaded","publicationloaded"],this.onChannelLoaded),e.addEventListener("error",this.onError)}},this.onLoadChannelStart=()=>{this.showMessage_("loading",void 0)},this.onChannelOffline=()=>{this.showMessage_("offline",void 0)},this.onChannelLoaded=()=>{this.hidePlayerError(),this.hideMessage_()},this.onError=e=>{let t=e.errorObject.code;if(t<13e3||t>=14e3){this.showMessage_("offline",void 0);return}this.stopHidingPlayerError(),this.hideMessage_()},this._loading=this._shadowRoot.querySelector("#loading-announcement"),this._offline=this._shadowRoot.querySelector("#offline-announcement"),this._announcement=this._shadowRoot.querySelector("#announcement"),this._errorDisplay=this._shadowRoot.querySelector("theoplayer-error-display"),this._playButton=this._shadowRoot.querySelector("theoplayer-play-button"),this._root=this._shadowRoot.querySelector("theoplayer-ui"),this._ui.addEventListener(rR,this.onReady)}}customElements.define("theolive-default-ui",rY),e.ActiveQualityDisplay=tv,e.AdClickThroughButton=rf,e.AdCountdown=rv,e.AdDisplay=ry,e.AdSkipButton=rw,e.AirPlayButton=rr,e.Attribute=p,e.Button=N,e.CastButton=t2,e.ChromecastButton=t7,e.ChromecastDisplay=re,e.CloseMenuButton=eM,e.ColorStops=tD,e.ControlBar=s,e.DefaultUI=rF,e.DurationDisplay=el,e.ErrorDisplay=t5,e.ExtensionSlot=rx,e.FullscreenButton=tN,e.GestureReceiver=rs,e.LanguageMenu=tn,e.LanguageMenuButton=th,e.LinkButton=B,e.LiveButton=rp,e.LoadingIndicator=ro,e.MediaTrackRadioButton=eN,e.Menu=ew,e.MenuButton=eP,e.MenuGroup=eC,e.MuteButton=Y,e.PlayButton=Q,e.PlaybackRateDisplay=tm,e.PlaybackRateMenu=tg,e.PlaybackRateMenuButton=tc,e.PlaybackRateRadioGroup=tp,e.PreviewThumbnail=tz,e.PreviewTimeDisplay=tK,e.QualityRadioButton=tk,e.QualityRadioGroup=tx,e.RadioButton=eu,e.RadioGroup=ev,e.Range=tB,e.SeekButton=Z,e.SettingsMenu=tL,e.SettingsMenuButton=tR,e.SlotContainer=c,e.StateReceiverMixin=H,e.THEOliveDefaultUI=rY,e.TextTrackOffRadioButton=e$,e.TextTrackRadioButton=eF,e.TextTrackStyleDisplay=e4,e.TextTrackStyleMenu=ta,e.TextTrackStyleRadioGroup=e9,e.TextTrackStyleResetButton=tA,e.TimeDisplay=eo,e.TimeRange=tJ,e.TrackRadioGroup=eW,e.UIContainer=rD,e.VolumeRange=t0,e.buttonTemplate=I,e.linkButtonTemplate=D,e.menuGroupTemplate=eT,e.menuTemplate=ek,e.rangeTemplate=tq,e.registerExtension=function(e){rT.push(e)},e.version="1.16.3"});
42
42
  //# sourceMappingURL=THEOplayerUI.js.map