@broadcastingplatforms/player 0.0.0-dev.c57124a → 0.0.0-dev.e67afbe

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +63 -0
  2. package/dist/bp-player.js +201 -188
  3. package/dist/bp-player.mjs +201 -188
  4. package/dist/bp-player.standalone.mjs +255 -242
  5. package/dist/components/bp-default-ui.d.ts +2 -4
  6. package/dist/components/bp-player.d.ts +2 -1
  7. package/dist/core/player-core.d.ts +3 -2
  8. package/dist/elements/hls-video.d.ts +1 -0
  9. package/dist/elements/nano-video.d.ts +2 -0
  10. package/dist/events/AddRenditionEvent.d.ts +6 -0
  11. package/dist/events/CanPlayEvent.d.ts +5 -0
  12. package/dist/events/CanPlayThroughEvent.d.ts +5 -0
  13. package/dist/events/ChangeEvent.d.ts +5 -0
  14. package/dist/events/DurationChangeEvent.d.ts +5 -0
  15. package/dist/events/EmptiedEvent.d.ts +5 -0
  16. package/dist/events/EndedEvent.d.ts +5 -0
  17. package/dist/events/ErrorEvent.d.ts +9 -0
  18. package/dist/events/EventUtils.d.ts +22 -0
  19. package/dist/events/LoadStartEvent.d.ts +5 -0
  20. package/dist/events/LoadedDataEvent.d.ts +5 -0
  21. package/dist/events/LoadedMetadataEvent.d.ts +5 -0
  22. package/dist/events/PauseEvent.d.ts +5 -0
  23. package/dist/events/PlayEvent.d.ts +5 -0
  24. package/dist/events/PlayingEvent.d.ts +5 -0
  25. package/dist/events/ProgressEvent.d.ts +5 -0
  26. package/dist/events/RateChangeEvent.d.ts +5 -0
  27. package/dist/events/ReadyEvent.d.ts +6 -0
  28. package/dist/events/ResizeEvent.d.ts +5 -0
  29. package/dist/events/SeekedEvent.d.ts +5 -0
  30. package/dist/events/SeekingEvent.d.ts +5 -0
  31. package/dist/events/TimeUpdateEvent.d.ts +5 -0
  32. package/dist/events/VolumeChangeEvent.d.ts +5 -0
  33. package/dist/events/WaitingEvent.d.ts +5 -0
  34. package/dist/events/index.d.ts +49 -0
  35. package/dist/providers/contract.d.ts +2 -0
  36. package/dist/util/converters.d.ts +14 -0
  37. package/dist/util/index.d.ts +1 -0
  38. package/package.json +2 -19
package/dist/bp-player.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * BP Player (v0.0.0-dev.c57124a)
2
+ * BP Player (v0.0.0-dev.e67afbe)
3
3
  * Universal video player web component
4
4
  */
5
- "use strict";var BPPlayer=(()=>{var $m=Object.create;var pr=Object.defineProperty;var su=Object.getOwnPropertyDescriptor;var Bm=Object.getOwnPropertyNames;var Vm=Object.getPrototypeOf,Wm=Object.prototype.hasOwnProperty;var lu=i=>{throw TypeError(i)};var Fm=(i,e,t)=>e in i?pr(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var du=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var Km=(i,e)=>{for(var t in e)pr(i,t,{get:e[t],enumerable:!0})},cu=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Bm(e))!Wm.call(i,o)&&o!==t&&pr(i,o,{get:()=>e[o],enumerable:!(r=su(e,o))||r.enumerable});return i};var qm=(i,e,t)=>(t=i!=null?$m(Vm(i)):{},cu(e||!i||!i.__esModule?pr(t,"default",{value:i,enumerable:!0}):t,i)),Gm=i=>cu(pr({},"__esModule",{value:!0}),i),N=(i,e,t,r)=>{for(var o=r>1?void 0:r?su(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&&pr(e,t,o),o};var $=(i,e,t)=>Fm(i,typeof e!="symbol"?e+"":e,t),wl=(i,e,t)=>e.has(i)||lu("Cannot "+t);var u=(i,e,t)=>(wl(i,e,"read from private field"),t?t.call(i):e.get(i)),S=(i,e,t)=>e.has(i)?lu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),_=(i,e,t,r)=>(wl(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),O=(i,e,t)=>(wl(i,e,"access private method"),t);var zE={};Km(zE,{Attribute:()=>Yo,BPDefaultUI:()=>ee,BPErrorDisplay:()=>Ht,BPLiveError:()=>nt,BPLiveService:()=>fr,BPOverlay:()=>wt,BPPlayer:()=>Te,Hls:()=>Se.default,HlsVideo:()=>_i,HlsVideoElement:()=>Uc,LiveKitVideo:()=>Si,LiveKitVideoElement:()=>Bc,NANOPLAYER_NO_REPLAY_CODES:()=>Cu,NanoVideo:()=>Ai,NanoVideoElement:()=>Hc,PlayerCoreImpl:()=>qo,StateReceiverMixin:()=>Mu,StateReceiverProps:()=>Ri,addGlobalStyles:()=>gr,classifyLiveKitError:()=>ha,classifyNanoPlayerError:()=>ua,createInitialState:()=>Fo,createPlayerCore:()=>pa,createTemplate:()=>Du,forEachStateReceiverElement:()=>xi,isBPLiveClipSource:()=>Mi,isBPLiveSource:()=>Iu,isBPLiveStreamSource:()=>Ko,isStateReceiverElement:()=>ma,propagateStateToReceiver:()=>Go,removeStateFromReceiver:()=>zo,templateWithStyles:()=>Ou,toggleAttribute:()=>pe});var aa=globalThis,sa=aa.ShadowRoot&&(aa.ShadyCSS===void 0||aa.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Cl=Symbol(),uu=new WeakMap,Po=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Cl)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(sa&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=uu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&uu.set(t,e))}return e}toString(){return this.cssText}},hu=i=>new Po(typeof i=="string"?i:i+"",void 0,Cl),Do=(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 Po(t,i,Cl)},pu=(i,e)=>{if(sa)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),o=aa.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=t.cssText,i.appendChild(r)}},Il=sa?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return hu(t)})(i):i;var{is:zm,defineProperty:Ym,getOwnPropertyDescriptor:Qm,getOwnPropertyNames:Zm,getOwnPropertySymbols:Xm,getPrototypeOf:Jm}=Object,Kt=globalThis,mu=Kt.trustedTypes,jm=mu?mu.emptyScript:"",Ml=Kt.reactiveElementPolyfillSupport,Oo=(i,e)=>i,Uo={toAttribute(i,e){switch(e){case Boolean:i=i?jm: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}},la=(i,e)=>!zm(i,e),vu={attribute:!0,type:String,converter:Uo,reflect:!1,useDefault:!1,hasChanged:la};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Kt.litPropertyMetadata??(Kt.litPropertyMetadata=new WeakMap);var Rt=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=vu){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&&Ym(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){let{get:o,set:n}=Qm(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)??vu}static _$Ei(){if(this.hasOwnProperty(Oo("elementProperties")))return;let e=Jm(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Oo("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Oo("properties"))){let t=this.properties,r=[...Zm(t),...Xm(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(Il(o))}else e!==void 0&&t.push(Il(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 pu(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:Uo).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),c=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:Uo;this._$Em=o;let v=c.fromAttribute(t,l.type);this[o]=v??((a=this._$Ej)==null?void 0:a.get(o))??v,this._$Em=null}}requestUpdate(e,t,r){var o;if(e!==void 0){let n=this.constructor,a=this[e];if(r??(r=n.getPropertyOptions(e)),!((r.hasChanged??la)(a,t)||r.useDefault&&r.reflect&&a===((o=this._$Ej)==null?void 0:o.get(e))&&!this.hasAttribute(n._$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,c=this[n];l!==!0||this._$AL.has(n)||c===void 0||this.C(n,void 0,a,c)}}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){}};Rt.elementStyles=[],Rt.shadowRootOptions={mode:"open"},Rt[Oo("elementProperties")]=new Map,Rt[Oo("finalized")]=new Map,Ml==null||Ml({ReactiveElement:Rt}),(Kt.reactiveElementVersions??(Kt.reactiveElementVersions=[])).push("2.1.1");var Ho=globalThis,da=Ho.trustedTypes,fu=da?da.createPolicy("lit-html",{createHTML:i=>i}):void 0,Tu="$lit$",qt=`lit$${Math.random().toFixed(9).slice(2)}$`,Au="?"+qt,ev=`<${Au}>`,wi=document,$o=()=>wi.createComment(""),Bo=i=>i===null||typeof i!="object"&&typeof i!="function",Hl=Array.isArray,tv=i=>Hl(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Rl=`[
6
- \f\r]`,No=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gu=/-->/g,Eu=/>/g,ki=RegExp(`>|${Rl}(?:([^\\s"'>=/]+)(${Rl}*=${Rl}*(?:[^
7
- \f\r"'\`<>=]|("|')|))|$)`,"g"),bu=/'/g,_u=/"/g,Su=/^(?:script|style|textarea|title)$/i,$l=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),We=$l(1),eb=$l(2),tb=$l(3),Ci=Symbol.for("lit-noChange"),fe=Symbol.for("lit-nothing"),yu=new WeakMap,Li=wi.createTreeWalker(wi,129);function ku(i,e){if(!Hl(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return fu!==void 0?fu.createHTML(e):e}var iv=(i,e)=>{let t=i.length-1,r=[],o,n=e===2?"<svg>":e===3?"<math>":"",a=No;for(let l=0;l<t;l++){let c=i[l],v,h,p=-1,f=0;for(;f<c.length&&(a.lastIndex=f,h=a.exec(c),h!==null);)f=a.lastIndex,a===No?h[1]==="!--"?a=gu:h[1]!==void 0?a=Eu:h[2]!==void 0?(Su.test(h[2])&&(o=RegExp("</"+h[2],"g")),a=ki):h[3]!==void 0&&(a=ki):a===ki?h[0]===">"?(a=o??No,p=-1):h[1]===void 0?p=-2:(p=a.lastIndex-h[2].length,v=h[1],a=h[3]===void 0?ki:h[3]==='"'?_u:bu):a===_u||a===bu?a=ki:a===gu||a===Eu?a=No:(a=ki,o=void 0);let m=a===ki&&i[l+1].startsWith("/>")?" ":"";n+=a===No?c+ev:p>=0?(r.push(v),c.slice(0,p)+Tu+c.slice(p)+qt+m):c+qt+(p===-2?l:m)}return[ku(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},Vo=class i{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let n=0,a=0,l=e.length-1,c=this.parts,[v,h]=iv(e,t);if(this.el=i.createElement(v,r),Li.currentNode=this.el.content,t===2||t===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=Li.nextNode())!==null&&c.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let p of o.getAttributeNames())if(p.endsWith(Tu)){let f=h[a++],m=o.getAttribute(p).split(qt),A=/([.?@])?(.*)/.exec(f);c.push({type:1,index:n,name:A[2],strings:m,ctor:A[1]==="."?Dl:A[1]==="?"?Ol:A[1]==="@"?Ul:vr}),o.removeAttribute(p)}else p.startsWith(qt)&&(c.push({type:6,index:n}),o.removeAttribute(p));if(Su.test(o.tagName)){let p=o.textContent.split(qt),f=p.length-1;if(f>0){o.textContent=da?da.emptyScript:"";for(let m=0;m<f;m++)o.append(p[m],$o()),Li.nextNode(),c.push({type:2,index:++n});o.append(p[f],$o())}}}else if(o.nodeType===8)if(o.data===Au)c.push({type:2,index:n});else{let p=-1;for(;(p=o.data.indexOf(qt,p+1))!==-1;)c.push({type:7,index:n}),p+=qt.length-1}n++}}static createElement(e,t){let r=wi.createElement("template");return r.innerHTML=e,r}};function mr(i,e,t=i,r){var a,l;if(e===Ci)return e;let o=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl,n=Bo(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=mr(i,o._$AS(i,e.values),o,r)),e}var Pl=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)??wi).importNode(t,!0);Li.currentNode=o;let n=Li.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let v;c.type===2?v=new Wo(n,n.nextSibling,this,e):c.type===1?v=new c.ctor(n,c.name,c.strings,this,e):c.type===6&&(v=new Nl(n,this,e)),this._$AV.push(v),c=r[++l]}a!==(c==null?void 0:c.index)&&(n=Li.nextNode(),a++)}return Li.currentNode=wi,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++}},Wo=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=fe,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=mr(this,e,t),Bo(e)?e===fe||e==null||e===""?(this._$AH!==fe&&this._$AR(),this._$AH=fe):e!==this._$AH&&e!==Ci&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):tv(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!==fe&&Bo(this._$AH)?this._$AA.nextSibling.data=e:this.T(wi.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=Vo.createElement(ku(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 Pl(o,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=yu.get(e.strings);return t===void 0&&yu.set(e.strings,t=new Vo(e)),t}k(e){Hl(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($o()),this.O($o()),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=e.nextSibling;e.remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},vr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,o,n){this.type=1,this._$AH=fe,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=fe}_$AI(e,t=this,r,o){let n=this.strings,a=!1;if(n===void 0)e=mr(this,e,t,0),a=!Bo(e)||e!==this._$AH&&e!==Ci,a&&(this._$AH=e);else{let l=e,c,v;for(e=n[0],c=0;c<n.length-1;c++)v=mr(this,l[r+c],t,c),v===Ci&&(v=this._$AH[c]),a||(a=!Bo(v)||v!==this._$AH[c]),v===fe?e=fe:e!==fe&&(e+=(v??"")+n[c+1]),this._$AH[c]=v}a&&!o&&this.j(e)}j(e){e===fe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Dl=class extends vr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===fe?void 0:e}},Ol=class extends vr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==fe)}},Ul=class extends vr{constructor(e,t,r,o,n){super(e,t,r,o,n),this.type=5}_$AI(e,t=this){if((e=mr(this,e,t,0)??fe)===Ci)return;let r=this._$AH,o=e===fe&&r!==fe||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==fe&&(r===fe||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)}},Nl=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){mr(this,e)}};var xl=Ho.litHtmlPolyfillSupport;xl==null||xl(Vo,Wo),(Ho.litHtmlVersions??(Ho.litHtmlVersions=[])).push("3.3.1");var Lu=(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 Wo(e.insertBefore($o(),n),n,void 0,t??{})}return o._$AI(i),o};var Ii=globalThis,Ce=class extends Rt{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=Lu(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 Ci}},wu;Ce._$litElement$=!0,Ce.finalized=!0,(wu=Ii.litElementHydrateSupport)==null||wu.call(Ii,{LitElement:Ce});var Bl=Ii.litElementPolyfillSupport;Bl==null||Bl({LitElement:Ce});(Ii.litElementVersions??(Ii.litElementVersions=[])).push("4.2.1");var Gt=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var rv={attribute:!0,type:String,converter:Uo,reflect:!1,hasChanged:la},ov=(i=rv,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 c=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,c,i)},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 c=this[a];e.call(this,l),this.requestUpdate(a,c,i)}}throw Error("Unsupported decorator location: "+r)};function W(i){return(e,t)=>typeof t=="object"?ov(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 zt(i){return W({...i,state:!0,attribute:!1})}var Cu=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function ua(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 ha(i){return i===4e3||i===4001?"network":"unknown"}function Fo(){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 Ko(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function Mi(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function Iu(i){return Ko(i)||Mi(i)}var nt=class extends Error{constructor(t,r,o){super(t);this.code=r;this.status=o;this.name="BPLiveError"}},fr=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 nt("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`}});if(!r.ok)throw new nt(`HTTP ${r.status}: ${r.statusText}`,"HTTP_ERROR",r.status);return r.json()}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 nt(`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,Ko(e))return this.resolveStreamSource(e);if(Mi(e))return this.resolveClipSource(e);throw new nt("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 a,l,c,v,h;let r=(await this.getStream(e.streamId)).data;this._stream=r;let o=r.player_source??((a=r.active_stream)==null?void 0:a.player_source),n=this.extractStreamPoster(r);if(o)return{source:this.mapPlayerSourceToResolvedSource(o),contentType:"stream",poster:n};if(((c=(l=r.media)==null?void 0:l.vod)==null?void 0:c.length)>0){let p=r.media.vod[0];return{source:{type:"video",url:p.original},contentType:"video",poster:n??p.thumb??void 0,videoWidth:(v=p.dimension)==null?void 0:v.width,videoHeight:(h=p.dimension)==null?void 0:h.height}}throw new nt("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 nt("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 nv(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 av(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var sv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],qo=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._state=Fo()}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=t??this._container,n=r??this._config;if(!o){console.error("[PlayerCore] No container provided. Call attach() first or provide container to loadSource().");return}this._container=o,n&&(this._config=n),this.updateState({error:null,connectionState:"connecting",paused:!0,ended:!1,playing:!1,waiting:!1,seeking:!1,readyState:0,currentTime:0,duration:NaN,buffered:null}),this.dispatch("sourcechange",{source:e});try{let a=e,l=this._state.contentType,c,v,h;if(av(e)){if(n!=null&&n.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new fr(n.bpLive)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let L=await this._bpLive.resolveSource(e);a=L.source,l=L.contentType,c=L.poster,v=L.videoWidth,h=L.videoHeight}let p=nv(a);(this._currentProviderType!==null&&this._currentProviderType!==p||this._mediaElement)&&this.destroyMediaElement();let g=p==="nano"||p==="livekit"||l==="stream"?"live":"vod";return this._currentProviderType=p,this.updateState({providerType:p,contentType:l,streamType:g}),this._mediaElement=this.createMediaElement(p,a,n),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),o.appendChild(this._mediaElement),this._ready=!0,this.dispatch("videoelementchange",{video:this._mediaElement}),{poster:c,videoWidth:v,videoHeight:h}}catch(a){console.error("[PlayerCore] loadSource error:",a);let l={code:-1,message:a instanceof Error?a.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:l,connectionState:"failed"}),this.dispatch("error",l)}}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 sv){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=ua(o),l=a!=="offline"&&a!=="autoplay"):this._state.providerType==="livekit"&&o>0&&(a=ha(o),l=!0);let c={code:o,message:n,fatal:l,category:a};this.updateState({error:c}),this.dispatch("error",c);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({...Fo(),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}),this.dispatch("play",void 0);try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),this.dispatch("pause",void 0),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this.dispatch("pause",void 0),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)}setFullscreen(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"})}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 pa(){return new qo}var Ri="bpPlayerObservedProperties";function ma(i){return Ri in i&&Array.isArray(i[Ri])}function Mu(i,e){class t extends i{get[Ri](){return e}}return t}function lv(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 xi(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!ma(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),ma(i)&&t(i);let r=lv(i);r.length>0&&await Promise.all(r.map(o=>xi(o,e,t)))}function Go(i,e,t){let r=i[Ri];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 zo(i){i[Ri].includes("player")&&(i.player=void 0)}var Ru=`/**
5
+ "use strict";var BPPlayer=(()=>{var lv=Object.create;var kr=Object.defineProperty;var Du=Object.getOwnPropertyDescriptor;var dv=Object.getOwnPropertyNames;var cv=Object.getPrototypeOf,uv=Object.prototype.hasOwnProperty;var Ou=i=>{throw TypeError(i)};var hv=(i,e,t)=>e in i?kr(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Nu=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var pv=(i,e)=>{for(var t in e)kr(i,t,{get:e[t],enumerable:!0})},Uu=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of dv(e))!uv.call(i,o)&&o!==t&&kr(i,o,{get:()=>e[o],enumerable:!(r=Du(e,o))||r.enumerable});return i};var mv=(i,e,t)=>(t=i!=null?lv(cv(i)):{},Uu(e||!i||!i.__esModule?kr(t,"default",{value:i,enumerable:!0}):t,i)),vv=i=>Uu(kr({},"__esModule",{value:!0}),i),U=(i,e,t,r)=>{for(var o=r>1?void 0:r?Du(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&&kr(e,t,o),o};var $=(i,e,t)=>hv(i,typeof e!="symbol"?e+"":e,t),zl=(i,e,t)=>e.has(i)||Ou("Cannot "+t);var u=(i,e,t)=>(zl(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),f=(i,e,t,r)=>(zl(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),P=(i,e,t)=>(zl(i,e,"access private method"),t);var fb={};pv(fb,{Attribute:()=>an,BPDefaultUI:()=>te,BPErrorDisplay:()=>Wt,BPLiveError:()=>lt,BPLiveService:()=>Ir,BPOverlay:()=>Mt,BPPlayer:()=>Ie,Hls:()=>Me.default,HlsVideo:()=>Ci,HlsVideoElement:()=>cu,LiveKitVideo:()=>Ri,LiveKitVideoElement:()=>pu,NANOPLAYER_NO_REPLAY_CODES:()=>th,NanoVideo:()=>wi,NanoVideoElement:()=>hu,PlayerCoreImpl:()=>rn,StateReceiverMixin:()=>rh,StateReceiverProps:()=>Hi,addGlobalStyles:()=>wr,classifyLiveKitError:()=>wa,classifyNanoPlayerError:()=>Ia,createInitialState:()=>en,createPlayerCore:()=>Ma,createTemplate:()=>sh,forEachStateReceiverElement:()=>$i,isBPLiveClipSource:()=>Ui,isBPLiveSource:()=>ih,isBPLiveStreamSource:()=>tn,isStateReceiverElement:()=>Ra,propagateStateToReceiver:()=>on,removeStateFromReceiver:()=>nn,templateWithStyles:()=>lh,toggleAttribute:()=>Ee});var Aa=globalThis,Sa=Aa.ShadowRoot&&(Aa.ShadyCSS===void 0||Aa.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Yl=Symbol(),Hu=new WeakMap,Ko=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Yl)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(Sa&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=Hu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Hu.set(t,e))}return e}toString(){return this.cssText}},$u=i=>new Ko(typeof i=="string"?i:i+"",void 0,Yl),Go=(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 Ko(t,i,Yl)},Bu=(i,e)=>{if(Sa)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),o=Aa.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=t.cssText,i.appendChild(r)}},Ql=Sa?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return $u(t)})(i):i;var{is:fv,defineProperty:Ev,getOwnPropertyDescriptor:gv,getOwnPropertyNames:bv,getOwnPropertySymbols:_v,getPrototypeOf:yv}=Object,Yt=globalThis,Vu=Yt.trustedTypes,Tv=Vu?Vu.emptyScript:"",Zl=Yt.reactiveElementPolyfillSupport,qo=(i,e)=>i,zo={toAttribute(i,e){switch(e){case Boolean:i=i?Tv: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}},ka=(i,e)=>!fv(i,e),Wu={attribute:!0,type:String,converter:zo,reflect:!1,useDefault:!1,hasChanged:ka};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=Wu){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&&Ev(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){let{get:o,set:n}=gv(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)??Wu}static _$Ei(){if(this.hasOwnProperty(qo("elementProperties")))return;let e=yv(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(qo("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(qo("properties"))){let t=this.properties,r=[...bv(t),..._v(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(Ql(o))}else e!==void 0&&t.push(Ql(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 Bu(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:zo).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:zo;this._$Em=o;let v=d.fromAttribute(t,l.type);this[o]=v??((a=this._$Ej)==null?void 0:a.get(o))??v,this._$Em=null}}requestUpdate(e,t,r){var o;if(e!==void 0){let n=this.constructor,a=this[e];if(r??(r=n.getPropertyOptions(e)),!((r.hasChanged??ka)(a,t)||r.useDefault&&r.reflect&&a===((o=this._$Ej)==null?void 0:o.get(e))&&!this.hasAttribute(n._$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[qo("elementProperties")]=new Map,Ot[qo("finalized")]=new Map,Zl==null||Zl({ReactiveElement:Ot}),(Yt.reactiveElementVersions??(Yt.reactiveElementVersions=[])).push("2.1.1");var Qo=globalThis,La=Qo.trustedTypes,Fu=La?La.createPolicy("lit-html",{createHTML:i=>i}):void 0,Qu="$lit$",Qt=`lit$${Math.random().toFixed(9).slice(2)}$`,Zu="?"+Qt,Av=`<${Zu}>`,Di=document,Zo=()=>Di.createComment(""),Xo=i=>i===null||typeof i!="object"&&typeof i!="function",od=Array.isArray,Sv=i=>od(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Xl=`[
6
+ \f\r]`,Yo=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ku=/-->/g,Gu=/>/g,xi=RegExp(`>|${Xl}(?:([^\\s"'>=/]+)(${Xl}*=${Xl}*(?:[^
7
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),qu=/'/g,zu=/"/g,Xu=/^(?:script|style|textarea|title)$/i,nd=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Ge=nd(1),Ab=nd(2),Sb=nd(3),Oi=Symbol.for("lit-noChange"),_e=Symbol.for("lit-nothing"),Yu=new WeakMap,Pi=Di.createTreeWalker(Di,129);function Ju(i,e){if(!od(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Fu!==void 0?Fu.createHTML(e):e}var kv=(i,e)=>{let t=i.length-1,r=[],o,n=e===2?"<svg>":e===3?"<math>":"",a=Yo;for(let l=0;l<t;l++){let d=i[l],v,h,m=-1,T=0;for(;T<d.length&&(a.lastIndex=T,h=a.exec(d),h!==null);)T=a.lastIndex,a===Yo?h[1]==="!--"?a=Ku:h[1]!==void 0?a=Gu:h[2]!==void 0?(Xu.test(h[2])&&(o=RegExp("</"+h[2],"g")),a=xi):h[3]!==void 0&&(a=xi):a===xi?h[0]===">"?(a=o??Yo,m=-1):h[1]===void 0?m=-2:(m=a.lastIndex-h[2].length,v=h[1],a=h[3]===void 0?xi:h[3]==='"'?zu:qu):a===zu||a===qu?a=xi:a===Ku||a===Gu?a=Yo:(a=xi,o=void 0);let p=a===xi&&i[l+1].startsWith("/>")?" ":"";n+=a===Yo?d+Av:m>=0?(r.push(v),d.slice(0,m)+Qu+d.slice(m)+Qt+p):d+Qt+(m===-2?l:p)}return[Ju(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},Jo=class i{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let n=0,a=0,l=e.length-1,d=this.parts,[v,h]=kv(e,t);if(this.el=i.createElement(v,r),Pi.currentNode=this.el.content,t===2||t===3){let m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(o=Pi.nextNode())!==null&&d.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let m of o.getAttributeNames())if(m.endsWith(Qu)){let T=h[a++],p=o.getAttribute(m).split(Qt),A=/([.?@])?(.*)/.exec(T);d.push({type:1,index:n,name:A[2],strings:p,ctor:A[1]==="."?ed:A[1]==="?"?td:A[1]==="@"?id:Cr}),o.removeAttribute(m)}else m.startsWith(Qt)&&(d.push({type:6,index:n}),o.removeAttribute(m));if(Xu.test(o.tagName)){let m=o.textContent.split(Qt),T=m.length-1;if(T>0){o.textContent=La?La.emptyScript:"";for(let p=0;p<T;p++)o.append(m[p],Zo()),Pi.nextNode(),d.push({type:2,index:++n});o.append(m[T],Zo())}}}else if(o.nodeType===8)if(o.data===Zu)d.push({type:2,index:n});else{let m=-1;for(;(m=o.data.indexOf(Qt,m+1))!==-1;)d.push({type:7,index:n}),m+=Qt.length-1}n++}}static createElement(e,t){let r=Di.createElement("template");return r.innerHTML=e,r}};function Lr(i,e,t=i,r){var a,l;if(e===Oi)return e;let o=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl,n=Xo(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=Lr(i,o._$AS(i,e.values),o,r)),e}var jl=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)??Di).importNode(t,!0);Pi.currentNode=o;let n=Pi.nextNode(),a=0,l=0,d=r[0];for(;d!==void 0;){if(a===d.index){let v;d.type===2?v=new jo(n,n.nextSibling,this,e):d.type===1?v=new d.ctor(n,d.name,d.strings,this,e):d.type===6&&(v=new rd(n,this,e)),this._$AV.push(v),d=r[++l]}a!==(d==null?void 0:d.index)&&(n=Pi.nextNode(),a++)}return Pi.currentNode=Di,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++}},jo=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=_e,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=Lr(this,e,t),Xo(e)?e===_e||e==null||e===""?(this._$AH!==_e&&this._$AR(),this._$AH=_e):e!==this._$AH&&e!==Oi&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Sv(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!==_e&&Xo(this._$AH)?this._$AA.nextSibling.data=e:this.T(Di.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=Jo.createElement(Ju(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 jl(o,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=Yu.get(e.strings);return t===void 0&&Yu.set(e.strings,t=new Jo(e)),t}k(e){od(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=e.nextSibling;e.remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Cr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,o,n){this.type=1,this._$AH=_e,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=_e}_$AI(e,t=this,r,o){let n=this.strings,a=!1;if(n===void 0)e=Lr(this,e,t,0),a=!Xo(e)||e!==this._$AH&&e!==Oi,a&&(this._$AH=e);else{let l=e,d,v;for(e=n[0],d=0;d<n.length-1;d++)v=Lr(this,l[r+d],t,d),v===Oi&&(v=this._$AH[d]),a||(a=!Xo(v)||v!==this._$AH[d]),v===_e?e=_e:e!==_e&&(e+=(v??"")+n[d+1]),this._$AH[d]=v}a&&!o&&this.j(e)}j(e){e===_e?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ed=class extends Cr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===_e?void 0:e}},td=class extends Cr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==_e)}},id=class extends Cr{constructor(e,t,r,o,n){super(e,t,r,o,n),this.type=5}_$AI(e,t=this){if((e=Lr(this,e,t,0)??_e)===Oi)return;let r=this._$AH,o=e===_e&&r!==_e||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==_e&&(r===_e||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)}},rd=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){Lr(this,e)}};var Jl=Qo.litHtmlPolyfillSupport;Jl==null||Jl(Jo,jo),(Qo.litHtmlVersions??(Qo.litHtmlVersions=[])).push("3.3.1");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 jo(e.insertBefore(Zo(),n),n,void 0,t??{})}return o._$AI(i),o};var Ni=globalThis,Pe=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 Oi}},eh;Pe._$litElement$=!0,Pe.finalized=!0,(eh=Ni.litElementHydrateSupport)==null||eh.call(Ni,{LitElement:Pe});var ad=Ni.litElementPolyfillSupport;ad==null||ad({LitElement:Pe});(Ni.litElementVersions??(Ni.litElementVersions=[])).push("4.2.1");var Zt=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Lv={attribute:!0,type:String,converter:zo,reflect:!1,hasChanged:ka},Cv=(i=Lv,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)},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)}}throw Error("Unsupported decorator location: "+r)};function W(i){return(e,t)=>typeof t=="object"?Cv(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 th=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function Ia(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 wa(i){return i===4e3||i===4001?"network":"unknown"}function en(){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 tn(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function Ui(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function ih(i){return tn(i)||Ui(i)}var lt=class extends Error{constructor(t,r,o){super(t);this.code=r;this.status=o;this.name="BPLiveError"}},Ir=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 lt("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`}});if(!r.ok)throw new lt(`HTTP ${r.status}: ${r.statusText}`,"HTTP_ERROR",r.status);return r.json()}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 lt(`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,tn(e))return this.resolveStreamSource(e);if(Ui(e))return this.resolveClipSource(e);throw new lt("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 a,l,d,v,h;let r=(await this.getStream(e.streamId)).data;this._stream=r;let o=r.player_source??((a=r.active_stream)==null?void 0:a.player_source),n=this.extractStreamPoster(r);if(o)return{source:this.mapPlayerSourceToResolvedSource(o),contentType:"stream",poster:n};if(((d=(l=r.media)==null?void 0:l.vod)==null?void 0:d.length)>0){let m=r.media.vod[0];return{source:{type:"video",url:m.original},contentType:"video",poster:n??m.thumb??void 0,videoWidth:(v=m.dimension)==null?void 0:v.width,videoHeight:(h=m.dimension)==null?void 0:h.height}}throw new lt("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 lt("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 Iv(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 wv(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var Mv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],rn=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._state=en()}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=t??this._container,n=r??this._config;if(!o){console.error("[PlayerCore] No container provided. Call attach() first or provide container to loadSource().");return}this._container=o,n&&(this._config=n),this.updateState({error:null,connectionState:"connecting",paused:!0,ended:!1,playing:!1,waiting:!1,seeking:!1,readyState:0,currentTime:0,duration:NaN,buffered:null}),this.dispatch("sourcechange",{source:e});try{let a=e,l=this._state.contentType,d,v,h;if(wv(e)){if(n!=null&&n.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new Ir(n.bpLive)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let _=await this._bpLive.resolveSource(e);a=_.source,l=_.contentType,d=_.poster,v=_.videoWidth,h=_.videoHeight}let m=Iv(a);(this._currentProviderType!==null&&this._currentProviderType!==m||this._mediaElement)&&this.destroyMediaElement();let E=m==="nano"||m==="livekit"||l==="stream"?"live":"vod";return this._currentProviderType=m,this.updateState({providerType:m,contentType:l,streamType:E}),this._mediaElement=this.createMediaElement(m,a,n),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),o.appendChild(this._mediaElement),this._ready=!0,this.dispatch("videoelementchange",{video:this._mediaElement}),{poster:d,videoWidth:v,videoHeight:h}}catch(a){console.error("[PlayerCore] loadSource error:",a);let l={code:-1,message:a instanceof Error?a.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:l,connectionState:"failed"}),this.dispatch("error",l)}}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 Mv){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=Ia(o),l=a!=="offline"&&a!=="autoplay"):this._state.providerType==="livekit"&&o>0&&(a=wa(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({...en(),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}),this.dispatch("play",void 0);try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),this.dispatch("pause",void 0),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this.dispatch("pause",void 0),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 Ma(){return new rn}var Hi="bpPlayerObservedProperties";function Ra(i){return Hi in i&&Array.isArray(i[Hi])}function rh(i,e){class t extends i{get[Hi](){return e}}return t}function Rv(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 $i(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!Ra(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),Ra(i)&&t(i);let r=Rv(i);r.length>0&&await Promise.all(r.map(o=>$i(o,e,t)))}function on(i,e,t){let r=i[Hi];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 nn(i){i[Hi].includes("player")&&(i.player=void 0)}var oh=`/**
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 @@
116
116
  /* Mobile */
117
117
  --bp-mobile-control-backdrop-background: rgba(0, 0, 0, 0.5);
118
118
  }
119
- `;var xu=`/**
119
+ `;var nh=`/**
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 Pu=!1;function gr(){if(Pu)return;let i=document.createElement("style");i.id="bp-player-global-styles",i.textContent=Ru+`
140
- `+xu,document.head.appendChild(i),Pu=!0}function Du(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function Ou(i,e){return`<style>${i}</style>${e}`}var Yo=(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))(Yo||{});function pe(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)}var va=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(new Event("change"))}_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,c)=>({index:c,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(new CustomEvent("addrendition",{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(new Event("change"))};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(t=>t()),this._cleanup=[],this._renditions=[];for(let t=0;t<this._renditions.length;t++)delete this[t]}};var Uu=`/**
139
+ `;var ah=!1;function wr(){if(ah)return;let i=document.createElement("style");i.id="bp-player-global-styles",i.textContent=oh+`
140
+ `+nh,document.head.appendChild(i),ah=!0}function sh(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function lh(i,e){return`<style>${i}</style>${e}`}var an=(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))(an||{});function Ee(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 Mr(){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}),Bi=(i,e)=>new CustomEvent(i,{bubbles:!0,composed:!0,...e});function Jt(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 sn="play";var Vi="pause";var jt="playing";var Rr="waiting";var ln="ended";var dn="timeupdate";var sd="durationchange";var ld="loadstart";var dd="loadedmetadata";var cd="loadeddata";var cn="canplay";var xa="canplaythrough";var un="volumechange";var ei="resize";var hn="ready";var Pa="change";var ud="addrendition";var Da=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(Pa))}_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(Bi(ud,{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(Pa))};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 dh=`/**
141
141
  * BP Player Styles
142
142
  *
143
143
  * Core player component styles using CSS custom properties.
@@ -227,20 +227,20 @@ bp-player[waiting] {
227
227
  bp-player[has-error] {
228
228
  /* Styles when player has an error */
229
229
  }
230
- `;var Nu={fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{console.warn("[bp-player] Failed to parse JSON attribute:",i);return}},toAttribute:i=>i==null?null:JSON.stringify(i)},Hu=!1;function hv(){if(Hu)return;gr();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=Uu,document.head.appendChild(i),Hu=!0}var pv=["emptied","loadstart","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Te=class extends Ce{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&&xi(o,this.providerContainer,this.registerStateReceiver);for(let o of r.removedNodes)o.nodeType===Node.ELEMENT_NODE&&xi(o,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&Go(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),zo(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),hv(),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),this.defaultMuted=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:()=>0,end:()=>0}}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(){this._playerCore||!this.providerContainer||(this._playerCore=pa(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this._playerCore.attach(this.providerContainer,this.config),this.setupEventForwarding(),this._videoRenditions=new va(this))}async loadSource(){var r,o,n,a,l,c,v;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,xi(this,this.providerContainer,this.registerStateReceiver),this.dispatchEvent(new CustomEvent("ready",{detail:this._playerCore,bubbles:!0,composed:!0})),this.debug&&console.log("[BPPlayer] Player ready",(l=this._playerCore)==null?void 0:l.state)),this.propagateStateToAllReceivers(),this.updateStateAttributes(),(v=(c=this._playerCore)==null?void 0:c.state)!=null&&v.paused&&this.dispatchEvent(new Event("pause",{bubbles:!0,composed:!0})),this.autoplay)try{await this._playerCore.play()}catch{}}catch(h){console.error("[BPPlayer] Failed to load source:",h)}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)Go(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;for(let n of pv){let a=()=>{var l;this.debug&&!["durationchange","timeupdate"].includes(n)&&console.log(`[BPPlayer] Forwarding event: ${n}`,(l=this._playerCore)==null?void 0:l.state),this.dispatchEvent(new Event(n,{bubbles:!0,composed:!0}))};this._playerCore.addEventListener(n,a),this.eventCleanup.push(()=>{var l;return(l=this._playerCore)==null?void 0:l.removeEventListener(n,a)})}let t=()=>{var a;let n=(a=this._playerCore)==null?void 0:a.videoElement;n&&this.updateVideoDimensions(n.videoWidth,n.videoHeight)};this._playerCore.addEventListener("resize",t),this._playerCore.addEventListener("loadedmetadata",t),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("resize",t)}),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("loadedmetadata",t)}),t();let r=()=>{this.dispatchEvent(new Event("resize",{bubbles:!0,composed:!0}))};this._playerCore.addEventListener("qualitychange",r),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("qualitychange",r)});let o=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};this._playerCore.addEventListener("statechange",o),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("statechange",o)})}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;pe(this,"paused",t.paused),pe(this,"playing",t.playing),pe(this,"ended",t.ended),pe(this,"seeking",t.seeking),pe(this,"waiting",t.waiting),pe(this,"has-error",t.error!==null),pe(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)zo(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 We`
230
+ `;var hd=!1;function Ov(){if(hd)return;if(document.getElementById("bp-player-styles")){hd=!0;return}wr();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=dh,document.head.appendChild(i),hd=!0}var Nv=["emptied","loadstart","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Ie=class extends Pe{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&&$i(o,this.providerContainer,this.registerStateReceiver);for(let o of r.removedNodes)o.nodeType===Node.ELEMENT_NODE&&$i(o,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&on(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),nn(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),Ov(),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),this.defaultMuted=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:()=>0,end:()=>0}}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(){this._playerCore||!this.providerContainer||(this._playerCore=Ma(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this._playerCore.attach(this.providerContainer,this.config),this.setupEventForwarding(),this._videoRenditions=new Da(this))}async loadSource(){var r,o,n,a,l,d,v;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,$i(this,this.providerContainer,this.registerStateReceiver),this.dispatchEvent(Bi(hn,{detail:this._playerCore})),this.debug&&console.log("[BPPlayer] Player ready",(l=this._playerCore)==null?void 0:l.state)),this.propagateStateToAllReceivers(),this.updateStateAttributes(),(v=(d=this._playerCore)==null?void 0:d.state)!=null&&v.paused&&this.dispatchEvent(q(Vi)),this.autoplay&&this._playerCore)try{await this._playerCore.play()}catch{}}catch(h){console.error("[BPPlayer] Failed to load source:",h)}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)on(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;for(let n of Nv){let a=()=>{var l;this.debug&&!["durationchange","timeupdate"].includes(n)&&console.log(`[BPPlayer] Forwarding event: ${n}`,(l=this._playerCore)==null?void 0:l.state),this.dispatchEvent(q(n))};this._playerCore.addEventListener(n,a),this.eventCleanup.push(()=>{var l;return(l=this._playerCore)==null?void 0:l.removeEventListener(n,a)})}let t=()=>{var a;let n=(a=this._playerCore)==null?void 0:a.videoElement;n&&this.updateVideoDimensions(n.videoWidth,n.videoHeight)};this._playerCore.addEventListener("resize",t),this._playerCore.addEventListener("loadedmetadata",t),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("resize",t)}),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("loadedmetadata",t)}),t();let r=()=>{this.dispatchEvent(q(ei))};this._playerCore.addEventListener("qualitychange",r),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("qualitychange",r)});let o=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};this._playerCore.addEventListener("statechange",o),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("statechange",o)})}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;Ee(this,"paused",t.paused),Ee(this,"playing",t.playing),Ee(this,"ended",t.ended),Ee(this,"seeking",t.seeking),Ee(this,"waiting",t.waiting),Ee(this,"has-error",t.error!==null),Ee(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)nn(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`
231
231
  <div
232
232
  class="${this.getContainerClasses()}"
233
233
  style="${this.getContainerStyle()}"
234
234
  >
235
235
  </div>
236
- `}};N([W({converter:Nu})],Te.prototype,"source",2),N([W({type:Boolean})],Te.prototype,"autoplay",2),N([W({type:Boolean,reflect:!0,attribute:"muted"})],Te.prototype,"defaultMuted",2),N([W({type:Boolean})],Te.prototype,"loop",2),N([W({type:String})],Te.prototype,"scaling",2),N([W({type:String,attribute:"aspect-ratio"})],Te.prototype,"aspectRatio",2),N([W({converter:Nu})],Te.prototype,"config",2),N([W({type:Boolean})],Te.prototype,"debug",2),N([zt()],Te.prototype,"_playerCore",2),Te=N([Gt("bp-player")],Te);var b={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"},U={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Vl={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"},$u=Object.entries(Vl),s=$u.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),mv={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Pi=$u.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...mv}),p_=Object.entries(Pi).reduce((i,[e,t])=>{let r=s[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),Bu=Object.entries(s).reduce((i,[e,t])=>{let r=Pi[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),Ie={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Yt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var fa={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Me={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ze={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Vu={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Wu(i){return i==null?void 0:i.map(fv).join(" ")}function Fu(i){return i==null?void 0:i.split(/\s+/).map(gv)}function fv(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(o=>o!=null).join(":")}}function gv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function Ku(i){return i==null?void 0:i.map(Ev).join(" ")}function qu(i){return i==null?void 0:i.split(/\s+/).map(bv)}function Ev(i){if(i){let{id:e,kind:t,language:r,label:o}=i;return[e,t,r,o].filter(n=>n!=null).join(":")}}function bv(i){if(i){let[e,t,r,o]=i.split(":");return{id:e,kind:t,language:r,label:o}}}function Er(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var ga=i=>new Promise(e=>setTimeout(e,i));var Gu=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],_v=(i,e)=>{let t=i===1?Gu[e].singular:Gu[e].plural;return`${i} ${t}`},Di=i=>{if(!Er(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,c)=>l&&_v(l,c)).filter(l=>l).join(", ")}${t?" remaining":""}`};function Xe(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 f_=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 zu={"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 Yu,Wl={en:zu},Fl=((Yu=globalThis.navigator)==null?void 0:Yu.language)||"en",Qu=i=>{Fl=i};var Tv=i=>{var e,t,r;let[o]=Fl.split("-");return((e=Wl[Fl])==null?void 0:e[i])||((t=Wl[o])==null?void 0:t[i])||((r=Wl.en)==null?void 0:r[i])||i},E=(i,e={})=>Tv(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var Ea=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},ba=class extends Ea{},_a=class extends ba{constructor(){super(...arguments),this.role=null}},Kl=class{observe(){}unobserve(){}disconnect(){}},Zu={createElement:function(){return new Qo.HTMLElement},createElementNS:function(){return new Qo.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},Qo={ResizeObserver:Kl,document:Zu,Node:ba,Element:_a,HTMLElement:class extends _a{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Qo.DocumentFragment}},DocumentFragment:class extends Ea{},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}}}}},Xu="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",Ju=Object.keys(Qo).every(i=>i in globalThis),d=Xu&&!Ju?Qo:globalThis,j=Xu&&!Ju?Zu:globalThis.document;var ju=new WeakMap,ql=i=>{let e=ju.get(i);return e||ju.set(i,e=new Set),e},eh=new d.ResizeObserver(i=>{for(let e of i)for(let t of ql(e.target))t(e)});function xt(i,e){ql(i).add(e),eh.observe(i)}function Pt(i,e){let t=ql(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 Z(i){var e;return(e=ya(i))!=null?e:at(i,"media-controller")}function ya(i){var e;let{MEDIA_CONTROLLER:t}=U,r=i.getAttribute(t);if(r)return(e=Oi(i))==null?void 0:e.getElementById(r)}var Ta=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},Av=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},Aa=(i,e)=>Av(i,e)[0],Ae=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Ae(i,e.getRootNode().host),at=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||at(i.getRootNode().host,e)};function Zo(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=Zo(t.shadowRoot))!=null?e:t:null}function Oi(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 Sa(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 th(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 X(i,e){let t=Sv(i,r=>r===e);return t||Xo(i,e)}function Sv(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 Xo(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 I(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}C(i,e)!=t&&i.toggleAttribute(e,t)}function x(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function P(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;x(i,e,void 0)!==r&&i.setAttribute(e,r)}var ih=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qt=(i,e,t)=>(ih(i,e,"read from private field"),t?t.call(i):e.get(i)),kv=(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)},ka=(i,e,t,r)=>(ih(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Re;function Lv(i){return`
236
+ `}};U([W({converter:Mr()})],Ie.prototype,"source",2),U([W({type:Boolean})],Ie.prototype,"autoplay",2),U([W({type:Boolean,reflect:!0,attribute:"muted"})],Ie.prototype,"defaultMuted",2),U([W({type:Boolean})],Ie.prototype,"loop",2),U([W({type:String})],Ie.prototype,"scaling",2),U([W({type:String,attribute:"aspect-ratio"})],Ie.prototype,"aspectRatio",2),U([W({converter:Mr()})],Ie.prototype,"config",2),U([W({type:Boolean})],Ie.prototype,"debug",2),U([Xt()],Ie.prototype,"_playerCore",2),Ie=U([Zt("bp-player")],Ie);var b={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"},ch=Object.entries(pd),s=ch.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),Uv={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Wi=ch.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...Uv}),Fy=Object.entries(Wi).reduce((i,[e,t])=>{let r=s[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),uh=Object.entries(s).reduce((i,[e,t])=>{let r=Wi[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),De={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},ti={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Oa={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Oe={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},et={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var hh={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function ph(i){return i==null?void 0:i.map($v).join(" ")}function mh(i){return i==null?void 0:i.split(/\s+/).map(Bv)}function $v(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(o=>o!=null).join(":")}}function Bv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function vh(i){return i==null?void 0:i.map(Vv).join(" ")}function fh(i){return i==null?void 0:i.split(/\s+/).map(Wv)}function Vv(i){if(i){let{id:e,kind:t,language:r,label:o}=i;return[e,t,r,o].filter(n=>n!=null).join(":")}}function Wv(i){if(i){let[e,t,r,o]=i.split(":");return{id:e,kind:t,language:r,label:o}}}function xr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var Na=i=>new Promise(e=>setTimeout(e,i));var Eh=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Fv=(i,e)=>{let t=i===1?Eh[e].singular:Eh[e].plural;return`${i} ${t}`},Fi=i=>{if(!xr(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&&Fv(l,d)).filter(l=>l).join(", ")}${t?" remaining":""}`};function tt(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 qy=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 gh={"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 bh,md={en:gh},vd=((bh=globalThis.navigator)==null?void 0:bh.language)||"en",_h=i=>{vd=i};var Gv=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},g=(i,e={})=>Gv(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var Ua=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Ha=class extends Ua{},$a=class extends Ha{constructor(){super(...arguments),this.role=null}},fd=class{observe(){}unobserve(){}disconnect(){}},yh={createElement:function(){return new pn.HTMLElement},createElementNS:function(){return new pn.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},pn={ResizeObserver:fd,document:yh,Node:Ha,Element:$a,HTMLElement:class extends $a{constructor(){super(...arguments),this.innerHTML=""}get content(){return new pn.DocumentFragment}},DocumentFragment:class extends Ua{},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}}}}},Th="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",Ah=Object.keys(pn).every(i=>i in globalThis),c=Th&&!Ah?pn:globalThis,ee=Th&&!Ah?yh:globalThis.document;var Sh=new WeakMap,Ed=i=>{let e=Sh.get(i);return e||Sh.set(i,e=new Set),e},kh=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),kh.observe(i)}function Ut(i,e){let t=Ed(i);t.delete(e),t.size||kh.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=Ba(i))!=null?e:dt(i,"media-controller")}function Ba(i){var e;let{MEDIA_CONTROLLER:t}=N,r=i.getAttribute(t);if(r)return(e=Ki(i))==null?void 0:e.getElementById(r)}var Va=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},qv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},Wa=(i,e)=>qv(i,e)[0],we=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:we(i,e.getRootNode().host),dt=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||dt(i.getRootNode().host,e)};function mn(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=mn(t.shadowRoot))!=null?e:t:null}function Ki(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 Fa(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 Lh(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=zv(i,r=>r===e);return t||vn(i,e)}function zv(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 vn(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 Ch=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ii=(i,e,t)=>(Ch(i,e,"read from private field"),t?t.call(i):e.get(i)),Yv=(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)},Ka=(i,e,t,r)=>(Ch(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ne;function Qv(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 br=class extends d.HTMLElement{constructor(){if(super(),kv(this,Re,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[U.MEDIA_CONTROLLER,s.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===U.MEDIA_CONTROLLER&&(t&&((n=(o=Qt(this,Re))==null?void 0:o.unassociateElement)==null||n.call(o,this),ka(this,Re,null)),r&&this.isConnected&&(ka(this,Re,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=Qt(this,Re))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r,o;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),ka(this,Re,wv(this)),this.getAttribute(U.MEDIA_CONTROLLER)&&((t=(e=Qt(this,Re))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=Qt(this,Re))==null||r.addEventListener("pointerdown",this),(o=Qt(this,Re))==null||o.addEventListener("click",this)}disconnectedCallback(){var e,t,r,o;this.getAttribute(U.MEDIA_CONTROLLER)&&((t=(e=Qt(this,Re))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=Qt(this,Re))==null||r.removeEventListener("pointerdown",this),(o=Qt(this,Re))==null||o.removeEventListener("click",this),ka(this,Re,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:c,width:v,height:h}=this.getBoundingClientRect(),p=n-l,f=a-c;if(p<0||f<0||p>v||f>h||v===0&&h===0)return;let m=this._pointerType||"mouse";if(this._pointerType=void 0,m===fa.TOUCH){this.handleTap(e);return}else if(m===fa.MOUSE||m===fa.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return C(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};Re=new WeakMap;br.shadowRootOptions={mode:"open"};br.getTemplateHTML=Lv;function wv(i){var e;let t=i.getAttribute(U.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):at(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",br);var La=br;var Ql=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},$e=(i,e,t)=>(Ql(i,e,"read from private field"),t?t.call(i):e.get(i)),He=(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)},Ui=(i,e,t,r)=>(Ql(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Fe=(i,e,t)=>(Ql(i,e,"access private method"),t),Ia,_r,jo,yr,wa,Gl,rh,Jo,Ca,zl,oh,Yl,nh,en,Ma,Ra,Zl,Tr,tn,R={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Cv(i){return`
243
+ `}var Pr=class extends c.HTMLElement{constructor(){if(super(),Yv(this,Ne,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=ii(this,Ne))==null?void 0:o.unassociateElement)==null||n.call(o,this),Ka(this,Ne,null)),r&&this.isConnected&&(Ka(this,Ne,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=ii(this,Ne))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r,o;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Ka(this,Ne,Zv(this)),this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=ii(this,Ne))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=ii(this,Ne))==null||r.addEventListener("pointerdown",this),(o=ii(this,Ne))==null||o.addEventListener("click",this)}disconnectedCallback(){var e,t,r,o;this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=ii(this,Ne))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=ii(this,Ne))==null||r.removeEventListener("pointerdown",this),(o=ii(this,Ne))==null||o.removeEventListener("click",this),Ka(this,Ne,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:v,height:h}=this.getBoundingClientRect(),m=n-l,T=a-d;if(m<0||T<0||m>v||T>h||v===0&&h===0)return;let p=this._pointerType||"mouse";if(this._pointerType=void 0,p===Oa.TOUCH){this.handleTap(e);return}else if(p===Oa.MOUSE||p===Oa.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?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(t,{composed:!0,bubbles:!0}))}};Ne=new WeakMap;Pr.shadowRootOptions={mode:"open"};Pr.getTemplateHTML=Qv;function Zv(i){var e;let t=i.getAttribute(N.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):dt(i,"media-controller")}c.customElements.get("media-gesture-receiver")||c.customElements.define("media-gesture-receiver",Pr);var Ga=Pr;var yd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},We=(i,e,t)=>(yd(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)},Gi=(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),Ya,Dr,En,Or,qa,gd,Ih,fn,za,bd,wh,_d,Mh,gn,Qa,Za,Td,Nr,bn,x={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Xv(i){return`
244
244
  <style>
245
245
 
246
246
  :host([${s.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -256,7 +256,7 @@ bp-player[has-error] {
256
256
  overflow: hidden;
257
257
  }
258
258
 
259
- :host(:not([${R.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
259
+ :host(:not([${x.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
260
260
  position: absolute;
261
261
  top: 0;
262
262
  left: 0;
@@ -274,19 +274,19 @@ bp-player[has-error] {
274
274
  }
275
275
 
276
276
 
277
- :host([${R.AUDIO}]) slot[name=media] {
277
+ :host([${x.AUDIO}]) slot[name=media] {
278
278
  display: var(--media-slot-display, none);
279
279
  }
280
280
 
281
281
 
282
- :host([${R.AUDIO}]) [part~=layer][part~=gesture-layer] {
282
+ :host([${x.AUDIO}]) [part~=layer][part~=gesture-layer] {
283
283
  height: 0;
284
284
  display: block;
285
285
  }
286
286
 
287
287
 
288
- :host(:not([${R.AUDIO}])[${R.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
289
- :host(:not([${R.AUDIO}])[${R.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
288
+ :host(:not([${x.AUDIO}])[${x.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
289
+ :host(:not([${x.AUDIO}])[${x.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
290
290
  display: none;
291
291
  }
292
292
 
@@ -295,13 +295,13 @@ bp-player[has-error] {
295
295
  pointer-events: auto;
296
296
  }
297
297
 
298
- :host(:not([${R.AUDIO}])) *[part~=layer][part~=centered-layer] {
298
+ :host(:not([${x.AUDIO}])) *[part~=layer][part~=centered-layer] {
299
299
  align-items: center;
300
300
  justify-content: center;
301
301
  }
302
302
 
303
- :host(:not([${R.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
304
- :host(:not([${R.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
303
+ :host(:not([${x.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
304
+ :host(:not([${x.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
305
305
  align-self: stretch;
306
306
  flex-grow: 1;
307
307
  }
@@ -321,7 +321,7 @@ bp-player[has-error] {
321
321
  }
322
322
 
323
323
 
324
- :host(:not([${R.AUDIO}])) .spacer {
324
+ :host(:not([${x.AUDIO}])) .spacer {
325
325
  flex-grow: 1;
326
326
  }
327
327
 
@@ -333,22 +333,22 @@ bp-player[has-error] {
333
333
  }
334
334
 
335
335
 
336
- ::slotted(:not([slot=media]):not([slot=poster]):not([${R.NO_AUTOHIDE}]):not([hidden]):not([role=dialog])) {
336
+ ::slotted(:not([slot=media]):not([slot=poster]):not([${x.NO_AUTOHIDE}]):not([hidden]):not([role=dialog])) {
337
337
  opacity: 1;
338
338
  transition: var(--media-control-transition-in, opacity 0.25s);
339
339
  }
340
340
 
341
341
 
342
- :host([${R.USER_INACTIVE}]:not([${s.MEDIA_PAUSED}]):not([${s.MEDIA_IS_AIRPLAYING}]):not([${s.MEDIA_IS_CASTING}]):not([${R.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${R.NO_AUTOHIDE}]):not([role=dialog])) {
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])) {
343
343
  opacity: 0;
344
344
  transition: var(--media-control-transition-out, opacity 1s);
345
345
  }
346
346
 
347
- :host([${R.USER_INACTIVE}]:not([${R.NO_AUTOHIDE}]):not([${s.MEDIA_PAUSED}]):not([${s.MEDIA_IS_CASTING}]):not([${R.AUDIO}])) ::slotted([slot=media]) {
347
+ :host([${x.USER_INACTIVE}]:not([${x.NO_AUTOHIDE}]):not([${s.MEDIA_PAUSED}]):not([${s.MEDIA_IS_CASTING}]):not([${x.AUDIO}])) ::slotted([slot=media]) {
348
348
  cursor: none;
349
349
  }
350
350
 
351
- :host([${R.USER_INACTIVE}][${R.AUTOHIDE_OVER_CONTROLS}]:not([${R.NO_AUTOHIDE}]):not([${s.MEDIA_PAUSED}]):not([${s.MEDIA_IS_CASTING}]):not([${R.AUDIO}])) * {
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}])) * {
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([${R.AUDIO}])[${s.MEDIA_HAS_PLAYED}]) slot[name=poster] {
362
+ :host(:not([${x.AUDIO}])[${s.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="${La.shadowRootOptions.mode}">
382
- ${La.getTemplateHTML({})}
381
+ <template shadowrootmode="${Ga.shadowRootOptions.mode}">
382
+ ${Ga.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 Iv=Object.values(s),Mv="sm:384 md:576 lg:768 xl:960";function Rv(i){ah(i.target,i.contentRect.width)}function ah(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(R.BREAKPOINTS))!=null?t:Mv,o=xv(r),n=Pv(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(Pi.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Pi.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function xv(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Pv(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var Ni=class extends d.HTMLElement{constructor(){if(super(),He(this,Gl),He(this,zl),He(this,Yl),He(this,en),He(this,Ra),He(this,Tr),He(this,Ia,0),He(this,_r,null),He(this,jo,null),He(this,yr,void 0),this.breakpointsComputed=!1,He(this,wa,new MutationObserver(Fe(this,Gl,rh).bind(this))),He(this,Jo,!1),He(this,Ca,t=>{$e(this,Jo)||(setTimeout(()=>{Rv(t),Ui(this,Jo,!1)},0),Ui(this,Jo,!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){$e(this,_r)&&this.mediaUnsetCallback($e(this,_r));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[R.AUTOHIDE,R.GESTURES_DISABLED].concat(Iv).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()==R.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&&(Ui(this,_r,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;$e(this,wa).observe(this,{childList:!0,subtree:!0}),xt(this,$e(this,Ca));let r=this.getAttribute(R.AUDIO)!=null?E("audio player"):E("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(R.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=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;$e(this,wa).disconnect(),Pt(this,$e(this,Ca)),this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ui(this,_r,null)}handleEvent(e){switch(e.type){case"pointerdown":Ui(this,Ia,e.timeStamp);break;case"pointermove":Fe(this,zl,oh).call(this,e);break;case"pointerup":Fe(this,Yl,nh).call(this,e);break;case"mouseleave":Fe(this,en,Ma).call(this);break;case"mouseup":this.removeAttribute(R.KEYBOARD_CONTROL);break;case"keyup":Fe(this,Tr,tn).call(this),this.setAttribute(R.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Ui(this,yr,isNaN(t)?0:t)}get autohide(){return($e(this,yr)===void 0?2:$e(this,yr)).toString()}get breakpoints(){return x(this,R.BREAKPOINTS)}set breakpoints(e){P(this,R.BREAKPOINTS,e)}get audio(){return C(this,R.AUDIO)}set audio(e){I(this,R.AUDIO,e)}get gesturesDisabled(){return C(this,R.GESTURES_DISABLED)}set gesturesDisabled(e){I(this,R.GESTURES_DISABLED,e)}get keyboardControl(){return C(this,R.KEYBOARD_CONTROL)}set keyboardControl(e){I(this,R.KEYBOARD_CONTROL,e)}get noAutohide(){return C(this,R.NO_AUTOHIDE)}set noAutohide(e){I(this,R.NO_AUTOHIDE,e)}get autohideOverControls(){return C(this,R.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){I(this,R.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return C(this,R.USER_INACTIVE)}set userInteractive(e){I(this,R.USER_INACTIVE,e)}};Ia=new WeakMap;_r=new WeakMap;jo=new WeakMap;yr=new WeakMap;wa=new WeakMap;Gl=new WeakSet;rh=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)}};Jo=new WeakMap;Ca=new WeakMap;zl=new WeakSet;oh=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-$e(this,Ia)<250)return;Fe(this,Ra,Zl).call(this),clearTimeout($e(this,jo));let e=this.hasAttribute(R.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&Fe(this,Tr,tn).call(this)};Yl=new WeakSet;nh=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(R.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Fe(this,en,Ma).call(this):Fe(this,Tr,tn).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Fe(this,Tr,tn).call(this)};en=new WeakSet;Ma=function(){if($e(this,yr)<0||this.hasAttribute(R.USER_INACTIVE))return;this.setAttribute(R.USER_INACTIVE,"");let i=new d.CustomEvent(Pi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};Ra=new WeakSet;Zl=function(){if(!this.hasAttribute(R.USER_INACTIVE))return;this.removeAttribute(R.USER_INACTIVE);let i=new d.CustomEvent(Pi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Tr=new WeakSet;tn=function(){Fe(this,Ra,Zl).call(this),clearTimeout($e(this,jo));let i=parseInt(this.autohide);i<0||Ui(this,jo,setTimeout(()=>{Fe(this,en,Ma).call(this)},i*1e3))};Ni.shadowRootOptions={mode:"open"};Ni.getTemplateHTML=Cv;d.customElements.get("media-container")||d.customElements.define("media-container",Ni);var sh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(sh(i,e,"read from private field"),t?t.call(i):e.get(i)),rn=(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)},xa=(i,e,t,r)=>(sh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ar,Sr,Pa,Hi,Dt,Zt,Xt=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){rn(this,Dt),rn(this,Ar,void 0),rn(this,Sr,void 0),rn(this,Pa,void 0),rn(this,Hi,new Set),xa(this,Ar,e),xa(this,Sr,t),xa(this,Pa,new Set(r))}[Symbol.iterator](){return ge(this,Dt,Zt).values()}get length(){return ge(this,Dt,Zt).size}get value(){var e;return(e=[...ge(this,Dt,Zt)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(xa(this,Hi,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...ge(this,Dt,Zt)][e]}values(){return ge(this,Dt,Zt).values()}forEach(e,t){ge(this,Dt,Zt).forEach(e,t)}add(...e){var t,r;e.forEach(o=>ge(this,Hi).add(o)),!(this.value===""&&!((t=ge(this,Ar))!=null&&t.hasAttribute(`${ge(this,Sr)}`)))&&((r=ge(this,Ar))==null||r.setAttribute(`${ge(this,Sr)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>ge(this,Hi).delete(r)),(t=ge(this,Ar))==null||t.setAttribute(`${ge(this,Sr)}`,`${this.value}`)}contains(e){return ge(this,Dt,Zt).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}};Ar=new WeakMap;Sr=new WeakMap;Pa=new WeakMap;Hi=new WeakMap;Dt=new WeakSet;Zt=function(){return ge(this,Hi).size?ge(this,Hi):ge(this,Pa)};var Dv=(i="")=>i.split(/\s+/),lh=(i="")=>{let[e,t,r]=i.split(":"),o=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?Ie.CAPTIONS:Ie.SUBTITLES,language:t,label:o}},$i=(i="",e={})=>Dv(i).map(t=>{let r=lh(t);return{...e,...r}}),Xl=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?lh(e):e):typeof i=="string"?$i(i):[i]:[],Da=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Ot=(i=[])=>Array.prototype.map.call(i,Da).join(" "),Ov=(i,e)=>t=>t[i]===e,dh=i=>{let e=Object.entries(i).map(([t,r])=>Ov(t,r));return t=>e.every(r=>r(t))},Bi=(i,e=[],t=[])=>{let r=Xl(t).map(dh),o=n=>r.some(a=>a(n));Array.from(e).filter(o).forEach(n=>{n.mode=i})},Vi=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:dh(e);return Array.from(i.textTracks).filter(t)},Oa=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)};var uh=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 j?"exitFullscreen":"webkitExitFullscreen"in j?"webkitExitFullscreen":"webkitCancelFullScreen"in j?"webkitCancelFullScreen":void 0,hh=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(()=>{})}},on="fullscreenElement"in j?"fullscreenElement":"webkitFullscreenElement"in j?"webkitFullscreenElement":void 0,Uv=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[on];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===Vu.FULLSCREEN?t:r},ph=i=>{var e;let{media:t,documentElement:r,fullscreenElement:o=t}=i;if(!t||!r)return!1;let n=Uv(i);if(!n)return!1;if(n===o||n===t)return!0;if(n.localName.includes("-")){let a=n.shadowRoot;if(!(on in a))return Ae(n,o);for(;a!=null&&a[on];){if(a[on]===o)return!0;a=(e=a[on])==null?void 0:e.shadowRoot}}return!1},Nv="fullscreenEnabled"in j?"fullscreenEnabled":"webkitFullscreenEnabled"in j?"webkitFullscreenEnabled":void 0,mh=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[Nv])||t&&"webkitSupportsFullscreen"in t};var Ua,Jl=()=>{var i,e;return Ua||(Ua=(e=(i=j)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Ua)},vh=async(i=Jl())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([Hv(i,t.signal),$v(i,e)]);return t.abort(),r},Hv=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),$v=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await ga(10)}return i.volume!==e},Bv=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),jl=(i=Jl())=>d.matchMedia("(display-mode: standalone)").matches&&Bv?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",ed=(i=Jl())=>mh({documentElement:j,media:i}),fh=ed(),gh=jl(),Eh=!!d.WebKitPlaybackTargetAvailabilityEvent,bh=!!d.chrome;var kr=i=>Vi(i.media,e=>[Ie.SUBTITLES,Ie.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),td=i=>Vi(i.media,e=>e.mode===Yt.SHOWING&&[Ie.SUBTITLES,Ie.CAPTIONS].includes(e.kind)),Na=(i,e)=>{let t=kr(i),r=td(i),o=!!r.length;if(t.length){if(e===!1||o&&e!==!0)Bi(Yt.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"),p=h?[h,...globalThis.navigator.languages]:globalThis.navigator.languages,f=t.filter(m=>p.some(A=>m.language.toLowerCase().startsWith(A.split("-")[0]))).sort((m,A)=>{let g=p.findIndex(D=>m.language.toLowerCase().startsWith(D.split("-")[0])),L=p.findIndex(D=>A.language.toLowerCase().startsWith(D.split("-")[0]));return g-L});f[0]&&(n=f[0])}let{language:l,label:c,kind:v}=n;Bi(Yt.DISABLED,t,r),Bi(Yt.SHOWING,t,[{language:l,label:c,kind:v}])}}},Ha=(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)?Vv(i,e):Object.entries(i).every(([t,r])=>t in e&&Ha(r,e[t])),Vv=(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)=>Ha(o,e[n])):!0};var Wv=Object.values(Ze),$a,Fv=vh().then(i=>($a=i,$a)),_h=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=d.customElements.get(t);r&&e instanceof r||(await d.customElements.whenDefined(t),d.customElements.upgrade(e))}))},Kv=new d.DOMParser,qv=i=>i&&(Kv.parseFromString(i,"text/html").body.textContent||i),Lr={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=d.localStorage.getItem("media-chrome-pref-muted")!==null,n=t.hasAttribute("muted");if(r){o&&d.localStorage.removeItem("media-chrome-pref-muted");return}if(n&&!o)return;d.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=d.localStorage.getItem("media-chrome-pref-muted")==="true";Lr.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?d.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&d.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=d.localStorage.getItem("media-chrome-pref-volume");if(o==null)return;Lr.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||!Er(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=[Ze.LIVE,Ze.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:o}=e;if(Wv.includes(o))return o===Ze.UNKNOWN?r:o;let n=e.duration;return n===1/0?Ze.LIVE:Number.isFinite(n)?Ze.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=Lr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===Ze.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(!(Lr.mediaStreamType.get(i)===Ze.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 kr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return td(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 c;!n.defaultSubtitles||l&&![Ie.CAPTIONS,Ie.SUBTITLES].includes((c=l==null?void 0:l.track)==null?void 0:c.kind)||Na(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,c;o.removeEventListener("loadstart",a),(l=o.textTracks)==null||l.removeEventListener("addtrack",a),(c=o.textTracks)==null||c.removeEventListener("removetrack",a)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=Vi(t,{kind:Ie.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:o,startTime:n,endTime:a})=>({text:qv(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("-")?Ae(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(!j.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 j.pictureInPictureElement&&j.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 ph(i)},set(i,e,t){var r;i?(uh(e),t.detail&&((r=e.media)==null||r.focus())):hh(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&&d.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(!fh||!ed(e))return Me.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!gh||!jl(e))return Me.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Me.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if($a===!1||(e==null?void 0:e.volume)==null)return Me.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{$a==null&&Fv.then(e=>i(e?void 0:Me.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!bh||!((t=r==null?void 0:r.remote)!=null&&t.state))return Me.UNSUPPORTED;if(!(e==null||e==="available"))return Me.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(!Eh)return Me.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Me.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 Me.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Me.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return Me.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Me.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var yh={[b.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,o,n;let{media:a}=e,l=t??void 0,c,v;if(a&&l!=null){let[m]=Vi(a,{kind:Ie.METADATA,label:"thumbnails"}),A=Array.prototype.find.call((r=m==null?void 0:m.cues)!=null?r:[],(g,L,D)=>L===0?g.endTime>l:L===D.length-1?g.startTime<=l:g.startTime<=l&&g.endTime>l);if(A){let g=/'^(?:[a-z]+:)?\/\//i.test(A.text)||(o=a==null?void 0:a.querySelector('track[label="thumbnails"]'))==null?void 0:o.src,L=new URL(A.text,g);v=new URLSearchParams(L.hash).get("#xywh").split(",").map(Ue=>+Ue),c=L.href}}let h=i.mediaDuration.get(e),f=(n=i.mediaChaptersCues.get(e).find((m,A,g)=>A===g.length-1&&h===m.endTime?m.startTime<=l&&m.endTime>=l:m.startTime<=l&&m.endTime>l))==null?void 0:n.text;return t!=null&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:c,mediaPreviewCoords:v,mediaPreviewChapter:f}},[b.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[b.MEDIA_PLAY_REQUEST](i,e){var t,r,o,n;let a="mediaPaused",c=i.mediaStreamType.get(e)===Ze.LIVE,v=!((t=e.options)!=null&&t.noAutoSeekToLive),h=i.mediaTargetLiveWindow.get(e)>0;if(c&&v&&!h){let p=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(p){let f=(n=(o=e.options)==null?void 0:o.seekToLiveOffset)!=null?n:0,m=p-f;i.mediaCurrentTime.set(m,e)}}i[a].set(!1,e)},[b.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",o=t;i[r].set(o,e)},[b.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[b.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[b.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",o=!!t;return i[r].set(o,e),{mediaLoop:o}},[b.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)},[b.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",o=t;i[r].set(o,e)},[b.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,c=a-l;i[n].set(c,e)},[b.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:o}=e,n=kr(e),a=Xl(t),l=(r=a[0])==null?void 0:r.language;l&&!o.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Bi(Yt.SHOWING,n,a)},[b.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=kr(e),o=t??[];Bi(Yt.DISABLED,r,o)},[b.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){Na(e,t)},[b.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",o=t;i[r].set(o,e)},[b.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",o=t;i[r].set(o,e)},[b.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[b.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)},[b.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[b.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[b.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var Th=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Lr,requestMap:o=yh,options:n={},monitorStateOwnersOnlyWithSubscriptions:a=!0})=>{let l=[],c={options:{...n}},v=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),h=g=>{g!=null&&(Ha(g,v)||(v=Object.freeze({...v,...g}),l.forEach(L=>L(v))))},p=()=>{let g=Object.entries(r).reduce((L,[D,{get:Ue}])=>(L[D]=Ue(c),L),{});h(g)},f={},m,A=async(g,L)=>{var D,Ue,ot,Mo,cr,Vc,kl,k,K,ne,te,G,he,Mt,Ro,Wc;let Rm=!!m;if(m={...c,...m??{},...g},Rm)return;await _h(...Object.values(g));let ur=l.length>0&&L===0&&a,Fc=c.media!==m.media,Kc=((D=c.media)==null?void 0:D.textTracks)!==((Ue=m.media)==null?void 0:Ue.textTracks),qc=((ot=c.media)==null?void 0:ot.videoRenditions)!==((Mo=m.media)==null?void 0:Mo.videoRenditions),Gc=((cr=c.media)==null?void 0:cr.audioTracks)!==((Vc=m.media)==null?void 0:Vc.audioTracks),zc=((kl=c.media)==null?void 0:kl.remote)!==((k=m.media)==null?void 0:k.remote),Yc=c.documentElement!==m.documentElement,Qc=!!c.media&&(Fc||ur),Zc=!!((K=c.media)!=null&&K.textTracks)&&(Kc||ur),Xc=!!((ne=c.media)!=null&&ne.videoRenditions)&&(qc||ur),Jc=!!((te=c.media)!=null&&te.audioTracks)&&(Gc||ur),jc=!!((G=c.media)!=null&&G.remote)&&(zc||ur),eu=!!c.documentElement&&(Yc||ur),Ll=Qc||Zc||Xc||Jc||jc||eu,hr=l.length===0&&L===1&&a,w=!!m.media&&(Fc||hr),tu=!!((he=m.media)!=null&&he.textTracks)&&(Kc||hr),iu=!!((Mt=m.media)!=null&&Mt.videoRenditions)&&(qc||hr),ru=!!((Ro=m.media)!=null&&Ro.audioTracks)&&(Gc||hr),ou=!!((Wc=m.media)!=null&&Wc.remote)&&(zc||hr),nu=!!m.documentElement&&(Yc||hr),au=w||tu||iu||ru||ou||nu;if(!(Ll||au)){Object.entries(m).forEach(([z,xo])=>{c[z]=xo}),p(),m=void 0;return}Object.entries(r).forEach(([z,{get:xo,mediaEvents:xm=[],textTracksEvents:Pm=[],videoRenditionsEvents:Dm=[],audioTracksEvents:Om=[],remoteEvents:Um=[],rootEvents:Nm=[],stateOwnersUpdateHandlers:Hm=[]}])=>{f[z]||(f[z]={});let Ne=ie=>{let ce=xo(c,ie);h({[z]:ce})},ve;ve=f[z].mediaEvents,xm.forEach(ie=>{ve&&Qc&&(c.media.removeEventListener(ie,ve),f[z].mediaEvents=void 0),w&&(m.media.addEventListener(ie,Ne),f[z].mediaEvents=Ne)}),ve=f[z].textTracksEvents,Pm.forEach(ie=>{var ce,Qe;ve&&Zc&&((ce=c.media.textTracks)==null||ce.removeEventListener(ie,ve),f[z].textTracksEvents=void 0),tu&&((Qe=m.media.textTracks)==null||Qe.addEventListener(ie,Ne),f[z].textTracksEvents=Ne)}),ve=f[z].videoRenditionsEvents,Dm.forEach(ie=>{var ce,Qe;ve&&Xc&&((ce=c.media.videoRenditions)==null||ce.removeEventListener(ie,ve),f[z].videoRenditionsEvents=void 0),iu&&((Qe=m.media.videoRenditions)==null||Qe.addEventListener(ie,Ne),f[z].videoRenditionsEvents=Ne)}),ve=f[z].audioTracksEvents,Om.forEach(ie=>{var ce,Qe;ve&&Jc&&((ce=c.media.audioTracks)==null||ce.removeEventListener(ie,ve),f[z].audioTracksEvents=void 0),ru&&((Qe=m.media.audioTracks)==null||Qe.addEventListener(ie,Ne),f[z].audioTracksEvents=Ne)}),ve=f[z].remoteEvents,Um.forEach(ie=>{var ce,Qe;ve&&jc&&((ce=c.media.remote)==null||ce.removeEventListener(ie,ve),f[z].remoteEvents=void 0),ou&&((Qe=m.media.remote)==null||Qe.addEventListener(ie,Ne),f[z].remoteEvents=Ne)}),ve=f[z].rootEvents,Nm.forEach(ie=>{ve&&eu&&(c.documentElement.removeEventListener(ie,ve),f[z].rootEvents=void 0),nu&&(m.documentElement.addEventListener(ie,Ne),f[z].rootEvents=Ne)});let na=f[z].stateOwnersUpdateHandlers;if(na&&Ll&&(Array.isArray(na)?na:[na]).forEach(ce=>{typeof ce=="function"&&ce()}),au){let ie=Hm.map(ce=>ce(Ne,m)).filter(ce=>typeof ce=="function");f[z].stateOwnersUpdateHandlers=ie.length===1?ie[0]:ie}else Ll&&(f[z].stateOwnersUpdateHandlers=void 0)}),Object.entries(m).forEach(([z,xo])=>{c[z]=xo}),p(),m=void 0};return A({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(g){let{type:L,detail:D}=g;if(o[L]&&v.mediaErrorCode==null){h(o[L](r,c,g));return}L==="mediaelementchangerequest"?A({media:D}):L==="fullscreenelementchangerequest"?A({fullscreenElement:D}):L==="documentelementchangerequest"?A({documentElement:D}):L==="optionschangerequest"&&(Object.entries(D??{}).forEach(([Ue,ot])=>{c.options[Ue]=ot}),p())},getState(){return v},subscribe(g){return A({},l.length+1),l.push(g),g(v),()=>{let L=l.indexOf(g);L>=0&&(A({},l.length-1),l.splice(L,1))}}}};var sd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},M=(i,e,t)=>(sd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ke=(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)},st=(i,e,t,r)=>(sd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),dt=(i,e,t)=>(sd(i,e,"access private method"),t),Jt,nn,V,Fi,an,lt,Ba,sn,Va,id,Ki,wr,Wa,rd,od,Ih,Mh=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],Ah=10,Sh=.025,kh=.25,Gv=.25,zv=2,y={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"},nd=class extends Ni{constructor(){super(),Ke(this,Va),Ke(this,Ki),Ke(this,Wa),Ke(this,od),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Ke(this,Jt,new Xt(this,y.HOTKEYS)),Ke(this,nn,void 0),Ke(this,V,void 0),Ke(this,Fi,null),Ke(this,an,void 0),Ke(this,lt,void 0),Ke(this,Ba,t=>{var r;(r=M(this,V))==null||r.dispatch(t)}),Ke(this,sn,void 0),this.associateElement(this);let e={};st(this,an,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 d.CustomEvent(Bu[n],{composed:!0,detail:o});this.dispatchEvent(a)}),e=t}),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(y.NO_HOTKEYS,y.HOTKEYS,y.DEFAULT_STREAM_TYPE,y.DEFAULT_SUBTITLES,y.DEFAULT_DURATION,y.NO_MUTED_PREF,y.NO_VOLUME_PREF,y.LANG,y.LOOP)}get mediaStore(){return M(this,V)}set mediaStore(e){var t,r;if(M(this,V)&&((t=M(this,lt))==null||t.call(this),st(this,lt,void 0)),st(this,V,e),!M(this,V)&&!this.hasAttribute(y.NO_DEFAULT_STORE)){dt(this,Va,id).call(this);return}st(this,lt,(r=M(this,V))==null?void 0:r.subscribe(M(this,an)))}get fullscreenElement(){var e;return(e=M(this,nn))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(y.FULLSCREEN_ELEMENT)&&this.removeAttribute(y.FULLSCREEN_ELEMENT),st(this,nn,e),(t=M(this,V))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return C(this,y.DEFAULT_SUBTITLES)}set defaultSubtitles(e){I(this,y.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return x(this,y.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){P(this,y.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return H(this,y.DEFAULT_DURATION)}set defaultDuration(e){B(this,y.DEFAULT_DURATION,e)}get noHotkeys(){return C(this,y.NO_HOTKEYS)}set noHotkeys(e){I(this,y.NO_HOTKEYS,e)}get keysUsed(){return x(this,y.KEYS_USED)}set keysUsed(e){P(this,y.KEYS_USED,e)}get liveEdgeOffset(){return H(this,y.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){B(this,y.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return C(this,y.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){I(this,y.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return C(this,y.NO_VOLUME_PREF)}set noVolumePref(e){I(this,y.NO_VOLUME_PREF,e)}get noMutedPref(){return C(this,y.NO_MUTED_PREF)}set noMutedPref(e){I(this,y.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return C(this,y.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){I(this,y.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return C(this,y.NO_DEFAULT_STORE)}set noDefaultStore(e){I(this,y.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var o,n,a,l,c,v,h,p,f,m,A,g;if(super.attributeChangedCallback(e,t,r),e===y.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(y.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===y.HOTKEYS)M(this,Jt).value=r;else if(e===y.DEFAULT_SUBTITLES&&r!==t)(o=M(this,V))==null||o.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES)}});else if(e===y.DEFAULT_STREAM_TYPE)(a=M(this,V))==null||a.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===y.LIVE_EDGE_OFFSET)(l=M(this,V))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(y.LIVE_EDGE_OFFSET)}});else if(e===y.SEEK_TO_LIVE_OFFSET)(c=M(this,V))==null||c.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===y.NO_AUTO_SEEK_TO_LIVE)(v=M(this,V))==null||v.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE)}});else if(e===y.FULLSCREEN_ELEMENT){let L=r?(h=this.getRootNode())==null?void 0:h.getElementById(r):void 0;st(this,nn,L),(p=M(this,V))==null||p.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===y.LANG&&r!==t?(Qu(r),(f=M(this,V))==null||f.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===y.LOOP&&r!==t?(m=M(this,V))==null||m.dispatch({type:b.MEDIA_LOOP_REQUEST,detail:r!=null}):e===y.NO_VOLUME_PREF&&r!==t?(A=M(this,V))==null||A.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF)}}):e===y.NO_MUTED_PREF&&r!==t&&((g=M(this,V))==null||g.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(y.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!M(this,V)&&!this.hasAttribute(y.NO_DEFAULT_STORE)&&dt(this,Va,id).call(this),(e=M(this,V))==null||e.dispatch({type:"documentelementchangerequest",detail:j}),super.connectedCallback(),M(this,V)&&!M(this,lt)&&st(this,lt,(t=M(this,V))==null?void 0:t.subscribe(M(this,an))),M(this,sn)!==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:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:M(this,sn)}))},0),this.hasAttribute(y.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 a=M(this,V).getState();st(this,sn,!!((t=a.mediaSubtitlesShowing)!=null&&t.length)),(r=M(this,V))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(o=M(this,V))==null||o.dispatch({type:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}M(this,lt)&&((n=M(this,lt))==null||n.call(this),st(this,lt,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){Ch(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=jv(e,r,o);Object.values(b).forEach(a=>{e.addEventListener(a,M(this,Ba))}),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(b).forEach(o=>{e.removeEventListener(o,M(this,Ba))})}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])=>{Ch([e],o,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",dt(this,Wa,rd))}disableHotkeys(){this.removeEventListener("keydown",dt(this,Wa,rd)),this.removeEventListener("keyup",dt(this,Ki,wr))}get hotkeys(){return x(this,y.HOTKEYS)}set hotkeys(e){P(this,y.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,o,n,a,l,c,v,h;let p=e.target;if(((o=(r=(t=p.getAttribute(y.KEYS_USED))==null?void 0:t.split(" "))!=null?r:p==null?void 0:p.keysUsed)!=null?o:[]).map(D=>D==="Space"?" ":D).filter(Boolean).includes(e.key))return;let m,A,g;if(!(M(this,Jt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&M(this,Jt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&M(this,Jt).contains("noshift+/")))switch(e.key){case" ":case"k":m=M(this,V).getState().mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"m":m=this.mediaStore.getState().mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"f":m=this.mediaStore.getState().mediaIsFullscreen?b.MEDIA_EXIT_FULLSCREEN_REQUEST:b.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let D=this.hasAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET):Ah;A=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-D,0),g=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(g);break}case"ArrowRight":case"l":{let D=this.hasAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET):Ah;A=Math.max(((a=this.mediaStore.getState().mediaCurrentTime)!=null?a:0)+D,0),g=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(g);break}case"ArrowUp":{let D=this.hasAttribute(y.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_UP_VOLUME_STEP):Sh;A=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+D,1),g=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(g);break}case"ArrowDown":{let D=this.hasAttribute(y.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_DOWN_VOLUME_STEP):Sh;A=Math.max(((c=this.mediaStore.getState().mediaVolume)!=null?c:1)-D,0),g=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(g);break}case"<":{let D=(v=this.mediaStore.getState().mediaPlaybackRate)!=null?v:1;A=Math.max(D-kh,Gv).toFixed(2),g=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(g);break}case">":{let D=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;A=Math.min(D+kh,zv).toFixed(2),g=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(g);break}case"/":case"?":{e.shiftKey&&dt(this,od,Ih).call(this);break}case"p":{m=this.mediaStore.getState().mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST,g=new d.CustomEvent(m,{composed:!0,bubbles:!0}),this.dispatchEvent(g);break}default:break}}};Jt=new WeakMap;nn=new WeakMap;V=new WeakMap;Fi=new WeakMap;an=new WeakMap;lt=new WeakMap;Ba=new WeakMap;sn=new WeakMap;Va=new WeakSet;id=function(){var i;this.mediaStore=Th({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(y.DEFAULT_DURATION)?+this.getAttribute(y.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(y.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(y.NO_SUBTITLES_LANG_PREF)}})};Ki=new WeakSet;wr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||Mh.includes(e))){this.removeEventListener("keyup",dt(this,Ki,wr));return}this.keyboardShortcutHandler(i)};Wa=new WeakSet;rd=function(i){var e;let{metaKey:t,altKey:r,key:o,shiftKey:n}=i,a=n&&(o==="/"||o==="?");if(a&&((e=M(this,Fi))!=null&&e.open)){this.removeEventListener("keyup",dt(this,Ki,wr));return}if(t||r||!a&&!Mh.includes(o)){this.removeEventListener("keyup",dt(this,Ki,wr));return}let l=i.target,c=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(o)&&!(M(this,Jt).contains(`no${o.toLowerCase()}`)||o===" "&&M(this,Jt).contains("nospace"))&&!c&&i.preventDefault(),this.addEventListener("keyup",dt(this,Ki,wr),{once:!0})};od=new WeakSet;Ih=function(){M(this,Fi)||(st(this,Fi,j.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(M(this,Fi))),M(this,Fi).open=!0};var Yv=Object.values(s),Qv=Object.values(Vl),Rh=i=>{var e,t,r,o;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let a=(o=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,U.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:o.call(r,/\s+/);return Array.isArray(n||a)?(n||a).filter(l=>Yv.includes(l)):[]},Zv=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&d.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof d.customElements.get(i.nodeName.toLowerCase()))&&d.customElements.upgrade(i),Qv.some(r=>r in i)},ad=i=>Zv(i)||!!Rh(i).length,Lh=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},wh={[s.MEDIA_SUBTITLES_LIST]:Ot,[s.MEDIA_SUBTITLES_SHOWING]:Ot,[s.MEDIA_SEEKABLE]:Lh,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Lh).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:Wu,[s.MEDIA_AUDIO_TRACK_LIST]:Ku},Xv=async(i,e,t)=>{var r,o;if(i.isConnected||await ga(0),typeof t=="boolean"||t==null)return I(i,e,t);if(typeof t=="number")return B(i,e,t);if(typeof t=="string")return P(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(o=(r=wh[e])==null?void 0:r.call(wh,t))!=null?o:t;return i.setAttribute(e,n)},Jv=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Wi=(i,e)=>{if(Jv(i))return;let t=(o,n)=>{var a,l;ad(o)&&n(o);let{children:c=[]}=o??{},v=(l=(a=o==null?void 0:o.shadowRoot)==null?void 0:a.children)!=null?l:[];[...c,...v].forEach(p=>Wi(p,n))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!ad(i)){d.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},Ch=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let o=Rh(r),n=e.toLowerCase();o.includes(n)&&Xv(r,n,t)})},jv=(i,e,t)=>{Wi(i,e);let r=h=>{var p;let f=(p=h==null?void 0:h.composedPath()[0])!=null?p:h.target;e(f)},o=h=>{var p;let f=(p=h==null?void 0:h.composedPath()[0])!=null?p:h.target;t(f)};i.addEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o);let n=h=>{h.forEach(p=>{let{addedNodes:f=[],removedNodes:m=[],type:A,target:g,attributeName:L}=p;A==="childList"?(Array.prototype.forEach.call(f,D=>Wi(D,e)),Array.prototype.forEach.call(m,D=>Wi(D,t))):A==="attributes"&&L===U.MEDIA_CHROME_ATTRIBUTES&&(ad(g)?e(g):t(g))})},a=[],l=h=>{let p=h.target;p.name!=="media"&&(a.forEach(f=>Wi(f,t)),a=[...p.assignedElements({flatten:!0})],a.forEach(f=>Wi(f,e)))};i.addEventListener("slotchange",l);let c=new MutationObserver(n);return c.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Wi(i,t),i.removeEventListener("slotchange",l),c.disconnect(),i.removeEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",nd);var Cr={PLACEMENT:"placement",BOUNDS:"bounds"};function ef(i){return`
394
+ `}var Jv=Object.values(s),jv="sm:384 md:576 lg:768 xl:960";function ef(i){Rh(i.target,i.contentRect.width)}function Rh(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(x.BREAKPOINTS))!=null?t:jv,o=tf(r),n=rf(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(Wi.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Wi.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function tf(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function rf(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var qi=class extends c.HTMLElement{constructor(){if(super(),Ve(this,gd),Ve(this,bd),Ve(this,_d),Ve(this,gn),Ve(this,Za),Ve(this,Nr),Ve(this,Ya,0),Ve(this,Dr,null),Ve(this,En,null),Ve(this,Or,void 0),this.breakpointsComputed=!1,Ve(this,qa,new MutationObserver(qe(this,gd,Ih).bind(this))),Ve(this,fn,!1),Ve(this,za,t=>{We(this,fn)||(setTimeout(()=>{ef(t),Gi(this,fn,!1)},0),Gi(this,fn,!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){We(this,Dr)&&this.mediaUnsetCallback(We(this,Dr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[x.AUTOHIDE,x.GESTURES_DISABLED].concat(Jv).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&&(Gi(this,Dr,e),e.localName.includes("-")&&await c.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;We(this,qa).observe(this,{childList:!0,subtree:!0}),Nt(this,We(this,za));let r=this.getAttribute(x.AUDIO)!=null?g("audio player"):g("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(x.USER_INACTIVE,""),Rh(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;We(this,qa).disconnect(),Ut(this,We(this,za)),this.media&&this.mediaUnsetCallback(this.media),(e=c.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Gi(this,Dr,null)}handleEvent(e){switch(e.type){case"pointerdown":Gi(this,Ya,e.timeStamp);break;case"pointermove":qe(this,bd,wh).call(this,e);break;case"pointerup":qe(this,_d,Mh).call(this,e);break;case"mouseleave":qe(this,gn,Qa).call(this);break;case"mouseup":this.removeAttribute(x.KEYBOARD_CONTROL);break;case"keyup":qe(this,Nr,bn).call(this),this.setAttribute(x.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Gi(this,Or,isNaN(t)?0:t)}get autohide(){return(We(this,Or)===void 0?2:We(this,Or)).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)}};Ya=new WeakMap;Dr=new WeakMap;En=new WeakMap;Or=new WeakMap;qa=new WeakMap;gd=new WeakSet;Ih=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)}};fn=new WeakMap;za=new WeakMap;bd=new WeakSet;wh=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-We(this,Ya)<250)return;qe(this,Za,Td).call(this),clearTimeout(We(this,En));let e=this.hasAttribute(x.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&qe(this,Nr,bn).call(this)};_d=new WeakSet;Mh=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(x.USER_INACTIVE);[this,this.media].includes(i.target)&&e?qe(this,gn,Qa).call(this):qe(this,Nr,bn).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&qe(this,Nr,bn).call(this)};gn=new WeakSet;Qa=function(){if(We(this,Or)<0||this.hasAttribute(x.USER_INACTIVE))return;this.setAttribute(x.USER_INACTIVE,"");let i=new c.CustomEvent(Wi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};Za=new WeakSet;Td=function(){if(!this.hasAttribute(x.USER_INACTIVE))return;this.removeAttribute(x.USER_INACTIVE);let i=new c.CustomEvent(Wi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Nr=new WeakSet;bn=function(){qe(this,Za,Td).call(this),clearTimeout(We(this,En));let i=parseInt(this.autohide);i<0||Gi(this,En,setTimeout(()=>{qe(this,gn,Qa).call(this)},i*1e3))};qi.shadowRootOptions={mode:"open"};qi.getTemplateHTML=Xv;c.customElements.get("media-container")||c.customElements.define("media-container",qi);var xh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ye=(i,e,t)=>(xh(i,e,"read from private field"),t?t.call(i):e.get(i)),_n=(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)},Xa=(i,e,t,r)=>(xh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ur,Hr,Ja,zi,Ht,ri,oi=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){_n(this,Ht),_n(this,Ur,void 0),_n(this,Hr,void 0),_n(this,Ja,void 0),_n(this,zi,new Set),Xa(this,Ur,e),Xa(this,Hr,t),Xa(this,Ja,new Set(r))}[Symbol.iterator](){return ye(this,Ht,ri).values()}get length(){return ye(this,Ht,ri).size}get value(){var e;return(e=[...ye(this,Ht,ri)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Xa(this,zi,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...ye(this,Ht,ri)][e]}values(){return ye(this,Ht,ri).values()}forEach(e,t){ye(this,Ht,ri).forEach(e,t)}add(...e){var t,r;e.forEach(o=>ye(this,zi).add(o)),!(this.value===""&&!((t=ye(this,Ur))!=null&&t.hasAttribute(`${ye(this,Hr)}`)))&&((r=ye(this,Ur))==null||r.setAttribute(`${ye(this,Hr)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>ye(this,zi).delete(r)),(t=ye(this,Ur))==null||t.setAttribute(`${ye(this,Hr)}`,`${this.value}`)}contains(e){return ye(this,Ht,ri).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}};Ur=new WeakMap;Hr=new WeakMap;Ja=new WeakMap;zi=new WeakMap;Ht=new WeakSet;ri=function(){return ye(this,zi).size?ye(this,zi):ye(this,Ja)};var of=(i="")=>i.split(/\s+/),Ph=(i="")=>{let[e,t,r]=i.split(":"),o=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?De.CAPTIONS:De.SUBTITLES,language:t,label:o}},Yi=(i="",e={})=>of(i).map(t=>{let r=Ph(t);return{...e,...r}}),Ad=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?Ph(e):e):typeof i=="string"?Yi(i):[i]:[],ja=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,$t=(i=[])=>Array.prototype.map.call(i,ja).join(" "),nf=(i,e)=>t=>t[i]===e,Dh=i=>{let e=Object.entries(i).map(([t,r])=>nf(t,r));return t=>e.every(r=>r(t))},Qi=(i,e=[],t=[])=>{let r=Ad(t).map(Dh),o=n=>r.some(a=>a(n));Array.from(e).filter(o).forEach(n=>{n.mode=i})},Zi=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Dh(e);return Array.from(i.textTracks).filter(t)},es=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)};var Nh=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)}},Oh="exitFullscreen"in ee?"exitFullscreen":"webkitExitFullscreen"in ee?"webkitExitFullscreen":"webkitCancelFullScreen"in ee?"webkitCancelFullScreen":void 0,Uh=i=>{var e;let{documentElement:t}=i;if(Oh){let r=(e=t==null?void 0:t[Oh])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},yn="fullscreenElement"in ee?"fullscreenElement":"webkitFullscreenElement"in ee?"webkitFullscreenElement":void 0,af=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[yn];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===hh.FULLSCREEN?t:r},Hh=i=>{var e;let{media:t,documentElement:r,fullscreenElement:o=t}=i;if(!t||!r)return!1;let n=af(i);if(!n)return!1;if(n===o||n===t)return!0;if(n.localName.includes("-")){let a=n.shadowRoot;if(!(yn in a))return we(n,o);for(;a!=null&&a[yn];){if(a[yn]===o)return!0;a=(e=a[yn])==null?void 0:e.shadowRoot}}return!1},sf="fullscreenEnabled"in ee?"fullscreenEnabled":"webkitFullscreenEnabled"in ee?"webkitFullscreenEnabled":void 0,$h=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[sf])||t&&"webkitSupportsFullscreen"in t};var ts,Sd=()=>{var i,e;return ts||(ts=(e=(i=ee)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),ts)},Bh=async(i=Sd())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([lf(i,t.signal),df(i,e)]);return t.abort(),r},lf=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),df=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await Na(10)}return i.volume!==e},cf=/.*Version\/.*Safari\/.*/.test(c.navigator.userAgent),kd=(i=Sd())=>c.matchMedia("(display-mode: standalone)").matches&&cf?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Ld=(i=Sd())=>$h({documentElement:ee,media:i}),Vh=Ld(),Wh=kd(),Fh=!!c.WebKitPlaybackTargetAvailabilityEvent,Kh=!!c.chrome;var $r=i=>Zi(i.media,e=>[De.SUBTITLES,De.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Cd=i=>Zi(i.media,e=>e.mode===ti.SHOWING&&[De.SUBTITLES,De.CAPTIONS].includes(e.kind)),is=(i,e)=>{let t=$r(i),r=Cd(i),o=!!r.length;if(t.length){if(e===!1||o&&e!==!0)Qi(ti.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"),m=h?[h,...globalThis.navigator.languages]:globalThis.navigator.languages,T=t.filter(p=>m.some(A=>p.language.toLowerCase().startsWith(A.split("-")[0]))).sort((p,A)=>{let E=m.findIndex(k=>p.language.toLowerCase().startsWith(k.split("-")[0])),_=m.findIndex(k=>A.language.toLowerCase().startsWith(k.split("-")[0]));return E-_});T[0]&&(n=T[0])}let{language:l,label:d,kind:v}=n;Qi(ti.DISABLED,t,r),Qi(ti.SHOWING,t,[{language:l,label:d,kind:v}])}}},rs=(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)?uf(i,e):Object.entries(i).every(([t,r])=>t in e&&rs(r,e[t])),uf=(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)=>rs(o,e[n])):!0};var hf=Object.values(et),os,pf=Bh().then(i=>(os=i,os)),Gh=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))}))},mf=new c.DOMParser,vf=i=>i&&(mf.parseFromString(i,"text/html").body.textContent||i),Br={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";Br.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;Br.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||!xr(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=[et.LIVE,et.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:o}=e;if(hf.includes(o))return o===et.UNKNOWN?r:o;let n=e.duration;return n===1/0?et.LIVE:Number.isFinite(n)?et.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=Br.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===et.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(!(Br.mediaStreamType.get(i)===et.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 $r(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&&![De.CAPTIONS,De.SUBTITLES].includes((d=l==null?void 0:l.track)==null?void 0:d.kind)||is(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]=Zi(t,{kind:De.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:o,startTime:n,endTime:a})=>({text:vf(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("-")?we(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 Hh(i)},set(i,e,t){var r;i?(Nh(e),t.detail&&((r=e.media)==null||r.focus())):Uh(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(!Vh||!Ld(e))return Oe.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!Wh||!kd(e))return Oe.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Oe.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(os===!1||(e==null?void 0:e.volume)==null)return Oe.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{os==null&&pf.then(e=>i(e?void 0:Oe.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!Kh||!((t=r==null?void 0:r.remote)!=null&&t.state))return Oe.UNSUPPORTED;if(!(e==null||e==="available"))return Oe.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(!Fh)return Oe.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Oe.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 Oe.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return Oe.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var qh={[b.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,o,n;let{media:a}=e,l=t??void 0,d,v;if(a&&l!=null){let[p]=Zi(a,{kind:De.METADATA,label:"thumbnails"}),A=Array.prototype.find.call((r=p==null?void 0:p.cues)!=null?r:[],(E,_,k)=>_===0?E.endTime>l:_===k.length-1?E.startTime<=l:E.startTime<=l&&E.endTime>l);if(A){let E=/'^(?:[a-z]+:)?\/\//i.test(A.text)||(o=a==null?void 0:a.querySelector('track[label="thumbnails"]'))==null?void 0:o.src,_=new URL(A.text,E);v=new URLSearchParams(_.hash).get("#xywh").split(",").map(ie=>+ie),d=_.href}}let h=i.mediaDuration.get(e),T=(n=i.mediaChaptersCues.get(e).find((p,A,E)=>A===E.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&&T==null&&(T=""),{mediaPreviewTime:l,mediaPreviewImage:d,mediaPreviewCoords:v,mediaPreviewChapter:T}},[b.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[b.MEDIA_PLAY_REQUEST](i,e){var t,r,o,n;let a="mediaPaused",d=i.mediaStreamType.get(e)===et.LIVE,v=!((t=e.options)!=null&&t.noAutoSeekToLive),h=i.mediaTargetLiveWindow.get(e)>0;if(d&&v&&!h){let m=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(m){let T=(n=(o=e.options)==null?void 0:o.seekToLiveOffset)!=null?n:0,p=m-T;i.mediaCurrentTime.set(p,e)}}i[a].set(!1,e)},[b.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",o=t;i[r].set(o,e)},[b.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[b.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[b.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",o=!!t;return i[r].set(o,e),{mediaLoop:o}},[b.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)},[b.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",o=t;i[r].set(o,e)},[b.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)},[b.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:o}=e,n=$r(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),Qi(ti.SHOWING,n,a)},[b.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=$r(e),o=t??[];Qi(ti.DISABLED,r,o)},[b.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){is(e,t)},[b.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",o=t;i[r].set(o,e)},[b.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",o=t;i[r].set(o,e)},[b.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[b.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)},[b.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[b.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[b.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var zh=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Br,requestMap:o=qh,options:n={},monitorStateOwnersOnlyWithSubscriptions:a=!0})=>{let l=[],d={options:{...n}},v=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),h=E=>{E!=null&&(rs(E,v)||(v=Object.freeze({...v,...E}),l.forEach(_=>_(v))))},m=()=>{let E=Object.entries(r).reduce((_,[k,{get:ie}])=>(_[k]=ie(d),_),{});h(E)},T={},p,A=async(E,_)=>{var k,ie,ke,Le,Tr,mu,Gl,C,K,de,re,z,fe,Dt,Wo,vu;let ev=!!p;if(p={...d,...p??{},...E},ev)return;await Gh(...Object.values(E));let Ar=l.length>0&&_===0&&a,fu=d.media!==p.media,Eu=((k=d.media)==null?void 0:k.textTracks)!==((ie=p.media)==null?void 0:ie.textTracks),gu=((ke=d.media)==null?void 0:ke.videoRenditions)!==((Le=p.media)==null?void 0:Le.videoRenditions),bu=((Tr=d.media)==null?void 0:Tr.audioTracks)!==((mu=p.media)==null?void 0:mu.audioTracks),_u=((Gl=d.media)==null?void 0:Gl.remote)!==((C=p.media)==null?void 0:C.remote),yu=d.documentElement!==p.documentElement,Tu=!!d.media&&(fu||Ar),Au=!!((K=d.media)!=null&&K.textTracks)&&(Eu||Ar),Su=!!((de=d.media)!=null&&de.videoRenditions)&&(gu||Ar),ku=!!((re=d.media)!=null&&re.audioTracks)&&(bu||Ar),Lu=!!((z=d.media)!=null&&z.remote)&&(_u||Ar),Cu=!!d.documentElement&&(yu||Ar),ql=Tu||Au||Su||ku||Lu||Cu,Sr=l.length===0&&_===1&&a,I=!!p.media&&(fu||Sr),Iu=!!((fe=p.media)!=null&&fe.textTracks)&&(Eu||Sr),wu=!!((Dt=p.media)!=null&&Dt.videoRenditions)&&(gu||Sr),Mu=!!((Wo=p.media)!=null&&Wo.audioTracks)&&(bu||Sr),Ru=!!((vu=p.media)!=null&&vu.remote)&&(_u||Sr),xu=!!p.documentElement&&(yu||Sr),Pu=I||Iu||wu||Mu||Ru||xu;if(!(ql||Pu)){Object.entries(p).forEach(([Y,Fo])=>{d[Y]=Fo}),m(),p=void 0;return}Object.entries(r).forEach(([Y,{get:Fo,mediaEvents:tv=[],textTracksEvents:iv=[],videoRenditionsEvents:rv=[],audioTracksEvents:ov=[],remoteEvents:nv=[],rootEvents:av=[],stateOwnersUpdateHandlers:sv=[]}])=>{T[Y]||(T[Y]={});let Be=oe=>{let pe=Fo(d,oe);h({[Y]:pe})},be;be=T[Y].mediaEvents,tv.forEach(oe=>{be&&Tu&&(d.media.removeEventListener(oe,be),T[Y].mediaEvents=void 0),I&&(p.media.addEventListener(oe,Be),T[Y].mediaEvents=Be)}),be=T[Y].textTracksEvents,iv.forEach(oe=>{var pe,je;be&&Au&&((pe=d.media.textTracks)==null||pe.removeEventListener(oe,be),T[Y].textTracksEvents=void 0),Iu&&((je=p.media.textTracks)==null||je.addEventListener(oe,Be),T[Y].textTracksEvents=Be)}),be=T[Y].videoRenditionsEvents,rv.forEach(oe=>{var pe,je;be&&Su&&((pe=d.media.videoRenditions)==null||pe.removeEventListener(oe,be),T[Y].videoRenditionsEvents=void 0),wu&&((je=p.media.videoRenditions)==null||je.addEventListener(oe,Be),T[Y].videoRenditionsEvents=Be)}),be=T[Y].audioTracksEvents,ov.forEach(oe=>{var pe,je;be&&ku&&((pe=d.media.audioTracks)==null||pe.removeEventListener(oe,be),T[Y].audioTracksEvents=void 0),Mu&&((je=p.media.audioTracks)==null||je.addEventListener(oe,Be),T[Y].audioTracksEvents=Be)}),be=T[Y].remoteEvents,nv.forEach(oe=>{var pe,je;be&&Lu&&((pe=d.media.remote)==null||pe.removeEventListener(oe,be),T[Y].remoteEvents=void 0),Ru&&((je=p.media.remote)==null||je.addEventListener(oe,Be),T[Y].remoteEvents=Be)}),be=T[Y].rootEvents,av.forEach(oe=>{be&&Cu&&(d.documentElement.removeEventListener(oe,be),T[Y].rootEvents=void 0),xu&&(p.documentElement.addEventListener(oe,Be),T[Y].rootEvents=Be)});let Ta=T[Y].stateOwnersUpdateHandlers;if(Ta&&ql&&(Array.isArray(Ta)?Ta:[Ta]).forEach(pe=>{typeof pe=="function"&&pe()}),Pu){let oe=sv.map(pe=>pe(Be,p)).filter(pe=>typeof pe=="function");T[Y].stateOwnersUpdateHandlers=oe.length===1?oe[0]:oe}else ql&&(T[Y].stateOwnersUpdateHandlers=void 0)}),Object.entries(p).forEach(([Y,Fo])=>{d[Y]=Fo}),m(),p=void 0};return A({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(E){let{type:_,detail:k}=E;if(o[_]&&v.mediaErrorCode==null){h(o[_](r,d,E));return}_==="mediaelementchangerequest"?A({media:k}):_==="fullscreenelementchangerequest"?A({fullscreenElement:k}):_==="documentelementchangerequest"?A({documentElement:k}):_==="optionschangerequest"&&(Object.entries(k??{}).forEach(([ie,ke])=>{d.options[ie]=ke}),m())},getState(){return v},subscribe(E){return A({},l.length+1),l.push(E),E(v),()=>{let _=l.indexOf(E);_>=0&&(A({},l.length-1),l.splice(_,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)},ct=(i,e,t,r)=>(Pd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ht=(i,e,t)=>(Pd(i,e,"access private method"),t),ni,Tn,V,Ji,An,ut,ns,Sn,as,Id,ji,Vr,ss,wd,Md,ep,tp=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],Yh=10,Qh=.025,Zh=.25,ff=.25,Ef=2,y={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 qi{constructor(){super(),ze(this,as),ze(this,ji),ze(this,ss),ze(this,Md),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,ze(this,ni,new oi(this,y.HOTKEYS)),ze(this,Tn,void 0),ze(this,V,void 0),ze(this,Ji,null),ze(this,An,void 0),ze(this,ut,void 0),ze(this,ns,t=>{var r;(r=R(this,V))==null||r.dispatch(t)}),ze(this,Sn,void 0),this.associateElement(this);let e={};ct(this,An,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(uh[n],{composed:!0,detail:o});this.dispatchEvent(a)}),e=t}),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(y.NO_HOTKEYS,y.HOTKEYS,y.DEFAULT_STREAM_TYPE,y.DEFAULT_SUBTITLES,y.DEFAULT_DURATION,y.NO_MUTED_PREF,y.NO_VOLUME_PREF,y.LANG,y.LOOP)}get mediaStore(){return R(this,V)}set mediaStore(e){var t,r;if(R(this,V)&&((t=R(this,ut))==null||t.call(this),ct(this,ut,void 0)),ct(this,V,e),!R(this,V)&&!this.hasAttribute(y.NO_DEFAULT_STORE)){ht(this,as,Id).call(this);return}ct(this,ut,(r=R(this,V))==null?void 0:r.subscribe(R(this,An)))}get fullscreenElement(){var e;return(e=R(this,Tn))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(y.FULLSCREEN_ELEMENT)&&this.removeAttribute(y.FULLSCREEN_ELEMENT),ct(this,Tn,e),(t=R(this,V))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return w(this,y.DEFAULT_SUBTITLES)}set defaultSubtitles(e){M(this,y.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return D(this,y.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){O(this,y.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return H(this,y.DEFAULT_DURATION)}set defaultDuration(e){B(this,y.DEFAULT_DURATION,e)}get noHotkeys(){return w(this,y.NO_HOTKEYS)}set noHotkeys(e){M(this,y.NO_HOTKEYS,e)}get keysUsed(){return D(this,y.KEYS_USED)}set keysUsed(e){O(this,y.KEYS_USED,e)}get liveEdgeOffset(){return H(this,y.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){B(this,y.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return w(this,y.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){M(this,y.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return w(this,y.NO_VOLUME_PREF)}set noVolumePref(e){M(this,y.NO_VOLUME_PREF,e)}get noMutedPref(){return w(this,y.NO_MUTED_PREF)}set noMutedPref(e){M(this,y.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return w(this,y.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){M(this,y.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return w(this,y.NO_DEFAULT_STORE)}set noDefaultStore(e){M(this,y.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var o,n,a,l,d,v,h,m,T,p,A,E;if(super.attributeChangedCallback(e,t,r),e===y.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(y.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===y.HOTKEYS)R(this,ni).value=r;else if(e===y.DEFAULT_SUBTITLES&&r!==t)(o=R(this,V))==null||o.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES)}});else if(e===y.DEFAULT_STREAM_TYPE)(a=R(this,V))==null||a.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===y.LIVE_EDGE_OFFSET)(l=R(this,V))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(y.LIVE_EDGE_OFFSET)}});else if(e===y.SEEK_TO_LIVE_OFFSET)(d=R(this,V))==null||d.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===y.NO_AUTO_SEEK_TO_LIVE)(v=R(this,V))==null||v.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE)}});else if(e===y.FULLSCREEN_ELEMENT){let _=r?(h=this.getRootNode())==null?void 0:h.getElementById(r):void 0;ct(this,Tn,_),(m=R(this,V))==null||m.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===y.LANG&&r!==t?(_h(r),(T=R(this,V))==null||T.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===y.LOOP&&r!==t?(p=R(this,V))==null||p.dispatch({type:b.MEDIA_LOOP_REQUEST,detail:r!=null}):e===y.NO_VOLUME_PREF&&r!==t?(A=R(this,V))==null||A.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF)}}):e===y.NO_MUTED_PREF&&r!==t&&((E=R(this,V))==null||E.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(y.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!R(this,V)&&!this.hasAttribute(y.NO_DEFAULT_STORE)&&ht(this,as,Id).call(this),(e=R(this,V))==null||e.dispatch({type:"documentelementchangerequest",detail:ee}),super.connectedCallback(),R(this,V)&&!R(this,ut)&&ct(this,ut,(t=R(this,V))==null?void 0:t.subscribe(R(this,An))),R(this,Sn)!==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:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:R(this,Sn)}))},0),this.hasAttribute(y.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();ct(this,Sn,!!((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:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}R(this,ut)&&((n=R(this,ut))==null||n.call(this),ct(this,ut,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){jh(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=Af(e,r,o);Object.values(b).forEach(a=>{e.addEventListener(a,R(this,ns))}),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(b).forEach(o=>{e.removeEventListener(o,R(this,ns))})}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])=>{jh([e],o,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",ht(this,ss,wd))}disableHotkeys(){this.removeEventListener("keydown",ht(this,ss,wd)),this.removeEventListener("keyup",ht(this,ji,Vr))}get hotkeys(){return D(this,y.HOTKEYS)}set hotkeys(e){O(this,y.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,o,n,a,l,d,v,h;let m=e.target;if(((o=(r=(t=m.getAttribute(y.KEYS_USED))==null?void 0:t.split(" "))!=null?r:m==null?void 0:m.keysUsed)!=null?o:[]).map(k=>k==="Space"?" ":k).filter(Boolean).includes(e.key))return;let p,A,E;if(!(R(this,ni).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&R(this,ni).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&R(this,ni).contains("noshift+/")))switch(e.key){case" ":case"k":p=R(this,V).getState().mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new c.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"m":p=this.mediaStore.getState().mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST,this.dispatchEvent(new c.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"f":p=this.mediaStore.getState().mediaIsFullscreen?b.MEDIA_EXIT_FULLSCREEN_REQUEST:b.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new c.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new c.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let k=this.hasAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET):Yh;A=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-k,0),E=new c.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(E);break}case"ArrowRight":case"l":{let k=this.hasAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET):Yh;A=Math.max(((a=this.mediaStore.getState().mediaCurrentTime)!=null?a:0)+k,0),E=new c.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(E);break}case"ArrowUp":{let k=this.hasAttribute(y.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_UP_VOLUME_STEP):Qh;A=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+k,1),E=new c.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(E);break}case"ArrowDown":{let k=this.hasAttribute(y.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_DOWN_VOLUME_STEP):Qh;A=Math.max(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)-k,0),E=new c.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(E);break}case"<":{let k=(v=this.mediaStore.getState().mediaPlaybackRate)!=null?v:1;A=Math.max(k-Zh,ff).toFixed(2),E=new c.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(E);break}case">":{let k=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;A=Math.min(k+Zh,Ef).toFixed(2),E=new c.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(E);break}case"/":case"?":{e.shiftKey&&ht(this,Md,ep).call(this);break}case"p":{p=this.mediaStore.getState().mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST,E=new c.CustomEvent(p,{composed:!0,bubbles:!0}),this.dispatchEvent(E);break}default:break}}};ni=new WeakMap;Tn=new WeakMap;V=new WeakMap;Ji=new WeakMap;An=new WeakMap;ut=new WeakMap;ns=new WeakMap;Sn=new WeakMap;as=new WeakSet;Id=function(){var i;this.mediaStore=zh({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(y.DEFAULT_DURATION)?+this.getAttribute(y.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(y.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(y.NO_SUBTITLES_LANG_PREF)}})};ji=new WeakSet;Vr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||tp.includes(e))){this.removeEventListener("keyup",ht(this,ji,Vr));return}this.keyboardShortcutHandler(i)};ss=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,Ji))!=null&&e.open)){this.removeEventListener("keyup",ht(this,ji,Vr));return}if(t||r||!a&&!tp.includes(o)){this.removeEventListener("keyup",ht(this,ji,Vr));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,ni).contains(`no${o.toLowerCase()}`)||o===" "&&R(this,ni).contains("nospace"))&&!d&&i.preventDefault(),this.addEventListener("keyup",ht(this,ji,Vr),{once:!0})};Md=new WeakSet;ep=function(){R(this,Ji)||(ct(this,Ji,ee.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(R(this,Ji))),R(this,Ji).open=!0};var gf=Object.values(s),bf=Object.values(pd),ip=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=>gf.includes(l)):[]},_f=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),bf.some(r=>r in i)},xd=i=>_f(i)||!!ip(i).length,Xh=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Jh={[s.MEDIA_SUBTITLES_LIST]:$t,[s.MEDIA_SUBTITLES_SHOWING]:$t,[s.MEDIA_SEEKABLE]:Xh,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Xh).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:ph,[s.MEDIA_AUDIO_TRACK_LIST]:vh},yf=async(i,e,t)=>{var r,o;if(i.isConnected||await Na(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=Jh[e])==null?void 0:r.call(Jh,t))!=null?o:t;return i.setAttribute(e,n)},Tf=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Xi=(i,e)=>{if(Tf(i))return;let t=(o,n)=>{var a,l;xd(o)&&n(o);let{children:d=[]}=o??{},v=(l=(a=o==null?void 0:o.shadowRoot)==null?void 0:a.children)!=null?l:[];[...d,...v].forEach(m=>Xi(m,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)},jh=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let o=ip(r),n=e.toLowerCase();o.includes(n)&&yf(r,n,t)})},Af=(i,e,t)=>{Xi(i,e);let r=h=>{var m;let T=(m=h==null?void 0:h.composedPath()[0])!=null?m:h.target;e(T)},o=h=>{var m;let T=(m=h==null?void 0:h.composedPath()[0])!=null?m:h.target;t(T)};i.addEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o);let n=h=>{h.forEach(m=>{let{addedNodes:T=[],removedNodes:p=[],type:A,target:E,attributeName:_}=m;A==="childList"?(Array.prototype.forEach.call(T,k=>Xi(k,e)),Array.prototype.forEach.call(p,k=>Xi(k,t))):A==="attributes"&&_===N.MEDIA_CHROME_ATTRIBUTES&&(xd(E)?e(E):t(E))})},a=[],l=h=>{let m=h.target;m.name!=="media"&&(a.forEach(T=>Xi(T,t)),a=[...m.assignedElements({flatten:!0})],a.forEach(T=>Xi(T,e)))};i.addEventListener("slotchange",l);let d=new MutationObserver(n);return d.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Xi(i,t),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};c.customElements.get("media-controller")||c.customElements.define("media-controller",Rd);var Wr={PLACEMENT:"placement",BOUNDS:"bounds"};function Sf(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 Ir=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Sa(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=at(this,"#"+this.bounds))!=null?e:Z(this);if(!o)return;let{x:n,width:a}=o.getBoundingClientRect(),{x:l,width:c}=this.getBoundingClientRect(),v=l+c,h=n+a,p=r.getPropertyValue("--media-tooltip-offset-x"),f=p?parseFloat(p.replace("px","")):0,m=r.getPropertyValue("--media-tooltip-container-margin"),A=m?parseFloat(m.replace("px","")):0,g=l-n+f-A,L=v-h+f+A;if(g<0){this.style.setProperty("--media-tooltip-offset-x",`${g}px`);return}if(L>0){this.style.setProperty("--media-tooltip-offset-x",`${L}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[Cr.PLACEMENT,Cr.BOUNDS]}get placement(){return x(this,Cr.PLACEMENT)}set placement(e){P(this,Cr.PLACEMENT,e)}get bounds(){return x(this,Cr.BOUNDS)}set bounds(e){P(this,Cr.BOUNDS,e)}};Ir.shadowRootOptions={mode:"open"};Ir.getTemplateHTML=ef;d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",Ir);var Fa=Ir;var dd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ue=(i,e,t)=>(dd(i,e,"read from private field"),t?t.call(i):e.get(i)),Mr=(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)},Ka=(i,e,t,r)=>(dd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),tf=(i,e,t)=>(dd(i,e,"access private method"),t),ct,xr,ei,Rr,qa,ld,xh,jt={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function rf(i,e={}){return`
503
+ `}var Fr=class extends c.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Fa(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=dt(this,"#"+this.bounds))!=null?e:X(this);if(!o)return;let{x:n,width:a}=o.getBoundingClientRect(),{x:l,width:d}=this.getBoundingClientRect(),v=l+d,h=n+a,m=r.getPropertyValue("--media-tooltip-offset-x"),T=m?parseFloat(m.replace("px","")):0,p=r.getPropertyValue("--media-tooltip-container-margin"),A=p?parseFloat(p.replace("px","")):0,E=l-n+T-A,_=v-h+T+A;if(E<0){this.style.setProperty("--media-tooltip-offset-x",`${E}px`);return}if(_>0){this.style.setProperty("--media-tooltip-offset-x",`${_}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[Wr.PLACEMENT,Wr.BOUNDS]}get placement(){return D(this,Wr.PLACEMENT)}set placement(e){O(this,Wr.PLACEMENT,e)}get bounds(){return D(this,Wr.BOUNDS)}set bounds(e){O(this,Wr.BOUNDS,e)}};Fr.shadowRootOptions={mode:"open"};Fr.getTemplateHTML=Sf;c.customElements.get("media-tooltip")||c.customElements.define("media-tooltip",Fr);var ls=Fr;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)),Kr=(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)},ds=(i,e,t,r)=>(Od(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),kf=(i,e,t)=>(Od(i,e,"access private method"),t),pt,qr,si,Gr,cs,Dd,rp,ai={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Lf(i,e={}){return`
504
504
  <style>
505
505
  :host {
506
506
  position: relative;
@@ -574,20 +574,20 @@ bp-player[has-error] {
574
574
 
575
575
  <slot name="tooltip">
576
576
  <media-tooltip part="tooltip" aria-hidden="true">
577
- <template shadowrootmode="${Fa.shadowRootOptions.mode}">
578
- ${Fa.getTemplateHTML({})}
577
+ <template shadowrootmode="${ls.shadowRootOptions.mode}">
578
+ ${ls.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 of(i,e){return`
585
+ `}function Cf(i,e){return`
586
586
  <slot></slot>
587
- `}function nf(){return""}var F=class extends d.HTMLElement{constructor(){if(super(),Mr(this,ld),Mr(this,ct,void 0),this.preventClick=!1,this.tooltipEl=null,Mr(this,xr,e=>{this.preventClick||this.handleClick(e),setTimeout(ue(this,ei),0)}),Mr(this,ei,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),Mr(this,Rr,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",ue(this,Rr));return}this.preventClick||this.handleClick(e)}),Mr(this,qa,e=>{let{metaKey:t,altKey:r,key:o}=e;if(t||r||!this.keysUsed.includes(o)){this.removeEventListener("keyup",ue(this,Rr));return}this.addEventListener("keyup",ue(this,Rr),{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",jt.TOOLTIP_PLACEMENT,U.MEDIA_CONTROLLER,s.MEDIA_LANG]}enable(){this.addEventListener("click",ue(this,xr)),this.addEventListener("keydown",ue(this,qa)),this.tabIndex=0}disable(){this.removeEventListener("click",ue(this,xr)),this.removeEventListener("keydown",ue(this,qa)),this.removeEventListener("keyup",ue(this,Rr)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===U.MEDIA_CONTROLLER?(t&&((n=(o=ue(this,ct))==null?void 0:o.unassociateElement)==null||n.call(o,this),Ka(this,ct,null)),r&&this.isConnected&&(Ka(this,ct,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=ue(this,ct))==null?void 0:l.associateElement)==null||c.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===jt.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()),ue(this,ei).call(this)}connectedCallback(){var e,t,r;let{style:o}=X(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(U.MEDIA_CONTROLLER);n&&(Ka(this,ct,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=ue(this,ct))==null?void 0:t.associateElement)==null||r.call(t,this)),d.customElements.whenDefined("media-tooltip").then(()=>tf(this,ld,xh).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=ue(this,ct))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ka(this,ct,null),this.removeEventListener("mouseenter",ue(this,ei)),this.removeEventListener("focus",ue(this,ei)),this.removeEventListener("click",ue(this,xr))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return x(this,jt.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){P(this,jt.TOOLTIP_PLACEMENT,e)}get mediaController(){return x(this,U.MEDIA_CONTROLLER)}set mediaController(e){P(this,U.MEDIA_CONTROLLER,e)}get disabled(){return C(this,jt.DISABLED)}set disabled(e){I(this,jt.DISABLED,e)}get noTooltip(){return C(this,jt.NO_TOOLTIP)}set noTooltip(e){I(this,jt.NO_TOOLTIP,e)}handleClick(e){}};ct=new WeakMap;xr=new WeakMap;ei=new WeakMap;Rr=new WeakMap;qa=new WeakMap;ld=new WeakSet;xh=function(){this.addEventListener("mouseenter",ue(this,ei)),this.addEventListener("focus",ue(this,ei)),this.addEventListener("click",ue(this,xr));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};F.shadowRootOptions={mode:"open"};F.getTemplateHTML=rf;F.getSlotTemplateHTML=of;F.getTooltipContentHTML=nf;d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",F);var Ph=`<svg aria-hidden="true" viewBox="0 0 26 24">
587
+ `}function If(){return""}var F=class extends c.HTMLElement{constructor(){if(super(),Kr(this,Dd),Kr(this,pt,void 0),this.preventClick=!1,this.tooltipEl=null,Kr(this,qr,e=>{this.preventClick||this.handleClick(e),setTimeout(me(this,si),0)}),Kr(this,si,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),Kr(this,Gr,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",me(this,Gr));return}this.preventClick||this.handleClick(e)}),Kr(this,cs,e=>{let{metaKey:t,altKey:r,key:o}=e;if(t||r||!this.keysUsed.includes(o)){this.removeEventListener("keyup",me(this,Gr));return}this.addEventListener("keyup",me(this,Gr),{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",ai.TOOLTIP_PLACEMENT,N.MEDIA_CONTROLLER,s.MEDIA_LANG]}enable(){this.addEventListener("click",me(this,qr)),this.addEventListener("keydown",me(this,cs)),this.tabIndex=0}disable(){this.removeEventListener("click",me(this,qr)),this.removeEventListener("keydown",me(this,cs)),this.removeEventListener("keyup",me(this,Gr)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER?(t&&((n=(o=me(this,pt))==null?void 0:o.unassociateElement)==null||n.call(o,this),ds(this,pt,null)),r&&this.isConnected&&(ds(this,pt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=me(this,pt))==null?void 0:l.associateElement)==null||d.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===ai.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,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&&(ds(this,pt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=me(this,pt))==null?void 0:t.associateElement)==null||r.call(t,this)),c.customElements.whenDefined("media-tooltip").then(()=>kf(this,Dd,rp).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=me(this,pt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ds(this,pt,null),this.removeEventListener("mouseenter",me(this,si)),this.removeEventListener("focus",me(this,si)),this.removeEventListener("click",me(this,qr))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return D(this,ai.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){O(this,ai.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,ai.DISABLED)}set disabled(e){M(this,ai.DISABLED,e)}get noTooltip(){return w(this,ai.NO_TOOLTIP)}set noTooltip(e){M(this,ai.NO_TOOLTIP,e)}handleClick(e){}};pt=new WeakMap;qr=new WeakMap;si=new WeakMap;Gr=new WeakMap;cs=new WeakMap;Dd=new WeakSet;rp=function(){this.addEventListener("mouseenter",me(this,si)),this.addEventListener("focus",me(this,si)),this.addEventListener("click",me(this,qr));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};F.shadowRootOptions={mode:"open"};F.getTemplateHTML=Lf;F.getSlotTemplateHTML=Cf;F.getTooltipContentHTML=If;c.customElements.get("media-chrome-button")||c.customElements.define("media-chrome-button",F);var op=`<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
592
  :host([${s.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
593
593
  display: none !important;
@@ -605,17 +605,17 @@ bp-player[has-error] {
605
605
  </style>
606
606
 
607
607
  <slot name="icon">
608
- <slot name="enter">${Ph}</slot>
609
- <slot name="exit">${Ph}</slot>
608
+ <slot name="enter">${op}</slot>
609
+ <slot name="exit">${op}</slot>
610
610
  </slot>
611
- `}function sf(){return`
612
- <slot name="tooltip-enter">${E("start airplay")}</slot>
613
- <slot name="tooltip-exit">${E("stop airplay")}</slot>
614
- `}var Dh=i=>{let e=i.mediaIsAirplaying?E("stop airplay"):E("start airplay");i.setAttribute("aria-label",e)},ln=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_AIRPLAYING,s.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Dh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_AIRPLAYING&&Dh(this)}get mediaIsAirplaying(){return C(this,s.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){I(this,s.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return x(this,s.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){P(this,s.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(b.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};ln.getSlotTemplateHTML=af;ln.getTooltipContentHTML=sf;d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",ln);var lf=`<svg aria-hidden="true" viewBox="0 0 26 24">
611
+ `}function Mf(){return`
612
+ <slot name="tooltip-enter">${g("start airplay")}</slot>
613
+ <slot name="tooltip-exit">${g("stop airplay")}</slot>
614
+ `}var np=i=>{let e=i.mediaIsAirplaying?g("stop airplay"):g("start airplay");i.setAttribute("aria-label",e)},kn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_AIRPLAYING,s.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),np(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_AIRPLAYING&&np(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(b.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};kn.getSlotTemplateHTML=wf;kn.getTooltipContentHTML=Mf;c.customElements.get("media-airplay-button")||c.customElements.define("media-airplay-button",kn);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>`,df=`<svg aria-hidden="true" viewBox="0 0 26 24">
616
+ </svg>`,xf=`<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 Pf(i){return`
619
619
  <style>
620
620
  :host([aria-checked="true"]) slot[name=off] {
621
621
  display: none !important;
@@ -633,13 +633,13 @@ bp-player[has-error] {
633
633
  </style>
634
634
 
635
635
  <slot name="icon">
636
- <slot name="on">${lf}</slot>
637
- <slot name="off">${df}</slot>
636
+ <slot name="on">${Rf}</slot>
637
+ <slot name="off">${xf}</slot>
638
638
  </slot>
639
- `}function uf(){return`
640
- <slot name="tooltip-enable">${E("Enable captions")}</slot>
641
- <slot name="tooltip-disable">${E("Disable captions")}</slot>
642
- `}var Oh=i=>{i.setAttribute("aria-checked",Oa(i).toString())},dn=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",E("closed captions")),Oh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING&&Oh(this)}get mediaSubtitlesList(){return Uh(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Nh(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Uh(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Nh(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};dn.getSlotTemplateHTML=cf;dn.getTooltipContentHTML=uf;var Uh=(i,e)=>{let t=i.getAttribute(e);return t?$i(t):[]},Nh=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Ot(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",dn);var hf='<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>',pf='<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 mf(i){return`
639
+ `}function Df(){return`
640
+ <slot name="tooltip-enable">${g("Enable captions")}</slot>
641
+ <slot name="tooltip-disable">${g("Disable captions")}</slot>
642
+ `}var ap=i=>{i.setAttribute("aria-checked",es(i).toString())},Ln=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",g("closed captions")),ap(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING&&ap(this)}get mediaSubtitlesList(){return sp(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){lp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return sp(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){lp(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new c.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};Ln.getSlotTemplateHTML=Pf;Ln.getTooltipContentHTML=Df;var sp=(i,e)=>{let t=i.getAttribute(e);return t?Yi(t):[]},lp=(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",Ln);var 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"/></g></svg>',Nf='<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 Uf(i){return`
643
643
  <style>
644
644
  :host([${s.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
645
645
  display: none !important;
@@ -657,13 +657,13 @@ bp-player[has-error] {
657
657
  </style>
658
658
 
659
659
  <slot name="icon">
660
- <slot name="enter">${hf}</slot>
661
- <slot name="exit">${pf}</slot>
660
+ <slot name="enter">${Of}</slot>
661
+ <slot name="exit">${Nf}</slot>
662
662
  </slot>
663
- `}function vf(){return`
664
- <slot name="tooltip-enter">${E("Start casting")}</slot>
665
- <slot name="tooltip-exit">${E("Stop casting")}</slot>
666
- `}var Hh=i=>{let e=i.mediaIsCasting?E("stop casting"):E("start casting");i.setAttribute("aria-label",e)},cn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Hh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_CASTING&&Hh(this)}get mediaIsCasting(){return C(this,s.MEDIA_IS_CASTING)}set mediaIsCasting(e){I(this,s.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return x(this,s.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){P(this,s.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?b.MEDIA_EXIT_CAST_REQUEST:b.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};cn.getSlotTemplateHTML=mf;cn.getTooltipContentHTML=vf;d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",cn);var fd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Gi=(i,e,t)=>(fd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ut=(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)},gd=(i,e,t,r)=>(fd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),qi=(i,e,t)=>(fd(i,e,"access private method"),t),za,hn,zi,Ga,cd,ud,$h,hd,Bh,pd,Vh,md,Wh,vd,Fh;function ff(i){return`
663
+ `}function Hf(){return`
664
+ <slot name="tooltip-enter">${g("Start casting")}</slot>
665
+ <slot name="tooltip-exit">${g("Stop casting")}</slot>
666
+ `}var dp=i=>{let e=i.mediaIsCasting?g("stop casting"):g("start casting");i.setAttribute("aria-label",e)},Cn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),dp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_CASTING&&dp(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?b.MEDIA_EXIT_CAST_REQUEST:b.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Cn.getSlotTemplateHTML=Uf;Cn.getTooltipContentHTML=Hf;c.customElements.get("media-cast-button")||c.customElements.define("media-cast-button",Cn);var Wd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tr=(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),er=(i,e,t)=>(Wd(i,e,"access private method"),t),hs,wn,ir,us,Nd,Ud,cp,Hd,up,$d,hp,Bd,pp,Vd,mp;function $f(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 gf(i){return`
707
+ `}function Bf(i){return`
708
708
  <slot id="content"></slot>
709
- `}var un={OPEN:"open",ANCHOR:"anchor"},ut=class extends d.HTMLElement{constructor(){super(),Ut(this,Ga),Ut(this,ud),Ut(this,hd),Ut(this,pd),Ut(this,md),Ut(this,vd),Ut(this,za,!1),Ut(this,hn,null),Ut(this,zi,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[un.OPEN,un.ANCHOR]}get open(){return C(this,un.OPEN)}set open(e){I(this,un.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":qi(this,pd,Vh).call(this,e);break;case"focusout":qi(this,md,Wh).call(this,e);break;case"keydown":qi(this,vd,Fh).call(this,e);break}}connectedCallback(){qi(this,Ga,cd).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){qi(this,Ga,cd).call(this),e===un.OPEN&&r!==t&&(this.open?qi(this,ud,$h).call(this):qi(this,hd,Bh).call(this))}focus(){gd(this,hn,Zo());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"]}};za=new WeakMap;hn=new WeakMap;zi=new WeakMap;Ga=new WeakSet;cd=function(){if(!Gi(this,za)&&(gd(this,za,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=J(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=X(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};ud=new WeakSet;$h=function(){var i;(i=Gi(this,zi))==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;Bh=function(){var i;(i=Gi(this,zi))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};pd=new WeakSet;Vh=function(i){gd(this,zi,i.relatedTarget),Ae(this,i.relatedTarget)||(this.open=!this.open)};md=new WeakSet;Wh=function(i){var e;Ae(this,i.relatedTarget)||((e=Gi(this,hn))==null||e.focus(),Gi(this,zi)&&Gi(this,zi)!==i.relatedTarget&&this.open&&(this.open=!1))};vd=new WeakSet;Fh=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:c,metaKey:v}=i;l||c||v||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=Gi(this,hn))==null||n.focus(),this.open=!1))};ut.shadowRootOptions={mode:"open"};ut.getTemplateHTML=ff;ut.getSlotTemplateHTML=gf;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",ut);var Sd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oe=(i,e,t)=>(Sd(i,e,"read from private field"),t?t.call(i):e.get(i)),be=(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)},ti=(i,e,t,r)=>(Sd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Je=(i,e,t)=>(Sd(i,e,"access private method"),t),ht,rs,Ya,Qa,je,ts,Za,Xa,Ja,kd,Kh,ja,Ed,es,bd,is,Ld,_d,qh,yd,Gh,Td,zh,Ad,Yh;function Ef(i){return`
709
+ `}var In={OPEN:"open",ANCHOR:"anchor"},mt=class extends c.HTMLElement{constructor(){super(),Bt(this,us),Bt(this,Ud),Bt(this,Hd),Bt(this,$d),Bt(this,Bd),Bt(this,Vd),Bt(this,hs,!1),Bt(this,wn,null),Bt(this,ir,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[In.OPEN,In.ANCHOR]}get open(){return w(this,In.OPEN)}set open(e){M(this,In.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":er(this,$d,hp).call(this,e);break;case"focusout":er(this,Bd,pp).call(this,e);break;case"keydown":er(this,Vd,mp).call(this,e);break}}connectedCallback(){er(this,us,Nd).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){er(this,us,Nd).call(this),e===In.OPEN&&r!==t&&(this.open?er(this,Ud,cp).call(this):er(this,Hd,up).call(this))}focus(){Fd(this,wn,mn());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"]}};hs=new WeakMap;wn=new WeakMap;ir=new WeakMap;us=new WeakSet;Nd=function(){if(!tr(this,hs)&&(Fd(this,hs,!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;cp=function(){var i;(i=tr(this,ir))==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;up=function(){var i;(i=tr(this,ir))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};$d=new WeakSet;hp=function(i){Fd(this,ir,i.relatedTarget),we(this,i.relatedTarget)||(this.open=!this.open)};Bd=new WeakSet;pp=function(i){var e;we(this,i.relatedTarget)||((e=tr(this,wn))==null||e.focus(),tr(this,ir)&&tr(this,ir)!==i.relatedTarget&&this.open&&(this.open=!1))};Vd=new WeakSet;mp=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:d,metaKey:v}=i;l||d||v||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=tr(this,wn))==null||n.focus(),this.open=!1))};mt.shadowRootOptions={mode:"open"};mt.getTemplateHTML=$f;mt.getSlotTemplateHTML=Bf;c.customElements.get("media-chrome-dialog")||c.customElements.define("media-chrome-dialog",mt);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)),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)},li=(i,e,t,r)=>(Zd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),it=(i,e,t)=>(Zd(i,e,"access private method"),t),vt,Ts,ps,ms,rt,_s,vs,fs,Es,Xd,vp,gs,Kd,bs,Gd,ys,Jd,qd,fp,zd,Ep,Yd,gp,Qd,bp;function Vf(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 bf(i){return""}var pt=class extends d.HTMLElement{constructor(){if(super(),be(this,kd),be(this,ja),be(this,es),be(this,is),be(this,_d),be(this,yd),be(this,Td),be(this,Ad),be(this,ht,void 0),be(this,rs,void 0),be(this,Ya,void 0),be(this,Qa,void 0),be(this,je,{}),be(this,ts,[]),be(this,Za,()=>{if(this.range.matches(":focus-visible")){let{style:e}=X(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),be(this,Xa,()=>{let{style:e}=X(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),be(this,Ja,()=>{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"),ti(this,Ya,this.shadowRoot.querySelector("#startpoint")),ti(this,Qa,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",U.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===U.MEDIA_CONTROLLER?(t&&((n=(o=oe(this,ht))==null?void 0:o.unassociateElement)==null||n.call(o,this),ti(this,ht,null)),r&&this.isConnected&&(ti(this,ht,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=oe(this,ht))==null?void 0:l.associateElement)==null||c.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),Je(this,ja,Ed).call(this)):(this.range.setAttribute(e,r),Je(this,es,bd).call(this)))}connectedCallback(){var e,t,r;let{style:o}=X(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),oe(this,je).pointer=X(this.shadowRoot,"#pointer"),oe(this,je).progress=X(this.shadowRoot,"#progress"),oe(this,je).thumb=X(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),oe(this,je).activeSegment=X(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(U.MEDIA_CONTROLLER);n&&(ti(this,ht,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=oe(this,ht))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",oe(this,Za)),this.shadowRoot.addEventListener("focusout",oe(this,Xa)),Je(this,ja,Ed).call(this),xt(this.container,oe(this,Ja))}disconnectedCallback(){var e,t;Je(this,es,bd).call(this),(t=(e=oe(this,ht))==null?void 0:e.unassociateElement)==null||t.call(e,this),ti(this,ht,null),this.shadowRoot.removeEventListener("focusin",oe(this,Za)),this.shadowRoot.removeEventListener("focusout",oe(this,Xa)),Pt(this.container,oe(this,Ja))}updatePointerBar(e){var t;(t=oe(this,je).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=oe(this,je).progress)==null||e.style.setProperty("width",`${r}%`),(t=oe(this,je).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])];ti(this,ts,[...r]);let o=r.pop();for(let[n,a]of r.entries()){let[l,c]=[n===0,n===r.length-1],v=l?"calc(var(--segments-gap) / -1)":`${a*100}%`,p=`calc(${((c?o:r[n+1])-a)*100}%${l||c?"":" - var(--segments-gap)"})`,f=j.createElementNS("http://www.w3.org/2000/svg","rect"),m=Xo(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);m.style.setProperty("x",v),m.style.setProperty("width",p),t.append(f)}}getPointerRatio(e){return th(e.clientX,e.clientY,oe(this,Ya).getBoundingClientRect(),oe(this,Qa).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Je(this,Ad,Yh).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Je(this,_d,qh).call(this,e);break;case"pointerdown":Je(this,is,Ld).call(this,e);break;case"pointerup":Je(this,yd,Gh).call(this);break;case"pointerleave":Je(this,Td,zh).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};ht=new WeakMap;rs=new WeakMap;Ya=new WeakMap;Qa=new WeakMap;je=new WeakMap;ts=new WeakMap;Za=new WeakMap;Xa=new WeakMap;Ja=new WeakMap;kd=new WeakSet;Kh=function(i){let e=oe(this,je).activeSegment;if(!e)return;let t=this.getPointerRatio(i),o=`#segments-clipping rect:nth-child(${oe(this,ts).findIndex((n,a,l)=>{let c=l[a+1];return c!=null&&t>=n&&t<=c})+1})`;(e.selectorText!=o||!e.style.transform)&&(e.selectorText=o,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};ja=new WeakSet;Ed=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};es=new WeakSet;bd=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=d.window)==null||i.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};is=new WeakSet;Ld=function(i){var e;ti(this,rs,i.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};_d=new WeakSet;qh=function(i){var e;i.pointerType!=="mouse"&&Je(this,is,Ld).call(this,i),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};yd=new WeakSet;Gh=function(){var i;(i=d.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};Td=new WeakSet;zh=function(){var i,e;this.removeEventListener("pointerleave",this),(i=d.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=oe(this,je).activeSegment)==null||e.style.removeProperty("transform")};Ad=new WeakSet;Yh=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),Je(this,kd,Kh).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!oe(this,rs))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};pt.shadowRootOptions={mode:"open"};pt.getTemplateHTML=Ef;pt.getContainerTemplateHTML=bf;d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",pt);var Qh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},os=(i,e,t)=>(Qh(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)},ns=(i,e,t,r)=>(Qh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),mt;function yf(i){return`
939
+ `}function Wf(i){return""}var ft=class extends c.HTMLElement{constructor(){if(super(),Ae(this,Xd),Ae(this,gs),Ae(this,bs),Ae(this,ys),Ae(this,qd),Ae(this,zd),Ae(this,Yd),Ae(this,Qd),Ae(this,vt,void 0),Ae(this,Ts,void 0),Ae(this,ps,void 0),Ae(this,ms,void 0),Ae(this,rt,{}),Ae(this,_s,[]),Ae(this,vs,()=>{if(this.range.matches(":focus-visible")){let{style:e}=J(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),Ae(this,fs,()=>{let{style:e}=J(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),Ae(this,Es,()=>{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"),li(this,ps,this.shadowRoot.querySelector("#startpoint")),li(this,ms,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,vt))==null?void 0:o.unassociateElement)==null||n.call(o,this),li(this,vt,null)),r&&this.isConnected&&(li(this,vt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=se(this,vt))==null?void 0:l.associateElement)==null||d.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),it(this,gs,Kd).call(this)):(this.range.setAttribute(e,r),it(this,bs,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,rt).pointer=J(this.shadowRoot,"#pointer"),se(this,rt).progress=J(this.shadowRoot,"#progress"),se(this,rt).thumb=J(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),se(this,rt).activeSegment=J(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(li(this,vt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=se(this,vt))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",se(this,vs)),this.shadowRoot.addEventListener("focusout",se(this,fs)),it(this,gs,Kd).call(this),Nt(this.container,se(this,Es))}disconnectedCallback(){var e,t;it(this,bs,Gd).call(this),(t=(e=se(this,vt))==null?void 0:e.unassociateElement)==null||t.call(e,this),li(this,vt,null),this.shadowRoot.removeEventListener("focusin",se(this,vs)),this.shadowRoot.removeEventListener("focusout",se(this,fs)),Ut(this.container,se(this,Es))}updatePointerBar(e){var t;(t=se(this,rt).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=se(this,rt).progress)==null||e.style.setProperty("width",`${r}%`),(t=se(this,rt).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])];li(this,_s,[...r]);let o=r.pop();for(let[n,a]of r.entries()){let[l,d]=[n===0,n===r.length-1],v=l?"calc(var(--segments-gap) / -1)":`${a*100}%`,m=`calc(${((d?o:r[n+1])-a)*100}%${l||d?"":" - var(--segments-gap)"})`,T=ee.createElementNS("http://www.w3.org/2000/svg","rect"),p=vn(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);p.style.setProperty("x",v),p.style.setProperty("width",m),t.append(T)}}getPointerRatio(e){return Lh(e.clientX,e.clientY,se(this,ps).getBoundingClientRect(),se(this,ms).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":it(this,Qd,bp).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":it(this,qd,fp).call(this,e);break;case"pointerdown":it(this,ys,Jd).call(this,e);break;case"pointerup":it(this,zd,Ep).call(this);break;case"pointerleave":it(this,Yd,gp).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};vt=new WeakMap;Ts=new WeakMap;ps=new WeakMap;ms=new WeakMap;rt=new WeakMap;_s=new WeakMap;vs=new WeakMap;fs=new WeakMap;Es=new WeakMap;Xd=new WeakSet;vp=function(i){let e=se(this,rt).activeSegment;if(!e)return;let t=this.getPointerRatio(i),o=`#segments-clipping rect:nth-child(${se(this,_s).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))"))};gs=new WeakSet;Kd=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};bs=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)};ys=new WeakSet;Jd=function(i){var e;li(this,Ts,i.composedPath().includes(this.range)),(e=c.window)==null||e.addEventListener("pointerup",this)};qd=new WeakSet;fp=function(i){var e;i.pointerType!=="mouse"&&it(this,ys,Jd).call(this,i),this.addEventListener("pointerleave",this),(e=c.window)==null||e.addEventListener("pointermove",this)};zd=new WeakSet;Ep=function(){var i;(i=c.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};Yd=new WeakSet;gp=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,rt).activeSegment)==null||e.style.removeProperty("transform")};Qd=new WeakSet;bp=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),it(this,Xd,vp).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!se(this,Ts))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};ft.shadowRootOptions={mode:"open"};ft.getTemplateHTML=Vf;ft.getContainerTemplateHTML=Wf;c.customElements.get("media-chrome-range")||c.customElements.define("media-chrome-range",ft);var _p=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},As=(i,e,t)=>(_p(i,e,"read from private field"),t?t.call(i):e.get(i)),Ff=(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)},Ss=(i,e,t,r)=>(_p(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Et;function Kf(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 pn=class extends d.HTMLElement{constructor(){if(super(),_f(this,mt,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[U.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===U.MEDIA_CONTROLLER&&(t&&((n=(o=os(this,mt))==null?void 0:o.unassociateElement)==null||n.call(o,this),ns(this,mt,null)),r&&this.isConnected&&(ns(this,mt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=os(this,mt))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(U.MEDIA_CONTROLLER);o&&(ns(this,mt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=os(this,mt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=os(this,mt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ns(this,mt,null)}};mt=new WeakMap;pn.shadowRootOptions={mode:"open"};pn.getTemplateHTML=yf;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",pn);var Zh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},as=(i,e,t)=>(Zh(i,e,"read from private field"),t?t.call(i):e.get(i)),Tf=(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)},ss=(i,e,t,r)=>(Zh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),vt;function Af(i,e={}){return`
965
+ `}var Mn=class extends c.HTMLElement{constructor(){if(super(),Ff(this,Et,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=As(this,Et))==null?void 0:o.unassociateElement)==null||n.call(o,this),Ss(this,Et,null)),r&&this.isConnected&&(Ss(this,Et,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=As(this,Et))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(Ss(this,Et,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=As(this,Et))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=As(this,Et))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ss(this,Et,null)}};Et=new WeakMap;Mn.shadowRootOptions={mode:"open"};Mn.getTemplateHTML=Kf;c.customElements.get("media-control-bar")||c.customElements.define("media-control-bar",Mn);var yp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ks=(i,e,t)=>(yp(i,e,"read from private field"),t?t.call(i):e.get(i)),Gf=(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)},Ls=(i,e,t,r)=>(yp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),gt;function qf(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 Sf(i,e){return`
999
+ `}function zf(i,e){return`
1000
1000
  <slot></slot>
1001
- `}var xe=class extends d.HTMLElement{constructor(){if(super(),Tf(this,vt,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[U.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===U.MEDIA_CONTROLLER&&(t&&((n=(o=as(this,vt))==null?void 0:o.unassociateElement)==null||n.call(o,this),ss(this,vt,null)),r&&this.isConnected&&(ss(this,vt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=as(this,vt))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let{style:o}=X(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(U.MEDIA_CONTROLLER);n&&(ss(this,vt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=as(this,vt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=as(this,vt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ss(this,vt,null)}};vt=new WeakMap;xe.shadowRootOptions={mode:"open"};xe.getTemplateHTML=Af;xe.getSlotTemplateHTML=Sf;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",xe);var Jh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Xh=(i,e,t)=>(Jh(i,e,"read from private field"),t?t.call(i):e.get(i)),kf=(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)},Lf=(i,e,t,r)=>(Jh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),mn;function wf(i,e){return`
1002
- <slot>${Xe(e.mediaDuration)}</slot>
1003
- `}var ls=class extends xe{constructor(){var e;super(),kf(this,mn,void 0),Lf(this,mn,this.shadowRoot.querySelector("slot")),Xh(this,mn).textContent=Xe((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===s.MEDIA_DURATION&&(Xh(this,mn).textContent=Xe(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return H(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}};mn=new WeakMap;ls.getSlotTemplateHTML=wf;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",ls);var Cf={2:E("Network Error"),3:E("Decode Error"),4:E("Source Not Supported"),5:E("Encryption Error")},If={2:E("A network error caused the media download to fail."),3:E("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:E("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:E("The media is encrypted and there are no keys to decrypt it.")},wd=i=>{var e,t;return i.code===1?null:{title:(e=Cf[i.code])!=null?e:`Error ${i.code}`,message:(t=If[i.code])!=null?t:i.message}};var ep=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Mf=(i,e,t)=>(ep(i,e,"read from private field"),t?t.call(i):e.get(i)),Rf=(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)},xf=(i,e,t,r)=>(ep(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ds;function Pf(i){return`
1001
+ `}var Ue=class extends c.HTMLElement{constructor(){if(super(),Gf(this,gt,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=ks(this,gt))==null?void 0:o.unassociateElement)==null||n.call(o,this),Ls(this,gt,null)),r&&this.isConnected&&(Ls(this,gt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=ks(this,gt))==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&&(Ls(this,gt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=ks(this,gt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ks(this,gt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ls(this,gt,null)}};gt=new WeakMap;Ue.shadowRootOptions={mode:"open"};Ue.getTemplateHTML=qf;Ue.getSlotTemplateHTML=zf;c.customElements.get("media-text-display")||c.customElements.define("media-text-display",Ue);var Ap=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Tp=(i,e,t)=>(Ap(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)=>(Ap(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Rn;function Zf(i,e){return`
1002
+ <slot>${tt(e.mediaDuration)}</slot>
1003
+ `}var Cs=class extends Ue{constructor(){var e;super(),Yf(this,Rn,void 0),Qf(this,Rn,this.shadowRoot.querySelector("slot")),Tp(this,Rn).textContent=tt((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===s.MEDIA_DURATION&&(Tp(this,Rn).textContent=tt(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return H(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}};Rn=new WeakMap;Cs.getSlotTemplateHTML=Zf;c.customElements.get("media-duration-display")||c.customElements.define("media-duration-display",Cs);var Xf={2:g("Network Error"),3:g("Decode Error"),4:g("Source Not Supported"),5:g("Encryption Error")},Jf={2:g("A network error caused the media download to fail."),3:g("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:g("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:g("The media is encrypted and there are no keys to decrypt it.")},jd=i=>{var e,t;return i.code===1?null:{title:(e=Xf[i.code])!=null?e:`Error ${i.code}`,message:(t=Jf[i.code])!=null?t:i.message}};var kp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},jf=(i,e,t)=>(kp(i,e,"read from private field"),t?t.call(i):e.get(i)),eE=(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)},tE=(i,e,t,r)=>(kp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Is;function iE(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
- ${tp({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
1020
+ ${Lp({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
1021
1021
  </slot>
1022
- `}function Df(i){return i.code&&wd(i)!==null}function tp(i){var e;let{title:t,message:r}=(e=wd(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 jh=[s.MEDIA_ERROR_CODE,s.MEDIA_ERROR_MESSAGE],vn=class extends ut{constructor(){super(...arguments),Rf(this,ds,null)}static get observedAttributes(){return[...super.observedAttributes,...jh]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var o;if(super.attributeChangedCallback(e,t,r),!jh.includes(e))return;let n=(o=this.mediaError)!=null?o:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=Df(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return Mf(this,ds)}set mediaError(e){xf(this,ds,e)}get mediaErrorCode(){return H(this,"mediaerrorcode")}set mediaErrorCode(e){B(this,"mediaerrorcode",e)}get mediaErrorMessage(){return x(this,"mediaerrormessage")}set mediaErrorMessage(e){P(this,"mediaerrormessage",e)}};ds=new WeakMap;vn.getSlotTemplateHTML=Pf;vn.formatErrorMessage=tp;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",vn);var Of=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ii=(i,e,t)=>(Of(i,e,"read from private field"),t?t.call(i):e.get(i)),ip=(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)},Pr,Dr;function Uf(i){return`
1022
+ `}function rE(i){return i.code&&jd(i)!==null}function Lp(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 Sp=[s.MEDIA_ERROR_CODE,s.MEDIA_ERROR_MESSAGE],xn=class extends mt{constructor(){super(...arguments),eE(this,Is,null)}static get observedAttributes(){return[...super.observedAttributes,...Sp]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var o;if(super.attributeChangedCallback(e,t,r),!Sp.includes(e))return;let n=(o=this.mediaError)!=null?o:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=rE(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return jf(this,Is)}set mediaError(e){tE(this,Is,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)}};Is=new WeakMap;xn.getSlotTemplateHTML=iE;xn.formatErrorMessage=Lp;c.customElements.get("media-error-dialog")||c.customElements.define("media-error-dialog",xn);var oE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},di=(i,e,t)=>(oE(i,e,"read from private field"),t?t.call(i):e.get(i)),Cp=(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)},zr,Yr;function nE(i){return`
1023
1023
  <style>
1024
1024
  :host {
1025
1025
  position: fixed;
@@ -1104,9 +1104,9 @@ bp-player[has-error] {
1104
1104
  }
1105
1105
  </style>
1106
1106
  <slot id="content">
1107
- ${Nf()}
1107
+ ${aE()}
1108
1108
  </slot>
1109
- `}function Nf(){return`
1109
+ `}function aE(){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>
@@ -1116,11 +1116,11 @@ bp-player[has-error] {
1116
1116
  <td class="description">${r}</td>
1117
1117
  </tr>
1118
1118
  `).join("")}</table>
1119
- `}var cs=class extends ut{constructor(){super(...arguments),ip(this,Pr,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)}),ip(this,Dr,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",ii(this,Pr)),document.addEventListener("keydown",ii(this,Dr)))}disconnectedCallback(){this.removeEventListener("click",ii(this,Pr)),document.removeEventListener("keydown",ii(this,Dr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",ii(this,Pr)),document.addEventListener("keydown",ii(this,Dr))):(this.removeEventListener("click",ii(this,Pr)),document.removeEventListener("keydown",ii(this,Dr))))}};Pr=new WeakMap;Dr=new WeakMap;cs.getSlotTemplateHTML=Uf;d.customElements.get("media-keyboard-shortcuts-dialog")||d.customElements.define("media-keyboard-shortcuts-dialog",cs);var op=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Hf=(i,e,t)=>(op(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)},Bf=(i,e,t,r)=>(op(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),us,Vf=`<svg aria-hidden="true" viewBox="0 0 26 24">
1119
+ `}var ws=class extends mt{constructor(){super(...arguments),Cp(this,zr,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)}),Cp(this,Yr,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",di(this,zr)),document.addEventListener("keydown",di(this,Yr)))}disconnectedCallback(){this.removeEventListener("click",di(this,zr)),document.removeEventListener("keydown",di(this,Yr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",di(this,zr)),document.addEventListener("keydown",di(this,Yr))):(this.removeEventListener("click",di(this,zr)),document.removeEventListener("keydown",di(this,Yr))))}};zr=new WeakMap;Yr=new WeakMap;ws.getSlotTemplateHTML=nE;c.customElements.get("media-keyboard-shortcuts-dialog")||c.customElements.define("media-keyboard-shortcuts-dialog",ws);var wp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},sE=(i,e,t)=>(wp(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)},dE=(i,e,t,r)=>(wp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ms,cE=`<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>`,Wf=`<svg aria-hidden="true" viewBox="0 0 26 24">
1121
+ </svg>`,uE=`<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 Ff(i){return`
1123
+ </svg>`;function hE(i){return`
1124
1124
  <style>
1125
1125
  :host([${s.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
1126
1126
  display: none !important;
@@ -1138,13 +1138,13 @@ bp-player[has-error] {
1138
1138
  </style>
1139
1139
 
1140
1140
  <slot name="icon">
1141
- <slot name="enter">${Vf}</slot>
1142
- <slot name="exit">${Wf}</slot>
1141
+ <slot name="enter">${cE}</slot>
1142
+ <slot name="exit">${uE}</slot>
1143
1143
  </slot>
1144
- `}function Kf(){return`
1145
- <slot name="tooltip-enter">${E("Enter fullscreen mode")}</slot>
1146
- <slot name="tooltip-exit">${E("Exit fullscreen mode")}</slot>
1147
- `}var rp=i=>{let e=i.mediaIsFullscreen?E("exit fullscreen mode"):E("enter fullscreen mode");i.setAttribute("aria-label",e)},fn=class extends F{constructor(){super(...arguments),$f(this,us,null)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_FULLSCREEN,s.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),rp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_FULLSCREEN&&rp(this)}get mediaFullscreenUnavailable(){return x(this,s.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){P(this,s.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return C(this,s.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){I(this,s.MEDIA_IS_FULLSCREEN,e)}handleClick(e){Bf(this,us,e);let t=Hf(this,us)instanceof PointerEvent,r=this.mediaIsFullscreen?new d.CustomEvent(b.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new d.CustomEvent(b.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};us=new WeakMap;fn.getSlotTemplateHTML=Ff;fn.getTooltipContentHTML=Kf;d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",fn);var{MEDIA_TIME_IS_LIVE:hs,MEDIA_PAUSED:gn}=s,{MEDIA_SEEK_TO_LIVE_REQUEST:qf,MEDIA_PLAY_REQUEST:Gf}=b,zf='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function Yf(i){return`
1144
+ `}function pE(){return`
1145
+ <slot name="tooltip-enter">${g("Enter fullscreen mode")}</slot>
1146
+ <slot name="tooltip-exit">${g("Exit fullscreen mode")}</slot>
1147
+ `}var Ip=i=>{let e=i.mediaIsFullscreen?g("exit fullscreen mode"):g("enter fullscreen mode");i.setAttribute("aria-label",e)},Pn=class extends F{constructor(){super(...arguments),lE(this,Ms,null)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_FULLSCREEN,s.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Ip(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_FULLSCREEN&&Ip(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){dE(this,Ms,e);let t=sE(this,Ms)instanceof PointerEvent,r=this.mediaIsFullscreen?new c.CustomEvent(b.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new c.CustomEvent(b.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};Ms=new WeakMap;Pn.getSlotTemplateHTML=hE;Pn.getTooltipContentHTML=pE;c.customElements.get("media-fullscreen-button")||c.customElements.define("media-fullscreen-button",Pn);var{MEDIA_TIME_IS_LIVE:Rs,MEDIA_PAUSED:Dn}=s,{MEDIA_SEEK_TO_LIVE_REQUEST:mE,MEDIA_PLAY_REQUEST:vE}=b,fE='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function EE(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([${hs}]:not([${gn}])) slot[name=indicator] > *,
1160
- :host([${hs}]:not([${gn}])) ::slotted([slot=indicator]) {
1159
+ :host([${Rs}]:not([${Dn}])) slot[name=indicator] > *,
1160
+ :host([${Rs}]:not([${Dn}])) ::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([${hs}]:not([${gn}])) {
1165
+ :host([${Rs}]:not([${Dn}])) {
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">${zf}</slot>
1175
+ <slot name="indicator">${fE}</slot>
1176
1176
 
1177
- <slot name="spacer">&nbsp;</slot><slot name="text">${E("live")}</slot>
1178
- `}var np=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?E("seek to live"):E("playing live");i.setAttribute("aria-label",r);let o=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');o&&(o.textContent=E("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},ps=class extends F{static get observedAttributes(){return[...super.observedAttributes,hs,gn]}connectedCallback(){super.connectedCallback(),np(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),np(this)}get mediaPaused(){return C(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return C(this,s.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){I(this,s.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(qf,{composed:!0,bubbles:!0})),this.hasAttribute(gn)&&this.dispatchEvent(new d.CustomEvent(Gf,{composed:!0,bubbles:!0})))}};ps.getSlotTemplateHTML=Yf;d.customElements.get("media-live-button")||d.customElements.define("media-live-button",ps);var sp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},En=(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)},bn=(i,e,t,r)=>(sp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ft,vs,ms={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},lp=500,Qf=`
1177
+ <slot name="spacer">&nbsp;</slot><slot name="text">${g("live")}</slot>
1178
+ `}var Mp=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?g("seek to live"):g("playing live");i.setAttribute("aria-label",r);let o=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');o&&(o.textContent=g("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},xs=class extends F{static get observedAttributes(){return[...super.observedAttributes,Rs,Dn]}connectedCallback(){super.connectedCallback(),Mp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),Mp(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(mE,{composed:!0,bubbles:!0})),this.hasAttribute(Dn)&&this.dispatchEvent(new c.CustomEvent(vE,{composed:!0,bubbles:!0})))}};xs.getSlotTemplateHTML=EE;c.customElements.get("media-live-button")||c.customElements.define("media-live-button",xs);var xp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},On=(i,e,t)=>(xp(i,e,"read from private field"),t?t.call(i):e.get(i)),Rp=(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)},Nn=(i,e,t,r)=>(xp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),bt,Ds,Ps={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},Pp=500,gE=`
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 Zf(i){return`
1191
+ `;function bE(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, ${lp}ms);
1197
+ --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${Pp}ms);
1198
1198
  }
1199
1199
 
1200
1200
  #status {
@@ -1233,15 +1233,15 @@ bp-player[has-error] {
1233
1233
  }
1234
1234
  </style>
1235
1235
 
1236
- <slot name="icon">${Qf}</slot>
1237
- <div id="status" role="status" aria-live="polite">${E("media loading")}</div>
1238
- `}var _n=class extends d.HTMLElement{constructor(){if(super(),ap(this,ft,void 0),ap(this,vs,lp),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=J(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[U.MEDIA_CONTROLLER,s.MEDIA_PAUSED,s.MEDIA_LOADING,ms.LOADING_DELAY]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===ms.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===U.MEDIA_CONTROLLER&&(t&&((n=(o=En(this,ft))==null?void 0:o.unassociateElement)==null||n.call(o,this),bn(this,ft,null)),r&&this.isConnected&&(bn(this,ft,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=En(this,ft))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(U.MEDIA_CONTROLLER);o&&(bn(this,ft,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=En(this,ft))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=En(this,ft))==null?void 0:e.unassociateElement)==null||t.call(e,this),bn(this,ft,null)}get loadingDelay(){return En(this,vs)}set loadingDelay(e){bn(this,vs,e);let{style:t}=X(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return C(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return C(this,s.MEDIA_LOADING)}set mediaLoading(e){I(this,s.MEDIA_LOADING,e)}get mediaController(){return x(this,U.MEDIA_CONTROLLER)}set mediaController(e){P(this,U.MEDIA_CONTROLLER,e)}get noAutohide(){return C(this,ms.NO_AUTOHIDE)}set noAutohide(e){I(this,ms.NO_AUTOHIDE,e)}};ft=new WeakMap;vs=new WeakMap;_n.shadowRootOptions={mode:"open"};_n.getTemplateHTML=Zf;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",_n);var Xf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1236
+ <slot name="icon">${gE}</slot>
1237
+ <div id="status" role="status" aria-live="polite">${g("media loading")}</div>
1238
+ `}var Un=class extends c.HTMLElement{constructor(){if(super(),Rp(this,bt,void 0),Rp(this,Ds,Pp),!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,Ps.LOADING_DELAY]}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===Ps.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===N.MEDIA_CONTROLLER&&(t&&((n=(o=On(this,bt))==null?void 0:o.unassociateElement)==null||n.call(o,this),Nn(this,bt,null)),r&&this.isConnected&&(Nn(this,bt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=On(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&&(Nn(this,bt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=On(this,bt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=On(this,bt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Nn(this,bt,null)}get loadingDelay(){return On(this,Ds)}set loadingDelay(e){Nn(this,Ds,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,Ps.NO_AUTOHIDE)}set noAutohide(e){M(this,Ps.NO_AUTOHIDE,e)}};bt=new WeakMap;Ds=new WeakMap;Un.shadowRootOptions={mode:"open"};Un.getTemplateHTML=bE;c.customElements.get("media-loading-indicator")||c.customElements.define("media-loading-indicator",Un);var _E=`<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>`,dp=`<svg aria-hidden="true" viewBox="0 0 24 24">
1240
+ </svg>`,Dp=`<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>`,Jf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1242
+ </svg>`,yE=`<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 jf(i){return`
1244
+ </svg>`;function TE(i){return`
1245
1245
  <style>
1246
1246
  :host(:not([${s.MEDIA_VOLUME_LEVEL}])) slot[name=icon] slot:not([name=high]),
1247
1247
  :host([${s.MEDIA_VOLUME_LEVEL}=high]) slot[name=icon] slot:not([name=high]) {
@@ -1267,17 +1267,17 @@ bp-player[has-error] {
1267
1267
  </style>
1268
1268
 
1269
1269
  <slot name="icon">
1270
- <slot name="off">${Xf}</slot>
1271
- <slot name="low">${dp}</slot>
1272
- <slot name="medium">${dp}</slot>
1273
- <slot name="high">${Jf}</slot>
1270
+ <slot name="off">${_E}</slot>
1271
+ <slot name="low">${Dp}</slot>
1272
+ <slot name="medium">${Dp}</slot>
1273
+ <slot name="high">${yE}</slot>
1274
1274
  </slot>
1275
- `}function eg(){return`
1276
- <slot name="tooltip-mute">${E("Mute")}</slot>
1277
- <slot name="tooltip-unmute">${E("Unmute")}</slot>
1278
- `}var cp=i=>{let t=i.mediaVolumeLevel==="off"?E("unmute"):E("mute");i.setAttribute("aria-label",t)},yn=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 x(this,s.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){P(this,s.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};yn.getSlotTemplateHTML=jf;yn.getTooltipContentHTML=eg;d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",yn);var up=`<svg aria-hidden="true" viewBox="0 0 28 24">
1275
+ `}function AE(){return`
1276
+ <slot name="tooltip-mute">${g("Mute")}</slot>
1277
+ <slot name="tooltip-unmute">${g("Unmute")}</slot>
1278
+ `}var Op=i=>{let t=i.mediaVolumeLevel==="off"?g("unmute"):g("mute");i.setAttribute("aria-label",t)},Hn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),Op(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_VOLUME_LEVEL&&Op(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"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Hn.getSlotTemplateHTML=TE;Hn.getTooltipContentHTML=AE;c.customElements.get("media-mute-button")||c.customElements.define("media-mute-button",Hn);var Np=`<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 tg(i){return`
1280
+ </svg>`;function SE(i){return`
1281
1281
  <style>
1282
1282
  :host([${s.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
1283
1283
  display: none !important;
@@ -1294,25 +1294,25 @@ bp-player[has-error] {
1294
1294
  </style>
1295
1295
 
1296
1296
  <slot name="icon">
1297
- <slot name="enter">${up}</slot>
1298
- <slot name="exit">${up}</slot>
1297
+ <slot name="enter">${Np}</slot>
1298
+ <slot name="exit">${Np}</slot>
1299
1299
  </slot>
1300
- `}function ig(){return`
1301
- <slot name="tooltip-enter">${E("Enter picture in picture mode")}</slot>
1302
- <slot name="tooltip-exit">${E("Exit picture in picture mode")}</slot>
1303
- `}var hp=i=>{let e=i.mediaIsPip?E("exit picture in picture mode"):E("enter picture in picture mode");i.setAttribute("aria-label",e)},Tn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_PIP,s.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),hp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_PIP&&hp(this)}get mediaPipUnavailable(){return x(this,s.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){P(this,s.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return C(this,s.MEDIA_IS_PIP)}set mediaIsPip(e){I(this,s.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};Tn.getSlotTemplateHTML=tg;Tn.getTooltipContentHTML=ig;d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",Tn);var rg=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Or=(i,e,t)=>(rg(i,e,"read from private field"),t?t.call(i):e.get(i)),og=(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)},ri,Cd={RATES:"rates"},Id=[1,1.2,1.5,1.7,2],Yi=1;function ng(i){return`
1300
+ `}function kE(){return`
1301
+ <slot name="tooltip-enter">${g("Enter picture in picture mode")}</slot>
1302
+ <slot name="tooltip-exit">${g("Exit picture in picture mode")}</slot>
1303
+ `}var Up=i=>{let e=i.mediaIsPip?g("exit picture in picture mode"):g("enter picture in picture mode");i.setAttribute("aria-label",e)},$n=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_PIP,s.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Up(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_PIP&&Up(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?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};$n.getSlotTemplateHTML=SE;$n.getTooltipContentHTML=kE;c.customElements.get("media-pip-button")||c.customElements.define("media-pip-button",$n);var LE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qr=(i,e,t)=>(LE(i,e,"read from private field"),t?t.call(i):e.get(i)),CE=(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)},ci,ec={RATES:"rates"},tc=[1,1.2,1.5,1.7,2],rr=1;function IE(i){return`
1304
1304
  <style>
1305
1305
  :host {
1306
1306
  min-width: 5ch;
1307
1307
  padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
1308
1308
  }
1309
1309
  </style>
1310
- <slot name="icon">${i.mediaplaybackrate||Yi}x</slot>
1311
- `}function ag(){return E("Playback rate")}var An=class extends F{constructor(){var e;super(),og(this,ri,new Xt(this,Cd.RATES,{defaultValue:Id})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Yi}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,Cd.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===Cd.RATES&&(Or(this,ri).value=r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?Yi:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",E("Playback rate {playbackRate}",{playbackRate:n}))}}get rates(){return Or(this,ri)}set rates(e){e?Array.isArray(e)?Or(this,ri).value=e.join(" "):typeof e=="string"&&(Or(this,ri).value=e):Or(this,ri).value=""}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,Yi)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(Or(this,ri).values(),a=>+a).sort((a,l)=>a-l),o=(t=(e=r.find(a=>a>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:Yi,n=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:o});this.dispatchEvent(n)}};ri=new WeakMap;An.getSlotTemplateHTML=ng;An.getTooltipContentHTML=ag;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",An);var sg=`<svg aria-hidden="true" viewBox="0 0 24 24">
1310
+ <slot name="icon">${i.mediaplaybackrate||rr}x</slot>
1311
+ `}function wE(){return g("Playback rate")}var Bn=class extends F{constructor(){var e;super(),CE(this,ci,new oi(this,ec.RATES,{defaultValue:tc})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:rr}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,ci).value=r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?rr:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",g("Playback rate {playbackRate}",{playbackRate:n}))}}get rates(){return Qr(this,ci)}set rates(e){e?Array.isArray(e)?Qr(this,ci).value=e.join(" "):typeof e=="string"&&(Qr(this,ci).value=e):Qr(this,ci).value=""}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,rr)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(Qr(this,ci).values(),a=>+a).sort((a,l)=>a-l),o=(t=(e=r.find(a=>a>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:rr,n=new c.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:o});this.dispatchEvent(n)}};ci=new WeakMap;Bn.getSlotTemplateHTML=IE;Bn.getTooltipContentHTML=wE;c.customElements.get("media-playback-rate-button")||c.customElements.define("media-playback-rate-button",Bn);var ME=`<svg aria-hidden="true" viewBox="0 0 24 24">
1312
1312
  <path d="m6 21 15-9L6 3v18Z"/>
1313
- </svg>`,lg=`<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 dg(i){return`
1315
+ </svg>`;function xE(i){return`
1316
1316
  <style>
1317
1317
  :host([${s.MEDIA_PAUSED}]) slot[name=pause],
1318
1318
  :host(:not([${s.MEDIA_PAUSED}])) slot[name=play] {
@@ -1326,13 +1326,13 @@ bp-player[has-error] {
1326
1326
  </style>
1327
1327
 
1328
1328
  <slot name="icon">
1329
- <slot name="play">${sg}</slot>
1330
- <slot name="pause">${lg}</slot>
1329
+ <slot name="play">${ME}</slot>
1330
+ <slot name="pause">${RE}</slot>
1331
1331
  </slot>
1332
- `}function cg(){return`
1333
- <slot name="tooltip-play">${E("Play")}</slot>
1334
- <slot name="tooltip-pause">${E("Pause")}</slot>
1335
- `}var pp=i=>{let e=i.mediaPaused?E("play"):E("pause");i.setAttribute("aria-label",e)},Sn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),pp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PAUSED||e===s.MEDIA_LANG)&&pp(this)}get mediaPaused(){return C(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};Sn.getSlotTemplateHTML=dg;Sn.getTooltipContentHTML=cg;d.customElements.get("media-play-button")||d.customElements.define("media-play-button",Sn);var gt={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function ug(i){return`
1332
+ `}function PE(){return`
1333
+ <slot name="tooltip-play">${g("Play")}</slot>
1334
+ <slot name="tooltip-pause">${g("Pause")}</slot>
1335
+ `}var Hp=i=>{let e=i.mediaPaused?g("play"):g("pause");i.setAttribute("aria-label",e)},Vn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),Hp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PAUSED||e===s.MEDIA_LANG)&&Hp(this)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){M(this,s.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Vn.getSlotTemplateHTML=xE;Vn.getTooltipContentHTML=PE;c.customElements.get("media-play-button")||c.customElements.define("media-play-button",Vn);var _t={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function DE(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 hg=i=>{i.style.removeProperty("background-image")},pg=(i,e)=>{i.style["background-image"]=`url('${e}')`},kn=class extends d.HTMLElement{static get observedAttributes(){return[gt.PLACEHOLDER_SRC,gt.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===gt.SRC&&(r==null?this.image.removeAttribute(gt.SRC):this.image.setAttribute(gt.SRC,r)),e===gt.PLACEHOLDER_SRC&&(r==null?hg(this.image):pg(this.image,r))}get placeholderSrc(){return x(this,gt.PLACEHOLDER_SRC)}set placeholderSrc(e){P(this,gt.SRC,e)}get src(){return x(this,gt.SRC)}set src(e){P(this,gt.SRC,e)}};kn.shadowRootOptions={mode:"open"};kn.getTemplateHTML=ug;d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",kn);var mp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},mg=(i,e,t)=>(mp(i,e,"read from private field"),t?t.call(i):e.get(i)),vg=(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)},fg=(i,e,t,r)=>(mp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),fs,Md=class extends xe{constructor(){super(),vg(this,fs,void 0),fg(this,fs,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(mg(this,fs).textContent=r,r!==""){let o=E("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",o)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return x(this,s.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){P(this,s.MEDIA_PREVIEW_CHAPTER,e)}};fs=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",Md);var vp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gs=(i,e,t)=>(vp(i,e,"read from private field"),t?t.call(i):e.get(i)),gg=(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)},Es=(i,e,t,r)=>(vp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Et;function Eg(i){return`
1357
+ `}var OE=i=>{i.style.removeProperty("background-image")},NE=(i,e)=>{i.style["background-image"]=`url('${e}')`},Wn=class extends c.HTMLElement{static get observedAttributes(){return[_t.PLACEHOLDER_SRC,_t.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===_t.SRC&&(r==null?this.image.removeAttribute(_t.SRC):this.image.setAttribute(_t.SRC,r)),e===_t.PLACEHOLDER_SRC&&(r==null?OE(this.image):NE(this.image,r))}get placeholderSrc(){return D(this,_t.PLACEHOLDER_SRC)}set placeholderSrc(e){O(this,_t.SRC,e)}get src(){return D(this,_t.SRC)}set src(e){O(this,_t.SRC,e)}};Wn.shadowRootOptions={mode:"open"};Wn.getTemplateHTML=DE;c.customElements.get("media-poster-image")||c.customElements.define("media-poster-image",Wn);var $p=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},UE=(i,e,t)=>($p(i,e,"read from private field"),t?t.call(i):e.get(i)),HE=(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)},$E=(i,e,t,r)=>($p(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Os,ic=class extends Ue{constructor(){super(),HE(this,Os,void 0),$E(this,Os,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(UE(this,Os).textContent=r,r!==""){let o=g("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)}};Os=new WeakMap;c.customElements.get("media-preview-chapter-display")||c.customElements.define("media-preview-chapter-display",ic);var Bp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ns=(i,e,t)=>(Bp(i,e,"read from private field"),t?t.call(i):e.get(i)),BE=(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)},Us=(i,e,t,r)=>(Bp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),yt;function VE(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 Ur=class extends d.HTMLElement{constructor(){if(super(),gg(this,Et,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[U.MEDIA_CONTROLLER,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let o=this.getAttribute(U.MEDIA_CONTROLLER);o&&(Es(this,Et,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=gs(this,Et))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=gs(this,Et))==null?void 0:e.unassociateElement)==null||t.call(e,this),Es(this,Et,null)}attributeChangedCallback(e,t,r){var o,n,a,l,c;[s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===U.MEDIA_CONTROLLER&&(t&&((n=(o=gs(this,Et))==null?void 0:o.unassociateElement)==null||n.call(o,this),Es(this,Et,null)),r&&this.isConnected&&(Es(this,Et,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=gs(this,Et))==null?void 0:l.associateElement)==null||c.call(l,this)))}get mediaPreviewImage(){return x(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){P(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],c=getComputedStyle(this),{maxWidth:v,maxHeight:h,minWidth:p,minHeight:f}=c,m=Math.min(parseInt(v)/n,parseInt(h)/a),A=Math.max(parseInt(p)/n,parseInt(f)/a),g=m<1,L=g?m:A>1?A:1,{style:D}=X(this.shadowRoot,":host"),Ue=X(this.shadowRoot,"img").style,ot=this.shadowRoot.querySelector("img"),Mo=g?"min":"max";D.setProperty(`${Mo}-width`,"initial","important"),D.setProperty(`${Mo}-height`,"initial","important"),D.width=`${n*L}px`,D.height=`${a*L}px`;let cr=()=>{Ue.width=`${this.imgWidth*L}px`,Ue.height=`${this.imgHeight*L}px`,Ue.display="block"};ot.src!==l&&(ot.onload=()=>{this.imgWidth=ot.naturalWidth,this.imgHeight=ot.naturalHeight,cr()},ot.src=l,cr()),cr(),Ue.transform=`translate(-${r*L}px, -${o*L}px)`}};Et=new WeakMap;Ur.shadowRootOptions={mode:"open"};Ur.getTemplateHTML=Eg;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Ur);var bs=Ur;var gp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},fp=(i,e,t)=>(gp(i,e,"read from private field"),t?t.call(i):e.get(i)),bg=(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)},_g=(i,e,t,r)=>(gp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ln,Rd=class extends xe{constructor(){super(),bg(this,Ln,void 0),_g(this,Ln,this.shadowRoot.querySelector("slot")),fp(this,Ln).textContent=Xe(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&&(fp(this,Ln).textContent=Xe(parseFloat(r)))}get mediaPreviewTime(){return H(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}};Ln=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Rd);var Nr={SEEK_OFFSET:"seekoffset"},xd=30,yg=i=>`
1371
+ `}var Zr=class extends c.HTMLElement{constructor(){if(super(),BE(this,yt,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&&(Us(this,yt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=Ns(this,yt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ns(this,yt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Us(this,yt,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=Ns(this,yt))==null?void 0:o.unassociateElement)==null||n.call(o,this),Us(this,yt,null)),r&&this.isConnected&&(Us(this,yt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=Ns(this,yt))==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:v,maxHeight:h,minWidth:m,minHeight:T}=d,p=Math.min(parseInt(v)/n,parseInt(h)/a),A=Math.max(parseInt(m)/n,parseInt(T)/a),E=p<1,_=E?p:A>1?A:1,{style:k}=J(this.shadowRoot,":host"),ie=J(this.shadowRoot,"img").style,ke=this.shadowRoot.querySelector("img"),Le=E?"min":"max";k.setProperty(`${Le}-width`,"initial","important"),k.setProperty(`${Le}-height`,"initial","important"),k.width=`${n*_}px`,k.height=`${a*_}px`;let Tr=()=>{ie.width=`${this.imgWidth*_}px`,ie.height=`${this.imgHeight*_}px`,ie.display="block"};ke.src!==l&&(ke.onload=()=>{this.imgWidth=ke.naturalWidth,this.imgHeight=ke.naturalHeight,Tr()},ke.src=l,Tr()),Tr(),ie.transform=`translate(-${r*_}px, -${o*_}px)`}};yt=new WeakMap;Zr.shadowRootOptions={mode:"open"};Zr.getTemplateHTML=VE;c.customElements.get("media-preview-thumbnail")||c.customElements.define("media-preview-thumbnail",Zr);var Hs=Zr;var Wp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Vp=(i,e,t)=>(Wp(i,e,"read from private field"),t?t.call(i):e.get(i)),WE=(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)},FE=(i,e,t,r)=>(Wp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Fn,rc=class extends Ue{constructor(){super(),WE(this,Fn,void 0),FE(this,Fn,this.shadowRoot.querySelector("slot")),Vp(this,Fn).textContent=tt(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&&(Vp(this,Fn).textContent=tt(parseFloat(r)))}get mediaPreviewTime(){return H(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}};Fn=new WeakMap;c.customElements.get("media-preview-time-display")||c.customElements.define("media-preview-time-display",rc);var Xr={SEEK_OFFSET:"seekoffset"},oc=30,KE=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 Tg(i,e){return`
1379
- <slot name="icon">${yg(e.seekOffset)}</slot>
1380
- `}function Ag(){return E("Seek backward")}var Sg=0,wn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Nr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=H(this,Nr.SEEK_OFFSET,xd)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Nr.SEEK_OFFSET&&(this.seekOffset=H(this,Nr.SEEK_OFFSET,xd))}get seekOffset(){return H(this,Nr.SEEK_OFFSET,xd)}set seekOffset(e){B(this,Nr.SEEK_OFFSET,e),this.setAttribute("aria-label",E("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Ta(Aa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME,Sg)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};wn.getSlotTemplateHTML=Tg;wn.getTooltipContentHTML=Ag;d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",wn);var Hr={SEEK_OFFSET:"seekoffset"},Pd=30,kg=i=>`
1378
+ </svg>`;function GE(i,e){return`
1379
+ <slot name="icon">${KE(e.seekOffset)}</slot>
1380
+ `}function qE(){return g("Seek backward")}var zE=0,Kn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Xr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=H(this,Xr.SEEK_OFFSET,oc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Xr.SEEK_OFFSET&&(this.seekOffset=H(this,Xr.SEEK_OFFSET,oc))}get seekOffset(){return H(this,Xr.SEEK_OFFSET,oc)}set seekOffset(e){B(this,Xr.SEEK_OFFSET,e),this.setAttribute("aria-label",g("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Va(Wa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME,zE)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new c.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Kn.getSlotTemplateHTML=GE;Kn.getTooltipContentHTML=qE;c.customElements.get("media-seek-backward-button")||c.customElements.define("media-seek-backward-button",Kn);var Jr={SEEK_OFFSET:"seekoffset"},nc=30,YE=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 Lg(i,e){return`
1388
- <slot name="icon">${kg(e.seekOffset)}</slot>
1389
- `}function wg(){return E("Seek forward")}var Cg=0,Cn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Hr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=H(this,Hr.SEEK_OFFSET,Pd)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Hr.SEEK_OFFSET&&(this.seekOffset=H(this,Hr.SEEK_OFFSET,Pd))}get seekOffset(){return H(this,Hr.SEEK_OFFSET,Pd)}set seekOffset(e){B(this,Hr.SEEK_OFFSET,e),this.setAttribute("aria-label",E("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Ta(Aa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME,Cg)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Cn.getSlotTemplateHTML=Lg;Cn.getTooltipContentHTML=wg;d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",Cn);var _p=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Dd=(i,e,t)=>(_p(i,e,"read from private field"),t?t.call(i):e.get(i)),Ig=(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)},Mg=(i,e,t,r)=>(_p(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),$r,Qi={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Ep=[...Object.values(Qi),s.MEDIA_CURRENT_TIME,s.MEDIA_DURATION,s.MEDIA_SEEKABLE],bp=["Enter"," "],Rg="&nbsp;/&nbsp;",Od=(i,{timesSep:e=Rg}={})=>{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?Xe(0-(a-o)):Xe(o);return i.showDuration?`${l}${e}${Xe(a)}`:l},xg="video not loaded, unknown time.",Pg=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",xg);return}let n=i.remaining?Di(0-(o-t)):Di(t);if(!i.showDuration){i.setAttribute("aria-valuetext",n);return}let a=Di(o),l=`${n} of ${a}`;i.setAttribute("aria-valuetext",l)};function Dg(i,e){return`
1390
- <slot>${Od(e)}</slot>
1391
- `}var _s=class extends xe{constructor(){super(),Ig(this,$r,void 0),Mg(this,$r,this.shadowRoot.querySelector("slot")),Dd(this,$r).innerHTML=`${Od(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Ep,"disabled"]}connectedCallback(){let{style:e}=X(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",E("playback time"));let t=r=>{let{key:o}=r;if(!bp.includes(o)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:o,altKey:n,key:a}=r;if(o||n||!bp.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){Ep.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,Qi.REMAINING)}set remaining(e){I(this,Qi.REMAINING,e)}get showDuration(){return C(this,Qi.SHOW_DURATION)}set showDuration(e){I(this,Qi.SHOW_DURATION,e)}get noToggle(){return C(this,Qi.NO_TOGGLE)}set noToggle(e){I(this,Qi.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=Od(this);Pg(this),e!==Dd(this,$r).innerHTML&&(Dd(this,$r).innerHTML=e)}};$r=new WeakMap;_s.getSlotTemplateHTML=Dg;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",_s);var yp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ee=(i,e,t)=>(yp(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)},Be=(i,e,t,r)=>(yp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Og=(i,e,t,r)=>({set _(o){Be(i,e,o,t)},get _(){return Ee(i,e,r)}}),Br,ys,Vr,In,Ts,As,Ss,Wr,Zi,ks,Ls=class{constructor(e,t,r){bt(this,Br,void 0),bt(this,ys,void 0),bt(this,Vr,void 0),bt(this,In,void 0),bt(this,Ts,void 0),bt(this,As,void 0),bt(this,Ss,void 0),bt(this,Wr,void 0),bt(this,Zi,0),bt(this,ks,(o=performance.now())=>{Be(this,Zi,requestAnimationFrame(Ee(this,ks))),Be(this,In,performance.now()-Ee(this,Vr));let n=1e3/this.fps;if(Ee(this,In)>n){Be(this,Vr,o-Ee(this,In)%n);let a=1e3/((o-Ee(this,ys))/++Og(this,Ts)._),l=(o-Ee(this,As))/1e3/this.duration,c=Ee(this,Ss)+l*this.playbackRate;c-Ee(this,Br).valueAsNumber>0?Be(this,Wr,this.playbackRate/this.duration/a):(Be(this,Wr,.995*Ee(this,Wr)),c=Ee(this,Br).valueAsNumber+Ee(this,Wr)),this.callback(c)}}),Be(this,Br,e),this.callback=t,this.fps=r}start(){Ee(this,Zi)===0&&(Be(this,Vr,performance.now()),Be(this,ys,Ee(this,Vr)),Be(this,Ts,0),Ee(this,ks).call(this))}stop(){Ee(this,Zi)!==0&&(cancelAnimationFrame(Ee(this,Zi)),Be(this,Zi,0))}update({start:e,duration:t,playbackRate:r}){let o=e-Ee(this,Br).valueAsNumber,n=Math.abs(t-this.duration);(o>0||o<-.03||n>=.5)&&this.callback(e),Be(this,Ss,e),Be(this,As,performance.now()),this.duration=t,this.playbackRate=r}};Br=new WeakMap;ys=new WeakMap;Vr=new WeakMap;In=new WeakMap;Ts=new WeakMap;As=new WeakMap;Ss=new WeakMap;Wr=new WeakMap;Zi=new WeakMap;ks=new WeakMap;var $d=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ae=(i,e,t)=>($d(i,e,"read from private field"),t?t.call(i):e.get(i)),me=(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)},qe=(i,e,t,r)=>($d(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ye=(i,e,t)=>($d(i,e,"access private method"),t),Fr,Xi,Is,Rn,Ms,Cs,xn,Pn,Kr,qr,Gr,Mn,Bd,Tp,Ud,Rs,Vd,xs,Wd,Ps,Fd,Nd,Ap,Dn,Ds,Hd,Sp,Ug="video not loaded, unknown time.",Ng=i=>{let e=i.range,t=Di(+kp(i)),r=Di(+i.mediaSeekableEnd),o=t&&r?`${t} of ${r}`:Ug;e.setAttribute("aria-valuetext",o)};function Hg(i){return`
1387
+ </svg>`;function QE(i,e){return`
1388
+ <slot name="icon">${YE(e.seekOffset)}</slot>
1389
+ `}function ZE(){return g("Seek forward")}var XE=0,Gn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Jr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=H(this,Jr.SEEK_OFFSET,nc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Jr.SEEK_OFFSET&&(this.seekOffset=H(this,Jr.SEEK_OFFSET,nc))}get seekOffset(){return H(this,Jr.SEEK_OFFSET,nc)}set seekOffset(e){B(this,Jr.SEEK_OFFSET,e),this.setAttribute("aria-label",g("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Va(Wa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME,XE)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new c.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Gn.getSlotTemplateHTML=QE;Gn.getTooltipContentHTML=ZE;c.customElements.get("media-seek-forward-button")||c.customElements.define("media-seek-forward-button",Gn);var Gp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ac=(i,e,t)=>(Gp(i,e,"read from private field"),t?t.call(i):e.get(i)),JE=(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)=>(Gp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),jr,or={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Fp=[...Object.values(or),s.MEDIA_CURRENT_TIME,s.MEDIA_DURATION,s.MEDIA_SEEKABLE],Kp=["Enter"," "],eg="&nbsp;/&nbsp;",sc=(i,{timesSep:e=eg}={})=>{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?tt(0-(a-o)):tt(o);return i.showDuration?`${l}${e}${tt(a)}`:l},tg="video not loaded, unknown time.",ig=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",tg);return}let n=i.remaining?Fi(0-(o-t)):Fi(t);if(!i.showDuration){i.setAttribute("aria-valuetext",n);return}let a=Fi(o),l=`${n} of ${a}`;i.setAttribute("aria-valuetext",l)};function rg(i,e){return`
1390
+ <slot>${sc(e)}</slot>
1391
+ `}var $s=class extends Ue{constructor(){super(),JE(this,jr,void 0),jE(this,jr,this.shadowRoot.querySelector("slot")),ac(this,jr).innerHTML=`${sc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Fp,"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",g("playback time"));let t=r=>{let{key:o}=r;if(!Kp.includes(o)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:o,altKey:n,key:a}=r;if(o||n||!Kp.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){Fp.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,or.REMAINING)}set remaining(e){M(this,or.REMAINING,e)}get showDuration(){return w(this,or.SHOW_DURATION)}set showDuration(e){M(this,or.SHOW_DURATION,e)}get noToggle(){return w(this,or.NO_TOGGLE)}set noToggle(e){M(this,or.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);ig(this),e!==ac(this,jr).innerHTML&&(ac(this,jr).innerHTML=e)}};jr=new WeakMap;$s.getSlotTemplateHTML=rg;c.customElements.get("media-time-display")||c.customElements.define("media-time-display",$s);var qp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Te=(i,e,t)=>(qp(i,e,"read from private field"),t?t.call(i):e.get(i)),Tt=(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)},Fe=(i,e,t,r)=>(qp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),og=(i,e,t,r)=>({set _(o){Fe(i,e,o,t)},get _(){return Te(i,e,r)}}),eo,Bs,to,qn,Vs,Ws,Fs,io,nr,Ks,Gs=class{constructor(e,t,r){Tt(this,eo,void 0),Tt(this,Bs,void 0),Tt(this,to,void 0),Tt(this,qn,void 0),Tt(this,Vs,void 0),Tt(this,Ws,void 0),Tt(this,Fs,void 0),Tt(this,io,void 0),Tt(this,nr,0),Tt(this,Ks,(o=performance.now())=>{Fe(this,nr,requestAnimationFrame(Te(this,Ks))),Fe(this,qn,performance.now()-Te(this,to));let n=1e3/this.fps;if(Te(this,qn)>n){Fe(this,to,o-Te(this,qn)%n);let a=1e3/((o-Te(this,Bs))/++og(this,Vs)._),l=(o-Te(this,Ws))/1e3/this.duration,d=Te(this,Fs)+l*this.playbackRate;d-Te(this,eo).valueAsNumber>0?Fe(this,io,this.playbackRate/this.duration/a):(Fe(this,io,.995*Te(this,io)),d=Te(this,eo).valueAsNumber+Te(this,io)),this.callback(d)}}),Fe(this,eo,e),this.callback=t,this.fps=r}start(){Te(this,nr)===0&&(Fe(this,to,performance.now()),Fe(this,Bs,Te(this,to)),Fe(this,Vs,0),Te(this,Ks).call(this))}stop(){Te(this,nr)!==0&&(cancelAnimationFrame(Te(this,nr)),Fe(this,nr,0))}update({start:e,duration:t,playbackRate:r}){let o=e-Te(this,eo).valueAsNumber,n=Math.abs(t-this.duration);(o>0||o<-.03||n>=.5)&&this.callback(e),Fe(this,Fs,e),Fe(this,Ws,performance.now()),this.duration=t,this.playbackRate=r}};eo=new WeakMap;Bs=new WeakMap;to=new WeakMap;qn=new WeakMap;Vs=new WeakMap;Ws=new WeakMap;Fs=new WeakMap;io=new WeakMap;nr=new WeakMap;Ks=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)),ge=(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),Ce=(i,e,t)=>(uc(i,e,"access private method"),t),ro,ar,Ys,Yn,Qs,zs,Qn,Zn,oo,no,ao,zn,hc,zp,lc,Zs,pc,Xs,mc,Js,vc,dc,Yp,Xn,js,cc,Qp,ng="video not loaded, unknown time.",ag=i=>{let e=i.range,t=Fi(+Zp(i)),r=Fi(+i.mediaSeekableEnd),o=t&&r?`${t} of ${r}`:ng;e.setAttribute("aria-valuetext",o)};function sg(i){return`
1392
1392
  <style>
1393
1393
  :host {
1394
1394
  --media-box-border-radius: 4px;
@@ -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="${bs.shadowRootOptions.mode}">
1595
- ${bs.getTemplateHTML({})}
1594
+ <template shadowrootmode="${Hs.shadowRootOptions.mode}">
1595
+ ${Hs.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 ws=(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))},kp=(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},On=class extends pt{constructor(){super(),me(this,Gr),me(this,Bd),me(this,Rs),me(this,xs),me(this,Ps),me(this,Nd),me(this,Dn),me(this,Hd),me(this,Fr,void 0),me(this,Xi,void 0),me(this,Is,void 0),me(this,Rn,void 0),me(this,Ms,void 0),me(this,Cs,void 0),me(this,xn,void 0),me(this,Pn,void 0),me(this,Kr,void 0),me(this,qr,void 0),me(this,Ud,r=>{this.dragging||(Er(r)&&(this.range.valueAsNumber=r),ae(this,qr)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),qe(this,Is,this.shadowRoot.querySelectorAll('[part~="box"]')),qe(this,Ms,this.shadowRoot.querySelector('[part~="preview-box"]')),qe(this,Cs,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);qe(this,xn,parseInt(t.getPropertyValue("--media-box-padding-left"))),qe(this,Pn,parseInt(t.getPropertyValue("--media-box-padding-right"))),qe(this,Xi,new Ls(this.range,ae(this,Ud),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",E("seek")),ye(this,Gr,Mn).call(this),qe(this,Fr,this.getRootNode()),(e=ae(this,Fr))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),ye(this,Gr,Mn).call(this),(e=ae(this,Fr))==null||e.removeEventListener("transitionstart",this),qe(this,Fr,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?(ae(this,Xi).update({start:ws(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),ye(this,Gr,Mn).call(this),Ng(this)):e===s.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=ae(this,Kr),this.updateBar()))}get mediaChaptersCues(){return ae(this,Kr)}set mediaChaptersCues(e){var t;qe(this,Kr,e),this.updateSegments((t=ae(this,Kr))==null?void 0:t.map(r=>({start:ws(this,r.startTime),end:ws(this,r.endTime)})))}get mediaPaused(){return C(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return C(this,s.MEDIA_LOADING)}set mediaLoading(e){I(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 x(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){P(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 C(this,s.MEDIA_ENDED)}set mediaEnded(e){I(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,c])=>l<=n&&n<=c))!=null?e:[];r=ws(this,a)}let{style:o}=X(this.shadowRoot,"#buffered");o.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=X(this.shadowRoot,"#current-rail"),r=X(this.shadowRoot,'[part~="current-box"]'),o=ye(this,Rs,Vd).call(this,ae(this,Cs)),n=ye(this,xs,Wd).call(this,o,this.range.valueAsNumber),a=ye(this,Ps,Fd).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":ye(this,Hd,Sp).call(this);break;case"pointermove":ye(this,Nd,Ap).call(this,e);break;case"pointerup":ae(this,qr)&&qe(this,qr,!1);break;case"pointerdown":qe(this,qr,!0);break;case"pointerleave":ye(this,Dn,Ds).call(this,null);break;case"transitionstart":Ae(e.target,this)&&setTimeout(()=>ye(this,Gr,Mn).call(this),0);break}}};Fr=new WeakMap;Xi=new WeakMap;Is=new WeakMap;Rn=new WeakMap;Ms=new WeakMap;Cs=new WeakMap;xn=new WeakMap;Pn=new WeakMap;Kr=new WeakMap;qr=new WeakMap;Gr=new WeakSet;Mn=function(){ye(this,Bd,Tp).call(this)?ae(this,Xi).start():ae(this,Xi).stop()};Bd=new WeakSet;Tp=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Sa(this)};Ud=new WeakMap;Rs=new WeakSet;Vd=function(i){var e;let r=((e=this.getAttribute("bounds")?at(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}};xs=new WeakSet;Wd=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};Ps=new WeakSet;Fd=function(i,e){let{width:t,min:r,max:o}=i.box,n=e*i.range.width;if(n<r+ae(this,xn)){let a=i.range.left-i.bounds.left-ae(this,xn);return`${n-t/2+a}px`}if(n>o-ae(this,Pn)){let a=i.bounds.right-i.range.right-ae(this,Pn);return`${n+t/2-a-i.range.width}px`}return 0};Nd=new WeakSet;Ap=function(i){let e=[...ae(this,Is)].some(h=>i.composedPath().includes(h));if(!this.dragging&&(e||!i.composedPath().includes(this))){ye(this,Dn,Ds).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=X(this.shadowRoot,"#preview-rail"),o=X(this.shadowRoot,'[part~="preview-box"]'),n=ye(this,Rs,Vd).call(this,ae(this,Ms)),a=(i.clientX-n.range.left)/n.range.width;a=Math.max(0,Math.min(1,a));let l=ye(this,xs,Wd).call(this,n,a),c=ye(this,Ps,Fd).call(this,n,a);r.style.transform=`translateX(${l})`,r.style.setProperty("--_range-width",`${n.range.width}`),o.style.setProperty("--_box-shift",`${c}`),o.style.setProperty("--_box-width",`${n.box.width}px`);let v=Math.round(ae(this,Rn))-Math.round(a*t);Math.abs(v)<1&&a>.01&&a<.99||(qe(this,Rn,a*t),ye(this,Dn,Ds).call(this,ae(this,Rn)))};Dn=new WeakSet;Ds=function(i){this.dispatchEvent(new d.CustomEvent(b.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Hd=new WeakSet;Sp=function(){ae(this,Xi).stop();let i=kp(this);this.dispatchEvent(new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};On.shadowRootOptions={mode:"open"};On.getContainerTemplateHTML=Hg;d.customElements.get("media-time-range")||d.customElements.define("media-time-range",On);var $g=1,Bg=i=>i.mediaMuted?0:i.mediaVolume,Vg=i=>`${Math.round(i*100)}%`,Kd=class extends pt{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 d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",E("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_VOLUME||e===s.MEDIA_MUTED)&&(this.range.valueAsNumber=Bg(this),this.range.setAttribute("aria-valuetext",Vg(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return H(this,s.MEDIA_VOLUME,$g)}set mediaVolume(e){B(this,s.MEDIA_VOLUME,e)}get mediaMuted(){return C(this,s.MEDIA_MUTED)}set mediaMuted(e){I(this,s.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return x(this,s.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){P(this,s.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",Kd);function Wg(i){return`
1608
+ `}var qs=(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},Jn=class extends ft{constructor(){super(),ge(this,ao),ge(this,hc),ge(this,Zs),ge(this,Xs),ge(this,Js),ge(this,dc),ge(this,Xn),ge(this,cc),ge(this,ro,void 0),ge(this,ar,void 0),ge(this,Ys,void 0),ge(this,Yn,void 0),ge(this,Qs,void 0),ge(this,zs,void 0),ge(this,Qn,void 0),ge(this,Zn,void 0),ge(this,oo,void 0),ge(this,no,void 0),ge(this,lc,r=>{this.dragging||(xr(r)&&(this.range.valueAsNumber=r),ce(this,no)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Ye(this,Ys,this.shadowRoot.querySelectorAll('[part~="box"]')),Ye(this,Qs,this.shadowRoot.querySelector('[part~="preview-box"]')),Ye(this,zs,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Ye(this,Qn,parseInt(t.getPropertyValue("--media-box-padding-left"))),Ye(this,Zn,parseInt(t.getPropertyValue("--media-box-padding-right"))),Ye(this,ar,new Gs(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",g("seek")),Ce(this,ao,zn).call(this),Ye(this,ro,this.getRootNode()),(e=ce(this,ro))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),Ce(this,ao,zn).call(this),(e=ce(this,ro))==null||e.removeEventListener("transitionstart",this),Ye(this,ro,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,ar).update({start:qs(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),Ce(this,ao,zn).call(this),ag(this)):e===s.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=ce(this,oo),this.updateBar()))}get mediaChaptersCues(){return ce(this,oo)}set mediaChaptersCues(e){var t;Ye(this,oo,e),this.updateSegments((t=ce(this,oo))==null?void 0:t.map(r=>({start:qs(this,r.startTime),end:qs(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=qs(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=Ce(this,Zs,pc).call(this,ce(this,zs)),n=Ce(this,Xs,mc).call(this,o,this.range.valueAsNumber),a=Ce(this,Js,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":Ce(this,cc,Qp).call(this);break;case"pointermove":Ce(this,dc,Yp).call(this,e);break;case"pointerup":ce(this,no)&&Ye(this,no,!1);break;case"pointerdown":Ye(this,no,!0);break;case"pointerleave":Ce(this,Xn,js).call(this,null);break;case"transitionstart":we(e.target,this)&&setTimeout(()=>Ce(this,ao,zn).call(this),0);break}}};ro=new WeakMap;ar=new WeakMap;Ys=new WeakMap;Yn=new WeakMap;Qs=new WeakMap;zs=new WeakMap;Qn=new WeakMap;Zn=new WeakMap;oo=new WeakMap;no=new WeakMap;ao=new WeakSet;zn=function(){Ce(this,hc,zp).call(this)?ce(this,ar).start():ce(this,ar).stop()};hc=new WeakSet;zp=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Fa(this)};lc=new WeakMap;Zs=new WeakSet;pc=function(i){var e;let r=((e=this.getAttribute("bounds")?dt(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}};Xs=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};Js=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,Qn)){let a=i.range.left-i.bounds.left-ce(this,Qn);return`${n-t/2+a}px`}if(n>o-ce(this,Zn)){let a=i.bounds.right-i.range.right-ce(this,Zn);return`${n+t/2-a-i.range.width}px`}return 0};dc=new WeakSet;Yp=function(i){let e=[...ce(this,Ys)].some(h=>i.composedPath().includes(h));if(!this.dragging&&(e||!i.composedPath().includes(this))){Ce(this,Xn,js).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=Ce(this,Zs,pc).call(this,ce(this,Qs)),a=(i.clientX-n.range.left)/n.range.width;a=Math.max(0,Math.min(1,a));let l=Ce(this,Xs,mc).call(this,n,a),d=Ce(this,Js,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 v=Math.round(ce(this,Yn))-Math.round(a*t);Math.abs(v)<1&&a>.01&&a<.99||(Ye(this,Yn,a*t),Ce(this,Xn,js).call(this,ce(this,Yn)))};Xn=new WeakSet;js=function(i){this.dispatchEvent(new c.CustomEvent(b.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};cc=new WeakSet;Qp=function(){ce(this,ar).stop();let i=Zp(this);this.dispatchEvent(new c.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Jn.shadowRootOptions={mode:"open"};Jn.getContainerTemplateHTML=sg;c.customElements.get("media-time-range")||c.customElements.define("media-time-range",Jn);var lg=1,dg=i=>i.mediaMuted?0:i.mediaVolume,cg=i=>`${Math.round(i*100)}%`,fc=class extends ft{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(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",g("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_VOLUME||e===s.MEDIA_MUTED)&&(this.range.valueAsNumber=dg(this),this.range.setAttribute("aria-valuetext",cg(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return H(this,s.MEDIA_VOLUME,lg)}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 ug(i){return`
1609
1609
  <style>
1610
1610
  :host {
1611
1611
  min-width: 4ch;
@@ -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 Fg(){return E("Loop")}var Un=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=E("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 C(this,s.MEDIA_LOOP)}set mediaLoop(e){I(this,s.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new d.CustomEvent(b.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Un.getSlotTemplateHTML=Wg;Un.getTooltipContentHTML=Fg;d.customElements.get("media-loop-button")||d.customElements.define("media-loop-button",Un);function Lp({anchor:i,floating:e,placement:t}){let r=Kg({anchor:i,floating:e}),{x:o,y:n}=Gg(r,t);return{x:o,y:n}}function Kg({anchor:i,floating:e}){return{anchor:qg(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function qg(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 Gg({anchor:i,floating:e},t){let r=zg(t)==="x"?"y":"x",o=r==="y"?"height":"width",n=wp(t),a=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,c=i[o]/2-e[o]/2,v;switch(n){case"top":v={x:a,y:i.y-e.height};break;case"bottom":v={x:a,y:i.y+i.height};break;case"right":v={x:i.x+i.width,y:l};break;case"left":v={x:i.x-e.width,y:l};break;default:v={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":v[r]-=c;break;case"end":v[r]+=c;break}return v}function wp(i){return i.split("-")[0]}function zg(i){return["top","bottom"].includes(wp(i))?"y":"x"}var oi=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},Os=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)},q=(i,e,t)=>(ic(i,e,"read from private field"),t?t.call(i):e.get(i)),Y=(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)},_t=(i,e,t,r)=>(ic(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Q=(i,e,t)=>(ic(i,e,"access private method"),t),yt,ji,ni,Us,Ns,er,$n,qd,Cp,Bs,rc,Vs,Hs,Gd,zd,Ip,Yd,Mp,Qd,Rp,zr,Yr,Qr,Bn,Ws,oc,Zd,xp,nc,Pp,Xd,Dp,ac,Op,Jd,Up,jd,Np,Nn,Fs,ec,Hp,Hn,Ks,$s,tc;function Tt({type:i,text:e,value:t,checked:r}){let o=j.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=j.createElement("span");return n.textContent=e,o.append(n),o}function et(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 Yg(i){return`
1637
+ `}function hg(){return g("Loop")}var jn=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=g("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(b.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};jn.getSlotTemplateHTML=ug;jn.getTooltipContentHTML=hg;c.customElements.get("media-loop-button")||c.customElements.define("media-loop-button",jn);function Xp({anchor:i,floating:e,placement:t}){let r=pg({anchor:i,floating:e}),{x:o,y:n}=vg(r,t);return{x:o,y:n}}function pg({anchor:i,floating:e}){return{anchor:mg(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function mg(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 vg({anchor:i,floating:e},t){let r=fg(t)==="x"?"y":"x",o=r==="y"?"height":"width",n=Jp(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,v;switch(n){case"top":v={x:a,y:i.y-e.height};break;case"bottom":v={x:a,y:i.y+i.height};break;case"right":v={x:i.x+i.width,y:l};break;case"left":v={x:i.x-e.width,y:l};break;default:v={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":v[r]-=d;break;case"end":v[r]+=d;break}return v}function Jp(i){return i.split("-")[0]}function fg(i){return["top","bottom"].includes(Jp(i))?"y":"x"}var ui=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},el=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)},At=(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),St,lr,hi,tl,il,dr,ia,Ec,jp,nl,wc,al,rl,gc,bc,em,_c,tm,yc,im,so,lo,co,ra,sl,Mc,Tc,rm,Rc,om,Ac,nm,xc,am,Sc,sm,kc,lm,ea,ll,Lc,dm,ta,dl,ol,Cc;function kt({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 ot(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 Eg(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 Ji={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},se=class extends d.HTMLElement{constructor(){if(super(),Y(this,qd),Y(this,Bs),Y(this,Hs),Y(this,zd),Y(this,Yd),Y(this,Qd),Y(this,Qr),Y(this,Ws),Y(this,Zd),Y(this,nc),Y(this,Xd),Y(this,ac),Y(this,Jd),Y(this,jd),Y(this,Nn),Y(this,ec),Y(this,Hn),Y(this,$s),Y(this,yt,null),Y(this,ji,null),Y(this,ni,null),Y(this,Us,new Set),Y(this,Ns,void 0),Y(this,er,!1),Y(this,$n,null),Y(this,Vs,()=>{let e=q(this,Us),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}));_t(this,Us,t)}),Y(this,zr,()=>{Q(this,Qr,Bn).call(this),Q(this,Ws,oc).call(this,!1)}),Y(this,Yr,()=>{Q(this,Qr,Bn).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),_t(this,Ns,new MutationObserver(q(this,Vs))),q(this,Ns).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[Ji.DISABLED,Ji.HIDDEN,Ji.STYLE,Ji.ANCHOR,U.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":Q(this,qd,Cp).call(this,e);break;case"invoke":Q(this,zd,Ip).call(this,e);break;case"click":Q(this,Zd,xp).call(this,e);break;case"toggle":Q(this,Xd,Dp).call(this,e);break;case"focusout":Q(this,Jd,Up).call(this,e);break;case"keydown":Q(this,jd,Np).call(this,e);break}}connectedCallback(){var e,t;_t(this,$n,Xo(this.shadowRoot,":host")),Q(this,Hs,Gd).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),_t(this,yt,ya(this)),(t=(e=q(this,yt))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(xt(Vn(this),q(this,zr)),xt(this,q(this,Yr))),Q(this,Bs,rc).call(this)}disconnectedCallback(){var e,t;Pt(Vn(this),q(this,zr)),Pt(this,q(this,Yr)),this.disable(),(t=(e=q(this,yt))==null?void 0:e.unassociateElement)==null||t.call(e,this),_t(this,yt,null)}attributeChangedCallback(e,t,r){var o,n,a,l;e===Ji.HIDDEN&&r!==t?(q(this,er)||_t(this,er,!0),this.hidden?Q(this,Qd,Rp).call(this):Q(this,Yd,Mp).call(this),this.dispatchEvent(new Os({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===U.MEDIA_CONTROLLER?(t&&((n=(o=q(this,yt))==null?void 0:o.unassociateElement)==null||n.call(o,this),_t(this,yt,null)),r&&this.isConnected&&(_t(this,yt,ya(this)),(l=(a=q(this,yt))==null?void 0:a.associateElement)==null||l.call(a,this))):e===Ji.DISABLED&&r!==t?r==null?this.enable():this.disable():e===Ji.STYLE&&r!==t&&Q(this,Hs,Gd).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=Oi(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Qg)}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&&Q(this,$s,tc).call(this,t)}focus(){if(_t(this,ji,Zo()),this.items.length){Q(this,Hn,Ks).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=Q(this,Nn,Fs).call(this,e);r&&(Q(this,$s,tc).call(this,r,r.type==="checkbox"),q(this,ni)&&!this.hidden&&((t=q(this,ji))==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=Q(this,Nn,Fs).call(this,e))!=null?t:Q(this,ec,Hp).call(this))!=null?r:n[0],l=n.indexOf(a),c=Math.max(0,l);o==="ArrowDown"?c++:o==="ArrowUp"?c--:e.key==="Home"?c=0:e.key==="End"&&(c=n.length-1),c<0&&(c=n.length-1),c>n.length-1&&(c=0),Q(this,Hn,Ks).call(this,n[c]),n[c].focus()}};yt=new WeakMap;ji=new WeakMap;ni=new WeakMap;Us=new WeakMap;Ns=new WeakMap;er=new WeakMap;$n=new WeakMap;qd=new WeakSet;Cp=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)&&Q(this,Bs,rc).call(this),e.name||q(this,Vs).call(this)};Bs=new WeakSet;rc=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};Vs=new WeakMap;Hs=new WeakSet;Gd=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")};zd=new WeakSet;Ip=function(i){_t(this,ni,i.relatedTarget),Ae(this,i.relatedTarget)||(this.hidden=!this.hidden)};Yd=new WeakSet;Mp=function(){var i;(i=q(this,ni))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),xt(Vn(this),q(this,zr)),xt(this,q(this,Yr))};Qd=new WeakSet;Rp=function(){var i;(i=q(this,ni))==null||i.setAttribute("aria-expanded","false"),Pt(Vn(this),q(this,zr)),Pt(this,q(this,Yr))};zr=new WeakMap;Yr=new WeakMap;Qr=new WeakSet;Bn=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=Lp({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let o=Vn(this).getBoundingClientRect(),n=o.width-e-i,a=o.height-t-this.offsetHeight,{style:l}=q(this,$n);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${a}px`);let c=getComputedStyle(this),h=l.getPropertyValue("--_menu-bottom")===c.bottom?a:parseFloat(c.bottom),p=o.height-h-parseFloat(c.marginBottom);this.style.setProperty("--_menu-max-height",`${p}px`)};Ws=new WeakSet;oc=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=q(this,$n);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`),Q(this,Qr,Bn).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),Q(this,Qr,Bn).call(this);r.removeProperty("--media-menu-transition-in")};Zd=new WeakSet;xp=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(q(this,nc,Pp))){(e=q(this,ji))==null||e.focus(),this.hidden=!0;return}let t=Q(this,Nn,Fs).call(this,i);!t||t.hasAttribute("disabled")||(Q(this,Hn,Ks).call(this,t),this.handleSelect(i))};nc=new WeakSet;Pp=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"]'))};Xd=new WeakSet;Dp=function(i){if(i.target===this)return;Q(this,ac,Op).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 oi({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);Q(this,Ws,oc).call(this,!0)};ac=new WeakSet;Op=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Jd=new WeakSet;Up=function(i){var e;Ae(this,i.relatedTarget)||(q(this,er)&&((e=q(this,ji))==null||e.focus()),q(this,ni)&&q(this,ni)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};jd=new WeakSet;Np=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:c,metaKey:v}=i;if(!(l||c||v)&&this.keysUsed.includes(a))if(i.preventDefault(),i.stopPropagation(),a==="Tab"){if(q(this,er)){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=q(this,ji))==null||n.focus(),q(this,er)&&(this.hidden=!0)):a==="Enter"||a===" "?this.handleSelect(i):this.handleMove(i)};Nn=new WeakSet;Fs=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};ec=new WeakSet;Hp=function(){return this.items.find(i=>i.tabIndex===0)};Hn=new WeakSet;Ks=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};$s=new WeakSet;tc=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}))};se.shadowRootOptions={mode:"open"};se.getTemplateHTML=Yg;function Qg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function Vn(i){var e;return(e=i.getAttribute("bounds")?at(i,`#${i.getAttribute("bounds")}`):Z(i)||i.parentElement)!=null?e:i}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",se);var hc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},At=(i,e,t)=>(hc(i,e,"read from private field"),t?t.call(i):e.get(i)),Nt=(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)},sc=(i,e,t,r)=>(hc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),tt=(i,e,t)=>(hc(i,e,"access private method"),t),qs,Fn,lc,$p,zs,pc,mc,Bp,St,Zr,Kn,dc,Vp,Gs,cc;function Zg(i){return`
1812
+ `}var sr={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},ue=class extends c.HTMLElement{constructor(){if(super(),Q(this,Ec),Q(this,nl),Q(this,rl),Q(this,bc),Q(this,_c),Q(this,yc),Q(this,co),Q(this,sl),Q(this,Tc),Q(this,Rc),Q(this,Ac),Q(this,xc),Q(this,Sc),Q(this,kc),Q(this,ea),Q(this,Lc),Q(this,ta),Q(this,ol),Q(this,St,null),Q(this,lr,null),Q(this,hi,null),Q(this,tl,new Set),Q(this,il,void 0),Q(this,dr,!1),Q(this,ia,null),Q(this,al,()=>{let e=G(this,tl),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}));At(this,tl,t)}),Q(this,so,()=>{Z(this,co,ra).call(this),Z(this,sl,Mc).call(this,!1)}),Q(this,lo,()=>{Z(this,co,ra).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),At(this,il,new MutationObserver(G(this,al))),G(this,il).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[sr.DISABLED,sr.HIDDEN,sr.STYLE,sr.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,jp).call(this,e);break;case"invoke":Z(this,bc,em).call(this,e);break;case"click":Z(this,Tc,rm).call(this,e);break;case"toggle":Z(this,Ac,nm).call(this,e);break;case"focusout":Z(this,Sc,sm).call(this,e);break;case"keydown":Z(this,kc,lm).call(this,e);break}}connectedCallback(){var e,t;At(this,ia,vn(this.shadowRoot,":host")),Z(this,rl,gc).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),At(this,St,Ba(this)),(t=(e=G(this,St))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Nt(oa(this),G(this,so)),Nt(this,G(this,lo))),Z(this,nl,wc).call(this)}disconnectedCallback(){var e,t;Ut(oa(this),G(this,so)),Ut(this,G(this,lo)),this.disable(),(t=(e=G(this,St))==null?void 0:e.unassociateElement)==null||t.call(e,this),At(this,St,null)}attributeChangedCallback(e,t,r){var o,n,a,l;e===sr.HIDDEN&&r!==t?(G(this,dr)||At(this,dr,!0),this.hidden?Z(this,yc,im).call(this):Z(this,_c,tm).call(this),this.dispatchEvent(new el({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===N.MEDIA_CONTROLLER?(t&&((n=(o=G(this,St))==null?void 0:o.unassociateElement)==null||n.call(o,this),At(this,St,null)),r&&this.isConnected&&(At(this,St,Ba(this)),(l=(a=G(this,St))==null?void 0:a.associateElement)==null||l.call(a,this))):e===sr.DISABLED&&r!==t?r==null?this.enable():this.disable():e===sr.STYLE&&r!==t&&Z(this,rl,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=Ki(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(gg)}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,ol,Cc).call(this,t)}focus(){if(At(this,lr,mn()),this.items.length){Z(this,ta,dl).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,ea,ll).call(this,e);r&&(Z(this,ol,Cc).call(this,r,r.type==="checkbox"),G(this,hi)&&!this.hidden&&((t=G(this,lr))==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,ea,ll).call(this,e))!=null?t:Z(this,Lc,dm).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,ta,dl).call(this,n[d]),n[d].focus()}};St=new WeakMap;lr=new WeakMap;hi=new WeakMap;tl=new WeakMap;il=new WeakMap;dr=new WeakMap;ia=new WeakMap;Ec=new WeakSet;jp=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,nl,wc).call(this),e.name||G(this,al).call(this)};nl=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};al=new WeakMap;rl=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;em=function(i){At(this,hi,i.relatedTarget),we(this,i.relatedTarget)||(this.hidden=!this.hidden)};_c=new WeakSet;tm=function(){var i;(i=G(this,hi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Nt(oa(this),G(this,so)),Nt(this,G(this,lo))};yc=new WeakSet;im=function(){var i;(i=G(this,hi))==null||i.setAttribute("aria-expanded","false"),Ut(oa(this),G(this,so)),Ut(this,G(this,lo))};so=new WeakMap;lo=new WeakMap;co=new WeakSet;ra=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=Xp({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let o=oa(this).getBoundingClientRect(),n=o.width-e-i,a=o.height-t-this.offsetHeight,{style:l}=G(this,ia);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),m=o.height-h-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${m}px`)};sl=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,ia);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,co,ra).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),Z(this,co,ra).call(this);r.removeProperty("--media-menu-transition-in")};Tc=new WeakSet;rm=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(G(this,Rc,om))){(e=G(this,lr))==null||e.focus(),this.hidden=!0;return}let t=Z(this,ea,ll).call(this,i);!t||t.hasAttribute("disabled")||(Z(this,ta,dl).call(this,t),this.handleSelect(i))};Rc=new WeakSet;om=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;nm=function(i){if(i.target===this)return;Z(this,xc,am).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 ui({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);Z(this,sl,Mc).call(this,!0)};xc=new WeakSet;am=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Sc=new WeakSet;sm=function(i){var e;we(this,i.relatedTarget)||(G(this,dr)&&((e=G(this,lr))==null||e.focus()),G(this,hi)&&G(this,hi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};kc=new WeakSet;lm=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:d,metaKey:v}=i;if(!(l||d||v)&&this.keysUsed.includes(a))if(i.preventDefault(),i.stopPropagation(),a==="Tab"){if(G(this,dr)){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,lr))==null||n.focus(),G(this,dr)&&(this.hidden=!0)):a==="Enter"||a===" "?this.handleSelect(i):this.handleMove(i)};ea=new WeakSet;ll=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Lc=new WeakSet;dm=function(){return this.items.find(i=>i.tabIndex===0)};ta=new WeakSet;dl=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};ol=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=Eg;function gg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function oa(i){var e;return(e=i.getAttribute("bounds")?dt(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)},Lt=(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),nt=(i,e,t)=>(Hc(i,e,"access private method"),t),cl,aa,Dc,cm,hl,$c,Bc,um,Ct,uo,sa,Oc,hm,ul,Nc;function bg(i){return`
1813
1813
  <style>
1814
1814
  :host {
1815
1815
  transition: var(--media-menu-item-transition,
@@ -1927,8 +1927,8 @@ bp-player[has-error] {
1927
1927
  ${this.getSuffixSlotInnerHTML(i)}
1928
1928
  </slot>
1929
1929
  <slot name="submenu"></slot>
1930
- `}function Xg(i){return""}var Ge={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Ve=class extends d.HTMLElement{constructor(){if(super(),Nt(this,lc),Nt(this,zs),Nt(this,mc),Nt(this,Zr),Nt(this,dc),Nt(this,Gs),Nt(this,qs,!1),Nt(this,Fn,void 0),Nt(this,St,()=>{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=j.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[Ge.TYPE,Ge.DISABLED,Ge.CHECKED,Ge.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Wn(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":tt(this,lc,$p).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":tt(this,dc,Vp).call(this,e);break;case"keyup":tt(this,Zr,Kn).call(this,e);break}}attributeChangedCallback(e,t,r){e===Ge.CHECKED&&Wn(this)&&!At(this,qs)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===Ge.TYPE&&r!==t?this.role="menuitem"+r:e===Ge.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Ge.DISABLED)||this.enable(),this.role="menuitem"+this.type,sc(this,Fn,uc(this,this.parentNode)),tt(this,Gs,cc).call(this),this.submenuElement&&tt(this,zs,pc).call(this)}disconnectedCallback(){this.disable(),tt(this,Gs,cc).call(this),sc(this,Fn,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Oi(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(Ge.TYPE))!=null?e:""}set type(e){this.setAttribute(Ge.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Ge.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Ge.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Wn(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Wn(this)&&(sc(this,qs,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Wn(this)||this.invokeTargetElement&&Ae(this,e.target)&&this.invokeTargetElement.dispatchEvent(new oi({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};qs=new WeakMap;Fn=new WeakMap;lc=new WeakSet;$p=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?tt(this,zs,pc).call(this):tt(this,mc,Bp).call(this))};zs=new WeakSet;pc=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",At(this,St)),this.submenuElement.addEventListener("addmenuitem",At(this,St)),this.submenuElement.addEventListener("removemenuitem",At(this,St)),At(this,St).call(this)};mc=new WeakSet;Bp=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",At(this,St)),this.submenuElement.removeEventListener("addmenuitem",At(this,St)),this.submenuElement.removeEventListener("removemenuitem",At(this,St)),At(this,St).call(this)};St=new WeakMap;Zr=new WeakSet;Kn=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",tt(this,Zr,Kn));return}this.handleClick(i)};dc=new WeakSet;Vp=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",tt(this,Zr,Kn));return}this.addEventListener("keyup",tt(this,Zr,Kn),{once:!0})};Gs=new WeakSet;cc=function(){var i;let e=(i=At(this,Fn))==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")};Ve.shadowRootOptions={mode:"open"};Ve.getTemplateHTML=Zg;Ve.getSuffixSlotInnerHTML=Xg;function Wn(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)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",Ve);function Jg(i){return`
1931
- ${se.getTemplateHTML(i)}
1930
+ `}function _g(i){return""}var Qe={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Ke=class extends c.HTMLElement{constructor(){if(super(),Vt(this,Dc),Vt(this,hl),Vt(this,Bc),Vt(this,uo),Vt(this,Oc),Vt(this,ul),Vt(this,cl,!1),Vt(this,aa,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,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"),na(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":nt(this,Dc,cm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":nt(this,Oc,hm).call(this,e);break;case"keyup":nt(this,uo,sa).call(this,e);break}}attributeChangedCallback(e,t,r){e===Qe.CHECKED&&na(this)&&!Lt(this,cl)?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,aa,Uc(this,this.parentNode)),nt(this,ul,Nc).call(this),this.submenuElement&&nt(this,hl,$c).call(this)}disconnectedCallback(){this.disable(),nt(this,ul,Nc).call(this),Pc(this,aa,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Ki(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(na(this))return this.getAttribute("aria-checked")==="true"}set checked(e){na(this)&&(Pc(this,cl,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){na(this)||this.invokeTargetElement&&we(this,e.target)&&this.invokeTargetElement.dispatchEvent(new ui({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};cl=new WeakMap;aa=new WeakMap;Dc=new WeakSet;cm=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?nt(this,hl,$c).call(this):nt(this,Bc,um).call(this))};hl=new WeakSet;$c=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",Lt(this,Ct)),this.submenuElement.addEventListener("addmenuitem",Lt(this,Ct)),this.submenuElement.addEventListener("removemenuitem",Lt(this,Ct)),Lt(this,Ct).call(this)};Bc=new WeakSet;um=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",Lt(this,Ct)),this.submenuElement.removeEventListener("addmenuitem",Lt(this,Ct)),this.submenuElement.removeEventListener("removemenuitem",Lt(this,Ct)),Lt(this,Ct).call(this)};Ct=new WeakMap;uo=new WeakSet;sa=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",nt(this,uo,sa));return}this.handleClick(i)};Oc=new WeakSet;hm=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",nt(this,uo,sa));return}this.addEventListener("keyup",nt(this,uo,sa),{once:!0})};ul=new WeakSet;Nc=function(){var i;let e=(i=Lt(this,aa))==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")};Ke.shadowRootOptions={mode:"open"};Ke.getTemplateHTML=bg;Ke.getSuffixSlotInnerHTML=_g;function na(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",Ke);function yg(i){return`
1931
+ ${ue.getTemplateHTML(i)}
1932
1932
  <style>
1933
1933
  :host {
1934
1934
  --_menu-bg: rgb(20 20 30 / .8);
@@ -1962,8 +1962,8 @@ bp-player[has-error] {
1962
1962
  --media-settings-menu-item-opacity: 0;
1963
1963
  }
1964
1964
  </style>
1965
- `}var qn=class extends se{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-settings-menu-button")}};qn.getTemplateHTML=Jg;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",qn);function jg(i){return`
1966
- ${Ve.getTemplateHTML.call(this,i)}
1965
+ `}var la=class extends ue{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-settings-menu-button")}};la.getTemplateHTML=yg;c.customElements.get("media-settings-menu")||c.customElements.define("media-settings-menu",la);function Tg(i){return`
1966
+ ${Ke.getTemplateHTML.call(this,i)}
1967
1967
  <style>
1968
1968
  slot:not([name="submenu"]) {
1969
1969
  opacity: var(--media-settings-menu-item-opacity, var(--media-menu-item-opacity));
@@ -1973,11 +1973,11 @@ bp-player[has-error] {
1973
1973
  background: transparent;
1974
1974
  }
1975
1975
  </style>
1976
- `}function eE(i){return`
1976
+ `}function Ag(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 tr=class extends Ve{};tr.shadowRootOptions={mode:"open"};tr.getTemplateHTML=jg;tr.getSuffixSlotInnerHTML=eE;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",tr);var Pe=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=Oi(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new oi({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",Pe);function tE(){return`
1980
+ `}var cr=class extends Ke{};cr.shadowRootOptions={mode:"open"};cr.getTemplateHTML=Tg;cr.getSuffixSlotInnerHTML=Ag;c.customElements.get("media-settings-menu-item")||c.customElements.define("media-settings-menu-item",cr);var He=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=Ki(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new ui({relatedTarget:this}))}};c.customElements.get("media-chrome-menu-button")||c.customElements.define("media-chrome-menu-button",He);function Sg(){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 iE(){return E("Settings")}var Xr=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",E("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-settings-menu")}};Xr.getSlotTemplateHTML=tE;Xr.getTooltipContentHTML=iE;d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",Xr);var Ec=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Wp=(i,e,t)=>(Ec(i,e,"read from private field"),t?t.call(i):e.get(i)),Ys=(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)=>(Ec(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Qs=(i,e,t)=>(Ec(i,e,"access private method"),t),Gn,Js,Zs,fc,Xs,gc,js=class extends se{constructor(){super(...arguments),Ys(this,Zs),Ys(this,Xs),Ys(this,Gn,[]),Ys(this,Js,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,Gn,qu(r??"")),Qs(this,Zs,fc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Qs(this,Xs,gc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Qs(this,Xs,gc))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=Z(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Wp(this,Gn)}set mediaAudioTrackList(e){vc(this,Gn,e),Qs(this,Zs,fc).call(this)}get mediaAudioTrackEnabled(){var e;return(e=x(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){P(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};Gn=new WeakMap;Js=new WeakMap;Zs=new WeakSet;fc=function(){if(Wp(this,Js)===JSON.stringify(this.mediaAudioTrackList))return;vc(this,Js,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=Tt({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(et(this,"checked-indicator")),this.defaultSlot.append(r)}};Xs=new WeakSet;gc=function(){if(this.value==null)return;let i=new d.CustomEvent(b.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-audio-track-menu")||d.customElements.define("media-audio-track-menu",js);var rE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1991
+ `}function kg(){return g("Settings")}var ho=class extends He{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",g("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-settings-menu")}};ho.getSlotTemplateHTML=Sg;ho.getTooltipContentHTML=kg;c.customElements.get("media-settings-menu-button")||c.customElements.define("media-settings-menu-button",ho);var Kc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pm=(i,e,t)=>(Kc(i,e,"read from private field"),t?t.call(i):e.get(i)),pl=(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),ml=(i,e,t)=>(Kc(i,e,"access private method"),t),da,El,vl,Wc,fl,Fc,gl=class extends ue{constructor(){super(...arguments),pl(this,vl),pl(this,fl),pl(this,da,[]),pl(this,El,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,da,fh(r??"")),ml(this,vl,Wc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ml(this,fl,Fc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ml(this,fl,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 pm(this,da)}set mediaAudioTrackList(e){Vc(this,da,e),ml(this,vl,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)}};da=new WeakMap;El=new WeakMap;vl=new WeakSet;Wc=function(){if(pm(this,El)===JSON.stringify(this.mediaAudioTrackList))return;Vc(this,El,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=kt({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(ot(this,"checked-indicator")),this.defaultSlot.append(r)}};fl=new WeakSet;Fc=function(){if(this.value==null)return;let i=new c.CustomEvent(b.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",gl);var Lg=`<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 oE(){return`
1994
+ </svg>`;function Cg(){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">${rE}</slot>
2001
- `}function nE(){return E("Audio")}var Fp=i=>{let e=E("Audio");i.setAttribute("aria-label",e)},Jr=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Fp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LANG&&Fp(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Z(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=x(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){P(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};Jr.getSlotTemplateHTML=oE;Jr.getTooltipContentHTML=nE;d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",Jr);var Tc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},aE=(i,e,t)=>(Tc(i,e,"read from private field"),t?t.call(i):e.get(i)),bc=(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)},sE=(i,e,t,r)=>(Tc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),el=(i,e,t)=>(Tc(i,e,"access private method"),t),rl,tl,_c,il,yc,lE=`
2000
+ <slot name="icon">${Lg}</slot>
2001
+ `}function Ig(){return g("Audio")}var mm=i=>{let e=g("Audio");i.setAttribute("aria-label",e)},po=class extends He{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),mm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LANG&&mm(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)}};po.getSlotTemplateHTML=Cg;po.getTooltipContentHTML=Ig;c.customElements.get("media-audio-track-menu-button")||c.customElements.define("media-audio-track-menu-button",po);var Yc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},wg=(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)},Mg=(i,e,t,r)=>(Yc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),bl=(i,e,t)=>(Yc(i,e,"access private method"),t),Tl,_l,qc,yl,zc,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 dE(i){return`
2005
- ${se.getTemplateHTML(i)}
2006
- <slot name="captions-indicator" hidden>${lE}</slot>
2007
- `}var zn=class extends se{constructor(){super(...arguments),bc(this,tl),bc(this,il),bc(this,rl,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?el(this,tl,_c).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",el(this,tl,_c).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",el(this,il,yc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",el(this,il,yc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Kp(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){qp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Kp(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){qp(this,s.MEDIA_SUBTITLES_SHOWING,e)}};rl=new WeakMap;tl=new WeakSet;_c=function(){var i;let e=aE(this,rl)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(s.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;sE(this,rl,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,o=Tt({type:"radio",text:this.formatMenuItemText(E("Off")),value:"off",checked:r});o.prepend(et(this,"checked-indicator")),this.defaultSlot.append(o);let n=this.mediaSubtitlesList;for(let a of n){let l=Tt({type:"radio",text:this.formatMenuItemText(a.label,a),value:Da(a),checked:this.value==Da(a)});l.prepend(et(this,"checked-indicator")),((i=a.kind)!=null?i:"subs")==="captions"&&l.append(et(this,"captions-indicator")),this.defaultSlot.append(l)}};il=new WeakSet;yc=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 d.CustomEvent(b.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new d.CustomEvent(b.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};zn.getTemplateHTML=dE;var Kp=(i,e)=>{let t=i.getAttribute(e);return t?$i(t):[]},qp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Ot(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",zn);var cE=`<svg aria-hidden="true" viewBox="0 0 26 24">
2004
+ </svg>`;function xg(i){return`
2005
+ ${ue.getTemplateHTML(i)}
2006
+ <slot name="captions-indicator" hidden>${Rg}</slot>
2007
+ `}var ca=class extends ue{constructor(){super(...arguments),Gc(this,_l),Gc(this,yl),Gc(this,Tl,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?bl(this,_l,qc).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",bl(this,_l,qc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",bl(this,yl,zc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",bl(this,yl,zc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return vm(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){fm(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return vm(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){fm(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Tl=new WeakMap;_l=new WeakSet;qc=function(){var i;let e=wg(this,Tl)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(s.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;Mg(this,Tl,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,o=kt({type:"radio",text:this.formatMenuItemText(g("Off")),value:"off",checked:r});o.prepend(ot(this,"checked-indicator")),this.defaultSlot.append(o);let n=this.mediaSubtitlesList;for(let a of n){let l=kt({type:"radio",text:this.formatMenuItemText(a.label,a),value:ja(a),checked:this.value==ja(a)});l.prepend(ot(this,"checked-indicator")),((i=a.kind)!=null?i:"subs")==="captions"&&l.append(ot(this,"captions-indicator")),this.defaultSlot.append(l)}};yl=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(b.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new c.CustomEvent(b.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};ca.getTemplateHTML=xg;var vm=(i,e)=>{let t=i.getAttribute(e);return t?Yi(t):[]},fm=(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",ca);var Pg=`<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>`,uE=`<svg aria-hidden="true" viewBox="0 0 26 24">
2009
+ </svg>`,Dg=`<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 hE(){return`
2011
+ </svg>`;function Og(){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">${cE}</slot>
2029
- <slot name="off">${uE}</slot>
2028
+ <slot name="on">${Pg}</slot>
2029
+ <slot name="off">${Dg}</slot>
2030
2030
  </slot>
2031
- `}function pE(){return E("Captions")}var Gp=i=>{i.setAttribute("data-captions-enabled",Oa(i).toString())},zp=i=>{i.setAttribute("aria-label",E("closed captions"))},jr=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING,s.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),zp(this),Gp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING?Gp(this):e===s.MEDIA_LANG&&zp(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Z(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Yp(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Qp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Yp(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Qp(this,s.MEDIA_SUBTITLES_SHOWING,e)}};jr.getSlotTemplateHTML=hE;jr.getTooltipContentHTML=pE;var Yp=(i,e)=>{let t=i.getAttribute(e);return t?$i(t):[]},Qp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Ot(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",jr);var Zp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},to=(i,e,t)=>(Zp(i,e,"read from private field"),t?t.call(i):e.get(i)),Ac=(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)},eo=(i,e,t)=>(Zp(i,e,"access private method"),t),ai,io,Yn,ol,kc,Sc={RATES:"rates"},nl=class extends se{constructor(){super(),Ac(this,io),Ac(this,ol),Ac(this,ai,new Xt(this,Sc.RATES,{defaultValue:Id})),eo(this,io,Yn).call(this)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,Sc.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,eo(this,io,Yn).call(this)):e===Sc.RATES&&t!=r&&(to(this,ai).value=r,eo(this,io,Yn).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",eo(this,ol,kc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",eo(this,ol,kc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-playback-rate-menu-button")}get rates(){return to(this,ai)}set rates(e){e?Array.isArray(e)?to(this,ai).value=e.join(" "):typeof e=="string"&&(to(this,ai).value=e):to(this,ai).value="",eo(this,io,Yn).call(this)}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,Yi)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};ai=new WeakMap;io=new WeakSet;Yn=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(to(this,ai)).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=Tt({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});o.prepend(et(this,"checked-indicator")),this.defaultSlot.append(o)}};ol=new WeakSet;kc=function(){if(!this.value)return;let i=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-playback-rate-menu")||d.customElements.define("media-playback-rate-menu",nl);var al=1;function mE(i){return`
2031
+ `}function Ng(){return g("Captions")}var Em=i=>{i.setAttribute("data-captions-enabled",es(i).toString())},gm=i=>{i.setAttribute("aria-label",g("closed captions"))},mo=class extends He{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING,s.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),gm(this),Em(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING?Em(this):e===s.MEDIA_LANG&&gm(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 bm(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){_m(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return bm(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){_m(this,s.MEDIA_SUBTITLES_SHOWING,e)}};mo.getSlotTemplateHTML=Og;mo.getTooltipContentHTML=Ng;var bm=(i,e)=>{let t=i.getAttribute(e);return t?Yi(t):[]},_m=(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",mo);var ym=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},fo=(i,e,t)=>(ym(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)},vo=(i,e,t)=>(ym(i,e,"access private method"),t),pi,Eo,ua,Al,Xc,Zc={RATES:"rates"},Sl=class extends ue{constructor(){super(),Qc(this,Eo),Qc(this,Al),Qc(this,pi,new oi(this,Zc.RATES,{defaultValue:tc})),vo(this,Eo,ua).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,vo(this,Eo,ua).call(this)):e===Zc.RATES&&t!=r&&(fo(this,pi).value=r,vo(this,Eo,ua).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",vo(this,Al,Xc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",vo(this,Al,Xc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-playback-rate-menu-button")}get rates(){return fo(this,pi)}set rates(e){e?Array.isArray(e)?fo(this,pi).value=e.join(" "):typeof e=="string"&&(fo(this,pi).value=e):fo(this,pi).value="",vo(this,Eo,ua).call(this)}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,rr)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};pi=new WeakMap;Eo=new WeakSet;ua=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(fo(this,pi)).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=kt({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});o.prepend(ot(this,"checked-indicator")),this.defaultSlot.append(o)}};Al=new WeakSet;Xc=function(){if(!this.value)return;let i=new c.CustomEvent(b.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",Sl);var kl=1;function Ug(i){return`
2032
2032
  <style>
2033
2033
  :host {
2034
2034
  min-width: 5ch;
@@ -2043,18 +2043,18 @@ bp-player[has-error] {
2043
2043
  display: none;
2044
2044
  }
2045
2045
  </style>
2046
- <slot name="icon">${i.mediaplaybackrate||al}x</slot>
2047
- `}function vE(){return E("Playback rate")}var ro=class extends Pe{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:al}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)?al:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",E("Playback rate {playbackRate}",{playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,al)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};ro.getSlotTemplateHTML=mE;ro.getTooltipContentHTML=vE;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",ro);var wc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qn=(i,e,t)=>(wc(i,e,"read from private field"),t?t.call(i):e.get(i)),sl=(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)},Xp=(i,e,t,r)=>(wc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),oo=(i,e,t)=>(wc(i,e,"access private method"),t),Zn,ao,no,Xn,ll,Lc,dl=class extends se{constructor(){super(...arguments),sl(this,no),sl(this,ll),sl(this,Zn,[]),sl(this,ao,{})}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",oo(this,no,Xn).call(this)):e===s.MEDIA_RENDITION_LIST&&t!==r?(Xp(this,Zn,Fu(r)),oo(this,no,Xn).call(this)):e===s.MEDIA_HEIGHT&&t!==r&&oo(this,no,Xn).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",oo(this,ll,Lc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",oo(this,ll,Lc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return Qn(this,Zn)}set mediaRenditionList(e){Xp(this,Zn,e),oo(this,no,Xn).call(this)}get mediaRenditionSelected(){return x(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){P(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)}};Zn=new WeakMap;ao=new WeakMap;no=new WeakSet;Xn=function(){if(Qn(this,ao).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&Qn(this,ao).mediaHeight===this.mediaHeight)return;Qn(this,ao).mediaRenditionList=JSON.stringify(this.mediaRenditionList),Qn(this,ao).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)}),c=Tt({type:"radio",text:l,value:`${a.id}`,checked:a.selected&&!t});c.prepend(et(this,"checked-indicator")),this.defaultSlot.append(c)}let r=e&&this.showRenditionBitrate(e),o=t?e?this.formatMenuItemText(`${E("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${E("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(E("Auto")),n=Tt({type:"radio",text:o,value:"auto",checked:t});n.dataset.description=o,n.prepend(et(this,"checked-indicator")),this.defaultSlot.append(n)};ll=new WeakSet;Lc=function(){if(this.value==null)return;let i=new d.CustomEvent(b.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",dl);var fE=`<svg aria-hidden="true" viewBox="0 0 24 24">
2046
+ <slot name="icon">${i.mediaplaybackrate||kl}x</slot>
2047
+ `}function Hg(){return g("Playback rate")}var go=class extends He{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:kl}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)?kl:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",g("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,kl)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};go.getSlotTemplateHTML=Ug;go.getTooltipContentHTML=Hg;c.customElements.get("media-playback-rate-menu-button")||c.customElements.define("media-playback-rate-menu-button",go);var jc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ha=(i,e,t)=>(jc(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)},Tm=(i,e,t,r)=>(jc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),bo=(i,e,t)=>(jc(i,e,"access private method"),t),pa,yo,_o,ma,Cl,Jc,Il=class extends ue{constructor(){super(...arguments),Ll(this,_o),Ll(this,Cl),Ll(this,pa,[]),Ll(this,yo,{})}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",bo(this,_o,ma).call(this)):e===s.MEDIA_RENDITION_LIST&&t!==r?(Tm(this,pa,mh(r)),bo(this,_o,ma).call(this)):e===s.MEDIA_HEIGHT&&t!==r&&bo(this,_o,ma).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",bo(this,Cl,Jc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",bo(this,Cl,Jc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return ha(this,pa)}set mediaRenditionList(e){Tm(this,pa,e),bo(this,_o,ma).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)}};pa=new WeakMap;yo=new WeakMap;_o=new WeakSet;ma=function(){if(ha(this,yo).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&ha(this,yo).mediaHeight===this.mediaHeight)return;ha(this,yo).mediaRenditionList=JSON.stringify(this.mediaRenditionList),ha(this,yo).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=kt({type:"radio",text:l,value:`${a.id}`,checked:a.selected&&!t});d.prepend(ot(this,"checked-indicator")),this.defaultSlot.append(d)}let r=e&&this.showRenditionBitrate(e),o=t?e?this.formatMenuItemText(`${g("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${g("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(g("Auto")),n=kt({type:"radio",text:o,value:"auto",checked:t});n.dataset.description=o,n.prepend(ot(this,"checked-indicator")),this.defaultSlot.append(n)};Cl=new WeakSet;Jc=function(){if(this.value==null)return;let i=new c.CustomEvent(b.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",Il);var $g=`<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 gE(){return`
2049
+ </svg>`;function Bg(){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">${fE}</slot>
2056
- `}function EE(){return E("Quality")}var so=class extends Pe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",E("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return x(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){P(this,s.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return H(this,s.MEDIA_HEIGHT)}set mediaHeight(e){B(this,s.MEDIA_HEIGHT,e)}};so.getSlotTemplateHTML=gE;so.getTooltipContentHTML=EE;d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",so);var Mc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Lt=(i,e,t)=>(Mc(i,e,"read from private field"),t?t.call(i):e.get(i)),kt=(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)},Jp=(i,e,t,r)=>(Mc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ze=(i,e,t)=>(Mc(i,e,"access private method"),t),co,Jn,vl,ir,lo,Rc,jp,cl,Cc,ul,Ic,em,pl,ml,hl;function bE(i){return`
2057
- ${se.getTemplateHTML(i)}
2055
+ <slot name="icon">${$g}</slot>
2056
+ `}function Vg(){return g("Quality")}var To=class extends He{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",g("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)}};To.getSlotTemplateHTML=Bg;To.getTooltipContentHTML=Vg;c.customElements.get("media-rendition-menu-button")||c.customElements.define("media-rendition-menu-button",To);var iu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},wt=(i,e,t)=>(iu(i,e,"read from private field"),t?t.call(i):e.get(i)),It=(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)},Am=(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),So,va,Dl,ur,Ao,ru,Sm,wl,eu,Ml,tu,km,xl,Pl,Rl;function Wg(i){return`
2057
+ ${ue.getTemplateHTML(i)}
2058
2058
  <style>
2059
2059
  :host {
2060
2060
  --_menu-bg: rgb(20 20 30 / .8);
@@ -2067,8 +2067,8 @@ bp-player[has-error] {
2067
2067
  overflow: hidden;
2068
2068
  }
2069
2069
  </style>
2070
- `}var jn=class extends se{constructor(){super(),kt(this,Jn),kt(this,ir),kt(this,Rc),kt(this,cl),kt(this,Ic),kt(this,co,!1),kt(this,ul,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",o=ze(this,cl,Cc).call(this,t);(r||o)&&(Lt(this,co)?ze(this,ir,lo).call(this):ze(this,Ic,em).call(this,e))}),kt(this,pl,e=>{let t=e.target,r=this.contains(t),o=e.button===2,n=(t==null?void 0:t.nodeName)==="VIDEO",a=ze(this,cl,Cc).call(this,t);r||o&&(n||a)||ze(this,ir,lo).call(this)}),kt(this,ml,e=>{e.key==="Escape"&&ze(this,ir,lo).call(this)}),kt(this,hl,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,ir,lo).call(this)}),this.setAttribute("noautohide",""),ze(this,Jn,vl).call(this)}connectedCallback(){super.connectedCallback(),Z(this).addEventListener("contextmenu",Lt(this,ul)),this.addEventListener("click",Lt(this,hl))}disconnectedCallback(){super.disconnectedCallback(),Z(this).removeEventListener("contextmenu",Lt(this,ul)),this.removeEventListener("click",Lt(this,hl)),document.removeEventListener("mousedown",Lt(this,pl)),document.removeEventListener("keydown",Lt(this,ml))}};co=new WeakMap;Jn=new WeakSet;vl=function(){this.hidden=!Lt(this,co)};ir=new WeakSet;lo=function(){Jp(this,co,!1),ze(this,Jn,vl).call(this)};Rc=new WeakSet;jp=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&ze(t=e,ir,lo).call(t)})};cl=new WeakSet;Cc=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};ul=new WeakMap;Ic=new WeakSet;em=function(i){i.preventDefault(),ze(this,Rc,jp).call(this),Jp(this,co,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,ze(this,Jn,vl).call(this),document.addEventListener("mousedown",Lt(this,pl),{once:!0}),document.addEventListener("keydown",Lt(this,ml),{once:!0})};pl=new WeakMap;ml=new WeakMap;hl=new WeakMap;jn.getTemplateHTML=bE;d.customElements.get("media-context-menu")||d.customElements.define("media-context-menu",jn);function _E(i){return`
2071
- ${Ve.getTemplateHTML.call(this,i)}
2070
+ `}var fa=class extends ue{constructor(){super(),It(this,va),It(this,ur),It(this,ru),It(this,wl),It(this,tu),It(this,So,!1),It(this,Ml,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",o=Ze(this,wl,eu).call(this,t);(r||o)&&(wt(this,So)?Ze(this,ur,Ao).call(this):Ze(this,tu,km).call(this,e))}),It(this,xl,e=>{let t=e.target,r=this.contains(t),o=e.button===2,n=(t==null?void 0:t.nodeName)==="VIDEO",a=Ze(this,wl,eu).call(this,t);r||o&&(n||a)||Ze(this,ur,Ao).call(this)}),It(this,Pl,e=>{e.key==="Escape"&&Ze(this,ur,Ao).call(this)}),It(this,Rl,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,ur,Ao).call(this)}),this.setAttribute("noautohide",""),Ze(this,va,Dl).call(this)}connectedCallback(){super.connectedCallback(),X(this).addEventListener("contextmenu",wt(this,Ml)),this.addEventListener("click",wt(this,Rl))}disconnectedCallback(){super.disconnectedCallback(),X(this).removeEventListener("contextmenu",wt(this,Ml)),this.removeEventListener("click",wt(this,Rl)),document.removeEventListener("mousedown",wt(this,xl)),document.removeEventListener("keydown",wt(this,Pl))}};So=new WeakMap;va=new WeakSet;Dl=function(){this.hidden=!wt(this,So)};ur=new WeakSet;Ao=function(){Am(this,So,!1),Ze(this,va,Dl).call(this)};ru=new WeakSet;Sm=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&Ze(t=e,ur,Ao).call(t)})};wl=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};Ml=new WeakMap;tu=new WeakSet;km=function(i){i.preventDefault(),Ze(this,ru,Sm).call(this),Am(this,So,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,Ze(this,va,Dl).call(this),document.addEventListener("mousedown",wt(this,xl),{once:!0}),document.addEventListener("keydown",wt(this,Pl),{once:!0})};xl=new WeakMap;Pl=new WeakMap;Rl=new WeakMap;fa.getTemplateHTML=Wg;c.customElements.get("media-context-menu")||c.customElements.define("media-context-menu",fa);function Fg(i){return`
2071
+ ${Ke.getTemplateHTML.call(this,i)}
2072
2072
  <style>
2073
2073
  ::slotted(*) {
2074
2074
  color: var(--media-text-color, white);
@@ -2080,16 +2080,16 @@ bp-player[has-error] {
2080
2080
  min-height: var(--media-control-height, 24px);
2081
2081
  }
2082
2082
  </style>
2083
- `}var uo=class extends Ve{};uo.shadowRootOptions={mode:"open"};uo.getTemplateHTML=_E;d.customElements.get("media-context-menu-item")||d.customElements.define("media-context-menu-item",uo);var yE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2083
+ `}var ko=class extends Ke{};ko.shadowRootOptions={mode:"open"};ko.getTemplateHTML=Fg;c.customElements.get("media-context-menu-item")||c.customElements.define("media-context-menu-item",ko);var Kg=`<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>`,TE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2085
+ </svg>`,Gg=`<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>`,AE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2087
+ </svg>`,qg=`<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>`,SE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2090
+ </svg>`,zg=`<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 kE(i){switch(i){case"offline":return TE;case"network":return AE;case"security":return SE;default:return yE}}function LE(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 Ht=class extends Ce{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=kE(t),o=LE(t);return We`
2092
+ </svg>`;function Yg(i){switch(i){case"offline":return Gg;case"network":return qg;case"security":return zg;default:return Kg}}function Qg(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 Wt=class extends Pe{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=Yg(t),o=Qg(t);return Ge`
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?We`
2102
+ ${this.showCode?Ge`
2103
2103
  <span part="code">
2104
2104
  <slot name="code">Error ${this.error.code}</slot>
2105
2105
  </span>
@@ -2107,7 +2107,7 @@ bp-player[has-error] {
2107
2107
  <div part="actions">
2108
2108
  <slot name="actions"></slot>
2109
2109
  </div>
2110
- `}renderIcon(t){let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};Ht.styles=Do`
2110
+ `}renderIcon(t){let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};Wt.styles=Go`
2111
2111
  :host {
2112
2112
  display: flex;
2113
2113
  flex-direction: column;
@@ -2168,7 +2168,7 @@ bp-player[has-error] {
2168
2168
  [part="actions"] button {
2169
2169
  cursor: pointer;
2170
2170
  }
2171
- `,N([W({type:Object})],Ht.prototype,"error",2),N([W({type:Boolean})],Ht.prototype,"showCode",2),Ht=N([Gt("bp-error-display")],Ht);var tm=`/**
2171
+ `,U([W({type:Object})],Wt.prototype,"error",2),U([W({type:Boolean})],Wt.prototype,"showCode",2),Wt=U([Zt("bp-error-display")],Wt);var Lm=`/**
2172
2172
  * BP Default UI Styles
2173
2173
  *
2174
2174
  * Layer-based architecture.
@@ -2449,16 +2449,29 @@ bp-default-ui media-play-button.bp-center-play:active {
2449
2449
  ============================================
2450
2450
 
2451
2451
  Hide default controls when user provides custom chrome.
2452
- Uses CSS :has() to detect slotted content presence.
2452
+
2453
+ IMPORTANT: We use marker attributes (has-custom-*) instead of
2454
+ CSS :has(> [slot="..."]) selectors because:
2455
+
2456
+ 1. _moveSlottedContent() moves slotted elements from direct children
2457
+ of bp-default-ui INTO media-controller
2458
+ 2. For bottom-chrome, the slot attribute is also removed
2459
+
2460
+ After this DOM manipulation, :has(> [slot="..."]) no longer matches
2461
+ because the elements are no longer direct children of bp-default-ui.
2462
+
2463
+ The marker attributes are set by _moveSlottedContent() BEFORE moving
2464
+ elements, ensuring CSS can reliably detect custom chrome presence.
2453
2465
  ============================================ */
2454
2466
 
2455
- /* Hide default center play button when custom centered-chrome is provided */
2456
- bp-default-ui:has(> [slot="centered-chrome"]) .bp-center-play {
2467
+ /* Hide default centered chrome (loading indicator + play button) when custom centered-chrome is provided */
2468
+ bp-default-ui[has-custom-centered-chrome] .bp-center-play,
2469
+ bp-default-ui[has-custom-centered-chrome] media-loading-indicator {
2457
2470
  display: none !important;
2458
2471
  }
2459
2472
 
2460
2473
  /* Hide default control bar when custom bottom-chrome is provided */
2461
- bp-default-ui:has(> [slot="bottom-chrome"]) media-control-bar {
2474
+ bp-default-ui[has-custom-bottom-chrome] media-control-bar {
2462
2475
  display: none !important;
2463
2476
  }
2464
2477
 
@@ -2649,7 +2662,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2649
2662
  outline: 2px solid rgba(0, 255, 0, 1) !important;
2650
2663
  background: rgba(0, 255, 0, 0.3) !important;
2651
2664
  }
2652
- `;var im={fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{console.warn("[bp-default-ui] Failed to parse JSON attribute:",i);return}},toAttribute:i=>i==null?null:JSON.stringify(i)},rm=!1;function CE(){if(rm)return;gr();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=tm,document.head.appendChild(i),rm=!0}var ee=class extends Ce{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(),CE(),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(),this.fluid&&this._setInitialVideoDimensionsFromSources()}updated(t){super.updated(t),this._moveSlottedContent(),t.has("debug")&&this.toggleAttribute("debug-hitboxes",this.debug),t.has("source")&&(this._error=null,this._showEndedOverlay=!1,pe(this,"has-error",!1),this.fluid&&this._setInitialVideoDimensionsFromSources())}_setInitialVideoDimensionsFromSources(){var r;let t=(r=this.source)==null?void 0:r.sources;if(t){for(let o of t)if(Mi(o)&&o.preferredOrientation){o.preferredOrientation==="portrait"?(this.style.setProperty("--bp-video-width","9"),this.style.setProperty("--bp-video-height","16")):(this.style.setProperty("--bp-video-width","16"),this.style.setProperty("--bp-video-height","9")),this.debug&&console.log("[BPDefaultUI] Set initial video dimensions from preferredOrientation:",o.preferredOrientation);break}}}_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"},{from:"centered-chrome",to:"centered-chrome"},{from:"middle-chrome",to:"middle-chrome"},{from:"bottom-chrome",to:null}];for(let{from:o,to:n}of r)this.querySelectorAll(`:scope > [slot="${o}"]`).forEach(l=>{l.parentElement!==t&&(n?l.setAttribute("slot",n):l.removeAttribute("slot"),t.appendChild(l))})}setupPlayer(){let t=this.querySelector("bp-player");t&&t.addEventListener("ready",r=>{r.stopPropagation(),this._player=r.detail,this._providerType=t.providerType,this.live=this._player.state.streamType==="live",this.setupPlayerListeners(),this.dispatchEvent(new CustomEvent("ready",{detail:this._player,bubbles:!0,composed:!0})),this.requestUpdate()})}setupPlayerListeners(){if(!this._player)return;let t=()=>{var f;let h=((f=this._player)==null?void 0:f.state.error)??null;this._error=h;let p=h!==null&&h.fatal&&h.category!=="offline";pe(this,"has-error",p)},r=()=>{var p;let h=(p=this._player)==null?void 0:p.state;if(h&&(this._connectionState=h.connectionState,this.live=h.streamType==="live",this.setAttribute("content-type",h.contentType),this.setAttribute("stream-type",h.streamType),pe(this,"paused",h.paused),pe(this,"ended",h.ended),pe(this,"waiting",h.waiting),h.error!==this._error)){this._error=h.error;let f=h.error!==null&&h.error.fatal&&h.error.category!=="offline";pe(this,"has-error",f)}},o=()=>{this._error=null,this._showEndedOverlay=!1,pe(this,"has-error",!1)},n=()=>{this.live&&(this._showEndedOverlay=!0)},a=()=>{this._error=null,this._showEndedOverlay=!1,pe(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:c,videoHeight:v}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:c,videoHeight:v,fluid:this.fluid}),c>0&&v>0&&l({videoWidth:c,videoHeight:v}),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"?We`
2665
+ `;var ou=!1;function Xg(){if(ou)return;if(document.getElementById("bp-default-ui-styles")){ou=!0;return}wr();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=Lm,document.head.appendChild(i),ou=!0}var te=class extends Pe{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(),Xg(),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(),this.fluid&&this._setInitialVideoDimensionsFromSources()}updated(t){super.updated(t),this._moveSlottedContent(),t.has("debug")&&this.toggleAttribute("debug-hitboxes",this.debug),t.has("source")&&(this._error=null,this._showEndedOverlay=!1,Ee(this,"has-error",!1),this.fluid&&this._setInitialVideoDimensionsFromSources())}_setInitialVideoDimensionsFromSources(){var r;let t=(r=this.source)==null?void 0:r.sources;if(t){for(let o of t)if(Ui(o)&&o.preferredOrientation){o.preferredOrientation==="portrait"?(this.style.setProperty("--bp-video-width","9"),this.style.setProperty("--bp-video-height","16")):(this.style.setProperty("--bp-video-width","16"),this.style.setProperty("--bp-video-height","9")),this.debug&&console.log("[BPDefaultUI] Set initial video dimensions from preferredOrientation:",o.preferredOrientation);break}}}_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");t&&t.addEventListener("ready",r=>{r.stopPropagation(),this._player=r.detail,this._providerType=t.providerType,this.live=this._player.state.streamType==="live",this.setupPlayerListeners(),this.dispatchEvent(Bi(hn,{detail:this._player})),this.requestUpdate()})}setupPlayerListeners(){if(!this._player)return;let t=()=>{var T;let h=((T=this._player)==null?void 0:T.state.error)??null;this._error=h;let m=h!==null&&h.fatal&&h.category!=="offline";Ee(this,"has-error",m)},r=()=>{var m;let h=(m=this._player)==null?void 0:m.state;if(h&&(this._connectionState=h.connectionState,this.live=h.streamType==="live",this.setAttribute("content-type",h.contentType),this.setAttribute("stream-type",h.streamType),Ee(this,"paused",h.paused),Ee(this,"ended",h.ended),Ee(this,"waiting",h.waiting),h.error!==this._error)){this._error=h.error;let T=h.error!==null&&h.error.fatal&&h.error.category!=="offline";Ee(this,"has-error",T)}},o=()=>{this._error=null,this._showEndedOverlay=!1,Ee(this,"has-error",!1)},n=()=>{this.live&&(this._showEndedOverlay=!0)},a=()=>{this._error=null,this._showEndedOverlay=!1,Ee(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:v}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:d,videoHeight:v,fluid:this.fluid}),d>0&&v>0&&l({videoWidth:d,videoHeight:v}),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`
2653
2666
  <media-control-bar>
2654
2667
  <media-play-button notooltip clip-hidden></media-play-button>
2655
2668
  <media-live-button notooltip vod-hidden clip-hidden></media-live-button>
@@ -2659,7 +2672,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2659
2672
  <media-rendition-menu-button notooltip clip-hidden></media-rendition-menu-button>
2660
2673
  <media-fullscreen-button notooltip clip-hidden></media-fullscreen-button>
2661
2674
  </media-control-bar>
2662
- `:We`
2675
+ `:Ge`
2663
2676
  <media-control-bar>
2664
2677
  <media-play-button notooltip clip-hidden></media-play-button>
2665
2678
  <media-live-button notooltip vod-hidden clip-hidden></media-live-button>
@@ -2675,7 +2688,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2675
2688
  <media-pip-button notooltip clip-hidden></media-pip-button>
2676
2689
  <media-fullscreen-button notooltip clip-hidden></media-fullscreen-button>
2677
2690
  </media-control-bar>
2678
- `}render(){return We`
2691
+ `}render(){return Ge`
2679
2692
  <!-- Chrome Layer: media-controller with all controls -->
2680
2693
  <div class="bp-layer bp-chrome-layer">
2681
2694
  <media-controller autohide="${this.autohide}" ?hotkeys="${this.hotkeys}">
@@ -2691,7 +2704,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2691
2704
  ?debug="${this.debug}"
2692
2705
  ></bp-player>
2693
2706
 
2694
- ${this._getPoster()?We`
2707
+ ${this._getPoster()?Ge`
2695
2708
  <media-poster-image slot="poster" src="${this._getPoster()}"></media-poster-image>
2696
2709
  `:null}
2697
2710
 
@@ -2724,19 +2737,19 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2724
2737
  <div class="bp-layer bp-error-layer">
2725
2738
  <bp-error-display .error="${this._error}" ?showCode="${this.debug}"></bp-error-display>
2726
2739
  </div>
2727
- `}};N([W({converter:im})],ee.prototype,"source",2),N([W({type:Boolean})],ee.prototype,"autoplay",2),N([W({type:Boolean})],ee.prototype,"muted",2),N([W({type:Boolean})],ee.prototype,"loop",2),N([W({type:String})],ee.prototype,"poster",2),N([W({type:String})],ee.prototype,"scaling",2),N([W({type:String,attribute:"aspect-ratio"})],ee.prototype,"aspectRatio",2),N([W({converter:im})],ee.prototype,"config",2),N([W({type:Boolean})],ee.prototype,"debug",2),N([W({type:Number})],ee.prototype,"autohide",2),N([W({type:Boolean})],ee.prototype,"hotkeys",2),N([W({type:Boolean,reflect:!0})],ee.prototype,"mobile",2),N([W({type:Boolean,reflect:!0})],ee.prototype,"live",2),N([W({type:Boolean,reflect:!0})],ee.prototype,"fluid",2),N([zt()],ee.prototype,"_player",2),N([zt()],ee.prototype,"_providerType",2),N([zt()],ee.prototype,"_error",2),N([zt()],ee.prototype,"_connectionState",2),N([zt()],ee.prototype,"_showEndedOverlay",2),ee=N([Gt("bp-default-ui")],ee);var IE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2740
+ `}};U([W({converter:Mr()})],te.prototype,"source",2),U([W({type:Boolean})],te.prototype,"autoplay",2),U([W({type:Boolean})],te.prototype,"muted",2),U([W({type:Boolean})],te.prototype,"loop",2),U([W({type:String})],te.prototype,"poster",2),U([W({type:String})],te.prototype,"scaling",2),U([W({type:String,attribute:"aspect-ratio"})],te.prototype,"aspectRatio",2),U([W({converter:Mr()})],te.prototype,"config",2),U([W({type:Boolean})],te.prototype,"debug",2),U([W({type:Number})],te.prototype,"autohide",2),U([W({type:Boolean})],te.prototype,"hotkeys",2),U([W({type:Boolean,reflect:!0})],te.prototype,"mobile",2),U([W({type:Boolean,reflect:!0})],te.prototype,"live",2),U([W({type:Boolean,reflect:!0})],te.prototype,"fluid",2),U([Xt()],te.prototype,"_player",2),U([Xt()],te.prototype,"_providerType",2),U([Xt()],te.prototype,"_error",2),U([Xt()],te.prototype,"_connectionState",2),U([Xt()],te.prototype,"_showEndedOverlay",2),te=U([Zt("bp-default-ui")],te);var Jg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2728
2741
  <circle cx="12" cy="12" r="10" stroke-opacity="0.25"/>
2729
2742
  <path d="M12 2a10 10 0 0 1 10 10" stroke-linecap="round">
2730
2743
  <animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/>
2731
2744
  </path>
2732
- </svg>`,ME=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2745
+ </svg>`,jg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2733
2746
  <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"/>
2734
2747
  <circle cx="12" cy="12" r="3" fill="currentColor"/>
2735
- </svg>`,RE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2748
+ </svg>`,eb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2736
2749
  <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"/>
2737
- </svg>`,xE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2750
+ </svg>`,tb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2738
2751
  <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"/>
2739
- </svg>`,wt=class extends Ce{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return IE;case"offline":return ME;case"ended":return this.live?RE:xE;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 We`
2752
+ </svg>`,Mt=class extends Pe{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return Jg;case"offline":return jg;case"ended":return this.live?eb:tb;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`
2740
2753
  <div part="icon">
2741
2754
  <slot name="icon">${this.renderIcon(t)}</slot>
2742
2755
  </div>
@@ -2746,7 +2759,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2746
2759
  <p part="submessage">
2747
2760
  <slot name="submessage"></slot>
2748
2761
  </p>
2749
- `}renderIcon(t){if(!t)return null;let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};wt.styles=Do`
2762
+ `}renderIcon(t){if(!t)return null;let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};Mt.styles=Go`
2750
2763
  :host {
2751
2764
  display: flex;
2752
2765
  flex-direction: column;
@@ -2817,7 +2830,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2817
2830
  :host([button-mode]) [part="submessage"] {
2818
2831
  display: none;
2819
2832
  }
2820
- `,N([W({type:String,reflect:!0})],wt.prototype,"type",2),N([W({type:Boolean,reflect:!0})],wt.prototype,"live",2),N([W({type:Boolean,reflect:!0,attribute:"button-mode"})],wt.prototype,"buttonMode",2),wt=N([Gt("bp-overlay")],wt);var PE=["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"],om=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function DE(i){return`
2833
+ `,U([W({type:String,reflect:!0})],Mt.prototype,"type",2),U([W({type:Boolean,reflect:!0})],Mt.prototype,"live",2),U([W({type:Boolean,reflect:!0,attribute:"button-mode"})],Mt.prototype,"buttonMode",2),Mt=U([Zt("bp-overlay")],Mt);var ib=["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"],Cm=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function rb(i){return`
2821
2834
  <style>
2822
2835
  :host {
2823
2836
  display: inline-flex;
@@ -2831,10 +2844,10 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2831
2844
  }
2832
2845
  </style>
2833
2846
  <slot name="media">
2834
- <audio${cm(i)}></audio>
2847
+ <audio${Pm(i)}></audio>
2835
2848
  </slot>
2836
2849
  <slot></slot>
2837
- `}function OE(i){return`
2850
+ `}function ob(i){return`
2838
2851
  <style>
2839
2852
  :host {
2840
2853
  display: inline-block;
@@ -2856,25 +2869,25 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2856
2869
  }
2857
2870
  </style>
2858
2871
  <slot name="media">
2859
- <video${cm(i)}></video>
2872
+ <video${Pm(i)}></video>
2860
2873
  </slot>
2861
2874
  <slot></slot>
2862
- `}function dm(i,{tag:e,is:t}){var n,a,l,c,v,nm,p,f,m,A,g,rr,xc,am,Pc,sm,lm;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),o=r?UE(r):[];return l=class extends i{constructor(){super(...arguments);S(this,g);S(this,p,!1);S(this,f,null);S(this,m,new Map);S(this,A);$(this,"get");$(this,"set");$(this,"call")}static get observedAttributes(){var K,ne;return O(K=l,v,nm).call(K),[...((ne=r==null?void 0:r.constructor)==null?void 0:ne.observedAttributes)??[],...om]}get nativeEl(){var k;return O(this,g,rr).call(this),u(this,f)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((k=this.shadowRoot)==null?void 0:k.querySelector(e))??null}set nativeEl(k){_(this,f,k)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(k){this.toggleAttribute("muted",k)}get src(){return this.getAttribute("src")}set src(k){this.setAttribute("src",`${k}`)}get preload(){var k;return this.getAttribute("preload")??((k=this.nativeEl)==null?void 0:k.preload)}set preload(k){this.setAttribute("preload",`${k}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let k=NE(this.attributes);t&&(k.is=t),e&&(k.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(k)}this.nativeEl.muted=this.hasAttribute("muted");for(let k of o)O(this,g,sm).call(this,k);_(this,A,new MutationObserver(O(this,g,am).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>O(this,g,xc).call(this)),O(this,g,xc).call(this);for(let k of this.constructor.Events)this.shadowRoot.addEventListener(k,this,!0)}handleEvent(k){k.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(k.type,{detail:k.detail}))}attributeChangedCallback(k,K,ne){O(this,g,rr).call(this),O(this,g,lm).call(this,k,K,ne)}connectedCallback(){O(this,g,rr).call(this)}},c=new WeakMap,v=new WeakSet,nm=function(){if(u(this,c))return;_(this,c,!0);let k=new Set(this.observedAttributes);k.delete("muted");for(let K of o)if(!(K in this.prototype))if(typeof r[K]=="function")this.prototype[K]=function(...ne){return O(this,g,rr).call(this),(()=>{var he;if(this.call)return this.call(K,...ne);let G=(he=this.nativeEl)==null?void 0:he[K];return G==null?void 0:G.apply(this.nativeEl,ne)})()};else{let ne={get(){var G,he;O(this,g,rr).call(this);let te=K.toLowerCase();if(k.has(te)){let Mt=this.getAttribute(te);return Mt===null?!1:Mt===""?!0:Mt}return((G=this.get)==null?void 0:G.call(this,K))??((he=this.nativeEl)==null?void 0:he[K])}};K!==K.toUpperCase()&&(ne.set=function(te){O(this,g,rr).call(this);let G=K.toLowerCase();if(k.has(G)){te===!0||te===!1||te==null?this.toggleAttribute(G,!!te):this.setAttribute(G,te);return}if(this.set){this.set(K,te);return}this.nativeEl&&(this.nativeEl[K]=te)}),Object.defineProperty(this.prototype,K,ne)}},p=new WeakMap,f=new WeakMap,m=new WeakMap,A=new WeakMap,g=new WeakSet,rr=function(){u(this,p)||(_(this,p,!0),this.init())},xc=function(){var te;let k=new Map(u(this,m)),K=(te=this.shadowRoot)==null?void 0:te.querySelector("slot:not([name])");(K==null?void 0:K.assignedElements({flatten:!0}).filter(G=>["track","source"].includes(G.localName))).forEach(G=>{var Mt,Ro;k.delete(G);let he=u(this,m).get(G);he||(he=G.cloneNode(),u(this,m).set(G,he),(Mt=u(this,A))==null||Mt.observe(G,{attributes:!0})),(Ro=this.nativeEl)==null||Ro.append(he),O(this,g,Pc).call(this,he)}),k.forEach((G,he)=>{G.remove(),u(this,m).delete(he)})},am=function(k){for(let K of k)if(K.type==="attributes"){let{target:ne,attributeName:te}=K,G=u(this,m).get(ne);G&&te&&(G.setAttribute(te,ne.getAttribute(te)??""),O(this,g,Pc).call(this,G))}},Pc=function(k){k&&k.localName==="track"&&k.default&&(k.kind==="chapters"||k.kind==="metadata")&&k.track.mode==="disabled"&&(k.track.mode="hidden")},sm=function(k){if(Object.prototype.hasOwnProperty.call(this,k)){let K=this[k];delete this[k],this[k]=K}},lm=function(k,K,ne){var te,G,he;["id","class"].includes(k)||!l.observedAttributes.includes(k)&&this.constructor.observedAttributes.includes(k)||(ne===null?(te=this.nativeEl)==null||te.removeAttribute(k):((G=this.nativeEl)==null?void 0:G.getAttribute(k))!==ne&&((he=this.nativeEl)==null||he.setAttribute(k,ne)))},S(l,v),$(l,"getTemplateHTML",e.endsWith("audio")?DE:OE),$(l,"shadowRootOptions",{mode:"open"}),$(l,"Events",PE),S(l,c,!1),l}function UE(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 cm(i){let e="";for(let t in i){if(!om.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function NE(i){let e={};for(let t of i)e[t.name]=t.value;return e}var De=dm(globalThis.HTMLElement??class{},{tag:"video"}),sw=dm(globalThis.HTMLElement??class{},{tag:"audio"});var $t=class extends Event{constructor(t,r){super(t);$(this,"track");this.track=r.track}};var Dc=new WeakMap;function T(i){return Dc.get(i)??HE(i,{})}function HE(i,e){let t=Dc.get(i);return t||Dc.set(i,t={}),Object.assign(t,e)}function fl(i,e){let t=i.videoTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in nr.prototype||Object.defineProperty(nr.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new $t("addtrack",{track:e}))})}function gl(i){var r;let e=(r=T(i).media)==null?void 0:r.videoTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new $t("removetrack",{track:i}))})}function um(i){let e=T(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(T(e).changeRequested)return;T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var si,li,di,or,ea,nr=class extends EventTarget{constructor(){super();S(this,or);S(this,si);S(this,li);S(this,di);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,or,ea).values()}get length(){return u(this,or,ea).size}getTrackById(t){return[...u(this,or,ea)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,or,ea)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,si)}set onaddtrack(t){u(this,si)&&(this.removeEventListener("addtrack",u(this,si)),_(this,si,void 0)),typeof t=="function"&&(_(this,si,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,li)}set onremovetrack(t){u(this,li)&&(this.removeEventListener("removetrack",u(this,li)),_(this,li,void 0)),typeof t=="function"&&(_(this,li,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,di)}set onchange(t){u(this,di)&&(this.removeEventListener("change",u(this,di)),_(this,di,void 0)),typeof t=="function"&&(_(this,di,t),this.addEventListener("change",t))}};si=new WeakMap,li=new WeakMap,di=new WeakMap,or=new WeakSet,ea=function(){return T(this).trackSet};var Bt=class extends Event{constructor(t,r){super(t);$(this,"rendition");this.rendition=r.rendition}};function hm(i,e){let t=T(i).media.videoRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in ar.prototype||Object.defineProperty(ar.prototype,o,{get(){return ho(this)[o]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Bt("addrendition",{rendition:e}))})}function pm(i){let e=T(i).media.videoRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.selected&&e.dispatchEvent(new Bt("removerendition",{rendition:i}))})}function mm(i){let e=T(i).media.videoRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function ho(i){return[...T(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...T(t).renditionSet])}var ci,ui,hi,ar=class extends EventTarget{constructor(){super(...arguments);S(this,ci);S(this,ui);S(this,hi)}[Symbol.iterator](){return ho(this).values()}get length(){return ho(this).length}getRenditionById(t){return ho(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return ho(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of ho(this).entries())o.selected=r===t}get onaddrendition(){return u(this,ci)}set onaddrendition(t){u(this,ci)&&(this.removeEventListener("addrendition",u(this,ci)),_(this,ci,void 0)),typeof t=="function"&&(_(this,ci,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,ui)}set onremoverendition(t){u(this,ui)&&(this.removeEventListener("removerendition",u(this,ui)),_(this,ui,void 0)),typeof t=="function"&&(_(this,ui,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,hi)}set onchange(t){u(this,hi)&&(this.removeEventListener("change",u(this,hi)),_(this,hi,void 0)),typeof t=="function"&&(_(this,hi,t),this.addEventListener("change",t))}};ci=new WeakMap,ui=new WeakMap,hi=new WeakMap;var po,ta=class{constructor(){$(this,"src");$(this,"id");$(this,"width");$(this,"height");$(this,"bitrate");$(this,"frameRate");$(this,"codec");S(this,po,!1)}get selected(){return u(this,po)}set selected(e){u(this,po)!==e&&(_(this,po,e),mm(this))}};po=new WeakMap;var mo,vo=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");S(this,mo,!1)}addRendition(e,t,r,o,n,a){let l=new ta;return l.src=e,l.width=t,l.height=r,l.frameRate=a,l.bitrate=n,l.codec=o,hm(this,l),l}removeRendition(e){pm(e)}get selected(){return u(this,mo)}set selected(e){u(this,mo)!==e&&(_(this,mo,e),e===!0&&um(this))}};mo=new WeakMap;function vm(i,e){let t=T(i).media.audioRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in sr.prototype||Object.defineProperty(sr.prototype,o,{get(){return fo(this)[o]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Bt("addrendition",{rendition:e}))})}function fm(i){let e=T(i).media.audioRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.enabled&&e.dispatchEvent(new Bt("removerendition",{rendition:i}))})}function gm(i){let e=T(i).media.audioRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function fo(i){return[...T(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...T(t).renditionSet])}var pi,mi,vi,sr=class extends EventTarget{constructor(){super(...arguments);S(this,pi);S(this,mi);S(this,vi)}[Symbol.iterator](){return fo(this).values()}get length(){return fo(this).length}getRenditionById(t){return fo(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return fo(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of fo(this).entries())o.selected=r===t}get onaddrendition(){return u(this,pi)}set onaddrendition(t){u(this,pi)&&(this.removeEventListener("addrendition",u(this,pi)),_(this,pi,void 0)),typeof t=="function"&&(_(this,pi,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,mi)}set onremoverendition(t){u(this,mi)&&(this.removeEventListener("removerendition",u(this,mi)),_(this,mi,void 0)),typeof t=="function"&&(_(this,mi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,vi)}set onchange(t){u(this,vi)&&(this.removeEventListener("change",u(this,vi)),_(this,vi,void 0)),typeof t=="function"&&(_(this,vi,t),this.addEventListener("change",t))}};pi=new WeakMap,mi=new WeakMap,vi=new WeakMap;var go,ia=class{constructor(){$(this,"src");$(this,"id");$(this,"bitrate");$(this,"codec");S(this,go,!1)}get selected(){return u(this,go)}set selected(e){u(this,go)!==e&&(_(this,go,e),gm(this))}};go=new WeakMap;function bl(i,e){let t=i.audioTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in lr.prototype||Object.defineProperty(lr.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new $t("addtrack",{track:e}))})}function _l(i){var r;let e=(r=T(i).media)==null?void 0:r.audioTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new $t("removetrack",{track:i}))})}function Em(i){let e=T(i).media.audioTracks;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var fi,gi,Ei,Eo,El,lr=class extends EventTarget{constructor(){super();S(this,Eo);S(this,fi);S(this,gi);S(this,Ei);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,Eo,El).values()}get length(){return u(this,Eo,El).size}getTrackById(t){return[...u(this,Eo,El)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,fi)}set onaddtrack(t){u(this,fi)&&(this.removeEventListener("addtrack",u(this,fi)),_(this,fi,void 0)),typeof t=="function"&&(_(this,fi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,gi)}set onremovetrack(t){u(this,gi)&&(this.removeEventListener("removetrack",u(this,gi)),_(this,gi,void 0)),typeof t=="function"&&(_(this,gi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,Ei)}set onchange(t){u(this,Ei)&&(this.removeEventListener("change",u(this,Ei)),_(this,Ei,void 0)),typeof t=="function"&&(_(this,Ei,t),this.addEventListener("change",t))}};fi=new WeakMap,gi=new WeakMap,Ei=new WeakMap,Eo=new WeakSet,El=function(){return T(this).trackSet};var bo,_o=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");S(this,bo,!1)}addRendition(e,t,r){let o=new ia;return o.src=e,o.codec=t,o.bitrate=r,vm(this,o),o}removeRendition(e){fm(e)}get enabled(){return u(this,bo)}set enabled(e){u(this,bo)!==e&&(_(this,bo,e),Em(this))}};bo=new WeakMap;var bm=yl(globalThis.HTMLMediaElement,"video"),_m=yl(globalThis.HTMLMediaElement,"audio");function yo(i){if(!(i!=null&&i.prototype))return i;let e=yl(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return $E(this)}});let t=yl(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return BE(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",l=""){let c=new vo;return c.kind=n,c.label=a,c.language=l,fl(this,c),c}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=gl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",l=""){let c=new _o;return c.kind=n,c.label=a,c.language=l,bl(this,c),c}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=_l),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=T(n).videoRenditions;return a||(a=new ar,T(a).media=n,T(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return o(this)}});let o=n=>{let a=T(n).audioRenditions;return a||(a=new sr,T(a).media=n,T(n).audioRenditions=a),a};return i}function yl(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function $E(i){let e=T(i).videoTracks;if(!e&&(e=new nr,T(i).videoTracks=e,bm)){let t=bm.call(i.nativeEl??i);for(let r of t)fl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof vo)){for(let o of t)gl(o);return}fl(i,r.track)}),t.addEventListener("removetrack",r=>{gl(r.track)})}return e}function BE(i){let e=T(i).audioTracks;if(!e&&(e=new lr,T(i).audioTracks=e,_m)){let t=_m.call(i.nativeEl??i);for(let r of t)bl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof _o)){for(let o of t)_l(o);return}bl(i,r.track)}),t.addEventListener("removetrack",r=>{_l(r.track)})}return e}var Se=qm(du("hls.js"),1);var VE=yo(De),Vt,bi,To,it,ym,Tm,Oc,ra,Am,_i=class extends VE{constructor(){super();S(this,it);S(this,Vt,null);S(this,bi,null);S(this,To,!1);this.api=null;S(this,ra,()=>{var r,o;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(o=this.api)==null||o.startLoad()});O(this,it,Am).call(this,"config")}static getTemplateHTML(t,r={}){let{src:o,...n}=t;return`
2875
+ `}function xm(i,{tag:e,is:t}){var n,a,l,d,v,Im,m,T,p,A,E,hr,nu,wm,au,Mm,Rm;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),o=r?nb(r):[];return l=class extends i{constructor(){super(...arguments);L(this,E);L(this,m,!1);L(this,T,null);L(this,p,new Map);L(this,A);$(this,"get");$(this,"set");$(this,"call")}static get observedAttributes(){var K,de;return P(K=l,v,Im).call(K),[...((de=r==null?void 0:r.constructor)==null?void 0:de.observedAttributes)??[],...Cm]}get nativeEl(){var C;return P(this,E,hr).call(this),u(this,T)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((C=this.shadowRoot)==null?void 0:C.querySelector(e))??null}set nativeEl(C){f(this,T,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=ab(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,E,Mm).call(this,C);f(this,A,new MutationObserver(P(this,E,wm).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>P(this,E,nu).call(this)),P(this,E,nu).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,E,hr).call(this),P(this,E,Rm).call(this,C,K,de)}connectedCallback(){P(this,E,hr).call(this)}},d=new WeakMap,v=new WeakSet,Im=function(){if(u(this,d))return;f(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,E,hr).call(this),(()=>{var fe;if(this.call)return this.call(K,...de);let z=(fe=this.nativeEl)==null?void 0:fe[K];return z==null?void 0:z.apply(this.nativeEl,de)})()};else{let de={get(){var z,fe;P(this,E,hr).call(this);let re=K.toLowerCase();if(C.has(re)){let Dt=this.getAttribute(re);return Dt===null?!1:Dt===""?!0:Dt}return((z=this.get)==null?void 0:z.call(this,K))??((fe=this.nativeEl)==null?void 0:fe[K])}};K!==K.toUpperCase()&&(de.set=function(re){P(this,E,hr).call(this);let z=K.toLowerCase();if(C.has(z)){re===!0||re===!1||re==null?this.toggleAttribute(z,!!re):this.setAttribute(z,re);return}if(this.set){this.set(K,re);return}this.nativeEl&&(this.nativeEl[K]=re)}),Object.defineProperty(this.prototype,K,de)}},m=new WeakMap,T=new WeakMap,p=new WeakMap,A=new WeakMap,E=new WeakSet,hr=function(){u(this,m)||(f(this,m,!0),this.init())},nu=function(){var re;let C=new Map(u(this,p)),K=(re=this.shadowRoot)==null?void 0:re.querySelector("slot:not([name])");(K==null?void 0:K.assignedElements({flatten:!0}).filter(z=>["track","source"].includes(z.localName))).forEach(z=>{var Dt,Wo;C.delete(z);let fe=u(this,p).get(z);fe||(fe=z.cloneNode(),u(this,p).set(z,fe),(Dt=u(this,A))==null||Dt.observe(z,{attributes:!0})),(Wo=this.nativeEl)==null||Wo.append(fe),P(this,E,au).call(this,fe)}),C.forEach((z,fe)=>{z.remove(),u(this,p).delete(fe)})},wm=function(C){for(let K of C)if(K.type==="attributes"){let{target:de,attributeName:re}=K,z=u(this,p).get(de);z&&re&&(z.setAttribute(re,de.getAttribute(re)??""),P(this,E,au).call(this,z))}},au=function(C){C&&C.localName==="track"&&C.default&&(C.kind==="chapters"||C.kind==="metadata")&&C.track.mode==="disabled"&&(C.track.mode="hidden")},Mm=function(C){if(Object.prototype.hasOwnProperty.call(this,C)){let K=this[C];delete this[C],this[C]=K}},Rm=function(C,K,de){var re,z,fe;["id","class"].includes(C)||!l.observedAttributes.includes(C)&&this.constructor.observedAttributes.includes(C)||(de===null?(re=this.nativeEl)==null||re.removeAttribute(C):((z=this.nativeEl)==null?void 0:z.getAttribute(C))!==de&&((fe=this.nativeEl)==null||fe.setAttribute(C,de)))},L(l,v),$(l,"getTemplateHTML",e.endsWith("audio")?rb:ob),$(l,"shadowRootOptions",{mode:"open"}),$(l,"Events",ib),L(l,d,!1),l}function nb(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 Pm(i){let e="";for(let t in i){if(!Cm.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function ab(i){let e={};for(let t of i)e[t.name]=t.value;return e}var $e=xm(globalThis.HTMLElement??class{},{tag:"video"}),HI=xm(globalThis.HTMLElement??class{},{tag:"audio"});var Ft=class extends Event{constructor(t,r){super(t);$(this,"track");this.track=r.track}};var su=new WeakMap;function S(i){return su.get(i)??sb(i,{})}function sb(i,e){let t=su.get(i);return t||su.set(i,t={}),Object.assign(t,e)}function Ol(i,e){let t=i.videoTracks;S(e).media=i,S(e).renditionSet||(S(e).renditionSet=new Set);let r=S(t).trackSet;r.add(e);let o=r.size-1;o in mr.prototype||Object.defineProperty(mr.prototype,o,{get(){return[...S(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Ft("addtrack",{track:e}))})}function Nl(i){var r;let e=(r=S(i).media)==null?void 0:r.videoTracks;if(!e)return;S(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ft("removetrack",{track:i}))})}function Dm(i){let e=S(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(S(e).changeRequested)return;S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var mi,vi,fi,pr,Ea,mr=class extends EventTarget{constructor(){super();L(this,pr);L(this,mi);L(this,vi);L(this,fi);S(this).trackSet=new Set}[Symbol.iterator](){return u(this,pr,Ea).values()}get length(){return u(this,pr,Ea).size}getTrackById(t){return[...u(this,pr,Ea)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,pr,Ea)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,mi)}set onaddtrack(t){u(this,mi)&&(this.removeEventListener("addtrack",u(this,mi)),f(this,mi,void 0)),typeof t=="function"&&(f(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)),f(this,vi,void 0)),typeof t=="function"&&(f(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)),f(this,fi,void 0)),typeof t=="function"&&(f(this,fi,t),this.addEventListener("change",t))}};mi=new WeakMap,vi=new WeakMap,fi=new WeakMap,pr=new WeakSet,Ea=function(){return S(this).trackSet};var Kt=class extends Event{constructor(t,r){super(t);$(this,"rendition");this.rendition=r.rendition}};function Om(i,e){let t=S(i).media.videoRenditions;S(e).media=S(i).media,S(e).track=i;let r=S(i).renditionSet;r.add(e);let o=r.size-1;o in vr.prototype||Object.defineProperty(vr.prototype,o,{get(){return Lo(this)[o]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Kt("addrendition",{rendition:e}))})}function Nm(i){let e=S(i).media.videoRenditions,t=S(i).track;S(t).renditionSet.delete(i),queueMicrotask(()=>{S(i).track.selected&&e.dispatchEvent(new Kt("removerendition",{rendition:i}))})}function Um(i){let e=S(i).media.videoRenditions;!e||S(e).changeRequested||(S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,S(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Lo(i){return[...S(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...S(t).renditionSet])}var Ei,gi,bi,vr=class extends EventTarget{constructor(){super(...arguments);L(this,Ei);L(this,gi);L(this,bi)}[Symbol.iterator](){return Lo(this).values()}get length(){return Lo(this).length}getRenditionById(t){return Lo(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Lo(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of Lo(this).entries())o.selected=r===t}get onaddrendition(){return u(this,Ei)}set onaddrendition(t){u(this,Ei)&&(this.removeEventListener("addrendition",u(this,Ei)),f(this,Ei,void 0)),typeof t=="function"&&(f(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)),f(this,gi,void 0)),typeof t=="function"&&(f(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)),f(this,bi,void 0)),typeof t=="function"&&(f(this,bi,t),this.addEventListener("change",t))}};Ei=new WeakMap,gi=new WeakMap,bi=new WeakMap;var Co,ga=class{constructor(){$(this,"src");$(this,"id");$(this,"width");$(this,"height");$(this,"bitrate");$(this,"frameRate");$(this,"codec");L(this,Co,!1)}get selected(){return u(this,Co)}set selected(e){u(this,Co)!==e&&(f(this,Co,e),Um(this))}};Co=new WeakMap;var Io,wo=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");L(this,Io,!1)}addRendition(e,t,r,o,n,a){let l=new ga;return l.src=e,l.width=t,l.height=r,l.frameRate=a,l.bitrate=n,l.codec=o,Om(this,l),l}removeRendition(e){Nm(e)}get selected(){return u(this,Io)}set selected(e){u(this,Io)!==e&&(f(this,Io,e),e===!0&&Dm(this))}};Io=new WeakMap;function Hm(i,e){let t=S(i).media.audioRenditions;S(e).media=S(i).media,S(e).track=i;let r=S(i).renditionSet;r.add(e);let o=r.size-1;o in fr.prototype||Object.defineProperty(fr.prototype,o,{get(){return Mo(this)[o]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Kt("addrendition",{rendition:e}))})}function $m(i){let e=S(i).media.audioRenditions,t=S(i).track;S(t).renditionSet.delete(i),queueMicrotask(()=>{S(i).track.enabled&&e.dispatchEvent(new Kt("removerendition",{rendition:i}))})}function Bm(i){let e=S(i).media.audioRenditions;!e||S(e).changeRequested||(S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,S(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function Mo(i){return[...S(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...S(t).renditionSet])}var _i,yi,Ti,fr=class extends EventTarget{constructor(){super(...arguments);L(this,_i);L(this,yi);L(this,Ti)}[Symbol.iterator](){return Mo(this).values()}get length(){return Mo(this).length}getRenditionById(t){return Mo(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Mo(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of Mo(this).entries())o.selected=r===t}get onaddrendition(){return u(this,_i)}set onaddrendition(t){u(this,_i)&&(this.removeEventListener("addrendition",u(this,_i)),f(this,_i,void 0)),typeof t=="function"&&(f(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)),f(this,yi,void 0)),typeof t=="function"&&(f(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)),f(this,Ti,void 0)),typeof t=="function"&&(f(this,Ti,t),this.addEventListener("change",t))}};_i=new WeakMap,yi=new WeakMap,Ti=new WeakMap;var Ro,ba=class{constructor(){$(this,"src");$(this,"id");$(this,"bitrate");$(this,"codec");L(this,Ro,!1)}get selected(){return u(this,Ro)}set selected(e){u(this,Ro)!==e&&(f(this,Ro,e),Bm(this))}};Ro=new WeakMap;function Hl(i,e){let t=i.audioTracks;S(e).media=i,S(e).renditionSet||(S(e).renditionSet=new Set);let r=S(t).trackSet;r.add(e);let o=r.size-1;o in Er.prototype||Object.defineProperty(Er.prototype,o,{get(){return[...S(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Ft("addtrack",{track:e}))})}function $l(i){var r;let e=(r=S(i).media)==null?void 0:r.audioTracks;if(!e)return;S(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ft("removetrack",{track:i}))})}function Vm(i){let e=S(i).media.audioTracks;!e||S(e).changeRequested||(S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var Ai,Si,ki,xo,Ul,Er=class extends EventTarget{constructor(){super();L(this,xo);L(this,Ai);L(this,Si);L(this,ki);S(this).trackSet=new Set}[Symbol.iterator](){return u(this,xo,Ul).values()}get length(){return u(this,xo,Ul).size}getTrackById(t){return[...u(this,xo,Ul)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,Ai)}set onaddtrack(t){u(this,Ai)&&(this.removeEventListener("addtrack",u(this,Ai)),f(this,Ai,void 0)),typeof t=="function"&&(f(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)),f(this,Si,void 0)),typeof t=="function"&&(f(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)),f(this,ki,void 0)),typeof t=="function"&&(f(this,ki,t),this.addEventListener("change",t))}};Ai=new WeakMap,Si=new WeakMap,ki=new WeakMap,xo=new WeakSet,Ul=function(){return S(this).trackSet};var Po,Do=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");L(this,Po,!1)}addRendition(e,t,r){let o=new ba;return o.src=e,o.codec=t,o.bitrate=r,Hm(this,o),o}removeRendition(e){$m(e)}get enabled(){return u(this,Po)}set enabled(e){u(this,Po)!==e&&(f(this,Po,e),Vm(this))}};Po=new WeakMap;var Wm=Bl(globalThis.HTMLMediaElement,"video"),Fm=Bl(globalThis.HTMLMediaElement,"audio");function Oo(i){if(!(i!=null&&i.prototype))return i;let e=Bl(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return lb(this)}});let t=Bl(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return db(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",l=""){let d=new wo;return d.kind=n,d.label=a,d.language=l,Ol(this,d),d}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=Nl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",l=""){let d=new Do;return d.kind=n,d.label=a,d.language=l,Hl(this,d),d}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=$l),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=S(n).videoRenditions;return a||(a=new vr,S(a).media=n,S(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return o(this)}});let o=n=>{let a=S(n).audioRenditions;return a||(a=new fr,S(a).media=n,S(n).audioRenditions=a),a};return i}function Bl(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function lb(i){let e=S(i).videoTracks;if(!e&&(e=new mr,S(i).videoTracks=e,Wm)){let t=Wm.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 wo)){for(let o of t)Nl(o);return}Ol(i,r.track)}),t.addEventListener("removetrack",r=>{Nl(r.track)})}return e}function db(i){let e=S(i).audioTracks;if(!e&&(e=new Er,S(i).audioTracks=e,Fm)){let t=Fm.call(i.nativeEl??i);for(let r of t)Hl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof Do)){for(let o of t)$l(o);return}Hl(i,r.track)}),t.addEventListener("removetrack",r=>{$l(r.track)})}return e}var Me=mv(Nu("hls.js"),1);var cb=Oo($e),Gt,qt,Li,No,Xe,lu,Km,du,_a,Gm,Ci=class extends cb{constructor(){super();L(this,Xe);L(this,Gt,null);L(this,qt,null);L(this,Li,null);L(this,No,!1);this.api=null;L(this,_a,()=>{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,Gm).call(this,"config")}static getTemplateHTML(t,r={}){let{src:o,...n}=t;return`
2863
2876
  <script type="application/json" id="config">
2864
2877
  ${JSON.stringify(r.config||{})}
2865
2878
  <\/script>
2866
- ${De.getTemplateHTML(n)}
2867
- `}get config(){return u(this,bi)}set config(t){_(this,bi,t)}attributeChangedCallback(t,r,o){t!=="src"&&super.attributeChangedCallback(t,r,o),t==="src"&&r!==o&&this.load()}async load(){var o,n,a;let t=!this.api&&!u(this,To);if(O(this,it,ym).call(this),!this.src)return;if(t&&!u(this,bi)&&_(this,bi,JSON.parse(((n=(o=this.shadowRoot)==null?void 0:o.getElementById("config"))==null?void 0:n.textContent)||"{}")),!O(this,it,Tm).call(this,this.src)){await Promise.resolve(),_(this,To,!0),this.nativeEl.src=this.src;return}if(Se.default.isSupported()){switch(await Promise.resolve(),this.api=new Se.default({liveDurationInfinity:!0,autoStartLoad:!1,...u(this,bi)}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let p=()=>{var f;return(f=this.api)==null?void 0:f.startLoad()};this.nativeEl.addEventListener("play",p,{once:!0}),this.api.on(Se.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",p)});break}case"metadata":{let p=this.api.config.maxBufferLength,f=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let m=()=>{this.api&&(this.api.config.maxBufferLength=p,this.api.config.maxBufferSize=f)};this.nativeEl.addEventListener("play",m,{once:!0}),this.api.on(Se.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",m)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,ra)),_(this,Vt,document.createElement("source")),u(this,Vt).setAttribute("type","application/x-mpegURL"),u(this,Vt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(u(this,Vt));let c=new WeakMap;this.api.on(Se.default.Events.MANIFEST_PARSED,(p,f)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(A=>{console.warn("Autoplay failed:",A)}),O(this,it,Oc).call(this);let m=this.videoTracks.getTrackById("main");m||(m=this.addVideoTrack("main"),m.id="main",m.selected=!0);for(let[A,g]of f.levels.entries()){let L=m.addRendition(g.url[0],g.width,g.height,g.videoCodec??void 0,g.bitrate);c.set(g,`${A}`),L.id=`${A}`}for(let[A,g]of f.audioTracks.entries()){let L=g.default?"main":"alternative",D=this.addAudioTrack(L,g.name,g.lang);D.id=`${A}`,g.default&&(D.enabled=!0)}}),this.audioTracks.addEventListener("change",()=>{var A,g;let p=[...this.audioTracks].find(L=>L.enabled),f=p?+p.id:void 0,m=((A=this.api)==null?void 0:A.audioTracks.map(L=>L.id))??[];f!==void 0&&f!==((g=this.api)==null?void 0:g.audioTrack)&&m.includes(f)&&this.api&&(this.api.audioTrack=f)}),this.api.on(Se.default.Events.LEVELS_UPDATED,(p,f)=>{let m=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!m)return;let A=f.levels.map(g=>c.get(g));for(let g of this.videoRenditions)g.id&&!A.includes(g.id)&&m.removeRendition(g)});let v=null;this.api.on(Se.default.Events.ERROR,(p,f)=>{var m;f.type===Se.default.ErrorTypes.NETWORK_ERROR&&f.details===Se.default.ErrorDetails.FRAG_LOAD_ERROR&&(v=((m=f.frag)==null?void 0:m.level)??null)}),this.api.on(Se.default.Events.LEVEL_SWITCHED,(p,f)=>{let m=f.level;v!==null&&m<v&&(console.warn(`hls.js downgraded quality from level ${v} to ${m} due to fragment load failure.`),this.videoRenditions.selectedIndex=m,v=null)});let h=()=>{let p=this.videoRenditions.selectedIndex;this.api&&p!==this.api.nextLevel&&(this.api.nextLevel=p)};(a=this.videoRenditions)==null||a.addEventListener("change",h),this.api.once(Se.default.Events.DESTROYING,()=>O(this,it,Oc).call(this));return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};Vt=new WeakMap,bi=new WeakMap,To=new WeakMap,it=new WeakSet,ym=function(){var t,r;(t=u(this,Vt))==null||t.remove(),_(this,Vt,null),(r=this.nativeEl)==null||r.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,ra)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),_(this,To,!1)},Tm=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},Oc=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},ra=new WeakMap,Am=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},_i.shadowRootOptions={...De.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",_i);var Uc=_i;var WE="nanoplayer.4.min.js",FE="nanoplayer",ke={loading:!1,loaded:!1,error:null,callbacks:[]};function KE(i){return new Promise((e,t)=>{if(window.NanoPlayer){ke.loaded=!0,e();return}if(ke.loaded){e();return}if(ke.error){t(ke.error);return}if(ke.callbacks.push(a=>{a?t(a):e()}),ke.loading)return;ke.loading=!0;let o=`${i.endsWith("/")?i:`${i}/`}${FE}/${WE}`,n=document.createElement("script");n.src=o,n.async=!0,n.onload=()=>{ke.loaded=!0,ke.loading=!1,ke.callbacks.forEach(a=>a()),ke.callbacks=[]},n.onerror=()=>{let a=new Error(`Failed to load NanoPlayer script from ${o}`);ke.error=a,ke.loading=!1,ke.callbacks.forEach(l=>l(a)),ke.callbacks=[]},document.head.appendChild(n)})}var qE=yo(De),Wt,yi,le,rt,Ao,Le,oa,Ti,dr,So,Ft,ko,Lo,we,Nc,Sm,km,Lm,Tl,Ai=class extends qE{constructor(){super();S(this,we);S(this,Wt,null);S(this,yi,null);S(this,le,null);S(this,rt,null);S(this,Ao,"");S(this,Le,null);S(this,oa,!0);S(this,Ti,[]);S(this,dr,[]);S(this,So,null);S(this,Ft,null);S(this,ko,!1);S(this,Lo,!1);this.api=null;O(this,we,Tl).call(this,"config"),O(this,we,Tl).call(this,"streamid"),O(this,we,Tl).call(this,"sourceConfig")}static get observedAttributes(){return[...De.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:o,"library-location":n,...a}=t;return`
2879
+ ${$e.getTemplateHTML(n)}
2880
+ `}get config(){return u(this,Li)}set config(t){f(this,Li,t)}attributeChangedCallback(t,r,o){t!=="src"&&super.attributeChangedCallback(t,r,o),t==="src"&&r!==o&&this.load()}disconnectedCallback(){var t;P(this,Xe,lu).call(this),(t=super.disconnectedCallback)==null||t.call(this)}async load(){var o,n,a,l;let t=!this.api&&!u(this,No);if(P(this,Xe,lu).call(this),!this.src)return;if(t&&!u(this,Li)&&f(this,Li,JSON.parse(((n=(o=this.shadowRoot)==null?void 0:o.getElementById("config"))==null?void 0:n.textContent)||"{}")),!P(this,Xe,Km).call(this,this.src)){await Promise.resolve(),f(this,No,!0),this.nativeEl.src=this.src;return}if(Me.default.isSupported()){switch(await Promise.resolve(),this.api=new Me.default({liveDurationInfinity:!0,autoStartLoad:!1,...u(this,Li)}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let p=()=>{var A;return(A=this.api)==null?void 0:A.startLoad()};this.nativeEl.addEventListener("play",p,{once:!0}),this.api.on(Me.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",p)});break}case"metadata":{let p=this.api.config.maxBufferLength,A=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let E=()=>{this.api&&(this.api.config.maxBufferLength=p,this.api.config.maxBufferSize=A)};this.nativeEl.addEventListener("play",E,{once:!0}),this.api.on(Me.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",E)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,_a)),f(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 v=new WeakMap;this.api.on(Me.default.Events.MANIFEST_PARSED,(p,A)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(_=>{console.warn("Autoplay failed:",_)}),P(this,Xe,du).call(this);let E=this.videoTracks.getTrackById("main");E||(E=this.addVideoTrack("main"),E.id="main",E.selected=!0);for(let[_,k]of A.levels.entries()){let ie=E.addRendition(k.url[0],k.width,k.height,k.videoCodec??void 0,k.bitrate);v.set(k,`${_}`),ie.id=`${_}`}for(let[_,k]of A.audioTracks.entries()){let ie=k.default?"main":"alternative",ke=this.addAudioTrack(ie,k.name,k.lang);ke.id=`${_}`,k.default&&(ke.enabled=!0)}}),(a=u(this,qt))==null||a.call(this);let h=()=>{var _,k;let p=[...this.audioTracks].find(ie=>ie.enabled),A=p?+p.id:void 0,E=((_=this.api)==null?void 0:_.audioTracks.map(ie=>ie.id))??[];A!==void 0&&A!==((k=this.api)==null?void 0:k.audioTrack)&&E.includes(A)&&this.api&&(this.api.audioTrack=A)};this.audioTracks.addEventListener("change",h),f(this,qt,()=>{this.audioTracks.removeEventListener("change",h)}),this.api.on(Me.default.Events.LEVELS_UPDATED,(p,A)=>{let E=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!E)return;let _=A.levels.map(k=>v.get(k));for(let k of this.videoRenditions)k.id&&!_.includes(k.id)&&E.removeRendition(k)});let m=null;this.api.on(Me.default.Events.ERROR,(p,A)=>{var E;A.type===Me.default.ErrorTypes.NETWORK_ERROR&&A.details===Me.default.ErrorDetails.FRAG_LOAD_ERROR&&(m=((E=A.frag)==null?void 0:E.level)??null)}),this.api.on(Me.default.Events.LEVEL_SWITCHED,(p,A)=>{let E=A.level;m!==null&&E<m&&(console.warn(`hls.js downgraded quality from level ${m} to ${E} due to fragment load failure.`),this.videoRenditions.selectedIndex=E,m=null)});let T=()=>{let p=this.videoRenditions.selectedIndex;this.api&&p!==this.api.nextLevel&&(this.api.nextLevel=p)};(l=this.videoRenditions)==null||l.addEventListener("change",T),this.api.once(Me.default.Events.DESTROYING,()=>{var p,A;P(this,Xe,du).call(this),(p=this.videoRenditions)==null||p.removeEventListener("change",T),(A=u(this,qt))==null||A.call(this),f(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,Li=new WeakMap,No=new WeakMap,Xe=new WeakSet,lu=function(){var t,r,o;(t=u(this,Gt))==null||t.remove(),f(this,Gt,null),(r=u(this,qt))==null||r.call(this),f(this,qt,null),(o=this.nativeEl)==null||o.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,_a)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),f(this,No,!1)},Km=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},du=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},_a=new WeakMap,Gm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ci.shadowRootOptions={...$e.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",Ci);var cu=Ci;var ub="nanoplayer.4.min.js",hb="nanoplayer",Re={loading:!1,loaded:!1,error:null,callbacks:[]};function pb(i,e){return new Promise((t,r)=>{if(window.NanoPlayer){Re.loaded=!0,t();return}if(Re.loaded){t();return}if(Re.error){r(Re.error);return}if(Re.callbacks.push(a=>{a?r(a):t()}),Re.loading)return;Re.loading=!0;let o;e?o=e:o=`${i.endsWith("/")?i:`${i}/`}${hb}/${ub}`;let n=document.createElement("script");n.src=o,n.async=!0,n.onload=()=>{Re.loaded=!0,Re.loading=!1,Re.callbacks.forEach(a=>a()),Re.callbacks=[]},n.onerror=()=>{let a=new Error(`Failed to load NanoPlayer script from ${o}`);Re.error=a,Re.loading=!1,Re.callbacks.forEach(l=>l(a)),Re.callbacks=[]},document.head.appendChild(n)})}var mb=Oo($e),Rt,Ii,he,at,Uo,xe,ya,zt,gr,br,st,_r,Ho,$o,Se,qm,uu,zm,Ym,Qm,Vl,wi=class extends mb{constructor(){super();L(this,Se);L(this,Rt,null);L(this,Ii,null);L(this,he,null);L(this,at,null);L(this,Uo,"");L(this,xe,null);L(this,ya,!0);L(this,zt,[]);L(this,gr,[]);L(this,br,null);L(this,st,null);L(this,_r,!1);L(this,Ho,!1);L(this,$o,null);this.api=null;P(this,Se,Vl).call(this,"config"),P(this,Se,Vl).call(this,"streamid"),P(this,Se,Vl).call(this,"sourceConfig"),P(this,Se,qm).call(this)}static get observedAttributes(){return[...$e.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:o,"library-location":n,...a}=t;return`
2868
2881
  <script type="application/json" id="config">
2869
2882
  ${JSON.stringify(r.config||{})}
2870
2883
  <\/script>
2871
- ${De.getTemplateHTML(a)}
2872
- `}get config(){return u(this,Wt)}set config(t){_(this,Wt,t)}get sourceConfig(){return u(this,yi)}set sourceConfig(t){let r=u(this,yi)!==t;_(this,yi,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 n,a,l,c,v;let t=!u(this,le);O(this,we,Nc).call(this);let r=this.streamid,o=!!u(this,yi);if(!(!r&&!o)){_(this,So,new Promise(h=>{_(this,Ft,h)})),t&&!u(this,Wt)&&_(this,Wt,JSON.parse(((a=(n=this.shadowRoot)==null?void 0:n.getElementById("config"))==null?void 0:a.textContent)||"{}"));try{await KE(this.libraryLocation)}catch(h){console.error("[nano-video] Failed to load NanoPlayer script:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:"Failed to load NanoPlayer script"})),(l=u(this,Ft))==null||l.call(this);return}_(this,Ao,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),_(this,rt,document.createElement("div")),u(this,rt).id=u(this,Ao),u(this,rt).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.addEventListener("pause",h=>{var p;h.target!==this&&((p=u(this,rt))!=null&&p.contains(h.target))&&u(this,ko)&&h.stopImmediatePropagation()},!0),this.style.position="relative",this.nativeEl.style.display="none",this.appendChild(u(this,rt)),_(this,le,new window.NanoPlayer(u(this,Ao))),this.api=u(this,le);try{let h=O(this,we,Sm).call(this,r,o?u(this,yi):void 0),p=await u(this,le).setup(h);_(this,dr,((c=p.source.entries)==null?void 0:c.map((f,m)=>({index:m,height:f.info.height??0,width:f.info.width??0,bitrate:f.info.bitrate??0,label:f.info.height?`${f.info.height}p`:m===0?"Source":`Stream ${m+1}`})))??[]),O(this,we,Lm).call(this)}catch(h){console.error("[nano-video] Failed to setup NanoPlayer:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:"Failed to setup NanoPlayer"})),(v=u(this,Ft))==null||v.call(this)}}}async play(){if(u(this,So)&&await u(this,So),u(this,le)){_(this,ko,!0),u(this,le).play();return}return super.play()}pause(){if(u(this,le)){u(this,le).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,Le))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,le)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,Le))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,Le))==null?void 0:t.volume)??super.volume}set volume(t){u(this,Le)?u(this,Le).volume=t:super.volume=t}get muted(){var t;return((t=u(this,Le))==null?void 0:t.muted)??super.muted}set muted(t){u(this,Le)&&(u(this,Le).muted=t),u(this,le)?t?u(this,le).mute():u(this,le).unmute():super.muted=t}get videoWidth(){var t;return((t=u(this,Le))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,Le))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;O(this,we,Nc).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Wt=new WeakMap,yi=new WeakMap,le=new WeakMap,rt=new WeakMap,Ao=new WeakMap,Le=new WeakMap,oa=new WeakMap,Ti=new WeakMap,dr=new WeakMap,So=new WeakMap,Ft=new WeakMap,ko=new WeakMap,Lo=new WeakMap,we=new WeakSet,Nc=function(){u(this,Ti).forEach(t=>t()),_(this,Ti,[]),u(this,le)&&(u(this,le).destroy(),_(this,le,null),this.api=null),u(this,rt)&&(u(this,rt).remove(),_(this,rt,null)),_(this,Le,null),_(this,Lo,!1),_(this,dr,[])},Sm=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,Wt))==null?void 0:n.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((a=u(this,Wt))==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(new Event("loadeddata",{bubbles:!0})),this.dispatchEvent(new Event("canplay",{bubbles:!0})),this.dispatchEvent(new Event("canplaythrough",{bubbles:!0})),(l=u(this,Ft))==null||l.call(this)},onPlay:()=>{_(this,ko,!1),_(this,Lo,!0),this.dispatchEvent(new Event("play",{bubbles:!0})),this.dispatchEvent(new Event("playing",{bubbles:!0}))},onPause:()=>{this.dispatchEvent(new Event("pause",{bubbles:!0}))},onLoading:()=>{this.dispatchEvent(new Event("waiting",{bubbles:!0}))},onStartBuffering:()=>{this.dispatchEvent(new Event("waiting",{bubbles:!0}))},onStopBuffering:()=>{this.dispatchEvent(new Event("canplaythrough",{bubbles:!0})),this.dispatchEvent(new Event("playing",{bubbles:!0}))},onError:l=>{var p,f;let c=l.data.code??-1,v=l.data.message??"NanoPlayer error";if(c===2004&&u(this,Lo)){this.dispatchEvent(new Event("ended",{bubbles:!0})),(p=u(this,Ft))==null||p.call(this);return}let h=Object.assign(new Error(v),{code:c});this.dispatchEvent(new ErrorEvent("error",{error:h,message:v,bubbles:!0})),(f=u(this,Ft))==null||f.call(this)},onActiveVideoElementChange:l=>{var v;let c=(v=l.data)==null?void 0:v.activeVideoElement;c&&(_(this,Le,c),O(this,we,km).call(this,c))}}}},km=function(t){u(this,Ti).forEach(o=>o()),_(this,Ti,[]);let r=["timeupdate","volumechange","durationchange","resize"];for(let o of r){let n=()=>{this.dispatchEvent(new Event(o,{bubbles:!0}))};t.addEventListener(o,n),u(this,Ti).push(()=>t.removeEventListener(o,n))}},Lm=function(){for(let o of this.videoTracks)this.removeVideoTrack(o);if(u(this,dr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let o of u(this,dr)){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?(_(this,oa,!0),(n=u(this,le))==null||n.setAdaption({rule:"deviationOfMean2"})):(_(this,oa,!1),(a=u(this,le))==null||a.switchStream(o).catch(()=>{}),(l=u(this,le))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r)},Tl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ai.shadowRootOptions={...De.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",Ai);var Hc=Ai;var Oe=du("livekit-client");var GE=yo(De),Ye,_e,re,Ct,wo,It,Co,Io,de,$c,wm,Cm,Al,Im,Mm,Sl,Si=class extends GE{constructor(){super();S(this,de);S(this,Ye,null);S(this,_e,null);S(this,re,null);S(this,Ct,[]);S(this,wo,[]);S(this,It,"disconnected");S(this,Co,null);S(this,Io,null);this.room=null;O(this,de,Sl).call(this,"config"),O(this,de,Sl).call(this,"url"),O(this,de,Sl).call(this,"token")}static get observedAttributes(){return[...De.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:o,token:n,...a}=t;return`
2884
+ ${$e.getTemplateHTML(a)}
2885
+ `}get config(){return u(this,Rt)}set config(t){f(this,Rt,t)}get sourceConfig(){return u(this,Ii)}set sourceConfig(t){let r=u(this,Ii)!==t;f(this,Ii,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 n,a,l,d,v,h;let t=!u(this,he);P(this,Se,uu).call(this);let r=this.streamid,o=!!u(this,Ii);if(!(!r&&!o)){f(this,br,new Promise(m=>{f(this,st,m)})),t&&!u(this,Rt)&&f(this,Rt,JSON.parse(((a=(n=this.shadowRoot)==null?void 0:n.getElementById("config"))==null?void 0:a.textContent)||"{}"));try{await pb(this.libraryLocation,(l=u(this,Rt))==null?void 0:l.scriptUrl)}catch(m){console.error("[nano-video] Failed to load NanoPlayer script:",m),this.dispatchEvent(Jt(m)),(d=u(this,st))==null||d.call(this);return}f(this,Uo,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),f(this,at,document.createElement("div")),u(this,at).id=u(this,Uo),u(this,at).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.style.position="relative",this.nativeEl.style.display="none",this.appendChild(u(this,at)),f(this,he,new window.NanoPlayer(u(this,Uo))),this.api=u(this,he);try{let m=P(this,Se,zm).call(this,r,o?u(this,Ii):void 0),T=await u(this,he).setup(m);f(this,gr,((v=T.source.entries)==null?void 0:v.map((p,A)=>({index:A,height:p.info.height??0,width:p.info.width??0,bitrate:p.info.bitrate??0,label:p.info.height?`${p.info.height}p`:A===0?"Source":`Stream ${A+1}`})))??[]),P(this,Se,Qm).call(this)}catch(m){console.error("[nano-video] Failed to setup NanoPlayer:",m),this.dispatchEvent(Jt(m)),(h=u(this,st))==null||h.call(this)}}}async play(){if(u(this,br)&&await u(this,br),u(this,he)){f(this,_r,!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,xe))==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,xe))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,xe))==null?void 0:t.volume)??super.volume}set volume(t){u(this,xe)?u(this,xe).volume=t:super.volume=t}get muted(){var t;return((t=u(this,xe))==null?void 0:t.muted)??super.muted}set muted(t){u(this,xe)&&(u(this,xe).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,xe))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,xe))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t,r;P(this,Se,uu).call(this),(t=u(this,$o))==null||t.call(this),f(this,$o,null),(r=super.disconnectedCallback)==null||r.call(this)}};Rt=new WeakMap,Ii=new WeakMap,he=new WeakMap,at=new WeakMap,Uo=new WeakMap,xe=new WeakMap,ya=new WeakMap,zt=new WeakMap,gr=new WeakMap,br=new WeakMap,st=new WeakMap,_r=new WeakMap,Ho=new WeakMap,$o=new WeakMap,Se=new WeakSet,qm=function(){let t=r=>{var o;r.target!==this&&((o=u(this,at))!=null&&o.contains(r.target))&&u(this,_r)&&r.stopImmediatePropagation()};this.addEventListener("pause",t,!0),f(this,$o,()=>this.removeEventListener("pause",t,!0))},uu=function(){var t;(t=u(this,st))==null||t.call(this),f(this,br,null),f(this,st,null),u(this,zt).forEach(r=>r()),f(this,zt,[]);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(),f(this,he,null),this.api=null),u(this,at)&&(u(this,at).remove(),f(this,at,null)),f(this,xe,null),f(this,Ho,!1),f(this,gr,[])},zm=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,Rt))==null?void 0:n.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((a=u(this,Rt))==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(cd)),this.dispatchEvent(q(cn)),this.dispatchEvent(q(xa)),(l=u(this,st))==null||l.call(this)},onPlay:()=>{f(this,_r,!1),f(this,Ho,!0),this.dispatchEvent(q(sn)),this.dispatchEvent(q(jt))},onPause:()=>{this.dispatchEvent(q(Vi))},onLoading:()=>{this.dispatchEvent(q(Rr))},onStartBuffering:()=>{this.dispatchEvent(q(Rr))},onStopBuffering:()=>{this.dispatchEvent(q(xa)),this.dispatchEvent(q(jt))},onError:l=>{var h,m;f(this,_r,!1);let d=l.data.code??-1,v=l.data.message??"NanoPlayer error";if(d===2004&&u(this,Ho)){this.dispatchEvent(q(ln)),(h=u(this,st))==null||h.call(this);return}this.dispatchEvent(Jt(new Error(v),d)),(m=u(this,st))==null||m.call(this)},onActiveVideoElementChange:l=>{var v;let d=(v=l.data)==null?void 0:v.activeVideoElement;d&&(f(this,xe,d),P(this,Se,Ym).call(this,d))}}}},Ym=function(t){u(this,zt).forEach(o=>o()),f(this,zt,[]);let r=[dn,un,sd,ei];for(let o of r){let n=()=>{this.dispatchEvent(q(o))};t.addEventListener(o,n),u(this,zt).push(()=>t.removeEventListener(o,n))}},Qm=function(){for(let o of this.videoTracks)this.removeVideoTrack(o);for(let o of this.audioTracks)this.removeAudioTrack(o);if(u(this,gr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let o of u(this,gr)){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?(f(this,ya,!0),(n=u(this,he))==null||n.setAdaption({rule:"deviationOfMean2"})):(f(this,ya,!1),(a=u(this,he))==null||a.switchStream(o).catch(()=>{}),(l=u(this,he))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r),u(this,zt).push(()=>{this.videoRenditions.removeEventListener("change",r)})},Vl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},wi.shadowRootOptions={...$e.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",wi);var hu=wi;var ve=Nu("livekit-client");var vb=Oo($e),Je,ne,ae,xt,Bo,Vo,Pt,yr,Mi,le,Wl,Zm,Xm,Fl,Jm,jm,Kl,Ri=class extends vb{constructor(){super();L(this,le);L(this,Je,null);L(this,ne,null);L(this,ae,null);L(this,xt,[]);L(this,Bo,[]);L(this,Vo,[]);L(this,Pt,"disconnected");L(this,yr,null);L(this,Mi,null);this.room=null;P(this,le,Kl).call(this,"config"),P(this,le,Kl).call(this,"url"),P(this,le,Kl).call(this,"token")}static get observedAttributes(){return[...$e.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:o,token:n,...a}=t;return`
2873
2886
  <script type="application/json" id="config">
2874
2887
  ${JSON.stringify(r.config||{})}
2875
2888
  <\/script>
2876
- ${De.getTemplateHTML(a)}
2877
- `}get config(){return u(this,Ye)}set config(t){_(this,Ye,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():t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,o)}async load(){var l,c,v;let t=!u(this,_e);O(this,de,$c).call(this);let r=this.url,o=this.token;if(!r||!o)return;_(this,Co,new Promise(h=>{_(this,Io,h)})),t&&!u(this,Ye)&&_(this,Ye,JSON.parse(((c=(l=this.shadowRoot)==null?void 0:l.getElementById("config"))==null?void 0:c.textContent)||"{}"));let n=O(this,de,Im).call(this),a=O(this,de,Mm).call(this);_(this,_e,new Oe.Room(n)),this.room=u(this,_e),u(this,_e).on(Oe.RoomEvent.Connected,()=>{_(this,It,"connected")}),u(this,_e).on(Oe.RoomEvent.Disconnected,h=>{if(_(this,It,"disconnected"),h){let p=Object.assign(new Error(`LiveKit disconnected: ${h}`),{code:4001});this.dispatchEvent(new ErrorEvent("error",{error:p,message:p.message}))}else this.dispatchEvent(new Event("ended"))}),u(this,_e).on(Oe.RoomEvent.Reconnecting,()=>{_(this,It,"reconnecting"),this.dispatchEvent(new Event("waiting"))}),u(this,_e).on(Oe.RoomEvent.Reconnected,()=>{_(this,It,"connected"),this.dispatchEvent(new Event("playing"))}),u(this,_e).on(Oe.RoomEvent.TrackSubscribed,(h,p,f)=>{var m,A;if(h.kind===Oe.Track.Kind.Video){let g=h.attach();g.style.width="100%",g.style.height="100%",g.style.objectFit="contain",g.style.position="absolute",g.style.top="0",g.style.left="0",this.nativeEl.muted&&(g.muted=!0),this.nativeEl.style.display="none",(m=this.shadowRoot)==null||m.appendChild(g),_(this,re,g),O(this,de,wm).call(this,g),O(this,de,Cm).call(this,p),this.dispatchEvent(new Event("loadedmetadata")),this.dispatchEvent(new Event("resize")),this.dispatchEvent(new Event("canplay")),this.dispatchEvent(new Event("playing")),(A=u(this,Io))==null||A.call(this)}}),u(this,_e).on(Oe.RoomEvent.TrackUnsubscribed,h=>{h.kind===Oe.Track.Kind.Video&&(h.detach(),O(this,de,Al).call(this),u(this,re)&&(u(this,Ct).forEach(p=>p()),_(this,Ct,[]),u(this,re).remove(),_(this,re,null)))}),_(this,It,"connecting"),this.dispatchEvent(new Event("loadstart"));try{await u(this,_e).connect(r,o,a)}catch(h){_(this,It,"failed"),console.error("[livekit-video] Failed to connect:",h);let p=h instanceof Error?h.message:"Failed to connect to LiveKit room",f=Object.assign(new Error(p),{code:4e3});this.dispatchEvent(new ErrorEvent("error",{error:f,message:p})),(v=u(this,Io))==null||v.call(this)}}async play(){return u(this,Co)&&await u(this,Co),u(this,re)?u(this,re).play():super.play()}pause(){if(u(this,re)){u(this,re).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,re))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,_e)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,re))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,re))==null?void 0:t.volume)??super.volume}set volume(t){u(this,re)?u(this,re).volume=t:super.volume=t}get muted(){var t;return((t=u(this,re))==null?void 0:t.muted)??super.muted}set muted(t){u(this,re)?u(this,re).muted=t:super.muted=t}get videoWidth(){var t;return((t=u(this,re))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,re))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;O(this,de,$c).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Ye=new WeakMap,_e=new WeakMap,re=new WeakMap,Ct=new WeakMap,wo=new WeakMap,It=new WeakMap,Co=new WeakMap,Io=new WeakMap,de=new WeakSet,$c=function(){u(this,Ct).forEach(t=>t()),_(this,Ct,[]),O(this,de,Al).call(this),u(this,_e)&&(u(this,_e).disconnect(),_(this,_e,null),this.room=null),u(this,re)&&(u(this,re).remove(),_(this,re,null)),_(this,It,"disconnected")},wm=function(t){u(this,Ct).forEach(o=>o()),_(this,Ct,[]);let r=["timeupdate","volumechange","play","playing","pause","resize"];for(let o of r){let n=()=>{this.dispatchEvent(new Event(o))};t.addEventListener(o,n),u(this,Ct).push(()=>t.removeEventListener(o,n))}},Cm=function(t){var l;O(this,de,Al).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((c,v)=>c.quality-v.quality);for(let c of n){let v=o.addRendition("",c.width,c.height,void 0,c.bitrate);v.id=`${c.quality}`}let a=()=>{let c=this.videoRenditions.selectedIndex;if(c<0)t.setVideoQuality(Oe.VideoQuality.HIGH);else{let v=n[c];v&&t.setVideoQuality(v.quality)}};this.videoRenditions.addEventListener("change",a),u(this,wo).push(()=>this.videoRenditions.removeEventListener("change",a))},Al=function(){u(this,wo).forEach(t=>t()),_(this,wo,[]);for(let t of this.videoTracks)this.removeVideoTrack(t)},Im=function(){var t,r,o;return{adaptiveStream:((t=u(this,Ye))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=u(this,Ye))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((o=u(this,Ye))==null?void 0:o.disconnectOnPageLeave)??!1}},Mm=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=u(this,Ye))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=u(this,Ye))==null?void 0:r.iceTransportPolicy)??"relay"}}},Sl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Si.shadowRootOptions={...De.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",Si);var Bc=Si;return Gm(zE);})();
2889
+ ${$e.getTemplateHTML(a)}
2890
+ `}get config(){return u(this,Je)}set config(t){f(this,Je,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,Wl).call(this):t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,o)}async load(){var p,A,E;let t=!u(this,ne);P(this,le,Wl).call(this);let r=this.url,o=this.token;if(!r||!o)return;f(this,yr,new Promise(_=>{f(this,Mi,_)})),t&&!u(this,Je)&&f(this,Je,JSON.parse(((A=(p=this.shadowRoot)==null?void 0:p.getElementById("config"))==null?void 0:A.textContent)||"{}"));let n=P(this,le,Jm).call(this),a=P(this,le,jm).call(this);f(this,ne,new ve.Room(n)),this.room=u(this,ne);let l=()=>{f(this,Pt,"connected")},d=_=>{f(this,Pt,"disconnected"),_?this.dispatchEvent(Jt(new Error(`LiveKit disconnected: ${_}`),4001)):this.dispatchEvent(q(ln))},v=()=>{f(this,Pt,"reconnecting"),this.dispatchEvent(q(Rr))},h=()=>{f(this,Pt,"connected"),this.dispatchEvent(q(jt))},m=(_,k)=>{var ie,ke;if(_.kind===ve.Track.Kind.Video){let Le=_.attach();Le.style.width="100%",Le.style.height="100%",Le.style.objectFit="contain",Le.style.position="absolute",Le.style.top="0",Le.style.left="0",this.nativeEl.muted&&(Le.muted=!0),this.nativeEl.style.display="none",(ie=this.shadowRoot)==null||ie.appendChild(Le),f(this,ae,Le),P(this,le,Zm).call(this,Le),P(this,le,Xm).call(this,k),this.dispatchEvent(q(dd)),this.dispatchEvent(q(ei)),this.dispatchEvent(q(cn)),this.dispatchEvent(q(jt)),(ke=u(this,Mi))==null||ke.call(this)}},T=_=>{_.kind===ve.Track.Kind.Video&&(_.detach(),P(this,le,Fl).call(this),u(this,ae)&&(u(this,xt).forEach(k=>k()),f(this,xt,[]),u(this,ae).remove(),f(this,ae,null)))};u(this,ne).on(ve.RoomEvent.Connected,l),u(this,ne).on(ve.RoomEvent.Disconnected,d),u(this,ne).on(ve.RoomEvent.Reconnecting,v),u(this,ne).on(ve.RoomEvent.Reconnected,h),u(this,ne).on(ve.RoomEvent.TrackSubscribed,m),u(this,ne).on(ve.RoomEvent.TrackUnsubscribed,T),f(this,Vo,[()=>{var _;return(_=u(this,ne))==null?void 0:_.off(ve.RoomEvent.Connected,l)},()=>{var _;return(_=u(this,ne))==null?void 0:_.off(ve.RoomEvent.Disconnected,d)},()=>{var _;return(_=u(this,ne))==null?void 0:_.off(ve.RoomEvent.Reconnecting,v)},()=>{var _;return(_=u(this,ne))==null?void 0:_.off(ve.RoomEvent.Reconnected,h)},()=>{var _;return(_=u(this,ne))==null?void 0:_.off(ve.RoomEvent.TrackSubscribed,m)},()=>{var _;return(_=u(this,ne))==null?void 0:_.off(ve.RoomEvent.TrackUnsubscribed,T)}]),f(this,Pt,"connecting"),this.dispatchEvent(q(ld));try{await u(this,ne).connect(r,o,a)}catch(_){f(this,Pt,"failed"),console.error("[livekit-video] Failed to connect:",_);let k=_ instanceof Error?_.message:"Failed to connect to LiveKit room";this.dispatchEvent(Jt(new Error(k),4e3)),(E=u(this,Mi))==null||E.call(this)}}async play(){return u(this,yr)&&await u(this,yr),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,Wl).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Je=new WeakMap,ne=new WeakMap,ae=new WeakMap,xt=new WeakMap,Bo=new WeakMap,Vo=new WeakMap,Pt=new WeakMap,yr=new WeakMap,Mi=new WeakMap,le=new WeakSet,Wl=function(){var t;(t=u(this,Mi))==null||t.call(this),f(this,yr,null),f(this,Mi,null),u(this,xt).forEach(r=>r()),f(this,xt,[]),P(this,le,Fl).call(this),u(this,Vo).forEach(r=>r()),f(this,Vo,[]),u(this,ne)&&(u(this,ne).disconnect(),f(this,ne,null),this.room=null),u(this,ae)&&(u(this,ae).remove(),f(this,ae,null)),f(this,Pt,"disconnected")},Zm=function(t){u(this,xt).forEach(o=>o()),f(this,xt,[]);let r=[dn,un,sn,jt,Vi,ei];for(let o of r){let n=()=>{this.dispatchEvent(q(o))};t.addEventListener(o,n),u(this,xt).push(()=>t.removeEventListener(o,n))}},Xm=function(t){var l;P(this,le,Fl).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,v)=>d.quality-v.quality);for(let d of n){let v=o.addRendition("",d.width,d.height,void 0,d.bitrate);v.id=`${d.quality}`}let a=()=>{let d=this.videoRenditions.selectedIndex;if(d<0)t.setVideoQuality(ve.VideoQuality.HIGH);else{let v=n[d];v&&t.setVideoQuality(v.quality)}};this.videoRenditions.addEventListener("change",a),u(this,Bo).push(()=>this.videoRenditions.removeEventListener("change",a))},Fl=function(){u(this,Bo).forEach(t=>t()),f(this,Bo,[]);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,Je))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=u(this,Je))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((o=u(this,Je))==null?void 0:o.disconnectOnPageLeave)??!1}},jm=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=u(this,Je))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=u(this,Je))==null?void 0:r.iceTransportPolicy)??"relay"}}},Kl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ri.shadowRootOptions={...$e.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",Ri);var pu=Ri;return vv(fb);})();
2878
2891
  /*! Bundled license information:
2879
2892
 
2880
2893
  @lit/reactive-element/css-tag.js: