@broadcastingplatforms/player 0.0.0-dev.e67afbe → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +72 -0
- package/README.md +28 -12
- package/dist/bp-player.js +150 -150
- package/dist/bp-player.mjs +150 -150
- package/dist/bp-player.standalone.mjs +152 -152
- package/dist/core/events.d.ts +148 -0
- package/dist/core/state.d.ts +2 -1
- package/dist/index.d.ts +1 -1
- package/package.json +3 -4
package/dist/bp-player.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* BP Player (
|
|
2
|
+
* BP Player (v1.1.0)
|
|
3
3
|
* Universal video player web component
|
|
4
4
|
*/
|
|
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]`,
|
|
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=`/**
|
|
5
|
+
"use strict";var BPPlayer=(()=>{var cv=Object.create;var Lr=Object.defineProperty;var Pu=Object.getOwnPropertyDescriptor;var uv=Object.getOwnPropertyNames;var hv=Object.getPrototypeOf,pv=Object.prototype.hasOwnProperty;var Du=i=>{throw TypeError(i)};var mv=(i,e,t)=>e in i?Lr(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Ou=(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 vv=(i,e)=>{for(var t in e)Lr(i,t,{get:e[t],enumerable:!0})},Nu=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of uv(e))!pv.call(i,o)&&o!==t&&Lr(i,o,{get:()=>e[o],enumerable:!(r=Pu(e,o))||r.enumerable});return i};var fv=(i,e,t)=>(t=i!=null?cv(hv(i)):{},Nu(e||!i||!i.__esModule?Lr(t,"default",{value:i,enumerable:!0}):t,i)),Ev=i=>Nu(Lr({},"__esModule",{value:!0}),i),U=(i,e,t,r)=>{for(var o=r>1?void 0:r?Pu(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&&Lr(e,t,o),o};var $=(i,e,t)=>mv(i,typeof e!="symbol"?e+"":e,t),zl=(i,e,t)=>e.has(i)||Du("Cannot "+t);var u=(i,e,t)=>(zl(i,e,"read from private field"),t?t.call(i):e.get(i)),k=(i,e,t)=>e.has(i)?Du("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 gb={};vv(gb,{Attribute:()=>an,BPDefaultUI:()=>te,BPErrorDisplay:()=>Ft,BPLiveError:()=>et,BPLiveService:()=>wr,BPOverlay:()=>xt,BPPlayer:()=>Ce,Hls:()=>Me.default,HlsVideo:()=>Li,HlsVideoElement:()=>du,LiveKitVideo:()=>xi,LiveKitVideoElement:()=>hu,NANOPLAYER_NO_REPLAY_CODES:()=>th,NanoVideo:()=>Mi,NanoVideoElement:()=>uu,StateReceiverMixin:()=>rh,StateReceiverProps:()=>$i,addGlobalStyles:()=>Mr,classifyLiveKitError:()=>wa,classifyNanoPlayerError:()=>Ca,createInitialState:()=>tn,createPlayerCore:()=>Ma,createTemplate:()=>sh,forEachStateReceiverElement:()=>Bi,isBPLiveClipSource:()=>Hi,isBPLiveSource:()=>ih,isBPLiveStreamSource:()=>rn,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(),Uu=new WeakMap,Go=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=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 Go(typeof i=="string"?i:i+"",void 0,Yl),qo=(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 Go(t,i,Yl)},$u=(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 Hu(t)})(i):i;var{is:gv,defineProperty:bv,getOwnPropertyDescriptor:_v,getOwnPropertyNames:yv,getOwnPropertySymbols:Tv,getPrototypeOf:Av}=Object,Qt=globalThis,Bu=Qt.trustedTypes,Sv=Bu?Bu.emptyScript:"",Zl=Qt.reactiveElementPolyfillSupport,zo=(i,e)=>i,Yo={toAttribute(i,e){switch(e){case Boolean:i=i?Sv: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)=>!gv(i,e),Vu={attribute:!0,type:String,converter:Yo,reflect:!1,useDefault:!1,hasChanged:ka};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Qt.litPropertyMetadata??(Qt.litPropertyMetadata=new WeakMap);var Nt=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&&bv(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){let{get:o,set:n}=_v(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(zo("elementProperties")))return;let e=Av(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(zo("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(zo("properties"))){let t=this.properties,r=[...yv(t),...Tv(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 $u(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:Yo).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:Yo;this._$Em=o;let m=d.fromAttribute(t,l.type);this[o]=m??((a=this._$Ej)==null?void 0:a.get(o))??m,this._$Em=null}}requestUpdate(e,t,r,o=!1,n){var a;if(e!==void 0){let l=this.constructor;if(o===!1&&(n=this[e]),r??(r=l.getPropertyOptions(e)),!((r.hasChanged??ka)(n,t)||r.useDefault&&r.reflect&&n===((a=this._$Ej)==null?void 0:a.get(e))&&!this.hasAttribute(l._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:o,wrapped:n},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),n!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),o===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,a]of o){let{wrapped:l}=a,d=this[n];l!==!0||this._$AL.has(n)||d===void 0||this.C(n,void 0,a,d)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var o;return(o=r.hostUpdated)==null?void 0:o.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Nt.elementStyles=[],Nt.shadowRootOptions={mode:"open"},Nt[zo("elementProperties")]=new Map,Nt[zo("finalized")]=new Map,Zl==null||Zl({ReactiveElement:Nt}),(Qt.reactiveElementVersions??(Qt.reactiveElementVersions=[])).push("2.1.2");var Zo=globalThis,Wu=i=>i,La=Zo.trustedTypes,Fu=La?La.createPolicy("lit-html",{createHTML:i=>i}):void 0,Qu="$lit$",Zt=`lit$${Math.random().toFixed(9).slice(2)}$`,Zu="?"+Zt,kv=`<${Zu}>`,Oi=document,Xo=()=>Oi.createComment(""),Jo=i=>i===null||typeof i!="object"&&typeof i!="function",od=Array.isArray,Lv=i=>od(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Xl=`[
|
|
6
|
+
\f\r]`,Qo=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ku=/-->/g,Gu=/>/g,Pi=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}),qe=nd(1),kb=nd(2),Lb=nd(3),Ni=Symbol.for("lit-noChange"),_e=Symbol.for("lit-nothing"),Yu=new WeakMap,Di=Oi.createTreeWalker(Oi,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 Iv=(i,e)=>{let t=i.length-1,r=[],o,n=e===2?"<svg>":e===3?"<math>":"",a=Qo;for(let l=0;l<t;l++){let d=i[l],m,h,E=-1,b=0;for(;b<d.length&&(a.lastIndex=b,h=a.exec(d),h!==null);)b=a.lastIndex,a===Qo?h[1]==="!--"?a=Ku:h[1]!==void 0?a=Gu:h[2]!==void 0?(Xu.test(h[2])&&(o=RegExp("</"+h[2],"g")),a=Pi):h[3]!==void 0&&(a=Pi):a===Pi?h[0]===">"?(a=o??Qo,E=-1):h[1]===void 0?E=-2:(E=a.lastIndex-h[2].length,m=h[1],a=h[3]===void 0?Pi:h[3]==='"'?zu:qu):a===zu||a===qu?a=Pi:a===Ku||a===Gu?a=Qo:(a=Pi,o=void 0);let p=a===Pi&&i[l+1].startsWith("/>")?" ":"";n+=a===Qo?d+kv:E>=0?(r.push(m),d.slice(0,E)+Qu+d.slice(E)+Zt+p):d+Zt+(E===-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,[m,h]=Iv(e,t);if(this.el=i.createElement(m,r),Di.currentNode=this.el.content,t===2||t===3){let E=this.el.content.firstChild;E.replaceWith(...E.childNodes)}for(;(o=Di.nextNode())!==null&&d.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let E of o.getAttributeNames())if(E.endsWith(Qu)){let b=h[a++],p=o.getAttribute(E).split(Zt),T=/([.?@])?(.*)/.exec(b);d.push({type:1,index:n,name:T[2],strings:p,ctor:T[1]==="."?ed:T[1]==="?"?td:T[1]==="@"?id:Cr}),o.removeAttribute(E)}else E.startsWith(Zt)&&(d.push({type:6,index:n}),o.removeAttribute(E));if(Xu.test(o.tagName)){let E=o.textContent.split(Zt),b=E.length-1;if(b>0){o.textContent=La?La.emptyScript:"";for(let p=0;p<b;p++)o.append(E[p],Xo()),Di.nextNode(),d.push({type:2,index:++n});o.append(E[b],Xo())}}}else if(o.nodeType===8)if(o.data===Zu)d.push({type:2,index:n});else{let E=-1;for(;(E=o.data.indexOf(Zt,E+1))!==-1;)d.push({type:7,index:n}),E+=Zt.length-1}n++}}static createElement(e,t){let r=Oi.createElement("template");return r.innerHTML=e,r}};function Ir(i,e,t=i,r){var a,l;if(e===Ni)return e;let o=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl,n=Jo(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=Ir(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)??Oi).importNode(t,!0);Di.currentNode=o;let n=Di.nextNode(),a=0,l=0,d=r[0];for(;d!==void 0;){if(a===d.index){let m;d.type===2?m=new en(n,n.nextSibling,this,e):d.type===1?m=new d.ctor(n,d.name,d.strings,this,e):d.type===6&&(m=new rd(n,this,e)),this._$AV.push(m),d=r[++l]}a!==(d==null?void 0:d.index)&&(n=Di.nextNode(),a++)}return Di.currentNode=Oi,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++}},en=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=Ir(this,e,t),Jo(e)?e===_e||e==null||e===""?(this._$AH!==_e&&this._$AR(),this._$AH=_e):e!==this._$AH&&e!==Ni&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Lv(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&&Jo(this._$AH)?this._$AA.nextSibling.data=e:this.T(Oi.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(Xo()),this.O(Xo()),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=Wu(e).nextSibling;Wu(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=Ir(this,e,t,0),a=!Jo(e)||e!==this._$AH&&e!==Ni,a&&(this._$AH=e);else{let l=e,d,m;for(e=n[0],d=0;d<n.length-1;d++)m=Ir(this,l[r+d],t,d),m===Ni&&(m=this._$AH[d]),a||(a=!Jo(m)||m!==this._$AH[d]),m===_e?e=_e:e!==_e&&(e+=(m??"")+n[d+1]),this._$AH[d]=m}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=Ir(this,e,t,0)??_e)===Ni)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){Ir(this,e)}};var Jl=Zo.litHtmlPolyfillSupport;Jl==null||Jl(jo,en),(Zo.litHtmlVersions??(Zo.litHtmlVersions=[])).push("3.3.2");var ju=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,o=r._$litPart$;if(o===void 0){let n=(t==null?void 0:t.renderBefore)??null;r._$litPart$=o=new en(e.insertBefore(Xo(),n),n,void 0,t??{})}return o._$AI(i),o};var Ui=globalThis,Pe=class extends Nt{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 Ni}},eh;Pe._$litElement$=!0,Pe.finalized=!0,(eh=Ui.litElementHydrateSupport)==null||eh.call(Ui,{LitElement:Pe});var ad=Ui.litElementPolyfillSupport;ad==null||ad({LitElement:Pe});(Ui.litElementVersions??(Ui.litElementVersions=[])).push("4.2.2");var Xt=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Cv={attribute:!0,type:String,converter:Yo,reflect:!1,hasChanged:ka},wv=(i=Cv,e,t)=>{let{kind:r,metadata:o}=t,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(t.name,i),r==="accessor"){let{name:a}=t;return{set(l){let d=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,d,i,!0,l)},init(l){return l!==void 0&&this.C(a,void 0,i,l),l}}}if(r==="setter"){let{name:a}=t;return function(l){let d=this[a];e.call(this,l),this.requestUpdate(a,d,i,!0,l)}}throw Error("Unsupported decorator location: "+r)};function W(i){return(e,t)=>typeof t=="object"?wv(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 Jt(i){return W({...i,state:!0,attribute:!1})}var th=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function Ca(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 tn(){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 rn(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function Hi(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function ih(i){return rn(i)||Hi(i)}var et=class extends Error{constructor(t,r,o){super(t);this.code=r;this.status=o;this.name="BPLiveError"}},wr=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 et("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r=new AbortController,o=setTimeout(()=>r.abort(),3e4);try{let n=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`},signal:r.signal});if(!n.ok)throw new et(`HTTP ${n.status}: ${n.statusText}`,"HTTP_ERROR",n.status);return n.json()}catch(n){throw n instanceof Error&&n.name==="AbortError"?new et("Request timeout after 30s","TIMEOUT"):n}finally{clearTimeout(o)}}async getStream(e){return this.fetch(`/streams/${e}`)}async getClip(e){return this.fetch(`/clips/${e}`)}mapPlayerSourceToResolvedSource(e){if(e.provider==="livekit")return{type:"livekit",url:e.url,token:e.token,room:e.room};if(e.provider==="nanoplayer"){let{provider:t,...r}=e;return{type:"nano",source:r}}throw new et(`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,rn(e))return this.resolveStreamSource(e);if(Hi(e))return this.resolveClipSource(e);throw new et("Invalid BPLive source","INVALID_SOURCE")}extractStreamPoster(e){var t;return e.cover_photo??((t=e.channel)==null?void 0:t.cover_image)??void 0}async resolveStreamSource(e){var l,d,m,h,E,b,p,T,v;let r=(await this.getStream(e.streamId)).data;this._stream=r;let o=this.extractStreamPoster(r);if(!!r.ended_at&&((d=(l=r.media)==null?void 0:l.vod)==null?void 0:d.length)>0){let g=r.media.vod[0];return{source:{type:"video",url:g.original},contentType:"video",poster:o??g.thumb??void 0,videoWidth:(m=g.dimension)==null?void 0:m.width,videoHeight:(h=g.dimension)==null?void 0:h.height}}let a=r.player_source??((E=r.active_stream)==null?void 0:E.player_source);if(a)return{source:this.mapPlayerSourceToResolvedSource(a),contentType:"stream",poster:o};if(((p=(b=r.media)==null?void 0:b.vod)==null?void 0:p.length)>0){let g=r.media.vod[0];return{source:{type:"video",url:g.original},contentType:"video",poster:o??g.thumb??void 0,videoWidth:(T=g.dimension)==null?void 0:T.width,videoHeight:(v=g.dimension)==null?void 0:v.height}}throw new et("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 et("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 Mv(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 Rv(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var xv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],sd=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=tn()}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,m,h;if(Rv(e)){if(n!=null&&n.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new wr(n.bpLive)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let g=await this._bpLive.resolveSource(e);a=g.source,l=g.contentType,d=g.poster,m=g.videoWidth,h=g.videoHeight}let E=Mv(a);(this._currentProviderType!==null&&this._currentProviderType!==E||this._mediaElement)&&this.destroyMediaElement();let v=E==="nano"||E==="livekit"||l==="stream"?"live":"vod";return this._currentProviderType=E,this.updateState({providerType:E,contentType:l,streamType:v}),this._mediaElement=this.createMediaElement(E,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:m,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 xv){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=Ca(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({...tn(),volume:this._state.volume,muted:this._state.muted,loop:this._state.loop,playbackRate:this._state.playbackRate}),this.dispatch("sourcechange",{source:null})}async play(){if(this._mediaElement){this.updateState({paused:!1});try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this._mediaElement.pause())}seek(e){this._mediaElement&&(this._mediaElement.currentTime=e)}setVolume(e){let t=Math.max(0,Math.min(1,e));this.updateState({volume:t}),this._mediaElement&&(this._mediaElement.volume=t),this.dispatch("volumechange",{volume:t,muted:this._state.muted})}setMuted(e){this.updateState({muted:e}),this._mediaElement&&(this._mediaElement.muted=e),this.dispatch("volumechange",{volume:this._state.volume,muted:e})}setLoop(e){this.updateState({loop:e}),this._mediaElement&&(this._mediaElement.loop=e)}setPlaybackRate(e){this.updateState({playbackRate:e}),this._mediaElement&&(this._mediaElement.playbackRate=e),this.dispatch("ratechange",{playbackRate:e})}setTargetQuality(e){this.updateState({targetQuality:e}),this.dispatch("targetqualitychanged",{quality:e});let t=this._mediaElement;t!=null&&t.videoRenditions&&(t.videoRenditions.selectedIndex=(e==null?void 0:e.index)??-1)}setQuality(e){this.setTargetQuality(e)}_getFullscreenTarget(){return this._container?this._container.closest("media-controller")??this._container.parentElement:null}async setFullscreen(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"});let t=this._getFullscreenTarget();t&&(e&&!document.fullscreenElement?await t.requestFullscreen():!e&&document.fullscreenElement&&await document.exitFullscreen())}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){this._destroyed||(this._destroyed=!0,this.unloadSource(),this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this._container=null,this._config=void 0,this._ready=!1,this.dispatch("destroy",void 0),this._listeners.clear())}};function Ma(){return new sd}var $i="bpPlayerObservedProperties";function Ra(i){return $i in i&&Array.isArray(i[$i])}function rh(i,e){class t extends i{get[$i](){return e}}return t}function Pv(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 Bi(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=Pv(i);r.length>0&&await Promise.all(r.map(o=>Bi(o,e,t)))}function on(i,e,t){let r=i[$i];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[$i].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.
|
|
@@ -136,8 +136,8 @@ html.bp-player-full-window > body {
|
|
|
136
136
|
margin: 0 !important;
|
|
137
137
|
padding: 0 !important;
|
|
138
138
|
}
|
|
139
|
-
`;var ah=!1;function
|
|
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=(
|
|
139
|
+
`;var ah=!1;function Mr(){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=(C=>(C.CONFIGURATION="configuration",C.SOURCE="source",C.SOURCES="sources",C.AUTOPLAY="autoplay",C.MUTED="muted",C.LOOP="loop",C.SCALING="scaling",C.ASPECT_RATIO="aspect-ratio",C.DEBUG="debug",C.AUTOHIDE="autohide",C.HOTKEYS="hotkeys",C.PAUSED="paused",C.PLAYING="playing",C.ENDED="ended",C.SEEKING="seeking",C.WAITING="waiting",C.LOADING="loading",C.READY="ready",C.HAS_ERROR="has-error",C.HAS_FIRST_PLAY="has-first-play",C.FULLSCREEN="fullscreen",C.FULLWINDOW="fullwindow",C.DEVICE_TYPE="device-type",C.MOBILE="mobile",C.TV="tv",C.STREAM_TYPE="stream-type",C.LIVE="live",C.CONTENT_TYPE="content-type",C.USER_IDLE="user-idle",C.USER_IDLE_TIMEOUT="user-idle-timeout",C.MOBILE_ONLY="mobile-only",C.MOBILE_HIDDEN="mobile-hidden",C.TV_ONLY="tv-only",C.TV_HIDDEN="tv-hidden",C.LIVE_ONLY="live-only",C.LIVE_HIDDEN="live-hidden",C.VOD_HIDDEN="vod-hidden",C.CLIP_HIDDEN="clip-hidden",C.NO_AUTO_HIDE="no-auto-hide",C.DISABLED="disabled",C.HIDDEN="hidden",C.NOTOOLTIP="notooltip",C.MENU="menu",C.MENU_OPENED="menu-opened",C.ARIA_LABEL="aria-label",C.ARIA_LIVE="aria-live",C.ARIA_CHECKED="aria-checked",C.VOLUME_LEVEL="volume-level",C.PROVIDER_TYPE="provider-type",C))(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 Rr(){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}),Vi=(i,e)=>new CustomEvent(i,{bubbles:!0,composed:!0,...e});function tt(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 Wi="pause";var jt="playing";var xr="waiting";var ln="ended";var dn="timeupdate";var ld="durationchange";var dd="loadstart";var cd="loadedmetadata";var ud="loadeddata";var cn="canplay";var xa="canplaythrough";var un="volumechange";var ei="resize";var hn="ready";var Pa="change";var hd="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(Vi(hd,{detail:a}))}_setupListeners(){this._cleanup.forEach(a=>a()),this._cleanup=[];let t=this._host.player;if(!t)return;let r=()=>{this._syncFromPlayer()},o=()=>{this._updateSelection(),this.dispatchEvent(q(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
|
|
230
|
+
`;var ch=!1;function Uv(){if(ch||(ch=!0,document.getElementById("bp-player-styles")))return;Mr();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=dh,document.head.appendChild(i)}var Hv=["emptied","loadstart","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Ce=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&&Bi(o,this.providerContainer,this.registerStateReceiver);for(let o of r.removedNodes)o.nodeType===Node.ELEMENT_NODE&&Bi(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(),Uv(),this._mutationObserver=new MutationObserver(this.handleMutation),this._mutationObserver.observe(this,{childList:!0,subtree:!0})}get player(){return this._playerCore}get playerState(){var t;return((t=this._playerCore)==null?void 0:t.state)??null}get bpLive(){var t;return((t=this._playerCore)==null?void 0:t.bpLive)??null}async play(){var t;this.debug&&console.log("[BPPlayer] play() called"),await((t=this._playerCore)==null?void 0:t.play())}pause(){var t;this.debug&&console.log("[BPPlayer] pause() called"),(t=this._playerCore)==null||t.pause()}get paused(){var r;let t=((r=this._playerCore)==null?void 0:r.state.paused)??!0;return this.debug&&console.log("[BPPlayer] paused getter:",t),t}get ended(){var t;return((t=this._playerCore)==null?void 0:t.state.ended)??!1}get seeking(){var t;return((t=this._playerCore)==null?void 0:t.state.seeking)??!1}get waiting(){var t;return((t=this._playerCore)==null?void 0:t.state.waiting)??!1}get currentTime(){var t;return((t=this._playerCore)==null?void 0:t.state.currentTime)??0}set currentTime(t){var r;(r=this._playerCore)==null||r.seek(t)}get duration(){var t;return((t=this._playerCore)==null?void 0:t.state.duration)??NaN}get volume(){var t;return((t=this._playerCore)==null?void 0:t.state.volume)??1}set volume(t){var r;(r=this._playerCore)==null||r.setVolume(t)}get muted(){var t;return((t=this._playerCore)==null?void 0:t.state.muted)??this.defaultMuted}set muted(t){var r;(r=this._playerCore)==null||r.setMuted(t)}get playbackRate(){var t;return((t=this._playerCore)==null?void 0:t.state.playbackRate)??1}set playbackRate(t){var r;(r=this._playerCore)==null||r.setPlaybackRate(t)}get readyState(){var t;return((t=this._playerCore)==null?void 0:t.state.readyState)??0}get buffered(){var r;let t=(r=this._playerCore)==null?void 0:r.state.buffered;return t||{length:0,start:o=>{throw new DOMException(`Index ${o} is out of bounds`,"IndexSizeError")},end:o=>{throw new DOMException(`Index ${o} is out of bounds`,"IndexSizeError")}}}get videoWidth(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.width?r.width:((a=this._playerCore)==null?void 0:a.state.videoWidth)??0}get videoHeight(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.height?r.height:((a=this._playerCore)==null?void 0:a.state.videoHeight)??0}get videoElement(){var t;return((t=this._playerCore)==null?void 0:t.videoElement)??null}get providerType(){var t;return((t=this._playerCore)==null?void 0:t.state.providerType)??null}get videoRenditions(){return this._videoRenditions}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._mutationObserver)==null||t.disconnect(),this.destroyPlayer()}firstUpdated(t){super.firstUpdated(t),this.containerRef=this.renderRoot.querySelector(".bp-player-container"),this.containerRef&&!this.providerContainer&&(this.providerContainer=document.createElement("div"),this.providerContainer.className="bp-player-provider",this.providerContainer.style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.containerRef.appendChild(this.providerContainer)),this.initPlayerCore()}updated(t){super.updated(t),t.has("source")&&this.loadSource(),t.has("defaultMuted")&&this._playerCore&&this._playerCore.setMuted(this.defaultMuted),t.has("loop")&&this._playerCore&&this._playerCore.setLoop(this.loop)}initPlayerCore(){if(!(this._playerCore||!this.providerContainer))try{this._playerCore=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)}catch(t){console.error("[BPPlayer] Failed to initialize player:",t),this.dispatchEvent(tt(t instanceof Error?t:new Error(String(t))))}}async loadSource(){var r,o,n,a,l,d,m;let t=(o=(r=this.source)==null?void 0:r.sources)==null?void 0:o[0];if(!t){(n=this._playerCore)!=null&&n.ready&&this._playerCore.unloadSource();return}if(!this._playerCore||!this.providerContainer){this.debug&&console.log("[BPPlayer] loadSource skipped - player not initialized");return}this.debug&&console.log("[BPPlayer] loadSource:",t);try{let h=await this._playerCore.loadSource(t);if(!this._playerCore)return;if(h!=null&&h.videoWidth&&(h!=null&&h.videoHeight)&&(this.updateVideoDimensions(h.videoWidth,h.videoHeight),this.debug&&console.log("[BPPlayer] Source video dimensions:",{width:h.videoWidth,height:h.videoHeight})),(a=this._videoRenditions)==null||a._setupListeners(),this._hasDispatchedReady||(this._hasDispatchedReady=!0,Bi(this,this.providerContainer,this.registerStateReceiver),this.dispatchEvent(Vi(hn,{detail:this._playerCore})),this.debug&&console.log("[BPPlayer] Player ready",(l=this._playerCore)==null?void 0:l.state)),this.propagateStateToAllReceivers(),this.updateStateAttributes(),(m=(d=this._playerCore)==null?void 0:d.state)!=null&&m.paused&&this.dispatchEvent(q(Wi)),this.autoplay&&this._playerCore)try{await this._playerCore.play()}catch{}}catch(h){console.error("[BPPlayer] Failed to load source:",h),this.dispatchEvent(tt(h instanceof Error?h:new Error(String(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;let t=this._playerCore;for(let a of Hv){let l=()=>{this.debug&&!["durationchange","timeupdate"].includes(a)&&console.log(`[BPPlayer] Forwarding event: ${a}`,t.state),this.dispatchEvent(q(a))};t.addEventListener(a,l),this.eventCleanup.push(()=>t.removeEventListener(a,l))}let r=()=>{let a=t.videoElement;a&&this.updateVideoDimensions(a.videoWidth,a.videoHeight)};t.addEventListener("resize",r),t.addEventListener("loadedmetadata",r),this.eventCleanup.push(()=>t.removeEventListener("resize",r)),this.eventCleanup.push(()=>t.removeEventListener("loadedmetadata",r)),r();let o=()=>{this.dispatchEvent(q(ei))};t.addEventListener("qualitychange",o),this.eventCleanup.push(()=>t.removeEventListener("qualitychange",o));let n=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};t.addEventListener("statechange",n),this.eventCleanup.push(()=>t.removeEventListener("statechange",n))}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;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 qe`
|
|
231
231
|
<div
|
|
232
232
|
class="${this.getContainerClasses()}"
|
|
233
233
|
style="${this.getContainerStyle()}"
|
|
234
234
|
>
|
|
235
235
|
</div>
|
|
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`
|
|
236
|
+
`}};U([W({converter:Rr()})],Ce.prototype,"source",2),U([W({type:Boolean})],Ce.prototype,"autoplay",2),U([W({type:Boolean,reflect:!0,attribute:"muted"})],Ce.prototype,"defaultMuted",2),U([W({type:Boolean})],Ce.prototype,"loop",2),U([W({type:String})],Ce.prototype,"scaling",2),U([W({type:String,attribute:"aspect-ratio"})],Ce.prototype,"aspectRatio",2),U([W({converter:Rr()})],Ce.prototype,"config",2),U([W({type:Boolean})],Ce.prototype,"debug",2),U([Jt()],Ce.prototype,"_playerCore",2),Ce=U([Xt("bp-player")],Ce);var y={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},N={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},pd={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},uh=Object.entries(pd),s=uh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),$v={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Fi=uh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...$v}),Gy=Object.entries(Fi).reduce((i,[e,t])=>{let r=s[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),hh=Object.entries(s).reduce((i,[e,t])=>{let r=Fi[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"},it={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var ph={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function mh(i){return i==null?void 0:i.map(Vv).join(" ")}function vh(i){return i==null?void 0:i.split(/\s+/).map(Wv)}function Vv(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(o=>o!=null).join(":")}}function Wv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function fh(i){return i==null?void 0:i.map(Fv).join(" ")}function Eh(i){return i==null?void 0:i.split(/\s+/).map(Kv)}function Fv(i){if(i){let{id:e,kind:t,language:r,label:o}=i;return[e,t,r,o].filter(n=>n!=null).join(":")}}function Kv(i){if(i){let[e,t,r,o]=i.split(":");return{id:e,kind:t,language:r,label:o}}}function Pr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var Na=i=>new Promise(e=>setTimeout(e,i));var gh=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Gv=(i,e)=>{let t=i===1?gh[e].singular:gh[e].plural;return`${i} ${t}`},Ki=i=>{if(!Pr(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&&Gv(l,d)).filter(l=>l).join(", ")}${t?" remaining":""}`};function rt(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 Yy=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 bh={"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 _h,md={en:bh},vd=((_h=globalThis.navigator)==null?void 0:_h.language)||"en",yh=i=>{vd=i};var zv=i=>{var e,t,r;let[o]=vd.split("-");return((e=md[vd])==null?void 0:e[i])||((t=md[o])==null?void 0:t[i])||((r=md.en)==null?void 0:r[i])||i},_=(i,e={})=>zv(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(){}},Th={createElement:function(){return new pn.HTMLElement},createElementNS:function(){return new pn.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},pn={ResizeObserver:fd,document:Th,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}}}}},Ah="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",Sh=Object.keys(pn).every(i=>i in globalThis),c=Ah&&!Sh?pn:globalThis,ee=Ah&&!Sh?Th:globalThis.document;var kh=new WeakMap,Ed=i=>{let e=kh.get(i);return e||kh.set(i,e=new Set),e},Lh=new c.ResizeObserver(i=>{for(let e of i)for(let t of Ed(e.target))t(e)});function Ut(i,e){Ed(i).add(e),Lh.observe(i)}function Ht(i,e){let t=Ed(i);t.delete(e),t.size||Lh.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:ut(i,"media-controller")}function Ba(i){var e;let{MEDIA_CONTROLLER:t}=N,r=i.getAttribute(t);if(r)return(e=Gi(i))==null?void 0:e.getElementById(r)}var Va=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},Yv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},Wa=(i,e)=>Yv(i,e)[0],we=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:we(i,e.getRootNode().host),ut=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||ut(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 Gi(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 Ih(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=Qv(i,r=>r===e);return t||vn(i,e)}function Qv(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)),Zv=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ka=(i,e,t,r)=>(Ch(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ne;function Xv(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
|
|
243
|
+
`}var Dr=class extends c.HTMLElement{constructor(){if(super(),Zv(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,Jv(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:m,height:h}=this.getBoundingClientRect(),E=n-l,b=a-d;if(E<0||b<0||E>m||b>h||m===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?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(t,{composed:!0,bubbles:!0}))}};Ne=new WeakMap;Dr.shadowRootOptions={mode:"open"};Dr.getTemplateHTML=Xv;function Jv(i){var e;let t=i.getAttribute(N.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):ut(i,"media-controller")}c.customElements.get("media-gesture-receiver")||c.customElements.define("media-gesture-receiver",Dr);var Ga=Dr;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)},qi=(i,e,t,r)=>(yd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ze=(i,e,t)=>(yd(i,e,"access private method"),t),Ya,Or,En,Nr,qa,gd,wh,fn,za,bd,Mh,_d,Rh,gn,Qa,Za,Td,Ur,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 jv(i){return`
|
|
244
244
|
<style>
|
|
245
245
|
|
|
246
246
|
:host([${s.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
|
|
@@ -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 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`
|
|
394
|
+
`}var ef=Object.values(s),tf="sm:384 md:576 lg:768 xl:960";function rf(i){xh(i.target,i.contentRect.width)}function xh(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(x.BREAKPOINTS))!=null?t:tf,o=of(r),n=nf(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(Fi.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Fi.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function of(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function nf(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var zi=class extends c.HTMLElement{constructor(){if(super(),Ve(this,gd),Ve(this,bd),Ve(this,_d),Ve(this,gn),Ve(this,Za),Ve(this,Ur),Ve(this,Ya,0),Ve(this,Or,null),Ve(this,En,null),Ve(this,Nr,void 0),this.breakpointsComputed=!1,Ve(this,qa,new MutationObserver(ze(this,gd,wh).bind(this))),Ve(this,fn,!1),Ve(this,za,t=>{We(this,fn)||(setTimeout(()=>{rf(t),qi(this,fn,!1)},0),qi(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,Or)&&this.mediaUnsetCallback(We(this,Or));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[x.AUTOHIDE,x.GESTURES_DISABLED].concat(ef).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&&(qi(this,Or,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}),Ut(this,We(this,za));let r=this.getAttribute(x.AUDIO)!=null?_("audio player"):_("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(x.USER_INACTIVE,""),xh(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(),Ht(this,We(this,za)),this.media&&this.mediaUnsetCallback(this.media),(e=c.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){qi(this,Or,null)}handleEvent(e){switch(e.type){case"pointerdown":qi(this,Ya,e.timeStamp);break;case"pointermove":ze(this,bd,Mh).call(this,e);break;case"pointerup":ze(this,_d,Rh).call(this,e);break;case"mouseleave":ze(this,gn,Qa).call(this);break;case"mouseup":this.removeAttribute(x.KEYBOARD_CONTROL);break;case"keyup":ze(this,Ur,bn).call(this),this.setAttribute(x.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);qi(this,Nr,isNaN(t)?0:t)}get autohide(){return(We(this,Nr)===void 0?2:We(this,Nr)).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;Or=new WeakMap;En=new WeakMap;Nr=new WeakMap;qa=new WeakMap;gd=new WeakSet;wh=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;Mh=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-We(this,Ya)<250)return;ze(this,Za,Td).call(this),clearTimeout(We(this,En));let e=this.hasAttribute(x.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&ze(this,Ur,bn).call(this)};_d=new WeakSet;Rh=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(x.USER_INACTIVE);[this,this.media].includes(i.target)&&e?ze(this,gn,Qa).call(this):ze(this,Ur,bn).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&ze(this,Ur,bn).call(this)};gn=new WeakSet;Qa=function(){if(We(this,Nr)<0||this.hasAttribute(x.USER_INACTIVE))return;this.setAttribute(x.USER_INACTIVE,"");let i=new c.CustomEvent(Fi.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(Fi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Ur=new WeakSet;bn=function(){ze(this,Za,Td).call(this),clearTimeout(We(this,En));let i=parseInt(this.autohide);i<0||qi(this,En,setTimeout(()=>{ze(this,gn,Qa).call(this)},i*1e3))};zi.shadowRootOptions={mode:"open"};zi.getTemplateHTML=jv;c.customElements.get("media-container")||c.customElements.define("media-container",zi);var Ph=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ye=(i,e,t)=>(Ph(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)=>(Ph(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Hr,$r,Ja,Yi,$t,ri,oi=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){_n(this,$t),_n(this,Hr,void 0),_n(this,$r,void 0),_n(this,Ja,void 0),_n(this,Yi,new Set),Xa(this,Hr,e),Xa(this,$r,t),Xa(this,Ja,new Set(r))}[Symbol.iterator](){return ye(this,$t,ri).values()}get length(){return ye(this,$t,ri).size}get value(){var e;return(e=[...ye(this,$t,ri)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Xa(this,Yi,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...ye(this,$t,ri)][e]}values(){return ye(this,$t,ri).values()}forEach(e,t){ye(this,$t,ri).forEach(e,t)}add(...e){var t,r;e.forEach(o=>ye(this,Yi).add(o)),!(this.value===""&&!((t=ye(this,Hr))!=null&&t.hasAttribute(`${ye(this,$r)}`)))&&((r=ye(this,Hr))==null||r.setAttribute(`${ye(this,$r)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>ye(this,Yi).delete(r)),(t=ye(this,Hr))==null||t.setAttribute(`${ye(this,$r)}`,`${this.value}`)}contains(e){return ye(this,$t,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}};Hr=new WeakMap;$r=new WeakMap;Ja=new WeakMap;Yi=new WeakMap;$t=new WeakSet;ri=function(){return ye(this,Yi).size?ye(this,Yi):ye(this,Ja)};var af=(i="")=>i.split(/\s+/),Dh=(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}},Qi=(i="",e={})=>af(i).map(t=>{let r=Dh(t);return{...e,...r}}),Ad=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?Dh(e):e):typeof i=="string"?Qi(i):[i]:[],ja=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Bt=(i=[])=>Array.prototype.map.call(i,ja).join(" "),sf=(i,e)=>t=>t[i]===e,Oh=i=>{let e=Object.entries(i).map(([t,r])=>sf(t,r));return t=>e.every(r=>r(t))},Zi=(i,e=[],t=[])=>{let r=Ad(t).map(Oh),o=n=>r.some(a=>a(n));Array.from(e).filter(o).forEach(n=>{n.mode=i})},Xi=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Oh(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 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)}},Nh="exitFullscreen"in ee?"exitFullscreen":"webkitExitFullscreen"in ee?"webkitExitFullscreen":"webkitCancelFullScreen"in ee?"webkitCancelFullScreen":void 0,Hh=i=>{var e;let{documentElement:t}=i;if(Nh){let r=(e=t==null?void 0:t[Nh])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},yn="fullscreenElement"in ee?"fullscreenElement":"webkitFullscreenElement"in ee?"webkitFullscreenElement":void 0,lf=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===ph.FULLSCREEN?t:r},$h=i=>{var e;let{media:t,documentElement:r,fullscreenElement:o=t}=i;if(!t||!r)return!1;let n=lf(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},df="fullscreenEnabled"in ee?"fullscreenEnabled":"webkitFullscreenEnabled"in ee?"webkitFullscreenEnabled":void 0,Bh=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[df])||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)},Vh=async(i=Sd())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([cf(i,t.signal),uf(i,e)]);return t.abort(),r},cf=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),uf=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await Na(10)}return i.volume!==e},hf=/.*Version\/.*Safari\/.*/.test(c.navigator.userAgent),kd=(i=Sd())=>c.matchMedia("(display-mode: standalone)").matches&&hf?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Ld=(i=Sd())=>Bh({documentElement:ee,media:i}),Wh=Ld(),Fh=kd(),Kh=!!c.WebKitPlaybackTargetAvailabilityEvent,Gh=!!c.chrome;var Br=i=>Xi(i.media,e=>[De.SUBTITLES,De.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Id=i=>Xi(i.media,e=>e.mode===ti.SHOWING&&[De.SUBTITLES,De.CAPTIONS].includes(e.kind)),is=(i,e)=>{let t=Br(i),r=Id(i),o=!!r.length;if(t.length){if(e===!1||o&&e!==!0)Zi(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"),E=h?[h,...globalThis.navigator.languages]:globalThis.navigator.languages,b=t.filter(p=>E.some(T=>p.language.toLowerCase().startsWith(T.split("-")[0]))).sort((p,T)=>{let v=E.findIndex(L=>p.language.toLowerCase().startsWith(L.split("-")[0])),g=E.findIndex(L=>T.language.toLowerCase().startsWith(L.split("-")[0]));return v-g});b[0]&&(n=b[0])}let{language:l,label:d,kind:m}=n;Zi(ti.DISABLED,t,r),Zi(ti.SHOWING,t,[{language:l,label:d,kind:m}])}}},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)?pf(i,e):Object.entries(i).every(([t,r])=>t in e&&rs(r,e[t])),pf=(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 mf=Object.values(it),os,vf=Vh().then(i=>(os=i,os)),qh=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))}))},ff=new c.DOMParser,Ef=i=>i&&(ff.parseFromString(i,"text/html").body.textContent||i),Vr={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";Vr.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;Vr.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||!Pr(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=[it.LIVE,it.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:o}=e;if(mf.includes(o))return o===it.UNKNOWN?r:o;let n=e.duration;return n===1/0?it.LIVE:Number.isFinite(n)?it.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=Vr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===it.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(!(Vr.mediaStreamType.get(i)===it.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 Br(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Id(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]=Xi(t,{kind:De.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:o,startTime:n,endTime:a})=>({text:Ef(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 $h(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&&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(!Wh||!Ld(e))return Oe.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!Fh||!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&&vf.then(e=>i(e?void 0:Oe.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!Gh||!((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(!Kh)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 zh={[y.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,o,n;let{media:a}=e,l=t??void 0,d,m;if(a&&l!=null){let[p]=Xi(a,{kind:De.METADATA,label:"thumbnails"}),T=Array.prototype.find.call((r=p==null?void 0:p.cues)!=null?r:[],(v,g,L)=>g===0?v.endTime>l:g===L.length-1?v.startTime<=l:v.startTime<=l&&v.endTime>l);if(T){let v=/'^(?:[a-z]+:)?\/\//i.test(T.text)||(o=a==null?void 0:a.querySelector('track[label="thumbnails"]'))==null?void 0:o.src,g=new URL(T.text,v);m=new URLSearchParams(g.hash).get("#xywh").split(",").map(ie=>+ie),d=g.href}}let h=i.mediaDuration.get(e),b=(n=i.mediaChaptersCues.get(e).find((p,T,v)=>T===v.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&&b==null&&(b=""),{mediaPreviewTime:l,mediaPreviewImage:d,mediaPreviewCoords:m,mediaPreviewChapter:b}},[y.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[y.MEDIA_PLAY_REQUEST](i,e){var t,r,o,n;let a="mediaPaused",d=i.mediaStreamType.get(e)===it.LIVE,m=!((t=e.options)!=null&&t.noAutoSeekToLive),h=i.mediaTargetLiveWindow.get(e)>0;if(d&&m&&!h){let E=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(E){let b=(n=(o=e.options)==null?void 0:o.seekToLiveOffset)!=null?n:0,p=E-b;i.mediaCurrentTime.set(p,e)}}i[a].set(!1,e)},[y.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",o=t;i[r].set(o,e)},[y.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[y.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[y.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",o=!!t;return i[r].set(o,e),{mediaLoop:o}},[y.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",o=t;o&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(o,e)},[y.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",o=t;i[r].set(o,e)},[y.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,o;let n="mediaCurrentTime",a=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(a)))return;let l=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,d=a-l;i[n].set(d,e)},[y.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:o}=e,n=Br(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),Zi(ti.SHOWING,n,a)},[y.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=Br(e),o=t??[];Zi(ti.DISABLED,r,o)},[y.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){is(e,t)},[y.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",o=t;i[r].set(o,e)},[y.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",o=t;i[r].set(o,e)},[y.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[y.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[y.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e,t){let r="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[r].set(!0,e,t)},[y.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[y.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[y.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[y.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var Yh=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Vr,requestMap:o=zh,options:n={},monitorStateOwnersOnlyWithSubscriptions:a=!0})=>{let l=[],d={options:{...n}},m=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),h=v=>{v!=null&&(rs(v,m)||(m=Object.freeze({...m,...v}),l.forEach(g=>g(m))))},E=()=>{let v=Object.entries(r).reduce((g,[L,{get:ie}])=>(g[L]=ie(d),g),{});h(v)},b={},p,T=async(v,g)=>{var L,ie,ke,Le,Ar,pu,Gl,I,K,de,re,z,fe,Ot,Fo,mu;let iv=!!p;if(p={...d,...p??{},...v},iv)return;await qh(...Object.values(v));let Sr=l.length>0&&g===0&&a,vu=d.media!==p.media,fu=((L=d.media)==null?void 0:L.textTracks)!==((ie=p.media)==null?void 0:ie.textTracks),Eu=((ke=d.media)==null?void 0:ke.videoRenditions)!==((Le=p.media)==null?void 0:Le.videoRenditions),gu=((Ar=d.media)==null?void 0:Ar.audioTracks)!==((pu=p.media)==null?void 0:pu.audioTracks),bu=((Gl=d.media)==null?void 0:Gl.remote)!==((I=p.media)==null?void 0:I.remote),_u=d.documentElement!==p.documentElement,yu=!!d.media&&(vu||Sr),Tu=!!((K=d.media)!=null&&K.textTracks)&&(fu||Sr),Au=!!((de=d.media)!=null&&de.videoRenditions)&&(Eu||Sr),Su=!!((re=d.media)!=null&&re.audioTracks)&&(gu||Sr),ku=!!((z=d.media)!=null&&z.remote)&&(bu||Sr),Lu=!!d.documentElement&&(_u||Sr),ql=yu||Tu||Au||Su||ku||Lu,kr=l.length===0&&g===1&&a,C=!!p.media&&(vu||kr),Iu=!!((fe=p.media)!=null&&fe.textTracks)&&(fu||kr),Cu=!!((Ot=p.media)!=null&&Ot.videoRenditions)&&(Eu||kr),wu=!!((Fo=p.media)!=null&&Fo.audioTracks)&&(gu||kr),Mu=!!((mu=p.media)!=null&&mu.remote)&&(bu||kr),Ru=!!p.documentElement&&(_u||kr),xu=C||Iu||Cu||wu||Mu||Ru;if(!(ql||xu)){Object.entries(p).forEach(([Y,Ko])=>{d[Y]=Ko}),E(),p=void 0;return}Object.entries(r).forEach(([Y,{get:Ko,mediaEvents:rv=[],textTracksEvents:ov=[],videoRenditionsEvents:nv=[],audioTracksEvents:av=[],remoteEvents:sv=[],rootEvents:lv=[],stateOwnersUpdateHandlers:dv=[]}])=>{b[Y]||(b[Y]={});let Be=oe=>{let pe=Ko(d,oe);h({[Y]:pe})},be;be=b[Y].mediaEvents,rv.forEach(oe=>{be&&yu&&(d.media.removeEventListener(oe,be),b[Y].mediaEvents=void 0),C&&(p.media.addEventListener(oe,Be),b[Y].mediaEvents=Be)}),be=b[Y].textTracksEvents,ov.forEach(oe=>{var pe,je;be&&Tu&&((pe=d.media.textTracks)==null||pe.removeEventListener(oe,be),b[Y].textTracksEvents=void 0),Iu&&((je=p.media.textTracks)==null||je.addEventListener(oe,Be),b[Y].textTracksEvents=Be)}),be=b[Y].videoRenditionsEvents,nv.forEach(oe=>{var pe,je;be&&Au&&((pe=d.media.videoRenditions)==null||pe.removeEventListener(oe,be),b[Y].videoRenditionsEvents=void 0),Cu&&((je=p.media.videoRenditions)==null||je.addEventListener(oe,Be),b[Y].videoRenditionsEvents=Be)}),be=b[Y].audioTracksEvents,av.forEach(oe=>{var pe,je;be&&Su&&((pe=d.media.audioTracks)==null||pe.removeEventListener(oe,be),b[Y].audioTracksEvents=void 0),wu&&((je=p.media.audioTracks)==null||je.addEventListener(oe,Be),b[Y].audioTracksEvents=Be)}),be=b[Y].remoteEvents,sv.forEach(oe=>{var pe,je;be&&ku&&((pe=d.media.remote)==null||pe.removeEventListener(oe,be),b[Y].remoteEvents=void 0),Mu&&((je=p.media.remote)==null||je.addEventListener(oe,Be),b[Y].remoteEvents=Be)}),be=b[Y].rootEvents,lv.forEach(oe=>{be&&Lu&&(d.documentElement.removeEventListener(oe,be),b[Y].rootEvents=void 0),Ru&&(p.documentElement.addEventListener(oe,Be),b[Y].rootEvents=Be)});let Ta=b[Y].stateOwnersUpdateHandlers;if(Ta&&ql&&(Array.isArray(Ta)?Ta:[Ta]).forEach(pe=>{typeof pe=="function"&&pe()}),xu){let oe=dv.map(pe=>pe(Be,p)).filter(pe=>typeof pe=="function");b[Y].stateOwnersUpdateHandlers=oe.length===1?oe[0]:oe}else ql&&(b[Y].stateOwnersUpdateHandlers=void 0)}),Object.entries(p).forEach(([Y,Ko])=>{d[Y]=Ko}),E(),p=void 0};return T({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(v){let{type:g,detail:L}=v;if(o[g]&&m.mediaErrorCode==null){h(o[g](r,d,v));return}g==="mediaelementchangerequest"?T({media:L}):g==="fullscreenelementchangerequest"?T({fullscreenElement:L}):g==="documentelementchangerequest"?T({documentElement:L}):g==="optionschangerequest"&&(Object.entries(L??{}).forEach(([ie,ke])=>{d.options[ie]=ke}),E())},getState(){return m},subscribe(v){return T({},l.length+1),l.push(v),v(m),()=>{let g=l.indexOf(v);g>=0&&(T({},l.length-1),l.splice(g,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)),Ye=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ht=(i,e,t,r)=>(Pd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),mt=(i,e,t)=>(Pd(i,e,"access private method"),t),ni,Tn,V,ji,An,pt,ns,Sn,as,Cd,er,Wr,ss,wd,Md,tp,ip=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],Qh=10,Zh=.025,Xh=.25,gf=.25,bf=2,A={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},Rd=class extends zi{constructor(){super(),Ye(this,as),Ye(this,er),Ye(this,ss),Ye(this,Md),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Ye(this,ni,new oi(this,A.HOTKEYS)),Ye(this,Tn,void 0),Ye(this,V,void 0),Ye(this,ji,null),Ye(this,An,void 0),Ye(this,pt,void 0),Ye(this,ns,t=>{var r;(r=R(this,V))==null||r.dispatch(t)}),Ye(this,Sn,void 0),this.associateElement(this);let e={};ht(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(hh[n],{composed:!0,detail:o});this.dispatchEvent(a)}),e=t}),this.hasAttribute(A.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(A.NO_HOTKEYS,A.HOTKEYS,A.DEFAULT_STREAM_TYPE,A.DEFAULT_SUBTITLES,A.DEFAULT_DURATION,A.NO_MUTED_PREF,A.NO_VOLUME_PREF,A.LANG,A.LOOP)}get mediaStore(){return R(this,V)}set mediaStore(e){var t,r;if(R(this,V)&&((t=R(this,pt))==null||t.call(this),ht(this,pt,void 0)),ht(this,V,e),!R(this,V)&&!this.hasAttribute(A.NO_DEFAULT_STORE)){mt(this,as,Cd).call(this);return}ht(this,pt,(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(A.FULLSCREEN_ELEMENT)&&this.removeAttribute(A.FULLSCREEN_ELEMENT),ht(this,Tn,e),(t=R(this,V))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return w(this,A.DEFAULT_SUBTITLES)}set defaultSubtitles(e){M(this,A.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return D(this,A.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){O(this,A.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return H(this,A.DEFAULT_DURATION)}set defaultDuration(e){B(this,A.DEFAULT_DURATION,e)}get noHotkeys(){return w(this,A.NO_HOTKEYS)}set noHotkeys(e){M(this,A.NO_HOTKEYS,e)}get keysUsed(){return D(this,A.KEYS_USED)}set keysUsed(e){O(this,A.KEYS_USED,e)}get liveEdgeOffset(){return H(this,A.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){B(this,A.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return w(this,A.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){M(this,A.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return w(this,A.NO_VOLUME_PREF)}set noVolumePref(e){M(this,A.NO_VOLUME_PREF,e)}get noMutedPref(){return w(this,A.NO_MUTED_PREF)}set noMutedPref(e){M(this,A.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return w(this,A.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){M(this,A.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return w(this,A.NO_DEFAULT_STORE)}set noDefaultStore(e){M(this,A.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var o,n,a,l,d,m,h,E,b,p,T,v;if(super.attributeChangedCallback(e,t,r),e===A.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(A.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):r!==t&&r===null&&this.enableHotkeys();else if(e===A.HOTKEYS)R(this,ni).value=r;else if(e===A.DEFAULT_SUBTITLES&&r!==t)(o=R(this,V))==null||o.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(A.DEFAULT_SUBTITLES)}});else if(e===A.DEFAULT_STREAM_TYPE)(a=R(this,V))==null||a.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(A.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===A.LIVE_EDGE_OFFSET)(l=R(this,V))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(A.LIVE_EDGE_OFFSET)}});else if(e===A.SEEK_TO_LIVE_OFFSET)(d=R(this,V))==null||d.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(A.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===A.NO_AUTO_SEEK_TO_LIVE)(m=R(this,V))==null||m.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(A.NO_AUTO_SEEK_TO_LIVE)}});else if(e===A.FULLSCREEN_ELEMENT){let g=r?(h=this.getRootNode())==null?void 0:h.getElementById(r):void 0;ht(this,Tn,g),(E=R(this,V))==null||E.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===A.LANG&&r!==t?(yh(r),(b=R(this,V))==null||b.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===A.LOOP&&r!==t?(p=R(this,V))==null||p.dispatch({type:y.MEDIA_LOOP_REQUEST,detail:r!=null}):e===A.NO_VOLUME_PREF&&r!==t?(T=R(this,V))==null||T.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(A.NO_VOLUME_PREF)}}):e===A.NO_MUTED_PREF&&r!==t&&((v=R(this,V))==null||v.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(A.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!R(this,V)&&!this.hasAttribute(A.NO_DEFAULT_STORE)&&mt(this,as,Cd).call(this),(e=R(this,V))==null||e.dispatch({type:"documentelementchangerequest",detail:ee}),super.connectedCallback(),R(this,V)&&!R(this,pt)&&ht(this,pt,(t=R(this,V))==null?void 0:t.subscribe(R(this,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:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:R(this,Sn)}))},0),this.hasAttribute(A.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,o,n;if((e=super.disconnectedCallback)==null||e.call(this),R(this,V)){let a=R(this,V).getState();ht(this,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:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}R(this,pt)&&((n=R(this,pt))==null||n.call(this),ht(this,pt,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=R(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=R(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){ep(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=kf(e,r,o);Object.values(y).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(y).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])=>{ep([e],o,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",mt(this,ss,wd))}disableHotkeys(){this.removeEventListener("keydown",mt(this,ss,wd)),this.removeEventListener("keyup",mt(this,er,Wr))}get hotkeys(){return D(this,A.HOTKEYS)}set hotkeys(e){O(this,A.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,o,n,a,l,d,m,h;let E=e.target;if(((o=(r=(t=E.getAttribute(A.KEYS_USED))==null?void 0:t.split(" "))!=null?r:E==null?void 0:E.keysUsed)!=null?o:[]).map(L=>L==="Space"?" ":L).filter(Boolean).includes(e.key))return;let p,T,v;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?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new c.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"m":p=this.mediaStore.getState().mediaVolumeLevel==="off"?y.MEDIA_UNMUTE_REQUEST:y.MEDIA_MUTE_REQUEST,this.dispatchEvent(new c.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"f":p=this.mediaStore.getState().mediaIsFullscreen?y.MEDIA_EXIT_FULLSCREEN_REQUEST:y.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new c.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new c.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let L=this.hasAttribute(A.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(A.KEYBOARD_BACKWARD_SEEK_OFFSET):Qh;T=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-L,0),v=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"ArrowRight":case"l":{let L=this.hasAttribute(A.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(A.KEYBOARD_FORWARD_SEEK_OFFSET):Qh;T=Math.max(((a=this.mediaStore.getState().mediaCurrentTime)!=null?a:0)+L,0),v=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"ArrowUp":{let L=this.hasAttribute(A.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(A.KEYBOARD_UP_VOLUME_STEP):Zh;T=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+L,1),v=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"ArrowDown":{let L=this.hasAttribute(A.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(A.KEYBOARD_DOWN_VOLUME_STEP):Zh;T=Math.max(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)-L,0),v=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"<":{let L=(m=this.mediaStore.getState().mediaPlaybackRate)!=null?m:1;T=Math.max(L-Xh,gf).toFixed(2),v=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case">":{let L=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;T=Math.min(L+Xh,bf).toFixed(2),v=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"/":case"?":{e.shiftKey&&mt(this,Md,tp).call(this);break}case"p":{p=this.mediaStore.getState().mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST,v=new c.CustomEvent(p,{composed:!0,bubbles:!0}),this.dispatchEvent(v);break}default:break}}};ni=new WeakMap;Tn=new WeakMap;V=new WeakMap;ji=new WeakMap;An=new WeakMap;pt=new WeakMap;ns=new WeakMap;Sn=new WeakMap;as=new WeakSet;Cd=function(){var i;this.mediaStore=Yh({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(A.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(A.DEFAULT_DURATION)?+this.getAttribute(A.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(A.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(A.SEEK_TO_LIVE_OFFSET):this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(A.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(A.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(A.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(A.NO_SUBTITLES_LANG_PREF)}})};er=new WeakSet;Wr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||ip.includes(e))){this.removeEventListener("keyup",mt(this,er,Wr));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",mt(this,er,Wr));return}if(t||r||!a&&!ip.includes(o)){this.removeEventListener("keyup",mt(this,er,Wr));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",mt(this,er,Wr),{once:!0})};Md=new WeakSet;tp=function(){R(this,ji)||(ht(this,ji,ee.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(R(this,ji))),R(this,ji).open=!0};var _f=Object.values(s),yf=Object.values(pd),rp=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=>_f.includes(l)):[]},Tf=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),yf.some(r=>r in i)},xd=i=>Tf(i)||!!rp(i).length,Jh=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},jh={[s.MEDIA_SUBTITLES_LIST]:Bt,[s.MEDIA_SUBTITLES_SHOWING]:Bt,[s.MEDIA_SEEKABLE]:Jh,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Jh).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:mh,[s.MEDIA_AUDIO_TRACK_LIST]:fh},Af=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)},Sf=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Ji=(i,e)=>{if(Sf(i))return;let t=(o,n)=>{var a,l;xd(o)&&n(o);let{children:d=[]}=o??{},m=(l=(a=o==null?void 0:o.shadowRoot)==null?void 0:a.children)!=null?l:[];[...d,...m].forEach(E=>Ji(E,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)},ep=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let o=rp(r),n=e.toLowerCase();o.includes(n)&&Af(r,n,t)})},kf=(i,e,t)=>{Ji(i,e);let r=h=>{var E;let b=(E=h==null?void 0:h.composedPath()[0])!=null?E:h.target;e(b)},o=h=>{var E;let b=(E=h==null?void 0:h.composedPath()[0])!=null?E:h.target;t(b)};i.addEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,o);let n=h=>{h.forEach(E=>{let{addedNodes:b=[],removedNodes:p=[],type:T,target:v,attributeName:g}=E;T==="childList"?(Array.prototype.forEach.call(b,L=>Ji(L,e)),Array.prototype.forEach.call(p,L=>Ji(L,t))):T==="attributes"&&g===N.MEDIA_CHROME_ATTRIBUTES&&(xd(v)?e(v):t(v))})},a=[],l=h=>{let E=h.target;E.name!=="media"&&(a.forEach(b=>Ji(b,t)),a=[...E.assignedElements({flatten:!0})],a.forEach(b=>Ji(b,e)))};i.addEventListener("slotchange",l);let d=new MutationObserver(n);return d.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Ji(i,t),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};c.customElements.get("media-controller")||c.customElements.define("media-controller",Rd);var Fr={PLACEMENT:"placement",BOUNDS:"bounds"};function Lf(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
|
|
503
|
+
`}var Kr=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=ut(this,"#"+this.bounds))!=null?e:X(this);if(!o)return;let{x:n,width:a}=o.getBoundingClientRect(),{x:l,width:d}=this.getBoundingClientRect(),m=l+d,h=n+a,E=r.getPropertyValue("--media-tooltip-offset-x"),b=E?parseFloat(E.replace("px","")):0,p=r.getPropertyValue("--media-tooltip-container-margin"),T=p?parseFloat(p.replace("px","")):0,v=l-n+b-T,g=m-h+b+T;if(v<0){this.style.setProperty("--media-tooltip-offset-x",`${v}px`);return}if(g>0){this.style.setProperty("--media-tooltip-offset-x",`${g}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[Fr.PLACEMENT,Fr.BOUNDS]}get placement(){return D(this,Fr.PLACEMENT)}set placement(e){O(this,Fr.PLACEMENT,e)}get bounds(){return D(this,Fr.BOUNDS)}set bounds(e){O(this,Fr.BOUNDS,e)}};Kr.shadowRootOptions={mode:"open"};Kr.getTemplateHTML=Lf;c.customElements.get("media-tooltip")||c.customElements.define("media-tooltip",Kr);var ls=Kr;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)),Gr=(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),If=(i,e,t)=>(Od(i,e,"access private method"),t),vt,zr,si,qr,cs,Dd,op,ai={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Cf(i,e={}){return`
|
|
504
504
|
<style>
|
|
505
505
|
:host {
|
|
506
506
|
position: relative;
|
|
@@ -582,12 +582,12 @@ bp-player[has-error] {
|
|
|
582
582
|
</slot>
|
|
583
583
|
</media-tooltip>
|
|
584
584
|
</slot>
|
|
585
|
-
`}function
|
|
585
|
+
`}function wf(i,e){return`
|
|
586
586
|
<slot></slot>
|
|
587
|
-
`}function
|
|
587
|
+
`}function Mf(){return""}var F=class extends c.HTMLElement{constructor(){if(super(),Gr(this,Dd),Gr(this,vt,void 0),this.preventClick=!1,this.tooltipEl=null,Gr(this,zr,e=>{this.preventClick||this.handleClick(e),setTimeout(me(this,si),0)}),Gr(this,si,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),Gr(this,qr,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",me(this,qr));return}this.preventClick||this.handleClick(e)}),Gr(this,cs,e=>{let{metaKey:t,altKey:r,key:o}=e;if(t||r||!this.keysUsed.includes(o)){this.removeEventListener("keyup",me(this,qr));return}this.addEventListener("keyup",me(this,qr),{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,zr)),this.addEventListener("keydown",me(this,cs)),this.tabIndex=0}disable(){this.removeEventListener("click",me(this,zr)),this.removeEventListener("keydown",me(this,cs)),this.removeEventListener("keyup",me(this,qr)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER?(t&&((n=(o=me(this,vt))==null?void 0:o.unassociateElement)==null||n.call(o,this),ds(this,vt,null)),r&&this.isConnected&&(ds(this,vt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=me(this,vt))==null?void 0:l.associateElement)==null||d.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===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,vt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=me(this,vt))==null?void 0:t.associateElement)==null||r.call(t,this)),c.customElements.whenDefined("media-tooltip").then(()=>If(this,Dd,op).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=me(this,vt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ds(this,vt,null),this.removeEventListener("mouseenter",me(this,si)),this.removeEventListener("focus",me(this,si)),this.removeEventListener("click",me(this,zr))}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){}};vt=new WeakMap;zr=new WeakMap;si=new WeakMap;qr=new WeakMap;cs=new WeakMap;Dd=new WeakSet;op=function(){this.addEventListener("mouseenter",me(this,si)),this.addEventListener("focus",me(this,si)),this.addEventListener("click",me(this,zr));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};F.shadowRootOptions={mode:"open"};F.getTemplateHTML=Cf;F.getSlotTemplateHTML=wf;F.getTooltipContentHTML=Mf;c.customElements.get("media-chrome-button")||c.customElements.define("media-chrome-button",F);var np=`<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
|
|
590
|
+
`;function Rf(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">${
|
|
609
|
-
<slot name="exit">${
|
|
608
|
+
<slot name="enter">${np}</slot>
|
|
609
|
+
<slot name="exit">${np}</slot>
|
|
610
610
|
</slot>
|
|
611
|
-
`}function
|
|
612
|
-
<slot name="tooltip-enter">${
|
|
613
|
-
<slot name="tooltip-exit">${
|
|
614
|
-
`}var
|
|
611
|
+
`}function xf(){return`
|
|
612
|
+
<slot name="tooltip-enter">${_("start airplay")}</slot>
|
|
613
|
+
<slot name="tooltip-exit">${_("stop airplay")}</slot>
|
|
614
|
+
`}var ap=i=>{let e=i.mediaIsAirplaying?_("stop airplay"):_("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(),ap(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_AIRPLAYING&&ap(this)}get mediaIsAirplaying(){return w(this,s.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){M(this,s.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return D(this,s.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){O(this,s.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new c.CustomEvent(y.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};kn.getSlotTemplateHTML=Rf;kn.getTooltipContentHTML=xf;c.customElements.get("media-airplay-button")||c.customElements.define("media-airplay-button",kn);var Pf=`<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>`,
|
|
616
|
+
</svg>`,Df=`<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
|
|
618
|
+
</svg>`;function Of(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">${
|
|
637
|
-
<slot name="off">${
|
|
636
|
+
<slot name="on">${Pf}</slot>
|
|
637
|
+
<slot name="off">${Df}</slot>
|
|
638
638
|
</slot>
|
|
639
|
-
`}function
|
|
640
|
-
<slot name="tooltip-enable">${
|
|
641
|
-
<slot name="tooltip-disable">${
|
|
642
|
-
`}var
|
|
639
|
+
`}function Nf(){return`
|
|
640
|
+
<slot name="tooltip-enable">${_("Enable captions")}</slot>
|
|
641
|
+
<slot name="tooltip-disable">${_("Disable captions")}</slot>
|
|
642
|
+
`}var sp=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",_("closed captions")),sp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING&&sp(this)}get mediaSubtitlesList(){return lp(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){dp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return lp(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){dp(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new c.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};Ln.getSlotTemplateHTML=Of;Ln.getTooltipContentHTML=Nf;var lp=(i,e)=>{let t=i.getAttribute(e);return t?Qi(t):[]},dp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Bt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-button")||c.customElements.define("media-captions-button",Ln);var Uf='<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>',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"/><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 $f(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">${
|
|
661
|
-
<slot name="exit">${
|
|
660
|
+
<slot name="enter">${Uf}</slot>
|
|
661
|
+
<slot name="exit">${Hf}</slot>
|
|
662
662
|
</slot>
|
|
663
|
-
`}function
|
|
664
|
-
<slot name="tooltip-enter">${
|
|
665
|
-
<slot name="tooltip-exit">${
|
|
666
|
-
`}var
|
|
663
|
+
`}function Bf(){return`
|
|
664
|
+
<slot name="tooltip-enter">${_("Start casting")}</slot>
|
|
665
|
+
<slot name="tooltip-exit">${_("Stop casting")}</slot>
|
|
666
|
+
`}var cp=i=>{let e=i.mediaIsCasting?_("stop casting"):_("start casting");i.setAttribute("aria-label",e)},In=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),cp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_CASTING&&cp(this)}get mediaIsCasting(){return w(this,s.MEDIA_IS_CASTING)}set mediaIsCasting(e){M(this,s.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return D(this,s.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){O(this,s.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?y.MEDIA_EXIT_CAST_REQUEST:y.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};In.getSlotTemplateHTML=$f;In.getTooltipContentHTML=Bf;c.customElements.get("media-cast-button")||c.customElements.define("media-cast-button",In);var Wd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ir=(i,e,t)=>(Wd(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)},Fd=(i,e,t,r)=>(Wd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),tr=(i,e,t)=>(Wd(i,e,"access private method"),t),hs,wn,rr,us,Nd,Ud,up,Hd,hp,$d,pp,Bd,mp,Vd,vp;function Vf(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
|
|
707
|
+
`}function Wf(i){return`
|
|
708
708
|
<slot id="content"></slot>
|
|
709
|
-
`}var
|
|
709
|
+
`}var Cn={OPEN:"open",ANCHOR:"anchor"},ft=class extends c.HTMLElement{constructor(){super(),Vt(this,us),Vt(this,Ud),Vt(this,Hd),Vt(this,$d),Vt(this,Bd),Vt(this,Vd),Vt(this,hs,!1),Vt(this,wn,null),Vt(this,rr,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Cn.OPEN,Cn.ANCHOR]}get open(){return w(this,Cn.OPEN)}set open(e){M(this,Cn.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":tr(this,$d,pp).call(this,e);break;case"focusout":tr(this,Bd,mp).call(this,e);break;case"keydown":tr(this,Vd,vp).call(this,e);break}}connectedCallback(){tr(this,us,Nd).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){tr(this,us,Nd).call(this),e===Cn.OPEN&&r!==t&&(this.open?tr(this,Ud,up).call(this):tr(this,Hd,hp).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;rr=new WeakMap;us=new WeakSet;Nd=function(){if(!ir(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;up=function(){var i;(i=ir(this,rr))==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;hp=function(){var i;(i=ir(this,rr))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};$d=new WeakSet;pp=function(i){Fd(this,rr,i.relatedTarget),we(this,i.relatedTarget)||(this.open=!this.open)};Bd=new WeakSet;mp=function(i){var e;we(this,i.relatedTarget)||((e=ir(this,wn))==null||e.focus(),ir(this,rr)&&ir(this,rr)!==i.relatedTarget&&this.open&&(this.open=!1))};Vd=new WeakSet;vp=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:d,metaKey:m}=i;l||d||m||this.keysUsed.includes(a)&&(i.preventDefault(),i.stopPropagation(),a==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()):a==="Escape"&&((n=ir(this,wn))==null||n.focus(),this.open=!1))};ft.shadowRootOptions={mode:"open"};ft.getTemplateHTML=Vf;ft.getSlotTemplateHTML=Wf;c.customElements.get("media-chrome-dialog")||c.customElements.define("media-chrome-dialog",ft);var Zd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},se=(i,e,t)=>(Zd(i,e,"read from private field"),t?t.call(i):e.get(i)),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),ot=(i,e,t)=>(Zd(i,e,"access private method"),t),Et,Ts,ps,ms,nt,_s,vs,fs,Es,Xd,fp,gs,Kd,bs,Gd,ys,Jd,qd,Ep,zd,gp,Yd,bp,Qd,_p;function Ff(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
|
|
939
|
+
`}function Kf(i){return""}var gt=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,Et,void 0),Ae(this,Ts,void 0),Ae(this,ps,void 0),Ae(this,ms,void 0),Ae(this,nt,{}),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,Et))==null?void 0:o.unassociateElement)==null||n.call(o,this),li(this,Et,null)),r&&this.isConnected&&(li(this,Et,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=se(this,Et))==null?void 0:l.associateElement)==null||d.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),ot(this,gs,Kd).call(this)):(this.range.setAttribute(e,r),ot(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,nt).pointer=J(this.shadowRoot,"#pointer"),se(this,nt).progress=J(this.shadowRoot,"#progress"),se(this,nt).thumb=J(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),se(this,nt).activeSegment=J(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(li(this,Et,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=se(this,Et))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",se(this,vs)),this.shadowRoot.addEventListener("focusout",se(this,fs)),ot(this,gs,Kd).call(this),Ut(this.container,se(this,Es))}disconnectedCallback(){var e,t;ot(this,bs,Gd).call(this),(t=(e=se(this,Et))==null?void 0:e.unassociateElement)==null||t.call(e,this),li(this,Et,null),this.shadowRoot.removeEventListener("focusin",se(this,vs)),this.shadowRoot.removeEventListener("focusout",se(this,fs)),Ht(this.container,se(this,Es))}updatePointerBar(e){var t;(t=se(this,nt).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=se(this,nt).progress)==null||e.style.setProperty("width",`${r}%`),(t=se(this,nt).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],m=l?"calc(var(--segments-gap) / -1)":`${a*100}%`,E=`calc(${((d?o:r[n+1])-a)*100}%${l||d?"":" - var(--segments-gap)"})`,b=ee.createElementNS("http://www.w3.org/2000/svg","rect"),p=vn(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);p.style.setProperty("x",m),p.style.setProperty("width",E),t.append(b)}}getPointerRatio(e){return Ih(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":ot(this,Qd,_p).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":ot(this,qd,Ep).call(this,e);break;case"pointerdown":ot(this,ys,Jd).call(this,e);break;case"pointerup":ot(this,zd,gp).call(this);break;case"pointerleave":ot(this,Yd,bp).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};Et=new WeakMap;Ts=new WeakMap;ps=new WeakMap;ms=new WeakMap;nt=new WeakMap;_s=new WeakMap;vs=new WeakMap;fs=new WeakMap;Es=new WeakMap;Xd=new WeakSet;fp=function(i){let e=se(this,nt).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;Ep=function(i){var e;i.pointerType!=="mouse"&&ot(this,ys,Jd).call(this,i),this.addEventListener("pointerleave",this),(e=c.window)==null||e.addEventListener("pointermove",this)};zd=new WeakSet;gp=function(){var i;(i=c.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};Yd=new WeakSet;bp=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,nt).activeSegment)==null||e.style.removeProperty("transform")};Qd=new WeakSet;_p=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),ot(this,Xd,fp).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}))))};gt.shadowRootOptions={mode:"open"};gt.getTemplateHTML=Ff;gt.getContainerTemplateHTML=Kf;c.customElements.get("media-chrome-range")||c.customElements.define("media-chrome-range",gt);var yp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},As=(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)},Ss=(i,e,t,r)=>(yp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),bt;function qf(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 Mn=class extends c.HTMLElement{constructor(){if(super(),
|
|
965
|
+
`}var Mn=class extends c.HTMLElement{constructor(){if(super(),Gf(this,bt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=As(this,bt))==null?void 0:o.unassociateElement)==null||n.call(o,this),Ss(this,bt,null)),r&&this.isConnected&&(Ss(this,bt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=As(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&&(Ss(this,bt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=As(this,bt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=As(this,bt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ss(this,bt,null)}};bt=new WeakMap;Mn.shadowRootOptions={mode:"open"};Mn.getTemplateHTML=qf;c.customElements.get("media-control-bar")||c.customElements.define("media-control-bar",Mn);var Tp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ks=(i,e,t)=>(Tp(i,e,"read from private field"),t?t.call(i):e.get(i)),zf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ls=(i,e,t,r)=>(Tp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),_t;function Yf(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
|
|
999
|
+
`}function Qf(i,e){return`
|
|
1000
1000
|
<slot></slot>
|
|
1001
|
-
`}var Ue=class extends c.HTMLElement{constructor(){if(super(),
|
|
1002
|
-
<slot>${
|
|
1003
|
-
`}var
|
|
1001
|
+
`}var Ue=class extends c.HTMLElement{constructor(){if(super(),zf(this,_t,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,d;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=ks(this,_t))==null?void 0:o.unassociateElement)==null||n.call(o,this),Ls(this,_t,null)),r&&this.isConnected&&(Ls(this,_t,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=ks(this,_t))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(Ls(this,_t,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=ks(this,_t))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ks(this,_t))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ls(this,_t,null)}};_t=new WeakMap;Ue.shadowRootOptions={mode:"open"};Ue.getTemplateHTML=Yf;Ue.getSlotTemplateHTML=Qf;c.customElements.get("media-text-display")||c.customElements.define("media-text-display",Ue);var Sp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ap=(i,e,t)=>(Sp(i,e,"read from private field"),t?t.call(i):e.get(i)),Zf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Xf=(i,e,t,r)=>(Sp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Rn;function Jf(i,e){return`
|
|
1002
|
+
<slot>${rt(e.mediaDuration)}</slot>
|
|
1003
|
+
`}var Is=class extends Ue{constructor(){var e;super(),Zf(this,Rn,void 0),Xf(this,Rn,this.shadowRoot.querySelector("slot")),Ap(this,Rn).textContent=rt((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===s.MEDIA_DURATION&&(Ap(this,Rn).textContent=rt(+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;Is.getSlotTemplateHTML=Jf;c.customElements.get("media-duration-display")||c.customElements.define("media-duration-display",Is);var jf={2:_("Network Error"),3:_("Decode Error"),4:_("Source Not Supported"),5:_("Encryption Error")},eE={2:_("A network error caused the media download to fail."),3:_("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:_("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:_("The media is encrypted and there are no keys to decrypt it.")},jd=i=>{var e,t;return i.code===1?null:{title:(e=jf[i.code])!=null?e:`Error ${i.code}`,message:(t=eE[i.code])!=null?t:i.message}};var Lp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tE=(i,e,t)=>(Lp(i,e,"read from private field"),t?t.call(i):e.get(i)),iE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},rE=(i,e,t,r)=>(Lp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Cs;function oE(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
|
-
${
|
|
1020
|
+
${Ip({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
|
|
1021
1021
|
</slot>
|
|
1022
|
-
`}function
|
|
1022
|
+
`}function nE(i){return i.code&&jd(i)!==null}function Ip(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 kp=[s.MEDIA_ERROR_CODE,s.MEDIA_ERROR_MESSAGE],xn=class extends ft{constructor(){super(...arguments),iE(this,Cs,null)}static get observedAttributes(){return[...super.observedAttributes,...kp]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var o;if(super.attributeChangedCallback(e,t,r),!kp.includes(e))return;let n=(o=this.mediaError)!=null?o:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=nE(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return tE(this,Cs)}set mediaError(e){rE(this,Cs,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)}};Cs=new WeakMap;xn.getSlotTemplateHTML=oE;xn.formatErrorMessage=Ip;c.customElements.get("media-error-dialog")||c.customElements.define("media-error-dialog",xn);var aE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},di=(i,e,t)=>(aE(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)},Yr,Qr;function sE(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
|
-
${
|
|
1107
|
+
${lE()}
|
|
1108
1108
|
</slot>
|
|
1109
|
-
`}function
|
|
1109
|
+
`}function lE(){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 ws=class extends
|
|
1119
|
+
`}var ws=class extends ft{constructor(){super(...arguments),Cp(this,Yr,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,Qr,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,Yr)),document.addEventListener("keydown",di(this,Qr)))}disconnectedCallback(){this.removeEventListener("click",di(this,Yr)),document.removeEventListener("keydown",di(this,Qr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",di(this,Yr)),document.addEventListener("keydown",di(this,Qr))):(this.removeEventListener("click",di(this,Yr)),document.removeEventListener("keydown",di(this,Qr))))}};Yr=new WeakMap;Qr=new WeakMap;ws.getSlotTemplateHTML=sE;c.customElements.get("media-keyboard-shortcuts-dialog")||c.customElements.define("media-keyboard-shortcuts-dialog",ws);var Mp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},dE=(i,e,t)=>(Mp(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)},uE=(i,e,t,r)=>(Mp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ms,hE=`<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>`,
|
|
1121
|
+
</svg>`,pE=`<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
|
|
1123
|
+
</svg>`;function mE(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">${
|
|
1142
|
-
<slot name="exit">${
|
|
1141
|
+
<slot name="enter">${hE}</slot>
|
|
1142
|
+
<slot name="exit">${pE}</slot>
|
|
1143
1143
|
</slot>
|
|
1144
|
-
`}function
|
|
1145
|
-
<slot name="tooltip-enter">${
|
|
1146
|
-
<slot name="tooltip-exit">${
|
|
1147
|
-
`}var
|
|
1144
|
+
`}function vE(){return`
|
|
1145
|
+
<slot name="tooltip-enter">${_("Enter fullscreen mode")}</slot>
|
|
1146
|
+
<slot name="tooltip-exit">${_("Exit fullscreen mode")}</slot>
|
|
1147
|
+
`}var wp=i=>{let e=i.mediaIsFullscreen?_("exit fullscreen mode"):_("enter fullscreen mode");i.setAttribute("aria-label",e)},Pn=class extends F{constructor(){super(...arguments),cE(this,Ms,null)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_FULLSCREEN,s.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),wp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_FULLSCREEN&&wp(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){uE(this,Ms,e);let t=dE(this,Ms)instanceof PointerEvent,r=this.mediaIsFullscreen?new c.CustomEvent(y.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new c.CustomEvent(y.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};Ms=new WeakMap;Pn.getSlotTemplateHTML=mE;Pn.getTooltipContentHTML=vE;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:fE,MEDIA_PLAY_REQUEST:EE}=y,gE='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function bE(i){return`
|
|
1148
1148
|
<style>
|
|
1149
1149
|
:host { --media-tooltip-display: none; }
|
|
1150
1150
|
|
|
@@ -1172,10 +1172,10 @@ bp-player[has-error] {
|
|
|
1172
1172
|
|
|
1173
1173
|
</style>
|
|
1174
1174
|
|
|
1175
|
-
<slot name="indicator">${
|
|
1175
|
+
<slot name="indicator">${gE}</slot>
|
|
1176
1176
|
|
|
1177
|
-
<slot name="spacer"> </slot><slot name="text">${
|
|
1178
|
-
`}var
|
|
1177
|
+
<slot name="spacer"> </slot><slot name="text">${_("live")}</slot>
|
|
1178
|
+
`}var Rp=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?_("seek to live"):_("playing live");i.setAttribute("aria-label",r);let o=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');o&&(o.textContent=_("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},xs=class extends F{static get observedAttributes(){return[...super.observedAttributes,Rs,Dn]}connectedCallback(){super.connectedCallback(),Rp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),Rp(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(fE,{composed:!0,bubbles:!0})),this.hasAttribute(Dn)&&this.dispatchEvent(new c.CustomEvent(EE,{composed:!0,bubbles:!0})))}};xs.getSlotTemplateHTML=bE;c.customElements.get("media-live-button")||c.customElements.define("media-live-button",xs);var Pp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},On=(i,e,t)=>(Pp(i,e,"read from private field"),t?t.call(i):e.get(i)),xp=(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)=>(Pp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),yt,Ds,Ps={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},Dp=500,_E=`
|
|
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
|
|
1191
|
+
`;function yE(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, ${
|
|
1197
|
+
--_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${Dp}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">${
|
|
1237
|
-
<div id="status" role="status" aria-live="polite">${
|
|
1238
|
-
`}var Un=class extends c.HTMLElement{constructor(){if(super(),
|
|
1236
|
+
<slot name="icon">${_E}</slot>
|
|
1237
|
+
<div id="status" role="status" aria-live="polite">${_("media loading")}</div>
|
|
1238
|
+
`}var Un=class extends c.HTMLElement{constructor(){if(super(),xp(this,yt,void 0),xp(this,Ds,Dp),!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,yt))==null?void 0:o.unassociateElement)==null||n.call(o,this),Nn(this,yt,null)),r&&this.isConnected&&(Nn(this,yt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=On(this,yt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(Nn(this,yt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=On(this,yt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=On(this,yt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Nn(this,yt,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)}};yt=new WeakMap;Ds=new WeakMap;Un.shadowRootOptions={mode:"open"};Un.getTemplateHTML=yE;c.customElements.get("media-loading-indicator")||c.customElements.define("media-loading-indicator",Un);var TE=`<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>`,
|
|
1240
|
+
</svg>`,Op=`<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>`,
|
|
1242
|
+
</svg>`,AE=`<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
|
|
1244
|
+
</svg>`;function SE(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">${
|
|
1271
|
-
<slot name="low">${
|
|
1272
|
-
<slot name="medium">${
|
|
1273
|
-
<slot name="high">${
|
|
1270
|
+
<slot name="off">${TE}</slot>
|
|
1271
|
+
<slot name="low">${Op}</slot>
|
|
1272
|
+
<slot name="medium">${Op}</slot>
|
|
1273
|
+
<slot name="high">${AE}</slot>
|
|
1274
1274
|
</slot>
|
|
1275
|
-
`}function
|
|
1276
|
-
<slot name="tooltip-mute">${
|
|
1277
|
-
<slot name="tooltip-unmute">${
|
|
1278
|
-
`}var
|
|
1275
|
+
`}function kE(){return`
|
|
1276
|
+
<slot name="tooltip-mute">${_("Mute")}</slot>
|
|
1277
|
+
<slot name="tooltip-unmute">${_("Unmute")}</slot>
|
|
1278
|
+
`}var Np=i=>{let t=i.mediaVolumeLevel==="off"?_("unmute"):_("mute");i.setAttribute("aria-label",t)},Hn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),Np(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_VOLUME_LEVEL&&Np(this)}get mediaVolumeLevel(){return D(this,s.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){O(this,s.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?y.MEDIA_UNMUTE_REQUEST:y.MEDIA_MUTE_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Hn.getSlotTemplateHTML=SE;Hn.getTooltipContentHTML=kE;c.customElements.get("media-mute-button")||c.customElements.define("media-mute-button",Hn);var Up=`<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
|
|
1280
|
+
</svg>`;function LE(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">${
|
|
1298
|
-
<slot name="exit">${
|
|
1297
|
+
<slot name="enter">${Up}</slot>
|
|
1298
|
+
<slot name="exit">${Up}</slot>
|
|
1299
1299
|
</slot>
|
|
1300
|
-
`}function
|
|
1301
|
-
<slot name="tooltip-enter">${
|
|
1302
|
-
<slot name="tooltip-exit">${
|
|
1303
|
-
`}var
|
|
1300
|
+
`}function IE(){return`
|
|
1301
|
+
<slot name="tooltip-enter">${_("Enter picture in picture mode")}</slot>
|
|
1302
|
+
<slot name="tooltip-exit">${_("Exit picture in picture mode")}</slot>
|
|
1303
|
+
`}var Hp=i=>{let e=i.mediaIsPip?_("exit picture in picture mode"):_("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(),Hp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_PIP&&Hp(this)}get mediaPipUnavailable(){return D(this,s.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){O(this,s.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return w(this,s.MEDIA_IS_PIP)}set mediaIsPip(e){M(this,s.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};$n.getSlotTemplateHTML=LE;$n.getTooltipContentHTML=IE;c.customElements.get("media-pip-button")||c.customElements.define("media-pip-button",$n);var CE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Zr=(i,e,t)=>(CE(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)},ci,ec={RATES:"rates"},tc=[1,1.2,1.5,1.7,2],or=1;function ME(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||
|
|
1311
|
-
`}function
|
|
1310
|
+
<slot name="icon">${i.mediaplaybackrate||or}x</slot>
|
|
1311
|
+
`}function RE(){return _("Playback rate")}var Bn=class extends F{constructor(){var e;super(),wE(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:or}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&&(Zr(this,ci).value=r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?or:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",_("Playback rate {playbackRate}",{playbackRate:n}))}}get rates(){return Zr(this,ci)}set rates(e){e?Array.isArray(e)?Zr(this,ci).value=e.join(" "):typeof e=="string"&&(Zr(this,ci).value=e):Zr(this,ci).value=""}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,or)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(Zr(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:or,n=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:o});this.dispatchEvent(n)}};ci=new WeakMap;Bn.getSlotTemplateHTML=ME;Bn.getTooltipContentHTML=RE;c.customElements.get("media-playback-rate-button")||c.customElements.define("media-playback-rate-button",Bn);var xE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1312
1312
|
<path d="m6 21 15-9L6 3v18Z"/>
|
|
1313
|
-
</svg>`,
|
|
1313
|
+
</svg>`,PE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1314
1314
|
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
1315
|
-
</svg>`;function
|
|
1315
|
+
</svg>`;function DE(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">${
|
|
1330
|
-
<slot name="pause">${
|
|
1329
|
+
<slot name="play">${xE}</slot>
|
|
1330
|
+
<slot name="pause">${PE}</slot>
|
|
1331
1331
|
</slot>
|
|
1332
|
-
`}function
|
|
1333
|
-
<slot name="tooltip-play">${
|
|
1334
|
-
<slot name="tooltip-pause">${
|
|
1335
|
-
`}var
|
|
1332
|
+
`}function OE(){return`
|
|
1333
|
+
<slot name="tooltip-play">${_("Play")}</slot>
|
|
1334
|
+
<slot name="tooltip-pause">${_("Pause")}</slot>
|
|
1335
|
+
`}var $p=i=>{let e=i.mediaPaused?_("play"):_("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(),$p(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PAUSED||e===s.MEDIA_LANG)&&$p(this)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){M(this,s.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Vn.getSlotTemplateHTML=DE;Vn.getTooltipContentHTML=OE;c.customElements.get("media-play-button")||c.customElements.define("media-play-button",Vn);var Tt={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function NE(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
|
|
1357
|
+
`}var UE=i=>{i.style.removeProperty("background-image")},HE=(i,e)=>{i.style["background-image"]=`url('${e}')`},Wn=class extends c.HTMLElement{static get observedAttributes(){return[Tt.PLACEHOLDER_SRC,Tt.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===Tt.SRC&&(r==null?this.image.removeAttribute(Tt.SRC):this.image.setAttribute(Tt.SRC,r)),e===Tt.PLACEHOLDER_SRC&&(r==null?UE(this.image):HE(this.image,r))}get placeholderSrc(){return D(this,Tt.PLACEHOLDER_SRC)}set placeholderSrc(e){O(this,Tt.SRC,e)}get src(){return D(this,Tt.SRC)}set src(e){O(this,Tt.SRC,e)}};Wn.shadowRootOptions={mode:"open"};Wn.getTemplateHTML=NE;c.customElements.get("media-poster-image")||c.customElements.define("media-poster-image",Wn);var Bp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},$E=(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)},VE=(i,e,t,r)=>(Bp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Os,ic=class extends Ue{constructor(){super(),BE(this,Os,void 0),VE(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($E(this,Os).textContent=r,r!==""){let o=_("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",o)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return D(this,s.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){O(this,s.MEDIA_PREVIEW_CHAPTER,e)}};Os=new WeakMap;c.customElements.get("media-preview-chapter-display")||c.customElements.define("media-preview-chapter-display",ic);var Vp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ns=(i,e,t)=>(Vp(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)},Us=(i,e,t,r)=>(Vp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),At;function FE(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
|
|
1371
|
+
`}var Xr=class extends c.HTMLElement{constructor(){if(super(),WE(this,At,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(Us(this,At,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=Ns(this,At))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ns(this,At))==null?void 0:e.unassociateElement)==null||t.call(e,this),Us(this,At,null)}attributeChangedCallback(e,t,r){var o,n,a,l,d;[s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Ns(this,At))==null?void 0:o.unassociateElement)==null||n.call(o,this),Us(this,At,null)),r&&this.isConnected&&(Us(this,At,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(d=(l=Ns(this,At))==null?void 0:l.associateElement)==null||d.call(l,this)))}get mediaPreviewImage(){return D(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){O(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(s.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(s.MEDIA_PREVIEW_COORDS);return}this.setAttribute(s.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[r,o,n,a]=e,l=t.split("#")[0],d=getComputedStyle(this),{maxWidth:m,maxHeight:h,minWidth:E,minHeight:b}=d,p=Math.min(parseInt(m)/n,parseInt(h)/a),T=Math.max(parseInt(E)/n,parseInt(b)/a),v=p<1,g=v?p:T>1?T:1,{style:L}=J(this.shadowRoot,":host"),ie=J(this.shadowRoot,"img").style,ke=this.shadowRoot.querySelector("img"),Le=v?"min":"max";L.setProperty(`${Le}-width`,"initial","important"),L.setProperty(`${Le}-height`,"initial","important"),L.width=`${n*g}px`,L.height=`${a*g}px`;let Ar=()=>{ie.width=`${this.imgWidth*g}px`,ie.height=`${this.imgHeight*g}px`,ie.display="block"};ke.src!==l&&(ke.onload=()=>{this.imgWidth=ke.naturalWidth,this.imgHeight=ke.naturalHeight,Ar()},ke.src=l,Ar()),Ar(),ie.transform=`translate(-${r*g}px, -${o*g}px)`}};At=new WeakMap;Xr.shadowRootOptions={mode:"open"};Xr.getTemplateHTML=FE;c.customElements.get("media-preview-thumbnail")||c.customElements.define("media-preview-thumbnail",Xr);var Hs=Xr;var Fp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Wp=(i,e,t)=>(Fp(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)},GE=(i,e,t,r)=>(Fp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Fn,rc=class extends Ue{constructor(){super(),KE(this,Fn,void 0),GE(this,Fn,this.shadowRoot.querySelector("slot")),Wp(this,Fn).textContent=rt(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&&(Wp(this,Fn).textContent=rt(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 Jr={SEEK_OFFSET:"seekoffset"},oc=30,qE=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
|
|
1379
|
-
<slot name="icon">${
|
|
1380
|
-
`}function
|
|
1378
|
+
</svg>`;function zE(i,e){return`
|
|
1379
|
+
<slot name="icon">${qE(e.seekOffset)}</slot>
|
|
1380
|
+
`}function YE(){return _("Seek backward")}var QE=0,Kn=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,oc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Jr.SEEK_OFFSET&&(this.seekOffset=H(this,Jr.SEEK_OFFSET,oc))}get seekOffset(){return H(this,Jr.SEEK_OFFSET,oc)}set seekOffset(e){B(this,Jr.SEEK_OFFSET,e),this.setAttribute("aria-label",_("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Va(Wa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME,QE)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Kn.getSlotTemplateHTML=zE;Kn.getTooltipContentHTML=YE;c.customElements.get("media-seek-backward-button")||c.customElements.define("media-seek-backward-button",Kn);var jr={SEEK_OFFSET:"seekoffset"},nc=30,ZE=i=>`
|
|
1381
1381
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1382
1382
|
<defs>
|
|
1383
1383
|
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
1384
1384
|
</defs>
|
|
1385
1385
|
<text class="text value" transform="translate(8.9 19.87)">${i}</text>
|
|
1386
1386
|
<path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/>
|
|
1387
|
-
</svg>`;function
|
|
1388
|
-
<slot name="icon">${
|
|
1389
|
-
`}function
|
|
1387
|
+
</svg>`;function XE(i,e){return`
|
|
1388
|
+
<slot name="icon">${ZE(e.seekOffset)}</slot>
|
|
1389
|
+
`}function JE(){return _("Seek forward")}var jE=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",_("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Va(Wa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME,jE)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Gn.getSlotTemplateHTML=XE;Gn.getTooltipContentHTML=JE;c.customElements.get("media-seek-forward-button")||c.customElements.define("media-seek-forward-button",Gn);var qp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ac=(i,e,t)=>(qp(i,e,"read from private field"),t?t.call(i):e.get(i)),eg=(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)},tg=(i,e,t,r)=>(qp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),eo,nr={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Kp=[...Object.values(nr),s.MEDIA_CURRENT_TIME,s.MEDIA_DURATION,s.MEDIA_SEEKABLE],Gp=["Enter"," "],ig=" / ",sc=(i,{timesSep:e=ig}={})=>{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?rt(0-(a-o)):rt(o);return i.showDuration?`${l}${e}${rt(a)}`:l},rg="video not loaded, unknown time.",og=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",rg);return}let n=i.remaining?Ki(0-(o-t)):Ki(t);if(!i.showDuration){i.setAttribute("aria-valuetext",n);return}let a=Ki(o),l=`${n} of ${a}`;i.setAttribute("aria-valuetext",l)};function ng(i,e){return`
|
|
1390
1390
|
<slot>${sc(e)}</slot>
|
|
1391
|
-
`}var $s=class extends Ue{constructor(){super(),
|
|
1391
|
+
`}var $s=class extends Ue{constructor(){super(),eg(this,eo,void 0),tg(this,eo,this.shadowRoot.querySelector("slot")),ac(this,eo).innerHTML=`${sc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Kp,"disabled"]}connectedCallback(){let{style:e}=J(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",_("playback time"));let t=r=>{let{key:o}=r;if(!Gp.includes(o)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:o,altKey:n,key:a}=r;if(o||n||!Gp.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){Kp.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,nr.REMAINING)}set remaining(e){M(this,nr.REMAINING,e)}get showDuration(){return w(this,nr.SHOW_DURATION)}set showDuration(e){M(this,nr.SHOW_DURATION,e)}get noToggle(){return w(this,nr.NO_TOGGLE)}set noToggle(e){M(this,nr.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);og(this),e!==ac(this,eo).innerHTML&&(ac(this,eo).innerHTML=e)}};eo=new WeakMap;$s.getSlotTemplateHTML=ng;c.customElements.get("media-time-display")||c.customElements.define("media-time-display",$s);var zp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Te=(i,e,t)=>(zp(i,e,"read from private field"),t?t.call(i):e.get(i)),St=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Fe=(i,e,t,r)=>(zp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ag=(i,e,t,r)=>({set _(o){Fe(i,e,o,t)},get _(){return Te(i,e,r)}}),to,Bs,io,qn,Vs,Ws,Fs,ro,ar,Ks,Gs=class{constructor(e,t,r){St(this,to,void 0),St(this,Bs,void 0),St(this,io,void 0),St(this,qn,void 0),St(this,Vs,void 0),St(this,Ws,void 0),St(this,Fs,void 0),St(this,ro,void 0),St(this,ar,0),St(this,Ks,(o=performance.now())=>{Fe(this,ar,requestAnimationFrame(Te(this,Ks))),Fe(this,qn,performance.now()-Te(this,io));let n=1e3/this.fps;if(Te(this,qn)>n){Fe(this,io,o-Te(this,qn)%n);let a=1e3/((o-Te(this,Bs))/++ag(this,Vs)._),l=(o-Te(this,Ws))/1e3/this.duration,d=Te(this,Fs)+l*this.playbackRate;d-Te(this,to).valueAsNumber>0?Fe(this,ro,this.playbackRate/this.duration/a):(Fe(this,ro,.995*Te(this,ro)),d=Te(this,to).valueAsNumber+Te(this,ro)),this.callback(d)}}),Fe(this,to,e),this.callback=t,this.fps=r}start(){Te(this,ar)===0&&(Fe(this,io,performance.now()),Fe(this,Bs,Te(this,io)),Fe(this,Vs,0),Te(this,Ks).call(this))}stop(){Te(this,ar)!==0&&(cancelAnimationFrame(Te(this,ar)),Fe(this,ar,0))}update({start:e,duration:t,playbackRate:r}){let o=e-Te(this,to).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}};to=new WeakMap;Bs=new WeakMap;io=new WeakMap;qn=new WeakMap;Vs=new WeakMap;Ws=new WeakMap;Fs=new WeakMap;ro=new WeakMap;ar=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)},Qe=(i,e,t,r)=>(uc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ie=(i,e,t)=>(uc(i,e,"access private method"),t),oo,sr,Ys,Yn,Qs,zs,Qn,Zn,no,ao,so,zn,hc,Yp,lc,Zs,pc,Xs,mc,Js,vc,dc,Qp,Xn,js,cc,Zp,sg="video not loaded, unknown time.",lg=i=>{let e=i.range,t=Ki(+Xp(i)),r=Ki(+i.mediaSeekableEnd),o=t&&r?`${t} of ${r}`:sg;e.setAttribute("aria-valuetext",o)};function dg(i){return`
|
|
1392
1392
|
<style>
|
|
1393
1393
|
:host {
|
|
1394
1394
|
--media-box-border-radius: 4px;
|
|
@@ -1605,7 +1605,7 @@ bp-player[has-error] {
|
|
|
1605
1605
|
|
|
1606
1606
|
</slot>
|
|
1607
1607
|
</div>
|
|
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))},
|
|
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))},Xp=(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 gt{constructor(){super(),ge(this,so),ge(this,hc),ge(this,Zs),ge(this,Xs),ge(this,Js),ge(this,dc),ge(this,Xn),ge(this,cc),ge(this,oo,void 0),ge(this,sr,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,no,void 0),ge(this,ao,void 0),ge(this,lc,r=>{this.dragging||(Pr(r)&&(this.range.valueAsNumber=r),ce(this,ao)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Qe(this,Ys,this.shadowRoot.querySelectorAll('[part~="box"]')),Qe(this,Qs,this.shadowRoot.querySelector('[part~="preview-box"]')),Qe(this,zs,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Qe(this,Qn,parseInt(t.getPropertyValue("--media-box-padding-left"))),Qe(this,Zn,parseInt(t.getPropertyValue("--media-box-padding-right"))),Qe(this,sr,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",_("seek")),Ie(this,so,zn).call(this),Qe(this,oo,this.getRootNode()),(e=ce(this,oo))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),Ie(this,so,zn).call(this),(e=ce(this,oo))==null||e.removeEventListener("transitionstart",this),Qe(this,oo,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,sr).update({start:qs(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),Ie(this,so,zn).call(this),lg(this)):e===s.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=ce(this,no),this.updateBar()))}get mediaChaptersCues(){return ce(this,no)}set mediaChaptersCues(e){var t;Qe(this,no,e),this.updateSegments((t=ce(this,no))==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=Ie(this,Zs,pc).call(this,ce(this,zs)),n=Ie(this,Xs,mc).call(this,o,this.range.valueAsNumber),a=Ie(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":Ie(this,cc,Zp).call(this);break;case"pointermove":Ie(this,dc,Qp).call(this,e);break;case"pointerup":ce(this,ao)&&Qe(this,ao,!1);break;case"pointerdown":Qe(this,ao,!0);break;case"pointerleave":Ie(this,Xn,js).call(this,null);break;case"transitionstart":we(e.target,this)&&setTimeout(()=>Ie(this,so,zn).call(this),0);break}}};oo=new WeakMap;sr=new WeakMap;Ys=new WeakMap;Yn=new WeakMap;Qs=new WeakMap;zs=new WeakMap;Qn=new WeakMap;Zn=new WeakMap;no=new WeakMap;ao=new WeakMap;so=new WeakSet;zn=function(){Ie(this,hc,Yp).call(this)?ce(this,sr).start():ce(this,sr).stop()};hc=new WeakSet;Yp=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")?ut(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),o=this.range.getBoundingClientRect(),n=i.offsetWidth,a=-(o.left-r.left-n/2),l=r.right-o.left-n/2;return{box:{width:n,min:a,max:l},bounds:r,range:o}};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;Qp=function(i){let e=[...ce(this,Ys)].some(h=>i.composedPath().includes(h));if(!this.dragging&&(e||!i.composedPath().includes(this))){Ie(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=Ie(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=Ie(this,Xs,mc).call(this,n,a),d=Ie(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 m=Math.round(ce(this,Yn))-Math.round(a*t);Math.abs(m)<1&&a>.01&&a<.99||(Qe(this,Yn,a*t),Ie(this,Xn,js).call(this,ce(this,Yn)))};Xn=new WeakSet;js=function(i){this.dispatchEvent(new c.CustomEvent(y.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};cc=new WeakSet;Zp=function(){ce(this,sr).stop();let i=Xp(this);this.dispatchEvent(new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Jn.shadowRootOptions={mode:"open"};Jn.getContainerTemplateHTML=dg;c.customElements.get("media-time-range")||c.customElements.define("media-time-range",Jn);var cg=1,ug=i=>i.mediaMuted?0:i.mediaVolume,hg=i=>`${Math.round(i*100)}%`,fc=class extends gt{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME,s.MEDIA_MUTED,s.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",_("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_VOLUME||e===s.MEDIA_MUTED)&&(this.range.valueAsNumber=ug(this),this.range.setAttribute("aria-valuetext",hg(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return H(this,s.MEDIA_VOLUME,cg)}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 pg(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
|
|
1637
|
+
`}function mg(){return _("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=_("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return w(this,s.MEDIA_LOOP)}set mediaLoop(e){M(this,s.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new c.CustomEvent(y.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};jn.getSlotTemplateHTML=pg;jn.getTooltipContentHTML=mg;c.customElements.get("media-loop-button")||c.customElements.define("media-loop-button",jn);function Jp({anchor:i,floating:e,placement:t}){let r=vg({anchor:i,floating:e}),{x:o,y:n}=Eg(r,t);return{x:o,y:n}}function vg({anchor:i,floating:e}){return{anchor:fg(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function fg(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 Eg({anchor:i,floating:e},t){let r=gg(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,m;switch(n){case"top":m={x:a,y:i.y-e.height};break;case"bottom":m={x:a,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:l};break;case"left":m={x:i.x-e.width,y:l};break;default:m={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":m[r]-=d;break;case"end":m[r]+=d;break}return m}function jp(i){return i.split("-")[0]}function gg(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 Cc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},G=(i,e,t)=>(Cc(i,e,"read from private field"),t?t.call(i):e.get(i)),Q=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},kt=(i,e,t,r)=>(Cc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Z=(i,e,t)=>(Cc(i,e,"access private method"),t),Lt,dr,hi,tl,il,cr,ia,Ec,em,nl,wc,al,rl,gc,bc,tm,_c,im,yc,rm,lo,co,uo,ra,sl,Mc,Tc,om,Rc,nm,Ac,am,xc,sm,Sc,lm,kc,dm,ea,ll,Lc,cm,ta,dl,ol,Ic;function It({type:i,text:e,value:t,checked:r}){let o=ee.createElement("media-chrome-menu-item");o.type=i??"",o.part.add("menu-item"),i&&o.part.add(i),o.value=t,o.checked=r;let n=ee.createElement("span");return n.textContent=e,o.append(n),o}function at(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 bg(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 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`
|
|
1812
|
+
`}var lr={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,uo),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,Lt,null),Q(this,dr,null),Q(this,hi,null),Q(this,tl,new Set),Q(this,il,void 0),Q(this,cr,!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}));kt(this,tl,t)}),Q(this,lo,()=>{Z(this,uo,ra).call(this),Z(this,sl,Mc).call(this,!1)}),Q(this,co,()=>{Z(this,uo,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),kt(this,il,new MutationObserver(G(this,al))),G(this,il).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[lr.DISABLED,lr.HIDDEN,lr.STYLE,lr.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,em).call(this,e);break;case"invoke":Z(this,bc,tm).call(this,e);break;case"click":Z(this,Tc,om).call(this,e);break;case"toggle":Z(this,Ac,am).call(this,e);break;case"focusout":Z(this,Sc,lm).call(this,e);break;case"keydown":Z(this,kc,dm).call(this,e);break}}connectedCallback(){var e,t;kt(this,ia,vn(this.shadowRoot,":host")),Z(this,rl,gc).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),kt(this,Lt,Ba(this)),(t=(e=G(this,Lt))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Ut(oa(this),G(this,lo)),Ut(this,G(this,co))),Z(this,nl,wc).call(this)}disconnectedCallback(){var e,t;Ht(oa(this),G(this,lo)),Ht(this,G(this,co)),this.disable(),(t=(e=G(this,Lt))==null?void 0:e.unassociateElement)==null||t.call(e,this),kt(this,Lt,null)}attributeChangedCallback(e,t,r){var o,n,a,l;e===lr.HIDDEN&&r!==t?(G(this,cr)||kt(this,cr,!0),this.hidden?Z(this,yc,rm).call(this):Z(this,_c,im).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,Lt))==null?void 0:o.unassociateElement)==null||n.call(o,this),kt(this,Lt,null)),r&&this.isConnected&&(kt(this,Lt,Ba(this)),(l=(a=G(this,Lt))==null?void 0:a.associateElement)==null||l.call(a,this))):e===lr.DISABLED&&r!==t?r==null?this.enable():this.disable():e===lr.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=Gi(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(_g)}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,Ic).call(this,t)}focus(){if(kt(this,dr,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,Ic).call(this,r,r.type==="checkbox"),G(this,hi)&&!this.hidden&&((t=G(this,dr))==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,cm).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()}};Lt=new WeakMap;dr=new WeakMap;hi=new WeakMap;tl=new WeakMap;il=new WeakMap;cr=new WeakMap;ia=new WeakMap;Ec=new WeakSet;em=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;tm=function(i){kt(this,hi,i.relatedTarget),we(this,i.relatedTarget)||(this.hidden=!this.hidden)};_c=new WeakSet;im=function(){var i;(i=G(this,hi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Ut(oa(this),G(this,lo)),Ut(this,G(this,co))};yc=new WeakSet;rm=function(){var i;(i=G(this,hi))==null||i.setAttribute("aria-expanded","false"),Ht(oa(this),G(this,lo)),Ht(this,G(this,co))};lo=new WeakMap;co=new WeakMap;uo=new WeakSet;ra=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=Jp({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),E=o.height-h-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${E}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,uo,ra).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),Z(this,uo,ra).call(this);r.removeProperty("--media-menu-transition-in")};Tc=new WeakSet;om=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(G(this,Rc,nm))){(e=G(this,dr))==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;nm=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;am=function(i){if(i.target===this)return;Z(this,xc,sm).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;sm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Sc=new WeakSet;lm=function(i){var e;we(this,i.relatedTarget)||(G(this,cr)&&((e=G(this,dr))==null||e.focus()),G(this,hi)&&G(this,hi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};kc=new WeakSet;dm=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:d,metaKey:m}=i;if(!(l||d||m)&&this.keysUsed.includes(a))if(i.preventDefault(),i.stopPropagation(),a==="Tab"){if(G(this,cr)){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,dr))==null||n.focus(),G(this,cr)&&(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;cm=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;Ic=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=bg;function _g(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function oa(i){var e;return(e=i.getAttribute("bounds")?ut(i,`#${i.getAttribute("bounds")}`):X(i)||i.parentElement)!=null?e:i}c.customElements.get("media-chrome-menu")||c.customElements.define("media-chrome-menu",ue);var Hc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ct=(i,e,t)=>(Hc(i,e,"read from private field"),t?t.call(i):e.get(i)),Wt=(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),st=(i,e,t)=>(Hc(i,e,"access private method"),t),cl,aa,Dc,um,hl,$c,Bc,hm,wt,ho,sa,Oc,pm,ul,Nc;function yg(i){return`
|
|
1813
1813
|
<style>
|
|
1814
1814
|
:host {
|
|
1815
1815
|
transition: var(--media-menu-item-transition,
|
|
@@ -1927,7 +1927,7 @@ bp-player[has-error] {
|
|
|
1927
1927
|
${this.getSuffixSlotInnerHTML(i)}
|
|
1928
1928
|
</slot>
|
|
1929
1929
|
<slot name="submenu"></slot>
|
|
1930
|
-
`}function
|
|
1930
|
+
`}function Tg(i){return""}var Ze={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Ke=class extends c.HTMLElement{constructor(){if(super(),Wt(this,Dc),Wt(this,hl),Wt(this,Bc),Wt(this,ho),Wt(this,Oc),Wt(this,ul),Wt(this,cl,!1),Wt(this,aa,void 0),Wt(this,wt,()=>{var e,t;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let r=this.shadowRoot.querySelector('slot[name="description"]'),o=(e=this.submenuElement.checkedItems)==null?void 0:e[0],n=(t=o==null?void 0:o.dataset.description)!=null?t:o==null?void 0:o.text,a=ee.createElement("span");a.textContent=n??"",r.replaceChildren(a)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Ze.TYPE,Ze.DISABLED,Ze.CHECKED,Ze.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":st(this,Dc,um).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":st(this,Oc,pm).call(this,e);break;case"keyup":st(this,ho,sa).call(this,e);break}}attributeChangedCallback(e,t,r){e===Ze.CHECKED&&na(this)&&!Ct(this,cl)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===Ze.TYPE&&r!==t?this.role="menuitem"+r:e===Ze.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Ze.DISABLED)||this.enable(),this.role="menuitem"+this.type,Pc(this,aa,Uc(this,this.parentNode)),st(this,ul,Nc).call(this),this.submenuElement&&st(this,hl,$c).call(this)}disconnectedCallback(){this.disable(),st(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=Gi(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(Ze.TYPE))!=null?e:""}set type(e){this.setAttribute(Ze.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Ze.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Ze.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;um=function(i){let e=i.target;if(!(e!=null&&e.name))for(let r of e.assignedNodes({flatten:!0}))r instanceof Text&&r.textContent.trim()===""&&r.remove();e.name==="submenu"&&(this.submenuElement?st(this,hl,$c).call(this):st(this,Bc,hm).call(this))};hl=new WeakSet;$c=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",Ct(this,wt)),this.submenuElement.addEventListener("addmenuitem",Ct(this,wt)),this.submenuElement.addEventListener("removemenuitem",Ct(this,wt)),Ct(this,wt).call(this)};Bc=new WeakSet;hm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",Ct(this,wt)),this.submenuElement.removeEventListener("addmenuitem",Ct(this,wt)),this.submenuElement.removeEventListener("removemenuitem",Ct(this,wt)),Ct(this,wt).call(this)};wt=new WeakMap;ho=new WeakSet;sa=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",st(this,ho,sa));return}this.handleClick(i)};Oc=new WeakSet;pm=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",st(this,ho,sa));return}this.addEventListener("keyup",st(this,ho,sa),{once:!0})};ul=new WeakSet;Nc=function(){var i;let e=(i=Ct(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=yg;Ke.getSuffixSlotInnerHTML=Tg;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 Ag(i){return`
|
|
1931
1931
|
${ue.getTemplateHTML(i)}
|
|
1932
1932
|
<style>
|
|
1933
1933
|
:host {
|
|
@@ -1962,7 +1962,7 @@ bp-player[has-error] {
|
|
|
1962
1962
|
--media-settings-menu-item-opacity: 0;
|
|
1963
1963
|
}
|
|
1964
1964
|
</style>
|
|
1965
|
-
`}var la=class extends ue{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-settings-menu-button")}};la.getTemplateHTML=
|
|
1965
|
+
`}var la=class extends ue{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-settings-menu-button")}};la.getTemplateHTML=Ag;c.customElements.get("media-settings-menu")||c.customElements.define("media-settings-menu",la);function Sg(i){return`
|
|
1966
1966
|
${Ke.getTemplateHTML.call(this,i)}
|
|
1967
1967
|
<style>
|
|
1968
1968
|
slot:not([name="submenu"]) {
|
|
@@ -1973,11 +1973,11 @@ bp-player[has-error] {
|
|
|
1973
1973
|
background: transparent;
|
|
1974
1974
|
}
|
|
1975
1975
|
</style>
|
|
1976
|
-
`}function
|
|
1976
|
+
`}function kg(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
|
|
1980
|
+
`}var ur=class extends Ke{};ur.shadowRootOptions={mode:"open"};ur.getTemplateHTML=Sg;ur.getSuffixSlotInnerHTML=kg;c.customElements.get("media-settings-menu-item")||c.customElements.define("media-settings-menu-item",ur);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=Gi(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 Lg(){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
|
|
1991
|
+
`}function Ig(){return _("Settings")}var po=class extends He{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",_("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-settings-menu")}};po.getSlotTemplateHTML=Lg;po.getTooltipContentHTML=Ig;c.customElements.get("media-settings-menu-button")||c.customElements.define("media-settings-menu-button",po);var Kc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},mm=(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,Eh(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 mm(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(mm(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=It({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(at(this,"checked-indicator")),this.defaultSlot.append(r)}};fl=new WeakSet;Fc=function(){if(this.value==null)return;let i=new c.CustomEvent(y.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-audio-track-menu")||c.customElements.define("media-audio-track-menu",gl);var Cg=`<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
|
|
1994
|
+
</svg>`;function wg(){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">${
|
|
2001
|
-
`}function
|
|
2000
|
+
<slot name="icon">${Cg}</slot>
|
|
2001
|
+
`}function Mg(){return _("Audio")}var vm=i=>{let e=_("Audio");i.setAttribute("aria-label",e)},mo=class extends He{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),vm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LANG&&vm(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)}};mo.getSlotTemplateHTML=wg;mo.getTooltipContentHTML=Mg;c.customElements.get("media-audio-track-menu-button")||c.customElements.define("media-audio-track-menu-button",mo);var Yc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Rg=(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)},xg=(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,Pg=`
|
|
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
|
|
2004
|
+
</svg>`;function Dg(i){return`
|
|
2005
2005
|
${ue.getTemplateHTML(i)}
|
|
2006
|
-
<slot name="captions-indicator" hidden>${
|
|
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
|
|
2006
|
+
<slot name="captions-indicator" hidden>${Pg}</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 fm(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Em(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return fm(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Em(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Tl=new WeakMap;_l=new WeakSet;qc=function(){var i;let e=Rg(this,Tl)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(s.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;xg(this,Tl,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,o=It({type:"radio",text:this.formatMenuItemText(_("Off")),value:"off",checked:r});o.prepend(at(this,"checked-indicator")),this.defaultSlot.append(o);let n=this.mediaSubtitlesList;for(let a of n){let l=It({type:"radio",text:this.formatMenuItemText(a.label,a),value:ja(a),checked:this.value==ja(a)});l.prepend(at(this,"checked-indicator")),((i=a.kind)!=null?i:"subs")==="captions"&&l.append(at(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(y.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new c.CustomEvent(y.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};ca.getTemplateHTML=Dg;var fm=(i,e)=>{let t=i.getAttribute(e);return t?Qi(t):[]},Em=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Bt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-menu")||c.customElements.define("media-captions-menu",ca);var Og=`<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>`,
|
|
2009
|
+
</svg>`,Ng=`<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
|
|
2011
|
+
</svg>`;function Ug(){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">${
|
|
2029
|
-
<slot name="off">${
|
|
2028
|
+
<slot name="on">${Og}</slot>
|
|
2029
|
+
<slot name="off">${Ng}</slot>
|
|
2030
2030
|
</slot>
|
|
2031
|
-
`}function
|
|
2031
|
+
`}function Hg(){return _("Captions")}var gm=i=>{i.setAttribute("data-captions-enabled",es(i).toString())},bm=i=>{i.setAttribute("aria-label",_("closed captions"))},vo=class extends He{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING,s.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),bm(this),gm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING?gm(this):e===s.MEDIA_LANG&&bm(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 _m(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){ym(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return _m(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){ym(this,s.MEDIA_SUBTITLES_SHOWING,e)}};vo.getSlotTemplateHTML=Ug;vo.getTooltipContentHTML=Hg;var _m=(i,e)=>{let t=i.getAttribute(e);return t?Qi(t):[]},ym=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Bt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-menu-button")||c.customElements.define("media-captions-menu-button",vo);var Tm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Eo=(i,e,t)=>(Tm(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)},fo=(i,e,t)=>(Tm(i,e,"access private method"),t),pi,go,ua,Al,Xc,Zc={RATES:"rates"},Sl=class extends ue{constructor(){super(),Qc(this,go),Qc(this,Al),Qc(this,pi,new oi(this,Zc.RATES,{defaultValue:tc})),fo(this,go,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,fo(this,go,ua).call(this)):e===Zc.RATES&&t!=r&&(Eo(this,pi).value=r,fo(this,go,ua).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",fo(this,Al,Xc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",fo(this,Al,Xc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-playback-rate-menu-button")}get rates(){return Eo(this,pi)}set rates(e){e?Array.isArray(e)?Eo(this,pi).value=e.join(" "):typeof e=="string"&&(Eo(this,pi).value=e):Eo(this,pi).value="",fo(this,go,ua).call(this)}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,or)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};pi=new WeakMap;go=new WeakSet;ua=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(Eo(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=It({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});o.prepend(at(this,"checked-indicator")),this.defaultSlot.append(o)}};Al=new WeakSet;Xc=function(){if(!this.value)return;let i=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-playback-rate-menu")||c.customElements.define("media-playback-rate-menu",Sl);var kl=1;function $g(i){return`
|
|
2032
2032
|
<style>
|
|
2033
2033
|
:host {
|
|
2034
2034
|
min-width: 5ch;
|
|
@@ -2044,16 +2044,16 @@ bp-player[has-error] {
|
|
|
2044
2044
|
}
|
|
2045
2045
|
</style>
|
|
2046
2046
|
<slot name="icon">${i.mediaplaybackrate||kl}x</slot>
|
|
2047
|
-
`}function
|
|
2047
|
+
`}function Bg(){return _("Playback rate")}var bo=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",_("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)}};bo.getSlotTemplateHTML=$g;bo.getTooltipContentHTML=Bg;c.customElements.get("media-playback-rate-menu-button")||c.customElements.define("media-playback-rate-menu-button",bo);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)},Am=(i,e,t,r)=>(jc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),_o=(i,e,t)=>(jc(i,e,"access private method"),t),pa,To,yo,ma,Il,Jc,Cl=class extends ue{constructor(){super(...arguments),Ll(this,yo),Ll(this,Il),Ll(this,pa,[]),Ll(this,To,{})}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",_o(this,yo,ma).call(this)):e===s.MEDIA_RENDITION_LIST&&t!==r?(Am(this,pa,vh(r)),_o(this,yo,ma).call(this)):e===s.MEDIA_HEIGHT&&t!==r&&_o(this,yo,ma).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",_o(this,Il,Jc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",_o(this,Il,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){Am(this,pa,e),_o(this,yo,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;To=new WeakMap;yo=new WeakSet;ma=function(){if(ha(this,To).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&ha(this,To).mediaHeight===this.mediaHeight)return;ha(this,To).mediaRenditionList=JSON.stringify(this.mediaRenditionList),ha(this,To).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=It({type:"radio",text:l,value:`${a.id}`,checked:a.selected&&!t});d.prepend(at(this,"checked-indicator")),this.defaultSlot.append(d)}let r=e&&this.showRenditionBitrate(e),o=t?e?this.formatMenuItemText(`${_("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${_("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(_("Auto")),n=It({type:"radio",text:o,value:"auto",checked:t});n.dataset.description=o,n.prepend(at(this,"checked-indicator")),this.defaultSlot.append(n)};Il=new WeakSet;Jc=function(){if(this.value==null)return;let i=new c.CustomEvent(y.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-rendition-menu")||c.customElements.define("media-rendition-menu",Cl);var Vg=`<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
|
|
2049
|
+
</svg>`;function Wg(){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">${
|
|
2056
|
-
`}function
|
|
2055
|
+
<slot name="icon">${Vg}</slot>
|
|
2056
|
+
`}function Fg(){return _("Quality")}var Ao=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",_("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)}};Ao.getSlotTemplateHTML=Wg;Ao.getTooltipContentHTML=Fg;c.customElements.get("media-rendition-menu-button")||c.customElements.define("media-rendition-menu-button",Ao);var iu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Rt=(i,e,t)=>(iu(i,e,"read from private field"),t?t.call(i):e.get(i)),Mt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Sm=(i,e,t,r)=>(iu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Xe=(i,e,t)=>(iu(i,e,"access private method"),t),ko,va,Dl,hr,So,ru,km,wl,eu,Ml,tu,Lm,xl,Pl,Rl;function Kg(i){return`
|
|
2057
2057
|
${ue.getTemplateHTML(i)}
|
|
2058
2058
|
<style>
|
|
2059
2059
|
:host {
|
|
@@ -2067,7 +2067,7 @@ bp-player[has-error] {
|
|
|
2067
2067
|
overflow: hidden;
|
|
2068
2068
|
}
|
|
2069
2069
|
</style>
|
|
2070
|
-
`}var fa=class extends ue{constructor(){super(),
|
|
2070
|
+
`}var fa=class extends ue{constructor(){super(),Mt(this,va),Mt(this,hr),Mt(this,ru),Mt(this,wl),Mt(this,tu),Mt(this,ko,!1),Mt(this,Ml,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",o=Xe(this,wl,eu).call(this,t);(r||o)&&(Rt(this,ko)?Xe(this,hr,So).call(this):Xe(this,tu,Lm).call(this,e))}),Mt(this,xl,e=>{let t=e.target,r=this.contains(t),o=e.button===2,n=(t==null?void 0:t.nodeName)==="VIDEO",a=Xe(this,wl,eu).call(this,t);r||o&&(n||a)||Xe(this,hr,So).call(this)}),Mt(this,Pl,e=>{e.key==="Escape"&&Xe(this,hr,So).call(this)}),Mt(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)}Xe(this,hr,So).call(this)}),this.setAttribute("noautohide",""),Xe(this,va,Dl).call(this)}connectedCallback(){super.connectedCallback(),X(this).addEventListener("contextmenu",Rt(this,Ml)),this.addEventListener("click",Rt(this,Rl))}disconnectedCallback(){super.disconnectedCallback(),X(this).removeEventListener("contextmenu",Rt(this,Ml)),this.removeEventListener("click",Rt(this,Rl)),document.removeEventListener("mousedown",Rt(this,xl)),document.removeEventListener("keydown",Rt(this,Pl))}};ko=new WeakMap;va=new WeakSet;Dl=function(){this.hidden=!Rt(this,ko)};hr=new WeakSet;So=function(){Sm(this,ko,!1),Xe(this,va,Dl).call(this)};ru=new WeakSet;km=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&Xe(t=e,hr,So).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;Lm=function(i){i.preventDefault(),Xe(this,ru,km).call(this),Sm(this,ko,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,Xe(this,va,Dl).call(this),document.addEventListener("mousedown",Rt(this,xl),{once:!0}),document.addEventListener("keydown",Rt(this,Pl),{once:!0})};xl=new WeakMap;Pl=new WeakMap;Rl=new WeakMap;fa.getTemplateHTML=Kg;c.customElements.get("media-context-menu")||c.customElements.define("media-context-menu",fa);function Gg(i){return`
|
|
2071
2071
|
${Ke.getTemplateHTML.call(this,i)}
|
|
2072
2072
|
<style>
|
|
2073
2073
|
::slotted(*) {
|
|
@@ -2080,16 +2080,16 @@ bp-player[has-error] {
|
|
|
2080
2080
|
min-height: var(--media-control-height, 24px);
|
|
2081
2081
|
}
|
|
2082
2082
|
</style>
|
|
2083
|
-
`}var
|
|
2083
|
+
`}var Lo=class extends Ke{};Lo.shadowRootOptions={mode:"open"};Lo.getTemplateHTML=Gg;c.customElements.get("media-context-menu-item")||c.customElements.define("media-context-menu-item",Lo);var qg=`<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>`,
|
|
2085
|
+
</svg>`,zg=`<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>`,
|
|
2087
|
+
</svg>`,Yg=`<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>`,
|
|
2090
|
+
</svg>`,Qg=`<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
|
|
2092
|
+
</svg>`;function Zg(i){switch(i){case"offline":return zg;case"network":return Yg;case"security":return Qg;default:return qg}}function Xg(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 Ft=class extends Pe{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=Zg(t),o=Xg(t);return qe`
|
|
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?
|
|
2102
|
+
${this.showCode?qe`
|
|
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)}};
|
|
2110
|
+
`}renderIcon(t){let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};Ft.styles=qo`
|
|
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
|
-
`,U([W({type:Object})],
|
|
2171
|
+
`,U([W({type:Object})],Ft.prototype,"error",2),U([W({type:Boolean})],Ft.prototype,"showCode",2),Ft=U([Xt("bp-error-display")],Ft);var Im=`/**
|
|
2172
2172
|
* BP Default UI Styles
|
|
2173
2173
|
*
|
|
2174
2174
|
* Layer-based architecture.
|
|
@@ -2662,7 +2662,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2662
2662
|
outline: 2px solid rgba(0, 255, 0, 1) !important;
|
|
2663
2663
|
background: rgba(0, 255, 0, 0.3) !important;
|
|
2664
2664
|
}
|
|
2665
|
-
`;var
|
|
2665
|
+
`;var Cm=!1;function jg(){if(Cm||(Cm=!0,document.getElementById("bp-default-ui-styles")))return;Mr();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=Im,document.head.appendChild(i)}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(),jg(),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(Hi(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");if(!t)return;let r=o=>{o.stopPropagation(),this._player=o.detail,this._providerType=t.providerType,this.live=this._player.state.streamType==="live",this.setupPlayerListeners(),this.dispatchEvent(Vi(hn,{detail:this._player})),this.requestUpdate()};t.addEventListener("ready",r),this._cleanupListeners.push(()=>t.removeEventListener("ready",r))}setupPlayerListeners(){if(!this._player)return;let t=()=>{var b;let h=((b=this._player)==null?void 0:b.state.error)??null;this._error=h;let E=h!==null&&h.fatal&&h.category!=="offline";Ee(this,"has-error",E)},r=()=>{var E;let h=(E=this._player)==null?void 0:E.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 b=h.error!==null&&h.error.fatal&&h.error.category!=="offline";Ee(this,"has-error",b)}},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:m}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:d,videoHeight:m,fluid:this.fluid}),d>0&&m>0&&l({videoWidth:d,videoHeight:m}),this._cleanupListeners.push(()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("error",t)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("statechange",r)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("playing",o)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("ended",n)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("sourcechange",a)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("resize",l)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("loadedmetadata",l)})}renderDefaultControls(){return this._providerType==="nano"||this._providerType==="livekit"?qe`
|
|
2666
2666
|
<media-control-bar>
|
|
2667
2667
|
<media-play-button notooltip clip-hidden></media-play-button>
|
|
2668
2668
|
<media-live-button notooltip vod-hidden clip-hidden></media-live-button>
|
|
@@ -2672,7 +2672,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2672
2672
|
<media-rendition-menu-button notooltip clip-hidden></media-rendition-menu-button>
|
|
2673
2673
|
<media-fullscreen-button notooltip clip-hidden></media-fullscreen-button>
|
|
2674
2674
|
</media-control-bar>
|
|
2675
|
-
`:
|
|
2675
|
+
`:qe`
|
|
2676
2676
|
<media-control-bar>
|
|
2677
2677
|
<media-play-button notooltip clip-hidden></media-play-button>
|
|
2678
2678
|
<media-live-button notooltip vod-hidden clip-hidden></media-live-button>
|
|
@@ -2688,7 +2688,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2688
2688
|
<media-pip-button notooltip clip-hidden></media-pip-button>
|
|
2689
2689
|
<media-fullscreen-button notooltip clip-hidden></media-fullscreen-button>
|
|
2690
2690
|
</media-control-bar>
|
|
2691
|
-
`}render(){return
|
|
2691
|
+
`}render(){return qe`
|
|
2692
2692
|
<!-- Chrome Layer: media-controller with all controls -->
|
|
2693
2693
|
<div class="bp-layer bp-chrome-layer">
|
|
2694
2694
|
<media-controller autohide="${this.autohide}" ?hotkeys="${this.hotkeys}">
|
|
@@ -2704,7 +2704,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2704
2704
|
?debug="${this.debug}"
|
|
2705
2705
|
></bp-player>
|
|
2706
2706
|
|
|
2707
|
-
${this._getPoster()?
|
|
2707
|
+
${this._getPoster()?qe`
|
|
2708
2708
|
<media-poster-image slot="poster" src="${this._getPoster()}"></media-poster-image>
|
|
2709
2709
|
`:null}
|
|
2710
2710
|
|
|
@@ -2737,19 +2737,19 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2737
2737
|
<div class="bp-layer bp-error-layer">
|
|
2738
2738
|
<bp-error-display .error="${this._error}" ?showCode="${this.debug}"></bp-error-display>
|
|
2739
2739
|
</div>
|
|
2740
|
-
`}};U([W({converter:
|
|
2740
|
+
`}};U([W({converter:Rr()})],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:Rr()})],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([Jt()],te.prototype,"_player",2),U([Jt()],te.prototype,"_providerType",2),U([Jt()],te.prototype,"_error",2),U([Jt()],te.prototype,"_connectionState",2),U([Jt()],te.prototype,"_showEndedOverlay",2),te=U([Xt("bp-default-ui")],te);var eb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
2741
2741
|
<circle cx="12" cy="12" r="10" stroke-opacity="0.25"/>
|
|
2742
2742
|
<path d="M12 2a10 10 0 0 1 10 10" stroke-linecap="round">
|
|
2743
2743
|
<animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/>
|
|
2744
2744
|
</path>
|
|
2745
|
-
</svg>`,
|
|
2745
|
+
</svg>`,tb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
2746
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"/>
|
|
2747
2747
|
<circle cx="12" cy="12" r="3" fill="currentColor"/>
|
|
2748
|
-
</svg>`,
|
|
2748
|
+
</svg>`,ib=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
2749
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"/>
|
|
2750
|
-
</svg>`,
|
|
2750
|
+
</svg>`,rb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
2751
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"/>
|
|
2752
|
-
</svg>`,
|
|
2752
|
+
</svg>`,xt=class extends Pe{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return eb;case"offline":return tb;case"ended":return this.live?ib:rb;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 qe`
|
|
2753
2753
|
<div part="icon">
|
|
2754
2754
|
<slot name="icon">${this.renderIcon(t)}</slot>
|
|
2755
2755
|
</div>
|
|
@@ -2759,7 +2759,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2759
2759
|
<p part="submessage">
|
|
2760
2760
|
<slot name="submessage"></slot>
|
|
2761
2761
|
</p>
|
|
2762
|
-
`}renderIcon(t){if(!t)return null;let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};
|
|
2762
|
+
`}renderIcon(t){if(!t)return null;let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};xt.styles=qo`
|
|
2763
2763
|
:host {
|
|
2764
2764
|
display: flex;
|
|
2765
2765
|
flex-direction: column;
|
|
@@ -2830,7 +2830,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2830
2830
|
:host([button-mode]) [part="submessage"] {
|
|
2831
2831
|
display: none;
|
|
2832
2832
|
}
|
|
2833
|
-
`,U([W({type:String,reflect:!0})],
|
|
2833
|
+
`,U([W({type:String,reflect:!0})],xt.prototype,"type",2),U([W({type:Boolean,reflect:!0})],xt.prototype,"live",2),U([W({type:Boolean,reflect:!0,attribute:"button-mode"})],xt.prototype,"buttonMode",2),xt=U([Xt("bp-overlay")],xt);var ob=["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"],wm=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function nb(i){return`
|
|
2834
2834
|
<style>
|
|
2835
2835
|
:host {
|
|
2836
2836
|
display: inline-flex;
|
|
@@ -2844,10 +2844,10 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2844
2844
|
}
|
|
2845
2845
|
</style>
|
|
2846
2846
|
<slot name="media">
|
|
2847
|
-
<audio${
|
|
2847
|
+
<audio${Om(i)}></audio>
|
|
2848
2848
|
</slot>
|
|
2849
2849
|
<slot></slot>
|
|
2850
|
-
`}function
|
|
2850
|
+
`}function ab(i){return`
|
|
2851
2851
|
<style>
|
|
2852
2852
|
:host {
|
|
2853
2853
|
display: inline-block;
|
|
@@ -2869,25 +2869,25 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2869
2869
|
}
|
|
2870
2870
|
</style>
|
|
2871
2871
|
<slot name="media">
|
|
2872
|
-
<video${
|
|
2872
|
+
<video${Om(i)}></video>
|
|
2873
2873
|
</slot>
|
|
2874
2874
|
<slot></slot>
|
|
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`
|
|
2875
|
+
`}function Dm(i,{tag:e,is:t}){var n,a,l,d,m,Mm,E,b,p,T,v,pr,ou,Rm,nu,xm,Pm;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),o=r?sb(r):[];return l=class extends i{constructor(){super(...arguments);k(this,v);k(this,E,!1);k(this,b,null);k(this,p,new Map);k(this,T);$(this,"get");$(this,"set");$(this,"call")}static get observedAttributes(){var K,de;return P(K=l,m,Mm).call(K),[...((de=r==null?void 0:r.constructor)==null?void 0:de.observedAttributes)??[],...wm]}get nativeEl(){var I;return P(this,v,pr).call(this),u(this,b)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((I=this.shadowRoot)==null?void 0:I.querySelector(e))??null}set nativeEl(I){f(this,b,I)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(I){this.toggleAttribute("muted",I)}get src(){return this.getAttribute("src")}set src(I){this.setAttribute("src",`${I}`)}get preload(){var I;return this.getAttribute("preload")??((I=this.nativeEl)==null?void 0:I.preload)}set preload(I){this.setAttribute("preload",`${I}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let I=lb(this.attributes);t&&(I.is=t),e&&(I.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(I)}this.nativeEl.muted=this.hasAttribute("muted");for(let I of o)P(this,v,xm).call(this,I);f(this,T,new MutationObserver(P(this,v,Rm).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>P(this,v,ou).call(this)),P(this,v,ou).call(this);for(let I of this.constructor.Events)this.shadowRoot.addEventListener(I,this,!0)}handleEvent(I){I.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(I.type,{detail:I.detail}))}attributeChangedCallback(I,K,de){P(this,v,pr).call(this),P(this,v,Pm).call(this,I,K,de)}connectedCallback(){P(this,v,pr).call(this)}},d=new WeakMap,m=new WeakSet,Mm=function(){if(u(this,d))return;f(this,d,!0);let I=new Set(this.observedAttributes);I.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,v,pr).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,v,pr).call(this);let re=K.toLowerCase();if(I.has(re)){let Ot=this.getAttribute(re);return Ot===null?!1:Ot===""?!0:Ot}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,v,pr).call(this);let z=K.toLowerCase();if(I.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)}},E=new WeakMap,b=new WeakMap,p=new WeakMap,T=new WeakMap,v=new WeakSet,pr=function(){u(this,E)||(f(this,E,!0),this.init())},ou=function(){var re;let I=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 Ot,Fo;I.delete(z);let fe=u(this,p).get(z);fe||(fe=z.cloneNode(),u(this,p).set(z,fe),(Ot=u(this,T))==null||Ot.observe(z,{attributes:!0})),(Fo=this.nativeEl)==null||Fo.append(fe),P(this,v,nu).call(this,fe)}),I.forEach((z,fe)=>{z.remove(),u(this,p).delete(fe)})},Rm=function(I){for(let K of I)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,v,nu).call(this,z))}},nu=function(I){I&&I.localName==="track"&&I.default&&(I.kind==="chapters"||I.kind==="metadata")&&I.track.mode==="disabled"&&(I.track.mode="hidden")},xm=function(I){if(Object.prototype.hasOwnProperty.call(this,I)){let K=this[I];delete this[I],this[I]=K}},Pm=function(I,K,de){var re,z,fe;["id","class"].includes(I)||!l.observedAttributes.includes(I)&&this.constructor.observedAttributes.includes(I)||(de===null?(re=this.nativeEl)==null||re.removeAttribute(I):((z=this.nativeEl)==null?void 0:z.getAttribute(I))!==de&&((fe=this.nativeEl)==null||fe.setAttribute(I,de)))},k(l,m),$(l,"getTemplateHTML",e.endsWith("audio")?nb:ab),$(l,"shadowRootOptions",{mode:"open"}),$(l,"Events",ob),k(l,d,!1),l}function sb(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 Om(i){let e="";for(let t in i){if(!wm.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function lb(i){let e={};for(let t of i)e[t.name]=t.value;return e}var $e=Dm(globalThis.HTMLElement??class{},{tag:"video"}),BC=Dm(globalThis.HTMLElement??class{},{tag:"audio"});var Kt=class extends Event{constructor(t,r){super(t);$(this,"track");this.track=r.track}};var au=new WeakMap;function S(i){return au.get(i)??db(i,{})}function db(i,e){let t=au.get(i);return t||au.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 vr.prototype||Object.defineProperty(vr.prototype,o,{get(){return[...S(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Kt("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 Kt("removetrack",{track:i}))})}function Nm(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,mr,Ea,vr=class extends EventTarget{constructor(){super();k(this,mr);k(this,mi);k(this,vi);k(this,fi);S(this).trackSet=new Set}[Symbol.iterator](){return u(this,mr,Ea).values()}get length(){return u(this,mr,Ea).size}getTrackById(t){return[...u(this,mr,Ea)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,mr,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,mr=new WeakSet,Ea=function(){return S(this).trackSet};var Gt=class extends Event{constructor(t,r){super(t);$(this,"rendition");this.rendition=r.rendition}};function Um(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 fr.prototype||Object.defineProperty(fr.prototype,o,{get(){return Io(this)[o]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Gt("addrendition",{rendition:e}))})}function Hm(i){let e=S(i).media.videoRenditions,t=S(i).track;S(t).renditionSet.delete(i),queueMicrotask(()=>{S(i).track.selected&&e.dispatchEvent(new Gt("removerendition",{rendition:i}))})}function $m(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 Io(i){return[...S(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...S(t).renditionSet])}var Ei,gi,bi,fr=class extends EventTarget{constructor(){super(...arguments);k(this,Ei);k(this,gi);k(this,bi)}[Symbol.iterator](){return Io(this).values()}get length(){return Io(this).length}getRenditionById(t){return Io(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Io(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of Io(this).entries())o.selected=r===t}get onaddrendition(){return u(this,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");k(this,Co,!1)}get selected(){return u(this,Co)}set selected(e){u(this,Co)!==e&&(f(this,Co,e),$m(this))}};Co=new WeakMap;var wo,Mo=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");k(this,wo,!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,Um(this,l),l}removeRendition(e){Hm(e)}get selected(){return u(this,wo)}set selected(e){u(this,wo)!==e&&(f(this,wo,e),e===!0&&Nm(this))}};wo=new WeakMap;function Bm(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 Er.prototype||Object.defineProperty(Er.prototype,o,{get(){return Ro(this)[o]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Gt("addrendition",{rendition:e}))})}function Vm(i){let e=S(i).media.audioRenditions,t=S(i).track;S(t).renditionSet.delete(i),queueMicrotask(()=>{S(i).track.enabled&&e.dispatchEvent(new Gt("removerendition",{rendition:i}))})}function Wm(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 Ro(i){return[...S(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...S(t).renditionSet])}var _i,yi,Ti,Er=class extends EventTarget{constructor(){super(...arguments);k(this,_i);k(this,yi);k(this,Ti)}[Symbol.iterator](){return Ro(this).values()}get length(){return Ro(this).length}getRenditionById(t){return Ro(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Ro(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of Ro(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 xo,ba=class{constructor(){$(this,"src");$(this,"id");$(this,"bitrate");$(this,"codec");k(this,xo,!1)}get selected(){return u(this,xo)}set selected(e){u(this,xo)!==e&&(f(this,xo,e),Wm(this))}};xo=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 gr.prototype||Object.defineProperty(gr.prototype,o,{get(){return[...S(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Kt("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 Kt("removetrack",{track:i}))})}function Fm(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,Po,Ul,gr=class extends EventTarget{constructor(){super();k(this,Po);k(this,Ai);k(this,Si);k(this,ki);S(this).trackSet=new Set}[Symbol.iterator](){return u(this,Po,Ul).values()}get length(){return u(this,Po,Ul).size}getTrackById(t){return[...u(this,Po,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,Po=new WeakSet,Ul=function(){return S(this).trackSet};var Do,Oo=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");k(this,Do,!1)}addRendition(e,t,r){let o=new ba;return o.src=e,o.codec=t,o.bitrate=r,Bm(this,o),o}removeRendition(e){Vm(e)}get enabled(){return u(this,Do)}set enabled(e){u(this,Do)!==e&&(f(this,Do,e),Fm(this))}};Do=new WeakMap;var Km=Bl(globalThis.HTMLMediaElement,"video"),Gm=Bl(globalThis.HTMLMediaElement,"audio");function No(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 cb(this)}});let t=Bl(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return ub(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",l=""){let d=new Mo;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 Oo;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 fr,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 Er,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 cb(i){let e=S(i).videoTracks;if(!e&&(e=new vr,S(i).videoTracks=e,Km)){let t=Km.call(i.nativeEl??i);for(let r of t)Ol(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof Mo)){for(let o of t)Nl(o);return}Ol(i,r.track)}),t.addEventListener("removetrack",r=>{Nl(r.track)})}return e}function ub(i){let e=S(i).audioTracks;if(!e&&(e=new gr,S(i).audioTracks=e,Gm)){let t=Gm.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 Oo)){for(let o of t)$l(o);return}Hl(i,r.track)}),t.addEventListener("removetrack",r=>{$l(r.track)})}return e}var Me=fv(Ou("hls.js"),1);var hb=No($e),qt,zt,Yt,Uo,Je,su,qm,lu,_a,zm,Li=class extends hb{constructor(){super();k(this,Je);k(this,qt,null);k(this,zt,null);k(this,Yt,null);k(this,Uo,!1);this.api=null;k(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,Je,zm).call(this,"config")}static getTemplateHTML(t,r={}){let{src:o,...n}=t;return`
|
|
2876
2876
|
<script type="application/json" id="config">
|
|
2877
2877
|
${JSON.stringify(r.config||{})}
|
|
2878
2878
|
<\/script>
|
|
2879
2879
|
${$e.getTemplateHTML(n)}
|
|
2880
|
-
`}get config(){return u(this,
|
|
2880
|
+
`}get config(){return u(this,Yt)}set config(t){f(this,Yt,t)}attributeChangedCallback(t,r,o){t!=="src"&&super.attributeChangedCallback(t,r,o),t==="src"&&r!==o&&this.load()}disconnectedCallback(){var t;P(this,Je,su).call(this),(t=super.disconnectedCallback)==null||t.call(this)}async load(){var o,n,a,l;let t=!this.api&&!u(this,Uo);if(P(this,Je,su).call(this),!this.src)return;if(t&&!u(this,Yt))try{f(this,Yt,JSON.parse(((n=(o=this.shadowRoot)==null?void 0:o.getElementById("config"))==null?void 0:n.textContent)||"{}"))}catch(d){console.error("[hls-video] Failed to parse config:",d),f(this,Yt,{})}if(!P(this,Je,qm).call(this,this.src)){await Promise.resolve(),f(this,Uo,!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,Yt)}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let p=()=>{var T;return(T=this.api)==null?void 0:T.startLoad()};this.nativeEl.addEventListener("play",p,{once:!0}),this.api.on(Me.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",p)});break}case"metadata":{let p=this.api.config.maxBufferLength,T=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let v=()=>{this.api&&(this.api.config.maxBufferLength=p,this.api.config.maxBufferSize=T)};this.nativeEl.addEventListener("play",v,{once:!0}),this.api.on(Me.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",v)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,_a)),f(this,qt,document.createElement("source")),u(this,qt).setAttribute("type","application/x-mpegURL"),u(this,qt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(u(this,qt));let m=new WeakMap;this.api.on(Me.default.Events.MANIFEST_PARSED,(p,T)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(g=>{console.warn("Autoplay failed:",g)}),P(this,Je,lu).call(this);let v=this.videoTracks.getTrackById("main");v||(v=this.addVideoTrack("main"),v.id="main",v.selected=!0);for(let[g,L]of T.levels.entries()){let ie=v.addRendition(L.url[0],L.width,L.height,L.videoCodec??void 0,L.bitrate);m.set(L,`${g}`),ie.id=`${g}`}for(let[g,L]of T.audioTracks.entries()){let ie=L.default?"main":"alternative",ke=this.addAudioTrack(ie,L.name,L.lang);ke.id=`${g}`,L.default&&(ke.enabled=!0)}}),(a=u(this,zt))==null||a.call(this);let h=()=>{var g,L;let p=[...this.audioTracks].find(ie=>ie.enabled),T=p?+p.id:void 0,v=((g=this.api)==null?void 0:g.audioTracks.map(ie=>ie.id))??[];T!==void 0&&T!==((L=this.api)==null?void 0:L.audioTrack)&&v.includes(T)&&this.api&&(this.api.audioTrack=T)};this.audioTracks.addEventListener("change",h),f(this,zt,()=>{this.audioTracks.removeEventListener("change",h)}),this.api.on(Me.default.Events.LEVELS_UPDATED,(p,T)=>{let v=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!v)return;let g=T.levels.map(L=>m.get(L));for(let L of this.videoRenditions)L.id&&!g.includes(L.id)&&v.removeRendition(L)});let E=null;this.api.on(Me.default.Events.ERROR,(p,T)=>{var v;T.type===Me.default.ErrorTypes.NETWORK_ERROR&&T.details===Me.default.ErrorDetails.FRAG_LOAD_ERROR&&(E=((v=T.frag)==null?void 0:v.level)??null)}),this.api.on(Me.default.Events.LEVEL_SWITCHED,(p,T)=>{let v=T.level;E!==null&&v<E&&(console.warn(`hls.js downgraded quality from level ${E} to ${v} due to fragment load failure.`),this.videoRenditions.selectedIndex=v,E=null)});let b=()=>{let p=this.videoRenditions.selectedIndex;this.api&&p!==this.api.nextLevel&&(this.api.nextLevel=p)};(l=this.videoRenditions)==null||l.addEventListener("change",b),this.api.once(Me.default.Events.DESTROYING,()=>{var p,T;P(this,Je,lu).call(this),(p=this.videoRenditions)==null||p.removeEventListener("change",b),(T=u(this,zt))==null||T.call(this),f(this,zt,null)});return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};qt=new WeakMap,zt=new WeakMap,Yt=new WeakMap,Uo=new WeakMap,Je=new WeakSet,su=function(){var t,r,o;(t=u(this,qt))==null||t.remove(),f(this,qt,null),(r=u(this,zt))==null||r.call(this),f(this,zt,null),(o=this.nativeEl)==null||o.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,_a)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),f(this,Uo,!1)},qm=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},lu=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},_a=new WeakMap,zm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Li.shadowRootOptions={...$e.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",Li);var du=Li;var pb="nanoplayer.4.min.js",mb="nanoplayer",Re={loading:!1,loaded:!1,error:null,callbacks:[]};function vb(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}/`}${mb}/${pb}`;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 fb=No($e),lt,Ii,he,dt,Ho,xe,ya,Ci,wi,br,_r,ct,yr,$o,Bo,Se,Ym,cu,Qm,Zm,Xm,Vl,Mi=class extends fb{constructor(){super();k(this,Se);k(this,lt,null);k(this,Ii,null);k(this,he,null);k(this,dt,null);k(this,Ho,"");k(this,xe,null);k(this,ya,!0);k(this,Ci,[]);k(this,wi,[]);k(this,br,[]);k(this,_r,null);k(this,ct,null);k(this,yr,!1);k(this,$o,!1);k(this,Bo,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,Ym).call(this)}static get observedAttributes(){return[...$e.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:o,"library-location":n,...a}=t;return`
|
|
2881
2881
|
<script type="application/json" id="config">
|
|
2882
2882
|
${JSON.stringify(r.config||{})}
|
|
2883
2883
|
<\/script>
|
|
2884
2884
|
${$e.getTemplateHTML(a)}
|
|
2885
|
-
`}get config(){return u(this,
|
|
2885
|
+
`}get config(){return u(this,lt)}set config(t){f(this,lt,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 a,l,d,m,h,E;let t=!u(this,he);P(this,Se,cu).call(this);let r=this.streamid,o=!!u(this,Ii);if(!r&&!o)return;if(f(this,_r,new Promise(b=>{f(this,ct,b)})),t&&!u(this,lt))try{f(this,lt,JSON.parse(((l=(a=this.shadowRoot)==null?void 0:a.getElementById("config"))==null?void 0:l.textContent)||"{}"))}catch(b){console.error("[nano-video] Failed to parse config:",b),f(this,lt,{})}try{await vb(this.libraryLocation,(d=u(this,lt))==null?void 0:d.scriptUrl)}catch(b){console.error("[nano-video] Failed to load NanoPlayer script:",b),this.dispatchEvent(tt(b)),(m=u(this,ct))==null||m.call(this);return}f(this,Ho,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),f(this,dt,document.createElement("div")),u(this,dt).id=u(this,Ho),u(this,dt).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",getComputedStyle(this).position==="static"&&(this.style.position="relative"),this.nativeEl.style.display="none",this.appendChild(u(this,dt)),f(this,he,new window.NanoPlayer(u(this,Ho))),this.api=u(this,he);try{let b=P(this,Se,Qm).call(this,r,o?u(this,Ii):void 0),p=await u(this,he).setup(b);f(this,br,((h=p.source.entries)==null?void 0:h.map((T,v)=>({index:v,height:T.info.height??0,width:T.info.width??0,bitrate:T.info.bitrate??0,label:T.info.height?`${T.info.height}p`:v===0?"Source":`Stream ${v+1}`})))??[]),P(this,Se,Xm).call(this)}catch(b){console.error("[nano-video] Failed to setup NanoPlayer:",b),this.dispatchEvent(tt(b)),(E=u(this,ct))==null||E.call(this)}}async play(){if(u(this,_r)&&await u(this,_r),u(this,he)){f(this,yr,!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,cu).call(this),(t=u(this,Bo))==null||t.call(this),f(this,Bo,null),(r=super.disconnectedCallback)==null||r.call(this)}};lt=new WeakMap,Ii=new WeakMap,he=new WeakMap,dt=new WeakMap,Ho=new WeakMap,xe=new WeakMap,ya=new WeakMap,Ci=new WeakMap,wi=new WeakMap,br=new WeakMap,_r=new WeakMap,ct=new WeakMap,yr=new WeakMap,$o=new WeakMap,Bo=new WeakMap,Se=new WeakSet,Ym=function(){let t=r=>{var o;r.target!==this&&((o=u(this,dt))!=null&&o.contains(r.target))&&u(this,yr)&&r.stopImmediatePropagation()};this.addEventListener("pause",t,!0),f(this,Bo,()=>this.removeEventListener("pause",t,!0))},cu=function(){var t;(t=u(this,ct))==null||t.call(this),f(this,_r,null),f(this,ct,null),u(this,Ci).forEach(r=>r()),f(this,Ci,[]),u(this,wi).forEach(r=>r()),f(this,wi,[]);for(let r of this.videoTracks)this.removeVideoTrack(r);for(let r of this.audioTracks)this.removeAudioTrack(r);u(this,he)&&(u(this,he).destroy(),f(this,he,null),this.api=null),u(this,dt)&&(u(this,dt).remove(),f(this,dt,null)),f(this,xe,null),f(this,$o,!1),f(this,br,[])},Qm=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,lt))==null?void 0:n.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((a=u(this,lt))==null?void 0:a.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(q(ud)),this.dispatchEvent(q(cn)),this.dispatchEvent(q(xa)),(l=u(this,ct))==null||l.call(this)},onPlay:()=>{f(this,yr,!1),f(this,$o,!0),this.dispatchEvent(q(sn)),this.dispatchEvent(q(jt))},onPause:()=>{this.dispatchEvent(q(Wi))},onLoading:()=>{this.dispatchEvent(q(xr))},onStartBuffering:()=>{this.dispatchEvent(q(xr))},onStopBuffering:()=>{this.dispatchEvent(q(xa)),this.dispatchEvent(q(jt))},onError:l=>{var h,E;f(this,yr,!1);let d=l.data.code??-1,m=l.data.message??"NanoPlayer error";if(d===2004&&u(this,$o)){this.dispatchEvent(q(ln)),(h=u(this,ct))==null||h.call(this);return}this.dispatchEvent(tt(new Error(m),d)),(E=u(this,ct))==null||E.call(this)},onActiveVideoElementChange:l=>{var m;let d=(m=l.data)==null?void 0:m.activeVideoElement;d&&(f(this,xe,d),P(this,Se,Zm).call(this,d))}}}},Zm=function(t){u(this,Ci).forEach(o=>o()),f(this,Ci,[]);let r=[dn,un,ld,ei];for(let o of r){let n=()=>{this.dispatchEvent(q(o))};t.addEventListener(o,n),u(this,Ci).push(()=>t.removeEventListener(o,n))}},Xm=function(){u(this,wi).forEach(o=>o()),f(this,wi,[]);for(let o of this.videoTracks)this.removeVideoTrack(o);for(let o of this.audioTracks)this.removeAudioTrack(o);if(u(this,br).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let o of u(this,br)){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(d=>{console.warn("[nano-video] Quality switch failed:",d)}),(l=u(this,he))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r),u(this,wi).push(()=>{this.videoRenditions.removeEventListener("change",r)})},Vl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Mi.shadowRootOptions={...$e.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",Mi);var uu=Mi;var ve=Ou("livekit-client");var Eb=No($e),Ge,ne,ae,Pt,Vo,Wo,Dt,Tr,Ri,le,Wl,Jm,jm,Fl,ev,tv,Kl,xi=class extends Eb{constructor(){super();k(this,le);k(this,Ge,null);k(this,ne,null);k(this,ae,null);k(this,Pt,[]);k(this,Vo,[]);k(this,Wo,[]);k(this,Dt,"disconnected");k(this,Tr,null);k(this,Ri,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`
|
|
2886
2886
|
<script type="application/json" id="config">
|
|
2887
2887
|
${JSON.stringify(r.config||{})}
|
|
2888
2888
|
<\/script>
|
|
2889
2889
|
${$e.getTemplateHTML(a)}
|
|
2890
|
-
`}get config(){return u(this,
|
|
2890
|
+
`}get config(){return u(this,Ge)}set config(t){f(this,Ge,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,T,v;let t=!u(this,ne);P(this,le,Wl).call(this);let r=this.url,o=this.token;if(!r||!o)return;if(f(this,Tr,new Promise(g=>{f(this,Ri,g)})),t&&!u(this,Ge))try{f(this,Ge,JSON.parse(((T=(p=this.shadowRoot)==null?void 0:p.getElementById("config"))==null?void 0:T.textContent)||"{}"))}catch(g){console.error("[livekit-video] Failed to parse config:",g),f(this,Ge,{})}let n=P(this,le,ev).call(this),a=P(this,le,tv).call(this);f(this,ne,new ve.Room(n)),this.room=u(this,ne);let l=()=>{f(this,Dt,"connected")},d=g=>{f(this,Dt,"disconnected"),g?this.dispatchEvent(tt(new Error(`LiveKit disconnected: ${g}`),4001)):this.dispatchEvent(q(ln))},m=()=>{f(this,Dt,"reconnecting"),this.dispatchEvent(q(xr))},h=()=>{f(this,Dt,"connected"),this.dispatchEvent(q(jt))},E=(g,L)=>{var ie,ke;if(g.kind===ve.Track.Kind.Video){let Le=g.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,Jm).call(this,Le),P(this,le,jm).call(this,L),this.dispatchEvent(q(cd)),this.dispatchEvent(q(ei)),this.dispatchEvent(q(cn)),this.dispatchEvent(q(jt)),(ke=u(this,Ri))==null||ke.call(this)}},b=g=>{g.kind===ve.Track.Kind.Video&&(g.detach(),P(this,le,Fl).call(this),u(this,ae)&&(u(this,Pt).forEach(L=>L()),f(this,Pt,[]),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,m),u(this,ne).on(ve.RoomEvent.Reconnected,h),u(this,ne).on(ve.RoomEvent.TrackSubscribed,E),u(this,ne).on(ve.RoomEvent.TrackUnsubscribed,b),f(this,Wo,[()=>{var g;return(g=u(this,ne))==null?void 0:g.off(ve.RoomEvent.Connected,l)},()=>{var g;return(g=u(this,ne))==null?void 0:g.off(ve.RoomEvent.Disconnected,d)},()=>{var g;return(g=u(this,ne))==null?void 0:g.off(ve.RoomEvent.Reconnecting,m)},()=>{var g;return(g=u(this,ne))==null?void 0:g.off(ve.RoomEvent.Reconnected,h)},()=>{var g;return(g=u(this,ne))==null?void 0:g.off(ve.RoomEvent.TrackSubscribed,E)},()=>{var g;return(g=u(this,ne))==null?void 0:g.off(ve.RoomEvent.TrackUnsubscribed,b)}]),f(this,Dt,"connecting"),this.dispatchEvent(q(dd));try{await u(this,ne).connect(r,o,a)}catch(g){f(this,Dt,"failed"),console.error("[livekit-video] Failed to connect:",g);let L=g instanceof Error?g.message:"Failed to connect to LiveKit room";this.dispatchEvent(tt(new Error(L),4e3)),(v=u(this,Ri))==null||v.call(this)}}async play(){return u(this,Tr)&&await u(this,Tr),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)}};Ge=new WeakMap,ne=new WeakMap,ae=new WeakMap,Pt=new WeakMap,Vo=new WeakMap,Wo=new WeakMap,Dt=new WeakMap,Tr=new WeakMap,Ri=new WeakMap,le=new WeakSet,Wl=function(){var t;(t=u(this,Ri))==null||t.call(this),f(this,Tr,null),f(this,Ri,null),u(this,Pt).forEach(r=>r()),f(this,Pt,[]),P(this,le,Fl).call(this),u(this,Wo).forEach(r=>r()),f(this,Wo,[]),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,Dt,"disconnected")},Jm=function(t){u(this,Pt).forEach(o=>o()),f(this,Pt,[]);let r=[dn,un,sn,jt,Wi,ei];for(let o of r){let n=()=>{this.dispatchEvent(q(o))};t.addEventListener(o,n),u(this,Pt).push(()=>t.removeEventListener(o,n))}},jm=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,m)=>d.quality-m.quality);for(let d of n){let m=o.addRendition("",d.width,d.height,void 0,d.bitrate);m.id=`${d.quality}`}let a=()=>{let d=this.videoRenditions.selectedIndex;if(d<0)t.setVideoQuality(ve.VideoQuality.HIGH);else{let m=n[d];m&&t.setVideoQuality(m.quality)}};this.videoRenditions.addEventListener("change",a),u(this,Vo).push(()=>this.videoRenditions.removeEventListener("change",a))},Fl=function(){u(this,Vo).forEach(t=>t()),f(this,Vo,[]);for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},ev=function(){var t,r,o;return{adaptiveStream:((t=u(this,Ge))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=u(this,Ge))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((o=u(this,Ge))==null?void 0:o.disconnectOnPageLeave)??!1}},tv=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=u(this,Ge))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=u(this,Ge))==null?void 0:r.iceTransportPolicy)??"all"}}},Kl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},xi.shadowRootOptions={...$e.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",xi);var hu=xi;return Ev(gb);})();
|
|
2891
2891
|
/*! Bundled license information:
|
|
2892
2892
|
|
|
2893
2893
|
@lit/reactive-element/css-tag.js:
|