function e(e,t,r,i){var s,o=arguments.length,n=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,r,n):s(t,r))||n);return o>3&&n&&Object.defineProperty(t,r,n),n}"function"==typeof SuppressedError&&SuppressedError;
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
let t=class extends Event{constructor(e,t,r,i){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=r,this.subscribe=i??!1}};
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
let r=class{constructor(e,t,r,i){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(e,t)=>{this.unsubscribe&&(this.unsubscribe!==t&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=e,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(e,t)),this.unsubscribe=t},this.host=e,void 0!==t.context){const e=t;this.context=e.context,this.callback=e.callback,this.subscribe=e.subscribe??!1}else this.context=t,this.callback=r,this.subscribe=i??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new t(this.context,this.host,this.t,this.subscribe))}},i=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){const r=t||!Object.is(e,this.o);this.o=e,r&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(const[e,{disposer:t}]of this.subscriptions)e(this.o,t)},void 0!==e&&(this.value=e)}addCallback(e,t,r){if(!r)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});const{disposer:i}=this.subscriptions.get(e);e(this.value,i)}clearCallbacks(){this.subscriptions.clear()}},s=class extends Event{constructor(e,t){super("context-provider",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},o=class extends i{constructor(e,r,i){super(void 0!==r.context?r.initialValue:i),this.onContextRequest=e=>{if(e.context!==this.context)return;const t=e.contextTarget??e.composedPath()[0];t!==this.host&&(e.stopPropagation(),this.addCallback(e.callback,t,e.subscribe))},this.onProviderRequest=e=>{if(e.context!==this.context)return;if((e.contextTarget??e.composedPath()[0])===this.host)return;const r=new Set;for(const[e,{consumerHost:i}]of this.subscriptions)r.has(e)||(r.add(e),i.dispatchEvent(new t(this.context,i,e,!0)));e.stopPropagation()},this.host=e,void 0!==r.context?this.context=r.context:this.context=r,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new s(this.context,this.host))}};
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
function n({context:e}){return(t,r)=>{const i=new WeakMap;if("object"==typeof r)return{get(){return t.get.call(this)},set(e){return i.get(this).setValue(e),t.set.call(this,e)},init(t){return i.set(this,new o(this,{context:e,initialValue:t})),t}};{t.constructor.addInitializer(t=>{i.set(t,new o(t,{context:e}))});const s=Object.getOwnPropertyDescriptor(t,r);let n;if(void 0===s){const e=new WeakMap;n={get(){return e.get(this)},set(t){i.get(this).setValue(t),e.set(this,t)},configurable:!0,enumerable:!0}}else{const e=s.set;n={...s,set(t){i.get(this).setValue(t),e?.call(this,t)}}}return void Object.defineProperty(t,r,n)}}}
/**
 * @license
 * Copyright 2022 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function a({context:e,subscribe:t}){return(i,s)=>{"object"==typeof s?s.addInitializer(function(){new r(this,{context:e,callback:e=>{i.set.call(this,e)},subscribe:t})}):i.constructor.addInitializer(i=>{new r(i,{context:e,callback:e=>{i[s]=e},subscribe:t})})}}
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const l=globalThis,c=l.ShadowRoot&&(void 0===l.ShadyCSS||l.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,A=Symbol(),d=new WeakMap;let u=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==A)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(c&&void 0===e){const r=void 0!==t&&1===t.length;r&&(e=d.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&d.set(t,e))}return e}toString(){return this.cssText}};const h=e=>new u("string"==typeof e?e:e+"",void 0,A),p=(e,...t)=>{const r=1===e.length?e[0]:t.reduce((t,r,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+e[i+1],e[0]);return new u(r,e,A)},g=c?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return h(t)})(e):e,{is:m,defineProperty:v,getOwnPropertyDescriptor:f,getOwnPropertyNames:y,getOwnPropertySymbols:b,getPrototypeOf:w}=Object,E=globalThis,C=E.trustedTypes,I=C?C.emptyScript:"",B=E.reactiveElementPolyfillSupport,x=(e,t)=>e,P={toAttribute(e,t){switch(t){case Boolean:e=e?I:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},D=(e,t)=>!m(e,t),S={attribute:!0,type:String,converter:P,reflect:!1,useDefault:!1,hasChanged:D};
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */Symbol.metadata??=Symbol("metadata"),E.litPropertyMetadata??=new WeakMap;let k=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=S){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){const r=Symbol(),i=this.getPropertyDescriptor(e,r,t);void 0!==i&&v(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){const{get:i,set:s}=f(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:i,set(t){const o=i?.call(this);s?.call(this,t),this.requestUpdate(e,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??S}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;const e=w(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){const e=this.properties,t=[...y(e),...b(e)];for(const r of t)this.createProperty(r,e[r])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,r]of t)this.elementProperties.set(e,r)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const r=this._$Eu(e,t);void 0!==r&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(g(e))}else void 0!==e&&t.push(g(e));return t}static _$Eu(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(c)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const r of t){const t=document.createElement("style"),i=l.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=r.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){const r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(void 0!==i&&!0===r.reflect){const s=(void 0!==r.converter?.toAttribute?r.converter:P).toAttribute(t,r.type);this._$Em=e,null==s?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,t){const r=this.constructor,i=r._$Eh.get(e);if(void 0!==i&&this._$Em!==i){const e=r.getPropertyOptions(i),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:P;this._$Em=i;const o=s.fromAttribute(t,e.type);this[i]=o??this._$Ej?.get(i)??o,this._$Em=null}}requestUpdate(e,t,r,i=!1,s){if(void 0!==e){const o=this.constructor;if(!1===i&&(s=this[e]),r??=o.getPropertyOptions(e),!((r.hasChanged??D)(s,t)||r.useDefault&&r.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,r))))return;this.C(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:i,wrapped:s},o){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),!0!==s||void 0!==o)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,r]of e){const{wrapped:e}=r,i=this[t];!0!==e||this._$AL.has(t)||void 0===i||this.C(t,void 0,r,i)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),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.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[x("elementProperties")]=new Map,k[x("finalized")]=new Map,B?.({ReactiveElement:k}),(E.reactiveElementVersions??=[]).push("2.1.2");
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const R=globalThis,Q=e=>e,M=R.trustedTypes,H=M?M.createPolicy("lit-html",{createHTML:e=>e}):void 0,O="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,L="?"+T,q=`<${L}>`,U=document,F=()=>U.createComment(""),V=e=>null===e||"object"!=typeof e&&"function"!=typeof e,z=Array.isArray,J="[ \t\n\f\r]",Y=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,N=/-->/g,X=/>/g,j=RegExp(`>|${J}(?:([^\\s"'>=/]+)(${J}*=${J}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),K=/'/g,G=/"/g,W=/^(?:script|style|textarea|title)$/i,Z=(e=>(t,...r)=>({_$litType$:e,strings:t,values:r}))(1),_=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),ee=new WeakMap,te=U.createTreeWalker(U,129);function re(e,t){if(!z(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==H?H.createHTML(t):t}class ie{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let s=0,o=0;const n=e.length-1,a=this.parts,[l,c]=((e,t)=>{const r=e.length-1,i=[];let s,o=2===t?"<svg>":3===t?"<math>":"",n=Y;for(let t=0;t<r;t++){const r=e[t];let a,l,c=-1,A=0;for(;A<r.length&&(n.lastIndex=A,l=n.exec(r),null!==l);)A=n.lastIndex,n===Y?"!--"===l[1]?n=N:void 0!==l[1]?n=X:void 0!==l[2]?(W.test(l[2])&&(s=RegExp("</"+l[2],"g")),n=j):void 0!==l[3]&&(n=j):n===j?">"===l[0]?(n=s??Y,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?j:'"'===l[3]?G:K):n===G||n===K?n=j:n===N||n===X?n=Y:(n=j,s=void 0);const d=n===j&&e[t+1].startsWith("/>")?" ":"";o+=n===Y?r+q:c>=0?(i.push(a),r.slice(0,c)+O+r.slice(c)+T+d):r+T+(-2===c?t:d)}return[re(e,o+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]})(e,t);if(this.el=ie.createElement(l,r),te.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=te.nextNode())&&a.length<n;){if(1===i.nodeType){if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(O)){const t=c[o++],r=i.getAttribute(e).split(T),n=/([.?@])?(.*)/.exec(t);a.push({type:1,index:s,name:n[2],strings:r,ctor:"."===n[1]?le:"?"===n[1]?ce:"@"===n[1]?Ae:ae}),i.removeAttribute(e)}else e.startsWith(T)&&(a.push({type:6,index:s}),i.removeAttribute(e));if(W.test(i.tagName)){const e=i.textContent.split(T),t=e.length-1;if(t>0){i.textContent=M?M.emptyScript:"";for(let r=0;r<t;r++)i.append(e[r],F()),te.nextNode(),a.push({type:2,index:++s});i.append(e[t],F())}}}else if(8===i.nodeType)if(i.data===L)a.push({type:2,index:s});else{let e=-1;for(;-1!==(e=i.data.indexOf(T,e+1));)a.push({type:7,index:s}),e+=T.length-1}s++}}static createElement(e,t){const r=U.createElement("template");return r.innerHTML=e,r}}function se(e,t,r=e,i){if(t===_)return t;let s=void 0!==i?r._$Co?.[i]:r._$Cl;const o=V(t)?void 0:t._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(!1),void 0===o?s=void 0:(s=new o(e),s._$AT(e,r,i)),void 0!==i?(r._$Co??=[])[i]=s:r._$Cl=s),void 0!==s&&(t=se(e,s._$AS(e,t.values),s,i)),t}class oe{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){const{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??U).importNode(t,!0);te.currentNode=i;let s=te.nextNode(),o=0,n=0,a=r[0];for(;void 0!==a;){if(o===a.index){let t;2===a.type?t=new ne(s,s.nextSibling,this,e):1===a.type?t=new a.ctor(s,a.name,a.strings,this,e):6===a.type&&(t=new de(s,this,e)),this._$AV.push(t),a=r[++n]}o!==a?.index&&(s=te.nextNode(),o++)}return te.currentNode=U,i}p(e){let t=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class ne{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=se(this,e,t),V(e)?e===$||null==e||""===e?(this._$AH!==$&&this._$AR(),this._$AH=$):e!==this._$AH&&e!==_&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>z(e)||"function"==typeof e?.[Symbol.iterator])(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!==$&&V(this._$AH)?this._$AA.nextSibling.data=e:this.T(U.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:r}=e,i="number"==typeof r?this._$AC(e):(void 0===r.el&&(r.el=ie.createElement(re(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{const e=new oe(i,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=ee.get(e.strings);return void 0===t&&ee.set(e.strings,t=new ie(e)),t}k(e){z(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,i=0;for(const s of e)i===t.length?t.push(r=new ne(this.O(F()),this.O(F()),this,this.options)):r=t[i],r._$AI(s),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=Q(e).nextSibling;Q(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class ae{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,s){this.type=1,this._$AH=$,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=s,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=$}_$AI(e,t=this,r,i){const s=this.strings;let o=!1;if(void 0===s)e=se(this,e,t,0),o=!V(e)||e!==this._$AH&&e!==_,o&&(this._$AH=e);else{const i=e;let n,a;for(e=s[0],n=0;n<s.length-1;n++)a=se(this,i[r+n],t,n),a===_&&(a=this._$AH[n]),o||=!V(a)||a!==this._$AH[n],a===$?e=$:e!==$&&(e+=(a??"")+s[n+1]),this._$AH[n]=a}o&&!i&&this.j(e)}j(e){e===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class le extends ae{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===$?void 0:e}}class ce extends ae{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==$)}}class Ae extends ae{constructor(e,t,r,i,s){super(e,t,r,i,s),this.type=5}_$AI(e,t=this){if((e=se(this,e,t,0)??$)===_)return;const r=this._$AH,i=e===$&&r!==$||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==$&&(r===$||i);i&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class de{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){se(this,e)}}const ue={I:ne,H:ae,N:ce,U:Ae,B:le},he=R.litHtmlPolyfillSupport;he?.(ie,ne),(R.litHtmlVersions??=[]).push("3.3.3");const pe=(e,t,r)=>{const i=r?.renderBefore??t;let s=i._$litPart$;if(void 0===s){const e=r?.renderBefore??null;i._$litPart$=s=new ne(t.insertBefore(F(),e),e,void 0,r??{})}return s._$AI(e),s
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */},ge=globalThis;let me=class extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=pe(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return _}};me._$litElement$=!0,me.finalized=!0,ge.litElementHydrateSupport?.({LitElement:me});const ve=ge.litElementPolyfillSupport;ve?.({LitElement:me}),(ge.litElementVersions??=[]).push("4.2.2");
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const fe=Symbol.for(""),ye=e=>{if(e?.r===fe)return e?._$litStatic$},be=(e,...t)=>({_$litStatic$:t.reduce((t,r,i)=>t+(e=>{if(void 0!==e._$litStatic$)return e._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${e}. Use 'unsafeStatic' to pass non-literal values, but\n            take care to ensure page security.`)})(r)+e[i+1],e[0]),r:fe}),we=new Map,Ee=(e=>(t,...r)=>{const i=r.length;let s,o;const n=[],a=[];let l,c=0,A=!1;for(;c<i;){for(l=t[c];c<i&&void 0!==(o=r[c],s=ye(o));)l+=s+t[++c],A=!0;c!==i&&a.push(o),n.push(l),c++}if(c===i&&n.push(t[i]),A){const e=n.join("$$lit$$");void 0===(t=we.get(e))&&(n.raw=n,we.set(e,t=n)),r=a}return e(t,...r)})(Z),Ce=e=>(t,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},Ie={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:D},Be=(e=Ie,t,r)=>{const{kind:i,metadata:s}=r;let o=globalThis.litPropertyMetadata.get(s);if(void 0===o&&globalThis.litPropertyMetadata.set(s,o=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),o.set(r.name,e),"accessor"===i){const{name:i}=r;return{set(r){const s=t.get.call(this);t.set.call(this,r),this.requestUpdate(i,s,e,!0,r)},init(t){return void 0!==t&&this.C(i,void 0,e,t),t}}}if("setter"===i){const{name:i}=r;return function(r){const s=this[i];t.call(this,r),this.requestUpdate(i,s,e,!0,r)}}throw Error("Unsupported decorator location: "+i)};
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function xe(e){return(t,r)=>"object"==typeof r?Be(e,t,r):((e,t,r)=>{const i=t.hasOwnProperty(r);return t.constructor.createProperty(r,e),i?Object.getOwnPropertyDescriptor(t,r):void 0})(e,t,r)}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function Pe(e){return xe({...e,state:!0,attribute:!1})}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const De=(e,t,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,r),r);
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function Se(e,t){return(t,r,i)=>De(t,r,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */let ke;function Re(e){return(t,r)=>De(t,r,{get(){return(this.renderRoot??(ke??=document.createDocumentFragment())).querySelectorAll(e)}})}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const Qe=1,Me=2,He=3,Oe=4,Te=e=>(...t)=>({_$litDirective$:e,values:t});let Le=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const{I:qe}=ue,Ue=e=>e,Fe=(e,t)=>void 0!==e?._$litType$,Ve=e=>void 0===e.strings,ze=()=>document.createComment(""),Je=(e,t,r)=>{const i=e._$AA.parentNode,s=void 0===t?e._$AB:t._$AA;if(void 0===r){const t=i.insertBefore(ze(),s),o=i.insertBefore(ze(),s);r=new qe(t,o,e,e.options)}else{const t=r._$AB.nextSibling,o=r._$AM,n=o!==e;if(n){let t;r._$AQ?.(e),r._$AM=e,void 0!==r._$AP&&(t=e._$AU)!==o._$AU&&r._$AP(t)}if(t!==s||n){let e=r._$AA;for(;e!==t;){const t=Ue(e).nextSibling;Ue(i).insertBefore(e,s),e=t}}}return r},Ye=(e,t,r=e)=>(e._$AI(t,r),e),Ne={},Xe=(e,t=Ne)=>e._$AH=t,je=e=>e._$AH,Ke=e=>{e._$AR(),e._$AA.remove()},Ge=e=>(e=>null!=e?._$litType$?.h)(e)?e._$litType$.h:e.strings,We=Te(class extends Le{constructor(e){super(e),this.et=new WeakMap}render(e){return[e]}update(e,[t]){const r=Fe(this.it)?Ge(this.it):null,i=Fe(t)?Ge(t):null;if(null!==r&&(null===i||r!==i)){const t=je(e).pop();let i=this.et.get(r);if(void 0===i){const e=document.createDocumentFragment();i=pe($,e),i.setConnected(!1),this.et.set(r,i)}Xe(i,[t]),Je(i,void 0,t)}if(null!==i){if(null===r||r!==i){const t=this.et.get(i);if(void 0!==t){const r=je(t).pop();(e=>{e._$AR()})(e),Je(e,void 0,r),Xe(e,[r])}}this.it=t}else this.it=void 0;return this.render(t)}});
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */var Ze=p`
  :host {
    display: block;
  }

  .input {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: stretch;
    justify-content: start;
    position: relative;
    width: 100%;
    font-family: var(--sl-input-font-family);
    font-weight: var(--sl-input-font-weight);
    letter-spacing: var(--sl-input-letter-spacing);
    vertical-align: middle;
    overflow: hidden;
    cursor: text;
    transition:
      var(--sl-transition-fast) color,
      var(--sl-transition-fast) border,
      var(--sl-transition-fast) box-shadow,
      var(--sl-transition-fast) background-color;
  }

  /* Standard inputs */
  .input--standard {
    background-color: var(--sl-input-background-color);
    border: solid var(--sl-input-border-width) var(--sl-input-border-color);
  }

  .input--standard:hover:not(.input--disabled) {
    background-color: var(--sl-input-background-color-hover);
    border-color: var(--sl-input-border-color-hover);
  }

  .input--standard.input--focused:not(.input--disabled) {
    background-color: var(--sl-input-background-color-focus);
    border-color: var(--sl-input-border-color-focus);
    box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color);
  }

  .input--standard.input--focused:not(.input--disabled) .input__control {
    color: var(--sl-input-color-focus);
  }

  .input--standard.input--disabled {
    background-color: var(--sl-input-background-color-disabled);
    border-color: var(--sl-input-border-color-disabled);
    opacity: 0.5;
    cursor: not-allowed;
  }

  .input--standard.input--disabled .input__control {
    color: var(--sl-input-color-disabled);
  }

  .input--standard.input--disabled .input__control::placeholder {
    color: var(--sl-input-placeholder-color-disabled);
  }

  /* Filled inputs */
  .input--filled {
    border: none;
    background-color: var(--sl-input-filled-background-color);
    color: var(--sl-input-color);
  }

  .input--filled:hover:not(.input--disabled) {
    background-color: var(--sl-input-filled-background-color-hover);
  }

  .input--filled.input--focused:not(.input--disabled) {
    background-color: var(--sl-input-filled-background-color-focus);
    outline: var(--sl-focus-ring);
    outline-offset: var(--sl-focus-ring-offset);
  }

  .input--filled.input--disabled {
    background-color: var(--sl-input-filled-background-color-disabled);
    opacity: 0.5;
    cursor: not-allowed;
  }

  .input__control {
    flex: 1 1 auto;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    min-width: 0;
    height: 100%;
    color: var(--sl-input-color);
    border: none;
    background: inherit;
    box-shadow: none;
    padding: 0;
    margin: 0;
    cursor: inherit;
    -webkit-appearance: none;
  }

  .input__control::-webkit-search-decoration,
  .input__control::-webkit-search-cancel-button,
  .input__control::-webkit-search-results-button,
  .input__control::-webkit-search-results-decoration {
    -webkit-appearance: none;
  }

  .input__control:-webkit-autofill,
  .input__control:-webkit-autofill:hover,
  .input__control:-webkit-autofill:focus,
  .input__control:-webkit-autofill:active {
    box-shadow: 0 0 0 var(--sl-input-height-large) var(--sl-input-background-color-hover) inset !important;
    -webkit-text-fill-color: var(--sl-color-primary-500);
    caret-color: var(--sl-input-color);
  }

  .input--filled .input__control:-webkit-autofill,
  .input--filled .input__control:-webkit-autofill:hover,
  .input--filled .input__control:-webkit-autofill:focus,
  .input--filled .input__control:-webkit-autofill:active {
    box-shadow: 0 0 0 var(--sl-input-height-large) var(--sl-input-filled-background-color) inset !important;
  }

  .input__control::placeholder {
    color: var(--sl-input-placeholder-color);
    user-select: none;
    -webkit-user-select: none;
  }

  .input:hover:not(.input--disabled) .input__control {
    color: var(--sl-input-color-hover);
  }

  .input__control:focus {
    outline: none;
  }

  .input__prefix,
  .input__suffix {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    cursor: default;
  }

  .input__prefix ::slotted(sl-icon),
  .input__suffix ::slotted(sl-icon) {
    color: var(--sl-input-icon-color);
  }

  /*
   * Size modifiers
   */

  .input--small {
    border-radius: var(--sl-input-border-radius-small);
    font-size: var(--sl-input-font-size-small);
    height: var(--sl-input-height-small);
  }

  .input--small .input__control {
    height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2);
    padding: 0 var(--sl-input-spacing-small);
  }

  .input--small .input__clear,
  .input--small .input__password-toggle {
    width: calc(1em + var(--sl-input-spacing-small) * 2);
  }

  .input--small .input__prefix ::slotted(*) {
    margin-inline-start: var(--sl-input-spacing-small);
  }

  .input--small .input__suffix ::slotted(*) {
    margin-inline-end: var(--sl-input-spacing-small);
  }

  .input--medium {
    border-radius: var(--sl-input-border-radius-medium);
    font-size: var(--sl-input-font-size-medium);
    height: var(--sl-input-height-medium);
  }

  .input--medium .input__control {
    height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2);
    padding: 0 var(--sl-input-spacing-medium);
  }

  .input--medium .input__clear,
  .input--medium .input__password-toggle {
    width: calc(1em + var(--sl-input-spacing-medium) * 2);
  }

  .input--medium .input__prefix ::slotted(*) {
    margin-inline-start: var(--sl-input-spacing-medium);
  }

  .input--medium .input__suffix ::slotted(*) {
    margin-inline-end: var(--sl-input-spacing-medium);
  }

  .input--large {
    border-radius: var(--sl-input-border-radius-large);
    font-size: var(--sl-input-font-size-large);
    height: var(--sl-input-height-large);
  }

  .input--large .input__control {
    height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2);
    padding: 0 var(--sl-input-spacing-large);
  }

  .input--large .input__clear,
  .input--large .input__password-toggle {
    width: calc(1em + var(--sl-input-spacing-large) * 2);
  }

  .input--large .input__prefix ::slotted(*) {
    margin-inline-start: var(--sl-input-spacing-large);
  }

  .input--large .input__suffix ::slotted(*) {
    margin-inline-end: var(--sl-input-spacing-large);
  }

  /*
   * Pill modifier
   */

  .input--pill.input--small {
    border-radius: var(--sl-input-height-small);
  }

  .input--pill.input--medium {
    border-radius: var(--sl-input-height-medium);
  }

  .input--pill.input--large {
    border-radius: var(--sl-input-height-large);
  }

  /*
   * Clearable + Password Toggle
   */

  .input__clear,
  .input__password-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: inherit;
    color: var(--sl-input-icon-color);
    border: none;
    background: none;
    padding: 0;
    transition: var(--sl-transition-fast) color;
    cursor: pointer;
  }

  .input__clear:hover,
  .input__password-toggle:hover {
    color: var(--sl-input-icon-color-hover);
  }

  .input__clear:focus,
  .input__password-toggle:focus {
    outline: none;
  }

  /* Don't show the browser's password toggle in Edge */
  ::-ms-reveal {
    display: none;
  }

  /* Hide the built-in number spinner */
  .input--no-spin-buttons input[type='number']::-webkit-outer-spin-button,
  .input--no-spin-buttons input[type='number']::-webkit-inner-spin-button {
    -webkit-appearance: none;
    display: none;
  }

  .input--no-spin-buttons input[type='number'] {
    -moz-appearance: textfield;
  }
`,_e=p`
  .form-control .form-control__label {
    display: none;
  }

  .form-control .form-control__help-text {
    display: none;
  }

  /* Label */
  .form-control--has-label .form-control__label {
    display: inline-block;
    color: var(--sl-input-label-color);
    margin-bottom: var(--sl-spacing-3x-small);
  }

  .form-control--has-label.form-control--small .form-control__label {
    font-size: var(--sl-input-label-font-size-small);
  }

  .form-control--has-label.form-control--medium .form-control__label {
    font-size: var(--sl-input-label-font-size-medium);
  }

  .form-control--has-label.form-control--large .form-control__label {
    font-size: var(--sl-input-label-font-size-large);
  }

  :host([required]) .form-control--has-label .form-control__label::after {
    content: var(--sl-input-required-content);
    margin-inline-start: var(--sl-input-required-content-offset);
    color: var(--sl-input-required-content-color);
  }

  /* Help text */
  .form-control--has-help-text .form-control__help-text {
    display: block;
    color: var(--sl-input-help-text-color);
    margin-top: var(--sl-spacing-3x-small);
  }

  .form-control--has-help-text.form-control--small .form-control__help-text {
    font-size: var(--sl-input-help-text-font-size-small);
  }

  .form-control--has-help-text.form-control--medium .form-control__help-text {
    font-size: var(--sl-input-help-text-font-size-medium);
  }

  .form-control--has-help-text.form-control--large .form-control__help-text {
    font-size: var(--sl-input-help-text-font-size-large);
  }

  .form-control--has-help-text.form-control--radio-group .form-control__help-text {
    margin-top: var(--sl-spacing-2x-small);
  }
`,$e=Object.defineProperty,et=Object.defineProperties,tt=Object.getOwnPropertyDescriptor,rt=Object.getOwnPropertyDescriptors,it=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,nt=e=>{throw TypeError(e)},at=(e,t,r)=>t in e?$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lt=(e,t)=>{for(var r in t||(t={}))st.call(t,r)&&at(e,r,t[r]);if(it)for(var r of it(t))ot.call(t,r)&&at(e,r,t[r]);return e},ct=(e,t)=>et(e,rt(t)),At=(e,t,r,i)=>{for(var s,o=i>1?void 0:i?tt(t,r):t,n=e.length-1;n>=0;n--)(s=e[n])&&(o=(i?s(t,r,o):s(o))||o);return i&&o&&$e(t,r,o),o},dt=(e,t,r)=>t.has(e)||nt("Cannot "+r),ut=new WeakMap,ht=new WeakMap,pt=new WeakMap,gt=new WeakSet,mt=new WeakMap,vt=class{constructor(e,t){this.handleFormData=e=>{const t=this.options.disabled(this.host),r=this.options.name(this.host),i=this.options.value(this.host),s="sl-button"===this.host.tagName.toLowerCase();this.host.isConnected&&!t&&!s&&"string"==typeof r&&r.length>0&&void 0!==i&&(Array.isArray(i)?i.forEach(t=>{e.formData.append(r,t.toString())}):e.formData.append(r,i.toString()))},this.handleFormSubmit=e=>{var t;const r=this.options.disabled(this.host),i=this.options.reportValidity;this.form&&!this.form.noValidate&&(null==(t=ut.get(this.form))||t.forEach(e=>{this.setUserInteracted(e,!0)})),!this.form||this.form.noValidate||r||i(this.host)||(e.preventDefault(),e.stopImmediatePropagation())},this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),mt.set(this.host,[])},this.handleInteraction=e=>{const t=mt.get(this.host);t.includes(e.type)||t.push(e.type),t.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)},this.checkFormValidity=()=>{if(this.form&&!this.form.noValidate){const e=this.form.querySelectorAll("*");for(const t of e)if("function"==typeof t.checkValidity&&!t.checkValidity())return!1}return!0},this.reportFormValidity=()=>{if(this.form&&!this.form.noValidate){const e=this.form.querySelectorAll("*");for(const t of e)if("function"==typeof t.reportValidity&&!t.reportValidity())return!1}return!0},(this.host=e).addController(this),this.options=lt({form:e=>{const t=e.form;if(t){const r=e.getRootNode().querySelector(`#${t}`);if(r)return r}return e.closest("form")},name:e=>e.name,value:e=>e.value,defaultValue:e=>e.defaultValue,disabled:e=>{var t;return null!=(t=e.disabled)&&t},reportValidity:e=>"function"!=typeof e.reportValidity||e.reportValidity(),checkValidity:e=>"function"!=typeof e.checkValidity||e.checkValidity(),setValue:(e,t)=>e.value=t,assumeInteractionOn:["sl-input"]},t)}hostConnected(){const e=this.options.form(this.host);e&&this.attachForm(e),mt.set(this.host,[]),this.options.assumeInteractionOn.forEach(e=>{this.host.addEventListener(e,this.handleInteraction)})}hostDisconnected(){this.detachForm(),mt.delete(this.host),this.options.assumeInteractionOn.forEach(e=>{this.host.removeEventListener(e,this.handleInteraction)})}hostUpdated(){const e=this.options.form(this.host);e||this.detachForm(),e&&this.form!==e&&(this.detachForm(),this.attachForm(e)),this.host.hasUpdated&&this.setValidity(this.host.validity.valid)}attachForm(e){e?(this.form=e,ut.has(this.form)?ut.get(this.form).add(this.host):ut.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),ht.has(this.form)||(ht.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity()),pt.has(this.form)||(pt.set(this.form,this.form.checkValidity),this.form.checkValidity=()=>this.checkFormValidity())):this.form=void 0}detachForm(){if(!this.form)return;const e=ut.get(this.form);e&&(e.delete(this.host),e.size<=0&&(this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),ht.has(this.form)&&(this.form.reportValidity=ht.get(this.form),ht.delete(this.form)),pt.has(this.form)&&(this.form.checkValidity=pt.get(this.form),pt.delete(this.form)),this.form=void 0))}setUserInteracted(e,t){t?gt.add(e):gt.delete(e),e.requestUpdate()}doAction(e,t){if(this.form){const r=document.createElement("button");r.type=e,r.style.position="absolute",r.style.width="0",r.style.height="0",r.style.clipPath="inset(50%)",r.style.overflow="hidden",r.style.whiteSpace="nowrap",t&&(r.name=t.name,r.value=t.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach(e=>{t.hasAttribute(e)&&r.setAttribute(e,t.getAttribute(e))})),this.form.append(r),r.click(),r.remove()}}getForm(){var e;return null!=(e=this.form)?e:null}reset(e){this.doAction("reset",e)}submit(e){this.doAction("submit",e)}setValidity(e){const t=this.host,r=Boolean(gt.has(t)),i=Boolean(t.required);t.toggleAttribute("data-required",i),t.toggleAttribute("data-optional",!i),t.toggleAttribute("data-invalid",!e),t.toggleAttribute("data-valid",e),t.toggleAttribute("data-user-invalid",!e&&r),t.toggleAttribute("data-user-valid",e&&r)}updateValidity(){const e=this.host;this.setValidity(e.validity.valid)}emitInvalidEvent(e){const t=new CustomEvent("sl-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});e||t.preventDefault(),this.host.dispatchEvent(t)||null==e||e.preventDefault()}},ft=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1});Object.freeze(ct(lt({},ft),{valid:!1,valueMissing:!0})),Object.freeze(ct(lt({},ft),{valid:!1,customError:!0}));var yt=class{constructor(e,...t){this.slotNames=[],this.handleSlotChange=e=>{const t=e.target;(this.slotNames.includes("[default]")&&!t.name||t.name&&this.slotNames.includes(t.name))&&this.host.requestUpdate()},(this.host=e).addController(this),this.slotNames=t}hasDefaultSlot(){return[...this.host.childNodes].some(e=>{if(e.nodeType===e.TEXT_NODE&&""!==e.textContent.trim())return!0;if(e.nodeType===e.ELEMENT_NODE){const t=e;if("sl-visually-hidden"===t.tagName.toLowerCase())return!1;if(!t.hasAttribute("slot"))return!0}return!1})}hasNamedSlot(e){return null!==this.host.querySelector(`:scope > [slot="${e}"]`)}test(e){return"[default]"===e?this.hasDefaultSlot():this.hasNamedSlot(e)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}};const bt=new Set,wt=new Map;let Et,Ct="ltr",It="en";const Bt="undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&void 0!==document.documentElement;if(Bt){const e=new MutationObserver(Pt);Ct=document.documentElement.dir||"ltr",It=document.documentElement.lang||navigator.language,e.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function xt(...e){e.map(e=>{const t=e.$code.toLowerCase();wt.has(t)?wt.set(t,Object.assign(Object.assign({},wt.get(t)),e)):wt.set(t,e),Et||(Et=e)}),Pt()}function Pt(){Bt&&(Ct=document.documentElement.dir||"ltr",It=document.documentElement.lang||navigator.language),[...bt.keys()].map(e=>{"function"==typeof e.requestUpdate&&e.requestUpdate()})}let Dt=class{constructor(e){this.host=e,this.host.addController(this)}hostConnected(){bt.add(this.host)}hostDisconnected(){bt.delete(this.host)}dir(){return`${this.host.dir||Ct}`.toLowerCase()}lang(){return`${this.host.lang||It}`.toLowerCase()}getTranslationData(e){var t,r;let i;try{i=new Intl.Locale(e.replace(/_/g,"-"))}catch(e){return{locale:void 0,language:"",region:"",primary:void 0,secondary:void 0}}const s=i.language.toLowerCase(),o=null!==(r=null===(t=i.region)||void 0===t?void 0:t.toLowerCase())&&void 0!==r?r:"";return{locale:i,language:s,region:o,primary:wt.get(`${s}-${o}`),secondary:wt.get(s)}}exists(e,t){var r;const{primary:i,secondary:s}=this.getTranslationData(null!==(r=t.lang)&&void 0!==r?r:this.lang());return t=Object.assign({includeFallback:!1},t),!!(i&&i[e]||s&&s[e]||t.includeFallback&&Et&&Et[e])}term(e,...t){const{primary:r,secondary:i}=this.getTranslationData(this.lang());let s;if(r&&r[e])s=r[e];else if(i&&i[e])s=i[e];else{if(!Et||!Et[e])return console.error(`No translation found for: ${String(e)}`),String(e);s=Et[e]}return"function"==typeof s?s(...t):s}date(e,t){return e=new Date(e),new Intl.DateTimeFormat(this.lang(),t).format(e)}number(e,t){return e=Number(e),isNaN(e)?"":new Intl.NumberFormat(this.lang(),t).format(e)}relativeTime(e,t,r){return new Intl.RelativeTimeFormat(this.lang(),r).format(e,t)}};var St={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(e,t)=>`Go to slide ${e} of ${t}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:e=>0===e?"No options selected":1===e?"1 option selected":`${e} options selected`,previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:e=>`Slide ${e}`,toggleColorFormat:"Toggle color format"};xt(St);var kt=St,Rt=class extends Dt{};xt(kt);var Qt="";function Mt(e){Qt=e}var Ht={name:"default",resolver:e=>function(e=""){if(!Qt){const e=[...document.getElementsByTagName("script")],t=e.find(e=>e.hasAttribute("data-shoelace"));if(t)Mt(t.getAttribute("data-shoelace"));else{const t=e.find(e=>/shoelace(\.min)?\.js($|\?)/.test(e.src)||/shoelace-autoloader(\.min)?\.js($|\?)/.test(e.src));let r="";t&&(r=t.getAttribute("src")),Mt(r.split("/").slice(0,-1).join("/"))}}return Qt.replace(/\/$/,"")+(e?`/${e.replace(/^\//,"")}`:"")}(`assets/icons/${e}.svg`)},Ot={caret:'\n    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n      <polyline points="6 9 12 15 18 9"></polyline>\n    </svg>\n  ',check:'\n    <svg part="checked-icon" class="checkbox__icon" viewBox="0 0 16 16">\n      <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n        <g stroke="currentColor">\n          <g transform="translate(3.428571, 3.428571)">\n            <path d="M0,5.71428571 L3.42857143,9.14285714"></path>\n            <path d="M9.14285714,0 L3.42857143,9.14285714"></path>\n          </g>\n        </g>\n      </g>\n    </svg>\n  ',"chevron-down":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\n      <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>\n    </svg>\n  ',"chevron-left":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16">\n      <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/>\n    </svg>\n  ',"chevron-right":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">\n      <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/>\n    </svg>\n  ',copy:'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16">\n      <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2Zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6ZM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1H2Z"/>\n    </svg>\n  ',eye:'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16">\n      <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>\n      <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>\n    </svg>\n  ',"eye-slash":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16">\n      <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/>\n      <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>\n      <path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/>\n    </svg>\n  ',eyedropper:'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eyedropper" viewBox="0 0 16 16">\n      <path d="M13.354.646a1.207 1.207 0 0 0-1.708 0L8.5 3.793l-.646-.647a.5.5 0 1 0-.708.708L8.293 5l-7.147 7.146A.5.5 0 0 0 1 12.5v1.793l-.854.853a.5.5 0 1 0 .708.707L1.707 15H3.5a.5.5 0 0 0 .354-.146L11 7.707l1.146 1.147a.5.5 0 0 0 .708-.708l-.647-.646 3.147-3.146a1.207 1.207 0 0 0 0-1.708l-2-2zM2 12.707l7-7L10.293 7l-7 7H2v-1.293z"></path>\n    </svg>\n  ',"grip-vertical":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grip-vertical" viewBox="0 0 16 16">\n      <path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path>\n    </svg>\n  ',indeterminate:'\n    <svg part="indeterminate-icon" class="checkbox__icon" viewBox="0 0 16 16">\n      <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n        <g stroke="currentColor" stroke-width="2">\n          <g transform="translate(2.285714, 6.857143)">\n            <path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path>\n          </g>\n        </g>\n      </g>\n    </svg>\n  ',"person-fill":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">\n      <path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>\n    </svg>\n  ',"play-fill":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16">\n      <path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path>\n    </svg>\n  ',"pause-fill":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause-fill" viewBox="0 0 16 16">\n      <path d="M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z"></path>\n    </svg>\n  ',radio:'\n    <svg part="checked-icon" class="radio__icon" viewBox="0 0 16 16">\n      <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n        <g fill="currentColor">\n          <circle cx="8" cy="8" r="3.42857143"></circle>\n        </g>\n      </g>\n    </svg>\n  ',"star-fill":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">\n      <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>\n    </svg>\n  ',"x-lg":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16">\n      <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>\n    </svg>\n  ',"x-circle-fill":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16">\n      <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"></path>\n    </svg>\n  '},Tt=[Ht,{name:"system",resolver:e=>e in Ot?`data:image/svg+xml,${encodeURIComponent(Ot[e])}`:""}],Lt=[];function qt(e){return Tt.find(t=>t.name===e)}var Ut=p`
  :host {
    display: inline-block;
    width: 1em;
    height: 1em;
    box-sizing: content-box !important;
  }

  svg {
    display: block;
    height: 100%;
    width: 100%;
  }
`;function Ft(e,t){const r=lt({waitUntilFirstUpdate:!1},t);return(t,i)=>{const{update:s}=t,o=Array.isArray(e)?e:[e];t.update=function(e){o.forEach(t=>{const s=t;if(e.has(s)){const t=e.get(s),o=this[s];t!==o&&(r.waitUntilFirstUpdate&&!this.hasUpdated||this[i](t,o))}}),s.call(this,e)}}}var Vt,zt=p`
  :host {
    box-sizing: border-box;
  }

  :host *,
  :host *::before,
  :host *::after {
    box-sizing: inherit;
  }

  [hidden] {
    display: none !important;
  }
`,Jt=class extends me{constructor(){var e,t,r;super(),e=this,r=!1,(t=Vt).has(e)?nt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),this.initialReflectedProperties=new Map,Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}emit(e,t){const r=new CustomEvent(e,lt({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(r),r}static define(e,t=this,r={}){const i=customElements.get(e);if(!i){try{customElements.define(e,t,r)}catch(i){customElements.define(e,class extends t{},r)}return}let s=" (unknown version)",o=s;"version"in t&&t.version&&(s=" v"+t.version),"version"in i&&i.version&&(o=" v"+i.version),s&&o&&s===o||console.warn(`Attempted to register <${e}>${s}, but <${e}>${o} has already been registered.`)}attributeChangedCallback(e,t,r){var i,s;dt(i=this,s=Vt,"read from private field"),s.get(i)||(this.constructor.elementProperties.forEach((e,t)=>{e.reflect&&null!=this[t]&&this.initialReflectedProperties.set(t,this[t])}),((e,t,r)=>{dt(e,t,"write to private field"),t.set(e,r)})(this,Vt,!0)),super.attributeChangedCallback(e,t,r)}willUpdate(e){super.willUpdate(e),this.initialReflectedProperties.forEach((t,r)=>{e.has(r)&&null==this[r]&&(this[r]=t)})}};Vt=new WeakMap,Jt.version="2.20.1",Jt.dependencies={},At([xe()],Jt.prototype,"dir",2),At([xe()],Jt.prototype,"lang",2);var Yt,Nt=Symbol(),Xt=Symbol(),jt=new Map,Kt=class extends Jt{constructor(){super(...arguments),this.initialRender=!1,this.svg=null,this.label="",this.library="default"}async resolveIcon(e,t){var r;let i;if(null==t?void 0:t.spriteSheet)return this.svg=Z`<svg part="svg">
        <use part="use" href="${e}"></use>
      </svg>`,this.svg;try{if(i=await fetch(e,{mode:"cors"}),!i.ok)return 410===i.status?Nt:Xt}catch(e){return Xt}try{const e=document.createElement("div");e.innerHTML=await i.text();const t=e.firstElementChild;if("svg"!==(null==(r=null==t?void 0:t.tagName)?void 0:r.toLowerCase()))return Nt;Yt||(Yt=new DOMParser);const s=Yt.parseFromString(t.outerHTML,"text/html").body.querySelector("svg");return s?(s.part.add("svg"),document.adoptNode(s)):Nt}catch(e){return Nt}}connectedCallback(){var e;super.connectedCallback(),e=this,Lt.push(e)}firstUpdated(){this.initialRender=!0,this.setIcon()}disconnectedCallback(){var e;super.disconnectedCallback(),e=this,Lt=Lt.filter(t=>t!==e)}getIconSource(){const e=qt(this.library);return this.name&&e?{url:e.resolver(this.name),fromLibrary:!0}:{url:this.src,fromLibrary:!1}}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var e;const{url:t,fromLibrary:r}=this.getIconSource(),i=r?qt(this.library):void 0;if(!t)return void(this.svg=null);let s=jt.get(t);if(s||(s=this.resolveIcon(t,i),jt.set(t,s)),!this.initialRender)return;const o=await s;if(o===Xt&&jt.delete(t),t===this.getIconSource().url)if(Fe(o)){if(this.svg=o,i){await this.updateComplete;const e=this.shadowRoot.querySelector("[part='svg']");"function"==typeof i.mutator&&e&&i.mutator(e)}}else switch(o){case Xt:case Nt:this.svg=null,this.emit("sl-error");break;default:this.svg=o.cloneNode(!0),null==(e=null==i?void 0:i.mutator)||e.call(i,this.svg),this.emit("sl-load")}}render(){return this.svg}};Kt.styles=[zt,Ut],At([Pe()],Kt.prototype,"svg",2),At([xe({reflect:!0})],Kt.prototype,"name",2),At([xe()],Kt.prototype,"src",2),At([xe()],Kt.prototype,"label",2),At([xe({reflect:!0})],Kt.prototype,"library",2),At([Ft("label")],Kt.prototype,"handleLabelChange",1),At([Ft(["name","src","library"])],Kt.prototype,"setIcon",1);
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const Gt=Te(class extends Le{constructor(e){if(super(e),e.type!==Qe||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e)));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const r=e.element.classList;for(const e of this.st)e in t||(r.remove(e),this.st.delete(e));for(const e in t){const i=!!t[e];i===this.st.has(e)||this.nt?.has(e)||(i?(r.add(e),this.st.add(e)):(r.remove(e),this.st.delete(e)))}return _}}),Wt=e=>e??$,Zt=Te(class extends Le{constructor(e){if(super(e),e.type!==He&&e.type!==Qe&&e.type!==Oe)throw Error("The `live` directive is not allowed on child or event bindings");if(!Ve(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===_||t===$)return t;const r=e.element,i=e.name;if(e.type===He){if(t===r[i])return _}else if(e.type===Oe){if(!!t===r.hasAttribute(i))return _}else if(e.type===Qe&&r.getAttribute(i)===t+"")return _;return Xe(e),t}});
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */var _t,$t,er,tr,rr,ir,sr,or,nr=class extends Jt{constructor(){super(...arguments),this.formControlController=new vt(this,{assumeInteractionOn:["sl-blur","sl-input"]}),this.hasSlotController=new yt(this,"help-text","label"),this.localize=new Rt(this),this.hasFocus=!1,this.title="",this.__numberInput=Object.assign(document.createElement("input"),{type:"number"}),this.__dateInput=Object.assign(document.createElement("input"),{type:"date"}),this.type="text",this.name="",this.value="",this.defaultValue="",this.size="medium",this.filled=!1,this.pill=!1,this.label="",this.helpText="",this.clearable=!1,this.disabled=!1,this.placeholder="",this.readonly=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.noSpinButtons=!1,this.form="",this.required=!1,this.spellcheck=!0}get valueAsDate(){var e;return this.__dateInput.type=this.type,this.__dateInput.value=this.value,(null==(e=this.input)?void 0:e.valueAsDate)||this.__dateInput.valueAsDate}set valueAsDate(e){this.__dateInput.type=this.type,this.__dateInput.valueAsDate=e,this.value=this.__dateInput.value}get valueAsNumber(){var e;return this.__numberInput.value=this.value,(null==(e=this.input)?void 0:e.valueAsNumber)||this.__numberInput.valueAsNumber}set valueAsNumber(e){this.__numberInput.valueAsNumber=e,this.value=this.__numberInput.value}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleChange(){this.value=this.input.value,this.emit("sl-change")}handleClearClick(e){e.preventDefault(),""!==this.value&&(this.value="",this.emit("sl-clear"),this.emit("sl-input"),this.emit("sl-change")),this.input.focus()}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleInput(){this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sl-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e)}handleKeyDown(e){const t=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;"Enter"!==e.key||t||setTimeout(()=>{e.defaultPrevented||e.isComposing||this.formControlController.submit()})}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(e){this.input.focus(e)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(e,t,r="none"){this.input.setSelectionRange(e,t,r)}setRangeText(e,t,r,i="preserve"){const s=null!=t?t:this.input.selectionStart,o=null!=r?r:this.input.selectionEnd;this.input.setRangeText(e,s,o,i),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){const e=this.hasSlotController.test("label"),t=this.hasSlotController.test("help-text"),r=!!this.label||!!e,i=!!this.helpText||!!t,s=this.clearable&&!this.disabled&&!this.readonly&&("number"==typeof this.value||this.value.length>0);return Z`
      <div
        part="form-control"
        class=${Gt({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-label":r,"form-control--has-help-text":i})}
      >
        <label
          part="form-control-label"
          class="form-control__label"
          for="input"
          aria-hidden=${r?"false":"true"}
        >
          <slot name="label">${this.label}</slot>
        </label>

        <div part="form-control-input" class="form-control-input">
          <div
            part="base"
            class=${Gt({input:!0,"input--small":"small"===this.size,"input--medium":"medium"===this.size,"input--large":"large"===this.size,"input--pill":this.pill,"input--standard":!this.filled,"input--filled":this.filled,"input--disabled":this.disabled,"input--focused":this.hasFocus,"input--empty":!this.value,"input--no-spin-buttons":this.noSpinButtons})}
          >
            <span part="prefix" class="input__prefix">
              <slot name="prefix"></slot>
            </span>

            <input
              part="input"
              id="input"
              class="input__control"
              type=${"password"===this.type&&this.passwordVisible?"text":this.type}
              title=${this.title}
              name=${Wt(this.name)}
              ?disabled=${this.disabled}
              ?readonly=${this.readonly}
              ?required=${this.required}
              placeholder=${Wt(this.placeholder)}
              minlength=${Wt(this.minlength)}
              maxlength=${Wt(this.maxlength)}
              min=${Wt(this.min)}
              max=${Wt(this.max)}
              step=${Wt(this.step)}
              .value=${Zt(this.value)}
              autocapitalize=${Wt(this.autocapitalize)}
              autocomplete=${Wt(this.autocomplete)}
              autocorrect=${Wt(this.autocorrect)}
              ?autofocus=${this.autofocus}
              spellcheck=${this.spellcheck}
              pattern=${Wt(this.pattern)}
              enterkeyhint=${Wt(this.enterkeyhint)}
              inputmode=${Wt(this.inputmode)}
              aria-describedby="help-text"
              @change=${this.handleChange}
              @input=${this.handleInput}
              @invalid=${this.handleInvalid}
              @keydown=${this.handleKeyDown}
              @focus=${this.handleFocus}
              @blur=${this.handleBlur}
            />

            ${s?Z`
                  <button
                    part="clear-button"
                    class="input__clear"
                    type="button"
                    aria-label=${this.localize.term("clearEntry")}
                    @click=${this.handleClearClick}
                    tabindex="-1"
                  >
                    <slot name="clear-icon">
                      <sl-icon name="x-circle-fill" library="system"></sl-icon>
                    </slot>
                  </button>
                `:""}
            ${this.passwordToggle&&!this.disabled?Z`
                  <button
                    part="password-toggle-button"
                    class="input__password-toggle"
                    type="button"
                    aria-label=${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}
                    @click=${this.handlePasswordToggle}
                    tabindex="-1"
                  >
                    ${this.passwordVisible?Z`
                          <slot name="show-password-icon">
                            <sl-icon name="eye-slash" library="system"></sl-icon>
                          </slot>
                        `:Z`
                          <slot name="hide-password-icon">
                            <sl-icon name="eye" library="system"></sl-icon>
                          </slot>
                        `}
                  </button>
                `:""}

            <span part="suffix" class="input__suffix">
              <slot name="suffix"></slot>
            </span>
          </div>
        </div>

        <div
          part="form-control-help-text"
          id="help-text"
          class="form-control__help-text"
          aria-hidden=${i?"false":"true"}
        >
          <slot name="help-text">${this.helpText}</slot>
        </div>
      </div>
    `}};nr.styles=[zt,_e,Ze],nr.dependencies={"sl-icon":Kt},At([Se(".input__control")],nr.prototype,"input",2),At([Pe()],nr.prototype,"hasFocus",2),At([xe()],nr.prototype,"title",2),At([xe({reflect:!0})],nr.prototype,"type",2),At([xe()],nr.prototype,"name",2),At([xe()],nr.prototype,"value",2),At([((e="value")=>(t,r)=>{const i=t.constructor,s=i.prototype.attributeChangedCallback;i.prototype.attributeChangedCallback=function(t,o,n){var a;const l=i.getPropertyOptions(e);if(t===("string"==typeof l.attribute?l.attribute:e)){const t=l.converter||P,i=("function"==typeof t?t:null!=(a=null==t?void 0:t.fromAttribute)?a:P.fromAttribute)(n,l.type);this[e]!==i&&(this[r]=i)}s.call(this,t,o,n)}})()],nr.prototype,"defaultValue",2),At([xe({reflect:!0})],nr.prototype,"size",2),At([xe({type:Boolean,reflect:!0})],nr.prototype,"filled",2),At([xe({type:Boolean,reflect:!0})],nr.prototype,"pill",2),At([xe()],nr.prototype,"label",2),At([xe({attribute:"help-text"})],nr.prototype,"helpText",2),At([xe({type:Boolean})],nr.prototype,"clearable",2),At([xe({type:Boolean,reflect:!0})],nr.prototype,"disabled",2),At([xe()],nr.prototype,"placeholder",2),At([xe({type:Boolean,reflect:!0})],nr.prototype,"readonly",2),At([xe({attribute:"password-toggle",type:Boolean})],nr.prototype,"passwordToggle",2),At([xe({attribute:"password-visible",type:Boolean})],nr.prototype,"passwordVisible",2),At([xe({attribute:"no-spin-buttons",type:Boolean})],nr.prototype,"noSpinButtons",2),At([xe({reflect:!0})],nr.prototype,"form",2),At([xe({type:Boolean,reflect:!0})],nr.prototype,"required",2),At([xe()],nr.prototype,"pattern",2),At([xe({type:Number})],nr.prototype,"minlength",2),At([xe({type:Number})],nr.prototype,"maxlength",2),At([xe()],nr.prototype,"min",2),At([xe()],nr.prototype,"max",2),At([xe()],nr.prototype,"step",2),At([xe()],nr.prototype,"autocapitalize",2),At([xe()],nr.prototype,"autocorrect",2),At([xe()],nr.prototype,"autocomplete",2),At([xe({type:Boolean})],nr.prototype,"autofocus",2),At([xe()],nr.prototype,"enterkeyhint",2),At([xe({type:Boolean,converter:{fromAttribute:e=>!(!e||"false"===e),toAttribute:e=>e?"true":"false"}})],nr.prototype,"spellcheck",2),At([xe()],nr.prototype,"inputmode",2),At([Ft("disabled",{waitUntilFirstUpdate:!0})],nr.prototype,"handleDisabledChange",1),At([Ft("step",{waitUntilFirstUpdate:!0})],nr.prototype,"handleStepChange",1),At([Ft("value",{waitUntilFirstUpdate:!0})],nr.prototype,"handleValueChange",1),nr.define("sl-input"),function(e){e.Filled="filled",e.FilledVariant="filled-variant",e.Plain="plain",e.Standard="standard",e.Tonal="tonal",e.Variant="variant"}(_t||(_t={})),function(e){e.PLAY_NOW="play",e.PLAY_NOW_CLEAR_QUEUE="replace",e.PLAY_NEXT="next",e.PLAY_NEXT_CLEAR_QUEUE="replace_next",e.ADD_TO_QUEUE="add",e.RADIO="radio"}($t||($t={})),function(e){e.ALBUM="album",e.ARTIST="artist",e.AUDIOBOOK="audiobook",e.PLAYLIST="playlist",e.PODCAST="podcast",e.TRACK="track",e.RADIO="radio"}(er||(er={})),function(e){e.OFF="off",e.ONCE="one",e.ALL="all"}(tr||(tr={})),function(e){e.QUEUE="queue",e.MUSIC_PLAYER="music-player",e.PLAYERS="players",e.MEDIA_BROWSER="media-browser"}(rr||(rr={})),function(e){e.BOOK="book",e.CLEFT="cleft",e.DISC="disc",e.HEADPHONES="headphones",e.MICROPHONE="microphone",e.MICROPHONE_MAGIC="microphone_magic",e.PERSON="person",e.PLAYLIST="playlist",e.RADIO="radio"}(ir||(ir={})),function(e){e[e.CLICK=5]="CLICK",e[e.VERY_SHORT=25]="VERY_SHORT",e[e.SHORT=75]="SHORT",e[e.MEDIUM=150]="MEDIUM",e[e.LONG=300]="LONG",e[e.VERY_LONG=500]="VERY_LONG"}(sr||(sr={})),function(e){e[e.PAUSE=-1]="PAUSE",e[e.SEEK=-2]="SEEK",e[e.VOLUME_SET=-3]="VOLUME_SET",e[e.VOLUME_MUTE=-4]="VOLUME_MUTE",e[e.PREVIOUS_TRACK=-5]="PREVIOUS_TRACK",e[e.NEXT_TRACK=-6]="NEXT_TRACK",e[e.TURN_ON=-8]="TURN_ON",e[e.TURN_OFF=-9]="TURN_OFF",e[e.PLAY_MEDIA=-10]="PLAY_MEDIA",e[e.VOLUME_STEP=-11]="VOLUME_STEP",e[e.SELECT_SOURCE=-12]="SELECT_SOURCE",e[e.STOP=-13]="STOP",e[e.CLEAR_PLAYLIST=-14]="CLEAR_PLAYLIST",e[e.PLAY=-15]="PLAY",e[e.SHUFFLE_SET=-16]="SHUFFLE_SET",e[e.SELECT_SOUND_MODE=-17]="SELECT_SOUND_MODE",e[e.BROWSE_MEDIA=-18]="BROWSE_MEDIA",e[e.REPEAT_SET=-19]="REPEAT_SET",e[e.GROUPING=-20]="GROUPING",e[e.MEDIA_ANNOUNCE=-21]="MEDIA_ANNOUNCE",e[e.MEDIA_ENQUEUE=-22]="MEDIA_ENQUEUE",e[e.SEARCH_MEDIA=-23]="SEARCH_MEDIA"}(or||(or={}));const ar={ca:{"browser.card.favorites":"Preferits","browser.card.recents":"Recents","browser.card.recommendations":"Recomanacions","browser.collections.track_count":"peces","browser.collections.playlist.unknown_owner":"Desconegut","browser.collections.podcast.episodes":"episodis","browser.enqueue.play":"Reprodueix ara","browser.enqueue.next":"Reprodueix a continuació","browser.enqueue.play_clear":"Reprodueix ara i buida la cua","browser.enqueue.next_clear":"Reprodueix a continuació i buida la cua","browser.enqueue.queue":"Afegeix a la cua","browser.enqueue.radio":"Reprodueix la ràdio","browser.loading":"S'està carregant…","browser.search.placeholder":"Cerca al Music Assistant","browser.sections.album":"Àlbums","browser.sections.artist":"Artistes","browser.sections.audiobook":"Audiollibres","browser.sections.playlist":"Llistes de reproducció","browser.sections.podcast":"Podcasts","browser.sections.radio":"Ràdios","browser.sections.track":"Peces","browser.playlists.remove_track":"Suprimeix de la llista de reproducció","player.controls.power":"Engega/Apaga","player.controls.shuffle":"Aleatori","player.controls.repeat":"Repeteix","player.controls.favorite":"Preferit","player.controls.previous":"Anterior","player.controls.play":"Reprodueix","player.controls.pause":"Pausa","player.controls.play_pause":"Reprodueix/Pausa","player.controls.next":"Següent","player.header":"Reproductor multimèdia","player.messages.inactive":["Tot bé, tret del so del silenci.","Quin silenci que hi ha, aquí!","Estàs sortint amb altres reproductors?","Si us plau, no em deixis sol amb els meus pensaments.","Espero que no tinguis acúfens.","Per què no fem alguna cosa productiva, per variar?","Fem servir la imaginació, millor."],"player.title.inactive":"Ara mateix no hi ha res actiu!","players.header":"Reproductors","queue.header":"Cua","player.playlist_dialog.header":"Afegeix a la llista de reproducció"},de:{"browser.card.favorites":"Favoriten","browser.card.recents":"Zuletzt verwendet","browser.card.recommendations":"Empfehlungen","browser.collections.track_count":"Titel","browser.collections.playlist.unknown_owner":"Unbekannt","browser.collections.podcast.episodes":"Folgen","browser.enqueue.play":"Jetzt abspielen","browser.enqueue.next":"Als Nächstes abspielen","browser.enqueue.play_clear":"Jetzt abspielen & Warteschlange leeren","browser.enqueue.next_clear":"Als Nächstes abspielen & Warteschlange leeren","browser.enqueue.queue":"Zur Warteschlange hinzufügen","browser.enqueue.radio":"Radio abspielen","browser.loading":"Wird geladen...","browser.search.placeholder":"Music Assistant durchsuchen","browser.sections.album":"Alben","browser.sections.artist":"Künstler","browser.sections.audiobook":"Hörbücher","browser.sections.playlist":"Wiedergabelisten","browser.sections.podcast":"Podcasts","browser.sections.radio":"Radios","browser.sections.track":"Titel","browser.playlists.remove_track":"Aus Playlist entfernen","player.controls.power":"Ein/Aus","player.controls.shuffle":"Zufällige Wiedergabe","player.controls.repeat":"Wiederholen","player.controls.favorite":"Favorit","player.controls.previous":"Favorit","player.controls.play":"Abspielen","player.controls.pause":"Pausieren","player.controls.play_pause":"Abspielen/Pausieren","player.controls.next":"Nächster","player.header":"Medienplayer","player.messages.inactive":["Außer dem Klang der Stille.","Es ist hier einfach so ruhig.","Siehst du andere Player?","Bitte lass mich nicht mit meinen Gedanken allein.","Ich hoffe, du hast keinen Tinnitus.","Warum nicht etwas Produktives tun?","Lass uns stattdessen unsere Fantasie nutzen."],"player.title.inactive":"Derzeit ist nichts aktiv!","players.header":"Player","queue.header":"Warteschlange","player.playlist_dialog.header":"Zur Wiedergabeliste hinzufügen"},en:{"browser.card.favorites":"Favorites","browser.card.recents":"Recents","browser.card.recommendations":"Recommendations","browser.collections.track_count":"tracks","browser.collections.playlist.unknown_owner":"Unknown","browser.collections.podcast.episodes":"episodes","browser.enqueue.play":"Play Now","browser.enqueue.next":"Play Next","browser.enqueue.play_clear":"Play Now & Clear Queue","browser.enqueue.next_clear":"Play Next & Clear Queue","browser.enqueue.queue":"Add to Queue","browser.enqueue.radio":"Play Radio","browser.loading":"Loading...","browser.search.placeholder":"Search Music Assistant","browser.sections.album":"Albums","browser.sections.artist":"Artists","browser.sections.audiobook":"Audiobooks","browser.sections.playlist":"Playlists","browser.sections.podcast":"Podcasts","browser.sections.radio":"Radios","browser.sections.track":"Tracks","browser.playlists.remove_track":"Remove from Playlist","player.controls.power":"Power","player.controls.shuffle":"Shuffle","player.controls.repeat":"Repeat","player.controls.favorite":"Favorite","player.controls.previous":"Previous","player.controls.play":"Play","player.controls.pause":"Pause","player.controls.play_pause":"Play/Pause","player.controls.next":"Next","player.header":"Media Player","player.messages.inactive":["Except the sound of silence.","It's just so quiet in here.","Are you seeing other players?","Please don't leave me alone with my thoughts.","I hope you don't have tinnitus.","Why not do something productive instead?","Let's use our imagination instead."],"player.title.inactive":"Nothing is currently active!","players.header":"Players","queue.header":"Queue","player.playlist_dialog.header":"Add to Playlist"},es:{"browser.card.favorites":"Favoritos","browser.card.recents":"Recientes","browser.card.recommendations":"Recomendaciones","browser.collections.track_count":"pistas","browser.collections.playlist.unknown_owner":"Desconocido","browser.collections.podcast.episodes":"episodios","browser.enqueue.play":"Reproducir ahora","browser.enqueue.next":"Reproducir a continuación","browser.enqueue.play_clear":"Reproducir ahora y vaciar cola de reproducción","browser.enqueue.next_clear":"Reproducir a continuación y vaciar cola de reproducción","browser.enqueue.queue":"Agregar a la cola de reproducción","browser.enqueue.radio":"Reproducir radio","browser.loading":"Cargando...","browser.search.placeholder":"Buscar en Music Assistant","browser.sections.album":"Álbumes","browser.sections.artist":"Artistas","browser.sections.audiobook":"Audiolibros","browser.sections.playlist":"Listas de reproducción","browser.sections.podcast":"Podcasts","browser.sections.radio":"Radios","browser.sections.track":"Pistas","browser.playlists.remove_track":"Eliminar de la lista de reproducción","player.controls.power":"Encendido","player.controls.shuffle":"Aleatorio","player.controls.repeat":"Repetir","player.controls.favorite":"Favorito","player.controls.previous":"Anterior","player.controls.play":"Reproducir","player.controls.pause":"Pausar","player.controls.play_pause":"Reproducir/Pausar","player.controls.next":"Siguiente","player.header":"Reproductor de medios","player.messages.inactive":["Excepto el sonido del silencio.","Está demasiado silencioso aquí.","¿Estás viendo a otros reproductores?","Por favor, no me dejes a solas con mis pensamientos.","Espero que no tengas tinnitus.","¿Por qué no haces algo productivo en su lugar?","Mejor usemos nuestra imaginación."],"player.title.inactive":"¡No hay nada activo en este momento!","players.header":"Reproductores","queue.header":"Cola de reproducción","player.playlist_dialog.header":"Agregar a la lista de reproducción"},fr:{"browser.card.favorites":"Favoris","browser.card.recents":"Récents","browser.card.recommendations":"Recommandations","browser.enqueue.play":"Lire","browser.enqueue.next":"Lire suivant","browser.enqueue.play_clear":"Lire et vider la file","browser.enqueue.next_clear":"Lire suivant et vider la file","browser.enqueue.queue":"Ajouter à la file","browser.enqueue.radio":"Lancer la radio","browser.search.placeholder":"Rechercher dans Music Assistant","browser.sections.album":"Albums","browser.sections.artist":"Artistes","browser.sections.audiobook":"Livres audio","browser.sections.playlist":"Playlists","browser.sections.podcast":"Podcasts","browser.sections.radio":"Radios","browser.sections.track":"Titres","player.controls.power":"On/Off","player.controls.shuffle":"Shuffle","player.controls.repeat":"Répéter","player.controls.favorite":"Favori","player.controls.previous":"Précédent","player.controls.play":"Lecture","player.controls.pause":"Pause","player.controls.play_pause":"Lecture/Pause","player.controls.next":"Suivant","player.header":"Lecteur multimédia","player.messages.inactive":["Seulement le son du silence.","C’est tellement calme ici.","Tu vois d’autres lecteurs ?","Ne me laisse pas seul avec mes pensées.","J’espère que tu n’as pas d’acouphènes.","Et si on faisait quelque chose d’utile à la place ?","Utilisons notre imagination, tiens."],"player.title.inactive":"Aucune lecture en cours !","players.header":"Appareils","queue.header":"File d’attente"},it:{"browser.card.favorites":"Preferiti","browser.card.recents":"Recenti","browser.card.recommendations":"Consigliati","browser.collections.track_count":"brani","browser.collections.playlist.unknown_owner":"Sconosciuto","browser.collections.podcast.episodes":"episodi","browser.enqueue.play":"Riproduci adesso","browser.enqueue.next":"Riproduci successivamente","browser.enqueue.play_clear":"Riproduci adesso e svuota coda di riproduzione","browser.enqueue.next_clear":"Riproduci successivamente e svuota coda di riproduzione","browser.enqueue.queue":"Aggiungi alla coda di riproduzione","browser.enqueue.radio":"Riproduci radio","browser.loading":"Caricamento...","browser.search.placeholder":"Cerca in Music Assistant","browser.sections.album":"Album","browser.sections.artist":"Artisti","browser.sections.audiobook":"Audiolibri","browser.sections.playlist":"Playlist","browser.sections.podcast":"Podcast","browser.sections.radio":"Radio","browser.sections.track":"Brani","browser.playlists.remove_track":"Rimuovi dalla playlist","player.controls.power":"Accensione","player.controls.shuffle":"Riproduzione casuale","player.controls.repeat":"Ripeti","player.controls.favorite":"Preferito","player.controls.previous":"Precedente","player.controls.play":"Riproduci","player.controls.pause":"Pausa","player.controls.play_pause":"Riproduci/Pausa","player.controls.next":"Successivo","player.header":"Lettore multimediale","player.messages.inactive":["Tranne il suono del silenzio.","C'è un silenzio assordante qui.","Stai frequentando altri lettori?","Per favore, non lasciarmi solo con i miei pensieri.","Spero tu non soffra di acufene.","Perché non fai qualcosa di produttivo invece?","Usiamo l'immaginazione, piuttosto."],"player.title.inactive":"Non c'è nulla in riproduzione al momento!","players.header":"Lettori","queue.header":"Coda di riproduzione","player.playlist_dialog.header":"Aggiungi alla playlist"},nl:{"browser.card.favorites":"Favorieten","browser.card.recents":"Recent afgespeeld","browser.card.recommendations":"Aanbevelingen","browser.enqueue.play":"Nu afspelen","browser.enqueue.next":"Volgende afspelen","browser.enqueue.play_clear":"Nu afspelen & wachtrij wissen","browser.enqueue.next_clear":"Volgende afspelen & wachtrij wissen","browser.enqueue.queue":"Toevoegen aan wachtrij","browser.enqueue.radio":"Radio afspelen","browser.search.placeholder":"Zoek in Music Assistant","browser.sections.album":"Albums","browser.sections.artist":"Artiesten","browser.sections.audiobook":"Luisterboeken","browser.sections.playlist":"Afspeellijsten","browser.sections.podcast":"Podcasts","browser.sections.radio":"Radiozenders","browser.sections.track":"Nummers","player.controls.power":"Power","player.controls.shuffle":"Random","player.controls.repeat":"Herhalen","player.controls.favorite":"Favoriet","player.controls.previous":"Vorige","player.controls.play":"Afspelen","player.controls.pause":"Pauze","player.controls.play_pause":"Afspelen/Pauzeren","player.controls.next":"Volgende","player.header":"Mediaspeler","player.messages.inactive":["Behalve het geluid van stilte.","Het is hier zo stil.","Zie je andere spelers?","Laat me niet alleen met mijn gedachten.","Hopelijk heb je geen oorsuizen.","Waarom niet iets productiefs doen?","Laten we onze verbeelding gebruiken."],"player.title.inactive":"Er is momenteel niets actief!","players.header":"Spelers","queue.header":"Wachtrij"},pt:{"browser.card.favorites":"Favoritos","browser.card.recents":"Recentes","browser.card.recommendations":"Recomendações","browser.enqueue.play":"Reproduzir Agora","browser.enqueue.next":"Reproduzir Seguinte","browser.enqueue.play_clear":"Reproduzir Agora e Limpar Fila","browser.enqueue.next_clear":"Reproduzir Seguinte e Limpar Fila","browser.enqueue.queue":"Adicionar à Fila","browser.enqueue.radio":"Reproduzir Rádio","browser.search.placeholder":"Pesquisar Music Assistant","browser.sections.album":"Álbuns","browser.sections.artist":"Artistas","browser.sections.audiobook":"Audiolivros","browser.sections.playlist":"Listas de Reprodução","browser.sections.podcast":"Podcasts","browser.sections.radio":"Rádios","browser.sections.track":"Faixas","player.controls.power":"On/Off","player.controls.shuffle":"Aleatório","player.controls.repeat":"Repetir","player.controls.favorite":"Favorito","player.controls.previous":"Anterior","player.controls.play":"Reproduzir","player.controls.pause":"Pausar","player.controls.play_pause":"Reproduzir/Pausar","player.controls.next":"Seguinte","player.header":"Leitor Multimédia","player.messages.inactive":["Excepto o som do silêncio.","Está tão silencioso aqui.","Estás a ver outros leitores?","Por favor, não me deixes sozinho com os meus pensamentos.","Espero que não tenhas zumbidos no ouvido.","Porque não fazer algo produtivo?","Vamos usar a nossa imaginação."],"player.title.inactive":"Não há nada activo!","players.header":"Leitores","queue.header":"Fila"}},lr=ar.en;function cr(e,t){const r=ar[t?.language??"en"]??lr,i=lr[e]??e;return r[e]??i}const Ar={album:ir.DISC,artist:ir.PERSON,audiobook:ir.BOOK,playlist:ir.PLAYLIST,podcast:ir.MICROPHONE_MAGIC,track:ir.CLEFT,radio:ir.RADIO};function dr(e,t){return[{option:$t.PLAY_NOW,icon:e.PLAY_CIRCLE_OUTLINE,title:cr("browser.enqueue.play",t)},{option:$t.PLAY_NEXT,icon:e.SKIP_NEXT_CIRCLE_OUTLINED,title:cr("browser.enqueue.next",t)},{option:$t.PLAY_NOW_CLEAR_QUEUE,icon:e.PLAY_CIRCLE,title:cr("browser.enqueue.play_clear",t)},{option:$t.PLAY_NEXT_CLEAR_QUEUE,icon:e.SKIP_NEXT_CIRCLE,title:cr("browser.enqueue.next_clear",t)},{option:$t.ADD_TO_QUEUE,icon:e.PLAYLIST_PLUS,title:cr("browser.enqueue.queue",t)},{option:$t.RADIO,icon:e.RADIO,title:cr("browser.enqueue.radio",t)}]}function ur(e,t){return[{option:er.ALBUM,icon:e.ALBUM,title:cr("browser.sections.album",t)},{option:er.ARTIST,icon:e.ARTIST,title:cr("browser.sections.artist",t)},{option:er.AUDIOBOOK,icon:e.BOOK,title:cr("browser.sections.audiobook",t)},{option:er.PLAYLIST,icon:e.PLAYLIST,title:cr("browser.sections.playlist",t)},{option:er.PODCAST,icon:e.PODCAST,title:cr("browser.sections.podcast",t)},{option:er.RADIO,icon:e.RADIO,title:cr("browser.sections.radio",t)},{option:er.TRACK,icon:e.MUSIC,title:cr("browser.sections.track",t)}]}const hr="favorites",pr="main",gr={add_to_queue:$t.ADD_TO_QUEUE,play_next:$t.PLAY_NEXT,play_next_clear_queue:$t.PLAY_NEXT_CLEAR_QUEUE,play_now:$t.PLAY_NOW,play_now_clear_queue:$t.PLAY_NOW_CLEAR_QUEUE,radio:$t.RADIO};
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */
var mr,vr=class{constructor(e,...t){this.slotNames=[],this.handleSlotChange=e=>{const t=e.target;(this.slotNames.includes("[default]")&&!t.name||t.name&&this.slotNames.includes(t.name))&&this.host.requestUpdate()},(this.host=e).addController(this),this.slotNames=t}hasDefaultSlot(){return[...this.host.childNodes].some(e=>{if(e.nodeType===Node.TEXT_NODE&&""!==e.textContent.trim())return!0;if(e.nodeType===Node.ELEMENT_NODE){const t=e;if("wa-visually-hidden"===t.tagName.toLowerCase())return!1;if(!t.hasAttribute("slot"))return!0}return!1})}hasNamedSlot(e){return null!==this.host.querySelector(`:scope > [slot="${e}"]`)}test(e){return"[default]"===e?this.hasDefaultSlot():this.hasNamedSlot(e)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}},fr=Object.defineProperty,yr=Object.getOwnPropertyDescriptor,br=e=>{throw TypeError(e)},wr=(e,t,r,i)=>{for(var s,o=i>1?void 0:i?yr(t,r):t,n=e.length-1;n>=0;n--)(s=e[n])&&(o=(i?s(t,r,o):s(o))||o);return i&&o&&fr(t,r,o),o},Er=(e,t,r)=>t.has(e)||br("Cannot "+r),Cr=":host {\n  box-sizing: border-box !important;\n}\n\n:host *,\n:host *::before,\n:host *::after {\n  box-sizing: inherit !important;\n}\n\n[hidden] {\n  display: none !important;\n}\n",Ir=class extends me{constructor(){var e,t,r;super(),e=this,r=!1,(t=mr).has(e)?br("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),this.initialReflectedProperties=new Map,this.didSSR=Boolean(this.shadowRoot),this.customStates={set:(e,t)=>{if(Boolean(this.internals?.states))try{t?this.internals.states.add(e):this.internals.states.delete(e)}catch(e){if(!String(e).includes("must start with '--'"))throw e;console.error("Your browser implements an outdated version of CustomStateSet. Consider using a polyfill")}},has:e=>{if(!Boolean(this.internals?.states))return!1;try{return this.internals.states.has(e)}catch{return!1}}};try{this.internals=this.attachInternals()}catch{console.error("Element internals are not supported in your browser. Consider using a polyfill")}this.customStates.set("wa-defined",!0);let i=this.constructor;for(let[e,t]of i.elementProperties)"inherit"===t.default&&void 0!==t.initial&&"string"==typeof e&&this.customStates.set(`initial-${e}-${t.initial}`,!0)}static get styles(){const e=Array.isArray(this.css)?this.css:this.css?[this.css]:[];return[Cr,...e].map(e=>"string"==typeof e?h(e):e)}attributeChangedCallback(e,t,r){var i,s;Er(i=this,s=mr,"read from private field"),s.get(i)||(this.constructor.elementProperties.forEach((e,t)=>{e.reflect&&null!=this[t]&&this.initialReflectedProperties.set(t,this[t])}),((e,t,r)=>{Er(e,t,"write to private field"),t.set(e,r);
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */})(this,mr,!0)),super.attributeChangedCallback(e,t,r)}willUpdate(e){super.willUpdate(e),this.initialReflectedProperties.forEach((t,r)=>{e.has(r)&&null==this[r]&&(this[r]=t)})}firstUpdated(e){super.firstUpdated(e),this.didSSR&&this.shadowRoot?.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))})}update(e){try{super.update(e)}catch(e){if(this.didSSR&&!this.hasUpdated){const t=new Event("lit-hydration-error",{bubbles:!0,composed:!0,cancelable:!1});t.error=e,this.dispatchEvent(t)}throw e}}relayNativeEvent(e,t){e.stopImmediatePropagation(),this.dispatchEvent(new e.constructor(e.type,{...e,...t}))}};
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */mr=new WeakMap,wr([xe()],Ir.prototype,"dir",2),wr([xe()],Ir.prototype,"lang",2),wr([xe({type:Boolean,reflect:!0,attribute:"did-ssr"})],Ir.prototype,"didSSR",2);
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */
var Br=class extends Ir{constructor(){super(...arguments),this.hasSlotController=new vr(this,"footer","header","media","header-actions","footer-actions","actions"),this.appearance="outlined",this.withHeader=!1,this.withMedia=!1,this.withFooter=!1,this.orientation="vertical"}updated(){!this.withHeader&&this.hasSlotController.test("header")&&(this.withHeader=!0),!this.withMedia&&this.hasSlotController.test("media")&&(this.withMedia=!0),!this.withFooter&&this.hasSlotController.test("footer")&&(this.withFooter=!0)}render(){return"horizontal"===this.orientation?Z`
        <slot name="media" part="media" class="media"></slot>
        <slot part="body" class="body"></slot>
        <slot name="actions" part="actions" class="actions"></slot>
      `:Z`
      <slot name="media" part="media" class="media"></slot>

      ${this.hasSlotController.test("header-actions")?Z` <header part="header" class="header has-actions">
            <slot name="header"></slot>
            <slot name="header-actions"></slot>
          </header>`:Z` <header part="header" class="header">
            <slot name="header"></slot>
          </header>`}

      <slot part="body" class="body"></slot>
      ${this.hasSlotController.test("footer-actions")?Z` <footer part="footer" class="footer has-actions">
            <slot name="footer"></slot>
            <slot name="footer-actions"></slot>
          </footer>`:Z` <footer part="footer" class="footer">
            <slot name="footer"></slot>
          </footer>`}
    `}};Br.css=["@layer wa-utilities {\n  :host([size='small']),\n  .wa-size-s {\n    font-size: var(--wa-font-size-s);\n  }\n\n  :host([size='medium']),\n  .wa-size-m {\n    font-size: var(--wa-font-size-m);\n  }\n\n  :host([size='large']),\n  .wa-size-l {\n    font-size: var(--wa-font-size-l);\n  }\n}\n",":host {\n  --spacing: var(--wa-space-l);\n\n  /* Internal calculated properties */\n  --inner-border-radius: calc(var(--wa-panel-border-radius) - var(--wa-panel-border-width));\n\n  display: flex;\n  flex-direction: column;\n  background-color: var(--wa-color-surface-default);\n  border-color: var(--wa-color-surface-border);\n  border-radius: var(--wa-panel-border-radius);\n  border-style: var(--wa-panel-border-style);\n  box-shadow: var(--wa-shadow-s);\n  border-width: var(--wa-panel-border-width);\n  color: var(--wa-color-text-normal);\n}\n\n/* Appearance modifiers */\n:host([appearance='plain']) {\n  background-color: transparent;\n  border-color: transparent;\n  box-shadow: none;\n}\n\n:host([appearance='outlined']) {\n  background-color: var(--wa-color-surface-default);\n  border-color: var(--wa-color-surface-border);\n}\n\n:host([appearance='filled']) {\n  background-color: var(--wa-color-neutral-fill-quiet);\n  border-color: transparent;\n}\n\n:host([appearance='filled-outlined']) {\n  background-color: var(--wa-color-neutral-fill-quiet);\n  border-color: var(--wa-color-surface-border);\n}\n\n:host([appearance='accent']) {\n  color: var(--wa-color-neutral-on-loud);\n  background-color: var(--wa-color-neutral-fill-loud);\n  border-color: transparent;\n}\n\n/* Take care of top and bottom radii */\n.media,\n:host(:not([with-media])) .header,\n:host(:not([with-media], [with-header])) .body {\n  border-start-start-radius: var(--inner-border-radius);\n  border-start-end-radius: var(--inner-border-radius);\n}\n\n:host(:not([with-footer])) .body,\n.footer {\n  border-end-start-radius: var(--inner-border-radius);\n  border-end-end-radius: var(--inner-border-radius);\n}\n\n.media {\n  display: flex;\n  overflow: hidden;\n\n  &::slotted(*) {\n    display: block;\n    width: 100%;\n    border-radius: 0 !important;\n  }\n}\n\n/* Round all corners for plain appearance */\n:host([appearance='plain']) .media {\n  border-radius: var(--inner-border-radius);\n\n  &::slotted(*) {\n    border-radius: inherit !important;\n  }\n}\n\n.header {\n  display: block;\n  border-block-end-style: inherit;\n  border-block-end-color: var(--wa-color-surface-border);\n  border-block-end-width: var(--wa-panel-border-width);\n  padding: calc(var(--spacing) / 2) var(--spacing);\n}\n\n.body {\n  display: block;\n  padding: var(--spacing);\n}\n\n.footer {\n  display: block;\n  border-block-start-style: inherit;\n  border-block-start-color: var(--wa-color-surface-border);\n  border-block-start-width: var(--wa-panel-border-width);\n  padding: var(--spacing);\n}\n\n/* Push slots to sides when the action slots renders */\n.has-actions {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n}\n\n:host(:not([with-header])) .header,\n:host(:not([with-footer])) .footer,\n:host(:not([with-media])) .media {\n  display: none;\n}\n\n/* Orientation Styles */\n:host([orientation='horizontal']) {\n  flex-direction: row;\n\n  .media {\n    border-start-start-radius: var(--inner-border-radius);\n    border-end-start-radius: var(--inner-border-radius);\n    border-start-end-radius: 0;\n\n    &::slotted(*) {\n      block-size: 100%;\n      inline-size: 100%;\n      object-fit: cover;\n    }\n  }\n}\n\n:host([orientation='horizontal']) ::slotted([slot='body']) {\n  display: block;\n  height: 100%;\n  margin: 0;\n}\n\n:host([orientation='horizontal']) ::slotted([slot='actions']) {\n  display: flex;\n  align-items: center;\n  padding: var(--spacing);\n}\n"],wr([xe({reflect:!0})],Br.prototype,"appearance",2),wr([xe({attribute:"with-header",type:Boolean,reflect:!0})],Br.prototype,"withHeader",2),wr([xe({attribute:"with-media",type:Boolean,reflect:!0})],Br.prototype,"withMedia",2),wr([xe({attribute:"with-footer",type:Boolean,reflect:!0})],Br.prototype,"withFooter",2),wr([xe({reflect:!0})],Br.prototype,"orientation",2),Br=wr([Ce("wa-card")],Br);const xr=[rr.MUSIC_PLAYER,rr.QUEUE,rr.PLAYERS,rr.MEDIA_BROWSER],Pr={Queue:{ACTION_MOVE_UP:[sr.CLICK,20,sr.SHORT],ACTION_MOVE_DOWN:[sr.SHORT,20,sr.CLICK],ACTION_MOVE_NEXT:[sr.SHORT,20,sr.SHORT],ACTION_REMOVE:[sr.CLICK,20,sr.CLICK]},Players:{ACTION_JOIN:[sr.CLICK,20,sr.SHORT],ACTION_TRANSFER:[sr.SHORT,20,sr.CLICK]},Player:{ACTION_FAVORITE_HOLD:sr.CLICK,ACTION_SWIPE:sr.VERY_SHORT}},Dr={book:"data:image/png;base64, ",cleft:"data:image/png;base64, ",disc:"data:image/png;base64, ",headphones:"data:image/png;base64, ",microphone:"data:image/png;base64, ",microphone_magic:"data:image/png;base64, ",person:"data:image/png;base64, ",playlist:"data:image/png;base64, ",radio:"data:image/png;base64, "},Sr={book:"data:image/png;base64, ",cleft:"data:image/png;base64, ",disc:"data:image/png;base64, ",headphones:"data:image/png;base64, ",microphone:"data:image/png;base64, ",microphone_magic:"data:image/png;base64, ",person:"data:image/png;base64, ",playlist:"data:image/png;base64, ",radio:"data:image/png;base64, "};var kr,Rr;!function(e){e.ACCESSIBLE="accessible",e.NOT_ACCESSIBLE="not_accessible",e.NOT_URL="not_url"}(kr||(kr={})),function(e){e.HTTP_IP="http_ip",e.HTTPS_IP="https_ip",e.HTTP_URL="http_url",e.HTTPS_URL="https_url"}(Rr||(Rr={}));const Qr=/\d{2,3}\.\d{1,3}.\d{1,3}.\d{1,3}/;function Mr(e){if(!e.startsWith("http"))return!1;const t=function(){const e=document.location,t="http:"==e.protocol,r=Qr.test(e.hostname);return t?r?Rr.HTTP_IP:Rr.HTTP_URL:r?Rr.HTTPS_IP:Rr.HTTPS_URL}(),r=function(e){const t=e.startsWith("http://"),r=Qr.test(e);return t?r?Rr.HTTP_IP:Rr.HTTP_URL:r?Rr.HTTPS_IP:Rr.HTTPS_URL}(e);return t==Rr.HTTP_IP||t==r||r==Rr.HTTPS_URL}function Hr(e){if(!function(e){return"string"==typeof e&&e.length>=10}(e))return kr.NOT_URL;const t=e;return function(e){return e.startsWith("/api/")}(t)||Mr(t)||function(e){return e.startsWith("data:")}(t)?kr.ACCESSIBLE:kr.NOT_ACCESSIBLE}async function Or(e,t,r,i=!0,s=!1){return r=Object.values(ir).includes(r)?Tr(e,r)??"":await qr(e,r,s),!i&&!s||t.startsWith("/api/")||(t=await qr(e,t,s)),{image_url:t,fallback_url:r}}function Tr(e,t){return e&&e.themes.darkMode?Dr[t]:Sr[t]}function Lr(e,t,r){const i=ur(t,r).find(t=>t.option==e);return i?.icon??ir.CLEFT}async function qr(e,t,r){if(!r){const e=Hr(t);if(e==kr.NOT_URL)return"";if(e==kr.ACCESSIBLE)return t}return await async function(e,t){if("string"!=typeof t)return"";try{return await e.callWS({type:"mass_queue/download_and_encode_image",url:t})}catch(e){return console.error(`Error getting image: ${t}`,e),""}}(e,t)}function Ur(e,t,r,i,s=ir.CLEFT){const o=Tr(e,s),n=i?.length?i:o,a=r.length>0?r:n;return""==t||t==document.location.href?a:t==a?n:t==i?o:a}const Fr={music_player:rr.MUSIC_PLAYER,queue:rr.QUEUE,media_browser:rr.MEDIA_BROWSER,players:rr.PLAYERS};function Vr(e){if(Number.isNaN(e))return"0:00";const t=Math.floor(e/60),r=Math.floor(e%60);return`${t.toString()}:${r<10?"0":""}${r.toString()}`}function zr(e,t){if(!t&&!e)return!1;if(!t||!e)return!0;const r=e.attributes,i=t.attributes,s=e.state!=t.state,o=["active_queue","app_id","entity_picture","entity_picture_local","group_members","is_volume_muted","mass_player_type","media_album_name","media_artist","media_content_id","media_content_type","media_duration","media_position","media_title","repeat","shuffle","volume_level"].filter(e=>{try{return r[e]!==i[e]}catch{return!0}}).length>0;return s||o}function Jr(e,t,r){if(!t||!e)return!1;const i=!(r.inactive_when_idle?["off","idle"]:["off"]).includes(t.state),s=!!t.attributes.media_content_id,o="music_assistant"==t.attributes.app_id,n=!!t.attributes.active_queue,a=e.connected,l=new Date(t.last_updated).getTime(),c=Date.now()-l<=72e5||!r.inactive_when_not_updated;return i&&o&&n&&a&&c&&s}function Yr(e,t){return JSON.stringify(e)==JSON.stringify(t)}async function Nr(e,t,r,i=!1){const s=[e,...t],o=await function(e,t,r=!1){return new Promise(i=>{let s=0;function o(){if(s>=e.length)return void i(!1);const n=new Image,a=function(e,t){return Object.values(ir).includes(e)?Tr(t,e):e}(e[s],t);n.onload=()=>{r&&i(n),i(a)},n.onerror=()=>{s++,o()},n.src=a}o()})}(s,r,i);return o}function Xr(e){return new Promise(t=>setTimeout(t,e))}function jr(){return"10000000-1000-4000-8000-100000000000".replaceAll(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}function Kr(e){if(!e)return"0 minutes";let t=e;const r=Math.floor(t/86400);t%=86400;const i=Math.floor(t/3600);t%=3600;const s=Math.floor(t/60);return r?`${r.toString()} days, ${i.toString()} hours, ${s.toString()} minutes`:i?`${i.toString()} hours, ${s.toString()} minutes`:`${s.toString()} minutes`}function Gr(e,t){if("string"!=typeof t||!t.startsWith("media_player"))return!1;if(!e?.states)return!1;const r=e.states[t];if(!r)return!1;const i=r.state;return!["unknown","unavailable"].includes(i)}function Wr(e,t){return"1"==(e>>>0).toString(2).at(t)}const Zr=jr(),_r=jr(),$r=jr(),ei=jr(),ti=jr(),ri=jr(),ii=jr(),si=jr(),oi=jr(),ni=jr(),ai=jr(),li=jr(),ci=jr(),Ai=jr(),di=jr(),ui=jr(),hi=jr(),pi=jr(),gi=jr(),mi=jr(),vi=jr(),fi=jr(),yi=jr(),bi=jr(),wi=jr(),Ei=jr(),Ci=jr(),Ii=jr(),Bi=jr(),xi=jr(),Pi=jr(),Di=jr(),Si=jr(),ki=jr(),Ri=jr(),Qi=jr(),Mi=jr();var Hi=p`
  :host {
    --default-border-radius: var(--control-select-menu-border-radius, 6px);
    --used-border-radius: var(
      --menu-button-border-radius,
      var(--default-border-radius)
    );
    --mass-menu-background-color-expressive: var(
      --md-sys-color-surface-container-low
    );
    --mass-menu-text-color-expressive: var(--md-sys-color-on-surface);
    --mass-menu-icon-color-expressive: var(--md-sys-color-on-surface-variant);

    --mass-menu-background-color-expressive-vibrant: var(
      --md-sys-color-tertiary-container
    );
    --mass-menu-text-color-expressive-vibrant: var(
      --md-sys-color-on-tertiary-container
    );
    --mass-menu-icon-color-expressive-vibrant: var(
      --md-sys-color-on-tertiary-container
    );
    --animation-duration: 0.25s;
    --button-border-radius: var(--used-border-radius);
  }
  :host([scheme="filled"]) {
    --menu-button-background-color: var(--md-sys-color-primary);
    --button-icon-color: var(--md-sys-color-on-primary);
  }
  :host([scheme="tonal"]) {
    --menu-button-background-color: var(--md-sys-color-secondary-container);
    --button-icon-color: var(--md-sys-color-on-secondary-container);
  }
  :host([scheme="standard"]) {
    --menu-button-background-color: unset;
    --button-icon-color: var(--md-sys-color-on-surface-variant);
  }
  :host([scheme="plain"]) {
    --menu-button-background-color: none;
    --button-icon-color: var(--md-sys-color-on-surface-variant);
  }
  .divider {
    margin-top: 2px;
    margin-bottom: 2px;
  }
  .divider::before {
    content: " ";
    display: block;
    height: 1px;
    background-color: var(--divider-color);
    margin-left: 24px;
    margin-right: 24px;
  }
  mpc-button::part(button) {
    --used-button-background-color: var(--menu-button-background-color);
  }
  #menu-button {
    border-radius: var(--used-border-radius);
  }
  #menu-select-menu.expressive {
    --menu-background-color: var(--mass-menu-background-color-expressive);
    --mdc-shape-medium: var(--default-border-radius);
  }
  #menu-select-menu.expressive::part(menu) {
    background-color: var(--menu-background-color);
    border-radius: 24px;
  }
  #menu-select-menu.expressive.vibrant {
    --menu-background-color: var(
      --mass-menu-background-color-expressive-vibrant
    );
  }
  #menu-select-menu {
    border-radius: var(--used-border-radius);
  }
  mpc-menu-item {
    height: 100%;
    width: 100%;
    display: block;
    border: none;
  }
  mpc-menu-item:first-of-type {
    margin-top: 4px;
  }
  mpc-menu-item:last-of-type {
    margin-bottom: 4px;
  }
  .svg-menu {
    border-radius: var(--used-border-radius);
    --icon-primary-color: var(--button-icon-color);
  }
  .svg-menu:not(.expressive) {
    color: var(--md-sys-color-primary);
  }
  .svg-expressive {
    margin-left: 14px;
  }
  .svg-menu.expressive {
    color: var(--md-sys-color-on-secondary-container);
  }
  .title-md,
  .title,
  .menu-list-item-image,
  .menu-list-item-svg {
    touch-action: none;
  }
`,Oi=p`
  :host {
    --background-color-normal-active: var(--mdc-theme-primary);
    --background-color-expressive-active: var(
      --md-sys-color-secondary-container
    );
    --background-color-expressive-vibrant-active: var(--md-sys-color-tertiary);

    --text-color-normal-active: var(--mdc-theme-on-primary);
    --text-color-expressive: var(--md-sys-color-on-surface);
    --text-color-expressive-vibrant: var(--md-sys-color-on-tertiary-container);
    --text-color-expressive-active: var(--md-sys-color-on-secondary-container);
    --text-color-expressive-vibrant-active: var(--md-sys-color-on-tertiary);

    --ripple-hover-color-expressive: var(--md-sys-color-on-surface);
    --ripple-hover-color-expressive-vibrant: var(
      --md-sys-color-on-tertiary-container
    );
    --ripple-hover-color-expressive-active: var(--md-sys-color-on-surface);
    --ripple-hover-color-expressive-vibrant-active: var(
      --md-sys-color-on-tertiary-container
    );
  }
  .divider {
    margin-top: 2px;
    margin-bottom: 2px;
  }
  .divider::before {
    content: " ";
    display: block;
    height: 1px;
    background-color: var(--divider-color);
    margin-left: 24px;
    margin-right: 24px;
  }
  /* Base */
  ha-dropdown-item {
    padding-inline: unset;
    padding-right: 14px;
  }
  /* 
    Expressive: True
  */
  .menu-list-item-md.expressive {
    border-radius: 1.5em;
  }
  .menu-list-item-md.expressive {
    padding-top: 0px;
    padding-bottom: 0px;
  }

  /* 
    Expressive: True
    Vibrant: False
    Selected: False
  */
  .menu-list-item-md.expressive:not(.vibrant):not(.selected) {
    --wa-color-text-normal: var(--text-color-expressive);
    --wa-color-neutral-fill-normal: rgba(
      from var(--ripple-hover-color-expressive) r g b / 0.08
    );
  }
  .menu-list-item-md:not(.vibrant):not(.selected) {
    color: var(--text-color-expressive);
  }

  /* 
    Expressive: True
    Vibrant: False
    Selected: True
  */
  .menu-list-item-md.expressive.selected:not(.vibrant) {
    background-color: var(--background-color-expressive-active);
    --wa-color-text-normal: var(--text-color-expressive-active);
    --wa-color-neutral-fill-normal: rgba(
      from var(--ripple-hover-color-expressive-active) r g b / 0.08
    );
  }

  /* 
    Expressive: True
    Vibrant: True
    Selected: False
  */
  .menu-list-item-md.vibrant:not(.selected) {
    --wa-color-text-normal: var(--text-color-expressive-vibrant);
    --wa-color-neutral-fill-normal: rgba(
      from var(--ripple-hover-color-expressive-vibrant) r g b / 0.08
    );
  }

  /* 
    Expressive: True
    Vibrant: True
    Selected: True
  */
  .menu-list-item-md.vibrant.selected {
    background-color: var(--background-color-expressive-vibrant-active);
    --wa-color-text-normal: var(--text-color-expressive-vibrant-active);
    --wa-color-neutral-fill-normal: rgba(
      from var(--ripple-hover-color-expressive-vibrant-active) r g b / 0.08
    );
  }

  .menu-list-item-svg.expressive:not(.vibrant) {
    color: var(--md-sys-color-on-surface-variant);
    fill: var(--md-sys-color-on-surface-variant);
  }
  .menu-list-item-svg.expressive.vibrant {
    color: var(--md-sys-color-on-tertiary-container);
    fill: var(--md-sys-color-on-tertiary-container);
  }

  .menu-list-item-svg.expressive,
  .menu-list-item-image.expressive {
    margin-left: 14px;
    height: 3em;
    width: 3em;
  }
  .menu-list-item-svg:not(.expressive),
  .menu-list-item-image:not(.expressive) {
    height: 2em;
    width: 2em;
    margin-left: 12px;
  }
  .menu-list-item-image.expressive {
    border-radius: var(--media-row-thumbnail-border-radius);
  }
  .menu-list-item-md.selected:not(.expressive) {
    background-color: rgba(
      from var(--background-color-normal-active) r g b / 0.2
    );
  }
  .title.expressive {
    font-family: var(--expressive-font-family);
    font-variation-settings: "ROND" 100;
    font-size: 1.2em;
  }
`;const Ti={AttributePart:ue.H,PropertyPart:ue.B,BooleanAttributePart:ue.N,EventPart:ue.U},{AttributePart:Li,PropertyPart:qi,BooleanAttributePart:Ui,EventPart:Fi}=Ti,Vi=e=>e,zi={h:Vi`
      <ha-svg-icon part="menu-list-item-svg" slot="icon"></ha-svg-icon>
    `,parts:[{type:1,index:0,name:"class",strings:["menu-list-item-svg "," "," ",""],ctor:Li},{type:1,index:0,name:"path",strings:["",""],ctor:qi}]},Ji={h:Vi`
      <img part="menu-list-item-image" slot="icon" loading="lazy">
    `,parts:[{type:1,index:0,name:"class",strings:["menu-list-item-image ",""],ctor:Li},{type:1,index:0,name:"src",strings:["",""],ctor:Li}]},Yi={h:Vi`<!--?-->`,parts:[]},Ni={h:Vi` <div class="divider"></div> `,parts:[]},Xi={h:Vi`
      <ha-dropdown-item type="button">
        <?>
        <div><?></div>
      </ha-dropdown-item>
      <?>
    `,parts:[{type:1,index:0,name:"class",strings:["menu-list-item-md "," "," ",""],ctor:Li},{type:1,index:0,name:"click",strings:["",""],ctor:Fi},{type:1,index:0,name:"disabled",strings:["",""],ctor:Ui},{type:2,index:1},{type:1,index:2,name:"class",strings:["title ",""],ctor:Li},{type:2,index:3},{type:2,index:4}]};let ji=class extends me{constructor(){super(...arguments),this.divider=!1,this.expressive=!1,this.vibrant=!1,this.useMD=!1,this.selected=!1,this.disabled=!1,this.getImageCallback=e=>{this.imgPath="string"==typeof e?e:void 0},this.onSelection=()=>{if(this.disabled)return;const e={option:this.menuItem.option},t=new CustomEvent("menu-item-selected",{detail:e,bubbles:!0,composed:!0});this.dispatchEvent(t)}}set menuItem(e){this._menuItem=e,this.setImageOrIconElement()}get menuItem(){return this._menuItem}setImageOrIconElement(){this.getImagePath()}getImagePath(){const e=this.menuItem.image,t=e?.url,r=e?.fallback;(t?.length??r?.length)&&Nr(t??r,[r??t],this.hass).then(e=>{this.getImageCallback(e)})}hasExtraStyles(){const e=this.dropdownItem?.shadowRoot?.querySelector("style");return!!e}checkAndRemoveExtraStyles(){const e=this.dropdownItem?.shadowRoot?.querySelector("style");e&&e.remove()}renderIcon(){const e=this.expressive?"expressive":"",t=this.vibrant?"vibrant":"",r=this.selected?"selected":"";return{_$litType$:zi,values:[e,t,r,this.menuItem.icon]}}renderImage(){const e=this.expressive?"expressive":"";return{_$litType$:Ji,values:[e,this.imgPath]}}renderImageOrIcon(){return this.imgPath?this.renderImage():this.renderIcon()}renderDivider(){return this.divider?{_$litType$:Ni,values:[]}:{_$litType$:Yi,values:[]}}render(){const e=this.expressive?"expressive":"",t=this.vibrant?"vibrant":"",r=this.selected?"selected":"",i=this.menuItem;return{_$litType$:Xi,values:[e,t,r,this.onSelection,this.disabled,this.renderImageOrIcon(),e,i.title,this.renderDivider()]}}updated(){this.hasExtraStyles()&&this.checkAndRemoveExtraStyles()}static get styles(){return Oi}shouldUpdate(e){return e.size>0||this.hasExtraStyles()}};e([a({context:Zr,subscribe:!0})],ji.prototype,"hass",void 0),e([Pe()],ji.prototype,"imgPath",void 0),e([xe({attribute:"divider",type:Boolean})],ji.prototype,"divider",void 0),e([xe({attribute:"expressive",type:Boolean})],ji.prototype,"expressive",void 0),e([xe({attribute:"vibrant",type:Boolean})],ji.prototype,"vibrant",void 0),e([xe({attribute:"use-md",type:Boolean})],ji.prototype,"useMD",void 0),e([xe({attribute:"selected",type:Boolean})],ji.prototype,"selected",void 0),e([xe({type:Boolean})],ji.prototype,"disabled",void 0),e([Se("ha-dropdown-item")],ji.prototype,"dropdownItem",void 0),e([xe({attribute:!1})],ji.prototype,"menuItem",null),ji=e([Ce("mpc-menu-item")],ji);const Ki="filled",{AttributePart:Gi,PropertyPart:Wi,BooleanAttributePart:Zi,EventPart:_i}=Ti,$i=e=>e,es={h:$i`<!--?-->`,parts:[]},ts={h:$i`
        <mpc-menu-item class="menu-items"></mpc-menu-item>
      `,parts:[{type:1,index:0,name:"divider",strings:["",""],ctor:Zi},{type:1,index:0,name:"expressive",strings:["",""],ctor:Zi},{type:1,index:0,name:"vibrant",strings:["",""],ctor:Zi},{type:1,index:0,name:"selected",strings:["",""],ctor:Zi},{type:1,index:0,name:"menuItem",strings:["",""],ctor:Wi},{type:1,index:0,name:"use-md",strings:["",""],ctor:Zi},{type:1,index:0,name:"disabled",strings:["",""],ctor:Zi}]},rs={h:$i`
      <div id="menu-button" part="menu-button">
        <ha-dropdown id="menu-select-menu" part="menu-select-menu" naturalmenuwidth="">
          <mpc-button slot="trigger" part="div-icon" role="variant">
            <ha-svg-icon part="menu-svg"></ha-svg-icon>
          </mpc-button>
          <?>
          <slot></slot>
        </ha-dropdown>
      </div>
    `,parts:[{type:1,index:1,name:"class",strings:[""," ",""],ctor:Gi},{type:1,index:1,name:"menu-item-selected",strings:["",""],ctor:_i},{type:1,index:1,name:"fixedMenuPosition",strings:["",""],ctor:Zi},{type:1,index:1,name:"click",strings:["",""],ctor:_i},{type:1,index:2,name:"elevation",strings:["",""],ctor:Gi},{type:1,index:2,name:"outlined",strings:["",""],ctor:Zi},{type:1,index:3,name:"class",strings:["svg-menu ",""],ctor:Gi},{type:1,index:3,name:"path",strings:["",""],ctor:Wi},{type:2,index:4}]};let is=class extends me{constructor(){super(...arguments),this.scheme=Ki,this.fixedMenuPosition=!1,this.dividers=!1,this.useMD=!1,this.elevation=1,this.outlined=!1,this.gapReset=!1,this.onSelect=e=>{e.stopPropagation();const t={detail:e.detail},r=new CustomEvent("menu-item-selected",t);this.dispatchEvent(r),this.menuElement&&(this.menuElement.open=!1)}}set initialSelection(e){this._initialSelection=e,this._selectedItem=e}get initialSelection(){return this._initialSelection??""}set items(e){Yr(this._items,e)||e&&(this._items=e,this._selectedItem||(this._selectedItem=e[0].option))}get items(){return this._items??[]}attemptGapReset(){if(!this.interval)return;if(this.gapReset)return window.clearInterval(this.interval),void(this.interval=void 0);const e=this.menuElement?.shadowRoot?.querySelector(".select-anchor");e&&(e.style.gap="unset",this.gapReset=!0)}renderMenuItems(){if(!this.items?.length)return{_$litType$:es,values:[]};const e=this.items.length;return this.items.map((t,r)=>{const i=r<e-1&&this.dividers;return{_$litType$:ts,values:[i,this.useExpressive,this.useVibrant,this._selectedItem==t.option,t,this.useMD,t.disabled]}})}render(){const e=this.useExpressive?"expressive":"",t=this.useVibrant?"vibrant":"";return{_$litType$:rs,values:[e,t,this.onSelect,this.fixedMenuPosition,e=>{e.stopPropagation()},this.elevation,this.outlined,this.useExpressive?"expressive":"",this.iconPath,this.renderMenuItems()]}}shouldUpdate(e){return e.size>0||!this.gapReset}firstUpdated(){this.gapReset||(this.interval=window.setInterval(()=>{this.attemptGapReset()},20))}disconnectedCallback(){super.disconnectedCallback(),this.interval&&(window.clearInterval(this.interval),this.interval=void 0)}static get styles(){return Hi}};e([xe({attribute:!1})],is.prototype,"iconPath",void 0),e([xe({attribute:!1})],is.prototype,"_items",void 0),e([xe({attribute:"scheme",type:String,default:Ki,reflect:!0})],is.prototype,"scheme",void 0),e([xe({type:Boolean,attribute:"fixedMenuPosition"})],is.prototype,"fixedMenuPosition",void 0),e([xe({type:Boolean,attribute:"dividers"})],is.prototype,"dividers",void 0),e([xe({type:Boolean,attribute:"use-md"})],is.prototype,"useMD",void 0),e([xe({type:Number,attribute:"elevation",default:1,reflect:!0})],is.prototype,"elevation",void 0),e([xe({type:Boolean,default:!1,reflect:!0})],is.prototype,"outlined",void 0),e([Se("#menu-select-menu")],is.prototype,"menuElement",void 0),e([a({context:bi,subscribe:!0})],is.prototype,"useExpressive",void 0),e([a({context:wi,subscribe:!0})],is.prototype,"useVibrant",void 0),e([a({context:mi,subscribe:!0})],is.prototype,"controller",void 0),e([Pe()],is.prototype,"_selectedItem",void 0),e([xe({attribute:!1})],is.prototype,"initialSelection",null),is=e([Ce("mpc-menu-button")],is);var ss=p`
  :host {
    --mdc-icon-size: calc(10em / var(--columns, 2));
  }
  mpc-menu-button {
    --menu-button-border-radius: 50%;
    --menu-button-background-color: var(
      --browser-button-enqueue-menu-icon-secondary-color
    );
    --button-icon-color: var(--browser-button-enqueue-menu-icon-primary-color);
  }
  mpc-menu-button::part(menu-list-item-svg) {
    height: 2em;
    width: 2em;
  }
  mpc-menu-button::part(menu-button) {
    --mdc-icon-size: calc(10em / var(--columns, 2));
    --button-button-height: var(--mdc-icon-size);
    --button-button-width: var(--mdc-icon-size);
  }
  mpc-menu-button::part(menu-select-menu) {
    --control-select-menu-height: unset;
    --control-select-menu-background-color: unset;
  }
  mpc-menu-button::part(menu-svg) {
    --mdc-icon-size: calc(10em / var(--columns, 2));
    height: 100%;
    width: 100%;
  }
  .svg-menu-expressive {
    max-width: 5em;
    max-height: 5em;
    min-width: 2em;
    min-width: 2em;
  }

  wa-card {
    --wa-panel-border-width: var(--ha-card-border-width);
    height: 100%;
    width: 100%;
  }

  #container {
    width: 100%;
    border-radius: var(--browser-card-border-radius) !important;
    overflow: visible !important;
    margin: 0px 0px 3px;
    aspect-ratio: 1;
  }
  #container,
  #container-outer {
    position: relative;
    display: flex;
  }
  #enqueue-button-div {
    position: absolute;
    right: 0.2em;
    bottom: 2.2em;
    overflow: visible;
    border-radius: var(--menu-button-border-radius);
  }

  .media-card {
    border-radius: var(--browser-card-border-radius) !important;
    overflow: hidden;
  }
  .media-card::part(body) {
    padding: unset;
    text-align: center;
  }
  .media-card-expressive {
    box-shadow: var(--md-sys-elevation-level2);
  }

  .thumbnail {
    border-radius: var(--browser-card-border-radius);
    overflow: hidden !important;
  }
  .thumbnail,
  .thumbnail-section {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  #thumbnail-div {
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: center;
    height: 100%;
    aspect-ratio: 1;
  }
  .thumbnail-section {
    background-repeat: no-repeat;
    background-size: contain;
    width: 100%;
    aspect-ratio: 1;
  }

  #title-div {
    font-size: 1.2rem;
    text-transform: capitalize;
    position: absolute;
    width: 100%;
    line-height: 160%;
    bottom: 0;
    background-color: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-primary);
    border-radius: 0px 0px var(--default-border-radius)
      var(--default-border-radius);
  }
  #title-div.expressive {
    font-size: 1.3rem;
    font-family: var(--expressive-font-family);
    font-stretch: 80%;
    font-weight: 600;
    font-variation-settings: "ROND" 100;
  }
`,os="M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12,16.5C9.5,16.5 7.5,14.5 7.5,12C7.5,9.5 9.5,7.5 12,7.5C14.5,7.5 16.5,9.5 16.5,12C16.5,14.5 14.5,16.5 12,16.5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",ns="M19,1L17.74,3.75L15,5L17.74,6.26L19,9L20.25,6.26L23,5L20.25,3.75M9,4L6.5,9.5L1,12L6.5,14.5L9,20L11.5,14.5L17,12L11.5,9.5M19,15L17.74,17.74L15,19L17.74,20.25L19,23L20.25,20.25L23,19L20.25,17.74",as="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z",ls="M13.5,8H12V13L16.28,15.54L17,14.33L13.5,12.25V8M13,3A9,9 0 0,0 4,12H1L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3",cs="M21,3V15.5A3.5,3.5 0 0,1 17.5,19A3.5,3.5 0 0,1 14,15.5A3.5,3.5 0 0,1 17.5,12C18.04,12 18.55,12.12 19,12.34V6.47L9,8.6V17.5A3.5,3.5 0 0,1 5.5,21A3.5,3.5 0 0,1 2,17.5A3.5,3.5 0 0,1 5.5,14C6.04,14 6.55,14.12 7,14.34V6L21,3Z",As="M15,6H3V8H15V6M15,10H3V12H15V10M3,16H11V14H3V16M17,6V14.18C16.69,14.07 16.35,14 16,14A3,3 0 0,0 13,17A3,3 0 0,0 16,20A3,3 0 0,0 19,17V8H22V6H17Z",ds="M14,10A3,3 0 0,0 11,13A3,3 0 0,0 14,16A3,3 0 0,0 17,13A3,3 0 0,0 14,10M14,18A5,5 0 0,1 9,13A5,5 0 0,1 14,8A5,5 0 0,1 19,13A5,5 0 0,1 14,18M14,2A2,2 0 0,1 16,4A2,2 0 0,1 14,6A2,2 0 0,1 12,4A2,2 0 0,1 14,2M19,0H9A2,2 0 0,0 7,2V18A2,2 0 0,0 9,20H19A2,2 0 0,0 21,18V2A2,2 0 0,0 19,0M5,22H17V24H5A2,2 0 0,1 3,22V4H5";function us(e){return{name:"hide",type:"expandable",schema:e.map(e=>({name:e,selector:{boolean:{}},default:!1}))}}function hs(e,t){if(Object.keys(e).includes(t))return e[t]}function ps(e,t,r){const i=Object.keys(e),s={},o={...e},n={...t},a={...r};return i.forEach(e=>{s[e]=hs(a,e)||hs(n,e)||hs(o,e)||!1}),s}const gs={enabled:!0,limit:25,items:[],favorites_only:!0},ms={enabled:!0,albums:gs,artists:gs,audiobooks:gs,playlists:gs,podcasts:gs,radios:gs,tracks:gs,show_collection_view:!0},vs={back_button:!1,filter_button:!1,search_button:!1,titles:!1,enqueue_menu:!1,add_to_queue_button:!1,play_next_button:!1,play_next_clear_queue_button:!1,play_now_button:!1,play_now_clear_queue_button:!1,header_title:!1,header:!1},fs={add:"add_to_queue_button",play:"play_now_button",next:"play_next_button",replace:"play_now_clear_queue_button",replace_next:"play_next_clear_queue_button"},ys=[],bs={enabled:!0,show_collection_view:!0},ws={enabled:!0,favorites:ms,recents:ms,recommendations:bs,sections:ys,hide:vs,columns:2,playlists_allow_removing_tracks:!1,default_enqueue_option:"play_now",default_section:"favorites"},Es=["back_button","search","titles","enqueue_menu","add_to_queue_button","play_now_button","play_now_clear_queue_button","play_next_button","play_next_clear_queue_button"];function Cs(e){return{name:e,type:"expandable",schema:[{name:"",type:"grid",schema:[{name:"enabled",selector:{boolean:{}},default:!0},{name:"limit",selector:{number:{min:0,max:500,mode:"box"}}}]}]}}function Is(e){return{...gs,...e}}function Bs(e){let t=e.media_browser;return t=function(e){return{...ws,...e}}(t),t=function(e){let t=e.favorites;return t={...ms,...t},t={...t,albums:Is(t.albums),artists:Is(t.artists),audiobooks:Is(t.audiobooks),playlists:Is(t.playlists),podcasts:Is(t.podcasts),radios:Is(t.radios),tracks:Is(t.tracks)},{...e,favorites:t}}(t),t=function(e){let t=e.recents;return t={...ms,...t},t={...t,albums:Is(t.albums),artists:Is(t.artists),audiobooks:Is(t.audiobooks),playlists:Is(t.playlists),podcasts:Is(t.podcasts),radios:Is(t.radios),tracks:Is(t.tracks)},{...e,recents:t}}(t),t=function(e){let t=e.sections;return t=[...ys,...t],{...e,sections:t}}(t),t=function(e){const t=e.recommendations;return{...e,recommendations:{...bs,...t}}}(t),t=function(e){const t=e.hide;return{...e,hide:{...vs,...t}}}(t),{...e,media_browser:t}}let xs=class extends me{constructor(){super(...arguments),this.queueable=!1,this._firstLoaded=!1,this._play=!1,this.onEnqueue=e=>{e.stopPropagation();const t=e.detail.option;this.onEnqueueAction(this._config.data,t)},this.onSelect=()=>{this.onSelectAction(this._config.data,this)},this._renderImageFallback=e=>{const t=Tr(this.hass,this.config?.fallback??ir.DISC);e.target.src=t}}set activeSection(e){e&&(this._play=e==rr.MEDIA_BROWSER,this._activeSection=e,this.generateCode())}get activeSection(){return this._activeSection}set config(e){e&&(Yr(this._config,e)||(this._config=e,this.updateHiddenElements(),this.generateCode()))}get config(){return this._config}set cardConfig(e){e&&(Yr(this._cardConfig,e)||(this._cardConfig=e))}get cardConfig(){return this._cardConfig}set sectionConfig(e){!Yr(this._sectionConfig,e)&&e&&(this._sectionConfig=e,this.updateHiddenElements())}get sectionConfig(){return this._sectionConfig}set Icons(e){!Yr(this._icons,e)&&e&&(this._icons=e)}get Icons(){return this._icons}set entityConfig(e){!Yr(this._entityConfig,e)&&e&&(this._entityConfig=e,this.updateHiddenElements(),this.hass&&this.Icons&&(this._search_buttons=ur(this.Icons,this.hass)))}get entityConfig(){return this._entityConfig}updateHiddenElements(){this.updateEnqueueButtons(),this.generateCode()}updateEnqueueButtons(){if(!this.hass||!this.Icons)return;const e=dr(this.Icons,this.hass),t=fs,r=e.filter(e=>{const r=t[e.option];return!this.hide[r]});this._enqueue_buttons=r}renderThumbnailFromBackground(){return Ee` ${this.config?.background} `}renderThumbnailFromThumbnail(){const e=this.config?.thumbnail;return Ee`
      <img
        id="thumbnail-div"
        slot="media"
        class="wa-grid"
        src="${e}"
        @error=${this._renderImageFallback}
        loading="lazy"
      />
    `}renderThumbnail(){return this.config?.background?this.renderThumbnailFromBackground():this.renderThumbnailFromThumbnail()}renderTitle(){return this.hide.titles?Ee``:Ee`
      <div id="title-div" class="${this.useExpressive?"expressive":""}">
        ${this.config?.title}
      </div>
    `}renderEnqueueButton(){if(this.hide.enqueue_menu||!this.queueable||!this.Icons)return Ee``;const e=this.cardConfig?.media_browser.columns;return Ee`
      <mpc-menu-button
        id="enqueue-button-div"
        .iconPath=${this.Icons.PLAY_CIRCLE}
        .items=${this._enqueue_buttons}
        style="--columns: ${e};"
        @menu-item-selected=${this.onEnqueue}
        fixedMenuPosition
        elevation="4"
      ></mpc-menu-button>
    `}generateCode(){this._enqueue_buttons&&this.hass&&this.activeSection&&this.sectionConfig&&this.Icons&&this.entityConfig&&(this.code=Ee`
      <div id="container-outer">
        <wa-animation
          id="animation"
          name="pulse"
          easing="ease"
          iterations="1"
          play=${this._play}
          playback-rate="1"
        >
          <div id="container">
            <wa-card
              class="media-card ${this.useExpressive?"media-card-expressive":""}"
              @click=${this.onSelect}
            >
              <div slot="media" id="media">${this.renderThumbnail()}</div>
              ${this.renderTitle()}
            </wa-card>
          </div>
        </wa-animation>
        ${this.renderEnqueueButton()}
      </div>
    `)}render(){return this.code}firstUpdated(){this._firstLoaded=!0}shouldUpdate(e){return e.size>0}connectedCallback(){this._firstLoaded&&(this._animation.play=!0),super.connectedCallback()}static get styles(){return ss}};e([xe({type:Boolean})],xs.prototype,"queueable",void 0),e([Pe()],xs.prototype,"code",void 0),e([Se("#animation")],xs.prototype,"_animation",void 0),e([a({context:Zr})],xs.prototype,"hass",void 0),e([a({context:bi})],xs.prototype,"useExpressive",void 0),e([a({context:Qi,subscribe:!0})],xs.prototype,"hide",void 0),e([a({context:ui,subscribe:!0})],xs.prototype,"activeSection",null),e([a({context:ni,subscribe:!0})],xs.prototype,"cardConfig",null),e([a({context:Ai,subscribe:!0})],xs.prototype,"sectionConfig",null),e([a({context:Ei,subscribe:!0})],xs.prototype,"Icons",null),e([a({context:_r,subscribe:!0})],xs.prototype,"entityConfig",null),xs=e([Ce("mpc-browser-media-card")],xs);var Ps=p`
  :host {
    width: 100%;
  }
  mpc-browser-media-card {
    max-height: 100%;
    aspect-ratio: 1;
    width: 100%;
    justify-content: center;
  }
  .icons {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
    row-gap: 20px;
    overflow-y: scroll;
    max-height: calc(
      var(--mass-player-card-height) - var(--navbar-height) - 8px
    );
    scrollbar-width: none;
    padding-bottom: 8px;
    padding-top: 8px;
  }
  .loading-indicator {
    background-color: var(--md-sys-color-primary);
    justify-self: center;
    top: 2em;
  }
`;let Ds=class extends me{constructor(){super(...arguments),this._loading=!1,this.onItemSelected=(e,t)=>{this.resetScroll(),this.onSelectAction(e,t)},this.onEnqueue=(e,t)=>{this.onEnqueueAction(e,t)}}set browserConfig(e){!Yr(this._browserConfig,e)&&e&&(this._browserConfig=e,this.items&&this.generateCode())}get browserConfig(){return this._browserConfig}set items(e){e?.length&&(Yr(this._items,e)||(this._items=e,this.browserConfig&&this.generateCode()))}get items(){return this._items}set loading(e){this._loading=e,this.generateCode()}get loading(){return this._loading}resetScroll(){this._iconsElement?.scrollTo({top:0})}generateCode(){if(this.loading)return void(this.code=Ee`
        <link
          href="https://cdn.jsdelivr.net/npm/beercss@4.0.20/dist/cdn/beer.min.css"
          rel="stylesheet"
        />
        <div class="shape loading-indicator extra"></div>
      `);const e=this.items?.map(e=>{const t=["service","playlist","album","artist","podcast"].includes(e.data.type)?be`queueable`:be``,r=1/(this.browserConfig?.columns??1)*100-2;return Ee`
        <mpc-browser-media-card
          style="max-width: ${r.toString()}%"
          .config=${e}
          .onSelectAction=${this.onItemSelected}
          .onEnqueueAction=${this.onEnqueue}
          ${t}
        >
        </mpc-browser-media-card>
      `});this.code=Ee` <div class="icons wa-grid">${e}</div> `}render(){return this.code}shouldUpdate(e){return e.size>0}static get styles(){return Ps}};e([Pe()],Ds.prototype,"code",void 0),e([a({context:Zr,subscribe:!0})],Ds.prototype,"hass",void 0),e([Se(".icons")],Ds.prototype,"_iconsElement",void 0),e([a({context:Ai,subscribe:!0})],Ds.prototype,"browserConfig",null),e([a({context:Di,subscribe:!0})],Ds.prototype,"items",null),e([xe({attribute:"loading",type:Boolean})],Ds.prototype,"loading",null),Ds=e([Ce("mpc-browser-cards")],Ds);var Ss=p`
  .end {
    display: block;
    position: absolute;
    right: 1em;
    top: 0.5em;
    z-index: 1;
  }

  #header {
    padding: 0.5em 0.5em 0em 0.5em;
    box-sizing: border-box;
    width: 100%;
    display: block;
    position: relative;
    z-index: 2;
    height: 3.5em;
  }
  .header.expressive {
    background-color: var(--md-sys-primary-container);
    border-radius: 20px 20px 0px 0px;
  }

  .label {
    display: block;
    position: relative;
    height: 40px;
    width: 100%;
    font-size: 1.5rem;
    text-align: center;
    font-weight: 600;
    z-index: 0;
    color: var(--md-sys-color-on-primary-container);
  }
  .label.expressive {
    font-family: var(--expressive-font-family);
    font-variation-settings: "ROND" 100;
    font-stretch: 25%;
    font-size: 2em;
    line-height: 1em;
  }
  .expressive::slotted([slot="label"]) {
    vertical-align: text-bottom;
  }

  .start {
    display: block;
    position: absolute;
    left: 1em;
    top: 0.5em;
    z-index: 1;
  }
`;const{AttributePart:ks}=Ti,Rs={h:(e=>e)`
      <div id="header" part="header">
        <slot name="start" part="start" class="start"></slot>
        <slot name="label" part="label"></slot>
        <slot name="end" part="end" class="end"></slot>
      </div>
    `,parts:[{type:1,index:0,name:"class",strings:["header ",""],ctor:ks},{type:1,index:2,name:"class",strings:["label ",""],ctor:ks}]};let Qs=class extends me{constructor(){super(...arguments),this._initialUpdate=!1}render(){const e=this.useExpressive?"expressive":"";return{_$litType$:Rs,values:[e,e]}}shouldUpdate(e){return!this._initialUpdate||e.size>0}firstUpdated(){this._initialUpdate=!0}static get styles(){return Ss}};e([a({context:bi,subscribe:!0})],Qs.prototype,"useExpressive",void 0),Qs=e([Ce("mpc-section-header")],Qs);var Ms=p`
  :host {
    --view-header-height: 12em;
    --view-header-min-height: 8em;
    --view-header-wrapper-border-div-height: 1em;
    --view-header-wrapper-height: calc(
      var(--view-header-height) + var(--view-header-wrapper-border-div-height)
    );
    --view-header-wrapper-min-height: calc(
      var(--view-header-min-height) +
        var(--view-header-wrapper-border-div-height)
    );
    --header-expanded-menu-icon-size: 5em;
    --header-expanded-menu-control-size: 5em;
    --header-collapsed-menu-icon-size: 3em;
    --header-collapsed-menu-control-size: 3em;
  }
  :host {
    display: block;
  }
  mpc-menu-button {
    --menu-button-border-radius: 50%;
    border-radius: var(--menu-button-border-radius);
    --menu-button-background-color: var(
      --browser-button-enqueue-menu-icon-secondary-color
    );
    --button-icon-color: var(--browser-button-enqueue-menu-icon-primary-color);
  }
  mpc-menu-button::part(menu-button) {
    --ha-ripple-color: rgba(0, 0, 0, 0);
  }
  mpc-menu-button::part(menu-list-item-svg) {
    height: 2em;
    width: 2em;
  }
  mpc-menu-button::part(base) {
    --ha-button-border-radius: unset;
    height: 72px;
  }
  mpc-menu-button::part(menu-button) {
    --button-button-height: var(--mdc-icon-size);
    --button-button-width: var(--mdc-icon-size);
  }
  mpc-menu-button::part(menu-select-menu) {
    --control-select-menu-height: unset;
    --control-select-menu-background-color: unset;
    --control-select-menu-padding: unset;
  }
  mpc-menu-button::part(menu-svg) {
    --mdc-icon-size: var(--header-expanded-menu-icon-size);
  }
  mpc-collection-track-row {
    width: 100%;
    padding-left: 4px;
    padding-right: 4px;
  }
  #animation-image {
    display: block;
  }
  #browser-view {
    background-color: var(--md-sys-color-background);
    border-radius: var(--default-border-radius);
    height: 100%;
    scrollbar-width: none;
  }
  #collection-image {
    display: flex;
    height: 10em;
    aspect-ratio: 1;
    --collection-image-div-collapsed-height: 6em;
    margin-left: 1em;
    margin-top: 1em;
  }
  #collection-info {
    text-align: end;
  }
  #container {
    height: calc(100% - 1em);
    overflow: hidden;
    background-color: var(
      --md-sys-color-secondary-container,
      var(--ha-card-background)
    );
  }
  #enqueue {
    display: flex;
    align-self: end;
    position: relative;
    right: 37.5%;
    bottom: -12.5%;
    z-index: 1;
  }
  #header {
    height: var(--view-header-height);
    display: flex;
    position: absolute;
    width: 100%;
    background-color: var(
      --md-sys-color-secondary-container,
      var(--ha-card-background)
    );
    z-index: 1;
    height: var(--view-header-height);
    border-top-left-radius: var(--default-border-radius);
    border-top-right-radius: var(--default-border-radius);
    z-index: 2;
  }
  #img-header {
    display: flex;
    border-radius: 15%;
    height: 100%;
    width: 100%;
    will-change: transform;
    place-self: center;
  }
  .loading-indicator {
    background-color: var(--md-sys-color-primary);
    justify-self: center;
    top: 2em;
  }
  #overview {
    display: block;
    width: 0%;
    justify-items: end;
    line-height: normal;
    margin-right: 1em;
    height: 100%;
    flex: 1 1 100%;
    padding-top: 1em;
  }
  #title {
    display: block;
    text-wrap: nowrap;
    width: 100%;
    font-size: 3em;
    font-style: italic;
    will-change: font-size;
    transition: font-size;
    font-variation-settings:
      "slnt" 0,
      "GRAD" 0,
      "ROND" 100;
    font-weight: 900;
    font-stretch: 25%;
    text-align: end;
  }
  #title.expressive,
  #tracks-length.expressive {
    font-family: var(--expressive-font-family);
  }
  #title::not(.expressive),
  #tracks-length::not(.expressive) {
    font-family: "Roboto", sans-serif;
  }
  #title-text {
    padding-right: 4px;
  }
  #tracks {
    height: calc(var(--mass-player-card-height) - var(--navbar-height));
    padding-bottom: var(--navbar-height);
    padding-top: calc(
      var(--view-header-height) 0 var(--view-header-min-height)
    );
    position: relative;
    scrollbar-width: none;
    top: var(--view-header-height);
  }
  #tracks:not(.no-scroll) #virtualizer {
    overflow: scroll;
  }
  #tracks-container {
    overflow: hidden;
  }
  #tracks-container.expressive {
    border-top-left-radius: var(--default-border-radius);
    border-top-right-radius: var(--default-border-radius);
  }
  #tracks-container:not(.expressive) {
    border-top-left-radius: var(--queue-border-radius);
    border-top-right-radius: var(--queue-border-radius);
  }
  #tracks-length {
    margin-right: 0.5em;
    will-change: font-size;
  }
  #tracks-padding {
    height: 0em;
  }
  #virtualizer {
    background-color: var(
      --md-sys-color-background,
      var(--card-background-color)
    );
    border-radius: var(--default-border-radius);
    scrollbar-width: none;
    height: 100%;
  }
  @keyframes scroll-image {
    to {
      transform: scale(0.5);
    }
  }
`,Hs=p`
  #playlist-duration,
  #playlist-owner {
    font-size: 1em;
    margin-right: 0.5em;
    font-style: italic;
  }
  #playlist-duration::not(.expressive),
  #playlist-owner::not(.expressive) {
    font-family: "Roboto", sans-serif;
  }
  #playlist-duration.expressive,
  #playlist-owner.expressive {
    font-family: var(--expressive-font-family);
  }
  #overview {
    position: relative;
  }
`
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */;const Os=(e,t)=>{const r=e._$AN;if(void 0===r)return!1;for(const e of r)e._$AO?.(t,!1),Os(e,t);return!0},Ts=e=>{let t,r;do{if(void 0===(t=e._$AM))break;r=t._$AN,r.delete(e),e=t}while(0===r?.size)},Ls=e=>{for(let t;t=e._$AM;e=t){let r=t._$AN;if(void 0===r)t._$AN=r=new Set;else if(r.has(e))break;r.add(e),Fs(t)}};function qs(e){void 0!==this._$AN?(Ts(this),this._$AM=e,Ls(this)):this._$AM=e}function Us(e,t=!1,r=0){const i=this._$AH,s=this._$AN;if(void 0!==s&&0!==s.size)if(t)if(Array.isArray(i))for(let e=r;e<i.length;e++)Os(i[e],!1),Ts(i[e]);else null!=i&&(Os(i,!1),Ts(i));else Os(this,e)}const Fs=e=>{e.type==Me&&(e._$AP??=Us,e._$AQ??=qs)};class Vs extends Le{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),Ls(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Os(this,e),Ts(this))}setValue(e){if(Ve(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const zs=(e,t,r)=>{const i=new Map;for(let s=t;s<=r;s++)i.set(e[s],s);return i},Js=Te(class extends Le{constructor(e){if(super(e),e.type!==Me)throw Error("repeat() can only be used in text expressions")}dt(e,t,r){let i;void 0===r?r=t:void 0!==t&&(i=t);const s=[],o=[];let n=0;for(const t of e)s[n]=i?i(t,n):n,o[n]=r(t,n),n++;return{values:o,keys:s}}render(e,t,r){return this.dt(e,t,r).values}update(e,[t,r,i]){const s=je(e),{values:o,keys:n}=this.dt(t,r,i);if(!Array.isArray(s))return this.ut=n,o;const a=this.ut??=[],l=[];let c,A,d=0,u=s.length-1,h=0,p=o.length-1;for(;d<=u&&h<=p;)if(null===s[d])d++;else if(null===s[u])u--;else if(a[d]===n[h])l[h]=Ye(s[d],o[h]),d++,h++;else if(a[u]===n[p])l[p]=Ye(s[u],o[p]),u--,p--;else if(a[d]===n[p])l[p]=Ye(s[d],o[p]),Je(e,l[p+1],s[d]),d++,p--;else if(a[u]===n[h])l[h]=Ye(s[u],o[h]),Je(e,s[d],s[u]),u--,h++;else if(void 0===c&&(c=zs(n,h,p),A=zs(a,d,u)),c.has(a[d]))if(c.has(a[u])){const t=A.get(n[h]),r=void 0!==t?s[t]:null;if(null===r){const t=Je(e,s[d]);Ye(t,o[h]),l[h]=t}else l[h]=Ye(r,o[h]),Je(e,s[d],r),s[t]=null;h++}else Ke(s[u]),u--;else Ke(s[d]),d++;for(;h<=p;){const t=Je(e,l[p+1]);Ye(t,o[h]),l[h++]=t}for(;d<=u;){const e=s[d++];null!==e&&Ke(e)}return this.ut=n,Xe(e,l),_}});
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */class Ys extends Event{constructor(e){super(Ys.eventName,{bubbles:!1}),this.first=e.first,this.last=e.last}}Ys.eventName="rangeChanged";class Ns extends Event{constructor(e){super(Ns.eventName,{bubbles:!1}),this.first=e.first,this.last=e.last}}Ns.eventName="visibilityChanged";class Xs extends Event{constructor(){super(Xs.eventName,{bubbles:!1})}}Xs.eventName="unpinned";
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
class js{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(this._element=e)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}}class Ks extends js{constructor(e,t){super(t),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);const r=this._node;this._originalScrollTo=r.scrollTo,this._originalScrollBy=r.scrollBy,this._originalScroll=r.scroll,this._attach(e)}get _destination(){return this.__destination}get scrolling(){return null!==this._destination}scrollTo(e,t){const r="number"==typeof e&&"number"==typeof t?{left:e,top:t}:e;this._scrollTo(r)}scrollBy(e,t){const r="number"==typeof e&&"number"==typeof t?{left:e,top:t}:e;void 0!==r.top&&(r.top+=this.scrollTop),void 0!==r.left&&(r.left+=this.scrollLeft),this._scrollTo(r)}_nativeScrollTo(e){this._originalScrollTo.bind(this._element||window)(e)}_scrollTo(e,t=null,r=null){null!==this._end&&this._end(),"smooth"===e.behavior?(this._setDestination(e),this._retarget=t,this._end=r):this._resetScrollState(),this._nativeScrollTo(e)}_setDestination(e){let{top:t,left:r}=e;return t=void 0===t?void 0:Math.max(0,Math.min(t,this.maxScrollTop)),r=void 0===r?void 0:Math.max(0,Math.min(r,this.maxScrollLeft)),(null===this._destination||r!==this._destination.left||t!==this._destination.top)&&(this.__destination={top:t,left:r,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(e){this._destination&&this._setDestination(e)&&this._nativeScrollTo(this._destination)}managedScrollTo(e,t,r){return this._scrollTo(e,t,r),this._updateManagedScrollTo}correctScrollError(e){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(e),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(null!==this._destination){const{scrollTop:e,scrollLeft:t}=this;let{top:r,left:i}=this._destination;r=Math.min(r||0,this.maxScrollTop),i=Math.min(i||0,this.maxScrollLeft);const s=Math.abs(r-e),o=Math.abs(i-t);s<1&&o<1&&(this._end&&this._end(),this._resetScrollState())}}detach(e){return this._clients.delete(e),0===this._clients.size&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(e){this._clients.add(e),1===this._clients.size&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}}
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */let Gs="undefined"!=typeof window?window.ResizeObserver:void 0;const Ws=Symbol("virtualizerRef"),Zs="virtualizer-sizer";let _s;class $s{constructor(e){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!e)throw new Error("Virtualizer constructor requires a configuration object");if(!e.hostElement)throw new Error('Virtualizer configuration requires the "hostElement" property');this._init(e)}set items(e){Array.isArray(e)&&e!==this._items&&(this._itemsChanged=!0,this._items=e,this._schedule(this._updateLayout))}_init(e){this._isScroller=!!e.scroller,this._initHostElement(e);const t=e.layout||{};this._layoutInitialized=this._initLayout(t)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new Gs(()=>this._hostElementSizeChanged()),this._childrenRO=new Gs(this._childrenSizeChanged.bind(this))}_initHostElement(e){const t=this._hostElement=e.hostElement;this._applyVirtualizerStyles(),t[Ws]=this}connected(){this._initObservers();const e=this._isScroller;this._clippingAncestors=function(e,t=!1){let r=!1;return function(e,t=!1){const r=[];let i=t?e:to(e);for(;null!==i;)r.push(i),i=to(i);return r}(e,t).filter(e=>{if(r)return!1;const t=getComputedStyle(e);return r="fixed"===t.position,"visible"!==t.overflow})}
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */(this._hostElement,e),this._scrollerController=new Ks(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(e=>{e.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(e),this._hostElementRO.observe(e)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(e=>this._childrenRO.observe(e)),this._scrollEventListeners.forEach(e=>e.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){this._scrollEventListeners.forEach(e=>e.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const e=this._hostElement.style;e.display=e.display||"block",e.position=e.position||"relative",e.contain=e.contain||"size layout",this._isScroller&&(e.overflow=e.overflow||"auto",e.minHeight=e.minHeight||"150px")}_getSizer(){const e=this._hostElement;if(!this._sizer){let t=e.querySelector(`[${Zs}]`);t||(t=document.createElement("div"),t.setAttribute(Zs,""),e.appendChild(t)),Object.assign(t.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),t.textContent="&nbsp;",t.setAttribute(Zs,""),this._sizer=t}return this._sizer}async updateLayoutConfig(e){await this._layoutInitialized;const t=e.type||_s;if("function"==typeof t&&this._layout instanceof t){const t={...e};return delete t.type,this._layout.config=t,!0}return!1}async _initLayout(e){let t,r;if("function"==typeof e.type){r=e.type;const i={...e};delete i.type,t=i}else t=e;void 0===r&&(_s=r=(await Promise.resolve().then(function(){return Th})).FlowLayout),this._layout=new r(e=>this._handleLayoutMessage(e),t),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const e=window.performance.now(),t=e-this._benchmarkStart,r=performance.getEntriesByName("uv-virtualizing","measure").filter(t=>t.startTime>=this._benchmarkStart&&t.startTime<e).reduce((e,t)=>e+t.duration,0);return this._benchmarkStart=null,{timeElapsed:t,virtualizationTime:r}}return null}_measureChildren(){const e={},t=this._children,r=this._measureChildOverride||this._measureChild;for(let i=0;i<t.length;i++){const s=t[i],o=this._first+i;(this._itemsChanged||this._toBeMeasured.has(s))&&(e[o]=r.call(this,s,this._items[o]))}this._childMeasurements=e,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(e){const{width:t,height:r}=e.getBoundingClientRect();return Object.assign({width:t,height:r},function(e){const t=window.getComputedStyle(e);return{marginTop:eo(t.marginTop),marginRight:eo(t.marginRight),marginBottom:eo(t.marginBottom),marginLeft:eo(t.marginLeft)}}(e))}async _schedule(e){this._scheduled.has(e)||(this._scheduled.add(e),await Promise.resolve(),this._scheduled.delete(e),e.call(this))}async _updateDOM(e){this._scrollSize=e.scrollSize,this._adjustRange(e.range),this._childrenPos=e.childPositions,this._scrollError=e.scrollError||null;const{_rangeChanged:t,_itemsChanged:r}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(t||r)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(e=>this._childrenRO.observe(e)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(e){console.warn("Error measuring performance data: ",e)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(e){if("scroll"===e.type)(e.currentTarget===window||this._clippingAncestors.includes(e.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",e)}_handleLayoutMessage(e){"stateChanged"===e.type?this._updateDOM(e):"visibilityChanged"===e.type?(this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._notifyVisibility()):"unpinned"===e.type&&this._hostElement.dispatchEvent(new Xs)}get _children(){const e=[];let t=this._hostElement.firstElementChild;for(;t;)t.hasAttribute(Zs)||e.push(t),t=t.nextElementSibling;return e}_updateView(){const e=this._hostElement,t=this._scrollerController?.element,r=this._layout;if(e&&t&&r){let i,s,o,n;const a=e.getBoundingClientRect();i=0,s=0,o=window.innerHeight,n=window.innerWidth;const l=this._clippingAncestors.map(e=>e.getBoundingClientRect());l.unshift(a);for(const e of l)i=Math.max(i,e.top),s=Math.max(s,e.left),o=Math.min(o,e.bottom),n=Math.min(n,e.right);const c=t.getBoundingClientRect(),A={left:a.left-c.left,top:a.top-c.top},d={width:t.scrollWidth,height:t.scrollHeight},u=i-a.top+e.scrollTop,h=s-a.left+e.scrollLeft,p=Math.max(0,o-i),g=Math.max(0,n-s);r.viewportSize={width:g,height:p},r.viewportScroll={top:u,left:h},r.totalScrollSize=d,r.offsetWithinScroller=A}}_sizeHostElement(e){const t=82e5,r=e&&null!==e.width?Math.min(t,e.width):0,i=e&&null!==e.height?Math.min(t,e.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${r}px, ${i}px)`;else{const e=this._hostElement.style;e.minWidth=r?`${r}px`:"100%",e.minHeight=i?`${i}px`:"100%"}}_positionChildren(e){e&&e.forEach(({top:e,left:t,width:r,height:i,xOffset:s,yOffset:o},n)=>{const a=this._children[n-this._first];a&&(a.style.position="absolute",a.style.boxSizing="border-box",a.style.transform=`translate(${t}px, ${e}px)`,void 0!==r&&(a.style.width=r+"px"),void 0!==i&&(a.style.height=i+"px"),a.style.left=void 0===s?null:s+"px",a.style.top=void 0===o?null:o+"px")})}async _adjustRange(e){const{_first:t,_last:r,_firstVisible:i,_lastVisible:s}=this;this._first=e.first,this._last=e.last,this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==t||this._last!==r,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==i||this._lastVisible!==s}_correctScrollError(){if(this._scrollError){const{scrollTop:e,scrollLeft:t}=this._scrollerController,{top:r,left:i}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:e-r,left:t-i})}}element(e){return e===1/0&&(e=this._items.length-1),void 0===this._items?.[e]?void 0:{scrollIntoView:(t={})=>this._scrollElementIntoView({...t,index:e})}}_scrollElementIntoView(e){if(e.index>=this._first&&e.index<=this._last)this._children[e.index-this._first].scrollIntoView(e);else if(e.index=Math.min(e.index,this._items.length-1),"smooth"===e.behavior){const t=this._layout.getScrollIntoViewCoordinates(e),{behavior:r}=e;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(t,{behavior:r}),()=>this._layout.getScrollIntoViewCoordinates(e),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=e}else this._layout.pin=e}_checkScrollIntoViewTarget(e){const{index:t}=this._scrollIntoViewTarget||{};t&&e?.has(t)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new Ys({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new Ns({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((e,t)=>{this._layoutCompleteResolver=e,this._layoutCompleteRejecter=t})),this._layoutCompletePromise}_rejectLayoutCompletePromise(e){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(e),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(e){if(this._layout?.measureChildren){for(const t of e)this._toBeMeasured.set(t.target,t.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function eo(e){const t=e?parseFloat(e):NaN;return Number.isNaN(t)?0:t}function to(e){if(null!==e.assignedSlot)return e.assignedSlot;if(null!==e.parentElement)return e.parentElement;const t=e.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}const ro=e=>e,io=(e,t)=>Z`${t}: ${JSON.stringify(e,null,2)}`;const so=Te(class extends Vs{constructor(e){if(super(e),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,t)=>io(e,t+this._first),this._keyFunction=(e,t)=>ro(e,this._first),this._items=[],e.type!==Me)throw new Error("The virtualize directive can only be used in child expressions")}render(e){e&&this._setFunctions(e);const t=[];if(this._first>=0&&this._last>=this._first)for(let e=this._first;e<=this._last;e++)t.push(this._items[e]);return Js(t,this._keyFunction,this._renderItem)}update(e,[t]){this._setFunctions(t);const r=this._items!==t.items;return this._items=t.items||[],this._virtualizer?this._updateVirtualizerConfig(e,t):this._initialize(e,t),r?_:this.render()}async _updateVirtualizerConfig(e,t){if(!await this._virtualizer.updateLayoutConfig(t.layout||{})){const r=e.parentNode;this._makeVirtualizer(r,t)}this._virtualizer.items=this._items}_setFunctions(e){const{renderItem:t,keyFunction:r}=e;t&&(this._renderItem=(e,r)=>t(e,r+this._first)),r&&(this._keyFunction=(e,t)=>r(e,t+this._first))}_makeVirtualizer(e,t){this._virtualizer&&this._virtualizer.disconnected();const{layout:r,scroller:i,items:s}=t;this._virtualizer=new $s({hostElement:e,layout:r,scroller:i}),this._virtualizer.items=s,this._virtualizer.connected()}_initialize(e,t){const r=e.parentNode;r&&1===r.nodeType&&(r.addEventListener("rangeChanged",e=>{this._first=e.first,this._last=e.last,this.setValue(this.render())}),this._makeVirtualizer(r,t))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */class oo extends me{constructor(){super(...arguments),this.items=[],this.renderItem=io,this.keyFunction=ro,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){const{items:e,renderItem:t,keyFunction:r,layout:i,scroller:s}=this;return Z`${so({items:e,renderItem:t,keyFunction:r,layout:i,scroller:s})}`}element(e){return this[Ws]?.element(e)}get layoutComplete(){return this[Ws]?.layoutComplete}scrollToIndex(e,t="start"){this.element(e)?.scrollIntoView({block:t})}}e([xe({attribute:!1})],oo.prototype,"items",void 0),e([xe()],oo.prototype,"renderItem",void 0),e([xe()],oo.prototype,"keyFunction",void 0),e([xe({attribute:!1})],oo.prototype,"layout",void 0),e([xe({reflect:!0,type:Boolean})],oo.prototype,"scroller",void 0),customElements.get("lit-virtualizer")||customElements.define("lit-virtualizer",oo);class no{constructor(e){this.hass=e}set hass(e){e&&(this._hass=e)}get hass(){return this._hass}async actionPlayMedia(e,t,r){await this.hass.callService("media_player","play_media",{entity_id:e,media_content_id:t,media_content_type:r})}async actionPlayMediaFromService(e,t){const r=e.split(".");await this.hass.callService(r[0],r[1],{entity_id:t})}async actionEnqueueMedia(e,t,r,i){const s={entity_id:e,media_id:t,media_type:r},o=i==$t.RADIO?{...s,radio_mode:!0}:{...s,enqueue:i};await this.hass.callService("music_assistant","play_media",o)}async actionGetLibraryRecents(e,t,r=25){const i={type:"call_service",domain:"music_assistant",service:"get_library",service_data:{limit:r,config_entry_id:await this.getPlayerConfigEntry(e),media_type:t,order_by:"last_played_desc"},return_response:!0};return(await this.hass.callWS(i)).response.items}async actionGetLibrary(e,t,r=25,i=!0){const s={type:"call_service",domain:"music_assistant",service:"get_library",service_data:{..."boolean"==typeof i?{favorite:i}:{},limit:r,config_entry_id:await this.getPlayerConfigEntry(e),media_type:t},return_response:!0};return(await this.hass.callWS(s)).response.items}async actionSearchMedia(e,t,r,i=!1,s=20){const o={type:"call_service",domain:"music_assistant",service:"search",service_data:{limit:s,library_only:i,config_entry_id:await this.getPlayerConfigEntry(e),name:t,media_type:[r]},return_response:!0},n=await this.hass.callWS(o),a=r==er.RADIO?"radio":`${r}s`;return n.response[a]??[]}async actionGetRecommendations(e,t){const r={type:"call_service",domain:"mass_queue",service:"get_recommendations",service_data:{entity:e,...t?{providers:t}:{}},return_response:!0};return await this.hass.callWS(r)}async actionPlayRadio(e,t,r){await this.hass.callService("music_assistant","play_media",{entity_id:e,media_id:t,media_type:r,radio_mode:!0})}async actionGetPlaylistTracks(e,t){let r;if(t.includes(".")){const i=await this.actionGetPlayerInfo(t);if(!i)throw new Error(`Received nothing back when getting tracks for playlist ${e}!`);r=i.entries.mass_queue}else r=t;const i={type:"call_service",domain:"mass_queue",service:"get_playlist_tracks",service_data:{uri:e,config_entry_id:r},return_response:!0};return await this.hass.callWS(i)}async actionGetAlbumTracks(e,t){let r;if(t.includes(".")){const i=await this.actionGetPlayerInfo(t);if(!i)throw new Error(`Received nothing back when getting tracks for playlist ${e}!`);r=i.entries.mass_queue}else r=t;const i={type:"call_service",domain:"mass_queue",service:"get_album_tracks",service_data:{uri:e,config_entry_id:r},return_response:!0};return await this.hass.callWS(i)}async actionGetArtistTracks(e,t){let r;if(t.includes(".")){const i=await this.actionGetPlayerInfo(t);if(!i)throw new Error(`Received nothing back when getting tracks for playlist ${e}!`);r=i.entries.mass_queue}else r=t;const i={type:"call_service",domain:"mass_queue",service:"get_artist_tracks",service_data:{uri:e,config_entry_id:r},return_response:!0};return await this.hass.callWS(i)}async actionGetPodcastEpisodes(e,t){let r;if(t.includes(".")){const i=await this.actionGetPlayerInfo(t);if(!i)throw new Error(`Received nothing back when getting tracks for playlist ${e}!`);r=i.entries.mass_queue}else r=t;const i={type:"call_service",domain:"mass_queue",service:"get_podcast_episodes",service_data:{uri:e,config_entry_id:r},return_response:!0};return await this.hass.callWS(i)}async actionGetPlaylistData(e,t){let r;if(t.includes(".")){const i=await this.actionGetPlayerInfo(t);if(!i)throw new Error(`Received nothing back when getting tracks for playlist ${e}!`);r=i.entries.mass_queue}else r=t;const i={type:"call_service",domain:"mass_queue",service:"get_playlist",service_data:{uri:e,config_entry_id:r},return_response:!0};return await this.hass.callWS(i)}async actionGetAlbumData(e,t){let r;if(t.includes(".")){const i=await this.actionGetPlayerInfo(t);if(!i)throw new Error(`Received nothing back when getting tracks for album ${e}!`);r=i.entries.mass_queue}else r=t;const i={type:"call_service",domain:"mass_queue",service:"get_album",service_data:{uri:e,config_entry_id:r},return_response:!0};return await this.hass.callWS(i)}async actionGetArtistData(e,t){let r;if(t.includes(".")){const i=await this.actionGetPlayerInfo(t);if(!i)throw new Error(`Received nothing back when getting tracks for album ${e}!`);r=i.entries.mass_queue}else r=t;const i={type:"call_service",domain:"mass_queue",service:"get_artist",service_data:{uri:e,config_entry_id:r},return_response:!0};return await this.hass.callWS(i)}async actionGetPodcastData(e,t){let r;if(t.includes(".")){const i=await this.actionGetPlayerInfo(t);if(!i)throw new Error(`Received nothing back when getting episodes for podcast ${e}!`);r=i.entries.mass_queue}else r=t;const i={type:"call_service",domain:"mass_queue",service:"get_podcast",service_data:{uri:e,config_entry_id:r},return_response:!0};return await this.hass.callWS(i)}async actionRemovePlaylistTrack(e,t,r){let i;if(r.includes(".")){const e=await this.actionGetPlayerInfo(r);if(!e)throw new Error(`Received nothing back when getting config entry for ${r}!`);i=e.entries.mass_queue}else i=r;const s={type:"call_service",domain:"mass_queue",service:"remove_playlist_tracks",service_data:{playlist_id:e,positions_to_remove:[t],config_entry_id:i}};await this.hass.callWS(s)}async getPlayerConfigEntry(e){return(await this.hass.callWS({type:"config/entity_registry/get",entity_id:e})).config_entry_id}async actionGetPlayerInfo(e){const t={type:"mass_queue/get_info",entity_id:e};return await this.hass.callWS(t)}}const{EventPart:ao}=Ti,lo={h:(e=>e)`
      <div class="marquee-container">
        <span class="marquee-text"><slot></slot></span>
      </div>
    `,parts:[{type:1,index:0,name:"mouseenter",strings:["",""],ctor:ao},{type:1,index:0,name:"mouseleave",strings:["",""],ctor:ao},{type:1,index:0,name:"touchstart",strings:["",""],ctor:ao},{type:1,index:0,name:"touchend",strings:["",""],ctor:ao}]};class co extends me{constructor(){super(...arguments),this.speed=15,this.pauseDuration=1e3,this.pauseOnHover=!1,this._direction="left",this._position=0,this._maxOffset=0,this._animate=()=>{if(!this._container||!this._textSpan)return;const e=this.speed*(1/60);let t=!1;"left"===this._direction?(this._position-=e,this._position<=-this._maxOffset&&(this._position=-this._maxOffset,this._direction="right",t=!0)):(this._position+=e,this._position>=0&&(this._position=0,this._direction="left",t=!0)),this._textSpan.style.transform=`translateX(${this._position.toString()}px)`,t?this._pauseTimeout=window.setTimeout(()=>{this._pauseTimeout=void 0,this._animationFrame=requestAnimationFrame(this._animate)},this.pauseDuration):this._animationFrame=requestAnimationFrame(this._animate)},this._handleMouseEnter=()=>{this.pauseOnHover&&this._animationFrame&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0),this.pauseOnHover&&this._pauseTimeout&&(clearTimeout(this._pauseTimeout),this._pauseTimeout=void 0)},this._handleMouseLeave=()=>{!this.pauseOnHover||this._animationFrame||this._pauseTimeout||this._animate()}}firstUpdated(e){super.firstUpdated(e),setTimeout(()=>{this._setupAnimation()},50)}updated(e){super.updated(e),e.has("text")&&this._setupAnimation()}disconnectedCallback(){super.disconnectedCallback(),this._animationFrame&&cancelAnimationFrame(this._animationFrame),this._pauseTimeout&&(clearTimeout(this._pauseTimeout),this._pauseTimeout=void 0)}render(){return{_$litType$:lo,values:[this._handleMouseEnter,this._handleMouseLeave,this._handleMouseEnter,this._handleMouseLeave]}}_setupAnimation(){this._container&&this._textSpan&&(this._position=0,this._direction="left",this._maxOffset=Math.max(0,this._textSpan.offsetWidth-this._container.offsetWidth),this._textSpan.style.transform="translateX(0px)",this._animationFrame&&cancelAnimationFrame(this._animationFrame),this._pauseTimeout&&(clearTimeout(this._pauseTimeout),this._pauseTimeout=void 0),this._animate())}static{this.styles=p`
    :host {
      display: block;
      overflow: hidden;
      width: 100%;
    }

    .marquee-container {
      width: 100%;
      white-space: nowrap;
      overflow: hidden;
      user-select: none;
      cursor: default;
    }

    .marquee-text {
      display: inline-block;
      vertical-align: middle;
      will-change: transform;
      font-size: 1em;
      pointer-events: none;
    }
  `}}e([xe({type:Number})],co.prototype,"speed",void 0),e([xe({type:Number,attribute:"pause-duration"})],co.prototype,"pauseDuration",void 0),e([xe({type:Boolean,attribute:"pause-on-hover"})],co.prototype,"pauseOnHover",void 0),e([Se(".marquee-container")],co.prototype,"_container",void 0),e([Se(".marquee-text")],co.prototype,"_textSpan",void 0),customElements.define("mpc-marquee-text",co);var Ao=p`
  mpc-menu-button::part(menu-select-menu) {
    --control-select-menu-background-opacity: 0;
    width: 2.5em;
    margin-top: var(--md-list-item-top-space);
    margin-bottom: var(--md-list-item-bottom-space);
  }
  .button.expressive {
    border-radius: var(--default-border-radius);
  }
  .button {
    border-radius: var(--media-row-border-radius);
    margin: 0.15rem;
    height: var(--media-row-height);
  }
  .divider {
    --divider-color: var(--md-sys-color-surface-variant);
  }
  .divider::before {
    content: " ";
    display: block;
    height: 1px;
    background-color: var(--divider-color);
    margin-left: 64px;
    margin-right: 24px;
  }
  .menu-button {
    height: 100%;
    padding-right: 8px;
    position: absolute;
    right: 0;
    place-content: center;
  }
  .thumbnail {
    width: var(--media-row-thumbnail-height);
    height: var(--media-row-thumbnail-height);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left;
    border-radius: var(--media-row-thumbnail-border-radius);
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  .title.expressive {
    font-family: var(--expressive-font-family);
    font-variation-settings: "ROND" 100;
    text-transform: uppercase;
  }
  .title.track.expressive {
    font-size: 1.3em;
    font-stretch: 25%;
    font-weight: 500;
  }
  .title.artist.expressive {
    font-size: 1.2em;
    font-stretch: 30%;
    font-weight: 275;
  }
`;const{AttributePart:uo,PropertyPart:ho,EventPart:po}=Ti,go=e=>e,mo={h:go`
      <div>
        <?>
      
    </div>`,parts:[{type:1,index:0,name:"class",strings:["title track ",""],ctor:uo},{type:2,index:1}]},vo={h:go`
      <div>
        <?>
      
    </div>`,parts:[{type:1,index:0,name:"class",strings:["title artist ",""],ctor:uo},{type:2,index:1}]},fo={h:go`
      <span slot="end" class="menu-button">
          <mpc-menu-button id="menu-button" fixedmenuposition="" naturalmenuwidth="" scheme="plain" outlined="" elevation="0">
          </mpc-menu-button>
        
      </span>
    `,parts:[{type:1,index:0,name:"click",strings:["",""],ctor:po},{type:1,index:1,name:"iconPath",strings:["",""],ctor:ho},{type:1,index:1,name:"menu-item-selected",strings:["",""],ctor:po},{type:1,index:1,name:"items",strings:["",""],ctor:ho}]},yo={h:go`
      <img class="thumbnail" slot="start" loading="lazy">
    `,parts:[{type:1,index:0,name:"src",strings:["",""],ctor:uo},{type:1,index:0,name:"error",strings:["",""],ctor:po}]},bo={h:go`
      <ha-md-list-item type="button">
        <?>
        <span slot="headline" id="headline">
          <?> <?>
        </span>
        <?>
      </ha-md-list-item>
      <?>
    `,parts:[{type:1,index:0,name:"class",strings:["button "," ",""],ctor:uo},{type:1,index:0,name:"click",strings:["",""],ctor:po},{type:2,index:1},{type:2,index:3},{type:2,index:4},{type:2,index:5},{type:2,index:6}]},wo={h:go`<div class="divider"></div>`,parts:[]};let Eo=class extends me{constructor(){super(...arguments),this.divider=!1,this.playlist=!1,this.imagesExhausted=!1,this.enqueueTrack=e=>{const t=this.activeEntityId;this.browserActions.actionEnqueueMedia(t,this.track.media_content_id,"music",e)},this.onPlaylistItemSelected=e=>{e.stopPropagation(),this.playTrackEnqueuePlaylist()},this.onMenuItemSelected=e=>{e.stopPropagation();const t=e.detail.option;"remove"==t?this.removeTrackFromPlaylist():this.enqueueTrack(t)},this._renderThumbnailFallback=()=>{const e=this.thumbnailElement.src,t=Ur(this.hass,e,this.defaultImageURL??"",this.fallbackImageURL,ir.CLEFT);this.thumbnailElement.src=t,t!=e?this.imagesExhausted&&(this.thumbnailElement.onerror=null):this.imagesExhausted=!0}}set hass(e){this._hass=e,this.getTrackImage()}get hass(){return this._hass}set track(e){this._track=e,this.getTrackImage()}get track(){return this._track}get browserActions(){return this._browserActions??=new no(this.hass),this._browserActions}set Icons(e){this._Icons=e,this.setEnqueueButtons()}get Icons(){return this._Icons}set enqueueButtons(e){this._enqueueButtons=e,this.setEnqueueButtons()}get enqueueButtons(){return this._enqueueButtons}setEnqueueButtons(){if(!this._enqueueButtons||!this.Icons?.CLOSE||!this.playlist)return;const e=this._enqueueButtons;let t=!0;if(e&&(t=-1==e.findIndex(e=>"remove"==e.option)),t){const e={option:"remove",icon:this.Icons.CLOSE,title:cr("browser.playlists.remove_track",this.hass)};this._enqueueButtons=[...this._enqueueButtons,e]}}async getTrackImage(){if(!this.hass)return;const e=this.track.local_image_encoded?.length?this.track.local_image_encoded:void 0,t=this.track.media_image.length>0?this.track.media_image:void 0,r=await Or(this.hass,e??"",t??ir.CLEFT,this.cardConfig.download_local,this.cardConfig.proxy_all_artwork);this.defaultImageURL=r.image_url,this.fallbackImageURL=r.fallback_url}async playTrackEnqueuePlaylist(){const e=this.activeEntityId,t=this.browserActions,r=this.track.media_content_id,i=gr[this.browserConfig.default_enqueue_option];await t.actionEnqueueMedia(e,r,"music",i==$t.RADIO?$t.PLAY_NOW:i),await t.actionEnqueueMedia(e,this.collectionURI,"playlist",$t.PLAY_NEXT)}removeTrackFromPlaylist(){const e=this.collectionURI.split("//")[1].split("/")[1],t=this.track.position;this.browserActions.actionRemovePlaylistTrack(e,t,this.activeEntityId);const r={detail:{playlist:this.collectionURI,position:t}},i=new CustomEvent("playlist-track-removed",r);this.dispatchEvent(i)}renderTitle(){return{_$litType$:mo,values:[this.useExpressive?"expressive":"",this.track.media_title]}}renderArtist(){return{_$litType$:vo,values:[this.useExpressive?"expressive":"",this.track.media_artist]}}renderMenuButton(){return{_$litType$:fo,values:[e=>{e.stopPropagation()},this.Icons?.OVERFLOW,this.onMenuItemSelected,this.enqueueButtons]}}renderThumbnail(){const e=this.defaultImageURL?.length?this.defaultImageURL:this.fallbackImageURL?.length?this.fallbackImageURL:Tr(this.hass,ir.CLEFT);return{_$litType$:yo,values:[e,this._renderThumbnailFallback]}}render(){const e=this.useExpressive?"expressive":"",t=this.useVibrant?"vibrant":"";return{_$litType$:bo,values:[e,t,this.onPlaylistItemSelected,this.renderThumbnail(),this.renderTitle(),this.renderArtist(),this.renderMenuButton(),this.divider?{_$litType$:wo,values:[]}:""]}}shouldUpdate(e){return e.size>0}static get styles(){return Ao}};e([xe({attribute:!1})],Eo.prototype,"_track",void 0),e([xe({attribute:"divider",type:Boolean})],Eo.prototype,"divider",void 0),e([xe({attribute:"playlist",type:Boolean})],Eo.prototype,"playlist",void 0),e([Pe()],Eo.prototype,"defaultImageURL",void 0),e([Se(".thumbnail")],Eo.prototype,"thumbnailElement",void 0),e([xe({attribute:!1})],Eo.prototype,"collectionURI",void 0),e([a({context:Ai,subscribe:!0})],Eo.prototype,"browserConfig",void 0),e([a({context:ni,subscribe:!0})],Eo.prototype,"cardConfig",void 0),e([a({context:bi,subscribe:!0})],Eo.prototype,"useExpressive",void 0),e([a({context:wi,subscribe:!0})],Eo.prototype,"useVibrant",void 0),e([a({context:Zr,subscribe:!0})],Eo.prototype,"_hass",void 0),e([a({context:$r,subscribe:!0})],Eo.prototype,"activeEntityId",void 0),e([xe({attribute:!1})],Eo.prototype,"track",null),e([a({context:Ei,subscribe:!0})],Eo.prototype,"Icons",null),e([xe({attribute:!1})],Eo.prototype,"enqueueButtons",null),Eo=e([Ce("mpc-collection-track-row")],Eo);const{AttributePart:Co,PropertyPart:Io,BooleanAttributePart:Bo,EventPart:xo}=Ti,Po=e=>e,Do={h:Po`
      <img id="img-header" class="thumbnail" loading="lazy">
    `,parts:[{type:1,index:0,name:"src",strings:["",""],ctor:Co},{type:1,index:0,name:"error",strings:["",""],ctor:xo}]},So={h:Po`
      <mpc-marquee-text id="title">
        <div id="title-text"><?></div>
      </mpc-marquee-text>
    `,parts:[{type:1,index:0,name:"class",strings:["",""],ctor:Co},{type:2,index:2}]},ko={h:Po`<!--?-->`,parts:[]},Ro={h:Po`
      <mpc-menu-button id="enqueue-button" naturalmenuwidth="" elevation="1" scheme="plain"></mpc-menu-button>
    `,parts:[{type:1,index:0,name:"iconPath",strings:["",""],ctor:Io},{type:1,index:0,name:"items",strings:["",""],ctor:Io},{type:1,index:0,name:"menu-item-selected",strings:["",""],ctor:xo}]},Qo={h:Po`
      <mpc-collection-track-row></mpc-collection-track-row>
    `,parts:[{type:1,index:0,name:"track",strings:["",""],ctor:Io},{type:1,index:0,name:"divider",strings:["",""],ctor:Bo},{type:1,index:0,name:"collectionURI",strings:["",""],ctor:Io},{type:1,index:0,name:"enqueueButtons",strings:["",""],ctor:Io}]},Mo={h:Po`
        <link href="https://cdn.jsdelivr.net/npm/beercss@4.0.20/dist/cdn/beer.min.css" rel="stylesheet">
        <div id="browser-view" style="height: 100%;">
          <div class="shape loading-indicator extra"></div>
        </div>
      `,parts:[]},Ho={h:Po`
      <div id="virtualizer">
        <div id="tracks-padding"></div>
        <lit-virtualizer id="browser-view"></lit-virtualizer>
      </div>
    `,parts:[{type:1,index:2,name:"items",strings:["",""],ctor:Io},{type:1,index:2,name:"renderItem",strings:["",""],ctor:Io}]},Oo={h:Po`
      <div id="container">
        <div id="header">
          <?>
        </div>
          <div>
            <div id="tracks">
              <?>
            </div>
          </div>
        </div>
      
    `,parts:[{type:1,index:0,name:"class",strings:[""," ",""],ctor:Co},{type:2,index:2},{type:1,index:3,name:"id",strings:["tracks-container ",""],ctor:Co},{type:1,index:4,name:"class",strings:["",""],ctor:Co},{type:2,index:5}]};class To extends me{constructor(){super(...arguments),this.animationsAdded=!1,this.onEnqueue=e=>{if(!this.collectionData)return;e.stopPropagation();const t=e.detail.option;this.onEnqueueAction(this.collectionData,t)},this._renderImageFallback=e=>{e.target.src=Tr(this.hass,ir.PLAYLIST)}}set browserConfig(e){this._browserConfig=e}get browserConfig(){return this._browserConfig}set activeEntityConf(e){this._activeEntityConf=e}get activeEntityConf(){return this._activeEntityConf}set Icons(e){this._Icons=e}get Icons(){return this._Icons}set hass(e){if(!this._hass)return this._hass=e,this.getTracks(),void this.getCollectionImage();this._hass=e}get hass(){return this._hass}set activePlayer(e){if(!this.activePlayer)return this._activePlayer=e,void this.getTracks();this._activePlayer=e}get activePlayer(){return this._activePlayer}set collectionData(e){this._collectionData=e,this.collectionImageURL=e?.media_image??"",this.getTracks(),this.getCollectionImage()}get collectionData(){return this._collectionData}setHiddenElements(){this.activeEntityConf&&this.browserConfig&&this.updateEnqueueButtons()}getTracks(){}async getCollectionImage(){if(!this.hass||!this.collectionData)return;const e=await Or(this.hass,this.collectionData.media_image,ir.PLAYLIST,this.cardConfig.download_local,this.cardConfig.proxy_all_artwork);this.collectionImageURL=e.image_url.length>0?e.image_url:e.fallback_url}get browserActions(){return this._browserActions??=new no(this.hass),this._browserActions}addScrollAnimation(e,t){const r=(this.headerElement?.offsetHeight??0)*(1/3)/(this.virtElement?.scrollHeight??1),i=[{...e,offset:r},{...e,offset:1}],s=new window.ScrollTimeline({source:this.virtDiv}),o=t.animate(i,{timeline:s,direction:"normal",iterations:1});return o.play(),o}animateHeaderElement(){this.addScrollAnimation({height:"var(--view-header-min-height)"},this.headerElement)}animateTracksElement(){const e={top:"8em"};this.addScrollAnimation(e,this.virtDiv),this.addScrollAnimation(e,this.tracksElement),this.addScrollAnimation({height:"4em"},this.padElement)}animateHeaderTitle(){this.addScrollAnimation({fontSize:"2em",fontWeight:"500",top:"0em"},this.titleElement)}animateHeaderEnqueue(){const e=this.enqueueElement?.shadowRoot?.querySelector(".svg-menu"),t=this.enqueueElement?.shadowRoot?.querySelector("#menu-select-menu")?.shadowRoot?.querySelector(".select-anchor");if(e){this.enqueueIconElement=e;const t={height:"var(--header-collapsed-menu-icon-size)",width:"var(--header-collapsed-menu-icon-size)"};this.addScrollAnimation(t,this.enqueueIconElement)}if(t){this.enqueueControlElement=t;const e={height:"var(--header-collapsed-menu-control-size)"};this.addScrollAnimation(e,this.enqueueControlElement)}}animateHeaderImage(){this.addScrollAnimation({height:"var(--collection-image-div-collapsed-height)"},this.imageDivElement)}updateEnqueueButtons(){if(!this.Icons)return;const e=dr(this.Icons,this.hass),t=fs,r=e.filter(e=>{const r=t[e.option];return!this.hide[r]});this._enqueue_buttons=r}renderImage(){const e=this.collectionImageURL;return{_$litType$:Do,values:[e,this._renderImageFallback]}}renderTitle(){const e=this.useExpressive?"expressive":"";return{_$litType$:So,values:[e,this.collectionData?.media_title]}}renderHeader(){return{_$litType$:ko,values:[]}}renderEnqueue(){return{_$litType$:Ro,values:[this.Icons?.PLAY_CIRCLE,this._enqueue_buttons,this.onEnqueue]}}renderTrack(e,t){return We({_$litType$:Qo,values:[e,t,this.collectionData?.media_content_id,this._enqueue_buttons]})}renderTracks(){return this.tracks?.length?{_$litType$:Ho,values:[this.tracks,e=>this.renderTrack(e,!0)]}:{_$litType$:Mo,values:[]}}render(){const e=this.useExpressive?"expressive":"",t=this.useVibrant?"vibrant":"",r=this.tracks?.length?"":"no-scroll";return{_$litType$:Oo,values:[e,t,this.renderHeader(),e,r,this.renderTracks()]}}shouldUpdate(e){return e.size>0}updated(){this.animationsAdded||this.testAnimation()}async testAnimation(e=50){}}e([Se("#title")],To.prototype,"titleElement",void 0),e([Se("#enqueue-button")],To.prototype,"enqueueElement",void 0),e([Se("#collection-image")],To.prototype,"imageDivElement",void 0),e([Se("lit-virtualizer")],To.prototype,"virtElement",void 0),e([Se("#virtualizer")],To.prototype,"virtDiv",void 0),e([Se("#tracks")],To.prototype,"tracksElement",void 0),e([Se("#tracks-padding")],To.prototype,"padElement",void 0),e([Se("#header")],To.prototype,"headerElement",void 0),e([a({context:Qi,subscribe:!0})],To.prototype,"hide",void 0),e([a({context:ni,subscribe:!0})],To.prototype,"cardConfig",void 0),e([a({context:Ai,subscribe:!0})],To.prototype,"browserConfig",null),e([a({context:_r,subscribe:!0})],To.prototype,"activeEntityConf",null),e([a({context:Ei,subscribe:!0})],To.prototype,"Icons",null),e([Pe()],To.prototype,"tracks",void 0),e([a({context:bi})],To.prototype,"useExpressive",void 0),e([a({context:wi})],To.prototype,"useVibrant",void 0),e([a({context:Zr,subscribe:!0})],To.prototype,"hass",null),e([a({context:ti,subscribe:!0})],To.prototype,"activePlayer",null),e([xe({attribute:!1})],To.prototype,"collectionData",null);const{AttributePart:Lo}=Ti,qo=e=>e,Uo={h:qo`
      <div id="collection-image">
        <?>
        <div id="enqueue"><?></div>
      </div>
      <div id="overview"><?></div>
    `,parts:[{type:2,index:1},{type:2,index:3},{type:2,index:5}]},Fo={h:qo`
      <?>
      <div id="collection-info">
        <div id="tracks-length"><?></div>
        <div id="playlist-duration">
          <?>
        </div>
        <div id="playlist-owner"><?></div>
      </div>
    `,parts:[{type:2,index:0},{type:1,index:2,name:"class",strings:["",""],ctor:Lo},{type:2,index:3},{type:1,index:4,name:"class",strings:["",""],ctor:Lo},{type:2,index:5},{type:1,index:6,name:"class",strings:["",""],ctor:Lo},{type:2,index:7}]};let Vo=class extends To{constructor(){super(...arguments),this.playlistDuration=0,this.onTrackRemoved=e=>{const t=e.detail.position,r=this.tracks.filter(e=>e.position!=t).map(e=>(e.position>t&&(e.position-=1),e));this.tracks=r}}getTracks(){this.hass&&this.collectionData&&this.activePlayer&&(this.browserActions.actionGetPlaylistTracks(this.collectionData.media_content_id,this.activePlayer.entity_id).then(e=>{this.tracks=e.response.tracks;let t=0;this.tracks.forEach(e=>{t+=e.duration??0}),this.playlistDuration=t}),this.setHiddenElements(),this.getPlaylistMetadata())}async getPlaylistMetadata(){if(!this.hass||!this.collectionData||!this.activePlayer)return;const e=await this.browserActions.actionGetPlaylistData(this.collectionData.media_content_id,this.activePlayer.entity_id);this.playlistMetadata=e}animateHeaderInfo(){this.addScrollAnimation({fontSize:"0.8em"},this.infoElement)}animateHeader(){this.animateHeaderElement(),this.animateHeaderImage(),this.animateHeaderTitle(),this.animateHeaderInfo(),this.animateHeaderEnqueue(),this.animateTracksElement()}renderHeader(){return{_$litType$:Uo,values:[this.renderImage(),this.renderEnqueue(),this.renderOverview()]}}renderOverview(){const e=cr("browser.collections.track_count",this.hass),t=cr("browser.loading",this.hass),r=cr("browser.collections.playlist.unknown_owner",this.hass),i=this.tracks?.length?`${this.tracks.length.toString()} ${e}`:t,s=this.playlistMetadata?.response.owner??r,o=this.useExpressive?"expressive":"";return{_$litType$:Fo,values:[this.renderTitle(),o,i,o,Kr(this.playlistDuration),o,s]}}async testAnimation(e=50){if(await Xr(e),!this.animationsAdded&&(this.virtElement?.scrollHeight??0)>(this.tracksElement?.offsetHeight??1)&&this.titleElement&&this.infoElement&&this.enqueueElement&&this.imageDivElement)this.animationsAdded=!0,this.animateHeader();else{if(e>1e3)return;await this.testAnimation(2*e)}}static get styles(){return[Hs,Ms]}};e([Se("#collection-info")],Vo.prototype,"infoElement",void 0),e([Pe()],Vo.prototype,"playlistMetadata",void 0),Vo=e([Ce("mpc-collection-playlist-view")],Vo);var zo=p`
  #collection-artists {
    font-size: 1.5em;
    margin-right: 0.5em;
    font-style: italic;
  }
  #collection-year {
    margin-right: 0.5em;
    font-style: italic;
  }
  #collection-artists.expressive,
  #collection-year.expressive {
    font-family: var(--expressive-font-family);
  }
  #collection-artists::not(.expressive),
  #collection-year::not(.expressive) {
    font-family: "Roboto", sans-serif;
  }
`;const{AttributePart:Jo}=Ti,Yo=e=>e,No={h:Yo`
      <div id="collection-image">
        <?>
        <div id="enqueue"><?></div>
      </div>
      <div id="overview"><?></div>
    `,parts:[{type:2,index:1},{type:2,index:3},{type:2,index:5}]},Xo={h:Yo`
      <?>
      <div id="collection-info">
        <div id="collection-artists">
          <?>
        </div>
        <div id="tracks-length"><?></div>
        <div id="collection-year">
          <?>
        </div>
      </div>
    `,parts:[{type:2,index:0},{type:1,index:2,name:"class",strings:["",""],ctor:Jo},{type:2,index:3},{type:1,index:4,name:"class",strings:["",""],ctor:Jo},{type:2,index:5},{type:1,index:6,name:"class",strings:["",""],ctor:Jo},{type:2,index:7}]};let jo=class extends To{getTracks(){this.hass&&this.collectionData&&this.activePlayer&&(this.browserActions.actionGetAlbumTracks(this.collectionData.media_content_id,this.activePlayer.entity_id).then(e=>{this.tracks=e.response.tracks}),this.setHiddenElements(),this.getMetadata())}async getMetadata(){if(!this.hass||!this.collectionData||!this.activePlayer)return;const e=await this.browserActions.actionGetAlbumData(this.collectionData.media_content_id,this.activePlayer.entity_id);this.albumMetadata=e}animateHeaderInfo(){this.addScrollAnimation({fontSize:"0.7em"},this.infoElement)}animateHeader(){this.animateHeaderElement(),this.animateHeaderImage(),this.animateHeaderTitle(),this.animateHeaderInfo(),this.animateHeaderEnqueue()}renderHeader(){return{_$litType$:No,values:[this.renderImage(),this.renderEnqueue(),this.renderOverview()]}}renderOverview(){const e=cr("browser.collections.track_count",this.hass),t=cr("browser.loading",this.hass),r=this.tracks?.length?`${this.tracks.length.toString()} ${e}`:t,i=this.albumMetadata?.response,s=(i?.artists??[]).map(e=>e.name),o=s.length>0?s.join(", "):t,n=this.useExpressive?"expressive":"";return{_$litType$:Xo,values:[this.renderTitle(),n,o,n,r,n,this.albumMetadata?.response.year??""]}}async testAnimation(e=50){if(await Xr(e),!this.animationsAdded&&(this.virtElement?.scrollHeight??0)>(this.tracksElement?.offsetHeight??1)&&this.titleElement&&this.infoElement&&this.enqueueElement&&this.imageDivElement)this.animationsAdded=!0,this.animateHeader();else{if(e>1e3)return;await this.testAnimation(2*e)}}static get styles(){return[zo,Ms]}};e([Se("#collection-info")],jo.prototype,"infoElement",void 0),e([Se("#collection-artists")],jo.prototype,"artistsElement",void 0),e([Pe()],jo.prototype,"albumMetadata",void 0),jo=e([Ce("mpc-collection-album-view")],jo);var Ko=p``;const{AttributePart:Go}=Ti,Wo=e=>e,Zo={h:Wo`
      <div id="collection-image">
        <?>
        <div id="enqueue"><?></div>
      </div>
      <div id="overview"><?></div>
    `,parts:[{type:2,index:1},{type:2,index:3},{type:2,index:5}]},_o={h:Wo`
      <?>
      <div id="collection-info">
        <div id="tracks-length"><?></div>
      </div>
    `,parts:[{type:2,index:0},{type:1,index:2,name:"class",strings:["",""],ctor:Go},{type:2,index:3}]};let $o=class extends To{getTracks(){this.hass&&this.collectionData&&this.activePlayer&&(this.browserActions.actionGetArtistTracks(this.collectionData.media_content_id,this.activePlayer.entity_id).then(e=>{this.tracks=e.response.tracks}),this.setHiddenElements(),this.getMetadata())}async getMetadata(){if(!this.hass||!this.collectionData||!this.activePlayer)return;const e=await this.browserActions.actionGetArtistData(this.collectionData.media_content_id,this.activePlayer.entity_id);this.artistMetadata=e}animateHeaderInfo(){this.addScrollAnimation({fontSize:"0.7em"},this.infoElement)}animateHeader(){this.animateHeaderElement(),this.animateHeaderImage(),this.animateHeaderTitle(),this.animateHeaderInfo(),this.animateHeaderEnqueue()}renderHeader(){return{_$litType$:Zo,values:[this.renderImage(),this.renderEnqueue(),this.renderOverview()]}}renderOverview(){const e=cr("browser.collections.track_count",this.hass),t=cr("browser.loading",this.hass),r=this.tracks?.length?`${this.tracks.length.toString()} ${e}`:t,i=this.useExpressive?"expressive":"";return{_$litType$:_o,values:[this.renderTitle(),i,r]}}async testAnimation(e=50){if(await Xr(e),!this.animationsAdded&&(this.virtElement?.scrollHeight??0)>(this.tracksElement?.offsetHeight??1)&&this.titleElement&&this.infoElement&&this.enqueueElement&&this.imageDivElement)this.animationsAdded=!0,this.animateHeader();else{if(e>1e3)return;await this.testAnimation(2*e)}}static get styles(){return[Ko,Ms]}};e([Se("#collection-info")],$o.prototype,"infoElement",void 0),e([Se("#collection-artists")],$o.prototype,"artistsElement",void 0),e([Pe()],$o.prototype,"artistMetadata",void 0),$o=e([Ce("mpc-collection-artist-view")],$o);var en=p`
  #collection-description {
    padding-top: 8px;
    font-family: var(--expressive-font-family);
  }
`;const{AttributePart:tn}=Ti,rn=e=>e,sn={h:rn`
      <div id="collection-image">
        <?>
        <div id="enqueue"><?></div>
      </div>
      <div id="overview"><?></div>
    `,parts:[{type:2,index:1},{type:2,index:3},{type:2,index:5}]},on={h:rn`
      <?>
      <div id="collection-info">
        <div id="tracks-length"><?></div>
        <div id="collection-description"><?></div>
      </div>
    `,parts:[{type:2,index:0},{type:1,index:2,name:"class",strings:["",""],ctor:tn},{type:2,index:3},{type:2,index:5}]};let nn=class extends To{getTracks(){if(!this.hass||!this.collectionData||!this.activePlayer)return;this.browserActions.actionGetPodcastEpisodes(this.collectionData.media_content_id,this.activePlayer.entity_id).then(t=>{this.podcastMetadata||(this.tracks=t.response.episodes);const r=t.response.episodes.map(t=>(t.media_image=t.media_image.length>0?t.media_image:e,t));this.tracks=r});const e=this.collectionData.media_image;this.setHiddenElements(),this.getPodcastMetadata()}async getPodcastMetadata(){if(!this.hass||!this.collectionData||!this.activePlayer)return;const e=await this.browserActions.actionGetPodcastData(this.collectionData.media_content_id,this.activePlayer.entity_id);this.podcastMetadata=e}animateHeaderInfo(){this.addScrollAnimation({fontSize:"0.8em"},this.infoElement)}animateHeader(){this.animateHeaderElement(),this.animateHeaderImage(),this.animateHeaderTitle(),this.animateHeaderInfo(),this.animateHeaderEnqueue()}renderHeader(){return{_$litType$:sn,values:[this.renderImage(),this.renderEnqueue(),this.renderOverview()]}}renderOverview(){const e=cr("browser.collections.track_count",this.hass),t=cr("browser.loading",this.hass),r=this.tracks?.length?`${this.tracks.length.toString()} ${e}`:t,i=this.podcastMetadata?.response.metadata.description??"",s=this.useExpressive?"expressive":"";return{_$litType$:on,values:[this.renderTitle(),s,r,i]}}async testAnimation(e=50){if(await Xr(e),!this.animationsAdded&&(this.virtElement?.scrollHeight??0)>(this.tracksElement?.offsetHeight??1)&&this.titleElement&&this.infoElement&&this.enqueueElement&&this.imageDivElement)this.animationsAdded=!0,this.animateHeader();else{if(e>1e3)return;await this.testAnimation(2*e)}}static get styles(){return[en,Ms]}};e([Se("#collection-info")],nn.prototype,"infoElement",void 0),e([Pe()],nn.prototype,"podcastMetadata",void 0),nn=e([Ce("mpc-collection-podcast-view")],nn);var an=p`
  .button.min::part(button),
  #filter-menu {
    --button-button-height: 35px;
    --button-button-width: 35px;
    --button-padding: 0px;
  }
  #filter-menu {
    --menu-button-border-radius: var(--button-small-border-radius);
  }
  #filter-menu.expressive::part(menu-select-menu) {
    box-shadow: var(--md-sys-elevation-level1);
  }
  .button.expressive .header-icon,
  #filter-menu.expressive::part(menu-svg),
  .menu-expressive::part(menu-svg) {
    color: var(--md-sys-color-on-primary);
  }

  #container {
    box-shadow: unset;
    overflow: hidden;
    height: 100%;
  }
  .container.expressive {
    border-radius: var(--expressive-border-radius-container);
    background-color: var(--expressive-color-container);
  }
  #filter-menu::part(menu-list-item-svg) {
    height: 2em;
    width: 2em;
  }
  #filter-menu::part(menu-select-menu) {
    --mdc-icon-size: 1.5em;
    --control-select-menu-padding: 0px;
    --control-select-menu-height: 35px;
    width: 35px;
  }
  #filter-menu::part(menu-svg) {
    height: 30px;
    width: 30px;
  }
  #filter-menu:not(.expressive)::part(menu-select-menu) {
    --control-select-menu-background-color: var(
      --md-sys-color-secondary-container
    );
    background-color: var(--md-sys-color-secondary-container);
  }
  #filter-menu.expressive::part(menu-select-menu) {
    --control-select-menu-background-color: unset;
    background-color: var(--md-sys-color-primary);
  }

  #header-buttons-end {
    display: flex;
    gap: 8px;
  }

  .header-icon {
    height: 2rem;
    width: 2rem;
  }

  #mass-browser {
    overflow: hidden;
  }
  .mass-browser.expressive {
    background-color: var(--md-sys-color-background, var(--ha-card-background));
    height: calc(100% - 3em);
    border-radius: var(--expressive-border-radius-container);
  }
  sl-input::part(base) {
    background-color: var(--md-sys-color-surface-container-high);
  }
  sl-input::part(input)::placeholder {
    color: var(--search-placeholder-text-color);
  }
  sl-input::part(input) {
    color: var(--search-text-color);
  }
  #search::part(end) {
    width: calc(100% - 3em - 40px);
  }
  #search-favorite-button::part(button) {
    --button-button-width: 36px;
    vertical-align: top;
  }
  #search-input {
    height: 40px;
    position: relative;
    width: calc(100% - 5em);
    z-index: 2;
  }
  #search-media-type-menu {
    border-radius: var(--button-small-border-radius);
    height: 30px;
    width: 30px;
  }
  #search-media-type-menu::part(menu-list-item-svg) {
    height: 2em;
    width: 2em;
  }
  #search-media-type-menu::part(menu-select-menu) {
    --mdc-icon-size: 1.5em;
    --control-select-menu-padding: 0px;
    --control-select-menu-background-color: unset;
    height: 30px;
    width: 30px;
  }
  #search-media-type-menu::part(menu-svg) {
    height: 30px;
    width: 30px;
  }
  .search-media-type-menu.expressive::part(menu-svg),
  .search-library-button.expressive .svg.menu.expressive {
    color: var(--md-sys-color-on-surface-variant) !important;
  }
  #search-options {
    height: 35px;
    display: flex;
  }

  .svg.expressive {
    color: var(--md-sys-color-primary);
  }
  .svg.xs {
    height: 30px;
    width: 30px;
  }

  #title {
    text-transform: capitalize;
  }
`;const{AttributePart:ln,PropertyPart:cn,BooleanAttributePart:An,EventPart:dn}=Ti,un=e=>e,hn={h:un`
      <mpc-collection-album-view></mpc-collection-album-view>
    `,parts:[{type:1,index:0,name:"collectionData",strings:["",""],ctor:cn},{type:1,index:0,name:"onEnqueueAction",strings:["",""],ctor:cn}]},pn={h:un`
      <mpc-collection-artist-view></mpc-collection-artist-view>
    `,parts:[{type:1,index:0,name:"collectionData",strings:["",""],ctor:cn},{type:1,index:0,name:"onEnqueueAction",strings:["",""],ctor:cn}]},gn={h:un`
      <mpc-collection-podcast-view></mpc-collection-podcast-view>
    `,parts:[{type:1,index:0,name:"collectionData",strings:["",""],ctor:cn},{type:1,index:0,name:"onEnqueueAction",strings:["",""],ctor:cn}]},mn={h:un`
      <mpc-collection-playlist-view></mpc-collection-playlist-view>
    `,parts:[{type:1,index:0,name:"collectionData",strings:["",""],ctor:cn},{type:1,index:0,name:"onEnqueueAction",strings:["",""],ctor:cn}]},vn={h:un`
            <mpc-browser-cards></mpc-browser-cards>
          `,parts:[{type:1,index:0,name:"onSelectAction",strings:["",""],ctor:cn},{type:1,index:0,name:"onEnqueueAction",strings:["",""],ctor:cn},{type:1,index:0,name:"loading",strings:["",""],ctor:An}]},fn={h:un`<!--?-->`,parts:[]},yn={h:un` <span slot="label" id="title"> <?> </span> `,parts:[{type:2,index:1}]},bn={h:un`<!--?-->`,parts:[]},wn={h:un`
        <mpc-menu-button id="search-media-type-menu" scheme="plain" elevation="0" fixedmenuposition=""></mpc-menu-button>
      `,parts:[{type:1,index:0,name:"class",strings:["search-media-type-menu ",""],ctor:ln},{type:1,index:0,name:"iconPath",strings:["",""],ctor:cn},{type:1,index:0,name:"initialSelection",strings:["",""],ctor:cn},{type:1,index:0,name:"items",strings:["",""],ctor:cn},{type:1,index:0,name:"menu-item-selected",strings:["",""],ctor:dn}]},En={h:un`<!--?-->`,parts:[]},Cn={h:un`
        <mpc-button role="plain" size="small" elevation="0" id="search-favorite-button">
          <ha-svg-icon></ha-svg-icon>
        </mpc-button>
      `,parts:[{type:1,index:0,name:"onPressService",strings:["",""],ctor:cn},{type:1,index:0,name:"class",strings:["search-library-button button min ",""],ctor:ln},{type:1,index:1,name:"path",strings:["",""],ctor:cn},{type:1,index:1,name:"class",strings:["svg xs menu ",""],ctor:ln}]},In={h:un`<!--?-->`,parts:[]},Bn={h:un`
      <span slot="end" id="search-input">
        <link rel="stylesheet">
        <sl-input type="search" inputmode="search" size="medium" clearable="" pill="">
          <span slot="suffix">
            <div id="search-options">
              <?>
              <?>
            </div>
          </span>
        </sl-input>
      </span>
    `,parts:[{type:1,index:1,name:"href",strings:["",""],ctor:ln},{type:1,index:2,name:"placeholder",strings:["",""],ctor:ln},{type:1,index:2,name:"class",strings:["",""],ctor:ln},{type:1,index:2,name:"sl-input",strings:["",""],ctor:dn},{type:2,index:5},{type:2,index:6}]},xn={h:un`
      <span slot="end" id="buttons-end">
        <div id="header-buttons-end">
          <?> <?>
        </div>
      </span>
    `,parts:[{type:2,index:2},{type:2,index:3}]},Pn={h:un`<!--?-->`,parts:[]},Dn={h:un`
      <mpc-button role="filled" size="small" elevation="1" id="button-search">
        <ha-svg-icon class="svg xs"></ha-svg-icon>
      </mpc-button>
    `,parts:[{type:1,index:0,name:"onPressService",strings:["",""],ctor:cn},{type:1,index:0,name:"class",strings:["button min ",""],ctor:ln},{type:1,index:1,name:"path",strings:["",""],ctor:cn}]},Sn={h:un`<!--?-->`,parts:[]},kn={h:un`
      <span slot="start" id="back-button">
        <mpc-button role="filled" size="small" elevation="1" id="button-back">
          <ha-svg-icon class="header-icon"></ha-svg-icon>
        </mpc-button>
      </span>
    `,parts:[{type:1,index:1,name:"onPressService",strings:["",""],ctor:cn},{type:1,index:1,name:"class",strings:["button min ",""],ctor:ln},{type:1,index:2,name:"path",strings:["",""],ctor:cn}]},Rn={h:un`<!--?-->`,parts:[]},Qn={h:un`
      <mpc-menu-button id="filter-menu" fixedmenuposition=""></mpc-menu-button>
    `,parts:[{type:1,index:0,name:"class",strings:["hdr-menu ",""],ctor:ln},{type:1,index:0,name:"iconPath",strings:["",""],ctor:cn},{type:1,index:0,name:"initialSelection",strings:["",""],ctor:cn},{type:1,index:0,name:"items",strings:["",""],ctor:cn},{type:1,index:0,name:"menu-item-selected",strings:["",""],ctor:dn}]},Mn={h:un`
      <mpc-section-header id="search">
        <?> <?>
      </mpc-section-header>
    `,parts:[{type:2,index:1},{type:2,index:2}]},Hn={h:un`
      <mpc-section-header>
        <?> <?>
        <?>
      </mpc-section-header>
    `,parts:[{type:2,index:1},{type:2,index:2},{type:2,index:3}]},On={h:un`
      <mpc-section-header>
        <?> <?>
      </mpc-section-header>
    `,parts:[{type:2,index:1},{type:2,index:2}]},Tn={h:un`<!--?-->`,parts:[]},Ln={h:un`
      <div id="container">
        <?>
        <div id="mass-browser">
          <?>
        </div>
      </div>
    `,parts:[{type:1,index:0,name:"class",strings:["container ",""],ctor:ln},{type:2,index:1},{type:1,index:2,name:"class",strings:["mass-browser ",""],ctor:ln},{type:2,index:3}]};let qn=class extends me{constructor(){super(...arguments),this.searchMediaType=er.TRACK,this.searchLibrary=!1,this.activeSection=hr,this.activeSubSection=pr,this.previousSections=[],this.previousSubSections=[],this.searchTerm="",this.searchActivated=!1,this.searchLoading=!1,this.onServiceSelect=e=>{if(!this.actions)return;if(e.service)return void this.actions.actionPlayMediaFromService(e.service,this.activeEntityConfig.entity_id);const t=gr[this.config.default_enqueue_option];this.actions.actionEnqueueMedia(this.activeEntityConfig.entity_id,e.media_content_id,e.media_content_type,t),this.onMediaSelectedAction()},this.onSectionSelect=e=>{this.setPreviousSection(),this.activeSection=e.subtype,this.activeSubSection=e.section,this.setActiveCards()},this.onItemSelect=e=>{this.actions&&this.actions.actionPlayMedia(this.activeEntityConfig.entity_id,e.media_content_id,e.media_content_type)},this.onCollectionSelect=e=>{this.setPreviousSection(),this.activeCollectionData=e,this.activeSubSection="collection",this.searchActivated=!1,this.requestUpdate("collection","selected")},this.onSelect=e=>{const t={section:this.onSectionSelect,item:this.onItemSelect,service:this.onServiceSelect,playlist:this.onCollectionSelect,album:this.onCollectionSelect,artist:this.onCollectionSelect,podcast:this.onCollectionSelect}[e.type];["playlist","album","artist"].includes(e.type)?this.onCollectionSelect(e):t(e)},this.onEnqueue=(e,t)=>{const r=(e.type,e.media_content_id),i="playlist"==e.type?"music":e.media_content_id;this.actions&&(t!=$t.RADIO?this.actions.actionEnqueueMedia(this.activeEntityConfig.entity_id,r,i,t):this.actions.actionPlayRadio(this.activeEntityConfig.entity_id,r,i))},this.onPlaylistEnqueue=(e,t)=>{if(!this.actions)return;const r=e.media_content_id;this.actions.actionEnqueueMedia(this.activeEntityConfig.entity_id,r,"playlist",t)},this.onBack=()=>{const e="collection"==this.activeSubSection&&"search"!=this.activeSection;this.activeSection=this.previousSections.pop()??hr,this.activeSubSection=this.previousSubSections.pop()??pr,this.setActiveCards(),e&&this.requestUpdate("collections","back")},this.onSearchButtonPress=()=>{this.hass&&(this.setPreviousSection(),this.cards&&(this.searchMediaTypeIcon||(this.searchMediaTypeIcon=Lr(er.TRACK,this.Icons,this.hass)),this.searchTerm="",this.activeSection="search",this.cards.search=[],this.activeCards=this.cards.search,this.searchActivated=!0))},this.onSearchMediaTypeSelect=async e=>{if(!this.hass)return;const t=e.detail.option;this.searchMediaType=t,this.searchMediaTypeIcon=Lr(t,this.Icons,this.hass),await this.searchMedia()},this.onSearchLibrarySelect=async()=>{this.searchLibrary=!this.searchLibrary,await this.searchMedia()},this.onSearchInput=e=>{const t=e.target.value.trim();if(!(t.length<3)){if(this.searchTerm=t,this._searchTimeout)try{clearTimeout(this._searchTimeout)}finally{this._searchTimeout=0}this._searchTimeout=window.setTimeout(()=>{this._searchTimeout=0,this.searchMedia()},1e3)}},this.onFilterType=e=>{if(!this.cards)return;const t=e.detail.option;0!==t.length&&Object.keys(this.cards).includes(t)&&(this.activeSection=t,this.activeSubSection="main",this.activeCards=this.cards[t].main)},this.onCardsUpdated=e=>{const t=e.detail,r=t.section;"all"==r&&(this._cards=t.cards),this.cards&&(this.activeCards?.length||"all"!=r&&r!=this.activeSection||this.setActiveCards())},this.renderAlbumView=()=>({_$litType$:hn,values:[this.activeCollectionData,this.onPlaylistEnqueue]}),this.renderArtistView=()=>({_$litType$:pn,values:[this.activeCollectionData,this.onPlaylistEnqueue]}),this.renderPodcastView=()=>({_$litType$:gn,values:[this.activeCollectionData,this.onPlaylistEnqueue]}),this.renderPlaylistView=()=>({_$litType$:mn,values:[this.activeCollectionData,this.onPlaylistEnqueue]})}set activeCards(e){e&&(Yr(this._activeCards,e)||(this._activeCards=e))}get activeCards(){return this._activeCards}set hass(e){e&&(this._hass=e,this.actions??=new no(e))}get hass(){return this._hass}set browserController(e){e&&(this._browserController=e)}get browserController(){return this._browserController}set config(e){this._config=e,this.activeSection=e.default_section,this.cards&&this.setActiveCards()}get config(){return this._config}set activeEntityConfig(e){this._activeEntityConfig=e}get activeEntityConfig(){return this._activeEntityConfig}set cards(e){Yr(this._cards,e)||(this._cards=e,"search"!=this.activeSection?this.activeCards||this.setActiveCards():this.activeCards=[])}get cards(){return this._cards}setPreviousSection(){this.previousSections.push(this.activeSection),this.previousSubSections.push(this.activeSubSection)}setActiveCards(){const e=this.activeSection,t=this.activeSubSection;let r;if("collection"==this.activeSubSection&&"search"!=this.activeSection)return void this.requestUpdate("collection","selected");if(!this.cards)return;try{r=[...this.cards[e][t]]}catch{return}Yr(r,this.activeCards)||(this.activeCards=r),this.scrollCardsToTop()}scrollCardsToTop(){this.offsetHeight&&this.cardsElement?.resetScroll()}resetActiveSections(){this.activeSection=hr,this.activeSubSection=pr,this.previousSections=[],this.previousSubSections=[],this.setActiveCards()}async searchMedia(){const e=this.searchTerm;if(this.browserController&&!(e.length<3)){this.searchLoading=!0;try{const t=await this.browserController.search(this.activeEntityConfig.entity_id,e,this.searchMediaType,this.searchLibrary,20);this.searchLoading=!1,this.activeCards=t}finally{this.searchLoading=!1}}}hideSectionHeader(){return this.hiddenElements.header}renderCollectionView(){const e=this.activeCollectionData.type;return We({album:this.renderAlbumView,artist:this.renderArtistView,playlist:this.renderPlaylistView,podcast:this.renderPodcastView}[e]())}renderBrowserCards(){return We("collection"==this.activeSubSection&&"search"!=this.activeSection?this.renderCollectionView():{_$litType$:vn,values:[this.onSelect,this.onEnqueue,this.searchLoading]})}renderTitle(){if(this.hiddenElements.header_title)return{_$litType$:fn,values:[]};const e=this.activeSection;return{_$litType$:yn,values:[e]}}renderSearchMediaTypeButton(){if(!this.hass)return{_$litType$:bn,values:[]};if("search"==this.activeSection){const e=ur(this.Icons,this.hass);return{_$litType$:wn,values:[this.useExpressive?"expressive":"",this.searchMediaTypeIcon,this.searchMediaType,e,this.onSearchMediaTypeSelect]}}return{_$litType$:En,values:[]}}renderSearchLibraryButton(){return"search"==this.activeSection?{_$litType$:Cn,values:[this.onSearchLibrarySelect,this.useExpressive?"expressive":"",this.searchLibrary?this.Icons.LIBRARY:this.Icons.LIBRARY_OUTLINED,this.useExpressive?"expressive":""]}:{_$litType$:In,values:[]}}renderSearchBar(){if(!this.hass)return;const e=this.hass.themes.darkMode,t="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.1/cdn/themes/"+(e?"dark.css":"light.css"),r=cr("browser.search.placeholder",this.hass);return{_$litType$:Bn,values:[t,r,e?"sl-theme-dark":"sl-theme-light",this.onSearchInput,this.renderSearchMediaTypeButton(),this.renderSearchLibraryButton()]}}renderEndButtons(){return{_$litType$:xn,values:[this.renderFilterButton(),this.renderSearchButton()]}}renderSearchButton(){return this.hiddenElements.search_button?{_$litType$:Pn,values:[]}:{_$litType$:Dn,values:[this.onSearchButtonPress,this.useExpressive?"expressive":"",this.Icons.SEARCH]}}renderBackButton(){return this.hiddenElements.back_button?{_$litType$:Sn,values:[]}:{_$litType$:kn,values:[this.onBack,this.useExpressive?"expressive":"",this.Icons.ARROW_LEFT]}}renderFilterButton(){if(!this.hass||this.hiddenElements.filter_button)return{_$litType$:Rn,values:[]};const e=function(e,t,r){const i=[];return r.favorites.enabled&&i.push({option:"favorites",icon:e.HEART,title:cr("browser.card.favorites",t)}),r.recents.enabled&&i.push({option:"recents",icon:e.RECENTS,title:cr("browser.card.recents",t)}),r.recommendations.enabled&&i.push({option:"recommendations",icon:e.SUGGESTIONS,title:cr("browser.card.recommendations",t)}),i}(this.Icons,this.hass,this.config),t=this.Icons.FILTER;return{_$litType$:Qn,values:[this.useExpressive?"expressive":"",t,this.activeSection,e,this.onFilterType]}}renderSearchHeader(){return{_$litType$:Mn,values:[this.renderBackButton(),this.renderSearchBar()]}}renderSubsectionHeader(){return{_$litType$:Hn,values:[this.renderBackButton(),this.renderTitle(),this.renderEndButtons()]}}renderMainHeader(){return{_$litType$:On,values:[this.renderTitle(),this.renderEndButtons()]}}shouldUpdate(e){return e.size>0}renderHeader(){return this.hideSectionHeader()?{_$litType$:Tn,values:[]}:"search"==this.activeSection?this.renderSearchHeader():this.activeSection==hr&&this.activeSubSection==pr?this.renderMainHeader():this.renderSubsectionHeader()}firstUpdated(){this.browserController._host.addEventListener("cards-updated",this.onCardsUpdated)}render(){return{_$litType$:Ln,values:[this.useExpressive?"expressive":"",this.renderHeader(),this.useExpressive?"expressive":"",this.renderBrowserCards()]}}disconnectedCallback(){super.disconnectedCallback(),this.browserController._host.removeEventListener("cards-updated",this.onCardsUpdated)}connectedCallback(){super.connectedCallback(),this.browserController?._host&&this.browserController._host.addEventListener("cards-updated",this.onCardsUpdated)}updated(){this.searchActivated&&setTimeout(()=>{this.shadowRoot?.querySelector("#search")?.querySelector("sl-input")?.shadowRoot?.querySelector("input")?.focus(),this.searchActivated=!1},50)}static get styles(){return an}};e([xe({attribute:!1})],qn.prototype,"_config",void 0),e([xe({attribute:!1})],qn.prototype,"onMediaSelectedAction",void 0),e([Pe()],qn.prototype,"_cards",void 0),e([Pe()],qn.prototype,"searchMediaTypeIcon",void 0),e([Pe()],qn.prototype,"searchMediaType",void 0),e([Pe()],qn.prototype,"searchLibrary",void 0),e([Se("mpc-browser-cards")],qn.prototype,"cardsElement",void 0),e([n({context:Di}),Pe()],qn.prototype,"_activeCards",void 0),e([a({context:bi,subscribe:!0})],qn.prototype,"useExpressive",void 0),e([a({context:Ei})],qn.prototype,"Icons",void 0),e([a({context:_r,subscribe:!0})],qn.prototype,"_activeEntityConfig",void 0),e([a({context:Qi,subscribe:!0})],qn.prototype,"hiddenElements",void 0),e([xe()],qn.prototype,"activeCollectionData",void 0),e([Pe()],qn.prototype,"searchLoading",void 0),e([Pe()],qn.prototype,"activeCards",null),e([a({context:Zr,subscribe:!0})],qn.prototype,"hass",null),e([a({context:fi,subscribe:!0})],qn.prototype,"browserController",null),e([a({context:Ai,subscribe:!0})],qn.prototype,"config",null),e([a({context:_r,subscribe:!0})],qn.prototype,"activeEntityConfig",null),e([a({context:Pi,subscribe:!0})],qn.prototype,"cards",null),qn=e([Ce("mpc-media-browser")],qn);
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const Un="important",Fn=" !"+Un,Vn=Te(class extends Le{constructor(e){if(super(e),e.type!==Qe||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,r)=>{const i=e[r];return null==i?t:t+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(e,[t]){const{style:r}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?r.removeProperty(e):r[e]=null);for(const e in t){const i=t[e];if(null!=i){this.ft.add(e);const t="string"==typeof i&&i.endsWith(Fn);e.includes("-")||t?r.setProperty(e,t?i.slice(0,-11):i,t?Un:""):r[e]=i}}return _}}),zn=["role","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"],Jn=zn.map(Nn);
/**
 * @license
 * Copyright 2023 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Yn(e){return Jn.includes(e)}function Nn(e){return e.replace("aria","aria-").replace(/Elements?/g,"").toLowerCase()}
/**
 * @license
 * Copyright 2023 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Xn=Symbol("privateIgnoreAttributeChangesFor");function jn(e){return`data-${e}`}function Kn(e){return e.replace(/-\w/,e=>e[1].toUpperCase())}
/**
 * @license
 * Copyright 2023 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Gn=function(e){var t;class r extends e{constructor(){super(...arguments),this[t]=new Set}attributeChangedCallback(e,t,r){if(!Yn(e))return void super.attributeChangedCallback(e,t,r);if(this[Xn].has(e))return;this[Xn].add(e),this.removeAttribute(e),this[Xn].delete(e);const i=Kn(e);null===r?delete this.dataset[i]:this.dataset[i]=r,this.requestUpdate(Kn(e),t)}getAttribute(e){return Yn(e)?super.getAttribute(jn(e)):super.getAttribute(e)}removeAttribute(e){super.removeAttribute(e),Yn(e)&&(super.removeAttribute(jn(e)),this.requestUpdate())}}return t=Xn,function(e){for(const t of zn){const r=Nn(t),i=jn(r),s=Kn(r);e.createProperty(t,{attribute:r,noAccessor:!0}),e.createProperty(Symbol(i),{attribute:i,noAccessor:!0}),Object.defineProperty(e.prototype,t,{configurable:!0,enumerable:!0,get(){return this.dataset[s]??null},set(e){const r=this.dataset[s]??null;e!==r&&(null===e?delete this.dataset[s]:this.dataset[s]=e,this.requestUpdate(t,r))}})}}(r),r}(me);class Wn extends Gn{constructor(){super(...arguments),this.value=0,this.max=1,this.indeterminate=!1,this.fourColor=!1}render(){const{ariaLabel:e}=this;return Z`
      <div
        class="progress ${Gt(this.getRenderClasses())}"
        role="progressbar"
        aria-label="${e||$}"
        aria-valuemin="0"
        aria-valuemax=${this.max}
        aria-valuenow=${this.indeterminate?$:this.value}
        >${this.renderIndicator()}</div
      >
    `}getRenderClasses(){return{indeterminate:this.indeterminate,"four-color":this.fourColor}}}e([xe({type:Number})],Wn.prototype,"value",void 0),e([xe({type:Number})],Wn.prototype,"max",void 0),e([xe({type:Boolean})],Wn.prototype,"indeterminate",void 0),e([xe({type:Boolean,attribute:"four-color"})],Wn.prototype,"fourColor",void 0);
/**
 * @license
 * Copyright 2023 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class Zn extends Wn{constructor(){super(...arguments),this.buffer=0}renderIndicator(){const e={transform:`scaleX(${100*(this.indeterminate?1:this.value/this.max)}%)`},t=this.buffer??0,r=t>0,i={transform:`scaleX(${100*(this.indeterminate||!r?1:t/this.max)}%)`},s=this.indeterminate||!r||t>=this.max||this.value>=this.max;return Z`
      <div class="dots" ?hidden=${s}></div>
      <div class="inactive-track" style=${Vn(i)}></div>
      <div class="bar primary-bar" style=${Vn(e)}>
        <div class="bar-inner"></div>
      </div>
      <div class="bar secondary-bar">
        <div class="bar-inner"></div>
      </div>
    `}}e([xe({type:Number})],Zn.prototype,"buffer",void 0);
/**
 * @license
 * Copyright 2024 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
const _n=p`:host{--_active-indicator-color: var(--md-linear-progress-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-height: var(--md-linear-progress-active-indicator-height, 4px);--_four-color-active-indicator-four-color: var(--md-linear-progress-four-color-active-indicator-four-color, var(--md-sys-color-tertiary-container, #ffd8e4));--_four-color-active-indicator-one-color: var(--md-linear-progress-four-color-active-indicator-one-color, var(--md-sys-color-primary, #6750a4));--_four-color-active-indicator-three-color: var(--md-linear-progress-four-color-active-indicator-three-color, var(--md-sys-color-tertiary, #7d5260));--_four-color-active-indicator-two-color: var(--md-linear-progress-four-color-active-indicator-two-color, var(--md-sys-color-primary-container, #eaddff));--_track-color: var(--md-linear-progress-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_track-height: var(--md-linear-progress-track-height, 4px);--_track-shape: var(--md-linear-progress-track-shape, var(--md-sys-shape-corner-none, 0px));border-radius:var(--_track-shape);display:flex;position:relative;min-width:80px;height:var(--_track-height);content-visibility:auto;contain:strict}.progress,.dots,.inactive-track,.bar,.bar-inner{position:absolute}.progress{direction:ltr;inset:0;border-radius:inherit;overflow:hidden;display:flex;align-items:center}.bar{animation:none;width:100%;height:var(--_active-indicator-height);transform-origin:left center;transition:transform 250ms cubic-bezier(0.4, 0, 0.6, 1)}.secondary-bar{display:none}.bar-inner{inset:0;animation:none;background:var(--_active-indicator-color)}.inactive-track{background:var(--_track-color);inset:0;transition:transform 250ms cubic-bezier(0.4, 0, 0.6, 1);transform-origin:left center}.dots{inset:0;animation:linear infinite 250ms;animation-name:buffering;background-color:var(--_track-color);background-repeat:repeat-x;-webkit-mask-image:url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 2' preserveAspectRatio='xMinYMin slice'%3E%3Ccircle cx='1' cy='1' r='1'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 2' preserveAspectRatio='xMinYMin slice'%3E%3Ccircle cx='1' cy='1' r='1'/%3E%3C/svg%3E");z-index:-1}.dots[hidden]{display:none}.indeterminate .bar{transition:none}.indeterminate .primary-bar{inset-inline-start:-145.167%}.indeterminate .secondary-bar{inset-inline-start:-54.8889%;display:block}.indeterminate .primary-bar{animation:linear infinite 2s;animation-name:primary-indeterminate-translate}.indeterminate .primary-bar>.bar-inner{animation:linear infinite 2s primary-indeterminate-scale}.indeterminate.four-color .primary-bar>.bar-inner{animation-name:primary-indeterminate-scale,four-color;animation-duration:2s,4s}.indeterminate .secondary-bar{animation:linear infinite 2s;animation-name:secondary-indeterminate-translate}.indeterminate .secondary-bar>.bar-inner{animation:linear infinite 2s secondary-indeterminate-scale}.indeterminate.four-color .secondary-bar>.bar-inner{animation-name:secondary-indeterminate-scale,four-color;animation-duration:2s,4s}:host(:dir(rtl)){transform:scale(-1)}@keyframes primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.00432);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes buffering{0%{transform:translateX(calc(var(--_track-height) / 2 * 5))}}@keyframes primary-indeterminate-translate{0%{transform:translateX(0px)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0px)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.6714%)}100%{transform:translateX(200.611%)}}@keyframes secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0px)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.6519%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.3862%)}100%{transform:translateX(160.278%)}}@keyframes four-color{0%{background:var(--_four-color-active-indicator-one-color)}15%{background:var(--_four-color-active-indicator-one-color)}25%{background:var(--_four-color-active-indicator-two-color)}40%{background:var(--_four-color-active-indicator-two-color)}50%{background:var(--_four-color-active-indicator-three-color)}65%{background:var(--_four-color-active-indicator-three-color)}75%{background:var(--_four-color-active-indicator-four-color)}90%{background:var(--_four-color-active-indicator-four-color)}100%{background:var(--_four-color-active-indicator-one-color)}}@media(forced-colors: active){:host{outline:1px solid CanvasText}.bar-inner,.dots{background-color:CanvasText}}
`
/**
 * @license
 * Copyright 2023 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let $n=class extends Zn{};$n.styles=[_n],$n=e([Ce("md-linear-progress")],$n);var ea=p`
  .divider {
    margin-top: 2px;
    margin-bottom: 2px;
  }
  .divider::before {
    content: " ";
    display: block;
    height: 1px;
    background-color: var(--divider-color);
    margin-left: 24px;
    margin-right: 24px;
  }
  .grouped-button-unjoin {
    --button-button-width: var(--media-row-icon-width);
    --button-button-height: 30px;
    --button-border-radius: 25%;
    --button-padding: 0px;
    align-content: center;
  }
  .grouped-players-item {
    height: calc(var(--control-select-menu-height) * 2);
    display: contents;
  }
  #grouped-players-menu {
    --control-select-thickness: 2.5em;
    max-width: var(--control-select-menu-height);
  }
  #grouped-players-menu ha-md-list-item {
    padding-left: 12px;
  }
  #grouped-players-menu ha-md-list-item:not(.grouped-players-volume-item) {
    padding-right: 12px;
  }
  #grouped-players-menu::part(menu-button) {
    --ha-ripple-color: rgba(0, 0, 0, 0);
  }
  .grouped-players-select-item {
    width: 320px;
    height: 100%;
  }
  .grouped-players-select-item-image,
  .grouped-players-select-item-icon {
    height: 3em;
    width: 3em;
  }
  .grouped-players-select-item-icon.expressive,
  .grouped-players-select-item-image.expressive {
    margin-left: 14px;
  }
  .grouped-players-select-item-image.expressive {
    border-radius: 12px;
  }
  .grouped-players-volume-item {
    --md-list-item-top-space: 0px;
  }
  .grouped-svg-unjoin {
    --button-button-height: var(--row-icon-button-height);
    width: var(--row-icon-button-height);
  }
  .grouped-svg-unjoin.expressive {
    color: var(--expressive-row-button-color-text);
  }
  .grouped-svg-unjoin.expressive:hover {
    color: var(--expressive-row-button-color-text-hover);
  }
  #grouped-volume,
  .grouped-players-volume-slider::part(slider) {
    position: relative;
    width: 96%;
    left: 2%;
    height: 2.5em;
  }
  .grouped-volume .player-name-icon {
    margin-top: 10px;
    color: var(--md-sys-color-primary);
  }
  .menu-header {
    --menu-button-border-radius: 50%;
  }
  .menu-header::part(menu-select-menu) {
    height: 2.5em;
    width: 2.5em;
    --control-select-menu-padding: 7px;
    --mdc-icon-size: 1.5em;
    --control-select-menu-height: 2.5em;
    background-color: var(--control-select-menu-background-color);
  }
  .menu-header::part(menu-svg):not(.expressive) {
    color: var(--wa-color-brand-on-normal, var(--wa-color-neutral-on-normal));
  }
  .menu-header.expressive::part(menu-select-menu) {
    --control-select-menu-background-color: var(
      --md-sys-color-secondary-container
    ) !important;
  }
  .menu-header.expressive::part(menu-svg) {
    color: var(--md-sys-color-on-secondary-container);
  }
`;class ta{constructor(e){this.hass=e}set hass(e){e&&(this._hass=e)}get hass(){return this._hass}async actionPlayPause(e){try{await this.hass.callService("media_player","media_play_pause",{entity_id:e.entity_id})}catch(e){console.error("Error calling play/pause",e)}}async actionMuteToggle(e){const t=!this.hass.states[e.entity_id].attributes.is_volume_muted;try{await this.hass.callService("media_player","volume_mute",{entity_id:e.entity_id,is_volume_muted:t})}catch(e){console.error("Error calling mute",e)}}async actionNext(e){try{await this.hass.callService("media_player","media_next_track",{entity_id:e.entity_id})}catch(e){console.error("Error calling play next",e)}}async actionPrevious(e){try{await this.hass.callService("media_player","media_previous_track",{entity_id:e.entity_id})}catch(e){console.error("Error calling play previous",e)}}async actionShuffleToggle(e){const t=!e.attributes.shuffle;try{await this.hass.callService("media_player","shuffle_set",{entity_id:e.entity_id,shuffle:t})}catch(e){console.error("Error calling shuffle",e)}}async actionRepeatSet(e,t){try{await this.hass.callService("media_player","repeat_set",{entity_id:e.entity_id,repeat:t})}catch(e){console.error("Error calling repeat",e)}}async actionSetVolume(e,t){try{await this.hass.callService("media_player","volume_set",{entity_id:e.entity_id,volume_level:t})}catch(e){console.error("Error setting volume",e)}}async actionSeek(e,t){try{await this.hass.callService("media_player","media_seek",{entity_id:e.entity_id,seek_position:t})}catch(e){console.error("Error calling repeat",e)}}async actionTogglePlayer(e){try{await this.hass.callService("media_player","toggle",{entity_id:e.entity_id})}catch(e){console.error("Error calling repeat",e)}}async actionGetCurrentItem(e){const t={type:"call_service",domain:"mass_queue",service:"get_queue_items",service_data:{entity:e.entity_id,limit_before:1,limit_after:1},return_response:!0};return(await this.hass.callWS(t)).response[e.entity_id].find(t=>t.media_content_id==e.attributes.media_content_id)??void 0}async actionAddFavorite(e){const t=this.hass.entities[e.entity_id].device_id;try{await this.hass.callService("button","press",{device_id:t})}catch(e){console.error("Error setting favorite",e)}}async actionRemoveFavorite(e){try{await this.hass.callService("mass_queue","unfavorite_current_item",{entity:e.entity_id})}catch(e){console.error("Error unfavoriting item for entity.",e)}}async actionUnjoinPlayers(e){try{await this.hass.callService("media_player","unjoin",{entity_id:e})}catch(e){console.error("Error unjoining players",e)}}async actionAddToPlaylist(e,t,r){const i=await this.actionGetPlayerInfo(r),s=i?.entries.mass_queue,o=t.split("/"),n={type:"call_service",domain:"mass_queue",service:"send_command",service_data:{command:"music/playlists/add_playlist_tracks",config_entry_id:s,data:{db_playlist_id:o[o.length-1],uris:[e]}}};await this.hass.callWS(n)}async actionGetPlayerInfo(e){const t={type:"mass_queue/get_info",entity_id:e.entity_id};return await this.hass.callWS(t)}}var ra=p`
  ha-control-slider {
    --control-slider-thickness: 2.25em;
    --control-slider-color: var(--md-sys-color-primary) !important;
  }

  #button-power {
    margin-right: 1em;
  }
  #button-mute,
  #button-favorite {
    margin-left: 1em;
  }

  #volume {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    padding-left: 2em;
    padding-right: 2em;
  }
`;const{PropertyPart:ia,EventPart:sa}=Ti,oa=e=>e,na={h:oa`<!--?-->`,parts:[]},aa={h:oa`
      <ha-control-slider part="slider" style="--control-slider-color: var(--md-sys-color-primary) !important;" .unit="%" .min="0"></ha-control-slider>
    `,parts:[{type:1,index:0,name:"disabled",strings:["",""],ctor:ia},{type:1,index:0,name:"value",strings:["",""],ctor:ia},{type:1,index:0,name:"max",strings:["",""],ctor:ia},{type:1,index:0,name:"value-changed",strings:["",""],ctor:sa}]};let la=class extends me{constructor(){super(...arguments),this.maxVolume=100,this.onVolumeChange=async e=>{if(!this.entity)return;let t=e.detail.value;t/=100,this.requestUpdate("volume",t),await this._actions.actionSetVolume(this.entity,t)}}set entityId(e){if(this._entityId=e,!this.hass)return;const t=this.hass.states[e];t&&(this.entity=t)}get entityId(){return this._entityId}set hass(e){if(!e)return;this._hass=e,this._actions=new ta(e);const t=e.states[this.entityId];t&&(this.entity=t)}get hass(){return this._hass}render(){return this.entity?{_$litType$:aa,values:[this.entity.attributes.is_volume_muted,100*(this.entity.attributes.volume_level??0),this.maxVolume,this.onVolumeChange]}:{_$litType$:na,values:[]}}shouldUpdate(e){return e.size>0}styles(){return ra}};e([xe({attribute:!1})],la.prototype,"maxVolume",void 0),e([Pe()],la.prototype,"entity",void 0),e([xe({attribute:!1})],la.prototype,"entityId",null),e([a({context:Zr,subscribe:!0})],la.prototype,"hass",null),la=e([Ce("mpc-volume-slider")],la);const{AttributePart:ca,PropertyPart:Aa,EventPart:da}=Ti,ua=e=>e,ha={h:ua`
      <div class="grouped-players-item grouped-volume">
        <div class="player-name-icon">
          <ha-md-list-item class="grouped-players-select-item" noninteractive="" hide-label="">
            <ha-svg-icon slot="start"></ha-svg-icon>
            <ha-control-slider part="slider" style="--control-slider-color: var(--md-sys-color-primary) !important" id="grouped-volume" .unit="%" .min="0" .max="100"></ha-control-slider>
          </ha-md-list-item>
        </div>
        <div class="divider"></div>
      </div>
    `,parts:[{type:1,index:2,name:"graphic",strings:["",""],ctor:Aa},{type:1,index:3,name:"class",strings:["grouped-players-select-item-icon ",""],ctor:ca},{type:1,index:3,name:"path",strings:["",""],ctor:Aa},{type:1,index:4,name:"value",strings:["",""],ctor:Aa},{type:1,index:4,name:"value-changed",strings:["",""],ctor:da}]},pa={h:ua`
        <div class="grouped-players-item">
          <div class="player-name-icon">
            <ha-md-list-item class="grouped-players-select-item" noninteractive="" hide-label="">
              <img slot="start" loading="lazy">
              <span slot="headline" class="grouped-title"> <?> </span>
              <span slot="end">
                <mpc-button size="small" elevation="1">
                  <ha-svg-icon></ha-svg-icon>
                </mpc-button>
              </span>
            </ha-md-list-item>
          </div>
          <ha-md-list-item class="grouped-players-volume-item">
            <mpc-volume-slider class="grouped-players-volume-slider"></mpc-volume-slider>
          </ha-md-list-item>
          <?>
        </div>
      `,parts:[{type:1,index:2,name:"graphic",strings:["",""],ctor:Aa},{type:1,index:3,name:"class",strings:["grouped-players-select-item-image ",""],ctor:ca},{type:1,index:3,name:"src",strings:["",""],ctor:ca},{type:1,index:3,name:"error",strings:["",""],ctor:da},{type:2,index:5},{type:1,index:7,name:"onPressService",strings:["",""],ctor:Aa},{type:1,index:7,name:"role",strings:["",""],ctor:ca},{type:1,index:7,name:"class",strings:["grouped-button-unjoin ",""],ctor:ca},{type:1,index:8,name:"path",strings:["",""],ctor:Aa},{type:1,index:8,name:"class",strings:["grouped-svg-unjoin ",""],ctor:ca},{type:1,index:8,name:"entity",strings:["",""],ctor:Aa},{type:1,index:10,name:"maxVolume",strings:["",""],ctor:ca},{type:1,index:10,name:"entityId",strings:["",""],ctor:Aa},{type:2,index:11}]},ga={h:ua`<div class="divider"></div>`,parts:[]},ma={h:ua`
      <mpc-menu-button slot="end" id="grouped-players-menu" naturalmenuwidth="" fixedmenuposition="" elevation="1">
        <?> <?>
      </mpc-menu-button>
    `,parts:[{type:1,index:0,name:"class",strings:["menu-header ",""],ctor:ca},{type:1,index:0,name:"iconPath",strings:["",""],ctor:Aa},{type:2,index:1},{type:2,index:2}]};let va=class extends me{constructor(){super(...arguments),this._groupedPlayers=[],this.onUnjoinSelect=e=>{const t=new ta(this.hass),r=e.target.entity;t.actionUnjoinPlayers(r)},this.onGroupVolumeChange=e=>{const t=e.detail.value;this.controller.ActivePlayer?.setActiveGroupVolume(t)},this.onImgErr=(e,t)=>{const r=this.hass.states[t.entity_id]?.attributes,i=r?.entity_picture_local,s=r?.entity_picture,o=Tr(this.hass,ir.HEADPHONES),n=e.target.src;e.target.src=n==i?s??o:o}}set groupedPlayersList(e){const t=this.playerEntities?.filter(t=>e.includes(t.entity_id));!Yr(this._groupedPlayers,t)&&t&&(this._groupedPlayers=t)}get groupedPlayers(){return this._groupedPlayers}renderGroupedVolume(){const e=this.groupVolumeLevel;return{_$litType$:ha,values:[this.Icons.SPEAKER_MULTIPLE,this.useExpressive?"expressive":"",this.Icons.SPEAKER_MULTIPLE,e,this.onGroupVolumeChange]}}renderGroupedPlayers(){const e=this.groupedPlayers.length,t=this.useExpressive,r=this.useVibrant?"tonal":"filled-variant";return this.groupedPlayers.map((i,s)=>{const o=i.name.length>0?i.name:this.hass.states[i.entity_id]?.attributes.friendly_name??"",n=this.hass.states[i.entity_id],a=n?.attributes.entity_picture_local??n?.attributes.entity_picture;return{_$litType$:pa,values:[this.Icons.SPEAKER,t?"expressive":"",a,e=>{this.onImgErr(e,i)},o,this.onUnjoinSelect,r,t?"grouped-button-unjoin-expressive":"",this.Icons.LINK_OFF,t?"expressive":"",i.entity_id,i.max_volume,i.volume_entity_id,s<e-1?{_$litType$:ga,values:[]}:""]}})}render(){return{_$litType$:ma,values:[this.useExpressive?"expressive":"",this.Icons.SPEAKER_MULTIPLE,this.renderGroupedVolume(),this.renderGroupedPlayers()]}}shouldUpdate(e){return e.size>0||!this.hasUpdated}static get styles(){return ea}};e([Pe()],va.prototype,"_groupedPlayers",void 0),e([Pe(),a({context:bi,subscribe:!0})],va.prototype,"useExpressive",void 0),e([Pe(),a({context:wi,subscribe:!0})],va.prototype,"useVibrant",void 0),e([a({context:Ei,subscribe:!0})],va.prototype,"Icons",void 0),e([a({context:Zr,subscribe:!0})],va.prototype,"hass",void 0),e([Pe(),a({context:oi,subscribe:!0})],va.prototype,"groupVolumeLevel",void 0),e([Pe(),a({context:ai,subscribe:!0})],va.prototype,"playerEntities",void 0),e([a({context:mi,subscribe:!0})],va.prototype,"controller",void 0),e([a({context:si,subscribe:!0})],va.prototype,"groupedPlayersList",null),va=e([Ce("mpc-grouped-player-menu")],va);var fa=p`
  .progress {
    padding-left: 36px;
    padding-right: 36px;
    padding-bottom: 8px;
    touch-action: none;
  }

  #progress-bar {
    --primary: var(
      --md-sys-color-on-primary-container,
      var(
        --md-linear-progress-track-color,
        var(--md-sys-color-surface-container-highest, #e6e0e9)
      )
    );
    --_light: unset;
    --_dark: unset;
  }

  #progress-div {
    margin-bottom: 4px;
  }
  .prog-incomplete {
    position: absolute;
    left: var(--incomplete-progress-start-pct);
    --height: 6px;
    top: calc(50% - (var(--height) / 2 - 1px));
    height: var(--height);
    background-color: var(
      --md-sys-color-secondary-container,
      var(
        --md-linear-progress-track-color,
        var(--md-sys-color-surface-container-highest, #e6e0e9)
      )
    );
    width: calc(100% - var(--incomplete-progress-start-pct));
    border-radius: 0px 3px 3px 0px;
  }

  #progress-handle {
    background-color: var(
      --md-sys-color-on-primary-container,
      var(
        --md-linear-progress-track-color,
        var(--md-sys-color-surface-container-highest, #e6e0e9)
      )
    );
    top: 0;
    height: 100%;
    border-radius: 4px;
  }

  progress.wavy {
    --_size: 4px;
    background-size: var(--_size);
    block-size: calc(var(--_size) * 3);
  }

  #time {
    justify-self: center;
  }
  #time:not(.time-expressive) {
    margin-bottom: 4px;
  }
  .time-expressive {
    color: var(--md-sys-color-on-primary-container) !important;
    font-weight: 400;
    font-size: 1.5em;
    line-height: 1.2em;
    font-stretch: 50%;
    font-family: var(--expressive-font-family);
  }
`;const{AttributePart:ya,EventPart:ba}=Ti,wa=e=>e,Ea={h:wa`<!--?-->`,parts:[]},Ca={h:wa`
      <div id="progress-div">
        <link href="https://cdn.jsdelivr.net/npm/beercss@4.0.20/dist/cdn/beer.min.css" rel="stylesheet">
        <div class="prog-incomplete"></div>
        <progress id="progress-bar" max="1"></progress>
        <?>
      </div>
    `,parts:[{type:1,index:0,name:"pointerdown",strings:["",""],ctor:ba},{type:1,index:0,name:"click",strings:["",""],ctor:ba},{type:1,index:2,name:"style",strings:["--incomplete-progress-start-pct: ","%;"],ctor:ya},{type:1,index:3,name:"class",strings:["",""],ctor:ya},{type:1,index:3,name:"value",strings:["",""],ctor:ya},{type:2,index:4}]},Ia={h:wa`<!--?-->`,parts:[]},Ba={h:wa`
      <div id="time">
        <?> - <?>
      </div>
    `,parts:[{type:1,index:0,name:"class",strings:["",""],ctor:ya},{type:2,index:1},{type:2,index:2}]},xa={h:wa`
      <div id="progress-handle"></div>
    `,parts:[{type:1,index:0,name:"style",strings:["\n          width: ","px; \n          position: absolute;\n          left: calc(","% - (","px / 2));\n        "],ctor:ya}]},Pa={h:wa`
      <div class="progress"><?> <?></div>
    `,parts:[{type:2,index:1},{type:2,index:2}]};let Da=class extends me{constructor(){super(...arguments),this.entity_duration=1,this.entity_position=0,this._prog_pct=0,this._lastUpdate=0,this._handleBarWidth=8,this._refreshMilliseconds=5e3,this._tick_duration_ms=250,this._dragging=!1,this._requestProgress=!0,this._currentSetPosition=0,this._newSetPosition=0,this.tickProgress=()=>{const e=this.player_data?.playing;if(!e||this._dragging)return;const t=Date.now();if(this._requestProgress&&(!this.media_duration||t-this._lastUpdate>=this._refreshMilliseconds))return this._lastUpdate=t,void this.requestProgress();let r=(this.media_position??0)+this._tick_duration_ms/1e3;this._currentSetPosition!=this._newSetPosition&&(this._currentSetPosition=this._newSetPosition,r=this._currentSetPosition),this.media_position=Math.min(r,this.media_duration??1)},this.onSeek=async e=>{if(!this.actions)return;const t=this.progressBar?.offsetWidth??1,r=e.offsetX/t,i=Math.floor(r*(this.media_duration??1));await this.actions.actionSeek(i),this._dragging=!1,this._requestProgress=!0,window.removeEventListener("pointerup",this.onPointerUp),this.removeEventListener("pointermove",this.pointerMoveListener)},this.pointerMoveListener=e=>{const t=this.progressBar,r=t?.offsetLeft??36,i=t?.offsetWidth??1,s=(e.offsetX-r)/i;let o=Math.floor(s*(this.media_duration??1));o=Math.min(this.media_duration??1,o),o=Math.max(0,o),this.media_position=o,this._newSetPosition=o,this.entity_position=o},this.onPointerDown=()=>{this._dragging=!0,this._requestProgress=!1,window.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointermove",this.pointerMoveListener)},this.onPointerUp=()=>{if(this.actions){try{this.actions.actionSeek(this._newSetPosition)}finally{window.removeEventListener("pointerup",this.onPointerUp),this.removeEventListener("pointermove",this.pointerMoveListener)}this._newSetPosition=this.media_position??0,this._updateTimeout&&clearTimeout(this._updateTimeout),this._dragging=!1,this._updateTimeout=window.setTimeout(()=>{this._requestProgress=!0,this.requestProgress()},5e3)}}}set media_position(e){e??=0,this._media_position=e;const t=Math.min(1,e/this._media_duration);this._prog_pct=t}get media_position(){return this._media_position||this.requestProgress(),this._media_position}set media_duration(e){e??=1,this._media_duration=e,this._media_duration||this.requestProgress();const t=Math.min(1,this._media_position/e);this._prog_pct=t}get media_duration(){return this._media_duration}set activePlayer(e){if(this._activePlayer&&!zr(this._activePlayer,e))return;if(!e)return;const t=e.attributes.media_duration??1,r=this._activePlayer?.attributes.media_title&&e.attributes.media_title!=this._activePlayer.attributes.media_title?1:e.attributes.media_position;this._activePlayer=e,this.media_duration??=t,this.media_position??=r,this.requestProgress()}get activePlayer(){return this._activePlayer}set player_data(e){e&&(this._player_data=e,this.requestProgress())}get player_data(){return this._player_data}requestProgress(){this.activePlayerController&&Gr(this.hass,this.activePlayerController.activeEntityID)&&(this.activePlayerController.getPlayerProgress().then(e=>{const t=e;this.entity_position=t??this.entity_position,this._newSetPosition=t??this.entity_position}),this.activePlayerController.getPlayerActiveItemDuration().then(e=>{this.media_duration=e,this.entity_duration=e}),"playing"==this.activePlayer?.state?this.startProgressTick():this.stopProgressTick())}startProgressTick(){this.stopProgressTick(),this._tickListener=window.setInterval(this.tickProgress,this._tick_duration_ms)}stopProgressTick(){if(this._tickListener)try{clearInterval(this._tickListener)}catch{}this._tickListener=void 0}renderVolumeBar(){if(this.controller?.Config.MusicPlayer.hide.track_progress_bar)return{_$litType$:Ea,values:[]};const e=this.player_data?.playing&&this.controller?.config?.expressive?"wavy medium":"medium progress-plain";return{_$litType$:Ca,values:[this.onPointerDown,this.onSeek,Math.round(100*this._prog_pct),e,this._prog_pct,this.renderVolumeBarHandle()]}}renderTime(){if(this.controller?.Config.MusicPlayer.hide.track_progress_time)return{_$litType$:Ia,values:[]};const e=Vr(this.media_position??0),t=Vr(this.media_duration??1);return{_$litType$:Ba,values:[this.controller?.config?.expressive?"time-expressive":"",e,t]}}renderVolumeBarHandle(){return{_$litType$:xa,values:[this._handleBarWidth.toString(),(100*this._prog_pct).toString(),this._handleBarWidth.toString()]}}render(){return{_$litType$:Pa,values:[this.renderTime(),this.renderVolumeBar()]}}connectedCallback(){this._tickListener??=window.setInterval(this.tickProgress,this._tick_duration_ms),this.activePlayerController&&this.hasUpdated&&this.requestProgress(),super.connectedCallback()}disconnectedCallback(){if(this.removeEventListener("pointermove",this.pointerMoveListener),window.removeEventListener("pointerup",this.onPointerUp),this._tickListener)try{clearInterval(this._tickListener)}finally{this._tickListener=void 0}super.disconnectedCallback()}shouldUpdate(e){const t=this.progressBar?.classList.contains("wavy"),r=t!=this.player_data?.playing;return e.size>0||r}static get styles(){return fa}};e([Pe()],Da.prototype,"_media_duration",void 0),e([Pe()],Da.prototype,"_media_position",void 0),e([Se("#progress-bar")],Da.prototype,"progressBar",void 0),e([a({context:pi,subscribe:!0})],Da.prototype,"activePlayerController",void 0),e([a({context:gi,subscribe:!0})],Da.prototype,"actions",void 0),e([a({context:mi,subscribe:!0})],Da.prototype,"controller",void 0),e([Pe()],Da.prototype,"_player_data",void 0),e([a({context:Zr,subscribe:!0})],Da.prototype,"hass",void 0),e([a({context:ti,subscribe:!0})],Da.prototype,"activePlayer",null),e([a({context:ii,subscribe:!0})],Da.prototype,"player_data",null),Da=e([Ce("mpc-progress-bar")],Da);var Sa=p`
  .artwork {
    border-radius: var(--artwork-border-radius);
    max-width: 100%;
    justify-self: center;
    display: block;
  }
  #asleep {
    height: 100%;
    width: 100%;
  }
  #asleep.expressive {
    color: rgba(from var(--md-sys-color-primary) r g b / 0.7);
  }

  #carousel {
    --aspect-ratio: 1;
    position: absolute;
  }
  #carousel.large {
    height: var(--artwork-large-height);
    aspect-ratio: 1;
    width: 100%;
  }
  #carousel.large.panel {
    height: 100% !important;
  }
  #carousel.medium {
    height: var(--artwork-medium-height);
    aspect-ratio: 1;
    place-content: center;
    position: absolute;
    top: calc(50% - (var(--artwork-medium-height) / 2) - 2em);
  }
  #carousel.small {
    position: absolute;
    height: var(--artwork-small-height);
    display: flex;
    aspect-ratio: 1;
    left: calc(50% - (var(--artwork-small-height) / 2));
    top: calc(50% - (var(--artwork-small-height) / 2));
  }
  wa-carousel.large::part(base) {
    column-gap: 0px;
  }
  wa-carousel-item img {
    max-height: 100%;
    max-width: 100%;
    aspect-ratio: 1;
    height: 100% !important;
    width: unset !important;
  }
  .panel .slot {
    max-height: 100%;
    max-width: 100%;
    aspect-ratio: 1;
    height: 100%;
  }
`
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */;function ka(e,t,r){const i=e=>Object.is(e,-0)?0:e;return i(e<t?t:e>r?r:e)}
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */
function Ra(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */var Qa=class{constructor(e,t){this.timerId=0,this.activeInteractions=0,this.paused=!1,this.stopped=!0,this.pause=()=>{this.activeInteractions++||(this.paused=!0,this.host.requestUpdate())},this.resume=()=>{--this.activeInteractions||(this.paused=!1,this.host.requestUpdate())},e.addController(this),this.host=e,this.tickCallback=t}hostConnected(){this.host.addEventListener("mouseenter",this.pause),this.host.addEventListener("mouseleave",this.resume),this.host.addEventListener("focusin",this.pause),this.host.addEventListener("focusout",this.resume),this.host.addEventListener("touchstart",this.pause,{passive:!0}),this.host.addEventListener("touchend",this.resume)}hostDisconnected(){this.stop(),this.host.removeEventListener("mouseenter",this.pause),this.host.removeEventListener("mouseleave",this.resume),this.host.removeEventListener("focusin",this.pause),this.host.removeEventListener("focusout",this.resume),this.host.removeEventListener("touchstart",this.pause),this.host.removeEventListener("touchend",this.resume)}start(e){this.stop(),this.stopped=!1,this.timerId=window.setInterval(()=>{this.paused||this.tickCallback()},e)}stop(){clearInterval(this.timerId),this.stopped=!0,this.host.requestUpdate()}},Ma={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(e,t)=>`Go to slide ${e} of ${t}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:e=>0===e?"No options selected":1===e?"1 option selected":`${e} options selected`,pauseAnimation:"Pause animation",playAnimation:"Play animation",previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollableRegion:"Scrollable region",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:e=>`Slide ${e}`,toggleColorFormat:"Toggle color format",zoomIn:"Zoom in",zoomOut:"Zoom out"};
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */xt(Ma);var Ha=Ma,Oa=class extends Dt{};
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */
function Ta(e,t){const r={waitUntilFirstUpdate:!1,...t};return(t,i)=>{const{update:s}=t,o=Array.isArray(e)?e:[e];t.update=function(e){o.forEach(t=>{const s=t;if(e.has(s)){const t=e.get(s),o=this[s];t!==o&&(r.waitUntilFirstUpdate&&!this.hasUpdated||this[i](t,o))}}),s.call(this,e)}}}
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */xt(Ha),
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */
(()=>{const e=(e,t)=>{let r=0;return function(...i){window.clearTimeout(r),r=window.setTimeout(()=>{e.call(this,...i)},t)}},t=(e,t,r)=>{const i=e[t];e[t]=function(...e){i.call(this,...e),r.call(this,i,...e)}};if(!("onscrollend"in window)){const r=new Set,i=new WeakMap,s=e=>{r.add(e.pointerId)},o=e=>{r.delete(e.pointerId)};document.addEventListener("pointerdown",s),document.addEventListener("pointerup",o),t(EventTarget.prototype,"addEventListener",function(t,s){if("scroll"!==s)return;const o=e(()=>{r.size?o():this.dispatchEvent(new Event("scrollend"))},100);t.call(this,"scroll",o,{passive:!0}),i.set(this,o)}),t(EventTarget.prototype,"removeEventListener",function(e,t){if("scroll"!==t)return;const r=i.get(this);r&&e.call(this,"scroll",r,{passive:!0})})}})();var La=class extends Event{constructor(e){super("wa-slide-change",{bubbles:!0,cancelable:!1,composed:!0}),this.detail=e}},qa=class extends Ir{constructor(){super(...arguments),this.loop=!1,this.slides=0,this.currentSlide=0,this.navigation=!1,this.pagination=!1,this.autoplay=!1,this.autoplayInterval=3e3,this.slidesPerPage=1,this.slidesPerMove=1,this.orientation="horizontal",this.mouseDragging=!1,this.activeSlide=0,this.scrolling=!1,this.dragging=!1,this.autoplayController=new Qa(this,()=>this.next()),this.dragStartPosition=[-1,-1],this.localize=new Oa(this),this.pendingSlideChange=!1,this.handleMouseDrag=e=>{this.dragging||(this.scrollContainer.style.setProperty("scroll-snap-type","none"),this.dragging=!0,this.dragStartPosition=[e.clientX,e.clientY]),this.scrollContainer.scrollBy({left:-e.movementX,top:-e.movementY,behavior:"instant"})},this.handleMouseDragEnd=()=>{const e=this.scrollContainer;document.removeEventListener("pointermove",this.handleMouseDrag,{capture:!0});const t=e.scrollLeft,r=e.scrollTop;e.style.removeProperty("scroll-snap-type");const i=e.scrollLeft,s=e.scrollTop;e.style.removeProperty("overflow"),e.style.setProperty("scroll-snap-type","none"),e.scrollTo({left:t,top:r,behavior:"instant"}),requestAnimationFrame(async()=>{var o,n;t===i&&r===s||(e.scrollTo({left:i,top:s,behavior:Ra()?"auto":"smooth"}),await(o=e,n="scrollend",new Promise(e=>{o.addEventListener(n,function t(r){r.target===o&&(o.removeEventListener(n,t),e())})}))),e.style.removeProperty("scroll-snap-type"),this.dragging=!1,this.dragStartPosition=[-1,-1],this.handleScrollEnd()})},this.handleSlotChange=e=>{e.some(e=>[...e.addedNodes,...e.removedNodes].some(e=>this.isCarouselItem(e)&&!e.hasAttribute("data-clone")))&&this.initializeSlides(),this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","region"),this.setAttribute("aria-label",this.localize.term("carousel"))}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect()}firstUpdated(){this.initializeSlides(),this.mutationObserver=new MutationObserver(this.handleSlotChange),this.mutationObserver.observe(this,{childList:!0,subtree:!0})}willUpdate(e){(e.has("slidesPerMove")||e.has("slidesPerPage"))&&(this.slidesPerMove=Math.min(this.slidesPerMove,this.slidesPerPage))}getPageCount(){const e=this.getSlides().length,{slidesPerPage:t,slidesPerMove:r,loop:i}=this,s=i?e/r:(e-t)/r+1;return Math.ceil(s)}getCurrentPage(){return Math.ceil(this.activeSlide/this.slidesPerMove)}canScrollNext(){return this.loop||this.getCurrentPage()<this.getPageCount()-1}canScrollPrev(){return this.loop||this.getCurrentPage()>0}getSlides({excludeClones:e=!0}={}){return[...this.children].filter(t=>this.isCarouselItem(t)&&(!e||!t.hasAttribute("data-clone")))}handleClick(e){if(this.dragging&&this.dragStartPosition[0]>0&&this.dragStartPosition[1]>0){const t=Math.abs(this.dragStartPosition[0]-e.clientX),r=Math.abs(this.dragStartPosition[1]-e.clientY);Math.sqrt(t*t+r*r)>=10&&e.preventDefault()}}handleKeyDown(e){if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)){const t=e.target,r="rtl"===this.localize.dir(),i=null!==t.closest('[part~="pagination-item"]'),s="ArrowDown"===e.key||!r&&"ArrowRight"===e.key||r&&"ArrowLeft"===e.key,o="ArrowUp"===e.key||!r&&"ArrowLeft"===e.key||r&&"ArrowRight"===e.key;e.preventDefault(),o&&this.previous(),s&&this.next(),"Home"===e.key&&this.goToSlide(0),"End"===e.key&&this.goToSlide(this.getSlides().length-1),i&&this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelector('[part~="pagination-item-active"]');e&&e.focus()})}}handleMouseDragStart(e){this.mouseDragging&&0===e.button&&(e.preventDefault(),document.addEventListener("pointermove",this.handleMouseDrag,{capture:!0,passive:!0}),document.addEventListener("pointerup",this.handleMouseDragEnd,{capture:!0,once:!0}))}handleScroll(){this.scrolling=!0,this.pendingSlideChange||this.synchronizeSlides()}synchronizeSlides(){const e=new IntersectionObserver(t=>{e.disconnect();for(const e of t){const t=e.target;t.toggleAttribute("inert",!e.isIntersecting),t.classList.toggle("--in-view",e.isIntersecting),t.setAttribute("aria-hidden",e.isIntersecting?"false":"true")}const r=t.find(e=>e.isIntersecting);if(!r)return;const i=this.getSlides({excludeClones:!1}),s=this.getSlides().length,o=i.indexOf(r.target),n=this.loop?o-this.slidesPerPage:o;if(r&&(this.activeSlide=(Math.ceil(n/this.slidesPerMove)*this.slidesPerMove+s)%s,!this.scrolling&&this.loop&&r.target.hasAttribute("data-clone"))){const e=Number(r.target.getAttribute("data-clone"));this.goToSlide(e,"instant")}},{root:this.scrollContainer,threshold:.6});this.getSlides({excludeClones:!1}).forEach(t=>{e.observe(t)})}handleScrollEnd(){this.scrolling&&!this.dragging&&(this.synchronizeSlides(),this.scrolling=!1,this.pendingSlideChange=!1,this.synchronizeSlides())}isCarouselItem(e){return e instanceof Element&&"wa-carousel-item"===e.tagName.toLowerCase()}initializeSlides(){this.getSlides({excludeClones:!1}).forEach((e,t)=>{e.classList.remove("--in-view"),e.classList.remove("--is-active"),e.setAttribute("aria-label",this.localize.term("slideNum",t+1)),e.hasAttribute("data-clone")&&e.remove()}),this.updateSlidesSnap(),this.loop&&this.createClones(),this.goToSlide(this.activeSlide,"auto"),this.synchronizeSlides()}createClones(){const e=this.getSlides(),t=this.slidesPerPage,r=e.slice(-t),i=e.slice(0,t);r.reverse().forEach((t,r)=>{const i=t.cloneNode(!0);i.setAttribute("data-clone",String(e.length-r-1)),this.prepend(i)}),i.forEach((e,t)=>{const r=e.cloneNode(!0);r.setAttribute("data-clone",String(t)),this.append(r)})}handleSlideChange(){const e=this.getSlides();e.forEach((e,t)=>{e.classList.toggle("--is-active",t===this.activeSlide)}),this.hasUpdated&&this.dispatchEvent(new La({index:this.activeSlide,slide:e[this.activeSlide]}))}updateSlidesSnap(){const e=this.getSlides(),t=this.slidesPerMove;e.forEach((e,r)=>{(r+t)%t===0?e.style.removeProperty("scroll-snap-align"):e.style.setProperty("scroll-snap-align","none")})}handleAutoplayChange(){this.autoplayController.stop(),this.autoplay&&this.autoplayController.start(this.autoplayInterval)}previous(e="smooth"){this.goToSlide(this.activeSlide-this.slidesPerMove,e)}next(e="smooth"){this.goToSlide(this.activeSlide+this.slidesPerMove,e)}goToSlide(e,t="smooth"){const{slidesPerPage:r,loop:i}=this,s=this.getSlides(),o=this.getSlides({excludeClones:!1});if(!s.length)return;const n=i?(e+s.length)%s.length:ka(e,0,s.length-r);this.activeSlide=n;const a=o[ka(e+(i?r:0)+("rtl"===this.localize.dir()?r-1:0),0,o.length-1)];this.scrollToSlide(a,Ra()?"auto":t)}scrollToSlide(e,t="smooth"){this.pendingSlideChange=!0,window.requestAnimationFrame(()=>{if(!this.scrollContainer)return;const r=this.scrollContainer,i=r.getBoundingClientRect(),s=e.getBoundingClientRect(),o=s.left-i.left,n=s.top-i.top;o||n?(this.pendingSlideChange=!0,r.scrollTo({left:o+r.scrollLeft,top:n+r.scrollTop,behavior:t})):this.pendingSlideChange=!1})}render(){const{slidesPerMove:e,scrolling:t}=this;let r=0,i=0,s=!1,o=!1;this.hasUpdated&&(r=this.getPageCount(),i=this.getCurrentPage(),s=this.canScrollPrev(),o=this.canScrollNext());const n="rtl"===this.localize.dir();return Z`
      <div part="base" class="carousel">
        <div
          id="scroll-container"
          part="scroll-container"
          class="${Gt({slides:!0,"slides-horizontal":"horizontal"===this.orientation,"slides-vertical":"vertical"===this.orientation,"slides-dragging":this.dragging})}"
          style="--slides-per-page: ${this.slidesPerPage};"
          aria-busy="${t?"true":"false"}"
          aria-atomic="true"
          tabindex="0"
          @keydown=${this.handleKeyDown}
          @mousedown="${this.handleMouseDragStart}"
          @scroll="${this.handleScroll}"
          @scrollend=${this.handleScrollEnd}
          @click=${this.handleClick}
        >
          <slot @slotchange=${()=>this.requestUpdate()}></slot>
        </div>

        ${this.navigation?Z`
              <div part="navigation" class="navigation">
                <button
                  part="navigation-button navigation-button-previous"
                  class="${Gt({"navigation-button":!0,"navigation-button-previous":!0,"navigation-button-disabled":!s})}"
                  aria-label="${this.localize.term("previousSlide")}"
                  aria-controls="scroll-container"
                  aria-disabled="${s?"false":"true"}"
                  @click=${s?()=>this.previous():null}
                >
                  <slot name="previous-icon">
                    <wa-mpc-icon library="system" name="${n?"chevron-right":"chevron-left"}"></wa-mpc-icon>
                  </slot>
                </button>

                <button
                  part="navigation-button navigation-button-next"
                  class=${Gt({"navigation-button":!0,"navigation-button-next":!0,"navigation-button-disabled":!o})}
                  aria-label="${this.localize.term("nextSlide")}"
                  aria-controls="scroll-container"
                  aria-disabled="${o?"false":"true"}"
                  @click=${o?()=>this.next():null}
                >
                  <slot name="next-icon">
                    <wa-mpc-icon library="system" name="${n?"chevron-left":"chevron-right"}"></wa-mpc-icon>
                  </slot>
                </button>
              </div>
            `:""}
        ${this.pagination?Z`
              <div part="pagination" role="tablist" class="pagination" aria-controls="scroll-container">
                ${function*(e,t){if(void 0!==e){let r=0;for(const i of e)yield t(i,r++)}}
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */(function*(e,t,r=1){const i=void 0===t?0:e;t??=e;for(let e=i;r>0?e<t:t<e;e+=r)yield e}(r),t=>{const s=t===i;return Z`
                    <button
                      part="pagination-item ${s?"pagination-item-active":""}"
                      class="${Gt({"pagination-item":!0,"pagination-item-active":s})}"
                      role="tab"
                      aria-selected="${s?"true":"false"}"
                      aria-label="${this.localize.term("goToSlide",t+1,r)}"
                      tabindex=${s?"0":"-1"}
                      @click=${()=>this.goToSlide(t*e)}
                      @keydown=${this.handleKeyDown}
                    ></button>
                  `})}
              </div>
            `:Z``}
      </div>
    `}};qa.css=":host {\n  --aspect-ratio: 16 / 9;\n  --scroll-hint: 0px;\n  --slide-gap: var(--wa-space-m, 1rem); /* fallback value is necessary */\n\n  display: flex;\n}\n\n.carousel {\n  display: grid;\n  grid-template-columns: min-content 1fr min-content;\n  grid-template-rows: 1fr min-content;\n  grid-template-areas:\n    '. slides .'\n    '. pagination .';\n  gap: var(--wa-space-m);\n  align-items: center;\n  min-height: 100%;\n  min-width: 100%;\n  position: relative;\n}\n\n.pagination {\n  grid-area: pagination;\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: center;\n  gap: var(--wa-space-s);\n}\n\n.slides {\n  grid-area: slides;\n\n  display: grid;\n  height: 100%;\n  width: 100%;\n  align-items: center;\n  justify-items: center;\n  overflow: auto;\n  overscroll-behavior-x: contain;\n  scrollbar-width: none;\n  aspect-ratio: calc(var(--aspect-ratio) * var(--slides-per-page));\n  border-radius: var(--wa-border-radius-m);\n\n  --slide-size: calc((100% - (var(--slides-per-page) - 1) * var(--slide-gap)) / var(--slides-per-page));\n}\n\n@media (prefers-reduced-motion) {\n  :where(.slides) {\n    scroll-behavior: auto;\n  }\n}\n\n.slides-horizontal {\n  grid-auto-flow: column;\n  grid-auto-columns: var(--slide-size);\n  grid-auto-rows: 100%;\n  column-gap: var(--slide-gap);\n  scroll-snap-type: x mandatory;\n  scroll-padding-inline: var(--scroll-hint);\n  padding-inline: var(--scroll-hint);\n  overflow-y: hidden;\n}\n\n.slides-vertical {\n  grid-auto-flow: row;\n  grid-auto-columns: 100%;\n  grid-auto-rows: var(--slide-size);\n  row-gap: var(--slide-gap);\n  scroll-snap-type: y mandatory;\n  scroll-padding-block: var(--scroll-hint);\n  padding-block: var(--scroll-hint);\n  overflow-x: hidden;\n}\n\n.slides-dragging,\n.slides-dropping {\n  scroll-snap-type: unset;\n}\n\n:host([vertical]) ::slotted(wa-carousel-item) {\n  height: 100%;\n}\n\n.slides::-webkit-scrollbar {\n  display: none;\n}\n\n.navigation {\n  grid-area: navigation;\n  display: contents;\n  font-size: var(--wa-font-size-l);\n}\n\n.navigation-button {\n  flex: 0 0 auto;\n  display: flex;\n  align-items: center;\n  background: none;\n  border: none;\n  border-radius: var(--wa-border-radius-m);\n  font-size: inherit;\n  color: var(--wa-color-text-quiet);\n  padding: var(--wa-space-xs);\n  cursor: pointer;\n  transition: var(--wa-transition-normal) color;\n  appearance: none;\n}\n\n.navigation-button-disabled {\n  opacity: 0.5;\n  cursor: not-allowed;\n}\n\n.navigation-button-disabled::part(base) {\n  pointer-events: none;\n}\n\n.navigation-button-previous {\n  grid-column: 1;\n  grid-row: 1;\n}\n\n.navigation-button-next {\n  grid-column: 3;\n  grid-row: 1;\n}\n\n.pagination-item {\n  display: block;\n  cursor: pointer;\n  background: none;\n  border: 0;\n  border-radius: var(--wa-border-radius-circle);\n  width: var(--wa-space-s);\n  height: var(--wa-space-s);\n  background-color: var(--wa-color-neutral-fill-normal);\n  padding: 0;\n  margin: 0;\n  transition: transform var(--wa-transition-slow);\n}\n\n.pagination-item-active {\n  background-color: var(--wa-form-control-activated-color);\n  transform: scale(1.25);\n}\n\n/* Focus styles */\n.slides:focus-visible,\n.navigation-button:focus-visible,\n.pagination-item:focus-visible {\n  outline: var(--wa-focus-ring);\n  outline-offset: var(--wa-focus-ring-offset);\n}\n",wr([xe({type:Boolean,reflect:!0})],qa.prototype,"loop",2),wr([xe({type:Number,reflect:!0})],qa.prototype,"slides",2),wr([xe({type:Number,reflect:!0})],qa.prototype,"currentSlide",2),wr([xe({type:Boolean,reflect:!0})],qa.prototype,"navigation",2),wr([xe({type:Boolean,reflect:!0})],qa.prototype,"pagination",2),wr([xe({type:Boolean,reflect:!0})],qa.prototype,"autoplay",2),wr([xe({type:Number,attribute:"autoplay-interval"})],qa.prototype,"autoplayInterval",2),wr([xe({type:Number,attribute:"slides-per-page"})],qa.prototype,"slidesPerPage",2),wr([xe({type:Number,attribute:"slides-per-move"})],qa.prototype,"slidesPerMove",2),wr([xe()],qa.prototype,"orientation",2),wr([xe({type:Boolean,reflect:!0,attribute:"mouse-dragging"})],qa.prototype,"mouseDragging",2),wr([Se(".slides")],qa.prototype,"scrollContainer",2),wr([Se(".pagination")],qa.prototype,"paginationContainer",2),wr([Pe()],qa.prototype,"activeSlide",2),wr([Pe()],qa.prototype,"scrolling",2),wr([Pe()],qa.prototype,"dragging",2),wr([function(e){return(t,r)=>{const i="function"==typeof t?t:t[r];Object.assign(i,e)}}({passive:!0})],qa.prototype,"handleScroll",1),wr([Ta("loop",{waitUntilFirstUpdate:!0}),Ta("slidesPerPage",{waitUntilFirstUpdate:!0})],qa.prototype,"initializeSlides",1),wr([Ta("activeSlide")],qa.prototype,"handleSlideChange",1),wr([Ta("slidesPerMove")],qa.prototype,"updateSlidesSnap",1),wr([Ta("autoplay")],qa.prototype,"handleAutoplayChange",1),qa=wr([Ce("wa-carousel")],qa);
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */
var Ua=class extends Event{constructor(){super("wa-load",{bubbles:!0,cancelable:!1,composed:!0})}},Fa="";
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */function Va(){if(!Fa){const t=document.querySelector("[data-fa-kit-code]");t&&(e=t.getAttribute("data-fa-kit-code")||"",Fa=e)}var e;return Fa}var za="7.0.1";var Ja={name:"default",resolver:(e,t="classic",r="solid")=>function(e,t,r){const i=Va(),s=i.length>0;let o="solid";return"notdog"===t?("solid"===r&&(o="solid"),"duo-solid"===r&&(o="duo-solid"),`https://ka-p.fontawesome.com/releases/v${za}/svgs/notdog-${o}/${e}.svg?token=${encodeURIComponent(i)}`):"chisel"===t?`https://ka-p.fontawesome.com/releases/v${za}/svgs/chisel-regular/${e}.svg?token=${encodeURIComponent(i)}`:"etch"===t?`https://ka-p.fontawesome.com/releases/v${za}/svgs/etch-solid/${e}.svg?token=${encodeURIComponent(i)}`:"jelly"===t?("regular"===r&&(o="regular"),"duo-regular"===r&&(o="duo-regular"),"fill-regular"===r&&(o="fill-regular"),`https://ka-p.fontawesome.com/releases/v${za}/svgs/jelly-${o}/${e}.svg?token=${encodeURIComponent(i)}`):"slab"===t?("solid"!==r&&"regular"!==r||(o="regular"),"press-regular"===r&&(o="press-regular"),`https://ka-p.fontawesome.com/releases/v${za}/svgs/slab-${o}/${e}.svg?token=${encodeURIComponent(i)}`):"thumbprint"===t?`https://ka-p.fontawesome.com/releases/v${za}/svgs/thumbprint-light/${e}.svg?token=${encodeURIComponent(i)}`:"whiteboard"===t?`https://ka-p.fontawesome.com/releases/v${za}/svgs/whiteboard-semibold/${e}.svg?token=${encodeURIComponent(i)}`:("classic"===t&&("thin"===r&&(o="thin"),"light"===r&&(o="light"),"regular"===r&&(o="regular"),"solid"===r&&(o="solid")),"sharp"===t&&("thin"===r&&(o="sharp-thin"),"light"===r&&(o="sharp-light"),"regular"===r&&(o="sharp-regular"),"solid"===r&&(o="sharp-solid")),"duotone"===t&&("thin"===r&&(o="duotone-thin"),"light"===r&&(o="duotone-light"),"regular"===r&&(o="duotone-regular"),"solid"===r&&(o="duotone")),"sharp-duotone"===t&&("thin"===r&&(o="sharp-duotone-thin"),"light"===r&&(o="sharp-duotone-light"),"regular"===r&&(o="sharp-duotone-regular"),"solid"===r&&(o="sharp-duotone-solid")),"brands"===t&&(o="brands"),s?`https://ka-p.fontawesome.com/releases/v${za}/svgs/${o}/${e}.svg?token=${encodeURIComponent(i)}`:`https://ka-f.fontawesome.com/releases/v${za}/svgs/${o}/${e}.svg`)}(e,t,r),mutator:(e,t)=>{if(t?.family&&!e.hasAttribute("data-duotone-initialized")){const{family:r,variant:i}=t;if("duotone"===r||"sharp-duotone"===r||"notdog"===r&&"duo-solid"===i||"jelly"===r&&"duo-regular"===i||"thumbprint"===r){const r=[...e.querySelectorAll("path")],i=r.find(e=>!e.hasAttribute("opacity")),s=r.find(e=>e.hasAttribute("opacity"));if(!i||!s)return;if(i.setAttribute("data-duotone-primary",""),s.setAttribute("data-duotone-secondary",""),t.swapOpacity&&i&&s){const e=s.getAttribute("opacity")||"0.4";i.style.setProperty("--path-opacity",e),s.style.setProperty("--path-opacity","1")}e.setAttribute("data-duotone-initialized","")}}}};var Ya={solid:{check:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z"/></svg>',"chevron-down":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"/></svg>',"chevron-left":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"/></svg>',"chevron-right":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"/></svg>',circle:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z"/></svg>',eyedropper:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M341.6 29.2l-101.6 101.6-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4 101.6-101.6c39-39 39-102.2 0-141.1s-102.2-39-141.1 0zM55.4 323.3c-15 15-23.4 35.4-23.4 56.6l0 42.4-26.6 39.9c-8.5 12.7-6.8 29.6 4 40.4s27.7 12.5 40.4 4l39.9-26.6 42.4 0c21.2 0 41.6-8.4 56.6-23.4l109.4-109.4-45.3-45.3-109.4 109.4c-3 3-7.1 4.7-11.3 4.7l-36.1 0 0-36.1c0-4.2 1.7-8.3 4.7-11.3l109.4-109.4-45.3-45.3-109.4 109.4z"/></svg>',"grip-vertical":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M128 40c0-22.1-17.9-40-40-40L40 0C17.9 0 0 17.9 0 40L0 88c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zm0 192c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zM0 424l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40zM320 40c0-22.1-17.9-40-40-40L232 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zM192 232l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40zM320 424c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48z"/></svg>',indeterminate:'<svg part="indeterminate-icon" class="icon" viewBox="0 0 16 16"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round"><g stroke="currentColor" stroke-width="2"><g transform="translate(2.285714 6.857143)"><path d="M10.2857143,1.14285714 L1.14285714,1.14285714"/></g></g></g></svg>',minus:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32z"/></svg>',pause:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M48 32C21.5 32 0 53.5 0 80L0 432c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48L48 32zm224 0c-26.5 0-48 21.5-48 48l0 352c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48l-64 0z"/></svg>',play:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z"/></svg>',star:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M309.5-18.9c-4.1-8-12.4-13.1-21.4-13.1s-17.3 5.1-21.4 13.1L193.1 125.3 33.2 150.7c-8.9 1.4-16.3 7.7-19.1 16.3s-.5 18 5.8 24.4l114.4 114.5-25.2 159.9c-1.4 8.9 2.3 17.9 9.6 23.2s16.9 6.1 25 2L288.1 417.6 432.4 491c8 4.1 17.7 3.3 25-2s11-14.2 9.6-23.2L441.7 305.9 556.1 191.4c6.4-6.4 8.6-15.8 5.8-24.4s-10.1-14.9-19.1-16.3L383 125.3 309.5-18.9z"/></svg>',user:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M224 248a120 120 0 1 0 0-240 120 120 0 1 0 0 240zm-29.7 56C95.8 304 16 383.8 16 482.3 16 498.7 29.3 512 45.7 512l356.6 0c16.4 0 29.7-13.3 29.7-29.7 0-98.5-79.8-178.3-178.3-178.3l-59.4 0z"/></svg>',xmark:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"/></svg>'},regular:{"circle-question":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M464 256a208 208 0 1 0 -416 0 208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm256-80c-17.7 0-32 14.3-32 32 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-44.2 35.8-80 80-80s80 35.8 80 80c0 47.2-36 67.2-56 74.5l0 3.8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8.1c0-20.5 14.8-35.2 30.1-40.2 6.4-2.1 13.2-5.5 18.2-10.3 4.3-4.2 7.7-10 7.7-19.6 0-17.7-14.3-32-32-32zM224 368a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>',"circle-xmark":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM167 167c-9.4 9.4-9.4 24.6 0 33.9l55 55-55 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55-55-55c-9.4-9.4-24.6-9.4-33.9 0z"/></svg>',copy:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M384 336l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l133.5 0c4.2 0 8.3 1.7 11.3 4.7l58.5 58.5c3 3 4.7 7.1 4.7 11.3L400 320c0 8.8-7.2 16-16 16zM192 384l192 0c35.3 0 64-28.7 64-64l0-197.5c0-17-6.7-33.3-18.7-45.3L370.7 18.7C358.7 6.7 342.5 0 325.5 0L192 0c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-16-48 0 0 16c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l16 0 0-48-16 0z"/></svg>',eye:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M288 80C222.8 80 169.2 109.6 128.1 147.7 89.6 183.5 63 226 49.4 256 63 286 89.6 328.5 128.1 364.3 169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256 513 226 486.4 183.5 447.9 147.7 406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1 3.3 7.9 3.3 16.7 0 24.6-14.9 35.7-46.2 87.7-93 131.1-47.1 43.7-111.8 80.6-192.6 80.6S142.5 443.2 95.4 399.4c-46.8-43.5-78.1-95.4-93-131.1-3.3-7.9-3.3-16.7 0-24.6 14.9-35.7 46.2-87.7 93-131.1zM288 336c44.2 0 80-35.8 80-80 0-29.6-16.1-55.5-40-69.3-1.4 59.7-49.6 107.9-109.3 109.3 13.8 23.9 39.7 40 69.3 40zm-79.6-88.4c2.5 .3 5 .4 7.6 .4 35.3 0 64-28.7 64-64 0-2.6-.2-5.1-.4-7.6-37.4 3.9-67.2 33.7-71.1 71.1zm45.6-115c10.8-3 22.2-4.5 33.9-4.5 8.8 0 17.5 .9 25.8 2.6 .3 .1 .5 .1 .8 .2 57.9 12.2 101.4 63.7 101.4 125.2 0 70.7-57.3 128-128 128-61.6 0-113-43.5-125.2-101.4-1.8-8.6-2.8-17.5-2.8-26.6 0-11 1.4-21.8 4-32 .2-.7 .3-1.3 .5-1.9 11.9-43.4 46.1-77.6 89.5-89.5z"/></svg>',"eye-slash":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-96.4-96.4c2.7-2.4 5.4-4.8 8-7.2 46.8-43.5 78.1-95.4 93-131.1 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1-47.1-43.7-111.8-80.6-192.6-80.6-56.8 0-105.6 18.2-146 44.2L41-24.9zM176.9 111.1c32.1-18.9 69.2-31.1 111.1-31.1 65.2 0 118.8 29.6 159.9 67.7 38.5 35.7 65.1 78.3 78.6 108.3-13.6 30-40.2 72.5-78.6 108.3-3.1 2.8-6.2 5.6-9.4 8.4L393.8 328c14-20.5 22.2-45.3 22.2-72 0-70.7-57.3-128-128-128-26.7 0-51.5 8.2-72 22.2l-39.1-39.1zm182 182l-108-108c11.1-5.8 23.7-9.1 37.1-9.1 44.2 0 80 35.8 80 80 0 13.4-3.3 26-9.1 37.1zM103.4 173.2l-34-34c-32.6 36.8-55 75.8-66.9 104.5-3.3 7.9-3.3 16.7 0 24.6 14.9 35.7 46.2 87.7 93 131.1 47.1 43.7 111.8 80.6 192.6 80.6 37.3 0 71.2-7.9 101.5-20.6L352.2 422c-20 6.4-41.4 10-64.2 10-65.2 0-118.8-29.6-159.9-67.7-38.5-35.7-65.1-78.3-78.6-108.3 10.4-23.1 28.6-53.6 54-82.8z"/></svg>',star:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path fill="currentColor" d="M288.1-32c9 0 17.3 5.1 21.4 13.1L383 125.3 542.9 150.7c8.9 1.4 16.3 7.7 19.1 16.3s.5 18-5.8 24.4L441.7 305.9 467 465.8c1.4 8.9-2.3 17.9-9.6 23.2s-17 6.1-25 2L288.1 417.6 143.8 491c-8 4.1-17.7 3.3-25-2s-11-14.2-9.6-23.2L134.4 305.9 20 191.4c-6.4-6.4-8.6-15.8-5.8-24.4s10.1-14.9 19.1-16.3l159.9-25.4 73.6-144.2c4.1-8 12.4-13.1 21.4-13.1zm0 76.8L230.3 158c-3.5 6.8-10 11.6-17.6 12.8l-125.5 20 89.8 89.9c5.4 5.4 7.9 13.1 6.7 20.7l-19.8 125.5 113.3-57.6c6.8-3.5 14.9-3.5 21.8 0l113.3 57.6-19.8-125.5c-1.2-7.6 1.3-15.3 6.7-20.7l89.8-89.9-125.5-20c-7.6-1.2-14.1-6-17.6-12.8L288.1 44.8z"/></svg>'}},Na=[Ja,{name:"system",resolver:(e,t="classic",r="solid")=>{let i=Ya[r][e]??Ya.regular[e]??Ya.regular["circle-question"];return i?
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */
function(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}(i):""}}],Xa=[];function ja(e){return Na.find(t=>t.name===e)}
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */
var Ka,Ga=class extends Event{constructor(){super("wa-error",{bubbles:!0,cancelable:!1,composed:!0})}},Wa=Symbol(),Za=Symbol(),_a=new Map,$a=class extends Ir{constructor(){super(...arguments),this.svg=null,this.autoWidth=!1,this.swapOpacity=!1,this.label="",this.library="default",this.resolveIcon=async(e,t)=>{let r;if(t?.spriteSheet){this.hasUpdated||await this.updateComplete,this.svg=Z`<svg part="svg">
        <use part="use" href="${e}"></use>
      </svg>`,await this.updateComplete;const r=this.shadowRoot.querySelector("[part='svg']");return"function"==typeof t.mutator&&t.mutator(r,this),this.svg}try{if(r=await fetch(e,{mode:"cors"}),!r.ok)return 410===r.status?Wa:Za}catch{return Za}try{const e=document.createElement("div");e.innerHTML=await r.text();const t=e.firstElementChild;if("svg"!==t?.tagName?.toLowerCase())return Wa;Ka||(Ka=new DOMParser);const i=Ka.parseFromString(t.outerHTML,"text/html").body.querySelector("svg");return i?(i.part.add("svg"),document.adoptNode(i)):Wa}catch{return Wa}}}connectedCallback(){var e;super.connectedCallback(),e=this,Xa.push(e)}firstUpdated(e){super.firstUpdated(e),this.setIcon()}disconnectedCallback(){var e;super.disconnectedCallback(),e=this,Xa=Xa.filter(t=>t!==e)}getIconSource(){const e=ja(this.library),t=this.family||"classic";return this.name&&e?{url:e.resolver(this.name,t,this.variant,this.autoWidth),fromLibrary:!0}:{url:this.src,fromLibrary:!1}}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){const{url:e,fromLibrary:t}=this.getIconSource(),r=t?ja(this.library):void 0;if(!e)return void(this.svg=null);let i=_a.get(e);i||(i=this.resolveIcon(e,r),_a.set(e,i));const s=await i;if(s===Za&&_a.delete(e),e===this.getIconSource().url)if(Fe(s))this.svg=s;else switch(s){case Za:case Wa:this.svg=null,this.dispatchEvent(new Ga);break;default:this.svg=s.cloneNode(!0),r?.mutator?.(this.svg,this),this.dispatchEvent(new Ua)}}updated(e){super.updated(e);const t=ja(this.library),r=this.shadowRoot?.querySelector("svg");r&&t?.mutator?.(r,this)}render(){return this.hasUpdated?this.svg:Z`<svg part="svg" width="16" height="16"></svg>`}};$a.css=":host {\n  --primary-color: currentColor;\n  --primary-opacity: 1;\n  --secondary-color: currentColor;\n  --secondary-opacity: 0.4;\n\n  box-sizing: content-box;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  vertical-align: -0.125em;\n}\n\n/* Standard */\n:host(:not([auto-width])) {\n  width: 1.25em;\n  height: 1em;\n}\n\n/* Auto-width */\n:host([auto-width]) {\n  width: auto;\n  height: 1em;\n}\n\nsvg {\n  height: 1em;\n  overflow: visible;\n\n  /* Duotone colors with path-specific opacity fallback */\n  path[data-duotone-primary] {\n    color: var(--primary-color);\n    opacity: var(--path-opacity, var(--primary-opacity));\n  }\n\n  path[data-duotone-secondary] {\n    color: var(--secondary-color);\n    opacity: var(--path-opacity, var(--secondary-opacity));\n  }\n}\n",wr([Pe()],$a.prototype,"svg",2),wr([xe({reflect:!0})],$a.prototype,"name",2),wr([xe({reflect:!0})],$a.prototype,"family",2),wr([xe({reflect:!0})],$a.prototype,"variant",2),wr([xe({attribute:"auto-width",type:Boolean,reflect:!0})],$a.prototype,"autoWidth",2),wr([xe({attribute:"swap-opacity",type:Boolean,reflect:!0})],$a.prototype,"swapOpacity",2),wr([xe()],$a.prototype,"src",2),wr([xe()],$a.prototype,"label",2),wr([xe({reflect:!0})],$a.prototype,"library",2),wr([Ta("label")],$a.prototype,"handleLabelChange",1),wr([Ta(["family","name","library","variant","src","autoWidth","swapOpacity"],{waitUntilFirstUpdate:!0})],$a.prototype,"setIcon",1),$a=wr([Ce("wa-mpc-icon")],$a);
/*! Copyright 2025 Fonticons, Inc. - https://webawesome.com/license */
var el=class extends Ir{connectedCallback(){super.connectedCallback(),this.setAttribute("role","group")}render(){return Z` <slot></slot> `}};el.css=":host {\n  --aspect-ratio: inherit;\n\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  flex-direction: column;\n  width: 100%;\n  max-height: 100%;\n  aspect-ratio: var(--aspect-ratio);\n  scroll-snap-align: start;\n  scroll-snap-stop: always;\n}\n\n::slotted(img) {\n  width: 100% !important;\n  height: 100% !important;\n  object-fit: cover;\n}\n",el=wr([Ce("wa-carousel-item")],el);const{AttributePart:tl,PropertyPart:rl,EventPart:il}=Ti,sl=e=>e,ol={h:sl`
      <wa-carousel-item>
        <ha-svg-icon id="asleep">
      </ha-svg-icon></wa-carousel-item>
    `,parts:[{type:1,index:1,name:"path",strings:["",""],ctor:rl},{type:1,index:1,name:"class",strings:["",""],ctor:tl}]},nl={h:sl`
      <wa-carousel-item id="active-slide">
        <div class="slot">
          <img id="img-playing" loading="lazy">
        </div>
      </wa-carousel-item>
    `,parts:[{type:1,index:0,name:"data-queueitem",strings:["",""],ctor:tl},{type:1,index:2,name:"class",strings:["artwork ",""],ctor:tl},{type:1,index:2,name:"src",strings:["",""],ctor:tl}]},al={h:sl`
      <wa-carousel id="carousel" mouse-dragging="">
        <?>
      </wa-carousel>
    `,parts:[{type:1,index:0,name:"class",strings:["",""],ctor:tl},{type:1,index:0,name:"pointerdown",strings:["",""],ctor:il},{type:2,index:1}]};let ll=class extends me{constructor(){super(...arguments),this._intervalSet=!1,this._intervalMs=250,this._queue=null,this._slidesInserted=!1,this._pushingArtwork=!1,this._touchActive=!1,this._observerCB=()=>{if(this._touchActive)return;const e=this.getActiveIndex();this.delayedGoToSlide(e)},this.onSwipe=e=>{if(!this.queue?.length)return;this.queue[e].playing=!0;const t=this.queue[e];t.media_content_id!=this.activePlayer.attributes.media_content_id&&(navigator.vibrate&&navigator.vibrate(Pr.Player.ACTION_SWIPE),this.controller.Queue&&this.controller.Queue.playQueueItem(t.queue_item_id))},this.onPointerDown=()=>{this._touchActive=!0,window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("touchend",this.onPointerUp,{passive:!0})},this.onPointerUp=()=>{setTimeout(()=>{this._touchActive=!1},150),window.removeEventListener("pointerup",this.onPointerUp),this._pointerUpCheckSwipe()},this._pointerUpCheckSwipe=async()=>{if(!this.queue)return;if(await Xr(100),!this.carouselItems)return;const e=[...this.carouselItems].findIndex(e=>e.classList.contains("--in-view")),t=this.queue.findIndex(e=>e.playing);!e&&0!=e||!t&&0!=t||e!=t&&this.onSwipe(e)},this._intervalGoToSlide=()=>{this.delayedGoToSlide(this.getActiveIndex())}}set activePlayer(e){zr(this._activePlayer,e)&&(this._activePlayer=e)}get activePlayer(){return this._activePlayer}set queue(e){e&&(e=this._filterQueue(e)),Yr(this._queue,e)||(this._queue=e,this.pushQueueArtwork())}get queue(){return this._queue}getActiveIndex(){return this.queue?.findIndex(e=>e.playing)??0}_filterQueue(e){if(e.length<=10)return e;const t=e.findIndex(e=>e.playing);if(0!=t&&!t)return e.slice(0,10);const r=Math.max(0,t-5),i=Math.min(e.length,t+6);return e.slice(r,i)}renderEmptyQueue(){const e=this.controller.config?.expressive?"expressive":"";return{_$litType$:ol,values:[this.Icons.ASLEEP,e]}}delayedGoToSlide(e){if(!this.carouselItems)return;const t=this.carouselItems[e]?.dataset?.queueitem;if(!t)return;if(this._touchActive)return;const r=this.getIntersectingSlide();if(!r||!this.carouselElement)return;t!=r.dataset.queueitem&&this.carouselElement.goToSlide(e,"instant")}getIntersectingSlide(){if(!this.carouselItems?.length)return;const e=this.carouselItems[0],t=e.assignedSlot?.parentElement;if(!t)return;const r=t.scrollLeft,i=t.offsetWidth,s=r+i,o=[...this.carouselItems].filter(e=>{const t=e.offsetLeft+e.offsetWidth/2;return t>=r&&t<=s});return o.length>0?o[0]:e}async pushQueueArtwork(){if(this._pushingArtwork)return;this._pushingArtwork=!0,await Xr(300),this._pushQueueArtwork();const e=this.getActiveIndex();this.delayedGoToSlide(e),this._pushingArtwork=!1}_pushQueueArtwork(){const e=this.queue,t=this.getActiveIndex();e&&(t||0==t)&&this.activeSlide&&(this.createAndDestroyCarouselItemsAsNeeded(),e.forEach((e,t)=>{let r=e.media_image;if(0===r.length&&(r=e.local_image_encoded??""),e.playing){const i=this.activePlayer.attributes,s=i.entity_picture??r,o=i.entity_picture_local??s,n=[];s&&n.push(s),n.push(r),this.updateCarouselImg(t,o,e.queue_item_id,n,!0)}else this.updateCarouselImg(t,r,e.queue_item_id)}))}async updateCarouselImg(e,t,r,i=[],s=!1){const o=this.carouselElement?.querySelectorAll("img")[e];if(!o)return;const n=await Or(this.hass,t,ir.CLEFT,this.Config.download_local,this.Config.proxy_all_artwork);o.src=n.image_url.length>0?n.image_url:n.fallback_url,o.onerror=async()=>{const e=[t,...i,ir.CLEFT],r=e.findIndex(e=>o.src==e),s=e[r+1]??ir.CLEFT,n=await Or(this.hass,s,ir.CLEFT,this.Config.download_local,this.Config.proxy_all_artwork);o.src=n.image_url},o.parentElement?.setAttribute("data-queueitem",r),s?(o.setAttribute("id","img-playing"),o.parentElement?.setAttribute("id","active-slide")):o.id&&(o.id="",o.removeAttribute("id"),o.parentElement?.removeAttribute("id"))}createAndDestroyCarouselItemsAsNeeded(){const e=this.carouselItems;if(!e||!this.queue)return;const t=[...e].findIndex(e=>"active-slide"==e.id),r=t,i=e.length-t-1,s=this.queue.findIndex(e=>e.playing),o=s,n=this.queue.length-s-1;if(r!=o||i!=n){if(r<o){const e=o-r;this.insertSlides(e,"start")}else if(r>o){const e=r-o;this.removeSlides(e,"start")}if(i<n){const e=n-i;this.insertSlides(e,"end")}else if(i>n){const e=i-n;this.removeSlides(e,"end")}}}removeSlides(e,t){if(!this.carouselItems)return;const r=[...this.carouselItems];("start"==t?r.slice(0,e):r.slice(r.length-e)).forEach(e=>{e.remove()})}insertSlides(e,t){if(!this.carouselItems||!this.carouselElement)return;const r=[...Array(e).keys()],i=this.carouselItems[0];r.forEach(()=>{const e=document.createElement("wa-carousel-item"),r=document.createElement("div");r.className="slot";const s=document.createElement("img");s.loading="lazy",r.append(s),e.append(r),"start"==t?this.carouselElement.insertBefore(e,i):this.carouselElement.append(e)})}renderActiveItem(){if(!this.queue?.length)return this.renderEmptyQueue();const e=this.queue.find(e=>e.playing);if(!e)return this.renderEmptyQueue();const t=this.playerConfig.layout.artwork_size,r=this.activePlayer.attributes,i=r.entity_picture_local??r.entity_picture;return{_$litType$:nl,values:[e.queue_item_id,t,i]}}render(){const e=`${this.playerConfig.layout.artwork_size} ${this.Config.panel?" panel":""}`;return{_$litType$:al,values:[e,this.onPointerDown,this.renderActiveItem()]}}updated(){this.activeSlide&&this.queue&&!this._slidesInserted&&(this._slidesInserted=!0,this.pushQueueArtwork()),!this._observer&&this.carouselItems?.length&&this.carouselElement&&(this._observer=new MutationObserver(this._observerCB),this._observer.observe(this.carouselElement,{subtree:!0,childList:!0,attributes:!0})),!this._intervalSet&&this.carouselItems?.length&&this.carouselElement&&(this._intervalSet=!0,this._interval=window.setInterval(()=>{this._intervalGoToSlide()},this._intervalMs))}firstUpdated(){this.controller.ActivePlayer&&(this.controller.ActivePlayer.carouselElement=this.carouselElement)}disconnectedCallback(){if(super.disconnectedCallback(),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("touchend",this.onPointerUp),this._observer?.disconnect(),this._interval)try{clearInterval(this._interval)}finally{this._interval=void 0,this._intervalSet=!1}}static get styles(){return Sa}};var cl,Al,dl;e([a({context:li,subscribe:!0}),Pe()],ll.prototype,"playerConfig",void 0),e([a({context:mi,subscribe:!0})],ll.prototype,"controller",void 0),e([a({context:Ei,subscribe:!0})],ll.prototype,"Icons",void 0),e([a({context:ni,subscribe:!0})],ll.prototype,"Config",void 0),e([Pe()],ll.prototype,"_activePlayer",void 0),e([a({context:Zr,subscribe:!0}),Pe()],ll.prototype,"hass",void 0),e([Pe()],ll.prototype,"_queue",void 0),e([Se("#carousel")],ll.prototype,"carouselElement",void 0),e([Se("#active-slide")],ll.prototype,"activeSlide",void 0),e([Re("wa-carousel-item")],ll.prototype,"carouselItems",void 0),e([a({context:ti,subscribe:!0})],ll.prototype,"activePlayer",null),e([a({context:Ci,subscribe:!0})],ll.prototype,"queue",null),ll=e([Ce("mpc-player-artwork")],ll),function(e){e.COMPACT="compact",e.SPACED="spaced"}(cl||(cl={})),function(e){e.SMALL="small",e.MEDIUM="medium",e.LARGE="large"}(Al||(Al={})),function(e){e.SMALL="small",e.LARGE="large"}(dl||(dl={}));const ul={favorite_button:!1,mute_button:!1,player_selector:!1,power_button:!1,repeat_button:!1,shuffle_button:!1,volume:!1,group_selector:!1,player_name:!1,track_artist:!1,track_progress_bar:!1,track_progress_time:!1,track_title:!1,header_title:!1,header:!1},hl={shuffle:{size:dl.SMALL,box_shadow:!1,label:!0},previous:{size:dl.SMALL,box_shadow:!1,label:!1},play_pause:{size:dl.LARGE,box_shadow:!0,label:!1},next:{size:dl.SMALL,box_shadow:!1,label:!1},repeat:{size:dl.SMALL,box_shadow:!1,label:!0},power:{size:dl.SMALL,box_shadow:!1,label:!0},favorite:{size:dl.SMALL,box_shadow:!1,label:!0}},pl={controls_layout:cl.COMPACT,icons:hl,hide_labels:!1,artwork_size:Al.LARGE},gl={enabled:!0,hide:ul,layout:pl},ml=["favorite","mute","player_selector","power","repeat","shuffle","volume","group_selector"];function vl(e){return{name:e,type:"expandable",schema:[{name:"label",selector:{boolean:{}},default:!0,description:{suffix:`Show/hide the label for ${e}`}}]}}function fl(e){e=function(e){const t=e.layout,r=hl,i=t.icons;let s={...r,...i};return s={shuffle:{...r.shuffle,...s.shuffle},previous:{...r.previous,...s.previous},play_pause:{...r.play_pause,...s.play_pause},next:{...r.next,...s.next},repeat:{...r.repeat,...s.repeat},power:{...r.power,...s.power},favorite:{...r.favorite,...s.favorite}},{...e,layout:{...t,icons:s}}}(e);const t=e.layout;return{...e,layout:{...pl,...t}}}function yl(e){let t=e.player;return t=function(e){return{...gl,...e}}(t),t=function(e){const t=e.hide;return{...e,hide:{...ul,...t}}}(t),t=fl(t),{...e,player:t}}const bl=e=>e,wl={h:bl`<!--?-->`,parts:[]},El={h:bl`slot="start"`,parts:[]};function Cl(e){return e.size!=dl.LARGE&&e.label?{_$litType$:El,values:[]}:{_$litType$:wl,values:[]}}const Il={h:bl`<!--?-->`,parts:[]},Bl={h:bl`<?><!--?-->`,parts:[{type:2,index:0}]};function xl(e,t,r){return e.size==dl.LARGE||!e.label||r?{_$litType$:Il,values:[]}:{_$litType$:Bl,values:[t]}}function Pl(e,t){return e==tr.ALL?t.REPEAT:e==tr.ONCE?t.REPEAT_ONCE:t.REPEAT_OFF}class Dl extends me{constructor(){super(...arguments),this.playing=!1,this.repeat=tr.OFF,this.shuffle=!1,this.favorite=!1,this.onPrevious=async e=>{e.stopPropagation(),await this.actions.actionPlayPrevious(),this.requestPlayerDataUpdate()},this.onNext=async e=>{e.stopPropagation(),await this.actions.actionPlayNext(),this.requestPlayerDataUpdate()},this.onPlayPause=async e=>{e.stopPropagation(),this.playing=!this.playing,await this.actions.actionPlayPause()},this.onShuffle=async e=>{e.stopPropagation(),this.shuffle=!this.shuffle,this.requestUpdate("shuffle",this.shuffle),await this.actions.actionToggleShuffle()},this.onRepeat=async e=>{e.stopPropagation();const t=function(e){return e==tr.ALL?tr.ONCE:e==tr.ONCE?tr.OFF:tr.ALL}(this.repeat);this.repeat=t,this.requestUpdate("repeat",this.repeat),await this.actions.actionSetRepeat(t)},this.onPower=async e=>{e.stopPropagation(),await this.actions.actionTogglePower()},this.onFavorite=async e=>{e.stopPropagation(),this.favorite=!this.favorite,this.requestUpdate("favorite",this.favorite),this.playerData.favorite?await this.actions.actionRemoveFavorite():await this.actions.actionAddFavorite()}}set config(e){Yr(this._config,e)||(this._config=e,this.layoutConfig=e.layout)}get config(){return this._config}set playerData(e){this._playerData=e,this.playing=e.playing,this.repeat=e.repeat,this.shuffle=e.shuffle,this.favorite=e.favorite}get playerData(){return this._playerData}forceUpdatePlayerData(e,t){const r=new CustomEvent("force-update-player",{detail:{key:e,value:t}});this.controller.host.dispatchEvent(r)}requestPlayerDataUpdate(){const e=new Event("request-player-data-update");this.controller.host.dispatchEvent(e)}shouldUpdate(e){return e.size>0}}e([a({context:ti,subscribe:!0})],Dl.prototype,"activeEntity",void 0),e([a({context:li,subscribe:!0}),Pe()],Dl.prototype,"config",null),e([a({context:gi})],Dl.prototype,"actions",void 0),e([a({context:ki,subscribe:!0})],Dl.prototype,"hiddenElements",void 0),e([a({context:mi,subscribe:!0})],Dl.prototype,"controller",void 0),e([Pe()],Dl.prototype,"_playerData",void 0),e([a({context:Ei})],Dl.prototype,"Icons",void 0),e([Pe()],Dl.prototype,"playing",void 0),e([Pe()],Dl.prototype,"repeat",void 0),e([Pe()],Dl.prototype,"shuffle",void 0),e([Pe()],Dl.prototype,"favorite",void 0),e([a({context:ii,subscribe:!0})],Dl.prototype,"playerData",null);var Sl=p`
  .button-label {
    display: contents;
  }
  .shuffle .button-label {
    color: var(--player-button-shuffle-text-color);
  }
  .shuffle .svg {
    fill: var(--player-button-shuffle-icon-color);
  }

  .track-previous .button-label {
    color: var(--player-button-previous-text-color);
  }
  .track-previous .svg {
    fill: var(--player-button-previous-icon-color);
  }

  .play .button-label {
    color: var(--player-button-play-text-color);
  }
  .play .svg {
    fill: var(--player-button-play-icon-color);
  }

  .pause .button-label {
    color: var(--player-button-pause-text-color);
  }
  .pause .svg {
    fill: var(--player-button-pause-icon-color);
  }

  .track-next .button-label {
    color: var(--player-button-next-text-color);
  }
  .track-next .svg {
    fill: var(--player-button-next-icon-color);
  }

  .repeat .button-label {
    color: var(--player-button-repeat-text-color);
  }
  .repeat .svg {
    fill: var(--player-button-repeat-icon-color);
  }

  .controls-div {
    grid-area: controls;
    overflow-y: auto;
    margin: 0.25rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }
  .controls.left {
    display: flex;
    flex-direction: column;
    align-items: end;
    justify-content: center;
  }
  .controls.right {
    display: flex;
    align-items: start;
    justify-content: center;
  }

  .controls.compact {
    flex-direction: column;
  }
  .controls.spaced {
    flex-direction: row;
    gap: 1em;
    margin-left: 1em;
    margin-right: 1em;
  }
  .div.medium {
    --ha-button-height: var(--player-play-pause-icon-size);
    margin: 0px 6px 0px 6px;
    --ha-button-border-radius: 50%;
    border-radius: 50%;
  }

  .div.spaced {
    align-self: center;
  }

  .has-box-shadow::part(base) {
    box-shadow: rgba(0, 0, 0, 0.16) 0px 2px 4px 0px;
  }
  .icon.accent::part(base) {
    background-color: var(--md-sys-color-primary);
  }
  .icon.accent::part(label) {
    color: var(--md-sys-color-on-primary);
  }
  .player-controls {
    width: var(--player-control-icon-width);
    height: var(--player-control-icon-width);
  }

  .svg.medium {
    height: 4em;
    width: 4em;
  }
  .svg.small {
    height: 2em;
    width: 2em;
  }
`;const{AttributePart:kl,PropertyPart:Rl,EventPart:Ql}=Ti,Ml=e=>e,Hl={h:Ml`<!--?-->`,parts:[]},Ol={h:Ml`
      <div>
        <ha-button variant="brand">
          <ha-svg-icon></ha-svg-icon>
          <div class="button-label"><?></div>
        </ha-button>
      </div>
    `,parts:[{type:1,index:0,name:"class",strings:["shuffle div "," ",""],ctor:kl},{type:1,index:1,name:"appearance",strings:["",""],ctor:kl},{type:1,index:1,name:"click",strings:["",""],ctor:Ql},{type:1,index:1,name:"size",strings:["",""],ctor:kl},{type:1,index:1,name:"class",strings:["icon "," ","  ",""],ctor:kl},{type:6,index:2},{type:1,index:2,name:"path",strings:["",""],ctor:Rl},{type:1,index:2,name:"class",strings:["svg ",""],ctor:kl},{type:2,index:4}]},Tl={h:Ml`
      <div>
        <ha-button appearance="outlined" variant="brand">
          <ha-svg-icon></ha-svg-icon>
          <div class="button-label"><?></div>
        </ha-button>
      </div>
    `,parts:[{type:1,index:0,name:"class",strings:["track-previous div "," ",""],ctor:kl},{type:1,index:1,name:"click",strings:["",""],ctor:Ql},{type:1,index:1,name:"size",strings:["",""],ctor:kl},{type:1,index:1,name:"class",strings:["icon "," ",""],ctor:kl},{type:6,index:2},{type:1,index:2,name:"path",strings:["",""],ctor:Rl},{type:1,index:2,name:"class",strings:["svg "," icon-outlined"],ctor:kl},{type:2,index:4}]},Ll={h:Ml`
      <div>
        <ha-button variant="brand">
          <ha-svg-icon></ha-svg-icon>
          <div class="button-label"><?></div>
        </ha-button>
      </div>
    `,parts:[{type:1,index:0,name:"class",strings:["play-pause div "," ","\n        ",""],ctor:kl},{type:1,index:1,name:"appearance",strings:["",""],ctor:kl},{type:1,index:1,name:"size",strings:["",""],ctor:kl},{type:1,index:1,name:"class",strings:["mpc-button-play-pause icon "," "," ",""],ctor:kl},{type:1,index:1,name:"click",strings:["",""],ctor:Ql},{type:6,index:2},{type:1,index:2,name:"path",strings:["",""],ctor:Rl},{type:1,index:2,name:"class",strings:["svg "," icon-outlined"],ctor:kl},{type:2,index:4}]},ql={h:Ml`
      <div>
        <ha-button appearance="outlined" variant="brand" style="display: block;">
          <ha-svg-icon></ha-svg-icon>
          <div class="button-label"><?></div>
        </ha-button>
      </div>
    `,parts:[{type:1,index:0,name:"class",strings:["track-next div "," ",""],ctor:kl},{type:1,index:1,name:"click",strings:["",""],ctor:Ql},{type:1,index:1,name:"size",strings:["",""],ctor:kl},{type:1,index:1,name:"class",strings:["icon "," ",""],ctor:kl},{type:6,index:2},{type:1,index:2,name:"path",strings:["",""],ctor:Rl},{type:1,index:2,name:"class",strings:["svg ",""],ctor:kl},{type:2,index:4}]},Ul={h:Ml`<!--?-->`,parts:[]},Fl={h:Ml`
      <div>
        <ha-button variant="brand">
          <ha-svg-icon></ha-svg-icon>
          <div class="button-label"><?></div>
        </ha-button>
      </div>
    `,parts:[{type:1,index:0,name:"class",strings:["repeat div "," ",""],ctor:kl},{type:1,index:1,name:"appearance",strings:["",""],ctor:kl},{type:1,index:1,name:"size",strings:["",""],ctor:kl},{type:1,index:1,name:"class",strings:["icon "," "," ",""],ctor:kl},{type:1,index:1,name:"click",strings:["",""],ctor:Ql},{type:6,index:2},{type:1,index:2,name:"path",strings:["",""],ctor:Rl},{type:1,index:2,name:"class",strings:["svg ",""],ctor:kl},{type:2,index:4}]},Vl={h:Ml`
      <div>
        <?>
        <?>
      </div>
    `,parts:[{type:1,index:0,name:"class",strings:["controls left ",""],ctor:kl},{type:2,index:1},{type:2,index:2}]},zl={h:Ml`
      <div>
        <?> <?>
      </div>
    `,parts:[{type:1,index:0,name:"class",strings:["controls right ",""],ctor:kl},{type:2,index:1},{type:2,index:2}]},Jl={h:Ml`
      <div class="controls-div">
        <?> <?>
        <?>
      </div>
    `,parts:[{type:2,index:1},{type:2,index:2},{type:2,index:3}]};let Yl=class extends Dl{renderShuffle(){if(this.hiddenElements.shuffle_button)return{_$litType$:Hl,values:[]};const e=this.layoutConfig.icons.shuffle,t=e.size==dl.LARGE?"m":"s",r=Cl(e),i=xl(e,this.controller.translate("player.controls.shuffle"),this.layoutConfig.hide_labels),s=this.layoutConfig.controls_layout,o=this._playerData.shuffle?"accent":"plain";return{_$litType$:Ol,values:[t,s,o,this.onShuffle,t,t,e.box_shadow?"has-box-shadow":"",o,r,this._playerData.shuffle?this.Icons.SHUFFLE:this.Icons.SHUFFLE_DISABLED,t,i]}}renderPrevious(){const e=this.layoutConfig.icons.previous,t=e.size==dl.LARGE?"m":"s",r=this.layoutConfig.controls_layout,i=Cl(e),s=xl(e,this.controller.translate("player.controls.previous"),this.layoutConfig.hide_labels);return{_$litType$:Tl,values:[t,r,this.onPrevious,t,t,e.box_shadow?"has-box-shadow":"",i,this.Icons.SKIP_PREVIOUS,t,s]}}renderPlayPause(){const e=this.layoutConfig.icons.play_pause,t=e.size==dl.LARGE?"m":"s",r=this.layoutConfig.controls_layout,i=Cl(e),s=this._playerData.playing?"player.controls.play":"player.controls.pause",o=xl(e,this.controller.translate(s),this.layoutConfig.hide_labels),n=this._playerData.playing?"filled":"outlined";return{_$litType$:Ll,values:[t,r,this._playerData.playing?"playing":"paused",n,t,t,e.box_shadow?"has-box-shadow":"",n,this.onPlayPause,i,this._playerData.playing?this.Icons.PAUSE:this.Icons.PLAY,t,o]}}renderNext(){const e=this.layoutConfig.icons.next,t=e.size==dl.LARGE?"m":"s",r=this.layoutConfig.controls_layout,i=Cl(e),s=xl(e,this.controller.translate("player.controls.next"),this.layoutConfig.hide_labels);return{_$litType$:ql,values:[t,r,this.onNext,t,t,e.box_shadow?"has-box-shadow":"",i,this.Icons.SKIP_NEXT,t,s]}}renderRepeat(){if(this.hiddenElements.repeat_button)return{_$litType$:Ul,values:[]};const e=Pl(this._playerData.repeat,this.Icons),t=this.layoutConfig.controls_layout,r=this.layoutConfig.icons.repeat,i=r.size==dl.LARGE?"m":"s",s=Cl(r),o=xl(r,this.controller.translate("player.controls.repeat"),this.layoutConfig.hide_labels),n=this._playerData.repeat==tr.OFF?"accent":"plain";return{_$litType$:Fl,values:[i,t,n,i,i,r.box_shadow?"has-box-shadow":"",n,this.onRepeat,s,e,i,o]}}renderControlsLeft(){const e=this.layoutConfig,t=this.renderPrevious(),r=this.renderShuffle();return{_$litType$:Vl,values:[e.controls_layout,e.controls_layout==cl.COMPACT?t:r,e.controls_layout==cl.COMPACT?r:t]}}renderControlsRight(){const e=this.layoutConfig;return{_$litType$:zl,values:[e.controls_layout,this.renderNext(),this.renderRepeat()]}}render(){return{_$litType$:Jl,values:[this.renderControlsLeft(),this.renderPlayPause(),this.renderControlsRight()]}}static get styles(){return Sl}};Yl=e([Ce("mpc-player-controls")],Yl);var Nl=p`
  :host {
    --lower-button-border-radius: 8px;
    --lower-button-start-border-radius: 24px 8px 8px 24px;
    --lower-button-end-border-radius: 8px 24px 24px 8px;
    --lower-button-only-border-radius: 24px 24px 24px 24px;

    --lower-controls-first-button-start-border-radius: 24px;
    --lower-controls-first-button-end-border-radius: 8px;
    --lower-controls-last-button-start-border-radius: 8px;
    --lower-controls-last-button-end-border-radius: 24px;
    --lower-controls-only-button-start-border-radius: 24px;
    --lower-controls-only-button-end-border-radius: 24px;
    --lower-controls-button-start-border-radius: 8px;
    --lower-controls-button-end-border-radius: 8px;

    --next-prev-button-height: var(--play-pause-icon-height);
    --next-prev-button-width: 48px;
    --next-prev-icon-height: 48px;
    --next-border-radius: 36px 18px 18px 36px !important;
    --next-start-border-radius: 18px;
    --next-end-border-radius: 36px;
    --prev-start-border-radius: 36px;
    --prev-end-border-radius: 18px;
    --prev-border-radius: 18px 36px 36px 18px !important;

    --play-pause-icon-height: 64px;
    --pause-button-width: 96px;
    --play-button-width: 110px;
    --play-pause-border-radius: 18px !important;
  }

  .mpc-button.lower {
    --ha-button-start-border-radius: var(
      --lower-controls-button-start-border-radius
    );
    --ha-button-end-border-radius: var(
      --lower-controls-button-end-border-radius
    );
    --used-button-border-radius: var(--lower-button-border-radius);
  }
  .mpc-button.lower::part(button) {
    --button-padding-left: 8px;
    --button-padding-right: 12px;
    border-radius: var(--button-border-radius);
  }
  .mpc-button.lower:hover {
    --button-border-radius: 40px !important;
  }

  .mpc-button.lower:first-of-type {
    --ha-button-start-border-radius: var(
      --lower-controls-first-button-start-border-radius
    );
    --ha-button-end-border-radius: var(
      --lower-controls-first-button-end-border-radius
    );
    --used-button-border-radius: var(--lower-button-start-border-radius);
  }
  .mpc-button.lower:last-of-type {
    --ha-button-start-border-radius: var(
      --lower-controls-last-button-start-border-radius
    );
    --ha-button-end-border-radius: var(
      --lower-controls-last-button-end-border-radius
    );
    --used-button-border-radius: var(--lower-button-end-border-radius);
  }
  .mpc-button.lower:only-of-type {
    --ha-button-start-border-radius: var(
      --lower-controls-only-button-start-border-radius
    );
    --ha-button-end-border-radius: var(
      --lower-controls-only-button-end-border-radius
    );
    --used-button-border-radius: var(
      --lower-button-only-border-radius
    ) !important;
  }

  .mpc-button.lower.active {
    --button-border-radius: 20px;
  }

  .mpc-button.next,
  .mpc-button.previous::part(button) {
    --button-button-height: var(--next-prev-button-height);
    --button-button-width: var(--next-prev-button-width);
    --button-elevation: var(--md-sys-elevation-level1);
    --button-padding: 0px;
  }

  .button-label {
    display: contents;
  }

  #button-next {
    --ha-button-start-border-radius: var(--next-start-border-radius);
    --ha-button-end-border-radius: var(--next-end-border-radius);
    --used-button-border-radius: var(--prev-border-radius);
  }
  #button-previous {
    --ha-button-start-border-radius: var(--prev-start-border-radius);
    --ha-button-end-border-radius: var(--prev-end-border-radius);
    --used-button-border-radius: var(--next-border-radius);
  }
  .mpc-button.play-pause {
    --button-button-height: var(--play-pause-icon-height);
    --button-border-radius: var(--play-pause-border-radius);
    --button-padding: 0px;
    --button-elevation: var(--md-sys-elevation-level2);
  }
  #button-play {
    --button-button-width: var(--play-button-width);
  }
  #button-pause {
    --button-button-width: var(--pause-button-width);
  }

  #div-controls {
    container-name: controls;
    container-type: inline-size;
    row-gap: 6px;
    display: grid;
    margin-top: 12px;
    margin-bottom: 6px;
  }

  .icons.favorite.lower.active {
    color: var(--md-sys-color-tertiary);
  }

  .icons.lower,
  .icons.lower.active {
    height: var(--icon-height);
    width: var(--icon-height);
  }

  .icons.next,
  .icons.previous {
    height: var(--next-prev-icon-height);
    width: var(--next-prev-icon-height);
  }
  .icons.play-pause {
    height: var(--play-pause-icon-height);
    width: var(--play-pause-icon-height);
  }

  #button-next .icons {
    fill: var(--player-button-next-icon-color);
  }
  #button-previous .icons {
    fill: var(--player-button-previous-icon-color);
  }
  #button-pause .icons {
    fill: var(--player-button-pause-icon-color);
  }
  #button-play .icons {
    fill: var(--player-button-play-icon-color);
  }

  #button-shuffle .icons {
    fill: var(--player-button-shuffle-icon-color);
  }
  #button-shuffle .button-label {
    color: var(--player-button-shuffle-text-color);
  }

  #button-repeat .icons {
    fill: var(--player-button-repeat-icon-color);
  }
  #button-repeat .button-label {
    color: var(--player-button-repeat-text-color);
  }

  #button-favorite .icons {
    fill: var(--player-button-favorite-icon-color);
  }
  #button-favorite .button-label {
    color: var(--player-button-favorite-text-color);
  }

  #button-power .icons {
    fill: var(--player-button-power-icon-color);
  }
  #button-power .button-label {
    color: var(--player-button-power-text-color);
  }

  .no-label::part(button) {
    --button-padding-left: 12px;
    --button-padding-right: 12px;
  }
  .player-controls {
    justify-items: center;
  }
  #player-controls-lower {
    place-self: center;
    padding: 6px;
    border-radius: 24px;
    background-color: rgba(
      from var(--ha-card-background) r g b / 0.4
    ) !important;
  }
  #player-controls-upper {
    place-self: center;
    column-gap: 4px;
    margin-top: unset;
    row-gap: unset;
  }
  @container controls (width <= 30em) {
    #player-controls-lower {
      --md-sys-typescale-label-large-size: 10px;
      --icon-height: 16px;
    }
    .mpc-button.lower::part(label) {
      --md-sys-typescale-label-large-size: 10px;
      --icon-height: 16px;
    }
  }
  @container controls (width > 30em) {
    #player-controls-lower {
      --md-sys-typescale-label-large-size: 14px;
      --icon-height: 24px;
    }
    .mpc-button-lower::part(label) {
      --md-sys-typescale-label-large-size: 14px;
      --icon-height: 24px;
    }
  }
`,Xl=p`
  :host {
    --button-default-height-small: 32px;
    --button-default-border-radius-small: 40%;

    --button-default-height-medium: 40px;
    --button-default-border-radius-medium: 40%;

    --button-default-height-large: 64px;
    --button-default-border-radius-large: 40%;

    --animation-duration: 0.25s;
    --used-button-height: var(--button-button-height);
    --used-button-width: var(--button-button-width);
    --ha-space-1: 0px;
    --used-button-border-radius: var(--button-border-radius, 50%);
  }
  ha-button:not(.expressive)::part(base) {
    --inherited-background-color: var(
      --used-button-background-color,
      var(--button-background-color)
    );
    background-color: var(
      --used-button-background-color,
      var(--button-background-color)
    );
    --inherited-text-color: var(
      --used-button-text-color,
      var(--button-text-color)
    );
    color: var(--used-button-text-color, var(--button-text-color));
    --ha-button-border-radius: var(--used-button-border-radius);
  }
  ha-button {
    border-radius: var(--used-button-border-radius) !important;
    transition: border-radius var(--animation-duration);
  }
  ha-button::part(base) {
    transition: border-radius var(--animation-duration);
    border-radius: var(--used-button-border-radius) !important;
    height: var(--used-button-height, 100%);
    width: var(--used-button-width, 100%);
    padding: unset;
    background-color: var(
      --used-button-background-color,
      var(--button-background-color)
    );
    --inherited-background-color: var(
      --used-button-background-color,
      var(--button-background-color)
    );
    color: var(--used-button-text-color, var(--button-text-color));
    --inherited-text-color: var(
      --used-button-text-color,
      var(--button-text-color)
    );
    --used-button-height: var(--button-button-height);
    --used-button-width: var(--button-button-width);
    --wa-form-control-border-radius: var(--used-button-border-radius);
    --ha-button-border-radius: var(--used-button-border-radius);
    --md-sys-shape-corner-small: var(--used-button-border-radius);
    --state-layer-color: rgba(0, 0, 0, 0);
  }

  .small::part(base) {
    min-height: var(--used-button-height, var(--button-default-height-small));
    min-width: var(--used-button-width, var(--button-default-height-small));
    --ha-button-border-radius: var(
      --used-button-border-radius,
      var(--button-default-border-radius-small)
    );
    padding-left: var(--button-padding-left, var(--button-padding, 0px));
    padding-right: var(--button-padding-right, var(--button-padding, 0px));
  }

  .medium::part(base) {
    min-height: var(--used-button-height, var(--button-default-height-medium));
    min-width: var(--used-button-height, var(--button-default-height-medium));
    --ha-button-border-radius: var(
      --used-button-border-radius,
      var(--button-default-border-radius-medium)
    );
    padding-left: var(--button-padding-left, var(--button-padding, 16px));
    padding-right: var(--button-padding-right, var(--button-padding, 16px));
  }

  .large::part(base) {
    min-height: var(--used-button-height, var(--button-default-height-large));
    min-width: var(--used-button-height, var(--button-default-height-large));
    --ha-button-border-radius: var(
      --used-button-border-radius,
      var(--button-default-border-radius-large)
    );
    padding-left: var(--button-padding-left, var(--button-padding, 24px));
    padding-right: var(--button-padding-right, var(--button-padding, 24px));
    --wa-form-control-border-radius: var(--used-button-border-radius);
  }

  .filled {
    --button-outline-color: var(
      --md-sys-color-outline-variant,
      var(--outline-color)
    );
    --button-background-color: var(--md-sys-color-secondary-container);
  }
  .filled.expressive {
    --button-background-color: var(--md-sys-color-primary);
    --button-text-color: var(--md-sys-color-on-primary);

    --button-selected-background-color: var(--md-sys-color-primary);
    --button-selected-text-color: var(--md-sys-color-on-primary);

    --button-unselected-background-color: var(--md-sys-color-surface-container);
    --button-unselected-text-color: var(--md-sys-color-on-surface-variant);

    --button-disabled-background-color: var(--md-sys-color-on-surface);
    --button-disabled-text-color: var(--md-sys-color-on-surface);
  }

  .filled-variant {
    --button-outline-color: var(--md-sys-color-outline, var(--outline-color));
  }
  .filled-variant.expressive {
    --button-background-color: var(--md-sys-color-surface-variant);
    --button-text-color: var(--md-sys-color-on-surface-variant);

    --button-selected-background-color: var(--md-sys-color-primary);
    --button-selected-text-color: var(--md-sys-color-on-primary);

    --button-unselected-background-color: var(--md-sys-color-surface-container);
    --button-unselected-text-color: var(--md-sys-color-on-surface-variant);

    --button-disabled-background-color: var(--md-sys-color-on-surface-variant);
    --button-disabled-text-color: var(--md-sys-color-on-surface-variant);
  }

  .standard {
    --button-outline-color: var(
      --md-sys-color-outline-variant,
      var(--outline-color)
    );
    --button-background-color: var(--md-sys-color-secondary-container);
  }
  .standard.expressive {
    --button-background-color: var(--md-sys-color-primary);
    --button-text-color: var(--md-sys-color-on-primary);

    --button-selected-background-color: var(--md-sys-color-primary);
    --button-selected-text-color: var(--md-sys-color-on-primary);

    --button-unselected-background-color: var(--md-sys-color-surface-container);
    --button-unselected-text-color: var(--md-sys-color-on-surface-variant);

    --button-disabled-background-color: var(--md-sys-color-on-surface);
    --button-disabled-text-color: var(--md-sys-color-on-surface);
  }

  .tonal {
    --button-outline-color: var(--md-sys-color-outline, var(--outline-color));
    --button-background-color: var(--md-sys-color-secondary-container);
  }
  .tonal.expressive {
    --button-background-color: var(--md-sys-color-secondary-container);
    --button-text-color: var(--md-sys-color-on-secondary-container);

    --button-selected-background-color: var(--md-sys-color-secondary);
    --button-selected-text-color: var(--md-sys-color-on-secondary);

    --button-unselected-background-color: var(
      --md-sys-color-secondary-container
    );
    --button-unselected-text-color: var(--md-sys-color-on-secondary-container);

    --button-disabled-background-color: var(--md-sys-color-on-surface);
    --button-disabled-text-color: var(--md-sys-color-on-surface);
  }

  .variant {
    --button-outline-color: var(
      --md-sys-color-outline-variant,
      var(--outline-color)
    );
    --button-background-color: var(--md-sys-color-secondary-container);
  }
  .variant.expressive {
    --button-background-color: var(--md-sys-color-tertiary-container);
    --button-text-color: var(--md-sys-color-on-tertiary-container);

    --button-selected-background-color: var(--md-sys-color-tertiary-fixed-dim);
    --button-selected-text-color: var(--md-sys-color-on-tertiary-fixed-variant);

    --button-unselected-background-color: var(
      --md-sys-color-tertiary-container
    );
    --button-unselected-text-color: var(--md-sys-color-on-tertiary-container);

    --button-disabled-background-color: var(--md-sys-color-on-surface-variant);
    --button-disabled-text-color: var(--md-sys-color-on-surface-variant);
  }

  .plain.expressive {
    --button-background-color: transparent;
    --button-text-color: var(--md-sys-color-on-tertiary-container);

    --button-selected-background-color: transparent;
    --button-selected-text-color: var(--md-sys-color-on-tertiary-fixed-variant);

    --button-unselected-background-color: transparent;
    --button-unselected-text-color: var(--md-sys-color-on-tertiary-container);

    --button-disabled-background-color: transparent;
    --button-disabled-text-color: var(--md-sys-color-on-surface-variant);
  }

  .elevation-0 {
    --button-elevation: none;
    --hover-button-elevation: var(--md-sys-elevation-level0);
  }

  .elevation-1 {
    --button-elevation: var(--md-sys-elevation-level1);
    --hover-button-elevation: var(--md-sys-elevation-level2);
  }

  .elevation-2 {
    --button-elevation: var(--md-sys-elevation-level2);
    --hover-button-elevation: var(--md-sys-elevation-level3);
  }

  .elevation-3 {
    --button-elevation: var(--md-sys-elevation-level3);
    --hover-button-elevation: var(--md-sys-elevation-level4);
  }
  .elevation-4 {
    --button-elevation: var(--md-sys-elevation-level4);
    --hover-button-elevation: var(--md-sys-elevation-level5);
  }

  .elevation-5 {
    --button-elevation: var(--md-sys-elevation-level5);
    --hover-button-elevation: var(--md-sys-elevation-level5);
  }

  .elevation-0:not(:hover),
  .elevation-1:not(:hover),
  .elevation-2:not(:hover),
  .elevation-3:not(:hover),
  .elevation-4:not(:hover),
  .elevation-5 {
    transition: box-shadow var(--animation-duration) !important;
    box-shadow: var(--button-elevation);
  }
  .elevation-0:hover,
  .elevation-1:hover,
  .elevation-2:hover,
  .elevation-3:hover,
  .elevation-4:hover,
  .elevation-5:hover {
    transition: box-shadow var(--animation-duration) !important;
    box-shadow: var(--hover-button-elevation);
  }

  .outlined::part(base) {
    border: var(--button-outline-color) 1px solid;
  }

  .disabled {
    --used-button-background-color: var(--button-disabled-background-color);
    --used-button-text-color: var(--button-disabled-text-color);
  }
  .selected {
    --used-button-background-color: var(--button-selected-background-color);
    --used-button-text-color: var(--button-selected-text-color);
  }
  .unselected {
    --used-button-background-color: var(--button-unselected-background-color);
    --used-button-text-color: var(--button-unselected-text-color);
  }
`;const jl=_t.Filled,Kl={filled:"accent","filled-variant":"filled",plain:"plain",standard:"plain",tonal:"filled",variant:"accent"},{AttributePart:Gl,EventPart:Wl}=Ti,Zl={h:(e=>e)`
      <ha-button part="button">
        <slot name="start" slot="start"></slot>
        <slot name="end" slot="end"></slot>
        <slot></slot>
      </ha-button>
    `,parts:[{type:1,index:0,name:"appearance",strings:["",""],ctor:Gl},{type:1,index:0,name:"pointerdown",strings:["",""],ctor:Wl},{type:1,index:0,name:"pointerup",strings:["",""],ctor:Wl},{type:1,index:0,name:"class",strings:[""," "," "," "," "," "," ",""],ctor:Gl}]};let _l=class extends me{constructor(){super(...arguments),this.colorRole=jl,this.size="small",this.disabled=!1,this.selected=!1,this.selectable=!1,this.elevation=1,this.outlined=!1,this.holdDelayMs=1e3,this.onHold=e=>{const t=this.onHoldService??this.onPressService;t&&t(e)},this.onPointerUp=e=>{!this.timeout&&this.onHoldService||!this.onPressService||(clearTimeout(this.timeout),this.onPressService(e),this.timeout=void 0)},this.onPointerDown=e=>{this.onHoldService&&(this.timeout=window.setTimeout(()=>{this.timeout&&(this.timeout=void 0,this.onHold(e))},this.holdDelayMs))}}render(){const e=this.config.expressive?"expressive":"",t=`elevation-${this.elevation.toString()}`,r=this.disabled?"disabled":"",i=this.outlined?"outlined":"",s=!this.selected&&this.selectable?"unselected":this.selected?"selected":"";return{_$litType$:Zl,values:[Kl[this.colorRole],this.onPointerDown,this.onPointerUp,this.colorRole,this.size,e,t,r,i,s]}}static get styles(){return Xl}};e([xe({attribute:!1})],_l.prototype,"onPressService",void 0),e([xe({attribute:"role",type:String})],_l.prototype,"colorRole",void 0),e([xe({attribute:"size",type:String})],_l.prototype,"size",void 0),e([xe({attribute:"disabled",type:Boolean})],_l.prototype,"disabled",void 0),e([xe({attribute:"selected",type:Boolean})],_l.prototype,"selected",void 0),e([xe({attribute:"selectable",type:Boolean})],_l.prototype,"selectable",void 0),e([xe({attribute:"elevation",type:Number,default:1,reflect:!0})],_l.prototype,"elevation",void 0),e([xe({attribute:"outlined",type:Boolean})],_l.prototype,"outlined",void 0),e([xe({attribute:!1})],_l.prototype,"onHoldService",void 0),e([xe({attribute:"hold-delay",type:Number})],_l.prototype,"holdDelayMs",void 0),e([a({context:ni,subscribe:!0})],_l.prototype,"config",void 0),_l=e([Ce("mpc-button")],_l);let $l=class extends Dl{constructor(){super(...arguments),this.onFavoriteHold=()=>{navigator.vibrate&&navigator.vibrate(Pr.Player.ACTION_FAVORITE_HOLD);const e=new Event("open-add-to-playlist-dialog");this.controller.host.dispatchEvent(e)}}renderPrevious(){return Ee`
      <mpc-button
        .onPressService=${this.onPrevious}
        role="filled-variant"
        size="large"
        id="button-previous"
        class="mpc-button previous"
      >
        <ha-svg-icon
          .path=${this.Icons.SKIP_PREVIOUS}
          class="icons previous"
          id="icon-previous"
        ></ha-svg-icon>
      </mpc-button>
    `}renderPlayPause(){const e=this.playing;return Ee`
      <mpc-button
        .onPressService=${this.onPlayPause}
        role="filled-variant"
        size="large"
        elevation="1"
        selectable
        ?selected=${e}
        id="${e?"button-play":"button-pause"}"
        class="mpc-button play-pause"
      >
        <ha-svg-icon
          .path=${e?this.Icons.PAUSE:this.Icons.PLAY}
          id="${e?"icon-play":"icon-pause"}"
          class="icons play-pause"
        ></ha-svg-icon>
      </mpc-button>
    `}renderNext(){return Ee`
      <mpc-button
        .onPressService=${this.onNext}
        role="filled-variant"
        size="large"
        id="button-next"
        class="mpc-button next"
      >
        <ha-svg-icon
          .path=${this.Icons.SKIP_NEXT}
          class="icons next"
          id="icon-previous"
        ></ha-svg-icon>
      </mpc-button>
    `}renderPower(){const e=this.activeEntity.attributes.supported_features,t=Wr(e,or.TURN_ON)&&Wr(e,or.TURN_OFF);if(this.hiddenElements.power_button||!t)return Ee``;const r=this.renderLabel("player.controls.power",this.layoutConfig.icons.power),i=this.renderLowerIcon(this.Icons.POWER,"icons power lower"),s=r?.length?"":"no-label";return Ee`
      <mpc-button
        .onPressService=${this.onPower}
        role="variant"
        size="medium"
        id="button-power"
        class="mpc-button lower ${s}"
        elevation="1"
      >
        ${i} ${r}
      </mpc-button>
    `}renderShuffle(){if(this.hiddenElements.shuffle_button)return Ee``;const e=this.shuffle,t=this.renderLabel("player.controls.shuffle",this.layoutConfig.icons.power),r=e?this.Icons.SHUFFLE:this.Icons.SHUFFLE_DISABLED,i=t?.length?"":"no-label",s=e?"active":"",o=this.renderLowerIcon(r,`icons shuffle lower ${s}`,t);return Ee`
      <mpc-button
        .onPressService=${this.onShuffle}
        role="variant"
        size="medium"
        selectable
        ?selected=${e}
        elevation=${e?2:1}
        id="button-shuffle"
        class="mpc-button lower ${s} ${i}"
      >
        ${o} ${t}
      </mpc-button>
    `}renderRepeat(){if(this.hiddenElements.repeat_button)return Ee``;const e=this.repeat,t=e!=tr.OFF,r=this.renderLabel("player.controls.repeat",this.layoutConfig.icons.power),i=Pl(e,this.Icons),s=r?.length?"":"no-label",o=t?"active":"",n=this.renderLowerIcon(i,`icons repeat lower ${o}`,r);return Ee`
      <mpc-button
        .onPressService=${this.onRepeat}
        role="variant"
        size="medium"
        selectable
        ?selected=${t}
        elevation=${t?2:1}
        id="button-repeat"
        class="mpc-button lower ${o} ${s}"
      >
        ${n} ${r}
      </mpc-button>
    `}renderFavorite(){if(this.hiddenElements.favorite_button)return Ee``;const e=this.favorite,t=this.renderLabel("player.controls.favorite",this.layoutConfig.icons.favorite),r=t?.length?"":"no-label",i=e?"active":"",s=e?this.Icons.HEART_ALT:this.Icons.HEART_PLUS,o=this.renderLowerIcon(s,`icons favorite lower ${i}`,t);return Ee`
      <mpc-button
        .onPressService=${this.onFavorite}
        .onHoldService=${this.onFavoriteHold}
        role="variant"
        size="medium"
        selectable
        ?selected=${e}
        elevation=${e?2:1}
        id="button-favorite"
        class="mpc-button lower ${i} ${r}"
      >
        ${o} ${t}
      </mpc-button>
    `}renderUpperControls(){return Ee`
      <div id="player-controls-upper" class="player-controls">
        ${this.renderPrevious()} ${this.renderPlayPause()} ${this.renderNext()}
      </div>
    `}renderLowerControls(){const e=this.hiddenElements;return e.power_button&&e.shuffle_button&&e.repeat_button&&e.favorite_button?Ee``:Ee`
      <div
        id="player-controls-lower"
        class="player-controls"
      >
          ${this.renderPower()}
          ${this.renderShuffle()}
          ${this.renderRepeat()}
          ${this.renderFavorite()}
        </nav>
      </div>
    `}render(){return Ee`
      <link
        href="https://cdn.jsdelivr.net/npm/beercss@4.0.20/dist/cdn/beer.min.css"
        rel="stylesheet"
      />
      <div id="div-controls">
        ${this.renderUpperControls()} ${this.renderLowerControls()}
      </div>
    `}shouldUpdate(e){return super.shouldUpdate(e)}static get styles(){return Nl}renderLowerIcon(e,t,r=null){const i=r?.length?be`slot="start"`:"";return Ee`
      <ha-svg-icon
        ${i}
        .path=${e}
        class="${t}"
      ></ha-svg-icon>
    `}renderLabel(e,t){const r=this.layoutConfig.hide_labels,i=!t.label;return r||i?"":Ee`
      <div class="button-label">${this.controller.translate(e)}</div>
    `}};$l=e([Ce("mpc-player-controls-expressive")],$l);var ec=p`
  #players-select-menu::part(menu-list-item) {
    height: 3.5em;
  }
  #players-select-menu::part(menu-list-item-svg) {
    height: 2em;
    width: 2em;
  }
  .menu-header {
    --menu-button-border-radius: 50%;
  }
  .menu-header::part(menu-select-menu) {
    height: 2.5em;
    width: 2.5em;
    --control-select-menu-padding: 7px;
    --mdc-icon-size: 1.5em;
    --control-select-menu-height: 2.5em;
  }
  .menu-header.expressive::part(menu-select-menu) {
    --control-select-menu-background-color: var(
      --md-sys-color-surface-container-low
    ) !important;
    background-color: var(--control-select-menu-background-color);
  }
  .menu-header.expressive::part(menu-svg) {
    color: var(--md-sys-color-on-primary);
  }
  .menu-header:not(.expressive)::part(menu-select-menu) {
    background-color: var(--control-select-menu-background-color);
  }
  .menu-header::part(menu-svg):not(.expressive) {
    color: var(--wa-color-brand-on-normal, var(--wa-color-neutral-on-normal));
    border-radius: 50%;
  }
`;const{AttributePart:tc,PropertyPart:rc,EventPart:ic}=Ti,sc=e=>e,oc={h:sc`<!--?-->`,parts:[]},nc={h:sc`
      <mpc-menu-button id="players-select-menu" dividers="" use-md="" fixedmenuposition="" naturalmenuwidth="" elevation="1"></mpc-menu-button>
    `,parts:[{type:1,index:0,name:"class",strings:["menu-header ",""],ctor:tc},{type:1,index:0,name:"iconPath",strings:["",""],ctor:rc},{type:1,index:0,name:"initialSelection",strings:["",""],ctor:rc},{type:1,index:0,name:"items",strings:["",""],ctor:rc},{type:1,index:0,name:"menu-item-selected",strings:["",""],ctor:ic}]};let ac=class extends me{constructor(){super(...arguments),this.onSelect=e=>{e.stopPropagation();const t={detail:e.detail},r=new CustomEvent("menu-item-selected",t);this.dispatchEvent(r)}}renderPlayerItems(){const e=this.playerEntities.map(e=>{const t=this.hass.states[e.entity_id];if(!t)return;const r=e.name.length>0?e.name:t.attributes.friendly_name??`Missing- ${e.entity_id}`;let i,s;"music_assistant"!=t.attributes.app_id?(i="",s=""):(i=t.attributes.entity_picture_local??t.attributes.entity_picture??"",s=t.attributes.entity_picture??"");const o=Gr(this.hass,t.entity_id)?{}:{disabled:!0};return{option:e.entity_id,icon:this.Icons.SPEAKER,title:r,image:{url:i,fallback:s},...o}});return e.filter(Boolean)}render(){const e=this.config.hide.player_selector,t=this.activeEntityConfig.hide.player.player_selector;return e||t?{_$litType$:oc,values:[]}:{_$litType$:nc,values:[this.useExpressive?"expressive":"",this.Icons.SPEAKER,this.activeEntityConfig.entity_id,this.renderPlayerItems(),this.onSelect]}}static get styles(){return ec}};e([a({context:li,subscribe:!0})],ac.prototype,"config",void 0),e([a({context:_r,subscribe:!0})],ac.prototype,"activeEntityConfig",void 0),e([a({context:bi,subscribe:!0})],ac.prototype,"useExpressive",void 0),e([a({context:Ei,subscribe:!0})],ac.prototype,"Icons",void 0),e([a({context:ai,subscribe:!0})],ac.prototype,"playerEntities",void 0),e([a({context:Zr,subscribe:!0})],ac.prototype,"hass",void 0),ac=e([Ce("mpc-player-selector")],ac);var lc=p`
  .button.min {
    height: 40px;
    width: 40px;
    --wa-color-fill-quiet: rgba(from var(--md-sys-color-primary) r g b / 0.1);
  }
  .button.min::part(base) {
    --wa-form-control-padding-inline: 0px;
  }

  #button-favorite {
    margin-left: 1em;
  }
  #button-favorite .svg {
    fill: var(--player-button-favorite-icon-color);
  }
  #button-mute {
    margin-left: 1em;
  }
  #button-mute .svg {
    fill: var(--player-button-mute-icon-color);
  }
  #button-power {
    margin-right: 1em;
  }
  #button-power .svg {
    fill: var(--player-button-power-icon-color);
  }

  #div-slider {
    width: 100%;
    height: var(--player-volume-slider-height);
    position: relative;
    border-radius: 24px;
    overflow: hidden;
  }

  .svg.plain {
    color: var(--md-sys-color-primary);
    height: 3em;
    width: 3em;
  }

  #ticks {
    height: var(--player-volume-slider-height);
    width: inherit;
    position: absolute;
    display: flex;
    justify-content: space-evenly;
    top: 0;
    align-items: center;
    pointer-events: none;
  }
  .tick {
    width: 1%;
    aspect-ratio: 1;
    display: inline-flex;
    flex-direction: row;
    vertical-align: bottom;
    position: relative;
    height: max-content;
    border-radius: 50%;
  }
  .tick.in {
    background-color: var(--md-sys-color-on-primary);
  }
  .tick.out {
    background-color: var(--md-sys-color-on-primary-container);
  }

  #volume {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    padding-left: 2em;
    padding-right: 2em;
  }

  #volume-slider {
    --control-slider-thickness: 2.25em;
    border-radius: 10px;
    --disabled-color: var(--control-slider-color);
    height: var(--player-volume-slider-height);
  }
  .volume-slider.expressive {
    --control-slider-color: var(--md-sys-color-primary);
    --disabled-color: var(--md-sys-color-secondary-container);
    box-shadow: var(--md-sys-elevation-level1);
  }
`;const{AttributePart:cc,PropertyPart:Ac,EventPart:dc}=Ti,uc=e=>e,hc={h:uc`<!--?-->`,parts:[]},pc={h:uc`
      <ha-button appearance="plain" variant="brand" size="m" id="button-power" class="button min" part="button-power">
        <ha-svg-icon class="svg plain"></ha-svg-icon>
      </ha-button>
    `,parts:[{type:1,index:0,name:"click",strings:["",""],ctor:dc},{type:1,index:1,name:"path",strings:["",""],ctor:Ac}]},gc={h:uc`<!--?-->`,parts:[]},mc={h:uc`
      <ha-button appearance="plain" variant="brand" size="m" id="button-mute" class="button min" part="button-mute">
        <ha-svg-icon class="svg plain"></ha-svg-icon>
      </ha-button>
    `,parts:[{type:1,index:0,name:"click",strings:["",""],ctor:dc},{type:1,index:1,name:"path",strings:["",""],ctor:Ac}]},vc={h:uc`<!--?-->`,parts:[]},fc={h:uc`
      <ha-button appearance="plain" variant="brand" size="m" id="button-favorite" class="button min" part="button-favorite">
        <ha-svg-icon class="svg plain"></ha-svg-icon>
      </ha-button>
    `,parts:[{type:1,index:0,name:"click",strings:["",""],ctor:dc},{type:1,index:1,name:"path",strings:["",""],ctor:Ac}]},yc={h:uc`<!--?-->`,parts:[]},bc={h:uc`
      <div id="ticks">
        <?>
      </div>
    `,parts:[{type:2,index:1}]},wc={h:uc`
            <div></div>
          `,parts:[{type:1,index:0,name:"class",strings:["tick ",""],ctor:cc},{type:1,index:0,name:"value",strings:["",""],ctor:cc},{type:1,index:0,name:"tick",strings:["",""],ctor:cc}]},Ec={h:uc`<!--?-->`,parts:[]},Cc={h:uc`
      <div id="div-slider">
        <ha-control-slider .unit="%" .min="0" id="volume-slider" part="volume-slider"></ha-control-slider>
        <?>
      </div>
    `,parts:[{type:1,index:1,name:"value",strings:["",""],ctor:Ac},{type:1,index:1,name:"max",strings:["",""],ctor:Ac},{type:1,index:1,name:"value-changed",strings:["",""],ctor:dc},{type:1,index:1,name:"class",strings:["volume-slider ",""],ctor:cc},{type:2,index:2}]},Ic={h:uc`
      <div id="volume" part="volume-div">
        <?> <?> <?>
        <?>
      </div>
    `,parts:[{type:2,index:1},{type:2,index:2},{type:2,index:3},{type:2,index:4}]};let Bc=class extends me{constructor(){super(...arguments),this.favorite=!1,this.canMute=!1,this.onToggle=async()=>{await this.actions.actionTogglePower()},this.onVolumeMuteToggle=async()=>{await this.actions.actionToggleMute()},this.onVolume=async e=>{let t=e.detail.value;Number.isNaN(t)||(this.player_data.volume=t,t/=100,this.requestUpdate("volume",this.player_data.volume),await this.actions.actionSetVolume(t))},this.onFavorite=async()=>{this.favorite=!this.favorite,await(this.player_data.favorite?this.actions.actionRemoveFavorite():this.actions.actionAddFavorite())}}set config(e){!Yr(this._config,e)&&e&&(this._config=e)}get config(){return this._config}set entityConfig(e){!Yr(this._entityConfig,e)&&e&&(this._entityConfig=e,this.maxVolume=e.max_volume)}get entityConfig(){return this._entityConfig}set player_data(e){Yr(this._player_data,e)||(this._player_data=e,this.favorite=e.favorite)}get player_data(){return this._player_data}renderPower(){return this.hide.power_button||this.useExpressive?{_$litType$:hc,values:[]}:{_$litType$:pc,values:[this.onToggle,this.Icons.POWER]}}renderMute(){return this.hide.mute_button||!this.canMute?{_$litType$:gc,values:[]}:{_$litType$:mc,values:[this.onVolumeMuteToggle,this.player_data.muted?this.Icons.VOLUME_MUTE:this.Icons.VOLUME_HIGH]}}renderFavorite(){return this.hide.favorite_button||this.useExpressive?{_$litType$:vc,values:[]}:{_$litType$:fc,values:[this.onFavorite,this.favorite?this.Icons.HEART:this.Icons.HEART_PLUS]}}renderTicks(){if(!this.useExpressive)return{_$litType$:yc,values:[]};const e=[...Array(19).keys()],t=this.player_data.volume,r=this.maxVolume;return{_$litType$:bc,values:[e.map(e=>{const i=(e+1)*r/20;return{_$litType$:wc,values:[i<=t?"in":"out",i,e]}})]}}renderVolumeBar(){return this.hide.volume?{_$litType$:Ec,values:[]}:{_$litType$:Cc,values:[this.player_data.volume,this.maxVolume,this.onVolume,this.controller.ActivePlayer?.useExpressive?"expressive":"",this.renderTicks()]}}render(){return{_$litType$:Ic,values:[this.renderPower(),this.renderVolumeBar(),this.renderMute(),this.renderFavorite()]}}shouldUpdate(e){return e.size>0||!this._initialUpdate}firstUpdated(){this._initialUpdate=!0}static get styles(){return lc}};e([a({context:mi})],Bc.prototype,"controller",void 0),e([a({context:Ei})],Bc.prototype,"Icons",void 0),e([Pe()],Bc.prototype,"favorite",void 0),e([xe({attribute:"can-mute",type:Boolean,default:!1})],Bc.prototype,"canMute",void 0),e([a({context:ki,subscribe:!0})],Bc.prototype,"hide",void 0),e([Pe()],Bc.prototype,"_player_data",void 0),e([a({context:gi,subscribe:!0})],Bc.prototype,"actions",void 0),e([a({context:bi,subscribe:!0})],Bc.prototype,"useExpressive",void 0),e([a({context:li,subscribe:!0})],Bc.prototype,"config",null),e([a({context:_r,subscribe:!0})],Bc.prototype,"entityConfig",null),e([a({context:ii,subscribe:!0})],Bc.prototype,"player_data",null),Bc=e([Ce("mpc-volume-row")],Bc);var xc=p`
  *[hide] {
    display: none;
  }

  *[background] {
    background-color: rgba(var(--player-blur-color), 0.9);
    border-radius: 10px;
  }

  mpc-player-artwork {
    display: flex;
    justify-content: center;
  }

  #active-track.large,
  #active-track.medium,
  #active-track.small {
    width: 100%;
    position: relative;
    z-index: -1;
    position: relative;
    top: -0.5em;
  }

  #active-track-text {
    z-index: 0;
    transform: translate3d(0, 0, -1px);
    -webkit-transform: translate3d(0, 0, -1px);
    position: relative;
  }
  .active-track-text.rounded {
    border-radius: 8px 8px 0px 0px;
  }

  #container {
    height: var(--mass-player-card-height);
  }
  #container.expressive {
    border-radius: var(--expressive-border-radius-container);
  }

  #dialog-favorites {
    --dialog-content-padding: 12px;
  }
  .dialog-playlist-item {
    margin: 0.15rem;
    border-radius: var(--media-row-border-radius);
    height: var(--media-row-height);
  }
  #dialog-favorites.expressive .dialog-playlist-item {
    background-color: var(--expressive-row-color) !important;
    --md-list-item-hover-state-layer-color: var(--md-sys-color-on-surface);
    border-radius: var(--default-border-radius);
    --md-ripple-hover-color: var(--md-sys-color-on-surface);
    --md-ripple-pressed-color: var(--md-sys-color-on-surface);
  }
  .dialog-playlist-thumbnail {
    width: var(--media-row-thumbnail-height);
    height: var(--media-row-thumbnail-height);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left;
    border-radius: var(--media-row-thumbnail-border-radius);
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  .dialog-playlist-title {
    font-size: 1.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    color: var(--font-color);
  }
  .dialog-playlist-title.expressive {
    font-family: var(--expressive-font-family);
    font-variation-settings: "ROND" 100;
    font-size: 1.3em;
    font-stretch: 65%;
    font-weight: 500;
  }
  #dialog-favorites.expressive .dialog-playlist-title {
    color: var(--expressive-row-color-text);
  }
  .dialog-playlist-divider {
    --divider-color: var(--md-sys-color-outline-variant);
  }
  .dialog-playlist-divider::before {
    content: " ";
    display: block;
    height: 1px;
    background-color: var(--divider-color);
    margin-left: 64px;
    margin-right: 24px;
  }
  .header-art.large {
    z-index: 2;
    position: relative;
  }
  .header-art.large::part(header) {
    z-index: 2;
  }
  .header-art.small {
    position: relative;
  }
  .media-controls {
    position: absolute;
    bottom: calc(var(--navbar-height) * -1);
    width: 100%;
    padding-bottom: var(--navbar-height);
  }
  .media-controls:not(.expressive) {
    background: var(--player-blur-color) !important;
  }
  .media-controls.expressive {
    background: linear-gradient(
      to top,
      var(--expressive-player-blur-color),
      rgb(from var(--expressive-player-blur-color) r g b / 0.7) 40%,
      rgb(from var(--expressive-player-blur-color) r g b / 0.4) 85%,
      transparent 100%
    ) !important;
    padding-top: 1em;
    border-bottom-left-radius: var(--default-border-radius);
    border-bottom-right-radius: var(--default-border-radius);
    backdrop-filter: blur(8px);
    mask: linear-gradient(transparent, black 5%, black);
  }
  .padded {
    padding-top: 0.5em;
  }
  #player-card {
    z-index: 0;
    height: var(--mass-player-card-height);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22em;
    position: relative;
    border-top-left-radius: var(--default-border-radius);
    border-top-right-radius: var(--default-border-radius);
  }
  .player-card.expressive {
    background-color: var(--md-sys-color-background, var(--ha-card-background));
    border-radius: 8px 8px 0px 0px;
  }
  #player-card-header {
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 3;
    border-radius: var(--default-border-radius) var(--default-border-radius) 0px
      0px;
  }
  #player-card-header::before {
    content: "";
    height: 100%;
    width: 100%;
    display: block;
    position: absolute;
    top: 0;
    border-radius: var(--default-border-radius) var(--default-border-radius) 0px
      0px;
    overflow: hidden;
    z-index: -1;
    padding-bottom: 4px;
  }
  #player-card-header:not(.expressive)::before {
    background: var(--player-blur-color) !important;
  }
  #player-card-header.expressive::before {
    mask: linear-gradient(black, black 95%, transparent);
    background: linear-gradient(
      to bottom,
      var(--expressive-player-blur-color),
      rgb(from var(--expressive-player-blur-color) r g b / 0.7) 40%,
      rgb(from var(--expressive-player-blur-color) r g b / 0.4) 85%,
      transparent 100%
    ) !important;
    backdrop-filter: blur(8px);
  }
  .player-header {
    margin: 0em 1.75em 0em 1.75em;
    text-align: center;
    overflow: hidden;
  }

  .player-name {
    position: relative;
  }
  .player-name:not(.expressive) {
    color: var(--player-name-color);
    font-size: 0.8rem;
  }
  .player-name.expressive {
    color: var(--md-sys-color-on-primary-container) !important;
    font-family: var(--expressive-font-family);
    font-weight: 700;
    font-size: 0.9rem;
    top: -0.3em;
  }

  .player-track-artist {
    line-height: 1em;
  }
  .player-track-artist:not(.expressive) {
    font-size: 1em;
  }
  .player-track-artist.expressive {
    color: var(--md-sys-color-on-primary-container) !important;
    text-shadow: 0 0 var(--md-sys-color-on-primary-container);
    font-family: var(--expressive-font-family);
    font-style: italic;
    font-size: 1.5em;
    font-variation-settings: "ROND" 100;
    font-weight: 300;
    font-stretch: 50%;
  }
  .player-track-title {
    white-space: nowrap;
    text-overflow: clip;
  }
  .player-track-title:not(.expressive) {
    font-size: 1.5rem;
  }
  .player-track-title.expressive {
    color: var(--md-sys-color-on-primary-container);
    text-shadow: 0px 0px var(--md-sys-color-primary);
    font-size: 3rem;
    font-weight: 500;
    font-stretch: 25%;
    font-style: italic;
    font-variation-settings: "ROND" 100;
    line-height: 1.3em;
    font-family: var(--expressive-font-family);
    margin-top: -0.2em;
  }

  #volume {
    width: 100%;
  }

  .volume.expressive::part(volume-div) {
    padding-bottom: 6px;
    position: relative;
  }

  .vol-art.large {
    z-index: 1;
    position: relative;
  }
  .vol-art.large::part(volume-div) {
    z-index: 0;
  }
`;let Pc=class extends me{constructor(){super(...arguments),this.onForceLoadEvent=e=>{const t=e,r=t.detail.key,i=t.detail.value;this.forceUpdatePlayerDataValue(r,i)},this.onPlayerSelect=e=>{e.stopPropagation();const t=e.detail.option;0!==t.length&&this.selectedPlayerService(t)},this.onAddToPlaylist=e=>{if(!this.activeMediaPlayer||!this.hass)return;const t=e.target.dataset.uri,r=this.hass.states[this.activeEntity.entity_id];if(!r)return;const i=r.attributes.media_content_id;i&&(this.actions.actionAddToPlaylist(i,t,this.activeMediaPlayer),this.closeAddToPlaylistDialog())},this.delayedUpdatePlayerData=()=>{setTimeout(()=>{this.activePlayerController&&this.activePlayerController.updateActivePlayerData()},2e3)},this.openPlaylistDialogOnEvent=()=>{this.openAddToPlaylistDialog()},this.onActivePlayerUpdated=()=>{this.activePlayerController&&this.activePlayerController.updateActivePlayerData()}}set activeEntityConfig(e){this._activeEntityConfig=e,this.updatePlaylists()}get activeEntityConfig(){return this._activeEntityConfig}get activeMediaPlayer(){return this.activePlayerController?.activeMediaPlayer}set activeEntity(e){zr(this._activeEntity,e)&&(this._activeEntity=e)}get activeEntity(){return this._activeEntity}set hass(e){e&&(this.actions=new ta(e),this._hass=e)}get hass(){return this._hass}set config(e){Yr(this._config,e)||(this._config=e)}get config(){return this._config}set activePlayerController(e){e&&(this._activePlayerController=e,this.player_data||this.activePlayerController.updateActivePlayerData())}get activePlayerController(){return this._activePlayerController}set groupedPlayersList(e){const t=this.playerEntities.filter(t=>e?.includes(t.entity_id));Yr(this._groupedPlayers,t)||(this._groupedPlayers=t)}get groupedPlayers(){return this._groupedPlayers}forceUpdatePlayerDataValue(e,t){if(!this.player_data)return;const r=this.player_data;Object.keys(r).includes(e)&&(r[e]=t,this.player_data={...r})}async generatePlaylistData(e){return{name:e.name,image:await Or(this.controller.hass,e.image??"",ir.PLAYLIST,this.controller.config.download_local,this.cardConfig?.proxy_all_artwork),uri:e.uri}}async updatePlaylists(){if(!this.controller.Actions)return;const e=(await this.controller.Actions.browserActions.actionGetLibrary(this.activeEntityConfig.entity_id,er.PLAYLIST,20,null)).map(e=>this.generatePlaylistData(e));this._playlists=await Promise.all(e)}openAddToPlaylistDialog(){if(!this.favoritesDialog)throw new Error("Dialog element doesn't exist!");this.favoritesDialog.open=!0}closeAddToPlaylistDialog(){if(!this.favoritesDialog)throw new Error("Dialog element doesn't exist!");this.favoritesDialog.open=!1}hideSectionHeader(){return this.hiddenElements.header}renderPlaylistDialogList(){return this._playlists?0===this._playlists.length?Ee`
        <div class="dialog-playlists-none-loading">No playlists found!</div>
      `:this._playlists.map(e=>Ee`
        <ha-md-list-item
          class="dialog-playlist-item"
          @click=${this.onAddToPlaylist}
          data-uri="${e.uri}"
          type="button"
        >
          <img
            class="dialog-playlist-thumbnail"
            slot="start"
            src="${e.image.image_url}"
            loading="lazy"
            onerror="this.src = '${e.image.fallback_url}'"
          />
          <span
            slot="headline"
            class="dialog-playlist-title 
              ${this.cardConfig?.expressive?"expressive":""}"
            inert
          >
            ${e.name}
          </span>
        </ha-md-list-item>
        <div class="dialog-playlist-divider"></div>
      `):Ee`
        <div class="dialog-playlists-none-loading">Loading Playlists...</div>
      `}renderAddToPlaylistDialog(){if(!this.cardConfig)return Ee``;const e="dialog-favorites "+(this.cardConfig.expressive?"expressive":"");return Ee`
      <ha-dialog
        id="dialog-favorites"
        class="${e}"
        heading="${this.controller.translate("player.playlist_dialog.header")}"
      >
        <div class="dialog-items">${this.renderPlaylistDialogList()}</div>
      </ha-dialog>
    `}wrapTitleMarquee(){if(!this.player_data)return Ee``;const e=`${this.player_data.track_title} - ${this.player_data.track_album}`;return Ee`
      <mpc-marquee-text
        class="player-track-title marquee 
        ${this.cardConfig?.expressive?"expressive":""}"
      >
        ${e}
      </mpc-marquee-text>
    `}renderPlayerName(){return this.activePlayerController&&this.cardConfig&&!this.hiddenElements.player_name?Ee`
      <div
        class="player-name ${this.cardConfig.expressive?"expressive":""}"
      >
        ${this.player_data?.player_name??this.activePlayerController.activePlayerName}
      </div>
    `:Ee``}renderTitle(){return this.hiddenElements.track_title?Ee``:Jr(this.hass,this.activeMediaPlayer,this.activeEntityConfig)?this.wrapTitleMarquee():Ee`
        <div class="player-track-title">
          ${this.controller.translate("player.title.inactive")}
        </div>
      `}renderGrouped(){const e=this.hiddenElements.group_selector;return this.groupedPlayers&&this.groupedPlayers.length>1&&!e?Ee`
        <mpc-grouped-player-menu slot="end"></mpc-grouped-player-menu>
      `:Ee``}renderArtist(){if(!this.player_data||!this.cardConfig||this.hiddenElements.track_artist)return Ee``;if(!Jr(this.hass,this.activeMediaPlayer,this.activeEntityConfig)){const e=this.controller.translate("player.messages.inactive"),t=Math.floor(Math.random()*e.length);return Ee`
        <div
          class="player-track-artist 
          ${this.cardConfig.expressive?"expressive":""}"
        >
          ${e[t]}
        </div>
      `}return Ee`
      <div
        class="player-track-artist 
        ${this.cardConfig.expressive?"expressive":""}"
      >
        ${this.player_data.track_artist}
      </div>
    `}renderSectionTitle(){if(this.hiddenElements.header_title)return Ee``;const e=this.controller.translate("player.header");return Ee` <span slot="label">${e}</span> `}renderSectionHeader(){return this.hideSectionHeader()?Ee``:this.cardConfig?Ee`
      <mpc-section-header
        class="header header-art ${this._config.layout.artwork_size} 
        ${this.cardConfig.expressive?"expressive":""}"
      >
        ${this.renderPlayerSelector()} ${this.renderSectionTitle()}
        ${this.renderGrouped()}
      </mpc-section-header>
    `:Ee``}renderHeader(){if(!this.cardConfig)return Ee``;const e=this.cardConfig.expressive;return Ee`
      <div
        id="player-card-header"
        class="player-card-header ${e?"expressive":""}"
      >
        ${this.renderSectionHeader()} ${this.renderActiveItemSection()}
      </div>
    `}renderPlayerSelector(){return this.hiddenElements.player_selector?Ee``:Ee`
      <span slot="start">
        <mpc-player-selector @menu-item-selected=${this.onPlayerSelect}>
        </mpc-player-selector>
      </span>
    `}renderActiveItemSection(){return this.cardConfig?Ee`
      <div id="active-track" class="${this._config.layout.artwork_size}">
        <div
          id="active-track-text"
          class="active-track-text 
          ${this.cardConfig.expressive?"expressive":""} 
          ${this.config.layout.artwork_size==Al.LARGE?"":"rounded"}"
        >
          ${this.renderPlayerHeader()} ${this.renderProgress()}
        </div>
      </div>
    `:Ee``}renderPlayerHeader(){const e=this.hideSectionHeader()?"padded":"";return Ee`
      <div class="player-header ${e}">
        ${this.renderPlayerName()} ${this.renderArtist()} ${this.renderTitle()}
      </div>
    `}renderProgress(){if(this.hiddenElements.track_progress_bar&&this.hiddenElements.track_progress_time)return Ee``;const e=Jr(this.hass,this.activeMediaPlayer,this.activeEntityConfig)?"":"opacity: 0;";return Ee`
      <mpc-progress-bar
        class="bg-art ${this._config.layout.artwork_size}"
        style="${e}"
      ></mpc-progress-bar>
    `}renderArtwork(){return Ee` <mpc-player-artwork></mpc-player-artwork>`}renderVolumeRow(){const e=this.activeEntity.attributes.supported_features,t=Wr(e,or.VOLUME_SET);if(!this.cardConfig||!t)return Ee``;const r=Wr(e,or.VOLUME_MUTE);return Ee`
      <div id="volume">
        <mpc-volume-row
          class="volume vol-art ${this._config.layout.artwork_size} 
          ${this.cardConfig.expressive?"expressive":""}"
          ?can-mute=${r}
        ></mpc-volume-row>
      </div>
    `}renderControls(){return this.cardConfig?Ee`
      <div
        class="media-controls controls-art ${this._config.layout.artwork_size} 
        ${this.cardConfig.expressive?"expressive":""}"
      >
        ${this.cardConfig.expressive?Ee`<mpc-player-controls-expressive></mpc-player-controls-expressive>`:Ee`<mpc-player-controls></mpc-player-controls>`}
        ${this.renderVolumeRow()}
      </div>
    `:Ee``}render(){if(!this.cardConfig)return Ee``;const e=this.cardConfig.expressive;return Ee`
      <div id="container" class="${e?"expressive":""}">
        ${this.renderHeader()}
        <div
          id="player-card"
          class="player-card ${e?"expressive":""}"
        >
          ${this.renderArtwork()} ${this.renderControls()}
        </div>
        ${this.renderAddToPlaylistDialog()}
      </div>
    `}firstUpdated(){this.controller.host.addEventListener("request-player-data-update",this.delayedUpdatePlayerData),this.controller.host.addEventListener("force-update-player",this.onForceLoadEvent),this.controller.host.addEventListener("active-player-updated",this.onActivePlayerUpdated),this.controller.host.addEventListener("open-add-to-playlist-dialog",this.openPlaylistDialogOnEvent)}updated(){const e=this.favoritesDialog;if(!e)return;const t=e.shadowRoot?.querySelector("#actions");t&&"none"!=t.style.display&&(t.style.display="none");const r=e.shadowRoot?.querySelector("#content");r&&"none"!=r.style.scrollbarWidth&&(r.style.scrollbarWidth="none")}shouldUpdate(e){return!(!this.player_data||0===e.size)&&super.shouldUpdate(e)}disconnectedCallback(){super.disconnectedCallback(),this.controller.host.removeEventListener("request-player-data-update",this.delayedUpdatePlayerData),this.controller.host.removeEventListener("force-update-player",this.onForceLoadEvent),this.controller.host.removeEventListener("active-player-updated",this.onActivePlayerUpdated),this.controller.host.removeEventListener("open-add-to-playlist-dialog",this.openPlaylistDialogOnEvent)}connectedCallback(){super.connectedCallback(),this.controller?.host&&(this.controller.host.addEventListener("request-player-data-update",this.delayedUpdatePlayerData),this.controller.host.addEventListener("force-update-player",this.onForceLoadEvent),this.controller.host.addEventListener("active-player-updated",this.onActivePlayerUpdated),this.controller.host.addEventListener("open-add-to-playlist-dialog",this.openPlaylistDialogOnEvent))}static get styles(){return xc}};e([Se("#dialog-favorites")],Pc.prototype,"favoritesDialog",void 0),e([Pe()],Pc.prototype,"_playlists",void 0),e([a({context:ai,subscribe:!0})],Pc.prototype,"playerEntities",void 0),e([a({context:ni,subscribe:!0})],Pc.prototype,"cardConfig",void 0),e([a({context:mi,subscribe:!0})],Pc.prototype,"controller",void 0),e([a({context:ii,subscribe:!0}),Pe()],Pc.prototype,"player_data",void 0),e([a({context:ki,subscribe:!0})],Pc.prototype,"hiddenElements",void 0),e([Pe()],Pc.prototype,"_activePlayerController",void 0),e([a({context:_r,subscribe:!0})],Pc.prototype,"activeEntityConfig",null),e([a({context:ti,subscribe:!0}),Pe()],Pc.prototype,"activeEntity",null),e([a({context:Zr,subscribe:!0})],Pc.prototype,"hass",null),e([a({context:li,subscribe:!0})],Pc.prototype,"config",null),e([a({context:pi,subscribe:!0})],Pc.prototype,"activePlayerController",null),e([a({context:si,subscribe:!0})],Pc.prototype,"groupedPlayersList",null),Pc=e([Ce("mpc-music-player-card")],Pc);var Dc=p`
  .action-button {
    width: var(--media-row-icon-width);
    align-content: center;
  }
  .action-button:not(.expressive)::part(button) {
    --button-button-height: 38px;
    --button-button-width: 38px;
  }
  .action-button.expressive {
    --button-border-radius: 8px !important;
    --ha-button-start-border-radius: 8px !important;
    --ha-button-end-border-radius: 8px !important;
    --button-button-height: 48px;
    --used-button-height: 48px;
  }
  .action-button.expressive:hover {
    background-color: var(--expressive-row-button-color-hover) !important;
    --button-border-radius: 16px !important;
    transition: border-radius background-color var(--animation-duration);
    --ha-button-start-border-radius: 16px !important;
    --ha-button-end-border-radius: 16px !important;
  }
  .action-button.expressive:first-of-type {
    --button-border-radius: 24px 8px 8px 24px !important;
    --ha-button-start-border-radius: 24px !important;
    --ha-button-end-border-radius: 8px !important;
  }
  .action-button.expressive:first-of-type:hover {
    --button-border-radius: 24px 16px 16px 24px !important;
    --ha-button-end-border-radius: 16px !important;
  }
  .action-button.expressive:last-of-type {
    --button-border-radius: 8px 24px 24px 8px !important;
    --ha-button-start-border-radius: 8px !important;
    --ha-button-end-border-radius: 24px !important;
  }
  .action-button.expressive:last-of-type:hover {
    --button-border-radius: 16px 24px 24px 16px !important;
    --ha-button-start-border-radius: 16px !important;
  }
  .action-button.expressive:only-of-type {
    --button-border-radius: 16px !important;
    --ha-button-start-border-radius: 16px !important;
    --ha-button-end-border-radius: 16px !important;
    --button-button-width: 48px;
    --used-button-width: 48px;
  }
  .action-button.expressive:only-of-type:hover {
    --button-border-radius: 16px !important;
  }

  .button {
    margin: 0.15rem;
    height: var(--media-row-height);
  }
  .button.expressive {
    border-radius: var(--default-border-radius);
  }
  .button:not(.expressive) {
    border-radius: var(--media-row-border-radius);
  }
  .button.active {
    margin: 0.15rem;
    background-color: var(
      --media-row-active-background-color,
      var(--md-sys-color-secondary-container)
    );
    height: var(--media-row-height);
    padding-inline-start: 0px;
    color: var(--accent-color);
  }
  .button.active :host {
    --md-sys-color-primary: unset;
  }

  .button.expressive {
    background-color: var(--expressive-row-color) !important;
    --md-list-item-hover-state-layer-color: var(--md-sys-color-on-surface);
    border-radius: var(--default-border-radius);
    --md-ripple-hover-color: var(--md-sys-color-on-surface);
    --md-ripple-pressed-color: var(--md-sys-color-on-surface);
  }
  .button.expressive > .title {
    color: var(--expressive-row-color-text);
  }

  .button.expressive.active {
    --primary-text-color: var(--expressive-row-active-color-text) !important;
    --font-color: var(--expressive-row-active-color-text) !important;
    background-color: var(--expressive-row-active-color) !important;
    border-radius: var(--default-border-radius);
    --md-ripple-hover-color: var(--md-sys-color-on-surface);
    --md-ripple-pressed-color: var(--md-sys-color-on-surface);
  }
  .button.expressive.active > .title {
    color: var(--expressive-row-active-color-text);
  }

  .button-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    height: 48px;
    right: 8px;
    padding-right: 8px;
    position: absolute;
  }

  .divider {
    --divider-color: var(--md-sys-color-surface-variant);
  }
  .divider::before {
    content: " ";
    display: block;
    height: 1px;
    background-color: var(--divider-color);
    margin-left: 64px;
    margin-right: 24px;
  }
  .hide-covers .title {
    margin-left: 14px;
  }

  .svg-action-button {
    height: var(--row-icon-button-height);
    width: var(--row-icon-button-height);
    color: var(
      --md-sys-color-on-secondary-container,
      var(--md-sys-color-on-secondary-container)
    ) !important;
  }
  .svg-action-button.expressive {
    color: var(--expressive-row-button-color-text);
  }
  .svg-action-button.expressive:hover {
    color: var(--expressive-row-button-color-text-hover);
    transition: color var(--animation-duration);
  }

  .thumbnail {
    width: var(--media-row-thumbnail-height);
    height: var(--media-row-thumbnail-height);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left;
    border-radius: var(--media-row-thumbnail-border-radius);
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  .thumbnail.disabled {
    opacity: 0.38;
  }

  .title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    color: var(--font-color);
  }
  .title.expressive {
    font-family: var(--expressive-font-family);
    font-variation-settings: "ROND" 100;
    text-transform: uppercase;
  }
  .title.track.expressive {
    font-size: 1.3em;
    font-stretch: 25%;
    font-weight: 500;
  }
  .title.artist.expressive {
    font-size: 1.2em;
    font-stretch: 30%;
    font-weight: 275;
  }
  .title.disabled {
    opacity: 0.38;
  }
`;const{AttributePart:Sc,PropertyPart:kc,EventPart:Rc}=Ti,Qc=e=>e,Mc={h:Qc`<!--?-->`,parts:[]},Hc={h:Qc`
        <img slot="start" loading="lazy">
      `,parts:[{type:1,index:0,name:"class",strings:["thumbnail ",""],ctor:Sc},{type:1,index:0,name:"src",strings:["",""],ctor:Sc},{type:1,index:0,name:"error",strings:["",""],ctor:Rc}]},Oc={h:Qc`<!--?-->`,parts:[]},Tc={h:Qc`
      <div>
        <?>
      
    </div>`,parts:[{type:1,index:0,name:"class",strings:["title track \n        ","\n        ",""],ctor:Sc},{type:1,index:0,name:"style",strings:["width: ",""],ctor:Sc},{type:2,index:1}]},Lc={h:Qc`<!--?-->`,parts:[]},qc={h:Qc`
      <div>
        <?>
      
    </div>`,parts:[{type:1,index:0,name:"class",strings:["title artist \n        "," \n        ",""],ctor:Sc},{type:1,index:0,name:"style",strings:["width: ",""],ctor:Sc},{type:2,index:1}]},Uc={h:Qc`<!--?-->`,parts:[]},Fc={h:Qc`
      <span slot="end" class="button-group">
        <?> <?>
        <?> <?>
      </span>
    `,parts:[{type:1,index:0,name:"click",strings:["",""],ctor:Rc},{type:2,index:1},{type:2,index:2},{type:2,index:3},{type:2,index:4}]},Vc={h:Qc`<!--?-->`,parts:[]},zc={h:Qc`
      <mpc-button role="tonal" size="small" elevation="1">
        <ha-svg-icon></ha-svg-icon>
      </mpc-button>
    `,parts:[{type:1,index:0,name:"onPressService",strings:["",""],ctor:kc},{type:1,index:0,name:"class",strings:["action-button ",""],ctor:Sc},{type:1,index:1,name:"path",strings:["",""],ctor:kc},{type:1,index:1,name:"class",strings:["svg-action-button ",""],ctor:Sc}]},Jc={h:Qc`<!--?-->`,parts:[]},Yc={h:Qc`
      <mpc-button role="tonal" size="small" elevation="1">
        <ha-svg-icon></ha-svg-icon>
      </mpc-button>
    `,parts:[{type:1,index:0,name:"onPressService",strings:["",""],ctor:kc},{type:1,index:0,name:"class",strings:["action-button ",""],ctor:Sc},{type:1,index:1,name:"path",strings:["",""],ctor:kc},{type:1,index:1,name:"class",strings:["svg-action-button ",""],ctor:Sc}]},Nc={h:Qc`<!--?-->`,parts:[]},Xc={h:Qc`
      <mpc-button role="tonal" size="small" elevation="1">
        <ha-svg-icon></ha-svg-icon>
      </mpc-button>
    `,parts:[{type:1,index:0,name:"onPressService",strings:["",""],ctor:kc},{type:1,index:0,name:"class",strings:["action-button ",""],ctor:Sc},{type:1,index:1,name:"path",strings:["",""],ctor:kc},{type:1,index:1,name:"class",strings:["svg-action-button ",""],ctor:Sc}]},jc={h:Qc`<!--?-->`,parts:[]},Kc={h:Qc`
      <mpc-button role="tonal" size="small" elevation="1">
        <ha-svg-icon></ha-svg-icon>
      </mpc-button>
    `,parts:[{type:1,index:0,name:"onPressService",strings:["",""],ctor:kc},{type:1,index:0,name:"class",strings:["action-button ",""],ctor:Sc},{type:1,index:1,name:"path",strings:["",""],ctor:kc},{type:1,index:1,name:"class",strings:["svg-action-button ",""],ctor:Sc}]},Gc={h:Qc`
      <ha-md-list-item type="button">
        <?>
        <span slot="headline" id="headline">
          <?> <?>
        </span>
        <?>
      </ha-md-list-item>
      <div class="divider"></div>
    `,parts:[{type:1,index:0,name:"style",strings:["",""],ctor:Sc},{type:1,index:0,name:"class",strings:["button "," "," ",""],ctor:Sc},{type:1,index:0,name:"click",strings:["",""],ctor:Rc},{type:2,index:1},{type:2,index:3},{type:2,index:4},{type:2,index:5}]};let Wc=class extends me{constructor(){super(...arguments),this.imagesExhausted=!1,this.errorCount=0,this.showAlbumCovers=!0,this.callMoveItemUpService=e=>{this.media_item&&(navigator.vibrate&&navigator.vibrate(Pr.Queue.ACTION_MOVE_UP),e.stopPropagation(),this.moveQueueItemUpService(this.media_item.queue_item_id))},this.callMoveItemDownService=e=>{this.media_item&&(navigator.vibrate&&navigator.vibrate(Pr.Queue.ACTION_MOVE_DOWN),e.stopPropagation(),this.moveQueueItemDownService(this.media_item.queue_item_id))},this.callMoveItemNextService=e=>{this.media_item&&(navigator.vibrate&&navigator.vibrate(Pr.Queue.ACTION_MOVE_NEXT),e.stopPropagation(),this.moveQueueItemNextService(this.media_item.queue_item_id))},this.callRemoveItemService=e=>{this.media_item&&(e.stopPropagation(),navigator.vibrate&&navigator.vibrate(Pr.Queue.ACTION_REMOVE),this.removeService(this.media_item.queue_item_id))},this.callOnQueueItemSelectedService=()=>{this.media_item&&this.selectedService(this.media_item.queue_item_id)},this._renderThumbnailFallback=()=>{this.errorCount++;const e=this.thumbnailElement.src,t=Ur(this.hass,e,this.defaultImageURL??"",this.fallbackImageURL,ir.CLEFT);this.thumbnailElement.src=t,t==e||this.errorCount>=5?this.imagesExhausted=!0:this.imagesExhausted&&(this.thumbnailElement.onerror=null)}}set config(e){!Yr(this._config,e)&&e&&(this._config=e)}get config(){return this._config}set entityConfig(e){!Yr(this._entityConfig,e)&&e&&(this._entityConfig=e)}get entityConfig(){return this._entityConfig}set hass(e){this._hass=e,this.getTrackImage()}get hass(){return this._hass}set media_item(e){e&&(this._media_item=e,this.getTrackImage())}get media_item(){return this._media_item}async getTrackImage(){if(!this.hass||!this.media_item)return;const e=this.media_item,t=e.media_image.length>0?e.media_image:ir.CLEFT,r=e.local_image_encoded?.length?e.local_image_encoded:t,i=await Or(this.hass,r,t,this.cardConfig.download_local,this.cardConfig.proxy_all_artwork);this.defaultImageURL=i.image_url,this.fallbackImageURL=i.fallback_url}shouldUpdate(e){if(e.has("media_item")){const i=e.get("media_item");return t=i,r=this.media_item,t?.media_content_id!==r?.media_content_id||t?.playing!==r?.playing||t?.queue_item_id!==r?.queue_item_id||t?.show_action_buttons!==r?.show_action_buttons||t?.show_artist_name!==r?.show_artist_name||t?.show_move_up_next!==r?.show_move_up_next}var t,r;return e.size>0}renderThumbnail(){if(!this.media_item)return{_$litType$:Mc,values:[]};const e=this.defaultImageURL?.length?this.defaultImageURL:this.fallbackImageURL?.length?this.fallbackImageURL:Tr(this.hass,ir.CLEFT),t=!this.media_item.show_action_buttons&&!this.media_item?.playing;return this.showAlbumCovers&&!this.hide.album_covers?{_$litType$:Hc,values:[t?"disabled":"",e,this._renderThumbnailFallback]}:{_$litType$:Oc,values:[]}}_calculateTitleWidth(){if(!this.config||!this.media_item)return;let e=0;const t=this.hide,r=this.media_item;if(r.show_move_up_next&&!t.move_next_button&&(e+=1),r.show_move_up_next&&!t.move_up_button&&(e+=1),t.move_down_button||(e+=1),t.remove_button||(e+=1),0==e||!r.show_action_buttons||t.action_buttons)return"100%";const i=e-1;return`calc(100% - ((32px * ${e.toString()}) + (8px * ${i.toString()}) + 16px));`}renderTitle(){const e=!this.media_item?.show_action_buttons&&!this.media_item?.playing;return{_$litType$:Tc,values:[e?"disabled":"",this.useExpressive?"expressive":"",this._calculateTitleWidth(),this.media_item?.media_title]}}renderArtist(){if(this.hide.artist_names)return{_$litType$:Lc,values:[]};const e=!this.media_item?.show_action_buttons&&!this.media_item?.playing;return{_$litType$:qc,values:[e?"disabled":"",this.useExpressive?"expressive":"",this._calculateTitleWidth(),this.media_item?.media_artist]}}renderActionButtons(){return this.hide.action_buttons||!this.media_item?.show_action_buttons?{_$litType$:Uc,values:[]}:{_$litType$:Fc,values:[e=>{e.stopPropagation()},this.renderMoveNextButton(),this.renderMoveUpButton(),this.renderMoveDownButton(),this.renderRemoveButton()]}}renderMoveNextButton(){return this.hide.move_next_button||!this.media_item?.show_move_up_next?{_$litType$:Vc,values:[]}:{_$litType$:zc,values:[this.callMoveItemNextService,this.useExpressive?"expressive":"",this.Icons.ARROW_PLAY_NEXT,this.useExpressive?"expressive":""]}}renderMoveUpButton(){return this.hide.move_up_button||!this.media_item?.show_move_up_next?{_$litType$:Jc,values:[]}:{_$litType$:Yc,values:[this.callMoveItemUpService,this.useExpressive?"expressive":"",this.Icons.ARROW_UP,this.useExpressive?"expressive":""]}}renderMoveDownButton(){return this.hide.move_down_button?{_$litType$:Nc,values:[]}:{_$litType$:Xc,values:[this.callMoveItemDownService,this.useExpressive?"expressive":"",this.Icons.ARROW_DOWN,this.useExpressive?"expressive":""]}}renderRemoveButton(){return this.hide.remove_button?{_$litType$:jc,values:[]}:{_$litType$:Kc,values:[this.callRemoveItemService,this.useExpressive?"expressive":"",this.Icons.CLOSE,this.useExpressive?"expressive":""]}}render(){const e=this.media_item?.playing?"active":"",t=this.useExpressive?"expressive":"",r=this.showAlbumCovers?"":"hide-covers";return{_$litType$:Gc,values:[this.display?"":"display: none;",e,t,r,this.callOnQueueItemSelectedService,this.renderThumbnail(),this.renderTitle(),this.renderArtist(),this.renderActionButtons()]}}static get styles(){return Dc}};e([a({context:Ei})],Wc.prototype,"Icons",void 0),e([a({context:hi,subscribe:!0}),Pe()],Wc.prototype,"display",void 0),e([a({context:bi,subscribe:!0})],Wc.prototype,"useExpressive",void 0),e([Pe()],Wc.prototype,"defaultImageURL",void 0),e([Pe()],Wc.prototype,"fallbackImageURL",void 0),e([Se(".thumbnail")],Wc.prototype,"thumbnailElement",void 0),e([a({context:Ri,subscribe:!0})],Wc.prototype,"hide",void 0),e([a({context:ni,subscribe:!0})],Wc.prototype,"cardConfig",void 0),e([a({context:ci,subscribe:!0})],Wc.prototype,"config",null),e([a({context:_r,subscribe:!0})],Wc.prototype,"entityConfig",null),e([a({context:Zr,subscribe:!0})],Wc.prototype,"hass",null),e([xe({attribute:!1})],Wc.prototype,"media_item",null),Wc=e([Ce("mpc-queue-media-row")],Wc);const Zc={action_buttons:!1,move_down_button:!1,move_next_button:!1,move_up_button:!1,remove_button:!1,album_covers:!1,artist_names:!1,clear_queue_button:!1,header_title:!1,header:!1},_c={enabled:!0,show_album_covers:!0,show_artist_names:!0,hide:Zc},$c=["action_buttons","move_down_button","move_next_button","move_up_button","remove_button","album_covers","artist_names","clear_queue_button"];var eA;function tA(e){let t=e.queue;return t=function(e){return{..._c,...e}}(t),t=function(e){const t=e.hide;return{...e,hide:{...Zc,...t}}}(t),{...e,queue:t}}!function(e){e.CONFIG_MISSING="Invalid configuration.",e.NO_ENTITY="You need to define entity.",e.ENTITY_TYPE="Entity must be a string!",e.MISSING_ENTITY="Entity does not exist!",e.OK="ok"}(eA||(eA={}));var rA=p`
  *[selected] {
    color: var(--accent-color);
  }
  *[hide] {
    display: none;
  }
  lit-virtualizer {
    height: calc(var(--queue-height) - 8px);
    scrollbar-width: none;
  }
  mpc-queue-media-row {
    width: 100%;
  }
  .button.min {
    --button-button-height: 35px;
    --button-button-width: 35px;
    --button-padding: 0px;
    position: relative;
  }

  #container {
    overflow: hidden;
    width: 100%;
    justify-content: center;
    box-shadow: unset;
    height: 100%;
  }
  #container.expressive {
    border-radius: var(--expressive-border-radius-container);
    background-color: var(
      --expressive-color-container,
      var(--ha-card-background)
    );
  }

  .header {
    display: flex;
    flex-direction: column;
    font-size: 1.5rem;
    text-align: center;
    font-weight: 600;
    padding-top: 12px;
    height: auto;
  }
  .header-icon {
    height: 30px;
    width: 30px;
  }
  .list {
    overflow-y: scroll;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-left: 4px;
    padding-right: 4px;
    border-radius: var(--queue-border-radius-expressive, 28px);
  }
  .list:not(.padded) {
    --queue-height: calc(100% - 3.5em);
    height: var(--queue-height);
  }
  .list.padded {
    --queue-height: 100%;
    height: var(--mass-player-card-height);
  }
  .list.expressive {
    background-color: var(--md-sys-color-background);
  }
  .ist:not(.expressive) {
    border-radius: var(--queue-border-radius, 12px);
  }

  .main {
    display: flex;
    height: 100%;
    margin: auto;
    padding: 6px 16px 6px 16px;
    width: 100%;
    justify-content: space-around;
    overflow-x: scroll;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
  }

  .name {
    font-weight: 300;
    font-size: var(--fontSize);
    line-height: var(--fontSize);
    cursor: pointer;
  }

  .title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
  }
  @keyframes fade-in {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }
`;const{AttributePart:iA,PropertyPart:sA}=Ti,oA=e=>e,nA={h:oA`
      <mpc-queue-media-row></mpc-queue-media-row>
    `,parts:[{type:1,index:0,name:"class",strings:["",""],ctor:iA},{type:1,index:0,name:"media_item",strings:["",""],ctor:sA},{type:1,index:0,name:"showAlbumCovers",strings:["",""],ctor:sA},{type:1,index:0,name:"selectedService",strings:["",""],ctor:sA},{type:1,index:0,name:"removeService",strings:["",""],ctor:sA},{type:1,index:0,name:"moveQueueItemNextService",strings:["",""],ctor:sA},{type:1,index:0,name:"moveQueueItemUpService",strings:["",""],ctor:sA},{type:1,index:0,name:"moveQueueItemDownService",strings:["",""],ctor:sA}]},aA={h:oA`
      <lit-virtualizer scroller=""></lit-virtualizer>
    `,parts:[{type:1,index:0,name:"items",strings:["",""],ctor:sA},{type:1,index:0,name:"renderItem",strings:["",""],ctor:sA}]},lA={h:oA`<!--?-->`,parts:[]},cA={h:oA`
      <mpc-button role="filled" size="small" elevation="1" id="button-back">
        <ha-svg-icon class="header-icon"></ha-svg-icon>
      </mpc-button>
    `,parts:[{type:1,index:0,name:"onPressService",strings:["",""],ctor:sA},{type:1,index:0,name:"class",strings:["button min ",""],ctor:iA},{type:1,index:1,name:"path",strings:["",""],ctor:sA}]},AA={h:oA`<!--?-->`,parts:[]},dA={h:oA`
      <mpc-section-header>
        <span slot="label" id="title"> <?> </span>
        <span slot="end" id="clear-queue">
          <?>
        </span>
      </mpc-section-header>
    `,parts:[{type:2,index:2},{type:2,index:4}]},uA={h:oA`
        <div id="container">
          <?>
          <div>
            <?>
          </div>
        </div>
      `,parts:[{type:1,index:0,name:"class",strings:["",""],ctor:iA},{type:2,index:1},{type:1,index:2,name:"class",strings:["list "," ",""],ctor:iA},{type:2,index:3}]},hA={h:oA`<?><!--?-->`,parts:[{type:2,index:0}]};let pA=class extends me{constructor(){super(...arguments),this._queue=[],this._firstLoaded=!1,this._tabSwitchFirstUpdate=!1,this._mediaCardDisplay=!0,this.onQueueItemSelected=async e=>{this.queueController&&(await this.queueController.playQueueItem(e),this.queueController.getQueue(),this.scrollToActive())},this.onQueueItemRemoved=async e=>{this.queueController&&await this.queueController.removeQueueItem(e)},this.onQueueItemMoveNext=async e=>{this.queueController&&await this.queueController.moveQueueItemNext(e)},this.onQueueItemMoveUp=async e=>{this.queueController&&await this.queueController.moveQueueItemUp(e)},this.onQueueItemMoveDown=async e=>{this.queueController&&await this.queueController.moveQueueItemDown(e)},this.onClearQueue=async()=>{this.queueController&&await this.queueController.clearQueue(this.active_player_entity)},this.onTabSwitch=e=>{e.detail==rr.QUEUE&&(this._tabSwitchFirstUpdate=!0,this.scrollToActive())}}set queueController(e){this._queueController=e}get queueController(){return this._queueController}set queue(e){if(e)return this.queue?.length?void(Yr(this.queue,e)||(this._queue=this.processQueue(e))):void(this._queue=this.processQueue(e))}get queue(){return this._queue}processQueue(e){const t=e.findIndex(e=>e.playing);return e.map((e,r)=>({...e,show_action_buttons:r>t,show_move_up_next:r>t+1}))}set activeSection(e){this._mediaCardDisplay=e==rr.QUEUE,this._section=e}get activeSection(){return this._section}set hass(e){e&&(this._hass=e)}get hass(){return this._hass}set active_player_entity(e){this._active_player_entity=e}get active_player_entity(){return this._active_player_entity}set config(e){const t=this.testConfig(e,!1);if(t!==eA.OK)throw this.createError(t);this._config={..._c,...e}}get config(){return this._config}testConfig(e,t=!0){if(!e)return eA.CONFIG_MISSING;if(t){if(!this.active_player_entity)return eA.NO_ENTITY;if("string"!=typeof this.active_player_entity)return eA.ENTITY_TYPE}return this.hass&&!this.hass.states[this.active_player_entity]?eA.MISSING_ENTITY:eA.OK}scrollToActive(){if(!this.queue?.length)return;const e=this.queue.findIndex(e=>e.playing);(e||0==e)&&this.virtualizerElement.element(e).scrollIntoView({block:"start",behavior:"auto"})}hideSectionHeader(){return this.hiddenElements.header}renderQueueItem(e){const t=this._config.show_album_covers;return{_$litType$:nA,values:[e.playing?"active":"",e,t,this.onQueueItemSelected,this.onQueueItemRemoved,this.onQueueItemMoveNext,this.onQueueItemMoveUp,this.onQueueItemMoveDown]}}renderQueueItems(){return{_$litType$:aA,values:[this.queue??[],e=>this.renderQueueItem(e)]}}renderClearQueueButton(){const e=this.activePlayerController.useExpressive;return this.hiddenElements.clear_queue_button?{_$litType$:lA,values:[]}:{_$litType$:cA,values:[this.onClearQueue,e?"expressive":"",this.Icons.CLEAR]}}renderHeader(){const e=cr("queue.header",this.hass),t=this.hiddenElements.header_title?"":e;return this.hideSectionHeader()?{_$litType$:AA,values:[]}:{_$litType$:dA,values:[t,this.renderClearQueueButton()]}}render(){const e=this.activePlayerController.useExpressive?"expressive":"",t=this.hideSectionHeader()?"padded":"";return this.error??{_$litType$:uA,values:[e,this.renderHeader(),e,t,this.renderQueueItems()]}}shouldUpdate(e){return 0!==e.size&&(!(!e.has("_config")&&!e.has("queue"))||super.shouldUpdate(e))}disconnectedCallback(){super.disconnectedCallback(),this.queueController&&(this.queueController.isSubscribed&&this.queueController.unsubscribeUpdates(),this.queueController._host.removeEventListener("section-changed",this.onTabSwitch))}connectedCallback(){this.queueController&&(this.queueController.getQueue(),this.queueController.subscribeUpdates()),this._animations&&this._firstLoaded&&this._animations.forEach(e=>e.play=!0),this.queueController?._host.addEventListener("section-changed",this.onTabSwitch),super.connectedCallback()}firstUpdated(){this._firstLoaded=!0,this.queueController&&this.queueController._host.addEventListener("section-changed",this.onTabSwitch)}updated(){this._tabSwitchFirstUpdate=!1}static get styles(){return rA}createError(e){const t=new Error(e),r=document.createElement("hui-error-card");return r.setConfig({type:"error",error:t,origConfig:this._config}),this.error={_$litType$:hA,values:[r]},t}};e([a({context:pi})],pA.prototype,"activePlayerController",void 0),e([a({context:_r,subscribe:!0})],pA.prototype,"entityConf",void 0),e([a({context:Ei,subscribe:!0})],pA.prototype,"Icons",void 0),e([a({context:Ri,subscribe:!0})],pA.prototype,"hiddenElements",void 0),e([n({context:ci})],pA.prototype,"_config",void 0),e([Pe()],pA.prototype,"_queue",void 0),e([Re("#animation")],pA.prototype,"_animations",void 0),e([Se(".media-active")],pA.prototype,"_activeElement",void 0),e([Se("lit-virtualizer")],pA.prototype,"virtualizerElement",void 0),e([Se(".list")],pA.prototype,"_items",void 0),e([Pe()],pA.prototype,"_tabSwitchFirstUpdate",void 0),e([a({context:vi,subscribe:!0})],pA.prototype,"queueController",null),e([a({context:Ci,subscribe:!0})],pA.prototype,"queue",null),e([n({context:hi})],pA.prototype,"_mediaCardDisplay",void 0),e([a({context:ui,subscribe:!0})],pA.prototype,"activeSection",null),e([a({context:Zr,subscribe:!0})],pA.prototype,"hass",null),e([a({context:$r,subscribe:!0}),xe({attribute:!1})],pA.prototype,"active_player_entity",null),pA=e([Ce("mpc-queue-card")],pA);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const gA=Te(class extends Le{constructor(){super(...arguments),this.key=$}render(e,t){return this.key=e,t}update(e,[t,r]){return t!==this.key&&(Xe(e),this.key=t),r}});var mA=p`
  :host {
    --me-font-color: var(--md-sys-color-on-primary-container);
    --me-icon-color: var(--md-sys-color-primary-container);
  }

  .action-button {
    width: var(--media-row-icon-width);
    transform: scale(1);
    align-content: center;
  }
  .action-button:not(.expressive)::part(button) {
    --button-button-height: 38px;
    --button-button-width: 38px;
  }

  .action-button.expressive {
    --button-border-radius: var(--button-small-border-radius) !important;
    --ha-button-start-border-radius: 8px !important;
    --ha-button-end-border-radius: 8px !important;
    --button-button-height: 48px;
    --used-button-height: 48px;
  }
  .action-button.expressive:hover {
    background-color: var(--expressive-row-button-color-hover);
    --button-border-radius: 16px !important;
    --ha-button-start-border-radius: 16px !important;
    --ha-button-end-border-radius: 16px !important;
    transition: border-radius background-color var(--animation-duration);
  }
  .action-button.expressive:first-of-type {
    --button-border-radius: 24px 8px 8px 24px !important;
    --ha-button-start-border-radius: 24px !important;
    --ha-button-end-border-radius: 8px !important;
  }
  .action-button.expressive:first-of-type:hover {
    --button-border-radius: 24px 16px 16px 24px !important;
    --ha-button-end-border-radius: 16px !important;
  }
  .action-button.expressive:last-of-type {
    --button-border-radius: 8px 24px 24px 8px !important;
    --ha-button-start-border-radius: 8px !important;
    --ha-button-end-border-radius: 24px !important;
  }
  .action-button.expressive:last-of-type:hover {
    --button-border-radius: 16px 24px 24px 16px !important;
    --ha-button-start-border-radius: 16px !important;
  }
  .action-button.expressive:only-of-type {
    --button-border-radius: 16px !important;
    --ha-button-start-border-radius: 16px !important;
    --ha-button-end-border-radius: 16px !important;
    --button-button-width: 48px;
    --used-button-width: 48px;
  }
  .action-button.expressive:only-of-type:hover {
    --button-border-radius: 24px !important;
    --ha-button-start-border-radius: 24px !important;
    --ha-button-end-border-radius: 24px !important;
  }

  .audio-bars {
    width: 0.55rem;
    position: absolute;
    right: 1rem;
    height: 100%;
    margin-left: 1rem;
  }
  .audio-bars > div {
    bottom: 0.05rem;
    height: 0.15rem;
    position: absolute;
    width: 0.15rem;
    display: block;
    animation: player-active 0ms -800ms linear infinite alternate;
  }
  .audio-bars.normal > div {
    --start-color: var(--audio-bars-color);
    --mid-color: var(--audio-bars-color);
    --end-color: var(--audio-bars-color);
  }
  .audio-bars.expressive > div {
    --start-color: var(--expressive-audio-bars-initial-color);
    --mid-color: var(--expressive-audio-bars-middle-color);
    --max-color: var(--expressive-audio-bars-max-color);
  }
  .audio-bars > div:first-child {
    left: 8px;
    animation-duration: 474ms;
  }
  .audio-bars > div:nth-child(2) {
    left: 12px;
    animation-duration: 433ms;
  }
  .audio-bars > div:nth-child(3) {
    left: 16px;
    animation-duration: 407ms;
  }
  .audio-bars > div:last-child {
    left: 20px;
    animation-duration: 375ms;
  }

  .button-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    height: 48px;
    right: 8px;
    padding-right: 8px;
    position: absolute;
  }

  .button.expressive {
    border-radius: var(--default-border-radius);
  }
  .button:not(.expressive) {
    border-radius: var(--player-row-border-radius);
  }
  .button {
    margin: 0.15rem;
    height: var(--media-row-height);
  }

  .button.active {
    margin: 0.15rem;
    border-radius: var(--player-row-border-radius);
    background-color: var(
      --media-row-active-background-color,
      var(--md-sys-color-secondary-container)
    );
    height: var(--media-row-height);
    padding-inline-start: 0px;
    color: var(--accent-color);
  }

  .button.expressive {
    background-color: var(--expressive-row-color) !important;
    --md-list-item-hover-state-layer-color: var(--md-sys-color-on-surface);
    border-radius: var(--default-border-radius);
    --md-ripple-hover-color: var(--md-sys-color-on-surface);
    --md-ripple-pressed-color: var(--md-sys-color-on-surface);
  }
  .button.expressive > .title {
    color: var(--expressive-row-color-text);
  }
  .button.expressive.active {
    --primary-text-color: var(--expressive-row-active-color-text) !important;
    --font-color: var(--expressive-row-active-color-text) !important;
    background-color: var(--expressive-row-active-color) !important;
    border-radius: var(--default-border-radius);
    --md-ripple-hover-color: var(--md-sys-color-on-surface);
    --md-ripple-pressed-color: var(--md-sys-color-on-surface);
  }
  .button.expressive.active > .title {
    color: var(--expressive-row-active-color-text);
  }

  .divider {
    --divider-color: var(--md-sys-color-surface-variant);
  }
  .divider::before {
    content: " ";
    display: block;
    height: 1px;
    background-color: var(--divider-color);
    margin-left: 64px;
    margin-right: 24px;
  }

  .svg-action-button {
    height: var(--row-icon-button-height);
    width: var(--row-icon-button-height);
    color: var(
      --md-sys-color-on-secondary-container,
      var(--md-sys-color-on-secondary-container)
    ) !important;
  }
  .svg-action-button.expressive {
    color: var(--expressive-row-button-color-text);
  }
  .svg-action-button.expressive:hover {
    color: var(--expressive-row-button-color-text-hover);
  }

  .thumbnail {
    width: var(--media-row-thumbnail-height);
    height: var(--media-row-thumbnail-height);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left;
    border-radius: var(--media-row-thumbnail-border-radius);
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  .title {
    font-size: 1.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    color: var(--font-color);
    width: fit-content;
  }
  .title.expressive {
    font-family: var(--expressive-font-family);
    font-variation-settings: "ROND" 100;
    font-size: 1.3em;
    font-stretch: 25%;
    font-weight: 500;
    text-transform: uppercase;
  }
  .title-bars {
    display: flex;
    flex-direction: row;
    position: relative;
  }

  @keyframes player-active {
    0% {
      height: 4px;
      background-color: var(--start-color);
    }
    50% {
      height: 14px;
      background-color: var(--mid-color);
    }
    100% {
      height: 24px;
      background-color: var(--max-color);
    }
  }
`;const{AttributePart:vA,PropertyPart:fA,BooleanAttributePart:yA,EventPart:bA}=Ti,wA=e=>e,EA={h:wA`
      <img class="thumbnail" slot="start" loading="lazy">
    `,parts:[{type:1,index:0,name:"src",strings:["",""],ctor:vA},{type:1,index:0,name:"error",strings:["",""],ctor:bA}]},CA={h:wA`
      <span slot="headline">
        <div class="title-bars">
          <div>
            <?>
          </div>
          <div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
          </div>
        </div>
      </span>
    `,parts:[{type:1,index:1,name:"style",strings:["max-width: ",""],ctor:vA},{type:1,index:2,name:"class",strings:["title ",""],ctor:vA},{type:2,index:3},{type:1,index:4,name:"class",strings:[""," ",""],ctor:vA}]},IA={h:wA`<!--?-->`,parts:[]},BA={h:wA`
      <mpc-button role="tonal" size="small" elevation="1">
        <ha-svg-icon></ha-svg-icon>
      </mpc-button>
    `,parts:[{type:1,index:0,name:"onPressService",strings:["",""],ctor:fA},{type:1,index:0,name:"class",strings:["action-button ",""],ctor:vA},{type:1,index:1,name:"path",strings:["",""],ctor:fA},{type:1,index:1,name:"class",strings:["svg-action-button ",""],ctor:vA}]},xA={h:wA`<!--?-->`,parts:[]},PA={h:wA`
      <mpc-button role="tonal" size="small" elevation="1">
        <ha-svg-icon></ha-svg-icon>
      </mpc-button>
    `,parts:[{type:1,index:0,name:"onPressService",strings:["",""],ctor:fA},{type:1,index:0,name:"class",strings:["action-button ",""],ctor:vA},{type:1,index:1,name:"path",strings:["",""],ctor:fA},{type:1,index:1,name:"class",strings:["svg-action-button ",""],ctor:vA}]},DA={h:wA`
        <span slot="end" class="button-group">
          <?> <?>
        </span>
      `,parts:[{type:1,index:0,name:"click",strings:["",""],ctor:bA},{type:2,index:1},{type:2,index:2}]},SA={h:wA`<!--?-->`,parts:[]},kA={h:wA`
      <ha-md-list-item type="button">
        <?> <?>
        <?>
      </ha-md-list-item>
      <div class="divider"></div>
    `,parts:[{type:1,index:0,name:"class",strings:["button "," ",""],ctor:vA},{type:1,index:0,name:"click",strings:["",""],ctor:bA},{type:1,index:0,name:"disabled",strings:["",""],ctor:yA},{type:2,index:1},{type:2,index:2},{type:2,index:3}]};let RA=class extends me{constructor(){super(...arguments),this.joined=!1,this.selected=!1,this.canGroup=!1,this.allowJoin=!0,this.callOnPlayerSelectedService=()=>{this.player_entity?.entity_id&&Gr(this.hass,this.player_entity.entity_id)&&this.selectedService(this.player_entity.entity_id)},this.onJoinPressed=async e=>{navigator.vibrate&&navigator.vibrate(Pr.Players.ACTION_JOIN),e.stopPropagation();const t=this.joined?this.unjoinService:this.joinService;this.player_entity&&(await t([this.player_entity.entity_id]),this.joined=!this.joined)},this.onTransferPressed=e=>{e.stopPropagation(),navigator.vibrate&&navigator.vibrate(Pr.Players.ACTION_TRANSFER),this.player_entity&&this.transferService(this.player_entity.entity_id)},this._renderThumbnailFallback=e=>{const t=this.player_entity?.attributes,r=Tr(this.hass,ir.HEADPHONES),i=t?.entity_picture_local,s=t?.entity_picture??r,o=e.target.src==i?s:r;e.target.src=o??""}}set config(e){!Yr(this._config,e)&&e&&(this._config=e)}get config(){return this._config}set entityConfig(e){!Yr(this._entityConfig,e)&&e&&(this._entityConfig=e)}get entityConfig(){return this._entityConfig}set hass(e){this._hass=e}get hass(){return this._hass}set player_entity(e){e&&(this._player_entity=e)}get player_entity(){return this._player_entity}shouldUpdate(e){return e.size>0}renderThumbnail(){const e=this.player_entity?.attributes,t=Tr(this.hass,ir.HEADPHONES),r=e?.entity_picture_local,i=e?.entity_picture;return{_$litType$:EA,values:[r??i??t,this._renderThumbnailFallback]}}_calculateTitleWidth(){let e=0;if(!this.config)return;const t=this.hide;if(!t.join_button&&this.player_entity?.attributes.group_members&&this.allowJoin&&(e+=1),t.transfer_button||(e+=1),this.selected||t.action_buttons)return"100%;";const r=e-1;return`calc(100% - ( (32px * ${e.toString()}) + (8px * ${r.toString()}) + 16px));`}renderTitle(){let e=this.playerName;0===e.length&&(e=this.player_entity?.attributes.friendly_name??"Media Player");const t=Jr(this.hass,this.player_entity,this._entityConfig)&&"playing"==this.player_entity?.state?"audio-bars":"audio-bars-inactive",r=this.useExpressive?"expressive":"normal";return{_$litType$:CA,values:[this._calculateTitleWidth(),this.useExpressive?"expressive":"",e,t,r]}}renderTransferButton(){return this.hide.transfer_button?{_$litType$:IA,values:[]}:{_$litType$:BA,values:[this.onTransferPressed,this.useExpressive?"expressive":"",this.Icons.SWAP,this.useExpressive?"expressive":""]}}renderJoinButon(){return this.hide.join_button||!this.canGroup?{_$litType$:xA,values:[]}:this.player_entity?.attributes.group_members&&this.allowJoin?{_$litType$:PA,values:[this.onJoinPressed,this.useExpressive?"expressive":"",this.joined?this.Icons.LINK_OFF:this.Icons.LINK,this.useExpressive?"expressive":""]}:void 0}renderActionButtons(){return this.selected||this.hide.action_buttons?{_$litType$:SA,values:[]}:{_$litType$:DA,values:[e=>{e.stopPropagation()},this.renderJoinButon(),this.renderTransferButton()]}}render(){const e=this.selected?"active":"",t=this.useExpressive?"expressive":"",r=this.player_entity,i=Gr(this.hass,this.player_entity?.entity_id??""),s=!r||!i;return{_$litType$:kA,values:[e,t,this.callOnPlayerSelectedService,s,this.renderThumbnail(),this.renderTitle(),this.renderActionButtons()]}}static get styles(){return mA}};e([xe({attribute:!1})],RA.prototype,"joined",void 0),e([xe({attribute:!1})],RA.prototype,"selected",void 0),e([a({context:Ei})],RA.prototype,"Icons",void 0),e([a({context:bi,subscribe:!0})],RA.prototype,"useExpressive",void 0),e([xe({attribute:"can-group",type:Boolean})],RA.prototype,"canGroup",void 0),e([a({context:Mi,subscribe:!0})],RA.prototype,"hide",void 0),e([a({context:di,subscribe:!0})],RA.prototype,"config",null),e([a({context:_r,subscribe:!0})],RA.prototype,"entityConfig",null),e([a({context:Zr,subscribe:!0})],RA.prototype,"hass",null),e([xe({attribute:!1})],RA.prototype,"player_entity",null),RA=e([Ce("mpc-player-row")],RA);class QA{constructor(e){this.hass=e}set hass(e){e&&(this._hass=e)}get hass(){return this._hass}async actionTransferQueue(e,t){try{await this.hass.callService("music_assistant","transfer_queue",{entity_id:t,source_player:e})}catch(e){console.error("Error calling transfer player",e)}}async actionJoinPlayers(e,t){const r=this.hass.states[e],i=r.attributes.group_members?.filter(t=>t!=e),s=i?.concat(t);await this.hass.callService("media_player","join",{entity_id:e,group_members:s})}async actionUnjoinPlayers(e){await this.hass.callService("media_player","unjoin",{entity_id:e})}}const MA={action_buttons:!1,join_button:!1,transfer_button:!1,header_title:!1,header:!1},HA={enabled:!0,hide:MA},OA=["action_buttons","join_button","transfer_button"];function TA(e){let t=e.players;return t=function(e){return{...HA,...e}}(t),t=function(e){const t=e.hide;return{...e,hide:{...MA,...t}}}(t),{...e,players:t}}var LA=p`
  *[selected] {
    color: var(--accent-color);
  }
  *[hide] {
    display: none;
  }

  #container {
    overflow: hidden;
    width: 100%;
    justify-content: center;
    box-shadow: unset;
    height: 100%;
  }
  #container.expressive {
    border-radius: var(--expressive-border-radius-container);
    background-color: var(
      --expressive-color-container,
      var(--ha-card-background)
    );
  }

  .header {
    display: flex;
    flex-direction: column;
    font-size: 1.5rem;
    text-align: center;
    font-weight: 600;
    padding-top: 12px;
    height: auto;
  }

  .main {
    display: flex;
    height: 100%;
    margin: auto;
    padding: 6px 16px 6px 16px;
    width: 100%;
    justify-content: space-around;
    overflow-x: scroll;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
  }

  .list {
    overflow-y: scroll;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-left: 4px;
    padding-right: 4px;
    border-radius: var(--players-border-radius-expressive, 28px);
  }
  .list:not(.padded) {
    --queue-height: calc(100% - 3.5em);
    height: var(--queue-height);
  }
  .list.padded {
    --queue-height: 100%;
    height: var(--mass-player-card-height);
  }
  .list.expressive {
    background-color: var(--md-sys-color-background);
  }
  .list:not(.expressive) {
    border-radius: var(--players-border-radius, 12px);
  }

  .name {
    font-weight: 300;
    font-size: var(--fontSize);
    line-height: var(--fontSize);
    cursor: pointer;
  }
  .title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
  }
`;const{AttributePart:qA,PropertyPart:UA,BooleanAttributePart:FA}=Ti,VA=e=>e,zA={h:VA`<!--?-->`,parts:[]},JA={h:VA`
          <mpc-player-row>
          </mpc-player-row>
        `,parts:[{type:1,index:0,name:"player_entity",strings:["",""],ctor:UA},{type:1,index:0,name:"playerName",strings:["",""],ctor:UA},{type:1,index:0,name:"selected",strings:["",""],ctor:UA},{type:1,index:0,name:"selectedService",strings:["",""],ctor:UA},{type:1,index:0,name:"joinService",strings:["",""],ctor:UA},{type:1,index:0,name:"unjoinService",strings:["",""],ctor:UA},{type:1,index:0,name:"transferService",strings:["",""],ctor:UA},{type:1,index:0,name:"joined",strings:["",""],ctor:UA},{type:1,index:0,name:"allowJoin",strings:["",""],ctor:UA},{type:1,index:0,name:"can-group",strings:["",""],ctor:FA}]},YA={h:VA`<!--?-->`,parts:[]},NA={h:VA`
      <mpc-section-header>
        <span slot="label" id="title"> <?> </span>
      </mpc-section-header>
    `,parts:[{type:2,index:2}]},XA={h:VA`
      <div id="container">
        <?>
        <wa-animation id="animation" name="fadeIn" easing="ease-in" iterations="1" playback-rate="4">
          <div>
            <?>
          </div>
        </wa-animation>
      </div>
    `,parts:[{type:1,index:0,name:"class",strings:["",""],ctor:qA},{type:2,index:1},{type:1,index:2,name:"play",strings:["",""],ctor:qA},{type:1,index:3,name:"class",strings:["list "," ",""],ctor:qA},{type:2,index:4}]};let jA=class extends me{constructor(){super(...arguments),this.entities=[],this._firstLoaded=!1,this.joinPlayers=async e=>{this.actions&&await this.actions.actionJoinPlayers(this.activePlayerEntity.entity_id,e)},this.unjoinPlayers=async e=>{this.actions&&await this.actions.actionUnjoinPlayers(e)},this.transferQueue=async e=>{if(!this.actions)return;await this.actions.actionTransferQueue(this.activePlayerEntity.entity_id,e);const t=this.config.entities.find(t=>t.entity_id==e);this.activePlayerEntity=t,this.selectedPlayerService(e)}}set config(e){e&&(this._hass&&this.setEntities(this._hass),this._config={...HA,...e},this._sectionConfig=this._config.players)}get config(){return this._config}set hass(e){if(!e)return;if(this._hass=e,this.actions?this.actions.hass=e:this.actions=new QA(e),0===this.entities.length)return void this.setEntities(e);let t=!1;this.entities.forEach(r=>{e.states[r.entity_id]!==r&&(t=!0)}),t&&this.setEntities(e)}get hass(){return this._hass}setEntities(e){if(!this._config)return;const t=[];this._config.entities.forEach(r=>{const i=e.states[r.entity_id];i&&t.push(i)}),this.entities=t}hideSectionHeader(){return this.config?.players.hide.header??!1}renderPlayerRows(){if(!this._hass||!this.controller.ActivePlayer)return{_$litType$:zA,values:[]};const e=this._hass.states[this.activePlayerEntity.entity_id]?.attributes,t=e?.group_members??[],r=this.controller.ActivePlayer.canGroupWith;return this.entities.map(i=>{const s=this.config.entities.find(e=>e.entity_id==i.entity_id),o=void 0!==e?.group_members;return gA(i.entity_id,{_$litType$:JA,values:[i,s.name,this.activePlayerEntity.entity_id==i.entity_id,this.selectedPlayerService,this.joinPlayers,this.unjoinPlayers,this.transferQueue,t.includes(i.entity_id),o,r.includes(s.entity_id)]})})}renderHeader(){if(this.hideSectionHeader())return{_$litType$:YA,values:[]};const e=cr("players.header",this.hass),t=this.config?.players.hide.header_title?"":e;return{_$litType$:NA,values:[t]}}render(){const e=this.config?.expressive?"expressive":"",t=this.hideSectionHeader()?"padded":"";return{_$litType$:XA,values:[e,this.renderHeader(),this.checkVisibility(),e,t,this.renderPlayerRows()]}}connectedCallback(){super.connectedCallback(),this._animation&&this._firstLoaded&&(this._animation.play=!0),0==this.controller.ActivePlayer?.canGroupWith.length&&setTimeout(()=>{this.requestUpdate("update-groups",!0)},1e3)}firstUpdated(){this._firstLoaded=!0}shouldUpdate(e){return e.size>0}static get styles(){return LA}};e([xe({attribute:!1})],jA.prototype,"entities",void 0),e([a({context:_r,subscribe:!0}),xe({attribute:!1})],jA.prototype,"activePlayerEntity",void 0),e([a({context:mi,subscribe:!0})],jA.prototype,"controller",void 0),e([Se("#animation")],jA.prototype,"_animation",void 0),e([n({context:di})],jA.prototype,"_sectionConfig",void 0),e([xe({attribute:!1})],jA.prototype,"config",null),e([a({context:Zr,subscribe:!0})],jA.prototype,"hass",null),jA=e([Ce("mpc-players-card")],jA);var KA=p`
  a.active {
    --primary-container: var(--tab-active-indicator-color);
  }
  :is(nav.tabbed > a, .tabs > a):is(:hover)::after {
    opacity: 0 !important;
  }
  .action-button-svg {
    --icon-primary-color: var(--tab-active-icon-color);
    height: var(--tab-icon-height);
    width: var(--tab-icon-height);
  }
  .action-button-svg.inactive {
    --icon-primary-color: var(--tab-inactive-icon-color);
    height: var(--tab-icon-height);
    width: var(--tab-icon-height);
  }

  .icon-i {
    height: 100%;
    width: 100%;
  }

  nav {
    height: var(--navbar-height);
  }
  nav.tabbed {
    background-color: var(--tabbed-background-color);
  }
  .player-tabs {
    --primary-container: rgba(from var(--primary-color) r g b / 0.25);
    z-index: 2;
  }
  #tab-indicator {
    height: 100%;
    max-height: var(--navbar-height);
    position: absolute;
    box-shadow: var(--md-sys-elevation-level2);
    background-color: var(--md-sys-color-secondary-container);
    z-index: 1;
    will-change: transform;
    border-radius: var(--default-border-radius);
  }
  .tabbed {
    --tabbed-elevation: var(--md-sys-elevation-level1);
    --tab-active-icon-color: var(--md-sys-color-on-secondary-container);
    --tab-active-indicator-color: var(--md-sys-color-secondary-container);
    --tab-inactive-icon-color: var(--md-sys-color-on-surface-variant);
    --tab-icon-height: 24px;
  }
  .tabbed:not(.expressive) {
    --tabbed-background-color: var(--tabbed-background-color);
  }
  .tabbed.expressive {
    --tabbed-background-color: var(--md-sys-color-surface-container) !important;
    box-shadow: var(--tabbed-elevation);
  }
`;const{AttributePart:GA,PropertyPart:WA,EventPart:ZA}=Ti,_A=e=>e,$A={h:_A`<!--?-->`,parts:[]},ed={h:_A`<!--?-->`,parts:[]},td={h:_A`<!--?-->`,parts:[]},rd={h:_A`<!--?-->`,parts:[]},id={h:_A`
      <a class="player-tabs">
        <i>
          <ha-svg-icon></ha-svg-icon>
        </i>
      </a>
    `,parts:[{type:1,index:0,name:"id",strings:["tab-",""],ctor:GA},{type:1,index:0,name:"click",strings:["",""],ctor:ZA},{type:1,index:1,name:"class",strings:["icon-i ",""],ctor:GA},{type:1,index:2,name:"path",strings:["",""],ctor:WA},{type:1,index:2,name:"class",strings:["action-button-svg ",""],ctor:GA}]},sd={h:_A`
      <div>
        <nav id="navigation" class="tabbed expressive">
          <link href="https://cdn.jsdelivr.net/npm/beercss@4.0.20/dist/cdn/beer.min.css" rel="stylesheet">
          <?> <?>
          <?> <?>
        </nav>
      </div>
    `,parts:[{type:2,index:3},{type:2,index:4},{type:2,index:5},{type:2,index:6}]};let od=class extends me{constructor(){super(...arguments),this.animationLength=350,this.animating=!1,this.tabIndicatorLeftPx=0,this.tabIndicatorWidthPx=0,this.handleTabChanged=e=>{const t=this.active_section;t&&this.animateTabChange(t,e),this.setActiveSection(e),e==rr.MEDIA_BROWSER&&this.returnMediaBrowserToHome(),e==rr.QUEUE&&this.returnQueueToActive()},this.returnQueueToActive=()=>{const e=this.controller?.host,t=e?.shadowRoot?.querySelector("mpc-queue-card");t&&t.scrollToActive()},this.returnMediaBrowserToHome=()=>{const e=this.controller?.host,t=e?.shadowRoot?.querySelector("mpc-media-browser");t&&t.resetActiveSections()},this.onAnimationFinish=()=>{this.animating=!1,this.tabIndicator&&(this.tabIndicator.style.left=`${this.tabIndicatorLeftPx.toString()}px`,this.tabIndicator.style.width=`${this.tabIndicatorWidthPx.toString()}px`)}}set active_section(e){this.controller&&(e!=this.active_section&&e&&this.handleTabChanged(e),this._activeSection=e)}get active_section(){return this._activeSection}setActiveSection(e){this.controller&&(this.controller.activeSection=e)}set controller(e){e&&(this._controller=e,this.active_section=e.activeSection,this.config=e.config)}get controller(){return this._controller}set config(e){this._config=e}get config(){return this._config}getSectionElement(e){return{"media-browser":this.browserTab,"music-player":this.playerTab,queue:this.queueTab,players:this.playersTab}[e]}animateBounceLeft(e,t){const r=e.offsetLeft,i=e.offsetWidth,s=t.offsetLeft,o=t.offsetWidth,n=.2*o,a=Math.max(0,s-n),l=(a>0?o:o-n)/i;return{transform:`translateX(${(a-r-(0==s?n/2:0)).toString()}px) scaleX(${l.toString()})`,offset:.8}}animateBounceRight(e,t){const r=e.offsetLeft,i=e.offsetWidth,s=t.offsetLeft,o=t.offsetWidth,n=.2*o,a=this.navbar?.offsetWidth??0,l=s+o,c=s+n,A=(l>=a?a-c:o)/i;return{transform:`translateX(${(c-r-(l>=a?n/2:0)).toString()}px) scaleX(${A.toString()})`,offset:.8}}animateTabChange(e,t){if(this.animating=!0,e==t)return;const r=this.getSectionElement(e),i=this.getSectionElement(t);if(!r||!i)return;const s=r.offsetWidth,o=r.offsetLeft,n=i.offsetWidth,a=i.offsetLeft,l=o-a>0?this.animateBounceLeft(r,i):this.animateBounceRight(r,i),c=a-o,A=n/s,d=[{transform:`translateX(${c.toString()}px) scaleX(${A.toString()})`,offset:.6},l,{transform:`translateX(${c.toString()}px) scaleX(${A.toString()})`}],u=this.tabIndicator;this.animationElement&&u&&(this.animationElement.keyframes=d,this.tabIndicatorLeftPx=a,this.tabIndicatorWidthPx=n,this.animationElement.addEventListener("wa-finish",this.onAnimationFinish),this.animationElement.play=!0)}renderMusicPlayerTab(){const e=rr.MUSIC_PLAYER,t=this.Icons.MUSIC;return this.config?.player.enabled?this.renderTab(e,t):{_$litType$:$A,values:[]}}renderQueueTab(){const e=rr.QUEUE,t=this.Icons.PLAYLIST;return this.config?.queue.enabled?this.renderTab(e,t):{_$litType$:ed,values:[]}}renderMediaBrowserTab(){const e=rr.MEDIA_BROWSER,t=this.Icons.ALBUM;return this.config?.media_browser.enabled?this.renderTab(e,t):{_$litType$:td,values:[]}}renderPlayersTab(){const e=rr.PLAYERS,t=this.Icons.SPEAKER_MULTIPLE;return this.config?.players.enabled?this.renderTab(e,t):{_$litType$:rd,values:[]}}renderTab(e,t){const r=this.active_section==e;return{_$litType$:id,values:[e,()=>{this.handleTabChanged(e)},r?"active":"",t,r?"":"inactive"]}}render(){return{_$litType$:sd,values:[this.renderMusicPlayerTab(),this.renderQueueTab(),this.renderMediaBrowserTab(),this.renderPlayersTab()]}}shouldUpdate(e){return!!this.config&&e.size>0}firstUpdated(){if(!this.tabIndicator&&this.active_section){const e=this.navbar?.querySelectorAll("a").length??0,t=Math.round(1/Math.max(1,e)*100),r=document.createElement("div");r.id="tab-indicator";const i=this.config;if(!i)return;const s=[];i.player.enabled&&s.push(rr.MUSIC_PLAYER),i.queue.enabled&&s.push(rr.QUEUE),i.media_browser.enabled&&s.push(rr.MEDIA_BROWSER),i.players.enabled&&s.push(rr.PLAYERS);const o=this.active_section,n=s.findIndex(e=>e==o);if(!n&&0!=n)return;const a=n/s.length*100;r.style=`left: ${a.toString()}%; width: ${t.toString()}%;`;const l=document.createElement("wa-animation");l.id="animation",l.duration=this.animationLength,l.iterations=1,l.append(r),this.navbar?.append(l)}}disconnectedCallback(){super.disconnectedCallback(),this.animationElement&&this.animationElement.removeEventListener("wa-finish",this.onAnimationFinish)}static get styles(){return KA}};e([a({context:Ei})],od.prototype,"Icons",void 0),e([Se("#tab-music-player")],od.prototype,"playerTab",void 0),e([Se("#tab-queue")],od.prototype,"queueTab",void 0),e([Se("#tab-media-browser")],od.prototype,"browserTab",void 0),e([Se("#tab-players")],od.prototype,"playersTab",void 0),e([Se("#tab-indicator")],od.prototype,"tabIndicator",void 0),e([Se("#animation")],od.prototype,"animationElement",void 0),e([Se("#navigation")],od.prototype,"navbar",void 0),e([Se(".icon-active")],od.prototype,"activeIconElem",void 0),e([a({context:ui,subscribe:!0}),Pe()],od.prototype,"active_section",null),e([a({context:mi,subscribe:!0})],od.prototype,"controller",null),od=e([Ce("mpc-navbar-expressive")],od);const{AttributePart:nd,PropertyPart:ad,EventPart:ld}=Ti,cd=e=>e,Ad={h:cd`<!--?-->`,parts:[]},dd={h:cd`<!--?-->`,parts:[]},ud={h:cd`<!--?-->`,parts:[]},hd={h:cd`<!--?-->`,parts:[]},pd={h:cd`
      <a>
        <i class="icon-i">
          <ha-svg-icon></ha-svg-icon>
        </i>
        <span></span>
      </a>
    `,parts:[{type:1,index:0,name:"class",strings:[""," player-tabs"],ctor:nd},{type:1,index:0,name:"click",strings:["",""],ctor:ld},{type:1,index:2,name:"path",strings:["",""],ctor:ad},{type:1,index:2,name:"class",strings:["action-button-svg ",""],ctor:nd}]},gd={h:cd`
      <div>
        <nav class="tabbed">
          <link href="https://cdn.jsdelivr.net/npm/beercss@4.0.20/dist/cdn/beer.min.css" rel="stylesheet">
          <?> <?>
          <?> <?>
        </nav>
      </div>
    `,parts:[{type:2,index:3},{type:2,index:4},{type:2,index:5},{type:2,index:6}]};let md=class extends me{constructor(){super(...arguments),this.handleTabChanged=e=>{e&&this.controller&&(this.controller.activeSection=e)},this.returnMediaBrowserToHome=()=>{if(!this.controller)return;const e=this.controller.host,t=e.shadowRoot?.querySelector("mpc-media-browser");t&&t.resetActiveSections()}}set active_section(e){this.controller&&(this._activeSection=e)}get active_section(){return this._activeSection}set controller(e){e&&(this._controller=e,e.activeSection&&(this.active_section=e.activeSection),e.config&&(this.config=e.config))}get controller(){return this._controller}set config(e){this._config=e}get config(){return this._config}renderMusicPlayerTab(){const e=rr.MUSIC_PLAYER,t=this.Icons.MUSIC;return this.config?.player.enabled?this.renderTab(e,t):{_$litType$:Ad,values:[]}}renderQueueTab(){const e=rr.QUEUE,t=this.Icons.PLAYLIST;return this.config?.queue.enabled?this.renderTab(e,t):{_$litType$:dd,values:[]}}renderMediaBrowserTab(){const e=rr.MEDIA_BROWSER,t=this.Icons.ALBUM;return this.config?.media_browser.enabled?this.renderTab(e,t):{_$litType$:ud,values:[]}}renderPlayersTab(){const e=rr.PLAYERS,t=this.Icons.SPEAKER_MULTIPLE;return this.config?.players.enabled?this.renderTab(e,t):{_$litType$:hd,values:[]}}renderTab(e,t){const r=this.active_section==e;return{_$litType$:pd,values:[r?"active":"",()=>{this.handleTabChanged(e)},t,r?"":"inactive"]}}render(){return{_$litType$:gd,values:[this.renderMusicPlayerTab(),this.renderQueueTab(),this.renderMediaBrowserTab(),this.renderPlayersTab()]}}shouldUpdate(e){return e.size>0}static get styles(){return KA}};e([a({context:Ei})],md.prototype,"Icons",void 0),e([a({context:ui,subscribe:!0}),Pe()],md.prototype,"active_section",null),e([a({context:mi,subscribe:!0})],md.prototype,"controller",null),md=e([Ce("mpc-navbar")],md);const vd={queue:_c,player:gl,players:HA,media_browser:ws,expressive:!0,expressive_scheme:"expressive",entities:[],download_local:!1,proxy_all_artwork:!1,panel:!1,default_section:void 0,sync_player_across_dashboard:!1},fd={player:ul,queue:Zc,media_browser:vs,players:MA};function yd(e){if("string"==typeof e)return{entity_id:t=e,volume_entity_id:t,name:"",max_volume:100,hide:fd,inactive_when_idle:!1,inactive_when_not_updated:!0};var t;const r=function(e){const t=e?.hide,r={...fd,...t};return r.player={...ul,...r?.player},r}(e);return{entity_id:e.entity_id,volume_entity_id:e?.volume_entity_id??e.entity_id,name:e?.name??"",max_volume:e?.max_volume??100,hide:r,inactive_when_idle:e?.inactive_when_idle??!1,inactive_when_not_updated:e?.inactive_when_not_updated??!0}}function bd(e){return e=TA(e=tA(e=yl(e=Bs(e=function(e){const t=e.entities,r=[];return t.forEach(e=>{r.push(yd(e))}),{...e,entities:r}}(e=function(e){return{...vd,...e}}(e))))))}var wd=p`
  :host {
    --mass-player-card-height: var(--mass-player-card-section-height, 40em);

    --artwork-large-height: var(
      --mass-player-card-artwork-large-height,
      var(--mass-player-card-height)
    ) !important;
    --artwork-medium-height: var(
      --mass-player-card-artwork-medium-height,
      22em
    ) !important;
    --artwork-small-height: var(
      --mass-player-card-artwork-small-height,
      14em
    ) !important;

    --audio-bars-color: var(
      --mass-player-card-audio-bars-color,
      var(--secondary-text-color)
    );
    --expressive-audio-bars-initial-color: var(
      --mass-player-card-audio-bars-initial-color,
      var(--md-sys-color-tertiary)
    );
    --expressive-audio-bars-middle-color: var(
      --mass-player-card-audio-bars-middle-color,
      var(--md-sys-color-secondary)
    );
    --expressive-audio-bars-max-color: var(
      --mass-player-card-audio-bars-max-color,
      var(--md-sys-color-primary)
    );

    --default-border-radius: var(
      --mass-player-card-default-border-radius,
      28px
    );
    --artwork-border-radius: var(
      --mass-player-card-artwork-border-radius,
      var(--default-border-radius)
    );
    --browser-card-border-radius: var(
      --mass-player-card-browser-card-border-radius,
      var(--default-border-radius)
    );
    --players-border-radius: var(
      --mass-player-card-players-border-radius,
      0.7em
    );
    --players-border-radius-expressive: var(
      --mass-player-card-players-border-radius,
      var(--default-border-radius)
    );
    --queue-border-radius: var(--mass-player-card-queue-border-radius, 0.7em);
    --queue-border-radius-expressive: var(
      --mass-player-card-queue-border-radius,
      var(--default-border-radius)
    );
    --media-row-thumbnail-border-radius: var(
      --mass-player-card-media-row-thumbnail-border-radius,
      50%
    );
    --media-row-border-radius: var(
      --mass-player-card-media-row-border-radius,
      0.7em
    );
    --player-row-border-radius: var(
      --mass-player-card-player-row-border-radius,
      0.7em
    );

    --button-small-border-radius: var(
      --mass-player-card-small-button-border-radius,
      50%
    );

    --expressive-border-radius-container: var(
      --mass-player-card-expressive-border-radius-container,
      var(--default-border-radius)
    );

    --expressive-color-container: var(
      --mass-player-card-expressive-color-container,
      var(--md-sys-color-primary-container)
    );

    --expressive-row-color: var(
      --mass-player-card-expressive-row-color,
      var(--md-sys-color-surface)
    );
    --expressive-row-color-text: var(
      --mass-player-card-expressive-row-color-text,
      var(--md-sys-color-on-background)
    );
    --expressive-row-active-color: var(
      --mass-player-card-expressive-row-active-color,
      var(--md-sys-color-secondary-container)
    );
    --expressive-row-active-color-text: var(
      --mass-player-card-expressive-row-active-color-text,
      var(--md-sys-color-on-secondary-container)
    );

    --expressive-row-button-color-text: var(
      --mass-player-card-expressive-row-button-color-text,
      var(--md-sys-color-on-secondary-container)
    );
    --expressive-row-button-color-hover: var(
      --mass-player-card-expressive-row-button-color-hover,
      rgba(from var(--expressive-row-button-color-hover) r g b / 0.38)
        !important
    );
    --expressive-row-button-color-text-hover: var(
      --mass-player-card-expressive-row-button-color-text-hover,
      var(--md-sys-color-on-secondary-container)
    );

    --media-row-active-background-color: var(
      --mass-player-card-media-row-active-background-color,
      var(--table-row-alternative-background-color)
    );
    --media-row-height: var(--mass-player-card-media-row-height, 56px);
    --media-row-thumbnail-height: var(
      --mass-player-card-media-row-thumbnail-height,
      var(--media-row-height)
    );

    --player-blur-color: rgba(
      from var(--mass-player-card-player-blur-color, var(--ha-card-background))
        r g b / 0.6
    );
    --expressive-player-blur-color: rgba(
      from
        var(
          --mass-player-card-expressive-player-blur-color,
          var(--md-sys-color-primary-container)
        )
        r g b / 0.6
    ) !important;

    --player-control-icon-width: var(
      --mass-player-card-player-control-icon-width,
      30px
    );
    --player-volume-slider-height: var(
      --mass-player-card-player-volume-slider-height,
      40px
    );

    --player-name-color: var(
      --mass-player-card-player-name-color,
      var(--ha-color-text-secondary)
    );

    --player-play-pause-icon-size: var(
      --mass-player-card-player-play-pause-icon-size,
      6rem
    );

    --row-icon-button-height: var(
      --mass-player-card-row-icon-button-height,
      1.5rem
    );
    --navbar-height: 4em;
    --search-text-color: var(
      --mass-player-card-search-text-color,
      var(--ha-color-text-primary)
    );
    --search-placeholder-text-color: var(
      --mass-player-card-search-placeholder-text-color,
      var(--ha-color-neutral-50)
    );
    --player-control-icon-color: var(
      --mass-player-card-player-control-icon-color,
      var(--icon-primary-color, currentcolor)
    );
    --player-control-text-color: var(
      --mass-player-card-player-control-text-color,
      var(--primary-text-color)
    );

    --player-button-play-pause-icon-color: var(
      --mass-player-card-player-button-play-pause-icon-color,
      var(--player-control-icon-color)
    );
    --player-button-play-pause-text-color: var(
      --mass-player-card-player-button-play-pause-text-color,
      var(--player-control-text-color)
    );

    --player-button-play-icon-color: var(
      --mass-player-card-player-button-play-icon-color,
      var(--player-button-play-pause-icon-color)
    );
    --player-button-play-text-color: var(
      --mass-player-card-player-button-play-text-color,
      var(--player-button-play-pause-text-color)
    );
    --player-button-pause-icon-color: var(
      --mass-player-card-player-button-pause-icon-color,
      var(--player-button-play-pause-icon-color)
    );
    --player-button-pause-text-color: var(
      --mass-player-card-player-button-pause-text-color,
      var(--player-button-play-pause-text-color)
    );

    --player-button-previous-icon-color: var(
      --mass-player-card-player-button-previous-icon-color,
      var(--player-control-icon-color)
    );
    --player-button-previous-text-color: var(
      --mass-player-card-player-button-previous-text-color,
      var(--player-control-text-color)
    );

    --player-button-next-icon-color: var(
      --mass-player-card-player-button-next-icon-color,
      var(--player-control-icon-color)
    );
    --player-button-next-text-color: var(
      --mass-player-card-player-button-next-text-color,
      var(--player-control-text-color)
    );

    --player-button-shuffle-icon-color: var(
      --mass-player-card-player-button-shuffle-icon-color,
      var(--player-control-icon-color)
    );
    --player-button-shuffle-text-color: var(
      --mass-player-card-player-button-shuffle-text-color,
      var(--player-control-text-color)
    );

    --player-button-repeat-icon-color: var(
      --mass-player-card-player-button-repeat-icon-color,
      var(--player-control-icon-color)
    );
    --player-button-repeat-text-color: var(
      --mass-player-card-player-button-repeat-text-color,
      var(--player-control-text-color)
    );

    --player-button-power-icon-color: var(
      --mass-player-card-player-button-power-icon-color,
      var(--player-control-icon-color)
    );
    --player-button-power-text-color: var(
      --mass-player-card-player-button-power-text-color,
      var(--player-control-text-color)
    );

    --player-button-favorite-icon-color: var(
      --mass-player-card-player-button-favorite-icon-color,
      var(--player-control-icon-color)
    );
    --player-button-favorite-text-color: var(
      --mass-player-card-player-button-favorite-text-color,
      var(--player-control-text-color)
    );

    --player-button-mute-icon-color: var(
      --mass-player-card-player-button-mute-icon-color,
      var(--player-control-icon-color)
    );

    --browser-button-enqueue-menu-icon-primary-color: var(
      --mass-player-card-browser-enqueue-menu-icon-primary-color,
      var(--md-sys-color-primary)
    );
    --browser-button-enqueue-menu-icon-secondary-color: var(
      --mass-player-card-browser-enqueue-menu-icon-secondary-color,
      var(--ha-card-background, var(--card-background-color, #fff))
    );

    --md-sys-elevation-level0: none;
    --md-sys-elevation-level1:
      rgba(from #000000 r g b / 0.2) 0px 2px 1px -1px,
      rgba(from #000000 r g b / 0.14) 0px 1px 1px 0px,
      rgba(from #000000 r g b / 0.12) 0px 1px 3px 0px;
    --md-sys-elevation-level2:
      rgba(from #000000 r g b / 0.2) 0px 3px 3px -2px,
      rgba(from #000000 r g b / 0.14) 0px 3px 4px 0px,
      rgba(from #000000 r g b / 0.12) 0px 1px 8px 0px;
    --md-sys-elevation-level3:
      rgba(from #000000 r g b / 0.2) 0px 3px 5px -1px,
      rgba(from #000000 r g b / 0.14) 0px 6px 10px 0px,
      rgba(from #000000 r g b / 0.12) 0px 1px 18px 0px;
    --md-sys-elevation-level4:
      rgba(from #000000 r g b / 0.2) 0px 5px 5px -3px,
      rgba(from #000000 r g b / 0.14) 0px 8px 10px 1px,
      rgba(from #000000 r g b / 0.12) 0px 3px 14px 2px;
    --md-sys-elevation-level5:
      rgba(from #000000 r g b / 0.2) 0px 7px 8px -4px,
      rgba(from #000000 r g b / 0.14) 0px 12px 17px 2px,
      rgba(from #000000 r g b / 0.12) 0px 5px 22px 4px;
    --expressive-font-family:
      "Google Sans Flex", "Roboto Flex", var(--ha-font-family-body), "Roboto",
      sans-serif !important;
  }

  ha-card {
    max-width: var(--mass-player-card-max-width, 100%);
    border-radius: var(--default-border-radius);
    font-family: "Roboto" sans-serif !important;
    height: calc(var(--mass-player-card-height) + var(--navbar-height));
  }
  ha-card#expressive {
    background-color: var(--md-sys-color-background, var(--ha-card-background));
    font-family: var(--expressive-font-family);
  }

  #navbar.expressive {
    border-radius: 0px 0px var(--default-border-radius)
      var(--default-border-radius);
  }
  #navbar {
    position: absolute;
    bottom: 0;
    width: 100%;
  }
  #navbar:not(.expressive) {
    border-radius: var(--default-border-radius);
    background-color: var(--card-background-color);
  }

  .section.hidden {
    display: none;
  }
`,Ed=p`
  /*Fonts */

  /* Roboto Flex */
  @font-face {
    font-family: "Roboto Flex";
    font-style: normal;
    font-display: swap;
    font-weight: 100 700;
    src: url(https://fonts.gstatic.com/s/robotoflex/v30/NaN4epOXO_NexZs0b5QrzlOHb8wCikXpYqmZsWI-__OGbt8jZktqc2V3Zs0KvDLdBP8SBZtOs2IifRuUZQMsPJtUsR4DEK6cULNeUx9XgTnH37Ha_FIAp4Fm0PP1hw45DntW2x0wZGzhPmr1YNMYKYn9_1IQXGwJAiUJVUMdN5YUW4O8HtSoXjC1z3QSabshNFVe3e0O5j3ZjrZCu23Qd4G0EBysQNK-QKavMl12JoUc.woff2)
      format("woff2");
    unicode-range:
      U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
      U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
      U+2212, U+2215, U+FEFF, U+FFFD;
  }
  /* Google Sans Flex */
  @font-face {
    font-family: "Google Sans Flex";
    font-style: normal;
    font-weight: 200 900;
    font-stretch: 25% 151%;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/googlesansflex/v16/t5tQIQcYNIWbFgDgAAzZ34auoVyXkJCOvp3SFWJbN5hF8Ju1x5Vwd0N3l9sIcwowNJwGpVd4AZzz0v6lDYatsQ.woff2)
      format("woff2");
    unicode-range:
      U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
      U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
      U+2212, U+2215, U+FEFF, U+FFFD;
  }
`;const Cd={ARTIST:"M11,14C12,14 13.05,14.16 14.2,14.44C13.39,15.31 13,16.33 13,17.5C13,18.39 13.25,19.23 13.78,20H3V18C3,16.81 3.91,15.85 5.74,15.12C7.57,14.38 9.33,14 11,14M11,12C9.92,12 9,11.61 8.18,10.83C7.38,10.05 7,9.11 7,8C7,6.92 7.38,6 8.18,5.18C9,4.38 9.92,4 11,4C12.11,4 13.05,4.38 13.83,5.18C14.61,6 15,6.92 15,8C15,9.11 14.61,10.05 13.83,10.83C13.05,11.61 12.11,12 11,12M18.5,10H20L22,10V12H20V17.5A2.5,2.5 0 0,1 17.5,20A2.5,2.5 0 0,1 15,17.5A2.5,2.5 0 0,1 17.5,15C17.86,15 18.19,15.07 18.5,15.21V10Z",ALBUM:os,ARROW_DOWN:"M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",ARROW_LEFT:"M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",ARROW_PLAY_NEXT:"M4.08,11.92L12,4L19.92,11.92L18.5,13.33L13,7.83V22H11V7.83L5.5,13.33L4.08,11.92M12,4H22V2H2V4H12Z",ARROW_UP:"M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",ASLEEP:"M23,12H17V10L20.39,6H17V4H23V6L19.62,10H23V12M15,16H9V14L12.39,10H9V8H15V10L11.62,14H15V16M7,20H1V18L4.39,14H1V12H7V14L3.62,18H7V20Z",BOOK:"M18,22A2,2 0 0,0 20,20V4C20,2.89 19.1,2 18,2H12V9L9.5,7.5L7,9V2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18Z",CLEAR:"M14 10H3V12H14V10M14 6H3V8H14V6M3 16H10V14H3V16M14.4 22L17 19.4L19.6 22L21 20.6L18.4 18L21 15.4L19.6 14L17 16.6L14.4 14L13 15.4L15.6 18L13 20.6L14.4 22Z",CLOSE:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",FILTER:"M6,13H18V11H6M3,6V8H21V6M10,18H14V16H10V18Z",HEART:as,HEART_ALT:as,HEART_PLUS:"M12.67 20.74L12 21.35L10.55 20.03C5.4 15.36 2 12.27 2 8.5C2 5.41 4.42 3 7.5 3C9.24 3 10.91 3.81 12 5.08C13.09 3.81 14.76 3 16.5 3C19.58 3 22 5.41 22 8.5C22 9.93 21.5 11.26 20.62 12.61C20 12.31 19.31 12.11 18.59 12.04C19.5 10.8 20 9.65 20 8.5C20 6.5 18.5 5 16.5 5C14.96 5 13.46 6 12.93 7.36H11.07C10.54 6 9.04 5 7.5 5C5.5 5 4 6.5 4 8.5C4 11.39 7.14 14.24 11.89 18.55L12 18.65L12.04 18.61C12.12 19.37 12.34 20.09 12.67 20.74M17 14V17H14V19H17V22H19V19H22V17H19V14H17Z",LIBRARY:"M12,8A3,3 0 0,0 15,5A3,3 0 0,0 12,2A3,3 0 0,0 9,5A3,3 0 0,0 12,8M12,11.54C9.64,9.35 6.5,8 3,8V19C6.5,19 9.64,20.35 12,22.54C14.36,20.35 17.5,19 21,19V8C17.5,8 14.36,9.35 12,11.54Z",LIBRARY_OUTLINED:"M12 14.27L10.64 13C9.09 11.57 7.16 10.57 5 10.18V17.13C7.61 17.47 10 18.47 12 19.95C14 18.47 16.39 17.47 19 17.13V10.18C16.84 10.57 14.91 11.57 13.36 13M19 8.15C19.65 8.05 20.32 8 21 8V19C17.5 19 14.36 20.35 12 22.54C9.64 20.35 6.5 19 3 19V8C3.68 8 4.35 8.05 5 8.15C7.69 8.56 10.1 9.78 12 11.54C13.9 9.78 16.31 8.56 19 8.15M12 6C12.27 6 12.5 5.9 12.71 5.71C12.9 5.5 13 5.27 13 5S12.9 4.5 12.71 4.29C12.5 4.11 12.27 4 12 4S11.5 4.11 11.29 4.29C11.11 4.5 11 4.74 11 5S11.11 5.5 11.29 5.71C11.5 5.9 11.74 6 12 6M14.12 7.12C13.56 7.68 12.8 8 12 8S10.44 7.68 9.88 7.12C9.32 6.56 9 5.8 9 5S9.32 3.44 9.88 2.88C10.44 2.32 11.2 2 12 2S13.56 2.32 14.12 2.88 15 4.2 15 5 14.68 6.56 14.12 7.12Z",LINK:"M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z",LINK_OFF:"M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.43 19.12,14.63 17.79,15L19.25,16.44C20.88,15.61 22,13.95 22,12A5,5 0 0,0 17,7M16,11H13.81L15.81,13H16V11M2,4.27L5.11,7.38C3.29,8.12 2,9.91 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12C3.9,10.41 5.11,9.1 6.66,8.93L8.73,11H8V13H10.73L13,15.27V17H14.73L18.74,21L20,19.74L3.27,3L2,4.27Z",MUSIC:cs,OVERFLOW:"M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",PAUSE:"M14,19H18V5H14M6,19H10V5H6V19Z",PLAY:"M8,5.14V19.14L19,12.14L8,5.14Z",PLAY_CIRCLE:"M10,16.5V7.5L16,12M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",PLAY_CIRCLE_OUTLINE:"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M10,16.5L16,12L10,7.5V16.5Z",PLAYLIST:As,PLAYLIST_PLUS:"M3 16H10V14H3M18 14V10H16V14H12V16H16V20H18V16H22V14M14 6H3V8H14M14 10H3V12H14V10Z",PODCAST:"M17,18.25V21.5H7V18.25C7,16.87 9.24,15.75 12,15.75C14.76,15.75 17,16.87 17,18.25M12,5.5A6.5,6.5 0 0,1 18.5,12C18.5,13.25 18.15,14.42 17.54,15.41L16,14.04C16.32,13.43 16.5,12.73 16.5,12C16.5,9.5 14.5,7.5 12,7.5C9.5,7.5 7.5,9.5 7.5,12C7.5,12.73 7.68,13.43 8,14.04L6.46,15.41C5.85,14.42 5.5,13.25 5.5,12A6.5,6.5 0 0,1 12,5.5M12,1.5A10.5,10.5 0 0,1 22.5,12C22.5,14.28 21.77,16.39 20.54,18.11L19.04,16.76C19.96,15.4 20.5,13.76 20.5,12A8.5,8.5 0 0,0 12,3.5A8.5,8.5 0 0,0 3.5,12C3.5,13.76 4.04,15.4 4.96,16.76L3.46,18.11C2.23,16.39 1.5,14.28 1.5,12A10.5,10.5 0 0,1 12,1.5M12,9.5A2.5,2.5 0 0,1 14.5,12A2.5,2.5 0 0,1 12,14.5A2.5,2.5 0 0,1 9.5,12A2.5,2.5 0 0,1 12,9.5Z",POWER:"M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",RADIO:"M20,6A2,2 0 0,1 22,8V20A2,2 0 0,1 20,22H4A2,2 0 0,1 2,20V8C2,7.15 2.53,6.42 3.28,6.13L15.71,1L16.47,2.83L8.83,6H20M20,8H4V12H16V10H18V12H20V8M7,14A3,3 0 0,0 4,17A3,3 0 0,0 7,20A3,3 0 0,0 10,17A3,3 0 0,0 7,14Z",RECENTS:ls,REPEAT:"M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z",REPEAT_OFF:"M2,5.27L3.28,4L20,20.72L18.73,22L15.73,19H7V22L3,18L7,14V17H13.73L7,10.27V11H5V8.27L2,5.27M17,13H19V17.18L17,15.18V13M17,5V2L21,6L17,10V7H8.82L6.82,5H17Z",REPEAT_ONCE:"M13,15V9H12L10,10V11H11.5V15M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z",SEARCH:"M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z",SHUFFLE:"M14.83,13.41L13.42,14.82L16.55,17.95L14.5,20H20V14.5L17.96,16.54L14.83,13.41M14.5,4L16.54,6.04L4,18.59L5.41,20L17.96,7.46L20,9.5V4M10.59,9.17L5.41,4L4,5.41L9.17,10.58L10.59,9.17Z",SHUFFLE_DISABLED:"M16,4.5V7H5V9H16V11.5L19.5,8M16,12.5V15H5V17H16V19.5L19.5,16",SKIP_NEXT:"M16,18H18V6H16M6,18L14.5,12L6,6V18Z",SKIP_NEXT_CIRCLE:"M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M8,8L13,12L8,16M14,8H16V16H14",SKIP_NEXT_CIRCLE_OUTLINED:"M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4M8,8V16L13,12M14,8V16H16V8",SKIP_PREVIOUS:"M6,18V6H8V18H6M9.5,12L18,6V18L9.5,12Z",SPEAKER:"M12,12A3,3 0 0,0 9,15A3,3 0 0,0 12,18A3,3 0 0,0 15,15A3,3 0 0,0 12,12M12,20A5,5 0 0,1 7,15A5,5 0 0,1 12,10A5,5 0 0,1 17,15A5,5 0 0,1 12,20M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8C10.89,8 10,7.1 10,6C10,4.89 10.89,4 12,4M17,2H7C5.89,2 5,2.89 5,4V20A2,2 0 0,0 7,22H17A2,2 0 0,0 19,20V4C19,2.89 18.1,2 17,2Z",SPEAKER_MULTIPLE:ds,SUGGESTIONS:ns,SWAP:"M21,9L17,5V8H10V10H17V13M7,11L3,15L7,19V16H14V14H7V11Z",VOLUME_HIGH:"M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z",VOLUME_MUTE:"M3,9H7L12,4V20L7,15H3V9M16.59,12L14,9.41L15.41,8L18,10.59L20.59,8L22,9.41L19.41,12L22,14.59L20.59,16L18,13.41L15.41,16L14,14.59L16.59,12Z"},Id={ARTIST:"M17.5 20q-1.05 0-1.775-.725T15 17.5t.725-1.775T17.5 15q.2 0 .45.038t.55.162V11q0-.425.288-.712T19.5 10H21q.425 0 .713.288T22 11t-.288.713T21 12h-1v5.5q0 1.05-.725 1.775T17.5 20M11 12q-1.65 0-2.825-1.175T7 8t1.175-2.825T11 4t2.825 1.175T15 8t-1.175 2.825T11 12m-7 8q-.425 0-.712-.288T3 19v-1.8q0-.875.438-1.575T4.6 14.55q1.55-.775 3.15-1.162T11 13q.7 0 1.388.075t1.387.225q.425.1.537.525t-.237.775q-.525.625-.788 1.363t-.262 1.537q0 .325.038.638t.137.637q.125.45-.112.838t-.663.387z",ALBUM:"M12 16.5q1.875 0 3.188-1.312T16.5 12t-1.312-3.187T12 7.5T8.813 8.813T7.5 12t1.313 3.188T12 16.5m0-3.5q-.425 0-.712-.288T11 12t.288-.712T12 11t.713.288T13 12t-.288.713T12 13m0 9q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22",ARROW_DOWN:"M11 16.175V5q0-.425.288-.712T12 4t.713.288T13 5v11.175l4.9-4.9q.3-.3.7-.288t.7.313q.275.3.287.7t-.287.7l-6.6 6.6q-.15.15-.325.213t-.375.062t-.375-.062t-.325-.213l-6.6-6.6q-.275-.275-.275-.687T4.7 11.3q.3-.3.713-.3t.712.3z",ARROW_LEFT:"m7.85 13l2.85 2.85q.3.3.288.7t-.288.7q-.3.3-.712.313t-.713-.288L4.7 12.7q-.3-.3-.3-.7t.3-.7l4.575-4.575q.3-.3.713-.287t.712.312q.275.3.288.7t-.288.7L7.85 11H19q.425 0 .713.288T20 12t-.288.713T19 13z",ARROW_PLAY_NEXT:"M5 5q-.425 0-.712-.288T4 4t.288-.712T5 3h14q.425 0 .713.288T20 4t-.288.713T19 5zm7 16q-.425 0-.712-.288T11 20v-9.2l-1.9 1.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l3.6-3.6q.15-.15.325-.212T12 7.425t.375.063t.325.212l3.6 3.6q.275.275.275.7t-.275.7t-.7.275t-.7-.275L13 10.8V20q0 .425-.287.713T12 21",ARROW_UP:"m11 7.825l-4.9 4.9q-.3.3-.7.288t-.7-.313q-.275-.3-.288-.7t.288-.7l6.6-6.6q.15-.15.325-.212T12 4.425t.375.063t.325.212l6.6 6.6q.275.275.275.688t-.275.712q-.3.3-.712.3t-.713-.3L13 7.825V19q0 .425-.288.713T12 20t-.712-.288T11 19z",ASLEEP:"M12.075 22q-2.1 0-3.937-.8t-3.2-2.162t-2.163-3.2t-.8-3.938q0-3.1 1.713-5.625t4.587-3.7q.35-.125.725-.088t.625.238q.2.175.313.488t.112.812q.05 1.975.8 3.763T13 10.975t3.2 2.15t3.775.8q.525 0 .8.088t.45.287q.2.25.263.65t-.063.725q-1.15 2.875-3.7 4.6T12.075 22M14.3 7.3l-1.6-1.6q-.3-.3-.3-.7t.3-.7l1.6-1.6q.3-.3.7-.3t.7.3l1.6 1.6q.3.3.3.7t-.3.7l-1.6 1.6q-.3.3-.7.3t-.7-.3m5 3l-.6-.6q-.3-.3-.3-.7t.3-.7l.6-.6q.3-.3.7-.3t.7.3l.6.6q.3.3.3.7t-.3.7l-.6.6q-.3.3-.7.3t-.7-.3",BOOK:"M6 22q-.825 0-1.412-.587T4 20V4q0-.825.588-1.412T6 2h12q.825 0 1.413.588T20 4v16q0 .825-.587 1.413T18 22zm5-18v6.125q0 .3.238.438t.512-.013l1.225-.725q.25-.15.513-.15t.512.15l1.225.725q.275.15.525.013t.25-.438V4z",CLEAR:"m17 19.4l-1.9 1.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l1.9-1.9l-1.9-1.9q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l1.9 1.9l1.9-1.9q.275-.275.7-.275t.7.275t.275.7t-.275.7L18.4 18l1.9 1.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275zM4 16q-.425 0-.712-.288T3 15t.288-.712T4 14h5q.425 0 .713.288T10 15t-.288.713T9 16zm0-4q-.425 0-.712-.288T3 11t.288-.712T4 10h9q.425 0 .713.288T14 11t-.288.713T13 12zm0-4q-.425 0-.712-.288T3 7t.288-.712T4 6h9q.425 0 .713.288T14 7t-.288.713T13 8z",CLOSE:"m12 13.4l-4.9 4.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l4.9-4.9l-4.9-4.9q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.9 4.9l4.9-4.9q.275-.275.7-.275t.7.275t.275.7t-.275.7L13.4 12l4.9 4.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275z",FILTER:"M11 18q-.425 0-.712-.288T10 17t.288-.712T11 16h2q.425 0 .713.288T14 17t-.288.713T13 18zm-4-5q-.425 0-.712-.288T6 12t.288-.712T7 11h10q.425 0 .713.288T18 12t-.288.713T17 13zM4 8q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z",HEART:"M12 20.325q-.35 0-.712-.125t-.638-.4l-1.725-1.575q-2.65-2.425-4.788-4.812T2 8.15Q2 5.8 3.575 4.225T7.5 2.65q1.325 0 2.5.562t2 1.538q.825-.975 2-1.537t2.5-.563q2.35 0 3.925 1.575T22 8.15q0 2.875-2.125 5.275T15.05 18.25l-1.7 1.55q-.275.275-.637.4t-.713.125",HEART_ALT:"M12 15.5q1.35 0 2.463-.737T16.15 12.8q.175-.375 0-.75t-.575-.525q-.375-.15-.737.013t-.538.537q-.3.675-.937 1.05T12 13.5t-1.362-.375t-.938-1.05q-.175-.375-.537-.537t-.738-.013q-.4.15-.575.525t0 .75q.575 1.225 1.688 1.963T12 15.5m-2.75-5q.525 0 .888-.363t.362-.887t-.363-.888T9.25 8t-.888.363T8 9.25t.363.888t.887.362m5.5 0q.525 0 .888-.363T16 9.25t-.363-.888T14.75 8t-.888.363t-.362.887t.363.888t.887.362M12 5.1q.85-1 2.025-1.55T16.5 3q2.35 0 3.925 1.575T22 8.5q0 1.05-.312 2.013t-1.075 2.075t-2.05 2.437t-3.238 3.075l-2 1.75q-.575.5-1.325.5t-1.325-.5l-2-1.75q-1.95-1.75-3.238-3.075t-2.05-2.437t-1.075-2.075T2 8.5q0-2.35 1.575-3.925T7.5 3q1.3 0 2.475.55T12 5.1",HEART_PLUS:"M1 8.475q0-2.35 1.575-3.912T6.5 3q1.3 0 2.475.55T11 5.1q.85-1 2.025-1.55T15.5 3q1.775 0 3.05.888t1.925 2.287q.175.375.025.763t-.525.562t-.763.025T18.65 7q-.45-1-1.325-1.5T15.5 5q-1.15 0-2.1.65t-1.65 1.6q-.125.2-.325.288T11 7.624t-.425-.1t-.325-.275q-.7-.95-1.65-1.6T6.5 5q-1.425 0-2.462.988T3 8.474q0 .825.35 1.675t1.25 1.963t2.45 2.6T11 18.3l2.225-1.95q.3-.275.7-.25t.675.3q.3.3.288.738t-.338.712l-2.225 1.975q-.275.25-.625.375t-.7.125t-.7-.125t-.625-.4q-1.125-1-2.612-2.275t-2.838-2.737t-2.287-3.063T1 8.475M18 14h-2q-.425 0-.712-.288T15 13t.288-.712T16 12h2v-2q0-.425.288-.712T19 9t.713.288T20 10v2h2q.425 0 .713.288T23 13t-.288.713T22 14h-2v2q0 .425-.288.713T19 17t-.712-.288T18 16z",LIBRARY:"M3 17.15V10q0-.8.588-1.35t1.387-.5q1.975.3 3.763 1.163T12 11.55q1.475-1.375 3.263-2.238t3.762-1.162q.8-.05 1.388.5T21 10v7.15q0 .8-.525 1.363t-1.325.612q-1.6.25-3.1.825t-2.8 1.525q-.275.225-.587.337t-.663.113t-.663-.112t-.587-.338q-1.3-.95-2.8-1.525t-3.1-.825q-.8-.05-1.325-.612T3 17.15M12 9q-1.65 0-2.825-1.175T8 5t1.175-2.825T12 1t2.825 1.175T16 5t-1.175 2.825T12 9",LIBRARY_OUTLINED:"M3 17.15V10q0-.8.588-1.35t1.387-.5q1.975.3 3.763 1.163T12 11.55q1.475-1.375 3.263-2.238t3.762-1.162q.8-.05 1.388.5T21 10v7.15q0 .8-.525 1.363t-1.325.612q-1.6.25-3.1.825t-2.8 1.525q-.275.225-.587.337t-.663.113t-.663-.112t-.587-.338q-1.3-.95-2.8-1.525t-3.1-.825q-.8-.05-1.325-.612T3 17.15m9 2.75q1.575-1.175 3.35-1.875T19 17.1v-6.9q-1.825.325-3.588 1.313T12 14.15q-1.65-1.65-3.412-2.637T5 10.2v6.9q1.875.225 3.65.925T12 19.9M12 9q-1.65 0-2.825-1.175T8 5t1.175-2.825T12 1t2.825 1.175T16 5t-1.175 2.825T12 9m0-2q.825 0 1.413-.587T14 5t-.587-1.412T12 3t-1.412.588T10 5t.588 1.413T12 7m0 7.15",LINK:"M17 17h-2.025q-.425 0-.7-.288T14 16t.288-.712T15 15h2v-2q0-.425.288-.712T18 12t.713.288T19 13v2h2q.425 0 .713.288T22 16t-.288.713T21 17h-2v2q0 .425-.288.713T18 20t-.712-.288T17 19zm-7 0H7q-2.075 0-3.537-1.463T2 12t1.463-3.537T7 7h3q.425 0 .713.288T11 8t-.288.713T10 9H7q-1.25 0-2.125.875T4 12t.875 2.125T7 15h3q.425 0 .713.288T11 16t-.288.713T10 17m-1-4q-.425 0-.712-.288T8 12t.288-.712T9 11h6q.425 0 .713.288T16 12t-.288.713T15 13zm13-1h-2q0-1.25-.875-2.125T17 9h-3.025q-.425 0-.7-.288T13 8t.288-.712T14 7h3q2.075 0 3.538 1.463T22 12",LINK_OFF:"M15.625 12.775L13.85 11H15q.425 0 .713.288T16 12q0 .25-.1.45t-.275.325M20.5 21.9q-.275.275-.7.275t-.7-.275l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7M7 17q-2.075 0-3.537-1.463T2 12q0-1.725 1.05-3.075t2.7-1.775L7.6 9H7q-1.25 0-2.125.875T4 12t.875 2.125T7 15h3q.425 0 .713.288T11 16t-.288.713T10 17zm2-4q-.425 0-.712-.288T8 12t.288-.712T9 11h.625l1.975 2zm9.5 2.8q-.225-.35-.162-.75t.412-.625q.575-.425.913-1.05T20 12q0-1.25-.875-2.125T17 9h-3q-.425 0-.712-.288T13 8t.288-.712T14 7h3q2.075 0 3.538 1.463T22 12q0 1.225-.562 2.288t-1.563 1.762q-.35.225-.75.163T18.5 15.8",MUSIC:"M10 21q-1.65 0-2.825-1.175T6 17t1.175-2.825T10 13q.575 0 1.063.138t.937.412V4q0-.425.288-.712T13 3h4q.425 0 .713.288T18 4v2q0 .425-.288.713T17 7h-3v10q0 1.65-1.175 2.825T10 21",OVERFLOW:"M12 20q-.825 0-1.412-.587T10 18t.588-1.412T12 16t1.413.588T14 18t-.587 1.413T12 20m0-6q-.825 0-1.412-.587T10 12t.588-1.412T12 10t1.413.588T14 12t-.587 1.413T12 14m0-6q-.825 0-1.412-.587T10 6t.588-1.412T12 4t1.413.588T14 6t-.587 1.413T12 8",PAUSE:"M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19",PLAY:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712",PLAY_CIRCLE:"m10.65 15.75l4.875-3.125q.35-.225.35-.625t-.35-.625L10.65 8.25q-.375-.25-.763-.038t-.387.663v6.25q0 .45.388.663t.762-.038M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22",PLAY_CIRCLE_OUTLINE:"m10.65 15.75l4.875-3.125q.35-.225.35-.625t-.35-.625L10.65 8.25q-.375-.25-.763-.038t-.387.663v6.25q0 .45.388.663t.762-.038M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8",PLAYLIST:"M16 20q-1.25 0-2.125-.875T13 17t.875-2.125T16 14q.275 0 .525.038T17 14.2V7q0-.425.288-.712T18 6h3q.425 0 .713.288T22 7t-.288.713T21 8h-2v9q0 1.25-.875 2.125T16 20M4 16q-.425 0-.712-.288T3 15t.288-.712T4 14h6q.425 0 .713.288T11 15t-.288.713T10 16zm0-4q-.425 0-.712-.288T3 11t.288-.712T4 10h10q.425 0 .713.288T15 11t-.288.713T14 12zm0-4q-.425 0-.712-.288T3 7t.288-.712T4 6h10q.425 0 .713.288T15 7t-.288.713T14 8z",PLAYLIST_PLUS:"M4 16q-.425 0-.712-.288T3 15t.288-.712T4 14h5q.425 0 .713.288T10 15t-.288.713T9 16zm0-4q-.425 0-.712-.288T3 11t.288-.712T4 10h9q.425 0 .713.288T14 11t-.288.713T13 12zm0-4q-.425 0-.712-.288T3 7t.288-.712T4 6h9q.425 0 .713.288T14 7t-.288.713T13 8zm13 12q-.425 0-.712-.288T16 19v-3h-3q-.425 0-.712-.288T12 15t.288-.712T13 14h3v-3q0-.425.288-.712T17 10t.713.288T18 11v3h3q.425 0 .713.288T22 15t-.288.713T21 16h-3v3q0 .425-.288.713T17 20",PODCAST:"M11 21v-7.275q-.45-.275-.725-.712T10 12q0-.825.588-1.412T12 10t1.413.588T14 12q0 .575-.275 1.025t-.725.7V21q0 .425-.288.713T12 22t-.712-.288T11 21m-5.175-2.475q-.3.3-.725.3t-.7-.325q-1.125-1.325-1.763-2.975T2 12q0-2.075.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12q0 1.875-.638 3.525T19.6 18.5q-.275.325-.687.338t-.713-.288q-.275-.275-.275-.7t.275-.75q.85-1.05 1.325-2.35T20 12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12q0 1.45.475 2.738t1.35 2.337q.275.325.287.738t-.287.712M8.65 15.7q-.3.3-.725.313t-.675-.338q-.575-.775-.913-1.7T6 12q0-2.5 1.75-4.25T12 6t4.25 1.75T18 12q0 1.05-.337 1.988t-.913 1.687q-.25.325-.675.338t-.725-.288q-.275-.275-.287-.7t.237-.775q.325-.5.513-1.062T16 12q0-1.65-1.175-2.825T12 8T9.175 9.175T8 12q0 .65.188 1.2t.512 1.05q.25.35.238.763t-.288.687",POWER:"M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-2q2.5 0 4.25-1.75T18 12q0-.875-.225-1.662t-.65-1.488q-.3-.5-.712-.562t-.763.137t-.488.575t.138.75q.35.475.525 1.05T16 12q0 1.65-1.175 2.825T12 16t-2.825-1.175T8 12q0-.625.175-1.187t.5-1.038q.25-.375.125-.737t-.45-.563t-.737-.15t-.738.525q-.45.675-.663 1.475T6 12q0 2.5 1.75 4.25T12 18m0-12q-.425 0-.712.288T11 7v4q0 .425.288.713T12 12t.713-.288T13 11V7q0-.425-.288-.712T12 6m0 6",RADIO:"M4 22q-.825 0-1.412-.587T2 20V6.65l13.075-5.325q.35-.125.688.013t.462.487t-.012.688t-.488.462L8.3 6H20q.825 0 1.413.588T22 8v12q0 .825-.587 1.413T20 22zm4-3q1.05 0 1.775-.725T10.5 16.5t-.725-1.775T8 14t-1.775.725T5.5 16.5t.725 1.775T8 19m-4-8h12v-1q0-.425.288-.712T17 9t.713.288T18 10v1h2V8H4z",RECENTS:"M12 21q-3.15 0-5.575-1.912T3.275 14.2q-.1-.375.15-.687t.675-.363q.4-.05.725.15t.45.6q.6 2.25 2.475 3.675T12 19q2.925 0 4.963-2.037T19 12t-2.037-4.962T12 5q-1.725 0-3.225.8T6.25 8H8q.425 0 .713.288T9 9t-.288.713T8 10H4q-.425 0-.712-.288T3 9V5q0-.425.288-.712T4 4t.713.288T5 5v1.35q1.275-1.6 3.113-2.475T12 3q1.875 0 3.513.713t2.85 1.924t1.925 2.85T21 12t-.712 3.513t-1.925 2.85t-2.85 1.925T12 21m1-9.4l2.5 2.5q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-2.8-2.8q-.15-.15-.225-.337T11 11.975V8q0-.425.288-.712T12 7t.713.288T13 8z",REPEAT:"m6.85 19l.85.85q.3.3.288.7t-.288.7q-.3.3-.712.313t-.713-.288L3.7 18.7q-.15-.15-.213-.325T3.426 18t.063-.375t.212-.325l2.575-2.575q.3-.3.713-.287t.712.312q.275.3.288.7t-.288.7l-.85.85H17v-3q0-.425.288-.712T18 13t.713.288T19 14v3q0 .825-.587 1.413T17 19zm10.3-12H7v3q0 .425-.288.713T6 11t-.712-.288T5 10V7q0-.825.588-1.412T7 5h10.15l-.85-.85q-.3-.3-.288-.7t.288-.7q.3-.3.712-.312t.713.287L20.3 5.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-2.575 2.575q-.3.3-.712.288T16.3 9.25q-.275-.3-.288-.7t.288-.7z",REPEAT_OFF:"M6 12.05q0 1.175.463 2.25t1.287 1.9l.25.25V15q0-.425.288-.712T9 14t.713.288T10 15v4q0 .425-.288.713T9 20H5q-.425 0-.712-.288T4 19t.288-.712T5 18h1.75l-.4-.35q-1.125-1.125-1.737-2.575T4 12.05q0-1.1.275-2.137t.85-1.988L2.1 4.9q-.3-.3-.288-.712t.313-.713t.713-.3t.712.3l16.975 17q.3.3.3.7t-.3.7t-.712.3t-.713-.3l-3.025-3q-.275.175-.55.3l-.55.25q-.375.15-.738-.038t-.487-.612t.1-.762t.625-.538q.275-.125.5-.275t.475-.3l-.65.7l-8.2-8.2q-.275.625-.438 1.288T6 12.05m12.925 3.975l-1.5-1.5q.275-.6.425-1.25T18 11.95q0-1.175-.462-2.25T16.25 7.8L16 7.55V9q0 .425-.288.713T15 10t-.712-.288T14 9V5q0-.425.288-.712T15 4h4q.425 0 .713.288T20 5t-.288.713T19 6h-1.75l.4.35q1.125 1.125 1.738 2.575T20 11.95q0 1.075-.275 2.1t-.8 1.975m-9.45-9.45l-1.5-1.5q.275-.15.525-.263t.525-.237q.4-.15.75.037t.475.613q.1.4-.112.75t-.588.55q-.025.025-.038.025t-.037.025",REPEAT_ONCE:"M11.5 10.5h-.75q-.325 0-.537-.213T10 9.75t.213-.537T10.75 9H12q.425 0 .713.288T13 10v4.25q0 .325-.213.538T12.25 15t-.537-.213t-.213-.537zM6.85 19l.85.85q.3.3.288.7t-.288.7q-.3.3-.712.313t-.713-.288L3.7 18.7q-.15-.15-.213-.325T3.426 18t.063-.375t.212-.325l2.575-2.575q.3-.3.713-.287t.712.312q.275.3.288.7t-.288.7l-.85.85H17v-3q0-.425.288-.712T18 13t.713.288T19 14v3q0 .825-.587 1.413T17 19zm10.3-12H7v3q0 .425-.288.713T6 11t-.712-.288T5 10V7q0-.825.588-1.412T7 5h10.15l-.85-.85q-.3-.3-.288-.7t.288-.7q.3-.3.712-.312t.713.287L20.3 5.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-2.575 2.575q-.3.3-.712.288T16.3 9.25q-.275-.3-.288-.7t.288-.7z",SEARCH:"M9.5 16q-2.725 0-4.612-1.888T3 9.5t1.888-4.612T9.5 3t4.613 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l5.6 5.6q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-5.6-5.6q-.75.6-1.725.95T9.5 16m0-2q1.875 0 3.188-1.312T14 9.5t-1.312-3.187T9.5 5T6.313 6.313T5 9.5t1.313 3.188T9.5 14",SHUFFLE:"M15 20q-.425 0-.712-.288T14 19t.288-.712T15 18h1.6l-2.475-2.475q-.3-.3-.287-.712t.312-.713t.713-.3t.712.3L18 16.55V15q0-.425.288-.712T19 14t.713.288T20 15v4q0 .425-.288.713T19 20zm-10.7-.3q-.275-.275-.275-.7t.275-.7L16.6 6H15q-.425 0-.712-.288T14 5t.288-.712T15 4h4q.425 0 .713.288T20 5v4q0 .425-.288.713T19 10t-.712-.288T18 9V7.4L5.7 19.7q-.275.275-.7.275t-.7-.275m-.025-14Q4 5.425 4 5t.275-.7t.687-.275t.713.275l4.2 4.175q.275.275.288.688t-.288.712q-.275.275-.7.275t-.7-.275z",SHUFFLE_DISABLED:"m5.825 17l1.9 1.9q.3.3.288.7t-.313.7q-.3.275-.7.288t-.7-.288l-3.6-3.6q-.15-.15-.213-.325T2.426 16t.063-.375t.212-.325l3.6-3.6q.275-.275.688-.275t.712.275q.3.3.3.713t-.3.712L5.825 15H20q.425 0 .713.288T21 16t-.288.713T20 17zm12.35-8H4q-.425 0-.712-.288T3 8t.288-.712T4 7h14.175l-1.9-1.9q-.3-.3-.287-.7t.312-.7q.3-.275.7-.288t.7.288l3.6 3.6q.15.15.213.325t.062.375t-.062.375t-.213.325l-3.6 3.6q-.275.275-.687.275T16.3 12.3q-.3-.3-.3-.712t.3-.713z",SKIP_NEXT:"M16.5 17V7q0-.425.288-.712T17.5 6t.713.288T18.5 7v10q0 .425-.288.713T17.5 18t-.712-.288T16.5 17m-11-.875v-8.25q0-.45.3-.725t.7-.275q.125 0 .275.025t.275.125l6.2 4.15q.225.15.338.363T13.7 12t-.112.463t-.338.362l-6.2 4.15q-.125.1-.275.125t-.275.025q-.4 0-.7-.275t-.3-.725",SKIP_NEXT_CIRCLE:"M16.5 17V7q0-.425.288-.712T17.5 6t.713.288T18.5 7v10q0 .425-.288.713T17.5 18t-.712-.288T16.5 17m-11-.875v-8.25q0-.45.3-.725t.7-.275q.125 0 .275.025t.275.125l6.2 4.15q.225.15.338.363T13.7 12t-.112.463t-.338.362l-6.2 4.15q-.125.1-.275.125t-.275.025q-.4 0-.7-.275t-.3-.725",SKIP_NEXT_CIRCLE_OUTLINED:"M16.5 17V7q0-.425.288-.712T17.5 6t.713.288T18.5 7v10q0 .425-.288.713T17.5 18t-.712-.288T16.5 17m-11-.875v-8.25q0-.45.3-.725t.7-.275q.125 0 .275.025t.275.125l6.2 4.15q.225.15.338.363T13.7 12t-.112.463t-.338.362l-6.2 4.15q-.125.1-.275.125t-.275.025q-.4 0-.7-.275t-.3-.725m2-1.875L10.9 12L7.5 9.75z",SKIP_PREVIOUS:"M5.5 17V7q0-.425.288-.712T6.5 6t.713.288T7.5 7v10q0 .425-.288.713T6.5 18t-.712-.288T5.5 17m11.45-.025l-6.2-4.15q-.225-.15-.337-.362T10.3 12t.113-.462t.337-.363l6.2-4.15q.125-.1.275-.125t.275-.025q.4 0 .7.275t.3.725v8.25q0 .45-.3.725t-.7.275q-.125 0-.275-.025t-.275-.125",SPEAKER:"M17 22H7q-.825 0-1.412-.587T5 20V4q0-.825.588-1.412T7 2h10q.825 0 1.413.588T19 4v16q0 .825-.587 1.413T17 22M12 9q.825 0 1.413-.587T14 7t-.587-1.412T12 5t-1.412.588T10 7t.588 1.413T12 9m0 10q1.65 0 2.825-1.175T16 15t-1.175-2.825T12 11t-2.825 1.175T8 15t1.175 2.825T12 19m0-2q-.825 0-1.412-.587T10 15t.588-1.412T12 13t1.413.588T14 15t-.587 1.413T12 17",SPEAKER_MULTIPLE:"M10 19q-.825 0-1.412-.587T8 17V3q0-.825.588-1.412T10 1h9q.825 0 1.413.588T21 3v14q0 .825-.587 1.413T19 19zm4.5-11.5q.625 0 1.063-.437T16 6t-.437-1.062T14.5 4.5t-1.062.438T13 6t.438 1.063T14.5 7.5m0 8.5q1.45 0 2.475-1.025T18 12.5t-1.025-2.475T14.5 9t-2.475 1.025T11 12.5t1.025 2.475T14.5 16m0-2q-.625 0-1.062-.437T13 12.5t.438-1.062T14.5 11t1.063.438T16 12.5t-.437 1.063T14.5 14m.5 9H6q-.825 0-1.412-.587T4 21V6q0-.425.288-.712T5 5t.713.288T6 6v15h9q.425 0 .713.288T16 22t-.288.713T15 23",SUGGESTIONS:"M5.7 21.875q-.825.125-1.487-.387T3.45 20.15L2.125 9.225q-.1-.825.4-1.475T3.85 7L5 6.85V15q0 1.65 1.175 2.825T9 19h9.3q-.15.6-.6 1.038t-1.1.512zM9 17q-.825 0-1.412-.587T7 15V4q0-.825.588-1.412T9 2h11q.825 0 1.413.588T22 4v11q0 .825-.587 1.413T20 17zm3.725-4.8l1.775-1.075l1.775 1.075q.15.1.288 0t.087-.275L16.175 9.9l1.55-1.35q.125-.125.087-.263t-.212-.162l-2.05-.175l-.825-1.9q-.05-.15-.225-.15t-.225.15l-.825 1.9l-2.05.175q-.175.025-.212.163t.087.262l1.55 1.35l-.475 2.025q-.05.175.088.275t.287 0",SWAP:"M5.825 16L7.7 17.875q.275.275.275.688t-.275.712q-.3.3-.712.3t-.713-.3L2.7 15.7q-.15-.15-.213-.325T2.426 15t.063-.375t.212-.325l3.6-3.6q.3-.3.7-.287t.7.312q.275.3.288.7t-.288.7L5.825 14H12q.425 0 .713.288T13 15t-.288.713T12 16zm12.35-6H12q-.425 0-.712-.288T11 9t.288-.712T12 8h6.175L16.3 6.125q-.275-.275-.275-.687t.275-.713q.3-.3.713-.3t.712.3L21.3 8.3q.15.15.212.325t.063.375t-.063.375t-.212.325l-3.6 3.6q-.3.3-.7.288t-.7-.313q-.275-.3-.288-.7t.288-.7z",VOLUME_HIGH:"M19 11.975q0-2.075-1.1-3.787t-2.95-2.563q-.375-.175-.55-.537t-.05-.738q.15-.4.538-.575t.787 0Q18.1 4.85 19.55 7.063T21 11.974t-1.45 4.913t-3.875 3.287q-.4.175-.788 0t-.537-.575q-.125-.375.05-.737t.55-.538q1.85-.85 2.95-2.562t1.1-3.788M7 15H4q-.425 0-.712-.288T3 14v-4q0-.425.288-.712T4 9h3l3.3-3.3q.475-.475 1.088-.213t.612.938v11.15q0 .675-.612.938T10.3 18.3zm9.5-3q0 1.05-.475 1.988t-1.25 1.537q-.25.15-.513.013T14 15.1V8.85q0-.3.263-.437t.512.012q.775.625 1.25 1.575t.475 2",VOLUME_MUTE:"M16.775 19.575q-.275.175-.55.325t-.575.275q-.375.175-.762 0t-.538-.575q-.15-.375.038-.737t.562-.538q.1-.05.188-.1t.187-.1L12 14.8v2.775q0 .675-.612.938T10.3 18.3L7 15H4q-.425 0-.712-.288T3 14v-4q0-.425.288-.712T4 9h2.2L2.1 4.9q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275zm2.225-7.6q0-2.075-1.1-3.787t-2.95-2.563q-.375-.175-.55-.537t-.05-.738q.15-.4.538-.575t.787 0Q18.1 4.85 19.55 7.05T21 11.975q0 .825-.15 1.638t-.425 1.562q-.2.55-.612.688t-.763.012t-.562-.45t-.013-.75q.275-.65.4-1.312T19 11.975m-4.225-3.55Q15.6 8.95 16.05 10t.45 2v.25q0 .125-.025.25q-.05.325-.35.425t-.55-.15L14.3 11.5q-.15-.15-.225-.337T14 10.775V8.85q0-.3.263-.437t.512.012M9.75 6.95Q9.6 6.8 9.6 6.6t.15-.35l.55-.55q.475-.475 1.087-.213t.613.938V8q0 .35-.3.475t-.55-.125z"};class Bd{constructor(e){this._getHiddenElements=ps,this._defaultPlayerHide=ul,this._host=e,this._entitiesConfig=new o(e,{context:ai}),this._mediaBrowserConfig=new o(e,{context:Ai}),this._playerQueueConfig=new o(e,{context:ci}),this._musicPlayerConfig=new o(e,{context:li}),this._playersConfig=new o(e,{context:di}),this._icons=new o(e,{context:Ei}),this._musicPlayerHiddenElementsConfig=new o(e,{context:ki}),this._playerQueueHiddenElementsConfig=new o(e,{context:Ri}),this._mediaBrowserHiddenElementsConfig=new o(e,{context:Qi}),this._playersHiddenElementsConfig=new o(e,{context:Mi}),this._hiddenElementsConfig=new o(e,{context:Si})}set config(e){if(Yr(this._config,e))return;const t=bd(e);this._config=t,this._entitiesConfig.value=t.entities,this._playerQueueConfig.value=t.queue,this._musicPlayerConfig.value=t.player,this._playersConfig.value=t.players,this._mediaBrowserConfig.value=t.media_browser,this.Icons=t.expressive?Id:Cd,this.updateHiddenElements()}get config(){return this._config}set activeEntityConfig(e){this._activeEntityConfig=e,this.updateHiddenElements()}get activeEntityConfig(){return this._activeEntityConfig}set MusicPlayerHiddenElements(e){this._musicPlayerHiddenElementsConfig.setValue(e)}get MusicPlayerHiddenElements(){return this._musicPlayerHiddenElementsConfig.value}set PlayerQueueHiddenElements(e){this._playerQueueHiddenElementsConfig.setValue(e)}get PlayerQueueHiddenElements(){return this._playerQueueHiddenElementsConfig.value}set MediaBrowserHiddenElements(e){this._mediaBrowserHiddenElementsConfig.setValue(e)}get MediaBrowserHiddenElements(){return this._mediaBrowserHiddenElementsConfig.value}set PlayersHiddenElements(e){this._playersHiddenElementsConfig.setValue(e)}get PlayersHiddenElements(){return this._playersHiddenElementsConfig.value}set HiddenElements(e){this._hiddenElementsConfig.setValue(e)}get HiddenElements(){return this._hiddenElementsConfig.value}updateHiddenElements(){if(!this.config&&!this.activeEntityConfig)return;const e=this.activeEntityConfig?.hide,t=this.config,r={player:t?.player.hide??e?.player,queue:t?.queue.hide??e?.queue,media_browser:t?.media_browser.hide??e?.media_browser,players:t?.players.hide??e?.players},i=this.activeEntityConfig?.hide??r;this.MusicPlayerHiddenElements=ps(ul,r.player,i.player),this.PlayerQueueHiddenElements=ps(Zc,r.queue,i.queue),this.MediaBrowserHiddenElements=ps(vs,r.media_browser,i.media_browser),this.PlayersHiddenElements=ps(MA,r.players,i.players),this.HiddenElements={player:this.MusicPlayerHiddenElements,queue:this.PlayerQueueHiddenElements,media_browser:this.MediaBrowserHiddenElements,players:this.PlayersHiddenElements}}set Icons(e){this._icons.setValue(e)}get Icons(){return this._icons.value}get Entities(){return this.config.entities}get MediaBrowser(){return this.config.media_browser}get PlayerQueue(){return this.config.queue}get MusicPlayer(){return this.config.player}get Players(){return this.config.players}}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function xd(e){return e<0?-1:0===e?0:1}function Pd(e,t,r){return(1-r)*e+r*t}function Dd(e,t,r){return r<e?e:r>t?t:r}function Sd(e){return(e%=360)<0&&(e+=360),e}function kd(e){return(e%=360)<0&&(e+=360),e}function Rd(e,t){return 180-Math.abs(Math.abs(e-t)-180)}function Qd(e,t){return[e[0]*t[0][0]+e[1]*t[0][1]+e[2]*t[0][2],e[0]*t[1][0]+e[1]*t[1][1]+e[2]*t[1][2],e[0]*t[2][0]+e[1]*t[2][1]+e[2]*t[2][2]]}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Md=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],Hd=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],Od=[95.047,100,108.883];function Td(e,t,r){return(255<<24|(255&e)<<16|(255&t)<<8|255&r)>>>0}function Ld(e){return Td(Kd(e[0]),Kd(e[1]),Kd(e[2]))}function qd(e){return e>>24&255}function Ud(e){return e>>16&255}function Fd(e){return e>>8&255}function Vd(e){return 255&e}function zd(e,t,r){const i=Hd,s=i[0][0]*e+i[0][1]*t+i[0][2]*r,o=i[1][0]*e+i[1][1]*t+i[1][2]*r,n=i[2][0]*e+i[2][1]*t+i[2][2]*r;return Td(Kd(s),Kd(o),Kd(n))}function Jd(e){const t=jd(Ud(e)),r=jd(Fd(e)),i=jd(Vd(e)),s=Md,o=s[0][0]*t+s[0][1]*r+s[0][2]*i,n=s[1][0]*t+s[1][1]*r+s[1][2]*i,a=s[2][0]*t+s[2][1]*r+s[2][2]*i,l=n/Od[1],c=a/Od[2],A=Gd(o/Od[0]),d=Gd(l);return[116*d-16,500*(A-d),200*(d-Gd(c))]}function Yd(e){const t=function(e){return Qd([jd(Ud(e)),jd(Fd(e)),jd(Vd(e))],Md)}(e)[1];return 116*Gd(t/100)-16}function Nd(e){return 100*Wd((e+16)/116)}function Xd(e){return 116*Gd(e/100)-16}function jd(e){const t=e/255;return t<=.040449936?t/12.92*100:100*Math.pow((t+.055)/1.055,2.4)}function Kd(e){const t=e/100;let r=0;return r=t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,i=0,s=255,(o=Math.round(255*r))<i?i:o>s?s:o;var i,s,o}function Gd(e){const t=24389/27;return e>216/24389?Math.pow(e,1/3):(t*e+16)/116}function Wd(e){const t=e*e*e;return t>216/24389?t:(116*e-16)/(24389/27)}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Zd{static make(e=function(){return Od}(),t=200/Math.PI*Nd(50)/100,r=50,i=2,s=!1){const o=e,n=.401288*o[0]+.650173*o[1]+-.051461*o[2],a=-.250268*o[0]+1.204414*o[1]+.045854*o[2],l=-.002079*o[0]+.048952*o[1]+.953127*o[2],c=.8+i/10,A=c>=.9?Pd(.59,.69,10*(c-.9)):Pd(.525,.59,10*(c-.8));let d=s?1:c*(1-1/3.6*Math.exp((-t-42)/92));d=d>1?1:d<0?0:d;const u=c,h=[d*(100/n)+1-d,d*(100/a)+1-d,d*(100/l)+1-d],p=1/(5*t+1),g=p*p*p*p,m=1-g,v=g*t+.1*m*m*Math.cbrt(5*t),f=Nd(r)/e[1],y=1.48+Math.sqrt(f),b=.725/Math.pow(f,.2),w=b,E=[Math.pow(v*h[0]*n/100,.42),Math.pow(v*h[1]*a/100,.42),Math.pow(v*h[2]*l/100,.42)],C=[400*E[0]/(E[0]+27.13),400*E[1]/(E[1]+27.13),400*E[2]/(E[2]+27.13)];return new Zd(f,(2*C[0]+C[1]+.05*C[2])*b,b,w,A,u,h,v,Math.pow(v,.25),y)}constructor(e,t,r,i,s,o,n,a,l,c){this.n=e,this.aw=t,this.nbb=r,this.ncb=i,this.c=s,this.nc=o,this.rgbD=n,this.fl=a,this.fLRoot=l,this.z=c}}Zd.DEFAULT=Zd.make();
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class _d{constructor(e,t,r,i,s,o,n,a,l){this.hue=e,this.chroma=t,this.j=r,this.q=i,this.m=s,this.s=o,this.jstar=n,this.astar=a,this.bstar=l}distance(e){const t=this.jstar-e.jstar,r=this.astar-e.astar,i=this.bstar-e.bstar,s=Math.sqrt(t*t+r*r+i*i);return 1.41*Math.pow(s,.63)}static fromInt(e){return _d.fromIntInViewingConditions(e,Zd.DEFAULT)}static fromIntInViewingConditions(e,t){const r=(65280&e)>>8,i=255&e,s=jd((16711680&e)>>16),o=jd(r),n=jd(i),a=.41233895*s+.35762064*o+.18051042*n,l=.2126*s+.7152*o+.0722*n,c=.01932141*s+.11916382*o+.95034478*n,A=.401288*a+.650173*l-.051461*c,d=-.250268*a+1.204414*l+.045854*c,u=-.002079*a+.048952*l+.953127*c,h=t.rgbD[0]*A,p=t.rgbD[1]*d,g=t.rgbD[2]*u,m=Math.pow(t.fl*Math.abs(h)/100,.42),v=Math.pow(t.fl*Math.abs(p)/100,.42),f=Math.pow(t.fl*Math.abs(g)/100,.42),y=400*xd(h)*m/(m+27.13),b=400*xd(p)*v/(v+27.13),w=400*xd(g)*f/(f+27.13),E=(11*y+-12*b+w)/11,C=(y+b-2*w)/9,I=(20*y+20*b+21*w)/20,B=(40*y+20*b+w)/20,x=kd(180*Math.atan2(C,E)/Math.PI),P=x*Math.PI/180,D=B*t.nbb,S=100*Math.pow(D/t.aw,t.c*t.z),k=4/t.c*Math.sqrt(S/100)*(t.aw+4)*t.fLRoot,R=x<20.14?x+360:x,Q=5e4/13*(.25*(Math.cos(R*Math.PI/180+2)+3.8))*t.nc*t.ncb*Math.sqrt(E*E+C*C)/(I+.305),M=Math.pow(Q,.9)*Math.pow(1.64-Math.pow(.29,t.n),.73),H=M*Math.sqrt(S/100),O=H*t.fLRoot,T=50*Math.sqrt(M*t.c/(t.aw+4)),L=(1+100*.007)*S/(1+.007*S),q=1/.0228*Math.log(1+.0228*O),U=q*Math.cos(P),F=q*Math.sin(P);return new _d(x,H,S,k,O,T,L,U,F)}static fromJch(e,t,r){return _d.fromJchInViewingConditions(e,t,r,Zd.DEFAULT)}static fromJchInViewingConditions(e,t,r,i){const s=4/i.c*Math.sqrt(e/100)*(i.aw+4)*i.fLRoot,o=t*i.fLRoot,n=t/Math.sqrt(e/100),a=50*Math.sqrt(n*i.c/(i.aw+4)),l=r*Math.PI/180,c=(1+100*.007)*e/(1+.007*e),A=1/.0228*Math.log(1+.0228*o),d=A*Math.cos(l),u=A*Math.sin(l);return new _d(r,t,e,s,o,a,c,d,u)}static fromUcs(e,t,r){return _d.fromUcsInViewingConditions(e,t,r,Zd.DEFAULT)}static fromUcsInViewingConditions(e,t,r,i){const s=t,o=r,n=Math.sqrt(s*s+o*o),a=(Math.exp(.0228*n)-1)/.0228/i.fLRoot;let l=Math.atan2(o,s)*(180/Math.PI);l<0&&(l+=360);const c=e/(1-.007*(e-100));return _d.fromJchInViewingConditions(c,a,l,i)}toInt(){return this.viewed(Zd.DEFAULT)}viewed(e){const t=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(t/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),i=this.hue*Math.PI/180,s=.25*(Math.cos(i+2)+3.8),o=e.aw*Math.pow(this.j/100,1/e.c/e.z),n=s*(5e4/13)*e.nc*e.ncb,a=o/e.nbb,l=Math.sin(i),c=Math.cos(i),A=23*(a+.305)*r/(23*n+11*r*c+108*r*l),d=A*c,u=A*l,h=(460*a+451*d+288*u)/1403,p=(460*a-891*d-261*u)/1403,g=(460*a-220*d-6300*u)/1403,m=Math.max(0,27.13*Math.abs(h)/(400-Math.abs(h))),v=xd(h)*(100/e.fl)*Math.pow(m,1/.42),f=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),y=xd(p)*(100/e.fl)*Math.pow(f,1/.42),b=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),w=xd(g)*(100/e.fl)*Math.pow(b,1/.42),E=v/e.rgbD[0],C=y/e.rgbD[1],I=w/e.rgbD[2];return zd(1.86206786*E-1.01125463*C+.14918677*I,.38752654*E+.62144744*C-.00897398*I,-.0158415*E-.03412294*C+1.04996444*I)}static fromXyzInViewingConditions(e,t,r,i){const s=.401288*e+.650173*t-.051461*r,o=-.250268*e+1.204414*t+.045854*r,n=-.002079*e+.048952*t+.953127*r,a=i.rgbD[0]*s,l=i.rgbD[1]*o,c=i.rgbD[2]*n,A=Math.pow(i.fl*Math.abs(a)/100,.42),d=Math.pow(i.fl*Math.abs(l)/100,.42),u=Math.pow(i.fl*Math.abs(c)/100,.42),h=400*xd(a)*A/(A+27.13),p=400*xd(l)*d/(d+27.13),g=400*xd(c)*u/(u+27.13),m=(11*h+-12*p+g)/11,v=(h+p-2*g)/9,f=(20*h+20*p+21*g)/20,y=(40*h+20*p+g)/20,b=180*Math.atan2(v,m)/Math.PI,w=b<0?b+360:b>=360?b-360:b,E=w*Math.PI/180,C=y*i.nbb,I=100*Math.pow(C/i.aw,i.c*i.z),B=4/i.c*Math.sqrt(I/100)*(i.aw+4)*i.fLRoot,x=w<20.14?w+360:w,P=5e4/13*(1/4*(Math.cos(x*Math.PI/180+2)+3.8))*i.nc*i.ncb*Math.sqrt(m*m+v*v)/(f+.305),D=Math.pow(P,.9)*Math.pow(1.64-Math.pow(.29,i.n),.73),S=D*Math.sqrt(I/100),k=S*i.fLRoot,R=50*Math.sqrt(D*i.c/(i.aw+4)),Q=(1+100*.007)*I/(1+.007*I),M=Math.log(1+.0228*k)/.0228,H=M*Math.cos(E),O=M*Math.sin(E);return new _d(w,S,I,B,k,R,Q,H,O)}xyzInViewingConditions(e){const t=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(t/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),i=this.hue*Math.PI/180,s=.25*(Math.cos(i+2)+3.8),o=e.aw*Math.pow(this.j/100,1/e.c/e.z),n=s*(5e4/13)*e.nc*e.ncb,a=o/e.nbb,l=Math.sin(i),c=Math.cos(i),A=23*(a+.305)*r/(23*n+11*r*c+108*r*l),d=A*c,u=A*l,h=(460*a+451*d+288*u)/1403,p=(460*a-891*d-261*u)/1403,g=(460*a-220*d-6300*u)/1403,m=Math.max(0,27.13*Math.abs(h)/(400-Math.abs(h))),v=xd(h)*(100/e.fl)*Math.pow(m,1/.42),f=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),y=xd(p)*(100/e.fl)*Math.pow(f,1/.42),b=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),w=xd(g)*(100/e.fl)*Math.pow(b,1/.42),E=v/e.rgbD[0],C=y/e.rgbD[1],I=w/e.rgbD[2];return[1.86206786*E-1.01125463*C+.14918677*I,.38752654*E+.62144744*C-.00897398*I,-.0158415*E-.03412294*C+1.04996444*I]}}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class $d{static sanitizeRadians(e){return(e+8*Math.PI)%(2*Math.PI)}static trueDelinearized(e){const t=e/100;let r=0;return r=t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,255*r}static chromaticAdaptation(e){const t=Math.pow(Math.abs(e),.42);return 400*xd(e)*t/(t+27.13)}static hueOf(e){const t=Qd(e,$d.SCALED_DISCOUNT_FROM_LINRGB),r=$d.chromaticAdaptation(t[0]),i=$d.chromaticAdaptation(t[1]),s=$d.chromaticAdaptation(t[2]),o=(11*r+-12*i+s)/11,n=(r+i-2*s)/9;return Math.atan2(n,o)}static areInCyclicOrder(e,t,r){return $d.sanitizeRadians(t-e)<$d.sanitizeRadians(r-e)}static intercept(e,t,r){return(t-e)/(r-e)}static lerpPoint(e,t,r){return[e[0]+(r[0]-e[0])*t,e[1]+(r[1]-e[1])*t,e[2]+(r[2]-e[2])*t]}static setCoordinate(e,t,r,i){const s=$d.intercept(e[i],t,r[i]);return $d.lerpPoint(e,s,r)}static isBounded(e){return 0<=e&&e<=100}static nthVertex(e,t){const r=$d.Y_FROM_LINRGB[0],i=$d.Y_FROM_LINRGB[1],s=$d.Y_FROM_LINRGB[2],o=t%4<=1?0:100,n=t%2==0?0:100;if(t<4){const t=o,a=n,l=(e-t*i-a*s)/r;return $d.isBounded(l)?[l,t,a]:[-1,-1,-1]}if(t<8){const t=o,a=n,l=(e-a*r-t*s)/i;return $d.isBounded(l)?[a,l,t]:[-1,-1,-1]}{const t=o,a=n,l=(e-t*r-a*i)/s;return $d.isBounded(l)?[t,a,l]:[-1,-1,-1]}}static bisectToSegment(e,t){let r=[-1,-1,-1],i=r,s=0,o=0,n=!1,a=!0;for(let l=0;l<12;l++){const c=$d.nthVertex(e,l);if(c[0]<0)continue;const A=$d.hueOf(c);n?(a||$d.areInCyclicOrder(s,A,o))&&(a=!1,$d.areInCyclicOrder(s,t,A)?(i=c,o=A):(r=c,s=A)):(r=c,i=c,s=A,o=A,n=!0)}return[r,i]}static midpoint(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2,(e[2]+t[2])/2]}static criticalPlaneBelow(e){return Math.floor(e-.5)}static criticalPlaneAbove(e){return Math.ceil(e-.5)}static bisectToLimit(e,t){const r=$d.bisectToSegment(e,t);let i=r[0],s=$d.hueOf(i),o=r[1];for(let e=0;e<3;e++)if(i[e]!==o[e]){let r=-1,n=255;i[e]<o[e]?(r=$d.criticalPlaneBelow($d.trueDelinearized(i[e])),n=$d.criticalPlaneAbove($d.trueDelinearized(o[e]))):(r=$d.criticalPlaneAbove($d.trueDelinearized(i[e])),n=$d.criticalPlaneBelow($d.trueDelinearized(o[e])));for(let a=0;a<8&&!(Math.abs(n-r)<=1);a++){const a=Math.floor((r+n)/2),l=$d.CRITICAL_PLANES[a],c=$d.setCoordinate(i,l,o,e),A=$d.hueOf(c);$d.areInCyclicOrder(s,t,A)?(o=c,n=a):(i=c,s=A,r=a)}}return $d.midpoint(i,o)}static inverseChromaticAdaptation(e){const t=Math.abs(e),r=Math.max(0,27.13*t/(400-t));return xd(e)*Math.pow(r,1/.42)}static findResultByJ(e,t,r){let i=11*Math.sqrt(r);const s=Zd.DEFAULT,o=1/Math.pow(1.64-Math.pow(.29,s.n),.73),n=.25*(Math.cos(e+2)+3.8)*(5e4/13)*s.nc*s.ncb,a=Math.sin(e),l=Math.cos(e);for(let e=0;e<5;e++){const c=i/100,A=0===t||0===i?0:t/Math.sqrt(c),d=Math.pow(A*o,1/.9),u=s.aw*Math.pow(c,1/s.c/s.z)/s.nbb,h=23*(u+.305)*d/(23*n+11*d*l+108*d*a),p=h*l,g=h*a,m=(460*u+451*p+288*g)/1403,v=(460*u-891*p-261*g)/1403,f=(460*u-220*p-6300*g)/1403,y=Qd([$d.inverseChromaticAdaptation(m),$d.inverseChromaticAdaptation(v),$d.inverseChromaticAdaptation(f)],$d.LINRGB_FROM_SCALED_DISCOUNT);if(y[0]<0||y[1]<0||y[2]<0)return 0;const b=$d.Y_FROM_LINRGB[0],w=$d.Y_FROM_LINRGB[1],E=$d.Y_FROM_LINRGB[2],C=b*y[0]+w*y[1]+E*y[2];if(C<=0)return 0;if(4===e||Math.abs(C-r)<.002)return y[0]>100.01||y[1]>100.01||y[2]>100.01?0:Ld(y);i-=(C-r)*i/(2*C)}return 0}static solveToInt(e,t,r){if(t<1e-4||r<1e-4||r>99.9999)return function(e){const t=Kd(Nd(e));return Td(t,t,t)}(r);const i=(e=kd(e))/180*Math.PI,s=Nd(r),o=$d.findResultByJ(i,t,s);if(0!==o)return o;return Ld($d.bisectToLimit(s,i))}static solveToCam(e,t,r){return _d.fromInt($d.solveToInt(e,t,r))}}$d.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],$d.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],$d.Y_FROM_LINRGB=[.2126,.7152,.0722],$d.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776];
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class eu{static from(e,t,r){return new eu($d.solveToInt(e,t,r))}static fromInt(e){return new eu(e)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState($d.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState($d.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState($d.solveToInt(this.internalHue,this.internalChroma,e))}setValue(e,t){this[e]=t}toString(){return`HCT(${this.hue.toFixed(0)}, ${this.chroma.toFixed(0)}, ${this.tone.toFixed(0)})`}static isBlue(e){return e>=250&&e<270}static isYellow(e){return e>=105&&e<125}static isCyan(e){return e>=170&&e<207}constructor(e){this.argb=e;const t=_d.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=Yd(e),this.argb=e}setInternalState(e){const t=_d.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=Yd(e),this.argb=e}inViewingConditions(e){const t=_d.fromInt(this.toInt()).xyzInViewingConditions(e),r=_d.fromXyzInViewingConditions(t[0],t[1],t[2],Zd.make());return eu.from(r.hue,r.chroma,Xd(t[1]))}}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class tu{static ratioOfTones(e,t){return e=Dd(0,100,e),t=Dd(0,100,t),tu.ratioOfYs(Nd(e),Nd(t))}static ratioOfYs(e,t){const r=e>t?e:t;return(r+5)/((r===t?e:t)+5)}static lighter(e,t){if(e<0||e>100)return-1;const r=Nd(e),i=t*(r+5)-5,s=tu.ratioOfYs(i,r),o=Math.abs(s-t);if(s<t&&o>.04)return-1;const n=Xd(i)+.4;return n<0||n>100?-1:n}static darker(e,t){if(e<0||e>100)return-1;const r=Nd(e),i=(r+5)/t-5,s=tu.ratioOfYs(r,i),o=Math.abs(s-t);if(s<t&&o>.04)return-1;const n=Xd(i)-.4;return n<0||n>100?-1:n}static lighterUnsafe(e,t){const r=tu.lighter(e,t);return r<0?100:r}static darkerUnsafe(e,t){const r=tu.darker(e,t);return r<0?0:r}}
/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ru{static isDisliked(e){const t=Math.round(e.hue)>=90&&Math.round(e.hue)<=111,r=Math.round(e.chroma)>16,i=Math.round(e.tone)<65;return t&&r&&i}static fixIfDisliked(e){return ru.isDisliked(e)?eu.from(e.hue,e.chroma,70):e}}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function iu(e,t,r){return function(e,t,r){if(e.name!==r.name)throw new Error(`Attempting to extend color ${e.name} with color ${r.name} of different name for spec version ${t}.`);if(e.isBackground!==r.isBackground)throw new Error(`Attempting to extend color ${e.name} as a ${e.isBackground?"background":"foreground"} with color ${r.name} as a ${r.isBackground?"background":"foreground"} for spec version ${t}.`)}(e,t,r),su.fromPalette({name:e.name,palette:i=>i.specVersion>=t?r.palette(i):e.palette(i),tone:i=>i.specVersion>=t?r.tone(i):e.tone(i),isBackground:e.isBackground,chromaMultiplier:i=>{const s=i.specVersion>=t?r.chromaMultiplier:e.chromaMultiplier;return void 0!==s?s(i):1},background:i=>{const s=i.specVersion>=t?r.background:e.background;return void 0!==s?s(i):void 0},secondBackground:i=>{const s=i.specVersion>=t?r.secondBackground:e.secondBackground;return void 0!==s?s(i):void 0},contrastCurve:i=>{const s=i.specVersion>=t?r.contrastCurve:e.contrastCurve;return void 0!==s?s(i):void 0},toneDeltaPair:i=>{const s=i.specVersion>=t?r.toneDeltaPair:e.toneDeltaPair;return void 0!==s?s(i):void 0}})}class su{static fromPalette(e){return new su(e.name??"",e.palette,e.tone??su.getInitialToneFromBackground(e.background),e.isBackground??!1,e.chromaMultiplier,e.background,e.secondBackground,e.contrastCurve,e.toneDeltaPair)}static getInitialToneFromBackground(e){return void 0===e?e=>50:t=>e(t)?e(t).getTone(t):50}constructor(e,t,r,i,s,o,n,a,l){if(this.name=e,this.palette=t,this.tone=r,this.isBackground=i,this.chromaMultiplier=s,this.background=o,this.secondBackground=n,this.contrastCurve=a,this.toneDeltaPair=l,this.hctCache=new Map,!o&&n)throw new Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);if(!o&&a)throw new Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);if(o&&!a)throw new Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`)}clone(){return su.fromPalette({name:this.name,palette:this.palette,tone:this.tone,isBackground:this.isBackground,chromaMultiplier:this.chromaMultiplier,background:this.background,secondBackground:this.secondBackground,contrastCurve:this.contrastCurve,toneDeltaPair:this.toneDeltaPair})}clearCache(){this.hctCache.clear()}getArgb(e){return this.getHct(e).toInt()}getHct(e){const t=this.hctCache.get(e);if(null!=t)return t;const r=au(e.specVersion).getHct(e,this);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,r),r}getTone(e){return au(e.specVersion).getTone(e,this)}static foregroundTone(e,t){const r=tu.lighterUnsafe(e,t),i=tu.darkerUnsafe(e,t),s=tu.ratioOfTones(r,e),o=tu.ratioOfTones(i,e);if(su.tonePrefersLightForeground(e)){const e=Math.abs(s-o)<.1&&s<t&&o<t;return s>=t||s>=o||e?r:i}return o>=t||o>=s?i:r}static tonePrefersLightForeground(e){return Math.round(e)<60}static toneAllowsLightForeground(e){return Math.round(e)<=49}static enableLightForeground(e){return su.tonePrefersLightForeground(e)&&!su.toneAllowsLightForeground(e)?49:e}}const ou=new class{getHct(e,t){const r=t.getTone(e);return t.palette(e).getHct(r)}getTone(e,t){const r=e.contrastLevel<0,i=t.toneDeltaPair?t.toneDeltaPair(e):void 0;if(i){const s=i.roleA,o=i.roleB,n=i.delta,a=i.polarity,l=i.stayTogether,c="nearer"===a||"lighter"===a&&!e.isDark||"darker"===a&&e.isDark,A=c?s:o,d=c?o:s,u=t.name===A.name,h=e.isDark?1:-1;let p=A.tone(e),g=d.tone(e);if(t.background&&A.contrastCurve&&d.contrastCurve){const i=t.background(e),s=A.contrastCurve(e),o=d.contrastCurve(e);if(i&&s&&o){const t=i.getTone(e),n=s.get(e.contrastLevel),a=o.get(e.contrastLevel);tu.ratioOfTones(t,p)<n&&(p=su.foregroundTone(t,n)),tu.ratioOfTones(t,g)<a&&(g=su.foregroundTone(t,a)),r&&(p=su.foregroundTone(t,n),g=su.foregroundTone(t,a))}}return(g-p)*h<n&&(g=Dd(0,100,p+n*h),(g-p)*h>=n||(p=Dd(0,100,g-n*h))),50<=p&&p<60?h>0?(p=60,g=Math.max(g,p+n*h)):(p=49,g=Math.min(g,p+n*h)):50<=g&&g<60&&(l?h>0?(p=60,g=Math.max(g,p+n*h)):(p=49,g=Math.min(g,p+n*h)):g=h>0?60:49),u?p:g}{let i=t.tone(e);if(null==t.background||void 0===t.background(e)||null==t.contrastCurve||void 0===t.contrastCurve(e))return i;const s=t.background(e).getTone(e),o=t.contrastCurve(e).get(e.contrastLevel);if(tu.ratioOfTones(s,i)>=o||(i=su.foregroundTone(s,o)),r&&(i=su.foregroundTone(s,o)),t.isBackground&&50<=i&&i<60&&(i=tu.ratioOfTones(49,s)>=o?49:60),null==t.secondBackground||void 0===t.secondBackground(e))return i;const[n,a]=[t.background,t.secondBackground],[l,c]=[n(e).getTone(e),a(e).getTone(e)],[A,d]=[Math.max(l,c),Math.min(l,c)];if(tu.ratioOfTones(A,i)>=o&&tu.ratioOfTones(d,i)>=o)return i;const u=tu.lighter(A,o),h=tu.darker(d,o),p=[];-1!==u&&p.push(u),-1!==h&&p.push(h);return su.tonePrefersLightForeground(l)||su.tonePrefersLightForeground(c)?u<0?100:u:1===p.length?p[0]:h<0?0:h}}},nu=new class{getHct(e,t){const r=t.palette(e),i=t.getTone(e),s=r.hue,o=r.chroma*(t.chromaMultiplier?t.chromaMultiplier(e):1);return eu.from(s,o,i)}getTone(e,t){const r=t.toneDeltaPair?t.toneDeltaPair(e):void 0;if(r){const i=r.roleA,s=r.roleB,o=r.polarity,n=r.constraint,a="darker"===o||"relative_lighter"===o&&e.isDark||"relative_darker"===o&&!e.isDark?-r.delta:r.delta,l=t.name===i.name,c=l?s:i;let A=(l?i:s).tone(e),d=c.getTone(e);const u=a*(l?1:-1);if("exact"===n?A=Dd(0,100,d+u):"nearer"===n?A=Dd(0,100,u>0?Dd(d,d+u,A):Dd(d+u,d,A)):"farther"===n&&(A=u>0?Dd(d+u,100,A):Dd(0,d+u,A)),t.background&&t.contrastCurve){const r=t.background(e),i=t.contrastCurve(e);if(r&&i){const t=r.getTone(e),s=i.get(e.contrastLevel);A=tu.ratioOfTones(t,A)>=s&&e.contrastLevel>=0?A:su.foregroundTone(t,s)}}return t.isBackground&&!t.name.endsWith("_fixed_dim")&&(A=A>=57?Dd(65,100,A):Dd(0,49,A)),A}{let r=t.tone(e);if(null==t.background||void 0===t.background(e)||null==t.contrastCurve||void 0===t.contrastCurve(e))return r;const i=t.background(e).getTone(e),s=t.contrastCurve(e).get(e.contrastLevel);if(r=tu.ratioOfTones(i,r)>=s&&e.contrastLevel>=0?r:su.foregroundTone(i,s),t.isBackground&&!t.name.endsWith("_fixed_dim")&&(r=r>=57?Dd(65,100,r):Dd(0,49,r)),null==t.secondBackground||void 0===t.secondBackground(e))return r;const[o,n]=[t.background,t.secondBackground],[a,l]=[o(e).getTone(e),n(e).getTone(e)],[c,A]=[Math.max(a,l),Math.min(a,l)];if(tu.ratioOfTones(c,r)>=s&&tu.ratioOfTones(A,r)>=s)return r;const d=tu.lighter(c,s),u=tu.darker(A,s),h=[];-1!==d&&h.push(d),-1!==u&&h.push(u);return su.tonePrefersLightForeground(a)||su.tonePrefersLightForeground(l)?d<0?100:d:1===h.length?h[0]:u<0?0:u}}};function au(e){return"2021"===e?ou:nu}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class lu{static fromInt(e){const t=eu.fromInt(e);return lu.fromHct(t)}static fromHct(e){return new lu(e.hue,e.chroma,e)}static fromHueAndChroma(e,t){const r=new cu(e,t).create();return new lu(e,t,r)}constructor(e,t,r){this.hue=e,this.chroma=t,this.keyColor=r,this.cache=new Map}tone(e){let t=this.cache.get(e);return void 0===t&&(t=99==e&&eu.isYellow(this.hue)?this.averageArgb(this.tone(98),this.tone(100)):eu.from(this.hue,this.chroma,e).toInt(),this.cache.set(e,t)),t}getHct(e){return eu.fromInt(this.tone(e))}averageArgb(e,t){const r=e>>>16&255,i=e>>>8&255,s=255&e,o=t>>>16&255,n=t>>>8&255,a=255&t;return(255<<24|(255&Math.round((r+o)/2))<<16|(255&Math.round((i+n)/2))<<8|255&Math.round((s+a)/2))>>>0}}class cu{constructor(e,t){this.hue=e,this.requestedChroma=t,this.chromaCache=new Map,this.maxChromaValue=200}create(){let e=0,t=100;for(;e<t;){const r=Math.floor((e+t)/2),i=this.maxChroma(r)<this.maxChroma(r+1);if(this.maxChroma(r)>=this.requestedChroma-.01)if(Math.abs(e-50)<Math.abs(t-50))t=r;else{if(e===r)return eu.from(this.hue,this.requestedChroma,e);e=r}else i?e=r+1:t=r}return eu.from(this.hue,this.requestedChroma,e)}maxChroma(e){if(this.chromaCache.has(e))return this.chromaCache.get(e);const t=eu.from(this.hue,this.maxChromaValue,e).chroma;return this.chromaCache.set(e,t),t}}
/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Au{constructor(e){this.input=e,this.hctsByTempCache=[],this.hctsByHueCache=[],this.tempsByHctCache=new Map,this.inputRelativeTemperatureCache=-1,this.complementCache=null}get hctsByTemp(){if(this.hctsByTempCache.length>0)return this.hctsByTempCache;const e=this.hctsByHue.concat([this.input]),t=this.tempsByHct;return e.sort((e,r)=>t.get(e)-t.get(r)),this.hctsByTempCache=e,e}get warmest(){return this.hctsByTemp[this.hctsByTemp.length-1]}get coldest(){return this.hctsByTemp[0]}analogous(e=5,t=12){const r=Math.round(this.input.hue),i=this.hctsByHue[r];let s=this.relativeTemperature(i);const o=[i];let n=0;for(let e=0;e<360;e++){const t=Sd(r+e),i=this.hctsByHue[t],o=this.relativeTemperature(i),a=Math.abs(o-s);s=o,n+=a}let a=1;const l=n/t;let c=0;for(s=this.relativeTemperature(i);o.length<t;){const e=Sd(r+a),i=this.hctsByHue[e],n=this.relativeTemperature(i);c+=Math.abs(n-s);let A=c>=o.length*l,d=1;for(;A&&o.length<t;){o.push(i);A=c>=(o.length+d)*l,d++}if(s=n,a++,a>360){for(;o.length<t;)o.push(i);break}}const A=[this.input],d=Math.floor((e-1)/2);for(let e=1;e<d+1;e++){let t=0-e;for(;t<0;)t=o.length+t;t>=o.length&&(t%=o.length),A.splice(0,0,o[t])}const u=e-d-1;for(let e=1;e<u+1;e++){let t=e;for(;t<0;)t=o.length+t;t>=o.length&&(t%=o.length),A.push(o[t])}return A}get complement(){if(null!=this.complementCache)return this.complementCache;const e=this.coldest.hue,t=this.tempsByHct.get(this.coldest),r=this.warmest.hue,i=this.tempsByHct.get(this.warmest)-t,s=Au.isBetween(this.input.hue,e,r),o=s?r:e,n=s?e:r;let a=1e3,l=this.hctsByHue[Math.round(this.input.hue)];const c=1-this.inputRelativeTemperature;for(let e=0;e<=360;e+=1){const r=kd(o+1*e);if(!Au.isBetween(r,o,n))continue;const s=this.hctsByHue[Math.round(r)],A=(this.tempsByHct.get(s)-t)/i,d=Math.abs(c-A);d<a&&(a=d,l=s)}return this.complementCache=l,this.complementCache}relativeTemperature(e){const t=this.tempsByHct.get(this.warmest)-this.tempsByHct.get(this.coldest),r=this.tempsByHct.get(e)-this.tempsByHct.get(this.coldest);return 0===t?.5:r/t}get inputRelativeTemperature(){return this.inputRelativeTemperatureCache>=0||(this.inputRelativeTemperatureCache=this.relativeTemperature(this.input)),this.inputRelativeTemperatureCache}get tempsByHct(){if(this.tempsByHctCache.size>0)return this.tempsByHctCache;const e=this.hctsByHue.concat([this.input]),t=new Map;for(const r of e)t.set(r,Au.rawTemperature(r));return this.tempsByHctCache=t,t}get hctsByHue(){if(this.hctsByHueCache.length>0)return this.hctsByHueCache;const e=[];for(let t=0;t<=360;t+=1){const r=eu.from(t,this.input.chroma,this.input.tone);e.push(r)}return this.hctsByHueCache=e,this.hctsByHueCache}static isBetween(e,t,r){return t<r?t<=e&&e<=r:t<=e||e<=r}static rawTemperature(e){const t=Jd(e.toInt()),r=kd(180*Math.atan2(t[2],t[1])/Math.PI),i=Math.sqrt(t[1]*t[1]+t[2]*t[2]);return.02*Math.pow(i,1.07)*Math.cos(kd(r-50)*Math.PI/180)-.5}}
/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class du{constructor(e,t,r,i){this.low=e,this.normal=t,this.medium=r,this.high=i}get(e){return e<=-1?this.low:e<0?Pd(this.low,this.normal,(e- -1)/1):e<.5?Pd(this.normal,this.medium,(e-0)/.5):e<1?Pd(this.medium,this.high,(e-.5)/.5):this.high}}
/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class uu{constructor(e,t,r,i,s,o){this.roleA=e,this.roleB=t,this.delta=r,this.polarity=i,this.stayTogether=s,this.constraint=o,this.constraint=o??"exact"}}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */var hu;
/**
 * @license
 * Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function pu(e){return e.variant===hu.FIDELITY||e.variant===hu.CONTENT}function gu(e){return e.variant===hu.MONOCHROME}!function(e){e[e.MONOCHROME=0]="MONOCHROME",e[e.NEUTRAL=1]="NEUTRAL",e[e.TONAL_SPOT=2]="TONAL_SPOT",e[e.VIBRANT=3]="VIBRANT",e[e.EXPRESSIVE=4]="EXPRESSIVE",e[e.FIDELITY=5]="FIDELITY",e[e.CONTENT=6]="CONTENT",e[e.RAINBOW=7]="RAINBOW",e[e.FRUIT_SALAD=8]="FRUIT_SALAD",e[e.CMF=9]="CMF"}(hu||(hu={}));class mu{primaryPaletteKeyColor(){return su.fromPalette({name:"primary_palette_key_color",palette:e=>e.primaryPalette,tone:e=>e.primaryPalette.keyColor.tone})}secondaryPaletteKeyColor(){return su.fromPalette({name:"secondary_palette_key_color",palette:e=>e.secondaryPalette,tone:e=>e.secondaryPalette.keyColor.tone})}tertiaryPaletteKeyColor(){return su.fromPalette({name:"tertiary_palette_key_color",palette:e=>e.tertiaryPalette,tone:e=>e.tertiaryPalette.keyColor.tone})}neutralPaletteKeyColor(){return su.fromPalette({name:"neutral_palette_key_color",palette:e=>e.neutralPalette,tone:e=>e.neutralPalette.keyColor.tone})}neutralVariantPaletteKeyColor(){return su.fromPalette({name:"neutral_variant_palette_key_color",palette:e=>e.neutralVariantPalette,tone:e=>e.neutralVariantPalette.keyColor.tone})}errorPaletteKeyColor(){return su.fromPalette({name:"error_palette_key_color",palette:e=>e.errorPalette,tone:e=>e.errorPalette.keyColor.tone})}background(){return su.fromPalette({name:"background",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0})}onBackground(){return su.fromPalette({name:"on_background",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>this.background(),contrastCurve:e=>new du(3,3,4.5,7)})}surface(){return su.fromPalette({name:"surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0})}surfaceDim(){return su.fromPalette({name:"surface_dim",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:new du(87,87,80,75).get(e.contrastLevel),isBackground:!0})}surfaceBright(){return su.fromPalette({name:"surface_bright",palette:e=>e.neutralPalette,tone:e=>e.isDark?new du(24,24,29,34).get(e.contrastLevel):98,isBackground:!0})}surfaceContainerLowest(){return su.fromPalette({name:"surface_container_lowest",palette:e=>e.neutralPalette,tone:e=>e.isDark?new du(4,4,2,0).get(e.contrastLevel):100,isBackground:!0})}surfaceContainerLow(){return su.fromPalette({name:"surface_container_low",palette:e=>e.neutralPalette,tone:e=>e.isDark?new du(10,10,11,12).get(e.contrastLevel):new du(96,96,96,95).get(e.contrastLevel),isBackground:!0})}surfaceContainer(){return su.fromPalette({name:"surface_container",palette:e=>e.neutralPalette,tone:e=>e.isDark?new du(12,12,16,20).get(e.contrastLevel):new du(94,94,92,90).get(e.contrastLevel),isBackground:!0})}surfaceContainerHigh(){return su.fromPalette({name:"surface_container_high",palette:e=>e.neutralPalette,tone:e=>e.isDark?new du(17,17,21,25).get(e.contrastLevel):new du(92,92,88,85).get(e.contrastLevel),isBackground:!0})}surfaceContainerHighest(){return su.fromPalette({name:"surface_container_highest",palette:e=>e.neutralPalette,tone:e=>e.isDark?new du(22,22,26,30).get(e.contrastLevel):new du(90,90,84,80).get(e.contrastLevel),isBackground:!0})}onSurface(){return su.fromPalette({name:"on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>this.highestSurface(e),contrastCurve:e=>new du(4.5,7,11,21)})}surfaceVariant(){return su.fromPalette({name:"surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:90,isBackground:!0})}onSurfaceVariant(){return su.fromPalette({name:"on_surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?80:30,background:e=>this.highestSurface(e),contrastCurve:e=>new du(3,4.5,7,11)})}inverseSurface(){return su.fromPalette({name:"inverse_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:20,isBackground:!0})}inverseOnSurface(){return su.fromPalette({name:"inverse_on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?20:95,background:e=>this.inverseSurface(),contrastCurve:e=>new du(4.5,7,11,21)})}outline(){return su.fromPalette({name:"outline",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?60:50,background:e=>this.highestSurface(e),contrastCurve:e=>new du(1.5,3,4.5,7)})}outlineVariant(){return su.fromPalette({name:"outline_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:80,background:e=>this.highestSurface(e),contrastCurve:e=>new du(1,1,3,4.5)})}shadow(){return su.fromPalette({name:"shadow",palette:e=>e.neutralPalette,tone:e=>0})}scrim(){return su.fromPalette({name:"scrim",palette:e=>e.neutralPalette,tone:e=>0})}surfaceTint(){return su.fromPalette({name:"surface_tint",palette:e=>e.primaryPalette,tone:e=>e.isDark?80:40,isBackground:!0})}primary(){return su.fromPalette({name:"primary",palette:e=>e.primaryPalette,tone:e=>gu(e)?e.isDark?100:0:e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(3,4.5,7,7),toneDeltaPair:e=>new uu(this.primaryContainer(),this.primary(),10,"nearer",!1)})}primaryDim(){}onPrimary(){return su.fromPalette({name:"on_primary",palette:e=>e.primaryPalette,tone:e=>gu(e)?e.isDark?10:90:e.isDark?20:100,background:e=>this.primary(),contrastCurve:e=>new du(4.5,7,11,21)})}primaryContainer(){return su.fromPalette({name:"primary_container",palette:e=>e.primaryPalette,tone:e=>pu(e)?e.sourceColorHct.tone:gu(e)?e.isDark?85:25:e.isDark?30:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(1,1,3,4.5),toneDeltaPair:e=>new uu(this.primaryContainer(),this.primary(),10,"nearer",!1)})}onPrimaryContainer(){return su.fromPalette({name:"on_primary_container",palette:e=>e.primaryPalette,tone:e=>pu(e)?su.foregroundTone(this.primaryContainer().tone(e),4.5):gu(e)?e.isDark?0:100:e.isDark?90:30,background:e=>this.primaryContainer(),contrastCurve:e=>new du(3,4.5,7,11)})}inversePrimary(){return su.fromPalette({name:"inverse_primary",palette:e=>e.primaryPalette,tone:e=>e.isDark?40:80,background:e=>this.inverseSurface(),contrastCurve:e=>new du(3,4.5,7,7)})}secondary(){return su.fromPalette({name:"secondary",palette:e=>e.secondaryPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(3,4.5,7,7),toneDeltaPair:e=>new uu(this.secondaryContainer(),this.secondary(),10,"nearer",!1)})}secondaryDim(){}onSecondary(){return su.fromPalette({name:"on_secondary",palette:e=>e.secondaryPalette,tone:e=>gu(e)?e.isDark?10:100:e.isDark?20:100,background:e=>this.secondary(),contrastCurve:e=>new du(4.5,7,11,21)})}secondaryContainer(){return su.fromPalette({name:"secondary_container",palette:e=>e.secondaryPalette,tone:e=>{const t=e.isDark?30:90;return gu(e)?e.isDark?30:85:pu(e)?function(e,t,r,i){let s=r,o=eu.from(e,t,r);if(o.chroma<t){let r=o.chroma;for(;o.chroma<t;){s+=i?-1:1;const n=eu.from(e,t,s);if(r>n.chroma)break;if(Math.abs(n.chroma-t)<.4)break;Math.abs(n.chroma-t)<Math.abs(o.chroma-t)&&(o=n),r=Math.max(r,n.chroma)}}return s}(e.secondaryPalette.hue,e.secondaryPalette.chroma,t,!e.isDark):t},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(1,1,3,4.5),toneDeltaPair:e=>new uu(this.secondaryContainer(),this.secondary(),10,"nearer",!1)})}onSecondaryContainer(){return su.fromPalette({name:"on_secondary_container",palette:e=>e.secondaryPalette,tone:e=>gu(e)?e.isDark?90:10:pu(e)?su.foregroundTone(this.secondaryContainer().tone(e),4.5):e.isDark?90:30,background:e=>this.secondaryContainer(),contrastCurve:e=>new du(3,4.5,7,11)})}tertiary(){return su.fromPalette({name:"tertiary",palette:e=>e.tertiaryPalette,tone:e=>gu(e)?e.isDark?90:25:e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(3,4.5,7,7),toneDeltaPair:e=>new uu(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1)})}tertiaryDim(){}onTertiary(){return su.fromPalette({name:"on_tertiary",palette:e=>e.tertiaryPalette,tone:e=>gu(e)?e.isDark?10:90:e.isDark?20:100,background:e=>this.tertiary(),contrastCurve:e=>new du(4.5,7,11,21)})}tertiaryContainer(){return su.fromPalette({name:"tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>{if(gu(e))return e.isDark?60:49;if(!pu(e))return e.isDark?30:90;const t=e.tertiaryPalette.getHct(e.sourceColorHct.tone);return ru.fixIfDisliked(t).tone},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(1,1,3,4.5),toneDeltaPair:e=>new uu(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1)})}onTertiaryContainer(){return su.fromPalette({name:"on_tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>gu(e)?e.isDark?0:100:pu(e)?su.foregroundTone(this.tertiaryContainer().tone(e),4.5):e.isDark?90:30,background:e=>this.tertiaryContainer(),contrastCurve:e=>new du(3,4.5,7,11)})}error(){return su.fromPalette({name:"error",palette:e=>e.errorPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(3,4.5,7,7),toneDeltaPair:e=>new uu(this.errorContainer(),this.error(),10,"nearer",!1)})}errorDim(){}onError(){return su.fromPalette({name:"on_error",palette:e=>e.errorPalette,tone:e=>e.isDark?20:100,background:e=>this.error(),contrastCurve:e=>new du(4.5,7,11,21)})}errorContainer(){return su.fromPalette({name:"error_container",palette:e=>e.errorPalette,tone:e=>e.isDark?30:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(1,1,3,4.5),toneDeltaPair:e=>new uu(this.errorContainer(),this.error(),10,"nearer",!1)})}onErrorContainer(){return su.fromPalette({name:"on_error_container",palette:e=>e.errorPalette,tone:e=>gu(e)?e.isDark?90:10:e.isDark?90:30,background:e=>this.errorContainer(),contrastCurve:e=>new du(3,4.5,7,11)})}primaryFixed(){return su.fromPalette({name:"primary_fixed",palette:e=>e.primaryPalette,tone:e=>gu(e)?40:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(1,1,3,4.5),toneDeltaPair:e=>new uu(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0)})}primaryFixedDim(){return su.fromPalette({name:"primary_fixed_dim",palette:e=>e.primaryPalette,tone:e=>gu(e)?30:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(1,1,3,4.5),toneDeltaPair:e=>new uu(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0)})}onPrimaryFixed(){return su.fromPalette({name:"on_primary_fixed",palette:e=>e.primaryPalette,tone:e=>gu(e)?100:10,background:e=>this.primaryFixedDim(),secondBackground:e=>this.primaryFixed(),contrastCurve:e=>new du(4.5,7,11,21)})}onPrimaryFixedVariant(){return su.fromPalette({name:"on_primary_fixed_variant",palette:e=>e.primaryPalette,tone:e=>gu(e)?90:30,background:e=>this.primaryFixedDim(),secondBackground:e=>this.primaryFixed(),contrastCurve:e=>new du(3,4.5,7,11)})}secondaryFixed(){return su.fromPalette({name:"secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>gu(e)?80:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(1,1,3,4.5),toneDeltaPair:e=>new uu(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0)})}secondaryFixedDim(){return su.fromPalette({name:"secondary_fixed_dim",palette:e=>e.secondaryPalette,tone:e=>gu(e)?70:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(1,1,3,4.5),toneDeltaPair:e=>new uu(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0)})}onSecondaryFixed(){return su.fromPalette({name:"on_secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>10,background:e=>this.secondaryFixedDim(),secondBackground:e=>this.secondaryFixed(),contrastCurve:e=>new du(4.5,7,11,21)})}onSecondaryFixedVariant(){return su.fromPalette({name:"on_secondary_fixed_variant",palette:e=>e.secondaryPalette,tone:e=>gu(e)?25:30,background:e=>this.secondaryFixedDim(),secondBackground:e=>this.secondaryFixed(),contrastCurve:e=>new du(3,4.5,7,11)})}tertiaryFixed(){return su.fromPalette({name:"tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>gu(e)?40:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(1,1,3,4.5),toneDeltaPair:e=>new uu(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0)})}tertiaryFixedDim(){return su.fromPalette({name:"tertiary_fixed_dim",palette:e=>e.tertiaryPalette,tone:e=>gu(e)?30:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new du(1,1,3,4.5),toneDeltaPair:e=>new uu(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0)})}onTertiaryFixed(){return su.fromPalette({name:"on_tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>gu(e)?100:10,background:e=>this.tertiaryFixedDim(),secondBackground:e=>this.tertiaryFixed(),contrastCurve:e=>new du(4.5,7,11,21)})}onTertiaryFixedVariant(){return su.fromPalette({name:"on_tertiary_fixed_variant",palette:e=>e.tertiaryPalette,tone:e=>gu(e)?90:30,background:e=>this.tertiaryFixedDim(),secondBackground:e=>this.tertiaryFixed(),contrastCurve:e=>new du(3,4.5,7,11)})}highestSurface(e){return e.isDark?this.surfaceBright():this.surfaceDim()}}
/**
 * @license
 * Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function vu(e,t=0,r=100,i=1){return Dd(t,r,yu(e.hue,e.chroma*i,100,!0))}function fu(e,t=0,r=100){return Dd(t,r,yu(e.hue,e.chroma,0,!1))}function yu(e,t,r,i){let s=r,o=eu.from(e,t,s);for(;o.chroma<t&&!(r<0||r>100);){r+=i?-1:1;const n=eu.from(e,t,r);o.chroma<n.chroma&&(o=n,s=r)}return s}function bu(e){return 1.5===e?new du(1.5,1.5,3,5.5):3===e?new du(3,3,4.5,7):4.5===e?new du(4.5,4.5,7,11):6===e?new du(6,6,7,11):7===e?new du(7,7,11,21):9===e?new du(9,9,11,21):11===e?new du(11,11,21,21):21===e?new du(21,21,21,21):new du(e,e,7,21)}class wu extends mu{surface(){const e=su.fromPalette({name:"surface",palette:e=>e.neutralPalette,tone:e=>(super.surface().tone(e),"phone"===e.platform?e.isDark?4:eu.isYellow(e.neutralPalette.hue)?99:e.variant===hu.VIBRANT?97:98:0),isBackground:!0});return iu(super.surface(),"2025",e)}surfaceDim(){const e=su.fromPalette({name:"surface_dim",palette:e=>e.neutralPalette,tone:e=>e.isDark?4:eu.isYellow(e.neutralPalette.hue)?90:e.variant===hu.VIBRANT?85:87,isBackground:!0,chromaMultiplier:e=>{if(!e.isDark){if(e.variant===hu.NEUTRAL)return 2.5;if(e.variant===hu.TONAL_SPOT)return 1.7;if(e.variant===hu.EXPRESSIVE)return eu.isYellow(e.neutralPalette.hue)?2.7:1.75;if(e.variant===hu.VIBRANT)return 1.36}return 1}});return iu(super.surfaceDim(),"2025",e)}surfaceBright(){const e=su.fromPalette({name:"surface_bright",palette:e=>e.neutralPalette,tone:e=>e.isDark?18:eu.isYellow(e.neutralPalette.hue)?99:e.variant===hu.VIBRANT?97:98,isBackground:!0,chromaMultiplier:e=>{if(e.isDark){if(e.variant===hu.NEUTRAL)return 2.5;if(e.variant===hu.TONAL_SPOT)return 1.7;if(e.variant===hu.EXPRESSIVE)return eu.isYellow(e.neutralPalette.hue)?2.7:1.75;if(e.variant===hu.VIBRANT)return 1.36}return 1}});return iu(super.surfaceBright(),"2025",e)}surfaceContainerLowest(){const e=su.fromPalette({name:"surface_container_lowest",palette:e=>e.neutralPalette,tone:e=>e.isDark?0:100,isBackground:!0});return iu(super.surfaceContainerLowest(),"2025",e)}surfaceContainerLow(){const e=su.fromPalette({name:"surface_container_low",palette:e=>e.neutralPalette,tone:e=>"phone"===e.platform?e.isDark?6:eu.isYellow(e.neutralPalette.hue)?98:e.variant===hu.VIBRANT?95:96:15,isBackground:!0,chromaMultiplier:e=>{if("phone"===e.platform){if(e.variant===hu.NEUTRAL)return 1.3;if(e.variant===hu.TONAL_SPOT)return 1.25;if(e.variant===hu.EXPRESSIVE)return eu.isYellow(e.neutralPalette.hue)?1.3:1.15;if(e.variant===hu.VIBRANT)return 1.08}return 1}});return iu(super.surfaceContainerLow(),"2025",e)}surfaceContainer(){const e=su.fromPalette({name:"surface_container",palette:e=>e.neutralPalette,tone:e=>"phone"===e.platform?e.isDark?9:eu.isYellow(e.neutralPalette.hue)?96:e.variant===hu.VIBRANT?92:94:20,isBackground:!0,chromaMultiplier:e=>{if("phone"===e.platform){if(e.variant===hu.NEUTRAL)return 1.6;if(e.variant===hu.TONAL_SPOT)return 1.4;if(e.variant===hu.EXPRESSIVE)return eu.isYellow(e.neutralPalette.hue)?1.6:1.3;if(e.variant===hu.VIBRANT)return 1.15}return 1}});return iu(super.surfaceContainer(),"2025",e)}surfaceContainerHigh(){const e=su.fromPalette({name:"surface_container_high",palette:e=>e.neutralPalette,tone:e=>"phone"===e.platform?e.isDark?12:eu.isYellow(e.neutralPalette.hue)?94:e.variant===hu.VIBRANT?90:92:25,isBackground:!0,chromaMultiplier:e=>{if("phone"===e.platform){if(e.variant===hu.NEUTRAL)return 1.9;if(e.variant===hu.TONAL_SPOT)return 1.5;if(e.variant===hu.EXPRESSIVE)return eu.isYellow(e.neutralPalette.hue)?1.95:1.45;if(e.variant===hu.VIBRANT)return 1.22}return 1}});return iu(super.surfaceContainerHigh(),"2025",e)}surfaceContainerHighest(){const e=su.fromPalette({name:"surface_container_highest",palette:e=>e.neutralPalette,tone:e=>e.isDark?15:eu.isYellow(e.neutralPalette.hue)?92:e.variant===hu.VIBRANT?88:90,isBackground:!0,chromaMultiplier:e=>e.variant===hu.NEUTRAL?2.2:e.variant===hu.TONAL_SPOT?1.7:e.variant===hu.EXPRESSIVE?eu.isYellow(e.neutralPalette.hue)?2.3:1.6:e.variant===hu.VIBRANT?1.29:1});return iu(super.surfaceContainerHighest(),"2025",e)}onSurface(){const e=su.fromPalette({name:"on_surface",palette:e=>e.neutralPalette,tone:e=>e.variant===hu.VIBRANT?vu(e.neutralPalette,0,100,1.1):su.getInitialToneFromBackground(e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh())(e),chromaMultiplier:e=>{if("phone"===e.platform){if(e.variant===hu.NEUTRAL)return 2.2;if(e.variant===hu.TONAL_SPOT)return 1.7;if(e.variant===hu.EXPRESSIVE)return eu.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.isDark&&"phone"===e.platform?bu(11):bu(9)});return iu(super.onSurface(),"2025",e)}onSurfaceVariant(){const e=su.fromPalette({name:"on_surface_variant",palette:e=>e.neutralPalette,chromaMultiplier:e=>{if("phone"===e.platform){if(e.variant===hu.NEUTRAL)return 2.2;if(e.variant===hu.TONAL_SPOT)return 1.7;if(e.variant===hu.EXPRESSIVE)return eu.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?e.isDark?bu(6):bu(4.5):bu(7)});return iu(super.onSurfaceVariant(),"2025",e)}outline(){const e=su.fromPalette({name:"outline",palette:e=>e.neutralPalette,chromaMultiplier:e=>{if("phone"===e.platform){if(e.variant===hu.NEUTRAL)return 2.2;if(e.variant===hu.TONAL_SPOT)return 1.7;if(e.variant===hu.EXPRESSIVE)return eu.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?bu(3):bu(4.5)});return iu(super.outline(),"2025",e)}outlineVariant(){const e=su.fromPalette({name:"outline_variant",palette:e=>e.neutralPalette,chromaMultiplier:e=>{if("phone"===e.platform){if(e.variant===hu.NEUTRAL)return 2.2;if(e.variant===hu.TONAL_SPOT)return 1.7;if(e.variant===hu.EXPRESSIVE)return eu.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?bu(1.5):bu(3)});return iu(super.outlineVariant(),"2025",e)}inverseSurface(){const e=su.fromPalette({name:"inverse_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?98:4,isBackground:!0});return iu(super.inverseSurface(),"2025",e)}inverseOnSurface(){const e=su.fromPalette({name:"inverse_on_surface",palette:e=>e.neutralPalette,background:e=>this.inverseSurface(),contrastCurve:e=>bu(7)});return iu(super.inverseOnSurface(),"2025",e)}primary(){const e=su.fromPalette({name:"primary",palette:e=>e.primaryPalette,tone:e=>e.variant===hu.NEUTRAL?"phone"===e.platform?e.isDark?80:40:90:e.variant===hu.TONAL_SPOT?"phone"===e.platform?e.isDark?80:vu(e.primaryPalette):vu(e.primaryPalette,0,90):e.variant===hu.EXPRESSIVE?"phone"===e.platform?vu(e.primaryPalette,0,eu.isYellow(e.primaryPalette.hue)?25:eu.isCyan(e.primaryPalette.hue)?88:98):vu(e.primaryPalette):"phone"===e.platform?vu(e.primaryPalette,0,eu.isCyan(e.primaryPalette.hue)?88:98):vu(e.primaryPalette),isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?bu(4.5):bu(7),toneDeltaPair:e=>"phone"===e.platform?new uu(this.primaryContainer(),this.primary(),5,"relative_lighter",!0,"farther"):void 0});return iu(super.primary(),"2025",e)}primaryDim(){return su.fromPalette({name:"primary_dim",palette:e=>e.primaryPalette,tone:e=>e.variant===hu.NEUTRAL?85:e.variant===hu.TONAL_SPOT?vu(e.primaryPalette,0,90):vu(e.primaryPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>bu(4.5),toneDeltaPair:e=>new uu(this.primaryDim(),this.primary(),5,"darker",!0,"farther")})}onPrimary(){const e=su.fromPalette({name:"on_primary",palette:e=>e.primaryPalette,background:e=>"phone"===e.platform?this.primary():this.primaryDim(),contrastCurve:e=>"phone"===e.platform?bu(6):bu(7)});return iu(super.onPrimary(),"2025",e)}primaryContainer(){const e=su.fromPalette({name:"primary_container",palette:e=>e.primaryPalette,tone:e=>"watch"===e.platform?30:e.variant===hu.NEUTRAL?e.isDark?30:90:e.variant===hu.TONAL_SPOT?e.isDark?fu(e.primaryPalette,35,93):vu(e.primaryPalette,0,90):e.variant===hu.EXPRESSIVE?e.isDark?vu(e.primaryPalette,30,93):vu(e.primaryPalette,78,eu.isCyan(e.primaryPalette.hue)?88:90):e.isDark?fu(e.primaryPalette,66,93):vu(e.primaryPalette,66,eu.isCyan(e.primaryPalette.hue)?88:93),isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,toneDeltaPair:e=>"phone"===e.platform?void 0:new uu(this.primaryContainer(),this.primaryDim(),10,"darker",!0,"farther"),contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?bu(1.5):void 0});return iu(super.primaryContainer(),"2025",e)}onPrimaryContainer(){const e=su.fromPalette({name:"on_primary_container",palette:e=>e.primaryPalette,background:e=>this.primaryContainer(),contrastCurve:e=>"phone"===e.platform?bu(6):bu(7)});return iu(super.onPrimaryContainer(),"2025",e)}primaryFixed(){const e=su.fromPalette({name:"primary_fixed",palette:e=>e.primaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.primaryContainer().getTone(t)},isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?bu(1.5):void 0});return iu(super.primaryFixed(),"2025",e)}primaryFixedDim(){const e=su.fromPalette({name:"primary_fixed_dim",palette:e=>e.primaryPalette,tone:e=>this.primaryFixed().getTone(e),isBackground:!0,toneDeltaPair:e=>new uu(this.primaryFixedDim(),this.primaryFixed(),5,"darker",!0,"exact")});return iu(super.primaryFixedDim(),"2025",e)}onPrimaryFixed(){const e=su.fromPalette({name:"on_primary_fixed",palette:e=>e.primaryPalette,background:e=>this.primaryFixedDim(),contrastCurve:e=>bu(7)});return iu(super.onPrimaryFixed(),"2025",e)}onPrimaryFixedVariant(){const e=su.fromPalette({name:"on_primary_fixed_variant",palette:e=>e.primaryPalette,background:e=>this.primaryFixedDim(),contrastCurve:e=>bu(4.5)});return iu(super.onPrimaryFixedVariant(),"2025",e)}inversePrimary(){const e=su.fromPalette({name:"inverse_primary",palette:e=>e.primaryPalette,tone:e=>vu(e.primaryPalette),background:e=>this.inverseSurface(),contrastCurve:e=>"phone"===e.platform?bu(6):bu(7)});return iu(super.inversePrimary(),"2025",e)}secondary(){const e=su.fromPalette({name:"secondary",palette:e=>e.secondaryPalette,tone:e=>"watch"===e.platform?e.variant===hu.NEUTRAL?90:vu(e.secondaryPalette,0,90):e.variant===hu.NEUTRAL?e.isDark?fu(e.secondaryPalette,0,98):vu(e.secondaryPalette):e.variant===hu.VIBRANT?vu(e.secondaryPalette,0,e.isDark?90:98):e.isDark?80:vu(e.secondaryPalette),isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?bu(4.5):bu(7),toneDeltaPair:e=>"phone"===e.platform?new uu(this.secondaryContainer(),this.secondary(),5,"relative_lighter",!0,"farther"):void 0});return iu(super.secondary(),"2025",e)}secondaryDim(){return su.fromPalette({name:"secondary_dim",palette:e=>e.secondaryPalette,tone:e=>e.variant===hu.NEUTRAL?85:vu(e.secondaryPalette,0,90),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>bu(4.5),toneDeltaPair:e=>new uu(this.secondaryDim(),this.secondary(),5,"darker",!0,"farther")})}onSecondary(){const e=su.fromPalette({name:"on_secondary",palette:e=>e.secondaryPalette,background:e=>"phone"===e.platform?this.secondary():this.secondaryDim(),contrastCurve:e=>"phone"===e.platform?bu(6):bu(7)});return iu(super.onSecondary(),"2025",e)}secondaryContainer(){const e=su.fromPalette({name:"secondary_container",palette:e=>e.secondaryPalette,tone:e=>"watch"===e.platform?30:e.variant===hu.VIBRANT?e.isDark?fu(e.secondaryPalette,30,40):vu(e.secondaryPalette,84,90):e.variant===hu.EXPRESSIVE?e.isDark?15:vu(e.secondaryPalette,90,95):e.isDark?25:90,isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,toneDeltaPair:e=>"watch"===e.platform?new uu(this.secondaryContainer(),this.secondaryDim(),10,"darker",!0,"farther"):void 0,contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?bu(1.5):void 0});return iu(super.secondaryContainer(),"2025",e)}onSecondaryContainer(){const e=su.fromPalette({name:"on_secondary_container",palette:e=>e.secondaryPalette,background:e=>this.secondaryContainer(),contrastCurve:e=>"phone"===e.platform?bu(6):bu(7)});return iu(super.onSecondaryContainer(),"2025",e)}secondaryFixed(){const e=su.fromPalette({name:"secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.secondaryContainer().getTone(t)},isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?bu(1.5):void 0});return iu(super.secondaryFixed(),"2025",e)}secondaryFixedDim(){const e=su.fromPalette({name:"secondary_fixed_dim",palette:e=>e.secondaryPalette,tone:e=>this.secondaryFixed().getTone(e),isBackground:!0,toneDeltaPair:e=>new uu(this.secondaryFixedDim(),this.secondaryFixed(),5,"darker",!0,"exact")});return iu(super.secondaryFixedDim(),"2025",e)}onSecondaryFixed(){const e=su.fromPalette({name:"on_secondary_fixed",palette:e=>e.secondaryPalette,background:e=>this.secondaryFixedDim(),contrastCurve:e=>bu(7)});return iu(super.onSecondaryFixed(),"2025",e)}onSecondaryFixedVariant(){const e=su.fromPalette({name:"on_secondary_fixed_variant",palette:e=>e.secondaryPalette,background:e=>this.secondaryFixedDim(),contrastCurve:e=>bu(4.5)});return iu(super.onSecondaryFixedVariant(),"2025",e)}tertiary(){const e=su.fromPalette({name:"tertiary",palette:e=>e.tertiaryPalette,tone:e=>"watch"===e.platform?e.variant===hu.TONAL_SPOT?vu(e.tertiaryPalette,0,90):vu(e.tertiaryPalette):e.variant===hu.EXPRESSIVE||e.variant===hu.VIBRANT?vu(e.tertiaryPalette,0,eu.isCyan(e.tertiaryPalette.hue)?88:e.isDark?98:100):e.isDark?vu(e.tertiaryPalette,0,98):vu(e.tertiaryPalette),isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?bu(4.5):bu(7),toneDeltaPair:e=>"phone"===e.platform?new uu(this.tertiaryContainer(),this.tertiary(),5,"relative_lighter",!0,"farther"):void 0});return iu(super.tertiary(),"2025",e)}tertiaryDim(){return su.fromPalette({name:"tertiary_dim",palette:e=>e.tertiaryPalette,tone:e=>e.variant===hu.TONAL_SPOT?vu(e.tertiaryPalette,0,90):vu(e.tertiaryPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>bu(4.5),toneDeltaPair:e=>new uu(this.tertiaryDim(),this.tertiary(),5,"darker",!0,"farther")})}onTertiary(){const e=su.fromPalette({name:"on_tertiary",palette:e=>e.tertiaryPalette,background:e=>"phone"===e.platform?this.tertiary():this.tertiaryDim(),contrastCurve:e=>"phone"===e.platform?bu(6):bu(7)});return iu(super.onTertiary(),"2025",e)}tertiaryContainer(){const e=su.fromPalette({name:"tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>"watch"===e.platform?e.variant===hu.TONAL_SPOT?vu(e.tertiaryPalette,0,90):vu(e.tertiaryPalette):e.variant===hu.NEUTRAL?e.isDark?vu(e.tertiaryPalette,0,93):vu(e.tertiaryPalette,0,96):e.variant===hu.TONAL_SPOT?vu(e.tertiaryPalette,0,e.isDark?93:100):e.variant===hu.EXPRESSIVE?vu(e.tertiaryPalette,75,eu.isCyan(e.tertiaryPalette.hue)?88:e.isDark?93:100):e.isDark?vu(e.tertiaryPalette,0,93):vu(e.tertiaryPalette,72,100),isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,toneDeltaPair:e=>"watch"===e.platform?new uu(this.tertiaryContainer(),this.tertiaryDim(),10,"darker",!0,"farther"):void 0,contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?bu(1.5):void 0});return iu(super.tertiaryContainer(),"2025",e)}onTertiaryContainer(){const e=su.fromPalette({name:"on_tertiary_container",palette:e=>e.tertiaryPalette,background:e=>this.tertiaryContainer(),contrastCurve:e=>"phone"===e.platform?bu(6):bu(7)});return iu(super.onTertiaryContainer(),"2025",e)}tertiaryFixed(){const e=su.fromPalette({name:"tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.tertiaryContainer().getTone(t)},isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?bu(1.5):void 0});return iu(super.tertiaryFixed(),"2025",e)}tertiaryFixedDim(){const e=su.fromPalette({name:"tertiary_fixed_dim",palette:e=>e.tertiaryPalette,tone:e=>this.tertiaryFixed().getTone(e),isBackground:!0,toneDeltaPair:e=>new uu(this.tertiaryFixedDim(),this.tertiaryFixed(),5,"darker",!0,"exact")});return iu(super.tertiaryFixedDim(),"2025",e)}onTertiaryFixed(){const e=su.fromPalette({name:"on_tertiary_fixed",palette:e=>e.tertiaryPalette,background:e=>this.tertiaryFixedDim(),contrastCurve:e=>bu(7)});return iu(super.onTertiaryFixed(),"2025",e)}onTertiaryFixedVariant(){const e=su.fromPalette({name:"on_tertiary_fixed_variant",palette:e=>e.tertiaryPalette,background:e=>this.tertiaryFixedDim(),contrastCurve:e=>bu(4.5)});return iu(super.onTertiaryFixedVariant(),"2025",e)}error(){const e=su.fromPalette({name:"error",palette:e=>e.errorPalette,tone:e=>"phone"===e.platform?e.isDark?fu(e.errorPalette,0,98):vu(e.errorPalette):fu(e.errorPalette),isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?bu(4.5):bu(7),toneDeltaPair:e=>"phone"===e.platform?new uu(this.errorContainer(),this.error(),5,"relative_lighter",!0,"farther"):void 0});return iu(super.error(),"2025",e)}errorDim(){return su.fromPalette({name:"error_dim",palette:e=>e.errorPalette,tone:e=>fu(e.errorPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>bu(4.5),toneDeltaPair:e=>new uu(this.errorDim(),this.error(),5,"darker",!0,"farther")})}onError(){const e=su.fromPalette({name:"on_error",palette:e=>e.errorPalette,background:e=>"phone"===e.platform?this.error():this.errorDim(),contrastCurve:e=>"phone"===e.platform?bu(6):bu(7)});return iu(super.onError(),"2025",e)}errorContainer(){const e=su.fromPalette({name:"error_container",palette:e=>e.errorPalette,tone:e=>"watch"===e.platform?30:e.isDark?fu(e.errorPalette,30,93):vu(e.errorPalette,0,90),isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,toneDeltaPair:e=>"watch"===e.platform?new uu(this.errorContainer(),this.errorDim(),10,"darker",!0,"farther"):void 0,contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?bu(1.5):void 0});return iu(super.errorContainer(),"2025",e)}onErrorContainer(){const e=su.fromPalette({name:"on_error_container",palette:e=>e.errorPalette,background:e=>this.errorContainer(),contrastCurve:e=>"phone"===e.platform?bu(4.5):bu(7)});return iu(super.onErrorContainer(),"2025",e)}surfaceVariant(){const e=Object.assign(this.surfaceContainerHighest().clone(),{name:"surface_variant"});return iu(super.surfaceVariant(),"2025",e)}surfaceTint(){const e=Object.assign(this.primary().clone(),{name:"surface_tint"});return iu(super.surfaceTint(),"2025",e)}background(){const e=Object.assign(this.surface().clone(),{name:"background"});return iu(super.background(),"2025",e)}onBackground(){const e=Object.assign(this.onSurface().clone(),{name:"on_background",tone:e=>"watch"===e.platform?100:this.onSurface().getTone(e)});return iu(super.onBackground(),"2025",e)}}
/**
 * @license
 * Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function Eu(e,t=0,r=100,i=1){return Dd(t,r,Iu(e.hue,e.chroma*i,100,!0))}function Cu(e,t=0,r=100){return Dd(t,r,Iu(e.hue,e.chroma,0,!1))}function Iu(e,t,r,i){let s=r,o=eu.from(e,t,s);for(;o.chroma<t&&!(r<0||r>100);){r+=i?-1:1;const n=eu.from(e,t,r);o.chroma<n.chroma&&(o=n,s=r)}return s}function Bu(e){return 1.5===e?new du(1.5,1.5,3,5.5):3===e?new du(3,3,4.5,7):4.5===e?new du(4.5,4.5,7,11):6===e?new du(6,6,7,11):7===e?new du(7,7,11,21):9===e?new du(9,9,11,21):11===e?new du(11,11,21,21):21===e?new du(21,21,21,21):new du(e,e,7,21)}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class xu{constructor(){this.allColors=[this.background(),this.onBackground(),this.surface(),this.surfaceDim(),this.surfaceBright(),this.surfaceContainerLowest(),this.surfaceContainerLow(),this.surfaceContainer(),this.surfaceContainerHigh(),this.surfaceContainerHighest(),this.onSurface(),this.onSurfaceVariant(),this.outline(),this.outlineVariant(),this.inverseSurface(),this.inverseOnSurface(),this.primary(),this.primaryDim(),this.onPrimary(),this.primaryContainer(),this.onPrimaryContainer(),this.primaryFixed(),this.primaryFixedDim(),this.onPrimaryFixed(),this.onPrimaryFixedVariant(),this.inversePrimary(),this.secondary(),this.secondaryDim(),this.onSecondary(),this.secondaryContainer(),this.onSecondaryContainer(),this.secondaryFixed(),this.secondaryFixedDim(),this.onSecondaryFixed(),this.onSecondaryFixedVariant(),this.tertiary(),this.tertiaryDim(),this.onTertiary(),this.tertiaryContainer(),this.onTertiaryContainer(),this.tertiaryFixed(),this.tertiaryFixedDim(),this.onTertiaryFixed(),this.onTertiaryFixedVariant(),this.error(),this.errorDim(),this.onError(),this.errorContainer(),this.onErrorContainer()].filter(e=>void 0!==e)}highestSurface(e){return xu.colorSpec.highestSurface(e)}primaryPaletteKeyColor(){return xu.colorSpec.primaryPaletteKeyColor()}secondaryPaletteKeyColor(){return xu.colorSpec.secondaryPaletteKeyColor()}tertiaryPaletteKeyColor(){return xu.colorSpec.tertiaryPaletteKeyColor()}neutralPaletteKeyColor(){return xu.colorSpec.neutralPaletteKeyColor()}neutralVariantPaletteKeyColor(){return xu.colorSpec.neutralVariantPaletteKeyColor()}errorPaletteKeyColor(){return xu.colorSpec.errorPaletteKeyColor()}background(){return xu.colorSpec.background()}onBackground(){return xu.colorSpec.onBackground()}surface(){return xu.colorSpec.surface()}surfaceDim(){return xu.colorSpec.surfaceDim()}surfaceBright(){return xu.colorSpec.surfaceBright()}surfaceContainerLowest(){return xu.colorSpec.surfaceContainerLowest()}surfaceContainerLow(){return xu.colorSpec.surfaceContainerLow()}surfaceContainer(){return xu.colorSpec.surfaceContainer()}surfaceContainerHigh(){return xu.colorSpec.surfaceContainerHigh()}surfaceContainerHighest(){return xu.colorSpec.surfaceContainerHighest()}onSurface(){return xu.colorSpec.onSurface()}surfaceVariant(){return xu.colorSpec.surfaceVariant()}onSurfaceVariant(){return xu.colorSpec.onSurfaceVariant()}outline(){return xu.colorSpec.outline()}outlineVariant(){return xu.colorSpec.outlineVariant()}inverseSurface(){return xu.colorSpec.inverseSurface()}inverseOnSurface(){return xu.colorSpec.inverseOnSurface()}shadow(){return xu.colorSpec.shadow()}scrim(){return xu.colorSpec.scrim()}surfaceTint(){return xu.colorSpec.surfaceTint()}primary(){return xu.colorSpec.primary()}primaryDim(){return xu.colorSpec.primaryDim()}onPrimary(){return xu.colorSpec.onPrimary()}primaryContainer(){return xu.colorSpec.primaryContainer()}onPrimaryContainer(){return xu.colorSpec.onPrimaryContainer()}inversePrimary(){return xu.colorSpec.inversePrimary()}primaryFixed(){return xu.colorSpec.primaryFixed()}primaryFixedDim(){return xu.colorSpec.primaryFixedDim()}onPrimaryFixed(){return xu.colorSpec.onPrimaryFixed()}onPrimaryFixedVariant(){return xu.colorSpec.onPrimaryFixedVariant()}secondary(){return xu.colorSpec.secondary()}secondaryDim(){return xu.colorSpec.secondaryDim()}onSecondary(){return xu.colorSpec.onSecondary()}secondaryContainer(){return xu.colorSpec.secondaryContainer()}onSecondaryContainer(){return xu.colorSpec.onSecondaryContainer()}secondaryFixed(){return xu.colorSpec.secondaryFixed()}secondaryFixedDim(){return xu.colorSpec.secondaryFixedDim()}onSecondaryFixed(){return xu.colorSpec.onSecondaryFixed()}onSecondaryFixedVariant(){return xu.colorSpec.onSecondaryFixedVariant()}tertiary(){return xu.colorSpec.tertiary()}tertiaryDim(){return xu.colorSpec.tertiaryDim()}onTertiary(){return xu.colorSpec.onTertiary()}tertiaryContainer(){return xu.colorSpec.tertiaryContainer()}onTertiaryContainer(){return xu.colorSpec.onTertiaryContainer()}tertiaryFixed(){return xu.colorSpec.tertiaryFixed()}tertiaryFixedDim(){return xu.colorSpec.tertiaryFixedDim()}onTertiaryFixed(){return xu.colorSpec.onTertiaryFixed()}onTertiaryFixedVariant(){return xu.colorSpec.onTertiaryFixedVariant()}error(){return xu.colorSpec.error()}errorDim(){return xu.colorSpec.errorDim()}onError(){return xu.colorSpec.onError()}errorContainer(){return xu.colorSpec.errorContainer()}onErrorContainer(){return xu.colorSpec.onErrorContainer()}static highestSurface(e){return xu.colorSpec.highestSurface(e)}}xu.contentAccentToneDelta=15,xu.colorSpec=new class extends wu{surface(){const e=su.fromPalette({name:"surface",palette:e=>e.neutralPalette,tone:e=>e.variant===hu.CMF?e.isDark?4:98:0,isBackground:!0});return iu(super.surface(),"2026",e)}surfaceDim(){const e=su.fromPalette({name:"surface_dim",palette:e=>e.neutralPalette,tone:e=>e.variant===hu.CMF?e.isDark?4:87:0,chromaMultiplier:e=>e.variant===hu.CMF?e.isDark?1:1.7:0,isBackground:!0});return iu(super.surfaceDim(),"2026",e)}surfaceBright(){const e=su.fromPalette({name:"surface_bright",palette:e=>e.neutralPalette,tone:e=>e.variant===hu.CMF?e.isDark?18:98:0,chromaMultiplier:e=>e.variant===hu.CMF?e.isDark?1.7:1:0,isBackground:!0});return iu(super.surfaceBright(),"2026",e)}surfaceContainerLowest(){const e=su.fromPalette({name:"surface_container_lowest",palette:e=>e.neutralPalette,tone:e=>e.variant===hu.CMF?e.isDark?0:100:0,isBackground:!0});return iu(super.surfaceContainerLowest(),"2026",e)}surfaceContainerLow(){const e=su.fromPalette({name:"surface_container_low",palette:e=>e.neutralPalette,tone:e=>e.variant===hu.CMF?e.isDark?6:96:0,chromaMultiplier:e=>e.variant===hu.CMF?1.25:0,isBackground:!0});return iu(super.surfaceContainerLow(),"2026",e)}surfaceContainer(){const e=su.fromPalette({name:"surface_container",palette:e=>e.neutralPalette,tone:e=>e.variant===hu.CMF?e.isDark?9:94:0,chromaMultiplier:e=>e.variant===hu.CMF?1.4:0,isBackground:!0});return iu(super.surfaceContainer(),"2026",e)}surfaceContainerHigh(){const e=su.fromPalette({name:"surface_container_high",palette:e=>e.neutralPalette,tone:e=>e.variant===hu.CMF?e.isDark?12:92:0,chromaMultiplier:e=>e.variant===hu.CMF?1.5:0,isBackground:!0});return iu(super.surfaceContainerHigh(),"2026",e)}surfaceContainerHighest(){const e=su.fromPalette({name:"surface_container_highest",palette:e=>e.neutralPalette,tone:e=>e.variant===hu.CMF?e.isDark?15:90:0,chromaMultiplier:e=>e.variant===hu.CMF?1.7:0,isBackground:!0});return iu(super.surfaceContainerHighest(),"2026",e)}onSurface(){const e=su.fromPalette({name:"on_surface",palette:e=>e.neutralPalette,chromaMultiplier:e=>e.variant===hu.CMF?1.7:0,background:e=>this.highestSurface(e),contrastCurve:e=>e.isDark?Bu(11):Bu(9)});return iu(super.onSurface(),"2026",e)}onSurfaceVariant(){const e=su.fromPalette({name:"on_surface_variant",palette:e=>e.neutralPalette,chromaMultiplier:e=>e.variant===hu.CMF?1.7:0,background:e=>this.highestSurface(e),contrastCurve:e=>e.isDark?Bu(6):Bu(4.5)});return iu(super.onSurfaceVariant(),"2026",e)}outline(){const e=su.fromPalette({name:"outline",palette:e=>e.neutralPalette,chromaMultiplier:e=>e.variant===hu.CMF?1.7:0,background:e=>this.highestSurface(e),contrastCurve:e=>Bu(3)});return iu(super.outline(),"2026",e)}outlineVariant(){const e=su.fromPalette({name:"outline_variant",palette:e=>e.neutralPalette,chromaMultiplier:e=>e.variant===hu.CMF?1.7:0,background:e=>this.highestSurface(e),contrastCurve:e=>Bu(1.5)});return iu(super.outlineVariant(),"2026",e)}inverseSurface(){const e=su.fromPalette({name:"inverse_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?98:4,chromaMultiplier:e=>e.variant===hu.CMF?1.7:0,isBackground:!0});return iu(super.inverseSurface(),"2026",e)}inverseOnSurface(){const e=su.fromPalette({name:"inverse_on_surface",palette:e=>e.neutralPalette,background:e=>this.inverseSurface(),contrastCurve:e=>Bu(7)});return iu(super.inverseOnSurface(),"2026",e)}primary(){const e=su.fromPalette({name:"primary",palette:e=>e.primaryPalette,tone:e=>e.sourceColorHct.chroma<=12?e.isDark?80:40:e.sourceColorHct.tone,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>Bu(4.5),toneDeltaPair:e=>"phone"===e.platform?new uu(this.primaryContainer(),this.primary(),5,"relative_lighter",!0,"farther"):void 0});return iu(super.primary(),"2026",e)}onPrimary(){const e=su.fromPalette({name:"on_primary",palette:e=>e.primaryPalette,background:e=>this.primary(),contrastCurve:e=>Bu(6)});return iu(super.onPrimary(),"2026",e)}primaryContainer(){const e=su.fromPalette({name:"primary_container",palette:e=>e.primaryPalette,tone:e=>!e.isDark&&e.sourceColorHct.chroma<=12?90:e.sourceColorHct.tone>55?Dd(61,90,e.sourceColorHct.tone):Dd(30,49,e.sourceColorHct.tone),isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>e.contrastLevel>0?Bu(1.5):void 0});return iu(super.primaryContainer(),"2026",e)}onPrimaryContainer(){const e=su.fromPalette({name:"on_primary_container",palette:e=>e.primaryPalette,background:e=>this.primaryContainer(),contrastCurve:e=>Bu(6)});return iu(super.onPrimaryContainer(),"2026",e)}primaryFixed(){const e=su.fromPalette({name:"primary_fixed",palette:e=>e.primaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.primaryContainer().getTone(t)},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>e.contrastLevel>0?Bu(1.5):void 0});return iu(super.primaryFixed(),"2026",e)}primaryFixedDim(){const e=su.fromPalette({name:"primary_fixed_dim",palette:e=>e.primaryPalette,tone:e=>this.primaryFixed().getTone(e),isBackground:!0,background:e=>this.highestSurface(e),toneDeltaPair:e=>new uu(this.primaryFixedDim(),this.primaryFixed(),5,"darker",!0,"exact"),contrastCurve:e=>e.contrastLevel>0?Bu(1.5):void 0});return iu(super.primaryFixedDim(),"2026",e)}onPrimaryFixed(){const e=su.fromPalette({name:"on_primary_fixed",palette:e=>e.primaryPalette,background:e=>this.primaryFixed().getTone(e)>57?this.primaryFixedDim():this.primaryFixed(),contrastCurve:e=>Bu(7)});return iu(super.onPrimaryFixed(),"2026",e)}onPrimaryFixedVariant(){const e=su.fromPalette({name:"on_primary_fixed_variant",palette:e=>e.primaryPalette,background:e=>this.primaryFixed().getTone(e)>57?this.primaryFixedDim():this.primaryFixed(),contrastCurve:e=>Bu(4.5)});return iu(super.onPrimaryFixedVariant(),"2026",e)}inversePrimary(){return super.inversePrimary()}secondary(){const e=su.fromPalette({name:"secondary",palette:e=>e.secondaryPalette,tone:e=>e.isDark?Cu(e.secondaryPalette):Eu(e.secondaryPalette),isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>Bu(4.5),toneDeltaPair:e=>"phone"===e.platform?new uu(this.secondaryContainer(),this.secondary(),5,"relative_lighter",!0,"farther"):void 0});return iu(super.secondary(),"2026",e)}onSecondary(){const e=su.fromPalette({name:"on_secondary",palette:e=>e.secondaryPalette,background:e=>this.secondary(),contrastCurve:e=>Bu(6)});return iu(super.onSecondary(),"2026",e)}secondaryContainer(){const e=su.fromPalette({name:"secondary_container",palette:e=>e.secondaryPalette,tone:e=>e.isDark?Cu(e.secondaryPalette,20,49):Eu(e.secondaryPalette,61,90),isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>e.contrastLevel>0?Bu(1.5):void 0});return iu(super.secondaryContainer(),"2026",e)}onSecondaryContainer(){const e=su.fromPalette({name:"on_secondary_container",palette:e=>e.secondaryPalette,background:e=>this.secondaryContainer(),contrastCurve:e=>Bu(6)});return iu(super.onSecondaryContainer(),"2026",e)}secondaryFixed(){const e=su.fromPalette({name:"secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.secondaryContainer().getTone(t)},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>e.contrastLevel>0?Bu(1.5):void 0});return iu(super.secondaryFixed(),"2026",e)}secondaryFixedDim(){const e=su.fromPalette({name:"secondary_fixed_dim",palette:e=>e.secondaryPalette,tone:e=>this.secondaryFixed().getTone(e),isBackground:!0,background:e=>this.highestSurface(e),toneDeltaPair:e=>new uu(this.secondaryFixedDim(),this.secondaryFixed(),5,"darker",!0,"exact"),contrastCurve:e=>e.contrastLevel>0?Bu(1.5):void 0});return iu(super.secondaryFixedDim(),"2026",e)}onSecondaryFixed(){const e=su.fromPalette({name:"on_secondary_fixed",palette:e=>e.secondaryPalette,background:e=>this.secondaryFixed().getTone(e)>57?this.secondaryFixedDim():this.secondaryFixed(),contrastCurve:e=>Bu(7)});return iu(super.onSecondaryFixed(),"2026",e)}onSecondaryFixedVariant(){const e=su.fromPalette({name:"on_secondary_fixed_variant",palette:e=>e.secondaryPalette,background:e=>this.secondaryFixed().getTone(e)>57?this.secondaryFixedDim():this.secondaryFixed(),contrastCurve:e=>Bu(4.5)});return iu(super.onSecondaryFixedVariant(),"2026",e)}tertiary(){const e=su.fromPalette({name:"tertiary",palette:e=>e.tertiaryPalette,tone:e=>e.sourceColorHcts[1]?.tone??e.sourceColorHct.tone,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>Bu(4.5),toneDeltaPair:e=>"phone"===e.platform?new uu(this.tertiaryContainer(),this.tertiary(),5,"relative_lighter",!0,"farther"):void 0});return iu(super.tertiary(),"2026",e)}onTertiary(){const e=su.fromPalette({name:"on_tertiary",palette:e=>e.tertiaryPalette,background:e=>this.tertiary(),contrastCurve:e=>Bu(6)});return iu(super.onTertiary(),"2026",e)}tertiaryContainer(){const e=su.fromPalette({name:"tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>{const t=e.sourceColorHcts[1]??e.sourceColorHct;return t.tone>55?Dd(61,90,t.tone):Dd(20,49,t.tone)},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>e.contrastLevel>0?Bu(1.5):void 0});return iu(super.tertiaryContainer(),"2026",e)}onTertiaryContainer(){const e=su.fromPalette({name:"on_tertiary_container",palette:e=>e.tertiaryPalette,background:e=>this.tertiaryContainer(),contrastCurve:e=>Bu(6)});return iu(super.onTertiaryContainer(),"2026",e)}tertiaryFixed(){const e=su.fromPalette({name:"tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.tertiaryContainer().getTone(t)},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>e.contrastLevel>0?Bu(1.5):void 0});return iu(super.tertiaryFixed(),"2026",e)}tertiaryFixedDim(){const e=su.fromPalette({name:"tertiary_fixed_dim",palette:e=>e.tertiaryPalette,tone:e=>this.tertiaryFixed().getTone(e),isBackground:!0,background:e=>this.highestSurface(e),toneDeltaPair:e=>new uu(this.tertiaryFixedDim(),this.tertiaryFixed(),5,"darker",!0,"exact"),contrastCurve:e=>e.contrastLevel>0?Bu(1.5):void 0});return iu(super.tertiaryFixedDim(),"2026",e)}onTertiaryFixed(){const e=su.fromPalette({name:"on_tertiary_fixed",palette:e=>e.tertiaryPalette,background:e=>this.tertiaryFixed().getTone(e)>57?this.tertiaryFixedDim():this.tertiaryFixed(),contrastCurve:e=>Bu(7)});return iu(super.onTertiaryFixed(),"2026",e)}onTertiaryFixedVariant(){const e=su.fromPalette({name:"on_tertiary_fixed_variant",palette:e=>e.tertiaryPalette,background:e=>this.tertiaryFixed().getTone(e)>57?this.tertiaryFixedDim():this.tertiaryFixed(),contrastCurve:e=>Bu(4.5)});return iu(super.onTertiaryFixedVariant(),"2026",e)}error(){const e=su.fromPalette({name:"error",palette:e=>e.errorPalette,tone:e=>Eu(e.errorPalette),isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>Bu(4.5),toneDeltaPair:e=>"phone"===e.platform?new uu(this.errorContainer(),this.error(),5,"relative_lighter",!0,"farther"):void 0});return iu(super.error(),"2026",e)}onError(){const e=su.fromPalette({name:"on_error",palette:e=>e.errorPalette,background:e=>this.error(),contrastCurve:e=>Bu(6)});return iu(super.onError(),"2026",e)}errorContainer(){const e=su.fromPalette({name:"error_container",palette:e=>e.errorPalette,tone:e=>e.isDark?Cu(e.errorPalette):Eu(e.errorPalette),isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>e.contrastLevel>0?Bu(1.5):void 0});return iu(super.errorContainer(),"2026",e)}onErrorContainer(){const e=su.fromPalette({name:"on_error_container",palette:e=>e.errorPalette,background:e=>this.errorContainer(),contrastCurve:e=>Bu(6)});return iu(super.onErrorContainer(),"2026",e)}primaryDim(){const e=Object.assign(this.primary().clone(),{name:"primary_dim"});return iu(super.primaryDim(),"2026",e)}secondaryDim(){const e=Object.assign(this.secondary().clone(),{name:"secondary_dim"});return iu(super.secondaryDim(),"2026",e)}tertiaryDim(){const e=Object.assign(this.tertiary().clone(),{name:"tertiary_dim"});return iu(super.tertiaryDim(),"2026",e)}errorDim(){const e=Object.assign(this.error().clone(),{name:"error_dim"});return iu(super.errorDim(),"2026",e)}},xu.primaryPaletteKeyColor=xu.colorSpec.primaryPaletteKeyColor(),xu.secondaryPaletteKeyColor=xu.colorSpec.secondaryPaletteKeyColor(),xu.tertiaryPaletteKeyColor=xu.colorSpec.tertiaryPaletteKeyColor(),xu.neutralPaletteKeyColor=xu.colorSpec.neutralPaletteKeyColor(),xu.neutralVariantPaletteKeyColor=xu.colorSpec.neutralVariantPaletteKeyColor(),xu.background=xu.colorSpec.background(),xu.onBackground=xu.colorSpec.onBackground(),xu.surface=xu.colorSpec.surface(),xu.surfaceDim=xu.colorSpec.surfaceDim(),xu.surfaceBright=xu.colorSpec.surfaceBright(),xu.surfaceContainerLowest=xu.colorSpec.surfaceContainerLowest(),xu.surfaceContainerLow=xu.colorSpec.surfaceContainerLow(),xu.surfaceContainer=xu.colorSpec.surfaceContainer(),xu.surfaceContainerHigh=xu.colorSpec.surfaceContainerHigh(),xu.surfaceContainerHighest=xu.colorSpec.surfaceContainerHighest(),xu.onSurface=xu.colorSpec.onSurface(),xu.surfaceVariant=xu.colorSpec.surfaceVariant(),xu.onSurfaceVariant=xu.colorSpec.onSurfaceVariant(),xu.inverseSurface=xu.colorSpec.inverseSurface(),xu.inverseOnSurface=xu.colorSpec.inverseOnSurface(),xu.outline=xu.colorSpec.outline(),xu.outlineVariant=xu.colorSpec.outlineVariant(),xu.shadow=xu.colorSpec.shadow(),xu.scrim=xu.colorSpec.scrim(),xu.surfaceTint=xu.colorSpec.surfaceTint(),xu.primary=xu.colorSpec.primary(),xu.onPrimary=xu.colorSpec.onPrimary(),xu.primaryContainer=xu.colorSpec.primaryContainer(),xu.onPrimaryContainer=xu.colorSpec.onPrimaryContainer(),xu.inversePrimary=xu.colorSpec.inversePrimary(),xu.secondary=xu.colorSpec.secondary(),xu.onSecondary=xu.colorSpec.onSecondary(),xu.secondaryContainer=xu.colorSpec.secondaryContainer(),xu.onSecondaryContainer=xu.colorSpec.onSecondaryContainer(),xu.tertiary=xu.colorSpec.tertiary(),xu.onTertiary=xu.colorSpec.onTertiary(),xu.tertiaryContainer=xu.colorSpec.tertiaryContainer(),xu.onTertiaryContainer=xu.colorSpec.onTertiaryContainer(),xu.error=xu.colorSpec.error(),xu.onError=xu.colorSpec.onError(),xu.errorContainer=xu.colorSpec.errorContainer(),xu.onErrorContainer=xu.colorSpec.onErrorContainer(),xu.primaryFixed=xu.colorSpec.primaryFixed(),xu.primaryFixedDim=xu.colorSpec.primaryFixedDim(),xu.onPrimaryFixed=xu.colorSpec.onPrimaryFixed(),xu.onPrimaryFixedVariant=xu.colorSpec.onPrimaryFixedVariant(),xu.secondaryFixed=xu.colorSpec.secondaryFixed(),xu.secondaryFixedDim=xu.colorSpec.secondaryFixedDim(),xu.onSecondaryFixed=xu.colorSpec.onSecondaryFixed(),xu.onSecondaryFixedVariant=xu.colorSpec.onSecondaryFixedVariant(),xu.tertiaryFixed=xu.colorSpec.tertiaryFixed(),xu.tertiaryFixedDim=xu.colorSpec.tertiaryFixedDim(),xu.onTertiaryFixed=xu.colorSpec.onTertiaryFixed(),xu.onTertiaryFixedVariant=xu.colorSpec.onTertiaryFixedVariant();
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class Pu{static maybeFallbackSpecVersion(e,t){return t===hu.CMF?e:t===hu.EXPRESSIVE||t===hu.VIBRANT||t===hu.TONAL_SPOT||t===hu.NEUTRAL?"2026"===e?"2025":e:"2021"}constructor(e){if(e.sourceColorHcts){if(0===e.sourceColorHcts.length)throw new Error("sourceColorHcts cannot be empty");this.sourceColorHct=e.sourceColorHcts[0],this.sourceColorHcts=e.sourceColorHcts}else{if(!e.sourceColorHct)throw new Error("sourceColorHct or sourceColorHcts required");this.sourceColorHct=e.sourceColorHct,this.sourceColorHcts=[e.sourceColorHct]}this.sourceColorArgb=this.sourceColorHct.toInt(),this.variant=e.variant,this.contrastLevel=e.contrastLevel,this.isDark=e.isDark,this.platform=e.platform??"phone",this.specVersion=Pu.maybeFallbackSpecVersion(e.specVersion??"2021",this.variant),this.primaryPalette=e.primaryPalette??Qu(this.specVersion).getPrimaryPalette(this.variant,this.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.secondaryPalette=e.secondaryPalette??Qu(this.specVersion).getSecondaryPalette(this.variant,this.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.tertiaryPalette=e.tertiaryPalette??Qu(this.specVersion).getTertiaryPalette(this.variant,this.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.neutralPalette=e.neutralPalette??Qu(this.specVersion).getNeutralPalette(this.variant,this.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.neutralVariantPalette=e.neutralVariantPalette??Qu(this.specVersion).getNeutralVariantPalette(this.variant,this.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.errorPalette=e.errorPalette??Qu(this.specVersion).getErrorPalette(this.variant,this.sourceColorHct,this.isDark,this.platform,this.contrastLevel)??lu.fromHueAndChroma(25,84),this.colors=new xu}toString(){const e=this.sourceColorHcts.length<=1?"":`sourceColorHctList=[${this.sourceColorHcts.map(e=>e.toString()).join(", ")}], `;return`Scheme: variant=${hu[this.variant]}, mode=${this.isDark?"dark":"light"}, platform=${this.platform}, contrastLevel=${this.contrastLevel.toFixed(1)}, seed=${this.sourceColorHct.toString()}, `+e+`specVersion=${this.specVersion}`}static getPiecewiseHue(e,t,r){const i=Math.min(t.length-1,r.length),s=e.hue;for(let e=0;e<i;e++)if(s>=t[e]&&s<t[e+1])return kd(r[e]);return s}static getRotatedHue(e,t,r){let i=Pu.getPiecewiseHue(e,t,r);return Math.min(t.length-1,r.length)<=0&&(i=0),kd(e.hue+i)}getArgb(e){return e.getArgb(this)}getHct(e){return e.getHct(this)}get primaryPaletteKeyColor(){return this.getArgb(this.colors.primaryPaletteKeyColor())}get secondaryPaletteKeyColor(){return this.getArgb(this.colors.secondaryPaletteKeyColor())}get tertiaryPaletteKeyColor(){return this.getArgb(this.colors.tertiaryPaletteKeyColor())}get neutralPaletteKeyColor(){return this.getArgb(this.colors.neutralPaletteKeyColor())}get neutralVariantPaletteKeyColor(){return this.getArgb(this.colors.neutralVariantPaletteKeyColor())}get errorPaletteKeyColor(){return this.getArgb(this.colors.errorPaletteKeyColor())}get background(){return this.getArgb(this.colors.background())}get onBackground(){return this.getArgb(this.colors.onBackground())}get surface(){return this.getArgb(this.colors.surface())}get surfaceDim(){return this.getArgb(this.colors.surfaceDim())}get surfaceBright(){return this.getArgb(this.colors.surfaceBright())}get surfaceContainerLowest(){return this.getArgb(this.colors.surfaceContainerLowest())}get surfaceContainerLow(){return this.getArgb(this.colors.surfaceContainerLow())}get surfaceContainer(){return this.getArgb(this.colors.surfaceContainer())}get surfaceContainerHigh(){return this.getArgb(this.colors.surfaceContainerHigh())}get surfaceContainerHighest(){return this.getArgb(this.colors.surfaceContainerHighest())}get onSurface(){return this.getArgb(this.colors.onSurface())}get surfaceVariant(){return this.getArgb(this.colors.surfaceVariant())}get onSurfaceVariant(){return this.getArgb(this.colors.onSurfaceVariant())}get inverseSurface(){return this.getArgb(this.colors.inverseSurface())}get inverseOnSurface(){return this.getArgb(this.colors.inverseOnSurface())}get outline(){return this.getArgb(this.colors.outline())}get outlineVariant(){return this.getArgb(this.colors.outlineVariant())}get shadow(){return this.getArgb(this.colors.shadow())}get scrim(){return this.getArgb(this.colors.scrim())}get surfaceTint(){return this.getArgb(this.colors.surfaceTint())}get primary(){return this.getArgb(this.colors.primary())}get primaryDim(){const e=this.colors.primaryDim();if(void 0===e)throw new Error("`primaryDim` color is undefined prior to 2025 spec.");return this.getArgb(e)}get onPrimary(){return this.getArgb(this.colors.onPrimary())}get primaryContainer(){return this.getArgb(this.colors.primaryContainer())}get onPrimaryContainer(){return this.getArgb(this.colors.onPrimaryContainer())}get primaryFixed(){return this.getArgb(this.colors.primaryFixed())}get primaryFixedDim(){return this.getArgb(this.colors.primaryFixedDim())}get onPrimaryFixed(){return this.getArgb(this.colors.onPrimaryFixed())}get onPrimaryFixedVariant(){return this.getArgb(this.colors.onPrimaryFixedVariant())}get inversePrimary(){return this.getArgb(this.colors.inversePrimary())}get secondary(){return this.getArgb(this.colors.secondary())}get secondaryDim(){const e=this.colors.secondaryDim();if(void 0===e)throw new Error("`secondaryDim` color is undefined prior to 2025 spec.");return this.getArgb(e)}get onSecondary(){return this.getArgb(this.colors.onSecondary())}get secondaryContainer(){return this.getArgb(this.colors.secondaryContainer())}get onSecondaryContainer(){return this.getArgb(this.colors.onSecondaryContainer())}get secondaryFixed(){return this.getArgb(this.colors.secondaryFixed())}get secondaryFixedDim(){return this.getArgb(this.colors.secondaryFixedDim())}get onSecondaryFixed(){return this.getArgb(this.colors.onSecondaryFixed())}get onSecondaryFixedVariant(){return this.getArgb(this.colors.onSecondaryFixedVariant())}get tertiary(){return this.getArgb(this.colors.tertiary())}get tertiaryDim(){const e=this.colors.tertiaryDim();if(void 0===e)throw new Error("`tertiaryDim` color is undefined prior to 2025 spec.");return this.getArgb(e)}get onTertiary(){return this.getArgb(this.colors.onTertiary())}get tertiaryContainer(){return this.getArgb(this.colors.tertiaryContainer())}get onTertiaryContainer(){return this.getArgb(this.colors.onTertiaryContainer())}get tertiaryFixed(){return this.getArgb(this.colors.tertiaryFixed())}get tertiaryFixedDim(){return this.getArgb(this.colors.tertiaryFixedDim())}get onTertiaryFixed(){return this.getArgb(this.colors.onTertiaryFixed())}get onTertiaryFixedVariant(){return this.getArgb(this.colors.onTertiaryFixedVariant())}get error(){return this.getArgb(this.colors.error())}get errorDim(){const e=this.colors.errorDim();if(void 0===e)throw new Error("`errorDim` color is undefined prior to 2025 spec.");return this.getArgb(e)}get onError(){return this.getArgb(this.colors.onError())}get errorContainer(){return this.getArgb(this.colors.errorContainer())}get onErrorContainer(){return this.getArgb(this.colors.onErrorContainer())}}Pu.DEFAULT_SPEC_VERSION="2021",Pu.DEFAULT_PLATFORM="phone";class Du{getPrimaryPalette(e,t,r,i,s){switch(e){case hu.CONTENT:case hu.FIDELITY:return lu.fromHueAndChroma(t.hue,t.chroma);case hu.FRUIT_SALAD:return lu.fromHueAndChroma(kd(t.hue-50),48);case hu.MONOCHROME:return lu.fromHueAndChroma(t.hue,0);case hu.NEUTRAL:return lu.fromHueAndChroma(t.hue,12);case hu.RAINBOW:return lu.fromHueAndChroma(t.hue,48);case hu.TONAL_SPOT:return lu.fromHueAndChroma(t.hue,36);case hu.EXPRESSIVE:return lu.fromHueAndChroma(kd(t.hue+240),40);case hu.VIBRANT:return lu.fromHueAndChroma(t.hue,200);default:throw new Error(`Unsupported variant: ${e}`)}}getSecondaryPalette(e,t,r,i,s){switch(e){case hu.CONTENT:case hu.FIDELITY:return lu.fromHueAndChroma(t.hue,Math.max(t.chroma-32,.5*t.chroma));case hu.FRUIT_SALAD:return lu.fromHueAndChroma(kd(t.hue-50),36);case hu.MONOCHROME:return lu.fromHueAndChroma(t.hue,0);case hu.NEUTRAL:return lu.fromHueAndChroma(t.hue,8);case hu.RAINBOW:case hu.TONAL_SPOT:return lu.fromHueAndChroma(t.hue,16);case hu.EXPRESSIVE:return lu.fromHueAndChroma(Pu.getRotatedHue(t,[0,21,51,121,151,191,271,321,360],[45,95,45,20,45,90,45,45,45]),24);case hu.VIBRANT:return lu.fromHueAndChroma(Pu.getRotatedHue(t,[0,41,61,101,131,181,251,301,360],[18,15,10,12,15,18,15,12,12]),24);default:throw new Error(`Unsupported variant: ${e}`)}}getTertiaryPalette(e,t,r,i,s){switch(e){case hu.CONTENT:return lu.fromHct(ru.fixIfDisliked(new Au(t).analogous(3,6)[2]));case hu.FIDELITY:return lu.fromHct(ru.fixIfDisliked(new Au(t).complement));case hu.FRUIT_SALAD:return lu.fromHueAndChroma(t.hue,36);case hu.MONOCHROME:return lu.fromHueAndChroma(t.hue,0);case hu.NEUTRAL:return lu.fromHueAndChroma(t.hue,16);case hu.RAINBOW:case hu.TONAL_SPOT:return lu.fromHueAndChroma(kd(t.hue+60),24);case hu.EXPRESSIVE:return lu.fromHueAndChroma(Pu.getRotatedHue(t,[0,21,51,121,151,191,271,321,360],[120,120,20,45,20,15,20,120,120]),32);case hu.VIBRANT:return lu.fromHueAndChroma(Pu.getRotatedHue(t,[0,41,61,101,131,181,251,301,360],[35,30,20,25,30,35,30,25,25]),32);default:throw new Error(`Unsupported variant: ${e}`)}}getNeutralPalette(e,t,r,i,s){switch(e){case hu.CONTENT:case hu.FIDELITY:return lu.fromHueAndChroma(t.hue,t.chroma/8);case hu.FRUIT_SALAD:return lu.fromHueAndChroma(t.hue,10);case hu.MONOCHROME:return lu.fromHueAndChroma(t.hue,0);case hu.NEUTRAL:return lu.fromHueAndChroma(t.hue,2);case hu.RAINBOW:return lu.fromHueAndChroma(t.hue,0);case hu.TONAL_SPOT:return lu.fromHueAndChroma(t.hue,6);case hu.EXPRESSIVE:return lu.fromHueAndChroma(kd(t.hue+15),8);case hu.VIBRANT:return lu.fromHueAndChroma(t.hue,10);default:throw new Error(`Unsupported variant: ${e}`)}}getNeutralVariantPalette(e,t,r,i,s){switch(e){case hu.CONTENT:case hu.FIDELITY:return lu.fromHueAndChroma(t.hue,t.chroma/8+4);case hu.FRUIT_SALAD:return lu.fromHueAndChroma(t.hue,16);case hu.MONOCHROME:return lu.fromHueAndChroma(t.hue,0);case hu.NEUTRAL:return lu.fromHueAndChroma(t.hue,2);case hu.RAINBOW:return lu.fromHueAndChroma(t.hue,0);case hu.TONAL_SPOT:return lu.fromHueAndChroma(t.hue,8);case hu.EXPRESSIVE:return lu.fromHueAndChroma(kd(t.hue+15),12);case hu.VIBRANT:return lu.fromHueAndChroma(t.hue,12);default:throw new Error(`Unsupported variant: ${e}`)}}getErrorPalette(e,t,r,i,s){}}class Su extends Du{getPrimaryPalette(e,t,r,i,s){switch(e){case hu.NEUTRAL:return lu.fromHueAndChroma(t.hue,"phone"===i?eu.isBlue(t.hue)?12:8:eu.isBlue(t.hue)?16:12);case hu.TONAL_SPOT:return lu.fromHueAndChroma(t.hue,"phone"===i&&r?26:32);case hu.EXPRESSIVE:return lu.fromHueAndChroma(t.hue,"phone"===i?r?36:48:40);case hu.VIBRANT:return lu.fromHueAndChroma(t.hue,"phone"===i?74:56);default:return super.getPrimaryPalette(e,t,r,i,s)}}getSecondaryPalette(e,t,r,i,s){switch(e){case hu.NEUTRAL:return lu.fromHueAndChroma(t.hue,"phone"===i?eu.isBlue(t.hue)?6:4:eu.isBlue(t.hue)?10:6);case hu.TONAL_SPOT:return lu.fromHueAndChroma(t.hue,16);case hu.EXPRESSIVE:return lu.fromHueAndChroma(Pu.getRotatedHue(t,[0,105,140,204,253,278,300,333,360],[-160,155,-100,96,-96,-156,-165,-160]),"phone"===i&&r?16:24);case hu.VIBRANT:return lu.fromHueAndChroma(Pu.getRotatedHue(t,[0,38,105,140,333,360],[-14,10,-14,10,-14]),"phone"===i?56:36);default:return super.getSecondaryPalette(e,t,r,i,s)}}getTertiaryPalette(e,t,r,i,s){switch(e){case hu.NEUTRAL:return lu.fromHueAndChroma(Pu.getRotatedHue(t,[0,38,105,161,204,278,333,360],[-32,26,10,-39,24,-15,-32]),"phone"===i?20:36);case hu.TONAL_SPOT:return lu.fromHueAndChroma(Pu.getRotatedHue(t,[0,20,71,161,333,360],[-40,48,-32,40,-32]),"phone"===i?28:32);case hu.EXPRESSIVE:return lu.fromHueAndChroma(Pu.getRotatedHue(t,[0,105,140,204,253,278,300,333,360],[-165,160,-105,101,-101,-160,-170,-165]),48);case hu.VIBRANT:return lu.fromHueAndChroma(Pu.getRotatedHue(t,[0,38,71,105,140,161,253,333,360],[-72,35,24,-24,62,50,62,-72]),56);default:return super.getTertiaryPalette(e,t,r,i,s)}}static getExpressiveNeutralHue(e){return Pu.getRotatedHue(e,[0,71,124,253,278,300,360],[10,0,10,0,10,0])}static getExpressiveNeutralChroma(e,t,r){const i=Su.getExpressiveNeutralHue(e);return"phone"===r?t?eu.isYellow(i)?6:14:18:12}static getVibrantNeutralHue(e){return Pu.getRotatedHue(e,[0,38,105,140,333,360],[-14,10,-14,10,-14])}static getVibrantNeutralChroma(e,t){const r=Su.getVibrantNeutralHue(e);return"phone"===t||eu.isBlue(r)?28:20}getNeutralPalette(e,t,r,i,s){switch(e){case hu.NEUTRAL:return lu.fromHueAndChroma(t.hue,"phone"===i?1.4:6);case hu.TONAL_SPOT:return lu.fromHueAndChroma(t.hue,"phone"===i?5:10);case hu.EXPRESSIVE:return lu.fromHueAndChroma(Su.getExpressiveNeutralHue(t),Su.getExpressiveNeutralChroma(t,r,i));case hu.VIBRANT:return lu.fromHueAndChroma(Su.getVibrantNeutralHue(t),Su.getVibrantNeutralChroma(t,i));default:return super.getNeutralPalette(e,t,r,i,s)}}getNeutralVariantPalette(e,t,r,i,s){switch(e){case hu.NEUTRAL:return lu.fromHueAndChroma(t.hue,2.2*("phone"===i?1.4:6));case hu.TONAL_SPOT:return lu.fromHueAndChroma(t.hue,1.7*("phone"===i?5:10));case hu.EXPRESSIVE:const o=Su.getExpressiveNeutralHue(t),n=Su.getExpressiveNeutralChroma(t,r,i);return lu.fromHueAndChroma(o,n*(o>=105&&o<125?1.6:2.3));case hu.VIBRANT:const a=Su.getVibrantNeutralHue(t),l=Su.getVibrantNeutralChroma(t,i);return lu.fromHueAndChroma(a,1.29*l);default:return super.getNeutralVariantPalette(e,t,r,i,s)}}getErrorPalette(e,t,r,i,s){const o=Pu.getPiecewiseHue(t,[0,3,13,23,33,43,153,273,360],[12,22,32,12,22,32,22,12]);switch(e){case hu.NEUTRAL:return lu.fromHueAndChroma(o,"phone"===i?50:40);case hu.TONAL_SPOT:return lu.fromHueAndChroma(o,"phone"===i?60:48);case hu.EXPRESSIVE:return lu.fromHueAndChroma(o,"phone"===i?64:48);case hu.VIBRANT:return lu.fromHueAndChroma(o,"phone"===i?80:60);default:return super.getErrorPalette(e,t,r,i,s)}}}const ku=new Du,Ru=new Su;function Qu(e){return"2025"===e?Ru:ku}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Mu{fromInt(e){return Jd(e)}toInt(e){return function(e,t,r){const i=Od,s=(e+16)/116,o=s-r/200,n=Wd(t/500+s),a=Wd(s),l=Wd(o);return zd(n*i[0],a*i[1],l*i[2])}(e[0],e[1],e[2])}distance(e,t){const r=e[0]-t[0],i=e[1]-t[1],s=e[2]-t[2];return r*r+i*i+s*s}}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Hu{static quantize(e,t,r){const i=new Map,s=new Array,o=new Array,n=new Mu;let a=0;for(let t=0;t<e.length;t++){const r=e[t],l=i.get(r);void 0===l?(a++,s.push(n.fromInt(r)),o.push(r),i.set(r,1)):i.set(r,l+1)}const l=new Array;for(let e=0;e<a;e++){const t=o[e],r=i.get(t);void 0!==r&&(l[e]=r)}let c=Math.min(r,a);t.length>0&&(c=Math.min(c,t.length));const A=new Array;for(let e=0;e<t.length;e++)A.push(n.fromInt(t[e]));const d=c-A.length;if(0===t.length&&d>0)for(let e=0;e<d;e++){const e=100*Math.random(),t=201*Math.random()-100,r=201*Math.random()-100;A.push(new Array(e,t,r))}const u=new Array;for(let e=0;e<a;e++)u.push(Math.floor(Math.random()*c));const h=new Array;for(let e=0;e<c;e++){h.push(new Array);for(let t=0;t<c;t++)h[e].push(0)}const p=new Array;for(let e=0;e<c;e++){p.push(new Array);for(let t=0;t<c;t++)p[e].push(new Ou)}const g=new Array;for(let e=0;e<c;e++)g.push(0);for(let e=0;e<10;e++){for(let e=0;e<c;e++){for(let t=e+1;t<c;t++){const r=n.distance(A[e],A[t]);p[t][e].distance=r,p[t][e].index=e,p[e][t].distance=r,p[e][t].index=t}p[e].sort();for(let t=0;t<c;t++)h[e][t]=p[e][t].index}let t=0;for(let e=0;e<a;e++){const r=s[e],i=u[e],o=A[i],a=n.distance(r,o);let l=a,d=-1;for(let e=0;e<c;e++){if(p[i][e].distance>=4*a)continue;const t=n.distance(r,A[e]);t<l&&(l=t,d=e)}if(-1!==d){Math.abs(Math.sqrt(l)-Math.sqrt(a))>3&&(t++,u[e]=d)}}if(0===t&&0!==e)break;const r=new Array(c).fill(0),i=new Array(c).fill(0),o=new Array(c).fill(0);for(let e=0;e<c;e++)g[e]=0;for(let e=0;e<a;e++){const t=u[e],n=s[e],a=l[e];g[t]+=a,r[t]+=n[0]*a,i[t]+=n[1]*a,o[t]+=n[2]*a}for(let e=0;e<c;e++){const t=g[e];if(0===t){A[e]=[0,0,0];continue}const s=r[e]/t,n=i[e]/t,a=o[e]/t;A[e]=[s,n,a]}}const m=new Map;for(let e=0;e<c;e++){const t=g[e];if(0===t)continue;const r=n.toInt(A[e]);m.has(r)||m.set(r,t)}return m}}class Ou{constructor(){this.distance=-1,this.index=-1}}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Tu{static quantize(e){const t=new Map;for(let r=0;r<e.length;r++){const i=e[r];qd(i)<255||t.set(i,(t.get(i)??0)+1)}return t}}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Lu=33,qu=35937,Uu="red",Fu="green",Vu="blue";class zu{constructor(e=[],t=[],r=[],i=[],s=[],o=[]){this.weights=e,this.momentsR=t,this.momentsG=r,this.momentsB=i,this.moments=s,this.cubes=o}quantize(e,t){this.constructHistogram(e),this.computeMoments();const r=this.createBoxes(t);return this.createResult(r.resultCount)}constructHistogram(e){this.weights=Array.from({length:qu}).fill(0),this.momentsR=Array.from({length:qu}).fill(0),this.momentsG=Array.from({length:qu}).fill(0),this.momentsB=Array.from({length:qu}).fill(0),this.moments=Array.from({length:qu}).fill(0);const t=Tu.quantize(e);for(const[e,r]of t.entries()){const t=Ud(e),i=Fd(e),s=Vd(e),o=3,n=1+(t>>o),a=1+(i>>o),l=1+(s>>o),c=this.getIndex(n,a,l);this.weights[c]=(this.weights[c]??0)+r,this.momentsR[c]+=r*t,this.momentsG[c]+=r*i,this.momentsB[c]+=r*s,this.moments[c]+=r*(t*t+i*i+s*s)}}computeMoments(){for(let e=1;e<Lu;e++){const t=Array.from({length:Lu}).fill(0),r=Array.from({length:Lu}).fill(0),i=Array.from({length:Lu}).fill(0),s=Array.from({length:Lu}).fill(0),o=Array.from({length:Lu}).fill(0);for(let n=1;n<Lu;n++){let a=0,l=0,c=0,A=0,d=0;for(let u=1;u<Lu;u++){const h=this.getIndex(e,n,u);a+=this.weights[h],l+=this.momentsR[h],c+=this.momentsG[h],A+=this.momentsB[h],d+=this.moments[h],t[u]+=a,r[u]+=l,i[u]+=c,s[u]+=A,o[u]+=d;const p=this.getIndex(e-1,n,u);this.weights[h]=this.weights[p]+t[u],this.momentsR[h]=this.momentsR[p]+r[u],this.momentsG[h]=this.momentsG[p]+i[u],this.momentsB[h]=this.momentsB[p]+s[u],this.moments[h]=this.moments[p]+o[u]}}}}createBoxes(e){this.cubes=Array.from({length:e}).fill(0).map(()=>new Ju);const t=Array.from({length:e}).fill(0);this.cubes[0].r0=0,this.cubes[0].g0=0,this.cubes[0].b0=0,this.cubes[0].r1=32,this.cubes[0].g1=32,this.cubes[0].b1=32;let r=e,i=0;for(let s=1;s<e;s++){this.cut(this.cubes[i],this.cubes[s])?(t[i]=this.cubes[i].vol>1?this.variance(this.cubes[i]):0,t[s]=this.cubes[s].vol>1?this.variance(this.cubes[s]):0):(t[i]=0,s--),i=0;let e=t[0];for(let r=1;r<=s;r++)t[r]>e&&(e=t[r],i=r);if(e<=0){r=s+1;break}}return new Yu(e,r)}createResult(e){const t=[];for(let r=0;r<e;++r){const e=this.cubes[r],i=this.volume(e,this.weights);if(i>0){const r=255<<24|(255&Math.round(this.volume(e,this.momentsR)/i))<<16|(255&Math.round(this.volume(e,this.momentsG)/i))<<8|255&Math.round(this.volume(e,this.momentsB)/i);t.push(r)}}return t}variance(e){const t=this.volume(e,this.momentsR),r=this.volume(e,this.momentsG),i=this.volume(e,this.momentsB);return this.moments[this.getIndex(e.r1,e.g1,e.b1)]-this.moments[this.getIndex(e.r1,e.g1,e.b0)]-this.moments[this.getIndex(e.r1,e.g0,e.b1)]+this.moments[this.getIndex(e.r1,e.g0,e.b0)]-this.moments[this.getIndex(e.r0,e.g1,e.b1)]+this.moments[this.getIndex(e.r0,e.g1,e.b0)]+this.moments[this.getIndex(e.r0,e.g0,e.b1)]-this.moments[this.getIndex(e.r0,e.g0,e.b0)]-(t*t+r*r+i*i)/this.volume(e,this.weights)}cut(e,t){const r=this.volume(e,this.momentsR),i=this.volume(e,this.momentsG),s=this.volume(e,this.momentsB),o=this.volume(e,this.weights),n=this.maximize(e,Uu,e.r0+1,e.r1,r,i,s,o),a=this.maximize(e,Fu,e.g0+1,e.g1,r,i,s,o),l=this.maximize(e,Vu,e.b0+1,e.b1,r,i,s,o);let c;const A=n.maximum,d=a.maximum,u=l.maximum;if(A>=d&&A>=u){if(n.cutLocation<0)return!1;c=Uu}else c=d>=A&&d>=u?Fu:Vu;switch(t.r1=e.r1,t.g1=e.g1,t.b1=e.b1,c){case Uu:e.r1=n.cutLocation,t.r0=e.r1,t.g0=e.g0,t.b0=e.b0;break;case Fu:e.g1=a.cutLocation,t.r0=e.r0,t.g0=e.g1,t.b0=e.b0;break;case Vu:e.b1=l.cutLocation,t.r0=e.r0,t.g0=e.g0,t.b0=e.b1;break;default:throw new Error("unexpected direction "+c)}return e.vol=(e.r1-e.r0)*(e.g1-e.g0)*(e.b1-e.b0),t.vol=(t.r1-t.r0)*(t.g1-t.g0)*(t.b1-t.b0),!0}maximize(e,t,r,i,s,o,n,a){const l=this.bottom(e,t,this.momentsR),c=this.bottom(e,t,this.momentsG),A=this.bottom(e,t,this.momentsB),d=this.bottom(e,t,this.weights);let u=0,h=-1,p=0,g=0,m=0,v=0;for(let f=r;f<i;f++){if(p=l+this.top(e,t,f,this.momentsR),g=c+this.top(e,t,f,this.momentsG),m=A+this.top(e,t,f,this.momentsB),v=d+this.top(e,t,f,this.weights),0===v)continue;let r=1*(p*p+g*g+m*m),i=1*v,y=r/i;p=s-p,g=o-g,m=n-m,v=a-v,0!==v&&(r=1*(p*p+g*g+m*m),i=1*v,y+=r/i,y>u&&(u=y,h=f))}return new Nu(h,u)}volume(e,t){return t[this.getIndex(e.r1,e.g1,e.b1)]-t[this.getIndex(e.r1,e.g1,e.b0)]-t[this.getIndex(e.r1,e.g0,e.b1)]+t[this.getIndex(e.r1,e.g0,e.b0)]-t[this.getIndex(e.r0,e.g1,e.b1)]+t[this.getIndex(e.r0,e.g1,e.b0)]+t[this.getIndex(e.r0,e.g0,e.b1)]-t[this.getIndex(e.r0,e.g0,e.b0)]}bottom(e,t,r){switch(t){case Uu:return-r[this.getIndex(e.r0,e.g1,e.b1)]+r[this.getIndex(e.r0,e.g1,e.b0)]+r[this.getIndex(e.r0,e.g0,e.b1)]-r[this.getIndex(e.r0,e.g0,e.b0)];case Fu:return-r[this.getIndex(e.r1,e.g0,e.b1)]+r[this.getIndex(e.r1,e.g0,e.b0)]+r[this.getIndex(e.r0,e.g0,e.b1)]-r[this.getIndex(e.r0,e.g0,e.b0)];case Vu:return-r[this.getIndex(e.r1,e.g1,e.b0)]+r[this.getIndex(e.r1,e.g0,e.b0)]+r[this.getIndex(e.r0,e.g1,e.b0)]-r[this.getIndex(e.r0,e.g0,e.b0)];default:throw new Error("unexpected direction $direction")}}top(e,t,r,i){switch(t){case Uu:return i[this.getIndex(r,e.g1,e.b1)]-i[this.getIndex(r,e.g1,e.b0)]-i[this.getIndex(r,e.g0,e.b1)]+i[this.getIndex(r,e.g0,e.b0)];case Fu:return i[this.getIndex(e.r1,r,e.b1)]-i[this.getIndex(e.r1,r,e.b0)]-i[this.getIndex(e.r0,r,e.b1)]+i[this.getIndex(e.r0,r,e.b0)];case Vu:return i[this.getIndex(e.r1,e.g1,r)]-i[this.getIndex(e.r1,e.g0,r)]-i[this.getIndex(e.r0,e.g1,r)]+i[this.getIndex(e.r0,e.g0,r)];default:throw new Error("unexpected direction $direction")}}getIndex(e,t,r){return(e<<10)+(e<<6)+e+(t<<5)+t+r}}class Ju{constructor(e=0,t=0,r=0,i=0,s=0,o=0,n=0){this.r0=e,this.r1=t,this.g0=r,this.g1=i,this.b0=s,this.b1=o,this.vol=n}}class Yu{constructor(e,t){this.requestedCount=e,this.resultCount=t}}class Nu{constructor(e,t){this.cutLocation=e,this.maximum=t}}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Xu{static quantize(e,t){const r=(new zu).quantize(e,t);return Hu.quantize(e,r,t)}}
/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const ju={desired:4,fallbackColorARGB:4282549748,filter:!0};function Ku(e,t){return e.score>t.score?-1:e.score<t.score?1:0}class Gu{constructor(){}static score(e,t){const{desired:r,fallbackColorARGB:i,filter:s}={...ju,...t},o=[],n=new Array(360).fill(0);let a=0;for(const[t,r]of e.entries()){const e=eu.fromInt(t);o.push(e);n[Math.floor(e.hue)]+=r,a+=r}const l=new Array(360).fill(0);for(let e=0;e<360;e++){const t=n[e]/a;for(let r=e-14;r<e+16;r++){l[Sd(r)]+=t}}const c=new Array;for(const e of o){const t=l[Sd(Math.round(e.hue))];if(s&&(e.chroma<Gu.CUTOFF_CHROMA||t<=Gu.CUTOFF_EXCITED_PROPORTION))continue;const r=100*t*Gu.WEIGHT_PROPORTION,i=e.chroma<Gu.TARGET_CHROMA?Gu.WEIGHT_CHROMA_BELOW:Gu.WEIGHT_CHROMA_ABOVE,o=r+(e.chroma-Gu.TARGET_CHROMA)*i;c.push({hct:e,score:o})}c.sort(Ku);const A=[];for(let e=90;e>=15;e--){A.length=0;for(const{hct:t}of c){if(A.find(r=>Rd(t.hue,r.hue)<e)||A.push(t),A.length>=r)break}if(A.length>=r)break}const d=[];0===A.length&&d.push(i);for(const e of A)d.push(e.toInt());return d}}function Wu(e){return parseInt(e,16)}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function Zu(e){const t=await new Promise((t,r)=>{const i=document.createElement("canvas"),s=i.getContext("2d");if(!s)return void r(new Error("Could not get canvas context"));const o=()=>{i.width=e.width,i.height=e.height,s.drawImage(e,0,0);let r=[0,0,e.width,e.height];const o=e.dataset.area;o&&/^\d+(\s*,\s*\d+){3}$/.test(o)&&(r=o.split(/\s*,\s*/).map(e=>parseInt(e,10)));const[n,a,l,c]=r;t(s.getImageData(n,a,l,c).data)},n=()=>{r(new Error("Image load failed"))};e.complete?o():(e.onload=o,e.onerror=n)});return function(e){const t=[];for(let r=0;r<e.length;r+=4){const i=e[r],s=e[r+1],o=e[r+2];if(e[r+3]<255)continue;const n=Td(i,s,o);t.push(n)}const r=Xu.quantize(t,128),i=Gu.score(r);return i[0]}(t)}Gu.TARGET_CHROMA=48,Gu.WEIGHT_PROPORTION=.7,Gu.WEIGHT_CHROMA_ABOVE=.3,Gu.WEIGHT_CHROMA_BELOW=.1,Gu.CUTOFF_CHROMA=5,Gu.CUTOFF_EXCITED_PROPORTION=.01;var _u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function $u(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}var eh,th,rh=(eh=function(e,t){
/*!
    localForage -- Offline Storage, Improved
    Version 1.10.0
    https://localforage.github.io/localForage
    (c) 2013-2017 Mozilla, Apache License 2.0
*/
e.exports=function e(t,r,i){function s(n,a){if(!r[n]){if(!t[n]){if(!a&&$u)return $u();if(o)return o(n,!0);var l=new Error("Cannot find module '"+n+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[n]={exports:{}};t[n][0].call(c.exports,function(e){var r=t[n][1][e];return s(r||e)},c,c.exports,e,t,r,i)}return r[n].exports}for(var o=$u,n=0;n<i.length;n++)s(i[n]);return s}({1:[function(e,t,r){(function(e){var r,i,s=e.MutationObserver||e.WebKitMutationObserver;if(s){var o=0,n=new s(A),a=e.document.createTextNode("");n.observe(a,{characterData:!0}),r=function(){a.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){A(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(A,0)};else{var l=new e.MessageChannel;l.port1.onmessage=A,r=function(){l.port2.postMessage(0)}}var c=[];function A(){var e,t;i=!0;for(var r=c.length;r;){for(t=c,c=[],e=-1;++e<r;)t[e]();r=c.length}i=!1}function d(e){1!==c.push(e)||i||r()}t.exports=d}).call(this,void 0!==_u?_u:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,r){var i=e(1);function s(){}var o={},n=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==s&&h(this,e)}function A(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function d(e,t,r){i(function(){var i;try{i=t(r)}catch(t){return o.reject(e,t)}i===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,i)})}function u(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var r=!1;function i(t){r||(r=!0,o.reject(e,t))}function s(t){r||(r=!0,o.resolve(e,t))}function n(){t(s,i)}var a=p(n);"error"===a.status&&i(a.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}function g(e){return e instanceof this?e:o.resolve(new this(s),e)}function m(e){var t=new this(s);return o.reject(t,e)}function v(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,i=!1;if(!r)return this.resolve([]);for(var n=new Array(r),a=0,l=-1,c=new this(s);++l<r;)A(e[l],l);return c;function A(e,s){function l(e){n[s]=e,++a!==r||i||(i=!0,o.resolve(c,n))}t.resolve(e).then(l,function(e){i||(i=!0,o.reject(c,e))})}}function f(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,i=!1;if(!r)return this.resolve([]);for(var n=-1,a=new this(s);++n<r;)l(e[n]);return a;function l(e){t.resolve(e).then(function(e){i||(i=!0,o.resolve(a,e))},function(e){i||(i=!0,o.reject(a,e))})}}t.exports=c,c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===n)return this;var r=new this.constructor(s);return this.state!==l?d(r,this.state===a?e:t,this.outcome):this.queue.push(new A(r,e,t)),r},A.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},A.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},A.prototype.callRejected=function(e){o.reject(this.promise,e)},A.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},o.resolve=function(e,t){var r=p(u,t);if("error"===r.status)return o.reject(e,r.value);var i=r.value;if(i)h(e,i);else{e.state=a,e.outcome=t;for(var s=-1,n=e.queue.length;++s<n;)e.queue[s].callFulfilled(t)}return e},o.reject=function(e,t){e.state=n,e.outcome=t;for(var r=-1,i=e.queue.length;++r<i;)e.queue[r].callRejected(t);return e},c.resolve=g,c.reject=m,c.all=v,c.race=f},{1:1}],3:[function(e,t,r){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==_u?_u:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,r){var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}var n=o();function a(){try{if(!n||!n.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}function l(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(s){if("TypeError"!==s.name)throw s;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),i=0;i<e.length;i+=1)r.append(e[i]);return r.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var c=Promise;function A(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function d(e,t,r){"function"==typeof t&&e.then(t),"function"==typeof r&&e.catch(r)}function u(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function h(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var p="local-forage-detect-blob-support",g=void 0,m={},v=Object.prototype.toString,f="readonly",y="readwrite";function b(e){for(var t=e.length,r=new ArrayBuffer(t),i=new Uint8Array(r),s=0;s<t;s++)i[s]=e.charCodeAt(s);return r}function w(e){return new c(function(t){var r=e.transaction(p,y),i=l([""]);r.objectStore(p).put(i,"key"),r.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},r.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!e||parseInt(e[1],10)>=43)}}).catch(function(){return!1})}function E(e){return"boolean"==typeof g?c.resolve(g):w(e).then(function(e){return g=e})}function C(e){var t=m[e.name],r={};r.promise=new c(function(e,t){r.resolve=e,r.reject=t}),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then(function(){return r.promise}):t.dbReady=r.promise}function I(e){var t=m[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function B(e,t){var r=m[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function x(e,t){return new c(function(r,i){if(m[e.name]=m[e.name]||T(),e.db){if(!t)return r(e.db);C(e),e.db.close()}var s=[e.name];t&&s.push(e.version);var o=n.open.apply(n,s);t&&(o.onupgradeneeded=function(t){var r=o.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(p)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),o.onerror=function(e){e.preventDefault(),i(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},r(t),I(e)}})}function P(e){return x(e,!1)}function D(e){return x(e,!0)}function S(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),i=e.version<e.db.version,s=e.version>e.db.version;if(i&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),s||r){if(r){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function k(e){return new c(function(t,r){var i=new FileReader;i.onerror=r,i.onloadend=function(r){var i=btoa(r.target.result||"");t({__local_forage_encoded_blob:!0,data:i,type:e.type})},i.readAsBinaryString(e)})}function R(e){return l([b(atob(e.data))],{type:e.type})}function Q(e){return e&&e.__local_forage_encoded_blob}function M(e){var t=this,r=t._initReady().then(function(){var e=m[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return d(r,e,e),r}function H(e){C(e);for(var t=m[e.name],r=t.forages,i=0;i<r.length;i++){var s=r[i];s._dbInfo.db&&(s._dbInfo.db.close(),s._dbInfo.db=null)}return e.db=null,P(e).then(function(t){return e.db=t,S(e)?D(e):t}).then(function(i){e.db=t.db=i;for(var s=0;s<r.length;s++)r[s]._dbInfo.db=i}).catch(function(t){throw B(e,t),t})}function O(e,t,r,i){void 0===i&&(i=1);try{var s=e.db.transaction(e.storeName,t);r(null,s)}catch(s){if(i>0&&(!e.db||"InvalidStateError"===s.name||"NotFoundError"===s.name))return c.resolve().then(function(){if(!e.db||"NotFoundError"===s.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),D(e)}).then(function(){return H(e).then(function(){O(e,t,r,i-1)})}).catch(r);r(s)}}function T(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function L(e){var t=this,r={db:null};if(e)for(var i in e)r[i]=e[i];var s=m[r.name];s||(s=T(),m[r.name]=s),s.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=M);var o=[];function n(){return c.resolve()}for(var a=0;a<s.forages.length;a++){var l=s.forages[a];l!==t&&o.push(l._initReady().catch(n))}var A=s.forages.slice(0);return c.all(o).then(function(){return r.db=s.db,P(r)}).then(function(e){return r.db=e,S(r,t._defaultConfig.version)?D(r):e}).then(function(e){r.db=s.db=e,t._dbInfo=r;for(var i=0;i<A.length;i++){var o=A[i];o!==t&&(o._dbInfo.db=r.db,o._dbInfo.version=r.version)}})}function q(e,t){var r=this;e=u(e);var i=new c(function(t,i){r.ready().then(function(){O(r._dbInfo,f,function(s,o){if(s)return i(s);try{var n=o.objectStore(r._dbInfo.storeName).get(e);n.onsuccess=function(){var e=n.result;void 0===e&&(e=null),Q(e)&&(e=R(e)),t(e)},n.onerror=function(){i(n.error)}}catch(e){i(e)}})}).catch(i)});return A(i,t),i}function U(e,t){var r=this,i=new c(function(t,i){r.ready().then(function(){O(r._dbInfo,f,function(s,o){if(s)return i(s);try{var n=o.objectStore(r._dbInfo.storeName).openCursor(),a=1;n.onsuccess=function(){var r=n.result;if(r){var i=r.value;Q(i)&&(i=R(i));var s=e(i,r.key,a++);void 0!==s?t(s):r.continue()}else t()},n.onerror=function(){i(n.error)}}catch(e){i(e)}})}).catch(i)});return A(i,t),i}function F(e,t,r){var i=this;e=u(e);var s=new c(function(r,s){var o;i.ready().then(function(){return o=i._dbInfo,"[object Blob]"===v.call(t)?E(o.db).then(function(e){return e?t:k(t)}):t}).then(function(t){O(i._dbInfo,y,function(o,n){if(o)return s(o);try{var a=n.objectStore(i._dbInfo.storeName);null===t&&(t=void 0);var l=a.put(t,e);n.oncomplete=function(){void 0===t&&(t=null),r(t)},n.onabort=n.onerror=function(){var e=l.error?l.error:l.transaction.error;s(e)}}catch(e){s(e)}})}).catch(s)});return A(s,r),s}function V(e,t){var r=this;e=u(e);var i=new c(function(t,i){r.ready().then(function(){O(r._dbInfo,y,function(s,o){if(s)return i(s);try{var n=o.objectStore(r._dbInfo.storeName).delete(e);o.oncomplete=function(){t()},o.onerror=function(){i(n.error)},o.onabort=function(){var e=n.error?n.error:n.transaction.error;i(e)}}catch(e){i(e)}})}).catch(i)});return A(i,t),i}function z(e){var t=this,r=new c(function(e,r){t.ready().then(function(){O(t._dbInfo,y,function(i,s){if(i)return r(i);try{var o=s.objectStore(t._dbInfo.storeName).clear();s.oncomplete=function(){e()},s.onabort=s.onerror=function(){var e=o.error?o.error:o.transaction.error;r(e)}}catch(e){r(e)}})}).catch(r)});return A(r,e),r}function J(e){var t=this,r=new c(function(e,r){t.ready().then(function(){O(t._dbInfo,f,function(i,s){if(i)return r(i);try{var o=s.objectStore(t._dbInfo.storeName).count();o.onsuccess=function(){e(o.result)},o.onerror=function(){r(o.error)}}catch(e){r(e)}})}).catch(r)});return A(r,e),r}function Y(e,t){var r=this,i=new c(function(t,i){e<0?t(null):r.ready().then(function(){O(r._dbInfo,f,function(s,o){if(s)return i(s);try{var n=o.objectStore(r._dbInfo.storeName),a=!1,l=n.openKeyCursor();l.onsuccess=function(){var r=l.result;r?0===e||a?t(r.key):(a=!0,r.advance(e)):t(null)},l.onerror=function(){i(l.error)}}catch(e){i(e)}})}).catch(i)});return A(i,t),i}function N(e){var t=this,r=new c(function(e,r){t.ready().then(function(){O(t._dbInfo,f,function(i,s){if(i)return r(i);try{var o=s.objectStore(t._dbInfo.storeName).openKeyCursor(),n=[];o.onsuccess=function(){var t=o.result;t?(n.push(t.key),t.continue()):e(n)},o.onerror=function(){r(o.error)}}catch(e){r(e)}})}).catch(r)});return A(r,e),r}function X(e,t){t=h.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var i,s=this;if(e.name){var o=e.name===r.name&&s._dbInfo.db?c.resolve(s._dbInfo.db):P(e).then(function(t){var r=m[e.name],i=r.forages;r.db=t;for(var s=0;s<i.length;s++)i[s]._dbInfo.db=t;return t});i=e.storeName?o.then(function(t){if(t.objectStoreNames.contains(e.storeName)){var r=t.version+1;C(e);var i=m[e.name],s=i.forages;t.close();for(var o=0;o<s.length;o++){var a=s[o];a._dbInfo.db=null,a._dbInfo.version=r}var l=new c(function(t,i){var s=n.open(e.name,r);s.onerror=function(e){s.result.close(),i(e)},s.onupgradeneeded=function(){s.result.deleteObjectStore(e.storeName)},s.onsuccess=function(){var e=s.result;e.close(),t(e)}});return l.then(function(e){i.db=e;for(var t=0;t<s.length;t++){var r=s[t];r._dbInfo.db=e,I(r._dbInfo)}}).catch(function(t){throw(B(e,t)||c.resolve()).catch(function(){}),t})}}):o.then(function(t){C(e);var r=m[e.name],i=r.forages;t.close();for(var s=0;s<i.length;s++)i[s]._dbInfo.db=null;var o=new c(function(t,r){var i=n.deleteDatabase(e.name);i.onerror=function(){var e=i.result;e&&e.close(),r(i.error)},i.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},i.onsuccess=function(){var e=i.result;e&&e.close(),t(e)}});return o.then(function(e){r.db=e;for(var t=0;t<i.length;t++)I(i[t]._dbInfo)}).catch(function(t){throw(B(e,t)||c.resolve()).catch(function(){}),t})})}else i=c.reject("Invalid arguments");return A(i,t),i}var j={_driver:"asyncStorage",_initStorage:L,_support:a(),iterate:U,getItem:q,setItem:F,removeItem:V,clear:z,length:J,key:Y,keys:N,dropInstance:X};function K(){return"function"==typeof openDatabase}var G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",W="~~local_forage_type~",Z=/^~~local_forage_type~([^~]+)~/,_="__lfsc__:",$=_.length,ee="arbf",te="blob",re="si08",ie="ui08",se="uic8",oe="si16",ne="si32",ae="ur16",le="ui32",ce="fl32",Ae="fl64",de=$+ee.length,ue=Object.prototype.toString;function he(e){var t,r,i,s,o,n=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(n--,"="===e[e.length-2]&&n--);var c=new ArrayBuffer(n),A=new Uint8Array(c);for(t=0;t<a;t+=4)r=G.indexOf(e[t]),i=G.indexOf(e[t+1]),s=G.indexOf(e[t+2]),o=G.indexOf(e[t+3]),A[l++]=r<<2|i>>4,A[l++]=(15&i)<<4|s>>2,A[l++]=(3&s)<<6|63&o;return c}function pe(e){var t,r=new Uint8Array(e),i="";for(t=0;t<r.length;t+=3)i+=G[r[t]>>2],i+=G[(3&r[t])<<4|r[t+1]>>4],i+=G[(15&r[t+1])<<2|r[t+2]>>6],i+=G[63&r[t+2]];return r.length%3==2?i=i.substring(0,i.length-1)+"=":r.length%3==1&&(i=i.substring(0,i.length-2)+"=="),i}function ge(e,t){var r="";if(e&&(r=ue.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===ue.call(e.buffer))){var i,s=_;e instanceof ArrayBuffer?(i=e,s+=ee):(i=e.buffer,"[object Int8Array]"===r?s+=re:"[object Uint8Array]"===r?s+=ie:"[object Uint8ClampedArray]"===r?s+=se:"[object Int16Array]"===r?s+=oe:"[object Uint16Array]"===r?s+=ae:"[object Int32Array]"===r?s+=ne:"[object Uint32Array]"===r?s+=le:"[object Float32Array]"===r?s+=ce:"[object Float64Array]"===r?s+=Ae:t(new Error("Failed to get type for BinaryArray"))),t(s+pe(i))}else if("[object Blob]"===r){var o=new FileReader;o.onload=function(){var r=W+e.type+"~"+pe(this.result);t(_+te+r)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}}function me(e){if(e.substring(0,$)!==_)return JSON.parse(e);var t,r=e.substring(de),i=e.substring($,de);if(i===te&&Z.test(r)){var s=r.match(Z);t=s[1],r=r.substring(s[0].length)}var o=he(r);switch(i){case ee:return o;case te:return l([o],{type:t});case re:return new Int8Array(o);case ie:return new Uint8Array(o);case se:return new Uint8ClampedArray(o);case oe:return new Int16Array(o);case ae:return new Uint16Array(o);case ne:return new Int32Array(o);case le:return new Uint32Array(o);case ce:return new Float32Array(o);case Ae:return new Float64Array(o);default:throw new Error("Unkown type: "+i)}}var ve={serialize:ge,deserialize:me,stringToBuffer:he,bufferToString:pe};function fe(e,t,r,i){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,i)}function ye(e){var t=this,r={db:null};if(e)for(var i in e)r[i]="string"!=typeof e[i]?e[i].toString():e[i];var s=new c(function(e,i){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(e){return i(e)}r.db.transaction(function(s){fe(s,r,function(){t._dbInfo=r,e()},function(e,t){i(t)})},i)});return r.serializer=ve,s}function be(e,t,r,i,s,o){e.executeSql(r,i,s,function(e,n){n.code===n.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(e,a){a.rows.length?o(e,n):fe(e,t,function(){e.executeSql(r,i,s,o)},o)},o):o(e,n)},o)}function we(e,t){var r=this;e=u(e);var i=new c(function(t,i){r.ready().then(function(){var s=r._dbInfo;s.db.transaction(function(r){be(r,s,"SELECT * FROM "+s.storeName+" WHERE key = ? LIMIT 1",[e],function(e,r){var i=r.rows.length?r.rows.item(0).value:null;i&&(i=s.serializer.deserialize(i)),t(i)},function(e,t){i(t)})})}).catch(i)});return A(i,t),i}function Ee(e,t){var r=this,i=new c(function(t,i){r.ready().then(function(){var s=r._dbInfo;s.db.transaction(function(r){be(r,s,"SELECT * FROM "+s.storeName,[],function(r,i){for(var o=i.rows,n=o.length,a=0;a<n;a++){var l=o.item(a),c=l.value;if(c&&(c=s.serializer.deserialize(c)),void 0!==(c=e(c,l.key,a+1)))return void t(c)}t()},function(e,t){i(t)})})}).catch(i)});return A(i,t),i}function Ce(e,t,r,i){var s=this;e=u(e);var o=new c(function(o,n){s.ready().then(function(){void 0===t&&(t=null);var a=t,l=s._dbInfo;l.serializer.serialize(t,function(t,c){c?n(c):l.db.transaction(function(r){be(r,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,t],function(){o(a)},function(e,t){n(t)})},function(t){if(t.code===t.QUOTA_ERR){if(i>0)return void o(Ce.apply(s,[e,a,r,i-1]));n(t)}})})}).catch(n)});return A(o,r),o}function Ie(e,t,r){return Ce.apply(this,[e,t,r,1])}function Be(e,t){var r=this;e=u(e);var i=new c(function(t,i){r.ready().then(function(){var s=r._dbInfo;s.db.transaction(function(r){be(r,s,"DELETE FROM "+s.storeName+" WHERE key = ?",[e],function(){t()},function(e,t){i(t)})})}).catch(i)});return A(i,t),i}function xe(e){var t=this,r=new c(function(e,r){t.ready().then(function(){var i=t._dbInfo;i.db.transaction(function(t){be(t,i,"DELETE FROM "+i.storeName,[],function(){e()},function(e,t){r(t)})})}).catch(r)});return A(r,e),r}function Pe(e){var t=this,r=new c(function(e,r){t.ready().then(function(){var i=t._dbInfo;i.db.transaction(function(t){be(t,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],function(t,r){var i=r.rows.item(0).c;e(i)},function(e,t){r(t)})})}).catch(r)});return A(r,e),r}function De(e,t){var r=this,i=new c(function(t,i){r.ready().then(function(){var s=r._dbInfo;s.db.transaction(function(r){be(r,s,"SELECT key FROM "+s.storeName+" WHERE id = ? LIMIT 1",[e+1],function(e,r){var i=r.rows.length?r.rows.item(0).key:null;t(i)},function(e,t){i(t)})})}).catch(i)});return A(i,t),i}function Se(e){var t=this,r=new c(function(e,r){t.ready().then(function(){var i=t._dbInfo;i.db.transaction(function(t){be(t,i,"SELECT key FROM "+i.storeName,[],function(t,r){for(var i=[],s=0;s<r.rows.length;s++)i.push(r.rows.item(s).key);e(i)},function(e,t){r(t)})})}).catch(r)});return A(r,e),r}function ke(e){return new c(function(t,r){e.transaction(function(i){i.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(r,i){for(var s=[],o=0;o<i.rows.length;o++)s.push(i.rows.item(o).name);t({db:e,storeNames:s})},function(e,t){r(t)})},function(e){r(e)})})}function Re(e,t){t=h.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var i,s=this;return i=e.name?new c(function(t){var i;i=e.name===r.name?s._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:i,storeNames:[e.storeName]}):t(ke(i))}).then(function(e){return new c(function(t,r){e.db.transaction(function(i){function s(e){return new c(function(t,r){i.executeSql("DROP TABLE IF EXISTS "+e,[],function(){t()},function(e,t){r(t)})})}for(var o=[],n=0,a=e.storeNames.length;n<a;n++)o.push(s(e.storeNames[n]));c.all(o).then(function(){t()}).catch(function(e){r(e)})},function(e){r(e)})})}):c.reject("Invalid arguments"),A(i,t),i}var Qe={_driver:"webSQLStorage",_initStorage:ye,_support:K(),iterate:Ee,getItem:we,setItem:Ie,removeItem:Be,clear:xe,length:Pe,key:De,keys:Se,dropInstance:Re};function Me(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}function He(e,t){var r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}function Oe(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}function Te(){return!Oe()||localStorage.length>0}function Le(e){var t=this,r={};if(e)for(var i in e)r[i]=e[i];return r.keyPrefix=He(e,t._defaultConfig),Te()?(t._dbInfo=r,r.serializer=ve,c.resolve()):c.reject()}function qe(e){var t=this,r=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var i=localStorage.key(r);0===i.indexOf(e)&&localStorage.removeItem(i)}});return A(r,e),r}function Ue(e,t){var r=this;e=u(e);var i=r.ready().then(function(){var t=r._dbInfo,i=localStorage.getItem(t.keyPrefix+e);return i&&(i=t.serializer.deserialize(i)),i});return A(i,t),i}function Fe(e,t){var r=this,i=r.ready().then(function(){for(var t=r._dbInfo,i=t.keyPrefix,s=i.length,o=localStorage.length,n=1,a=0;a<o;a++){var l=localStorage.key(a);if(0===l.indexOf(i)){var c=localStorage.getItem(l);if(c&&(c=t.serializer.deserialize(c)),void 0!==(c=e(c,l.substring(s),n++)))return c}}});return A(i,t),i}function Ve(e,t){var r=this,i=r.ready().then(function(){var t,i=r._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(i.keyPrefix.length)),t});return A(i,t),i}function ze(e){var t=this,r=t.ready().then(function(){for(var e=t._dbInfo,r=localStorage.length,i=[],s=0;s<r;s++){var o=localStorage.key(s);0===o.indexOf(e.keyPrefix)&&i.push(o.substring(e.keyPrefix.length))}return i});return A(r,e),r}function Je(e){var t=this.keys().then(function(e){return e.length});return A(t,e),t}function Ye(e,t){var r=this;e=u(e);var i=r.ready().then(function(){var t=r._dbInfo;localStorage.removeItem(t.keyPrefix+e)});return A(i,t),i}function Ne(e,t,r){var i=this;e=u(e);var s=i.ready().then(function(){void 0===t&&(t=null);var r=t;return new c(function(s,o){var n=i._dbInfo;n.serializer.serialize(t,function(t,i){if(i)o(i);else try{localStorage.setItem(n.keyPrefix+e,t),s(r)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||o(e),o(e)}})})});return A(s,r),s}function Xe(e,t){if(t=h.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var i,s=this;return i=e.name?new c(function(t){e.storeName?t(He(e,s._defaultConfig)):t(e.name+"/")}).then(function(e){for(var t=localStorage.length-1;t>=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}}):c.reject("Invalid arguments"),A(i,t),i}var je={_driver:"localStorageWrapper",_initStorage:Le,_support:Me(),iterate:Fe,getItem:Ue,setItem:Ne,removeItem:Ye,clear:qe,length:Je,key:Ve,keys:ze,dropInstance:Xe},Ke=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Ge=function(e,t){for(var r=e.length,i=0;i<r;){if(Ke(e[i],t))return!0;i++}return!1},We=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Ze={},_e={},$e={INDEXEDDB:j,WEBSQL:Qe,LOCALSTORAGE:je},et=[$e.INDEXEDDB._driver,$e.WEBSQL._driver,$e.LOCALSTORAGE._driver],tt=["dropInstance"],rt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(tt),it={description:"",driver:et.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function st(e,t){e[t]=function(){var r=arguments;return e.ready().then(function(){return e[t].apply(e,r)})}}function ot(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var r in t)t.hasOwnProperty(r)&&(We(t[r])?arguments[0][r]=t[r].slice():arguments[0][r]=t[r])}return arguments[0]}var nt=function(){function e(t){for(var r in s(this,e),$e)if($e.hasOwnProperty(r)){var i=$e[r],o=i._driver;this[r]=o,Ze[o]||this.defineDriver(i)}this._defaultConfig=ot({},it),this._config=ot({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":i(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,r){var i=new c(function(t,r){try{var i=e._driver,s=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void r(s);for(var o=rt.concat("_initStorage"),n=0,a=o.length;n<a;n++){var l=o[n];if((!Ge(tt,l)||e[l])&&"function"!=typeof e[l])return void r(s)}var d=function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),r=c.reject(t);return A(r,arguments[arguments.length-1]),r}},r=0,i=tt.length;r<i;r++){var s=tt[r];e[s]||(e[s]=t(s))}};d();var u=function(r){Ze[i]&&console.info("Redefining LocalForage driver: "+i),Ze[i]=e,_e[i]=r,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(u,r):u(!!e._support):u(!0)}catch(e){r(e)}});return d(i,t,r),i},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,r){var i=Ze[e]?c.resolve(Ze[e]):c.reject(new Error("Driver not found."));return d(i,t,r),i},e.prototype.getSerializer=function(e){var t=c.resolve(ve);return d(t,e),t},e.prototype.ready=function(e){var t=this,r=t._driverSet.then(function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready});return d(r,e,e),r},e.prototype.setDriver=function(e,t,r){var i=this;We(e)||(e=[e]);var s=this._getSupportedDrivers(e);function o(){i._config.driver=i.driver()}function n(e){return i._extend(e),o(),i._ready=i._initStorage(i._config),i._ready}function a(e){return function(){var t=0;function r(){for(;t<e.length;){var s=e[t];return t++,i._dbInfo=null,i._ready=null,i.getDriver(s).then(n).catch(r)}o();var a=new Error("No available storage method found.");return i._driverSet=c.reject(a),i._driverSet}return r()}}var l=null!==this._driverSet?this._driverSet.catch(function(){return c.resolve()}):c.resolve();return this._driverSet=l.then(function(){var e=s[0];return i._dbInfo=null,i._ready=null,i.getDriver(e).then(function(e){i._driver=e._driver,o(),i._wrapLibraryMethodsWithReady(),i._initDriver=a(s)})}).catch(function(){o();var e=new Error("No available storage method found.");return i._driverSet=c.reject(e),i._driverSet}),d(this._driverSet,t,r),this._driverSet},e.prototype.supports=function(e){return!!_e[e]},e.prototype._extend=function(e){ot(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],r=0,i=e.length;r<i;r++){var s=e[r];this.supports(s)&&t.push(s)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=rt.length;e<t;e++)st(this,rt[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),at=new nt;t.exports=at},{3:3}]},{},[4])(4)},eh(th={exports:{}},th.exports),th.exports);const ih={content:class extends Pu{constructor(e,t,r,i=Pu.DEFAULT_SPEC_VERSION,s=Pu.DEFAULT_PLATFORM){super({sourceColorHcts:Array.isArray(e)?e:[e],variant:hu.CONTENT,contrastLevel:r,isDark:t,platform:s,specVersion:i})}}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,expressive:class extends Pu{constructor(e,t,r,i=Pu.DEFAULT_SPEC_VERSION,s=Pu.DEFAULT_PLATFORM){super({sourceColorHcts:Array.isArray(e)?e:[e],variant:hu.EXPRESSIVE,contrastLevel:r,isDark:t,platform:s,specVersion:i})}}
/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,fidelity:class extends Pu{constructor(e,t,r,i=Pu.DEFAULT_SPEC_VERSION,s=Pu.DEFAULT_PLATFORM){super({sourceColorHcts:Array.isArray(e)?e:[e],variant:hu.FIDELITY,contrastLevel:r,isDark:t,platform:s,specVersion:i})}}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,fruit_salad:class extends Pu{constructor(e,t,r,i=Pu.DEFAULT_SPEC_VERSION,s=Pu.DEFAULT_PLATFORM){super({sourceColorHcts:Array.isArray(e)?e:[e],variant:hu.FRUIT_SALAD,contrastLevel:r,isDark:t,platform:s,specVersion:i})}}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,monochrome:class extends Pu{constructor(e,t,r,i=Pu.DEFAULT_SPEC_VERSION,s=Pu.DEFAULT_PLATFORM){super({sourceColorHcts:Array.isArray(e)?e:[e],variant:hu.MONOCHROME,contrastLevel:r,isDark:t,platform:s,specVersion:i})}}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,neutral:class extends Pu{constructor(e,t,r,i=Pu.DEFAULT_SPEC_VERSION,s=Pu.DEFAULT_PLATFORM){super({sourceColorHcts:Array.isArray(e)?e:[e],variant:hu.NEUTRAL,contrastLevel:r,isDark:t,platform:s,specVersion:i})}}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,rainbow:class extends Pu{constructor(e,t,r,i=Pu.DEFAULT_SPEC_VERSION,s=Pu.DEFAULT_PLATFORM){super({sourceColorHcts:Array.isArray(e)?e:[e],variant:hu.RAINBOW,contrastLevel:r,isDark:t,platform:s,specVersion:i})}}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,tonal_spot:class extends Pu{constructor(e,t,r,i=Pu.DEFAULT_SPEC_VERSION,s=Pu.DEFAULT_PLATFORM){super({sourceColorHcts:Array.isArray(e)?e:[e],variant:hu.TONAL_SPOT,contrastLevel:r,isDark:t,platform:s,specVersion:i})}}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,vibrant:class extends Pu{constructor(e,t,r,i=Pu.DEFAULT_SPEC_VERSION,s=Pu.DEFAULT_PLATFORM){super({sourceColorHcts:Array.isArray(e)?e:[e],variant:hu.VIBRANT,contrastLevel:r,isDark:t,platform:s,specVersion:i})}}},sh={background:"--md-sys-color-background",error:"--md-sys-color-error",errorContainer:"--md-sys-color-error-container",inverseOnSurface:"--md-sys-color-inverse-on-surface",inversePrimary:"--md-sys-color-inverse-primary",inverseSurface:"--md-sys-color-inverse-surface",onBackground:"--md-sys-color-on-background",onError:"--md-sys-color-on-error",onErrorContainer:"--md-sys-color-on-error-container",onPrimary:"--md-sys-color-on-primary",onPrimaryContainer:"--md-sys-color-on-primary-container",onPrimaryFixed:"--md-sys-color-on-primary-fixed",onPrimaryFixedVariant:"--md-sys-color-on-primary-fixed-variant",onSecondary:"--md-sys-color-on-secondary",onSecondaryContainer:"--md-sys-color-on-secondary-container",onSecondaryFixed:"--md-sys-color-on-secondary-fixed",onSecondaryFixedVariant:"--md-sys-color-on-secondary-variant",onSurface:"--md-sys-color-on-surface",onSurfaceVariant:"--md-sys-color-on-surface-variant",onTertiary:"--md-sys-color-on-tertiary",onTertiaryContainer:"--md-sys-color-on-tertiary-container",onTertiaryFixed:"--md-sys-color-on-tertiary-fixed",onTertiaryFixedVariant:"--md-sys-color-on-tertiary-fixed-variant",outline:"--md-sys-color-outline",outlineVariant:"--md-sys-color-outline-variant",primary:"--md-sys-color-primary",primaryContainer:"--md-sys-color-primary-container",primaryFixed:"--md-sys-color-primary-fixed",primaryFixedDim:"--md-sys-color-primary-fixed-dim",scrim:"--md-sys-color-scrim",secondary:"--md-sys-color-secondary",secondaryContainer:"--md-sys-color-secondary-container",secondaryFixed:"--md-sys-color-secondary-fixed",secondaryFixedDim:"--md-sys-color-secondary-fixed-dim",shadow:"--md-sys-color-shadow",surface:"--md-sys-color-surface",surfaceBright:"--md-sys-color-surface-bright",surfaceContainer:"--md-sys-color-surface-container",surfaceContainerHigh:"--md-sys-color-surface-container-high",surfaceContainerHighest:"--md-sys-color-surface-container-highest",surfaceContainerLow:"--md-sys-color-surface-container-low",surfaceContainerLowest:"--md-sys-color-surface-container-lowest",surfaceDim:"--md-sys-color-surface-dim",surfaceTint:"--md-sys-color-surface-tint",surfaceVariant:"--md-sys-color-surface-variant",tertiary:"--md-sys-color-tertiary",tertiaryContainer:"--md-sys-color-tertiary-container",tertiaryFixed:"--md-sys-color-tertiary-fixed",tertiaryFixedDim:"--md-sys-color-tertiary-fixed-dim"};function oh(){const e=window.getComputedStyle(document.body).getPropertyValue("--primary-color").replace("#",""),t=e.length>0?e:"#009ac7",r=e.startsWith("rgb")?function(e){const t=e.split("(")[1].split(")")[0].split(",").map(e=>Number.parseInt(e));return Td(t[0],t[1],t[2])}(t):function(e){
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
return function(e){const t=3===(e=e.replace("#","")).length,r=6===e.length,i=8===e.length;if(!t&&!r&&!i)throw new Error("unexpected hex "+e);let s=0,o=0,n=0;return t?(s=Wu(e.slice(0,1).repeat(2)),o=Wu(e.slice(1,2).repeat(2)),n=Wu(e.slice(2,3).repeat(2))):r?(s=Wu(e.slice(0,2)),o=Wu(e.slice(2,4)),n=Wu(e.slice(4,6))):i&&(s=Wu(e.slice(2,4)),o=Wu(e.slice(4,6)),n=Wu(e.slice(6,8))),(255<<24|(255&s)<<16|(255&o)<<8|255&n)>>>0}(e)}(t);return r}function nh(e,t,r){return new(0,ih[t])(eu.fromInt(e),r,0,"2025","phone")}async function ah(e,t,r){const i=e?.src??"";if(!(Hr(i)===kr.ACCESSIBLE)){const e=oh();return{scheme:nh(e,t,r),color:e}}const s=await async function(e,t,r){const i=lh(e,t,r),s=await rh.getItem(i);if("number"==typeof s)return nh(s,t,r);return}(i,t,r);if(s)return{scheme:s,color:s.sourceColorArgb};const o=await async function(e){return e.crossOrigin="Anonymous",await Zu(e)}(e),n=nh(o,t,r);return"img"==e.tagName.toLowerCase()&&await async function(e,t,r,i){const s=lh(e,t,r);await rh.setItem(s,i.sourceColorArgb)}(i,t,r,n),{scheme:n,color:o}}function lh(e,t,r){return`${e}-${t}-${r?"dark":"light"}`}class ch{constructor(e,t,r){this._updatingScheme=!1,this._observerDelay=300,this._canGroupWith=[],this.observerCallback=()=>{if(this._timeout)try{clearTimeout(this._timeout)}catch{}this._timeout=window.setTimeout(()=>{this._timeout=void 0,this.createAndApplyExpressiveScheme()},this._observerDelay)},this._expressiveScheme=new o(r,{context:yi}),this._useExpressive=new o(r,{context:bi}),this._useVibrant=new o(r,{context:wi}),this._groupMembers=new o(r,{context:si}),this._groupVolume=new o(r,{context:oi}),this._activeEntityConfig=new o(r,{context:_r}),this._activeEntityID=new o(r,{context:$r}),this._activeMediaPlayer=new o(r,{context:ti}),this._activePlayerName=new o(r,{context:ei}),this._volumeMediaPlayer=new o(r,{context:ri}),this._activePlayerData=new o(r,{context:ii}),this._hass=e,this.config=t.config,this.configController=t,this._host=r,this.setDefaultActivePlayer()}set hass(e){this._hass=e;zr(this.activeMediaPlayer,e.states[this.activeEntityID])&&this.setActivePlayer(this.activeEntityID),this.volumeMediaPlayer=e.states[this.activeEntityConfig.volume_entity_id],this.updateActivePlayerData()}get hass(){return this._hass}set config(e){this._config=e,this.useExpressive=e.expressive,this.useVibrant="vibrant"==e.expressive_scheme}get config(){return this._config}set useExpressive(e){this._useExpressive.setValue(e)}get useExpressive(){return this._useExpressive.value}set useVibrant(e){this._useVibrant.setValue(e)}get useVibrant(){return this._useVibrant.value}set activeEntityConfig(e){this._activeEntityConfig.setValue(e);const t=this.hass.states;this.activePlayerName=e.name,this.volumeMediaPlayer=t[e.volume_entity_id],this.activeMediaPlayer=t[e.entity_id],this.activeEntityID=e.entity_id,this.configController.activeEntityConfig=e,this.setCanGroupWith()}get activeEntityConfig(){return this._activeEntityConfig.value}set activeEntityID(e){this._activeEntityID.setValue(e)}get activeEntityID(){return this._activeEntityID.value}set activeMediaPlayer(e){e&&zr(this.activeMediaPlayer,e)&&(this._activeMediaPlayer.setValue(e),this.dispatchUpdatedActivePlayer(),this.updateActivePlayerData(),e.attributes.group_members&&this.setGroupAttributes())}get activeMediaPlayer(){return this._activeMediaPlayer.value}set activePlayerName(e){if(e.length>0)return void this._activePlayerName.setValue(e);const t=this.hass.states[this.activeEntityConfig.entity_id];t&&this._activePlayerName.setValue(t.attributes.friendly_name??"")}get activePlayerName(){return this._activePlayerName.value}set groupMembers(e){!Yr(this._groupMembers.value,e)&&e&&this._groupMembers.setValue(e)}get groupMembers(){return this._groupMembers.value}set groupVolume(e){this._groupVolume.value!=e&&this._groupVolume.setValue(e)}get groupVolume(){return this._groupVolume.value}set volumeMediaPlayer(e){if(!e)return;const t=this.volumeMediaPlayer?.attributes,r=e.attributes;t?.volume_level==r.volume_level&&t?.is_volume_muted==r.is_volume_muted&&t||this._volumeMediaPlayer.setValue(e)}get volumeMediaPlayer(){return this._volumeMediaPlayer.value}set expressiveScheme(e){e&&this._expressiveScheme.setValue(e)}get expressiveScheme(){return this._expressiveScheme.value}set activePlayerData(e){this._activePlayerData.setValue(e)}get activePlayerData(){return this._activePlayerData.value}set carouselElement(e){e&&(this._carouselElement=e,this.createObserver())}get carouselElement(){return this._carouselElement}set canGroupWith(e){this._canGroupWith=e}get canGroupWith(){return this._canGroupWith}createObserver(){if(!this.config.expressive)return;if(this._observer)try{this._observer.disconnect()}catch{}if(!this.carouselElement)return;const e=new MutationObserver(this.observerCallback);e.observe(this.carouselElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["src","data-playing"]}),this.expressiveScheme||this.createAndApplyExpressiveScheme(),this._observer=e}getActiveArtwork(){if(this.carouselElement)return this.carouselElement.querySelector("#img-playing")}async updateActivePlayerData(){const e=["unavailable","unknown"];if(!this.activeMediaPlayer||e.includes(this.activeMediaPlayer.state)||!this.volumeMediaPlayer||e.includes(this.volumeMediaPlayer.state)||!this.activeEntityID)return;if(!Gr(this.hass,this.activeEntityID))return;const t=await this.getactivePlayerData();JSON.stringify(t)!=JSON.stringify(this.activePlayerData)&&(this.activePlayerData=t)}dispatchUpdatedActivePlayer(){const e=new CustomEvent("active-player-updated",{detail:this.activeMediaPlayer});this._host.dispatchEvent(e)}setGroupAttributes(){this.groupMembers=this.getGroupedPlayers().map(e=>e.entity_id),this._getAndSetGroupedVolume()}getGroupedPlayers(){if(!this.activeMediaPlayer)return[];const e=this.activeMediaPlayer.attributes.active_queue;return this.config.entities.filter(t=>{const r=this.hass.states[t.entity_id];if(r){const t=r.attributes;return t.active_queue==e&&"group"!=t.mass_player_type}return!1})}setDefaultActivePlayer(){const e=this.hass.states,t=this._config.entities,r=t.find(t=>{const r=e[t.entity_id];return Jr(this.hass,r,t)}),i=t.find(e=>Gr(this.hass,e.entity_id));this.activeEntityConfig=r||(i||t[0])}setActivePlayer(e){const t=this.config.entities.find(t=>t.entity_id==e);t&&(this.activeEntityConfig=t)}async getactivePlayerData(){const e=this.activeMediaPlayer,t=this.volumeMediaPlayer,r=(await this.actionGetCurrentQueue()).current_item;return{playing:"playing"==e?.state,repeat:e?.attributes.repeat??tr.OFF,shuffle:e?.attributes.shuffle??!1,track_album:e?.attributes.media_album_name??"",track_artist:e?.attributes.media_artist??"",track_artwork:e?.attributes.entity_picture_local??e?.attributes.entity_picture??"",track_title:e?.attributes.media_title??"",muted:t?.attributes.is_volume_muted??!0,volume:Math.floor(100*(t?.attributes.volume_level??0)),player_name:this.activePlayerName,favorite:r?.media_item?.favorite??!1}}async getPlayerProgress(){if(!Jr(this.hass,this.activeMediaPlayer,this.activeEntityConfig))return 0;return(await this.actionGetCurrentQueue()).elapsed_time}async getPlayerActiveItemDuration(){if(!Jr(this.hass,this.activeMediaPlayer,this.activeEntityConfig))return 1;const e=await this.actionGetCurrentQueue();return e.current_item?.duration??1}async actionGetCurrentQueue(){const e=this.activeEntityID;if(!Gr(this.hass,e))return{queue_id:"",active:!1,name:this.activePlayerName,items:0,shuffle_enabled:!1,repeat_mode:!1,current_index:0,elapsed_time:0,current_item:null,next_item:null};const t={type:"call_service",domain:"music_assistant",service:"get_queue",service_data:{entity_id:e},return_response:!0};return(await this.hass.callWS(t)).response[e]}createAndApplyExpressiveScheme(){this.config.expressive&&this.createExpressiveSchemeFromArtwork().then(e=>{e&&this.applyExpressiveScheme()})}applyExpressiveScheme(){const e=this.expressiveScheme;e&&function(e,t){Object.entries(sh).forEach(r=>{const i=r[0],s=r[1],o=e[i];if(o){const e=`#${o.toString(16).slice(2)}`;t.style.setProperty(s,e)}})}(e,this._host)}async createExpressiveSchemeFromArtwork(){if(this._updatingScheme)return;this._updatingScheme=!0;const e=this.getActiveArtwork(),t=this.config.expressive_scheme,r=this.hass.themes.darkMode;if(!this.activeMediaPlayer?.attributes.media_content_id||!e){const e=oh(),i=nh(e,t,r);return this._activeSchemeColor=e,this.expressiveScheme=i,this._updatingScheme=!1,this.expressiveScheme}const i=await ah(e,t,r);return this.expressiveScheme=i.scheme,this._activeSchemeColor=i.color,this._updatingScheme=!1,this.expressiveScheme}async _getAndSetGroupedVolume(){if(!this.activeMediaPlayer)return;const e=this.activeMediaPlayer.entity_id,t=await this.getGroupedVolume(e);this.groupVolume=t}async setGroupedVolume(e,t){const r={type:"call_service",domain:"mass_queue",service:"set_group_volume",service_data:{entity:e,volume_level:t}};await this.hass.callWS(r)}async setActiveGroupVolume(e){this.activeMediaPlayer&&(await this.setGroupedVolume(this.activeMediaPlayer.entity_id,e),this.groupVolume=e)}async getActiveGroupVolume(){return this.activeMediaPlayer?await this.getGroupedVolume(this.activeMediaPlayer.entity_id):0}async getGroupedVolume(e){const t={type:"call_service",domain:"mass_queue",service:"get_group_volume",service_data:{entity:e},return_response:!0};return(await this.hass.callWS(t)).response.volume_level}async getEntityInfo(e=this.activeEntityID){const t={type:"mass_queue/get_info",entity_id:e};return await this.hass.callWS(t)}async getPlayerProvider(e){return(await this.getEntityInfo(e)).provider}async playerCanGroupWith(e=this.activeEntityID){if(!Gr(this.hass,e))return[];const t=(await this.getEntityInfo(e)).can_group_with,r=[];for(const e of this.config.entities){const i=await this.getEntityInfo(e.entity_id);t.includes(i.player_id)&&r.push(e.entity_id)}return r}async setCanGroupWith(){this.activeEntityID&&(this.canGroupWith=await this.playerCanGroupWith())}disconnected(){this._observer?.disconnect(),this._observer=void 0}reconnected(e){this.hass=e,this.setActivePlayer(this.activeEntityID),this.createObserver()}}class Ah{constructor(e,t){this.hass=e,this.player_entity=t}set hass(e){e&&(this._hass=e)}get hass(){return this._hass}set player_entity(e){this._player_entity=e}get player_entity(){return this._player_entity}async getQueue(e){const t={entity:this.player_entity};e?.limit_before&&(t.limit_before=e.limit_before),e?.limit_after&&(t.limit_after=e.limit_after),e?.limit&&(t.limit=e.limit),e?.offset&&(t.offset=e.offset);const r={type:"call_service",domain:"mass_queue",service:"get_queue_items",service_data:t,return_response:!0};return(await this.hass.callWS(r)).response[this.player_entity]}async playQueueItem(e){try{await this.hass.callService("mass_queue","play_queue_item",{entity:this.player_entity,queue_item_id:e})}catch(e){console.error("Error selecting queue item",e)}}async removeQueueItem(e){try{await this.hass.callService("mass_queue","remove_queue_item",{entity:this.player_entity,queue_item_id:e})}catch(e){console.error("Error removing queue item",e)}}async MoveQueueItemNext(e){try{await this.hass.callService("mass_queue","move_queue_item_next",{entity:this.player_entity,queue_item_id:e})}catch(e){console.error("Error moving queue item next",e)}}async MoveQueueItemUp(e){try{await this.hass.callService("mass_queue","move_queue_item_up",{entity:this.player_entity,queue_item_id:e})}catch(e){console.error("Error moving queue item up",e)}}async MoveQueueItemDown(e){try{await this.hass.callService("mass_queue","move_queue_item_down",{entity:this.player_entity,queue_item_id:e})}catch(e){console.error("Error moving queue item down",e)}}async clearQueue(e=this.player_entity){await this.hass.callService("media_player","clear_playlist",{entity_id:e})}async getLocalImage(e){if("string"!=typeof e)return"";try{return await this.hass.callWS({type:"mass_queue/download_and_encode_image",url:e})}catch(e){return console.error("Error getting image",e),""}}}class dh{constructor(e,t,r){this._host=e,this._hass=t,this.setEntityConfig(r),this._setupActions()}setEntityConfig(e){this._entityConf=e;const t=e.entity_id,r=e.volume_entity_id,i=this._hass.states[t],s=this._hass.states[r];i&&(this._activeEntity=i),s&&(this._volumeEntity=s),this._activeEntityId=t,this._volumeEntityId=r}set hass(e){this._hass=e,this._updateActions()}_setupActions(){this._browserActions=new no(this._hass),this._playerActions=new ta(this._hass),this._playersActions=new QA(this._hass),this._queueActions=new Ah(this._hass,this._activeEntityId)}_updateActions(){if(this._browserActions.hass=this._hass,this._playerActions.hass=this._hass,this._playersActions.hass=this._hass,this._queueActions.hass=this._hass,this._activeEntityId){const e=this._hass.states[this._activeEntityId];e&&(this._activeEntity=e)}if(this._volumeEntityId){const e=this._hass.states[this._volumeEntityId];e&&(this._volumeEntity=e)}this._queueActions.player_entity=this._activeEntityId}async actionTogglePower(){await this.PlayerActions.actionTogglePlayer(this._activeEntity)}async actionPlayPause(){await this.PlayerActions.actionPlayPause(this._activeEntity)}async actionPlayNext(){await this.PlayerActions.actionNext(this._activeEntity)}async actionPlayPrevious(){await this.PlayerActions.actionPrevious(this._activeEntity)}async actionToggleShuffle(){await this.PlayerActions.actionShuffleToggle(this._activeEntity)}async actionSetRepeat(e){await this.PlayerActions.actionRepeatSet(this._activeEntity,e)}async actionSeek(e){await this.PlayerActions.actionSeek(this._activeEntity,e)}async actionAddFavorite(){await this.PlayerActions.actionAddFavorite(this._activeEntity)}async actionRemoveFavorite(){await this.PlayerActions.actionRemoveFavorite(this._activeEntity)}async actionSetVolume(e){const t=e>1?e/100:e;await this.PlayerActions.actionSetVolume(this._volumeEntity,t)}async actionToggleMute(){await this.PlayerActions.actionMuteToggle(this._volumeEntity)}get browserActions(){return this._browserActions}get PlayerActions(){return this._playerActions}get playersActions(){return this._playersActions}get queueActions(){return this._queueActions}disconnected(){}reconnected(e){this.hass=e}}class uh{constructor(e,t,r,i){this._fails=0,this._listening=!1,this._timedListening=!1,this._updatingQueue=!1,this.getQueue=async()=>{if(!this.activeMediaPlayer)return;const e=this.config.entities,t=this.activeMediaPlayer.entity_id,r=e.find(e=>e.entity_id==t);if(Jr(this.hass,this.activeMediaPlayer,r)){return await this._getQueue()}return this.queue=[],[]},this.timedListener=()=>{try{clearInterval(this._interval)}finally{this._interval=void 0}this._interval=window.setInterval(this.timedListener,1e4),this.getQueue()},this.eventListener=e=>{const t=e.data,r=t.data.queue_id;if("queue_updated"==t.type&&r==this._activeQueueID){if(this._updatingQueue)return;this.getQueue()}},this.hass=e,this.config=r,this._host=i,this._queue=new o(i,{context:Ci}),this._currentQueueItem=new o(i,{context:Ii}),this._nextQueueItem=new o(i,{context:Bi}),this._previousQueueItem=new o(i,{context:xi}),this._actions=new Ah(e,t.entity_id),this.activeMediaPlayer=t,this.getQueue(),this.subscribeUpdates()}set queue(e){Yr(this._queue.value,e)||(this.activeMediaPlayer?("playing"!=this.activeMediaPlayer.state||e?.length)&&this._queue.setValue(e):this._queue.setValue([]))}get queue(){return this._queue.value}set hass(e){this._hass=e,this.activeMediaPlayer&&(this.activeMediaPlayer=e.states[this.activeMediaPlayer.entity_id])}get hass(){return this._hass}set activeMediaPlayer(e){if(this._activeMediaPlayer){if(!zr(e,this._activeMediaPlayer))return}e&&(this._activeMediaPlayer=e,this._activeQueueID=e.attributes.active_queue??"",this.actions.player_entity=e.entity_id,this.getQueue())}get activeMediaPlayer(){return this._activeMediaPlayer}set config(e){this._config=e}get config(){return this._config}set actions(e){this._actions=e}get actions(){return this._actions}set currentQueueItem(e){Yr(this._currentQueueItem.value,e)||this._currentQueueItem.setValue(e)}get currentQueueItem(){return this._currentQueueItem.value}set nextQueueItem(e){Yr(this._nextQueueItem.value,e)||this._nextQueueItem.setValue(e)}get nextQueueItem(){return this._nextQueueItem.value}set previousQueueItem(e){Yr(this._previousQueueItem.value,e)||this._previousQueueItem.setValue(e)}get previousQueueItem(){return this._previousQueueItem.value}setActiveEntityId(e){this.activeMediaPlayer=this.hass.states[e]}raiseQueueFailure(){console.error("Reached max failures getting queue, check your browser and HA logs!")}setActiveTrack(e){if(!this.activeMediaPlayer)return;const t=this.activeMediaPlayer.attributes.media_content_id,r=e.findIndex(e=>e.media_content_id==t);return-1!==r&&(e[r].playing=!0),e}resetQueueFailures(){this._fails=0,this.getQueue()}async _getQueue(e=0){if(!this.activeMediaPlayer)return;if(this._updatingQueue)return;if(this._updatingQueue=!0,this._fails>=6)return this.raiseQueueFailure(),void(this._updatingQueue=!1);const t=this.queue?.findIndex(e=>e.playing)??0,r={offset:-1};t>250&&(r.offset=t-250);try{let t=await this.actions.getQueue(r)??null;if(t?.length||!["playing","paused"].includes(this.activeMediaPlayer.state))return t?(this._fails=0,t=this.setActiveTrack(t)??null,this.queue=t,this.getCurNextPrQueueItems(),this._updatingQueue=!1,t):void(this._updatingQueue=!1);if(e>=6)return[];setTimeout(()=>{this._getQueue(e+1)},75)}catch(e){throw this._fails++,e}finally{this._updatingQueue=!1}return[]}get isSubscribed(){return this._listening||this._timedListening}async subscribeUpdates(){this.unsubscribeUpdates(),this.hass.user.is_admin?(this._unsubscribe=await this.hass.connection.subscribeEvents(this.eventListener,"mass_queue"),this._listening=!0):(this.timedListener(),this._timedListening=!0)}unsubscribeUpdates(){if(this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=void 0),this._interval)try{clearInterval(this._interval)}finally{this._interval=void 0}}getCurNextPrQueueItems(){const e=this.queue;if(!e)return;const t=e.findIndex(e=>e.playing);this.currentQueueItem=e[t],this.previousQueueItem=t>0?e[t-1]:null,this.nextQueueItem=t<e.length-1?e[t+1]:null}setItemActive(e){if(!this.queue)return;const t=this.getIndex(e);if(-1===t||!this.queue[t])return;const r=this.queue.findIndex(e=>e.playing);-1!==r&&(this.queue[r].playing=!1),this.queue[t].playing=!0}getIndex(e){return this.queue?this.queue.findIndex(t=>t.queue_item_id===e):-1}moveQueueItem(e,t){if(!this.queue)return;const r=[...this.queue];r.splice(t,0,r.splice(e,1)[0]),this.queue=r}async playQueueItem(e){this.setItemActive(e),await this.actions.playQueueItem(e)}async moveQueueItemUp(e){const t=this.getIndex(e);t<=0||(this.moveQueueItem(t,t-1),await this.actions.MoveQueueItemUp(e))}async moveQueueItemDown(e){if(!this.queue)return;const t=this.getIndex(e);-1===t||t>=this.queue.length-1||(this.moveQueueItem(t,t+1),await this.actions.MoveQueueItemDown(e))}async moveQueueItemNext(e){if(!this.queue)return;const t=this.getIndex(e);if(-1===t)return;const r=this.queue.findIndex(e=>e.playing);if(-1===r)return;const i=r+1;this.moveQueueItem(t,i),await this.actions.MoveQueueItemNext(e)}async removeQueueItem(e){this.queue&&(this.queue=this.queue.filter(t=>t.queue_item_id!==e),await this.actions.removeQueueItem(e))}async clearQueue(e=this.activeMediaPlayer?.entity_id??""){await this.actions.clearQueue(e)}disconnected(){this.unsubscribeUpdates()}reconnected(e){this.hass=e,this.subscribeUpdates(),this.resetQueueFailures(),this.getQueue()}}const hh={playlist:function(e,t,r){const i={type:"playlist",media_content_id:e,media_image:t,media_title:r};return{title:r,thumbnail:t,fallback:ir.PLAYLIST,data:i}},album:function(e,t,r){const i={type:"album",media_content_id:e,media_image:t,media_title:r};return{title:r,thumbnail:t,fallback:ir.PLAYLIST,data:i}},artist:function(e,t,r){const i={type:"artist",media_content_id:e,media_image:t,media_title:r};return{title:r,thumbnail:t,fallback:ir.PLAYLIST,data:i}},podcast:function(e,t,r){const i={type:"podcast",media_content_id:e,media_image:t,media_title:r};return{title:r,thumbnail:t,fallback:ir.PLAYLIST,data:i}}},{AttributePart:ph}=Ti,gh=e=>e,mh={h:gh`
    <img class="thumbnail-section" loading="lazy">
  `,parts:[{type:1,index:0,name:"src",strings:["",""],ctor:ph},{type:1,index:0,name:"onerror",strings:["this.src = '","'"],ctor:ph}]};const vh={h:gh`<!--?-->`,parts:[]},fh={h:gh` <?> <?> `,parts:[{type:2,index:0},{type:2,index:1}]},yh={h:gh`
    <div class="thumbnail" style="display: grid; grid-template-columns: 1fr 1fr; padding-bottom: 0%; height: unset; width: unset; padding-left: unset; padding-right: unset;">
      <?>
    </div>
  `,parts:[{type:2,index:1}]};async function bh(e,t,r,i,s){const o=[...Array(4).keys()],n=[];o.forEach(o=>{const a=o%t.length;n.push(async function(e,t,r=ir.DISC,i,s){const o=await Or(e,t,r,i,s);return{_$litType$:mh,values:[o.image_url,o.fallback_url]}}(e,t[a]?.thumbnail??r,r,i,s))});const a=await Promise.all(n);let l={_$litType$:vh,values:[]};return a.forEach(e=>{l={_$litType$:fh,values:[l,e]}}),{_$litType$:yh,values:[l]}}function wh(e){return e.map(e=>({title:e.name,thumbnail:e.image,fallback:ir.CLEFT,data:{type:"service",media_content_id:e.media_content_id,media_content_type:e.media_content_type,service:e.service}}))}function Eh(e,t,r){const i=Ar[t];return e.map(e=>{const t=hh[e.media_type];if(t&&r)return t(e.uri,e.image??"",e.name);return{title:e.name,thumbnail:e.image??ir.CLEFT,fallback:i,data:{type:"service",media_content_id:e.uri,media_content_type:e.media_type}}})}class Ch{constructor(e,t,r,i){this._updatingCards=!1,this.hass=e,this.config=t,this._host=i,this._items=new o(i,{context:Pi,initialValue:{favorites:{main:[]},recents:{main:[]},recommendations:{main:[]},search:[]}}),this.actions=new no(e),this.browserConfig=t.media_browser,this.activeEntityId=r,this.items&&this.resetAndGenerateSections()}set items(e){if(!e)return;if(Yr(this._items.value,e))return;const t={...e};this._items.setValue(t)}get items(){return this._items.value}resetAndGenerateSections(){this._updatingCards||(this._updatingCards=!0,this.items={favorites:{main:[]},recents:{main:[]},recommendations:{main:[]},search:[]},this.generateAllSections())}generateAllSections(){const e=[this.generateAllFavorites(),this.generateAllRecents(),this.generateAllRecommendations()];Promise.all(e).then(()=>{if(this.generateCustomSections(),!this.items)return;const e={section:"all",cards:this.items},t=new CustomEvent("cards-updated",{detail:e});this._host.dispatchEvent(t)}).finally(()=>{this._updatingCards=!1})}set activeEntityId(e){e!=this._activeEntityId&&(this._activeEntityId=e,this.resetAndGenerateSections())}get activeEntityId(){return this._activeEntityId}async search(e,t,r,i=!1,s=20){return Eh(await this.actions.actionSearchMedia(e,t,r,i,s),r,this.browserConfig.favorites.show_collection_view)}async generateAllFavorites(){const e=this.browserConfig.favorites,t=this.config.download_local,r=this.config.proxy_all_artwork,i=[this.generateFavoriteData(e.albums,er.ALBUM,e.albums.favorites_only,t,r),this.generateFavoriteData(e.artists,er.ARTIST,e.artists.favorites_only,t,r),this.generateFavoriteData(e.audiobooks,er.AUDIOBOOK,e.audiobooks.favorites_only,t,r),this.generateFavoriteData(e.playlists,er.PLAYLIST,e.playlists.favorites_only,t,r),this.generateFavoriteData(e.podcasts,er.PODCAST,e.podcasts.favorites_only,t,r),this.generateFavoriteData(e.radios,er.RADIO,e.radios.favorites_only,t,r),this.generateFavoriteData(e.tracks,er.TRACK,e.tracks.favorites_only,t,r)];await Promise.all(i);const s={section:"favorites",cards:this.items.favorites},o=new CustomEvent("cards-updated",{detail:s});this._host.dispatchEvent(o)}async getFavoriteSection(e,t,r=!0){const i=e.limit,s=e.items;return[...Eh(await this.actions.actionGetLibrary(this.activeEntityId,t,i,!!r||null),t,this.browserConfig.favorites.show_collection_view),...wh(s)]}async generateFavoriteData(e,t,r=!0,i,s){if((this.items?.favorites??{})[t]||!e.enabled)return;const o=await this.getFavoriteSection(e,t,r);if(0===o.length)return;const n={...this.items};n.favorites[t]=o;const a=await async function(e,t,r,i,s){const o=Ar[t];return{title:cr(`browser.sections.${t}`,e),background:await bh(e,r,o,i,s),thumbnail:o,fallback:o,data:{type:"section",subtype:"favorites",section:t}}}(this.hass,t,o,i,s);n.favorites.main.push(a),this.items={...n}}async generateAllRecents(){const e=this.browserConfig.recents,t=[this.generateRecentsData(e.albums,er.ALBUM),this.generateRecentsData(e.artists,er.ARTIST),this.generateRecentsData(e.audiobooks,er.AUDIOBOOK),this.generateRecentsData(e.playlists,er.PLAYLIST),this.generateRecentsData(e.podcasts,er.PODCAST),this.generateRecentsData(e.radios,er.RADIO),this.generateRecentsData(e.tracks,er.TRACK)];await Promise.all(t);const r={section:"recents",cards:this.items.recents},i=new CustomEvent("cards-updated",{detail:r});this._host.dispatchEvent(i)}async getRecentSection(e,t){const r=e.limit;return[...Eh(await this.actions.actionGetLibraryRecents(this.activeEntityId,t,r),t,this.browserConfig.recents.show_collection_view)]}async generateRecentsData(e,t){if(this.items.recents[t]||!e.enabled)return;const r=await this.getRecentSection(e,t);if(r.length>0){const e=await async function(e,t,r,i,s){const o=Ar[t];return{title:cr(`browser.sections.${t}`,e),background:await bh(e,r,o,i,s),thumbnail:o,fallback:o,data:{type:"section",subtype:"recents",section:t}}}(this.hass,t,r,this.config.download_local,this.config.proxy_all_artwork),i={...this.items};i.recents.main.push(e),i.recents[t]=r,this.items={...i}}}async generateRecommendationSection(e){if(this.items.recommendations[e.name])return;const t=function(e,t){return e.items.map(e=>{const r=hh[e.media_type];return r&&t?r(e.uri,e.image,e.name):{title:e.name,thumbnail:e.image,fallback:ir.CLEFT,data:{type:"service",media_content_id:e.uri,media_content_type:e.media_type}}})}(e,this.browserConfig.recommendations.show_collection_view);if(t.length>0){const r=await async function(e,t,r,i,s){const o=ir.CLEFT;return{title:t.name,background:await bh(e,r,o,i,s),thumbnail:o,fallback:o,data:{type:"section",subtype:"recommendations",section:t.name}}}(this.hass,e,t,this.config.download_local,this.config.proxy_all_artwork),i={...this.items};i.recommendations.main.push(r),i.recommendations[e.name]=t,this.items={...i}}}async generateAllRecommendations(){const e=this.browserConfig.recommendations.providers??null,t=(await this.actions.actionGetRecommendations(this.activeEntityId,e)).response.response,r=[];t.forEach(e=>{r.push(this.generateRecommendationSection(e))}),await Promise.all(r);const i={section:"recommendations",cards:this.items.recommendations},s=new CustomEvent("cards-updated",{detail:i});this._host.dispatchEvent(s)}generateCustomSections(){this.browserConfig.sections.forEach(e=>{this.generateCustomSectionData(e)})}generateCustomSectionData(e){const t={title:e.name,thumbnail:e.image,fallback:ir.CLEFT,data:{type:"section",subtype:"favorites",section:`custom-${e.name}`}},r=wh(e.items),i={...this.items};i.favorites[`custom-${e.name}`]=r,i.favorites.main.push(t),this.items={...i}}disconnected(){}reconnected(e){this.hass=e,this.resetAndGenerateSections()}}class Ih{constructor(e){this._hass=new o(document.body,{context:Zr}),this._connected=!0,this._reconnected=!1,this.host=e,this.configController=new Bd(e),this._activeSection=new o(this.host,{context:ui})}set host(e){this._host=e}get host(){return this._host}setupIfReady(){this._setupActiveController(),this._setupActionsController(),this._setupQueueController(),this._setupBrowserController()}_setupActiveController(){if(this.hass&&this.Config&&!this.activePlayerController){const e=new ch(this.hass,this.Config,this.host);this.activePlayerController=new o(this.host,{context:pi}),this.activePlayerController.setValue(e)}}_setupActionsController(){const e=!!(this.activePlayerController&&this.config&&this.hass&&this.ActivePlayer);!this.actionsController&&e&&(this.actionsController=new o(this.host,{context:gi}),this.actionsController.setValue(new dh(this.host,this.hass,this.ActivePlayer.activeEntityConfig)))}_setupQueueController(){this.hass&&this.activeEntity&&this.config&&!this.queueController&&(this.queueController=new o(this.host,{context:vi}),this.queueController.setValue(new uh(this.hass,this.activeEntity,this.config,this.host)))}_setupBrowserController(){this.hass&&this.config&&this.activeEntityId&&!this.browserController&&(this.browserController=new o(this.host,{context:fi}),this.browserController.setValue(new Ch(this.hass,this.config,this.activeEntityId,this.host)))}set hass(e){e&&(this._hass.value=e,this.setupIfReady(),this.ActivePlayer&&(this.ActivePlayer.hass=e),this.Actions.hass=e,this.Queue.hass=e,this._reconnected&&(this._reconnected=!1,this.hassReconnected()))}get hass(){return this._hass.value}set config(e){!Yr(this.configController.config,e)&&e&&(this.configController.config=e,this.setupIfReady())}get config(){return this.configController.config}get Config(){return this.configController}set activeEntityId(e){this.ActivePlayer&&(this.ActivePlayer.setActivePlayer(e),this.Actions&&this.Actions.setEntityConfig(this.ActivePlayer.activeEntityConfig),this.Config.activeEntityConfig=this.ActivePlayer.activeEntityConfig),this.Queue&&this.Queue.setActiveEntityId(e),this.Browser&&(this.Browser.activeEntityId=e)}get activeEntityId(){return this.ActivePlayer?.activeEntityID??""}get activeEntity(){return this.ActivePlayer?.activeMediaPlayer}get volumeEntity(){return this.ActivePlayer?.volumeMediaPlayer}set activeSection(e){if(e&&e!=this.activeSection){this._activeSection.setValue(e);const t=new CustomEvent("section-changed",{detail:e});this.host.dispatchEvent(t)}}get activeSection(){return this._activeSection.value}get ActivePlayer(){if(this.activePlayerController)return this.activePlayerController.value}get Actions(){return this.actionsController?.value}get Queue(){return this.queueController?.value}get Browser(){return this.browserController?.value}disconnected(){this.ActivePlayer.disconnected(),this.Actions.disconnected(),this.Queue.disconnected(),this.Browser.disconnected(),this._connected=!1}connected(){this._connected=!0,this._reconnected=!0}hassReconnected(){const e=this.hass;this.ActivePlayer.reconnected(e),this.Actions.reconnected(e),this.Queue.reconnected(e),this.Browser.reconnected(e)}translate(e){return cr(e,this.hass)}}const Bh="mass-player-card",xh="Music Assistant Player Card";console.info(`%c ${xh} \n%c Version v2.8.0`,"color: teal; font-weight: bold; background: lightgray","color: darkblue; font-weight: bold; background: white"),window.customCards=window.customCards??[],window.customCards.push({type:`${Bh}`,name:`${xh}`,preview:!1,description:"Music Assistant Player Card for Home Assistant",documentationURL:"https://github.com/droans/mass-player-card"}),rh.config({name:"mass-player-card",version:1,storeName:"expressive-schemes",description:"Cached Expressive schemes for MA media items."});let Ph=class extends me{constructor(){super(...arguments),this._controller=new Ih(this),this.syncPlayerAcrossDashboard=!1,this.onPlayerSync=e=>{const t=e.detail.player;this.setActivePlayer(t,!0)},this.syncPlayerSelection=()=>{const e={player:this._controller.ActivePlayer?.activeEntityID??""},t=new CustomEvent("mpc-player-sync",{detail:e});globalThis.dispatchEvent(t)},this.setActivePlayer=(e,t=!1)=>{0!==e.length&&(this._controller.activeEntityId=e,!t&&this.syncPlayerAcrossDashboard&&this.syncPlayerSelection())},this.browserItemSelected=()=>{this.config.player.enabled&&(this.active_section=rr.MUSIC_PLAYER,this._controller.activeSection=rr.MUSIC_PLAYER)},this.playerSelected=e=>{this.setActivePlayer(e),this.config.player.enabled&&(this.active_section=rr.MUSIC_PLAYER,this._controller.activeSection=rr.MUSIC_PLAYER)},this.onSectionChangedEvent=e=>{this.active_section=e.detail}}set hass(e){if(!e)return;const t=this.config.entities;let r=!1;this._controller.hass=e;const i=[];t.forEach(t=>{const s=this.hass?.states[t.entity_id],o=e.states[t.entity_id];o&&i.push(o),Yr(s,o)||(r=!0)}),r&&(this._controller.hass=e,this.entities=i)}get hass(){return this._controller.hass}set config(e){this._config=e,this._controller.config=e,e.sync_player_across_dashboard&&(this.syncPlayerAcrossDashboard=!0)}get config(){return this._controller.config}async prepareSyncPlayerAcrossDashboard(){await Xr(5e3),window.addEventListener("mpc-player-sync",this.onPlayerSync),this.syncPlayerAcrossDashboard=!0}set active_section(e){this._activeSection=e}get active_section(){return this._activeSection??this._controller.activeSection}setActiveSection(e){this._controller.activeSection=e}static getConfigForm(){return{schema:[{name:"entities",required:!0,selector:{entity:{multiple:!0,integration:"music_assistant",domain:"media_player"}}},{name:"expressive",required:!1,selector:{boolean:{},default:!0}},{name:"expressive_scheme",required:!1,selector:{select:{multiple:!1,mode:"dropdown",options:[{value:"content",label:"Content"},{value:"expressive",label:"Expressive"},{value:"fidelity",label:"Fidelity"},{value:"fruit_salad",label:"Fruit Salad"},{value:"monochrome",label:"Monochrome"},{value:"neutral",label:"Neutral"},{value:"rainbow",label:"Rainbow"},{value:"tonal_spot",label:"Tonal Spot"},{value:"vibrant",label:"Vibrant"}]}}},{name:"default_section",required:!1,selector:{select:{multiple:!1,mode:"dropdown",options:[{value:"music_player",label:"Music Player"},{value:"queue",label:"Player Queue"},{value:"media_browser",label:"Media Browser"},{value:"players",label:"Players"}]}}},{name:"download_local",required:!1,selector:{boolean:{},default:!1}},{name:"proxy_all_artwork",required:!1,selector:{boolean:{},default:!1}},{name:"panel",required:!1,selector:{boolean:{},default:!1}},{name:"sync_player_across_dashboard",required:!1,selector:{boolean:{},default:!1}},{name:"player",type:"expandable",iconPath:cs,schema:[{name:"enabled",selector:{boolean:{}},default:!0},us(ml),{name:"layout",type:"expandable",schema:[{name:"artwork_size",selector:{select:{multiple:!1,custom_value:!0,mode:"dropdown",options:[{label:"Small (14em, Apx < 200px)",value:"small",description:"14em, apx 200px"},{label:"Medium",value:"medium",description:"22em, apx 300px"},{label:"Large",value:"large",description:"Full Card"}]},default:"large",description:{suffix:"Set the size of the artwork in the card"}}},{name:"hide_labels",selector:{boolean:{}},default:!1},{name:"icons",type:"expandable",schema:[vl("power"),vl("shuffle"),vl("repeat"),vl("favorite")]}]}]},{name:"queue",type:"expandable",iconPath:As,schema:[{name:"enabled",selector:{boolean:{}},default:!0},{name:"",type:"grid",schema:[{name:"show_album_covers",selector:{boolean:{}}},{name:"show_artist_names",selector:{boolean:{}}}]},us($c)]},{name:"media_browser",type:"expandable",iconPath:os,schema:[{name:"enabled",selector:{boolean:{}},default:!0},{name:"columns",selector:{number:{min:1,max:10,mode:"box"}}},{name:"default_section",required:!1,selector:{select:{multiple:!1,mode:"dropdown",options:[{value:"favorites",label:"Favorites"},{value:"recents",label:"Recents"},{value:"recommendations",label:"Recommendations"}]}}},{name:"default_enqueue_option",required:!1,selector:{select:{multiple:!1,mode:"dropdown",options:[{value:"play_now",label:"Play Now"},{value:"play_now_clear_queue",label:"Play Now and Clear Queue"},{value:"play_next",label:"Play Next"},{value:"play_next_clear_queue",label:"Play Next and Clear Queue"},{value:"add_to_queue",label:"Add to Queue"},{value:"radio",label:"Play Radio"}]}}},{name:"favorites",type:"expandable",iconPath:as,schema:[{name:"show_collection_view",selector:{boolean:{}},default:!0},Cs("albums"),Cs("artists"),Cs("audiobooks"),Cs("playlists"),Cs("podcasts"),Cs("radios"),Cs("tracks")]},{name:"recents",type:"expandable",iconPath:ls,schema:[{name:"show_collection_view",selector:{boolean:{}},default:!0},Cs("album"),Cs("artists"),Cs("audiobooks"),Cs("playlists"),Cs("podcasts"),Cs("radios"),Cs("tracks")]},{name:"recommendations",type:"expandable",iconPath:ns,schema:[{name:"enabled",selector:{boolean:{}},default:!0},{name:"providers",selector:{text:{multiple:!0}}},{name:"show_collection_view",selector:{boolean:{}},default:!0}]},us(Es),{name:"playlists_allow_removing_tracks",selector:{boolean:{}},default:!1}]},{name:"players",type:"expandable",iconPath:ds,schema:[{name:"enabled",selector:{boolean:{}},default:!0},us(OA)]}]}}static getStubConfig(e,t){return function(e,t){return{entities:[t.filter(e=>"media_player"==e.split(".")[0]).find(t=>e.states[t]?.attributes.mass_player_type)]}}(e,t)}setConfig(e){if(!e)throw this.createError("Invalid configuration");if(!e.entities)throw this.createError("You need to define entities.");this._controller.config=e,this.config=this._controller.config,this.active_section||this.setDefaultActiveSection(),this.requestUpdate()}setDefaultActiveSection(){this.active_section||(this._controller.activeSection=function(e){const t=xr;if(e.default_section)return Fr[e.default_section];const r={[rr.MUSIC_PLAYER]:e.player.enabled,[rr.QUEUE]:e.queue.enabled,[rr.PLAYERS]:e.players.enabled,[rr.MEDIA_BROWSER]:e.media_browser.enabled},i=Object.entries(r).filter(e=>e[1]).map(e=>e[0]);return t.find(e=>i.includes(e))}(this.config))}shouldUpdate(e){if(e.has("activeEntityConfig")||e.has("active_section"))return!0;if(e.has("hass")){const t=e.get("hass");if(!t)return!0;const r=t.states;if(!this.hass)return!1;const i=this.hass.states;let s=!1;return this.config.entities.forEach(e=>{r[e.entity_id]!==i[e.entity_id]&&(s=!0)}),s}return super.shouldUpdate(e)}renderPlayers(){return We(this.config.players.enabled&&this.active_section==rr.PLAYERS?Ee`
            <wa-tab-panel name="${rr.PLAYERS}" class="section">
              <mpc-players-card
                .selectedPlayerService=${this.playerSelected}
                .config=${this.config}
              ></mpc-players-card>
            </wa-tab-panel>
          `:Ee``)}renderMusicPlayer(){return We(this.config.player.enabled&&this.active_section==rr.MUSIC_PLAYER?Ee`
            <wa-tab-panel name="${rr.MUSIC_PLAYER}" class="section">
              <mpc-music-player-card
                .selectedPlayerService=${this.playerSelected}
              ></mpc-music-player-card>
            </wa-tab-panel>
          `:Ee``)}renderPlayerQueue(){return We(this.config.queue.enabled&&this.active_section==rr.QUEUE?Ee`
            <wa-tab-panel name="${rr.QUEUE}" class="section">
              <mpc-queue-card .config=${this.config.queue}></mpc-queue-card>
            </wa-tab-panel>
          `:Ee``)}renderMediaBrowser(){return We(this.config.media_browser.enabled&&this.active_section==rr.MEDIA_BROWSER?Ee`
            <wa-tab-panel name="${rr.MEDIA_BROWSER}" class="section">
              <mpc-media-browser
                .config=${this.config.media_browser}
                .onMediaSelectedAction=${this.browserItemSelected}
              ></mpc-media-browser>
            </wa-tab-panel>
          `:Ee``)}renderTabs(){return Ee`
      <div id="navbar" class="${this.config.expressive?"expressive":""}">
        ${this.config.expressive?Ee`<mpc-navbar-expressive></mpc-navbar-expressive>`:Ee`<mpc-navbar></mpc-navbar>`}
      </div>
    `}renderSections(){return Ee`
      ${this.renderMusicPlayer()} ${this.renderPlayerQueue()}
      ${this.renderMediaBrowser()} ${this.renderPlayers()}
    `}render(){const e=this.config.panel?`--mass-player-card-height: calc(${window.innerHeight.toString()}px - 4rem - var(--header-height));`:"";return this.error??Ee`
        <ha-card
          id="${this.config.expressive?"expressive":""}"
          style="${e}"
        >
          ${this.renderSections()} ${this.renderTabs()}
        </ha-card>
      `}static get styles(){return wd}firstUpdated(){const e=Ed.styleSheet;document.adoptedStyleSheets.push(e),this.syncPlayerAcrossDashboard&&this.prepareSyncPlayerAcrossDashboard()}connectedCallback(){super.connectedCallback(),this._controller.Queue&&(this._controller.Queue.resetQueueFailures(),this._controller.Queue.subscribeUpdates(),this.hasUpdated&&this._controller.connected()),this.addEventListener("section-changed",this.onSectionChangedEvent)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("section-changed",this.onSectionChangedEvent),this._controller.disconnected(),this.syncPlayerAcrossDashboard&&window.removeEventListener("mpc-player-sync",this.onPlayerSync)}getCardSize(){return 3}createError(e){const t=new Error(e),r=document.createElement("hui-error-card");return r.setConfig({type:"error",error:t,origConfig:this.config}),this.error=Ee`${r}`,t}};e([Pe()],Ph.prototype,"entities",void 0),e([Pe()],Ph.prototype,"error",void 0),e([Pe()],Ph.prototype,"_activeSection",void 0),e([n({context:mi})],Ph.prototype,"_controller",void 0),e([n({context:ni})],Ph.prototype,"_config",void 0),e([a({context:ui,subscribe:!0}),Pe()],Ph.prototype,"active_section",null),Ph=e([Ce(`${Bh}`)],Ph);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
class Dh{constructor(e){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===e?.roundAverageSize&&(this._roundAverageSize=!0)}set(e,t){const r=this._map.get(e)||0;this._map.set(e,t),this.totalSize+=t-r}get averageSize(){if(this._map.size>0){const e=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(e):e}return 0}getSize(e){return this._map.get(e)}clear(){this._map.clear(),this.totalSize=0}}
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function Sh(e){return"horizontal"===e?"width":"height"}class kh{_getDefaultConfig(){return{direction:"vertical"}}constructor(e,t){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=e,Promise.resolve().then(()=>this.config=t||this._getDefaultConfig())}set config(e){Object.assign(this,Object.assign({},this._getDefaultConfig(),e))}get config(){return{direction:this.direction}}get items(){return this._items}set items(e){this._setItems(e)}_setItems(e){e!==this._items&&(this._items=e,this._scheduleReflow())}get direction(){return this._direction}set direction(e){(e="horizontal"===e?e:"vertical")!==this._direction&&(this._direction=e,this._sizeDim="horizontal"===e?"width":"height",this._secondarySizeDim="horizontal"===e?"height":"width",this._positionDim="horizontal"===e?"left":"top",this._secondaryPositionDim="horizontal"===e?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(e){const{_viewDim1:t,_viewDim2:r}=this;Object.assign(this._viewportSize,e),r!==this._viewDim2?this._scheduleLayoutUpdate():t!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(e){Object.assign(this._latestCoords,e);const t=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(t-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(e=!1){(e||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(e){this._pin=e,this._triggerReflow()}get pin(){if(null!==this._pin){const{index:e,block:t}=this._pin;return{index:Math.max(0,Math.min(e,this.items.length-1)),block:t}}return null}_clampScrollPosition(e){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(e,this.totalScrollSize[Sh(this.direction)]-this._viewDim1))}unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(null!==this.pin){const e=this._scrollPosition,{index:t,block:r}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:t,block:r||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=e-this._scrollPosition}}_calculateScrollIntoViewPosition(e){const{block:t}=e,r=Math.min(this.items.length,Math.max(0,e.index)),i=this._getItemPosition(r)[this._positionDim];let s=i;if("start"!==t){const e=this._getItemSize(r)[this._sizeDim];if("center"===t)s=i-.5*this._viewDim1+.5*e;else{const r=i-this._viewDim1+e;if("end"===t)s=r;else{const e=this._scrollPosition;s=Math.abs(e-i)<Math.abs(e-r)?i:r}}}return s+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(s)}getScrollIntoViewCoordinates(e){return{[this._positionDim]:this._calculateScrollIntoViewPosition(e)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const e=new Map;if(-1!==this._first&&-1!==this._last)for(let t=this._first;t<=this._last;t++)e.set(t,this._getItemPosition(t));const t={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:e};this._scrollError&&(t.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(t)}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{const e=Math.max(0,this._scrollPosition-this._overhang),t=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>e||this._physicalMax<t?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(e){if(-1===this._first||-1===this._last)return;let t=this._first;for(;t<this._last&&Math.round(this._getItemPosition(t)[this._positionDim]+this._getItemSize(t)[this._sizeDim])<=Math.round(this._scrollPosition);)t++;let r=this._last;for(;r>this._first&&Math.round(this._getItemPosition(r)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)r--;t===this._firstVisible&&r===this._lastVisible||(this._firstVisible=t,this._lastVisible=r,e&&e.emit&&this._sendVisibilityChangedMessage())}}
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function Rh(e){return"horizontal"===e?"marginLeft":"marginTop"}function Qh(e){return"horizontal"===e?"marginRight":"marginBottom"}function Mh(e){return"horizontal"===e?"xOffset":"yOffset"}function Hh(e,t){const r=[e,t].sort();return r[1]<=0?Math.min(...r):r[0]>=0?Math.max(...r):r[0]+r[1]}class Oh{constructor(){this._childSizeCache=new Dh,this._marginSizeCache=new Dh,this._metricsCache=new Map}update(e,t){const r=new Set;Object.keys(e).forEach(i=>{const s=Number(i);this._metricsCache.set(s,e[s]),this._childSizeCache.set(s,e[s][Sh(t)]),r.add(s),r.add(s+1)});for(const e of r){const r=this._metricsCache.get(e)?.[Rh(t)]||0,i=this._metricsCache.get(e-1)?.[Qh(t)]||0;this._marginSizeCache.set(e,Hh(r,i))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(e,t){return this._metricsCache.get(e)?.[Rh(t)]||0}getChildSize(e){return this._childSizeCache.getSize(e)}getMarginSize(e){return this._marginSizeCache.getSize(e)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}var Th=Object.freeze({__proto__:null,FlowLayout:class extends kh{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new Oh,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(e){this._metricsCache.update(e,this.direction),this._scheduleReflow()}_getPhysicalItem(e){return this._newPhysicalItems.get(e)??this._physicalItems.get(e)}_getSize(e){return this._getPhysicalItem(e)&&this._metricsCache.getChildSize(e)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(e){const t=this._metricsCache;if(-1===this._first||-1===this._last)return t.averageMarginSize+e*(t.averageMarginSize+this._getAverageSize());if(e<this._first){const r=this._first-e;return this._getPhysicalItem(this._first).pos-(t.getMarginSize(this._first-1)||t.averageMarginSize)-(r*t.averageChildSize+(r-1)*t.averageMarginSize)}{const r=e-this._last;return this._getPhysicalItem(this._last).pos+(t.getChildSize(this._last)||t.averageChildSize)+(t.getMarginSize(this._last)||t.averageMarginSize)+r*(t.averageChildSize+t.averageMarginSize)}}_getPosition(e){const t=this._getPhysicalItem(e),{averageMarginSize:r}=this._metricsCache;return 0===e?this._metricsCache.getMarginSize(0)??r:t?t.pos:this._estimatePosition(e)}_calculateAnchor(e,t){return e<=0?0:t>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((e+t)/2/this._delta)))}_getAnchor(e,t){if(0===this._physicalItems.size)return this._calculateAnchor(e,t);if(this._first<0)return this._calculateAnchor(e,t);if(this._last<0)return this._calculateAnchor(e,t);const r=this._getPhysicalItem(this._first),i=this._getPhysicalItem(this._last),s=r.pos;if(i.pos+this._metricsCache.getChildSize(this._last)<e)return this._calculateAnchor(e,t);if(s>t)return this._calculateAnchor(e,t);let o=this._firstVisible-1,n=-1/0;for(;n<e;){n=this._getPhysicalItem(++o).pos+this._metricsCache.getChildSize(o)}return o}_getActiveItems(){0===this._viewDim1||0===this.items.length?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const e=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=e,this._stable=!0}_getItems(){const e=this._newPhysicalItems;let t,r;if(this._stable=!0,null!==this.pin){const{index:e}=this.pin;this._anchorIdx=e,this._anchorPos=this._getPosition(e)}if(t=this._scrollPosition-this._overhang,r=this._scrollPosition+this._viewDim1+this._overhang,r<0||t>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(t,r),this._anchorPos=this._getPosition(this._anchorIdx));let i=this._getSize(this._anchorIdx);void 0===i&&(this._stable=!1,i=this._getAverageSize());const s=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,o=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=s),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-o-i);let n=0;for(this._anchorPos+i+o<t&&(n=t-(this._anchorPos+i+o)),this._anchorPos-s>r&&(n=r-(this._anchorPos-s)),n&&(this._scrollPosition-=n,t-=n,r-=n,this._scrollError+=n),e.set(this._anchorIdx,{pos:this._anchorPos,size:i}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-s,this._physicalMax=this._anchorPos+i+o;this._physicalMin>t&&this._first>0;){let t=this._getSize(--this._first);void 0===t&&(this._stable=!1,t=this._getAverageSize());let r=this._metricsCache.getMarginSize(this._first);void 0===r&&(this._stable=!1,r=this._metricsCache.averageMarginSize),this._physicalMin-=t;const i=this._physicalMin;if(e.set(this._first,{pos:i,size:t}),this._physicalMin-=r,!1===this._stable&&!1===this._estimate)break}for(;this._physicalMax<r&&this._last<this.items.length-1;){let t=this._getSize(++this._last);void 0===t&&(this._stable=!1,t=this._getAverageSize());let r=this._metricsCache.getMarginSize(this._last);void 0===r&&(this._stable=!1,r=this._metricsCache.averageMarginSize);const i=this._physicalMax;if(e.set(this._last,{pos:i,size:t}),this._physicalMax+=t+r,!this._stable&&!this._estimate)break}const a=this._calculateError();a&&(this._physicalMin-=a,this._physicalMax-=a,this._anchorPos-=a,this._scrollPosition-=a,e.forEach(e=>e.pos-=a),this._scrollError+=a),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=e)}_calculateError(){return 0===this._first?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:e,_last:t}=this;super._reflow(),(-1===this._first&&-1==this._last||this._first===e&&this._last===t)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:e}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(e+this._getAverageSize())+e)}get _delta(){const{averageMarginSize:e}=this._metricsCache;return this._getAverageSize()+e}_getItemPosition(e){return{[this._positionDim]:this._getPosition(e),[this._secondaryPositionDim]:0,[Mh(this.direction)]:-(this._metricsCache.getLeadingMarginValue(e,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(e){return{[this._sizeDim]:this._getSize(e)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});export{Ph as MusicAssistantPlayerCard};
