@broadcastingplatforms/player 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * BP Player (v1.3.0)
2
+ * BP Player (v1.4.0)
3
3
  * Universal video player web component
4
4
  */
5
- var Mu=Object.defineProperty;var nv=Object.getOwnPropertyDescriptor;var Ru=i=>{throw TypeError(i)};var av=(i,e,t)=>e in i?Mu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var U=(i,e,t,r)=>{for(var o=r>1?void 0:r?nv(e,t):e,n=i.length-1,a;n>=0;n--)(a=i[n])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Mu(e,t,o),o};var $=(i,e,t)=>av(i,typeof e!="symbol"?e+"":e,t),Wl=(i,e,t)=>e.has(i)||Ru("Cannot "+t);var u=(i,e,t)=>(Wl(i,e,"read from private field"),t?t.call(i):e.get(i)),L=(i,e,t)=>e.has(i)?Ru("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),v=(i,e,t,r)=>(Wl(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),P=(i,e,t)=>(Wl(i,e,"access private method"),t);var fa=globalThis,Ea=fa.ShadowRoot&&(fa.ShadyCSS===void 0||fa.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fl=Symbol(),xu=new WeakMap,Vo=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Fl)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Ea&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=xu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&xu.set(t,e))}return e}toString(){return this.cssText}},Pu=i=>new Vo(typeof i=="string"?i:i+"",void 0,Fl),Wo=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,o,n)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[n+1],i[0]);return new Vo(t,i,Fl)},Du=(i,e)=>{if(Ea)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),o=fa.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=t.cssText,i.appendChild(r)}},Kl=Ea?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return Pu(t)})(i):i;var{is:sv,defineProperty:lv,getOwnPropertyDescriptor:dv,getOwnPropertyNames:cv,getOwnPropertySymbols:uv,getPrototypeOf:hv}=Object,Yt=globalThis,Ou=Yt.trustedTypes,pv=Ou?Ou.emptyScript:"",Gl=Yt.reactiveElementPolyfillSupport,Fo=(i,e)=>i,Ko={toAttribute(i,e){switch(e){case Boolean:i=i?pv:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},ga=(i,e)=>!sv(i,e),Nu={attribute:!0,type:String,converter:Ko,reflect:!1,useDefault:!1,hasChanged:ga};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Yt.litPropertyMetadata??(Yt.litPropertyMetadata=new WeakMap);var Ot=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Nu){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),o=this.getPropertyDescriptor(e,r,t);o!==void 0&&lv(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){let{get:o,set:n}=dv(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:o,set(a){let l=o==null?void 0:o.call(this);n==null||n.call(this,a),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Nu}static _$Ei(){if(this.hasOwnProperty(Fo("elementProperties")))return;let e=hv(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Fo("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Fo("properties"))){let t=this.properties,r=[...cv(t),...uv(t)];for(let o of r)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,o]of t)this.elementProperties.set(r,o)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let o=this._$Eu(t,r);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let o of r)t.unshift(Kl(o))}else e!==void 0&&t.push(Kl(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Du(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var n;let r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){let a=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:Ko).toAttribute(t,r.type);this._$Em=e,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,t){var n,a;let r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let l=r.getPropertyOptions(o),d=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:Ko;this._$Em=o;let m=d.fromAttribute(t,l.type);this[o]=m??((a=this._$Ej)==null?void 0:a.get(o))??m,this._$Em=null}}requestUpdate(e,t,r,o=!1,n){var a;if(e!==void 0){let l=this.constructor;if(o===!1&&(n=this[e]),r??(r=l.getPropertyOptions(e)),!((r.hasChanged??ga)(n,t)||r.useDefault&&r.reflect&&n===((a=this._$Ej)==null?void 0:a.get(e))&&!this.hasAttribute(l._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:o,wrapped:n},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),n!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),o===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,a]of o){let{wrapped:l}=a,d=this[n];l!==!0||this._$AL.has(n)||d===void 0||this.C(n,void 0,a,d)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var o;return(o=r.hostUpdated)==null?void 0:o.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Ot.elementStyles=[],Ot.shadowRootOptions={mode:"open"},Ot[Fo("elementProperties")]=new Map,Ot[Fo("finalized")]=new Map,Gl==null||Gl({ReactiveElement:Ot}),(Yt.reactiveElementVersions??(Yt.reactiveElementVersions=[])).push("2.1.2");var qo=globalThis,Uu=i=>i,ba=qo.trustedTypes,Hu=ba?ba.createPolicy("lit-html",{createHTML:i=>i}):void 0,Ku="$lit$",Qt=`lit$${Math.random().toFixed(9).slice(2)}$`,Gu="?"+Qt,mv=`<${Gu}>`,xi=document,zo=()=>xi.createComment(""),Yo=i=>i===null||typeof i!="object"&&typeof i!="function",jl=Array.isArray,vv=i=>jl(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",ql=`[
6
- \f\r]`,Go=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$u=/-->/g,Bu=/>/g,Mi=RegExp(`>|${ql}(?:([^\\s"'>=/]+)(${ql}*=${ql}*(?:[^
7
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Vu=/'/g,Wu=/"/g,qu=/^(?:script|style|textarea|title)$/i,ed=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Ge=ed(1),gb=ed(2),bb=ed(3),Pi=Symbol.for("lit-noChange"),ge=Symbol.for("lit-nothing"),Fu=new WeakMap,Ri=xi.createTreeWalker(xi,129);function zu(i,e){if(!jl(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Hu!==void 0?Hu.createHTML(e):e}var fv=(i,e)=>{let t=i.length-1,r=[],o,n=e===2?"<svg>":e===3?"<math>":"",a=Go;for(let l=0;l<t;l++){let d=i[l],m,h,g=-1,E=0;for(;E<d.length&&(a.lastIndex=E,h=a.exec(d),h!==null);)E=a.lastIndex,a===Go?h[1]==="!--"?a=$u:h[1]!==void 0?a=Bu:h[2]!==void 0?(qu.test(h[2])&&(o=RegExp("</"+h[2],"g")),a=Mi):h[3]!==void 0&&(a=Mi):a===Mi?h[0]===">"?(a=o??Go,g=-1):h[1]===void 0?g=-2:(g=a.lastIndex-h[2].length,m=h[1],a=h[3]===void 0?Mi:h[3]==='"'?Wu:Vu):a===Wu||a===Vu?a=Mi:a===$u||a===Bu?a=Go:(a=Mi,o=void 0);let p=a===Mi&&i[l+1].startsWith("/>")?" ":"";n+=a===Go?d+mv:g>=0?(r.push(m),d.slice(0,g)+Ku+d.slice(g)+Qt+p):d+Qt+(g===-2?l:p)}return[zu(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},Qo=class i{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let n=0,a=0,l=e.length-1,d=this.parts,[m,h]=fv(e,t);if(this.el=i.createElement(m,r),Ri.currentNode=this.el.content,t===2||t===3){let g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(o=Ri.nextNode())!==null&&d.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let g of o.getAttributeNames())if(g.endsWith(Ku)){let E=h[a++],p=o.getAttribute(g).split(Qt),T=/([.?@])?(.*)/.exec(E);d.push({type:1,index:n,name:T[2],strings:p,ctor:T[1]==="."?Ql:T[1]==="?"?Zl:T[1]==="@"?Xl:Sr}),o.removeAttribute(g)}else g.startsWith(Qt)&&(d.push({type:6,index:n}),o.removeAttribute(g));if(qu.test(o.tagName)){let g=o.textContent.split(Qt),E=g.length-1;if(E>0){o.textContent=ba?ba.emptyScript:"";for(let p=0;p<E;p++)o.append(g[p],zo()),Ri.nextNode(),d.push({type:2,index:++n});o.append(g[E],zo())}}}else if(o.nodeType===8)if(o.data===Gu)d.push({type:2,index:n});else{let g=-1;for(;(g=o.data.indexOf(Qt,g+1))!==-1;)d.push({type:7,index:n}),g+=Qt.length-1}n++}}static createElement(e,t){let r=xi.createElement("template");return r.innerHTML=e,r}};function Ar(i,e,t=i,r){var a,l;if(e===Pi)return e;let o=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl,n=Yo(e)?void 0:e._$litDirective$;return(o==null?void 0:o.constructor)!==n&&((l=o==null?void 0:o._$AO)==null||l.call(o,!1),n===void 0?o=void 0:(o=new n(i),o._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=o:t._$Cl=o),o!==void 0&&(e=Ar(i,o._$AS(i,e.values),o,r)),e}var Yl=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,o=((e==null?void 0:e.creationScope)??xi).importNode(t,!0);Ri.currentNode=o;let n=Ri.nextNode(),a=0,l=0,d=r[0];for(;d!==void 0;){if(a===d.index){let m;d.type===2?m=new Zo(n,n.nextSibling,this,e):d.type===1?m=new d.ctor(n,d.name,d.strings,this,e):d.type===6&&(m=new Jl(n,this,e)),this._$AV.push(m),d=r[++l]}a!==(d==null?void 0:d.index)&&(n=Ri.nextNode(),a++)}return Ri.currentNode=xi,o}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},Zo=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,o){this.type=2,this._$AH=ge,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ar(this,e,t),Yo(e)?e===ge||e==null||e===""?(this._$AH!==ge&&this._$AR(),this._$AH=ge):e!==this._$AH&&e!==Pi&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):vv(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==ge&&Yo(this._$AH)?this._$AA.nextSibling.data=e:this.T(xi.createTextNode(e)),this._$AH=e}$(e){var n;let{values:t,_$litType$:r}=e,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Qo.createElement(zu(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===o)this._$AH.p(t);else{let a=new Yl(o,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=Fu.get(e.strings);return t===void 0&&Fu.set(e.strings,t=new Qo(e)),t}k(e){jl(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,o=0;for(let n of e)o===t.length?t.push(r=new i(this.O(zo()),this.O(zo()),this,this.options)):r=t[o],r._$AI(n),o++;o<t.length&&(this._$AR(r&&r._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let o=Uu(e).nextSibling;Uu(e).remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Sr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,o,n){this.type=1,this._$AH=ge,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ge}_$AI(e,t=this,r,o){let n=this.strings,a=!1;if(n===void 0)e=Ar(this,e,t,0),a=!Yo(e)||e!==this._$AH&&e!==Pi,a&&(this._$AH=e);else{let l=e,d,m;for(e=n[0],d=0;d<n.length-1;d++)m=Ar(this,l[r+d],t,d),m===Pi&&(m=this._$AH[d]),a||(a=!Yo(m)||m!==this._$AH[d]),m===ge?e=ge:e!==ge&&(e+=(m??"")+n[d+1]),this._$AH[d]=m}a&&!o&&this.j(e)}j(e){e===ge?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ql=class extends Sr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ge?void 0:e}},Zl=class extends Sr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ge)}},Xl=class extends Sr{constructor(e,t,r,o,n){super(e,t,r,o,n),this.type=5}_$AI(e,t=this){if((e=Ar(this,e,t,0)??ge)===Pi)return;let r=this._$AH,o=e===ge&&r!==ge||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==ge&&(r===ge||o);o&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},Jl=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Ar(this,e)}};var zl=qo.litHtmlPolyfillSupport;zl==null||zl(Qo,Zo),(qo.litHtmlVersions??(qo.litHtmlVersions=[])).push("3.3.2");var Yu=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,o=r._$litPart$;if(o===void 0){let n=(t==null?void 0:t.renderBefore)??null;r._$litPart$=o=new Zo(e.insertBefore(zo(),n),n,void 0,t??{})}return o._$AI(i),o};var Di=globalThis,Me=class extends Ot{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;let e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Yu(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Pi}},Qu;Me._$litElement$=!0,Me.finalized=!0,(Qu=Di.litElementHydrateSupport)==null||Qu.call(Di,{LitElement:Me});var td=Di.litElementPolyfillSupport;td==null||td({LitElement:Me});(Di.litElementVersions??(Di.litElementVersions=[])).push("4.2.2");var Zt=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Ev={attribute:!0,type:String,converter:Ko,reflect:!1,hasChanged:ga},gv=(i=Ev,e,t)=>{let{kind:r,metadata:o}=t,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(t.name,i),r==="accessor"){let{name:a}=t;return{set(l){let d=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,d,i,!0,l)},init(l){return l!==void 0&&this.C(a,void 0,i,l),l}}}if(r==="setter"){let{name:a}=t;return function(l){let d=this[a];e.call(this,l),this.requestUpdate(a,d,i,!0,l)}}throw Error("Unsupported decorator location: "+r)};function W(i){return(e,t)=>typeof t=="object"?gv(i,e,t):((r,o,n)=>{let a=o.hasOwnProperty(n);return o.constructor.createProperty(n,r),a?Object.getOwnPropertyDescriptor(o,n):void 0})(i,e,t)}function Xt(i){return W({...i,state:!0,attribute:!1})}var bv=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function id(i){return i===1005||i===1007||i===1009?"autoplay":i>=2001&&i<=2004?"offline":i>=3e3&&i<=3999?"media":i>=4900&&i<=4999?"security":i>=4e3&&i<=4899?"network":i>=5e3&&i<=5999?"setup":i>=1e3&&i<=1999?"media":"unknown"}function rd(i){return i===4e3||i===4001?"network":"unknown"}function ya(){return{paused:!0,playing:!1,ended:!1,seeking:!1,waiting:!1,currentTime:0,duration:NaN,buffered:null,volume:1,muted:!1,loop:!1,playbackRate:1,readyState:0,videoWidth:0,videoHeight:0,qualities:[],currentQuality:null,targetQuality:null,fullscreen:!1,presentationMode:"inline",providerType:null,connectionState:"idle",streamType:"vod",contentType:"video",error:null}}function Ta(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function Aa(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function od(i){return Ta(i)||Aa(i)}var ct=class extends Error{constructor(t,r,o){super(t);this.code=r;this.status=o;this.name="BPLiveError"}},Xo=class{constructor(e){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??null}get config(){return this._config}get authToken(){return this._authToken}get stream(){return this._stream}get clip(){return this._clip}async fetch(e){if(!this._authToken)throw new ct("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r=new AbortController,o=setTimeout(()=>r.abort(),3e4);try{let n=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`},signal:r.signal});if(!n.ok)throw new ct(`HTTP ${n.status}: ${n.statusText}`,"HTTP_ERROR",n.status);return n.json()}catch(n){throw n instanceof Error&&n.name==="AbortError"?new ct("Request timeout after 30s","TIMEOUT"):n}finally{clearTimeout(o)}}async getStream(e){return this.fetch(`/streams/${e}`)}async getClip(e){return this.fetch(`/clips/${e}`)}mapPlayerSourceToResolvedSource(e){if(e.provider==="livekit")return{type:"livekit",url:e.url,token:e.token,room:e.room};if(e.provider==="nanoplayer"){let{provider:t,...r}=e;return{type:"nano",source:r}}throw new ct(`Unknown player source provider: ${e.provider}`,"UNKNOWN_PROVIDER")}selectClipMedia(e,t="landscape"){let r=e.filter(l=>l.type==="clip");if(r.length===0)return null;let o=r.find(l=>l.orientation===t);if(o)return o;let n=t==="landscape"?"portrait":"landscape",a=r.find(l=>l.orientation===n);return a||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,Ta(e))return this.resolveStreamSource(e);if(Aa(e))return this.resolveClipSource(e);throw new ct("Invalid BPLive source","INVALID_SOURCE")}extractStreamPoster(e){var t;return e.cover_photo??((t=e.channel)==null?void 0:t.cover_image)??void 0}async resolveStreamSource(e){var l,d,m,h,g,E,p,T,f;let r=(await this.getStream(e.streamId)).data;this._stream=r;let o=this.extractStreamPoster(r);if(!!r.ended_at&&((d=(l=r.media)==null?void 0:l.vod)==null?void 0:d.length)>0){let b=r.media.vod[0];return{source:{type:"video",url:b.original},contentType:"video",poster:o??b.thumb??void 0,videoWidth:(m=b.dimension)==null?void 0:m.width,videoHeight:(h=b.dimension)==null?void 0:h.height}}let a=r.player_source??((g=r.active_stream)==null?void 0:g.player_source);if(a)return{source:this.mapPlayerSourceToResolvedSource(a),contentType:"stream",poster:o};if(((p=(E=r.media)==null?void 0:E.vod)==null?void 0:p.length)>0){let b=r.media.vod[0];return{source:{type:"video",url:b.original},contentType:"video",poster:o??b.thumb??void 0,videoWidth:(T=b.dimension)==null?void 0:T.width,videoHeight:(f=b.dimension)==null?void 0:f.height}}throw new ct("Stream is not live and has no VOD content","STREAM_OFFLINE")}async resolveClipSource(e){let r=(await this.getClip(e.clipId)).data;this._clip=r;let o=this.selectClipMedia(r.media,e.preferredOrientation);if(!o)throw new ct("No playable media found in clip","NO_MEDIA");return{source:this.mapClipMediaToPlayerSource(o),contentType:"clip",poster:o.thumbnail??void 0,videoWidth:o.width,videoHeight:o.height}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function _v(i){if(typeof i=="string")return"video";switch(i.type){case"video":return"video";case"nano":return"nano";case"livekit":return"livekit";default:return"video"}}function Zu(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var yv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],nd=class{constructor(){this._mediaElement=null;this._container=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._currentProviderType=null;this._ready=!1;this._loadGeneration=0;this._state=ya()}get state(){return this._state}get videoElement(){return this._mediaElement}get bpLive(){return this._bpLive}get ready(){return this._ready}get providerType(){return this._currentProviderType}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r)this._listeners.has(o)||this._listeners.set(o,new Set),this._listeners.get(o).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r){let n=this._listeners.get(o);n&&(n.delete(t),n.size===0&&this._listeners.delete(o))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let o of r)try{o(t)}catch(n){console.error(`[PlayerCore] Error in event listener for "${e}":`,n)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}attach(e,t){this._destroyed||(this._container=e,this._config=t,this._ready=!0)}async loadSource(e,t,r){if(this._destroyed)return;let o=++this._loadGeneration,n=t??this._container,a=r??this._config;if(!n){console.error("[PlayerCore] No container provided. Call attach() first or provide container to loadSource().");return}this._container=n,a&&(this._config=a);let l=Zu(e)?"clipId"in e?"clip":"stream":void 0;this.updateState({error:null,connectionState:"connecting",ended:!1,...l&&{contentType:l}}),this.dispatch("sourcechange",{source:e});try{let d=e,m=this._state.contentType,h,g,E;if(Zu(e)){if(a!=null&&a.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new Xo(a.bpLive)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let S=await this._bpLive.resolveSource(e);if(o!==this._loadGeneration)return;d=S.source,m=S.contentType,h=S.poster,g=S.videoWidth,E=S.videoHeight}let p=_v(d),b=p==="nano"||p==="livekit"||m==="stream"?"live":"vod";return this._mediaElement&&this.destroyMediaElement(),this._currentProviderType=p,this.updateState({providerType:p,contentType:m,streamType:b,paused:!0,playing:!1,waiting:!1,seeking:!1,readyState:0,currentTime:0,duration:NaN,buffered:null}),this._mediaElement=this.createMediaElement(p,d,a),this._mediaElement.style.width="100%",this._mediaElement.style.height="100%",this._mediaElement.style.objectFit="contain",this._state.muted&&(this._mediaElement.muted=!0),this._state.loop&&(this._mediaElement.loop=!0),this.attachMediaElementListeners(this._mediaElement),n.appendChild(this._mediaElement),this._ready=!0,this.dispatch("videoelementchange",{video:this._mediaElement}),{poster:h,videoWidth:g,videoHeight:E}}catch(d){if(o!==this._loadGeneration)return;console.error("[PlayerCore] loadSource error:",d);let m={code:-1,message:d instanceof Error?d.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:m,connectionState:"failed"}),this.dispatch("error",m)}}destroyMediaElement(){if(this._eventCleanup.forEach(e=>e()),this._eventCleanup=[],this._mediaElement&&(this._mediaElement.remove(),this._mediaElement=null,this.dispatch("emptied",void 0),this.dispatch("videoelementchange",{video:null})),this._container)for(;this._container.firstChild;)this._container.removeChild(this._container.firstChild)}createMediaElement(e,t,r){switch(e){case"nano":{let o=document.createElement("nano-video"),n=t;return o.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",n.source?o.sourceConfig=n.source:n.streamid&&(o.streamid=n.streamid),r!=null&&r.nano&&(o.config=r.nano),o}case"livekit":{let o=document.createElement("livekit-video"),n=t;return o.url=n.url,o.token=n.token,r!=null&&r.livekit&&(o.config=r.livekit),o}case"video":default:{let o=document.createElement("hls-video"),n=typeof t=="string"?t:t.url;return o.src=n,r!=null&&r.video&&(o.config=r.video),o}}}attachMediaElementListeners(e){for(let t of yv){let r=o=>this.handleMediaEvent(t,e,o);e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}handleMediaEvent(e,t,r){switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let o=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:o}),this.dispatch("loadedmetadata",{duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight});break}case"loadeddata":this.updateState({readyState:2}),this.dispatch("loadeddata",void 0);break;case"canplay":this.updateState({readyState:3,connectionState:"connected"}),this.dispatch("canplay",void 0),this.dispatch("connectionstatechange",{state:"connected"});break;case"canplaythrough":this.updateState({readyState:4}),this.dispatch("canplaythrough",void 0);break;case"play":this.updateState({paused:!1,ended:!1}),this.dispatch("play",void 0);break;case"playing":this.updateState({paused:!1,playing:!0,ended:!1,waiting:!1,readyState:4}),this.dispatch("playing",void 0);break;case"pause":this.updateState({paused:!0,playing:!1,waiting:!1}),this.dispatch("pause",void 0);break;case"waiting":this.updateState({playing:!1,waiting:!0,readyState:2}),this.dispatch("waiting",void 0);break;case"seeking":this.updateState({seeking:!0,currentTime:t.currentTime}),this.dispatch("seeking",{currentTime:t.currentTime});break;case"seeked":this.updateState({seeking:!1,currentTime:t.currentTime}),this.dispatch("seeked",{currentTime:t.currentTime});break;case"timeupdate":this.updateState({currentTime:t.currentTime,duration:t.duration}),this.dispatch("timeupdate",{currentTime:t.currentTime,duration:t.duration});break;case"durationchange":{let o=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:o}),this.dispatch("durationchange",{duration:t.duration}),this.dispatch("streamtypechange",{streamType:this._state.streamType});break}case"ratechange":this.updateState({playbackRate:t.playbackRate}),this.dispatch("ratechange",{playbackRate:t.playbackRate});break;case"volumechange":this.updateState({volume:t.volume,muted:t.muted}),this.dispatch("volumechange",{volume:t.volume,muted:t.muted});break;case"ended":this.updateState({ended:!0,paused:!0,playing:!1}),this.dispatch("ended",void 0);break;case"progress":this.updateState({buffered:t.buffered}),this.dispatch("progress",{buffered:t.buffered});break;case"error":{let o=-1,n="Unknown error";r instanceof ErrorEvent&&r.error?(o=r.error.code??-1,n=r.error.message??r.message??"Unknown error"):t.error&&(o=t.error.code??-1,n=t.error.message??"Unknown error");let a="media",l=!0;this._state.providerType==="nano"&&o>0?(a=id(o),l=a!=="offline"&&a!=="autoplay"):this._state.providerType==="livekit"&&o>0&&(a=rd(o),l=!0);let d={code:o,message:n,fatal:l,category:a};this.updateState({error:d}),this.dispatch("error",d);break}case"resize":t.videoWidth&&t.videoHeight&&(this.updateState({videoWidth:t.videoWidth,videoHeight:t.videoHeight}),this.dispatch("resize",{videoWidth:t.videoWidth,videoHeight:t.videoHeight}));break}}unloadSource(){this.destroyMediaElement(),this._currentProviderType=null,this.updateState({...ya(),volume:this._state.volume,muted:this._state.muted,loop:this._state.loop,playbackRate:this._state.playbackRate}),this.dispatch("sourcechange",{source:null})}async play(){if(this._mediaElement){this.updateState({paused:!1});try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this._mediaElement.pause())}seek(e){this._mediaElement&&(this._mediaElement.currentTime=e)}setVolume(e){let t=Math.max(0,Math.min(1,e));this.updateState({volume:t}),this._mediaElement&&(this._mediaElement.volume=t),this.dispatch("volumechange",{volume:t,muted:this._state.muted})}setMuted(e){this.updateState({muted:e}),this._mediaElement&&(this._mediaElement.muted=e),this.dispatch("volumechange",{volume:this._state.volume,muted:e})}setLoop(e){this.updateState({loop:e}),this._mediaElement&&(this._mediaElement.loop=e)}setPlaybackRate(e){this.updateState({playbackRate:e}),this._mediaElement&&(this._mediaElement.playbackRate=e),this.dispatch("ratechange",{playbackRate:e})}setTargetQuality(e){this.updateState({targetQuality:e}),this.dispatch("targetqualitychanged",{quality:e});let t=this._mediaElement;t!=null&&t.videoRenditions&&(t.videoRenditions.selectedIndex=(e==null?void 0:e.index)??-1)}setQuality(e){this.setTargetQuality(e)}_getFullscreenTarget(){return this._container?this._container.closest("media-controller")??this._container.parentElement:null}async setFullscreen(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"});let t=this._getFullscreenTarget();t&&(e&&!document.fullscreenElement?await t.requestFullscreen():!e&&document.fullscreenElement&&await document.exitFullscreen())}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){this._destroyed||(this._destroyed=!0,this.unloadSource(),this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this._container=null,this._config=void 0,this._ready=!1,this.dispatch("destroy",void 0),this._listeners.clear())}};function ad(){return new nd}var kr="bpPlayerObservedProperties";function sd(i){return kr in i&&Array.isArray(i[kr])}function Tv(i,e){class t extends i{get[kr](){return e}}return t}function Av(i){if(i.shadowRoot)return Array.from(i.shadowRoot.children);if(i.localName==="slot"){let t=i.assignedNodes();if(t.length>0)return t.filter(r=>r.nodeType===Node.ELEMENT_NODE)}return Array.from(i.children)}async function Lr(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!sd(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),sd(i)&&t(i);let r=Av(i);r.length>0&&await Promise.all(r.map(o=>Lr(o,e,t)))}function Sa(i,e,t){let r=i[kr];r.includes("player")&&(i.player=e),r.includes("paused")&&(i.paused=t.paused),r.includes("playing")&&(i.playing=t.playing),r.includes("ended")&&(i.ended=t.ended),r.includes("seeking")&&(i.seeking=t.seeking),r.includes("currentTime")&&(i.currentTime=t.currentTime),r.includes("duration")&&(i.duration=t.duration),r.includes("volume")&&(i.volume=t.volume),r.includes("muted")&&(i.muted=t.muted),r.includes("playbackRate")&&(i.playbackRate=t.playbackRate),r.includes("readyState")&&(i.readyState=t.readyState),r.includes("videoWidth")&&(i.videoWidth=t.videoWidth),r.includes("videoHeight")&&(i.videoHeight=t.videoHeight),r.includes("qualities")&&(i.qualities=t.qualities),r.includes("currentQuality")&&(i.currentQuality=t.currentQuality),r.includes("targetQuality")&&(i.targetQuality=t.targetQuality),r.includes("fullscreen")&&(i.fullscreen=t.fullscreen),r.includes("presentationMode")&&(i.presentationMode=t.presentationMode),r.includes("connectionState")&&(i.connectionState=t.connectionState),r.includes("streamType")&&(i.streamType=t.streamType),r.includes("error")&&(i.error=t.error)}function ka(i){i[kr].includes("player")&&(i.player=void 0)}var Xu=`/**
5
+ var Du=Object.defineProperty;var cv=Object.getOwnPropertyDescriptor;var Ou=i=>{throw TypeError(i)};var uv=(i,e,t)=>e in i?Du(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var U=(i,e,t,r)=>{for(var o=r>1?void 0:r?cv(e,t):e,n=i.length-1,s;n>=0;n--)(s=i[n])&&(o=(r?s(e,t,o):s(o))||o);return r&&o&&Du(e,t,o),o};var $=(i,e,t)=>uv(i,typeof e!="symbol"?e+"":e,t),ql=(i,e,t)=>e.has(i)||Ou("Cannot "+t);var u=(i,e,t)=>(ql(i,e,"read from private field"),t?t.call(i):e.get(i)),L=(i,e,t)=>e.has(i)?Ou("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),v=(i,e,t,r)=>(ql(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),P=(i,e,t)=>(ql(i,e,"access private method"),t);var gs=globalThis,bs=gs.ShadowRoot&&(gs.ShadyCSS===void 0||gs.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Kl=Symbol(),Nu=new WeakMap,Vo=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Kl)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(bs&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=Nu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Nu.set(t,e))}return e}toString(){return this.cssText}},Uu=i=>new Vo(typeof i=="string"?i:i+"",void 0,Kl),Wo=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,o,n)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[n+1],i[0]);return new Vo(t,i,Kl)},Hu=(i,e)=>{if(bs)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),o=gs.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=t.cssText,i.appendChild(r)}},Gl=bs?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return Uu(t)})(i):i;var{is:hv,defineProperty:pv,getOwnPropertyDescriptor:mv,getOwnPropertyNames:vv,getOwnPropertySymbols:fv,getPrototypeOf:Ev}=Object,Yt=globalThis,$u=Yt.trustedTypes,gv=$u?$u.emptyScript:"",zl=Yt.reactiveElementPolyfillSupport,Fo=(i,e)=>i,qo={toAttribute(i,e){switch(e){case Boolean:i=i?gv:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},_s=(i,e)=>!hv(i,e),Bu={attribute:!0,type:String,converter:qo,reflect:!1,useDefault:!1,hasChanged:_s};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Yt.litPropertyMetadata??(Yt.litPropertyMetadata=new WeakMap);var Ot=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Bu){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),o=this.getPropertyDescriptor(e,r,t);o!==void 0&&pv(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){let{get:o,set:n}=mv(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:o,set(s){let l=o==null?void 0:o.call(this);n==null||n.call(this,s),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Bu}static _$Ei(){if(this.hasOwnProperty(Fo("elementProperties")))return;let e=Ev(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Fo("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Fo("properties"))){let t=this.properties,r=[...vv(t),...fv(t)];for(let o of r)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,o]of t)this.elementProperties.set(r,o)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let o=this._$Eu(t,r);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let o of r)t.unshift(Gl(o))}else e!==void 0&&t.push(Gl(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Hu(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var n;let r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){let s=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:qo).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(e,t){var n,s;let r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let l=r.getPropertyOptions(o),d=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:qo;this._$Em=o;let m=d.fromAttribute(t,l.type);this[o]=m??((s=this._$Ej)==null?void 0:s.get(o))??m,this._$Em=null}}requestUpdate(e,t,r,o=!1,n){var s;if(e!==void 0){let l=this.constructor;if(o===!1&&(n=this[e]),r??(r=l.getPropertyOptions(e)),!((r.hasChanged??_s)(n,t)||r.useDefault&&r.reflect&&n===((s=this._$Ej)==null?void 0:s.get(e))&&!this.hasAttribute(l._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:o,wrapped:n},s){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,s??t??this[e]),n!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),o===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,s]of o){let{wrapped:l}=s,d=this[n];l!==!0||this._$AL.has(n)||d===void 0||this.C(n,void 0,s,d)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var o;return(o=r.hostUpdated)==null?void 0:o.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Ot.elementStyles=[],Ot.shadowRootOptions={mode:"open"},Ot[Fo("elementProperties")]=new Map,Ot[Fo("finalized")]=new Map,zl==null||zl({ReactiveElement:Ot}),(Yt.reactiveElementVersions??(Yt.reactiveElementVersions=[])).push("2.1.2");var Go=globalThis,Vu=i=>i,ys=Go.trustedTypes,Wu=ys?ys.createPolicy("lit-html",{createHTML:i=>i}):void 0,Yu="$lit$",Qt=`lit$${Math.random().toFixed(9).slice(2)}$`,Qu="?"+Qt,bv=`<${Qu}>`,xi=document,zo=()=>xi.createComment(""),Yo=i=>i===null||typeof i!="object"&&typeof i!="function",td=Array.isArray,_v=i=>td(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Yl=`[
6
+ \f\r]`,Ko=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Fu=/-->/g,qu=/>/g,Ri=RegExp(`>|${Yl}(?:([^\\s"'>=/]+)(${Yl}*=${Yl}*(?:[^
7
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ku=/'/g,Gu=/"/g,Zu=/^(?:script|style|textarea|title)$/i,id=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Ke=id(1),Ab=id(2),Sb=id(3),Pi=Symbol.for("lit-noChange"),ge=Symbol.for("lit-nothing"),zu=new WeakMap,Mi=xi.createTreeWalker(xi,129);function Xu(i,e){if(!td(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Wu!==void 0?Wu.createHTML(e):e}var yv=(i,e)=>{let t=i.length-1,r=[],o,n=e===2?"<svg>":e===3?"<math>":"",s=Ko;for(let l=0;l<t;l++){let d=i[l],m,h,g=-1,E=0;for(;E<d.length&&(s.lastIndex=E,h=s.exec(d),h!==null);)E=s.lastIndex,s===Ko?h[1]==="!--"?s=Fu:h[1]!==void 0?s=qu:h[2]!==void 0?(Zu.test(h[2])&&(o=RegExp("</"+h[2],"g")),s=Ri):h[3]!==void 0&&(s=Ri):s===Ri?h[0]===">"?(s=o??Ko,g=-1):h[1]===void 0?g=-2:(g=s.lastIndex-h[2].length,m=h[1],s=h[3]===void 0?Ri:h[3]==='"'?Gu:Ku):s===Gu||s===Ku?s=Ri:s===Fu||s===qu?s=Ko:(s=Ri,o=void 0);let p=s===Ri&&i[l+1].startsWith("/>")?" ":"";n+=s===Ko?d+bv:g>=0?(r.push(m),d.slice(0,g)+Yu+d.slice(g)+Qt+p):d+Qt+(g===-2?l:p)}return[Xu(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},Qo=class i{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let n=0,s=0,l=e.length-1,d=this.parts,[m,h]=yv(e,t);if(this.el=i.createElement(m,r),Mi.currentNode=this.el.content,t===2||t===3){let g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(o=Mi.nextNode())!==null&&d.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let g of o.getAttributeNames())if(g.endsWith(Yu)){let E=h[s++],p=o.getAttribute(g).split(Qt),T=/([.?@])?(.*)/.exec(E);d.push({type:1,index:n,name:T[2],strings:p,ctor:T[1]==="."?Xl:T[1]==="?"?Jl:T[1]==="@"?jl:Sr}),o.removeAttribute(g)}else g.startsWith(Qt)&&(d.push({type:6,index:n}),o.removeAttribute(g));if(Zu.test(o.tagName)){let g=o.textContent.split(Qt),E=g.length-1;if(E>0){o.textContent=ys?ys.emptyScript:"";for(let p=0;p<E;p++)o.append(g[p],zo()),Mi.nextNode(),d.push({type:2,index:++n});o.append(g[E],zo())}}}else if(o.nodeType===8)if(o.data===Qu)d.push({type:2,index:n});else{let g=-1;for(;(g=o.data.indexOf(Qt,g+1))!==-1;)d.push({type:7,index:n}),g+=Qt.length-1}n++}}static createElement(e,t){let r=xi.createElement("template");return r.innerHTML=e,r}};function Ar(i,e,t=i,r){var s,l;if(e===Pi)return e;let o=r!==void 0?(s=t._$Co)==null?void 0:s[r]:t._$Cl,n=Yo(e)?void 0:e._$litDirective$;return(o==null?void 0:o.constructor)!==n&&((l=o==null?void 0:o._$AO)==null||l.call(o,!1),n===void 0?o=void 0:(o=new n(i),o._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=o:t._$Cl=o),o!==void 0&&(e=Ar(i,o._$AS(i,e.values),o,r)),e}var Zl=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,o=((e==null?void 0:e.creationScope)??xi).importNode(t,!0);Mi.currentNode=o;let n=Mi.nextNode(),s=0,l=0,d=r[0];for(;d!==void 0;){if(s===d.index){let m;d.type===2?m=new Zo(n,n.nextSibling,this,e):d.type===1?m=new d.ctor(n,d.name,d.strings,this,e):d.type===6&&(m=new ed(n,this,e)),this._$AV.push(m),d=r[++l]}s!==(d==null?void 0:d.index)&&(n=Mi.nextNode(),s++)}return Mi.currentNode=xi,o}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},Zo=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,o){this.type=2,this._$AH=ge,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ar(this,e,t),Yo(e)?e===ge||e==null||e===""?(this._$AH!==ge&&this._$AR(),this._$AH=ge):e!==this._$AH&&e!==Pi&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):_v(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==ge&&Yo(this._$AH)?this._$AA.nextSibling.data=e:this.T(xi.createTextNode(e)),this._$AH=e}$(e){var n;let{values:t,_$litType$:r}=e,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Qo.createElement(Xu(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===o)this._$AH.p(t);else{let s=new Zl(o,this),l=s.u(this.options);s.p(t),this.T(l),this._$AH=s}}_$AC(e){let t=zu.get(e.strings);return t===void 0&&zu.set(e.strings,t=new Qo(e)),t}k(e){td(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,o=0;for(let n of e)o===t.length?t.push(r=new i(this.O(zo()),this.O(zo()),this,this.options)):r=t[o],r._$AI(n),o++;o<t.length&&(this._$AR(r&&r._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let o=Vu(e).nextSibling;Vu(e).remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Sr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,o,n){this.type=1,this._$AH=ge,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ge}_$AI(e,t=this,r,o){let n=this.strings,s=!1;if(n===void 0)e=Ar(this,e,t,0),s=!Yo(e)||e!==this._$AH&&e!==Pi,s&&(this._$AH=e);else{let l=e,d,m;for(e=n[0],d=0;d<n.length-1;d++)m=Ar(this,l[r+d],t,d),m===Pi&&(m=this._$AH[d]),s||(s=!Yo(m)||m!==this._$AH[d]),m===ge?e=ge:e!==ge&&(e+=(m??"")+n[d+1]),this._$AH[d]=m}s&&!o&&this.j(e)}j(e){e===ge?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Xl=class extends Sr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ge?void 0:e}},Jl=class extends Sr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ge)}},jl=class extends Sr{constructor(e,t,r,o,n){super(e,t,r,o,n),this.type=5}_$AI(e,t=this){if((e=Ar(this,e,t,0)??ge)===Pi)return;let r=this._$AH,o=e===ge&&r!==ge||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==ge&&(r===ge||o);o&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},ed=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Ar(this,e)}};var Ql=Go.litHtmlPolyfillSupport;Ql==null||Ql(Qo,Zo),(Go.litHtmlVersions??(Go.litHtmlVersions=[])).push("3.3.2");var Ju=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,o=r._$litPart$;if(o===void 0){let n=(t==null?void 0:t.renderBefore)??null;r._$litPart$=o=new Zo(e.insertBefore(zo(),n),n,void 0,t??{})}return o._$AI(i),o};var Di=globalThis,Re=class extends Ot{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;let e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ju(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Pi}},ju;Re._$litElement$=!0,Re.finalized=!0,(ju=Di.litElementHydrateSupport)==null||ju.call(Di,{LitElement:Re});var rd=Di.litElementPolyfillSupport;rd==null||rd({LitElement:Re});(Di.litElementVersions??(Di.litElementVersions=[])).push("4.2.2");var Zt=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Tv={attribute:!0,type:String,converter:qo,reflect:!1,hasChanged:_s},Av=(i=Tv,e,t)=>{let{kind:r,metadata:o}=t,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(t.name,i),r==="accessor"){let{name:s}=t;return{set(l){let d=e.get.call(this);e.set.call(this,l),this.requestUpdate(s,d,i,!0,l)},init(l){return l!==void 0&&this.C(s,void 0,i,l),l}}}if(r==="setter"){let{name:s}=t;return function(l){let d=this[s];e.call(this,l),this.requestUpdate(s,d,i,!0,l)}}throw Error("Unsupported decorator location: "+r)};function W(i){return(e,t)=>typeof t=="object"?Av(i,e,t):((r,o,n)=>{let s=o.hasOwnProperty(n);return o.constructor.createProperty(n,r),s?Object.getOwnPropertyDescriptor(o,n):void 0})(i,e,t)}function Xt(i){return W({...i,state:!0,attribute:!1})}var Sv=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function od(i){return i===1005||i===1007||i===1009?"autoplay":i>=2001&&i<=2004?"offline":i>=3e3&&i<=3999?"media":i>=4900&&i<=4999?"security":i>=4e3&&i<=4899?"network":i>=5e3&&i<=5999?"setup":i>=1e3&&i<=1999?"media":"unknown"}function nd(i){return i===4e3||i===4001?"network":"unknown"}function As(){return{paused:!0,playing:!1,ended:!1,seeking:!1,waiting:!1,currentTime:0,duration:NaN,buffered:null,volume:1,muted:!1,loop:!1,playbackRate:1,readyState:0,videoWidth:0,videoHeight:0,qualities:[],currentQuality:null,targetQuality:null,fullscreen:!1,presentationMode:"inline",providerType:null,connectionState:"idle",streamType:"vod",contentType:"video",error:null}}function Ss(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function ks(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function sd(i){return Ss(i)||ks(i)}var ct=class extends Error{constructor(t,r,o){super(t);this.code=r;this.status=o;this.name="BPLiveError"}},Xo=class{constructor(e,t){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??null,this._network=t??null}get config(){return this._config}get authToken(){return this._authToken}get stream(){return this._stream}get clip(){return this._clip}async fetch(e){if(!this._authToken)throw new ct("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r={"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`};if(this._network){let s=await this._network.intercept({url:t,method:"GET",type:"api",headers:r});if(s.response)return s.response.body;t=s.url,r=s.headers}let o=new AbortController,n=setTimeout(()=>o.abort(),3e4);try{let s=await fetch(t,{method:"GET",headers:r,signal:o.signal});if(!s.ok)throw new ct(`HTTP ${s.status}: ${s.statusText}`,"HTTP_ERROR",s.status);let l=await s.json();return this._network&&(l=(await this._network.interceptResponse({url:t,status:s.status,headers:Object.fromEntries(s.headers),body:l})).body),l}catch(s){throw s instanceof Error&&s.name==="AbortError"?new ct("Request timeout after 30s","TIMEOUT"):s}finally{clearTimeout(n)}}async getStream(e){return this.fetch(`/streams/${e}`)}async getClip(e){return this.fetch(`/clips/${e}`)}mapPlayerSourceToResolvedSource(e){if(e.provider==="livekit")return{type:"livekit",url:e.url,token:e.token,room:e.room};if(e.provider==="nanoplayer"){let{provider:t,...r}=e;return{type:"nano",source:r}}throw new ct(`Unknown player source provider: ${e.provider}`,"UNKNOWN_PROVIDER")}selectClipMedia(e,t="landscape"){let r=e.filter(l=>l.type==="clip");if(r.length===0)return null;let o=r.find(l=>l.orientation===t);if(o)return o;let n=t==="landscape"?"portrait":"landscape",s=r.find(l=>l.orientation===n);return s||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,Ss(e))return this.resolveStreamSource(e);if(ks(e))return this.resolveClipSource(e);throw new ct("Invalid BPLive source","INVALID_SOURCE")}extractStreamPoster(e){var t;return e.cover_photo??((t=e.channel)==null?void 0:t.cover_image)??void 0}async resolveStreamSource(e){var l,d,m,h,g,E,p,T,f;let r=(await this.getStream(e.streamId)).data;this._stream=r;let o=this.extractStreamPoster(r);if(!!r.ended_at&&((d=(l=r.media)==null?void 0:l.vod)==null?void 0:d.length)>0){let b=r.media.vod[0];return{source:{type:"video",url:b.original},contentType:"video",poster:o??b.thumb??void 0,videoWidth:(m=b.dimension)==null?void 0:m.width,videoHeight:(h=b.dimension)==null?void 0:h.height}}let s=r.player_source??((g=r.active_stream)==null?void 0:g.player_source);if(s)return{source:this.mapPlayerSourceToResolvedSource(s),contentType:"stream",poster:o};if(((p=(E=r.media)==null?void 0:E.vod)==null?void 0:p.length)>0){let b=r.media.vod[0];return{source:{type:"video",url:b.original},contentType:"video",poster:o??b.thumb??void 0,videoWidth:(T=b.dimension)==null?void 0:T.width,videoHeight:(f=b.dimension)==null?void 0:f.height}}throw new ct("Stream is not live and has no VOD content","STREAM_OFFLINE")}async resolveClipSource(e){let r=(await this.getClip(e.clipId)).data;this._clip=r;let o=this.selectClipMedia(r.media,e.preferredOrientation);if(!o)throw new ct("No playable media found in clip","NO_MEDIA");return{source:this.mapClipMediaToPlayerSource(o),contentType:"clip",poster:o.thumbnail??void 0,videoWidth:o.width,videoHeight:o.height}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function Jo(i){return i!=null&&typeof i.then=="function"}function eh(i){return new Promise((e,t)=>{let r=!1,o=n=>{r||(r=!0,n?t(n):e())};try{let n=i(o);Jo(n)&&(r=!0,n.then(()=>e(),t))}catch(n){o(n)}})}var ad=class{constructor(e,t,r){this._closed=!1;this._pendingCount=0;this._firstError=null;this._redirectResult=null;this._responseResult=null;this.promise=new Promise((o,n)=>{this._resolve=o,this._reject=n}),this._state=e,this._interceptor=t,this._canModify=r,this._start()}get redirectResult(){return this._redirectResult}get responseResult(){return this._responseResult}get _open(){return this._canModify&&!this._closed}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());Jo(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get method(){return e._state.method},get type(){return e._state.type},get headers(){return{...e._state.headers}},get closed(){return!e._open},redirect(t){e._redirect(t)},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_redirect(e){if(!this._open)throw new Error("Request is closed");let t=typeof e=="string"?{url:e}:e;this._redirectResult={url:t.url??this._state.url,method:t.method??this._state.method,type:this._state.type,headers:t.headers??{...this._state.headers}},this._close()}_respondWith(e){if(!this._open)throw new Error("Request is closed");this._responseResult=e,this._close()}_waitUntil(e){if(!this._open)throw new Error("Request is closed");Jo(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(eh(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},ld=class{constructor(e,t){this._closed=!1;this._pendingCount=0;this._firstError=null;this._responseResult=null;this.promise=new Promise((r,o)=>{this._resolve=r,this._reject=o}),this._state=e,this._interceptor=t,this._start()}get responseResult(){return this._responseResult}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());Jo(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get status(){return e._state.status},get headers(){return{...e._state.headers}},get body(){return e._state.body},get closed(){return e._closed},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_respondWith(e){if(this._closed)throw new Error("Response is closed");this._responseResult=e,this._close()}_waitUntil(e){if(this._closed)throw new Error("Response is closed");Jo(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(eh(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},jo=class{constructor(){this._requestInterceptors=[];this._responseInterceptors=[]}addRequestInterceptor(e){this._requestInterceptors.unshift(e)}removeRequestInterceptor(e){let t=this._requestInterceptors.indexOf(e);t>=0&&this._requestInterceptors.splice(t,1)}addResponseInterceptor(e){this._responseInterceptors.unshift(e)}removeResponseInterceptor(e){let t=this._responseInterceptors.indexOf(e);t>=0&&this._responseInterceptors.splice(t,1)}async intercept(e){let t={...e,headers:{...e.headers}},r=!1,o=null;for(let n of this._requestInterceptors.slice()){let s=new ad(t,n,!r);try{await s.promise}catch{continue}s.responseResult&&!r&&(r=!0,o=s.responseResult),s.redirectResult&&!r&&(t=s.redirectResult)}return{url:t.url,headers:t.headers,response:o}}async interceptResponse(e){let t={...e,headers:{...e.headers}};for(let r of this._responseInterceptors.slice()){let o=new ld(t,r);try{await o.promise}catch{continue}o.responseResult&&(t={...t,status:o.responseResult.status!==void 0?o.responseResult.status:t.status,headers:o.responseResult.headers!==void 0?o.responseResult.headers:t.headers,body:"body"in o.responseResult?o.responseResult.body:t.body})}return{status:t.status,headers:t.headers,body:t.body}}};function kv(i){if(typeof i=="string")return"video";switch(i.type){case"video":return"video";case"nano":return"nano";case"livekit":return"livekit";default:return"video"}}function th(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var Lv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],dd=class{constructor(){this._mediaElement=null;this._container=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._network=new jo;this._currentProviderType=null;this._ready=!1;this._loadGeneration=0;this._state=As()}get state(){return this._state}get videoElement(){return this._mediaElement}get bpLive(){return this._bpLive}get network(){return this._network}get ready(){return this._ready}get providerType(){return this._currentProviderType}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r)this._listeners.has(o)||this._listeners.set(o,new Set),this._listeners.get(o).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r){let n=this._listeners.get(o);n&&(n.delete(t),n.size===0&&this._listeners.delete(o))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let o of r)try{o(t)}catch(n){console.error(`[PlayerCore] Error in event listener for "${e}":`,n)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}attach(e,t){this._destroyed||(this._container=e,this._config=t,this._ready=!0)}async loadSource(e,t,r){if(this._destroyed)return;let o=++this._loadGeneration,n=t??this._container,s=r??this._config;if(!n){console.error("[PlayerCore] No container provided. Call attach() first or provide container to loadSource().");return}this._container=n,s&&(this._config=s);let l=th(e)?"clipId"in e?"clip":"stream":void 0;this.updateState({error:null,connectionState:"connecting",ended:!1,...l&&{contentType:l}}),this.dispatch("sourcechange",{source:e});try{let d=e,m=this._state.contentType,h,g,E;if(th(e)){if(s!=null&&s.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new Xo(s.bpLive,this._network)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let S=await this._bpLive.resolveSource(e);if(o!==this._loadGeneration)return;d=S.source,m=S.contentType,h=S.poster,g=S.videoWidth,E=S.videoHeight}let p=kv(d),b=p==="nano"||p==="livekit"||m==="stream"?"live":"vod";return this._mediaElement&&this.destroyMediaElement(),this._currentProviderType=p,this.updateState({providerType:p,contentType:m,streamType:b,paused:!0,playing:!1,waiting:!1,seeking:!1,readyState:0,currentTime:0,duration:NaN,buffered:null}),this._mediaElement=this.createMediaElement(p,d,s),this._mediaElement.style.width="100%",this._mediaElement.style.height="100%",this._mediaElement.style.objectFit="contain",this._state.muted&&(this._mediaElement.muted=!0),this._state.loop&&(this._mediaElement.loop=!0),this.attachMediaElementListeners(this._mediaElement),n.appendChild(this._mediaElement),this._ready=!0,this.dispatch("videoelementchange",{video:this._mediaElement}),{poster:h,videoWidth:g,videoHeight:E}}catch(d){if(o!==this._loadGeneration)return;console.error("[PlayerCore] loadSource error:",d);let m={code:-1,message:d instanceof Error?d.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:m,connectionState:"failed"}),this.dispatch("error",m)}}destroyMediaElement(){if(this._eventCleanup.forEach(e=>e()),this._eventCleanup=[],this._mediaElement&&(this._mediaElement.remove(),this._mediaElement=null,this.dispatch("emptied",void 0),this.dispatch("videoelementchange",{video:null})),this._container)for(;this._container.firstChild;)this._container.removeChild(this._container.firstChild)}createMediaElement(e,t,r){switch(e){case"nano":{let o=document.createElement("nano-video"),n=t;return o.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",n.source?o.sourceConfig=n.source:n.streamid&&(o.streamid=n.streamid),r!=null&&r.nano&&(o.config=r.nano),o}case"livekit":{let o=document.createElement("livekit-video"),n=t;return o.url=n.url,o.token=n.token,r!=null&&r.livekit&&(o.config=r.livekit),o}case"video":default:{let o=document.createElement("hls-video"),n=typeof t=="string"?t:t.url;o.src=n;let s={...r==null?void 0:r.video},l=this._network,d=s.xhrSetup;return s.xhrSetup=async(m,h)=>{let g=h.includes(".m3u8")?"manifest":h.includes(".ts")||h.includes(".m4s")||h.includes(".fmp4")?"segment":"other",E=await l.intercept({url:h,method:"GET",type:g,headers:{}});E.url!==h&&m.open("GET",E.url,!0);for(let[p,T]of Object.entries(E.headers))m.setRequestHeader(p,T);d&&await d(m,E.url)},o.config=s,o}}}attachMediaElementListeners(e){for(let t of Lv){let r=o=>this.handleMediaEvent(t,e,o);e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}handleMediaEvent(e,t,r){switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let o=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:o}),this.dispatch("loadedmetadata",{duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight});break}case"loadeddata":this.updateState({readyState:2}),this.dispatch("loadeddata",void 0);break;case"canplay":this.updateState({readyState:3,connectionState:"connected"}),this.dispatch("canplay",void 0),this.dispatch("connectionstatechange",{state:"connected"});break;case"canplaythrough":this.updateState({readyState:4}),this.dispatch("canplaythrough",void 0);break;case"play":this.updateState({paused:!1,ended:!1}),this.dispatch("play",void 0);break;case"playing":this.updateState({paused:!1,playing:!0,ended:!1,waiting:!1,readyState:4}),this.dispatch("playing",void 0);break;case"pause":this.updateState({paused:!0,playing:!1,waiting:!1}),this.dispatch("pause",void 0);break;case"waiting":this.updateState({playing:!1,waiting:!0,readyState:2}),this.dispatch("waiting",void 0);break;case"seeking":this.updateState({seeking:!0,currentTime:t.currentTime}),this.dispatch("seeking",{currentTime:t.currentTime});break;case"seeked":this.updateState({seeking:!1,currentTime:t.currentTime}),this.dispatch("seeked",{currentTime:t.currentTime});break;case"timeupdate":this.updateState({currentTime:t.currentTime,duration:t.duration}),this.dispatch("timeupdate",{currentTime:t.currentTime,duration:t.duration});break;case"durationchange":{let o=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:o}),this.dispatch("durationchange",{duration:t.duration}),this.dispatch("streamtypechange",{streamType:this._state.streamType});break}case"ratechange":this.updateState({playbackRate:t.playbackRate}),this.dispatch("ratechange",{playbackRate:t.playbackRate});break;case"volumechange":this.updateState({volume:t.volume,muted:t.muted}),this.dispatch("volumechange",{volume:t.volume,muted:t.muted});break;case"ended":this.updateState({ended:!0,paused:!0,playing:!1}),this.dispatch("ended",void 0);break;case"progress":this.updateState({buffered:t.buffered}),this.dispatch("progress",{buffered:t.buffered});break;case"error":{let o=-1,n="Unknown error";r instanceof ErrorEvent&&r.error?(o=r.error.code??-1,n=r.error.message??r.message??"Unknown error"):t.error&&(o=t.error.code??-1,n=t.error.message??"Unknown error");let s="media",l=!0;this._state.providerType==="nano"&&o>0?(s=od(o),l=s!=="offline"&&s!=="autoplay"):this._state.providerType==="livekit"&&o>0&&(s=nd(o),l=!0);let d={code:o,message:n,fatal:l,category:s};this.updateState({error:d}),this.dispatch("error",d);break}case"resize":t.videoWidth&&t.videoHeight&&(this.updateState({videoWidth:t.videoWidth,videoHeight:t.videoHeight}),this.dispatch("resize",{videoWidth:t.videoWidth,videoHeight:t.videoHeight}));break}}unloadSource(){this.destroyMediaElement(),this._currentProviderType=null,this.updateState({...As(),volume:this._state.volume,muted:this._state.muted,loop:this._state.loop,playbackRate:this._state.playbackRate}),this.dispatch("sourcechange",{source:null})}async play(){if(this._mediaElement){this.updateState({paused:!1});try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this._mediaElement.pause())}seek(e){this._mediaElement&&(this._mediaElement.currentTime=e)}setVolume(e){let t=Math.max(0,Math.min(1,e));this.updateState({volume:t}),this._mediaElement&&(this._mediaElement.volume=t),this.dispatch("volumechange",{volume:t,muted:this._state.muted})}setMuted(e){this.updateState({muted:e}),this._mediaElement&&(this._mediaElement.muted=e),this.dispatch("volumechange",{volume:this._state.volume,muted:e})}setLoop(e){this.updateState({loop:e}),this._mediaElement&&(this._mediaElement.loop=e)}setPlaybackRate(e){this.updateState({playbackRate:e}),this._mediaElement&&(this._mediaElement.playbackRate=e),this.dispatch("ratechange",{playbackRate:e})}setTargetQuality(e){this.updateState({targetQuality:e}),this.dispatch("targetqualitychanged",{quality:e});let t=this._mediaElement;t!=null&&t.videoRenditions&&(t.videoRenditions.selectedIndex=(e==null?void 0:e.index)??-1)}setQuality(e){this.setTargetQuality(e)}_getFullscreenTarget(){return this._container?this._container.closest("media-controller")??this._container.parentElement:null}async setFullscreen(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"});let t=this._getFullscreenTarget();t&&(e&&!document.fullscreenElement?await t.requestFullscreen():!e&&document.fullscreenElement&&await document.exitFullscreen())}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){this._destroyed||(this._destroyed=!0,this.unloadSource(),this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this._container=null,this._config=void 0,this._ready=!1,this.dispatch("destroy",void 0),this._listeners.clear())}};function cd(){return new dd}var kr="bpPlayerObservedProperties";function ud(i){return kr in i&&Array.isArray(i[kr])}function Iv(i,e){class t extends i{get[kr](){return e}}return t}function wv(i){if(i.shadowRoot)return Array.from(i.shadowRoot.children);if(i.localName==="slot"){let t=i.assignedNodes();if(t.length>0)return t.filter(r=>r.nodeType===Node.ELEMENT_NODE)}return Array.from(i.children)}async function Lr(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!ud(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),ud(i)&&t(i);let r=wv(i);r.length>0&&await Promise.all(r.map(o=>Lr(o,e,t)))}function Ls(i,e,t){let r=i[kr];r.includes("player")&&(i.player=e),r.includes("paused")&&(i.paused=t.paused),r.includes("playing")&&(i.playing=t.playing),r.includes("ended")&&(i.ended=t.ended),r.includes("seeking")&&(i.seeking=t.seeking),r.includes("currentTime")&&(i.currentTime=t.currentTime),r.includes("duration")&&(i.duration=t.duration),r.includes("volume")&&(i.volume=t.volume),r.includes("muted")&&(i.muted=t.muted),r.includes("playbackRate")&&(i.playbackRate=t.playbackRate),r.includes("readyState")&&(i.readyState=t.readyState),r.includes("videoWidth")&&(i.videoWidth=t.videoWidth),r.includes("videoHeight")&&(i.videoHeight=t.videoHeight),r.includes("qualities")&&(i.qualities=t.qualities),r.includes("currentQuality")&&(i.currentQuality=t.currentQuality),r.includes("targetQuality")&&(i.targetQuality=t.targetQuality),r.includes("fullscreen")&&(i.fullscreen=t.fullscreen),r.includes("presentationMode")&&(i.presentationMode=t.presentationMode),r.includes("connectionState")&&(i.connectionState=t.connectionState),r.includes("streamType")&&(i.streamType=t.streamType),r.includes("error")&&(i.error=t.error)}function Is(i){i[kr].includes("player")&&(i.player=void 0)}var ih=`/**
8
8
  * BP Player CSS Custom Properties
9
9
  *
10
10
  * All styling can be customized by overriding these CSS variables.
@@ -116,7 +116,7 @@ var Mu=Object.defineProperty;var nv=Object.getOwnPropertyDescriptor;var Ru=i=>{t
116
116
  /* Mobile */
117
117
  --bp-mobile-control-backdrop-background: rgba(0, 0, 0, 0.5);
118
118
  }
119
- `;var Ju=`/**
119
+ `;var rh=`/**
120
120
  * BP Player Global Styles
121
121
  *
122
122
  * Base styles and resets for the player components.
@@ -136,8 +136,8 @@ html.bp-player-full-window > body {
136
136
  margin: 0 !important;
137
137
  padding: 0 !important;
138
138
  }
139
- `;var ju=!1;function Jo(){if(ju)return;let i=document.createElement("style");i.id="bp-player-global-styles",i.textContent=Xu+`
140
- `+Ju,document.head.appendChild(i),ju=!0}function Lv(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function Cv(i,e){return`<style>${i}</style>${e}`}var La=(I=>(I.CONFIGURATION="configuration",I.SOURCE="source",I.SOURCES="sources",I.AUTOPLAY="autoplay",I.MUTED="muted",I.LOOP="loop",I.SCALING="scaling",I.ASPECT_RATIO="aspect-ratio",I.DEBUG="debug",I.AUTOHIDE="autohide",I.HOTKEYS="hotkeys",I.PAUSED="paused",I.PLAYING="playing",I.ENDED="ended",I.SEEKING="seeking",I.WAITING="waiting",I.LOADING="loading",I.READY="ready",I.HAS_ERROR="has-error",I.HAS_FIRST_PLAY="has-first-play",I.FULLSCREEN="fullscreen",I.FULLWINDOW="fullwindow",I.DEVICE_TYPE="device-type",I.MOBILE="mobile",I.TV="tv",I.STREAM_TYPE="stream-type",I.LIVE="live",I.CONTENT_TYPE="content-type",I.USER_IDLE="user-idle",I.USER_IDLE_TIMEOUT="user-idle-timeout",I.MOBILE_ONLY="mobile-only",I.MOBILE_HIDDEN="mobile-hidden",I.TV_ONLY="tv-only",I.TV_HIDDEN="tv-hidden",I.LIVE_ONLY="live-only",I.LIVE_HIDDEN="live-hidden",I.VOD_HIDDEN="vod-hidden",I.CLIP_HIDDEN="clip-hidden",I.NO_AUTO_HIDE="no-auto-hide",I.DISABLED="disabled",I.HIDDEN="hidden",I.NOTOOLTIP="notooltip",I.MENU="menu",I.MENU_OPENED="menu-opened",I.ARIA_LABEL="aria-label",I.ARIA_LIVE="aria-live",I.ARIA_CHECKED="aria-checked",I.VOLUME_LEVEL="volume-level",I.PROVIDER_TYPE="provider-type",I))(La||{});function be(i,e,t){return t!==void 0?t?(i.setAttribute(e,""),!0):(i.removeAttribute(e),!1):i.hasAttribute(e)?(i.removeAttribute(e),!1):(i.setAttribute(e,""),!0)}function Cr(){return{fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{return}},toAttribute:i=>i==null?null:JSON.stringify(i)}}var q=(i,e)=>new Event(i,{bubbles:!0,composed:!0,...e}),Oi=(i,e)=>new CustomEvent(i,{bubbles:!0,composed:!0,...e});function et(i,e){let t=e!==void 0?Object.assign(i,{code:e}):i;return new ErrorEvent("error",{error:t,message:i.message,bubbles:!0,composed:!0})}var jo="play";var Ni="pause";var Jt="playing";var Ir="waiting";var en="ended";var tn="timeupdate";var ld="durationchange";var dd="loadstart";var cd="loadedmetadata";var ud="loadeddata";var rn="canplay";var Ca="canplaythrough";var on="volumechange";var jt="resize";var nn="ready";var Ia="change";var hd="addrendition";var wa=class extends EventTarget{constructor(t){super();this._renditions=[];this._cleanup=[];this._host=t}get length(){return this._renditions.length}[Symbol.iterator](){return this._renditions[Symbol.iterator]()}get selectedIndex(){var r;let t=(r=this._host.player)==null?void 0:r.state.targetQuality;return t?this._renditions.findIndex(o=>o.id===String(t.index)):-1}set selectedIndex(t){var r,o,n;if(t<0)(r=this._host.player)==null||r.setQuality(null);else{let l=(((o=this._host.player)==null?void 0:o.state.qualities)??[])[t];l&&((n=this._host.player)==null||n.setQuality(l))}this._updateSelection(),this.dispatchEvent(q(Ia))}_updateSelection(){let t=this.selectedIndex;this._renditions.forEach((r,o)=>{r.selected=o===t})}_syncFromPlayer(){var o,n;let t=((o=this._host.player)==null?void 0:o.state.qualities)??[];if(t.length===0){let a=(n=this._host.player)==null?void 0:n.videoElement;a!=null&&a.videoRenditions&&(t=[...a.videoRenditions].map((l,d)=>({index:d,width:l.width??0,height:l.height??0,bitrate:l.bitrate??0})))}let r=this._renditions.length;for(let a=0;a<r;a++)delete this[a];this._renditions=t.map(a=>({id:String(a.index),width:a.width,height:a.height,bitrate:a.bitrate,selected:!1})),this._renditions.forEach((a,l)=>{this[l]=a}),this._updateSelection();for(let a of this._renditions)this.dispatchEvent(Oi(hd,{detail:a}))}_setupListeners(){this._cleanup.forEach(a=>a()),this._cleanup=[];let t=this._host.player;if(!t)return;let r=()=>{this._syncFromPlayer()},o=()=>{this._updateSelection(),this.dispatchEvent(q(Ia))};t.addEventListener("qualitieschange",r),t.addEventListener("qualitychange",o),t.addEventListener("targetqualitychanged",o),this._cleanup.push(()=>{t.removeEventListener("qualitieschange",r),t.removeEventListener("qualitychange",o),t.removeEventListener("targetqualitychanged",o)});let n=t.videoElement;n!=null&&n.videoRenditions&&(n.videoRenditions.addEventListener("addrendition",r),n.videoRenditions.addEventListener("removerendition",r),this._cleanup.push(()=>{var a,l;(a=n.videoRenditions)==null||a.removeEventListener("addrendition",r),(l=n.videoRenditions)==null||l.removeEventListener("removerendition",r)})),this._syncFromPlayer()}_destroy(){this._cleanup.forEach(r=>r()),this._cleanup=[];let t=this._renditions.length;this._renditions=[];for(let r=0;r<t;r++)delete this[r]}};var eh=`/**
139
+ `;var oh=!1;function en(){if(oh)return;let i=document.createElement("style");i.id="bp-player-global-styles",i.textContent=ih+`
140
+ `+rh,document.head.appendChild(i),oh=!0}function Mv(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function xv(i,e){return`<style>${i}</style>${e}`}var ws=(w=>(w.CONFIGURATION="configuration",w.SOURCE="source",w.SOURCES="sources",w.AUTOPLAY="autoplay",w.MUTED="muted",w.LOOP="loop",w.SCALING="scaling",w.ASPECT_RATIO="aspect-ratio",w.DEBUG="debug",w.AUTOHIDE="autohide",w.HOTKEYS="hotkeys",w.PAUSED="paused",w.PLAYING="playing",w.ENDED="ended",w.SEEKING="seeking",w.WAITING="waiting",w.LOADING="loading",w.READY="ready",w.HAS_ERROR="has-error",w.HAS_FIRST_PLAY="has-first-play",w.FULLSCREEN="fullscreen",w.FULLWINDOW="fullwindow",w.DEVICE_TYPE="device-type",w.MOBILE="mobile",w.TV="tv",w.STREAM_TYPE="stream-type",w.LIVE="live",w.CONTENT_TYPE="content-type",w.USER_IDLE="user-idle",w.USER_IDLE_TIMEOUT="user-idle-timeout",w.MOBILE_ONLY="mobile-only",w.MOBILE_HIDDEN="mobile-hidden",w.TV_ONLY="tv-only",w.TV_HIDDEN="tv-hidden",w.LIVE_ONLY="live-only",w.LIVE_HIDDEN="live-hidden",w.VOD_HIDDEN="vod-hidden",w.CLIP_HIDDEN="clip-hidden",w.NO_AUTO_HIDE="no-auto-hide",w.DISABLED="disabled",w.HIDDEN="hidden",w.NOTOOLTIP="notooltip",w.MENU="menu",w.MENU_OPENED="menu-opened",w.ARIA_LABEL="aria-label",w.ARIA_LIVE="aria-live",w.ARIA_CHECKED="aria-checked",w.VOLUME_LEVEL="volume-level",w.PROVIDER_TYPE="provider-type",w))(ws||{});function be(i,e,t){return t!==void 0?t?(i.setAttribute(e,""),!0):(i.removeAttribute(e),!1):i.hasAttribute(e)?(i.removeAttribute(e),!1):(i.setAttribute(e,""),!0)}function Ir(){return{fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{return}},toAttribute:i=>i==null?null:JSON.stringify(i)}}var G=(i,e)=>new Event(i,{bubbles:!0,composed:!0,...e}),Oi=(i,e)=>new CustomEvent(i,{bubbles:!0,composed:!0,...e});function et(i,e){let t=e!==void 0?Object.assign(i,{code:e}):i;return new ErrorEvent("error",{error:t,message:i.message,bubbles:!0,composed:!0})}var tn="play";var Ni="pause";var Jt="playing";var wr="waiting";var rn="ended";var on="timeupdate";var hd="durationchange";var pd="loadstart";var md="loadedmetadata";var vd="loadeddata";var nn="canplay";var Cs="canplaythrough";var sn="volumechange";var jt="resize";var an="ready";var Rs="change";var fd="addrendition";var Ms=class extends EventTarget{constructor(t){super();this._renditions=[];this._cleanup=[];this._host=t}get length(){return this._renditions.length}[Symbol.iterator](){return this._renditions[Symbol.iterator]()}get selectedIndex(){var r;let t=(r=this._host.player)==null?void 0:r.state.targetQuality;return t?this._renditions.findIndex(o=>o.id===String(t.index)):-1}set selectedIndex(t){var r,o,n;if(t<0)(r=this._host.player)==null||r.setQuality(null);else{let l=(((o=this._host.player)==null?void 0:o.state.qualities)??[])[t];l&&((n=this._host.player)==null||n.setQuality(l))}this._updateSelection(),this.dispatchEvent(G(Rs))}_updateSelection(){let t=this.selectedIndex;this._renditions.forEach((r,o)=>{r.selected=o===t})}_syncFromPlayer(){var o,n;let t=((o=this._host.player)==null?void 0:o.state.qualities)??[];if(t.length===0){let s=(n=this._host.player)==null?void 0:n.videoElement;s!=null&&s.videoRenditions&&(t=[...s.videoRenditions].map((l,d)=>({index:d,width:l.width??0,height:l.height??0,bitrate:l.bitrate??0})))}let r=this._renditions.length;for(let s=0;s<r;s++)delete this[s];this._renditions=t.map(s=>({id:String(s.index),width:s.width,height:s.height,bitrate:s.bitrate,selected:!1})),this._renditions.forEach((s,l)=>{this[l]=s}),this._updateSelection();for(let s of this._renditions)this.dispatchEvent(Oi(fd,{detail:s}))}_setupListeners(){this._cleanup.forEach(s=>s()),this._cleanup=[];let t=this._host.player;if(!t)return;let r=()=>{this._syncFromPlayer()},o=()=>{this._updateSelection(),this.dispatchEvent(G(Rs))};t.addEventListener("qualitieschange",r),t.addEventListener("qualitychange",o),t.addEventListener("targetqualitychanged",o),this._cleanup.push(()=>{t.removeEventListener("qualitieschange",r),t.removeEventListener("qualitychange",o),t.removeEventListener("targetqualitychanged",o)});let n=t.videoElement;n!=null&&n.videoRenditions&&(n.videoRenditions.addEventListener("addrendition",r),n.videoRenditions.addEventListener("removerendition",r),this._cleanup.push(()=>{var s,l;(s=n.videoRenditions)==null||s.removeEventListener("addrendition",r),(l=n.videoRenditions)==null||l.removeEventListener("removerendition",r)})),this._syncFromPlayer()}_destroy(){this._cleanup.forEach(r=>r()),this._cleanup=[];let t=this._renditions.length;this._renditions=[];for(let r=0;r<t;r++)delete this[r]}};var nh=`/**
141
141
  * BP Player Styles
142
142
  *
143
143
  * Core player component styles using CSS custom properties.
@@ -227,23 +227,23 @@ bp-player[waiting] {
227
227
  bp-player[has-error] {
228
228
  /* Styles when player has an error */
229
229
  }
230
- `;var th=!1;function wv(){if(th||(th=!0,document.getElementById("bp-player-styles")))return;Jo();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=eh,document.head.appendChild(i)}var Mv=["emptied","loadstart","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Re=class extends Me{constructor(){super(...arguments);this.autoplay=!1;this.defaultMuted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this._playerCore=null;this.containerRef=null;this.providerContainer=null;this.eventCleanup=[];this.stateReceivers=[];this._mutationObserver=null;this._videoRenditions=null;this._hasDispatchedReady=!1;this.handleMutation=t=>{for(let r of t)if(r.type==="childList"){for(let o of r.addedNodes)o.nodeType===Node.ELEMENT_NODE&&Lr(o,this.providerContainer,this.registerStateReceiver);for(let o of r.removedNodes)o.nodeType===Node.ELEMENT_NODE&&Lr(o,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&Sa(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),ka(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),wv(),this._mutationObserver=new MutationObserver(this.handleMutation),this._mutationObserver.observe(this,{childList:!0,subtree:!0})}get player(){return this._playerCore}get playerState(){var t;return((t=this._playerCore)==null?void 0:t.state)??null}get bpLive(){var t;return((t=this._playerCore)==null?void 0:t.bpLive)??null}async play(){var t;this.debug&&console.log("[BPPlayer] play() called"),await((t=this._playerCore)==null?void 0:t.play())}pause(){var t;this.debug&&console.log("[BPPlayer] pause() called"),(t=this._playerCore)==null||t.pause()}get paused(){var r;let t=((r=this._playerCore)==null?void 0:r.state.paused)??!0;return this.debug&&console.log("[BPPlayer] paused getter:",t),t}get ended(){var t;return((t=this._playerCore)==null?void 0:t.state.ended)??!1}get seeking(){var t;return((t=this._playerCore)==null?void 0:t.state.seeking)??!1}get waiting(){var t;return((t=this._playerCore)==null?void 0:t.state.waiting)??!1}get currentTime(){var t;return((t=this._playerCore)==null?void 0:t.state.currentTime)??0}set currentTime(t){var r;(r=this._playerCore)==null||r.seek(t)}get duration(){var t;return((t=this._playerCore)==null?void 0:t.state.duration)??NaN}get volume(){var t;return((t=this._playerCore)==null?void 0:t.state.volume)??1}set volume(t){var r;(r=this._playerCore)==null||r.setVolume(t)}get muted(){var t;return((t=this._playerCore)==null?void 0:t.state.muted)??this.defaultMuted}set muted(t){var r;(r=this._playerCore)==null||r.setMuted(t)}get playbackRate(){var t;return((t=this._playerCore)==null?void 0:t.state.playbackRate)??1}set playbackRate(t){var r;(r=this._playerCore)==null||r.setPlaybackRate(t)}get readyState(){var t;return((t=this._playerCore)==null?void 0:t.state.readyState)??0}get buffered(){var r;let t=(r=this._playerCore)==null?void 0:r.state.buffered;return t||{length:0,start:o=>{throw new DOMException(`Index ${o} is out of bounds`,"IndexSizeError")},end:o=>{throw new DOMException(`Index ${o} is out of bounds`,"IndexSizeError")}}}get videoWidth(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.width?r.width:((a=this._playerCore)==null?void 0:a.state.videoWidth)??0}get videoHeight(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.height?r.height:((a=this._playerCore)==null?void 0:a.state.videoHeight)??0}get videoElement(){var t;return((t=this._playerCore)==null?void 0:t.videoElement)??null}get providerType(){var t;return((t=this._playerCore)==null?void 0:t.state.providerType)??null}get videoRenditions(){return this._videoRenditions}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._mutationObserver)==null||t.disconnect(),this.destroyPlayer()}firstUpdated(t){super.firstUpdated(t),this.containerRef=this.renderRoot.querySelector(".bp-player-container"),this.containerRef&&!this.providerContainer&&(this.providerContainer=document.createElement("div"),this.providerContainer.className="bp-player-provider",this.providerContainer.style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.containerRef.appendChild(this.providerContainer)),this.initPlayerCore()}updated(t){super.updated(t),t.has("source")&&this.loadSource(),t.has("defaultMuted")&&this._playerCore&&this._playerCore.setMuted(this.defaultMuted),t.has("loop")&&this._playerCore&&this._playerCore.setLoop(this.loop)}initPlayerCore(){if(!(this._playerCore||!this.providerContainer))try{this._playerCore=ad(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this._playerCore.attach(this.providerContainer,this.config),this.setupEventForwarding(),this._videoRenditions=new wa(this)}catch(t){console.error("[BPPlayer] Failed to initialize player:",t),this.dispatchEvent(et(t instanceof Error?t:new Error(String(t))))}}async loadSource(){var r,o,n,a,l,d,m;let t=(o=(r=this.source)==null?void 0:r.sources)==null?void 0:o[0];if(!t){(n=this._playerCore)!=null&&n.ready&&this._playerCore.unloadSource();return}if(!this._playerCore||!this.providerContainer){this.debug&&console.log("[BPPlayer] loadSource skipped - player not initialized");return}this.debug&&console.log("[BPPlayer] loadSource:",t);try{let h=await this._playerCore.loadSource(t);if(!this._playerCore)return;if(h!=null&&h.videoWidth&&(h!=null&&h.videoHeight)&&(this.updateVideoDimensions(h.videoWidth,h.videoHeight),this.debug&&console.log("[BPPlayer] Source video dimensions:",{width:h.videoWidth,height:h.videoHeight})),(a=this._videoRenditions)==null||a._setupListeners(),this._hasDispatchedReady||(this._hasDispatchedReady=!0,Lr(this,this.providerContainer,this.registerStateReceiver),this.dispatchEvent(Oi(nn,{detail:this._playerCore})),this.debug&&console.log("[BPPlayer] Player ready",(l=this._playerCore)==null?void 0:l.state)),this.propagateStateToAllReceivers(),this.updateStateAttributes(),(m=(d=this._playerCore)==null?void 0:d.state)!=null&&m.paused&&this.dispatchEvent(q(Ni)),this.autoplay&&this._playerCore)try{await this._playerCore.play()}catch{}}catch(h){console.error("[BPPlayer] Failed to load source:",h),this.dispatchEvent(et(h instanceof Error?h:new Error(String(h))))}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)Sa(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;let t=this._playerCore;for(let a of Mv){let l=()=>{this.debug&&!["durationchange","timeupdate"].includes(a)&&console.log(`[BPPlayer] Forwarding event: ${a}`,t.state),this.dispatchEvent(q(a))};t.addEventListener(a,l),this.eventCleanup.push(()=>t.removeEventListener(a,l))}let r=()=>{let a=t.videoElement;a&&this.updateVideoDimensions(a.videoWidth,a.videoHeight)};t.addEventListener("resize",r),t.addEventListener("loadedmetadata",r),this.eventCleanup.push(()=>t.removeEventListener("resize",r)),this.eventCleanup.push(()=>t.removeEventListener("loadedmetadata",r)),r();let o=()=>{this.dispatchEvent(q(jt))};t.addEventListener("qualitychange",o),this.eventCleanup.push(()=>t.removeEventListener("qualitychange",o));let n=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};t.addEventListener("statechange",n),this.eventCleanup.push(()=>t.removeEventListener("statechange",n))}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;be(this,"paused",t.paused),be(this,"playing",t.playing),be(this,"ended",t.ended),be(this,"seeking",t.seeking),be(this,"waiting",t.waiting),be(this,"has-error",t.error!==null),be(this,"ready",this._playerCore.ready),this.setAttribute("stream-type",t.streamType),this.setAttribute("content-type",t.contentType),t.providerType&&this.setAttribute("provider-type",t.providerType)}destroyPlayer(){var t;this.eventCleanup.forEach(r=>r()),this.eventCleanup=[],(t=this._videoRenditions)==null||t._destroy(),this._videoRenditions=null;for(let r of this.stateReceivers)ka(r);if(this.stateReceivers=[],this._playerCore&&(this._playerCore.destroy(),this._playerCore=null),this.providerContainer)for(;this.providerContainer.firstChild;)this.providerContainer.removeChild(this.providerContainer.firstChild);this.clearVideoDimensions(),this._hasDispatchedReady=!1}updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r)),this.debug&&console.log("[BPPlayer] Set video dimensions:",{width:t,height:r})):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"),this.debug&&console.log("[BPPlayer] Cleared video dimensions"))}clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}getContainerClasses(){return["bp-player-container",`bp-player-container--${this.scaling}`].join(" ")}getContainerStyle(){return this.aspectRatio?`aspect-ratio: ${this.aspectRatio}`:""}render(){return Ge`
230
+ `;var sh=!1;function Dv(){if(sh||(sh=!0,document.getElementById("bp-player-styles")))return;en();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=nh,document.head.appendChild(i)}var Ov=["emptied","loadstart","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Me=class extends Re{constructor(){super(...arguments);this.autoplay=!1;this.defaultMuted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this._playerCore=null;this.containerRef=null;this.providerContainer=null;this.eventCleanup=[];this.stateReceivers=[];this._mutationObserver=null;this._videoRenditions=null;this._hasDispatchedReady=!1;this.handleMutation=t=>{for(let r of t)if(r.type==="childList"){for(let o of r.addedNodes)o.nodeType===Node.ELEMENT_NODE&&Lr(o,this.providerContainer,this.registerStateReceiver);for(let o of r.removedNodes)o.nodeType===Node.ELEMENT_NODE&&Lr(o,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&Ls(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),Is(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),Dv(),this._mutationObserver=new MutationObserver(this.handleMutation),this._mutationObserver.observe(this,{childList:!0,subtree:!0})}get player(){return this._playerCore}get playerState(){var t;return((t=this._playerCore)==null?void 0:t.state)??null}get bpLive(){var t;return((t=this._playerCore)==null?void 0:t.bpLive)??null}async play(){var t;this.debug&&console.log("[BPPlayer] play() called"),await((t=this._playerCore)==null?void 0:t.play())}pause(){var t;this.debug&&console.log("[BPPlayer] pause() called"),(t=this._playerCore)==null||t.pause()}get paused(){var r;let t=((r=this._playerCore)==null?void 0:r.state.paused)??!0;return this.debug&&console.log("[BPPlayer] paused getter:",t),t}get ended(){var t;return((t=this._playerCore)==null?void 0:t.state.ended)??!1}get seeking(){var t;return((t=this._playerCore)==null?void 0:t.state.seeking)??!1}get waiting(){var t;return((t=this._playerCore)==null?void 0:t.state.waiting)??!1}get currentTime(){var t;return((t=this._playerCore)==null?void 0:t.state.currentTime)??0}set currentTime(t){var r;(r=this._playerCore)==null||r.seek(t)}get duration(){var t;return((t=this._playerCore)==null?void 0:t.state.duration)??NaN}get volume(){var t;return((t=this._playerCore)==null?void 0:t.state.volume)??1}set volume(t){var r;(r=this._playerCore)==null||r.setVolume(t)}get muted(){var t;return((t=this._playerCore)==null?void 0:t.state.muted)??this.defaultMuted}set muted(t){var r;(r=this._playerCore)==null||r.setMuted(t)}get playbackRate(){var t;return((t=this._playerCore)==null?void 0:t.state.playbackRate)??1}set playbackRate(t){var r;(r=this._playerCore)==null||r.setPlaybackRate(t)}get readyState(){var t;return((t=this._playerCore)==null?void 0:t.state.readyState)??0}get buffered(){var r;let t=(r=this._playerCore)==null?void 0:r.state.buffered;return t||{length:0,start:o=>{throw new DOMException(`Index ${o} is out of bounds`,"IndexSizeError")},end:o=>{throw new DOMException(`Index ${o} is out of bounds`,"IndexSizeError")}}}get videoWidth(){var o,n,s;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.width?r.width:((s=this._playerCore)==null?void 0:s.state.videoWidth)??0}get videoHeight(){var o,n,s;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.height?r.height:((s=this._playerCore)==null?void 0:s.state.videoHeight)??0}get videoElement(){var t;return((t=this._playerCore)==null?void 0:t.videoElement)??null}get providerType(){var t;return((t=this._playerCore)==null?void 0:t.state.providerType)??null}get videoRenditions(){return this._videoRenditions}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._mutationObserver)==null||t.disconnect(),this.destroyPlayer()}firstUpdated(t){super.firstUpdated(t),this.containerRef=this.renderRoot.querySelector(".bp-player-container"),this.containerRef&&!this.providerContainer&&(this.providerContainer=document.createElement("div"),this.providerContainer.className="bp-player-provider",this.providerContainer.style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.containerRef.appendChild(this.providerContainer)),this.initPlayerCore()}updated(t){super.updated(t),t.has("source")&&this.loadSource(),t.has("defaultMuted")&&this._playerCore&&this._playerCore.setMuted(this.defaultMuted),t.has("loop")&&this._playerCore&&this._playerCore.setLoop(this.loop)}initPlayerCore(){if(!(this._playerCore||!this.providerContainer))try{this._playerCore=cd(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this._playerCore.attach(this.providerContainer,this.config),this.setupEventForwarding(),this._videoRenditions=new Ms(this)}catch(t){console.error("[BPPlayer] Failed to initialize player:",t),this.dispatchEvent(et(t instanceof Error?t:new Error(String(t))))}}async loadSource(){var r,o,n,s,l,d,m;let t=(o=(r=this.source)==null?void 0:r.sources)==null?void 0:o[0];if(!t){(n=this._playerCore)!=null&&n.ready&&this._playerCore.unloadSource();return}if(!this._playerCore||!this.providerContainer){this.debug&&console.log("[BPPlayer] loadSource skipped - player not initialized");return}this.debug&&console.log("[BPPlayer] loadSource:",t);try{let h=await this._playerCore.loadSource(t);if(!this._playerCore)return;if(h!=null&&h.videoWidth&&(h!=null&&h.videoHeight)&&(this.updateVideoDimensions(h.videoWidth,h.videoHeight),this.debug&&console.log("[BPPlayer] Source video dimensions:",{width:h.videoWidth,height:h.videoHeight})),(s=this._videoRenditions)==null||s._setupListeners(),this._hasDispatchedReady||(this._hasDispatchedReady=!0,Lr(this,this.providerContainer,this.registerStateReceiver),this.dispatchEvent(Oi(an,{detail:this._playerCore})),this.debug&&console.log("[BPPlayer] Player ready",(l=this._playerCore)==null?void 0:l.state)),this.propagateStateToAllReceivers(),this.updateStateAttributes(),(m=(d=this._playerCore)==null?void 0:d.state)!=null&&m.paused&&this.dispatchEvent(G(Ni)),this.autoplay&&this._playerCore)try{await this._playerCore.play()}catch{}}catch(h){console.error("[BPPlayer] Failed to load source:",h),this.dispatchEvent(et(h instanceof Error?h:new Error(String(h))))}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)Ls(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;let t=this._playerCore;for(let s of Ov){let l=()=>{this.debug&&!["durationchange","timeupdate"].includes(s)&&console.log(`[BPPlayer] Forwarding event: ${s}`,t.state),this.dispatchEvent(G(s))};t.addEventListener(s,l),this.eventCleanup.push(()=>t.removeEventListener(s,l))}let r=()=>{let s=t.videoElement;s&&this.updateVideoDimensions(s.videoWidth,s.videoHeight)};t.addEventListener("resize",r),t.addEventListener("loadedmetadata",r),this.eventCleanup.push(()=>t.removeEventListener("resize",r)),this.eventCleanup.push(()=>t.removeEventListener("loadedmetadata",r)),r();let o=()=>{this.dispatchEvent(G(jt))};t.addEventListener("qualitychange",o),this.eventCleanup.push(()=>t.removeEventListener("qualitychange",o));let n=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};t.addEventListener("statechange",n),this.eventCleanup.push(()=>t.removeEventListener("statechange",n))}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;be(this,"paused",t.paused),be(this,"playing",t.playing),be(this,"ended",t.ended),be(this,"seeking",t.seeking),be(this,"waiting",t.waiting),be(this,"has-error",t.error!==null),be(this,"ready",this._playerCore.ready),this.setAttribute("stream-type",t.streamType),this.setAttribute("content-type",t.contentType),t.providerType&&this.setAttribute("provider-type",t.providerType)}destroyPlayer(){var t;this.eventCleanup.forEach(r=>r()),this.eventCleanup=[],(t=this._videoRenditions)==null||t._destroy(),this._videoRenditions=null;for(let r of this.stateReceivers)Is(r);if(this.stateReceivers=[],this._playerCore&&(this._playerCore.destroy(),this._playerCore=null),this.providerContainer)for(;this.providerContainer.firstChild;)this.providerContainer.removeChild(this.providerContainer.firstChild);this.clearVideoDimensions(),this._hasDispatchedReady=!1}updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r)),this.debug&&console.log("[BPPlayer] Set video dimensions:",{width:t,height:r})):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"),this.debug&&console.log("[BPPlayer] Cleared video dimensions"))}clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}getContainerClasses(){return["bp-player-container",`bp-player-container--${this.scaling}`].join(" ")}getContainerStyle(){return this.aspectRatio?`aspect-ratio: ${this.aspectRatio}`:""}render(){return Ke`
231
231
  <div
232
232
  class="${this.getContainerClasses()}"
233
233
  style="${this.getContainerStyle()}"
234
234
  >
235
235
  </div>
236
- `}};U([W({converter:Cr()})],Re.prototype,"source",2),U([W({type:Boolean})],Re.prototype,"autoplay",2),U([W({type:Boolean,reflect:!0,attribute:"muted"})],Re.prototype,"defaultMuted",2),U([W({type:Boolean})],Re.prototype,"loop",2),U([W({type:String})],Re.prototype,"scaling",2),U([W({type:String,attribute:"aspect-ratio"})],Re.prototype,"aspectRatio",2),U([W({converter:Cr()})],Re.prototype,"config",2),U([W({type:Boolean})],Re.prototype,"debug",2),U([Xt()],Re.prototype,"_playerCore",2),Re=U([Zt("bp-player")],Re);var y={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},N={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},pd={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},ih=Object.entries(pd),s=ih.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),Rv={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Ui=ih.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...Rv}),Hy=Object.entries(Ui).reduce((i,[e,t])=>{let r=s[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),rh=Object.entries(s).reduce((i,[e,t])=>{let r=Ui[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),xe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},ei={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ma={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Pe={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},tt={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var oh={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function nh(i){return i==null?void 0:i.map(Pv).join(" ")}function ah(i){return i==null?void 0:i.split(/\s+/).map(Dv)}function Pv(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(o=>o!=null).join(":")}}function Dv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function sh(i){return i==null?void 0:i.map(Ov).join(" ")}function lh(i){return i==null?void 0:i.split(/\s+/).map(Nv)}function Ov(i){if(i){let{id:e,kind:t,language:r,label:o}=i;return[e,t,r,o].filter(n=>n!=null).join(":")}}function Nv(i){if(i){let[e,t,r,o]=i.split(":");return{id:e,kind:t,language:r,label:o}}}function wr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var Ra=i=>new Promise(e=>setTimeout(e,i));var dh=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Uv=(i,e)=>{let t=i===1?dh[e].singular:dh[e].plural;return`${i} ${t}`},Hi=i=>{if(!wr(i))return"";let e=Math.abs(i),t=e!==i,r=new Date(0,0,0,0,0,e,0);return`${[r.getHours(),r.getMinutes(),r.getSeconds()].map((l,d)=>l&&Uv(l,d)).filter(l=>l).join(", ")}${t?" remaining":""}`};function it(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),o=Math.floor(i/60%60),n=Math.floor(i/3600),a=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=o=r="0"),n=n>0||l>0?n+":":"",o=((n||a>=10)&&o<10?"0"+o:o)+":",r=r<10?"0"+r:r,(t?"-":"")+n+o+r}var Vy=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var ch={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var uh,md={en:ch},vd=((uh=globalThis.navigator)==null?void 0:uh.language)||"en",hh=i=>{vd=i};var $v=i=>{var e,t,r;let[o]=vd.split("-");return((e=md[vd])==null?void 0:e[i])||((t=md[o])==null?void 0:t[i])||((r=md.en)==null?void 0:r[i])||i},_=(i,e={})=>$v(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var xa=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Pa=class extends xa{},Da=class extends Pa{constructor(){super(...arguments),this.role=null}},fd=class{observe(){}unobserve(){}disconnect(){}},ph={createElement:function(){return new an.HTMLElement},createElementNS:function(){return new an.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},an={ResizeObserver:fd,document:ph,Node:Pa,Element:Da,HTMLElement:class extends Da{constructor(){super(...arguments),this.innerHTML=""}get content(){return new an.DocumentFragment}},DocumentFragment:class extends xa{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}},DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},mh="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",vh=Object.keys(an).every(i=>i in globalThis),c=mh&&!vh?an:globalThis,ee=mh&&!vh?ph:globalThis.document;var fh=new WeakMap,Ed=i=>{let e=fh.get(i);return e||fh.set(i,e=new Set),e},Eh=new c.ResizeObserver(i=>{for(let e of i)for(let t of Ed(e.target))t(e)});function Nt(i,e){Ed(i).add(e),Eh.observe(i)}function Ut(i,e){let t=Ed(i);t.delete(e),t.size||Eh.unobserve(i)}function j(i){let e={};for(let t of i)e[t.name]=t.value;return e}function X(i){var e;return(e=Oa(i))!=null?e:ut(i,"media-controller")}function Oa(i){var e;let{MEDIA_CONTROLLER:t}=N,r=i.getAttribute(t);if(r)return(e=$i(i))==null?void 0:e.getElementById(r)}var Na=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},Bv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},Ua=(i,e)=>Bv(i,e)[0],Ce=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Ce(i,e.getRootNode().host),ut=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||ut(i.getRootNode().host,e)};function sn(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=sn(t.shadowRoot))!=null?e:t:null}function $i(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function Ha(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let o=i;for(;o&&e>0;){let n=getComputedStyle(o);if(t&&n.opacity==="0"||r&&n.visibility==="hidden"||n.display==="none")return!1;o=o.parentElement,e--}return!0}function gh(i,e,t,r){let o=r.x-t.x,n=r.y-t.y,a=o*o+n*n;if(a===0)return 0;let l=((i-t.x)*o+(e-t.y)*n)/a;return Math.max(0,Math.min(1,l))}function J(i,e){let t=Vv(i,r=>r===e);return t||ln(i,e)}function Vv(i,e){var t,r;let o;for(o of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(r=o.sheet)==null?void 0:r.cssRules}catch{continue}for(let a of n??[])if(e(a.selectorText))return a}}function ln(i,e){var t,r;let o=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=o==null?void 0:o[o.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(r=n.sheet.cssRules)==null?void 0:r[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function H(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function B(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}H(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function w(i,e){return i.hasAttribute(e)}function M(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}w(i,e)!=t&&i.toggleAttribute(e,t)}function D(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function O(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;D(i,e,void 0)!==r&&i.setAttribute(e,r)}var bh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ti=(i,e,t)=>(bh(i,e,"read from private field"),t?t.call(i):e.get(i)),Wv=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},$a=(i,e,t,r)=>(bh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),De;function Fv(i){return`
236
+ `}};U([W({converter:Ir()})],Me.prototype,"source",2),U([W({type:Boolean})],Me.prototype,"autoplay",2),U([W({type:Boolean,reflect:!0,attribute:"muted"})],Me.prototype,"defaultMuted",2),U([W({type:Boolean})],Me.prototype,"loop",2),U([W({type:String})],Me.prototype,"scaling",2),U([W({type:String,attribute:"aspect-ratio"})],Me.prototype,"aspectRatio",2),U([W({converter:Ir()})],Me.prototype,"config",2),U([W({type:Boolean})],Me.prototype,"debug",2),U([Xt()],Me.prototype,"_playerCore",2),Me=U([Zt("bp-player")],Me);var y={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},N={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Ed={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},ah=Object.entries(Ed),a=ah.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),Nv={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Ui=ah.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...Nv}),zy=Object.entries(Ui).reduce((i,[e,t])=>{let r=a[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),lh=Object.entries(a).reduce((i,[e,t])=>{let r=Ui[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),xe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},ei={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var xs={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Pe={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},tt={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var dh={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function ch(i){return i==null?void 0:i.map(Hv).join(" ")}function uh(i){return i==null?void 0:i.split(/\s+/).map($v)}function Hv(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(o=>o!=null).join(":")}}function $v(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function hh(i){return i==null?void 0:i.map(Bv).join(" ")}function ph(i){return i==null?void 0:i.split(/\s+/).map(Vv)}function Bv(i){if(i){let{id:e,kind:t,language:r,label:o}=i;return[e,t,r,o].filter(n=>n!=null).join(":")}}function Vv(i){if(i){let[e,t,r,o]=i.split(":");return{id:e,kind:t,language:r,label:o}}}function Cr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var Ps=i=>new Promise(e=>setTimeout(e,i));var mh=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Wv=(i,e)=>{let t=i===1?mh[e].singular:mh[e].plural;return`${i} ${t}`},Hi=i=>{if(!Cr(i))return"";let e=Math.abs(i),t=e!==i,r=new Date(0,0,0,0,0,e,0);return`${[r.getHours(),r.getMinutes(),r.getSeconds()].map((l,d)=>l&&Wv(l,d)).filter(l=>l).join(", ")}${t?" remaining":""}`};function it(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),o=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=o=r="0"),n=n>0||l>0?n+":":"",o=((n||s>=10)&&o<10?"0"+o:o)+":",r=r<10?"0"+r:r,(t?"-":"")+n+o+r}var Zy=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var vh={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var fh,gd={en:vh},bd=((fh=globalThis.navigator)==null?void 0:fh.language)||"en",Eh=i=>{bd=i};var qv=i=>{var e,t,r;let[o]=bd.split("-");return((e=gd[bd])==null?void 0:e[i])||((t=gd[o])==null?void 0:t[i])||((r=gd.en)==null?void 0:r[i])||i},_=(i,e={})=>qv(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var Ds=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Os=class extends Ds{},Ns=class extends Os{constructor(){super(...arguments),this.role=null}},_d=class{observe(){}unobserve(){}disconnect(){}},gh={createElement:function(){return new ln.HTMLElement},createElementNS:function(){return new ln.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},ln={ResizeObserver:_d,document:gh,Node:Os,Element:Ns,HTMLElement:class extends Ns{constructor(){super(...arguments),this.innerHTML=""}get content(){return new ln.DocumentFragment}},DocumentFragment:class extends Ds{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}},DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},bh="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",_h=Object.keys(ln).every(i=>i in globalThis),c=bh&&!_h?ln:globalThis,ee=bh&&!_h?gh:globalThis.document;var yh=new WeakMap,yd=i=>{let e=yh.get(i);return e||yh.set(i,e=new Set),e},Th=new c.ResizeObserver(i=>{for(let e of i)for(let t of yd(e.target))t(e)});function Nt(i,e){yd(i).add(e),Th.observe(i)}function Ut(i,e){let t=yd(i);t.delete(e),t.size||Th.unobserve(i)}function j(i){let e={};for(let t of i)e[t.name]=t.value;return e}function X(i){var e;return(e=Us(i))!=null?e:ut(i,"media-controller")}function Us(i){var e;let{MEDIA_CONTROLLER:t}=N,r=i.getAttribute(t);if(r)return(e=$i(i))==null?void 0:e.getElementById(r)}var Hs=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},Kv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},$s=(i,e)=>Kv(i,e)[0],Ie=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Ie(i,e.getRootNode().host),ut=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||ut(i.getRootNode().host,e)};function dn(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=dn(t.shadowRoot))!=null?e:t:null}function $i(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function Bs(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let o=i;for(;o&&e>0;){let n=getComputedStyle(o);if(t&&n.opacity==="0"||r&&n.visibility==="hidden"||n.display==="none")return!1;o=o.parentElement,e--}return!0}function Ah(i,e,t,r){let o=r.x-t.x,n=r.y-t.y,s=o*o+n*n;if(s===0)return 0;let l=((i-t.x)*o+(e-t.y)*n)/s;return Math.max(0,Math.min(1,l))}function J(i,e){let t=Gv(i,r=>r===e);return t||cn(i,e)}function Gv(i,e){var t,r;let o;for(o of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(r=o.sheet)==null?void 0:r.cssRules}catch{continue}for(let s of n??[])if(e(s.selectorText))return s}}function cn(i,e){var t,r;let o=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=o==null?void 0:o[o.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(r=n.sheet.cssRules)==null?void 0:r[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function H(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function B(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}H(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function C(i,e){return i.hasAttribute(e)}function R(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}C(i,e)!=t&&i.toggleAttribute(e,t)}function D(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function O(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;D(i,e,void 0)!==r&&i.setAttribute(e,r)}var Sh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ti=(i,e,t)=>(Sh(i,e,"read from private field"),t?t.call(i):e.get(i)),zv=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Vs=(i,e,t,r)=>(Sh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),De;function Yv(i){return`
237
237
  <style>
238
238
  :host {
239
239
  display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
240
240
  box-sizing: border-box;
241
241
  }
242
242
  </style>
243
- `}var Mr=class extends c.HTMLElement{constructor(){if(super(),Wv(this,De,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=ti(this,De))==null?void 0:o.unassociateElement)==null||n.call(o,this),$a(this,De,null)),r&&this.isConnected&&($a(this,De,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=ti(this,De))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r,o;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),$a(this,De,Kv(this)),this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=ti(this,De))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=ti(this,De))==null||r.addEventListener("pointerdown",this),(o=ti(this,De))==null||o.addEventListener("click",this)}disconnectedCallback(){var e,t,r,o;this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=ti(this,De))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=ti(this,De))==null||r.removeEventListener("pointerdown",this),(o=ti(this,De))==null||o.removeEventListener("click",this),$a(this,De,null)}handleEvent(e){var t;let r=(t=e.composedPath())==null?void 0:t[0];if(["video","media-controller"].includes(r==null?void 0:r.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:a}=e,{left:l,top:d,width:m,height:h}=this.getBoundingClientRect(),g=n-l,E=a-d;if(g<0||E<0||g>m||E>h||m===0&&h===0)return;let p=this._pointerType||"mouse";if(this._pointerType=void 0,p===Ma.TOUCH){this.handleTap(e);return}else if(p===Ma.MOUSE||p===Ma.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){M(this,s.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(t,{composed:!0,bubbles:!0}))}};De=new WeakMap;Mr.shadowRootOptions={mode:"open"};Mr.getTemplateHTML=Fv;function Kv(i){var e;let t=i.getAttribute(N.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):ut(i,"media-controller")}c.customElements.get("media-gesture-receiver")||c.customElements.define("media-gesture-receiver",Mr);var Ba=Mr;var yd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Be=(i,e,t)=>(yd(i,e,"read from private field"),t?t.call(i):e.get(i)),$e=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Bi=(i,e,t,r)=>(yd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),qe=(i,e,t)=>(yd(i,e,"access private method"),t),Fa,Rr,cn,xr,Va,gd,_h,dn,Wa,bd,yh,_d,Th,un,Ka,Ga,Td,Pr,hn,x={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Gv(i){return`
243
+ `}var Rr=class extends c.HTMLElement{constructor(){if(super(),zv(this,De,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,a.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var o,n,s,l,d;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=ti(this,De))==null?void 0:o.unassociateElement)==null||n.call(o,this),Vs(this,De,null)),r&&this.isConnected&&(Vs(this,De,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=ti(this,De))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r,o;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Vs(this,De,Qv(this)),this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=ti(this,De))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=ti(this,De))==null||r.addEventListener("pointerdown",this),(o=ti(this,De))==null||o.addEventListener("click",this)}disconnectedCallback(){var e,t,r,o;this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=ti(this,De))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=ti(this,De))==null||r.removeEventListener("pointerdown",this),(o=ti(this,De))==null||o.removeEventListener("click",this),Vs(this,De,null)}handleEvent(e){var t;let r=(t=e.composedPath())==null?void 0:t[0];if(["video","media-controller"].includes(r==null?void 0:r.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:s}=e,{left:l,top:d,width:m,height:h}=this.getBoundingClientRect(),g=n-l,E=s-d;if(g<0||E<0||g>m||E>h||m===0&&h===0)return;let p=this._pointerType||"mouse";if(this._pointerType=void 0,p===xs.TOUCH){this.handleTap(e);return}else if(p===xs.MOUSE||p===xs.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return C(this,a.MEDIA_PAUSED)}set mediaPaused(e){R(this,a.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(t,{composed:!0,bubbles:!0}))}};De=new WeakMap;Rr.shadowRootOptions={mode:"open"};Rr.getTemplateHTML=Yv;function Qv(i){var e;let t=i.getAttribute(N.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):ut(i,"media-controller")}c.customElements.get("media-gesture-receiver")||c.customElements.define("media-gesture-receiver",Rr);var Ws=Rr;var kd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Be=(i,e,t)=>(kd(i,e,"read from private field"),t?t.call(i):e.get(i)),$e=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Bi=(i,e,t,r)=>(kd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ge=(i,e,t)=>(kd(i,e,"access private method"),t),Ks,Mr,hn,xr,Fs,Td,kh,un,qs,Ad,Lh,Sd,Ih,pn,Gs,zs,Ld,Pr,mn,x={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Zv(i){return`
244
244
  <style>
245
245
 
246
- :host([${s.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
246
+ :host([${a.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
247
247
  outline: none;
248
248
  }
249
249
 
@@ -339,16 +339,16 @@ bp-player[has-error] {
339
339
  }
340
340
 
341
341
 
342
- :host([${x.USER_INACTIVE}]:not([${s.MEDIA_PAUSED}]):not([${s.MEDIA_IS_AIRPLAYING}]):not([${s.MEDIA_IS_CASTING}]):not([${x.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${x.NO_AUTOHIDE}]):not([role=dialog])) {
342
+ :host([${x.USER_INACTIVE}]:not([${a.MEDIA_PAUSED}]):not([${a.MEDIA_IS_AIRPLAYING}]):not([${a.MEDIA_IS_CASTING}]):not([${x.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${x.NO_AUTOHIDE}]):not([role=dialog])) {
343
343
  opacity: 0;
344
344
  transition: var(--media-control-transition-out, opacity 1s);
345
345
  }
346
346
 
347
- :host([${x.USER_INACTIVE}]:not([${x.NO_AUTOHIDE}]):not([${s.MEDIA_PAUSED}]):not([${s.MEDIA_IS_CASTING}]):not([${x.AUDIO}])) ::slotted([slot=media]) {
347
+ :host([${x.USER_INACTIVE}]:not([${x.NO_AUTOHIDE}]):not([${a.MEDIA_PAUSED}]):not([${a.MEDIA_IS_CASTING}]):not([${x.AUDIO}])) ::slotted([slot=media]) {
348
348
  cursor: none;
349
349
  }
350
350
 
351
- :host([${x.USER_INACTIVE}][${x.AUTOHIDE_OVER_CONTROLS}]:not([${x.NO_AUTOHIDE}]):not([${s.MEDIA_PAUSED}]):not([${s.MEDIA_IS_CASTING}]):not([${x.AUDIO}])) * {
351
+ :host([${x.USER_INACTIVE}][${x.AUTOHIDE_OVER_CONTROLS}]:not([${x.NO_AUTOHIDE}]):not([${a.MEDIA_PAUSED}]):not([${a.MEDIA_IS_CASTING}]):not([${x.AUDIO}])) * {
352
352
  --media-cursor: none;
353
353
  cursor: none;
354
354
  }
@@ -359,7 +359,7 @@ bp-player[has-error] {
359
359
  }
360
360
 
361
361
 
362
- :host(:not([${x.AUDIO}])[${s.MEDIA_HAS_PLAYED}]) slot[name=poster] {
362
+ :host(:not([${x.AUDIO}])[${a.MEDIA_HAS_PLAYED}]) slot[name=poster] {
363
363
  display: none;
364
364
  }
365
365
 
@@ -378,8 +378,8 @@ bp-player[has-error] {
378
378
  <slot name="poster" part="layer poster-layer"></slot>
379
379
  <slot name="gestures-chrome" part="layer gesture-layer">
380
380
  <media-gesture-receiver slot="gestures-chrome">
381
- <template shadowrootmode="${Ba.shadowRootOptions.mode}">
382
- ${Ba.getTemplateHTML({})}
381
+ <template shadowrootmode="${Ws.shadowRootOptions.mode}">
382
+ ${Ws.getTemplateHTML({})}
383
383
  </template>
384
384
  </media-gesture-receiver>
385
385
  </slot>
@@ -391,7 +391,7 @@ bp-player[has-error] {
391
391
  <slot part="bottom chrome"></slot>
392
392
  </span>
393
393
  <slot name="dialog" part="layer dialog-layer"></slot>
394
- `}var qv=Object.values(s),zv="sm:384 md:576 lg:768 xl:960";function Yv(i){Ah(i.target,i.contentRect.width)}function Ah(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(x.BREAKPOINTS))!=null?t:zv,o=Qv(r),n=Zv(o,e),a=!1;if(Object.keys(o).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),a=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),a=!0)}),a){let l=new CustomEvent(Ui.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Ui.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Qv(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Zv(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var Vi=class extends c.HTMLElement{constructor(){if(super(),$e(this,gd),$e(this,bd),$e(this,_d),$e(this,un),$e(this,Ga),$e(this,Pr),$e(this,Fa,0),$e(this,Rr,null),$e(this,cn,null),$e(this,xr,void 0),this.breakpointsComputed=!1,$e(this,Va,new MutationObserver(qe(this,gd,_h).bind(this))),$e(this,dn,!1),$e(this,Wa,t=>{Be(this,dn)||(setTimeout(()=>{Yv(t),Bi(this,dn,!1)},0),Bi(this,dn,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=j(this.attributes),r=this.constructor.getTemplateHTML(t);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(r):this.shadowRoot.innerHTML=r}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){Be(this,Rr)&&this.mediaUnsetCallback(Be(this,Rr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[x.AUTOHIDE,x.GESTURES_DISABLED].concat(qv).filter(e=>![s.MEDIA_RENDITION_LIST,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_CHAPTERS_CUES,s.MEDIA_WIDTH,s.MEDIA_HEIGHT,s.MEDIA_ERROR,s.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==x.AUTOHIDE&&(this.autohide=r)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Bi(this,Rr,e),e.localName.includes("-")&&await c.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Be(this,Va).observe(this,{childList:!0,subtree:!0}),Nt(this,Be(this,Wa));let r=this.getAttribute(x.AUDIO)!=null?_("audio player"):_("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(x.USER_INACTIVE,""),Ah(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=c.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Be(this,Va).disconnect(),Ut(this,Be(this,Wa)),this.media&&this.mediaUnsetCallback(this.media),(e=c.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Bi(this,Rr,null)}handleEvent(e){switch(e.type){case"pointerdown":Bi(this,Fa,e.timeStamp);break;case"pointermove":qe(this,bd,yh).call(this,e);break;case"pointerup":qe(this,_d,Th).call(this,e);break;case"mouseleave":qe(this,un,Ka).call(this);break;case"mouseup":this.removeAttribute(x.KEYBOARD_CONTROL);break;case"keyup":qe(this,Pr,hn).call(this),this.setAttribute(x.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Bi(this,xr,isNaN(t)?0:t)}get autohide(){return(Be(this,xr)===void 0?2:Be(this,xr)).toString()}get breakpoints(){return D(this,x.BREAKPOINTS)}set breakpoints(e){O(this,x.BREAKPOINTS,e)}get audio(){return w(this,x.AUDIO)}set audio(e){M(this,x.AUDIO,e)}get gesturesDisabled(){return w(this,x.GESTURES_DISABLED)}set gesturesDisabled(e){M(this,x.GESTURES_DISABLED,e)}get keyboardControl(){return w(this,x.KEYBOARD_CONTROL)}set keyboardControl(e){M(this,x.KEYBOARD_CONTROL,e)}get noAutohide(){return w(this,x.NO_AUTOHIDE)}set noAutohide(e){M(this,x.NO_AUTOHIDE,e)}get autohideOverControls(){return w(this,x.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){M(this,x.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return w(this,x.USER_INACTIVE)}set userInteractive(e){M(this,x.USER_INACTIVE,e)}};Fa=new WeakMap;Rr=new WeakMap;cn=new WeakMap;xr=new WeakMap;Va=new WeakMap;gd=new WeakSet;_h=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let o of r){if(o.slot!="media"||t.target!=this)continue;let n=t.previousSibling&&t.previousSibling.previousElementSibling;if(!n||!e)this.mediaUnsetCallback(o);else{let a=n.slot!=="media";for(;(n=n.previousSibling)!==null;)n.slot=="media"&&(a=!1);a&&this.mediaUnsetCallback(o)}}if(e)for(let o of t.addedNodes)o===e&&this.handleMediaUpdated(e)}};dn=new WeakMap;Wa=new WeakMap;bd=new WeakSet;yh=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-Be(this,Fa)<250)return;qe(this,Ga,Td).call(this),clearTimeout(Be(this,cn));let e=this.hasAttribute(x.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&qe(this,Pr,hn).call(this)};_d=new WeakSet;Th=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(x.USER_INACTIVE);[this,this.media].includes(i.target)&&e?qe(this,un,Ka).call(this):qe(this,Pr,hn).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&qe(this,Pr,hn).call(this)};un=new WeakSet;Ka=function(){if(Be(this,xr)<0||this.hasAttribute(x.USER_INACTIVE))return;this.setAttribute(x.USER_INACTIVE,"");let i=new c.CustomEvent(Ui.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};Ga=new WeakSet;Td=function(){if(!this.hasAttribute(x.USER_INACTIVE))return;this.removeAttribute(x.USER_INACTIVE);let i=new c.CustomEvent(Ui.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Pr=new WeakSet;hn=function(){qe(this,Ga,Td).call(this),clearTimeout(Be(this,cn));let i=parseInt(this.autohide);i<0||Bi(this,cn,setTimeout(()=>{qe(this,un,Ka).call(this)},i*1e3))};Vi.shadowRootOptions={mode:"open"};Vi.getTemplateHTML=Gv;c.customElements.get("media-container")||c.customElements.define("media-container",Vi);var Sh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_e=(i,e,t)=>(Sh(i,e,"read from private field"),t?t.call(i):e.get(i)),pn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},qa=(i,e,t,r)=>(Sh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Dr,Or,za,Wi,Ht,ii,ri=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){pn(this,Ht),pn(this,Dr,void 0),pn(this,Or,void 0),pn(this,za,void 0),pn(this,Wi,new Set),qa(this,Dr,e),qa(this,Or,t),qa(this,za,new Set(r))}[Symbol.iterator](){return _e(this,Ht,ii).values()}get length(){return _e(this,Ht,ii).size}get value(){var e;return(e=[..._e(this,Ht,ii)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(qa(this,Wi,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[..._e(this,Ht,ii)][e]}values(){return _e(this,Ht,ii).values()}forEach(e,t){_e(this,Ht,ii).forEach(e,t)}add(...e){var t,r;e.forEach(o=>_e(this,Wi).add(o)),!(this.value===""&&!((t=_e(this,Dr))!=null&&t.hasAttribute(`${_e(this,Or)}`)))&&((r=_e(this,Dr))==null||r.setAttribute(`${_e(this,Or)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>_e(this,Wi).delete(r)),(t=_e(this,Dr))==null||t.setAttribute(`${_e(this,Or)}`,`${this.value}`)}contains(e){return _e(this,Ht,ii).has(e)}toggle(e,t){return typeof t<"u"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};Dr=new WeakMap;Or=new WeakMap;za=new WeakMap;Wi=new WeakMap;Ht=new WeakSet;ii=function(){return _e(this,Wi).size?_e(this,Wi):_e(this,za)};var Xv=(i="")=>i.split(/\s+/),kh=(i="")=>{let[e,t,r]=i.split(":"),o=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?xe.CAPTIONS:xe.SUBTITLES,language:t,label:o}},Fi=(i="",e={})=>Xv(i).map(t=>{let r=kh(t);return{...e,...r}}),Ad=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?kh(e):e):typeof i=="string"?Fi(i):[i]:[],Ya=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,$t=(i=[])=>Array.prototype.map.call(i,Ya).join(" "),Jv=(i,e)=>t=>t[i]===e,Lh=i=>{let e=Object.entries(i).map(([t,r])=>Jv(t,r));return t=>e.every(r=>r(t))},Ki=(i,e=[],t=[])=>{let r=Ad(t).map(Lh),o=n=>r.some(a=>a(n));Array.from(e).filter(o).forEach(n=>{n.mode=i})},Gi=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Lh(e);return Array.from(i.textTracks).filter(t)},Qa=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)};var Ih=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let o=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(o){let n=(e=r[o])==null?void 0:e.call(r);if(n instanceof Promise)return n.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(o){console.error(o)}},Ch="exitFullscreen"in ee?"exitFullscreen":"webkitExitFullscreen"in ee?"webkitExitFullscreen":"webkitCancelFullScreen"in ee?"webkitCancelFullScreen":void 0,wh=i=>{var e;let{documentElement:t}=i;if(Ch){let r=(e=t==null?void 0:t[Ch])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},mn="fullscreenElement"in ee?"fullscreenElement":"webkitFullscreenElement"in ee?"webkitFullscreenElement":void 0,jv=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[mn];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===oh.FULLSCREEN?t:r},Mh=i=>{var e;let{media:t,documentElement:r,fullscreenElement:o=t}=i;if(!t||!r)return!1;let n=jv(i);if(!n)return!1;if(n===o||n===t)return!0;if(n.localName.includes("-")){let a=n.shadowRoot;if(!(mn in a))return Ce(n,o);for(;a!=null&&a[mn];){if(a[mn]===o)return!0;a=(e=a[mn])==null?void 0:e.shadowRoot}}return!1},ef="fullscreenEnabled"in ee?"fullscreenEnabled":"webkitFullscreenEnabled"in ee?"webkitFullscreenEnabled":void 0,Rh=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[ef])||t&&"webkitSupportsFullscreen"in t};var Za,Sd=()=>{var i,e;return Za||(Za=(e=(i=ee)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Za)},xh=async(i=Sd())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([tf(i,t.signal),rf(i,e)]);return t.abort(),r},tf=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),rf=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await Ra(10)}return i.volume!==e},of=/.*Version\/.*Safari\/.*/.test(c.navigator.userAgent),kd=(i=Sd())=>c.matchMedia("(display-mode: standalone)").matches&&of?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Ld=(i=Sd())=>Rh({documentElement:ee,media:i}),Ph=Ld(),Dh=kd(),Oh=!!c.WebKitPlaybackTargetAvailabilityEvent,Nh=!!c.chrome;var Nr=i=>Gi(i.media,e=>[xe.SUBTITLES,xe.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Cd=i=>Gi(i.media,e=>e.mode===ei.SHOWING&&[xe.SUBTITLES,xe.CAPTIONS].includes(e.kind)),Xa=(i,e)=>{let t=Nr(i),r=Cd(i),o=!!r.length;if(t.length){if(e===!1||o&&e!==!0)Ki(ei.DISABLED,t,r);else if(e===!0||!o&&e!==!1){let n=t[0],{options:a}=i;if(!(a!=null&&a.noSubtitlesLangPref)){let h=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=h?[h,...globalThis.navigator.languages]:globalThis.navigator.languages,E=t.filter(p=>g.some(T=>p.language.toLowerCase().startsWith(T.split("-")[0]))).sort((p,T)=>{let f=g.findIndex(S=>p.language.toLowerCase().startsWith(S.split("-")[0])),b=g.findIndex(S=>T.language.toLowerCase().startsWith(S.split("-")[0]));return f-b});E[0]&&(n=E[0])}let{language:l,label:d,kind:m}=n;Ki(ei.DISABLED,t,r),Ki(ei.SHOWING,t,[{language:l,label:d,kind:m}])}}},Ja=(i,e)=>i===e?!0:i==null||e==null||typeof i!=typeof e?!1:typeof i=="number"&&Number.isNaN(i)&&Number.isNaN(e)?!0:typeof i!="object"?!1:Array.isArray(i)?nf(i,e):Object.entries(i).every(([t,r])=>t in e&&Ja(r,e[t])),nf=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((o,n)=>Ja(o,e[n])):!0};var af=Object.values(tt),ja,sf=xh().then(i=>(ja=i,ja)),Uh=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof c.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=c.customElements.get(t);r&&e instanceof r||(await c.customElements.whenDefined(t),c.customElements.upgrade(e))}))},lf=new c.DOMParser,df=i=>i&&(lf.parseFromString(i,"text/html").body.textContent||i),Ur={mediaError:{get(i,e){let{media:t}=i;if((e==null?void 0:e.type)!=="playing")return t==null?void 0:t.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(i,e){var t;let{media:r}=i;if((e==null?void 0:e.type)!=="playing")return(t=r==null?void 0:r.error)==null?void 0:t.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(i,e){var t,r;let{media:o}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=o==null?void 0:o.error)==null?void 0:t.message)!=null?r:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:r}=e;r&&(i?r.pause():(t=r.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t,options:{noMutedPref:r}={}}=e;if(t){t.muted=i;try{let o=c.localStorage.getItem("media-chrome-pref-muted")!==null,n=t.hasAttribute("muted");if(r){o&&c.localStorage.removeItem("media-chrome-pref-muted");return}if(n&&!o)return;c.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(o){console.debug("Error setting muted pref",o)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let o=c.localStorage.getItem("media-chrome-pref-muted")==="true";Ur.mediaMuted.set(o,e),i(o)}catch(o){console.debug("Error getting muted pref",o)}}]},mediaLoop:{get(i){let{media:e}=i;return e==null?void 0:e.loop},set(i,e){let{media:t}=e;t&&(t.loop=i)},mediaEvents:["medialooprequest"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t,options:{noVolumePref:r}={}}=e;if(t){try{i==null?c.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&c.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(o){console.debug("Error setting volume pref",o)}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let{media:r}=e;if(!r)return;let o=c.localStorage.getItem("media-chrome-pref-volume");if(o==null)return;Ur.mediaVolume.set(+o,e),i(+o)}catch(r){console.debug("Error getting volume pref",r)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)>"u"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||!wr(i)||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let r=t.seekable.start(0),o=t.seekable.end(t.seekable.length-1);if(!(!r&&!o))return[Number(r.toFixed(3)),Number(o.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,r=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(r).map((o,n)=>[Number(r.start(n).toFixed(3)),Number(r.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[tt.LIVE,tt.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:o}=e;if(af.includes(o))return o===tt.UNKNOWN?r:o;let n=e.duration;return n===1/0?tt.LIVE:Number.isFinite(n)?tt.ON_DEMAND:r},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,r=Ur.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===tt.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(i){let{media:e,options:{liveEdgeOffset:t=10}={}}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Ur.mediaStreamType.get(i)===tt.LIVE))return!1;let o=e.seekable;if(!o)return!0;if(!o.length)return!1;let n=o.end(o.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return Nr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Cd(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,r;let{media:o,options:n}=e;if(!o)return;let a=l=>{var d;!n.defaultSubtitles||l&&![xe.CAPTIONS,xe.SUBTITLES].includes((d=l==null?void 0:l.track)==null?void 0:d.kind)||Xa(e,!0)};return o.addEventListener("loadstart",a),(t=o.textTracks)==null||t.addEventListener("addtrack",a),(r=o.textTracks)==null||r.addEventListener("removetrack",a),()=>{var l,d;o.removeEventListener("loadstart",a),(l=o.textTracks)==null||l.removeEventListener("addtrack",a),(d=o.textTracks)==null||d.removeEventListener("removetrack",a)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=Gi(t,{kind:xe.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:o,startTime:n,endTime:a})=>({text:df(o),startTime:n,endTime:a}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let o=r.querySelector('track[kind="chapters"][default][src]'),n=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return o==null||o.addEventListener("load",i),n==null||n.addEventListener("load",i),()=>{o==null||o.removeEventListener("load",i),n==null||n.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:o}=i;if(!r||!o||!o.pictureInPictureElement)return!1;if(o.pictureInPictureElement===r)return!0;if(o.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?Ce(r,o.pictureInPictureElement):!1;if(o.pictureInPictureElement.localName.includes("-")){let n=o.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===r)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!ee.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let r=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(o=>{if(o.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",a),t.preload="none"},a=()=>{t.requestPictureInPicture().catch(r),n()};t.addEventListener("loadedmetadata",a),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),n()},1e3)}else throw o}else throw o})}else ee.pictureInPictureElement&&ee.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(r=>({...r}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,r;let{media:o}=i;return(r=(t=o==null?void 0:o.videoRenditions)==null?void 0:t[(e=o.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:r.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let r=i,o=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==r);t.videoRenditions.selectedIndex!=o&&(t.videoRenditions.selectedIndex=o)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:r}=i;return(t=[...(e=r==null?void 0:r.audioTracks)!=null?e:[]].find(o=>o.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let r=i;for(let o of t.audioTracks)o.enabled=r==o.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return Mh(i)},set(i,e,t){var r;i?(Ih(e),t.detail&&((r=e.media)==null||r.focus())):wh(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,r;let{media:o}=e;if(o&&!(i&&((t=o.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=o.remote)==null?void 0:r.state)!=="connected")){if(typeof o.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}o.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&c.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!Ph||!Ld(e))return Pe.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!Dh||!kd(e))return Pe.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Pe.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(ja===!1||(e==null?void 0:e.volume)==null)return Pe.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{ja==null&&sf.then(e=>i(e?void 0:Pe.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!Nh||!((t=r==null?void 0:r.remote)!=null&&t.state))return Pe.UNSUPPORTED;if(!(e==null||e==="available"))return Pe.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!Oh)return Pe.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Pe.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Pe.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Pe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return Pe.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Pe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var Hh={[y.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,o,n;let{media:a}=e,l=t??void 0,d,m;if(a&&l!=null){let[p]=Gi(a,{kind:xe.METADATA,label:"thumbnails"}),T=Array.prototype.find.call((r=p==null?void 0:p.cues)!=null?r:[],(f,b,S)=>b===0?f.endTime>l:b===S.length-1?f.startTime<=l:f.startTime<=l&&f.endTime>l);if(T){let f=/'^(?:[a-z]+:)?\/\//i.test(T.text)||(o=a==null?void 0:a.querySelector('track[label="thumbnails"]'))==null?void 0:o.src,b=new URL(T.text,f);m=new URLSearchParams(b.hash).get("#xywh").split(",").map(te=>+te),d=b.href}}let h=i.mediaDuration.get(e),E=(n=i.mediaChaptersCues.get(e).find((p,T,f)=>T===f.length-1&&h===p.endTime?p.startTime<=l&&p.endTime>=l:p.startTime<=l&&p.endTime>l))==null?void 0:n.text;return t!=null&&E==null&&(E=""),{mediaPreviewTime:l,mediaPreviewImage:d,mediaPreviewCoords:m,mediaPreviewChapter:E}},[y.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[y.MEDIA_PLAY_REQUEST](i,e){var t,r,o,n;let a="mediaPaused",d=i.mediaStreamType.get(e)===tt.LIVE,m=!((t=e.options)!=null&&t.noAutoSeekToLive),h=i.mediaTargetLiveWindow.get(e)>0;if(d&&m&&!h){let g=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(g){let E=(n=(o=e.options)==null?void 0:o.seekToLiveOffset)!=null?n:0,p=g-E;i.mediaCurrentTime.set(p,e)}}i[a].set(!1,e)},[y.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",o=t;i[r].set(o,e)},[y.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[y.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[y.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",o=!!t;return i[r].set(o,e),{mediaLoop:o}},[y.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",o=t;o&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(o,e)},[y.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",o=t;i[r].set(o,e)},[y.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,o;let n="mediaCurrentTime",a=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(a)))return;let l=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,d=a-l;i[n].set(d,e)},[y.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:o}=e,n=Nr(e),a=Ad(t),l=(r=a[0])==null?void 0:r.language;l&&!o.noSubtitlesLangPref&&c.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Ki(ei.SHOWING,n,a)},[y.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=Nr(e),o=t??[];Ki(ei.DISABLED,r,o)},[y.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){Xa(e,t)},[y.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",o=t;i[r].set(o,e)},[y.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",o=t;i[r].set(o,e)},[y.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[y.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[y.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e,t){let r="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[r].set(!0,e,t)},[y.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[y.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[y.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[y.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var $h=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Ur,requestMap:o=Hh,options:n={},monitorStateOwnersOnlyWithSubscriptions:a=!0})=>{let l=[],d={options:{...n}},m=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),h=f=>{f!=null&&(Ja(f,m)||(m=Object.freeze({...m,...f}),l.forEach(b=>b(m))))},g=()=>{let f=Object.entries(r).reduce((b,[S,{get:te}])=>(b[S]=te(d),b),{});h(f)},E={},p,T=async(f,b)=>{var S,te,Se,ke,_r,cu,Bl,C,K,de,ie,z,ve,Dt,$o,uu;let Xm=!!p;if(p={...d,...p??{},...f},Xm)return;await Uh(...Object.values(f));let yr=l.length>0&&b===0&&a,hu=d.media!==p.media,pu=((S=d.media)==null?void 0:S.textTracks)!==((te=p.media)==null?void 0:te.textTracks),mu=((Se=d.media)==null?void 0:Se.videoRenditions)!==((ke=p.media)==null?void 0:ke.videoRenditions),vu=((_r=d.media)==null?void 0:_r.audioTracks)!==((cu=p.media)==null?void 0:cu.audioTracks),fu=((Bl=d.media)==null?void 0:Bl.remote)!==((C=p.media)==null?void 0:C.remote),Eu=d.documentElement!==p.documentElement,gu=!!d.media&&(hu||yr),bu=!!((K=d.media)!=null&&K.textTracks)&&(pu||yr),_u=!!((de=d.media)!=null&&de.videoRenditions)&&(mu||yr),yu=!!((ie=d.media)!=null&&ie.audioTracks)&&(vu||yr),Tu=!!((z=d.media)!=null&&z.remote)&&(fu||yr),Au=!!d.documentElement&&(Eu||yr),Vl=gu||bu||_u||yu||Tu||Au,Tr=l.length===0&&b===1&&a,I=!!p.media&&(hu||Tr),Su=!!((ve=p.media)!=null&&ve.textTracks)&&(pu||Tr),ku=!!((Dt=p.media)!=null&&Dt.videoRenditions)&&(mu||Tr),Lu=!!(($o=p.media)!=null&&$o.audioTracks)&&(vu||Tr),Cu=!!((uu=p.media)!=null&&uu.remote)&&(fu||Tr),Iu=!!p.documentElement&&(Eu||Tr),wu=I||Su||ku||Lu||Cu||Iu;if(!(Vl||wu)){Object.entries(p).forEach(([Y,Bo])=>{d[Y]=Bo}),g(),p=void 0;return}Object.entries(r).forEach(([Y,{get:Bo,mediaEvents:Jm=[],textTracksEvents:jm=[],videoRenditionsEvents:ev=[],audioTracksEvents:tv=[],remoteEvents:iv=[],rootEvents:rv=[],stateOwnersUpdateHandlers:ov=[]}])=>{E[Y]||(E[Y]={});let He=re=>{let pe=Bo(d,re);h({[Y]:pe})},Ee;Ee=E[Y].mediaEvents,Jm.forEach(re=>{Ee&&gu&&(d.media.removeEventListener(re,Ee),E[Y].mediaEvents=void 0),I&&(p.media.addEventListener(re,He),E[Y].mediaEvents=He)}),Ee=E[Y].textTracksEvents,jm.forEach(re=>{var pe,je;Ee&&bu&&((pe=d.media.textTracks)==null||pe.removeEventListener(re,Ee),E[Y].textTracksEvents=void 0),Su&&((je=p.media.textTracks)==null||je.addEventListener(re,He),E[Y].textTracksEvents=He)}),Ee=E[Y].videoRenditionsEvents,ev.forEach(re=>{var pe,je;Ee&&_u&&((pe=d.media.videoRenditions)==null||pe.removeEventListener(re,Ee),E[Y].videoRenditionsEvents=void 0),ku&&((je=p.media.videoRenditions)==null||je.addEventListener(re,He),E[Y].videoRenditionsEvents=He)}),Ee=E[Y].audioTracksEvents,tv.forEach(re=>{var pe,je;Ee&&yu&&((pe=d.media.audioTracks)==null||pe.removeEventListener(re,Ee),E[Y].audioTracksEvents=void 0),Lu&&((je=p.media.audioTracks)==null||je.addEventListener(re,He),E[Y].audioTracksEvents=He)}),Ee=E[Y].remoteEvents,iv.forEach(re=>{var pe,je;Ee&&Tu&&((pe=d.media.remote)==null||pe.removeEventListener(re,Ee),E[Y].remoteEvents=void 0),Cu&&((je=p.media.remote)==null||je.addEventListener(re,He),E[Y].remoteEvents=He)}),Ee=E[Y].rootEvents,rv.forEach(re=>{Ee&&Au&&(d.documentElement.removeEventListener(re,Ee),E[Y].rootEvents=void 0),Iu&&(p.documentElement.addEventListener(re,He),E[Y].rootEvents=He)});let va=E[Y].stateOwnersUpdateHandlers;if(va&&Vl&&(Array.isArray(va)?va:[va]).forEach(pe=>{typeof pe=="function"&&pe()}),wu){let re=ov.map(pe=>pe(He,p)).filter(pe=>typeof pe=="function");E[Y].stateOwnersUpdateHandlers=re.length===1?re[0]:re}else Vl&&(E[Y].stateOwnersUpdateHandlers=void 0)}),Object.entries(p).forEach(([Y,Bo])=>{d[Y]=Bo}),g(),p=void 0};return T({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(f){let{type:b,detail:S}=f;if(o[b]&&m.mediaErrorCode==null){h(o[b](r,d,f));return}b==="mediaelementchangerequest"?T({media:S}):b==="fullscreenelementchangerequest"?T({fullscreenElement:S}):b==="documentelementchangerequest"?T({documentElement:S}):b==="optionschangerequest"&&(Object.entries(S??{}).forEach(([te,Se])=>{d.options[te]=Se}),g())},getState(){return m},subscribe(f){return T({},l.length+1),l.push(f),f(m),()=>{let b=l.indexOf(f);b>=0&&(T({},l.length-1),l.splice(b,1))}}}};var Pd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},R=(i,e,t)=>(Pd(i,e,"read from private field"),t?t.call(i):e.get(i)),ze=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ht=(i,e,t,r)=>(Pd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),mt=(i,e,t)=>(Pd(i,e,"access private method"),t),oi,vn,V,zi,fn,pt,es,En,ts,Id,Yi,Hr,is,wd,Md,qh,zh=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],Bh=10,Vh=.025,Wh=.25,cf=.25,uf=2,A={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},Rd=class extends Vi{constructor(){super(),ze(this,ts),ze(this,Yi),ze(this,is),ze(this,Md),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,ze(this,oi,new ri(this,A.HOTKEYS)),ze(this,vn,void 0),ze(this,V,void 0),ze(this,zi,null),ze(this,fn,void 0),ze(this,pt,void 0),ze(this,es,t=>{var r;(r=R(this,V))==null||r.dispatch(t)}),ze(this,En,void 0),this.associateElement(this);let e={};ht(this,fn,t=>{Object.entries(t).forEach(([r,o])=>{if(r in e&&e[r]===o)return;this.propagateMediaState(r,o);let n=r.toLowerCase(),a=new c.CustomEvent(rh[n],{composed:!0,detail:o});this.dispatchEvent(a)}),e=t}),this.hasAttribute(A.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(A.NO_HOTKEYS,A.HOTKEYS,A.DEFAULT_STREAM_TYPE,A.DEFAULT_SUBTITLES,A.DEFAULT_DURATION,A.NO_MUTED_PREF,A.NO_VOLUME_PREF,A.LANG,A.LOOP)}get mediaStore(){return R(this,V)}set mediaStore(e){var t,r;if(R(this,V)&&((t=R(this,pt))==null||t.call(this),ht(this,pt,void 0)),ht(this,V,e),!R(this,V)&&!this.hasAttribute(A.NO_DEFAULT_STORE)){mt(this,ts,Id).call(this);return}ht(this,pt,(r=R(this,V))==null?void 0:r.subscribe(R(this,fn)))}get fullscreenElement(){var e;return(e=R(this,vn))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(A.FULLSCREEN_ELEMENT)&&this.removeAttribute(A.FULLSCREEN_ELEMENT),ht(this,vn,e),(t=R(this,V))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return w(this,A.DEFAULT_SUBTITLES)}set defaultSubtitles(e){M(this,A.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return D(this,A.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){O(this,A.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return H(this,A.DEFAULT_DURATION)}set defaultDuration(e){B(this,A.DEFAULT_DURATION,e)}get noHotkeys(){return w(this,A.NO_HOTKEYS)}set noHotkeys(e){M(this,A.NO_HOTKEYS,e)}get keysUsed(){return D(this,A.KEYS_USED)}set keysUsed(e){O(this,A.KEYS_USED,e)}get liveEdgeOffset(){return H(this,A.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){B(this,A.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return w(this,A.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){M(this,A.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return w(this,A.NO_VOLUME_PREF)}set noVolumePref(e){M(this,A.NO_VOLUME_PREF,e)}get noMutedPref(){return w(this,A.NO_MUTED_PREF)}set noMutedPref(e){M(this,A.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return w(this,A.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){M(this,A.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return w(this,A.NO_DEFAULT_STORE)}set noDefaultStore(e){M(this,A.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var o,n,a,l,d,m,h,g,E,p,T,f;if(super.attributeChangedCallback(e,t,r),e===A.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(A.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):r!==t&&r===null&&this.enableHotkeys();else if(e===A.HOTKEYS)R(this,oi).value=r;else if(e===A.DEFAULT_SUBTITLES&&r!==t)(o=R(this,V))==null||o.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(A.DEFAULT_SUBTITLES)}});else if(e===A.DEFAULT_STREAM_TYPE)(a=R(this,V))==null||a.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(A.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===A.LIVE_EDGE_OFFSET)(l=R(this,V))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(A.LIVE_EDGE_OFFSET)}});else if(e===A.SEEK_TO_LIVE_OFFSET)(d=R(this,V))==null||d.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(A.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===A.NO_AUTO_SEEK_TO_LIVE)(m=R(this,V))==null||m.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(A.NO_AUTO_SEEK_TO_LIVE)}});else if(e===A.FULLSCREEN_ELEMENT){let b=r?(h=this.getRootNode())==null?void 0:h.getElementById(r):void 0;ht(this,vn,b),(g=R(this,V))==null||g.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===A.LANG&&r!==t?(hh(r),(E=R(this,V))==null||E.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===A.LOOP&&r!==t?(p=R(this,V))==null||p.dispatch({type:y.MEDIA_LOOP_REQUEST,detail:r!=null}):e===A.NO_VOLUME_PREF&&r!==t?(T=R(this,V))==null||T.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(A.NO_VOLUME_PREF)}}):e===A.NO_MUTED_PREF&&r!==t&&((f=R(this,V))==null||f.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(A.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!R(this,V)&&!this.hasAttribute(A.NO_DEFAULT_STORE)&&mt(this,ts,Id).call(this),(e=R(this,V))==null||e.dispatch({type:"documentelementchangerequest",detail:ee}),super.connectedCallback(),R(this,V)&&!R(this,pt)&&ht(this,pt,(t=R(this,V))==null?void 0:t.subscribe(R(this,fn))),R(this,En)!==void 0&&R(this,V)&&this.media&&setTimeout(()=>{var r,o,n;(o=(r=this.media)==null?void 0:r.textTracks)!=null&&o.length&&((n=R(this,V))==null||n.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:R(this,En)}))},0),this.hasAttribute(A.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,o,n;if((e=super.disconnectedCallback)==null||e.call(this),R(this,V)){let a=R(this,V).getState();ht(this,En,!!((t=a.mediaSubtitlesShowing)!=null&&t.length)),(r=R(this,V))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(o=R(this,V))==null||o.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}R(this,pt)&&((n=R(this,pt))==null||n.call(this),ht(this,pt,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=R(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=R(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){Gh(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),o=this.unregisterMediaStateReceiver.bind(this),n=Ef(e,r,o);Object.values(y).forEach(a=>{e.addEventListener(a,R(this,es))}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(y).forEach(o=>{e.removeEventListener(o,R(this,es))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),R(this,V)&&Object.entries(R(this,V).getState()).forEach(([o,n])=>{Gh([e],o,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",mt(this,is,wd))}disableHotkeys(){this.removeEventListener("keydown",mt(this,is,wd)),this.removeEventListener("keyup",mt(this,Yi,Hr))}get hotkeys(){return D(this,A.HOTKEYS)}set hotkeys(e){O(this,A.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,o,n,a,l,d,m,h;let g=e.target;if(((o=(r=(t=g.getAttribute(A.KEYS_USED))==null?void 0:t.split(" "))!=null?r:g==null?void 0:g.keysUsed)!=null?o:[]).map(S=>S==="Space"?" ":S).filter(Boolean).includes(e.key))return;let p,T,f;if(!(R(this,oi).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&R(this,oi).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&R(this,oi).contains("noshift+/")))switch(e.key){case" ":case"k":p=R(this,V).getState().mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new c.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"m":p=this.mediaStore.getState().mediaVolumeLevel==="off"?y.MEDIA_UNMUTE_REQUEST:y.MEDIA_MUTE_REQUEST,this.dispatchEvent(new c.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"f":p=this.mediaStore.getState().mediaIsFullscreen?y.MEDIA_EXIT_FULLSCREEN_REQUEST:y.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new c.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new c.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let S=this.hasAttribute(A.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(A.KEYBOARD_BACKWARD_SEEK_OFFSET):Bh;T=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-S,0),f=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"ArrowRight":case"l":{let S=this.hasAttribute(A.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(A.KEYBOARD_FORWARD_SEEK_OFFSET):Bh;T=Math.max(((a=this.mediaStore.getState().mediaCurrentTime)!=null?a:0)+S,0),f=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"ArrowUp":{let S=this.hasAttribute(A.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(A.KEYBOARD_UP_VOLUME_STEP):Vh;T=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+S,1),f=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"ArrowDown":{let S=this.hasAttribute(A.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(A.KEYBOARD_DOWN_VOLUME_STEP):Vh;T=Math.max(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)-S,0),f=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"<":{let S=(m=this.mediaStore.getState().mediaPlaybackRate)!=null?m:1;T=Math.max(S-Wh,cf).toFixed(2),f=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case">":{let S=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;T=Math.min(S+Wh,uf).toFixed(2),f=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"/":case"?":{e.shiftKey&&mt(this,Md,qh).call(this);break}case"p":{p=this.mediaStore.getState().mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST,f=new c.CustomEvent(p,{composed:!0,bubbles:!0}),this.dispatchEvent(f);break}default:break}}};oi=new WeakMap;vn=new WeakMap;V=new WeakMap;zi=new WeakMap;fn=new WeakMap;pt=new WeakMap;es=new WeakMap;En=new WeakMap;ts=new WeakSet;Id=function(){var i;this.mediaStore=$h({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(A.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(A.DEFAULT_DURATION)?+this.getAttribute(A.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(A.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(A.SEEK_TO_LIVE_OFFSET):this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(A.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(A.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(A.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(A.NO_SUBTITLES_LANG_PREF)}})};Yi=new WeakSet;Hr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||zh.includes(e))){this.removeEventListener("keyup",mt(this,Yi,Hr));return}this.keyboardShortcutHandler(i)};is=new WeakSet;wd=function(i){var e;let{metaKey:t,altKey:r,key:o,shiftKey:n}=i,a=n&&(o==="/"||o==="?");if(a&&((e=R(this,zi))!=null&&e.open)){this.removeEventListener("keyup",mt(this,Yi,Hr));return}if(t||r||!a&&!zh.includes(o)){this.removeEventListener("keyup",mt(this,Yi,Hr));return}let l=i.target,d=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(o)&&!(R(this,oi).contains(`no${o.toLowerCase()}`)||o===" "&&R(this,oi).contains("nospace"))&&!d&&i.preventDefault(),this.addEventListener("keyup",mt(this,Yi,Hr),{once:!0})};Md=new WeakSet;qh=function(){R(this,zi)||(ht(this,zi,ee.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(R(this,zi))),R(this,zi).open=!0};var hf=Object.values(s),pf=Object.values(pd),Yh=i=>{var e,t,r,o;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(c.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let a=(o=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,N.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:o.call(r,/\s+/);return Array.isArray(n||a)?(n||a).filter(l=>hf.includes(l)):[]},mf=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&c.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof c.customElements.get(i.nodeName.toLowerCase()))&&c.customElements.upgrade(i),pf.some(r=>r in i)},xd=i=>mf(i)||!!Yh(i).length,Fh=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Kh={[s.MEDIA_SUBTITLES_LIST]:$t,[s.MEDIA_SUBTITLES_SHOWING]:$t,[s.MEDIA_SEEKABLE]:Fh,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Fh).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:nh,[s.MEDIA_AUDIO_TRACK_LIST]:sh},vf=async(i,e,t)=>{var r,o;if(i.isConnected||await Ra(0),typeof t=="boolean"||t==null)return M(i,e,t);if(typeof t=="number")return B(i,e,t);if(typeof t=="string")return O(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(o=(r=Kh[e])==null?void 0:r.call(Kh,t))!=null?o:t;return i.setAttribute(e,n)},ff=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},qi=(i,e)=>{if(ff(i))return;let t=(o,n)=>{var a,l;xd(o)&&n(o);let{children:d=[]}=o??{},m=(l=(a=o==null?void 0:o.shadowRoot)==null?void 0:a.children)!=null?l:[];[...d,...m].forEach(g=>qi(g,n))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!xd(i)){c.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},Gh=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let o=Yh(r),n=e.toLowerCase();o.includes(n)&&vf(r,n,t)})},Ef=(i,e,t)=>{qi(i,e);let r=h=>{var g;let E=(g=h==null?void 0:h.composedPath()[0])!=null?g:h.target;e(E)},o=h=>{var g;let E=(g=h==null?void 0:h.composedPath()[0])!=null?g:h.target;t(E)};i.addEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,o);let n=h=>{h.forEach(g=>{let{addedNodes:E=[],removedNodes:p=[],type:T,target:f,attributeName:b}=g;T==="childList"?(Array.prototype.forEach.call(E,S=>qi(S,e)),Array.prototype.forEach.call(p,S=>qi(S,t))):T==="attributes"&&b===N.MEDIA_CHROME_ATTRIBUTES&&(xd(f)?e(f):t(f))})},a=[],l=h=>{let g=h.target;g.name!=="media"&&(a.forEach(E=>qi(E,t)),a=[...g.assignedElements({flatten:!0})],a.forEach(E=>qi(E,e)))};i.addEventListener("slotchange",l);let d=new MutationObserver(n);return d.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{qi(i,t),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};c.customElements.get("media-controller")||c.customElements.define("media-controller",Rd);var $r={PLACEMENT:"placement",BOUNDS:"bounds"};function gf(i){return`
394
+ `}var Xv=Object.values(a),Jv="sm:384 md:576 lg:768 xl:960";function jv(i){wh(i.target,i.contentRect.width)}function wh(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(x.BREAKPOINTS))!=null?t:Jv,o=ef(r),n=tf(o,e),s=!1;if(Object.keys(o).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(Ui.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Ui.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function ef(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function tf(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var Vi=class extends c.HTMLElement{constructor(){if(super(),$e(this,Td),$e(this,Ad),$e(this,Sd),$e(this,pn),$e(this,zs),$e(this,Pr),$e(this,Ks,0),$e(this,Mr,null),$e(this,hn,null),$e(this,xr,void 0),this.breakpointsComputed=!1,$e(this,Fs,new MutationObserver(Ge(this,Td,kh).bind(this))),$e(this,un,!1),$e(this,qs,t=>{Be(this,un)||(setTimeout(()=>{jv(t),Bi(this,un,!1)},0),Bi(this,un,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=j(this.attributes),r=this.constructor.getTemplateHTML(t);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(r):this.shadowRoot.innerHTML=r}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){Be(this,Mr)&&this.mediaUnsetCallback(Be(this,Mr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[x.AUTOHIDE,x.GESTURES_DISABLED].concat(Xv).filter(e=>![a.MEDIA_RENDITION_LIST,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_CHAPTERS_CUES,a.MEDIA_WIDTH,a.MEDIA_HEIGHT,a.MEDIA_ERROR,a.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==x.AUTOHIDE&&(this.autohide=r)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Bi(this,Mr,e),e.localName.includes("-")&&await c.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Be(this,Fs).observe(this,{childList:!0,subtree:!0}),Nt(this,Be(this,qs));let r=this.getAttribute(x.AUDIO)!=null?_("audio player"):_("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(x.USER_INACTIVE,""),wh(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=c.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Be(this,Fs).disconnect(),Ut(this,Be(this,qs)),this.media&&this.mediaUnsetCallback(this.media),(e=c.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Bi(this,Mr,null)}handleEvent(e){switch(e.type){case"pointerdown":Bi(this,Ks,e.timeStamp);break;case"pointermove":Ge(this,Ad,Lh).call(this,e);break;case"pointerup":Ge(this,Sd,Ih).call(this,e);break;case"mouseleave":Ge(this,pn,Gs).call(this);break;case"mouseup":this.removeAttribute(x.KEYBOARD_CONTROL);break;case"keyup":Ge(this,Pr,mn).call(this),this.setAttribute(x.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Bi(this,xr,isNaN(t)?0:t)}get autohide(){return(Be(this,xr)===void 0?2:Be(this,xr)).toString()}get breakpoints(){return D(this,x.BREAKPOINTS)}set breakpoints(e){O(this,x.BREAKPOINTS,e)}get audio(){return C(this,x.AUDIO)}set audio(e){R(this,x.AUDIO,e)}get gesturesDisabled(){return C(this,x.GESTURES_DISABLED)}set gesturesDisabled(e){R(this,x.GESTURES_DISABLED,e)}get keyboardControl(){return C(this,x.KEYBOARD_CONTROL)}set keyboardControl(e){R(this,x.KEYBOARD_CONTROL,e)}get noAutohide(){return C(this,x.NO_AUTOHIDE)}set noAutohide(e){R(this,x.NO_AUTOHIDE,e)}get autohideOverControls(){return C(this,x.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){R(this,x.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return C(this,x.USER_INACTIVE)}set userInteractive(e){R(this,x.USER_INACTIVE,e)}};Ks=new WeakMap;Mr=new WeakMap;hn=new WeakMap;xr=new WeakMap;Fs=new WeakMap;Td=new WeakSet;kh=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let o of r){if(o.slot!="media"||t.target!=this)continue;let n=t.previousSibling&&t.previousSibling.previousElementSibling;if(!n||!e)this.mediaUnsetCallback(o);else{let s=n.slot!=="media";for(;(n=n.previousSibling)!==null;)n.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(o)}}if(e)for(let o of t.addedNodes)o===e&&this.handleMediaUpdated(e)}};un=new WeakMap;qs=new WeakMap;Ad=new WeakSet;Lh=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-Be(this,Ks)<250)return;Ge(this,zs,Ld).call(this),clearTimeout(Be(this,hn));let e=this.hasAttribute(x.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&Ge(this,Pr,mn).call(this)};Sd=new WeakSet;Ih=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(x.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Ge(this,pn,Gs).call(this):Ge(this,Pr,mn).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Ge(this,Pr,mn).call(this)};pn=new WeakSet;Gs=function(){if(Be(this,xr)<0||this.hasAttribute(x.USER_INACTIVE))return;this.setAttribute(x.USER_INACTIVE,"");let i=new c.CustomEvent(Ui.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};zs=new WeakSet;Ld=function(){if(!this.hasAttribute(x.USER_INACTIVE))return;this.removeAttribute(x.USER_INACTIVE);let i=new c.CustomEvent(Ui.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Pr=new WeakSet;mn=function(){Ge(this,zs,Ld).call(this),clearTimeout(Be(this,hn));let i=parseInt(this.autohide);i<0||Bi(this,hn,setTimeout(()=>{Ge(this,pn,Gs).call(this)},i*1e3))};Vi.shadowRootOptions={mode:"open"};Vi.getTemplateHTML=Zv;c.customElements.get("media-container")||c.customElements.define("media-container",Vi);var Ch=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_e=(i,e,t)=>(Ch(i,e,"read from private field"),t?t.call(i):e.get(i)),vn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ys=(i,e,t,r)=>(Ch(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Dr,Or,Qs,Wi,Ht,ii,ri=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){vn(this,Ht),vn(this,Dr,void 0),vn(this,Or,void 0),vn(this,Qs,void 0),vn(this,Wi,new Set),Ys(this,Dr,e),Ys(this,Or,t),Ys(this,Qs,new Set(r))}[Symbol.iterator](){return _e(this,Ht,ii).values()}get length(){return _e(this,Ht,ii).size}get value(){var e;return(e=[..._e(this,Ht,ii)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ys(this,Wi,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[..._e(this,Ht,ii)][e]}values(){return _e(this,Ht,ii).values()}forEach(e,t){_e(this,Ht,ii).forEach(e,t)}add(...e){var t,r;e.forEach(o=>_e(this,Wi).add(o)),!(this.value===""&&!((t=_e(this,Dr))!=null&&t.hasAttribute(`${_e(this,Or)}`)))&&((r=_e(this,Dr))==null||r.setAttribute(`${_e(this,Or)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>_e(this,Wi).delete(r)),(t=_e(this,Dr))==null||t.setAttribute(`${_e(this,Or)}`,`${this.value}`)}contains(e){return _e(this,Ht,ii).has(e)}toggle(e,t){return typeof t<"u"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};Dr=new WeakMap;Or=new WeakMap;Qs=new WeakMap;Wi=new WeakMap;Ht=new WeakSet;ii=function(){return _e(this,Wi).size?_e(this,Wi):_e(this,Qs)};var rf=(i="")=>i.split(/\s+/),Rh=(i="")=>{let[e,t,r]=i.split(":"),o=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?xe.CAPTIONS:xe.SUBTITLES,language:t,label:o}},Fi=(i="",e={})=>rf(i).map(t=>{let r=Rh(t);return{...e,...r}}),Id=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?Rh(e):e):typeof i=="string"?Fi(i):[i]:[],Zs=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,$t=(i=[])=>Array.prototype.map.call(i,Zs).join(" "),of=(i,e)=>t=>t[i]===e,Mh=i=>{let e=Object.entries(i).map(([t,r])=>of(t,r));return t=>e.every(r=>r(t))},qi=(i,e=[],t=[])=>{let r=Id(t).map(Mh),o=n=>r.some(s=>s(n));Array.from(e).filter(o).forEach(n=>{n.mode=i})},Ki=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Mh(e);return Array.from(i.textTracks).filter(t)},Xs=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(a.MEDIA_SUBTITLES_SHOWING)};var Ph=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let o=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(o){let n=(e=r[o])==null?void 0:e.call(r);if(n instanceof Promise)return n.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(o){console.error(o)}},xh="exitFullscreen"in ee?"exitFullscreen":"webkitExitFullscreen"in ee?"webkitExitFullscreen":"webkitCancelFullScreen"in ee?"webkitCancelFullScreen":void 0,Dh=i=>{var e;let{documentElement:t}=i;if(xh){let r=(e=t==null?void 0:t[xh])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},fn="fullscreenElement"in ee?"fullscreenElement":"webkitFullscreenElement"in ee?"webkitFullscreenElement":void 0,nf=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[fn];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===dh.FULLSCREEN?t:r},Oh=i=>{var e;let{media:t,documentElement:r,fullscreenElement:o=t}=i;if(!t||!r)return!1;let n=nf(i);if(!n)return!1;if(n===o||n===t)return!0;if(n.localName.includes("-")){let s=n.shadowRoot;if(!(fn in s))return Ie(n,o);for(;s!=null&&s[fn];){if(s[fn]===o)return!0;s=(e=s[fn])==null?void 0:e.shadowRoot}}return!1},sf="fullscreenEnabled"in ee?"fullscreenEnabled":"webkitFullscreenEnabled"in ee?"webkitFullscreenEnabled":void 0,Nh=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[sf])||t&&"webkitSupportsFullscreen"in t};var Js,wd=()=>{var i,e;return Js||(Js=(e=(i=ee)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Js)},Uh=async(i=wd())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([af(i,t.signal),lf(i,e)]);return t.abort(),r},af=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),lf=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await Ps(10)}return i.volume!==e},df=/.*Version\/.*Safari\/.*/.test(c.navigator.userAgent),Cd=(i=wd())=>c.matchMedia("(display-mode: standalone)").matches&&df?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Rd=(i=wd())=>Nh({documentElement:ee,media:i}),Hh=Rd(),$h=Cd(),Bh=!!c.WebKitPlaybackTargetAvailabilityEvent,Vh=!!c.chrome;var Nr=i=>Ki(i.media,e=>[xe.SUBTITLES,xe.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Md=i=>Ki(i.media,e=>e.mode===ei.SHOWING&&[xe.SUBTITLES,xe.CAPTIONS].includes(e.kind)),js=(i,e)=>{let t=Nr(i),r=Md(i),o=!!r.length;if(t.length){if(e===!1||o&&e!==!0)qi(ei.DISABLED,t,r);else if(e===!0||!o&&e!==!1){let n=t[0],{options:s}=i;if(!(s!=null&&s.noSubtitlesLangPref)){let h=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=h?[h,...globalThis.navigator.languages]:globalThis.navigator.languages,E=t.filter(p=>g.some(T=>p.language.toLowerCase().startsWith(T.split("-")[0]))).sort((p,T)=>{let f=g.findIndex(S=>p.language.toLowerCase().startsWith(S.split("-")[0])),b=g.findIndex(S=>T.language.toLowerCase().startsWith(S.split("-")[0]));return f-b});E[0]&&(n=E[0])}let{language:l,label:d,kind:m}=n;qi(ei.DISABLED,t,r),qi(ei.SHOWING,t,[{language:l,label:d,kind:m}])}}},ea=(i,e)=>i===e?!0:i==null||e==null||typeof i!=typeof e?!1:typeof i=="number"&&Number.isNaN(i)&&Number.isNaN(e)?!0:typeof i!="object"?!1:Array.isArray(i)?cf(i,e):Object.entries(i).every(([t,r])=>t in e&&ea(r,e[t])),cf=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((o,n)=>ea(o,e[n])):!0};var uf=Object.values(tt),ta,hf=Uh().then(i=>(ta=i,ta)),Wh=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof c.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=c.customElements.get(t);r&&e instanceof r||(await c.customElements.whenDefined(t),c.customElements.upgrade(e))}))},pf=new c.DOMParser,mf=i=>i&&(pf.parseFromString(i,"text/html").body.textContent||i),Ur={mediaError:{get(i,e){let{media:t}=i;if((e==null?void 0:e.type)!=="playing")return t==null?void 0:t.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(i,e){var t;let{media:r}=i;if((e==null?void 0:e.type)!=="playing")return(t=r==null?void 0:r.error)==null?void 0:t.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(i,e){var t,r;let{media:o}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=o==null?void 0:o.error)==null?void 0:t.message)!=null?r:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:r}=e;r&&(i?r.pause():(t=r.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t,options:{noMutedPref:r}={}}=e;if(t){t.muted=i;try{let o=c.localStorage.getItem("media-chrome-pref-muted")!==null,n=t.hasAttribute("muted");if(r){o&&c.localStorage.removeItem("media-chrome-pref-muted");return}if(n&&!o)return;c.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(o){console.debug("Error setting muted pref",o)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let o=c.localStorage.getItem("media-chrome-pref-muted")==="true";Ur.mediaMuted.set(o,e),i(o)}catch(o){console.debug("Error getting muted pref",o)}}]},mediaLoop:{get(i){let{media:e}=i;return e==null?void 0:e.loop},set(i,e){let{media:t}=e;t&&(t.loop=i)},mediaEvents:["medialooprequest"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t,options:{noVolumePref:r}={}}=e;if(t){try{i==null?c.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&c.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(o){console.debug("Error setting volume pref",o)}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let{media:r}=e;if(!r)return;let o=c.localStorage.getItem("media-chrome-pref-volume");if(o==null)return;Ur.mediaVolume.set(+o,e),i(+o)}catch(r){console.debug("Error getting volume pref",r)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)>"u"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||!Cr(i)||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let r=t.seekable.start(0),o=t.seekable.end(t.seekable.length-1);if(!(!r&&!o))return[Number(r.toFixed(3)),Number(o.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,r=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(r).map((o,n)=>[Number(r.start(n).toFixed(3)),Number(r.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[tt.LIVE,tt.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:o}=e;if(uf.includes(o))return o===tt.UNKNOWN?r:o;let n=e.duration;return n===1/0?tt.LIVE:Number.isFinite(n)?tt.ON_DEMAND:r},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,r=Ur.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===tt.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(i){let{media:e,options:{liveEdgeOffset:t=10}={}}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Ur.mediaStreamType.get(i)===tt.LIVE))return!1;let o=e.seekable;if(!o)return!0;if(!o.length)return!1;let n=o.end(o.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return Nr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Md(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,r;let{media:o,options:n}=e;if(!o)return;let s=l=>{var d;!n.defaultSubtitles||l&&![xe.CAPTIONS,xe.SUBTITLES].includes((d=l==null?void 0:l.track)==null?void 0:d.kind)||js(e,!0)};return o.addEventListener("loadstart",s),(t=o.textTracks)==null||t.addEventListener("addtrack",s),(r=o.textTracks)==null||r.addEventListener("removetrack",s),()=>{var l,d;o.removeEventListener("loadstart",s),(l=o.textTracks)==null||l.removeEventListener("addtrack",s),(d=o.textTracks)==null||d.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=Ki(t,{kind:xe.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:o,startTime:n,endTime:s})=>({text:mf(o),startTime:n,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let o=r.querySelector('track[kind="chapters"][default][src]'),n=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return o==null||o.addEventListener("load",i),n==null||n.addEventListener("load",i),()=>{o==null||o.removeEventListener("load",i),n==null||n.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:o}=i;if(!r||!o||!o.pictureInPictureElement)return!1;if(o.pictureInPictureElement===r)return!0;if(o.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?Ie(r,o.pictureInPictureElement):!1;if(o.pictureInPictureElement.localName.includes("-")){let n=o.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===r)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!ee.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let r=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(o=>{if(o.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(r),n()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),n()},1e3)}else throw o}else throw o})}else ee.pictureInPictureElement&&ee.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(r=>({...r}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,r;let{media:o}=i;return(r=(t=o==null?void 0:o.videoRenditions)==null?void 0:t[(e=o.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:r.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let r=i,o=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==r);t.videoRenditions.selectedIndex!=o&&(t.videoRenditions.selectedIndex=o)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:r}=i;return(t=[...(e=r==null?void 0:r.audioTracks)!=null?e:[]].find(o=>o.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let r=i;for(let o of t.audioTracks)o.enabled=r==o.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return Oh(i)},set(i,e,t){var r;i?(Ph(e),t.detail&&((r=e.media)==null||r.focus())):Dh(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,r;let{media:o}=e;if(o&&!(i&&((t=o.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=o.remote)==null?void 0:r.state)!=="connected")){if(typeof o.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}o.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&c.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!Hh||!Rd(e))return Pe.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!$h||!Cd(e))return Pe.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Pe.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(ta===!1||(e==null?void 0:e.volume)==null)return Pe.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{ta==null&&hf.then(e=>i(e?void 0:Pe.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!Vh||!((t=r==null?void 0:r.remote)!=null&&t.state))return Pe.UNSUPPORTED;if(!(e==null||e==="available"))return Pe.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!Bh)return Pe.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Pe.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Pe.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Pe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return Pe.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Pe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var Fh={[y.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,o,n;let{media:s}=e,l=t??void 0,d,m;if(s&&l!=null){let[p]=Ki(s,{kind:xe.METADATA,label:"thumbnails"}),T=Array.prototype.find.call((r=p==null?void 0:p.cues)!=null?r:[],(f,b,S)=>b===0?f.endTime>l:b===S.length-1?f.startTime<=l:f.startTime<=l&&f.endTime>l);if(T){let f=/'^(?:[a-z]+:)?\/\//i.test(T.text)||(o=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:o.src,b=new URL(T.text,f);m=new URLSearchParams(b.hash).get("#xywh").split(",").map(te=>+te),d=b.href}}let h=i.mediaDuration.get(e),E=(n=i.mediaChaptersCues.get(e).find((p,T,f)=>T===f.length-1&&h===p.endTime?p.startTime<=l&&p.endTime>=l:p.startTime<=l&&p.endTime>l))==null?void 0:n.text;return t!=null&&E==null&&(E=""),{mediaPreviewTime:l,mediaPreviewImage:d,mediaPreviewCoords:m,mediaPreviewChapter:E}},[y.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[y.MEDIA_PLAY_REQUEST](i,e){var t,r,o,n;let s="mediaPaused",d=i.mediaStreamType.get(e)===tt.LIVE,m=!((t=e.options)!=null&&t.noAutoSeekToLive),h=i.mediaTargetLiveWindow.get(e)>0;if(d&&m&&!h){let g=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(g){let E=(n=(o=e.options)==null?void 0:o.seekToLiveOffset)!=null?n:0,p=g-E;i.mediaCurrentTime.set(p,e)}}i[s].set(!1,e)},[y.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",o=t;i[r].set(o,e)},[y.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[y.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[y.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",o=!!t;return i[r].set(o,e),{mediaLoop:o}},[y.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",o=t;o&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(o,e)},[y.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",o=t;i[r].set(o,e)},[y.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,o;let n="mediaCurrentTime",s=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(s)))return;let l=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,d=s-l;i[n].set(d,e)},[y.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:o}=e,n=Nr(e),s=Id(t),l=(r=s[0])==null?void 0:r.language;l&&!o.noSubtitlesLangPref&&c.localStorage.setItem("media-chrome-pref-subtitles-lang",l),qi(ei.SHOWING,n,s)},[y.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=Nr(e),o=t??[];qi(ei.DISABLED,r,o)},[y.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){js(e,t)},[y.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",o=t;i[r].set(o,e)},[y.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",o=t;i[r].set(o,e)},[y.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[y.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[y.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e,t){let r="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[r].set(!0,e,t)},[y.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[y.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[y.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[y.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var qh=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Ur,requestMap:o=Fh,options:n={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],d={options:{...n}},m=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),h=f=>{f!=null&&(ea(f,m)||(m=Object.freeze({...m,...f}),l.forEach(b=>b(m))))},g=()=>{let f=Object.entries(r).reduce((b,[S,{get:te}])=>(b[S]=te(d),b),{});h(f)},E={},p,T=async(f,b)=>{var S,te,Se,ke,_r,mu,Wl,I,q,de,ie,z,ve,Dt,$o,vu;let iv=!!p;if(p={...d,...p??{},...f},iv)return;await Wh(...Object.values(f));let yr=l.length>0&&b===0&&s,fu=d.media!==p.media,Eu=((S=d.media)==null?void 0:S.textTracks)!==((te=p.media)==null?void 0:te.textTracks),gu=((Se=d.media)==null?void 0:Se.videoRenditions)!==((ke=p.media)==null?void 0:ke.videoRenditions),bu=((_r=d.media)==null?void 0:_r.audioTracks)!==((mu=p.media)==null?void 0:mu.audioTracks),_u=((Wl=d.media)==null?void 0:Wl.remote)!==((I=p.media)==null?void 0:I.remote),yu=d.documentElement!==p.documentElement,Tu=!!d.media&&(fu||yr),Au=!!((q=d.media)!=null&&q.textTracks)&&(Eu||yr),Su=!!((de=d.media)!=null&&de.videoRenditions)&&(gu||yr),ku=!!((ie=d.media)!=null&&ie.audioTracks)&&(bu||yr),Lu=!!((z=d.media)!=null&&z.remote)&&(_u||yr),Iu=!!d.documentElement&&(yu||yr),Fl=Tu||Au||Su||ku||Lu||Iu,Tr=l.length===0&&b===1&&s,w=!!p.media&&(fu||Tr),wu=!!((ve=p.media)!=null&&ve.textTracks)&&(Eu||Tr),Cu=!!((Dt=p.media)!=null&&Dt.videoRenditions)&&(gu||Tr),Ru=!!(($o=p.media)!=null&&$o.audioTracks)&&(bu||Tr),Mu=!!((vu=p.media)!=null&&vu.remote)&&(_u||Tr),xu=!!p.documentElement&&(yu||Tr),Pu=w||wu||Cu||Ru||Mu||xu;if(!(Fl||Pu)){Object.entries(p).forEach(([Y,Bo])=>{d[Y]=Bo}),g(),p=void 0;return}Object.entries(r).forEach(([Y,{get:Bo,mediaEvents:rv=[],textTracksEvents:ov=[],videoRenditionsEvents:nv=[],audioTracksEvents:sv=[],remoteEvents:av=[],rootEvents:lv=[],stateOwnersUpdateHandlers:dv=[]}])=>{E[Y]||(E[Y]={});let He=re=>{let pe=Bo(d,re);h({[Y]:pe})},Ee;Ee=E[Y].mediaEvents,rv.forEach(re=>{Ee&&Tu&&(d.media.removeEventListener(re,Ee),E[Y].mediaEvents=void 0),w&&(p.media.addEventListener(re,He),E[Y].mediaEvents=He)}),Ee=E[Y].textTracksEvents,ov.forEach(re=>{var pe,je;Ee&&Au&&((pe=d.media.textTracks)==null||pe.removeEventListener(re,Ee),E[Y].textTracksEvents=void 0),wu&&((je=p.media.textTracks)==null||je.addEventListener(re,He),E[Y].textTracksEvents=He)}),Ee=E[Y].videoRenditionsEvents,nv.forEach(re=>{var pe,je;Ee&&Su&&((pe=d.media.videoRenditions)==null||pe.removeEventListener(re,Ee),E[Y].videoRenditionsEvents=void 0),Cu&&((je=p.media.videoRenditions)==null||je.addEventListener(re,He),E[Y].videoRenditionsEvents=He)}),Ee=E[Y].audioTracksEvents,sv.forEach(re=>{var pe,je;Ee&&ku&&((pe=d.media.audioTracks)==null||pe.removeEventListener(re,Ee),E[Y].audioTracksEvents=void 0),Ru&&((je=p.media.audioTracks)==null||je.addEventListener(re,He),E[Y].audioTracksEvents=He)}),Ee=E[Y].remoteEvents,av.forEach(re=>{var pe,je;Ee&&Lu&&((pe=d.media.remote)==null||pe.removeEventListener(re,Ee),E[Y].remoteEvents=void 0),Mu&&((je=p.media.remote)==null||je.addEventListener(re,He),E[Y].remoteEvents=He)}),Ee=E[Y].rootEvents,lv.forEach(re=>{Ee&&Iu&&(d.documentElement.removeEventListener(re,Ee),E[Y].rootEvents=void 0),xu&&(p.documentElement.addEventListener(re,He),E[Y].rootEvents=He)});let Es=E[Y].stateOwnersUpdateHandlers;if(Es&&Fl&&(Array.isArray(Es)?Es:[Es]).forEach(pe=>{typeof pe=="function"&&pe()}),Pu){let re=dv.map(pe=>pe(He,p)).filter(pe=>typeof pe=="function");E[Y].stateOwnersUpdateHandlers=re.length===1?re[0]:re}else Fl&&(E[Y].stateOwnersUpdateHandlers=void 0)}),Object.entries(p).forEach(([Y,Bo])=>{d[Y]=Bo}),g(),p=void 0};return T({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(f){let{type:b,detail:S}=f;if(o[b]&&m.mediaErrorCode==null){h(o[b](r,d,f));return}b==="mediaelementchangerequest"?T({media:S}):b==="fullscreenelementchangerequest"?T({fullscreenElement:S}):b==="documentelementchangerequest"?T({documentElement:S}):b==="optionschangerequest"&&(Object.entries(S??{}).forEach(([te,Se])=>{d.options[te]=Se}),g())},getState(){return m},subscribe(f){return T({},l.length+1),l.push(f),f(m),()=>{let b=l.indexOf(f);b>=0&&(T({},l.length-1),l.splice(b,1))}}}};var Ud=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},M=(i,e,t)=>(Ud(i,e,"read from private field"),t?t.call(i):e.get(i)),ze=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ht=(i,e,t,r)=>(Ud(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),mt=(i,e,t)=>(Ud(i,e,"access private method"),t),oi,En,V,zi,gn,pt,ia,bn,ra,xd,Yi,Hr,oa,Pd,Dd,Xh,Jh=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],Kh=10,Gh=.025,zh=.25,vf=.25,ff=2,A={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},Od=class extends Vi{constructor(){super(),ze(this,ra),ze(this,Yi),ze(this,oa),ze(this,Dd),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,ze(this,oi,new ri(this,A.HOTKEYS)),ze(this,En,void 0),ze(this,V,void 0),ze(this,zi,null),ze(this,gn,void 0),ze(this,pt,void 0),ze(this,ia,t=>{var r;(r=M(this,V))==null||r.dispatch(t)}),ze(this,bn,void 0),this.associateElement(this);let e={};ht(this,gn,t=>{Object.entries(t).forEach(([r,o])=>{if(r in e&&e[r]===o)return;this.propagateMediaState(r,o);let n=r.toLowerCase(),s=new c.CustomEvent(lh[n],{composed:!0,detail:o});this.dispatchEvent(s)}),e=t}),this.hasAttribute(A.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(A.NO_HOTKEYS,A.HOTKEYS,A.DEFAULT_STREAM_TYPE,A.DEFAULT_SUBTITLES,A.DEFAULT_DURATION,A.NO_MUTED_PREF,A.NO_VOLUME_PREF,A.LANG,A.LOOP)}get mediaStore(){return M(this,V)}set mediaStore(e){var t,r;if(M(this,V)&&((t=M(this,pt))==null||t.call(this),ht(this,pt,void 0)),ht(this,V,e),!M(this,V)&&!this.hasAttribute(A.NO_DEFAULT_STORE)){mt(this,ra,xd).call(this);return}ht(this,pt,(r=M(this,V))==null?void 0:r.subscribe(M(this,gn)))}get fullscreenElement(){var e;return(e=M(this,En))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(A.FULLSCREEN_ELEMENT)&&this.removeAttribute(A.FULLSCREEN_ELEMENT),ht(this,En,e),(t=M(this,V))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return C(this,A.DEFAULT_SUBTITLES)}set defaultSubtitles(e){R(this,A.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return D(this,A.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){O(this,A.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return H(this,A.DEFAULT_DURATION)}set defaultDuration(e){B(this,A.DEFAULT_DURATION,e)}get noHotkeys(){return C(this,A.NO_HOTKEYS)}set noHotkeys(e){R(this,A.NO_HOTKEYS,e)}get keysUsed(){return D(this,A.KEYS_USED)}set keysUsed(e){O(this,A.KEYS_USED,e)}get liveEdgeOffset(){return H(this,A.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){B(this,A.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return C(this,A.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){R(this,A.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return C(this,A.NO_VOLUME_PREF)}set noVolumePref(e){R(this,A.NO_VOLUME_PREF,e)}get noMutedPref(){return C(this,A.NO_MUTED_PREF)}set noMutedPref(e){R(this,A.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return C(this,A.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){R(this,A.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return C(this,A.NO_DEFAULT_STORE)}set noDefaultStore(e){R(this,A.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var o,n,s,l,d,m,h,g,E,p,T,f;if(super.attributeChangedCallback(e,t,r),e===A.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(A.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):r!==t&&r===null&&this.enableHotkeys();else if(e===A.HOTKEYS)M(this,oi).value=r;else if(e===A.DEFAULT_SUBTITLES&&r!==t)(o=M(this,V))==null||o.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(A.DEFAULT_SUBTITLES)}});else if(e===A.DEFAULT_STREAM_TYPE)(s=M(this,V))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(A.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===A.LIVE_EDGE_OFFSET)(l=M(this,V))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(A.LIVE_EDGE_OFFSET)}});else if(e===A.SEEK_TO_LIVE_OFFSET)(d=M(this,V))==null||d.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(A.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===A.NO_AUTO_SEEK_TO_LIVE)(m=M(this,V))==null||m.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(A.NO_AUTO_SEEK_TO_LIVE)}});else if(e===A.FULLSCREEN_ELEMENT){let b=r?(h=this.getRootNode())==null?void 0:h.getElementById(r):void 0;ht(this,En,b),(g=M(this,V))==null||g.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===A.LANG&&r!==t?(Eh(r),(E=M(this,V))==null||E.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===A.LOOP&&r!==t?(p=M(this,V))==null||p.dispatch({type:y.MEDIA_LOOP_REQUEST,detail:r!=null}):e===A.NO_VOLUME_PREF&&r!==t?(T=M(this,V))==null||T.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(A.NO_VOLUME_PREF)}}):e===A.NO_MUTED_PREF&&r!==t&&((f=M(this,V))==null||f.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(A.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!M(this,V)&&!this.hasAttribute(A.NO_DEFAULT_STORE)&&mt(this,ra,xd).call(this),(e=M(this,V))==null||e.dispatch({type:"documentelementchangerequest",detail:ee}),super.connectedCallback(),M(this,V)&&!M(this,pt)&&ht(this,pt,(t=M(this,V))==null?void 0:t.subscribe(M(this,gn))),M(this,bn)!==void 0&&M(this,V)&&this.media&&setTimeout(()=>{var r,o,n;(o=(r=this.media)==null?void 0:r.textTracks)!=null&&o.length&&((n=M(this,V))==null||n.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:M(this,bn)}))},0),this.hasAttribute(A.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,o,n;if((e=super.disconnectedCallback)==null||e.call(this),M(this,V)){let s=M(this,V).getState();ht(this,bn,!!((t=s.mediaSubtitlesShowing)!=null&&t.length)),(r=M(this,V))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(o=M(this,V))==null||o.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}M(this,pt)&&((n=M(this,pt))==null||n.call(this),ht(this,pt,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=M(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=M(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){Zh(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),o=this.unregisterMediaStateReceiver.bind(this),n=Tf(e,r,o);Object.values(y).forEach(s=>{e.addEventListener(s,M(this,ia))}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(y).forEach(o=>{e.removeEventListener(o,M(this,ia))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),M(this,V)&&Object.entries(M(this,V).getState()).forEach(([o,n])=>{Zh([e],o,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",mt(this,oa,Pd))}disableHotkeys(){this.removeEventListener("keydown",mt(this,oa,Pd)),this.removeEventListener("keyup",mt(this,Yi,Hr))}get hotkeys(){return D(this,A.HOTKEYS)}set hotkeys(e){O(this,A.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,o,n,s,l,d,m,h;let g=e.target;if(((o=(r=(t=g.getAttribute(A.KEYS_USED))==null?void 0:t.split(" "))!=null?r:g==null?void 0:g.keysUsed)!=null?o:[]).map(S=>S==="Space"?" ":S).filter(Boolean).includes(e.key))return;let p,T,f;if(!(M(this,oi).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&M(this,oi).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&M(this,oi).contains("noshift+/")))switch(e.key){case" ":case"k":p=M(this,V).getState().mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new c.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"m":p=this.mediaStore.getState().mediaVolumeLevel==="off"?y.MEDIA_UNMUTE_REQUEST:y.MEDIA_MUTE_REQUEST,this.dispatchEvent(new c.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"f":p=this.mediaStore.getState().mediaIsFullscreen?y.MEDIA_EXIT_FULLSCREEN_REQUEST:y.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new c.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new c.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let S=this.hasAttribute(A.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(A.KEYBOARD_BACKWARD_SEEK_OFFSET):Kh;T=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-S,0),f=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"ArrowRight":case"l":{let S=this.hasAttribute(A.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(A.KEYBOARD_FORWARD_SEEK_OFFSET):Kh;T=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+S,0),f=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"ArrowUp":{let S=this.hasAttribute(A.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(A.KEYBOARD_UP_VOLUME_STEP):Gh;T=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+S,1),f=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"ArrowDown":{let S=this.hasAttribute(A.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(A.KEYBOARD_DOWN_VOLUME_STEP):Gh;T=Math.max(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)-S,0),f=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"<":{let S=(m=this.mediaStore.getState().mediaPlaybackRate)!=null?m:1;T=Math.max(S-zh,vf).toFixed(2),f=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case">":{let S=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;T=Math.min(S+zh,ff).toFixed(2),f=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"/":case"?":{e.shiftKey&&mt(this,Dd,Xh).call(this);break}case"p":{p=this.mediaStore.getState().mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST,f=new c.CustomEvent(p,{composed:!0,bubbles:!0}),this.dispatchEvent(f);break}default:break}}};oi=new WeakMap;En=new WeakMap;V=new WeakMap;zi=new WeakMap;gn=new WeakMap;pt=new WeakMap;ia=new WeakMap;bn=new WeakMap;ra=new WeakSet;xd=function(){var i;this.mediaStore=qh({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(A.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(A.DEFAULT_DURATION)?+this.getAttribute(A.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(A.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(A.SEEK_TO_LIVE_OFFSET):this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(A.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(A.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(A.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(A.NO_SUBTITLES_LANG_PREF)}})};Yi=new WeakSet;Hr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||Jh.includes(e))){this.removeEventListener("keyup",mt(this,Yi,Hr));return}this.keyboardShortcutHandler(i)};oa=new WeakSet;Pd=function(i){var e;let{metaKey:t,altKey:r,key:o,shiftKey:n}=i,s=n&&(o==="/"||o==="?");if(s&&((e=M(this,zi))!=null&&e.open)){this.removeEventListener("keyup",mt(this,Yi,Hr));return}if(t||r||!s&&!Jh.includes(o)){this.removeEventListener("keyup",mt(this,Yi,Hr));return}let l=i.target,d=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(o)&&!(M(this,oi).contains(`no${o.toLowerCase()}`)||o===" "&&M(this,oi).contains("nospace"))&&!d&&i.preventDefault(),this.addEventListener("keyup",mt(this,Yi,Hr),{once:!0})};Dd=new WeakSet;Xh=function(){M(this,zi)||(ht(this,zi,ee.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(M(this,zi))),M(this,zi).open=!0};var Ef=Object.values(a),gf=Object.values(Ed),jh=i=>{var e,t,r,o;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(c.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(o=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,N.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:o.call(r,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>Ef.includes(l)):[]},bf=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&c.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof c.customElements.get(i.nodeName.toLowerCase()))&&c.customElements.upgrade(i),gf.some(r=>r in i)},Nd=i=>bf(i)||!!jh(i).length,Yh=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Qh={[a.MEDIA_SUBTITLES_LIST]:$t,[a.MEDIA_SUBTITLES_SHOWING]:$t,[a.MEDIA_SEEKABLE]:Yh,[a.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Yh).join(" "),[a.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[a.MEDIA_RENDITION_LIST]:ch,[a.MEDIA_AUDIO_TRACK_LIST]:hh},_f=async(i,e,t)=>{var r,o;if(i.isConnected||await Ps(0),typeof t=="boolean"||t==null)return R(i,e,t);if(typeof t=="number")return B(i,e,t);if(typeof t=="string")return O(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(o=(r=Qh[e])==null?void 0:r.call(Qh,t))!=null?o:t;return i.setAttribute(e,n)},yf=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Gi=(i,e)=>{if(yf(i))return;let t=(o,n)=>{var s,l;Nd(o)&&n(o);let{children:d=[]}=o??{},m=(l=(s=o==null?void 0:o.shadowRoot)==null?void 0:s.children)!=null?l:[];[...d,...m].forEach(g=>Gi(g,n))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!Nd(i)){c.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},Zh=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let o=jh(r),n=e.toLowerCase();o.includes(n)&&_f(r,n,t)})},Tf=(i,e,t)=>{Gi(i,e);let r=h=>{var g;let E=(g=h==null?void 0:h.composedPath()[0])!=null?g:h.target;e(E)},o=h=>{var g;let E=(g=h==null?void 0:h.composedPath()[0])!=null?g:h.target;t(E)};i.addEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,o);let n=h=>{h.forEach(g=>{let{addedNodes:E=[],removedNodes:p=[],type:T,target:f,attributeName:b}=g;T==="childList"?(Array.prototype.forEach.call(E,S=>Gi(S,e)),Array.prototype.forEach.call(p,S=>Gi(S,t))):T==="attributes"&&b===N.MEDIA_CHROME_ATTRIBUTES&&(Nd(f)?e(f):t(f))})},s=[],l=h=>{let g=h.target;g.name!=="media"&&(s.forEach(E=>Gi(E,t)),s=[...g.assignedElements({flatten:!0})],s.forEach(E=>Gi(E,e)))};i.addEventListener("slotchange",l);let d=new MutationObserver(n);return d.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Gi(i,t),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};c.customElements.get("media-controller")||c.customElements.define("media-controller",Od);var $r={PLACEMENT:"placement",BOUNDS:"bounds"};function Af(i){return`
395
395
  <style>
396
396
  :host {
397
397
  --_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
@@ -500,7 +500,7 @@ bp-player[has-error] {
500
500
  </style>
501
501
  <slot></slot>
502
502
  <div id="arrow"></div>
503
- `}var Br=class extends c.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Ha(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let r=getComputedStyle(this),o=(e=ut(this,"#"+this.bounds))!=null?e:X(this);if(!o)return;let{x:n,width:a}=o.getBoundingClientRect(),{x:l,width:d}=this.getBoundingClientRect(),m=l+d,h=n+a,g=r.getPropertyValue("--media-tooltip-offset-x"),E=g?parseFloat(g.replace("px","")):0,p=r.getPropertyValue("--media-tooltip-container-margin"),T=p?parseFloat(p.replace("px","")):0,f=l-n+E-T,b=m-h+E+T;if(f<0){this.style.setProperty("--media-tooltip-offset-x",`${f}px`);return}if(b>0){this.style.setProperty("--media-tooltip-offset-x",`${b}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[$r.PLACEMENT,$r.BOUNDS]}get placement(){return D(this,$r.PLACEMENT)}set placement(e){O(this,$r.PLACEMENT,e)}get bounds(){return D(this,$r.BOUNDS)}set bounds(e){O(this,$r.BOUNDS,e)}};Br.shadowRootOptions={mode:"open"};Br.getTemplateHTML=gf;c.customElements.get("media-tooltip")||c.customElements.define("media-tooltip",Br);var rs=Br;var Od=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},me=(i,e,t)=>(Od(i,e,"read from private field"),t?t.call(i):e.get(i)),Vr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},os=(i,e,t,r)=>(Od(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),bf=(i,e,t)=>(Od(i,e,"access private method"),t),vt,Fr,ai,Wr,ns,Dd,Qh,ni={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function _f(i,e={}){return`
503
+ `}var Br=class extends c.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Bs(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let r=getComputedStyle(this),o=(e=ut(this,"#"+this.bounds))!=null?e:X(this);if(!o)return;let{x:n,width:s}=o.getBoundingClientRect(),{x:l,width:d}=this.getBoundingClientRect(),m=l+d,h=n+s,g=r.getPropertyValue("--media-tooltip-offset-x"),E=g?parseFloat(g.replace("px","")):0,p=r.getPropertyValue("--media-tooltip-container-margin"),T=p?parseFloat(p.replace("px","")):0,f=l-n+E-T,b=m-h+E+T;if(f<0){this.style.setProperty("--media-tooltip-offset-x",`${f}px`);return}if(b>0){this.style.setProperty("--media-tooltip-offset-x",`${b}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[$r.PLACEMENT,$r.BOUNDS]}get placement(){return D(this,$r.PLACEMENT)}set placement(e){O(this,$r.PLACEMENT,e)}get bounds(){return D(this,$r.BOUNDS)}set bounds(e){O(this,$r.BOUNDS,e)}};Br.shadowRootOptions={mode:"open"};Br.getTemplateHTML=Af;c.customElements.get("media-tooltip")||c.customElements.define("media-tooltip",Br);var na=Br;var $d=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},me=(i,e,t)=>($d(i,e,"read from private field"),t?t.call(i):e.get(i)),Vr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},sa=(i,e,t,r)=>($d(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Sf=(i,e,t)=>($d(i,e,"access private method"),t),vt,Fr,si,Wr,aa,Hd,ep,ni={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function kf(i,e={}){return`
504
504
  <style>
505
505
  :host {
506
506
  position: relative;
@@ -574,48 +574,48 @@ bp-player[has-error] {
574
574
 
575
575
  <slot name="tooltip">
576
576
  <media-tooltip part="tooltip" aria-hidden="true">
577
- <template shadowrootmode="${rs.shadowRootOptions.mode}">
578
- ${rs.getTemplateHTML({})}
577
+ <template shadowrootmode="${na.shadowRootOptions.mode}">
578
+ ${na.getTemplateHTML({})}
579
579
  </template>
580
580
  <slot name="tooltip-content">
581
581
  ${this.getTooltipContentHTML(i)}
582
582
  </slot>
583
583
  </media-tooltip>
584
584
  </slot>
585
- `}function yf(i,e){return`
585
+ `}function Lf(i,e){return`
586
586
  <slot></slot>
587
- `}function Tf(){return""}var F=class extends c.HTMLElement{constructor(){if(super(),Vr(this,Dd),Vr(this,vt,void 0),this.preventClick=!1,this.tooltipEl=null,Vr(this,Fr,e=>{this.preventClick||this.handleClick(e),setTimeout(me(this,ai),0)}),Vr(this,ai,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),Vr(this,Wr,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",me(this,Wr));return}this.preventClick||this.handleClick(e)}),Vr(this,ns,e=>{let{metaKey:t,altKey:r,key:o}=e;if(t||r||!this.keysUsed.includes(o)){this.removeEventListener("keyup",me(this,Wr));return}this.addEventListener("keyup",me(this,Wr),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",ni.TOOLTIP_PLACEMENT,N.MEDIA_CONTROLLER,s.MEDIA_LANG]}enable(){this.addEventListener("click",me(this,Fr)),this.addEventListener("keydown",me(this,ns)),this.tabIndex=0}disable(){this.removeEventListener("click",me(this,Fr)),this.removeEventListener("keydown",me(this,ns)),this.removeEventListener("keyup",me(this,Wr)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER?(t&&((n=(o=me(this,vt))==null?void 0:o.unassociateElement)==null||n.call(o,this),os(this,vt,null)),r&&this.isConnected&&(os(this,vt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=me(this,vt))==null?void 0:l.associateElement)==null||d.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===ni.TOOLTIP_PLACEMENT&&this.tooltipEl&&r!==t?this.tooltipEl.placement=r:e===s.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),me(this,ai).call(this)}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(os(this,vt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=me(this,vt))==null?void 0:t.associateElement)==null||r.call(t,this)),c.customElements.whenDefined("media-tooltip").then(()=>bf(this,Dd,Qh).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=me(this,vt))==null?void 0:e.unassociateElement)==null||t.call(e,this),os(this,vt,null),this.removeEventListener("mouseenter",me(this,ai)),this.removeEventListener("focus",me(this,ai)),this.removeEventListener("click",me(this,Fr))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return D(this,ni.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){O(this,ni.TOOLTIP_PLACEMENT,e)}get mediaController(){return D(this,N.MEDIA_CONTROLLER)}set mediaController(e){O(this,N.MEDIA_CONTROLLER,e)}get disabled(){return w(this,ni.DISABLED)}set disabled(e){M(this,ni.DISABLED,e)}get noTooltip(){return w(this,ni.NO_TOOLTIP)}set noTooltip(e){M(this,ni.NO_TOOLTIP,e)}handleClick(e){}};vt=new WeakMap;Fr=new WeakMap;ai=new WeakMap;Wr=new WeakMap;ns=new WeakMap;Dd=new WeakSet;Qh=function(){this.addEventListener("mouseenter",me(this,ai)),this.addEventListener("focus",me(this,ai)),this.addEventListener("click",me(this,Fr));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};F.shadowRootOptions={mode:"open"};F.getTemplateHTML=_f;F.getSlotTemplateHTML=yf;F.getTooltipContentHTML=Tf;c.customElements.get("media-chrome-button")||c.customElements.define("media-chrome-button",F);var Zh=`<svg aria-hidden="true" viewBox="0 0 26 24">
587
+ `}function If(){return""}var F=class extends c.HTMLElement{constructor(){if(super(),Vr(this,Hd),Vr(this,vt,void 0),this.preventClick=!1,this.tooltipEl=null,Vr(this,Fr,e=>{this.preventClick||this.handleClick(e),setTimeout(me(this,si),0)}),Vr(this,si,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),Vr(this,Wr,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",me(this,Wr));return}this.preventClick||this.handleClick(e)}),Vr(this,aa,e=>{let{metaKey:t,altKey:r,key:o}=e;if(t||r||!this.keysUsed.includes(o)){this.removeEventListener("keyup",me(this,Wr));return}this.addEventListener("keyup",me(this,Wr),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",ni.TOOLTIP_PLACEMENT,N.MEDIA_CONTROLLER,a.MEDIA_LANG]}enable(){this.addEventListener("click",me(this,Fr)),this.addEventListener("keydown",me(this,aa)),this.tabIndex=0}disable(){this.removeEventListener("click",me(this,Fr)),this.removeEventListener("keydown",me(this,aa)),this.removeEventListener("keyup",me(this,Wr)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var o,n,s,l,d;e===N.MEDIA_CONTROLLER?(t&&((n=(o=me(this,vt))==null?void 0:o.unassociateElement)==null||n.call(o,this),sa(this,vt,null)),r&&this.isConnected&&(sa(this,vt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=me(this,vt))==null?void 0:l.associateElement)==null||d.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===ni.TOOLTIP_PLACEMENT&&this.tooltipEl&&r!==t?this.tooltipEl.placement=r:e===a.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),me(this,si).call(this)}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(sa(this,vt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=me(this,vt))==null?void 0:t.associateElement)==null||r.call(t,this)),c.customElements.whenDefined("media-tooltip").then(()=>Sf(this,Hd,ep).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=me(this,vt))==null?void 0:e.unassociateElement)==null||t.call(e,this),sa(this,vt,null),this.removeEventListener("mouseenter",me(this,si)),this.removeEventListener("focus",me(this,si)),this.removeEventListener("click",me(this,Fr))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return D(this,ni.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){O(this,ni.TOOLTIP_PLACEMENT,e)}get mediaController(){return D(this,N.MEDIA_CONTROLLER)}set mediaController(e){O(this,N.MEDIA_CONTROLLER,e)}get disabled(){return C(this,ni.DISABLED)}set disabled(e){R(this,ni.DISABLED,e)}get noTooltip(){return C(this,ni.NO_TOOLTIP)}set noTooltip(e){R(this,ni.NO_TOOLTIP,e)}handleClick(e){}};vt=new WeakMap;Fr=new WeakMap;si=new WeakMap;Wr=new WeakMap;aa=new WeakMap;Hd=new WeakSet;ep=function(){this.addEventListener("mouseenter",me(this,si)),this.addEventListener("focus",me(this,si)),this.addEventListener("click",me(this,Fr));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};F.shadowRootOptions={mode:"open"};F.getTemplateHTML=kf;F.getSlotTemplateHTML=Lf;F.getTooltipContentHTML=If;c.customElements.get("media-chrome-button")||c.customElements.define("media-chrome-button",F);var tp=`<svg aria-hidden="true" viewBox="0 0 26 24">
588
588
  <path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
589
589
  </svg>
590
- `;function Af(i){return`
590
+ `;function wf(i){return`
591
591
  <style>
592
- :host([${s.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
592
+ :host([${a.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
593
593
  display: none !important;
594
594
  }
595
595
 
596
596
 
597
- :host(:not([${s.MEDIA_IS_AIRPLAYING}])) slot[name=icon] slot:not([name=enter]) {
597
+ :host(:not([${a.MEDIA_IS_AIRPLAYING}])) slot[name=icon] slot:not([name=enter]) {
598
598
  display: none !important;
599
599
  }
600
600
 
601
- :host([${s.MEDIA_IS_AIRPLAYING}]) slot[name=tooltip-enter],
602
- :host(:not([${s.MEDIA_IS_AIRPLAYING}])) slot[name=tooltip-exit] {
601
+ :host([${a.MEDIA_IS_AIRPLAYING}]) slot[name=tooltip-enter],
602
+ :host(:not([${a.MEDIA_IS_AIRPLAYING}])) slot[name=tooltip-exit] {
603
603
  display: none;
604
604
  }
605
605
  </style>
606
606
 
607
607
  <slot name="icon">
608
- <slot name="enter">${Zh}</slot>
609
- <slot name="exit">${Zh}</slot>
608
+ <slot name="enter">${tp}</slot>
609
+ <slot name="exit">${tp}</slot>
610
610
  </slot>
611
- `}function Sf(){return`
611
+ `}function Cf(){return`
612
612
  <slot name="tooltip-enter">${_("start airplay")}</slot>
613
613
  <slot name="tooltip-exit">${_("stop airplay")}</slot>
614
- `}var Xh=i=>{let e=i.mediaIsAirplaying?_("stop airplay"):_("start airplay");i.setAttribute("aria-label",e)},gn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_AIRPLAYING,s.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Xh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_AIRPLAYING&&Xh(this)}get mediaIsAirplaying(){return w(this,s.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){M(this,s.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return D(this,s.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){O(this,s.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new c.CustomEvent(y.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};gn.getSlotTemplateHTML=Af;gn.getTooltipContentHTML=Sf;c.customElements.get("media-airplay-button")||c.customElements.define("media-airplay-button",gn);var kf=`<svg aria-hidden="true" viewBox="0 0 26 24">
614
+ `}var ip=i=>{let e=i.mediaIsAirplaying?_("stop airplay"):_("start airplay");i.setAttribute("aria-label",e)},_n=class extends F{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_AIRPLAYING,a.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),ip(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_AIRPLAYING&&ip(this)}get mediaIsAirplaying(){return C(this,a.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){R(this,a.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return D(this,a.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){O(this,a.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new c.CustomEvent(y.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};_n.getSlotTemplateHTML=wf;_n.getTooltipContentHTML=Cf;c.customElements.get("media-airplay-button")||c.customElements.define("media-airplay-button",_n);var Rf=`<svg aria-hidden="true" viewBox="0 0 26 24">
615
615
  <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
616
- </svg>`,Lf=`<svg aria-hidden="true" viewBox="0 0 26 24">
616
+ </svg>`,Mf=`<svg aria-hidden="true" viewBox="0 0 26 24">
617
617
  <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
618
- </svg>`;function Cf(i){return`
618
+ </svg>`;function xf(i){return`
619
619
  <style>
620
620
  :host([aria-checked="true"]) slot[name=off] {
621
621
  display: none !important;
@@ -633,37 +633,37 @@ bp-player[has-error] {
633
633
  </style>
634
634
 
635
635
  <slot name="icon">
636
- <slot name="on">${kf}</slot>
637
- <slot name="off">${Lf}</slot>
636
+ <slot name="on">${Rf}</slot>
637
+ <slot name="off">${Mf}</slot>
638
638
  </slot>
639
- `}function If(){return`
639
+ `}function Pf(){return`
640
640
  <slot name="tooltip-enable">${_("Enable captions")}</slot>
641
641
  <slot name="tooltip-disable">${_("Disable captions")}</slot>
642
- `}var Jh=i=>{i.setAttribute("aria-checked",Qa(i).toString())},bn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",_("closed captions")),Jh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING&&Jh(this)}get mediaSubtitlesList(){return jh(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){ep(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return jh(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){ep(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new c.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};bn.getSlotTemplateHTML=Cf;bn.getTooltipContentHTML=If;var jh=(i,e)=>{let t=i.getAttribute(e);return t?Fi(t):[]},ep=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=$t(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-button")||c.customElements.define("media-captions-button",bn);var wf='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',Mf='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>';function Rf(i){return`
642
+ `}var rp=i=>{i.setAttribute("aria-checked",Xs(i).toString())},yn=class extends F{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",_("closed captions")),rp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING&&rp(this)}get mediaSubtitlesList(){return op(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){np(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return op(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){np(this,a.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new c.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};yn.getSlotTemplateHTML=xf;yn.getTooltipContentHTML=Pf;var op=(i,e)=>{let t=i.getAttribute(e);return t?Fi(t):[]},np=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=$t(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-button")||c.customElements.define("media-captions-button",yn);var Df='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',Of='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>';function Nf(i){return`
643
643
  <style>
644
- :host([${s.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
644
+ :host([${a.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
645
645
  display: none !important;
646
646
  }
647
647
 
648
648
 
649
- :host(:not([${s.MEDIA_IS_CASTING}])) slot[name=icon] slot:not([name=enter]) {
649
+ :host(:not([${a.MEDIA_IS_CASTING}])) slot[name=icon] slot:not([name=enter]) {
650
650
  display: none !important;
651
651
  }
652
652
 
653
- :host([${s.MEDIA_IS_CASTING}]) slot[name=tooltip-enter],
654
- :host(:not([${s.MEDIA_IS_CASTING}])) slot[name=tooltip-exit] {
653
+ :host([${a.MEDIA_IS_CASTING}]) slot[name=tooltip-enter],
654
+ :host(:not([${a.MEDIA_IS_CASTING}])) slot[name=tooltip-exit] {
655
655
  display: none;
656
656
  }
657
657
  </style>
658
658
 
659
659
  <slot name="icon">
660
- <slot name="enter">${wf}</slot>
661
- <slot name="exit">${Mf}</slot>
660
+ <slot name="enter">${Df}</slot>
661
+ <slot name="exit">${Of}</slot>
662
662
  </slot>
663
- `}function xf(){return`
663
+ `}function Uf(){return`
664
664
  <slot name="tooltip-enter">${_("Start casting")}</slot>
665
665
  <slot name="tooltip-exit">${_("Stop casting")}</slot>
666
- `}var tp=i=>{let e=i.mediaIsCasting?_("stop casting"):_("start casting");i.setAttribute("aria-label",e)},_n=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),tp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_CASTING&&tp(this)}get mediaIsCasting(){return w(this,s.MEDIA_IS_CASTING)}set mediaIsCasting(e){M(this,s.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return D(this,s.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){O(this,s.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?y.MEDIA_EXIT_CAST_REQUEST:y.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};_n.getSlotTemplateHTML=Rf;_n.getTooltipContentHTML=xf;c.customElements.get("media-cast-button")||c.customElements.define("media-cast-button",_n);var Wd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Zi=(i,e,t)=>(Wd(i,e,"read from private field"),t?t.call(i):e.get(i)),Bt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Fd=(i,e,t,r)=>(Wd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Qi=(i,e,t)=>(Wd(i,e,"access private method"),t),ss,Tn,Xi,as,Nd,Ud,ip,Hd,rp,$d,op,Bd,np,Vd,ap;function Pf(i){return`
666
+ `}var sp=i=>{let e=i.mediaIsCasting?_("stop casting"):_("start casting");i.setAttribute("aria-label",e)},Tn=class extends F{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_CASTING,a.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),sp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_CASTING&&sp(this)}get mediaIsCasting(){return C(this,a.MEDIA_IS_CASTING)}set mediaIsCasting(e){R(this,a.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return D(this,a.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){O(this,a.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?y.MEDIA_EXIT_CAST_REQUEST:y.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Tn.getSlotTemplateHTML=Nf;Tn.getTooltipContentHTML=Uf;c.customElements.get("media-cast-button")||c.customElements.define("media-cast-button",Tn);var Gd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Zi=(i,e,t)=>(Gd(i,e,"read from private field"),t?t.call(i):e.get(i)),Bt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},zd=(i,e,t,r)=>(Gd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Qi=(i,e,t)=>(Gd(i,e,"access private method"),t),da,Sn,Xi,la,Bd,Vd,ap,Wd,lp,Fd,dp,qd,cp,Kd,up;function Hf(i){return`
667
667
  <style>
668
668
  :host {
669
669
  font: var(--media-font,
@@ -704,9 +704,9 @@ bp-player[has-error] {
704
704
  }
705
705
  </style>
706
706
  ${this.getSlotTemplateHTML(i)}
707
- `}function Df(i){return`
707
+ `}function $f(i){return`
708
708
  <slot id="content"></slot>
709
- `}var yn={OPEN:"open",ANCHOR:"anchor"},ft=class extends c.HTMLElement{constructor(){super(),Bt(this,as),Bt(this,Ud),Bt(this,Hd),Bt(this,$d),Bt(this,Bd),Bt(this,Vd),Bt(this,ss,!1),Bt(this,Tn,null),Bt(this,Xi,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[yn.OPEN,yn.ANCHOR]}get open(){return w(this,yn.OPEN)}set open(e){M(this,yn.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":Qi(this,$d,op).call(this,e);break;case"focusout":Qi(this,Bd,np).call(this,e);break;case"keydown":Qi(this,Vd,ap).call(this,e);break}}connectedCallback(){Qi(this,as,Nd).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){Qi(this,as,Nd).call(this),e===yn.OPEN&&r!==t&&(this.open?Qi(this,Ud,ip).call(this):Qi(this,Hd,rp).call(this))}focus(){Fd(this,Tn,sn());let e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),t=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||t)return;let r=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');r==null||r.focus()}get keysUsed(){return["Escape","Tab"]}};ss=new WeakMap;Tn=new WeakMap;Xi=new WeakMap;as=new WeakSet;Nd=function(){if(!Zi(this,ss)&&(Fd(this,ss,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=J(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};Ud=new WeakSet;ip=function(){var i;(i=Zi(this,Xi))==null||i.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};Hd=new WeakSet;rp=function(){var i;(i=Zi(this,Xi))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};$d=new WeakSet;op=function(i){Fd(this,Xi,i.relatedTarget),Ce(this,i.relatedTarget)||(this.open=!this.open)};Bd=new WeakSet;np=function(i){var e;Ce(this,i.relatedTarget)||((e=Zi(this,Tn))==null||e.focus(),Zi(this,Xi)&&Zi(this,Xi)!==i.relatedTarget&&this.open&&(this.open=!1))};Vd=new WeakSet;ap=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:d,metaKey:m}=i;l||d||m||this.keysUsed.includes(a)&&(i.preventDefault(),i.stopPropagation(),a==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()):a==="Escape"&&((n=Zi(this,Tn))==null||n.focus(),this.open=!1))};ft.shadowRootOptions={mode:"open"};ft.getTemplateHTML=Pf;ft.getSlotTemplateHTML=Df;c.customElements.get("media-chrome-dialog")||c.customElements.define("media-chrome-dialog",ft);var Zd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},se=(i,e,t)=>(Zd(i,e,"read from private field"),t?t.call(i):e.get(i)),Te=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},si=(i,e,t,r)=>(Zd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),rt=(i,e,t)=>(Zd(i,e,"access private method"),t),Et,Es,ls,ds,ot,vs,cs,us,hs,Xd,sp,ps,Kd,ms,Gd,fs,Jd,qd,lp,zd,dp,Yd,cp,Qd,up;function Of(i){return`
709
+ `}var An={OPEN:"open",ANCHOR:"anchor"},ft=class extends c.HTMLElement{constructor(){super(),Bt(this,la),Bt(this,Vd),Bt(this,Wd),Bt(this,Fd),Bt(this,qd),Bt(this,Kd),Bt(this,da,!1),Bt(this,Sn,null),Bt(this,Xi,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[An.OPEN,An.ANCHOR]}get open(){return C(this,An.OPEN)}set open(e){R(this,An.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":Qi(this,Fd,dp).call(this,e);break;case"focusout":Qi(this,qd,cp).call(this,e);break;case"keydown":Qi(this,Kd,up).call(this,e);break}}connectedCallback(){Qi(this,la,Bd).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){Qi(this,la,Bd).call(this),e===An.OPEN&&r!==t&&(this.open?Qi(this,Vd,ap).call(this):Qi(this,Wd,lp).call(this))}focus(){zd(this,Sn,dn());let e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),t=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||t)return;let r=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');r==null||r.focus()}get keysUsed(){return["Escape","Tab"]}};da=new WeakMap;Sn=new WeakMap;Xi=new WeakMap;la=new WeakSet;Bd=function(){if(!Zi(this,da)&&(zd(this,da,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=J(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};Vd=new WeakSet;ap=function(){var i;(i=Zi(this,Xi))==null||i.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};Wd=new WeakSet;lp=function(){var i;(i=Zi(this,Xi))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};Fd=new WeakSet;dp=function(i){zd(this,Xi,i.relatedTarget),Ie(this,i.relatedTarget)||(this.open=!this.open)};qd=new WeakSet;cp=function(i){var e;Ie(this,i.relatedTarget)||((e=Zi(this,Sn))==null||e.focus(),Zi(this,Xi)&&Zi(this,Xi)!==i.relatedTarget&&this.open&&(this.open=!1))};Kd=new WeakSet;up=function(i){var e,t,r,o,n;let{key:s,ctrlKey:l,altKey:d,metaKey:m}=i;l||d||m||this.keysUsed.includes(s)&&(i.preventDefault(),i.stopPropagation(),s==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()):s==="Escape"&&((n=Zi(this,Sn))==null||n.focus(),this.open=!1))};ft.shadowRootOptions={mode:"open"};ft.getTemplateHTML=Hf;ft.getSlotTemplateHTML=$f;c.customElements.get("media-chrome-dialog")||c.customElements.define("media-chrome-dialog",ft);var ec=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ae=(i,e,t)=>(ec(i,e,"read from private field"),t?t.call(i):e.get(i)),Te=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ai=(i,e,t,r)=>(ec(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),rt=(i,e,t)=>(ec(i,e,"access private method"),t),Et,ba,ca,ua,ot,Ea,ha,pa,ma,tc,hp,va,Yd,fa,Qd,ga,ic,Zd,pp,Xd,mp,Jd,vp,jd,fp;function Bf(i){return`
710
710
  <style>
711
711
  :host {
712
712
  --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
@@ -936,7 +936,7 @@ bp-player[has-error] {
936
936
  ${this.getContainerTemplateHTML(i)}
937
937
  </div>
938
938
  <div id="rightgap"></div>
939
- `}function Nf(i){return""}var gt=class extends c.HTMLElement{constructor(){if(super(),Te(this,Xd),Te(this,ps),Te(this,ms),Te(this,fs),Te(this,qd),Te(this,zd),Te(this,Yd),Te(this,Qd),Te(this,Et,void 0),Te(this,Es,void 0),Te(this,ls,void 0),Te(this,ds,void 0),Te(this,ot,{}),Te(this,vs,[]),Te(this,cs,()=>{if(this.range.matches(":focus-visible")){let{style:e}=J(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),Te(this,us,()=>{let{style:e}=J(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),Te(this,hs,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector("#container"),si(this,ls,this.shadowRoot.querySelector("#startpoint")),si(this,ds,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER?(t&&((n=(o=se(this,Et))==null?void 0:o.unassociateElement)==null||n.call(o,this),si(this,Et,null)),r&&this.isConnected&&(si(this,Et,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=se(this,Et))==null?void 0:l.associateElement)==null||d.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),rt(this,ps,Kd).call(this)):(this.range.setAttribute(e,r),rt(this,ms,Gd).call(this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),se(this,ot).pointer=J(this.shadowRoot,"#pointer"),se(this,ot).progress=J(this.shadowRoot,"#progress"),se(this,ot).thumb=J(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),se(this,ot).activeSegment=J(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(si(this,Et,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=se(this,Et))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",se(this,cs)),this.shadowRoot.addEventListener("focusout",se(this,us)),rt(this,ps,Kd).call(this),Nt(this.container,se(this,hs))}disconnectedCallback(){var e,t;rt(this,ms,Gd).call(this),(t=(e=se(this,Et))==null?void 0:e.unassociateElement)==null||t.call(e,this),si(this,Et,null),this.shadowRoot.removeEventListener("focusin",se(this,cs)),this.shadowRoot.removeEventListener("focusout",se(this,us)),Ut(this.container,se(this,hs))}updatePointerBar(e){var t;(t=se(this,ot).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=se(this,ot).progress)==null||e.style.setProperty("width",`${r}%`),(t=se(this,ot).thumb)==null||t.style.setProperty("left",`${r}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let r=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];si(this,vs,[...r]);let o=r.pop();for(let[n,a]of r.entries()){let[l,d]=[n===0,n===r.length-1],m=l?"calc(var(--segments-gap) / -1)":`${a*100}%`,g=`calc(${((d?o:r[n+1])-a)*100}%${l||d?"":" - var(--segments-gap)"})`,E=ee.createElementNS("http://www.w3.org/2000/svg","rect"),p=ln(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);p.style.setProperty("x",m),p.style.setProperty("width",g),t.append(E)}}getPointerRatio(e){return gh(e.clientX,e.clientY,se(this,ls).getBoundingClientRect(),se(this,ds).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":rt(this,Qd,up).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":rt(this,qd,lp).call(this,e);break;case"pointerdown":rt(this,fs,Jd).call(this,e);break;case"pointerup":rt(this,zd,dp).call(this);break;case"pointerleave":rt(this,Yd,cp).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};Et=new WeakMap;Es=new WeakMap;ls=new WeakMap;ds=new WeakMap;ot=new WeakMap;vs=new WeakMap;cs=new WeakMap;us=new WeakMap;hs=new WeakMap;Xd=new WeakSet;sp=function(i){let e=se(this,ot).activeSegment;if(!e)return;let t=this.getPointerRatio(i),o=`#segments-clipping rect:nth-child(${se(this,vs).findIndex((n,a,l)=>{let d=l[a+1];return d!=null&&t>=n&&t<=d})+1})`;(e.selectorText!=o||!e.style.transform)&&(e.selectorText=o,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};ps=new WeakSet;Kd=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};ms=new WeakSet;Gd=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=c.window)==null||i.removeEventListener("pointerup",this),(e=c.window)==null||e.removeEventListener("pointermove",this)};fs=new WeakSet;Jd=function(i){var e;si(this,Es,i.composedPath().includes(this.range)),(e=c.window)==null||e.addEventListener("pointerup",this)};qd=new WeakSet;lp=function(i){var e;i.pointerType!=="mouse"&&rt(this,fs,Jd).call(this,i),this.addEventListener("pointerleave",this),(e=c.window)==null||e.addEventListener("pointermove",this)};zd=new WeakSet;dp=function(){var i;(i=c.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};Yd=new WeakSet;cp=function(){var i,e;this.removeEventListener("pointerleave",this),(i=c.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=se(this,ot).activeSegment)==null||e.style.removeProperty("transform")};Qd=new WeakSet;up=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),rt(this,Xd,sp).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!se(this,Es))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};gt.shadowRootOptions={mode:"open"};gt.getTemplateHTML=Of;gt.getContainerTemplateHTML=Nf;c.customElements.get("media-chrome-range")||c.customElements.define("media-chrome-range",gt);var hp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gs=(i,e,t)=>(hp(i,e,"read from private field"),t?t.call(i):e.get(i)),Uf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},bs=(i,e,t,r)=>(hp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),bt;function Hf(i){return`
939
+ `}function Vf(i){return""}var gt=class extends c.HTMLElement{constructor(){if(super(),Te(this,tc),Te(this,va),Te(this,fa),Te(this,ga),Te(this,Zd),Te(this,Xd),Te(this,Jd),Te(this,jd),Te(this,Et,void 0),Te(this,ba,void 0),Te(this,ca,void 0),Te(this,ua,void 0),Te(this,ot,{}),Te(this,Ea,[]),Te(this,ha,()=>{if(this.range.matches(":focus-visible")){let{style:e}=J(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),Te(this,pa,()=>{let{style:e}=J(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),Te(this,ma,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector("#container"),ai(this,ca,this.shadowRoot.querySelector("#startpoint")),ai(this,ua,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,s,l,d;e===N.MEDIA_CONTROLLER?(t&&((n=(o=ae(this,Et))==null?void 0:o.unassociateElement)==null||n.call(o,this),ai(this,Et,null)),r&&this.isConnected&&(ai(this,Et,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=ae(this,Et))==null?void 0:l.associateElement)==null||d.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),rt(this,va,Yd).call(this)):(this.range.setAttribute(e,r),rt(this,fa,Qd).call(this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),ae(this,ot).pointer=J(this.shadowRoot,"#pointer"),ae(this,ot).progress=J(this.shadowRoot,"#progress"),ae(this,ot).thumb=J(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),ae(this,ot).activeSegment=J(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(ai(this,Et,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=ae(this,Et))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",ae(this,ha)),this.shadowRoot.addEventListener("focusout",ae(this,pa)),rt(this,va,Yd).call(this),Nt(this.container,ae(this,ma))}disconnectedCallback(){var e,t;rt(this,fa,Qd).call(this),(t=(e=ae(this,Et))==null?void 0:e.unassociateElement)==null||t.call(e,this),ai(this,Et,null),this.shadowRoot.removeEventListener("focusin",ae(this,ha)),this.shadowRoot.removeEventListener("focusout",ae(this,pa)),Ut(this.container,ae(this,ma))}updatePointerBar(e){var t;(t=ae(this,ot).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=ae(this,ot).progress)==null||e.style.setProperty("width",`${r}%`),(t=ae(this,ot).thumb)==null||t.style.setProperty("left",`${r}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let r=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];ai(this,Ea,[...r]);let o=r.pop();for(let[n,s]of r.entries()){let[l,d]=[n===0,n===r.length-1],m=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,g=`calc(${((d?o:r[n+1])-s)*100}%${l||d?"":" - var(--segments-gap)"})`,E=ee.createElementNS("http://www.w3.org/2000/svg","rect"),p=cn(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);p.style.setProperty("x",m),p.style.setProperty("width",g),t.append(E)}}getPointerRatio(e){return Ah(e.clientX,e.clientY,ae(this,ca).getBoundingClientRect(),ae(this,ua).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":rt(this,jd,fp).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":rt(this,Zd,pp).call(this,e);break;case"pointerdown":rt(this,ga,ic).call(this,e);break;case"pointerup":rt(this,Xd,mp).call(this);break;case"pointerleave":rt(this,Jd,vp).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};Et=new WeakMap;ba=new WeakMap;ca=new WeakMap;ua=new WeakMap;ot=new WeakMap;Ea=new WeakMap;ha=new WeakMap;pa=new WeakMap;ma=new WeakMap;tc=new WeakSet;hp=function(i){let e=ae(this,ot).activeSegment;if(!e)return;let t=this.getPointerRatio(i),o=`#segments-clipping rect:nth-child(${ae(this,Ea).findIndex((n,s,l)=>{let d=l[s+1];return d!=null&&t>=n&&t<=d})+1})`;(e.selectorText!=o||!e.style.transform)&&(e.selectorText=o,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};va=new WeakSet;Yd=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};fa=new WeakSet;Qd=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=c.window)==null||i.removeEventListener("pointerup",this),(e=c.window)==null||e.removeEventListener("pointermove",this)};ga=new WeakSet;ic=function(i){var e;ai(this,ba,i.composedPath().includes(this.range)),(e=c.window)==null||e.addEventListener("pointerup",this)};Zd=new WeakSet;pp=function(i){var e;i.pointerType!=="mouse"&&rt(this,ga,ic).call(this,i),this.addEventListener("pointerleave",this),(e=c.window)==null||e.addEventListener("pointermove",this)};Xd=new WeakSet;mp=function(){var i;(i=c.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};Jd=new WeakSet;vp=function(){var i,e;this.removeEventListener("pointerleave",this),(i=c.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=ae(this,ot).activeSegment)==null||e.style.removeProperty("transform")};jd=new WeakSet;fp=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),rt(this,tc,hp).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!ae(this,ba))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};gt.shadowRootOptions={mode:"open"};gt.getTemplateHTML=Bf;gt.getContainerTemplateHTML=Vf;c.customElements.get("media-chrome-range")||c.customElements.define("media-chrome-range",gt);var Ep=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_a=(i,e,t)=>(Ep(i,e,"read from private field"),t?t.call(i):e.get(i)),Wf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ya=(i,e,t,r)=>(Ep(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),bt;function Ff(i){return`
940
940
  <style>
941
941
  :host {
942
942
 
@@ -962,7 +962,7 @@ bp-player[has-error] {
962
962
  </style>
963
963
 
964
964
  <slot></slot>
965
- `}var An=class extends c.HTMLElement{constructor(){if(super(),Uf(this,bt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=gs(this,bt))==null?void 0:o.unassociateElement)==null||n.call(o,this),bs(this,bt,null)),r&&this.isConnected&&(bs(this,bt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=gs(this,bt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(bs(this,bt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=gs(this,bt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=gs(this,bt))==null?void 0:e.unassociateElement)==null||t.call(e,this),bs(this,bt,null)}};bt=new WeakMap;An.shadowRootOptions={mode:"open"};An.getTemplateHTML=Hf;c.customElements.get("media-control-bar")||c.customElements.define("media-control-bar",An);var pp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_s=(i,e,t)=>(pp(i,e,"read from private field"),t?t.call(i):e.get(i)),$f=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ys=(i,e,t,r)=>(pp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),_t;function Bf(i,e={}){return`
965
+ `}var kn=class extends c.HTMLElement{constructor(){if(super(),Wf(this,bt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,s,l,d;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=_a(this,bt))==null?void 0:o.unassociateElement)==null||n.call(o,this),ya(this,bt,null)),r&&this.isConnected&&(ya(this,bt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=_a(this,bt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(ya(this,bt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=_a(this,bt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=_a(this,bt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ya(this,bt,null)}};bt=new WeakMap;kn.shadowRootOptions={mode:"open"};kn.getTemplateHTML=Ff;c.customElements.get("media-control-bar")||c.customElements.define("media-control-bar",kn);var gp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ta=(i,e,t)=>(gp(i,e,"read from private field"),t?t.call(i):e.get(i)),qf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Aa=(i,e,t,r)=>(gp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),_t;function Kf(i,e={}){return`
966
966
  <style>
967
967
  :host {
968
968
  font: var(--media-font,
@@ -996,11 +996,11 @@ bp-player[has-error] {
996
996
  </style>
997
997
 
998
998
  ${this.getSlotTemplateHTML(i,e)}
999
- `}function Vf(i,e){return`
999
+ `}function Gf(i,e){return`
1000
1000
  <slot></slot>
1001
- `}var Oe=class extends c.HTMLElement{constructor(){if(super(),$f(this,_t,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=_s(this,_t))==null?void 0:o.unassociateElement)==null||n.call(o,this),ys(this,_t,null)),r&&this.isConnected&&(ys(this,_t,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=_s(this,_t))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(ys(this,_t,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=_s(this,_t))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=_s(this,_t))==null?void 0:e.unassociateElement)==null||t.call(e,this),ys(this,_t,null)}};_t=new WeakMap;Oe.shadowRootOptions={mode:"open"};Oe.getTemplateHTML=Bf;Oe.getSlotTemplateHTML=Vf;c.customElements.get("media-text-display")||c.customElements.define("media-text-display",Oe);var vp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},mp=(i,e,t)=>(vp(i,e,"read from private field"),t?t.call(i):e.get(i)),Wf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ff=(i,e,t,r)=>(vp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Sn;function Kf(i,e){return`
1001
+ `}var Oe=class extends c.HTMLElement{constructor(){if(super(),qf(this,_t,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,s,l,d;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Ta(this,_t))==null?void 0:o.unassociateElement)==null||n.call(o,this),Aa(this,_t,null)),r&&this.isConnected&&(Aa(this,_t,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Ta(this,_t))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(Aa(this,_t,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Ta(this,_t))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ta(this,_t))==null?void 0:e.unassociateElement)==null||t.call(e,this),Aa(this,_t,null)}};_t=new WeakMap;Oe.shadowRootOptions={mode:"open"};Oe.getTemplateHTML=Kf;Oe.getSlotTemplateHTML=Gf;c.customElements.get("media-text-display")||c.customElements.define("media-text-display",Oe);var _p=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},bp=(i,e,t)=>(_p(i,e,"read from private field"),t?t.call(i):e.get(i)),zf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Yf=(i,e,t,r)=>(_p(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ln;function Qf(i,e){return`
1002
1002
  <slot>${it(e.mediaDuration)}</slot>
1003
- `}var Ts=class extends Oe{constructor(){var e;super(),Wf(this,Sn,void 0),Ff(this,Sn,this.shadowRoot.querySelector("slot")),mp(this,Sn).textContent=it((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===s.MEDIA_DURATION&&(mp(this,Sn).textContent=it(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return H(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}};Sn=new WeakMap;Ts.getSlotTemplateHTML=Kf;c.customElements.get("media-duration-display")||c.customElements.define("media-duration-display",Ts);var Gf={2:_("Network Error"),3:_("Decode Error"),4:_("Source Not Supported"),5:_("Encryption Error")},qf={2:_("A network error caused the media download to fail."),3:_("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:_("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:_("The media is encrypted and there are no keys to decrypt it.")},jd=i=>{var e,t;return i.code===1?null:{title:(e=Gf[i.code])!=null?e:`Error ${i.code}`,message:(t=qf[i.code])!=null?t:i.message}};var Ep=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},zf=(i,e,t)=>(Ep(i,e,"read from private field"),t?t.call(i):e.get(i)),Yf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Qf=(i,e,t,r)=>(Ep(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),As;function Zf(i){return`
1003
+ `}var Sa=class extends Oe{constructor(){var e;super(),zf(this,Ln,void 0),Yf(this,Ln,this.shadowRoot.querySelector("slot")),bp(this,Ln).textContent=it((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===a.MEDIA_DURATION&&(bp(this,Ln).textContent=it(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return H(this,a.MEDIA_DURATION)}set mediaDuration(e){B(this,a.MEDIA_DURATION,e)}};Ln=new WeakMap;Sa.getSlotTemplateHTML=Qf;c.customElements.get("media-duration-display")||c.customElements.define("media-duration-display",Sa);var Zf={2:_("Network Error"),3:_("Decode Error"),4:_("Source Not Supported"),5:_("Encryption Error")},Xf={2:_("A network error caused the media download to fail."),3:_("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:_("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:_("The media is encrypted and there are no keys to decrypt it.")},rc=i=>{var e,t;return i.code===1?null:{title:(e=Zf[i.code])!=null?e:`Error ${i.code}`,message:(t=Xf[i.code])!=null?t:i.message}};var Tp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Jf=(i,e,t)=>(Tp(i,e,"read from private field"),t?t.call(i):e.get(i)),jf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},eE=(i,e,t,r)=>(Tp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ka;function tE(i){return`
1004
1004
  <style>
1005
1005
  :host {
1006
1006
  background: rgb(20 20 30 / .8);
@@ -1017,9 +1017,9 @@ bp-player[has-error] {
1017
1017
  }
1018
1018
  </style>
1019
1019
  <slot name="error-${i.mediaerrorcode}" id="content">
1020
- ${gp({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
1020
+ ${Ap({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
1021
1021
  </slot>
1022
- `}function Xf(i){return i.code&&jd(i)!==null}function gp(i){var e;let{title:t,message:r}=(e=jd(i))!=null?e:{},o="";return t&&(o+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),r&&(o+=`<slot name="error-${i.code}-message"><p>${r}</p></slot>`),o}var fp=[s.MEDIA_ERROR_CODE,s.MEDIA_ERROR_MESSAGE],kn=class extends ft{constructor(){super(...arguments),Yf(this,As,null)}static get observedAttributes(){return[...super.observedAttributes,...fp]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var o;if(super.attributeChangedCallback(e,t,r),!fp.includes(e))return;let n=(o=this.mediaError)!=null?o:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=Xf(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return zf(this,As)}set mediaError(e){Qf(this,As,e)}get mediaErrorCode(){return H(this,"mediaerrorcode")}set mediaErrorCode(e){B(this,"mediaerrorcode",e)}get mediaErrorMessage(){return D(this,"mediaerrormessage")}set mediaErrorMessage(e){O(this,"mediaerrormessage",e)}};As=new WeakMap;kn.getSlotTemplateHTML=Zf;kn.formatErrorMessage=gp;c.customElements.get("media-error-dialog")||c.customElements.define("media-error-dialog",kn);var Jf=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},li=(i,e,t)=>(Jf(i,e,"read from private field"),t?t.call(i):e.get(i)),bp=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Kr,Gr;function jf(i){return`
1022
+ `}function iE(i){return i.code&&rc(i)!==null}function Ap(i){var e;let{title:t,message:r}=(e=rc(i))!=null?e:{},o="";return t&&(o+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),r&&(o+=`<slot name="error-${i.code}-message"><p>${r}</p></slot>`),o}var yp=[a.MEDIA_ERROR_CODE,a.MEDIA_ERROR_MESSAGE],In=class extends ft{constructor(){super(...arguments),jf(this,ka,null)}static get observedAttributes(){return[...super.observedAttributes,...yp]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var o;if(super.attributeChangedCallback(e,t,r),!yp.includes(e))return;let n=(o=this.mediaError)!=null?o:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=iE(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return Jf(this,ka)}set mediaError(e){eE(this,ka,e)}get mediaErrorCode(){return H(this,"mediaerrorcode")}set mediaErrorCode(e){B(this,"mediaerrorcode",e)}get mediaErrorMessage(){return D(this,"mediaerrormessage")}set mediaErrorMessage(e){O(this,"mediaerrormessage",e)}};ka=new WeakMap;In.getSlotTemplateHTML=tE;In.formatErrorMessage=Ap;c.customElements.get("media-error-dialog")||c.customElements.define("media-error-dialog",In);var rE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},li=(i,e,t)=>(rE(i,e,"read from private field"),t?t.call(i):e.get(i)),Sp=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},qr,Kr;function oE(i){return`
1023
1023
  <style>
1024
1024
  :host {
1025
1025
  position: fixed;
@@ -1104,47 +1104,47 @@ bp-player[has-error] {
1104
1104
  }
1105
1105
  </style>
1106
1106
  <slot id="content">
1107
- ${eE()}
1107
+ ${nE()}
1108
1108
  </slot>
1109
- `}function eE(){return`
1109
+ `}function nE(){return`
1110
1110
  <h2>Keyboard Shortcuts</h2>
1111
1111
  <table class="shortcuts-table">${[{keys:["Space","k"],description:"Toggle Playback"},{keys:["m"],description:"Toggle mute"},{keys:["f"],description:"Toggle fullscreen"},{keys:["c"],description:"Toggle captions or subtitles, if available"},{keys:["p"],description:"Toggle Picture in Picture"},{keys:["\u2190","j"],description:"Seek back 10s"},{keys:["\u2192","l"],description:"Seek forward 10s"},{keys:["\u2191"],description:"Turn volume up"},{keys:["\u2193"],description:"Turn volume down"},{keys:["< (SHIFT+,)"],description:"Decrease playback rate"},{keys:["> (SHIFT+.)"],description:"Increase playback rate"}].map(({keys:t,description:r})=>`
1112
1112
  <tr>
1113
1113
  <td>
1114
- <div class="key-combo">${t.map((n,a)=>a>0?`<span class="key-separator">or</span><span class="key">${n}</span>`:`<span class="key">${n}</span>`).join("")}</div>
1114
+ <div class="key-combo">${t.map((n,s)=>s>0?`<span class="key-separator">or</span><span class="key">${n}</span>`:`<span class="key">${n}</span>`).join("")}</div>
1115
1115
  </td>
1116
1116
  <td class="description">${r}</td>
1117
1117
  </tr>
1118
1118
  `).join("")}</table>
1119
- `}var Ss=class extends ft{constructor(){super(...arguments),bp(this,Kr,e=>{var t;if(!this.open)return;let r=(t=this.shadowRoot)==null?void 0:t.querySelector("#content");if(!r)return;let o=e.composedPath(),n=o[0]===this||o.includes(this),a=o.includes(r);n&&!a&&(this.open=!1)}),bp(this,Gr,e=>{if(!this.open)return;let t=e.shiftKey&&(e.key==="/"||e.key==="?");(e.key==="Escape"||t)&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(this.open=!1,e.preventDefault(),e.stopPropagation())})}connectedCallback(){super.connectedCallback(),this.open&&(this.addEventListener("click",li(this,Kr)),document.addEventListener("keydown",li(this,Gr)))}disconnectedCallback(){this.removeEventListener("click",li(this,Kr)),document.removeEventListener("keydown",li(this,Gr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",li(this,Kr)),document.addEventListener("keydown",li(this,Gr))):(this.removeEventListener("click",li(this,Kr)),document.removeEventListener("keydown",li(this,Gr))))}};Kr=new WeakMap;Gr=new WeakMap;Ss.getSlotTemplateHTML=jf;c.customElements.get("media-keyboard-shortcuts-dialog")||c.customElements.define("media-keyboard-shortcuts-dialog",Ss);var yp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tE=(i,e,t)=>(yp(i,e,"read from private field"),t?t.call(i):e.get(i)),iE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},rE=(i,e,t,r)=>(yp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ks,oE=`<svg aria-hidden="true" viewBox="0 0 26 24">
1119
+ `}var La=class extends ft{constructor(){super(...arguments),Sp(this,qr,e=>{var t;if(!this.open)return;let r=(t=this.shadowRoot)==null?void 0:t.querySelector("#content");if(!r)return;let o=e.composedPath(),n=o[0]===this||o.includes(this),s=o.includes(r);n&&!s&&(this.open=!1)}),Sp(this,Kr,e=>{if(!this.open)return;let t=e.shiftKey&&(e.key==="/"||e.key==="?");(e.key==="Escape"||t)&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(this.open=!1,e.preventDefault(),e.stopPropagation())})}connectedCallback(){super.connectedCallback(),this.open&&(this.addEventListener("click",li(this,qr)),document.addEventListener("keydown",li(this,Kr)))}disconnectedCallback(){this.removeEventListener("click",li(this,qr)),document.removeEventListener("keydown",li(this,Kr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",li(this,qr)),document.addEventListener("keydown",li(this,Kr))):(this.removeEventListener("click",li(this,qr)),document.removeEventListener("keydown",li(this,Kr))))}};qr=new WeakMap;Kr=new WeakMap;La.getSlotTemplateHTML=oE;c.customElements.get("media-keyboard-shortcuts-dialog")||c.customElements.define("media-keyboard-shortcuts-dialog",La);var Lp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},sE=(i,e,t)=>(Lp(i,e,"read from private field"),t?t.call(i):e.get(i)),aE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},lE=(i,e,t,r)=>(Lp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ia,dE=`<svg aria-hidden="true" viewBox="0 0 26 24">
1120
1120
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
1121
- </svg>`,nE=`<svg aria-hidden="true" viewBox="0 0 26 24">
1121
+ </svg>`,cE=`<svg aria-hidden="true" viewBox="0 0 26 24">
1122
1122
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
1123
- </svg>`;function aE(i){return`
1123
+ </svg>`;function uE(i){return`
1124
1124
  <style>
1125
- :host([${s.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
1125
+ :host([${a.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
1126
1126
  display: none !important;
1127
1127
  }
1128
1128
 
1129
1129
 
1130
- :host(:not([${s.MEDIA_IS_FULLSCREEN}])) slot[name=icon] slot:not([name=enter]) {
1130
+ :host(:not([${a.MEDIA_IS_FULLSCREEN}])) slot[name=icon] slot:not([name=enter]) {
1131
1131
  display: none !important;
1132
1132
  }
1133
1133
 
1134
- :host([${s.MEDIA_IS_FULLSCREEN}]) slot[name=tooltip-enter],
1135
- :host(:not([${s.MEDIA_IS_FULLSCREEN}])) slot[name=tooltip-exit] {
1134
+ :host([${a.MEDIA_IS_FULLSCREEN}]) slot[name=tooltip-enter],
1135
+ :host(:not([${a.MEDIA_IS_FULLSCREEN}])) slot[name=tooltip-exit] {
1136
1136
  display: none;
1137
1137
  }
1138
1138
  </style>
1139
1139
 
1140
1140
  <slot name="icon">
1141
- <slot name="enter">${oE}</slot>
1142
- <slot name="exit">${nE}</slot>
1141
+ <slot name="enter">${dE}</slot>
1142
+ <slot name="exit">${cE}</slot>
1143
1143
  </slot>
1144
- `}function sE(){return`
1144
+ `}function hE(){return`
1145
1145
  <slot name="tooltip-enter">${_("Enter fullscreen mode")}</slot>
1146
1146
  <slot name="tooltip-exit">${_("Exit fullscreen mode")}</slot>
1147
- `}var _p=i=>{let e=i.mediaIsFullscreen?_("exit fullscreen mode"):_("enter fullscreen mode");i.setAttribute("aria-label",e)},Ln=class extends F{constructor(){super(...arguments),iE(this,ks,null)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_FULLSCREEN,s.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),_p(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_FULLSCREEN&&_p(this)}get mediaFullscreenUnavailable(){return D(this,s.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){O(this,s.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return w(this,s.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){M(this,s.MEDIA_IS_FULLSCREEN,e)}handleClick(e){rE(this,ks,e);let t=tE(this,ks)instanceof PointerEvent,r=this.mediaIsFullscreen?new c.CustomEvent(y.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new c.CustomEvent(y.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};ks=new WeakMap;Ln.getSlotTemplateHTML=aE;Ln.getTooltipContentHTML=sE;c.customElements.get("media-fullscreen-button")||c.customElements.define("media-fullscreen-button",Ln);var{MEDIA_TIME_IS_LIVE:Ls,MEDIA_PAUSED:Cn}=s,{MEDIA_SEEK_TO_LIVE_REQUEST:lE,MEDIA_PLAY_REQUEST:dE}=y,cE='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function uE(i){return`
1147
+ `}var kp=i=>{let e=i.mediaIsFullscreen?_("exit fullscreen mode"):_("enter fullscreen mode");i.setAttribute("aria-label",e)},wn=class extends F{constructor(){super(...arguments),aE(this,Ia,null)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_FULLSCREEN,a.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),kp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_FULLSCREEN&&kp(this)}get mediaFullscreenUnavailable(){return D(this,a.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){O(this,a.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return C(this,a.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){R(this,a.MEDIA_IS_FULLSCREEN,e)}handleClick(e){lE(this,Ia,e);let t=sE(this,Ia)instanceof PointerEvent,r=this.mediaIsFullscreen?new c.CustomEvent(y.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new c.CustomEvent(y.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};Ia=new WeakMap;wn.getSlotTemplateHTML=uE;wn.getTooltipContentHTML=hE;c.customElements.get("media-fullscreen-button")||c.customElements.define("media-fullscreen-button",wn);var{MEDIA_TIME_IS_LIVE:wa,MEDIA_PAUSED:Cn}=a,{MEDIA_SEEK_TO_LIVE_REQUEST:pE,MEDIA_PLAY_REQUEST:mE}=y,vE='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function fE(i){return`
1148
1148
  <style>
1149
1149
  :host { --media-tooltip-display: none; }
1150
1150
 
@@ -1156,13 +1156,13 @@ bp-player[has-error] {
1156
1156
  color: var(--media-live-button-icon-color, rgb(140, 140, 140));
1157
1157
  }
1158
1158
 
1159
- :host([${Ls}]:not([${Cn}])) slot[name=indicator] > *,
1160
- :host([${Ls}]:not([${Cn}])) ::slotted([slot=indicator]) {
1159
+ :host([${wa}]:not([${Cn}])) slot[name=indicator] > *,
1160
+ :host([${wa}]:not([${Cn}])) ::slotted([slot=indicator]) {
1161
1161
  fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
1162
1162
  color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
1163
1163
  }
1164
1164
 
1165
- :host([${Ls}]:not([${Cn}])) {
1165
+ :host([${wa}]:not([${Cn}])) {
1166
1166
  cursor: var(--media-cursor, not-allowed);
1167
1167
  }
1168
1168
 
@@ -1172,10 +1172,10 @@ bp-player[has-error] {
1172
1172
 
1173
1173
  </style>
1174
1174
 
1175
- <slot name="indicator">${cE}</slot>
1175
+ <slot name="indicator">${vE}</slot>
1176
1176
 
1177
1177
  <slot name="spacer">&nbsp;</slot><slot name="text">${_("live")}</slot>
1178
- `}var Tp=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?_("seek to live"):_("playing live");i.setAttribute("aria-label",r);let o=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');o&&(o.textContent=_("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},Cs=class extends F{static get observedAttributes(){return[...super.observedAttributes,Ls,Cn]}connectedCallback(){super.connectedCallback(),Tp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),Tp(this)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){M(this,s.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return w(this,s.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){M(this,s.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new c.CustomEvent(lE,{composed:!0,bubbles:!0})),this.hasAttribute(Cn)&&this.dispatchEvent(new c.CustomEvent(dE,{composed:!0,bubbles:!0})))}};Cs.getSlotTemplateHTML=uE;c.customElements.get("media-live-button")||c.customElements.define("media-live-button",Cs);var Sp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},In=(i,e,t)=>(Sp(i,e,"read from private field"),t?t.call(i):e.get(i)),Ap=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},wn=(i,e,t,r)=>(Sp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),yt,ws,Is={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},kp=500,hE=`
1178
+ `}var Ip=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?_("seek to live"):_("playing live");i.setAttribute("aria-label",r);let o=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');o&&(o.textContent=_("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},Ca=class extends F{static get observedAttributes(){return[...super.observedAttributes,wa,Cn]}connectedCallback(){super.connectedCallback(),Ip(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),Ip(this)}get mediaPaused(){return C(this,a.MEDIA_PAUSED)}set mediaPaused(e){R(this,a.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return C(this,a.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){R(this,a.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new c.CustomEvent(pE,{composed:!0,bubbles:!0})),this.hasAttribute(Cn)&&this.dispatchEvent(new c.CustomEvent(mE,{composed:!0,bubbles:!0})))}};Ca.getSlotTemplateHTML=fE;c.customElements.get("media-live-button")||c.customElements.define("media-live-button",Ca);var Cp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Rn=(i,e,t)=>(Cp(i,e,"read from private field"),t?t.call(i):e.get(i)),wp=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Mn=(i,e,t,r)=>(Cp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),yt,Ma,Ra={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},Rp=500,EE=`
1179
1179
  <svg aria-hidden="true" viewBox="0 0 100 100">
1180
1180
  <path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
1181
1181
  <animateTransform
@@ -1188,13 +1188,13 @@ bp-player[has-error] {
1188
1188
  repeatCount="indefinite" />
1189
1189
  </path>
1190
1190
  </svg>
1191
- `;function pE(i){return`
1191
+ `;function gE(i){return`
1192
1192
  <style>
1193
1193
  :host {
1194
1194
  display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
1195
1195
  vertical-align: middle;
1196
1196
  box-sizing: border-box;
1197
- --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${kp}ms);
1197
+ --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${Rp}ms);
1198
1198
  }
1199
1199
 
1200
1200
  #status {
@@ -1209,8 +1209,8 @@ bp-player[has-error] {
1209
1209
  transition: opacity 0.15s;
1210
1210
  }
1211
1211
 
1212
- :host([${s.MEDIA_LOADING}]:not([${s.MEDIA_PAUSED}])) slot[name=icon] > *,
1213
- :host([${s.MEDIA_LOADING}]:not([${s.MEDIA_PAUSED}])) ::slotted([slot=icon]) {
1212
+ :host([${a.MEDIA_LOADING}]:not([${a.MEDIA_PAUSED}])) slot[name=icon] > *,
1213
+ :host([${a.MEDIA_LOADING}]:not([${a.MEDIA_PAUSED}])) ::slotted([slot=icon]) {
1214
1214
  opacity: var(--media-loading-indicator-opacity, 1);
1215
1215
  transition: opacity 0.15s var(--_loading-indicator-delay);
1216
1216
  }
@@ -1220,7 +1220,7 @@ bp-player[has-error] {
1220
1220
  transition: visibility 0.15s;
1221
1221
  }
1222
1222
 
1223
- :host([${s.MEDIA_LOADING}]:not([${s.MEDIA_PAUSED}])) #status {
1223
+ :host([${a.MEDIA_LOADING}]:not([${a.MEDIA_PAUSED}])) #status {
1224
1224
  visibility: var(--media-loading-indicator-opacity, visible);
1225
1225
  transition: visibility 0.15s var(--_loading-indicator-delay);
1226
1226
  }
@@ -1233,74 +1233,74 @@ bp-player[has-error] {
1233
1233
  }
1234
1234
  </style>
1235
1235
 
1236
- <slot name="icon">${hE}</slot>
1236
+ <slot name="icon">${EE}</slot>
1237
1237
  <div id="status" role="status" aria-live="polite">${_("media loading")}</div>
1238
- `}var Mn=class extends c.HTMLElement{constructor(){if(super(),Ap(this,yt,void 0),Ap(this,ws,kp),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PAUSED,s.MEDIA_LOADING,Is.LOADING_DELAY]}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===Is.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===N.MEDIA_CONTROLLER&&(t&&((n=(o=In(this,yt))==null?void 0:o.unassociateElement)==null||n.call(o,this),wn(this,yt,null)),r&&this.isConnected&&(wn(this,yt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=In(this,yt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(wn(this,yt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=In(this,yt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=In(this,yt))==null?void 0:e.unassociateElement)==null||t.call(e,this),wn(this,yt,null)}get loadingDelay(){return In(this,ws)}set loadingDelay(e){wn(this,ws,e);let{style:t}=J(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){M(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,s.MEDIA_LOADING)}set mediaLoading(e){M(this,s.MEDIA_LOADING,e)}get mediaController(){return D(this,N.MEDIA_CONTROLLER)}set mediaController(e){O(this,N.MEDIA_CONTROLLER,e)}get noAutohide(){return w(this,Is.NO_AUTOHIDE)}set noAutohide(e){M(this,Is.NO_AUTOHIDE,e)}};yt=new WeakMap;ws=new WeakMap;Mn.shadowRootOptions={mode:"open"};Mn.getTemplateHTML=pE;c.customElements.get("media-loading-indicator")||c.customElements.define("media-loading-indicator",Mn);var mE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1238
+ `}var xn=class extends c.HTMLElement{constructor(){if(super(),wp(this,yt,void 0),wp(this,Ma,Rp),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,a.MEDIA_PAUSED,a.MEDIA_LOADING,Ra.LOADING_DELAY]}attributeChangedCallback(e,t,r){var o,n,s,l,d;e===Ra.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Rn(this,yt))==null?void 0:o.unassociateElement)==null||n.call(o,this),Mn(this,yt,null)),r&&this.isConnected&&(Mn(this,yt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Rn(this,yt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(Mn(this,yt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=Rn(this,yt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Rn(this,yt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Mn(this,yt,null)}get loadingDelay(){return Rn(this,Ma)}set loadingDelay(e){Mn(this,Ma,e);let{style:t}=J(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return C(this,a.MEDIA_PAUSED)}set mediaPaused(e){R(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return C(this,a.MEDIA_LOADING)}set mediaLoading(e){R(this,a.MEDIA_LOADING,e)}get mediaController(){return D(this,N.MEDIA_CONTROLLER)}set mediaController(e){O(this,N.MEDIA_CONTROLLER,e)}get noAutohide(){return C(this,Ra.NO_AUTOHIDE)}set noAutohide(e){R(this,Ra.NO_AUTOHIDE,e)}};yt=new WeakMap;Ma=new WeakMap;xn.shadowRootOptions={mode:"open"};xn.getTemplateHTML=gE;c.customElements.get("media-loading-indicator")||c.customElements.define("media-loading-indicator",xn);var bE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1239
1239
  <path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
1240
- </svg>`,Lp=`<svg aria-hidden="true" viewBox="0 0 24 24">
1240
+ </svg>`,Mp=`<svg aria-hidden="true" viewBox="0 0 24 24">
1241
1241
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
1242
- </svg>`,vE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1242
+ </svg>`,_E=`<svg aria-hidden="true" viewBox="0 0 24 24">
1243
1243
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
1244
- </svg>`;function fE(i){return`
1244
+ </svg>`;function yE(i){return`
1245
1245
  <style>
1246
- :host(:not([${s.MEDIA_VOLUME_LEVEL}])) slot[name=icon] slot:not([name=high]),
1247
- :host([${s.MEDIA_VOLUME_LEVEL}=high]) slot[name=icon] slot:not([name=high]) {
1246
+ :host(:not([${a.MEDIA_VOLUME_LEVEL}])) slot[name=icon] slot:not([name=high]),
1247
+ :host([${a.MEDIA_VOLUME_LEVEL}=high]) slot[name=icon] slot:not([name=high]) {
1248
1248
  display: none !important;
1249
1249
  }
1250
1250
 
1251
- :host([${s.MEDIA_VOLUME_LEVEL}=off]) slot[name=icon] slot:not([name=off]) {
1251
+ :host([${a.MEDIA_VOLUME_LEVEL}=off]) slot[name=icon] slot:not([name=off]) {
1252
1252
  display: none !important;
1253
1253
  }
1254
1254
 
1255
- :host([${s.MEDIA_VOLUME_LEVEL}=low]) slot[name=icon] slot:not([name=low]) {
1255
+ :host([${a.MEDIA_VOLUME_LEVEL}=low]) slot[name=icon] slot:not([name=low]) {
1256
1256
  display: none !important;
1257
1257
  }
1258
1258
 
1259
- :host([${s.MEDIA_VOLUME_LEVEL}=medium]) slot[name=icon] slot:not([name=medium]) {
1259
+ :host([${a.MEDIA_VOLUME_LEVEL}=medium]) slot[name=icon] slot:not([name=medium]) {
1260
1260
  display: none !important;
1261
1261
  }
1262
1262
 
1263
- :host(:not([${s.MEDIA_VOLUME_LEVEL}=off])) slot[name=tooltip-unmute],
1264
- :host([${s.MEDIA_VOLUME_LEVEL}=off]) slot[name=tooltip-mute] {
1263
+ :host(:not([${a.MEDIA_VOLUME_LEVEL}=off])) slot[name=tooltip-unmute],
1264
+ :host([${a.MEDIA_VOLUME_LEVEL}=off]) slot[name=tooltip-mute] {
1265
1265
  display: none;
1266
1266
  }
1267
1267
  </style>
1268
1268
 
1269
1269
  <slot name="icon">
1270
- <slot name="off">${mE}</slot>
1271
- <slot name="low">${Lp}</slot>
1272
- <slot name="medium">${Lp}</slot>
1273
- <slot name="high">${vE}</slot>
1270
+ <slot name="off">${bE}</slot>
1271
+ <slot name="low">${Mp}</slot>
1272
+ <slot name="medium">${Mp}</slot>
1273
+ <slot name="high">${_E}</slot>
1274
1274
  </slot>
1275
- `}function EE(){return`
1275
+ `}function TE(){return`
1276
1276
  <slot name="tooltip-mute">${_("Mute")}</slot>
1277
1277
  <slot name="tooltip-unmute">${_("Unmute")}</slot>
1278
- `}var Cp=i=>{let t=i.mediaVolumeLevel==="off"?_("unmute"):_("mute");i.setAttribute("aria-label",t)},Rn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),Cp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_VOLUME_LEVEL&&Cp(this)}get mediaVolumeLevel(){return D(this,s.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){O(this,s.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?y.MEDIA_UNMUTE_REQUEST:y.MEDIA_MUTE_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Rn.getSlotTemplateHTML=fE;Rn.getTooltipContentHTML=EE;c.customElements.get("media-mute-button")||c.customElements.define("media-mute-button",Rn);var Ip=`<svg aria-hidden="true" viewBox="0 0 28 24">
1278
+ `}var xp=i=>{let t=i.mediaVolumeLevel==="off"?_("unmute"):_("mute");i.setAttribute("aria-label",t)},Pn=class extends F{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),xp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_VOLUME_LEVEL&&xp(this)}get mediaVolumeLevel(){return D(this,a.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){O(this,a.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?y.MEDIA_UNMUTE_REQUEST:y.MEDIA_MUTE_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Pn.getSlotTemplateHTML=yE;Pn.getTooltipContentHTML=TE;c.customElements.get("media-mute-button")||c.customElements.define("media-mute-button",Pn);var Pp=`<svg aria-hidden="true" viewBox="0 0 28 24">
1279
1279
  <path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
1280
- </svg>`;function gE(i){return`
1280
+ </svg>`;function AE(i){return`
1281
1281
  <style>
1282
- :host([${s.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
1282
+ :host([${a.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
1283
1283
  display: none !important;
1284
1284
  }
1285
1285
 
1286
- :host(:not([${s.MEDIA_IS_PIP}])) slot[name=icon] slot:not([name=enter]) {
1286
+ :host(:not([${a.MEDIA_IS_PIP}])) slot[name=icon] slot:not([name=enter]) {
1287
1287
  display: none !important;
1288
1288
  }
1289
1289
 
1290
- :host([${s.MEDIA_IS_PIP}]) slot[name=tooltip-enter],
1291
- :host(:not([${s.MEDIA_IS_PIP}])) slot[name=tooltip-exit] {
1290
+ :host([${a.MEDIA_IS_PIP}]) slot[name=tooltip-enter],
1291
+ :host(:not([${a.MEDIA_IS_PIP}])) slot[name=tooltip-exit] {
1292
1292
  display: none;
1293
1293
  }
1294
1294
  </style>
1295
1295
 
1296
1296
  <slot name="icon">
1297
- <slot name="enter">${Ip}</slot>
1298
- <slot name="exit">${Ip}</slot>
1297
+ <slot name="enter">${Pp}</slot>
1298
+ <slot name="exit">${Pp}</slot>
1299
1299
  </slot>
1300
- `}function bE(){return`
1300
+ `}function SE(){return`
1301
1301
  <slot name="tooltip-enter">${_("Enter picture in picture mode")}</slot>
1302
1302
  <slot name="tooltip-exit">${_("Exit picture in picture mode")}</slot>
1303
- `}var wp=i=>{let e=i.mediaIsPip?_("exit picture in picture mode"):_("enter picture in picture mode");i.setAttribute("aria-label",e)},xn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_PIP,s.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),wp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_PIP&&wp(this)}get mediaPipUnavailable(){return D(this,s.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){O(this,s.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return w(this,s.MEDIA_IS_PIP)}set mediaIsPip(e){M(this,s.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};xn.getSlotTemplateHTML=gE;xn.getTooltipContentHTML=bE;c.customElements.get("media-pip-button")||c.customElements.define("media-pip-button",xn);var _E=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qr=(i,e,t)=>(_E(i,e,"read from private field"),t?t.call(i):e.get(i)),yE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},di,ec={RATES:"rates"},tc=[1,1.2,1.5,1.7,2],Ji=1;function TE(i){return`
1303
+ `}var Dp=i=>{let e=i.mediaIsPip?_("exit picture in picture mode"):_("enter picture in picture mode");i.setAttribute("aria-label",e)},Dn=class extends F{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_PIP,a.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Dp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_PIP&&Dp(this)}get mediaPipUnavailable(){return D(this,a.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){O(this,a.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return C(this,a.MEDIA_IS_PIP)}set mediaIsPip(e){R(this,a.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Dn.getSlotTemplateHTML=AE;Dn.getTooltipContentHTML=SE;c.customElements.get("media-pip-button")||c.customElements.define("media-pip-button",Dn);var kE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Gr=(i,e,t)=>(kE(i,e,"read from private field"),t?t.call(i):e.get(i)),LE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},di,oc={RATES:"rates"},nc=[1,1.2,1.5,1.7,2],Ji=1;function IE(i){return`
1304
1304
  <style>
1305
1305
  :host {
1306
1306
  min-width: 5ch;
@@ -1308,31 +1308,31 @@ bp-player[has-error] {
1308
1308
  }
1309
1309
  </style>
1310
1310
  <slot name="icon">${i.mediaplaybackrate||Ji}x</slot>
1311
- `}function AE(){return _("Playback rate")}var Pn=class extends F{constructor(){var e;super(),yE(this,di,new ri(this,ec.RATES,{defaultValue:tc})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Ji}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,ec.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===ec.RATES&&(qr(this,di).value=r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?Ji:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",_("Playback rate {playbackRate}",{playbackRate:n}))}}get rates(){return qr(this,di)}set rates(e){e?Array.isArray(e)?qr(this,di).value=e.join(" "):typeof e=="string"&&(qr(this,di).value=e):qr(this,di).value=""}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,Ji)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(qr(this,di).values(),a=>+a).sort((a,l)=>a-l),o=(t=(e=r.find(a=>a>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:Ji,n=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:o});this.dispatchEvent(n)}};di=new WeakMap;Pn.getSlotTemplateHTML=TE;Pn.getTooltipContentHTML=AE;c.customElements.get("media-playback-rate-button")||c.customElements.define("media-playback-rate-button",Pn);var SE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1311
+ `}function wE(){return _("Playback rate")}var On=class extends F{constructor(){var e;super(),LE(this,di,new ri(this,oc.RATES,{defaultValue:nc})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Ji}x`}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,oc.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===oc.RATES&&(Gr(this,di).value=r),e===a.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?Ji:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",_("Playback rate {playbackRate}",{playbackRate:n}))}}get rates(){return Gr(this,di)}set rates(e){e?Array.isArray(e)?Gr(this,di).value=e.join(" "):typeof e=="string"&&(Gr(this,di).value=e):Gr(this,di).value=""}get mediaPlaybackRate(){return H(this,a.MEDIA_PLAYBACK_RATE,Ji)}set mediaPlaybackRate(e){B(this,a.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(Gr(this,di).values(),s=>+s).sort((s,l)=>s-l),o=(t=(e=r.find(s=>s>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:Ji,n=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:o});this.dispatchEvent(n)}};di=new WeakMap;On.getSlotTemplateHTML=IE;On.getTooltipContentHTML=wE;c.customElements.get("media-playback-rate-button")||c.customElements.define("media-playback-rate-button",On);var CE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1312
1312
  <path d="m6 21 15-9L6 3v18Z"/>
1313
- </svg>`,kE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1313
+ </svg>`,RE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1314
1314
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
1315
- </svg>`;function LE(i){return`
1315
+ </svg>`;function ME(i){return`
1316
1316
  <style>
1317
- :host([${s.MEDIA_PAUSED}]) slot[name=pause],
1318
- :host(:not([${s.MEDIA_PAUSED}])) slot[name=play] {
1317
+ :host([${a.MEDIA_PAUSED}]) slot[name=pause],
1318
+ :host(:not([${a.MEDIA_PAUSED}])) slot[name=play] {
1319
1319
  display: none !important;
1320
1320
  }
1321
1321
 
1322
- :host([${s.MEDIA_PAUSED}]) slot[name=tooltip-pause],
1323
- :host(:not([${s.MEDIA_PAUSED}])) slot[name=tooltip-play] {
1322
+ :host([${a.MEDIA_PAUSED}]) slot[name=tooltip-pause],
1323
+ :host(:not([${a.MEDIA_PAUSED}])) slot[name=tooltip-play] {
1324
1324
  display: none;
1325
1325
  }
1326
1326
  </style>
1327
1327
 
1328
1328
  <slot name="icon">
1329
- <slot name="play">${SE}</slot>
1330
- <slot name="pause">${kE}</slot>
1329
+ <slot name="play">${CE}</slot>
1330
+ <slot name="pause">${RE}</slot>
1331
1331
  </slot>
1332
- `}function CE(){return`
1332
+ `}function xE(){return`
1333
1333
  <slot name="tooltip-play">${_("Play")}</slot>
1334
1334
  <slot name="tooltip-pause">${_("Pause")}</slot>
1335
- `}var Mp=i=>{let e=i.mediaPaused?_("play"):_("pause");i.setAttribute("aria-label",e)},Dn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),Mp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PAUSED||e===s.MEDIA_LANG)&&Mp(this)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){M(this,s.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Dn.getSlotTemplateHTML=LE;Dn.getTooltipContentHTML=CE;c.customElements.get("media-play-button")||c.customElements.define("media-play-button",Dn);var Tt={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function IE(i){return`
1335
+ `}var Op=i=>{let e=i.mediaPaused?_("play"):_("pause");i.setAttribute("aria-label",e)},Nn=class extends F{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),Op(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===a.MEDIA_PAUSED||e===a.MEDIA_LANG)&&Op(this)}get mediaPaused(){return C(this,a.MEDIA_PAUSED)}set mediaPaused(e){R(this,a.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Nn.getSlotTemplateHTML=ME;Nn.getTooltipContentHTML=xE;c.customElements.get("media-play-button")||c.customElements.define("media-play-button",Nn);var Tt={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function PE(i){return`
1336
1336
  <style>
1337
1337
  :host {
1338
1338
  pointer-events: none;
@@ -1354,7 +1354,7 @@ bp-player[has-error] {
1354
1354
  </style>
1355
1355
 
1356
1356
  <img part="poster img" aria-hidden="true" id="image"/>
1357
- `}var wE=i=>{i.style.removeProperty("background-image")},ME=(i,e)=>{i.style["background-image"]=`url('${e}')`},On=class extends c.HTMLElement{static get observedAttributes(){return[Tt.PLACEHOLDER_SRC,Tt.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===Tt.SRC&&(r==null?this.image.removeAttribute(Tt.SRC):this.image.setAttribute(Tt.SRC,r)),e===Tt.PLACEHOLDER_SRC&&(r==null?wE(this.image):ME(this.image,r))}get placeholderSrc(){return D(this,Tt.PLACEHOLDER_SRC)}set placeholderSrc(e){O(this,Tt.SRC,e)}get src(){return D(this,Tt.SRC)}set src(e){O(this,Tt.SRC,e)}};On.shadowRootOptions={mode:"open"};On.getTemplateHTML=IE;c.customElements.get("media-poster-image")||c.customElements.define("media-poster-image",On);var Rp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},RE=(i,e,t)=>(Rp(i,e,"read from private field"),t?t.call(i):e.get(i)),xE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},PE=(i,e,t,r)=>(Rp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ms,ic=class extends Oe{constructor(){super(),xE(this,Ms,void 0),PE(this,Ms,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_LANG]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PREVIEW_CHAPTER||e===s.MEDIA_LANG)&&r!==t&&r!=null)if(RE(this,Ms).textContent=r,r!==""){let o=_("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",o)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return D(this,s.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){O(this,s.MEDIA_PREVIEW_CHAPTER,e)}};Ms=new WeakMap;c.customElements.get("media-preview-chapter-display")||c.customElements.define("media-preview-chapter-display",ic);var xp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Rs=(i,e,t)=>(xp(i,e,"read from private field"),t?t.call(i):e.get(i)),DE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},xs=(i,e,t,r)=>(xp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),At;function OE(i){return`
1357
+ `}var DE=i=>{i.style.removeProperty("background-image")},OE=(i,e)=>{i.style["background-image"]=`url('${e}')`},Un=class extends c.HTMLElement{static get observedAttributes(){return[Tt.PLACEHOLDER_SRC,Tt.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===Tt.SRC&&(r==null?this.image.removeAttribute(Tt.SRC):this.image.setAttribute(Tt.SRC,r)),e===Tt.PLACEHOLDER_SRC&&(r==null?DE(this.image):OE(this.image,r))}get placeholderSrc(){return D(this,Tt.PLACEHOLDER_SRC)}set placeholderSrc(e){O(this,Tt.SRC,e)}get src(){return D(this,Tt.SRC)}set src(e){O(this,Tt.SRC,e)}};Un.shadowRootOptions={mode:"open"};Un.getTemplateHTML=PE;c.customElements.get("media-poster-image")||c.customElements.define("media-poster-image",Un);var Np=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},NE=(i,e,t)=>(Np(i,e,"read from private field"),t?t.call(i):e.get(i)),UE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},HE=(i,e,t,r)=>(Np(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),xa,sc=class extends Oe{constructor(){super(),UE(this,xa,void 0),HE(this,xa,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_LANG]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),(e===a.MEDIA_PREVIEW_CHAPTER||e===a.MEDIA_LANG)&&r!==t&&r!=null)if(NE(this,xa).textContent=r,r!==""){let o=_("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",o)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return D(this,a.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){O(this,a.MEDIA_PREVIEW_CHAPTER,e)}};xa=new WeakMap;c.customElements.get("media-preview-chapter-display")||c.customElements.define("media-preview-chapter-display",sc);var Up=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Pa=(i,e,t)=>(Up(i,e,"read from private field"),t?t.call(i):e.get(i)),$E=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Da=(i,e,t,r)=>(Up(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),At;function BE(i){return`
1358
1358
  <style>
1359
1359
  :host {
1360
1360
  box-sizing: border-box;
@@ -1368,27 +1368,27 @@ bp-player[has-error] {
1368
1368
  }
1369
1369
  </style>
1370
1370
  <img crossorigin loading="eager" decoding="async">
1371
- `}var zr=class extends c.HTMLElement{constructor(){if(super(),DE(this,At,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(xs(this,At,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=Rs(this,At))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Rs(this,At))==null?void 0:e.unassociateElement)==null||t.call(e,this),xs(this,At,null)}attributeChangedCallback(e,t,r){var o,n,a,l,d;[s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Rs(this,At))==null?void 0:o.unassociateElement)==null||n.call(o,this),xs(this,At,null)),r&&this.isConnected&&(xs(this,At,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=Rs(this,At))==null?void 0:l.associateElement)==null||d.call(l,this)))}get mediaPreviewImage(){return D(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){O(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(s.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(s.MEDIA_PREVIEW_COORDS);return}this.setAttribute(s.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[r,o,n,a]=e,l=t.split("#")[0],d=getComputedStyle(this),{maxWidth:m,maxHeight:h,minWidth:g,minHeight:E}=d,p=Math.min(parseInt(m)/n,parseInt(h)/a),T=Math.max(parseInt(g)/n,parseInt(E)/a),f=p<1,b=f?p:T>1?T:1,{style:S}=J(this.shadowRoot,":host"),te=J(this.shadowRoot,"img").style,Se=this.shadowRoot.querySelector("img"),ke=f?"min":"max";S.setProperty(`${ke}-width`,"initial","important"),S.setProperty(`${ke}-height`,"initial","important"),S.width=`${n*b}px`,S.height=`${a*b}px`;let _r=()=>{te.width=`${this.imgWidth*b}px`,te.height=`${this.imgHeight*b}px`,te.display="block"};Se.src!==l&&(Se.onload=()=>{this.imgWidth=Se.naturalWidth,this.imgHeight=Se.naturalHeight,_r()},Se.src=l,_r()),_r(),te.transform=`translate(-${r*b}px, -${o*b}px)`}};At=new WeakMap;zr.shadowRootOptions={mode:"open"};zr.getTemplateHTML=OE;c.customElements.get("media-preview-thumbnail")||c.customElements.define("media-preview-thumbnail",zr);var Ps=zr;var Dp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Pp=(i,e,t)=>(Dp(i,e,"read from private field"),t?t.call(i):e.get(i)),NE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},UE=(i,e,t,r)=>(Dp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Nn,rc=class extends Oe{constructor(){super(),NE(this,Nn,void 0),UE(this,Nn,this.shadowRoot.querySelector("slot")),Pp(this,Nn).textContent=it(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_PREVIEW_TIME&&r!=null&&(Pp(this,Nn).textContent=it(parseFloat(r)))}get mediaPreviewTime(){return H(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}};Nn=new WeakMap;c.customElements.get("media-preview-time-display")||c.customElements.define("media-preview-time-display",rc);var Yr={SEEK_OFFSET:"seekoffset"},oc=30,HE=i=>`
1371
+ `}var zr=class extends c.HTMLElement{constructor(){if(super(),$E(this,At,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(Da(this,At,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=Pa(this,At))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Pa(this,At))==null?void 0:e.unassociateElement)==null||t.call(e,this),Da(this,At,null)}attributeChangedCallback(e,t,r){var o,n,s,l,d;[a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Pa(this,At))==null?void 0:o.unassociateElement)==null||n.call(o,this),Da(this,At,null)),r&&this.isConnected&&(Da(this,At,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Pa(this,At))==null?void 0:l.associateElement)==null||d.call(l,this)))}get mediaPreviewImage(){return D(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){O(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(a.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(a.MEDIA_PREVIEW_COORDS);return}this.setAttribute(a.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[r,o,n,s]=e,l=t.split("#")[0],d=getComputedStyle(this),{maxWidth:m,maxHeight:h,minWidth:g,minHeight:E}=d,p=Math.min(parseInt(m)/n,parseInt(h)/s),T=Math.max(parseInt(g)/n,parseInt(E)/s),f=p<1,b=f?p:T>1?T:1,{style:S}=J(this.shadowRoot,":host"),te=J(this.shadowRoot,"img").style,Se=this.shadowRoot.querySelector("img"),ke=f?"min":"max";S.setProperty(`${ke}-width`,"initial","important"),S.setProperty(`${ke}-height`,"initial","important"),S.width=`${n*b}px`,S.height=`${s*b}px`;let _r=()=>{te.width=`${this.imgWidth*b}px`,te.height=`${this.imgHeight*b}px`,te.display="block"};Se.src!==l&&(Se.onload=()=>{this.imgWidth=Se.naturalWidth,this.imgHeight=Se.naturalHeight,_r()},Se.src=l,_r()),_r(),te.transform=`translate(-${r*b}px, -${o*b}px)`}};At=new WeakMap;zr.shadowRootOptions={mode:"open"};zr.getTemplateHTML=BE;c.customElements.get("media-preview-thumbnail")||c.customElements.define("media-preview-thumbnail",zr);var Oa=zr;var $p=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Hp=(i,e,t)=>($p(i,e,"read from private field"),t?t.call(i):e.get(i)),VE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},WE=(i,e,t,r)=>($p(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Hn,ac=class extends Oe{constructor(){super(),VE(this,Hn,void 0),WE(this,Hn,this.shadowRoot.querySelector("slot")),Hp(this,Hn).textContent=it(0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PREVIEW_TIME&&r!=null&&(Hp(this,Hn).textContent=it(parseFloat(r)))}get mediaPreviewTime(){return H(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,a.MEDIA_PREVIEW_TIME,e)}};Hn=new WeakMap;c.customElements.get("media-preview-time-display")||c.customElements.define("media-preview-time-display",ac);var Yr={SEEK_OFFSET:"seekoffset"},lc=30,FE=i=>`
1372
1372
  <svg aria-hidden="true" viewBox="0 0 20 24">
1373
1373
  <defs>
1374
1374
  <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
1375
1375
  </defs>
1376
1376
  <text class="text value" transform="translate(2.18 19.87)">${i}</text>
1377
1377
  <path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/>
1378
- </svg>`;function $E(i,e){return`
1379
- <slot name="icon">${HE(e.seekOffset)}</slot>
1380
- `}function BE(){return _("Seek backward")}var VE=0,Un=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Yr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=H(this,Yr.SEEK_OFFSET,oc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Yr.SEEK_OFFSET&&(this.seekOffset=H(this,Yr.SEEK_OFFSET,oc))}get seekOffset(){return H(this,Yr.SEEK_OFFSET,oc)}set seekOffset(e){B(this,Yr.SEEK_OFFSET,e),this.setAttribute("aria-label",_("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Na(Ua(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME,VE)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Un.getSlotTemplateHTML=$E;Un.getTooltipContentHTML=BE;c.customElements.get("media-seek-backward-button")||c.customElements.define("media-seek-backward-button",Un);var Qr={SEEK_OFFSET:"seekoffset"},nc=30,WE=i=>`
1378
+ </svg>`;function qE(i,e){return`
1379
+ <slot name="icon">${FE(e.seekOffset)}</slot>
1380
+ `}function KE(){return _("Seek backward")}var GE=0,$n=class extends F{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,Yr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=H(this,Yr.SEEK_OFFSET,lc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Yr.SEEK_OFFSET&&(this.seekOffset=H(this,Yr.SEEK_OFFSET,lc))}get seekOffset(){return H(this,Yr.SEEK_OFFSET,lc)}set seekOffset(e){B(this,Yr.SEEK_OFFSET,e),this.setAttribute("aria-label",_("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Hs($s(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,a.MEDIA_CURRENT_TIME,GE)}set mediaCurrentTime(e){B(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};$n.getSlotTemplateHTML=qE;$n.getTooltipContentHTML=KE;c.customElements.get("media-seek-backward-button")||c.customElements.define("media-seek-backward-button",$n);var Qr={SEEK_OFFSET:"seekoffset"},dc=30,zE=i=>`
1381
1381
  <svg aria-hidden="true" viewBox="0 0 20 24">
1382
1382
  <defs>
1383
1383
  <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
1384
1384
  </defs>
1385
1385
  <text class="text value" transform="translate(8.9 19.87)">${i}</text>
1386
1386
  <path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/>
1387
- </svg>`;function FE(i,e){return`
1388
- <slot name="icon">${WE(e.seekOffset)}</slot>
1389
- `}function KE(){return _("Seek forward")}var GE=0,Hn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Qr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=H(this,Qr.SEEK_OFFSET,nc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Qr.SEEK_OFFSET&&(this.seekOffset=H(this,Qr.SEEK_OFFSET,nc))}get seekOffset(){return H(this,Qr.SEEK_OFFSET,nc)}set seekOffset(e){B(this,Qr.SEEK_OFFSET,e),this.setAttribute("aria-label",_("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Na(Ua(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME,GE)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Hn.getSlotTemplateHTML=FE;Hn.getTooltipContentHTML=KE;c.customElements.get("media-seek-forward-button")||c.customElements.define("media-seek-forward-button",Hn);var Up=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ac=(i,e,t)=>(Up(i,e,"read from private field"),t?t.call(i):e.get(i)),qE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},zE=(i,e,t,r)=>(Up(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Zr,ji={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Op=[...Object.values(ji),s.MEDIA_CURRENT_TIME,s.MEDIA_DURATION,s.MEDIA_SEEKABLE],Np=["Enter"," "],YE="&nbsp;/&nbsp;",sc=(i,{timesSep:e=YE}={})=>{var t,r;let o=(t=i.mediaCurrentTime)!=null?t:0,[,n]=(r=i.mediaSeekable)!=null?r:[],a=0;Number.isFinite(i.mediaDuration)?a=i.mediaDuration:Number.isFinite(n)&&(a=n);let l=i.remaining?it(0-(a-o)):it(o);return i.showDuration?`${l}${e}${it(a)}`:l},QE="video not loaded, unknown time.",ZE=i=>{var e;let t=i.mediaCurrentTime,[,r]=(e=i.mediaSeekable)!=null?e:[],o=null;if(Number.isFinite(i.mediaDuration)?o=i.mediaDuration:Number.isFinite(r)&&(o=r),t==null||o===null){i.setAttribute("aria-valuetext",QE);return}let n=i.remaining?Hi(0-(o-t)):Hi(t);if(!i.showDuration){i.setAttribute("aria-valuetext",n);return}let a=Hi(o),l=`${n} of ${a}`;i.setAttribute("aria-valuetext",l)};function XE(i,e){return`
1390
- <slot>${sc(e)}</slot>
1391
- `}var Ds=class extends Oe{constructor(){super(),qE(this,Zr,void 0),zE(this,Zr,this.shadowRoot.querySelector("slot")),ac(this,Zr).innerHTML=`${sc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Op,"disabled"]}connectedCallback(){let{style:e}=J(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",_("playback time"));let t=r=>{let{key:o}=r;if(!Np.includes(o)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:o,altKey:n,key:a}=r;if(o||n||!Np.includes(a)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,r){Op.includes(e)?this.update():e==="disabled"&&r!==t&&(r==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,r)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return w(this,ji.REMAINING)}set remaining(e){M(this,ji.REMAINING,e)}get showDuration(){return w(this,ji.SHOW_DURATION)}set showDuration(e){M(this,ji.SHOW_DURATION,e)}get noToggle(){return w(this,ji.NO_TOGGLE)}set noToggle(e){M(this,ji.NO_TOGGLE,e)}get mediaDuration(){return H(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}update(){let e=sc(this);ZE(this),e!==ac(this,Zr).innerHTML&&(ac(this,Zr).innerHTML=e)}};Zr=new WeakMap;Ds.getSlotTemplateHTML=XE;c.customElements.get("media-time-display")||c.customElements.define("media-time-display",Ds);var Hp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ye=(i,e,t)=>(Hp(i,e,"read from private field"),t?t.call(i):e.get(i)),St=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ve=(i,e,t,r)=>(Hp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),JE=(i,e,t,r)=>({set _(o){Ve(i,e,o,t)},get _(){return ye(i,e,r)}}),Xr,Os,Jr,$n,Ns,Us,Hs,jr,er,$s,Bs=class{constructor(e,t,r){St(this,Xr,void 0),St(this,Os,void 0),St(this,Jr,void 0),St(this,$n,void 0),St(this,Ns,void 0),St(this,Us,void 0),St(this,Hs,void 0),St(this,jr,void 0),St(this,er,0),St(this,$s,(o=performance.now())=>{Ve(this,er,requestAnimationFrame(ye(this,$s))),Ve(this,$n,performance.now()-ye(this,Jr));let n=1e3/this.fps;if(ye(this,$n)>n){Ve(this,Jr,o-ye(this,$n)%n);let a=1e3/((o-ye(this,Os))/++JE(this,Ns)._),l=(o-ye(this,Us))/1e3/this.duration,d=ye(this,Hs)+l*this.playbackRate;d-ye(this,Xr).valueAsNumber>0?Ve(this,jr,this.playbackRate/this.duration/a):(Ve(this,jr,.995*ye(this,jr)),d=ye(this,Xr).valueAsNumber+ye(this,jr)),this.callback(d)}}),Ve(this,Xr,e),this.callback=t,this.fps=r}start(){ye(this,er)===0&&(Ve(this,Jr,performance.now()),Ve(this,Os,ye(this,Jr)),Ve(this,Ns,0),ye(this,$s).call(this))}stop(){ye(this,er)!==0&&(cancelAnimationFrame(ye(this,er)),Ve(this,er,0))}update({start:e,duration:t,playbackRate:r}){let o=e-ye(this,Xr).valueAsNumber,n=Math.abs(t-this.duration);(o>0||o<-.03||n>=.5)&&this.callback(e),Ve(this,Hs,e),Ve(this,Us,performance.now()),this.duration=t,this.playbackRate=r}};Xr=new WeakMap;Os=new WeakMap;Jr=new WeakMap;$n=new WeakMap;Ns=new WeakMap;Us=new WeakMap;Hs=new WeakMap;jr=new WeakMap;er=new WeakMap;$s=new WeakMap;var uc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ce=(i,e,t)=>(uc(i,e,"read from private field"),t?t.call(i):e.get(i)),fe=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ye=(i,e,t,r)=>(uc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Le=(i,e,t)=>(uc(i,e,"access private method"),t),eo,tr,Fs,Vn,Ks,Ws,Wn,Fn,to,io,ro,Bn,hc,$p,lc,Gs,pc,qs,mc,zs,vc,dc,Bp,Kn,Ys,cc,Vp,jE="video not loaded, unknown time.",eg=i=>{let e=i.range,t=Hi(+Wp(i)),r=Hi(+i.mediaSeekableEnd),o=t&&r?`${t} of ${r}`:jE;e.setAttribute("aria-valuetext",o)};function tg(i){return`
1387
+ </svg>`;function YE(i,e){return`
1388
+ <slot name="icon">${zE(e.seekOffset)}</slot>
1389
+ `}function QE(){return _("Seek forward")}var ZE=0,Bn=class extends F{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,Qr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=H(this,Qr.SEEK_OFFSET,dc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Qr.SEEK_OFFSET&&(this.seekOffset=H(this,Qr.SEEK_OFFSET,dc))}get seekOffset(){return H(this,Qr.SEEK_OFFSET,dc)}set seekOffset(e){B(this,Qr.SEEK_OFFSET,e),this.setAttribute("aria-label",_("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Hs($s(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,a.MEDIA_CURRENT_TIME,ZE)}set mediaCurrentTime(e){B(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Bn.getSlotTemplateHTML=YE;Bn.getTooltipContentHTML=QE;c.customElements.get("media-seek-forward-button")||c.customElements.define("media-seek-forward-button",Bn);var Wp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},cc=(i,e,t)=>(Wp(i,e,"read from private field"),t?t.call(i):e.get(i)),XE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},JE=(i,e,t,r)=>(Wp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Zr,ji={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Bp=[...Object.values(ji),a.MEDIA_CURRENT_TIME,a.MEDIA_DURATION,a.MEDIA_SEEKABLE],Vp=["Enter"," "],jE="&nbsp;/&nbsp;",uc=(i,{timesSep:e=jE}={})=>{var t,r;let o=(t=i.mediaCurrentTime)!=null?t:0,[,n]=(r=i.mediaSeekable)!=null?r:[],s=0;Number.isFinite(i.mediaDuration)?s=i.mediaDuration:Number.isFinite(n)&&(s=n);let l=i.remaining?it(0-(s-o)):it(o);return i.showDuration?`${l}${e}${it(s)}`:l},eg="video not loaded, unknown time.",tg=i=>{var e;let t=i.mediaCurrentTime,[,r]=(e=i.mediaSeekable)!=null?e:[],o=null;if(Number.isFinite(i.mediaDuration)?o=i.mediaDuration:Number.isFinite(r)&&(o=r),t==null||o===null){i.setAttribute("aria-valuetext",eg);return}let n=i.remaining?Hi(0-(o-t)):Hi(t);if(!i.showDuration){i.setAttribute("aria-valuetext",n);return}let s=Hi(o),l=`${n} of ${s}`;i.setAttribute("aria-valuetext",l)};function ig(i,e){return`
1390
+ <slot>${uc(e)}</slot>
1391
+ `}var Na=class extends Oe{constructor(){super(),XE(this,Zr,void 0),JE(this,Zr,this.shadowRoot.querySelector("slot")),cc(this,Zr).innerHTML=`${uc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Bp,"disabled"]}connectedCallback(){let{style:e}=J(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",_("playback time"));let t=r=>{let{key:o}=r;if(!Vp.includes(o)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:o,altKey:n,key:s}=r;if(o||n||!Vp.includes(s)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,r){Bp.includes(e)?this.update():e==="disabled"&&r!==t&&(r==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,r)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return C(this,ji.REMAINING)}set remaining(e){R(this,ji.REMAINING,e)}get showDuration(){return C(this,ji.SHOW_DURATION)}set showDuration(e){R(this,ji.SHOW_DURATION,e)}get noToggle(){return C(this,ji.NO_TOGGLE)}set noToggle(e){R(this,ji.NO_TOGGLE,e)}get mediaDuration(){return H(this,a.MEDIA_DURATION)}set mediaDuration(e){B(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return H(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,a.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(a.MEDIA_SEEKABLE);return}this.setAttribute(a.MEDIA_SEEKABLE,e.join(":"))}update(){let e=uc(this);tg(this),e!==cc(this,Zr).innerHTML&&(cc(this,Zr).innerHTML=e)}};Zr=new WeakMap;Na.getSlotTemplateHTML=ig;c.customElements.get("media-time-display")||c.customElements.define("media-time-display",Na);var Fp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ye=(i,e,t)=>(Fp(i,e,"read from private field"),t?t.call(i):e.get(i)),St=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ve=(i,e,t,r)=>(Fp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),rg=(i,e,t,r)=>({set _(o){Ve(i,e,o,t)},get _(){return ye(i,e,r)}}),Xr,Ua,Jr,Vn,Ha,$a,Ba,jr,er,Va,Wa=class{constructor(e,t,r){St(this,Xr,void 0),St(this,Ua,void 0),St(this,Jr,void 0),St(this,Vn,void 0),St(this,Ha,void 0),St(this,$a,void 0),St(this,Ba,void 0),St(this,jr,void 0),St(this,er,0),St(this,Va,(o=performance.now())=>{Ve(this,er,requestAnimationFrame(ye(this,Va))),Ve(this,Vn,performance.now()-ye(this,Jr));let n=1e3/this.fps;if(ye(this,Vn)>n){Ve(this,Jr,o-ye(this,Vn)%n);let s=1e3/((o-ye(this,Ua))/++rg(this,Ha)._),l=(o-ye(this,$a))/1e3/this.duration,d=ye(this,Ba)+l*this.playbackRate;d-ye(this,Xr).valueAsNumber>0?Ve(this,jr,this.playbackRate/this.duration/s):(Ve(this,jr,.995*ye(this,jr)),d=ye(this,Xr).valueAsNumber+ye(this,jr)),this.callback(d)}}),Ve(this,Xr,e),this.callback=t,this.fps=r}start(){ye(this,er)===0&&(Ve(this,Jr,performance.now()),Ve(this,Ua,ye(this,Jr)),Ve(this,Ha,0),ye(this,Va).call(this))}stop(){ye(this,er)!==0&&(cancelAnimationFrame(ye(this,er)),Ve(this,er,0))}update({start:e,duration:t,playbackRate:r}){let o=e-ye(this,Xr).valueAsNumber,n=Math.abs(t-this.duration);(o>0||o<-.03||n>=.5)&&this.callback(e),Ve(this,Ba,e),Ve(this,$a,performance.now()),this.duration=t,this.playbackRate=r}};Xr=new WeakMap;Ua=new WeakMap;Jr=new WeakMap;Vn=new WeakMap;Ha=new WeakMap;$a=new WeakMap;Ba=new WeakMap;jr=new WeakMap;er=new WeakMap;Va=new WeakMap;var vc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ce=(i,e,t)=>(vc(i,e,"read from private field"),t?t.call(i):e.get(i)),fe=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ye=(i,e,t,r)=>(vc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Le=(i,e,t)=>(vc(i,e,"access private method"),t),eo,tr,Ka,Fn,Ga,qa,qn,Kn,to,io,ro,Wn,fc,qp,hc,za,Ec,Ya,gc,Qa,bc,pc,Kp,Gn,Za,mc,Gp,og="video not loaded, unknown time.",ng=i=>{let e=i.range,t=Hi(+zp(i)),r=Hi(+i.mediaSeekableEnd),o=t&&r?`${t} of ${r}`:og;e.setAttribute("aria-valuetext",o)};function sg(i){return`
1392
1392
  <style>
1393
1393
  :host {
1394
1394
  --media-box-border-radius: 4px;
@@ -1446,7 +1446,7 @@ bp-player[has-error] {
1446
1446
  opacity: 0;
1447
1447
  }
1448
1448
 
1449
- :host(:is([${s.MEDIA_PREVIEW_IMAGE}], [${s.MEDIA_PREVIEW_TIME}])[dragging]) [part~="preview-box"] {
1449
+ :host(:is([${a.MEDIA_PREVIEW_IMAGE}], [${a.MEDIA_PREVIEW_TIME}])[dragging]) [part~="preview-box"] {
1450
1450
  transition-duration: var(--media-preview-transition-duration-in, .5s);
1451
1451
  transition-delay: var(--media-preview-transition-delay-in, .25s);
1452
1452
  visibility: visible;
@@ -1454,7 +1454,7 @@ bp-player[has-error] {
1454
1454
  }
1455
1455
 
1456
1456
  @media (hover: hover) {
1457
- :host(:is([${s.MEDIA_PREVIEW_IMAGE}], [${s.MEDIA_PREVIEW_TIME}]):hover) [part~="preview-box"] {
1457
+ :host(:is([${a.MEDIA_PREVIEW_IMAGE}], [${a.MEDIA_PREVIEW_TIME}]):hover) [part~="preview-box"] {
1458
1458
  transition-duration: var(--media-preview-transition-duration-in, .5s);
1459
1459
  transition-delay: var(--media-preview-transition-delay-in, .25s);
1460
1460
  visibility: visible;
@@ -1479,20 +1479,20 @@ bp-player[has-error] {
1479
1479
  var(--media-preview-border-radius) var(--media-preview-border-radius) 0 0);
1480
1480
  }
1481
1481
 
1482
- :host([${s.MEDIA_PREVIEW_IMAGE}][dragging]) media-preview-thumbnail,
1483
- :host([${s.MEDIA_PREVIEW_IMAGE}][dragging]) ::slotted(media-preview-thumbnail) {
1482
+ :host([${a.MEDIA_PREVIEW_IMAGE}][dragging]) media-preview-thumbnail,
1483
+ :host([${a.MEDIA_PREVIEW_IMAGE}][dragging]) ::slotted(media-preview-thumbnail) {
1484
1484
  transition-delay: var(--media-preview-transition-delay-in, .25s);
1485
1485
  visibility: visible;
1486
1486
  }
1487
1487
 
1488
1488
  @media (hover: hover) {
1489
- :host([${s.MEDIA_PREVIEW_IMAGE}]:hover) media-preview-thumbnail,
1490
- :host([${s.MEDIA_PREVIEW_IMAGE}]:hover) ::slotted(media-preview-thumbnail) {
1489
+ :host([${a.MEDIA_PREVIEW_IMAGE}]:hover) media-preview-thumbnail,
1490
+ :host([${a.MEDIA_PREVIEW_IMAGE}]:hover) ::slotted(media-preview-thumbnail) {
1491
1491
  transition-delay: var(--media-preview-transition-delay-in, .25s);
1492
1492
  visibility: visible;
1493
1493
  }
1494
1494
 
1495
- :host([${s.MEDIA_PREVIEW_TIME}]:hover) {
1495
+ :host([${a.MEDIA_PREVIEW_TIME}]:hover) {
1496
1496
  --media-time-range-hover-display: block;
1497
1497
  }
1498
1498
  }
@@ -1515,8 +1515,8 @@ bp-player[has-error] {
1515
1515
  text-shadow: var(--media-preview-chapter-text-shadow, 0 0 4px rgb(0 0 0 / .75));
1516
1516
  }
1517
1517
 
1518
- :host([${s.MEDIA_PREVIEW_IMAGE}]) media-preview-chapter-display,
1519
- :host([${s.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-chapter-display) {
1518
+ :host([${a.MEDIA_PREVIEW_IMAGE}]) media-preview-chapter-display,
1519
+ :host([${a.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-chapter-display) {
1520
1520
  transition-delay: var(--media-preview-transition-delay-in, .25s);
1521
1521
  border-radius: var(--media-preview-chapter-border-radius, 0);
1522
1522
  padding: var(--media-preview-chapter-padding, 3.5px 9px 0);
@@ -1524,8 +1524,8 @@ bp-player[has-error] {
1524
1524
  min-width: 100%;
1525
1525
  }
1526
1526
 
1527
- media-preview-chapter-display[${s.MEDIA_PREVIEW_CHAPTER}],
1528
- ::slotted(media-preview-chapter-display[${s.MEDIA_PREVIEW_CHAPTER}]) {
1527
+ media-preview-chapter-display[${a.MEDIA_PREVIEW_CHAPTER}],
1528
+ ::slotted(media-preview-chapter-display[${a.MEDIA_PREVIEW_CHAPTER}]) {
1529
1529
  visibility: visible;
1530
1530
  }
1531
1531
 
@@ -1558,15 +1558,15 @@ bp-player[has-error] {
1558
1558
  ));
1559
1559
  }
1560
1560
 
1561
- :host([${s.MEDIA_PREVIEW_IMAGE}]) media-preview-time-display,
1562
- :host([${s.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-time-display) {
1561
+ :host([${a.MEDIA_PREVIEW_IMAGE}]) media-preview-time-display,
1562
+ :host([${a.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-time-display) {
1563
1563
  transition-delay: var(--media-preview-transition-delay-in, .25s);
1564
1564
  border-radius: var(--media-preview-time-border-radius,
1565
1565
  0 0 var(--media-preview-border-radius) var(--media-preview-border-radius));
1566
1566
  min-width: 100%;
1567
1567
  }
1568
1568
 
1569
- :host([${s.MEDIA_PREVIEW_TIME}]:hover) {
1569
+ :host([${a.MEDIA_PREVIEW_TIME}]:hover) {
1570
1570
  --media-time-range-hover-display: block;
1571
1571
  }
1572
1572
 
@@ -1591,8 +1591,8 @@ bp-player[has-error] {
1591
1591
  <div id="preview-rail">
1592
1592
  <slot name="preview" part="box preview-box">
1593
1593
  <media-preview-thumbnail>
1594
- <template shadowrootmode="${Ps.shadowRootOptions.mode}">
1595
- ${Ps.getTemplateHTML({})}
1594
+ <template shadowrootmode="${Oa.shadowRootOptions.mode}">
1595
+ ${Oa.getTemplateHTML({})}
1596
1596
  </template>
1597
1597
  </media-preview-thumbnail>
1598
1598
  <media-preview-chapter-display></media-preview-chapter-display>
@@ -1605,7 +1605,7 @@ bp-player[has-error] {
1605
1605
 
1606
1606
  </slot>
1607
1607
  </div>
1608
- `}var Vs=(i,e=i.mediaCurrentTime)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;if(Number.isNaN(r))return 0;let o=(e-t)/(r-t);return Math.max(0,Math.min(o,1))},Wp=(i,e=i.range.valueAsNumber)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;return Number.isNaN(r)?0:e*(r-t)+t},Gn=class extends gt{constructor(){super(),fe(this,ro),fe(this,hc),fe(this,Gs),fe(this,qs),fe(this,zs),fe(this,dc),fe(this,Kn),fe(this,cc),fe(this,eo,void 0),fe(this,tr,void 0),fe(this,Fs,void 0),fe(this,Vn,void 0),fe(this,Ks,void 0),fe(this,Ws,void 0),fe(this,Wn,void 0),fe(this,Fn,void 0),fe(this,to,void 0),fe(this,io,void 0),fe(this,lc,r=>{this.dragging||(wr(r)&&(this.range.valueAsNumber=r),ce(this,io)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Ye(this,Fs,this.shadowRoot.querySelectorAll('[part~="box"]')),Ye(this,Ks,this.shadowRoot.querySelector('[part~="preview-box"]')),Ye(this,Ws,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Ye(this,Wn,parseInt(t.getPropertyValue("--media-box-padding-left"))),Ye(this,Fn,parseInt(t.getPropertyValue("--media-box-padding-right"))),Ye(this,tr,new Bs(this.range,ce(this,lc),60))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_DURATION,s.MEDIA_SEEKABLE,s.MEDIA_CURRENT_TIME,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_TIME,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_BUFFERED,s.MEDIA_PLAYBACK_RATE,s.MEDIA_LOADING,s.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",_("seek")),Le(this,ro,Bn).call(this),Ye(this,eo,this.getRootNode()),(e=ce(this,eo))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),Le(this,ro,Bn).call(this),(e=ce(this,eo))==null||e.removeEventListener("transitionstart",this),Ye(this,eo,null)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),t!=r&&(e===s.MEDIA_CURRENT_TIME||e===s.MEDIA_PAUSED||e===s.MEDIA_ENDED||e===s.MEDIA_LOADING||e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE?(ce(this,tr).update({start:Vs(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),Le(this,ro,Bn).call(this),eg(this)):e===s.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=ce(this,to),this.updateBar()))}get mediaChaptersCues(){return ce(this,to)}set mediaChaptersCues(e){var t;Ye(this,to,e),this.updateSegments((t=ce(this,to))==null?void 0:t.map(r=>({start:Vs(this,r.startTime),end:Vs(this,r.endTime)})))}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){M(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,s.MEDIA_LOADING)}set mediaLoading(e){M(this,s.MEDIA_LOADING,e)}get mediaDuration(){return H(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(s.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(r=>+r)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(s.MEDIA_BUFFERED);return}let t=e.map(r=>r.join(":")).join(" ");this.setAttribute(s.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return D(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){O(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return H(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return w(this,s.MEDIA_ENDED)}set mediaEnded(e){M(this,s.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let r;if(this.mediaEnded)r=1;else{let n=this.mediaCurrentTime,[,a=this.mediaSeekableStart]=(e=t.find(([l,d])=>l<=n&&n<=d))!=null?e:[];r=Vs(this,a)}let{style:o}=J(this.shadowRoot,"#buffered");o.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=J(this.shadowRoot,"#current-rail"),r=J(this.shadowRoot,'[part~="current-box"]'),o=Le(this,Gs,pc).call(this,ce(this,Ws)),n=Le(this,qs,mc).call(this,o,this.range.valueAsNumber),a=Le(this,zs,vc).call(this,o,this.range.valueAsNumber);t.style.transform=`translateX(${n})`,t.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${a}`),r.style.setProperty("--_box-width",`${o.box.width}px`),r.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":Le(this,cc,Vp).call(this);break;case"pointermove":Le(this,dc,Bp).call(this,e);break;case"pointerup":ce(this,io)&&Ye(this,io,!1);break;case"pointerdown":Ye(this,io,!0);break;case"pointerleave":Le(this,Kn,Ys).call(this,null);break;case"transitionstart":Ce(e.target,this)&&setTimeout(()=>Le(this,ro,Bn).call(this),0);break}}};eo=new WeakMap;tr=new WeakMap;Fs=new WeakMap;Vn=new WeakMap;Ks=new WeakMap;Ws=new WeakMap;Wn=new WeakMap;Fn=new WeakMap;to=new WeakMap;io=new WeakMap;ro=new WeakSet;Bn=function(){Le(this,hc,$p).call(this)?ce(this,tr).start():ce(this,tr).stop()};hc=new WeakSet;$p=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Ha(this)};lc=new WeakMap;Gs=new WeakSet;pc=function(i){var e;let r=((e=this.getAttribute("bounds")?ut(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),o=this.range.getBoundingClientRect(),n=i.offsetWidth,a=-(o.left-r.left-n/2),l=r.right-o.left-n/2;return{box:{width:n,min:a,max:l},bounds:r,range:o}};qs=new WeakSet;mc=function(i,e){let t=`${e*100}%`,{width:r,min:o,max:n}=i.box;if(!r)return t;if(Number.isNaN(o)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${o}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(n)){let l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};zs=new WeakSet;vc=function(i,e){let{width:t,min:r,max:o}=i.box,n=e*i.range.width;if(n<r+ce(this,Wn)){let a=i.range.left-i.bounds.left-ce(this,Wn);return`${n-t/2+a}px`}if(n>o-ce(this,Fn)){let a=i.bounds.right-i.range.right-ce(this,Fn);return`${n+t/2-a-i.range.width}px`}return 0};dc=new WeakSet;Bp=function(i){let e=[...ce(this,Fs)].some(h=>i.composedPath().includes(h));if(!this.dragging&&(e||!i.composedPath().includes(this))){Le(this,Kn,Ys).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=J(this.shadowRoot,"#preview-rail"),o=J(this.shadowRoot,'[part~="preview-box"]'),n=Le(this,Gs,pc).call(this,ce(this,Ks)),a=(i.clientX-n.range.left)/n.range.width;a=Math.max(0,Math.min(1,a));let l=Le(this,qs,mc).call(this,n,a),d=Le(this,zs,vc).call(this,n,a);r.style.transform=`translateX(${l})`,r.style.setProperty("--_range-width",`${n.range.width}`),o.style.setProperty("--_box-shift",`${d}`),o.style.setProperty("--_box-width",`${n.box.width}px`);let m=Math.round(ce(this,Vn))-Math.round(a*t);Math.abs(m)<1&&a>.01&&a<.99||(Ye(this,Vn,a*t),Le(this,Kn,Ys).call(this,ce(this,Vn)))};Kn=new WeakSet;Ys=function(i){this.dispatchEvent(new c.CustomEvent(y.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};cc=new WeakSet;Vp=function(){ce(this,tr).stop();let i=Wp(this);this.dispatchEvent(new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Gn.shadowRootOptions={mode:"open"};Gn.getContainerTemplateHTML=tg;c.customElements.get("media-time-range")||c.customElements.define("media-time-range",Gn);var ig=1,rg=i=>i.mediaMuted?0:i.mediaVolume,og=i=>`${Math.round(i*100)}%`,fc=class extends gt{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME,s.MEDIA_MUTED,s.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",_("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_VOLUME||e===s.MEDIA_MUTED)&&(this.range.valueAsNumber=rg(this),this.range.setAttribute("aria-valuetext",og(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return H(this,s.MEDIA_VOLUME,ig)}set mediaVolume(e){B(this,s.MEDIA_VOLUME,e)}get mediaMuted(){return w(this,s.MEDIA_MUTED)}set mediaMuted(e){M(this,s.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return D(this,s.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){O(this,s.MEDIA_VOLUME_UNAVAILABLE,e)}};c.customElements.get("media-volume-range")||c.customElements.define("media-volume-range",fc);function ng(i){return`
1608
+ `}var Fa=(i,e=i.mediaCurrentTime)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;if(Number.isNaN(r))return 0;let o=(e-t)/(r-t);return Math.max(0,Math.min(o,1))},zp=(i,e=i.range.valueAsNumber)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;return Number.isNaN(r)?0:e*(r-t)+t},zn=class extends gt{constructor(){super(),fe(this,ro),fe(this,fc),fe(this,za),fe(this,Ya),fe(this,Qa),fe(this,pc),fe(this,Gn),fe(this,mc),fe(this,eo,void 0),fe(this,tr,void 0),fe(this,Ka,void 0),fe(this,Fn,void 0),fe(this,Ga,void 0),fe(this,qa,void 0),fe(this,qn,void 0),fe(this,Kn,void 0),fe(this,to,void 0),fe(this,io,void 0),fe(this,hc,r=>{this.dragging||(Cr(r)&&(this.range.valueAsNumber=r),ce(this,io)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Ye(this,Ka,this.shadowRoot.querySelectorAll('[part~="box"]')),Ye(this,Ga,this.shadowRoot.querySelector('[part~="preview-box"]')),Ye(this,qa,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Ye(this,qn,parseInt(t.getPropertyValue("--media-box-padding-left"))),Ye(this,Kn,parseInt(t.getPropertyValue("--media-box-padding-right"))),Ye(this,tr,new Wa(this.range,ce(this,hc),60))}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_DURATION,a.MEDIA_SEEKABLE,a.MEDIA_CURRENT_TIME,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_TIME,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_BUFFERED,a.MEDIA_PLAYBACK_RATE,a.MEDIA_LOADING,a.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",_("seek")),Le(this,ro,Wn).call(this),Ye(this,eo,this.getRootNode()),(e=ce(this,eo))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),Le(this,ro,Wn).call(this),(e=ce(this,eo))==null||e.removeEventListener("transitionstart",this),Ye(this,eo,null)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),t!=r&&(e===a.MEDIA_CURRENT_TIME||e===a.MEDIA_PAUSED||e===a.MEDIA_ENDED||e===a.MEDIA_LOADING||e===a.MEDIA_DURATION||e===a.MEDIA_SEEKABLE?(ce(this,tr).update({start:Fa(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),Le(this,ro,Wn).call(this),ng(this)):e===a.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===a.MEDIA_DURATION||e===a.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=ce(this,to),this.updateBar()))}get mediaChaptersCues(){return ce(this,to)}set mediaChaptersCues(e){var t;Ye(this,to,e),this.updateSegments((t=ce(this,to))==null?void 0:t.map(r=>({start:Fa(this,r.startTime),end:Fa(this,r.endTime)})))}get mediaPaused(){return C(this,a.MEDIA_PAUSED)}set mediaPaused(e){R(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return C(this,a.MEDIA_LOADING)}set mediaLoading(e){R(this,a.MEDIA_LOADING,e)}get mediaDuration(){return H(this,a.MEDIA_DURATION)}set mediaDuration(e){B(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return H(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,a.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return H(this,a.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){B(this,a.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(a.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(r=>+r)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(a.MEDIA_BUFFERED);return}let t=e.map(r=>r.join(":")).join(" ");this.setAttribute(a.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(a.MEDIA_SEEKABLE);return}this.setAttribute(a.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return D(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){O(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return H(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,a.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return C(this,a.MEDIA_ENDED)}set mediaEnded(e){R(this,a.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let r;if(this.mediaEnded)r=1;else{let n=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=t.find(([l,d])=>l<=n&&n<=d))!=null?e:[];r=Fa(this,s)}let{style:o}=J(this.shadowRoot,"#buffered");o.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=J(this.shadowRoot,"#current-rail"),r=J(this.shadowRoot,'[part~="current-box"]'),o=Le(this,za,Ec).call(this,ce(this,qa)),n=Le(this,Ya,gc).call(this,o,this.range.valueAsNumber),s=Le(this,Qa,bc).call(this,o,this.range.valueAsNumber);t.style.transform=`translateX(${n})`,t.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${s}`),r.style.setProperty("--_box-width",`${o.box.width}px`),r.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":Le(this,mc,Gp).call(this);break;case"pointermove":Le(this,pc,Kp).call(this,e);break;case"pointerup":ce(this,io)&&Ye(this,io,!1);break;case"pointerdown":Ye(this,io,!0);break;case"pointerleave":Le(this,Gn,Za).call(this,null);break;case"transitionstart":Ie(e.target,this)&&setTimeout(()=>Le(this,ro,Wn).call(this),0);break}}};eo=new WeakMap;tr=new WeakMap;Ka=new WeakMap;Fn=new WeakMap;Ga=new WeakMap;qa=new WeakMap;qn=new WeakMap;Kn=new WeakMap;to=new WeakMap;io=new WeakMap;ro=new WeakSet;Wn=function(){Le(this,fc,qp).call(this)?ce(this,tr).start():ce(this,tr).stop()};fc=new WeakSet;qp=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Bs(this)};hc=new WeakMap;za=new WeakSet;Ec=function(i){var e;let r=((e=this.getAttribute("bounds")?ut(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),o=this.range.getBoundingClientRect(),n=i.offsetWidth,s=-(o.left-r.left-n/2),l=r.right-o.left-n/2;return{box:{width:n,min:s,max:l},bounds:r,range:o}};Ya=new WeakSet;gc=function(i,e){let t=`${e*100}%`,{width:r,min:o,max:n}=i.box;if(!r)return t;if(Number.isNaN(o)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${o}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(n)){let l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};Qa=new WeakSet;bc=function(i,e){let{width:t,min:r,max:o}=i.box,n=e*i.range.width;if(n<r+ce(this,qn)){let s=i.range.left-i.bounds.left-ce(this,qn);return`${n-t/2+s}px`}if(n>o-ce(this,Kn)){let s=i.bounds.right-i.range.right-ce(this,Kn);return`${n+t/2-s-i.range.width}px`}return 0};pc=new WeakSet;Kp=function(i){let e=[...ce(this,Ka)].some(h=>i.composedPath().includes(h));if(!this.dragging&&(e||!i.composedPath().includes(this))){Le(this,Gn,Za).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=J(this.shadowRoot,"#preview-rail"),o=J(this.shadowRoot,'[part~="preview-box"]'),n=Le(this,za,Ec).call(this,ce(this,Ga)),s=(i.clientX-n.range.left)/n.range.width;s=Math.max(0,Math.min(1,s));let l=Le(this,Ya,gc).call(this,n,s),d=Le(this,Qa,bc).call(this,n,s);r.style.transform=`translateX(${l})`,r.style.setProperty("--_range-width",`${n.range.width}`),o.style.setProperty("--_box-shift",`${d}`),o.style.setProperty("--_box-width",`${n.box.width}px`);let m=Math.round(ce(this,Fn))-Math.round(s*t);Math.abs(m)<1&&s>.01&&s<.99||(Ye(this,Fn,s*t),Le(this,Gn,Za).call(this,ce(this,Fn)))};Gn=new WeakSet;Za=function(i){this.dispatchEvent(new c.CustomEvent(y.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};mc=new WeakSet;Gp=function(){ce(this,tr).stop();let i=zp(this);this.dispatchEvent(new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};zn.shadowRootOptions={mode:"open"};zn.getContainerTemplateHTML=sg;c.customElements.get("media-time-range")||c.customElements.define("media-time-range",zn);var ag=1,lg=i=>i.mediaMuted?0:i.mediaVolume,dg=i=>`${Math.round(i*100)}%`,_c=class extends gt{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME,a.MEDIA_MUTED,a.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",_("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===a.MEDIA_VOLUME||e===a.MEDIA_MUTED)&&(this.range.valueAsNumber=lg(this),this.range.setAttribute("aria-valuetext",dg(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return H(this,a.MEDIA_VOLUME,ag)}set mediaVolume(e){B(this,a.MEDIA_VOLUME,e)}get mediaMuted(){return C(this,a.MEDIA_MUTED)}set mediaMuted(e){R(this,a.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return D(this,a.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){O(this,a.MEDIA_VOLUME_UNAVAILABLE,e)}};c.customElements.get("media-volume-range")||c.customElements.define("media-volume-range",_c);function cg(i){return`
1609
1609
  <style>
1610
1610
  :host {
1611
1611
  min-width: 4ch;
@@ -1621,7 +1621,7 @@ bp-player[has-error] {
1621
1621
  display: none;
1622
1622
  }
1623
1623
 
1624
- :host([${s.MEDIA_LOOP}]) #checked-indicator {
1624
+ :host([${a.MEDIA_LOOP}]) #checked-indicator {
1625
1625
  display: block;
1626
1626
  }
1627
1627
  </style>
@@ -1634,7 +1634,7 @@ bp-player[has-error] {
1634
1634
  <path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
1635
1635
  </svg>
1636
1636
  </div>
1637
- `}function ag(){return _("Loop")}var qn=class extends F{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=_("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return w(this,s.MEDIA_LOOP)}set mediaLoop(e){M(this,s.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new c.CustomEvent(y.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};qn.getSlotTemplateHTML=ng;qn.getTooltipContentHTML=ag;c.customElements.get("media-loop-button")||c.customElements.define("media-loop-button",qn);function Fp({anchor:i,floating:e,placement:t}){let r=sg({anchor:i,floating:e}),{x:o,y:n}=dg(r,t);return{x:o,y:n}}function sg({anchor:i,floating:e}){return{anchor:lg(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function lg(i,e){var t;let r=i.getBoundingClientRect(),o=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}function dg({anchor:i,floating:e},t){let r=cg(t)==="x"?"y":"x",o=r==="y"?"height":"width",n=Kp(t),a=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,d=i[o]/2-e[o]/2,m;switch(n){case"top":m={x:a,y:i.y-e.height};break;case"bottom":m={x:a,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:l};break;case"left":m={x:i.x-e.width,y:l};break;default:m={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":m[r]-=d;break;case"end":m[r]+=d;break}return m}function Kp(i){return i.split("-")[0]}function cg(i){return["top","bottom"].includes(Kp(i))?"y":"x"}var ci=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},Qs=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var Ic=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},G=(i,e,t)=>(Ic(i,e,"read from private field"),t?t.call(i):e.get(i)),Q=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},kt=(i,e,t,r)=>(Ic(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Z=(i,e,t)=>(Ic(i,e,"access private method"),t),Lt,rr,ui,Zs,Xs,or,Qn,Ec,Gp,el,wc,tl,Js,gc,bc,qp,_c,zp,yc,Yp,oo,no,ao,Zn,il,Mc,Tc,Qp,Rc,Zp,Ac,Xp,xc,Jp,Sc,jp,kc,em,zn,rl,Lc,tm,Yn,ol,js,Cc;function Ct({type:i,text:e,value:t,checked:r}){let o=ee.createElement("media-chrome-menu-item");o.type=i??"",o.part.add("menu-item"),i&&o.part.add(i),o.value=t,o.checked=r;let n=ee.createElement("span");return n.textContent=e,o.append(n),o}function nt(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);if((t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t)return t=t.cloneNode(!0),t;let r=i.shadowRoot.querySelector(`[name="${e}"] > svg`);return r?r.cloneNode(!0):""}function ug(i){return`
1637
+ `}function ug(){return _("Loop")}var Yn=class extends F{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=_("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return C(this,a.MEDIA_LOOP)}set mediaLoop(e){R(this,a.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new c.CustomEvent(y.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Yn.getSlotTemplateHTML=cg;Yn.getTooltipContentHTML=ug;c.customElements.get("media-loop-button")||c.customElements.define("media-loop-button",Yn);function Yp({anchor:i,floating:e,placement:t}){let r=hg({anchor:i,floating:e}),{x:o,y:n}=mg(r,t);return{x:o,y:n}}function hg({anchor:i,floating:e}){return{anchor:pg(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function pg(i,e){var t;let r=i.getBoundingClientRect(),o=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}function mg({anchor:i,floating:e},t){let r=vg(t)==="x"?"y":"x",o=r==="y"?"height":"width",n=Qp(t),s=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,d=i[o]/2-e[o]/2,m;switch(n){case"top":m={x:s,y:i.y-e.height};break;case"bottom":m={x:s,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:l};break;case"left":m={x:i.x-e.width,y:l};break;default:m={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":m[r]-=d;break;case"end":m[r]+=d;break}return m}function Qp(i){return i.split("-")[0]}function vg(i){return["top","bottom"].includes(Qp(i))?"y":"x"}var ci=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},Xa=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var xc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},K=(i,e,t)=>(xc(i,e,"read from private field"),t?t.call(i):e.get(i)),Q=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},kt=(i,e,t,r)=>(xc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Z=(i,e,t)=>(xc(i,e,"access private method"),t),Lt,rr,ui,Ja,ja,or,Xn,yc,Zp,il,Pc,rl,el,Tc,Ac,Xp,Sc,Jp,kc,jp,oo,no,so,Jn,ol,Dc,Lc,em,Oc,tm,Ic,im,Nc,rm,wc,om,Cc,nm,Qn,nl,Rc,sm,Zn,sl,tl,Mc;function It({type:i,text:e,value:t,checked:r}){let o=ee.createElement("media-chrome-menu-item");o.type=i??"",o.part.add("menu-item"),i&&o.part.add(i),o.value=t,o.checked=r;let n=ee.createElement("span");return n.textContent=e,o.append(n),o}function nt(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);if((t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t)return t=t.cloneNode(!0),t;let r=i.shadowRoot.querySelector(`[name="${e}"] > svg`);return r?r.cloneNode(!0):""}function fg(i){return`
1638
1638
  <style>
1639
1639
  :host {
1640
1640
  font: var(--media-font,
@@ -1809,7 +1809,7 @@ bp-player[has-error] {
1809
1809
  <slot></slot>
1810
1810
  </div>
1811
1811
  <slot name="checked-indicator" hidden></slot>
1812
- `}var ir={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},ue=class extends c.HTMLElement{constructor(){if(super(),Q(this,Ec),Q(this,el),Q(this,Js),Q(this,bc),Q(this,_c),Q(this,yc),Q(this,ao),Q(this,il),Q(this,Tc),Q(this,Rc),Q(this,Ac),Q(this,xc),Q(this,Sc),Q(this,kc),Q(this,zn),Q(this,Lc),Q(this,Yn),Q(this,js),Q(this,Lt,null),Q(this,rr,null),Q(this,ui,null),Q(this,Zs,new Set),Q(this,Xs,void 0),Q(this,or,!1),Q(this,Qn,null),Q(this,tl,()=>{let e=G(this,Zs),t=new Set(this.items);for(let r of e)t.has(r)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:r}));for(let r of t)e.has(r)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:r}));kt(this,Zs,t)}),Q(this,oo,()=>{Z(this,ao,Zn).call(this),Z(this,il,Mc).call(this,!1)}),Q(this,no,()=>{Z(this,ao,Zn).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),kt(this,Xs,new MutationObserver(G(this,tl))),G(this,Xs).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[ir.DISABLED,ir.HIDDEN,ir.STYLE,ir.ANCHOR,N.MEDIA_CONTROLLER]}static formatMenuItemText(e,t){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":Z(this,Ec,Gp).call(this,e);break;case"invoke":Z(this,bc,qp).call(this,e);break;case"click":Z(this,Tc,Qp).call(this,e);break;case"toggle":Z(this,Ac,Xp).call(this,e);break;case"focusout":Z(this,Sc,jp).call(this,e);break;case"keydown":Z(this,kc,em).call(this,e);break}}connectedCallback(){var e,t;kt(this,Qn,ln(this.shadowRoot,":host")),Z(this,Js,gc).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),kt(this,Lt,Oa(this)),(t=(e=G(this,Lt))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Nt(Xn(this),G(this,oo)),Nt(this,G(this,no))),Z(this,el,wc).call(this)}disconnectedCallback(){var e,t;Ut(Xn(this),G(this,oo)),Ut(this,G(this,no)),this.disable(),(t=(e=G(this,Lt))==null?void 0:e.unassociateElement)==null||t.call(e,this),kt(this,Lt,null)}attributeChangedCallback(e,t,r){var o,n,a,l;e===ir.HIDDEN&&r!==t?(G(this,or)||kt(this,or,!0),this.hidden?Z(this,yc,Yp).call(this):Z(this,_c,zp).call(this),this.dispatchEvent(new Qs({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===N.MEDIA_CONTROLLER?(t&&((n=(o=G(this,Lt))==null?void 0:o.unassociateElement)==null||n.call(o,this),kt(this,Lt,null)),r&&this.isConnected&&(kt(this,Lt,Oa(this)),(l=(a=G(this,Lt))==null?void 0:a.associateElement)==null||l.call(a,this))):e===ir.DISABLED&&r!==t?r==null?this.enable():this.disable():e===ir.STYLE&&r!==t&&Z(this,Js,gc).call(this)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=$i(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(hg)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(r=>r.value===e);t&&Z(this,js,Cc).call(this,t)}focus(){if(kt(this,rr,sn()),this.items.length){Z(this,Yn,ol).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let r=Z(this,zn,rl).call(this,e);r&&(Z(this,js,Cc).call(this,r,r.type==="checkbox"),G(this,ui)&&!this.hidden&&((t=G(this,rr))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:o}=e,n=this.items,a=(r=(t=Z(this,zn,rl).call(this,e))!=null?t:Z(this,Lc,tm).call(this))!=null?r:n[0],l=n.indexOf(a),d=Math.max(0,l);o==="ArrowDown"?d++:o==="ArrowUp"?d--:e.key==="Home"?d=0:e.key==="End"&&(d=n.length-1),d<0&&(d=n.length-1),d>n.length-1&&(d=0),Z(this,Yn,ol).call(this,n[d]),n[d].focus()}};Lt=new WeakMap;rr=new WeakMap;ui=new WeakMap;Zs=new WeakMap;Xs=new WeakMap;or=new WeakMap;Qn=new WeakMap;Ec=new WeakSet;Gp=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();["header","title"].includes(e.name)&&Z(this,el,wc).call(this),e.name||G(this,tl).call(this)};el=new WeakSet;wc=function(){let i=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');i.hidden=e.assignedNodes().length===0&&i.assignedNodes().length===0};tl=new WeakMap;Js=new WeakSet;gc=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=(i=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:i.trim();e.setAttribute("media",t==="row"?"":"width:0")};bc=new WeakSet;qp=function(i){kt(this,ui,i.relatedTarget),Ce(this,i.relatedTarget)||(this.hidden=!this.hidden)};_c=new WeakSet;zp=function(){var i;(i=G(this,ui))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Nt(Xn(this),G(this,oo)),Nt(this,G(this,no))};yc=new WeakSet;Yp=function(){var i;(i=G(this,ui))==null||i.setAttribute("aria-expanded","false"),Ut(Xn(this),G(this,oo)),Ut(this,G(this,no))};oo=new WeakMap;no=new WeakMap;ao=new WeakSet;Zn=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=Fp({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let o=Xn(this).getBoundingClientRect(),n=o.width-e-i,a=o.height-t-this.offsetHeight,{style:l}=G(this,Qn);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${a}px`);let d=getComputedStyle(this),h=l.getPropertyValue("--_menu-bottom")===d.bottom?a:parseFloat(d.bottom),g=o.height-h-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};il=new WeakSet;Mc=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=G(this,Qn);if(i||r.setProperty("--media-menu-transition-in","none"),t){let o=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${o}px`),Z(this,ao,Zn).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),Z(this,ao,Zn).call(this);r.removeProperty("--media-menu-transition-in")};Tc=new WeakSet;Qp=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(G(this,Rc,Zp))){(e=G(this,rr))==null||e.focus(),this.hidden=!0;return}let t=Z(this,zn,rl).call(this,i);!t||t.hasAttribute("disabled")||(Z(this,Yn,ol).call(this,t),this.handleSelect(i))};Rc=new WeakSet;Zp=function(){var i;return(i=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:i.find(t=>t.matches('button[part~="back"]'))};Ac=new WeakSet;Xp=function(i){if(i.target===this)return;Z(this,xc,Jp).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let t of e)t.invokeTargetElement!=i.target&&i.newState=="open"&&t.getAttribute("aria-expanded")=="true"&&!t.invokeTargetElement.hidden&&t.invokeTargetElement.dispatchEvent(new ci({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);Z(this,il,Mc).call(this,!0)};xc=new WeakSet;Jp=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Sc=new WeakSet;jp=function(i){var e;Ce(this,i.relatedTarget)||(G(this,or)&&((e=G(this,rr))==null||e.focus()),G(this,ui)&&G(this,ui)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};kc=new WeakSet;em=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:d,metaKey:m}=i;if(!(l||d||m)&&this.keysUsed.includes(a))if(i.preventDefault(),i.stopPropagation(),a==="Tab"){if(G(this,or)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()}else a==="Escape"?((n=G(this,rr))==null||n.focus(),G(this,or)&&(this.hidden=!0)):a==="Enter"||a===" "?this.handleSelect(i):this.handleMove(i)};zn=new WeakSet;rl=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Lc=new WeakSet;tm=function(){return this.items.find(i=>i.tabIndex===0)};Yn=new WeakSet;ol=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};js=new WeakSet;Cc=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(r=>r.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((r,o)=>r!=t[o])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};ue.shadowRootOptions={mode:"open"};ue.getTemplateHTML=ug;function hg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function Xn(i){var e;return(e=i.getAttribute("bounds")?ut(i,`#${i.getAttribute("bounds")}`):X(i)||i.parentElement)!=null?e:i}c.customElements.get("media-chrome-menu")||c.customElements.define("media-chrome-menu",ue);var Hc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},It=(i,e,t)=>(Hc(i,e,"read from private field"),t?t.call(i):e.get(i)),Vt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Pc=(i,e,t,r)=>(Hc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),at=(i,e,t)=>(Hc(i,e,"access private method"),t),nl,jn,Dc,im,sl,$c,Bc,rm,wt,so,ea,Oc,om,al,Nc;function pg(i){return`
1812
+ `}var ir={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},ue=class extends c.HTMLElement{constructor(){if(super(),Q(this,yc),Q(this,il),Q(this,el),Q(this,Ac),Q(this,Sc),Q(this,kc),Q(this,so),Q(this,ol),Q(this,Lc),Q(this,Oc),Q(this,Ic),Q(this,Nc),Q(this,wc),Q(this,Cc),Q(this,Qn),Q(this,Rc),Q(this,Zn),Q(this,tl),Q(this,Lt,null),Q(this,rr,null),Q(this,ui,null),Q(this,Ja,new Set),Q(this,ja,void 0),Q(this,or,!1),Q(this,Xn,null),Q(this,rl,()=>{let e=K(this,Ja),t=new Set(this.items);for(let r of e)t.has(r)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:r}));for(let r of t)e.has(r)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:r}));kt(this,Ja,t)}),Q(this,oo,()=>{Z(this,so,Jn).call(this),Z(this,ol,Dc).call(this,!1)}),Q(this,no,()=>{Z(this,so,Jn).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),kt(this,ja,new MutationObserver(K(this,rl))),K(this,ja).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[ir.DISABLED,ir.HIDDEN,ir.STYLE,ir.ANCHOR,N.MEDIA_CONTROLLER]}static formatMenuItemText(e,t){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":Z(this,yc,Zp).call(this,e);break;case"invoke":Z(this,Ac,Xp).call(this,e);break;case"click":Z(this,Lc,em).call(this,e);break;case"toggle":Z(this,Ic,im).call(this,e);break;case"focusout":Z(this,wc,om).call(this,e);break;case"keydown":Z(this,Cc,nm).call(this,e);break}}connectedCallback(){var e,t;kt(this,Xn,cn(this.shadowRoot,":host")),Z(this,el,Tc).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),kt(this,Lt,Us(this)),(t=(e=K(this,Lt))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Nt(jn(this),K(this,oo)),Nt(this,K(this,no))),Z(this,il,Pc).call(this)}disconnectedCallback(){var e,t;Ut(jn(this),K(this,oo)),Ut(this,K(this,no)),this.disable(),(t=(e=K(this,Lt))==null?void 0:e.unassociateElement)==null||t.call(e,this),kt(this,Lt,null)}attributeChangedCallback(e,t,r){var o,n,s,l;e===ir.HIDDEN&&r!==t?(K(this,or)||kt(this,or,!0),this.hidden?Z(this,kc,jp).call(this):Z(this,Sc,Jp).call(this),this.dispatchEvent(new Xa({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===N.MEDIA_CONTROLLER?(t&&((n=(o=K(this,Lt))==null?void 0:o.unassociateElement)==null||n.call(o,this),kt(this,Lt,null)),r&&this.isConnected&&(kt(this,Lt,Us(this)),(l=(s=K(this,Lt))==null?void 0:s.associateElement)==null||l.call(s,this))):e===ir.DISABLED&&r!==t?r==null?this.enable():this.disable():e===ir.STYLE&&r!==t&&Z(this,el,Tc).call(this)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=$i(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Eg)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(r=>r.value===e);t&&Z(this,tl,Mc).call(this,t)}focus(){if(kt(this,rr,dn()),this.items.length){Z(this,Zn,sl).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let r=Z(this,Qn,nl).call(this,e);r&&(Z(this,tl,Mc).call(this,r,r.type==="checkbox"),K(this,ui)&&!this.hidden&&((t=K(this,rr))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:o}=e,n=this.items,s=(r=(t=Z(this,Qn,nl).call(this,e))!=null?t:Z(this,Rc,sm).call(this))!=null?r:n[0],l=n.indexOf(s),d=Math.max(0,l);o==="ArrowDown"?d++:o==="ArrowUp"?d--:e.key==="Home"?d=0:e.key==="End"&&(d=n.length-1),d<0&&(d=n.length-1),d>n.length-1&&(d=0),Z(this,Zn,sl).call(this,n[d]),n[d].focus()}};Lt=new WeakMap;rr=new WeakMap;ui=new WeakMap;Ja=new WeakMap;ja=new WeakMap;or=new WeakMap;Xn=new WeakMap;yc=new WeakSet;Zp=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();["header","title"].includes(e.name)&&Z(this,il,Pc).call(this),e.name||K(this,rl).call(this)};il=new WeakSet;Pc=function(){let i=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');i.hidden=e.assignedNodes().length===0&&i.assignedNodes().length===0};rl=new WeakMap;el=new WeakSet;Tc=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=(i=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:i.trim();e.setAttribute("media",t==="row"?"":"width:0")};Ac=new WeakSet;Xp=function(i){kt(this,ui,i.relatedTarget),Ie(this,i.relatedTarget)||(this.hidden=!this.hidden)};Sc=new WeakSet;Jp=function(){var i;(i=K(this,ui))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Nt(jn(this),K(this,oo)),Nt(this,K(this,no))};kc=new WeakSet;jp=function(){var i;(i=K(this,ui))==null||i.setAttribute("aria-expanded","false"),Ut(jn(this),K(this,oo)),Ut(this,K(this,no))};oo=new WeakMap;no=new WeakMap;so=new WeakSet;Jn=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=Yp({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let o=jn(this).getBoundingClientRect(),n=o.width-e-i,s=o.height-t-this.offsetHeight,{style:l}=K(this,Xn);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${s}px`);let d=getComputedStyle(this),h=l.getPropertyValue("--_menu-bottom")===d.bottom?s:parseFloat(d.bottom),g=o.height-h-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};ol=new WeakSet;Dc=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=K(this,Xn);if(i||r.setProperty("--media-menu-transition-in","none"),t){let o=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${o}px`),Z(this,so,Jn).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),Z(this,so,Jn).call(this);r.removeProperty("--media-menu-transition-in")};Lc=new WeakSet;em=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(K(this,Oc,tm))){(e=K(this,rr))==null||e.focus(),this.hidden=!0;return}let t=Z(this,Qn,nl).call(this,i);!t||t.hasAttribute("disabled")||(Z(this,Zn,sl).call(this,t),this.handleSelect(i))};Oc=new WeakSet;tm=function(){var i;return(i=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:i.find(t=>t.matches('button[part~="back"]'))};Ic=new WeakSet;im=function(i){if(i.target===this)return;Z(this,Nc,rm).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let t of e)t.invokeTargetElement!=i.target&&i.newState=="open"&&t.getAttribute("aria-expanded")=="true"&&!t.invokeTargetElement.hidden&&t.invokeTargetElement.dispatchEvent(new ci({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);Z(this,ol,Dc).call(this,!0)};Nc=new WeakSet;rm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};wc=new WeakSet;om=function(i){var e;Ie(this,i.relatedTarget)||(K(this,or)&&((e=K(this,rr))==null||e.focus()),K(this,ui)&&K(this,ui)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Cc=new WeakSet;nm=function(i){var e,t,r,o,n;let{key:s,ctrlKey:l,altKey:d,metaKey:m}=i;if(!(l||d||m)&&this.keysUsed.includes(s))if(i.preventDefault(),i.stopPropagation(),s==="Tab"){if(K(this,or)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()}else s==="Escape"?((n=K(this,rr))==null||n.focus(),K(this,or)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(i):this.handleMove(i)};Qn=new WeakSet;nl=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Rc=new WeakSet;sm=function(){return this.items.find(i=>i.tabIndex===0)};Zn=new WeakSet;sl=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};tl=new WeakSet;Mc=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(r=>r.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((r,o)=>r!=t[o])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};ue.shadowRootOptions={mode:"open"};ue.getTemplateHTML=fg;function Eg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function jn(i){var e;return(e=i.getAttribute("bounds")?ut(i,`#${i.getAttribute("bounds")}`):X(i)||i.parentElement)!=null?e:i}c.customElements.get("media-chrome-menu")||c.customElements.define("media-chrome-menu",ue);var Wc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},wt=(i,e,t)=>(Wc(i,e,"read from private field"),t?t.call(i):e.get(i)),Vt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Uc=(i,e,t,r)=>(Wc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),st=(i,e,t)=>(Wc(i,e,"access private method"),t),al,ts,Hc,am,dl,Fc,qc,lm,Ct,ao,is,$c,dm,ll,Bc;function gg(i){return`
1813
1813
  <style>
1814
1814
  :host {
1815
1815
  transition: var(--media-menu-item-transition,
@@ -1927,7 +1927,7 @@ bp-player[has-error] {
1927
1927
  ${this.getSuffixSlotInnerHTML(i)}
1928
1928
  </slot>
1929
1929
  <slot name="submenu"></slot>
1930
- `}function mg(i){return""}var Qe={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},We=class extends c.HTMLElement{constructor(){if(super(),Vt(this,Dc),Vt(this,sl),Vt(this,Bc),Vt(this,so),Vt(this,Oc),Vt(this,al),Vt(this,nl,!1),Vt(this,jn,void 0),Vt(this,wt,()=>{var e,t;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let r=this.shadowRoot.querySelector('slot[name="description"]'),o=(e=this.submenuElement.checkedItems)==null?void 0:e[0],n=(t=o==null?void 0:o.dataset.description)!=null?t:o==null?void 0:o.text,a=ee.createElement("span");a.textContent=n??"",r.replaceChildren(a)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Qe.TYPE,Qe.DISABLED,Qe.CHECKED,Qe.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Jn(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":at(this,Dc,im).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":at(this,Oc,om).call(this,e);break;case"keyup":at(this,so,ea).call(this,e);break}}attributeChangedCallback(e,t,r){e===Qe.CHECKED&&Jn(this)&&!It(this,nl)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===Qe.TYPE&&r!==t?this.role="menuitem"+r:e===Qe.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Qe.DISABLED)||this.enable(),this.role="menuitem"+this.type,Pc(this,jn,Uc(this,this.parentNode)),at(this,al,Nc).call(this),this.submenuElement&&at(this,sl,$c).call(this)}disconnectedCallback(){this.disable(),at(this,al,Nc).call(this),Pc(this,jn,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=$i(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(Qe.TYPE))!=null?e:""}set type(e){this.setAttribute(Qe.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Qe.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Qe.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Jn(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Jn(this)&&(Pc(this,nl,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Jn(this)||this.invokeTargetElement&&Ce(this,e.target)&&this.invokeTargetElement.dispatchEvent(new ci({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};nl=new WeakMap;jn=new WeakMap;Dc=new WeakSet;im=function(i){let e=i.target;if(!(e!=null&&e.name))for(let r of e.assignedNodes({flatten:!0}))r instanceof Text&&r.textContent.trim()===""&&r.remove();e.name==="submenu"&&(this.submenuElement?at(this,sl,$c).call(this):at(this,Bc,rm).call(this))};sl=new WeakSet;$c=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",It(this,wt)),this.submenuElement.addEventListener("addmenuitem",It(this,wt)),this.submenuElement.addEventListener("removemenuitem",It(this,wt)),It(this,wt).call(this)};Bc=new WeakSet;rm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",It(this,wt)),this.submenuElement.removeEventListener("addmenuitem",It(this,wt)),this.submenuElement.removeEventListener("removemenuitem",It(this,wt)),It(this,wt).call(this)};wt=new WeakMap;so=new WeakSet;ea=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",at(this,so,ea));return}this.handleClick(i)};Oc=new WeakSet;om=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",at(this,so,ea));return}this.addEventListener("keyup",at(this,so,ea),{once:!0})};al=new WeakSet;Nc=function(){var i;let e=(i=It(this,jn))==null?void 0:i.radioGroupItems;if(!e)return;let t=e.filter(r=>r.getAttribute("aria-checked")==="true").pop();t||(t=e[0]);for(let r of e)r.setAttribute("aria-checked","false");t==null||t.setAttribute("aria-checked","true")};We.shadowRootOptions={mode:"open"};We.getTemplateHTML=pg;We.getSuffixSlotInnerHTML=mg;function Jn(i){return i.type==="radio"||i.type==="checkbox"}function Uc(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Uc(i,t):e!=null&&e.items?e:Uc(e,e==null?void 0:e.parentNode)}c.customElements.get("media-chrome-menu-item")||c.customElements.define("media-chrome-menu-item",We);function vg(i){return`
1930
+ `}function bg(i){return""}var Qe={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},We=class extends c.HTMLElement{constructor(){if(super(),Vt(this,Hc),Vt(this,dl),Vt(this,qc),Vt(this,ao),Vt(this,$c),Vt(this,ll),Vt(this,al,!1),Vt(this,ts,void 0),Vt(this,Ct,()=>{var e,t;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let r=this.shadowRoot.querySelector('slot[name="description"]'),o=(e=this.submenuElement.checkedItems)==null?void 0:e[0],n=(t=o==null?void 0:o.dataset.description)!=null?t:o==null?void 0:o.text,s=ee.createElement("span");s.textContent=n??"",r.replaceChildren(s)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Qe.TYPE,Qe.DISABLED,Qe.CHECKED,Qe.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),es(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":st(this,Hc,am).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":st(this,$c,dm).call(this,e);break;case"keyup":st(this,ao,is).call(this,e);break}}attributeChangedCallback(e,t,r){e===Qe.CHECKED&&es(this)&&!wt(this,al)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===Qe.TYPE&&r!==t?this.role="menuitem"+r:e===Qe.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Qe.DISABLED)||this.enable(),this.role="menuitem"+this.type,Uc(this,ts,Vc(this,this.parentNode)),st(this,ll,Bc).call(this),this.submenuElement&&st(this,dl,Fc).call(this)}disconnectedCallback(){this.disable(),st(this,ll,Bc).call(this),Uc(this,ts,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=$i(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(Qe.TYPE))!=null?e:""}set type(e){this.setAttribute(Qe.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Qe.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Qe.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(es(this))return this.getAttribute("aria-checked")==="true"}set checked(e){es(this)&&(Uc(this,al,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){es(this)||this.invokeTargetElement&&Ie(this,e.target)&&this.invokeTargetElement.dispatchEvent(new ci({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};al=new WeakMap;ts=new WeakMap;Hc=new WeakSet;am=function(i){let e=i.target;if(!(e!=null&&e.name))for(let r of e.assignedNodes({flatten:!0}))r instanceof Text&&r.textContent.trim()===""&&r.remove();e.name==="submenu"&&(this.submenuElement?st(this,dl,Fc).call(this):st(this,qc,lm).call(this))};dl=new WeakSet;Fc=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",wt(this,Ct)),this.submenuElement.addEventListener("addmenuitem",wt(this,Ct)),this.submenuElement.addEventListener("removemenuitem",wt(this,Ct)),wt(this,Ct).call(this)};qc=new WeakSet;lm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",wt(this,Ct)),this.submenuElement.removeEventListener("addmenuitem",wt(this,Ct)),this.submenuElement.removeEventListener("removemenuitem",wt(this,Ct)),wt(this,Ct).call(this)};Ct=new WeakMap;ao=new WeakSet;is=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",st(this,ao,is));return}this.handleClick(i)};$c=new WeakSet;dm=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",st(this,ao,is));return}this.addEventListener("keyup",st(this,ao,is),{once:!0})};ll=new WeakSet;Bc=function(){var i;let e=(i=wt(this,ts))==null?void 0:i.radioGroupItems;if(!e)return;let t=e.filter(r=>r.getAttribute("aria-checked")==="true").pop();t||(t=e[0]);for(let r of e)r.setAttribute("aria-checked","false");t==null||t.setAttribute("aria-checked","true")};We.shadowRootOptions={mode:"open"};We.getTemplateHTML=gg;We.getSuffixSlotInnerHTML=bg;function es(i){return i.type==="radio"||i.type==="checkbox"}function Vc(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Vc(i,t):e!=null&&e.items?e:Vc(e,e==null?void 0:e.parentNode)}c.customElements.get("media-chrome-menu-item")||c.customElements.define("media-chrome-menu-item",We);function _g(i){return`
1931
1931
  ${ue.getTemplateHTML(i)}
1932
1932
  <style>
1933
1933
  :host {
@@ -1962,7 +1962,7 @@ bp-player[has-error] {
1962
1962
  --media-settings-menu-item-opacity: 0;
1963
1963
  }
1964
1964
  </style>
1965
- `}var ta=class extends ue{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-settings-menu-button")}};ta.getTemplateHTML=vg;c.customElements.get("media-settings-menu")||c.customElements.define("media-settings-menu",ta);function fg(i){return`
1965
+ `}var rs=class extends ue{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-settings-menu-button")}};rs.getTemplateHTML=_g;c.customElements.get("media-settings-menu")||c.customElements.define("media-settings-menu",rs);function yg(i){return`
1966
1966
  ${We.getTemplateHTML.call(this,i)}
1967
1967
  <style>
1968
1968
  slot:not([name="submenu"]) {
@@ -1973,11 +1973,11 @@ bp-player[has-error] {
1973
1973
  background: transparent;
1974
1974
  }
1975
1975
  </style>
1976
- `}function Eg(i){return`
1976
+ `}function Tg(i){return`
1977
1977
  <svg aria-hidden="true" viewBox="0 0 20 24">
1978
1978
  <path d="m8.12 17.585-.742-.669 4.2-4.665-4.2-4.666.743-.669 4.803 5.335-4.803 5.334Z"/>
1979
1979
  </svg>
1980
- `}var nr=class extends We{};nr.shadowRootOptions={mode:"open"};nr.getTemplateHTML=fg;nr.getSuffixSlotInnerHTML=Eg;c.customElements.get("media-settings-menu-item")||c.customElements.define("media-settings-menu-item",nr);var Ne=class extends F{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=$i(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new ci({relatedTarget:this}))}};c.customElements.get("media-chrome-menu-button")||c.customElements.define("media-chrome-menu-button",Ne);function gg(){return`
1980
+ `}var nr=class extends We{};nr.shadowRootOptions={mode:"open"};nr.getTemplateHTML=yg;nr.getSuffixSlotInnerHTML=Tg;c.customElements.get("media-settings-menu-item")||c.customElements.define("media-settings-menu-item",nr);var Ne=class extends F{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=$i(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new ci({relatedTarget:this}))}};c.customElements.get("media-chrome-menu-button")||c.customElements.define("media-chrome-menu-button",Ne);function Ag(){return`
1981
1981
  <style>
1982
1982
  :host([aria-expanded="true"]) slot[name=tooltip] {
1983
1983
  display: none;
@@ -1988,27 +1988,27 @@ bp-player[has-error] {
1988
1988
  <path d="M4.5 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"/>
1989
1989
  </svg>
1990
1990
  </slot>
1991
- `}function bg(){return _("Settings")}var lo=class extends Ne{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",_("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-settings-menu")}};lo.getSlotTemplateHTML=gg;lo.getTooltipContentHTML=bg;c.customElements.get("media-settings-menu-button")||c.customElements.define("media-settings-menu-button",lo);var Kc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},nm=(i,e,t)=>(Kc(i,e,"read from private field"),t?t.call(i):e.get(i)),ll=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Vc=(i,e,t,r)=>(Kc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),dl=(i,e,t)=>(Kc(i,e,"access private method"),t),ia,hl,cl,Wc,ul,Fc,pl=class extends ue{constructor(){super(...arguments),ll(this,cl),ll(this,ul),ll(this,ia,[]),ll(this,hl,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_AUDIO_TRACK_ENABLED&&t!==r?this.value=r:e===s.MEDIA_AUDIO_TRACK_LIST&&t!==r&&(Vc(this,ia,lh(r??"")),dl(this,cl,Wc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",dl(this,ul,Fc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",dl(this,ul,Fc))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return nm(this,ia)}set mediaAudioTrackList(e){Vc(this,ia,e),dl(this,cl,Wc).call(this)}get mediaAudioTrackEnabled(){var e;return(e=D(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){O(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};ia=new WeakMap;hl=new WeakMap;cl=new WeakSet;Wc=function(){if(nm(this,hl)===JSON.stringify(this.mediaAudioTrackList))return;Vc(this,hl,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList;this.defaultSlot.textContent="",i.sort((e,t)=>e.id.localeCompare(t.id,void 0,{numeric:!0}));for(let e of i){let t=this.formatMenuItemText(e.label,e),r=Ct({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(nt(this,"checked-indicator")),this.defaultSlot.append(r)}};ul=new WeakSet;Fc=function(){if(this.value==null)return;let i=new c.CustomEvent(y.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-audio-track-menu")||c.customElements.define("media-audio-track-menu",pl);var _g=`<svg aria-hidden="true" viewBox="0 0 24 24">
1991
+ `}function Sg(){return _("Settings")}var lo=class extends Ne{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",_("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-settings-menu")}};lo.getSlotTemplateHTML=Ag;lo.getTooltipContentHTML=Sg;c.customElements.get("media-settings-menu-button")||c.customElements.define("media-settings-menu-button",lo);var Yc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},cm=(i,e,t)=>(Yc(i,e,"read from private field"),t?t.call(i):e.get(i)),cl=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Kc=(i,e,t,r)=>(Yc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ul=(i,e,t)=>(Yc(i,e,"access private method"),t),os,ml,hl,Gc,pl,zc,vl=class extends ue{constructor(){super(...arguments),cl(this,hl),cl(this,pl),cl(this,os,[]),cl(this,ml,void 0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_AUDIO_TRACK_ENABLED,a.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_AUDIO_TRACK_ENABLED&&t!==r?this.value=r:e===a.MEDIA_AUDIO_TRACK_LIST&&t!==r&&(Kc(this,os,ph(r??"")),ul(this,hl,Gc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ul(this,pl,zc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ul(this,pl,zc))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return cm(this,os)}set mediaAudioTrackList(e){Kc(this,os,e),ul(this,hl,Gc).call(this)}get mediaAudioTrackEnabled(){var e;return(e=D(this,a.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){O(this,a.MEDIA_AUDIO_TRACK_ENABLED,e)}};os=new WeakMap;ml=new WeakMap;hl=new WeakSet;Gc=function(){if(cm(this,ml)===JSON.stringify(this.mediaAudioTrackList))return;Kc(this,ml,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList;this.defaultSlot.textContent="",i.sort((e,t)=>e.id.localeCompare(t.id,void 0,{numeric:!0}));for(let e of i){let t=this.formatMenuItemText(e.label,e),r=It({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(nt(this,"checked-indicator")),this.defaultSlot.append(r)}};pl=new WeakSet;zc=function(){if(this.value==null)return;let i=new c.CustomEvent(y.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-audio-track-menu")||c.customElements.define("media-audio-track-menu",vl);var kg=`<svg aria-hidden="true" viewBox="0 0 24 24">
1992
1992
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
1993
1993
  <path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>
1994
- </svg>`;function yg(){return`
1994
+ </svg>`;function Lg(){return`
1995
1995
  <style>
1996
1996
  :host([aria-expanded="true"]) slot[name=tooltip] {
1997
1997
  display: none;
1998
1998
  }
1999
1999
  </style>
2000
- <slot name="icon">${_g}</slot>
2001
- `}function Tg(){return _("Audio")}var am=i=>{let e=_("Audio");i.setAttribute("aria-label",e)},co=class extends Ne{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),am(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LANG&&am(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=D(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){O(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};co.getSlotTemplateHTML=yg;co.getTooltipContentHTML=Tg;c.customElements.get("media-audio-track-menu-button")||c.customElements.define("media-audio-track-menu-button",co);var Yc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ag=(i,e,t)=>(Yc(i,e,"read from private field"),t?t.call(i):e.get(i)),Gc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Sg=(i,e,t,r)=>(Yc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ml=(i,e,t)=>(Yc(i,e,"access private method"),t),El,vl,qc,fl,zc,kg=`
2000
+ <slot name="icon">${kg}</slot>
2001
+ `}function Ig(){return _("Audio")}var um=i=>{let e=_("Audio");i.setAttribute("aria-label",e)},co=class extends Ne{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_AUDIO_TRACK_ENABLED,a.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),um(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LANG&&um(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=D(this,a.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){O(this,a.MEDIA_AUDIO_TRACK_ENABLED,e)}};co.getSlotTemplateHTML=Lg;co.getTooltipContentHTML=Ig;c.customElements.get("media-audio-track-menu-button")||c.customElements.define("media-audio-track-menu-button",co);var Jc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},wg=(i,e,t)=>(Jc(i,e,"read from private field"),t?t.call(i):e.get(i)),Qc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Cg=(i,e,t,r)=>(Jc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),fl=(i,e,t)=>(Jc(i,e,"access private method"),t),bl,El,Zc,gl,Xc,Rg=`
2002
2002
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
2003
2003
  <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
2004
- </svg>`;function Lg(i){return`
2004
+ </svg>`;function Mg(i){return`
2005
2005
  ${ue.getTemplateHTML(i)}
2006
- <slot name="captions-indicator" hidden>${kg}</slot>
2007
- `}var ra=class extends ue{constructor(){super(...arguments),Gc(this,vl),Gc(this,fl),Gc(this,El,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_LIST&&t!==r?ml(this,vl,qc).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",ml(this,vl,qc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ml(this,fl,zc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ml(this,fl,zc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return sm(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){lm(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return sm(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){lm(this,s.MEDIA_SUBTITLES_SHOWING,e)}};El=new WeakMap;vl=new WeakSet;qc=function(){var i;let e=Ag(this,El)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(s.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;Sg(this,El,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,o=Ct({type:"radio",text:this.formatMenuItemText(_("Off")),value:"off",checked:r});o.prepend(nt(this,"checked-indicator")),this.defaultSlot.append(o);let n=this.mediaSubtitlesList;for(let a of n){let l=Ct({type:"radio",text:this.formatMenuItemText(a.label,a),value:Ya(a),checked:this.value==Ya(a)});l.prepend(nt(this,"checked-indicator")),((i=a.kind)!=null?i:"subs")==="captions"&&l.append(nt(this,"captions-indicator")),this.defaultSlot.append(l)}};fl=new WeakSet;zc=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(s.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new c.CustomEvent(y.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new c.CustomEvent(y.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};ra.getTemplateHTML=Lg;var sm=(i,e)=>{let t=i.getAttribute(e);return t?Fi(t):[]},lm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=$t(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-menu")||c.customElements.define("media-captions-menu",ra);var Cg=`<svg aria-hidden="true" viewBox="0 0 26 24">
2006
+ <slot name="captions-indicator" hidden>${Rg}</slot>
2007
+ `}var ns=class extends ue{constructor(){super(...arguments),Qc(this,El),Qc(this,gl),Qc(this,bl,void 0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_LIST&&t!==r?fl(this,El,Zc).call(this):e===a.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",fl(this,El,Zc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",fl(this,gl,Xc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",fl(this,gl,Xc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return hm(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){pm(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return hm(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){pm(this,a.MEDIA_SUBTITLES_SHOWING,e)}};bl=new WeakMap;El=new WeakSet;Zc=function(){var i;let e=wg(this,bl)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(a.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;Cg(this,bl,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,o=It({type:"radio",text:this.formatMenuItemText(_("Off")),value:"off",checked:r});o.prepend(nt(this,"checked-indicator")),this.defaultSlot.append(o);let n=this.mediaSubtitlesList;for(let s of n){let l=It({type:"radio",text:this.formatMenuItemText(s.label,s),value:Zs(s),checked:this.value==Zs(s)});l.prepend(nt(this,"checked-indicator")),((i=s.kind)!=null?i:"subs")==="captions"&&l.append(nt(this,"captions-indicator")),this.defaultSlot.append(l)}};gl=new WeakSet;Xc=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(a.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new c.CustomEvent(y.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new c.CustomEvent(y.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};ns.getTemplateHTML=Mg;var hm=(i,e)=>{let t=i.getAttribute(e);return t?Fi(t):[]},pm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=$t(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-menu")||c.customElements.define("media-captions-menu",ns);var xg=`<svg aria-hidden="true" viewBox="0 0 26 24">
2008
2008
  <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
2009
- </svg>`,Ig=`<svg aria-hidden="true" viewBox="0 0 26 24">
2009
+ </svg>`,Pg=`<svg aria-hidden="true" viewBox="0 0 26 24">
2010
2010
  <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
2011
- </svg>`;function wg(){return`
2011
+ </svg>`;function Dg(){return`
2012
2012
  <style>
2013
2013
  :host([data-captions-enabled="true"]) slot[name=off] {
2014
2014
  display: none !important;
@@ -2025,10 +2025,10 @@ bp-player[has-error] {
2025
2025
  </style>
2026
2026
 
2027
2027
  <slot name="icon">
2028
- <slot name="on">${Cg}</slot>
2029
- <slot name="off">${Ig}</slot>
2028
+ <slot name="on">${xg}</slot>
2029
+ <slot name="off">${Pg}</slot>
2030
2030
  </slot>
2031
- `}function Mg(){return _("Captions")}var dm=i=>{i.setAttribute("data-captions-enabled",Qa(i).toString())},cm=i=>{i.setAttribute("aria-label",_("closed captions"))},uo=class extends Ne{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING,s.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),cm(this),dm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING?dm(this):e===s.MEDIA_LANG&&cm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return um(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){hm(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return um(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){hm(this,s.MEDIA_SUBTITLES_SHOWING,e)}};uo.getSlotTemplateHTML=wg;uo.getTooltipContentHTML=Mg;var um=(i,e)=>{let t=i.getAttribute(e);return t?Fi(t):[]},hm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=$t(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-menu-button")||c.customElements.define("media-captions-menu-button",uo);var pm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},po=(i,e,t)=>(pm(i,e,"read from private field"),t?t.call(i):e.get(i)),Qc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ho=(i,e,t)=>(pm(i,e,"access private method"),t),hi,mo,oa,gl,Xc,Zc={RATES:"rates"},bl=class extends ue{constructor(){super(),Qc(this,mo),Qc(this,gl),Qc(this,hi,new ri(this,Zc.RATES,{defaultValue:tc})),ho(this,mo,oa).call(this)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,Zc.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,ho(this,mo,oa).call(this)):e===Zc.RATES&&t!=r&&(po(this,hi).value=r,ho(this,mo,oa).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ho(this,gl,Xc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ho(this,gl,Xc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-playback-rate-menu-button")}get rates(){return po(this,hi)}set rates(e){e?Array.isArray(e)?po(this,hi).value=e.join(" "):typeof e=="string"&&(po(this,hi).value=e):po(this,hi).value="",ho(this,mo,oa).call(this)}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,Ji)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};hi=new WeakMap;mo=new WeakSet;oa=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(po(this,hi)).map(r=>Number(r)));i>0&&!e.has(i)&&e.add(i);let t=Array.from(e).sort((r,o)=>r-o);for(let r of t){let o=Ct({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});o.prepend(nt(this,"checked-indicator")),this.defaultSlot.append(o)}};gl=new WeakSet;Xc=function(){if(!this.value)return;let i=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-playback-rate-menu")||c.customElements.define("media-playback-rate-menu",bl);var _l=1;function Rg(i){return`
2031
+ `}function Og(){return _("Captions")}var mm=i=>{i.setAttribute("data-captions-enabled",Xs(i).toString())},vm=i=>{i.setAttribute("aria-label",_("closed captions"))},uo=class extends Ne{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING,a.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),vm(this),mm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING?mm(this):e===a.MEDIA_LANG&&vm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return fm(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Em(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return fm(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Em(this,a.MEDIA_SUBTITLES_SHOWING,e)}};uo.getSlotTemplateHTML=Dg;uo.getTooltipContentHTML=Og;var fm=(i,e)=>{let t=i.getAttribute(e);return t?Fi(t):[]},Em=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=$t(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-menu-button")||c.customElements.define("media-captions-menu-button",uo);var gm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},po=(i,e,t)=>(gm(i,e,"read from private field"),t?t.call(i):e.get(i)),jc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ho=(i,e,t)=>(gm(i,e,"access private method"),t),hi,mo,ss,_l,tu,eu={RATES:"rates"},yl=class extends ue{constructor(){super(),jc(this,mo),jc(this,_l),jc(this,hi,new ri(this,eu.RATES,{defaultValue:nc})),ho(this,mo,ss).call(this)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,eu.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,ho(this,mo,ss).call(this)):e===eu.RATES&&t!=r&&(po(this,hi).value=r,ho(this,mo,ss).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ho(this,_l,tu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ho(this,_l,tu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-playback-rate-menu-button")}get rates(){return po(this,hi)}set rates(e){e?Array.isArray(e)?po(this,hi).value=e.join(" "):typeof e=="string"&&(po(this,hi).value=e):po(this,hi).value="",ho(this,mo,ss).call(this)}get mediaPlaybackRate(){return H(this,a.MEDIA_PLAYBACK_RATE,Ji)}set mediaPlaybackRate(e){B(this,a.MEDIA_PLAYBACK_RATE,e)}};hi=new WeakMap;mo=new WeakSet;ss=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(po(this,hi)).map(r=>Number(r)));i>0&&!e.has(i)&&e.add(i);let t=Array.from(e).sort((r,o)=>r-o);for(let r of t){let o=It({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});o.prepend(nt(this,"checked-indicator")),this.defaultSlot.append(o)}};_l=new WeakSet;tu=function(){if(!this.value)return;let i=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-playback-rate-menu")||c.customElements.define("media-playback-rate-menu",yl);var Tl=1;function Ng(i){return`
2032
2032
  <style>
2033
2033
  :host {
2034
2034
  min-width: 5ch;
@@ -2043,17 +2043,17 @@ bp-player[has-error] {
2043
2043
  display: none;
2044
2044
  }
2045
2045
  </style>
2046
- <slot name="icon">${i.mediaplaybackrate||_l}x</slot>
2047
- `}function xg(){return _("Playback rate")}var vo=class extends Ne{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:_l}x`}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?_l:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",_("Playback rate {playbackRate}",{playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,_l)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};vo.getSlotTemplateHTML=Rg;vo.getTooltipContentHTML=xg;c.customElements.get("media-playback-rate-menu-button")||c.customElements.define("media-playback-rate-menu-button",vo);var jc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},na=(i,e,t)=>(jc(i,e,"read from private field"),t?t.call(i):e.get(i)),yl=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},mm=(i,e,t,r)=>(jc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),fo=(i,e,t)=>(jc(i,e,"access private method"),t),aa,go,Eo,sa,Tl,Jc,Al=class extends ue{constructor(){super(...arguments),yl(this,Eo),yl(this,Tl),yl(this,aa,[]),yl(this,go,{})}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_LIST,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.MEDIA_HEIGHT]}static formatMenuItemText(e,t){return super.formatMenuItemText(e,t)}static formatRendition(e,{showBitrate:t=!1}={}){let r=`${Math.min(e.width,e.height)}p`;if(t&&e.bitrate){let o=e.bitrate/1e6,n=`${o.toFixed(o<1?1:0)} Mbps`;return`${r} (${n})`}return this.formatMenuItemText(r,e)}static compareRendition(e,t){var r,o;return t.height===e.height?((r=t.bitrate)!=null?r:0)-((o=e.bitrate)!=null?o:0):t.height-e.height}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_RENDITION_SELECTED&&t!==r?(this.value=r??"auto",fo(this,Eo,sa).call(this)):e===s.MEDIA_RENDITION_LIST&&t!==r?(mm(this,aa,ah(r)),fo(this,Eo,sa).call(this)):e===s.MEDIA_HEIGHT&&t!==r&&fo(this,Eo,sa).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",fo(this,Tl,Jc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",fo(this,Tl,Jc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return na(this,aa)}set mediaRenditionList(e){mm(this,aa,e),fo(this,Eo,sa).call(this)}get mediaRenditionSelected(){return D(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){O(this,s.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return H(this,s.MEDIA_HEIGHT)}set mediaHeight(e){B(this,s.MEDIA_HEIGHT,e)}compareRendition(e,t){return this.constructor.compareRendition(e,t)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}formatRendition(e,t){return this.constructor.formatRendition(e,t)}showRenditionBitrate(e){return this.mediaRenditionList.some(t=>t!==e&&t.height===e.height&&t.bitrate!==e.bitrate)}};aa=new WeakMap;go=new WeakMap;Eo=new WeakSet;sa=function(){if(na(this,go).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&na(this,go).mediaHeight===this.mediaHeight)return;na(this,go).mediaRenditionList=JSON.stringify(this.mediaRenditionList),na(this,go).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=i.find(a=>a.id===this.mediaRenditionSelected);for(let a of i)a.selected=a===e;this.defaultSlot.textContent="";let t=!this.mediaRenditionSelected;for(let a of i){let l=this.formatRendition(a,{showBitrate:this.showRenditionBitrate(a)}),d=Ct({type:"radio",text:l,value:`${a.id}`,checked:a.selected&&!t});d.prepend(nt(this,"checked-indicator")),this.defaultSlot.append(d)}let r=e&&this.showRenditionBitrate(e),o=t?e?this.formatMenuItemText(`${_("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${_("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(_("Auto")),n=Ct({type:"radio",text:o,value:"auto",checked:t});n.dataset.description=o,n.prepend(nt(this,"checked-indicator")),this.defaultSlot.append(n)};Tl=new WeakSet;Jc=function(){if(this.value==null)return;let i=new c.CustomEvent(y.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-rendition-menu")||c.customElements.define("media-rendition-menu",Al);var Pg=`<svg aria-hidden="true" viewBox="0 0 24 24">
2046
+ <slot name="icon">${i.mediaplaybackrate||Tl}x</slot>
2047
+ `}function Ug(){return _("Playback rate")}var vo=class extends Ne{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Tl}x`}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?Tl:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",_("Playback rate {playbackRate}",{playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return H(this,a.MEDIA_PLAYBACK_RATE,Tl)}set mediaPlaybackRate(e){B(this,a.MEDIA_PLAYBACK_RATE,e)}};vo.getSlotTemplateHTML=Ng;vo.getTooltipContentHTML=Ug;c.customElements.get("media-playback-rate-menu-button")||c.customElements.define("media-playback-rate-menu-button",vo);var ru=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},as=(i,e,t)=>(ru(i,e,"read from private field"),t?t.call(i):e.get(i)),Al=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},bm=(i,e,t,r)=>(ru(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),fo=(i,e,t)=>(ru(i,e,"access private method"),t),ls,go,Eo,ds,Sl,iu,kl=class extends ue{constructor(){super(...arguments),Al(this,Eo),Al(this,Sl),Al(this,ls,[]),Al(this,go,{})}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_RENDITION_LIST,a.MEDIA_RENDITION_SELECTED,a.MEDIA_RENDITION_UNAVAILABLE,a.MEDIA_HEIGHT]}static formatMenuItemText(e,t){return super.formatMenuItemText(e,t)}static formatRendition(e,{showBitrate:t=!1}={}){let r=`${Math.min(e.width,e.height)}p`;if(t&&e.bitrate){let o=e.bitrate/1e6,n=`${o.toFixed(o<1?1:0)} Mbps`;return`${r} (${n})`}return this.formatMenuItemText(r,e)}static compareRendition(e,t){var r,o;return t.height===e.height?((r=t.bitrate)!=null?r:0)-((o=e.bitrate)!=null?o:0):t.height-e.height}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_RENDITION_SELECTED&&t!==r?(this.value=r??"auto",fo(this,Eo,ds).call(this)):e===a.MEDIA_RENDITION_LIST&&t!==r?(bm(this,ls,uh(r)),fo(this,Eo,ds).call(this)):e===a.MEDIA_HEIGHT&&t!==r&&fo(this,Eo,ds).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",fo(this,Sl,iu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",fo(this,Sl,iu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return as(this,ls)}set mediaRenditionList(e){bm(this,ls,e),fo(this,Eo,ds).call(this)}get mediaRenditionSelected(){return D(this,a.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){O(this,a.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return H(this,a.MEDIA_HEIGHT)}set mediaHeight(e){B(this,a.MEDIA_HEIGHT,e)}compareRendition(e,t){return this.constructor.compareRendition(e,t)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}formatRendition(e,t){return this.constructor.formatRendition(e,t)}showRenditionBitrate(e){return this.mediaRenditionList.some(t=>t!==e&&t.height===e.height&&t.bitrate!==e.bitrate)}};ls=new WeakMap;go=new WeakMap;Eo=new WeakSet;ds=function(){if(as(this,go).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&as(this,go).mediaHeight===this.mediaHeight)return;as(this,go).mediaRenditionList=JSON.stringify(this.mediaRenditionList),as(this,go).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=i.find(s=>s.id===this.mediaRenditionSelected);for(let s of i)s.selected=s===e;this.defaultSlot.textContent="";let t=!this.mediaRenditionSelected;for(let s of i){let l=this.formatRendition(s,{showBitrate:this.showRenditionBitrate(s)}),d=It({type:"radio",text:l,value:`${s.id}`,checked:s.selected&&!t});d.prepend(nt(this,"checked-indicator")),this.defaultSlot.append(d)}let r=e&&this.showRenditionBitrate(e),o=t?e?this.formatMenuItemText(`${_("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${_("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(_("Auto")),n=It({type:"radio",text:o,value:"auto",checked:t});n.dataset.description=o,n.prepend(nt(this,"checked-indicator")),this.defaultSlot.append(n)};Sl=new WeakSet;iu=function(){if(this.value==null)return;let i=new c.CustomEvent(y.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-rendition-menu")||c.customElements.define("media-rendition-menu",kl);var Hg=`<svg aria-hidden="true" viewBox="0 0 24 24">
2048
2048
  <path d="M13.5 2.5h2v6h-2v-2h-11v-2h11v-2Zm4 2h4v2h-4v-2Zm-12 4h2v6h-2v-2h-3v-2h3v-2Zm4 2h12v2h-12v-2Zm1 4h2v6h-2v-2h-8v-2h8v-2Zm4 2h7v2h-7v-2Z" />
2049
- </svg>`;function Dg(){return`
2049
+ </svg>`;function $g(){return`
2050
2050
  <style>
2051
2051
  :host([aria-expanded="true"]) slot[name=tooltip] {
2052
2052
  display: none;
2053
2053
  }
2054
2054
  </style>
2055
- <slot name="icon">${Pg}</slot>
2056
- `}function Og(){return _("Quality")}var bo=class extends Ne{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",_("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return D(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){O(this,s.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return H(this,s.MEDIA_HEIGHT)}set mediaHeight(e){B(this,s.MEDIA_HEIGHT,e)}};bo.getSlotTemplateHTML=Dg;bo.getTooltipContentHTML=Og;c.customElements.get("media-rendition-menu-button")||c.customElements.define("media-rendition-menu-button",bo);var iu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Rt=(i,e,t)=>(iu(i,e,"read from private field"),t?t.call(i):e.get(i)),Mt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},vm=(i,e,t,r)=>(iu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ze=(i,e,t)=>(iu(i,e,"access private method"),t),yo,la,wl,ar,_o,ru,fm,Sl,eu,kl,tu,Em,Cl,Il,Ll;function Ng(i){return`
2055
+ <slot name="icon">${Hg}</slot>
2056
+ `}function Bg(){return _("Quality")}var bo=class extends Ne{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_RENDITION_SELECTED,a.MEDIA_RENDITION_UNAVAILABLE,a.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",_("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return D(this,a.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){O(this,a.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return H(this,a.MEDIA_HEIGHT)}set mediaHeight(e){B(this,a.MEDIA_HEIGHT,e)}};bo.getSlotTemplateHTML=$g;bo.getTooltipContentHTML=Bg;c.customElements.get("media-rendition-menu-button")||c.customElements.define("media-rendition-menu-button",bo);var su=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Mt=(i,e,t)=>(su(i,e,"read from private field"),t?t.call(i):e.get(i)),Rt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_m=(i,e,t,r)=>(su(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ze=(i,e,t)=>(su(i,e,"access private method"),t),yo,cs,Ml,sr,_o,au,ym,Ll,ou,Il,nu,Tm,Cl,Rl,wl;function Vg(i){return`
2057
2057
  ${ue.getTemplateHTML(i)}
2058
2058
  <style>
2059
2059
  :host {
@@ -2067,7 +2067,7 @@ bp-player[has-error] {
2067
2067
  overflow: hidden;
2068
2068
  }
2069
2069
  </style>
2070
- `}var da=class extends ue{constructor(){super(),Mt(this,la),Mt(this,ar),Mt(this,ru),Mt(this,Sl),Mt(this,tu),Mt(this,yo,!1),Mt(this,kl,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",o=Ze(this,Sl,eu).call(this,t);(r||o)&&(Rt(this,yo)?Ze(this,ar,_o).call(this):Ze(this,tu,Em).call(this,e))}),Mt(this,Cl,e=>{let t=e.target,r=this.contains(t),o=e.button===2,n=(t==null?void 0:t.nodeName)==="VIDEO",a=Ze(this,Sl,eu).call(this,t);r||o&&(n||a)||Ze(this,ar,_o).call(this)}),Mt(this,Il,e=>{e.key==="Escape"&&Ze(this,ar,_o).call(this)}),Mt(this,Ll,e=>{var t,r;let o=e.target;if((t=o.matches)!=null&&t.call(o,'button[invoke="copy"]')){let n=(r=o.closest("media-context-menu-item"))==null?void 0:r.querySelector('input[slot="copy"]');n&&navigator.clipboard.writeText(n.value)}Ze(this,ar,_o).call(this)}),this.setAttribute("noautohide",""),Ze(this,la,wl).call(this)}connectedCallback(){super.connectedCallback(),X(this).addEventListener("contextmenu",Rt(this,kl)),this.addEventListener("click",Rt(this,Ll))}disconnectedCallback(){super.disconnectedCallback(),X(this).removeEventListener("contextmenu",Rt(this,kl)),this.removeEventListener("click",Rt(this,Ll)),document.removeEventListener("mousedown",Rt(this,Cl)),document.removeEventListener("keydown",Rt(this,Il))}};yo=new WeakMap;la=new WeakSet;wl=function(){this.hidden=!Rt(this,yo)};ar=new WeakSet;_o=function(){vm(this,yo,!1),Ze(this,la,wl).call(this)};ru=new WeakSet;fm=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&Ze(t=e,ar,_o).call(t)})};Sl=new WeakSet;eu=function(i){return i?i.hasAttribute("slot")&&i.getAttribute("slot")==="media"?!0:i.nodeName.includes("-")&&i.tagName.includes("-")?i.hasAttribute("src")||i.hasAttribute("poster")||i.hasAttribute("preload")||i.hasAttribute("playsinline"):!1:!1};kl=new WeakMap;tu=new WeakSet;Em=function(i){i.preventDefault(),Ze(this,ru,fm).call(this),vm(this,yo,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,Ze(this,la,wl).call(this),document.addEventListener("mousedown",Rt(this,Cl),{once:!0}),document.addEventListener("keydown",Rt(this,Il),{once:!0})};Cl=new WeakMap;Il=new WeakMap;Ll=new WeakMap;da.getTemplateHTML=Ng;c.customElements.get("media-context-menu")||c.customElements.define("media-context-menu",da);function Ug(i){return`
2070
+ `}var us=class extends ue{constructor(){super(),Rt(this,cs),Rt(this,sr),Rt(this,au),Rt(this,Ll),Rt(this,nu),Rt(this,yo,!1),Rt(this,Il,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",o=Ze(this,Ll,ou).call(this,t);(r||o)&&(Mt(this,yo)?Ze(this,sr,_o).call(this):Ze(this,nu,Tm).call(this,e))}),Rt(this,Cl,e=>{let t=e.target,r=this.contains(t),o=e.button===2,n=(t==null?void 0:t.nodeName)==="VIDEO",s=Ze(this,Ll,ou).call(this,t);r||o&&(n||s)||Ze(this,sr,_o).call(this)}),Rt(this,Rl,e=>{e.key==="Escape"&&Ze(this,sr,_o).call(this)}),Rt(this,wl,e=>{var t,r;let o=e.target;if((t=o.matches)!=null&&t.call(o,'button[invoke="copy"]')){let n=(r=o.closest("media-context-menu-item"))==null?void 0:r.querySelector('input[slot="copy"]');n&&navigator.clipboard.writeText(n.value)}Ze(this,sr,_o).call(this)}),this.setAttribute("noautohide",""),Ze(this,cs,Ml).call(this)}connectedCallback(){super.connectedCallback(),X(this).addEventListener("contextmenu",Mt(this,Il)),this.addEventListener("click",Mt(this,wl))}disconnectedCallback(){super.disconnectedCallback(),X(this).removeEventListener("contextmenu",Mt(this,Il)),this.removeEventListener("click",Mt(this,wl)),document.removeEventListener("mousedown",Mt(this,Cl)),document.removeEventListener("keydown",Mt(this,Rl))}};yo=new WeakMap;cs=new WeakSet;Ml=function(){this.hidden=!Mt(this,yo)};sr=new WeakSet;_o=function(){_m(this,yo,!1),Ze(this,cs,Ml).call(this)};au=new WeakSet;ym=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&Ze(t=e,sr,_o).call(t)})};Ll=new WeakSet;ou=function(i){return i?i.hasAttribute("slot")&&i.getAttribute("slot")==="media"?!0:i.nodeName.includes("-")&&i.tagName.includes("-")?i.hasAttribute("src")||i.hasAttribute("poster")||i.hasAttribute("preload")||i.hasAttribute("playsinline"):!1:!1};Il=new WeakMap;nu=new WeakSet;Tm=function(i){i.preventDefault(),Ze(this,au,ym).call(this),_m(this,yo,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,Ze(this,cs,Ml).call(this),document.addEventListener("mousedown",Mt(this,Cl),{once:!0}),document.addEventListener("keydown",Mt(this,Rl),{once:!0})};Cl=new WeakMap;Rl=new WeakMap;wl=new WeakMap;us.getTemplateHTML=Vg;c.customElements.get("media-context-menu")||c.customElements.define("media-context-menu",us);function Wg(i){return`
2071
2071
  ${We.getTemplateHTML.call(this,i)}
2072
2072
  <style>
2073
2073
  ::slotted(*) {
@@ -2080,16 +2080,16 @@ bp-player[has-error] {
2080
2080
  min-height: var(--media-control-height, 24px);
2081
2081
  }
2082
2082
  </style>
2083
- `}var To=class extends We{};To.shadowRootOptions={mode:"open"};To.getTemplateHTML=Ug;c.customElements.get("media-context-menu-item")||c.customElements.define("media-context-menu-item",To);var Hg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2083
+ `}var To=class extends We{};To.shadowRootOptions={mode:"open"};To.getTemplateHTML=Wg;c.customElements.get("media-context-menu-item")||c.customElements.define("media-context-menu-item",To);var Fg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2084
2084
  <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>
2085
- </svg>`,$g=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2085
+ </svg>`,qg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2086
2086
  <path d="M21 6H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H3V8h18v8zM9 10v4c0 .55-.45 1-1 1H5v-2h2v-2H5v-2h3c.55 0 1 .45 1 1zm4 4h2v1h-4v-6h2v2h2v1h-2v2zm6-3v1h-2v3h-2v-6h4v2h-2z"/>
2087
- </svg>`,Bg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2087
+ </svg>`,Kg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2088
2088
  <path d="M24 8.98C20.93 5.9 16.69 4 12 4S3.07 5.9 0 8.98L12 21 24 8.98zM2.92 9.07C5.51 7.08 8.67 6 12 6s6.49 1.08 9.08 3.07l-1.43 1.43C17.5 8.94 14.86 8 12 8s-5.5.94-7.65 2.51L2.92 9.07zM12 18l-6.36-6.36C7.34 10.27 9.58 9.5 12 9.5s4.66.77 6.36 2.14L12 18z"/>
2089
2089
  <line x1="2" y1="2" x2="22" y2="22" stroke="currentColor" stroke-width="2"/>
2090
- </svg>`,Vg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2090
+ </svg>`,Gg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2091
2091
  <path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>
2092
- </svg>`;function Wg(i){switch(i){case"offline":return $g;case"network":return Bg;case"security":return Vg;default:return Hg}}function Fg(i){switch(i){case"offline":return"Stream Unavailable";case"network":return"Connection Error";case"security":return"Access Denied";case"autoplay":return"Playback Blocked";case"media":return"Playback Error";case"setup":return"Configuration Error";default:return"An error occurred"}}var pi=class extends Me{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=Wg(t),o=Fg(t);return Ge`
2092
+ </svg>`;function zg(i){switch(i){case"offline":return qg;case"network":return Kg;case"security":return Gg;default:return Fg}}function Yg(i){switch(i){case"offline":return"Stream Unavailable";case"network":return"Connection Error";case"security":return"Access Denied";case"autoplay":return"Playback Blocked";case"media":return"Playback Error";case"setup":return"Configuration Error";default:return"An error occurred"}}var pi=class extends Re{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=zg(t),o=Yg(t);return Ke`
2093
2093
  <div part="icon">
2094
2094
  <slot name="icon">${this.renderIcon(r)}</slot>
2095
2095
  </div>
@@ -2099,7 +2099,7 @@ bp-player[has-error] {
2099
2099
  <p part="message">
2100
2100
  <slot name="message">${this.error.message}</slot>
2101
2101
  </p>
2102
- ${this.showCode?Ge`
2102
+ ${this.showCode?Ke`
2103
2103
  <span part="code">
2104
2104
  <slot name="code">Error ${this.error.code}</slot>
2105
2105
  </span>
@@ -2168,7 +2168,7 @@ bp-player[has-error] {
2168
2168
  [part="actions"] button {
2169
2169
  cursor: pointer;
2170
2170
  }
2171
- `,U([W({type:Object})],pi.prototype,"error",2),U([W({type:Boolean})],pi.prototype,"showCode",2),pi=U([Zt("bp-error-display")],pi);var gm=`/**
2171
+ `,U([W({type:Object})],pi.prototype,"error",2),U([W({type:Boolean})],pi.prototype,"showCode",2),pi=U([Zt("bp-error-display")],pi);var Am=`/**
2172
2172
  * BP Default UI Styles
2173
2173
  *
2174
2174
  * Layer-based architecture.
@@ -2689,7 +2689,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2689
2689
  outline: 2px solid rgba(0, 255, 0, 1) !important;
2690
2690
  background: rgba(0, 255, 0, 0.3) !important;
2691
2691
  }
2692
- `;var bm=!1;function Gg(){if(bm||(bm=!0,document.getElementById("bp-default-ui-styles")))return;Jo();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=gm,document.head.appendChild(i)}var oe=class extends Me{constructor(){super(...arguments);this.autoplay=!1;this.muted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this.autohide=2;this.hotkeys=!0;this.mobile=!1;this.live=!1;this.fluid=!1;this._player=null;this._providerType=null;this._error=null;this._connectionState="idle";this._showEndedOverlay=!1;this._cleanupListeners=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),Gg(),this.detectMobile()}disconnectedCallback(){super.disconnectedCallback(),this._cleanupListeners.forEach(t=>t()),this._cleanupListeners=[]}get player(){return this._player}get mediaController(){return this.querySelector("media-controller")}get bpLive(){var t;return((t=this._player)==null?void 0:t.bpLive)??null}detectMobile(){let t=/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);this.mobile=t}_getPoster(){var t;return((t=this.source)==null?void 0:t.poster)??this.poster??null}firstUpdated(t){super.firstUpdated(t),this.setupPlayer(),this._moveSlottedContent()}willUpdate(t){super.willUpdate(t),t.has("source")&&(this._applySourceHints(),this._error=null,this._showEndedOverlay=!1,be(this,"has-error",!1))}updated(t){super.updated(t),this._moveSlottedContent(),t.has("debug")&&this.toggleAttribute("debug-hitboxes",this.debug)}_applySourceHints(){var r;let t=(r=this.source)==null?void 0:r.sources;if(t){for(let o of t)if(od(o)){if("clipId"in o){if(this.setAttribute("content-type","clip"),this.fluid&&o.preferredOrientation){let n=o.preferredOrientation==="portrait";this.style.setProperty("--bp-video-width",n?"9":"16"),this.style.setProperty("--bp-video-height",n?"16":"9")}}else this.setAttribute("content-type","stream");return}this.setAttribute("content-type","video")}}_updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r))):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"))}_clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}_moveSlottedContent(){let t=this.querySelector("media-controller");if(!t)return;let r=[{from:"top-chrome",to:"top-chrome",marker:"has-custom-top-chrome"},{from:"centered-chrome",to:"centered-chrome",marker:"has-custom-centered-chrome"},{from:"middle-chrome",to:"middle-chrome",marker:"has-custom-middle-chrome"},{from:"bottom-chrome",to:null,marker:"has-custom-bottom-chrome"}];for(let{from:o,to:n,marker:a}of r){let l=this.querySelectorAll(`:scope > [slot="${o}"]`);l.length>0&&this.setAttribute(a,""),l.forEach(d=>{d.parentElement!==t&&(n?d.setAttribute("slot",n):d.removeAttribute("slot"),t.appendChild(d))})}}setupPlayer(){let t=this.querySelector("bp-player");if(!t)return;let r=o=>{o.stopPropagation(),this._player=o.detail,this._providerType=t.providerType,this.live=this._player.state.streamType==="live",this.setupPlayerListeners(),this.dispatchEvent(Oi(nn,{detail:this._player})),this.requestUpdate()};t.addEventListener("ready",r),this._cleanupListeners.push(()=>t.removeEventListener("ready",r))}setupPlayerListeners(){if(!this._player)return;let t=()=>{var E;let h=((E=this._player)==null?void 0:E.state.error)??null;this._error=h;let g=h!==null&&h.fatal&&h.category!=="offline";be(this,"has-error",g)},r=()=>{var g;let h=(g=this._player)==null?void 0:g.state;if(h&&(this._connectionState=h.connectionState,this.live=h.streamType==="live",this.setAttribute("content-type",h.contentType),this.setAttribute("stream-type",h.streamType),be(this,"paused",h.paused),be(this,"ended",h.ended),be(this,"waiting",h.waiting),h.error!==this._error)){this._error=h.error;let E=h.error!==null&&h.error.fatal&&h.error.category!=="offline";be(this,"has-error",E)}},o=()=>{this._error=null,this._showEndedOverlay=!1,be(this,"has-error",!1)},n=()=>{this.live&&(this._showEndedOverlay=!0)},a=()=>{this._error=null,this._showEndedOverlay=!1,be(this,"has-error",!1)},l=h=>{this.debug&&console.log("[BPDefaultUI] updateVideoDimensions called",{fluid:this.fluid,...h}),this.fluid&&(this._updateVideoDimensions(h.videoWidth,h.videoHeight),this.debug&&console.log("[BPDefaultUI] Set video dimensions:",{width:h.videoWidth,height:h.videoHeight}))};this._player.addEventListener("error",t),this._player.addEventListener("statechange",r),this._player.addEventListener("playing",o),this._player.addEventListener("ended",n),this._player.addEventListener("sourcechange",a),this._player.addEventListener("resize",l),this._player.addEventListener("loadedmetadata",l);let{videoWidth:d,videoHeight:m}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:d,videoHeight:m,fluid:this.fluid}),d>0&&m>0&&l({videoWidth:d,videoHeight:m}),this._cleanupListeners.push(()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("error",t)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("statechange",r)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("playing",o)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("ended",n)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("sourcechange",a)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("resize",l)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("loadedmetadata",l)})}renderDefaultControls(){return this._providerType==="nano"||this._providerType==="livekit"?Ge`
2692
+ `;var Sm=!1;function Zg(){if(Sm||(Sm=!0,document.getElementById("bp-default-ui-styles")))return;en();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=Am,document.head.appendChild(i)}var oe=class extends Re{constructor(){super(...arguments);this.autoplay=!1;this.muted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this.autohide=2;this.hotkeys=!0;this.mobile=!1;this.live=!1;this.fluid=!1;this._player=null;this._providerType=null;this._error=null;this._connectionState="idle";this._showEndedOverlay=!1;this._cleanupListeners=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),Zg(),this.detectMobile()}disconnectedCallback(){super.disconnectedCallback(),this._cleanupListeners.forEach(t=>t()),this._cleanupListeners=[]}get player(){return this._player}get mediaController(){return this.querySelector("media-controller")}get bpLive(){var t;return((t=this._player)==null?void 0:t.bpLive)??null}detectMobile(){let t=/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);this.mobile=t}_getPoster(){var t;return((t=this.source)==null?void 0:t.poster)??this.poster??null}firstUpdated(t){super.firstUpdated(t),this.setupPlayer(),this._moveSlottedContent()}willUpdate(t){super.willUpdate(t),t.has("source")&&(this._applySourceHints(),this._error=null,this._showEndedOverlay=!1,be(this,"has-error",!1))}updated(t){super.updated(t),this._moveSlottedContent(),t.has("debug")&&this.toggleAttribute("debug-hitboxes",this.debug)}_applySourceHints(){var r;let t=(r=this.source)==null?void 0:r.sources;if(t){for(let o of t)if(sd(o)){if("clipId"in o){if(this.setAttribute("content-type","clip"),this.fluid&&o.preferredOrientation){let n=o.preferredOrientation==="portrait";this.style.setProperty("--bp-video-width",n?"9":"16"),this.style.setProperty("--bp-video-height",n?"16":"9")}}else this.setAttribute("content-type","stream");return}this.setAttribute("content-type","video")}}_updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r))):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"))}_clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}_moveSlottedContent(){let t=this.querySelector("media-controller");if(!t)return;let r=[{from:"top-chrome",to:"top-chrome",marker:"has-custom-top-chrome"},{from:"centered-chrome",to:"centered-chrome",marker:"has-custom-centered-chrome"},{from:"middle-chrome",to:"middle-chrome",marker:"has-custom-middle-chrome"},{from:"bottom-chrome",to:null,marker:"has-custom-bottom-chrome"}];for(let{from:o,to:n,marker:s}of r){let l=this.querySelectorAll(`:scope > [slot="${o}"]`);l.length>0&&this.setAttribute(s,""),l.forEach(d=>{d.parentElement!==t&&(n?d.setAttribute("slot",n):d.removeAttribute("slot"),t.appendChild(d))})}}setupPlayer(){let t=this.querySelector("bp-player");if(!t)return;let r=o=>{o.stopPropagation(),this._player=o.detail,this._providerType=t.providerType,this.live=this._player.state.streamType==="live",this.setupPlayerListeners(),this.dispatchEvent(Oi(an,{detail:this._player})),this.requestUpdate()};t.addEventListener("ready",r),this._cleanupListeners.push(()=>t.removeEventListener("ready",r))}setupPlayerListeners(){if(!this._player)return;let t=()=>{var E;let h=((E=this._player)==null?void 0:E.state.error)??null;this._error=h;let g=h!==null&&h.fatal&&h.category!=="offline";be(this,"has-error",g)},r=()=>{var g;let h=(g=this._player)==null?void 0:g.state;if(h&&(this._connectionState=h.connectionState,this.live=h.streamType==="live",this.setAttribute("content-type",h.contentType),this.setAttribute("stream-type",h.streamType),be(this,"paused",h.paused),be(this,"ended",h.ended),be(this,"waiting",h.waiting),h.error!==this._error)){this._error=h.error;let E=h.error!==null&&h.error.fatal&&h.error.category!=="offline";be(this,"has-error",E)}},o=()=>{this._error=null,this._showEndedOverlay=!1,be(this,"has-error",!1)},n=()=>{this.live&&(this._showEndedOverlay=!0)},s=()=>{this._error=null,this._showEndedOverlay=!1,be(this,"has-error",!1)},l=h=>{this.debug&&console.log("[BPDefaultUI] updateVideoDimensions called",{fluid:this.fluid,...h}),this.fluid&&(this._updateVideoDimensions(h.videoWidth,h.videoHeight),this.debug&&console.log("[BPDefaultUI] Set video dimensions:",{width:h.videoWidth,height:h.videoHeight}))};this._player.addEventListener("error",t),this._player.addEventListener("statechange",r),this._player.addEventListener("playing",o),this._player.addEventListener("ended",n),this._player.addEventListener("sourcechange",s),this._player.addEventListener("resize",l),this._player.addEventListener("loadedmetadata",l);let{videoWidth:d,videoHeight:m}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:d,videoHeight:m,fluid:this.fluid}),d>0&&m>0&&l({videoWidth:d,videoHeight:m}),this._cleanupListeners.push(()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("error",t)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("statechange",r)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("playing",o)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("ended",n)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("sourcechange",s)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("resize",l)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("loadedmetadata",l)})}renderDefaultControls(){return this._providerType==="nano"||this._providerType==="livekit"?Ke`
2693
2693
  <media-control-bar>
2694
2694
  <media-play-button notooltip clip-hidden></media-play-button>
2695
2695
  <media-live-button notooltip vod-hidden clip-hidden></media-live-button>
@@ -2699,7 +2699,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2699
2699
  <media-rendition-menu-button notooltip clip-hidden></media-rendition-menu-button>
2700
2700
  <media-fullscreen-button notooltip clip-hidden></media-fullscreen-button>
2701
2701
  </media-control-bar>
2702
- `:Ge`
2702
+ `:Ke`
2703
2703
  <media-control-bar>
2704
2704
  <media-play-button notooltip clip-hidden></media-play-button>
2705
2705
  <media-live-button notooltip vod-hidden clip-hidden></media-live-button>
@@ -2715,7 +2715,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2715
2715
  <media-pip-button notooltip clip-hidden></media-pip-button>
2716
2716
  <media-fullscreen-button notooltip clip-hidden></media-fullscreen-button>
2717
2717
  </media-control-bar>
2718
- `}render(){return Ge`
2718
+ `}render(){return Ke`
2719
2719
  <!-- Chrome Layer: media-controller with all controls -->
2720
2720
  <div class="bp-layer bp-chrome-layer">
2721
2721
  <media-controller autohide="${this.autohide}" ?hotkeys="${this.hotkeys}">
@@ -2731,7 +2731,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2731
2731
  ?debug="${this.debug}"
2732
2732
  ></bp-player>
2733
2733
 
2734
- ${this._getPoster()?Ge`
2734
+ ${this._getPoster()?Ke`
2735
2735
  <media-poster-image slot="poster" src="${this._getPoster()}"></media-poster-image>
2736
2736
  `:null}
2737
2737
 
@@ -2764,19 +2764,19 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2764
2764
  <div class="bp-layer bp-error-layer">
2765
2765
  <bp-error-display .error="${this._error}" ?showCode="${this.debug}"></bp-error-display>
2766
2766
  </div>
2767
- `}};U([W({converter:Cr()})],oe.prototype,"source",2),U([W({type:Boolean})],oe.prototype,"autoplay",2),U([W({type:Boolean})],oe.prototype,"muted",2),U([W({type:Boolean})],oe.prototype,"loop",2),U([W({type:String})],oe.prototype,"poster",2),U([W({type:String})],oe.prototype,"scaling",2),U([W({type:String,attribute:"aspect-ratio"})],oe.prototype,"aspectRatio",2),U([W({converter:Cr()})],oe.prototype,"config",2),U([W({type:Boolean})],oe.prototype,"debug",2),U([W({type:Number})],oe.prototype,"autohide",2),U([W({type:Boolean})],oe.prototype,"hotkeys",2),U([W({type:Boolean,reflect:!0})],oe.prototype,"mobile",2),U([W({type:Boolean,reflect:!0})],oe.prototype,"live",2),U([W({type:Boolean,reflect:!0})],oe.prototype,"fluid",2),U([Xt()],oe.prototype,"_player",2),U([Xt()],oe.prototype,"_providerType",2),U([Xt()],oe.prototype,"_error",2),U([Xt()],oe.prototype,"_connectionState",2),U([Xt()],oe.prototype,"_showEndedOverlay",2),oe=U([Zt("bp-default-ui")],oe);var qg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2767
+ `}};U([W({converter:Ir()})],oe.prototype,"source",2),U([W({type:Boolean})],oe.prototype,"autoplay",2),U([W({type:Boolean})],oe.prototype,"muted",2),U([W({type:Boolean})],oe.prototype,"loop",2),U([W({type:String})],oe.prototype,"poster",2),U([W({type:String})],oe.prototype,"scaling",2),U([W({type:String,attribute:"aspect-ratio"})],oe.prototype,"aspectRatio",2),U([W({converter:Ir()})],oe.prototype,"config",2),U([W({type:Boolean})],oe.prototype,"debug",2),U([W({type:Number})],oe.prototype,"autohide",2),U([W({type:Boolean})],oe.prototype,"hotkeys",2),U([W({type:Boolean,reflect:!0})],oe.prototype,"mobile",2),U([W({type:Boolean,reflect:!0})],oe.prototype,"live",2),U([W({type:Boolean,reflect:!0})],oe.prototype,"fluid",2),U([Xt()],oe.prototype,"_player",2),U([Xt()],oe.prototype,"_providerType",2),U([Xt()],oe.prototype,"_error",2),U([Xt()],oe.prototype,"_connectionState",2),U([Xt()],oe.prototype,"_showEndedOverlay",2),oe=U([Zt("bp-default-ui")],oe);var Xg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2768
2768
  <circle cx="12" cy="12" r="10" stroke-opacity="0.25"/>
2769
2769
  <path d="M12 2a10 10 0 0 1 10 10" stroke-linecap="round">
2770
2770
  <animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/>
2771
2771
  </path>
2772
- </svg>`,zg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2772
+ </svg>`,Jg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2773
2773
  <path d="M21 6H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H3V8h18v8z"/>
2774
2774
  <circle cx="12" cy="12" r="3" fill="currentColor"/>
2775
- </svg>`,Yg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2775
+ </svg>`,jg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2776
2776
  <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
2777
- </svg>`,Qg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2777
+ </svg>`,eb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2778
2778
  <path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/>
2779
- </svg>`,Wt=class extends Me{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return qg;case"offline":return zg;case"ended":return this.live?Yg:Qg;default:return""}}getDefaultMessage(){switch(this.type){case"loading":return"Loading...";case"offline":return"The live stream hasn't started yet";case"ended":return this.live?"Stream has ended":"Replay";default:return""}}render(){if(this.type==="none")return null;let t=this.getIcon(),r=this.getDefaultMessage();return Ge`
2779
+ </svg>`,Wt=class extends Re{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return Xg;case"offline":return Jg;case"ended":return this.live?jg:eb;default:return""}}getDefaultMessage(){switch(this.type){case"loading":return"Loading...";case"offline":return"The live stream hasn't started yet";case"ended":return this.live?"Stream has ended":"Replay";default:return""}}render(){if(this.type==="none")return null;let t=this.getIcon(),r=this.getDefaultMessage();return Ke`
2780
2780
  <div part="icon">
2781
2781
  <slot name="icon">${this.renderIcon(t)}</slot>
2782
2782
  </div>
@@ -2857,7 +2857,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2857
2857
  :host([button-mode]) [part="submessage"] {
2858
2858
  display: none;
2859
2859
  }
2860
- `,U([W({type:String,reflect:!0})],Wt.prototype,"type",2),U([W({type:Boolean,reflect:!0})],Wt.prototype,"live",2),U([W({type:Boolean,reflect:!0,attribute:"button-mode"})],Wt.prototype,"buttonMode",2),Wt=U([Zt("bp-overlay")],Wt);var Zg=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],_m=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function Xg(i){return`
2860
+ `,U([W({type:String,reflect:!0})],Wt.prototype,"type",2),U([W({type:Boolean,reflect:!0})],Wt.prototype,"live",2),U([W({type:Boolean,reflect:!0,attribute:"button-mode"})],Wt.prototype,"buttonMode",2),Wt=U([Zt("bp-overlay")],Wt);var tb=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],km=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function ib(i){return`
2861
2861
  <style>
2862
2862
  :host {
2863
2863
  display: inline-flex;
@@ -2871,10 +2871,10 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2871
2871
  }
2872
2872
  </style>
2873
2873
  <slot name="media">
2874
- <audio${Lm(i)}></audio>
2874
+ <audio${Mm(i)}></audio>
2875
2875
  </slot>
2876
2876
  <slot></slot>
2877
- `}function Jg(i){return`
2877
+ `}function rb(i){return`
2878
2878
  <style>
2879
2879
  :host {
2880
2880
  display: inline-block;
@@ -2896,25 +2896,25 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2896
2896
  }
2897
2897
  </style>
2898
2898
  <slot name="media">
2899
- <video${Lm(i)}></video>
2899
+ <video${Mm(i)}></video>
2900
2900
  </slot>
2901
2901
  <slot></slot>
2902
- `}function km(i,{tag:e,is:t}){var n,a,l,d,m,ym,g,E,p,T,f,sr,ou,Tm,nu,Am,Sm;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),o=r?jg(r):[];return l=class extends i{constructor(){super(...arguments);L(this,f);L(this,g,!1);L(this,E,null);L(this,p,new Map);L(this,T);$(this,"get");$(this,"set");$(this,"call")}static get observedAttributes(){var K,de;return P(K=l,m,ym).call(K),[...((de=r==null?void 0:r.constructor)==null?void 0:de.observedAttributes)??[],..._m]}get nativeEl(){var C;return P(this,f,sr).call(this),u(this,E)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((C=this.shadowRoot)==null?void 0:C.querySelector(e))??null}set nativeEl(C){v(this,E,C)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(C){this.toggleAttribute("muted",C)}get src(){return this.getAttribute("src")}set src(C){this.setAttribute("src",`${C}`)}get preload(){var C;return this.getAttribute("preload")??((C=this.nativeEl)==null?void 0:C.preload)}set preload(C){this.setAttribute("preload",`${C}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let C=eb(this.attributes);t&&(C.is=t),e&&(C.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(C)}this.nativeEl.muted=this.hasAttribute("muted");for(let C of o)P(this,f,Am).call(this,C);v(this,T,new MutationObserver(P(this,f,Tm).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>P(this,f,ou).call(this)),P(this,f,ou).call(this);for(let C of this.constructor.Events)this.shadowRoot.addEventListener(C,this,!0)}handleEvent(C){C.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(C.type,{detail:C.detail}))}attributeChangedCallback(C,K,de){P(this,f,sr).call(this),P(this,f,Sm).call(this,C,K,de)}connectedCallback(){P(this,f,sr).call(this)}},d=new WeakMap,m=new WeakSet,ym=function(){if(u(this,d))return;v(this,d,!0);let C=new Set(this.observedAttributes);C.delete("muted");for(let K of o)if(!(K in this.prototype))if(typeof r[K]=="function")this.prototype[K]=function(...de){return P(this,f,sr).call(this),(()=>{var ve;if(this.call)return this.call(K,...de);let z=(ve=this.nativeEl)==null?void 0:ve[K];return z==null?void 0:z.apply(this.nativeEl,de)})()};else{let de={get(){var z,ve;P(this,f,sr).call(this);let ie=K.toLowerCase();if(C.has(ie)){let Dt=this.getAttribute(ie);return Dt===null?!1:Dt===""?!0:Dt}return((z=this.get)==null?void 0:z.call(this,K))??((ve=this.nativeEl)==null?void 0:ve[K])}};K!==K.toUpperCase()&&(de.set=function(ie){P(this,f,sr).call(this);let z=K.toLowerCase();if(C.has(z)){ie===!0||ie===!1||ie==null?this.toggleAttribute(z,!!ie):this.setAttribute(z,ie);return}if(this.set){this.set(K,ie);return}this.nativeEl&&(this.nativeEl[K]=ie)}),Object.defineProperty(this.prototype,K,de)}},g=new WeakMap,E=new WeakMap,p=new WeakMap,T=new WeakMap,f=new WeakSet,sr=function(){u(this,g)||(v(this,g,!0),this.init())},ou=function(){var ie;let C=new Map(u(this,p)),K=(ie=this.shadowRoot)==null?void 0:ie.querySelector("slot:not([name])");(K==null?void 0:K.assignedElements({flatten:!0}).filter(z=>["track","source"].includes(z.localName))).forEach(z=>{var Dt,$o;C.delete(z);let ve=u(this,p).get(z);ve||(ve=z.cloneNode(),u(this,p).set(z,ve),(Dt=u(this,T))==null||Dt.observe(z,{attributes:!0})),($o=this.nativeEl)==null||$o.append(ve),P(this,f,nu).call(this,ve)}),C.forEach((z,ve)=>{z.remove(),u(this,p).delete(ve)})},Tm=function(C){for(let K of C)if(K.type==="attributes"){let{target:de,attributeName:ie}=K,z=u(this,p).get(de);z&&ie&&(z.setAttribute(ie,de.getAttribute(ie)??""),P(this,f,nu).call(this,z))}},nu=function(C){C&&C.localName==="track"&&C.default&&(C.kind==="chapters"||C.kind==="metadata")&&C.track.mode==="disabled"&&(C.track.mode="hidden")},Am=function(C){if(Object.prototype.hasOwnProperty.call(this,C)){let K=this[C];delete this[C],this[C]=K}},Sm=function(C,K,de){var ie,z,ve;["id","class"].includes(C)||!l.observedAttributes.includes(C)&&this.constructor.observedAttributes.includes(C)||(de===null?(ie=this.nativeEl)==null||ie.removeAttribute(C):((z=this.nativeEl)==null?void 0:z.getAttribute(C))!==de&&((ve=this.nativeEl)==null||ve.setAttribute(C,de)))},L(l,m),$(l,"getTemplateHTML",e.endsWith("audio")?Xg:Jg),$(l,"shadowRootOptions",{mode:"open"}),$(l,"Events",Zg),L(l,d,!1),l}function jg(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function Lm(i){let e="";for(let t in i){if(!_m.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function eb(i){let e={};for(let t of i)e[t.name]=t.value;return e}var Ue=km(globalThis.HTMLElement??class{},{tag:"video"}),PI=km(globalThis.HTMLElement??class{},{tag:"audio"});var Ft=class extends Event{constructor(t,r){super(t);$(this,"track");this.track=r.track}};var au=new WeakMap;function k(i){return au.get(i)??tb(i,{})}function tb(i,e){let t=au.get(i);return t||au.set(i,t={}),Object.assign(t,e)}function Ml(i,e){let t=i.videoTracks;k(e).media=i,k(e).renditionSet||(k(e).renditionSet=new Set);let r=k(t).trackSet;r.add(e);let o=r.size-1;o in dr.prototype||Object.defineProperty(dr.prototype,o,{get(){return[...k(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Ft("addtrack",{track:e}))})}function Rl(i){var r;let e=(r=k(i).media)==null?void 0:r.videoTracks;if(!e)return;k(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ft("removetrack",{track:i}))})}function Cm(i){let e=k(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(k(e).changeRequested)return;k(e).changeRequested=!0,queueMicrotask(()=>{delete k(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var mi,vi,fi,lr,ca,dr=class extends EventTarget{constructor(){super();L(this,lr);L(this,mi);L(this,vi);L(this,fi);k(this).trackSet=new Set}[Symbol.iterator](){return u(this,lr,ca).values()}get length(){return u(this,lr,ca).size}getTrackById(t){return[...u(this,lr,ca)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,lr,ca)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,mi)}set onaddtrack(t){u(this,mi)&&(this.removeEventListener("addtrack",u(this,mi)),v(this,mi,void 0)),typeof t=="function"&&(v(this,mi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,vi)}set onremovetrack(t){u(this,vi)&&(this.removeEventListener("removetrack",u(this,vi)),v(this,vi,void 0)),typeof t=="function"&&(v(this,vi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,fi)}set onchange(t){u(this,fi)&&(this.removeEventListener("change",u(this,fi)),v(this,fi,void 0)),typeof t=="function"&&(v(this,fi,t),this.addEventListener("change",t))}};mi=new WeakMap,vi=new WeakMap,fi=new WeakMap,lr=new WeakSet,ca=function(){return k(this).trackSet};var Kt=class extends Event{constructor(t,r){super(t);$(this,"rendition");this.rendition=r.rendition}};function Im(i,e){let t=k(i).media.videoRenditions;k(e).media=k(i).media,k(e).track=i;let r=k(i).renditionSet;r.add(e);let o=r.size-1;o in cr.prototype||Object.defineProperty(cr.prototype,o,{get(){return Ao(this)[o]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Kt("addrendition",{rendition:e}))})}function wm(i){let e=k(i).media.videoRenditions,t=k(i).track;k(t).renditionSet.delete(i),queueMicrotask(()=>{k(i).track.selected&&e.dispatchEvent(new Kt("removerendition",{rendition:i}))})}function Mm(i){let e=k(i).media.videoRenditions;!e||k(e).changeRequested||(k(e).changeRequested=!0,queueMicrotask(()=>{delete k(e).changeRequested,k(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Ao(i){return[...k(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...k(t).renditionSet])}var Ei,gi,bi,cr=class extends EventTarget{constructor(){super(...arguments);L(this,Ei);L(this,gi);L(this,bi)}[Symbol.iterator](){return Ao(this).values()}get length(){return Ao(this).length}getRenditionById(t){return Ao(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Ao(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of Ao(this).entries())o.selected=r===t}get onaddrendition(){return u(this,Ei)}set onaddrendition(t){u(this,Ei)&&(this.removeEventListener("addrendition",u(this,Ei)),v(this,Ei,void 0)),typeof t=="function"&&(v(this,Ei,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,gi)}set onremoverendition(t){u(this,gi)&&(this.removeEventListener("removerendition",u(this,gi)),v(this,gi,void 0)),typeof t=="function"&&(v(this,gi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,bi)}set onchange(t){u(this,bi)&&(this.removeEventListener("change",u(this,bi)),v(this,bi,void 0)),typeof t=="function"&&(v(this,bi,t),this.addEventListener("change",t))}};Ei=new WeakMap,gi=new WeakMap,bi=new WeakMap;var So,ua=class{constructor(){$(this,"src");$(this,"id");$(this,"width");$(this,"height");$(this,"bitrate");$(this,"frameRate");$(this,"codec");L(this,So,!1)}get selected(){return u(this,So)}set selected(e){u(this,So)!==e&&(v(this,So,e),Mm(this))}};So=new WeakMap;var ko,Lo=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");L(this,ko,!1)}addRendition(e,t,r,o,n,a){let l=new ua;return l.src=e,l.width=t,l.height=r,l.frameRate=a,l.bitrate=n,l.codec=o,Im(this,l),l}removeRendition(e){wm(e)}get selected(){return u(this,ko)}set selected(e){u(this,ko)!==e&&(v(this,ko,e),e===!0&&Cm(this))}};ko=new WeakMap;function Rm(i,e){let t=k(i).media.audioRenditions;k(e).media=k(i).media,k(e).track=i;let r=k(i).renditionSet;r.add(e);let o=r.size-1;o in ur.prototype||Object.defineProperty(ur.prototype,o,{get(){return Co(this)[o]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Kt("addrendition",{rendition:e}))})}function xm(i){let e=k(i).media.audioRenditions,t=k(i).track;k(t).renditionSet.delete(i),queueMicrotask(()=>{k(i).track.enabled&&e.dispatchEvent(new Kt("removerendition",{rendition:i}))})}function Pm(i){let e=k(i).media.audioRenditions;!e||k(e).changeRequested||(k(e).changeRequested=!0,queueMicrotask(()=>{delete k(e).changeRequested,k(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function Co(i){return[...k(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...k(t).renditionSet])}var _i,yi,Ti,ur=class extends EventTarget{constructor(){super(...arguments);L(this,_i);L(this,yi);L(this,Ti)}[Symbol.iterator](){return Co(this).values()}get length(){return Co(this).length}getRenditionById(t){return Co(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Co(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of Co(this).entries())o.selected=r===t}get onaddrendition(){return u(this,_i)}set onaddrendition(t){u(this,_i)&&(this.removeEventListener("addrendition",u(this,_i)),v(this,_i,void 0)),typeof t=="function"&&(v(this,_i,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,yi)}set onremoverendition(t){u(this,yi)&&(this.removeEventListener("removerendition",u(this,yi)),v(this,yi,void 0)),typeof t=="function"&&(v(this,yi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,Ti)}set onchange(t){u(this,Ti)&&(this.removeEventListener("change",u(this,Ti)),v(this,Ti,void 0)),typeof t=="function"&&(v(this,Ti,t),this.addEventListener("change",t))}};_i=new WeakMap,yi=new WeakMap,Ti=new WeakMap;var Io,ha=class{constructor(){$(this,"src");$(this,"id");$(this,"bitrate");$(this,"codec");L(this,Io,!1)}get selected(){return u(this,Io)}set selected(e){u(this,Io)!==e&&(v(this,Io,e),Pm(this))}};Io=new WeakMap;function Pl(i,e){let t=i.audioTracks;k(e).media=i,k(e).renditionSet||(k(e).renditionSet=new Set);let r=k(t).trackSet;r.add(e);let o=r.size-1;o in hr.prototype||Object.defineProperty(hr.prototype,o,{get(){return[...k(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Ft("addtrack",{track:e}))})}function Dl(i){var r;let e=(r=k(i).media)==null?void 0:r.audioTracks;if(!e)return;k(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ft("removetrack",{track:i}))})}function Dm(i){let e=k(i).media.audioTracks;!e||k(e).changeRequested||(k(e).changeRequested=!0,queueMicrotask(()=>{delete k(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var Ai,Si,ki,wo,xl,hr=class extends EventTarget{constructor(){super();L(this,wo);L(this,Ai);L(this,Si);L(this,ki);k(this).trackSet=new Set}[Symbol.iterator](){return u(this,wo,xl).values()}get length(){return u(this,wo,xl).size}getTrackById(t){return[...u(this,wo,xl)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,Ai)}set onaddtrack(t){u(this,Ai)&&(this.removeEventListener("addtrack",u(this,Ai)),v(this,Ai,void 0)),typeof t=="function"&&(v(this,Ai,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,Si)}set onremovetrack(t){u(this,Si)&&(this.removeEventListener("removetrack",u(this,Si)),v(this,Si,void 0)),typeof t=="function"&&(v(this,Si,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,ki)}set onchange(t){u(this,ki)&&(this.removeEventListener("change",u(this,ki)),v(this,ki,void 0)),typeof t=="function"&&(v(this,ki,t),this.addEventListener("change",t))}};Ai=new WeakMap,Si=new WeakMap,ki=new WeakMap,wo=new WeakSet,xl=function(){return k(this).trackSet};var Mo,Ro=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");L(this,Mo,!1)}addRendition(e,t,r){let o=new ha;return o.src=e,o.codec=t,o.bitrate=r,Rm(this,o),o}removeRendition(e){xm(e)}get enabled(){return u(this,Mo)}set enabled(e){u(this,Mo)!==e&&(v(this,Mo,e),Dm(this))}};Mo=new WeakMap;var Om=Ol(globalThis.HTMLMediaElement,"video"),Nm=Ol(globalThis.HTMLMediaElement,"audio");function xo(i){if(!(i!=null&&i.prototype))return i;let e=Ol(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return ib(this)}});let t=Ol(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return rb(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",l=""){let d=new Lo;return d.kind=n,d.label=a,d.language=l,Ml(this,d),d}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=Rl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",l=""){let d=new Ro;return d.kind=n,d.label=a,d.language=l,Pl(this,d),d}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Dl),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=k(n).videoRenditions;return a||(a=new cr,k(a).media=n,k(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return o(this)}});let o=n=>{let a=k(n).audioRenditions;return a||(a=new ur,k(a).media=n,k(n).audioRenditions=a),a};return i}function Ol(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function ib(i){let e=k(i).videoTracks;if(!e&&(e=new dr,k(i).videoTracks=e,Om)){let t=Om.call(i.nativeEl??i);for(let r of t)Ml(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof Lo)){for(let o of t)Rl(o);return}Ml(i,r.track)}),t.addEventListener("removetrack",r=>{Rl(r.track)})}return e}function rb(i){let e=k(i).audioTracks;if(!e&&(e=new hr,k(i).audioTracks=e,Nm)){let t=Nm.call(i.nativeEl??i);for(let r of t)Pl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof Ro)){for(let o of t)Dl(o);return}Pl(i,r.track)}),t.addEventListener("removetrack",r=>{Dl(r.track)})}return e}import Fe from"hls.js";var ob=xo(Ue),Gt,qt,zt,Po,Xe,su,Um,lu,pa,Hm,pr=class extends ob{constructor(){super();L(this,Xe);L(this,Gt,null);L(this,qt,null);L(this,zt,null);L(this,Po,!1);this.api=null;L(this,pa,()=>{var r,o;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(o=this.api)==null||o.startLoad()});P(this,Xe,Hm).call(this,"config")}static getTemplateHTML(t,r={}){let{src:o,...n}=t;return`
2902
+ `}function Rm(i,{tag:e,is:t}){var n,s,l,d,m,Lm,g,E,p,T,f,ar,lu,Im,du,wm,Cm;let r=(s=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:s.call(n,e,{is:t}),o=r?ob(r):[];return l=class extends i{constructor(){super(...arguments);L(this,f);L(this,g,!1);L(this,E,null);L(this,p,new Map);L(this,T);$(this,"get");$(this,"set");$(this,"call")}static get observedAttributes(){var q,de;return P(q=l,m,Lm).call(q),[...((de=r==null?void 0:r.constructor)==null?void 0:de.observedAttributes)??[],...km]}get nativeEl(){var I;return P(this,f,ar).call(this),u(this,E)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((I=this.shadowRoot)==null?void 0:I.querySelector(e))??null}set nativeEl(I){v(this,E,I)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(I){this.toggleAttribute("muted",I)}get src(){return this.getAttribute("src")}set src(I){this.setAttribute("src",`${I}`)}get preload(){var I;return this.getAttribute("preload")??((I=this.nativeEl)==null?void 0:I.preload)}set preload(I){this.setAttribute("preload",`${I}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let I=nb(this.attributes);t&&(I.is=t),e&&(I.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(I)}this.nativeEl.muted=this.hasAttribute("muted");for(let I of o)P(this,f,wm).call(this,I);v(this,T,new MutationObserver(P(this,f,Im).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>P(this,f,lu).call(this)),P(this,f,lu).call(this);for(let I of this.constructor.Events)this.shadowRoot.addEventListener(I,this,!0)}handleEvent(I){I.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(I.type,{detail:I.detail}))}attributeChangedCallback(I,q,de){P(this,f,ar).call(this),P(this,f,Cm).call(this,I,q,de)}connectedCallback(){P(this,f,ar).call(this)}},d=new WeakMap,m=new WeakSet,Lm=function(){if(u(this,d))return;v(this,d,!0);let I=new Set(this.observedAttributes);I.delete("muted");for(let q of o)if(!(q in this.prototype))if(typeof r[q]=="function")this.prototype[q]=function(...de){return P(this,f,ar).call(this),(()=>{var ve;if(this.call)return this.call(q,...de);let z=(ve=this.nativeEl)==null?void 0:ve[q];return z==null?void 0:z.apply(this.nativeEl,de)})()};else{let de={get(){var z,ve;P(this,f,ar).call(this);let ie=q.toLowerCase();if(I.has(ie)){let Dt=this.getAttribute(ie);return Dt===null?!1:Dt===""?!0:Dt}return((z=this.get)==null?void 0:z.call(this,q))??((ve=this.nativeEl)==null?void 0:ve[q])}};q!==q.toUpperCase()&&(de.set=function(ie){P(this,f,ar).call(this);let z=q.toLowerCase();if(I.has(z)){ie===!0||ie===!1||ie==null?this.toggleAttribute(z,!!ie):this.setAttribute(z,ie);return}if(this.set){this.set(q,ie);return}this.nativeEl&&(this.nativeEl[q]=ie)}),Object.defineProperty(this.prototype,q,de)}},g=new WeakMap,E=new WeakMap,p=new WeakMap,T=new WeakMap,f=new WeakSet,ar=function(){u(this,g)||(v(this,g,!0),this.init())},lu=function(){var ie;let I=new Map(u(this,p)),q=(ie=this.shadowRoot)==null?void 0:ie.querySelector("slot:not([name])");(q==null?void 0:q.assignedElements({flatten:!0}).filter(z=>["track","source"].includes(z.localName))).forEach(z=>{var Dt,$o;I.delete(z);let ve=u(this,p).get(z);ve||(ve=z.cloneNode(),u(this,p).set(z,ve),(Dt=u(this,T))==null||Dt.observe(z,{attributes:!0})),($o=this.nativeEl)==null||$o.append(ve),P(this,f,du).call(this,ve)}),I.forEach((z,ve)=>{z.remove(),u(this,p).delete(ve)})},Im=function(I){for(let q of I)if(q.type==="attributes"){let{target:de,attributeName:ie}=q,z=u(this,p).get(de);z&&ie&&(z.setAttribute(ie,de.getAttribute(ie)??""),P(this,f,du).call(this,z))}},du=function(I){I&&I.localName==="track"&&I.default&&(I.kind==="chapters"||I.kind==="metadata")&&I.track.mode==="disabled"&&(I.track.mode="hidden")},wm=function(I){if(Object.prototype.hasOwnProperty.call(this,I)){let q=this[I];delete this[I],this[I]=q}},Cm=function(I,q,de){var ie,z,ve;["id","class"].includes(I)||!l.observedAttributes.includes(I)&&this.constructor.observedAttributes.includes(I)||(de===null?(ie=this.nativeEl)==null||ie.removeAttribute(I):((z=this.nativeEl)==null?void 0:z.getAttribute(I))!==de&&((ve=this.nativeEl)==null||ve.setAttribute(I,de)))},L(l,m),$(l,"getTemplateHTML",e.endsWith("audio")?ib:rb),$(l,"shadowRootOptions",{mode:"open"}),$(l,"Events",tb),L(l,d,!1),l}function ob(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function Mm(i){let e="";for(let t in i){if(!km.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function nb(i){let e={};for(let t of i)e[t.name]=t.value;return e}var Ue=Rm(globalThis.HTMLElement??class{},{tag:"video"}),Ww=Rm(globalThis.HTMLElement??class{},{tag:"audio"});var Ft=class extends Event{constructor(t,r){super(t);$(this,"track");this.track=r.track}};var cu=new WeakMap;function k(i){return cu.get(i)??sb(i,{})}function sb(i,e){let t=cu.get(i);return t||cu.set(i,t={}),Object.assign(t,e)}function xl(i,e){let t=i.videoTracks;k(e).media=i,k(e).renditionSet||(k(e).renditionSet=new Set);let r=k(t).trackSet;r.add(e);let o=r.size-1;o in dr.prototype||Object.defineProperty(dr.prototype,o,{get(){return[...k(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Ft("addtrack",{track:e}))})}function Pl(i){var r;let e=(r=k(i).media)==null?void 0:r.videoTracks;if(!e)return;k(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ft("removetrack",{track:i}))})}function xm(i){let e=k(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(k(e).changeRequested)return;k(e).changeRequested=!0,queueMicrotask(()=>{delete k(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var mi,vi,fi,lr,hs,dr=class extends EventTarget{constructor(){super();L(this,lr);L(this,mi);L(this,vi);L(this,fi);k(this).trackSet=new Set}[Symbol.iterator](){return u(this,lr,hs).values()}get length(){return u(this,lr,hs).size}getTrackById(t){return[...u(this,lr,hs)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,lr,hs)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,mi)}set onaddtrack(t){u(this,mi)&&(this.removeEventListener("addtrack",u(this,mi)),v(this,mi,void 0)),typeof t=="function"&&(v(this,mi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,vi)}set onremovetrack(t){u(this,vi)&&(this.removeEventListener("removetrack",u(this,vi)),v(this,vi,void 0)),typeof t=="function"&&(v(this,vi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,fi)}set onchange(t){u(this,fi)&&(this.removeEventListener("change",u(this,fi)),v(this,fi,void 0)),typeof t=="function"&&(v(this,fi,t),this.addEventListener("change",t))}};mi=new WeakMap,vi=new WeakMap,fi=new WeakMap,lr=new WeakSet,hs=function(){return k(this).trackSet};var qt=class extends Event{constructor(t,r){super(t);$(this,"rendition");this.rendition=r.rendition}};function Pm(i,e){let t=k(i).media.videoRenditions;k(e).media=k(i).media,k(e).track=i;let r=k(i).renditionSet;r.add(e);let o=r.size-1;o in cr.prototype||Object.defineProperty(cr.prototype,o,{get(){return Ao(this)[o]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new qt("addrendition",{rendition:e}))})}function Dm(i){let e=k(i).media.videoRenditions,t=k(i).track;k(t).renditionSet.delete(i),queueMicrotask(()=>{k(i).track.selected&&e.dispatchEvent(new qt("removerendition",{rendition:i}))})}function Om(i){let e=k(i).media.videoRenditions;!e||k(e).changeRequested||(k(e).changeRequested=!0,queueMicrotask(()=>{delete k(e).changeRequested,k(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Ao(i){return[...k(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...k(t).renditionSet])}var Ei,gi,bi,cr=class extends EventTarget{constructor(){super(...arguments);L(this,Ei);L(this,gi);L(this,bi)}[Symbol.iterator](){return Ao(this).values()}get length(){return Ao(this).length}getRenditionById(t){return Ao(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Ao(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of Ao(this).entries())o.selected=r===t}get onaddrendition(){return u(this,Ei)}set onaddrendition(t){u(this,Ei)&&(this.removeEventListener("addrendition",u(this,Ei)),v(this,Ei,void 0)),typeof t=="function"&&(v(this,Ei,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,gi)}set onremoverendition(t){u(this,gi)&&(this.removeEventListener("removerendition",u(this,gi)),v(this,gi,void 0)),typeof t=="function"&&(v(this,gi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,bi)}set onchange(t){u(this,bi)&&(this.removeEventListener("change",u(this,bi)),v(this,bi,void 0)),typeof t=="function"&&(v(this,bi,t),this.addEventListener("change",t))}};Ei=new WeakMap,gi=new WeakMap,bi=new WeakMap;var So,ps=class{constructor(){$(this,"src");$(this,"id");$(this,"width");$(this,"height");$(this,"bitrate");$(this,"frameRate");$(this,"codec");L(this,So,!1)}get selected(){return u(this,So)}set selected(e){u(this,So)!==e&&(v(this,So,e),Om(this))}};So=new WeakMap;var ko,Lo=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");L(this,ko,!1)}addRendition(e,t,r,o,n,s){let l=new ps;return l.src=e,l.width=t,l.height=r,l.frameRate=s,l.bitrate=n,l.codec=o,Pm(this,l),l}removeRendition(e){Dm(e)}get selected(){return u(this,ko)}set selected(e){u(this,ko)!==e&&(v(this,ko,e),e===!0&&xm(this))}};ko=new WeakMap;function Nm(i,e){let t=k(i).media.audioRenditions;k(e).media=k(i).media,k(e).track=i;let r=k(i).renditionSet;r.add(e);let o=r.size-1;o in ur.prototype||Object.defineProperty(ur.prototype,o,{get(){return Io(this)[o]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new qt("addrendition",{rendition:e}))})}function Um(i){let e=k(i).media.audioRenditions,t=k(i).track;k(t).renditionSet.delete(i),queueMicrotask(()=>{k(i).track.enabled&&e.dispatchEvent(new qt("removerendition",{rendition:i}))})}function Hm(i){let e=k(i).media.audioRenditions;!e||k(e).changeRequested||(k(e).changeRequested=!0,queueMicrotask(()=>{delete k(e).changeRequested,k(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function Io(i){return[...k(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...k(t).renditionSet])}var _i,yi,Ti,ur=class extends EventTarget{constructor(){super(...arguments);L(this,_i);L(this,yi);L(this,Ti)}[Symbol.iterator](){return Io(this).values()}get length(){return Io(this).length}getRenditionById(t){return Io(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Io(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of Io(this).entries())o.selected=r===t}get onaddrendition(){return u(this,_i)}set onaddrendition(t){u(this,_i)&&(this.removeEventListener("addrendition",u(this,_i)),v(this,_i,void 0)),typeof t=="function"&&(v(this,_i,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,yi)}set onremoverendition(t){u(this,yi)&&(this.removeEventListener("removerendition",u(this,yi)),v(this,yi,void 0)),typeof t=="function"&&(v(this,yi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,Ti)}set onchange(t){u(this,Ti)&&(this.removeEventListener("change",u(this,Ti)),v(this,Ti,void 0)),typeof t=="function"&&(v(this,Ti,t),this.addEventListener("change",t))}};_i=new WeakMap,yi=new WeakMap,Ti=new WeakMap;var wo,ms=class{constructor(){$(this,"src");$(this,"id");$(this,"bitrate");$(this,"codec");L(this,wo,!1)}get selected(){return u(this,wo)}set selected(e){u(this,wo)!==e&&(v(this,wo,e),Hm(this))}};wo=new WeakMap;function Ol(i,e){let t=i.audioTracks;k(e).media=i,k(e).renditionSet||(k(e).renditionSet=new Set);let r=k(t).trackSet;r.add(e);let o=r.size-1;o in hr.prototype||Object.defineProperty(hr.prototype,o,{get(){return[...k(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Ft("addtrack",{track:e}))})}function Nl(i){var r;let e=(r=k(i).media)==null?void 0:r.audioTracks;if(!e)return;k(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ft("removetrack",{track:i}))})}function $m(i){let e=k(i).media.audioTracks;!e||k(e).changeRequested||(k(e).changeRequested=!0,queueMicrotask(()=>{delete k(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var Ai,Si,ki,Co,Dl,hr=class extends EventTarget{constructor(){super();L(this,Co);L(this,Ai);L(this,Si);L(this,ki);k(this).trackSet=new Set}[Symbol.iterator](){return u(this,Co,Dl).values()}get length(){return u(this,Co,Dl).size}getTrackById(t){return[...u(this,Co,Dl)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,Ai)}set onaddtrack(t){u(this,Ai)&&(this.removeEventListener("addtrack",u(this,Ai)),v(this,Ai,void 0)),typeof t=="function"&&(v(this,Ai,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,Si)}set onremovetrack(t){u(this,Si)&&(this.removeEventListener("removetrack",u(this,Si)),v(this,Si,void 0)),typeof t=="function"&&(v(this,Si,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,ki)}set onchange(t){u(this,ki)&&(this.removeEventListener("change",u(this,ki)),v(this,ki,void 0)),typeof t=="function"&&(v(this,ki,t),this.addEventListener("change",t))}};Ai=new WeakMap,Si=new WeakMap,ki=new WeakMap,Co=new WeakSet,Dl=function(){return k(this).trackSet};var Ro,Mo=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");L(this,Ro,!1)}addRendition(e,t,r){let o=new ms;return o.src=e,o.codec=t,o.bitrate=r,Nm(this,o),o}removeRendition(e){Um(e)}get enabled(){return u(this,Ro)}set enabled(e){u(this,Ro)!==e&&(v(this,Ro,e),$m(this))}};Ro=new WeakMap;var Bm=Ul(globalThis.HTMLMediaElement,"video"),Vm=Ul(globalThis.HTMLMediaElement,"audio");function xo(i){if(!(i!=null&&i.prototype))return i;let e=Ul(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return ab(this)}});let t=Ul(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return lb(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,s="",l=""){let d=new Lo;return d.kind=n,d.label=s,d.language=l,xl(this,d),d}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=Pl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,s="",l=""){let d=new Mo;return d.kind=n,d.label=s,d.language=l,Ol(this,d),d}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Nl),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let s=k(n).videoRenditions;return s||(s=new cr,k(s).media=n,k(n).videoRenditions=s),s};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return o(this)}});let o=n=>{let s=k(n).audioRenditions;return s||(s=new ur,k(s).media=n,k(n).audioRenditions=s),s};return i}function Ul(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function ab(i){let e=k(i).videoTracks;if(!e&&(e=new dr,k(i).videoTracks=e,Bm)){let t=Bm.call(i.nativeEl??i);for(let r of t)xl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof Lo)){for(let o of t)Pl(o);return}xl(i,r.track)}),t.addEventListener("removetrack",r=>{Pl(r.track)})}return e}function lb(i){let e=k(i).audioTracks;if(!e&&(e=new hr,k(i).audioTracks=e,Vm)){let t=Vm.call(i.nativeEl??i);for(let r of t)Ol(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof Mo)){for(let o of t)Nl(o);return}Ol(i,r.track)}),t.addEventListener("removetrack",r=>{Nl(r.track)})}return e}import Fe from"hls.js";var db=xo(Ue),Kt,Gt,zt,Po,Xe,uu,Wm,hu,vs,Fm,pr=class extends db{constructor(){super();L(this,Xe);L(this,Kt,null);L(this,Gt,null);L(this,zt,null);L(this,Po,!1);this.api=null;L(this,vs,()=>{var r,o;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(o=this.api)==null||o.startLoad()});P(this,Xe,Fm).call(this,"config")}static getTemplateHTML(t,r={}){let{src:o,...n}=t;return`
2903
2903
  <script type="application/json" id="config">
2904
2904
  ${JSON.stringify(r.config||{})}
2905
2905
  <\/script>
2906
2906
  ${Ue.getTemplateHTML(n)}
2907
- `}get config(){return u(this,zt)}set config(t){v(this,zt,t)}attributeChangedCallback(t,r,o){t!=="src"&&super.attributeChangedCallback(t,r,o),t==="src"&&r!==o&&this.load()}disconnectedCallback(){var t;P(this,Xe,su).call(this),(t=super.disconnectedCallback)==null||t.call(this)}async load(){var o,n,a,l;let t=!this.api&&!u(this,Po);if(P(this,Xe,su).call(this),!this.src)return;if(t&&!u(this,zt))try{v(this,zt,JSON.parse(((n=(o=this.shadowRoot)==null?void 0:o.getElementById("config"))==null?void 0:n.textContent)||"{}"))}catch(d){console.error("[hls-video] Failed to parse config:",d),v(this,zt,{})}if(!P(this,Xe,Um).call(this,this.src)){await Promise.resolve(),v(this,Po,!0),this.nativeEl.src=this.src;return}if(Fe.isSupported()){switch(await Promise.resolve(),this.api=new Fe({liveDurationInfinity:!0,autoStartLoad:!1,...u(this,zt)}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let p=()=>{var T;return(T=this.api)==null?void 0:T.startLoad()};this.nativeEl.addEventListener("play",p,{once:!0}),this.api.on(Fe.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",p)});break}case"metadata":{let p=this.api.config.maxBufferLength,T=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let f=()=>{this.api&&(this.api.config.maxBufferLength=p,this.api.config.maxBufferSize=T)};this.nativeEl.addEventListener("play",f,{once:!0}),this.api.on(Fe.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",f)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,pa)),v(this,Gt,document.createElement("source")),u(this,Gt).setAttribute("type","application/x-mpegURL"),u(this,Gt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(u(this,Gt));let m=new WeakMap;this.api.on(Fe.Events.MANIFEST_PARSED,(p,T)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(b=>{console.warn("Autoplay failed:",b)}),P(this,Xe,lu).call(this);let f=this.videoTracks.getTrackById("main");f||(f=this.addVideoTrack("main"),f.id="main",f.selected=!0);for(let[b,S]of T.levels.entries()){let te=f.addRendition(S.url[0],S.width,S.height,S.videoCodec??void 0,S.bitrate);m.set(S,`${b}`),te.id=`${b}`}for(let[b,S]of T.audioTracks.entries()){let te=S.default?"main":"alternative",Se=this.addAudioTrack(te,S.name,S.lang);Se.id=`${b}`,S.default&&(Se.enabled=!0)}}),(a=u(this,qt))==null||a.call(this);let h=()=>{var b,S;let p=[...this.audioTracks].find(te=>te.enabled),T=p?+p.id:void 0,f=((b=this.api)==null?void 0:b.audioTracks.map(te=>te.id))??[];T!==void 0&&T!==((S=this.api)==null?void 0:S.audioTrack)&&f.includes(T)&&this.api&&(this.api.audioTrack=T)};this.audioTracks.addEventListener("change",h),v(this,qt,()=>{this.audioTracks.removeEventListener("change",h)}),this.api.on(Fe.Events.LEVELS_UPDATED,(p,T)=>{let f=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!f)return;let b=T.levels.map(S=>m.get(S));for(let S of this.videoRenditions)S.id&&!b.includes(S.id)&&f.removeRendition(S)});let g=null;this.api.on(Fe.Events.ERROR,(p,T)=>{var f;T.type===Fe.ErrorTypes.NETWORK_ERROR&&T.details===Fe.ErrorDetails.FRAG_LOAD_ERROR&&(g=((f=T.frag)==null?void 0:f.level)??null)}),this.api.on(Fe.Events.LEVEL_SWITCHED,(p,T)=>{let f=T.level;g!==null&&f<g&&(console.warn(`hls.js downgraded quality from level ${g} to ${f} due to fragment load failure.`),this.videoRenditions.selectedIndex=f,g=null)});let E=()=>{let p=this.videoRenditions.selectedIndex;this.api&&p!==this.api.nextLevel&&(this.api.nextLevel=p)};(l=this.videoRenditions)==null||l.addEventListener("change",E),this.api.once(Fe.Events.DESTROYING,()=>{var p,T;P(this,Xe,lu).call(this),(p=this.videoRenditions)==null||p.removeEventListener("change",E),(T=u(this,qt))==null||T.call(this),v(this,qt,null)});return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};Gt=new WeakMap,qt=new WeakMap,zt=new WeakMap,Po=new WeakMap,Xe=new WeakSet,su=function(){var t,r,o;(t=u(this,Gt))==null||t.remove(),v(this,Gt,null),(r=u(this,qt))==null||r.call(this),v(this,qt,null),(o=this.nativeEl)==null||o.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,pa)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),v(this,Po,!1)},Um=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},lu=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},pa=new WeakMap,Hm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},pr.shadowRootOptions={...Ue.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",pr);var $m=pr;var nb="nanoplayer.4.min.js",ab="nanoplayer",Ie={loading:!1,loaded:!1,error:null,callbacks:[]};function sb(i,e){return new Promise((t,r)=>{if(window.NanoPlayer){Ie.loaded=!0,t();return}if(Ie.loaded){t();return}if(Ie.error){r(Ie.error);return}if(Ie.callbacks.push(a=>{a?r(a):t()}),Ie.loading)return;Ie.loading=!0;let o;e?o=e:o=`${i.endsWith("/")?i:`${i}/`}${ab}/${nb}`;let n=document.createElement("script");n.src=o,n.async=!0,n.onload=()=>{Ie.loaded=!0,Ie.loading=!1,Ie.callbacks.forEach(a=>a()),Ie.callbacks=[]},n.onerror=()=>{let a=new Error(`Failed to load NanoPlayer script from ${o}`);Ie.error=a,Ie.loading=!1,Ie.callbacks.forEach(l=>l(a)),Ie.callbacks=[]},document.head.appendChild(n)})}var lb=xo(Ue),st,Li,he,lt,Do,we,ma,Ci,Ii,mr,vr,dt,fr,Oo,No,Ae,Bm,du,Vm,Wm,Fm,Nl,Er=class extends lb{constructor(){super();L(this,Ae);L(this,st,null);L(this,Li,null);L(this,he,null);L(this,lt,null);L(this,Do,"");L(this,we,null);L(this,ma,!0);L(this,Ci,[]);L(this,Ii,[]);L(this,mr,[]);L(this,vr,null);L(this,dt,null);L(this,fr,!1);L(this,Oo,!1);L(this,No,null);this.api=null;P(this,Ae,Nl).call(this,"config"),P(this,Ae,Nl).call(this,"streamid"),P(this,Ae,Nl).call(this,"sourceConfig"),P(this,Ae,Bm).call(this)}static get observedAttributes(){return[...Ue.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:o,"library-location":n,...a}=t;return`
2907
+ `}get config(){return u(this,zt)}set config(t){v(this,zt,t)}attributeChangedCallback(t,r,o){t!=="src"&&super.attributeChangedCallback(t,r,o),t==="src"&&r!==o&&this.load()}disconnectedCallback(){var t;P(this,Xe,uu).call(this),(t=super.disconnectedCallback)==null||t.call(this)}async load(){var o,n,s,l;let t=!this.api&&!u(this,Po);if(P(this,Xe,uu).call(this),!this.src)return;if(t&&!u(this,zt))try{v(this,zt,JSON.parse(((n=(o=this.shadowRoot)==null?void 0:o.getElementById("config"))==null?void 0:n.textContent)||"{}"))}catch(d){console.error("[hls-video] Failed to parse config:",d),v(this,zt,{})}if(!P(this,Xe,Wm).call(this,this.src)){await Promise.resolve(),v(this,Po,!0),this.nativeEl.src=this.src;return}if(Fe.isSupported()){switch(await Promise.resolve(),this.api=new Fe({liveDurationInfinity:!0,autoStartLoad:!1,...u(this,zt)}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let p=()=>{var T;return(T=this.api)==null?void 0:T.startLoad()};this.nativeEl.addEventListener("play",p,{once:!0}),this.api.on(Fe.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",p)});break}case"metadata":{let p=this.api.config.maxBufferLength,T=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let f=()=>{this.api&&(this.api.config.maxBufferLength=p,this.api.config.maxBufferSize=T)};this.nativeEl.addEventListener("play",f,{once:!0}),this.api.on(Fe.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",f)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,vs)),v(this,Kt,document.createElement("source")),u(this,Kt).setAttribute("type","application/x-mpegURL"),u(this,Kt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(u(this,Kt));let m=new WeakMap;this.api.on(Fe.Events.MANIFEST_PARSED,(p,T)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(b=>{console.warn("Autoplay failed:",b)}),P(this,Xe,hu).call(this);let f=this.videoTracks.getTrackById("main");f||(f=this.addVideoTrack("main"),f.id="main",f.selected=!0);for(let[b,S]of T.levels.entries()){let te=f.addRendition(S.url[0],S.width,S.height,S.videoCodec??void 0,S.bitrate);m.set(S,`${b}`),te.id=`${b}`}for(let[b,S]of T.audioTracks.entries()){let te=S.default?"main":"alternative",Se=this.addAudioTrack(te,S.name,S.lang);Se.id=`${b}`,S.default&&(Se.enabled=!0)}}),(s=u(this,Gt))==null||s.call(this);let h=()=>{var b,S;let p=[...this.audioTracks].find(te=>te.enabled),T=p?+p.id:void 0,f=((b=this.api)==null?void 0:b.audioTracks.map(te=>te.id))??[];T!==void 0&&T!==((S=this.api)==null?void 0:S.audioTrack)&&f.includes(T)&&this.api&&(this.api.audioTrack=T)};this.audioTracks.addEventListener("change",h),v(this,Gt,()=>{this.audioTracks.removeEventListener("change",h)}),this.api.on(Fe.Events.LEVELS_UPDATED,(p,T)=>{let f=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!f)return;let b=T.levels.map(S=>m.get(S));for(let S of this.videoRenditions)S.id&&!b.includes(S.id)&&f.removeRendition(S)});let g=null;this.api.on(Fe.Events.ERROR,(p,T)=>{var f;T.type===Fe.ErrorTypes.NETWORK_ERROR&&T.details===Fe.ErrorDetails.FRAG_LOAD_ERROR&&(g=((f=T.frag)==null?void 0:f.level)??null)}),this.api.on(Fe.Events.LEVEL_SWITCHED,(p,T)=>{let f=T.level;g!==null&&f<g&&(console.warn(`hls.js downgraded quality from level ${g} to ${f} due to fragment load failure.`),this.videoRenditions.selectedIndex=f,g=null)});let E=()=>{let p=this.videoRenditions.selectedIndex;this.api&&p!==this.api.nextLevel&&(this.api.nextLevel=p)};(l=this.videoRenditions)==null||l.addEventListener("change",E),this.api.once(Fe.Events.DESTROYING,()=>{var p,T;P(this,Xe,hu).call(this),(p=this.videoRenditions)==null||p.removeEventListener("change",E),(T=u(this,Gt))==null||T.call(this),v(this,Gt,null)});return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};Kt=new WeakMap,Gt=new WeakMap,zt=new WeakMap,Po=new WeakMap,Xe=new WeakSet,uu=function(){var t,r,o;(t=u(this,Kt))==null||t.remove(),v(this,Kt,null),(r=u(this,Gt))==null||r.call(this),v(this,Gt,null),(o=this.nativeEl)==null||o.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,vs)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),v(this,Po,!1)},Wm=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},hu=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},vs=new WeakMap,Fm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},pr.shadowRootOptions={...Ue.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",pr);var qm=pr;var cb="nanoplayer.4.min.js",ub="nanoplayer",we={loading:!1,loaded:!1,error:null,callbacks:[]};function hb(i,e){return new Promise((t,r)=>{if(window.NanoPlayer){we.loaded=!0,t();return}if(we.loaded){t();return}if(we.error){r(we.error);return}if(we.callbacks.push(s=>{s?r(s):t()}),we.loading)return;we.loading=!0;let o;e?o=e:o=`${i.endsWith("/")?i:`${i}/`}${ub}/${cb}`;let n=document.createElement("script");n.src=o,n.async=!0,n.onload=()=>{we.loaded=!0,we.loading=!1,we.callbacks.forEach(s=>s()),we.callbacks=[]},n.onerror=()=>{let s=new Error(`Failed to load NanoPlayer script from ${o}`);we.error=s,we.loading=!1,we.callbacks.forEach(l=>l(s)),we.callbacks=[]},document.head.appendChild(n)})}var pb=xo(Ue),at,Li,he,lt,Do,Ce,fs,Ii,wi,mr,vr,dt,fr,Oo,No,Ae,Km,pu,Gm,zm,Ym,Hl,Er=class extends pb{constructor(){super();L(this,Ae);L(this,at,null);L(this,Li,null);L(this,he,null);L(this,lt,null);L(this,Do,"");L(this,Ce,null);L(this,fs,!0);L(this,Ii,[]);L(this,wi,[]);L(this,mr,[]);L(this,vr,null);L(this,dt,null);L(this,fr,!1);L(this,Oo,!1);L(this,No,null);this.api=null;P(this,Ae,Hl).call(this,"config"),P(this,Ae,Hl).call(this,"streamid"),P(this,Ae,Hl).call(this,"sourceConfig"),P(this,Ae,Km).call(this)}static get observedAttributes(){return[...Ue.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:o,"library-location":n,...s}=t;return`
2908
2908
  <script type="application/json" id="config">
2909
2909
  ${JSON.stringify(r.config||{})}
2910
2910
  <\/script>
2911
- ${Ue.getTemplateHTML(a)}
2912
- `}get config(){return u(this,st)}set config(t){v(this,st,t)}get sourceConfig(){return u(this,Li)}set sourceConfig(t){let r=u(this,Li)!==t;v(this,Li,t),r&&t&&this.load()}get streamid(){return this.getAttribute("streamid")}set streamid(t){t?this.setAttribute("streamid",t):this.removeAttribute("streamid")}get libraryLocation(){return this.getAttribute("library-location")||"/vendor/bp-player"}set libraryLocation(t){this.setAttribute("library-location",t)}attributeChangedCallback(t,r,o){t==="streamid"&&r!==o?this.load():t!=="streamid"&&t!=="library-location"&&super.attributeChangedCallback(t,r,o)}async load(){var a,l,d,m,h,g;let t=!u(this,he);P(this,Ae,du).call(this);let r=this.streamid,o=!!u(this,Li);if(!r&&!o)return;if(v(this,vr,new Promise(E=>{v(this,dt,E)})),t&&!u(this,st))try{v(this,st,JSON.parse(((l=(a=this.shadowRoot)==null?void 0:a.getElementById("config"))==null?void 0:l.textContent)||"{}"))}catch(E){console.error("[nano-video] Failed to parse config:",E),v(this,st,{})}try{await sb(this.libraryLocation,(d=u(this,st))==null?void 0:d.scriptUrl)}catch(E){console.error("[nano-video] Failed to load NanoPlayer script:",E),this.dispatchEvent(et(E)),(m=u(this,dt))==null||m.call(this);return}v(this,Do,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),v(this,lt,document.createElement("div")),u(this,lt).id=u(this,Do),u(this,lt).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",getComputedStyle(this).position==="static"&&(this.style.position="relative"),this.nativeEl.style.display="none",this.appendChild(u(this,lt)),v(this,he,new window.NanoPlayer(u(this,Do))),this.api=u(this,he);try{let E=P(this,Ae,Vm).call(this,r,o?u(this,Li):void 0),p=await u(this,he).setup(E);v(this,mr,((h=p.source.entries)==null?void 0:h.map((T,f)=>({index:f,height:T.info.height??0,width:T.info.width??0,bitrate:T.info.bitrate??0,label:T.info.height?`${T.info.height}p`:f===0?"Source":`Stream ${f+1}`})))??[]),P(this,Ae,Fm).call(this)}catch(E){console.error("[nano-video] Failed to setup NanoPlayer:",E),this.dispatchEvent(et(E)),(g=u(this,dt))==null||g.call(this)}}async play(){if(u(this,vr)&&await u(this,vr),u(this,he)){v(this,fr,!0),u(this,he).play();return}return super.play()}pause(){if(u(this,he)){u(this,he).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,we))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,he)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,we))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,we))==null?void 0:t.volume)??super.volume}set volume(t){u(this,we)?u(this,we).volume=t:super.volume=t}get muted(){var t;return((t=u(this,we))==null?void 0:t.muted)??super.muted}set muted(t){u(this,we)&&(u(this,we).muted=t),u(this,he)?t?u(this,he).mute():u(this,he).unmute():super.muted=t}get videoWidth(){var t;return((t=u(this,we))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,we))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t,r;P(this,Ae,du).call(this),(t=u(this,No))==null||t.call(this),v(this,No,null),(r=super.disconnectedCallback)==null||r.call(this)}};st=new WeakMap,Li=new WeakMap,he=new WeakMap,lt=new WeakMap,Do=new WeakMap,we=new WeakMap,ma=new WeakMap,Ci=new WeakMap,Ii=new WeakMap,mr=new WeakMap,vr=new WeakMap,dt=new WeakMap,fr=new WeakMap,Oo=new WeakMap,No=new WeakMap,Ae=new WeakSet,Bm=function(){let t=r=>{var o;r.target!==this&&((o=u(this,lt))!=null&&o.contains(r.target))&&u(this,fr)&&r.stopImmediatePropagation()};this.addEventListener("pause",t,!0),v(this,No,()=>this.removeEventListener("pause",t,!0))},du=function(){var t;(t=u(this,dt))==null||t.call(this),v(this,vr,null),v(this,dt,null),u(this,Ci).forEach(r=>r()),v(this,Ci,[]),u(this,Ii).forEach(r=>r()),v(this,Ii,[]);for(let r of this.videoTracks)this.removeVideoTrack(r);for(let r of this.audioTracks)this.removeAudioTrack(r);u(this,he)&&(u(this,he).destroy(),v(this,he,null),this.api=null),u(this,lt)&&(u(this,lt).remove(),v(this,lt,null)),v(this,we,null),v(this,Oo,!1),v(this,mr,[])},Vm=function(t,r){var n,a;return{source:r??{group:{id:t},options:{adaption:{rule:"deviationOfMean2"},switch:{method:"server",pauseOnError:!1,forcePlay:!0,timeout:10}}},playback:{autoplay:this.nativeEl.autoplay,muted:this.nativeEl.muted,reconnect:((n=u(this,st))==null?void 0:n.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((a=u(this,st))==null?void 0:a.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(q(ud)),this.dispatchEvent(q(rn)),this.dispatchEvent(q(Ca)),(l=u(this,dt))==null||l.call(this)},onPlay:()=>{v(this,fr,!1),v(this,Oo,!0),this.dispatchEvent(q(jo)),this.dispatchEvent(q(Jt))},onPause:()=>{this.dispatchEvent(q(Ni))},onLoading:()=>{this.dispatchEvent(q(Ir))},onStartBuffering:()=>{this.dispatchEvent(q(Ir))},onStopBuffering:()=>{this.dispatchEvent(q(Ca)),this.dispatchEvent(q(Jt))},onError:l=>{var h,g;v(this,fr,!1);let d=l.data.code??-1,m=l.data.message??"NanoPlayer error";if(d===2004&&u(this,Oo)){this.dispatchEvent(q(en)),(h=u(this,dt))==null||h.call(this);return}this.dispatchEvent(et(new Error(m),d)),(g=u(this,dt))==null||g.call(this)},onActiveVideoElementChange:l=>{var m;let d=(m=l.data)==null?void 0:m.activeVideoElement;d&&(v(this,we,d),P(this,Ae,Wm).call(this,d))}}}},Wm=function(t){u(this,Ci).forEach(o=>o()),v(this,Ci,[]);let r=[tn,on,ld,jt];for(let o of r){let n=()=>{this.dispatchEvent(q(o))};t.addEventListener(o,n),u(this,Ci).push(()=>t.removeEventListener(o,n))}},Fm=function(){u(this,Ii).forEach(o=>o()),v(this,Ii,[]);for(let o of this.videoTracks)this.removeVideoTrack(o);for(let o of this.audioTracks)this.removeAudioTrack(o);if(u(this,mr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let o of u(this,mr)){let n=t.addRendition("",o.width,o.height,void 0,o.bitrate);n.id=`${o.index}`}let r=()=>{var n,a,l;let o=this.videoRenditions.selectedIndex;o<0?(v(this,ma,!0),(n=u(this,he))==null||n.setAdaption({rule:"deviationOfMean2"})):(v(this,ma,!1),(a=u(this,he))==null||a.switchStream(o).catch(d=>{console.warn("[nano-video] Quality switch failed:",d)}),(l=u(this,he))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r),u(this,Ii).push(()=>{this.videoRenditions.removeEventListener("change",r)})},Nl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Er.shadowRootOptions={...Ue.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",Er);var Km=Er;import{Room as db,RoomEvent as Je,Track as Gm,VideoQuality as cb}from"livekit-client";var ub=xo(Ue),Ke,ne,ae,xt,Uo,Ho,Pt,gr,wi,le,Ul,qm,zm,Hl,Ym,Qm,$l,br=class extends ub{constructor(){super();L(this,le);L(this,Ke,null);L(this,ne,null);L(this,ae,null);L(this,xt,[]);L(this,Uo,[]);L(this,Ho,[]);L(this,Pt,"disconnected");L(this,gr,null);L(this,wi,null);this.room=null;P(this,le,$l).call(this,"config"),P(this,le,$l).call(this,"url"),P(this,le,$l).call(this,"token")}static get observedAttributes(){return[...Ue.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:o,token:n,...a}=t;return`
2911
+ ${Ue.getTemplateHTML(s)}
2912
+ `}get config(){return u(this,at)}set config(t){v(this,at,t)}get sourceConfig(){return u(this,Li)}set sourceConfig(t){let r=u(this,Li)!==t;v(this,Li,t),r&&t&&this.load()}get streamid(){return this.getAttribute("streamid")}set streamid(t){t?this.setAttribute("streamid",t):this.removeAttribute("streamid")}get libraryLocation(){return this.getAttribute("library-location")||"/vendor/bp-player"}set libraryLocation(t){this.setAttribute("library-location",t)}attributeChangedCallback(t,r,o){t==="streamid"&&r!==o?this.load():t!=="streamid"&&t!=="library-location"&&super.attributeChangedCallback(t,r,o)}async load(){var s,l,d,m,h,g;let t=!u(this,he);P(this,Ae,pu).call(this);let r=this.streamid,o=!!u(this,Li);if(!r&&!o)return;if(v(this,vr,new Promise(E=>{v(this,dt,E)})),t&&!u(this,at))try{v(this,at,JSON.parse(((l=(s=this.shadowRoot)==null?void 0:s.getElementById("config"))==null?void 0:l.textContent)||"{}"))}catch(E){console.error("[nano-video] Failed to parse config:",E),v(this,at,{})}try{await hb(this.libraryLocation,(d=u(this,at))==null?void 0:d.scriptUrl)}catch(E){console.error("[nano-video] Failed to load NanoPlayer script:",E),this.dispatchEvent(et(E)),(m=u(this,dt))==null||m.call(this);return}v(this,Do,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),v(this,lt,document.createElement("div")),u(this,lt).id=u(this,Do),u(this,lt).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",getComputedStyle(this).position==="static"&&(this.style.position="relative"),this.nativeEl.style.display="none",this.appendChild(u(this,lt)),v(this,he,new window.NanoPlayer(u(this,Do))),this.api=u(this,he);try{let E=P(this,Ae,Gm).call(this,r,o?u(this,Li):void 0),p=await u(this,he).setup(E);v(this,mr,((h=p.source.entries)==null?void 0:h.map((T,f)=>({index:f,height:T.info.height??0,width:T.info.width??0,bitrate:T.info.bitrate??0,label:T.info.height?`${T.info.height}p`:f===0?"Source":`Stream ${f+1}`})))??[]),P(this,Ae,Ym).call(this)}catch(E){console.error("[nano-video] Failed to setup NanoPlayer:",E),this.dispatchEvent(et(E)),(g=u(this,dt))==null||g.call(this)}}async play(){if(u(this,vr)&&await u(this,vr),u(this,he)){v(this,fr,!0),u(this,he).play();return}return super.play()}pause(){if(u(this,he)){u(this,he).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,Ce))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,he)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,Ce))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,Ce))==null?void 0:t.volume)??super.volume}set volume(t){u(this,Ce)?u(this,Ce).volume=t:super.volume=t}get muted(){var t;return((t=u(this,Ce))==null?void 0:t.muted)??super.muted}set muted(t){u(this,Ce)&&(u(this,Ce).muted=t),u(this,he)?t?u(this,he).mute():u(this,he).unmute():super.muted=t}get videoWidth(){var t;return((t=u(this,Ce))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,Ce))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t,r;P(this,Ae,pu).call(this),(t=u(this,No))==null||t.call(this),v(this,No,null),(r=super.disconnectedCallback)==null||r.call(this)}};at=new WeakMap,Li=new WeakMap,he=new WeakMap,lt=new WeakMap,Do=new WeakMap,Ce=new WeakMap,fs=new WeakMap,Ii=new WeakMap,wi=new WeakMap,mr=new WeakMap,vr=new WeakMap,dt=new WeakMap,fr=new WeakMap,Oo=new WeakMap,No=new WeakMap,Ae=new WeakSet,Km=function(){let t=r=>{var o;r.target!==this&&((o=u(this,lt))!=null&&o.contains(r.target))&&u(this,fr)&&r.stopImmediatePropagation()};this.addEventListener("pause",t,!0),v(this,No,()=>this.removeEventListener("pause",t,!0))},pu=function(){var t;(t=u(this,dt))==null||t.call(this),v(this,vr,null),v(this,dt,null),u(this,Ii).forEach(r=>r()),v(this,Ii,[]),u(this,wi).forEach(r=>r()),v(this,wi,[]);for(let r of this.videoTracks)this.removeVideoTrack(r);for(let r of this.audioTracks)this.removeAudioTrack(r);u(this,he)&&(u(this,he).destroy(),v(this,he,null),this.api=null),u(this,lt)&&(u(this,lt).remove(),v(this,lt,null)),v(this,Ce,null),v(this,Oo,!1),v(this,mr,[])},Gm=function(t,r){var n,s;return{source:r??{group:{id:t},options:{adaption:{rule:"deviationOfMean2"},switch:{method:"server",pauseOnError:!1,forcePlay:!0,timeout:10}}},playback:{autoplay:this.nativeEl.autoplay,muted:this.nativeEl.muted,reconnect:((n=u(this,at))==null?void 0:n.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((s=u(this,at))==null?void 0:s.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(G(vd)),this.dispatchEvent(G(nn)),this.dispatchEvent(G(Cs)),(l=u(this,dt))==null||l.call(this)},onPlay:()=>{v(this,fr,!1),v(this,Oo,!0),this.dispatchEvent(G(tn)),this.dispatchEvent(G(Jt))},onPause:()=>{this.dispatchEvent(G(Ni))},onLoading:()=>{this.dispatchEvent(G(wr))},onStartBuffering:()=>{this.dispatchEvent(G(wr))},onStopBuffering:()=>{this.dispatchEvent(G(Cs)),this.dispatchEvent(G(Jt))},onError:l=>{var h,g;v(this,fr,!1);let d=l.data.code??-1,m=l.data.message??"NanoPlayer error";if(d===2004&&u(this,Oo)){this.dispatchEvent(G(rn)),(h=u(this,dt))==null||h.call(this);return}this.dispatchEvent(et(new Error(m),d)),(g=u(this,dt))==null||g.call(this)},onActiveVideoElementChange:l=>{var m;let d=(m=l.data)==null?void 0:m.activeVideoElement;d&&(v(this,Ce,d),P(this,Ae,zm).call(this,d))}}}},zm=function(t){u(this,Ii).forEach(o=>o()),v(this,Ii,[]);let r=[on,sn,hd,jt];for(let o of r){let n=()=>{this.dispatchEvent(G(o))};t.addEventListener(o,n),u(this,Ii).push(()=>t.removeEventListener(o,n))}},Ym=function(){u(this,wi).forEach(o=>o()),v(this,wi,[]);for(let o of this.videoTracks)this.removeVideoTrack(o);for(let o of this.audioTracks)this.removeAudioTrack(o);if(u(this,mr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let o of u(this,mr)){let n=t.addRendition("",o.width,o.height,void 0,o.bitrate);n.id=`${o.index}`}let r=()=>{var n,s,l;let o=this.videoRenditions.selectedIndex;o<0?(v(this,fs,!0),(n=u(this,he))==null||n.setAdaption({rule:"deviationOfMean2"})):(v(this,fs,!1),(s=u(this,he))==null||s.switchStream(o).catch(d=>{console.warn("[nano-video] Quality switch failed:",d)}),(l=u(this,he))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r),u(this,wi).push(()=>{this.videoRenditions.removeEventListener("change",r)})},Hl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Er.shadowRootOptions={...Ue.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",Er);var Qm=Er;import{Room as mb,RoomEvent as Je,Track as Zm,VideoQuality as vb}from"livekit-client";var fb=xo(Ue),qe,ne,se,xt,Uo,Ho,Pt,gr,Ci,le,$l,Xm,Jm,Bl,jm,ev,Vl,br=class extends fb{constructor(){super();L(this,le);L(this,qe,null);L(this,ne,null);L(this,se,null);L(this,xt,[]);L(this,Uo,[]);L(this,Ho,[]);L(this,Pt,"disconnected");L(this,gr,null);L(this,Ci,null);this.room=null;P(this,le,Vl).call(this,"config"),P(this,le,Vl).call(this,"url"),P(this,le,Vl).call(this,"token")}static get observedAttributes(){return[...Ue.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:o,token:n,...s}=t;return`
2913
2913
  <script type="application/json" id="config">
2914
2914
  ${JSON.stringify(r.config||{})}
2915
2915
  <\/script>
2916
- ${Ue.getTemplateHTML(a)}
2917
- `}get config(){return u(this,Ke)}set config(t){v(this,Ke,t)}get url(){return this.getAttribute("url")}set url(t){t?this.setAttribute("url",t):this.removeAttribute("url")}get token(){return this.getAttribute("token")}set token(t){t?this.setAttribute("token",t):this.removeAttribute("token")}attributeChangedCallback(t,r,o){(t==="url"||t==="token")&&r!==o?this.url&&this.token?this.load():u(this,ne)&&P(this,le,Ul).call(this):t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,o)}async load(){var p,T,f;let t=!u(this,ne);P(this,le,Ul).call(this);let r=this.url,o=this.token;if(!r||!o)return;if(v(this,gr,new Promise(b=>{v(this,wi,b)})),t&&!u(this,Ke))try{v(this,Ke,JSON.parse(((T=(p=this.shadowRoot)==null?void 0:p.getElementById("config"))==null?void 0:T.textContent)||"{}"))}catch(b){console.error("[livekit-video] Failed to parse config:",b),v(this,Ke,{})}let n=P(this,le,Ym).call(this),a=P(this,le,Qm).call(this);v(this,ne,new db(n)),this.room=u(this,ne);let l=()=>{v(this,Pt,"connected")},d=b=>{v(this,Pt,"disconnected"),b?this.dispatchEvent(et(new Error(`LiveKit disconnected: ${b}`),4001)):this.dispatchEvent(q(en))},m=()=>{v(this,Pt,"reconnecting"),this.dispatchEvent(q(Ir))},h=()=>{v(this,Pt,"connected"),this.dispatchEvent(q(Jt))},g=(b,S)=>{var te,Se;if(b.kind===Gm.Kind.Video){let ke=b.attach();ke.style.width="100%",ke.style.height="100%",ke.style.objectFit="contain",ke.style.position="absolute",ke.style.top="0",ke.style.left="0",this.nativeEl.muted&&(ke.muted=!0),this.nativeEl.style.display="none",(te=this.shadowRoot)==null||te.appendChild(ke),v(this,ae,ke),P(this,le,qm).call(this,ke),P(this,le,zm).call(this,S),this.dispatchEvent(q(cd)),this.dispatchEvent(q(jt)),this.dispatchEvent(q(rn)),this.dispatchEvent(q(Jt)),(Se=u(this,wi))==null||Se.call(this)}},E=b=>{b.kind===Gm.Kind.Video&&(b.detach(),P(this,le,Hl).call(this),u(this,ae)&&(u(this,xt).forEach(S=>S()),v(this,xt,[]),u(this,ae).remove(),v(this,ae,null)))};u(this,ne).on(Je.Connected,l),u(this,ne).on(Je.Disconnected,d),u(this,ne).on(Je.Reconnecting,m),u(this,ne).on(Je.Reconnected,h),u(this,ne).on(Je.TrackSubscribed,g),u(this,ne).on(Je.TrackUnsubscribed,E),v(this,Ho,[()=>{var b;return(b=u(this,ne))==null?void 0:b.off(Je.Connected,l)},()=>{var b;return(b=u(this,ne))==null?void 0:b.off(Je.Disconnected,d)},()=>{var b;return(b=u(this,ne))==null?void 0:b.off(Je.Reconnecting,m)},()=>{var b;return(b=u(this,ne))==null?void 0:b.off(Je.Reconnected,h)},()=>{var b;return(b=u(this,ne))==null?void 0:b.off(Je.TrackSubscribed,g)},()=>{var b;return(b=u(this,ne))==null?void 0:b.off(Je.TrackUnsubscribed,E)}]),v(this,Pt,"connecting"),this.dispatchEvent(q(dd));try{await u(this,ne).connect(r,o,a)}catch(b){v(this,Pt,"failed"),console.error("[livekit-video] Failed to connect:",b);let S=b instanceof Error?b.message:"Failed to connect to LiveKit room";this.dispatchEvent(et(new Error(S),4e3)),(f=u(this,wi))==null||f.call(this)}}async play(){return u(this,gr)&&await u(this,gr),u(this,ae)?u(this,ae).play():super.play()}pause(){if(u(this,ae)){u(this,ae).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,ae))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,ne)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,ae))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,ae))==null?void 0:t.volume)??super.volume}set volume(t){u(this,ae)?u(this,ae).volume=t:super.volume=t}get muted(){var t;return((t=u(this,ae))==null?void 0:t.muted)??super.muted}set muted(t){u(this,ae)?u(this,ae).muted=t:super.muted=t}get videoWidth(){var t;return((t=u(this,ae))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,ae))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;P(this,le,Ul).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Ke=new WeakMap,ne=new WeakMap,ae=new WeakMap,xt=new WeakMap,Uo=new WeakMap,Ho=new WeakMap,Pt=new WeakMap,gr=new WeakMap,wi=new WeakMap,le=new WeakSet,Ul=function(){var t;(t=u(this,wi))==null||t.call(this),v(this,gr,null),v(this,wi,null),u(this,xt).forEach(r=>r()),v(this,xt,[]),P(this,le,Hl).call(this),u(this,Ho).forEach(r=>r()),v(this,Ho,[]),u(this,ne)&&(u(this,ne).disconnect(),v(this,ne,null),this.room=null),u(this,ae)&&(u(this,ae).remove(),v(this,ae,null)),v(this,Pt,"disconnected")},qm=function(t){u(this,xt).forEach(o=>o()),v(this,xt,[]);let r=[tn,on,jo,Jt,Ni,jt];for(let o of r){let n=()=>{this.dispatchEvent(q(o))};t.addEventListener(o,n),u(this,xt).push(()=>t.removeEventListener(o,n))}},zm=function(t){var l;P(this,le,Hl).call(this);let r=(l=t.trackInfo)==null?void 0:l.layers;if(!r||r.length===0)return;let o=this.addVideoTrack("main");o.id="main",o.selected=!0;let n=[...r].sort((d,m)=>d.quality-m.quality);for(let d of n){let m=o.addRendition("",d.width,d.height,void 0,d.bitrate);m.id=`${d.quality}`}let a=()=>{let d=this.videoRenditions.selectedIndex;if(d<0)t.setVideoQuality(cb.HIGH);else{let m=n[d];m&&t.setVideoQuality(m.quality)}};this.videoRenditions.addEventListener("change",a),u(this,Uo).push(()=>this.videoRenditions.removeEventListener("change",a))},Hl=function(){u(this,Uo).forEach(t=>t()),v(this,Uo,[]);for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},Ym=function(){var t,r,o;return{adaptiveStream:((t=u(this,Ke))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=u(this,Ke))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((o=u(this,Ke))==null?void 0:o.disconnectOnPageLeave)??!1}},Qm=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=u(this,Ke))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=u(this,Ke))==null?void 0:r.iceTransportPolicy)??"all"}}},$l=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},br.shadowRootOptions={...Ue.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",br);var Zm=br;export{La as Attribute,oe as BPDefaultUI,pi as BPErrorDisplay,ct as BPLiveError,Xo as BPLiveService,Wt as BPOverlay,Re as BPPlayer,Fe as Hls,pr as HlsVideo,$m as HlsVideoElement,br as LiveKitVideo,Zm as LiveKitVideoElement,bv as NANOPLAYER_NO_REPLAY_CODES,Er as NanoVideo,Km as NanoVideoElement,Tv as StateReceiverMixin,kr as StateReceiverProps,Jo as addGlobalStyles,rd as classifyLiveKitError,id as classifyNanoPlayerError,ya as createInitialState,ad as createPlayerCore,Lv as createTemplate,Lr as forEachStateReceiverElement,Aa as isBPLiveClipSource,od as isBPLiveSource,Ta as isBPLiveStreamSource,sd as isStateReceiverElement,Sa as propagateStateToReceiver,ka as removeStateFromReceiver,Cv as templateWithStyles,be as toggleAttribute};
2916
+ ${Ue.getTemplateHTML(s)}
2917
+ `}get config(){return u(this,qe)}set config(t){v(this,qe,t)}get url(){return this.getAttribute("url")}set url(t){t?this.setAttribute("url",t):this.removeAttribute("url")}get token(){return this.getAttribute("token")}set token(t){t?this.setAttribute("token",t):this.removeAttribute("token")}attributeChangedCallback(t,r,o){(t==="url"||t==="token")&&r!==o?this.url&&this.token?this.load():u(this,ne)&&P(this,le,$l).call(this):t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,o)}async load(){var p,T,f;let t=!u(this,ne);P(this,le,$l).call(this);let r=this.url,o=this.token;if(!r||!o)return;if(v(this,gr,new Promise(b=>{v(this,Ci,b)})),t&&!u(this,qe))try{v(this,qe,JSON.parse(((T=(p=this.shadowRoot)==null?void 0:p.getElementById("config"))==null?void 0:T.textContent)||"{}"))}catch(b){console.error("[livekit-video] Failed to parse config:",b),v(this,qe,{})}let n=P(this,le,jm).call(this),s=P(this,le,ev).call(this);v(this,ne,new mb(n)),this.room=u(this,ne);let l=()=>{v(this,Pt,"connected")},d=b=>{v(this,Pt,"disconnected"),b?this.dispatchEvent(et(new Error(`LiveKit disconnected: ${b}`),4001)):this.dispatchEvent(G(rn))},m=()=>{v(this,Pt,"reconnecting"),this.dispatchEvent(G(wr))},h=()=>{v(this,Pt,"connected"),this.dispatchEvent(G(Jt))},g=(b,S)=>{var te,Se;if(b.kind===Zm.Kind.Video){let ke=b.attach();ke.style.width="100%",ke.style.height="100%",ke.style.objectFit="contain",ke.style.position="absolute",ke.style.top="0",ke.style.left="0",this.nativeEl.muted&&(ke.muted=!0),this.nativeEl.style.display="none",(te=this.shadowRoot)==null||te.appendChild(ke),v(this,se,ke),P(this,le,Xm).call(this,ke),P(this,le,Jm).call(this,S),this.dispatchEvent(G(md)),this.dispatchEvent(G(jt)),this.dispatchEvent(G(nn)),this.dispatchEvent(G(Jt)),(Se=u(this,Ci))==null||Se.call(this)}},E=b=>{b.kind===Zm.Kind.Video&&(b.detach(),P(this,le,Bl).call(this),u(this,se)&&(u(this,xt).forEach(S=>S()),v(this,xt,[]),u(this,se).remove(),v(this,se,null)))};u(this,ne).on(Je.Connected,l),u(this,ne).on(Je.Disconnected,d),u(this,ne).on(Je.Reconnecting,m),u(this,ne).on(Je.Reconnected,h),u(this,ne).on(Je.TrackSubscribed,g),u(this,ne).on(Je.TrackUnsubscribed,E),v(this,Ho,[()=>{var b;return(b=u(this,ne))==null?void 0:b.off(Je.Connected,l)},()=>{var b;return(b=u(this,ne))==null?void 0:b.off(Je.Disconnected,d)},()=>{var b;return(b=u(this,ne))==null?void 0:b.off(Je.Reconnecting,m)},()=>{var b;return(b=u(this,ne))==null?void 0:b.off(Je.Reconnected,h)},()=>{var b;return(b=u(this,ne))==null?void 0:b.off(Je.TrackSubscribed,g)},()=>{var b;return(b=u(this,ne))==null?void 0:b.off(Je.TrackUnsubscribed,E)}]),v(this,Pt,"connecting"),this.dispatchEvent(G(pd));try{await u(this,ne).connect(r,o,s)}catch(b){v(this,Pt,"failed"),console.error("[livekit-video] Failed to connect:",b);let S=b instanceof Error?b.message:"Failed to connect to LiveKit room";this.dispatchEvent(et(new Error(S),4e3)),(f=u(this,Ci))==null||f.call(this)}}async play(){return u(this,gr)&&await u(this,gr),u(this,se)?u(this,se).play():super.play()}pause(){if(u(this,se)){u(this,se).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,se))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,ne)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,se))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,se))==null?void 0:t.volume)??super.volume}set volume(t){u(this,se)?u(this,se).volume=t:super.volume=t}get muted(){var t;return((t=u(this,se))==null?void 0:t.muted)??super.muted}set muted(t){u(this,se)?u(this,se).muted=t:super.muted=t}get videoWidth(){var t;return((t=u(this,se))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,se))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;P(this,le,$l).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};qe=new WeakMap,ne=new WeakMap,se=new WeakMap,xt=new WeakMap,Uo=new WeakMap,Ho=new WeakMap,Pt=new WeakMap,gr=new WeakMap,Ci=new WeakMap,le=new WeakSet,$l=function(){var t;(t=u(this,Ci))==null||t.call(this),v(this,gr,null),v(this,Ci,null),u(this,xt).forEach(r=>r()),v(this,xt,[]),P(this,le,Bl).call(this),u(this,Ho).forEach(r=>r()),v(this,Ho,[]),u(this,ne)&&(u(this,ne).disconnect(),v(this,ne,null),this.room=null),u(this,se)&&(u(this,se).remove(),v(this,se,null)),v(this,Pt,"disconnected")},Xm=function(t){u(this,xt).forEach(o=>o()),v(this,xt,[]);let r=[on,sn,tn,Jt,Ni,jt];for(let o of r){let n=()=>{this.dispatchEvent(G(o))};t.addEventListener(o,n),u(this,xt).push(()=>t.removeEventListener(o,n))}},Jm=function(t){var l;P(this,le,Bl).call(this);let r=(l=t.trackInfo)==null?void 0:l.layers;if(!r||r.length===0)return;let o=this.addVideoTrack("main");o.id="main",o.selected=!0;let n=[...r].sort((d,m)=>d.quality-m.quality);for(let d of n){let m=o.addRendition("",d.width,d.height,void 0,d.bitrate);m.id=`${d.quality}`}let s=()=>{let d=this.videoRenditions.selectedIndex;if(d<0)t.setVideoQuality(vb.HIGH);else{let m=n[d];m&&t.setVideoQuality(m.quality)}};this.videoRenditions.addEventListener("change",s),u(this,Uo).push(()=>this.videoRenditions.removeEventListener("change",s))},Bl=function(){u(this,Uo).forEach(t=>t()),v(this,Uo,[]);for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},jm=function(){var t,r,o;return{adaptiveStream:((t=u(this,qe))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=u(this,qe))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((o=u(this,qe))==null?void 0:o.disconnectOnPageLeave)??!1}},ev=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=u(this,qe))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=u(this,qe))==null?void 0:r.iceTransportPolicy)??"all"}}},Vl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},br.shadowRootOptions={...Ue.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",br);var tv=br;export{ws as Attribute,oe as BPDefaultUI,pi as BPErrorDisplay,ct as BPLiveError,Xo as BPLiveService,Wt as BPOverlay,Me as BPPlayer,Fe as Hls,pr as HlsVideo,qm as HlsVideoElement,br as LiveKitVideo,tv as LiveKitVideoElement,Sv as NANOPLAYER_NO_REPLAY_CODES,Er as NanoVideo,Qm as NanoVideoElement,Iv as StateReceiverMixin,kr as StateReceiverProps,en as addGlobalStyles,nd as classifyLiveKitError,od as classifyNanoPlayerError,As as createInitialState,cd as createPlayerCore,Mv as createTemplate,Lr as forEachStateReceiverElement,ks as isBPLiveClipSource,sd as isBPLiveSource,Ss as isBPLiveStreamSource,ud as isStateReceiverElement,Ls as propagateStateToReceiver,Is as removeStateFromReceiver,xv as templateWithStyles,be as toggleAttribute};
2918
2918
  /*! Bundled license information:
2919
2919
 
2920
2920
  @lit/reactive-element/css-tag.js: