From 5103532b48e445cfcd5762bc18ee22ce5c629328 Mon Sep 17 00:00:00 2001 From: Martin Bauer Date: Tue, 14 Jul 2020 13:42:58 +0000 Subject: [PATCH] Switched icons in custom cards to ha-icon from paper-icons --- .../room-glance-card/dist/room-glance-card.js | 74 +++++++++---------- .../room-glance-card/package.json | 4 + .../room-glance-card/src/room-glance-card.ts | 35 ++++----- .../dist/state-card-custom-cover.js | 30 ++++---- .../src/state-card-custom-cover.ts | 16 ++-- www/custom_ui/mini-media-player-bundle.js | 2 +- www/custom_ui/room-glance-card.js | 74 +++++++++---------- www/custom_ui/state-card-custom-cover.js | 30 ++++---- 8 files changed, 135 insertions(+), 130 deletions(-) diff --git a/custom_frontend_sources/room-glance-card/dist/room-glance-card.js b/custom_frontend_sources/room-glance-card/dist/room-glance-card.js index e1314e3..941bd2f 100644 --- a/custom_frontend_sources/room-glance-card/dist/room-glance-card.js +++ b/custom_frontend_sources/room-glance-card/dist/room-glance-card.js @@ -1,4 +1,4 @@ -!function(e){var t={};function s(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(i,n,function(t){return e[t]}.bind(null,n));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=0)}([function(e,t,s){"use strict";s.r(t); +!function(t){var e={};function s(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=t,s.c=e,s.d=function(t,e,i){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)s.d(i,n,function(e){return t[e]}.bind(null,n));return i},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=0)}([function(t,e,s){"use strict";s.r(e); /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -12,7 +12,7 @@ * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const i=new WeakMap,n=e=>"function"==typeof e&&i.has(e),r=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,o=(e,t,s=null)=>{for(;t!==s;){const s=t.nextSibling;e.removeChild(t),t=s}},a={},l={},c=`{{lit-${String(Math.random()).slice(2)}}}`,d=`\x3c!--${c}--\x3e`,h=new RegExp(`${c}|${d}`),p="$lit$";class u{constructor(e,t){this.parts=[],this.element=t;const s=[],i=[],n=document.createTreeWalker(t.content,133,null,!1);let r=0,o=-1,a=0;const{strings:l,values:{length:d}}=e;for(;a0;){const t=l[a],s=g.exec(t)[2],i=s.toLowerCase()+p,n=e.getAttribute(i);e.removeAttribute(i);const r=n.split(h);this.parts.push({type:"attribute",index:o,name:s,strings:r}),a+=r.length-1}}"TEMPLATE"===e.tagName&&(i.push(e),n.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(c)>=0){const i=e.parentNode,n=t.split(h),r=n.length-1;for(let t=0;t{const s=e.length-t.length;return s>=0&&e.slice(s)===t},m=e=>-1!==e.index,_=()=>document.createComment(""),g=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; +const i=new WeakMap,n=t=>"function"==typeof t&&i.has(t),o=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,r=(t,e,s=null)=>{for(;e!==s;){const s=e.nextSibling;t.removeChild(e),e=s}},a={},l={},c=`{{lit-${String(Math.random()).slice(2)}}}`,h=`\x3c!--${c}--\x3e`,d=new RegExp(`${c}|${h}`),p="$lit$";class u{constructor(t,e){this.parts=[],this.element=e;const s=[],i=[],n=document.createTreeWalker(e.content,133,null,!1);let o=0,r=-1,a=0;const{strings:l,values:{length:h}}=t;for(;a0;){const e=l[a],s=g.exec(e)[2],i=s.toLowerCase()+p,n=t.getAttribute(i);t.removeAttribute(i);const o=n.split(d);this.parts.push({type:"attribute",index:r,name:s,strings:o}),a+=o.length-1}}"TEMPLATE"===t.tagName&&(i.push(t),n.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(c)>=0){const i=t.parentNode,n=e.split(d),o=n.length-1;for(let e=0;e{const s=t.length-e.length;return s>=0&&t.slice(s)===e},m=t=>-1!==t.index,_=()=>document.createComment(""),g=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -26,7 +26,7 @@ const i=new WeakMap,n=e=>"function"==typeof e&&i.has(e),r=void 0!==window.custom * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -class v{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this.__parts)void 0!==s&&s.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=r?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],s=this.template.parts,i=document.createTreeWalker(e,133,null,!1);let n,o=0,a=0,l=i.nextNode();for(;o-1||s)&&-1===e.indexOf("--\x3e",n+1);const r=g.exec(e);t+=null===r?e+(s?c:d):e.substr(0,r.index)+r[1]+r[2]+p+r[3]+c}return t+=this.strings[e]}getTemplateElement(){const e=document.createElement("template");return e.innerHTML=this.getHTML(),e}} + */class y{constructor(t,e,s,i){this.strings=t,this.values=e,this.type=s,this.processor=i}getHTML(){const t=this.strings.length-1;let e="",s=!1;for(let i=0;i-1||s)&&-1===t.indexOf("--\x3e",n+1);const o=g.exec(t);e+=null===o?t+(s?c:h):t.substr(0,o.index)+o[1]+o[2]+p+o[3]+c}return e+=this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}} /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -53,7 +53,7 @@ class v{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const S=e=>null===e||!("object"==typeof e||"function"==typeof e),b=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class w{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let e=0;ethis.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;n(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=a,e(this)}if(this.__pendingValue===a)return;const e=this.__pendingValue,t=this.value,s=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=null!=e&&(null==t||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=k(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=a}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const k=e=>e&&(T?{capture:e.capture,passive:e.passive,once:e.once}:e.capture); +const S=t=>null===t||!("object"==typeof t||"function"==typeof t),b=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class w{constructor(t,e,s){this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(let t=0;tthis.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;n(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=a,t(this)}if(this.__pendingValue===a)return;const t=this.__pendingValue,e=this.value,s=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=k(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=a}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const k=t=>t&&(T?{capture:t.capture,passive:t.passive,once:t.once}:t.capture); /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -66,7 +66,7 @@ const S=e=>null===e||!("object"==typeof e||"function"==typeof e),b=e=>Array.isAr * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */const V=new class{handleAttributeExpressions(e,t,s,i){const n=t[0];return"."===n?new N(e,t.slice(1),s).parts:"@"===n?[new E(e,t.slice(1),i.eventContext)]:"?"===n?[new C(e,t.slice(1),s)]:new w(e,t,s).parts}handleTextExpression(e){return new P(e)}}; + */const V=new class{handleAttributeExpressions(t,e,s,i){const n=e[0];return"."===n?new N(t,e.slice(1),s).parts:"@"===n?[new E(t,e.slice(1),i.eventContext)]:"?"===n?[new C(t,e.slice(1),s)]:new w(t,e,s).parts}handleTextExpression(t){return new P(t)}}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -79,7 +79,7 @@ const S=e=>null===e||!("object"==typeof e||"function"==typeof e),b=e=>Array.isAr * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */function O(e){let t=$.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},$.set(e.type,t));let s=t.stringsArray.get(e.strings);if(void 0!==s)return s;const i=e.strings.join(c);return void 0===(s=t.keyString.get(i))&&(s=new u(e,e.getTemplateElement()),t.keyString.set(i,s)),t.stringsArray.set(e.strings,s),s}const $=new Map,R=new WeakMap; + */function O(t){let e=$.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},$.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const i=t.strings.join(c);return void 0===(s=e.keyString.get(i))&&(s=new u(t,t.getTemplateElement()),e.keyString.set(i,s)),e.stringsArray.set(t.strings,s),s}const $=new Map,R=new WeakMap; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -106,7 +106,7 @@ const S=e=>null===e||!("object"==typeof e||"function"==typeof e),b=e=>Array.isAr * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const M=(e,...t)=>new y(e,t,"html",V),j=133;function U(e,t){const{element:{content:s},parts:i}=e,n=document.createTreeWalker(s,j,null,!1);let r=z(i),o=i[r],a=-1,l=0;const c=[];let d=null;for(;n.nextNode();){a++;const e=n.currentNode;for(e.previousSibling===d&&(d=null),t.has(e)&&(c.push(e),null===d&&(d=e)),null!==d&&l++;void 0!==o&&o.index===a;)o.index=null!==d?-1:o.index-l,o=i[r=z(i,r)]}c.forEach(e=>e.parentNode.removeChild(e))}const H=e=>{let t=11===e.nodeType?0:1;const s=document.createTreeWalker(e,j,null,!1);for(;s.nextNode();)t++;return t},z=(e,t=-1)=>{for(let s=t+1;snew y(t,e,"html",V),j=133;function U(t,e){const{element:{content:s},parts:i}=t,n=document.createTreeWalker(s,j,null,!1);let o=z(i),r=i[o],a=-1,l=0;const c=[];let h=null;for(;n.nextNode();){a++;const t=n.currentNode;for(t.previousSibling===h&&(h=null),e.has(t)&&(c.push(t),null===h&&(h=t)),null!==h&&l++;void 0!==r&&r.index===a;)r.index=null!==h?-1:r.index-l,r=i[o=z(i,o)]}c.forEach(t=>t.parentNode.removeChild(t))}const H=t=>{let e=11===t.nodeType?0:1;const s=document.createTreeWalker(t,j,null,!1);for(;s.nextNode();)e++;return e},z=(t,e=-1)=>{for(let s=e+1;snull===e||!("object"==typeof e||"function"==typeof e),b=e=>Array.isAr * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const q=(e,t)=>`${e}--${t}`;let F=!0;void 0===window.ShadyCSS?F=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),F=!1);const L=e=>t=>{const s=q(t.type,e);let i=$.get(s);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},$.set(s,i));let n=i.stringsArray.get(t.strings);if(void 0!==n)return n;const r=t.strings.join(c);if(void 0===(n=i.keyString.get(r))){const s=t.getTemplateElement();F&&window.ShadyCSS.prepareTemplateDom(s,e),n=new u(t,s),i.keyString.set(r,n)}return i.stringsArray.set(t.strings,n),n},I=["html","svg"],B=new Set,W=(e,t,s)=>{B.add(s);const i=e.querySelectorAll("style"),{length:n}=i;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(t.element,s);const r=document.createElement("style");for(let e=0;e{I.forEach(t=>{const s=$.get(q(t,e));void 0!==s&&s.keyString.forEach(e=>{const{element:{content:t}}=e,s=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{s.add(e)}),U(e,s)})})})(s);const o=t.element.content;!function(e,t,s=null){const{element:{content:i},parts:n}=e;if(null==s)return void i.appendChild(t);const r=document.createTreeWalker(i,j,null,!1);let o=z(n),a=0,l=-1;for(;r.nextNode();)for(l++,r.currentNode===s&&(a=H(t),s.parentNode.insertBefore(t,s));-1!==o&&n[o].index===l;){if(a>0){for(;-1!==o;)n[o].index+=a,o=z(n,o);return}o=z(n,o)}}(t,r,o.firstChild),window.ShadyCSS.prepareTemplateStyles(t.element,s);const a=o.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==a)e.insertBefore(a.cloneNode(!0),e.firstChild);else{o.insertBefore(r,o.firstChild);const e=new Set;e.add(r),U(t,e)}}; +const q=(t,e)=>`${t}--${e}`;let F=!0;void 0===window.ShadyCSS?F=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),F=!1);const L=t=>e=>{const s=q(e.type,t);let i=$.get(s);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},$.set(s,i));let n=i.stringsArray.get(e.strings);if(void 0!==n)return n;const o=e.strings.join(c);if(void 0===(n=i.keyString.get(o))){const s=e.getTemplateElement();F&&window.ShadyCSS.prepareTemplateDom(s,t),n=new u(e,s),i.keyString.set(o,n)}return i.stringsArray.set(e.strings,n),n},I=["html","svg"],B=new Set,W=(t,e,s)=>{B.add(s);const i=t.querySelectorAll("style"),{length:n}=i;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(e.element,s);const o=document.createElement("style");for(let t=0;t{I.forEach(e=>{const s=$.get(q(e,t));void 0!==s&&s.keyString.forEach(t=>{const{element:{content:e}}=t,s=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{s.add(t)}),U(t,s)})})})(s);const r=e.element.content;!function(t,e,s=null){const{element:{content:i},parts:n}=t;if(null==s)return void i.appendChild(e);const o=document.createTreeWalker(i,j,null,!1);let r=z(n),a=0,l=-1;for(;o.nextNode();)for(l++,o.currentNode===s&&(a=H(e),s.parentNode.insertBefore(e,s));-1!==r&&n[r].index===l;){if(a>0){for(;-1!==r;)n[r].index+=a,r=z(n,r);return}r=z(n,r)}}(e,o,r.firstChild),window.ShadyCSS.prepareTemplateStyles(e.element,s);const a=r.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==a)t.insertBefore(a.cloneNode(!0),t.firstChild);else{r.insertBefore(o,r.firstChild);const t=new Set;t.add(o),U(e,t)}}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -134,7 +134,7 @@ const q=(e,t)=>`${e}--${t}`;let F=!0;void 0===window.ShadyCSS?F=!1:void 0===wind * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -window.JSCompiler_renameProperty=(e,t)=>e;const J={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},D=(e,t)=>t!==e&&(t==t||e==e),G={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:D},K=Promise.resolve(!0),Q=1,X=4,Y=8,Z=16,ee=32;class te extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=K,this._hasConnectedResolver=void 0,this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach((t,s)=>{const i=this._attributeNameForProperty(s,t);void 0!==i&&(this._attributeToPropertyMap.set(i,s),e.push(i))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e,t=G){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const s="symbol"==typeof e?Symbol():`__${e}`;Object.defineProperty(this.prototype,e,{get(){return this[s]},set(t){const i=this[e];this[s]=t,this._requestUpdate(e,i)},configurable:!0,enumerable:!0})}static finalize(){if(this.hasOwnProperty(JSCompiler_renameProperty("finalized",this))&&this.finalized)return;const e=Object.getPrototypeOf(this);if("function"==typeof e.finalize&&e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const s of t)this.createProperty(s,e[s])}}static _attributeNameForProperty(e,t){const s=t.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,s=D){return s(e,t)}static _propertyValueFromAttribute(e,t){const s=t.type,i=t.converter||J,n="function"==typeof i?i:i.fromAttribute;return n?n(e,s):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const s=t.type,i=t.converter;return(i&&i.toAttribute||J.toAttribute)(e,s)}initialize(){this._saveInstanceProperties(),this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}connectedCallback(){this._updateState=this._updateState|ee,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,s){t!==s&&this._attributeToProperty(e,s)}_propertyToAttribute(e,t,s=G){const i=this.constructor,n=i._attributeNameForProperty(e,s);if(void 0!==n){const e=i._propertyValueToAttribute(t,s);if(void 0===e)return;this._updateState=this._updateState|Y,null==e?this.removeAttribute(n):this.setAttribute(n,e),this._updateState=this._updateState&~Y}}_attributeToProperty(e,t){if(this._updateState&Y)return;const s=this.constructor,i=s._attributeToPropertyMap.get(e);if(void 0!==i){const e=s._classProperties.get(i)||G;this._updateState=this._updateState|Z,this[i]=s._propertyValueFromAttribute(t,e),this._updateState=this._updateState&~Z}}_requestUpdate(e,t){let s=!0;if(void 0!==e){const i=this.constructor,n=i._classProperties.get(e)||G;i._valueHasChanged(this[e],t,n.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==n.reflect||this._updateState&Z||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,n))):s=!1}!this._hasRequestedUpdate&&s&&this._enqueueUpdate()}requestUpdate(e,t){return this._requestUpdate(e,t),this.updateComplete}async _enqueueUpdate(){let e,t;this._updateState=this._updateState|X;const s=this._updatePromise;this._updatePromise=new Promise((s,i)=>{e=s,t=i});try{await s}catch(e){}this._hasConnected||await new Promise(e=>this._hasConnectedResolver=e);try{const e=this.performUpdate();null!=e&&await e}catch(e){t(e)}e(!this._hasRequestedUpdate)}get _hasConnected(){return this._updateState&ee}get _hasRequestedUpdate(){return this._updateState&X}get hasUpdated(){return this._updateState&Q}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{(e=this.shouldUpdate(t))&&this.update(t)}catch(t){throw e=!1,t}finally{this._markUpdated()}e&&(this._updateState&Q||(this._updateState=this._updateState|Q,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~X}get updateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0)}updated(e){}firstUpdated(e){}}te.finalized=!0; +window.JSCompiler_renameProperty=(t,e)=>t;const J={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},D=(t,e)=>e!==t&&(e==e||t==t),G={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:D},K=Promise.resolve(!0),Q=1,X=4,Y=8,Z=16,tt=32;class et extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=K,this._hasConnectedResolver=void 0,this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach((e,s)=>{const i=this._attributeNameForProperty(s,e);void 0!==i&&(this._attributeToPropertyMap.set(i,s),t.push(i))}),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((t,e)=>this._classProperties.set(e,t))}}static createProperty(t,e=G){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const s="symbol"==typeof t?Symbol():`__${t}`;Object.defineProperty(this.prototype,t,{get(){return this[s]},set(e){const i=this[t];this[s]=e,this._requestUpdate(t,i)},configurable:!0,enumerable:!0})}static finalize(){if(this.hasOwnProperty(JSCompiler_renameProperty("finalized",this))&&this.finalized)return;const t=Object.getPrototypeOf(this);if("function"==typeof t.finalize&&t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const s of e)this.createProperty(s,t[s])}}static _attributeNameForProperty(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,s=D){return s(t,e)}static _propertyValueFromAttribute(t,e){const s=e.type,i=e.converter||J,n="function"==typeof i?i:i.fromAttribute;return n?n(t,s):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const s=e.type,i=e.converter;return(i&&i.toAttribute||J.toAttribute)(t,s)}initialize(){this._saveInstanceProperties(),this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}})}_applyInstanceProperties(){this._instanceProperties.forEach((t,e)=>this[e]=t),this._instanceProperties=void 0}connectedCallback(){this._updateState=this._updateState|tt,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,s){e!==s&&this._attributeToProperty(t,s)}_propertyToAttribute(t,e,s=G){const i=this.constructor,n=i._attributeNameForProperty(t,s);if(void 0!==n){const t=i._propertyValueToAttribute(e,s);if(void 0===t)return;this._updateState=this._updateState|Y,null==t?this.removeAttribute(n):this.setAttribute(n,t),this._updateState=this._updateState&~Y}}_attributeToProperty(t,e){if(this._updateState&Y)return;const s=this.constructor,i=s._attributeToPropertyMap.get(t);if(void 0!==i){const t=s._classProperties.get(i)||G;this._updateState=this._updateState|Z,this[i]=s._propertyValueFromAttribute(e,t),this._updateState=this._updateState&~Z}}_requestUpdate(t,e){let s=!0;if(void 0!==t){const i=this.constructor,n=i._classProperties.get(t)||G;i._valueHasChanged(this[t],e,n.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==n.reflect||this._updateState&Z||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,n))):s=!1}!this._hasRequestedUpdate&&s&&this._enqueueUpdate()}requestUpdate(t,e){return this._requestUpdate(t,e),this.updateComplete}async _enqueueUpdate(){let t,e;this._updateState=this._updateState|X;const s=this._updatePromise;this._updatePromise=new Promise((s,i)=>{t=s,e=i});try{await s}catch(t){}this._hasConnected||await new Promise(t=>this._hasConnectedResolver=t);try{const t=this.performUpdate();null!=t&&await t}catch(t){e(t)}t(!this._hasRequestedUpdate)}get _hasConnected(){return this._updateState&tt}get _hasRequestedUpdate(){return this._updateState&X}get hasUpdated(){return this._updateState&Q}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{(t=this.shouldUpdate(e))&&this.update(e)}catch(e){throw t=!1,e}finally{this._markUpdated()}t&&(this._updateState&Q||(this._updateState=this._updateState|Q,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~X}get updateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((t,e)=>this._propertyToAttribute(e,this[e],t)),this._reflectingProperties=void 0)}updated(t){}firstUpdated(t){}}et.finalized=!0; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -148,7 +148,7 @@ window.JSCompiler_renameProperty=(e,t)=>e;const J={toAttribute(e,t){switch(t){ca * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const se=(e,t)=>"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(s){s.createProperty(t.key,e)}}:Object.assign({},t,{finisher(s){s.createProperty(t.key,e)}}),ie=(e,t,s)=>{t.constructor.createProperty(s,e)};function ne(e){return(t,s)=>void 0!==s?ie(e,t,s):se(e,t)}const re="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,oe=Symbol();class ae{constructor(e,t){if(t!==oe)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(re?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const le=(e,...t)=>{const s=t.reduce((t,s,i)=>t+(e=>{if(e instanceof ae)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(s)+e[i+1],e[0]);return new ae(s,oe)}; +const st=(t,e)=>"method"!==e.kind||!e.descriptor||"value"in e.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(s){s.createProperty(e.key,t)}}:Object.assign({},e,{finisher(s){s.createProperty(e.key,t)}}),it=(t,e,s)=>{e.constructor.createProperty(s,t)};function nt(t){return(e,s)=>void 0!==s?it(t,e,s):st(t,e)}const ot="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rt=Symbol();class at{constructor(t,e){if(e!==rt)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(ot?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const lt=(t,...e)=>{const s=e.reduce((e,s,i)=>e+(t=>{if(t instanceof at)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(s)+t[i+1],t[0]);return new at(s,rt)}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -162,7 +162,7 @@ const se=(e,t)=>"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:" * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.2.0");const ce=e=>e.flat?e.flat(1/0):function e(t,s=[]){for(let i=0,n=t.length;i(e.add(t),e),new Set).forEach(e=>t.unshift(e))}else e&&t.push(e);return t}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?re?this.renderRoot.adoptedStyleSheets=e.map(e=>e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){super.update(e);const t=this.render();t instanceof y&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){}}de.finalized=!0,de.render=(e,t,s)=>{const i=s.scopeName,n=R.has(t),r=F&&11===t.nodeType&&!!t.host&&e instanceof y,a=r&&!B.has(i),l=a?document.createDocumentFragment():t;if(((e,t,s)=>{let i=R.get(t);void 0===i&&(o(t,t.firstChild),R.set(t,i=new P(Object.assign({templateFactory:O},s))),i.appendInto(t)),i.setValue(e),i.commit()})(e,l,Object.assign({templateFactory:L(i)},s)),a){const e=R.get(l);R.delete(l),e.value instanceof v&&W(l,e.value.template,i),o(t,t.firstChild),t.appendChild(l),R.set(t,e)}!n&&r&&window.ShadyCSS.styleElement(t.host)},s.d(t,"RoomGlanceCard",function(){return pe});var he=function(e,t,s,i){var n,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,s,o):n(t,s))||o);return r>3&&o&&Object.defineProperty(t,s,o),o};let pe=class extends de{setConfig(e){console.log("Setting config",e),this._config=e}static getCardSize(){return 3}render(){return this._config.scenes.length>=5?M` +(window.litElementVersions||(window.litElementVersions=[])).push("2.2.0");const ct=t=>t.flat?t.flat(1/0):function t(e,s=[]){for(let i=0,n=e.length;i(t.add(e),t),new Set).forEach(t=>e.unshift(t))}else t&&e.push(t);return e}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?ot?this.renderRoot.adoptedStyleSheets=t.map(t=>t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){super.update(t);const e=this.render();e instanceof y&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){}}ht.finalized=!0,ht.render=(t,e,s)=>{const i=s.scopeName,n=R.has(e),o=F&&11===e.nodeType&&!!e.host&&t instanceof y,a=o&&!B.has(i),l=a?document.createDocumentFragment():e;if(((t,e,s)=>{let i=R.get(e);void 0===i&&(r(e,e.firstChild),R.set(e,i=new P(Object.assign({templateFactory:O},s))),i.appendInto(e)),i.setValue(t),i.commit()})(t,l,Object.assign({templateFactory:L(i)},s)),a){const t=R.get(l);R.delete(l),t.value instanceof v&&W(l,t.value.template,i),r(e,e.firstChild),e.appendChild(l),R.set(e,t)}!n&&o&&window.ShadyCSS.styleElement(e.host)},s.d(e,"RoomGlanceCard",function(){return pt});var dt=function(t,e,s,i){var n,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o<3?n(r):o>3?n(e,s,r):n(e,s))||r);return o>3&&r&&Object.defineProperty(e,s,r),r};let pt=class extends ht{setConfig(t){console.log("Setting config",t),this._config=t}static getCardSize(){return 3}render(){return this._config.scenes.length>=5?M` @@ -182,7 +182,7 @@ const se=(e,t)=>"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:"
- ${this._config.scenes.map(e=>this.renderSceneButton(e))} + ${this._config.scenes.map(t=>this.renderSceneButton(t))}
@@ -202,52 +202,52 @@ const se=(e,t)=>"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:"
- ${this._config.scenes.map(e=>this.renderSceneButton(e))} + ${this._config.scenes.map(t=>this.renderSceneButton(t))} ${this.renderLightControl()}
- `}renderSceneButton(e){return M` - + `}renderSceneButton(t){return M` + `}renderLightControl(){return M` - + > - - + `}renderCoverControl(){return M` - `}renderCoverControl(){return M` + - + - + - + - `}serviceHandler(e,t,s={}){const i=this;return function(n){n.stopPropagation(),i.callServiceForAllEntities(e,t,s)}}callServiceForAllEntities(e,t,s={}){if(s.hasOwnProperty("entity_id"))console.log("Calling service with given entity_id",e,t,s),this.hass.callService(e,t,s);else for(let i of this._config.entities)s.entity_id=i,console.log("Calling service",e,t,s),this.hass.callService(e,t,s)}_handleTap(){console.log("Image tap")}_handleHold(){console.log("Image hold")}static get styles(){return le` + > + `}serviceHandler(t,e,s={}){const i=this;return function(n){n.stopPropagation(),i.callServiceForAllEntities(t,e,s)}}callServiceForAllEntities(t,e,s={}){if(s.hasOwnProperty("entity_id"))console.log("Calling service with given entity_id",t,e,s),this.hass.callService(t,e,s);else for(let i of this._config.entities)s.entity_id=i,console.log("Calling service",t,e,s),this.hass.callService(t,e,s)}_handleTap(){console.log("Image tap")}_handleHold(){console.log("Image hold")}static get styles(){return lt` ha-card { position: relative; min-height: 48px; @@ -316,4 +316,4 @@ const se=(e,t)=>"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:" ha-icon.state-on { color: white; } - `}};he([ne()],pe.prototype,"hass",void 0),he([ne()],pe.prototype,"_config",void 0),pe=he([(e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:s,elements:i}=t;return{kind:s,elements:i,finisher(t){window.customElements.define(e,t)}}})(e,t))("room-glance-card")],pe)}]); \ No newline at end of file + `}};dt([nt()],pt.prototype,"hass",void 0),dt([nt()],pt.prototype,"_config",void 0),pt=dt([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:i}=e;return{kind:s,elements:i,finisher(e){window.customElements.define(t,e)}}})(t,e))("room-glance-card")],pt)}]); \ No newline at end of file diff --git a/custom_frontend_sources/room-glance-card/package.json b/custom_frontend_sources/room-glance-card/package.json index 2c85f66..4ef37a0 100644 --- a/custom_frontend_sources/room-glance-card/package.json +++ b/custom_frontend_sources/room-glance-card/package.json @@ -17,5 +17,9 @@ "typescript": "^3.8.3", "webpack": "^4.42.1", "webpack-cli": "^3.3.11" + }, + "dependencies": { + "@polymer/iron-icons": "^3.0.1", + "@polymer/paper-icon-button": "^3.0.2" } } diff --git a/custom_frontend_sources/room-glance-card/src/room-glance-card.ts b/custom_frontend_sources/room-glance-card/src/room-glance-card.ts index 0a15a4e..f62aca9 100644 --- a/custom_frontend_sources/room-glance-card/src/room-glance-card.ts +++ b/custom_frontend_sources/room-glance-card/src/room-glance-card.ts @@ -2,7 +2,8 @@ import {LitElement, html, css, customElement, property, TemplateResult, CSSResul import {classMap} from "lit-html/directives/class-map"; import {styleMap} from "lit-html/directives/style-map"; import {HomeAssistant} from "./home-assistant-interface"; - +//import '@polymer/paper-icon-button/paper-icon-button.js'; +//import '@polymer/iron-icons/iron-icons.js'; @customElement("room-glance-card") export class RoomGlanceCard extends LitElement { @@ -84,52 +85,52 @@ export class RoomGlanceCard extends LitElement { private renderSceneButton(buttonCfg: any) { return html` - + > `; } private renderLightControl() { return html` - + > - - + `; + >`; } private renderCoverControl() { return html` - - + - + - + + > `; } diff --git a/custom_frontend_sources/state-card-custom-cover/dist/state-card-custom-cover.js b/custom_frontend_sources/state-card-custom-cover/dist/state-card-custom-cover.js index 24bb905..426fd20 100644 --- a/custom_frontend_sources/state-card-custom-cover/dist/state-card-custom-cover.js +++ b/custom_frontend_sources/state-card-custom-cover/dist/state-card-custom-cover.js @@ -12,7 +12,7 @@ * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const i=new WeakMap,n=t=>"function"==typeof t&&i.has(t),r=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,o=(t,e,s=null)=>{for(;e!==s;){const s=e.nextSibling;t.removeChild(e),e=s}},a={},l={},c=`{{lit-${String(Math.random()).slice(2)}}}`,h=`\x3c!--${c}--\x3e`,p=new RegExp(`${c}|${h}`),u="$lit$";class d{constructor(t,e){this.parts=[],this.element=e;const s=[],i=[],n=document.createTreeWalker(e.content,133,null,!1);let r=0,o=-1,a=0;const{strings:l,values:{length:h}}=t;for(;a0;){const e=l[a],s=y.exec(e)[2],i=s.toLowerCase()+u,n=t.getAttribute(i);t.removeAttribute(i);const r=n.split(p);this.parts.push({type:"attribute",index:o,name:s,strings:r}),a+=r.length-1}}"TEMPLATE"===t.tagName&&(i.push(t),n.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(c)>=0){const i=t.parentNode,n=e.split(p),r=n.length-1;for(let e=0;e{const s=t.length-e.length;return s>=0&&t.slice(s)===e},f=t=>-1!==t.index,m=()=>document.createComment(""),y=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; +const i=new WeakMap,n=t=>"function"==typeof t&&i.has(t),r=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,o=(t,e,s=null)=>{for(;e!==s;){const s=e.nextSibling;t.removeChild(e),e=s}},a={},l={},h=`{{lit-${String(Math.random()).slice(2)}}}`,c=`\x3c!--${h}--\x3e`,p=new RegExp(`${h}|${c}`),u="$lit$";class d{constructor(t,e){this.parts=[],this.element=e;const s=[],i=[],n=document.createTreeWalker(e.content,133,null,!1);let r=0,o=-1,a=0;const{strings:l,values:{length:c}}=t;for(;a0;){const e=l[a],s=y.exec(e)[2],i=s.toLowerCase()+u,n=t.getAttribute(i);t.removeAttribute(i);const r=n.split(p);this.parts.push({type:"attribute",index:o,name:s,strings:r}),a+=r.length-1}}"TEMPLATE"===t.tagName&&(i.push(t),n.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(h)>=0){const i=t.parentNode,n=e.split(p),r=n.length-1;for(let e=0;e{const s=t.length-e.length;return s>=0&&t.slice(s)===e},f=t=>-1!==t.index,m=()=>document.createComment(""),y=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -39,7 +39,7 @@ class g{constructor(t,e,s){this.__parts=[],this.template=t,this.processor=e,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */class v{constructor(t,e,s,i){this.strings=t,this.values=e,this.type=s,this.processor=i}getHTML(){const t=this.strings.length-1;let e="",s=!1;for(let i=0;i-1||s)&&-1===t.indexOf("--\x3e",n+1);const r=y.exec(t);e+=null===r?t+(s?c:h):t.substr(0,r.index)+r[1]+r[2]+u+r[3]+c}return e+=this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}} + */class v{constructor(t,e,s,i){this.strings=t,this.values=e,this.type=s,this.processor=i}getHTML(){const t=this.strings.length-1;let e="",s=!1;for(let i=0;i-1||s)&&-1===t.indexOf("--\x3e",n+1);const r=y.exec(t);e+=null===r?t+(s?h:c):t.substr(0,r.index)+r[1]+r[2]+u+r[3]+h}return e+=this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}} /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -79,7 +79,7 @@ const S=t=>null===t||!("object"==typeof t||"function"==typeof t),b=t=>Array.isAr * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */function V(t){let e=k.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},k.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const i=t.strings.join(c);return void 0===(s=e.keyString.get(i))&&(s=new d(t,t.getTemplateElement()),e.keyString.set(i,s)),e.stringsArray.set(t.strings,s),s}const k=new Map,M=new WeakMap; + */function V(t){let e=k.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},k.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const i=t.strings.join(h);return void 0===(s=e.keyString.get(i))&&(s=new d(t,t.getTemplateElement()),e.keyString.set(i,s)),e.stringsArray.set(t.strings,s),s}const k=new Map,M=new WeakMap; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -106,7 +106,7 @@ const S=t=>null===t||!("object"==typeof t||"function"==typeof t),b=t=>Array.isAr * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const R=(t,...e)=>new v(t,e,"html",E),U=133;function z(t,e){const{element:{content:s},parts:i}=t,n=document.createTreeWalker(s,U,null,!1);let r=$(i),o=i[r],a=-1,l=0;const c=[];let h=null;for(;n.nextNode();){a++;const t=n.currentNode;for(t.previousSibling===h&&(h=null),e.has(t)&&(c.push(t),null===h&&(h=t)),null!==h&&l++;void 0!==o&&o.index===a;)o.index=null!==h?-1:o.index-l,o=i[r=$(i,r)]}c.forEach(t=>t.parentNode.removeChild(t))}const F=t=>{let e=11===t.nodeType?0:1;const s=document.createTreeWalker(t,U,null,!1);for(;s.nextNode();)e++;return e},$=(t,e=-1)=>{for(let s=e+1;snew v(t,e,"html",E),U=133;function z(t,e){const{element:{content:s},parts:i}=t,n=document.createTreeWalker(s,U,null,!1);let r=$(i),o=i[r],a=-1,l=0;const h=[];let c=null;for(;n.nextNode();){a++;const t=n.currentNode;for(t.previousSibling===c&&(c=null),e.has(t)&&(h.push(t),null===c&&(c=t)),null!==c&&l++;void 0!==o&&o.index===a;)o.index=null!==c?-1:o.index-l,o=i[r=$(i,r)]}h.forEach(t=>t.parentNode.removeChild(t))}const F=t=>{let e=11===t.nodeType?0:1;const s=document.createTreeWalker(t,U,null,!1);for(;s.nextNode();)e++;return e},$=(t,e=-1)=>{for(let s=e+1;snull===t||!("object"==typeof t||"function"==typeof t),b=t=>Array.isAr * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const q=(t,e)=>`${t}--${e}`;let I=!0;void 0===window.ShadyCSS?I=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),I=!1);const H=t=>e=>{const s=q(e.type,t);let i=k.get(s);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},k.set(s,i));let n=i.stringsArray.get(e.strings);if(void 0!==n)return n;const r=e.strings.join(c);if(void 0===(n=i.keyString.get(r))){const s=e.getTemplateElement();I&&window.ShadyCSS.prepareTemplateDom(s,t),n=new d(e,s),i.keyString.set(r,n)}return i.stringsArray.set(e.strings,n),n},D=["html","svg"],L=new Set,B=(t,e,s)=>{L.add(s);const i=t.querySelectorAll("style"),{length:n}=i;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(e.element,s);const r=document.createElement("style");for(let t=0;t{D.forEach(e=>{const s=k.get(q(e,t));void 0!==s&&s.keyString.forEach(t=>{const{element:{content:e}}=t,s=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{s.add(t)}),z(t,s)})})})(s);const o=e.element.content;!function(t,e,s=null){const{element:{content:i},parts:n}=t;if(null==s)return void i.appendChild(e);const r=document.createTreeWalker(i,U,null,!1);let o=$(n),a=0,l=-1;for(;r.nextNode();)for(l++,r.currentNode===s&&(a=F(e),s.parentNode.insertBefore(e,s));-1!==o&&n[o].index===l;){if(a>0){for(;-1!==o;)n[o].index+=a,o=$(n,o);return}o=$(n,o)}}(e,r,o.firstChild),window.ShadyCSS.prepareTemplateStyles(e.element,s);const a=o.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==a)t.insertBefore(a.cloneNode(!0),t.firstChild);else{o.insertBefore(r,o.firstChild);const t=new Set;t.add(r),z(e,t)}}; +const q=(t,e)=>`${t}--${e}`;let I=!0;void 0===window.ShadyCSS?I=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),I=!1);const H=t=>e=>{const s=q(e.type,t);let i=k.get(s);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},k.set(s,i));let n=i.stringsArray.get(e.strings);if(void 0!==n)return n;const r=e.strings.join(h);if(void 0===(n=i.keyString.get(r))){const s=e.getTemplateElement();I&&window.ShadyCSS.prepareTemplateDom(s,t),n=new d(e,s),i.keyString.set(r,n)}return i.stringsArray.set(e.strings,n),n},D=["html","svg"],L=new Set,B=(t,e,s)=>{L.add(s);const i=t.querySelectorAll("style"),{length:n}=i;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(e.element,s);const r=document.createElement("style");for(let t=0;t{D.forEach(e=>{const s=k.get(q(e,t));void 0!==s&&s.keyString.forEach(t=>{const{element:{content:e}}=t,s=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{s.add(t)}),z(t,s)})})})(s);const o=e.element.content;!function(t,e,s=null){const{element:{content:i},parts:n}=t;if(null==s)return void i.appendChild(e);const r=document.createTreeWalker(i,U,null,!1);let o=$(n),a=0,l=-1;for(;r.nextNode();)for(l++,r.currentNode===s&&(a=F(e),s.parentNode.insertBefore(e,s));-1!==o&&n[o].index===l;){if(a>0){for(;-1!==o;)n[o].index+=a,o=$(n,o);return}o=$(n,o)}}(e,r,o.firstChild),window.ShadyCSS.prepareTemplateStyles(e.element,s);const a=o.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==a)t.insertBefore(a.cloneNode(!0),t.firstChild);else{o.insertBefore(r,o.firstChild);const t=new Set;t.add(r),z(e,t)}}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -162,7 +162,7 @@ const st=(t,e)=>"method"!==e.kind||!e.descriptor||"value"in e.descriptor?{kind:" * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.0.1");const ot=t=>t.flat?t.flat(1/0):function t(e,s=[]){for(let i=0,n=e.length;i(t.add(e),t),new Set).forEach(t=>e.unshift(t))}else t&&e.push(t);return e}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?rt?this.renderRoot.adoptedStyleSheets=t.map(t=>t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){super.update(t);const e=this.render();e instanceof v&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){}}at.finalized=!0,at.render=(t,e,s)=>{const i=s.scopeName,n=M.has(e),r=I&&11===e.nodeType&&!!e.host&&t instanceof v,a=r&&!L.has(i),l=a?document.createDocumentFragment():e;if(((t,e,s)=>{let i=M.get(e);void 0===i&&(o(e,e.firstChild),M.set(e,i=new C(Object.assign({templateFactory:V},s))),i.appendInto(e)),i.setValue(t),i.commit()})(t,l,Object.assign({templateFactory:H(i)},s)),a){const t=M.get(l);M.delete(l),t.value instanceof g&&B(l,t.value.template,i),o(e,e.firstChild),e.appendChild(l),M.set(e,t)}!n&&r&&window.ShadyCSS.styleElement(e.host)};const lt=(t,e)=>0!=(t.attributes.supported_features&e);class ct{constructor(t,e){this.hass=t,this.stateObj=e,this._attr=e.attributes,this._feat=this._attr.supported_features}get isFullyOpen(){return void 0!==this._attr.current_position?100===this._attr.current_position:"open"===this.stateObj.state}get isFullyClosed(){return void 0!==this._attr.current_position?0===this._attr.current_position:"closed"===this.stateObj.state}get isFullyOpenTilt(){return 100===this._attr.current_tilt_position}get isFullyClosedTilt(){return 0===this._attr.current_tilt_position}get isOpening(){return"opening"===this.stateObj.state}get isClosing(){return"closing"===this.stateObj.state}get supportsOpen(){return lt(this.stateObj,1)}get supportsClose(){return lt(this.stateObj,2)}get supportsSetPosition(){return lt(this.stateObj,4)}get supportsStop(){return lt(this.stateObj,8)}get supportsOpenTilt(){return lt(this.stateObj,16)}get supportsCloseTilt(){return lt(this.stateObj,32)}get supportsStopTilt(){return lt(this.stateObj,64)}get supportsSetTiltPosition(){return lt(this.stateObj,128)}get isTiltOnly(){const t=this.supportsOpen||this.supportsClose||this.supportsStop;return(this.supportsOpenTilt||this.supportsCloseTilt||this.supportsStopTilt)&&!t}openCover(){this.callService("open_cover")}closeCover(){this.callService("close_cover")}stopCover(){this.callService("stop_cover")}openCoverTilt(){this.callService("open_cover_tilt")}closeCoverTilt(){this.callService("close_cover_tilt")}stopCoverTilt(){this.callService("stop_cover_tilt")}setCoverPosition(t){this.callService("set_cover_position",{position:t})}setCoverTiltPosition(t){this.callService("set_cover_tilt_position",{tilt_position:t})}callService(t,e={}){e.entity_id=this.stateObj.entity_id,this.hass.callService("cover",t,e)}}s.d(e,"StateCardCustomCover",function(){return pt});var ht=function(t,e,s,i){var n,r=arguments.length,o=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,s,o):n(e,s))||o);return r>3&&o&&Object.defineProperty(e,s,o),o};let pt=class extends at{constructor(){super(...arguments),this.inDialog=!1}get stateObj(){return this.hass&&this._config?this.hass.states[this._config.entity]:null}setConfig(t){if(!t||!t.entity)throw new Error("Invalid configuration");this._config=t}get entityObj(){if(this.hass&&this.stateObj)return new ct(this.hass,this.stateObj);throw new Error("Trying to get entityObj before setting hass & config")}static getCardSize(){return 1}stateInfoTemplate(){return R` +(window.litElementVersions||(window.litElementVersions=[])).push("2.0.1");const ot=t=>t.flat?t.flat(1/0):function t(e,s=[]){for(let i=0,n=e.length;i(t.add(e),t),new Set).forEach(t=>e.unshift(t))}else t&&e.push(t);return e}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?rt?this.renderRoot.adoptedStyleSheets=t.map(t=>t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){super.update(t);const e=this.render();e instanceof v&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){}}at.finalized=!0,at.render=(t,e,s)=>{const i=s.scopeName,n=M.has(e),r=I&&11===e.nodeType&&!!e.host&&t instanceof v,a=r&&!L.has(i),l=a?document.createDocumentFragment():e;if(((t,e,s)=>{let i=M.get(e);void 0===i&&(o(e,e.firstChild),M.set(e,i=new C(Object.assign({templateFactory:V},s))),i.appendInto(e)),i.setValue(t),i.commit()})(t,l,Object.assign({templateFactory:H(i)},s)),a){const t=M.get(l);M.delete(l),t.value instanceof g&&B(l,t.value.template,i),o(e,e.firstChild),e.appendChild(l),M.set(e,t)}!n&&r&&window.ShadyCSS.styleElement(e.host)};const lt=(t,e)=>0!=(t.attributes.supported_features&e);class ht{constructor(t,e){this.hass=t,this.stateObj=e,this._attr=e.attributes,this._feat=this._attr.supported_features}get isFullyOpen(){return void 0!==this._attr.current_position?100===this._attr.current_position:"open"===this.stateObj.state}get isFullyClosed(){return void 0!==this._attr.current_position?0===this._attr.current_position:"closed"===this.stateObj.state}get isFullyOpenTilt(){return 100===this._attr.current_tilt_position}get isFullyClosedTilt(){return 0===this._attr.current_tilt_position}get isOpening(){return"opening"===this.stateObj.state}get isClosing(){return"closing"===this.stateObj.state}get supportsOpen(){return lt(this.stateObj,1)}get supportsClose(){return lt(this.stateObj,2)}get supportsSetPosition(){return lt(this.stateObj,4)}get supportsStop(){return lt(this.stateObj,8)}get supportsOpenTilt(){return lt(this.stateObj,16)}get supportsCloseTilt(){return lt(this.stateObj,32)}get supportsStopTilt(){return lt(this.stateObj,64)}get supportsSetTiltPosition(){return lt(this.stateObj,128)}get isTiltOnly(){const t=this.supportsOpen||this.supportsClose||this.supportsStop;return(this.supportsOpenTilt||this.supportsCloseTilt||this.supportsStopTilt)&&!t}openCover(){this.callService("open_cover")}closeCover(){this.callService("close_cover")}stopCover(){this.callService("stop_cover")}openCoverTilt(){this.callService("open_cover_tilt")}closeCoverTilt(){this.callService("close_cover_tilt")}stopCoverTilt(){this.callService("stop_cover_tilt")}setCoverPosition(t){this.callService("set_cover_position",{position:t})}setCoverTiltPosition(t){this.callService("set_cover_tilt_position",{tilt_position:t})}callService(t,e={}){e.entity_id=this.stateObj.entity_id,this.hass.callService("cover",t,e)}}s.d(e,"StateCardCustomCover",function(){return pt});var ct=function(t,e,s,i){var n,r=arguments.length,o=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,s,o):n(e,s))||o);return r>3&&o&&Object.defineProperty(e,s,o),o};let pt=class extends at{constructor(){super(...arguments),this.inDialog=!1}get stateObj(){return this.hass&&this._config?this.hass.states[this._config.entity]:null}setConfig(t){if(!t||!t.entity)throw new Error("Invalid configuration");this._config=t}get entityObj(){if(this.hass&&this.stateObj)return new ht(this.hass,this.stateObj);throw new Error("Trying to get entityObj before setting hass & config")}static getCardSize(){return 1}stateInfoTemplate(){return R` State info template `}render(){if(!this._config||!this.hass)return R``;const t=this.entityObj,e=this.hass.states[this._config.entity];return e?R` @@ -180,28 +180,28 @@ const st=(t,e)=>"method"!==e.kind||!e.descriptor||"value"in e.descriptor?{kind:"
- - + - + - + + >
`:R` Does not work :( - `}computeOpenDisabled(t,e){const s=!0===t.attributes.assumed_state;return(e.isFullyOpen||e.isOpening)&&!s}computeClosedDisabled(t,e){const s=!0===t.attributes.assumed_state;return(e.isFullyClosed||e.isClosing)&&!s}onHalfOpenTap(t){const e=this.hass.states[this._config.entity];t.stopPropagation(),this.entityObj.setCoverPosition(e.attributes.half_position)}onOpenTap(t){t.stopPropagation(),this.entityObj.openCover()}onCloseTap(t){t.stopPropagation(),this.entityObj.closeCover()}onStopTap(t){t.stopPropagation(),this.entityObj.stopCover()}};ht([nt()],pt.prototype,"hass",void 0),ht([nt()],pt.prototype,"_config",void 0),ht([nt()],pt.prototype,"stateObj",null),ht([nt()],pt.prototype,"inDialog",void 0),pt=ht([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:i}=e;return{kind:s,elements:i,finisher(e){window.customElements.define(t,e)}}})(t,e))("state-card-custom-cover")],pt)}]); \ No newline at end of file + `}computeOpenDisabled(t,e){const s=!0===t.attributes.assumed_state;return(e.isFullyOpen||e.isOpening)&&!s}computeClosedDisabled(t,e){const s=!0===t.attributes.assumed_state;return(e.isFullyClosed||e.isClosing)&&!s}onHalfOpenTap(t){const e=this.hass.states[this._config.entity];t.stopPropagation(),this.entityObj.setCoverPosition(e.attributes.half_position)}onOpenTap(t){t.stopPropagation(),this.entityObj.openCover()}onCloseTap(t){t.stopPropagation(),this.entityObj.closeCover()}onStopTap(t){t.stopPropagation(),this.entityObj.stopCover()}};ct([nt()],pt.prototype,"hass",void 0),ct([nt()],pt.prototype,"_config",void 0),ct([nt()],pt.prototype,"stateObj",null),ct([nt()],pt.prototype,"inDialog",void 0),pt=ct([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:i}=e;return{kind:s,elements:i,finisher(e){window.customElements.define(t,e)}}})(t,e))("state-card-custom-cover")],pt)}]); \ No newline at end of file diff --git a/custom_frontend_sources/state-card-custom-cover/src/state-card-custom-cover.ts b/custom_frontend_sources/state-card-custom-cover/src/state-card-custom-cover.ts index 5efad44..feaadfb 100644 --- a/custom_frontend_sources/state-card-custom-cover/src/state-card-custom-cover.ts +++ b/custom_frontend_sources/state-card-custom-cover/src/state-card-custom-cover.ts @@ -84,24 +84,24 @@ export class StateCardCustomCover extends LitElement {
- - + - + - + + >
`; diff --git a/www/custom_ui/mini-media-player-bundle.js b/www/custom_ui/mini-media-player-bundle.js index c960c6c..f12bed5 100644 --- a/www/custom_ui/mini-media-player-bundle.js +++ b/www/custom_ui/mini-media-player-bundle.js @@ -1 +1 @@ -(function(){"use strict";function a(){const b=za(["",""]);return a=function(){return b},b}function b(){const a=za(["",""]);return b=function(){return a},a}function c(){const a=za(["\n
\n
\n ","\n
\n
"]);return c=function(){return a},a}function d(){const a=za(["\n
\n ","\n ","\n
"]);return d=function(){return a},a}function e(){const a=za(["\n
\n "," ","\n
"]);return e=function(){return a},a}function f(){const a=za(["\n
\n \n
"]);return f=function(){return a},a}function g(){const a=za(["\n
\n
"]);return g=function(){return a},a}function h(){const a=za(["
"]);return h=function(){return a},a}function i(){const a=za(["\n \n \n "]);return i=function(){return a},a}function j(){const a=za(["\n \n \n "]);return j=function(){return a},a}function k(){const a=za(["\n \n \n "]);return k=function(){return a},a}function l(){const a=za(["\n \n
\n ","\n
\n
\n
\n ","\n
\n ","\n ","\n
\n \n \n
\n
\n ","\n \n \n ","\n \n \n
\n
\n
\n ","\n
\n \n "]);return l=function(){return a},a}function m(){const a=za(["\n :host {\n display: flex;\n line-height: var(--mmp-unit);\n max-height: var(--mmp-unit);\n }\n :host([flow]) mmp-media-controls {\n max-width: unset;\n }\n mmp-media-controls {\n max-width: calc(var(--mmp-unit) * 5);\n line-height: initial;\n justify-content: flex-end;\n }\n .group-button {\n height: calc(var(--mmp-unit) * .85);\n width: calc(var(--mmp-unit) * .85);\n min-width: calc(var(--mmp-unit) * .85);\n margin: 3px;\n }\n paper-icon-button {\n min-width: var(--mmp-unit);\n }\n "]);return m=function(){return a},a}function n(){const a=za(["\n \n ","\n \n "]);return n=function(){return a},a}function o(){const a=za(["\n \n "]);return o=function(){return a},a}function p(){const a=za(["\n \n "]);return p=function(){return a},a}function q(){const a=za(["\n \n "]);return q=function(){return a},a}function r(){const a=za(["\n \n "]);return r=function(){return a},a}function s(){const a=za(["\n \n "]);return s=function(){return a},a}function t(){const a=za(["\n \n \n "]);return t=function(){return a},a}function u(){const a=za(["\n ","\n ","\n ","\n ","\n ","\n ","\n "]);return u=function(){return a},a}function v(){const a=za(["\n \n ","\n \n "]);return v=function(){return a},a}function w(){const a=za(["\n :host {\n display: flex;\n width: 100%;\n justify-content: space-between;\n }\n .flex {\n display: flex;\n flex: 1;\n justify-content: space-between;\n }\n ha-slider {\n max-width: none;\n min-width: 100px;\n width: 100%;\n }\n paper-icon-button {\n min-width: var(--mmp-unit);\n }\n .mmp-media-controls__volume {\n flex: 100;\n max-height: var(--mmp-unit);\n }\n .mmp-media-controls__volume.--buttons {\n justify-content: left;\n }\n .mmp-media-controls__media {\n margin-right: 0;\n margin-left: auto;\n justify-content: inherit;\n }\n .mmp-media-controls__media[flow] {\n max-width: none;\n justify-content: space-between;\n }\n .mmp-media-controls__shuffle {\n flex: 3;\n flex-shrink: 200;\n justify-content: center;\n }\n .mmp-media-controls__shuffle paper-icon-button {\n height: 36px;\n width: 36px;\n min-width: 36px;\n margin: 2px;\n }\n "]);return w=function(){return a},a}function x(){const a=za([""]);return x=function(){return a},a}function y(){const a=za(["\n \n \n "]);return y=function(){return a},a}function z(){const a=za([""]);return z=function(){return a},a}function A(){const a=za(["\n \n \n "]);return A=function(){return a},a}function B(){const a=za(["\n ","\n ","\n "]);return B=function(){return a},a}function C(){const a=za(["\n \n \n "]);return C=function(){return a},a}function D(){const a=za(["\n \n \n "]);return D=function(){return a},a}function E(){const a=za(["\n \n \n "]);return E=function(){return a},a}function F(){const a=za(["\n \n \n "]);return F=function(){return a},a}function G(){const a=za(["\n \n \n "]);return G=function(){return a},a}function H(){const a=za(["\n
\n ","\n \n \n \n \n
"]);return H=function(){return a},a}function I(){const a=za(["\n
\n ","\n \n \n
"]);return I=function(){return a},a}function J(){const a=za([""]);return J=function(){return a},a}function K(){const a=za(["\n
\n \n \n ","\n \n \n
\n "]);return K=function(){return a},a}function L(){const a=za([""]);return L=function(){return a},a}function M(){const a=za(["\n
\n \n \n
\n "]);return M=function(){return a},a}function N(){const a=za([""]);return N=function(){return a},a}function O(){const a=za(["\n ","\n ","\n ","\n "]);return O=function(){return a},a}function P(){const a=za(["\n :host {\n max-width: 120px;\n min-width: var(--mmp-unit);\n }\n :host([full]) {\n max-width: none;\n }\n "]);return P=function(){return a},a}function Q(){const a=za(["\n \n "]);return Q=function(){return a},a}function R(){const a=za(["\n :host {\n max-width: 120px;\n min-width: var(--mmp-unit);\n }\n :host([full]) {\n max-width: none;\n }\n "]);return R=function(){return a},a}function S(){const a=za(["\n \n "]);return S=function(){return a},a}function T(){const a=za(["\n .mmp-progress {\n cursor: pointer;\n left: 0; right: 0; bottom: 0;\n position: absolute;\n pointer-events: auto;\n min-height: calc(var(--mmp-progress-height) + 10px);\n }\n .mmp-progress__duration {\n left: calc(var(--ha-card-border-radius, 4px) / 2);\n right: calc(var(--ha-card-border-radius, 4px) / 2);\n bottom: calc(var(--mmp-progress-height) + 6px);\n position: absolute;\n display: flex;\n justify-content: space-between;\n font-size: .8em;\n padding: 0 6px;\n z-index: 2\n }\n paper-progress {\n height: var(--mmp-progress-height);\n --paper-progress-height: var(--mmp-progress-height);\n bottom: 0;\n position: absolute;\n width: 100%;\n transition: height 0;\n z-index: 1;\n --paper-progress-active-color: var(--mmp-accent-color);\n --paper-progress-container-color: rgba(100,100,100,.15);\n --paper-progress-transition-duration: 1s;\n --paper-progress-transition-timing-function: linear;\n --paper-progress-transition-delay: 0s;\n }\n paper-progress.seeking {\n transition: height .15s ease-out;\n height: calc(var(--mmp-progress-height) + 4px);\n --paper-progress-height: calc(var(--mmp-progress-height) + 4px);\n }\n .mmp-progress[paused] paper-progress {\n --paper-progress-active-color: var(--disabled-text-color, rgba(150,150,150,.5));\n }\n "]);return T=function(){return a},a}function U(){const a=za(["\n
\n ","\n ","\n
\n "]);return U=function(){return a},a}function V(){const a=za(["\n
\n ","\n \n \n
\n "]);return V=function(){return a},a}function W(){const a=za(["\n :host {\n align-items: center;\n margin-left: 8px;\n display: flex;\n }\n .mmp-tts__input {\n cursor: text;\n flex: 1;\n margin-right: 8px;\n --paper-input-container-input: {\n font-size: 1em;\n };\n }\n ha-card[rtl] .mmp-tts__input {\n margin-right: auto;\n margin-left: 8px;\n }\n .mmp-tts__button {\n margin: 0;\n height: 30px;\n padding: 0 .4em;\n }\n paper-input {\n opacity: .75;\n --paper-input-container-color: var(--mmp-text-color);\n --paper-input-container-focus-color: var(--mmp-text-color);\n --paper-input-container: {\n padding: 0;\n };\n }\n paper-input[focused] {\n opacity: 1;\n }\n\n ha-card[artwork*='cover'][has-artwork] paper-input {\n --paper-input-container-focus-color: #FFFFFF;\n }\n ha-card[artwork*='cover'][has-artwork] paper-input {\n --paper-input-container-color: #FFFFFF;\n --paper-input-container-input-color: #FFFFFF;\n }\n "]);return W=function(){return a},a}function X(){const a=za(["\n \n \n \n SEND\n \n "]);return X=function(){return a},a}function Y(){const a=za(["\n .mmp-shortcuts__buttons {\n box-sizing: border-box;\n display: flex;\n flex-wrap: wrap;\n margin-top: 8px;\n }\n .mmp-shortcuts__button {\n min-width: calc(50% - 8px);\n flex: 1;\n }\n .mmp-shortcuts__button > div {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n padding: .2em 0;\n }\n .mmp-shortcuts__button > div[align='left'] {\n justify-content: flex-start;\n }\n .mmp-shortcuts__button > div[align='right'] {\n justify-content: flex-end;\n }\n .mmp-shortcuts__button[columns='1'] {\n min-width: calc(100% - 8px);\n }\n .mmp-shortcuts__button[columns='3'] {\n min-width: calc(33.33% - 8px);\n }\n .mmp-shortcuts__button[columns='4'] {\n min-width: calc(25% - 8px);\n }\n .mmp-shortcuts__button[columns='5'] {\n min-width: calc(20% - 8px);\n }\n .mmp-shortcuts__button[columns='6'] {\n min-width: calc(16.66% - 8px);\n }\n .mmp-shortcuts__button > div > span {\n line-height: calc(var(--mmp-unit) * .6);\n text-transform: initial;\n }\n .mmp-shortcuts__button > div > iron-icon {\n width: calc(var(--mmp-unit) * .6);\n height: calc(var(--mmp-unit) * .6);\n }\n .mmp-shortcuts__button > div > *:nth-child(2) {\n margin-left: 4px;\n }\n .mmp-shortcuts__button > div > img {\n height: 24px;\n }\n "]);return Y=function(){return a},a}function Z(){const a=za(["\n ","\n ","\n "]);return Z=function(){return a},a}function $(){const a=za(["",""]);return $=function(){return a},a}function _(){const a=za([""]);return _=function(){return a},a}function aa(){const a=za([""]);return aa=function(){return a},a}function ba(){const a=za(["\n \n
\n ","\n ","\n ","\n
\n "]);return ba=function(){return a},a}function ca(){const a=za(["\n
\n ","\n
\n "]);return ca=function(){return a},a}function da(){const a=za(["\n \n \n "]);return da=function(){return a},a}function ea(){const a=za([""]);return ea=function(){return a},a}function fa(){const a=za(["\n :host {\n display: block;\n }\n :host([faded]) {\n opacity: .75;\n }\n :host[small] .mmp-dropdown__label {\n max-width: 60px;\n display: block;\n position: relative;\n width: auto;\n text-transform: initial;\n }\n :host[full] .mmp-dropdown__label {\n max-width: none;\n }\n .mmp-dropdown {\n padding: 0;\n display: block;\n }\n .mmp-dropdown__button {\n display: flex;\n font-size: 1em;\n justify-content: space-between;\n align-items: center;\n height: calc(var(--mmp-unit) - 4px);\n margin: 2px 0;\n }\n .mmp-dropdown__button.icon {\n height: var(--mmp-unit);\n margin: 0;\n }\n .mmp-dropdown__button > div {\n display: flex;\n flex: 1;\n justify-content: space-between;\n align-items: center;\n height: calc(var(--mmp-unit) - 4px);\n max-width: 100%;\n }\n .mmp-dropdown__label {\n text-align: left;\n text-transform: none;\n }\n .mmp-dropdown__icon {\n height: calc(var(--mmp-unit) * .6);\n width: calc(var(--mmp-unit) * .6);\n min-width: calc(var(--mmp-unit) * .6);\n }\n paper-item > *:nth-child(2) {\n margin-left: 4px;\n }\n paper-menu-button[focused] mmp-button iron-icon {\n color: var(--mmp-accent-color);\n transform: rotate(180deg);\n }\n paper-menu-button[focused] paper-icon-button {\n color: var(--mmp-accent-color);\n transform: rotate(180deg);\n }\n paper-menu-button[focused] paper-icon-button[focused] {\n color: var(--mmp-text-color);\n transform: rotate(0deg);\n }\n "]);return fa=function(){return a},a}function ga(){const a=za(["",""]);return ga=function(){return a},a}function ha(){const a=za([""]);return ha=function(){return a},a}function ia(){const a=za(["\n \n ","\n ","\n "]);return ia=function(){return a},a}function ja(){const a=za(["\n \n
\n \n ","\n \n \n
\n
\n "]);return ja=function(){return a},a}function ka(){const a=za(["\n \n \n "]);return ka=function(){return a},a}function la(){const a=za(["\n \n ","\n \n ","\n \n \n "]);return la=function(){return a},a}function ma(){const a=za(["\n .mmp-group-list {\n display: flex;\n flex-direction: column;\n margin-left: 8px;\n margin-bottom: 8px;\n }\n .mmp-group-list__title {\n font-weight: 500;\n letter-spacing: .1em;\n margin: 8px 0 4px;\n text-transform: uppercase;\n }\n .mmp-group-list__buttons {\n display: flex;\n }\n .mmp-group-list__button {\n margin: 8px 8px 0 0;\n min-width: 0;\n text-transform: uppercase;\n text-align: center;\n width: 50%;\n --mdc-theme-primary: transparent;\n background: rgba(255,255,255,0.25);\n }\n "]);return ma=function(){return a},a}function na(){const a=za([""]);return na=function(){return a},a}function oa(){const a=za(["Leave"]);return oa=function(){return a},a}function pa(){const a=za(["Ungroup"]);return pa=function(){return a},a}function qa(){const a=za(["\n "]);return qa=function(){return a},a}function ra(){const a=za(["\n
\n Group speakers\n ","\n
\n \n ","\n \n \n Group all\n \n
\n
\n "]);return ra=function(){return a},a}function sa(){const a=za(["\n :host {\n position: relative;\n box-sizing: border-box;\n margin: 4px;\n min-width: 0;\n overflow: hidden;\n transition: background .5s;\n }\n :host([raised]) {\n background: rgba(255,255,255,0.25);\n min-height: calc(var(--mmp-unit) * .8);\n box-shadow:\n 0px 3px 1px -2px rgba(0, 0, 0, 0.2),\n 0px 2px 2px 0px rgba(0, 0, 0, 0.14),\n 0px 1px 5px 0px rgba(0,0,0,.12);\n }\n :host([color]) {\n background: var(--mmp-active-color);\n transition: background .25s;\n opacity: 1;\n }\n :host([faded]) {\n opacity: .75;\n }\n .container {\n height: 100%;\n width: 100%;\n }\n .slot-container {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 8px;\n width: auto;\n }\n paper-ripple {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n }\n "]);return sa=function(){return a},a}function ta(){const a=za(["\n
\n
\n \n
\n \n
\n "]);return ta=function(){return a},a}function ua(){const a=za(["\n paper-checkbox {\n padding: 8px 0;\n }\n paper-checkbox > span {\n font-weight: 600;\n }\n\n ha-card[artwork*='cover'][has-artwork] paper-checkbox[disabled] {\n --paper-checkbox-checkmark-color: rgba(0,0,0,.5);\n }\n ha-card[artwork*='cover'][has-artwork] paper-checkbox {\n --paper-checkbox-unchecked-color: #FFFFFF;\n --paper-checkbox-label-color: #FFFFFF;\n }\n "]);return ua=function(){return a},a}function va(){const a=za(["(master)"]);return va=function(){return a},a}function wa(){const a=za(["\n \n ","\n ","\n \n "]);return wa=function(){return a},a}function xa(){const a=za(["\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .label {\n margin: 0 8px;\n }\n ha-icon {\n width: calc(var(--mmp-unit) * .6);\n height: calc(var(--mmp-unit) * .6);\n }\n paper-icon-button {\n width: var(--mmp-unit);\n height: var(--mmp-unit);\n color: var(--mmp-text-color, var(--primary-text-color));\n transition: color .25s;\n }\n paper-icon-button[color] {\n color: var(--mmp-accent-color, var(--accent-color)) !important;\n opacity: 1 !important;\n }\n paper-icon-button[inactive] {\n opacity: .5;\n }\n"]);return xa=function(){return a},a}function ya(){const a=za(["\n :host {\n overflow: visible !important;\n display: block;\n --mmp-scale: var(--mini-media-player-scale, 1);\n --mmp-unit: calc(var(--mmp-scale) * 40px);\n --mmp-accent-color: var(--mini-media-player-accent-color, var(--accent-color, #f39c12));\n --mmp-base-color: var(--mini-media-player-base-color, var(--primary-text-color, #000));\n --mmp-overlay-color: var(--mini-media-player-overlay-color, rgba(0,0,0,0.5));\n --mmp-overlay-color-stop: var(--mini-media-player-overlay-color-stop, 25%);\n --mmp-overlay-base-color: var(--mini-media-player-overlay-base-color, #fff);\n --mmp-overlay-accent-color: var(--mini-media-player-overlay-accent-color, --mmp-accent-color);\n --mmp-text-color: var(--mini-media-player-base-color, var(--primary-text-color, #000));\n --mmp-media-cover-info-color: var(--mini-media-player-media-cover-info-color, --mmp-text-color);\n --mmp-text-color-inverted: var(--disabled-text-color);\n --mmp-active-color: var(--mmp-accent-color);\n --mmp-icon-color:\n var(--mini-media-player-icon-color,\n var(--mini-media-player-base-color,\n var(--paper-item-icon-color, #44739e)));\n --mmp-info-opacity: 1;\n --mmp-bg-opacity: var(--mini-media-player-background-opacity, 1);\n --mmp-artwork-opacity: var(--mini-media-player-artwork-opacity, 1);\n --mmp-progress-height: var(--mini-media-player-progress-height, 6px);\n --mdc-theme-primary: var(--mmp-text-color);\n --mdc-theme-on-primary: var(--mmp-text-color);\n --paper-checkbox-unchecked-color: var(--mmp-text-color);\n --paper-checkbox-label-color: var(--mmp-text-color);\n color: var(--mmp-text-color);\n }\n ha-card.--bg {\n --mmp-info-opacity: .75;\n }\n ha-card.--has-artwork[artwork*='cover'] {\n --mmp-accent-color: var(--mini-media-player-overlay-accent-color, var(--mini-media-player-accent-color, var(--accent-color, #f39c12)));\n --mmp-text-color: var(--mmp-overlay-base-color);\n --mmp-text-color-inverted: #000;\n --mmp-active-color: rgba(255,255,255,.5);\n --mmp-icon-color: var(--mmp-text-color);\n --mmp-info-opacity: .75;\n --paper-slider-container-color: var(--mini-media-player-overlay-color, rgba(255,255,255,.75));\n --mdc-theme-primary: var(--mmp-text-color);\n --mdc-theme-on-primary: var(--mmp-text-color);\n --paper-checkbox-unchecked-color: var(--mmp-text-color);\n --paper-checkbox-label-color: var(--mmp-text-color);\n color: var(--mmp-text-color);\n }\n ha-card {\n cursor: default;\n display: flex;\n background: transparent;\n overflow: visible;\n padding: 0;\n position: relative;\n color: inherit;\n font-size: calc(var(--mmp-unit) * 0.35);\n }\n ha-card.--group {\n box-shadow: none;\n --mmp-progress-height: var(--mini-media-player-progress-height, 4px);\n }\n ha-card.--more-info {\n cursor: pointer;\n }\n .mmp__bg, .mmp-player, .mmp__container {\n border-radius: var(--ha-card-border-radius, 0);\n }\n .mmp__container {\n overflow: hidden;\n height: 100%;\n width: 100%;\n position: absolute;\n pointer-events: none;\n }\n ha-card:before {\n content: '';\n padding-top: 0px;\n transition: padding-top .5s cubic-bezier(.21,.61,.35,1);\n will-change: padding-top;\n }\n ha-card.--initial .entity__artwork,\n ha-card.--initial .entity__icon {\n animation-duration: .001s;\n }\n ha-card.--initial:before,\n ha-card.--initial .mmp-player {\n transition: none;\n }\n header {\n display: none;\n }\n ha-card[artwork='full-cover'].--has-artwork:before {\n padding-top: 56%;\n }\n ha-card[artwork='full-cover'].--has-artwork[content='music']:before,\n ha-card[artwork='full-cover-fit'].--has-artwork:before {\n padding-top: 100%;\n }\n .mmp__bg {\n background: var(--ha-card-background, var(--paper-card-background-color, white));\n position: absolute;\n top: 0; right: 0; bottom: 0; left: 0;\n overflow: hidden;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n opacity: var(--mmp-bg-opacity);\n }\n ha-card[artwork*='cover'].--has-artwork .mmp__bg {\n opacity: var(--mmp-artwork-opacity);\n background: transparent;\n }\n ha-card.--group .mmp__bg {\n background: transparent;\n }\n .cover,\n .cover:before {\n display: block;\n opacity: 0;\n position: absolute;\n top: 0; right: 0; bottom: 0; left: 0;\n transition: opacity .75s cubic-bezier(.21,.61,.35,1);\n will-change: opacity;\n }\n .cover {\n animation: fade-in .5s cubic-bezier(.21,.61,.35,1);\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center center;\n border-radius: var(--ha-card-border-radius, 0);\n overflow: hidden;\n }\n .cover:before {\n background: var(--mmp-overlay-color);\n content: '';\n }\n ha-card[artwork*='full-cover'].--has-artwork .mmp-player {\n background: linear-gradient(to top, var(--mmp-overlay-color) var(--mmp-overlay-color-stop), transparent 100%);\n border-bottom-left-radius: var(--ha-card-border-radius, 0);\n border-bottom-right-radius: var(--ha-card-border-radius, 0);\n }\n ha-card.--has-artwork .cover,\n ha-card.--has-artwork[artwork='cover'] .cover:before,\n ha-card.--bg .cover {\n opacity: .999;\n }\n ha-card[artwork='default'] .cover {\n display: none;\n }\n ha-card.--bg .cover {\n display: block;\n }\n ha-card[artwork='full-cover-fit'].--has-artwork .cover {\n background-color: black;\n background-size: contain;\n }\n .mmp-player {\n align-self: flex-end;\n box-sizing: border-box;\n position: relative;\n padding: 16px;\n transition: padding .25s ease-out;\n width: 100%;\n will-change: padding;\n }\n ha-card.--group .mmp-player {\n padding: 10px 0;\n }\n .flex {\n display: flex;\n display: -ms-flexbox;\n display: -webkit-flex;\n flex-direction: row;\n }\n .mmp-player__core {\n position: relative;\n }\n .entity__info {\n justify-content: center;\n display: flex;\n flex-direction: column;\n margin-left: 8px;\n position: relative;\n overflow: hidden;\n user-select: none;\n }\n ha-card.--rtl .entity__info {\n margin-left: auto;\n margin-right: calc(var(--mmp-unit) / 5);\n }\n ha-card[content='movie'] .attr__media_season,\n ha-card[content='movie'] .attr__media_episode {\n display: none;\n }\n .entity__icon {\n color: var(--mmp-icon-color);\n }\n .entity__artwork, .entity__icon {\n animation: fade-in .25s ease-out;\n background-position: center center;\n background-repeat: no-repeat;\n background-size: cover;\n border-radius: 100%;\n height: var(--mmp-unit);\n width: var(--mmp-unit);\n min-width: var(--mmp-unit);\n line-height: var(--mmp-unit);\n margin-right: calc(var(--mmp-unit) / 5);\n position: relative;\n text-align: center;\n will-change: border-color;\n transition: border-color .25s ease-out;\n }\n ha-card.--rtl .entity__artwork,\n ha-card.--rtl .entity__icon {\n margin-right: auto;\n }\n .entity__artwork[border] {\n border: 2px solid var(--primary-text-color);\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n }\n .entity__artwork[border][state='playing'] {\n border-color: var(--mmp-accent-color);\n }\n .entity__info__name,\n .entity__info__media[short] {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .entity__info__name {\n line-height: calc(var(--mmp-unit) / 2);\n color: var(--mmp-text-color);\n }\n .entity__info__media {\n color: var(--secondary-text-color);\n max-height: 6em;\n word-break: break-word;\n opacity: var(--mmp-info-opacity);\n transition: color .5s;\n }\n .entity__info__media[short] {\n max-height: calc(var(--mmp-unit) / 2);\n overflow: hidden;\n }\n .attr__app_name {\n display: none;\n }\n .attr__app_name:first-child,\n .attr__app_name:first-of-type {\n display: inline;\n }\n .mmp-player__core[inactive] .entity__info__media {\n color: var(--mmp-text-color);\n max-width: 200px;\n opacity: .5;\n }\n .entity__info__media[short-scroll] {\n max-height: calc(var(--mmp-unit) / 2);\n white-space: nowrap;\n }\n .entity__info__media[scroll] > span {\n visibility: hidden;\n }\n .entity__info__media[scroll] > div {\n animation: move linear infinite;\n }\n .entity__info__media[scroll] .marquee {\n animation: slide linear infinite;\n }\n .entity__info__media[scroll] .marquee,\n .entity__info__media[scroll] > div {\n animation-duration: inherit;\n visibility: visible;\n }\n .entity__info__media[scroll] {\n animation-duration: 10s;\n mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);\n -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);\n }\n .marquee {\n visibility: hidden;\n position: absolute;\n white-space: nowrap;\n }\n ha-card[artwork*='cover'].--has-artwork .entity__info__media,\n ha-card.--bg .entity__info__media {\n color: var(--mmp-media-cover-info-color);\n }\n .entity__info__media span:before {\n content: ' - ';\n }\n .entity__info__media span:first-of-type:before {\n content: '';\n }\n .entity__info__media span:empty {\n display: none;\n }\n .mmp-player__adds {\n margin-left: calc(var(--mmp-unit) * 1.2);\n position: relative;\n }\n ha-card.--rtl .mmp-player__adds {\n margin-left: auto;\n margin-right: calc(var(--mmp-unit) * 1.2);\n }\n .mmp-player__adds > *:nth-child(2) {\n margin-top: 0px;\n }\n mmp-powerstrip {\n flex: 1;\n justify-content: flex-end;\n margin-right: 0;\n margin-left: auto;\n width: auto;\n max-width: 100%;\n }\n mmp-media-controls {\n flex-wrap: wrap;\n }\n ha-card.--flow mmp-powerstrip {\n justify-content: space-between;\n margin-left: auto;\n }\n ha-card.--flow.--rtl mmp-powerstrip {\n margin-right: auto;\n }\n ha-card.--flow .entity__info {\n display: none;\n }\n ha-card.--responsive .mmp-player__adds {\n margin-left: 0;\n }\n ha-card.--responsive.--rtl .mmp-player__adds {\n margin-right: 0;\n }\n ha-card.--responsive .mmp-player__adds > mmp-media-controls {\n padding: 0;\n }\n ha-card.--progress .mmp-player {\n padding-bottom: calc(16px + calc(var(--mini-media-player-progress-height, 6px) - 6px));\n }\n ha-card.--progress.--group .mmp-player {\n padding-bottom: calc(10px + calc(var(--mini-media-player-progress-height, 6px) - 6px));\n }\n ha-card.--runtime .mmp-player {\n padding-bottom: calc(16px + 16px + var(--mini-media-player-progress-height, 0px));\n }\n ha-card.--runtime.--group .mmp-player {\n padding-bottom: calc(16px + 12px + var(--mini-media-player-progress-height, 0px));\n }\n ha-card.--inactive .mmp-player {\n padding: 16px;\n }\n ha-card.--inactive.--group .mmp-player {\n padding: 10px 0;\n }\n .mmp-player div:empty {\n display: none;\n }\n @keyframes slide {\n 100% { transform: translateX(-100%); }\n }\n @keyframes move {\n from { transform: translateX(100%); }\n to { transform: translateX(0); }\n }\n @keyframes fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n"]);return ya=function(){return a},a}function za(a,b){return b||(b=a.slice(0)),Object.freeze(Object.defineProperties(a,{raw:{value:Object.freeze(b)}}))}function Aa(a,b){return Da(a)||Ca(a,b)||Ba()}function Ba(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Ca(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{d||null==h["return"]||h["return"]()}finally{if(e)throw f}}return c}function Da(a){if(Array.isArray(a))return a}function Ea(a){for(var b=1;ba.parentNode.removeChild(a))}function Ca(a,b){let c=2function(){const b=a(...arguments);return Qa.set(b,!0),b},Sa=a=>"function"==typeof a&&Qa.has(a),Ta=window.customElements!==void 0&&window.customElements.polyfillWrapFlushCallback!==void 0,Ua=function(a,b){for(let c=2"),Za=new RegExp("".concat(Xa,"|").concat(Ya)),$a="$lit$";class _a{constructor(a,b){this.parts=[],this.element=b;const c=[],d=[],e=document.createTreeWalker(b.content,133,null,!1);let f=0,g=-1,h=0;for(const i=a.strings,j=a.values.length;h{const c=a.length-b.length;return 0<=c&&a.slice(c)===b},bb=a=>-1!==a.index,cb=()=>document.createComment(""),db=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class eb{constructor(a,b,c){this.__parts=[],this.template=a,this.processor=b,this.options=c}update(a){let b=0;for(const c of this.__parts)void 0!==c&&c.setValue(a[b]),b++;for(const b of this.__parts)void 0!==b&&b.commit()}_clone(){const a=Ta?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),b=[],c=this.template.parts,d=document.createTreeWalker(a,133,null,!1);let e,f=0,g=0,h=d.nextNode();for(;f",e+1);const f=db.exec(a);b+=null===f?a+(c?Xa:Ya):a.substr(0,f.index)+f[1]+f[2]+$a+f[3]+Xa}return b+=this.strings[a],b}getTemplateElement(){const a=document.createElement("template");return a.innerHTML=this.getHTML(),a}}const gb=a=>null===a||"object"!=typeof a&&"function"!=typeof a,hb=a=>Array.isArray(a)||!!(a&&a[Symbol.iterator]);class ib{constructor(a,b,c){this.dirty=!0,this.element=a,this.name=b,this.strings=c,this.parts=[];for(let d=0;dthis.handleEvent(a)}setValue(a){this.__pendingValue=a}commit(){for(;Sa(this.__pendingValue);){const a=this.__pendingValue;this.__pendingValue=Va,a(this)}if(this.__pendingValue===Va)return;const a=this.__pendingValue,b=this.value,c=null==a||null!=b&&(a.capture!==b.capture||a.once!==b.once||a.passive!==b.passive);c&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),null!=a&&(null==b||c)&&(this.__options=qb(a),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=a,this.__pendingValue=Va}handleEvent(a){"function"==typeof this.value?this.value.call(this.eventContext||this.element,a):this.value.handleEvent(a)}}const qb=a=>a&&(ob?{capture:a.capture,passive:a.passive,once:a.once}:a.capture);const rb=new class{handleAttributeExpressions(a,b,c,d){const e=b[0];if("."===e){const d=new mb(a,b.slice(1),c);return d.parts}if("@"===e)return[new pb(a,b.slice(1),d.eventContext)];if("?"===e)return[new lb(a,b.slice(1),c)];const f=new ib(a,b,c);return f.parts}handleTextExpression(a){return new kb(a)}},sb=new Map,tb=new WeakMap,ub=(a,b,c)=>{let d=tb.get(b);d===void 0&&(Ua(b,b.firstChild),tb.set(b,d=new kb(Object.assign({templateFactory:za},c))),d.appendInto(b)),d.setValue(a),d.commit()};(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const vb=function(a){for(var b=arguments.length,c=Array(1{let b=11===a.nodeType?0:1;for(const c=document.createTreeWalker(a,wb,null,!1);c.nextNode();)b++;return b},yb=function(a){let b=1"".concat(a,"--").concat(b);let Ab=!0;"undefined"==typeof window.ShadyCSS?Ab=!1:"undefined"==typeof window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),Ab=!1);const Bb=a=>b=>{const c=zb(b.type,a);let d=sb.get(c);void 0===d&&(d={stringsArray:new WeakMap,keyString:new Map},sb.set(c,d));let e=d.stringsArray.get(b.strings);if(void 0!==e)return e;const f=b.strings.join(Xa);if(e=d.keyString.get(f),void 0===e){const c=b.getTemplateElement();Ab&&window.ShadyCSS.prepareTemplateDom(c,a),e=new _a(b,c),d.keyString.set(f,e)}return d.stringsArray.set(b.strings,e),e},Cb=["html","svg"],Db=a=>{Cb.forEach(b=>{const c=sb.get(zb(b,a));c!==void 0&&c.keyString.forEach(a=>{const b=a.element.content,c=new Set;Array.from(b.querySelectorAll("style")).forEach(a=>{c.add(a)}),Ba(a,c)})})},Eb=new Set,Fb=(a,b,c)=>{Eb.add(c);const d=a.querySelectorAll("style"),e=d.length;if(0===e)return void window.ShadyCSS.prepareTemplateStyles(b.element,c);const f=document.createElement("style");for(let g=0;g{const d=c.scopeName,e=tb.has(b),f=Ab&&11===b.nodeType&&!!b.host&&a instanceof fb,g=f&&!Eb.has(d),h=g?document.createDocumentFragment():b;if(ub(a,h,Object.assign({templateFactory:Bb(d)},c)),g){const a=tb.get(h);tb.delete(h),a.value instanceof eb&&Fb(h,a.value.template,d),Ua(b,b.firstChild),b.appendChild(h),tb.set(b,a)}!e&&f&&window.ShadyCSS.styleElement(b.host)};window.JSCompiler_renameProperty=a=>a;const Hb={toAttribute(a,b){return b===Boolean?a?"":null:b===Object||b===Array?null==a?a:JSON.stringify(a):a},fromAttribute(a,b){return b===Boolean?null!==a:b===Number?null===a?null:+a:b===Object||b===Array?JSON.parse(a):a}},Ib=(a,b)=>b!==a&&(b===b||a===a),Jb={attribute:!0,type:String,converter:Hb,reflect:!1,hasChanged:Ib},Kb=Promise.resolve(!0),Lb=1,Mb=4,Nb=8,Ob=16,Pb=32;class Qb extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=Kb,this._hasConnectedResolver=void 0,this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const a=[];return this._classProperties.forEach((b,c)=>{const d=this._attributeNameForProperty(c,b);void 0!==d&&(this._attributeToPropertyMap.set(d,c),a.push(d))}),a}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const a=Object.getPrototypeOf(this)._classProperties;a!==void 0&&a.forEach((a,b)=>this._classProperties.set(b,a))}}static createProperty(a){let b=1{if(this.hasOwnProperty(b)){const a=this[b];delete this[b],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(b,a)}})}_applyInstanceProperties(){this._instanceProperties.forEach((a,b)=>this[b]=a),this._instanceProperties=void 0}connectedCallback(){this._updateState|=Pb,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(a,b,c){b!==c&&this._attributeToProperty(a,c)}_propertyToAttribute(a,b){let c=2{b=a,c=d});try{yield d}catch(a){}a._hasConnected||(yield new Promise(b=>a._hasConnectedResolver=b));try{const b=a.performUpdate();null!=b&&(yield b)}catch(a){c(a)}b(!a._hasRequestedUpdate)})()}get _hasConnected(){return this._updateState&Pb}get _hasRequestedUpdate(){return this._updateState&Mb}get hasUpdated(){return this._updateState&Lb}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let a=!1;const b=this._changedProperties;try{a=this.shouldUpdate(b),a&&this.update(b)}catch(b){throw a=!1,b}finally{this._markUpdated()}a&&(!(this._updateState&Lb)&&(this._updateState|=Lb,this.firstUpdated(b)),this.updated(b))}_markUpdated(){this._changedProperties=new Map,this._updateState&=~Mb}get updateComplete(){return this._updatePromise}shouldUpdate(a){return!0}update(a){this._reflectingProperties!==void 0&&0this._propertyToAttribute(b,this[b],a)),this._reflectingProperties=void 0)}updated(a){}firstUpdated(a){}}Qb.finalized=!0;const Rb="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Sb=Symbol();class Tb{constructor(a,b){if(b!==Sb)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=a}get styleSheet(){return void 0===this._styleSheet&&(Rb?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const Ub=a=>{if(a instanceof Tb)return a.cssText;if("number"==typeof a)return a;throw new Error("Value passed to 'css' function must be a 'css' function result: ".concat(a,". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security."))},Vb=function(a){for(var b=arguments.length,c=Array(1b+Ub(c)+a[d+1],a[0]);return new Tb(e,Sb)};(window.litElementVersions||(window.litElementVersions=[])).push("2.2.0");const Wb=a=>a.flat?a.flat(1/0):Da(a);class Xb extends Qb{static finalize(){super.finalize(),this._styles=this.hasOwnProperty(JSCompiler_renameProperty("styles",this))?this._getUniqueStyles():this._styles||[]}static _getUniqueStyles(){const a=this.styles,b=[];if(Array.isArray(a)){const c=Wb(a),d=c.reduceRight((a,b)=>(a.add(b),a),new Set);d.forEach(a=>b.unshift(a))}else a&&b.push(a);return b}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const a=this.constructor._styles;0===a.length||(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow?Rb?this.renderRoot.adoptedStyleSheets=a.map(a=>a.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(a.map(a=>a.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&window.ShadyCSS!==void 0&&window.ShadyCSS.styleElement(this)}update(a){super.update(a);const b=this.render();b instanceof fb&&this.constructor.render(b,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(a=>{const b=document.createElement("style");b.textContent=a.cssText,this.renderRoot.appendChild(b)}))}render(){}}Xb.finalized=!0,Xb.render=Gb;const Yb=new WeakMap,Zb=Ra(a=>b=>{if(!(b instanceof jb)||b instanceof nb||"class"!==b.committer.name||1b=>{if(!(b instanceof jb)||b instanceof nb||"style"!==b.committer.name||1Ea({text:this.attr[a.attr],prefix:""},a)).filter(a=>a.text)}get hasProgress(){return!this.config.hide.progress&&!this.idle&&uc.every(a=>a in this.attr)}get progress(){return this.position+(Date.now()-new Date(this.updatedAt).getTime())/1e3}get idleView(){const a=this.config.idle_view;return!!(a.when_idle&&this.isIdle||a.when_standby&&this.isStandby||a.when_paused&&this.isPaused)||!!(this.updatedAt&&a.after&&!this.isPlaying)&&this.checkIdleAfter(a.after)}get trackIdle(){return this.active&&!this.isPlaying&&this.updatedAt&&this.config.idle_view&&this.config.idle_view.after}checkIdleAfter(a){const b=(Date.now()-new Date(this.updatedAt).getTime())/1e3;return this.idle=b>60*a,this.active=this.isActive,this.idle}get supportsShuffle(){return"undefined"!=typeof this.attr.shuffle}get supportsMute(){return"undefined"!=typeof this.attr.is_volume_muted}getAttribute(a){return this.attr[a]||""}fetchThumbnail(){var a=this;return Ha(function*(){try{const b=yield a.hass.callWS({type:"media_player_thumbnail",entity_id:a.config.entity}),c=b.content_type,d=b.content;return"url(data:".concat(c,";base64,").concat(d,")")}catch(a){return console.error("mini-media-player: Failed fetching thumbnail"),!1}})()}toggle(a){return this.config.toggle_power?this.callService(a,"toggle"):this.isOff?this.callService(a,"turn_on"):void this.callService(a,"turn_off")}toggleMute(a){this.callService(a,"volume_mute",{is_volume_muted:!this.muted})}toggleShuffle(a){this.callService(a,"shuffle_set",{shuffle:!this.shuffle})}setSource(a,b){this.callService(a,"select_source",{source:b})}setMedia(a,b){this.callService(a,"play_media",Ea({},b))}playPause(a){this.callService(a,"media_play_pause")}playStop(a){this.isPlaying?this.callService(a,"media_stop"):this.callService(a,"media_play")}setSoundMode(a,b){this.callService(a,"select_sound_mode",{sound_mode:b})}next(a){this.callService(a,"media_next_track")}prev(a){this.callService(a,"media_previous_track")}stop(a){this.callService(a,"media_stop")}volumeUp(a){this.callService(a,"volume_up")}volumeDown(a){this.callService(a,"volume_down")}seek(a,b){this.callService(a,"media_seek",{seek_position:b})}setVolume(a,b){this.config.speaker_group.sync_volume?this.group.forEach(c=>{const d=this.config.speaker_group.entities.find(a=>a.entity_id===c)||{};let e=b;d.volume_offset&&(e+=d.volume_offset/100,1e&&(e=0)),this.callService(a,"volume_set",{entity_id:c,volume_level:e})}):this.callService(a,"volume_set",{entity_id:this.config.entity,volume_level:b})}handleGroupChange(a,b,c){const d=this.config.speaker_group.platform,e={entity_id:b};if(c){if(e.master=this.config.entity,"bluesound"===d)return this.callService(a,"".concat(d,"_JOIN"),e);this.callService(a,"join",e,d)}else{if("bluesound"===d)return this.callService(a,"".concat(d,"_UNJOIN"),e);this.callService(a,"unjoin",e,d)}}toggleScript(a,b){let c=2{let g;switch(d.action){case"more-info":{g=new Event("hass-more-info",{composed:!0}),g.detail={entityId:d.entity||f},a.dispatchEvent(g);break}case"navigate":{if(!d.navigation_path)return;window.history.pushState(null,"",d.navigation_path),g=new Event("location-changed",{composed:!0}),g.detail={replace:!1},window.dispatchEvent(g);break}case"call-service":{if(!d.service)return;const a=d.service.split(".",2),c=Aa(a,2),e=c[0],f=c[1],g=Ea({},d.service_data);b.callService(e,f,g);break}case"url":{if(!d.url)return;window.location.href=d.url}}};class Ac extends Xb{static get properties(){return{item:{},checked:Boolean,disabled:Boolean,master:Boolean}}render(){return vb(wa(),this.checked,this.disabled,a=>a.stopPropagation(),this.handleClick,this.item.name,this.master?vb(va()):"")}handleClick(a){a.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:{entity:this.item.entity_id,checked:!this.checked}}))}static get styles(){return Vb(ua())}}customElements.define("mmp-group-item",Ac);class Bc extends Xb{render(){return vb(ta())}static get styles(){return Vb(sa())}}customElements.define("mmp-button",Bc);class Cc extends Xb{static get properties(){return{entities:{},player:{},visible:Boolean}}get group(){return this.player.group}get master(){return this.player.master}get isMaster(){return this.player.isMaster}handleGroupChange(a){const b=a.detail,c=b.entity,d=b.checked;this.player.handleGroupChange(a,c,d)}render(){let a=0vb(qa(),this.handleGroupChange,a,a.entity_id===this.player.id||b.includes(a.entity_id),a.entity_id===this.player.id||c!==this.player.id,a.entity_id===c)),2>b.length,a=>this.player.handleGroupChange(a,d?b:this.player.entity_id,!1),d?vb(pa()):vb(oa()),!d,a=>this.player.handleGroupChange(a,this.entities.map(a=>a.entity_id),!0)):vb(na())}static get styles(){return Vb(ma())}}customElements.define("mmp-group-list",Cc);class Dc extends Xb{static get properties(){return{items:[],label:String,selected:String}}get selectedId(){return this.items.map(a=>a.id).indexOf(this.selected)}onChange(a){this.dispatchEvent(new CustomEvent("change",{detail:a}))}render(){return vb(la(),"right","top",44,!0,a=>a.stopPropagation(),this.icon?vb(ka(),sc.DROPDOWN):vb(ja(),this.selected||this.label,sc.DROPDOWN),this.selectedId,this.items.map(a=>vb(ia(),a.id||a.name,()=>this.onChange(a),a.icon?vb(ha(),a.icon):"",a.name?vb(ga(),a.name):"")))}static get styles(){return[yc,Vb(fa())]}}customElements.define("mmp-dropdown",Dc);class Ec extends Xb{static get properties(){return{player:{},shortcuts:{}}}get buttons(){return this.shortcuts.buttons}get list(){return this.shortcuts.list}get show(){return!this.shortcuts.hide_when_off||this.player.active}get active(){return this.player.getAttribute(this.shortcuts.attribute)}get height(){return this.shortcuts.column_height||36}render(){if(!this.show)return vb(ea());const a=this.active,b=this.list?vb(da(),this.handleShortcut,this.list,this.shortcuts.label,a):"",c=this.buttons?vb(ca(),this.buttons.map(b=>vb(ba(),"min-height: ".concat(this.height,"px;"),this.shortcuts.columns,b.id===a,a=>this.handleShortcut(a,b),this.shortcuts.align_text,b.icon?vb(aa(),b.icon):"",b.image?vb(_(),b.image):"",b.name?vb($(),b.name):""))):"";return vb(Z(),c,b)}handleShortcut(a,b){const c=b||a.detail,d=c.type,e=c.id,f=c.data;if("source"===d)return this.player.setSource(a,e);if("service"===d)return this.player.toggleService(a,e,f);if("script"===d)return this.player.toggleScript(a,e,f);if("sound_mode"===d)return this.player.setSoundMode(a,e);this.player.setMedia(a,{media_content_type:d,media_content_id:e})}static get styles(){return[yc,Vb(Y())]}}customElements.define("mmp-shortcuts",Ec);const Fc=function(a,b){let c=2a.stopPropagation(),this.handleTts)}handleTts(a){const b=this.config,c=this.message,d={message:c,entity_id:b.entity_id||this.entity};b.language&&(d.language=b.language),"alexa"===b.platform?this.hass.callService("notify","alexa_media",{message:c,data:{type:b.type||"tts"},target:d.entity_id}):"sonos"===b.platform?this.hass.callService("script","sonos_say",{sonos_entity:d.entity_id,volume:b.volume||.5,message:c}):"webos"===b.platform?this.hass.callService("notify",d.entity_id.split(".").slice(-1)[0],{message:c}):"ga"===b.platform?this.hass.callService("notify","ga_broadcast",{message:c}):this.hass.callService("tts","".concat(b.platform,"_say"),d),a.stopPropagation(),this.reset()}reset(){this.input.value=""}static get styles(){return Vb(W())}}customElements.define("mmp-tts",Gc);var Hc=a=>{let b=parseInt(a%60,10),c=parseInt(a/60%60,10),d=parseInt(a/3600%24,10);return d=10>d?"0".concat(d):d,c=10>c?"0".concat(c):c,b=10>b?"0".concat(b):b,"".concat("00"===d?"":"".concat(d,":")).concat(c,":").concat(b)};class Ic extends Xb{static get properties(){return{_player:{},showTime:Boolean,progress:Number,duration:Number,tracker:{},seekProgress:Number,seekWidth:Number,track:Boolean}}set player(a){this._player=a,this.hasProgress&&this.trackProgress()}get duration(){return this.player.mediaDuration}get player(){return this._player}get hasProgress(){return this.player.hasProgress}get width(){return this.shadowRoot.querySelector(".mmp-progress").offsetWidth}get offset(){return this.getBoundingClientRect().left}get classes(){return Zb({transiting:!this.seekProgress,seeking:this.seekProgress})}render(){return vb(V(),this.initSeek,this.handleSeek,this.initSeek,this.handleSeek,this.resetSeek,a=>a.stopPropagation(),!this.player.isPlaying,this.showTime?vb(U(),Hc(this.seekProgress||this.progress),Hc(this.duration)):"",this.classes,this.seekProgress||this.progress,this.duration)}trackProgress(){this.progress=this.player.progress,this.tracker||(this.tracker=setInterval(()=>this.trackProgress(),1e3)),this.player.isPlaying||(clearInterval(this.tracker),this.tracker=null)}initSeek(a){const b=a.offsetX||a.touches[0].pageX-this.offset;this.seekWidth=this.width,this.seekProgress=this.calcProgress(b),this.addEventListener("touchmove",this.moveSeek),this.addEventListener("mousemove",this.moveSeek)}resetSeek(){this.seekProgress=null,this.removeEventListener("touchmove",this.moveSeek),this.removeEventListener("mousemove",this.moveSeek)}moveSeek(a){a.preventDefault();const b=a.offsetX||a.touches[0].pageX-this.offset;this.seekProgress=this.calcProgress(b)}handleSeek(a){this.resetSeek();const b=a.offsetX||a.changedTouches[0].pageX-this.offset,c=this.calcProgress(b);this.player.seek(a,c)}disconnectedCallback(){this.resetSeek(),clearInterval(this.tracker)}calcProgress(a){const b=a/this.seekWidth*this.duration;return Math.min(Math.max(b,.1),this.duration)}static get styles(){return Vb(T())}}customElements.define("mmp-progress",Ic);class Jc extends Xb{static get properties(){return{player:{},icon:Boolean}}get source(){return this.player.source}get sources(){return this.player.sources.map(a=>({name:a,id:a,type:"source"}))}render(){return vb(S(),this.handleSource,this.sources,this.source,this.source,this.icon)}handleSource(a){const b=a.detail.id;this.player.setSource(a,b)}static get styles(){return Vb(R())}}customElements.define("mmp-source-menu",Jc);class Kc extends Xb{static get properties(){return{player:{},selected:String,icon:Boolean}}get mode(){return this.player.soundMode}get modes(){return this.player.soundModes.map(a=>({name:a,id:a,type:"soundMode"}))}render(){return vb(Q(),this.handleChange,this.modes,this.mode,this.selected||this.mode,this.icon)}handleChange(a){const b=a.detail.id;this.player.setSoundMode(a,b),this.selected=b}static get styles(){return Vb(P())}}customElements.define("mmp-sound-menu",Kc);class Lc extends Xb{static get properties(){return{player:{},config:{},break:Boolean}}get showShuffle(){return!this.config.hide.shuffle&&this.player.supportsShuffle}get maxVol(){return this.config.max_volume||100}get minVol(){return this.config.min_volume||0}render(){const a=this.config.hide;return vb(O(),a.volume?vb(N()):this.renderVolControls(this.player.muted),this.showShuffle?vb(M(),a=>this.player.toggleShuffle(a),sc.SHUFFLE,this.player.shuffle):vb(L()),a.controls?vb(J()):vb(K(),this.config.flow||this.break,a=>this.player.prev(a),sc.PREV,this.renderPlayButtons(),a=>this.player.next(a),sc.NEXT))}renderVolControls(a){return this.config.volume_stateless?this.renderVolButtons(a):this.renderVolSlider(a)}renderVolSlider(a){return vb(I(),this.renderMuteButton(a),this.handleVolumeChange,a=>a.stopPropagation(),a,this.minVol,this.maxVol,100*this.player.vol,"ltr")}renderVolButtons(a){return vb(H(),this.renderMuteButton(a),a=>this.player.volumeDown(a),sc.VOL_DOWN,a=>this.player.volumeUp(a),sc.VOL_UP)}renderMuteButton(a){if(!this.config.hide.mute)switch(this.config.replace_mute){case"play":case"play_pause":return vb(G(),a=>this.player.playPause(a),sc.PLAY[this.player.isPlaying]);case"stop":return vb(F(),a=>this.player.stop(a),sc.STOP.true);case"play_stop":return vb(E(),a=>this.player.playStop(a),sc.STOP[this.player.isPlaying]);case"next":return vb(D(),a=>this.player.next(a),sc.NEXT);default:return this.player.supportsMute?vb(C(),a=>this.player.toggleMute(a),sc.MUTE[a]):void 0;}}renderPlayButtons(){const a=this.config.hide;return vb(B(),a.play_pause?vb(z()):vb(A(),a=>this.player.playPause(a),sc.PLAY[this.player.isPlaying]),a.play_stop?vb(x()):vb(y(),a=>this.handleStop(a),a.play_pause?sc.STOP[this.player.isPlaying]:sc.STOP.true))}handleStop(a){return this.config.hide.play_pause?this.player.playStop(a):this.player.stop(a)}handleVolumeChange(a){const b=parseFloat(a.target.value)/100;this.player.setVolume(a,b)}static get styles(){return[yc,Vb(w())]}}customElements.define("mmp-media-controls",Lc);class Mc extends Xb{static get properties(){return{hass:{},player:{},config:{},groupVisible:Boolean,idle:Boolean}}get icon(){return this.config.speaker_group.icon||sc.GROUP}get showGroupButton(){return this.config.speaker_group.entities}get showPowerButton(){return!this.config.hide.power}get powerColor(){return this.player.active&&!this.config.hide.power_state}get sourceSize(){return"icon"===this.config.source||this.hasControls||this.idle}get soundSize(){return"icon"===this.config.sound_mode||this.hasControls||this.idle}get hasControls(){return this.player.active&&this.config.hide.controls!==this.config.hide.volume}get hasSource(){return 0this.player.toggle(a),this.powerColor):"")}handleGroupClick(a){a.stopPropagation(),this.dispatchEvent(new CustomEvent("toggleGroupList"))}get renderIdleView(){return this.player.isPaused?vb(o(),sc.PLAY[this.player.isPlaying],a=>this.player.playPause(a)):vb(n(),Fc(this.hass,"state.media_player.idle","Idle"))}static get styles(){return[yc,Vb(m())]}}customElements.define("mmp-powerstrip",Mc),customElements.get("ha-slider")||customElements.define("ha-slider",class extends customElements.get("paper-slider"){});class Nc extends Xb{constructor(){super(),this._overflow=!1,this.initial=!0,this.picture=!1,this.thumbnail=!1,this.edit=!1,this.rtl=!1}static get properties(){return{_hass:{},config:{},entity:{},player:{},_overflow:Boolean,break:Boolean,initial:Boolean,picture:String,thumbnail:String,edit:Boolean,rtl:Boolean,idle:Boolean}}static get styles(){return[yc,xc]}set hass(a){if(a){const b=a.states[this.config.entity];this._hass=a,b&&this.entity!==b&&(this.entity=b,this.player=new wc(a,this.config,b),this.rtl=this.computeRTL(a),this.idle=this.player.idle,this.player.trackIdle&&this.updateIdleStatus())}}get hass(){return this._hass}set overflow(a){this._overflow!==a&&(this._overflow=a)}get overflow(){return this._overflow}get name(){return this.config.name||this.player.name}setConfig(a){if(!a.entity||"media_player"!==a.entity.split(".")[0])throw new Error("Specify an entity from within the media_player domain.");const b=Ea({artwork:"default",info:"default",more_info:!0,source:"default",sound_mode:"default",toggle_power:!0,tap_action:{action:"more-info"}},a,{hide:Ea({},rc,a.hide),speaker_group:Ea({show_group_count:!0,platform:"sonos"},a.sonos,a.speaker_group),shortcuts:Ea({label:"Shortcuts..."},a.shortcuts)});b.max_volume=+b.max_volume||100,b.min_volume=+b.min_volume||0,b.collapse=b.hide.controls||b.hide.volume,b.info=b.collapse&&"scroll"!==b.info?"short":b.info,b.flow=b.hide.icon&&b.hide.name&&b.hide.info,this.config=b}shouldUpdate(a){return void 0===this.break&&this.computeRect(this),tc.some(b=>a.has(b))&&this.player}firstUpdated(){const a=new qc(a=>{a.forEach(a=>{window.requestAnimationFrame(()=>{"scroll"===this.config.info&&this.computeOverflow(),this._resizeTimer||(this.computeRect(a),this._resizeTimer=setTimeout(()=>{this._resizeTimer=null,this.computeRect(this._resizeEntry)},250)),this._resizeEntry=a})})});a.observe(this),setTimeout(()=>this.initial=!1,250),this.edit=this.config.speaker_group.expanded||!1}updated(){"scroll"===this.config.info&&setTimeout(()=>{this.computeOverflow()},10)}render(){let a=0this.handlePopup(a),b.artwork,this.player.content,this.renderArtwork(c),this.player.idle,this.renderIcon(c),this.renderEntityName(),this.renderMediaInfo(),this.toggleGroupList,this.hass,this.player,b,this.edit,this.idle,b.flow,!b.collapse&&this.player.active?vb(k(),this.player,b,this.break):"",this.player,b.shortcuts,b.tts?vb(j(),b.tts,this.hass,this.player.id):"",this.edit,b.speaker_group.entities,this.player,this.player.active&&this.player.hasProgress?vb(i(),this.player,!this.config.hide.runtime):"")}renderArtwork(a){if(this.thumbnail||this.config.background){const b=this.config.background&&(!a||"default"===this.config.artwork)?"url(".concat(this.config.background,")"):this.thumbnail;return vb(h(),b)}}handlePopup(a){a.stopPropagation(),zc(this,this._hass,this.config,this.config.tap_action,this.player.id)}renderIcon(a){return this.config.hide.icon?void 0:this.player.active&&a&&"default"===this.config.artwork?vb(g(),this.thumbnail,!this.config.hide.artwork_border,this.player.state):vb(f(),this.computeIcon())}renderEntityName(){return this.config.hide.name?void 0:vb(e(),this.name,this.speakerCount())}renderMediaInfo(){if(!this.config.hide.info){const e=this.player.mediaInfo;return vb(d(),"short"===this.config.info||!this.player.active,"scroll"===this.config.info,this.overflow,this.overflow,"scroll"===this.config.info?vb(c(),e.map(a=>vb(b(),"attr__".concat(a.attr),a.prefix+a.text))):"",e.map(b=>vb(a(),"attr__".concat(b.attr),b.prefix+b.text)))}}speakerCount(){if(this.config.speaker_group.show_group_count){const a=this.player.groupCount;return 1{this.thumbnail=a}),this.picture=b),!!(c&&this.thumbnail)}computeIcon(){return this.config.icon?this.config.icon:this.player.icon||sc.DEFAULT}computeOverflow(){const a=this.shadowRoot.querySelector(".marquee");if(a){const b=a.clientWidth>a.parentNode.clientWidth;this.overflow=!!(b&&this.player.active)&&7.5+a.clientWidth/50}}computeRect(a){const b=a.contentRect||a.getBoundingClientRect(),c=b.left,d=b.width;this.break=d+2*c<390}computeRTL(a){const b=a.language||"en";return!!a.translationMetadata.translations[b]&&(a.translationMetadata.translations[b].isRTL||!1)}toggleGroupList(){this.edit=!this.edit}fire(a,b,c){const d=c||{},f=null===b||void 0===b?{}:b,g=new Event(a,{bubbles:void 0===d.bubbles||d.bubbles,cancelable:!!d.cancelable,composed:void 0===d.composed||d.composed});return g.detail=f,this.dispatchEvent(g),g}updateIdleStatus(){this._idleTracker&&clearTimeout(this._idleTracker);const a=(Date.now()-new Date(this.player.updatedAt).getTime())/1e3;this._idleTracker=setTimeout(()=>{this.idle=this.player.checkIdleAfter(this.config.idle_view.after),this.player.idle=this.idle,this._idleTracker=null},1e3*(60*this.config.idle_view.after-a))}getCardSize(){return this.config.collapse?1:2}}customElements.define("mini-media-player",Nc)})})(); +(function(){"use strict";function a(){var b=Ba(["",""]);return a=function(){return b},b}function b(){var a=Ba(["",""]);return b=function(){return a},a}function c(){var a=Ba(["\n
\n
\n ","\n
\n
"]);return c=function(){return a},a}function d(){var a=Ba(["\n
\n ","\n ","\n
"]);return d=function(){return a},a}function e(){var a=Ba(["\n
\n "," ","\n
"]);return e=function(){return a},a}function f(){var a=Ba(["\n
\n \n
"]);return f=function(){return a},a}function g(){var a=Ba(["\n
\n
"]);return g=function(){return a},a}function h(){var a=Ba(["
"]);return h=function(){return a},a}function i(){var a=Ba(["\n \n \n "]);return i=function(){return a},a}function j(){var a=Ba(["\n \n \n "]);return j=function(){return a},a}function k(){var a=Ba(["\n \n \n "]);return k=function(){return a},a}function l(){var a=Ba(["\n \n
\n ","\n
\n
\n
\n ","\n
\n ","\n ","\n
\n \n \n
\n
\n ","\n \n \n ","\n \n \n
\n
\n
\n ","\n
\n \n "]);return l=function(){return a},a}function m(){var a=Ba(["\n :host {\n display: flex;\n line-height: var(--mmp-unit);\n max-height: var(--mmp-unit);\n }\n :host([flow]) mmp-media-controls {\n max-width: unset;\n }\n mmp-media-controls {\n max-width: calc(var(--mmp-unit) * 5);\n line-height: initial;\n justify-content: flex-end;\n }\n .group-button {\n --mdc-icon-size: calc(var(--mmp-unit) * 0.5);\n }\n ha-icon-button {\n min-width: var(--mmp-unit);\n }\n "]);return m=function(){return a},a}function n(){var a=Ba(["\n \n ","\n \n "]);return n=function(){return a},a}function o(){var a=Ba(["\n \n "]);return o=function(){return a},a}function p(){var a=Ba(["\n \n "]);return p=function(){return a},a}function q(){var a=Ba(["\n \n "]);return q=function(){return a},a}function r(){var a=Ba(["\n \n "]);return r=function(){return a},a}function s(){var a=Ba(["\n \n "]);return s=function(){return a},a}function t(){var a=Ba(["\n \n \n "]);return t=function(){return a},a}function u(){var a=Ba(["\n ","\n ","\n ","\n ","\n ","\n ","\n "]);return u=function(){return a},a}function v(){var a=Ba(["\n \n ","\n \n "]);return v=function(){return a},a}function w(){var a=Ba(["\n :host {\n display: flex;\n width: 100%;\n justify-content: space-between;\n }\n .flex {\n display: flex;\n flex: 1;\n justify-content: space-between;\n }\n ha-slider {\n max-width: none;\n min-width: 100px;\n width: 100%;\n }\n ha-icon-button {\n min-width: var(--mmp-unit);\n }\n .mmp-media-controls__volume {\n flex: 100;\n max-height: var(--mmp-unit);\n }\n .mmp-media-controls__volume.--buttons {\n justify-content: left;\n }\n .mmp-media-controls__media {\n margin-right: 0;\n margin-left: auto;\n justify-content: inherit;\n }\n .mmp-media-controls__media[flow] {\n max-width: none;\n justify-content: space-between;\n }\n .mmp-media-controls__shuffle {\n flex: 3;\n flex-shrink: 200;\n justify-content: center;\n }\n .mmp-media-controls__shuffle ha-icon-button {\n height: 36px;\n width: 36px;\n min-width: 36px;\n margin: 2px;\n }\n "]);return w=function(){return a},a}function x(){var a=Ba([""]);return x=function(){return a},a}function y(){var a=Ba(["\n \n \n "]);return y=function(){return a},a}function z(){var a=Ba([""]);return z=function(){return a},a}function A(){var a=Ba(["\n \n \n "]);return A=function(){return a},a}function B(){var a=Ba(["\n ","\n ","\n "]);return B=function(){return a},a}function C(){var a=Ba(["\n \n \n "]);return C=function(){return a},a}function D(){var a=Ba(["\n \n \n "]);return D=function(){return a},a}function E(){var a=Ba(["\n \n \n "]);return E=function(){return a},a}function F(){var a=Ba(["\n \n \n "]);return F=function(){return a},a}function G(){var a=Ba(["\n \n \n "]);return G=function(){return a},a}function H(){var a=Ba(["\n
\n ","\n \n \n \n \n
"]);return H=function(){return a},a}function I(){var a=Ba(["\n
\n ","\n \n \n
"]);return I=function(){return a},a}function J(){var a=Ba([""]);return J=function(){return a},a}function K(){var a=Ba(["\n \n "]);return K=function(){return a},a}function L(){var a=Ba(["\n \n "]);return L=function(){return a},a}function M(){var a=Ba(["\n
\n ","\n ","\n ","\n
\n "]);return M=function(){return a},a}function N(){var a=Ba([""]);return N=function(){return a},a}function O(){var a=Ba(["\n
\n \n \n
\n "]);return O=function(){return a},a}function P(){var a=Ba([""]);return P=function(){return a},a}function Q(){var a=Ba(["\n ","\n ","\n ","\n "]);return Q=function(){return a},a}function R(){var a=Ba(["\n :host {\n max-width: 120px;\n min-width: var(--mmp-unit);\n }\n :host([full]) {\n max-width: none;\n }\n "]);return R=function(){return a},a}function S(){var a=Ba(["\n \n "]);return S=function(){return a},a}function T(){var a=Ba(["\n :host {\n max-width: 120px;\n min-width: var(--mmp-unit);\n }\n :host([full]) {\n max-width: none;\n }\n "]);return T=function(){return a},a}function U(){var a=Ba(["\n \n "]);return U=function(){return a},a}function V(){var a=Ba(["\n .mmp-progress {\n cursor: pointer;\n left: 0; right: 0; bottom: 0;\n position: absolute;\n pointer-events: auto;\n min-height: calc(var(--mmp-progress-height) + 10px);\n }\n .mmp-progress__duration {\n left: calc(var(--ha-card-border-radius, 4px) / 2);\n right: calc(var(--ha-card-border-radius, 4px) / 2);\n bottom: calc(var(--mmp-progress-height) + 6px);\n position: absolute;\n display: flex;\n justify-content: space-between;\n font-size: .8em;\n padding: 0 6px;\n z-index: 2\n }\n paper-progress {\n height: var(--mmp-progress-height);\n --paper-progress-height: var(--mmp-progress-height);\n bottom: 0;\n position: absolute;\n width: 100%;\n transition: height 0;\n z-index: 1;\n --paper-progress-active-color: var(--mmp-accent-color);\n --paper-progress-container-color: rgba(100,100,100,.15);\n --paper-progress-transition-duration: 1s;\n --paper-progress-transition-timing-function: linear;\n --paper-progress-transition-delay: 0s;\n }\n paper-progress.seeking {\n transition: height .15s ease-out;\n height: calc(var(--mmp-progress-height) + 4px);\n --paper-progress-height: calc(var(--mmp-progress-height) + 4px);\n }\n .mmp-progress[paused] paper-progress {\n --paper-progress-active-color: var(--disabled-text-color, rgba(150,150,150,.5));\n }\n "]);return V=function(){return a},a}function W(){var a=Ba(["\n
\n ","\n ","\n
\n "]);return W=function(){return a},a}function X(){var a=Ba(["\n
\n ","\n \n \n
\n "]);return X=function(){return a},a}function Y(){var a=Ba(["\n :host {\n align-items: center;\n margin-left: 8px;\n display: flex;\n }\n .mmp-tts__input {\n cursor: text;\n flex: 1;\n margin-right: 8px;\n --paper-input-container-input: {\n font-size: 1em;\n };\n }\n ha-card[rtl] .mmp-tts__input {\n margin-right: auto;\n margin-left: 8px;\n }\n .mmp-tts__button {\n margin: 0;\n height: 30px;\n padding: 0 .4em;\n }\n paper-input {\n opacity: .75;\n --paper-input-container-color: var(--mmp-text-color);\n --paper-input-container-input-color: var(--mmp-text-color);\n --paper-input-container-focus-color: var(--mmp-text-color);\n --paper-input-container: {\n padding: 0;\n };\n }\n paper-input[focused] {\n opacity: 1;\n }\n\n ha-card[artwork*='cover'][has-artwork] paper-input {\n --paper-input-container-color: #FFFFFF;\n --paper-input-container-input-color: #FFFFFF;\n --paper-input-container-focus-color: #FFFFFF;\n }\n "]);return Y=function(){return a},a}function Z(){var a=Ba(["\n \n \n \n SEND\n \n "]);return Z=function(){return a},a}function $(){var a=Ba(["\n .mmp-shortcuts__buttons {\n box-sizing: border-box;\n display: flex;\n flex-wrap: wrap;\n margin-top: 8px;\n }\n .mmp-shortcuts__button {\n min-width: calc(50% - 8px);\n flex: 1;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center center;\n }\n .mmp-shortcuts__button > div {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n padding: .2em 0;\n }\n .mmp-shortcuts__button > div[align='left'] {\n justify-content: flex-start;\n }\n .mmp-shortcuts__button > div[align='right'] {\n justify-content: flex-end;\n }\n .mmp-shortcuts__button[columns='1'] {\n min-width: calc(100% - 8px);\n }\n .mmp-shortcuts__button[columns='3'] {\n min-width: calc(33.33% - 8px);\n }\n .mmp-shortcuts__button[columns='4'] {\n min-width: calc(25% - 8px);\n }\n .mmp-shortcuts__button[columns='5'] {\n min-width: calc(20% - 8px);\n }\n .mmp-shortcuts__button[columns='6'] {\n min-width: calc(16.66% - 8px);\n }\n .mmp-shortcuts__button > div > span {\n line-height: calc(var(--mmp-unit) * .6);\n text-transform: initial;\n }\n .mmp-shortcuts__button > div > ha-icon {\n width: calc(var(--mmp-unit) * .6);\n height: calc(var(--mmp-unit) * .6);\n }\n .mmp-shortcuts__button > div > *:nth-child(2) {\n margin-left: 4px;\n }\n .mmp-shortcuts__button > div > img {\n height: 24px;\n }\n "]);return $=function(){return a},a}function _(){var a=Ba(["\n ","\n ","\n "]);return _=function(){return a},a}function aa(){var a=Ba(["",""]);return aa=function(){return a},a}function ba(){var a=Ba([""]);return ba=function(){return a},a}function ca(){var a=Ba([""]);return ca=function(){return a},a}function da(){var a=Ba(["\n \n
\n ","\n ","\n ","\n
\n "]);return da=function(){return a},a}function ea(){var a=Ba(["\n
\n ","\n
\n "]);return ea=function(){return a},a}function fa(){var a=Ba(["\n \n \n "]);return fa=function(){return a},a}function ga(){var a=Ba([""]);return ga=function(){return a},a}function ha(){var a=Ba(["\n :host {\n display: block;\n }\n :host([faded]) {\n opacity: .75;\n }\n :host[small] .mmp-dropdown__label {\n max-width: 60px;\n display: block;\n position: relative;\n width: auto;\n text-transform: initial;\n }\n :host[full] .mmp-dropdown__label {\n max-width: none;\n }\n .mmp-dropdown {\n padding: 0;\n display: block;\n }\n .mmp-dropdown__button {\n display: flex;\n font-size: 1em;\n justify-content: space-between;\n align-items: center;\n height: calc(var(--mmp-unit) - 4px);\n margin: 2px 0;\n }\n .mmp-dropdown__button.icon {\n height: var(--mmp-unit);\n margin: 0;\n }\n .mmp-dropdown__button > div {\n display: flex;\n flex: 1;\n justify-content: space-between;\n align-items: center;\n height: calc(var(--mmp-unit) - 4px);\n max-width: 100%;\n }\n .mmp-dropdown__label {\n text-align: left;\n text-transform: none;\n }\n .mmp-dropdown__icon {\n height: calc(var(--mmp-unit) * .6);\n width: calc(var(--mmp-unit) * .6);\n min-width: calc(var(--mmp-unit) * .6);\n }\n paper-item > *:nth-child(2) {\n margin-left: 4px;\n }\n paper-menu-button[focused] mmp-button ha-icon {\n color: var(--mmp-accent-color);\n transform: rotate(180deg);\n }\n paper-menu-button[focused] ha-icon-button {\n color: var(--mmp-accent-color);\n transform: rotate(180deg);\n }\n paper-menu-button[focused] ha-icon-button[focused] {\n color: var(--mmp-text-color);\n transform: rotate(0deg);\n }\n "]);return ha=function(){return a},a}function ia(){var a=Ba(["",""]);return ia=function(){return a},a}function ja(){var a=Ba([""]);return ja=function(){return a},a}function ka(){var a=Ba(["\n \n ","\n ","\n "]);return ka=function(){return a},a}function la(){var a=Ba(["\n \n
\n \n ","\n \n \n
\n
\n "]);return la=function(){return a},a}function ma(){var a=Ba(["\n \n \n "]);return ma=function(){return a},a}function na(){var a=Ba(["\n \n ","\n \n ","\n \n \n "]);return na=function(){return a},a}function oa(){var a=Ba(["\n .mmp-group-list {\n display: flex;\n flex-direction: column;\n margin-left: 8px;\n margin-bottom: 8px;\n }\n .mmp-group-list__title {\n font-weight: 500;\n letter-spacing: .1em;\n margin: 8px 0 4px;\n text-transform: uppercase;\n }\n .mmp-group-list__buttons {\n display: flex;\n }\n mmp-button {\n margin: 8px 8px 0 0;\n min-width: 0;\n text-transform: uppercase;\n text-align: center;\n width: 50%;\n --mdc-theme-primary: transparent;\n }\n "]);return oa=function(){return a},a}function pa(){var a=Ba(["\n "]);return pa=function(){return a},a}function qa(){var a=Ba([""]);return qa=function(){return a},a}function ra(){var a=Ba(["\n \n Ungroup\n \n "]);return ra=function(){return a},a}function sa(){var a=Ba(["\n
\n Group speakers\n ","\n
\n \n Leave\n \n ","\n \n Group all\n \n
\n
\n "]);return sa=function(){return a},a}function ta(){var a=Ba([""]);return ta=function(){return a},a}function ua(){var a=Ba(["\n :host {\n position: relative;\n box-sizing: border-box;\n margin: 4px;\n min-width: 0;\n overflow: hidden;\n transition: background .5s;\n border-radius: 4px;\n font-weight: 500;\n }\n :host([raised]) {\n background: var(--mmp-button-color);\n min-height: calc(var(--mmp-unit) * .8);\n box-shadow:\n 0px 3px 1px -2px rgba(0, 0, 0, 0.2),\n 0px 2px 2px 0px rgba(0, 0, 0, 0.14),\n 0px 1px 5px 0px rgba(0,0,0,.12);\n }\n :host([color]) {\n background: var(--mmp-active-color);\n transition: background .25s;\n opacity: 1;\n }\n :host([faded]) {\n opacity: .75;\n }\n :host([disabled]) {\n opacity: .25;\n pointer-events: none;\n }\n .container {\n height: 100%;\n width: 100%;\n }\n .slot-container {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 8px;\n width: auto;\n }\n paper-ripple {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n }\n "]);return ua=function(){return a},a}function va(){var a=Ba(["\n
\n
\n \n
\n \n
\n "]);return va=function(){return a},a}function wa(){var a=Ba(["\n paper-checkbox {\n padding: 8px 0;\n }\n paper-checkbox > span {\n font-weight: 600;\n }\n\n ha-card[artwork*='cover'][has-artwork] paper-checkbox[disabled] {\n --paper-checkbox-checkmark-color: rgba(0,0,0,.5);\n }\n ha-card[artwork*='cover'][has-artwork] paper-checkbox {\n --paper-checkbox-unchecked-color: #FFFFFF;\n --paper-checkbox-label-color: #FFFFFF;\n }\n "]);return wa=function(){return a},a}function xa(){var a=Ba(["(master)"]);return xa=function(){return a},a}function ya(){var a=Ba(["\n \n ","\n ","\n \n "]);return ya=function(){return a},a}function za(){var a=Ba(["\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .label {\n margin: 0 8px;\n }\n ha-icon {\n width: calc(var(--mmp-unit) * .6);\n height: calc(var(--mmp-unit) * .6);\n }\n ha-icon-button {\n width: var(--mmp-unit);\n height: var(--mmp-unit);\n color: var(--mmp-text-color, var(--primary-text-color));\n transition: color .25s;\n }\n ha-icon-button[color] {\n color: var(--mmp-accent-color, var(--accent-color)) !important;\n opacity: 1 !important;\n }\n ha-icon-button[inactive] {\n opacity: .5;\n }\n"]);return za=function(){return a},a}function Aa(){var a=Ba(["\n :host {\n overflow: visible !important;\n display: block;\n --mmp-scale: var(--mini-media-player-scale, 1);\n --mmp-unit: calc(var(--mmp-scale) * 40px);\n --mmp-name-font-weight: var(--mini-media-player-name-font-weight, 400);\n --mmp-accent-color: var(--mini-media-player-accent-color, var(--accent-color, #f39c12));\n --mmp-base-color: var(--mini-media-player-base-color, var(--primary-text-color, #000));\n --mmp-overlay-color: var(--mini-media-player-overlay-color, rgba(0,0,0,0.5));\n --mmp-overlay-color-stop: var(--mini-media-player-overlay-color-stop, 25%);\n --mmp-overlay-base-color: var(--mini-media-player-overlay-base-color, #fff);\n --mmp-overlay-accent-color: var(--mini-media-player-overlay-accent-color, --mmp-accent-color);\n --mmp-text-color: var(--mini-media-player-base-color, var(--primary-text-color, #000));\n --mmp-media-cover-info-color: var(--mini-media-player-media-cover-info-color, --mmp-text-color);\n --mmp-text-color-inverted: var(--disabled-text-color);\n --mmp-active-color: var(--mmp-accent-color);\n --mmp-button-color: var(--mini-media-player-button-color, rgba(255,255,255,0.25));\n --mmp-icon-color:\n var(--mini-media-player-icon-color,\n var(--mini-media-player-base-color,\n var(--paper-item-icon-color, #44739e)));\n --mmp-icon-active-color: var(--paper-item-icon-active-color, --mmp-active-color);\n --mmp-info-opacity: 1;\n --mmp-bg-opacity: var(--mini-media-player-background-opacity, 1);\n --mmp-artwork-opacity: var(--mini-media-player-artwork-opacity, 1);\n --mmp-progress-height: var(--mini-media-player-progress-height, 6px);\n --mdc-theme-primary: var(--mmp-text-color);\n --mdc-theme-on-primary: var(--mmp-text-color);\n --paper-checkbox-unchecked-color: var(--mmp-text-color);\n --paper-checkbox-label-color: var(--mmp-text-color);\n color: var(--mmp-text-color);\n }\n ha-card.--bg {\n --mmp-info-opacity: .75;\n }\n ha-card.--has-artwork[artwork*='cover'] {\n --mmp-accent-color: var(--mini-media-player-overlay-accent-color, var(--mini-media-player-accent-color, var(--accent-color, #f39c12)));\n --mmp-text-color: var(--mmp-overlay-base-color);\n --mmp-text-color-inverted: #000;\n --mmp-active-color: rgba(255,255,255,.5);\n --mmp-icon-color: var(--mmp-text-color);\n --mmp-icon-active-color: var(--mmp-text-color);\n --mmp-info-opacity: .75;\n --paper-slider-container-color: var(--mini-media-player-overlay-color, rgba(255,255,255,.75));\n --mdc-theme-primary: var(--mmp-text-color);\n --mdc-theme-on-primary: var(--mmp-text-color);\n --paper-checkbox-unchecked-color: var(--mmp-text-color);\n --paper-checkbox-label-color: var(--mmp-text-color);\n color: var(--mmp-text-color);\n }\n ha-card {\n cursor: default;\n display: flex;\n background: transparent;\n overflow: visible;\n padding: 0;\n position: relative;\n color: inherit;\n font-size: calc(var(--mmp-unit) * 0.35);\n --mdc-icon-button-size: calc(var(--mmp-unit));\n --mdc-icon-size: calc(var(--mmp-unit) * 0.6);\n }\n ha-card.--group {\n box-shadow: none;\n --mmp-progress-height: var(--mini-media-player-progress-height, 4px);\n }\n ha-card.--more-info {\n cursor: pointer;\n }\n .mmp__bg, .mmp-player, .mmp__container {\n border-radius: var(--ha-card-border-radius, 0);\n }\n .mmp__container {\n overflow: hidden;\n height: 100%;\n width: 100%;\n position: absolute;\n pointer-events: none;\n }\n ha-card:before {\n content: '';\n padding-top: 0px;\n transition: padding-top .5s cubic-bezier(.21,.61,.35,1);\n will-change: padding-top;\n }\n ha-card.--initial .entity__artwork,\n ha-card.--initial .entity__icon {\n animation-duration: .001s;\n }\n ha-card.--initial:before,\n ha-card.--initial .mmp-player {\n transition: none;\n }\n header {\n display: none;\n }\n ha-card[artwork='full-cover'].--has-artwork:before {\n padding-top: 56%;\n }\n ha-card[artwork='full-cover'].--has-artwork[content='music']:before,\n ha-card[artwork='full-cover-fit'].--has-artwork:before {\n padding-top: 100%;\n }\n .mmp__bg {\n background: var(--ha-card-background, var(--paper-card-background-color, white));\n position: absolute;\n top: 0; right: 0; bottom: 0; left: 0;\n overflow: hidden;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n opacity: var(--mmp-bg-opacity);\n }\n ha-card[artwork*='cover'].--has-artwork .mmp__bg {\n opacity: var(--mmp-artwork-opacity);\n background: transparent;\n }\n ha-card.--group .mmp__bg {\n background: transparent;\n }\n .cover,\n .cover:before {\n display: block;\n opacity: 0;\n position: absolute;\n top: 0; right: 0; bottom: 0; left: 0;\n transition: opacity .75s cubic-bezier(.21,.61,.35,1);\n will-change: opacity;\n }\n .cover {\n animation: fade-in .5s cubic-bezier(.21,.61,.35,1);\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center center;\n border-radius: var(--ha-card-border-radius, 0);\n overflow: hidden;\n }\n .cover:before {\n background: var(--mmp-overlay-color);\n content: '';\n }\n ha-card[artwork*='full-cover'].--has-artwork .mmp-player {\n background: linear-gradient(to top, var(--mmp-overlay-color) var(--mmp-overlay-color-stop), transparent 100%);\n border-bottom-left-radius: var(--ha-card-border-radius, 0);\n border-bottom-right-radius: var(--ha-card-border-radius, 0);\n }\n ha-card.--has-artwork .cover,\n ha-card.--has-artwork[artwork='cover'] .cover:before,\n ha-card.--bg .cover {\n opacity: .999;\n }\n ha-card[artwork='default'] .cover {\n display: none;\n }\n ha-card.--bg .cover {\n display: block;\n }\n ha-card[artwork='full-cover-fit'].--has-artwork .cover {\n background-color: black;\n background-size: contain;\n }\n .mmp-player {\n align-self: flex-end;\n box-sizing: border-box;\n position: relative;\n padding: 16px;\n transition: padding .25s ease-out;\n width: 100%;\n will-change: padding;\n }\n ha-card.--group .mmp-player {\n padding: 2px 0;\n }\n .flex {\n display: flex;\n display: -ms-flexbox;\n display: -webkit-flex;\n flex-direction: row;\n }\n .mmp-player__core {\n position: relative;\n }\n .entity__info {\n justify-content: center;\n display: flex;\n flex-direction: column;\n margin-left: 8px;\n position: relative;\n overflow: hidden;\n user-select: none;\n }\n ha-card.--rtl .entity__info {\n margin-left: auto;\n margin-right: calc(var(--mmp-unit) / 5);\n }\n ha-card[content='movie'] .attr__media_season,\n ha-card[content='movie'] .attr__media_episode {\n display: none;\n }\n .entity__icon {\n color: var(--mmp-icon-color);\n }\n .entity__icon[color] {\n color: var(--mmp-icon-active-color);\n }\n .entity__artwork, .entity__icon {\n animation: fade-in .25s ease-out;\n background-position: center center;\n background-repeat: no-repeat;\n background-size: cover;\n border-radius: 100%;\n height: var(--mmp-unit);\n width: var(--mmp-unit);\n min-width: var(--mmp-unit);\n line-height: var(--mmp-unit);\n margin-right: calc(var(--mmp-unit) / 5);\n position: relative;\n text-align: center;\n will-change: border-color;\n transition: border-color .25s ease-out;\n }\n ha-card.--rtl .entity__artwork,\n ha-card.--rtl .entity__icon {\n margin-right: auto;\n }\n .entity__artwork[border] {\n border: 2px solid var(--primary-text-color);\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n }\n .entity__artwork[border][state='playing'] {\n border-color: var(--mmp-accent-color);\n }\n .entity__info__name,\n .entity__info__media[short] {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .entity__info__name {\n line-height: calc(var(--mmp-unit) / 2);\n color: var(--mmp-text-color);\n font-weight: var(--mmp-name-font-weight);\n }\n .entity__info__media {\n color: var(--secondary-text-color);\n max-height: 6em;\n word-break: break-word;\n opacity: var(--mmp-info-opacity);\n transition: color .5s;\n }\n .entity__info__media[short] {\n max-height: calc(var(--mmp-unit) / 2);\n overflow: hidden;\n }\n .attr__app_name {\n display: none;\n }\n .attr__app_name:first-child,\n .attr__app_name:first-of-type {\n display: inline;\n }\n .mmp-player__core[inactive] .entity__info__media {\n color: var(--mmp-text-color);\n max-width: 200px;\n opacity: .5;\n }\n .entity__info__media[short-scroll] {\n max-height: calc(var(--mmp-unit) / 2);\n white-space: nowrap;\n }\n .entity__info__media[scroll] > span {\n visibility: hidden;\n }\n .entity__info__media[scroll] > div {\n animation: move linear infinite;\n }\n .entity__info__media[scroll] .marquee {\n animation: slide linear infinite;\n }\n .entity__info__media[scroll] .marquee,\n .entity__info__media[scroll] > div {\n animation-duration: inherit;\n visibility: visible;\n }\n .entity__info__media[scroll] {\n animation-duration: 10s;\n mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);\n -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);\n }\n .marquee {\n visibility: hidden;\n position: absolute;\n white-space: nowrap;\n }\n ha-card[artwork*='cover'].--has-artwork .entity__info__media,\n ha-card.--bg .entity__info__media {\n color: var(--mmp-media-cover-info-color);\n }\n .entity__info__media span:before {\n content: ' - ';\n }\n .entity__info__media span:first-of-type:before {\n content: '';\n }\n .entity__info__media span:empty {\n display: none;\n }\n .mmp-player__adds {\n margin-left: calc(var(--mmp-unit) * 1.2);\n position: relative;\n }\n ha-card.--rtl .mmp-player__adds {\n margin-left: auto;\n margin-right: calc(var(--mmp-unit) * 1.2);\n }\n .mmp-player__adds > *:nth-child(2) {\n margin-top: 0px;\n }\n mmp-powerstrip {\n flex: 1;\n justify-content: flex-end;\n margin-right: 0;\n margin-left: auto;\n width: auto;\n max-width: 100%;\n }\n mmp-media-controls {\n flex-wrap: wrap;\n }\n ha-card.--flow mmp-powerstrip {\n justify-content: space-between;\n margin-left: auto;\n }\n ha-card.--flow.--rtl mmp-powerstrip {\n margin-right: auto;\n }\n ha-card.--flow .entity__info {\n display: none;\n }\n ha-card.--responsive .mmp-player__adds {\n margin-left: 0;\n }\n ha-card.--responsive.--rtl .mmp-player__adds {\n margin-right: 0;\n }\n ha-card.--responsive .mmp-player__adds > mmp-media-controls {\n padding: 0;\n }\n ha-card.--progress .mmp-player {\n padding-bottom: calc(16px + calc(var(--mini-media-player-progress-height, 6px) - 6px));\n }\n ha-card.--progress.--group .mmp-player {\n padding-bottom: calc(10px + calc(var(--mini-media-player-progress-height, 6px) - 6px));\n }\n ha-card.--runtime .mmp-player {\n padding-bottom: calc(16px + 16px + var(--mini-media-player-progress-height, 0px));\n }\n ha-card.--runtime.--group .mmp-player {\n padding-bottom: calc(16px + 12px + var(--mini-media-player-progress-height, 0px));\n }\n ha-card.--inactive .mmp-player {\n padding: 16px;\n }\n ha-card.--inactive.--group .mmp-player {\n padding: 2px 0;\n }\n .mmp-player div:empty {\n display: none;\n }\n @keyframes slide {\n 100% { transform: translateX(-100%); }\n }\n @keyframes move {\n from { transform: translateX(100%); }\n to { transform: translateX(0); }\n }\n @keyframes fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n"]);return Aa=function(){return a},a}function Ba(a,b){return b||(b=a.slice(0)),Object.freeze(Object.defineProperties(a,{raw:{value:Object.freeze(b)}}))}function Ca(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function Da(a){for(var b,c=1;ca.parentNode.removeChild(a))}function Ca(a,b){var c=2"),Wa=new RegExp("".concat(Ua,"|").concat(Va)),Xa="$lit$";class Ya{constructor(a,b){this.parts=[],this.element=b;for(var c,d=[],e=[],f=document.createTreeWalker(b.content,133,null,!1),g=0,h=-1,j=0,{strings:k,values:{length:l}}=a;j{var c=a.length-b.length;return 0<=c&&a.slice(c)===b},$a=a=>-1!==a.index,ab=()=>document.createComment(""),bb=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,cb=a=>{for(var b=11===a.nodeType?0:1,c=document.createTreeWalker(a,133,null,!1);c.nextNode();)b++;return b},db=function(a){for(var b,c=1function(){var b=a(...arguments);return eb.set(b,!0),b},gb=a=>"function"==typeof a&&eb.has(a),hb={},ib={};class jb{constructor(a,b,c){this.__parts=[],this.template=a,this.processor=b,this.options=c}update(a){var b=0;for(var c of this.__parts)void 0!==c&&c.setValue(a[b]),b++;for(var d of this.__parts)void 0!==d&&d.commit()}_clone(){for(var a,b=Sa?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),c=[],d=this.template.parts,e=document.createTreeWalker(b,133,null,!1),f=0,g=0,h=e.nextNode();f",f+1);var g=bb.exec(e);b+=null===g?e+(c?kb:Va):e.substr(0,g.index)+g[1]+g[2]+Xa+g[3]+Ua}return b+=this.strings[a],b}getTemplateElement(){var a=document.createElement("template");return a.innerHTML=this.getHTML(),a}}var mb=a=>null===a||"object"!=typeof a&&"function"!=typeof a,nb=a=>Array.isArray(a)||!!(a&&a[Symbol.iterator]);class ob{constructor(a,b,c){this.dirty=!0,this.element=a,this.name=b,this.strings=c,this.parts=[];for(var d=0;d{try{var a={get capture(){return ub=!0,!1}};window.addEventListener("test",a,a),window.removeEventListener("test",a,a)}catch(a){}})();class vb{constructor(a,b,c){this.value=void 0,this.__pendingValue=void 0,this.element=a,this.eventName=b,this.eventContext=c,this.__boundHandleEvent=a=>this.handleEvent(a)}setValue(a){this.__pendingValue=a}commit(){for(;gb(this.__pendingValue);){var d=this.__pendingValue;this.__pendingValue=hb,d(this)}if(this.__pendingValue!==hb){var a=this.__pendingValue,b=this.value,c=null==a||null!=b&&(a.capture!==b.capture||a.once!==b.once||a.passive!==b.passive);c&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),null!=a&&(null==b||c)&&(this.__options=wb(a),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=a,this.__pendingValue=hb}}handleEvent(a){"function"==typeof this.value?this.value.call(this.eventContext||this.element,a):this.value.handleEvent(a)}}var wb=a=>a&&(ub?{capture:a.capture,passive:a.passive,once:a.once}:a.capture),xb=new Map,yb=new WeakMap,zb=(a,b,c)=>{var d=yb.get(b);d===void 0&&(Ta(b,b.firstChild),yb.set(b,d=new qb(Object.assign({templateFactory:Ea},c))),d.appendInto(b)),d.setValue(a),d.commit()};var Ab=new class a{handleAttributeExpressions(a,b,c,d){var e=b[0];if("."===e){var g=new sb(a,b.slice(1),c);return g.parts}if("@"===e)return[new vb(a,b.slice(1),d.eventContext)];if("?"===e)return[new rb(a,b.slice(1),c)];var f=new ob(a,b,c);return f.parts}handleTextExpression(a){return new qb(a)}};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.2.1");var Bb=function(a){for(var b=arguments.length,c=Array(1"".concat(a,"--").concat(b),Db=!0;"undefined"==typeof window.ShadyCSS?Db=!1:"undefined"==typeof window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),Db=!1);var Eb,Fb=a=>b=>{var c=Cb(b.type,a),d=xb.get(c);void 0===d&&(d={stringsArray:new WeakMap,keyString:new Map},xb.set(c,d));var e=d.stringsArray.get(b.strings);if(void 0!==e)return e;var f=b.strings.join(Ua);if(e=d.keyString.get(f),void 0===e){var g=b.getTemplateElement();Db&&window.ShadyCSS.prepareTemplateDom(g,a),e=new Ya(b,g),d.keyString.set(f,e)}return d.stringsArray.set(b.strings,e),e},Gb=["html","svg"],Hb=a=>{Gb.forEach(b=>{var c=xb.get(Cb(b,a));c!==void 0&&c.keyString.forEach(a=>{var{element:{content:b}}=a,c=new Set;Array.from(b.querySelectorAll("style")).forEach(a=>{c.add(a)}),Ba(a,c)})})},Ib=new Set,Jb=(a,b,c)=>{Ib.add(a);var d=!c?document.createElement("template"):c.element,e=b.querySelectorAll("style"),{length:f}=e;if(0===f)return void window.ShadyCSS.prepareTemplateStyles(d,a);for(var g,h=document.createElement("style"),j=0;j{if(!c||"object"!=typeof c||!c.scopeName)throw new Error("The `scopeName` option is required.");var d=c.scopeName,e=yb.has(b),f=Db&&11===b.nodeType&&!!b.host,g=f&&!Ib.has(d),h=g?document.createDocumentFragment():b;if(zb(a,h,Object.assign({templateFactory:Fb(d)},c)),g){var i=yb.get(h);yb.delete(h);var j=i.value instanceof jb?i.value.template:void 0;Jb(d,h,j),Ta(b,b.firstChild),b.appendChild(h),yb.set(b,i)}!e&&f&&window.ShadyCSS.styleElement(b.host)};window.JSCompiler_renameProperty=a=>a;var Lb={toAttribute(a,b){return b===Boolean?a?"":null:b===Object||b===Array?null==a?a:JSON.stringify(a):a},fromAttribute(a,b){return b===Boolean?null!==a:b===Number?null===a?null:+a:b===Object||b===Array?JSON.parse(a):a}},Mb=(a,b)=>b!==a&&(b===b||a===a),Nb={attribute:!0,type:String,converter:Lb,reflect:!1,hasChanged:Mb},Ob=1,Pb=4,Qb=8,Rb=16,Sb="finalized";class Tb extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=new Promise(a=>this._enableUpdatingResolver=a),this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();var a=[];return this._classProperties.forEach((b,c)=>{var d=this._attributeNameForProperty(c,b);void 0!==d&&(this._attributeToPropertyMap.set(d,c),a.push(d))}),a}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;var a=Object.getPrototypeOf(this)._classProperties;a!==void 0&&a.forEach((a,b)=>this._classProperties.set(b,a))}}static createProperty(a){var b=1{if(this.hasOwnProperty(b)){var c=this[b];delete this[b],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(b,c)}})}_applyInstanceProperties(){this._instanceProperties.forEach((a,b)=>this[b]=a),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){this._enableUpdatingResolver!==void 0&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(a,b,c){b!==c&&this._attributeToProperty(a,c)}_propertyToAttribute(a,b){var c=2this._propertyToAttribute(b,this[b],a)),this._reflectingProperties=void 0),this._markUpdated()}updated(){}firstUpdated(){}}Eb=Sb,Tb[Eb]=!0;var Ub="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Vb=Symbol();class Wb{constructor(a,b){if(b!==Vb)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=a}get styleSheet(){return void 0===this._styleSheet&&(Ub?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}var Xb=a=>{if(a instanceof Wb)return a.cssText;if("number"==typeof a)return a;throw new Error("Value passed to 'css' function must be a 'css' function result: ".concat(a,". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security."))},Yb=function(a){for(var b=arguments.length,c=Array(1b+Xb(c)+a[d+1],a[0]);return new Wb(e,Vb)};(window.litElementVersions||(window.litElementVersions=[])).push("2.3.1");var Zb={};class $b extends Tb{static getStyles(){return this.styles}static _getUniqueStyles(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_styles",this))){var a=this.getStyles();if(void 0===a)this._styles=[];else if(Array.isArray(a)){var b=(a,c)=>a.reduceRight((a,c)=>Array.isArray(c)?b(c,a):(a.add(c),a),c),c=b(a,new Set),d=[];c.forEach(a=>d.unshift(a)),this._styles=d}else this._styles=[a]}}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){var a=this.constructor._styles;0===a.length||(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow?Ub?this.renderRoot.adoptedStyleSheets=a.map(a=>a.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(a.map(a=>a.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&window.ShadyCSS!==void 0&&window.ShadyCSS.styleElement(this)}update(a){var b=this.render();super.update(a),b!==Zb&&this.constructor.render(b,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(a=>{var b=document.createElement("style");b.textContent=a.cssText,this.renderRoot.appendChild(b)}))}render(){return Zb}}$b.finalized=!0,$b.render=Kb;class _b{constructor(a){this.classes=new Set,this.changed=!1,this.element=a;var b=(a.getAttribute("class")||"").split(/\s+/);for(var c of b)this.classes.add(c)}add(a){this.classes.add(a),this.changed=!0}remove(a){this.classes.delete(a),this.changed=!0}commit(){if(this.changed){var a="";this.classes.forEach(b=>a+=b+" "),this.element.setAttribute("class",a)}}}var ac=new WeakMap,bc=fb(a=>b=>{if(!(b instanceof pb)||b instanceof tb||"class"!==b.committer.name||1{b in a||(f.remove(b),e.delete(b))}),a){var h=a[g];h!=e.has(g)&&(h?(f.add(g),e.add(g)):(f.remove(g),e.delete(g)))}"function"==typeof f.commit&&f.commit()}),cc=new WeakMap,dc=fb(a=>b=>{if(!(b instanceof pb)||b instanceof tb||"style"!==b.committer.name||1{b in a||(e.delete(b),-1===b.indexOf("-")?d[b]=null:d.removeProperty(b))}),a)e.add(f),-1===f.indexOf("-")?d[f]=a[f]:d.setProperty(f,a[f])}),ec=function(){function a(a,b){var c=-1;return a.some(function(a,d){return a[0]===b&&(c=d,!0)}),c}return"undefined"==typeof Map?function(){function b(){this.__entries__=[]}return Object.defineProperty(b.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),b.prototype.get=function(b){var c=a(this.__entries__,b),d=this.__entries__[c];return d&&d[1]},b.prototype.set=function(b,c){var d=a(this.__entries__,b);~d?this.__entries__[d][1]=c:this.__entries__.push([b,c])},b.prototype.delete=function(b){var c=this.__entries__,d=a(c,b);~d&&c.splice(d,1)},b.prototype.has=function(b){return!!~a(this.__entries__,b)},b.prototype.clear=function(){this.__entries__.splice(0)},b.prototype.forEach=function(a,b){void 0===b&&(b=null);for(var c,d=0,e=this.__entries__;dDa({text:this.attr[a.attr],prefix:""},a)).filter(a=>a.text)}get hasProgress(){return!this.config.hide.progress&&!this.idle&&yc.every(a=>a in this.attr)}get progress(){return this.position+(Date.now()-new Date(this.updatedAt).getTime())/1e3}get idleView(){var a=this.config.idle_view;return!!(a.when_idle&&this.isIdle||a.when_standby&&this.isStandby||a.when_paused&&this.isPaused)||!!(this.updatedAt&&a.after&&!this.isPlaying)&&this.checkIdleAfter(a.after)}get trackIdle(){return this.active&&!this.isPlaying&&this.updatedAt&&this.config.idle_view&&this.config.idle_view.after}checkIdleAfter(a){var b=(Date.now()-new Date(this.updatedAt).getTime())/1e3;return this.idle=b>60*a,this.active=this.isActive,this.idle}get supportsShuffle(){return"undefined"!=typeof this.attr.shuffle}get supportsMute(){return"undefined"!=typeof this.attr.is_volume_muted}get supportsVolumeSet(){return"undefined"!=typeof this.attr.volume_level}get supportsMaster(){return this.platform!==Ac.SQUEEZEBOX}get artwork(){return"url(".concat(this.attr.entity_picture_local?this.hass.hassUrl(this.picture):this.picture,")")}getAttribute(a){return this.attr[a]||""}toggle(a){return this.config.toggle_power?this.callService(a,"toggle"):this.isOff?this.callService(a,"turn_on"):void this.callService(a,"turn_off")}toggleMute(a){this.config.speaker_group.sync_volume?this.group.forEach(b=>{this.callService(a,"volume_mute",{entity_id:b,is_volume_muted:!this.muted})}):this.callService(a,"volume_mute",{is_volume_muted:!this.muted})}toggleShuffle(a){this.callService(a,"shuffle_set",{shuffle:!this.shuffle})}setSource(a,b){this.callService(a,"select_source",{source:b})}setMedia(a,b){this.callService(a,"play_media",Da({},b))}playPause(a){this.callService(a,"media_play_pause")}playStop(a){this.isPlaying?this.callService(a,"media_stop"):this.callService(a,"media_play")}setSoundMode(a,b){this.callService(a,"select_sound_mode",{sound_mode:b})}next(a){this.callService(a,"media_next_track")}prev(a){this.callService(a,"media_previous_track")}stop(a){this.callService(a,"media_stop")}volumeUp(a){this.supportsVolumeSet&&0{var d=this.config.speaker_group.entities.find(a=>a.entity_id===c)||{},e=b;d.volume_offset&&(e+=d.volume_offset/100,1e&&(e=0)),this.callService(a,"volume_set",{entity_id:c,volume_level:e})}):this.callService(a,"volume_set",{entity_id:this.config.entity,volume_level:b})}handleGroupChange(a,b,c){var{platform:d}=this,e={entity_id:b};return c?(e.master=this.config.entity,d===Ac.SOUNDTOUCH?this.handleSoundtouch(a,this.isGrouped?"ADD_ZONE_SLAVE":"CREATE_ZONE",b):d===Ac.SQUEEZEBOX?this.callService(a,"sync",{entity_id:this.config.entity,other_player:b},Ac.SQUEEZEBOX):this.callService(a,"join",e,d)):d===Ac.SOUNDTOUCH?this.handleSoundtouch(a,"REMOVE_ZONE_SLAVE",b):d===Ac.SQUEEZEBOX?this.callService(a,"unsync",e,Ac.SQUEEZEBOX):this.callService(a,"unjoin",e,d)}handleSoundtouch(a,b,c){return this.callService(a,b,{master:this.master,slaves:c},Ac.SOUNDTOUCH,!0)}toggleScript(a,b){var c=2{var g;switch(d.action){case"more-info":{g=new Event("hass-more-info",{composed:!0}),g.detail={entityId:d.entity||f},a.dispatchEvent(g);break}case"navigate":{if(!d.navigation_path)return;window.history.pushState(null,"",d.navigation_path),g=new Event("location-changed",{composed:!0}),g.detail={replace:!1},window.dispatchEvent(g);break}case"call-service":{if(!d.service)return;var[h,i]=d.service.split(".",2),j=Da({},d.service_data);b.callService(h,i,j);break}case"url":{if(!d.url)return;window.location.href=d.url}}};class Fc extends $b{static get properties(){return{item:{},checked:Boolean,disabled:Boolean,master:Boolean}}render(){return Bb(ya(),this.checked,this.disabled,a=>a.stopPropagation(),this.handleClick,this.item.name,this.master?Bb(xa()):"")}handleClick(a){a.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:{entity:this.item.entity_id,checked:!this.checked}}))}static get styles(){return Yb(wa())}}customElements.define("mmp-group-item",Fc);class Gc extends $b{render(){return Bb(va())}static get styles(){return Yb(ua())}}customElements.define("mmp-button",Gc);class Hc extends $b{static get properties(){return{entities:{},player:{},visible:Boolean}}get group(){return this.player.group}get master(){return this.player.master}get isMaster(){return this.player.isMaster}get isGrouped(){return this.player.isGrouped}handleGroupChange(a){var{entity:b,checked:c}=a.detail;this.player.handleGroupChange(a,b,c)}render(){if(!this.visible)return Bb(ta());var{group:a,isMaster:b,isGrouped:c}=this,{id:d}=this.player;return Bb(sa(),this.entities.map(a=>this.renderItem(a,d)),!c,a=>this.player.handleGroupChange(a,d,!1),c&&b?Bb(ra(),b=>this.player.handleGroupChange(b,a,!1)):Bb(qa()),!b,a=>this.player.handleGroupChange(a,this.entities.map(a=>a.entity_id),!0))}renderItem(a,b){var c=a.entity_id;return Bb(pa(),this.handleGroupChange,a,c===b||this.group.includes(c),c===b||!this.isMaster,c===this.master)}static get styles(){return Yb(oa())}}customElements.define("mmp-group-list",Hc);class Ic extends $b{static get properties(){return{items:[],label:String,selected:String}}get selectedId(){return this.items.map(a=>a.id).indexOf(this.selected)}onChange(a){var b=a.target.selected;b!==this.selectedId&&this.items[b]&&(this.dispatchEvent(new CustomEvent("change",{detail:this.items[b]})),a.target.selected=-1)}render(){return Bb(na(),"right","top",44,!0,a=>a.stopPropagation(),this.icon?Bb(ma(),wc.DROPDOWN):Bb(la(),this.selected||this.label,wc.DROPDOWN),this.selectedId,this.onChange,this.items.map(a=>Bb(ka(),a.id||a.name,a.icon?Bb(ja(),a.icon):"",a.name?Bb(ia(),a.name):"")))}static get styles(){return[Dc,Yb(ha())]}}customElements.define("mmp-dropdown",Ic);class Jc extends $b{static get properties(){return{player:{},shortcuts:{}}}get buttons(){return this.shortcuts.buttons}get list(){return this.shortcuts.list}get show(){return!this.shortcuts.hide_when_off||this.player.active}get active(){return this.player.getAttribute(this.shortcuts.attribute)}get height(){return this.shortcuts.column_height||36}render(){if(!this.show)return Bb(ga());var{active:a}=this,b=this.list?Bb(fa(),this.handleShortcut,this.list,this.shortcuts.label,a):"",c=this.buttons?Bb(ea(),this.buttons.map(b=>Bb(da(),dc(this.shortcutStyle(b)),this.shortcuts.columns,b.id===a,a=>this.handleShortcut(a,b),this.shortcuts.align_text,b.icon?Bb(ca(),b.icon):"",b.image?Bb(ba(),b.image):"",b.name?Bb(aa(),b.name):""))):"";return Bb(_(),c,b)}handleShortcut(a,b){var{type:c,id:d,data:e}=b||a.detail;if("source"===c)return this.player.setSource(a,d);if("service"===c)return this.player.toggleService(a,d,e);if("script"===c)return this.player.toggleScript(a,d,e);if("sound_mode"===c)return this.player.setSoundMode(a,d);this.player.setMedia(a,{media_content_type:c,media_content_id:d})}shortcutStyle(a){return Da({"min-height":"".concat(this.height,"px")},a.cover&&{"background-image":"url(".concat(a.cover,")")})}static get styles(){return[Dc,Yb($())]}}customElements.define("mmp-shortcuts",Jc);var Kc=function(a,b){var c=2a.stopPropagation(),this.handleTts)}handleTts(a){var{config:b,message:c}=this,d=Da({message:c,entity_id:b.entity_id||this.player.id},"group"===b.entity_id&&{entity_id:this.player.group});b.language&&(d.language=b.language),"alexa"===b.platform?this.hass.callService("notify","alexa_media",{message:c,data:{type:b.type||"tts"},target:d.entity_id}):"sonos"===b.platform?this.hass.callService("script","sonos_say",{sonos_entity:d.entity_id,volume:b.volume||.5,message:c}):"webos"===b.platform?this.hass.callService("notify",d.entity_id.split(".").slice(-1)[0],{message:c}):"ga"===b.platform?this.hass.callService("notify","ga_broadcast",{message:c}):this.hass.callService("tts","".concat(b.platform,"_say"),d),a.stopPropagation(),this.reset()}reset(){this.input.value=""}static get styles(){return Yb(Y())}}customElements.define("mmp-tts",Lc);var Mc=a=>{var b=parseInt(a%60,10),c=parseInt(a/60%60,10),d=parseInt(a/3600%24,10);return d=10>d?"0".concat(d):d,c=10>c?"0".concat(c):c,b=10>b?"0".concat(b):b,"".concat("00"===d?"":"".concat(d,":")).concat(c,":").concat(b)};class Nc extends $b{static get properties(){return{_player:{},showTime:Boolean,progress:Number,duration:Number,tracker:{},seekProgress:Number,seekWidth:Number,track:Boolean}}set player(a){this._player=a,this.hasProgress&&this.trackProgress()}get duration(){return this.player.mediaDuration}get player(){return this._player}get hasProgress(){return this.player.hasProgress}get width(){return this.shadowRoot.querySelector(".mmp-progress").offsetWidth}get offset(){return this.getBoundingClientRect().left}get classes(){return bc({transiting:!this.seekProgress,seeking:this.seekProgress})}render(){return Bb(X(),this.initSeek,this.handleSeek,this.initSeek,this.handleSeek,this.resetSeek,a=>a.stopPropagation(),!this.player.isPlaying,this.showTime?Bb(W(),Mc(this.seekProgress||this.progress),Mc(this.duration)):"",this.classes,this.seekProgress||this.progress,this.duration)}trackProgress(){this.progress=this.player.progress,this.tracker||(this.tracker=setInterval(()=>this.trackProgress(),1e3)),this.player.isPlaying||(clearInterval(this.tracker),this.tracker=null)}initSeek(a){var b=a.offsetX||a.touches[0].pageX-this.offset;this.seekWidth=this.width,this.seekProgress=this.calcProgress(b),this.addEventListener("touchmove",this.moveSeek),this.addEventListener("mousemove",this.moveSeek)}resetSeek(){this.seekProgress=null,this.removeEventListener("touchmove",this.moveSeek),this.removeEventListener("mousemove",this.moveSeek)}moveSeek(a){a.preventDefault();var b=a.offsetX||a.touches[0].pageX-this.offset;this.seekProgress=this.calcProgress(b)}handleSeek(a){this.resetSeek();var b=a.offsetX||a.changedTouches[0].pageX-this.offset,c=this.calcProgress(b);this.player.seek(a,c)}disconnectedCallback(){super.disconnectedCallback(),this.resetSeek(),clearInterval(this.tracker),this.tracker=null}connectedCallback(){super.connectedCallback(),this.hasProgress&&this.trackProgress()}calcProgress(a){var b=a/this.seekWidth*this.duration;return Ra(Qa(b,.1),this.duration)}static get styles(){return Yb(V())}}customElements.define("mmp-progress",Nc);class Oc extends $b{static get properties(){return{player:{},icon:Boolean}}get source(){return this.player.source}get sources(){return this.player.sources.map(a=>({name:a,id:a,type:"source"}))}render(){return Bb(U(),this.handleSource,this.sources,this.source,this.source,this.icon)}handleSource(a){var{id:b}=a.detail;this.player.setSource(a,b)}static get styles(){return Yb(T())}}customElements.define("mmp-source-menu",Oc);class Pc extends $b{static get properties(){return{player:{},selected:String,icon:Boolean}}get mode(){return this.player.soundMode}get modes(){return this.player.soundModes.map(a=>({name:a,id:a,type:"soundMode"}))}render(){return Bb(S(),this.handleChange,this.modes,this.mode,this.selected||this.mode,this.icon)}handleChange(a){var{id:b}=a.detail;this.player.setSoundMode(a,b),this.selected=b}static get styles(){return Yb(R())}}customElements.define("mmp-sound-menu",Pc);class Qc extends $b{static get properties(){return{player:{},config:{},break:Boolean}}get showShuffle(){return!this.config.hide.shuffle&&this.player.supportsShuffle}get maxVol(){return this.config.max_volume||100}get minVol(){return this.config.min_volume||0}render(){var{hide:a}=this.config;return Bb(Q(),a.volume?Bb(P()):this.renderVolControls(this.player.muted),this.showShuffle?Bb(O(),a=>this.player.toggleShuffle(a),wc.SHUFFLE,this.player.shuffle):Bb(N()),a.controls?Bb(J()):Bb(M(),this.config.flow||this.break,a.prev?"":Bb(L(),a=>this.player.prev(a),wc.PREV),this.renderPlayButtons(),a.next?"":Bb(K(),a=>this.player.next(a),wc.NEXT)))}renderVolControls(a){return this.config.volume_stateless?this.renderVolButtons(a):this.renderVolSlider(a)}renderVolSlider(a){return Bb(I(),this.renderMuteButton(a),this.handleVolumeChange,a=>a.stopPropagation(),a,this.minVol,this.maxVol,100*this.player.vol,"ltr")}renderVolButtons(a){return Bb(H(),this.renderMuteButton(a),a=>this.player.volumeDown(a),wc.VOL_DOWN,a=>this.player.volumeUp(a),wc.VOL_UP)}renderMuteButton(a){if(!this.config.hide.mute)switch(this.config.replace_mute){case"play":case"play_pause":return Bb(G(),a=>this.player.playPause(a),wc.PLAY[this.player.isPlaying]);case"stop":return Bb(F(),a=>this.player.stop(a),wc.STOP.true);case"play_stop":return Bb(E(),a=>this.player.playStop(a),wc.STOP[this.player.isPlaying]);case"next":return Bb(D(),a=>this.player.next(a),wc.NEXT);default:return this.player.supportsMute?Bb(C(),a=>this.player.toggleMute(a),wc.MUTE[a]):void 0;}}renderPlayButtons(){var{hide:a}=this.config;return Bb(B(),a.play_pause?Bb(z()):Bb(A(),a=>this.player.playPause(a),wc.PLAY[this.player.isPlaying]),a.play_stop?Bb(x()):Bb(y(),a=>this.handleStop(a),a.play_pause?wc.STOP[this.player.isPlaying]:wc.STOP.true))}handleStop(a){return this.config.hide.play_pause?this.player.playStop(a):this.player.stop(a)}handleVolumeChange(a){var b=parseFloat(a.target.value)/100;this.player.setVolume(a,b)}static get styles(){return[Dc,Yb(w())]}}customElements.define("mmp-media-controls",Qc);class Rc extends $b{static get properties(){return{hass:{},player:{},config:{},groupVisible:Boolean,idle:Boolean}}get icon(){return this.config.speaker_group.icon||wc.GROUP}get showGroupButton(){return this.config.speaker_group.entities}get showPowerButton(){return!this.config.hide.power}get powerColor(){return this.player.active&&!this.config.hide.power_state}get sourceSize(){return"icon"===this.config.source||this.hasControls||this.idle}get soundSize(){return"icon"===this.config.sound_mode||this.hasControls||this.idle}get hasControls(){return this.player.active&&this.config.hide.controls!==this.config.hide.volume}get hasSource(){return 0this.player.toggle(a),this.powerColor):"")}handleGroupClick(a){a.stopPropagation(),this.dispatchEvent(new CustomEvent("toggleGroupList"))}get renderIdleView(){return this.player.isPaused?Bb(o(),wc.PLAY[this.player.isPlaying],a=>this.player.playPause(a)):Bb(n(),Kc(this.hass,"state.media_player.idle","Idle"))}static get styles(){return[Dc,Yb(m())]}}customElements.define("mmp-powerstrip",Rc),customElements.get("ha-slider")||customElements.define("ha-slider",class extends customElements.get("paper-slider"){}),customElements.get("ha-icon-button")||customElements.define("ha-icon-button",class extends customElements.get("paper-icon-button"){}),customElements.get("ha-icon")||customElements.define("ha-icon",class extends customElements.get("iron-icon"){});class Sc extends $b{constructor(){super(),this._overflow=!1,this.initial=!0,this.picture=!1,this.thumbnail=!1,this.edit=!1,this.rtl=!1}static get properties(){return{_hass:{},config:{},entity:{},player:{},_overflow:Boolean,break:Boolean,initial:Boolean,picture:String,thumbnail:String,edit:Boolean,rtl:Boolean,idle:Boolean}}static get styles(){return[Dc,Cc]}set hass(a){if(a){var b=a.states[this.config.entity];this._hass=a,b&&this.entity!==b&&(this.entity=b,this.player=new Bc(a,this.config,b),this.rtl=this.computeRTL(a),this.idle=this.player.idle,this.player.trackIdle&&this.updateIdleStatus())}}get hass(){return this._hass}set overflow(a){this._overflow!==a&&(this._overflow=a)}get overflow(){return this._overflow}get name(){return this.config.name||this.player.name}setConfig(a){if(!a.entity||"media_player"!==a.entity.split(".")[0])throw new Error("Specify an entity from within the media_player domain.");var b=Da(Da({artwork:"default",info:"default",more_info:!0,source:"default",sound_mode:"default",toggle_power:!0,volume_step:null,tap_action:{action:"more-info"}},a),{},{hide:Da(Da({},vc),a.hide),speaker_group:Da(Da({show_group_count:!0,platform:"sonos"},a.sonos),a.speaker_group),shortcuts:Da({label:"Shortcuts..."},a.shortcuts)});b.max_volume=+b.max_volume||100,b.min_volume=+b.min_volume||0,b.collapse=b.hide.controls||b.hide.volume,b.info=b.collapse&&"scroll"!==b.info?"short":b.info,b.flow=b.hide.icon&&b.hide.name&&b.hide.info,this.config=b}shouldUpdate(a){return void 0===this.break&&this.computeRect(this),xc.some(b=>a.has(b))&&this.player}firstUpdated(){var a=new uc(a=>{a.forEach(a=>{window.requestAnimationFrame(()=>{"scroll"===this.config.info&&this.computeOverflow(),this._resizeTimer||(this.computeRect(a),this._resizeTimer=setTimeout(()=>{this._resizeTimer=null,this.computeRect(this._resizeEntry)},250)),this._resizeEntry=a})})});a.observe(this),setTimeout(()=>this.initial=!1,250),this.edit=this.config.speaker_group.expanded||!1}updated(){"scroll"===this.config.info&&setTimeout(()=>{this.computeOverflow()},10)}render(){var{config:a}=0this.handlePopup(a),a.artwork,this.player.content,this.renderArtwork(b),this.player.idle,this.renderIcon(b),this.renderEntityName(),this.renderMediaInfo(),this.toggleGroupList,this.hass,this.player,a,this.edit,this.idle,a.flow,!a.collapse&&this.player.active?Bb(k(),this.player,a,this.break):"",this.player,a.shortcuts,a.tts?Bb(j(),a.tts,this.hass,this.player):"",this.edit,a.speaker_group.entities,this.player,this.player.active&&this.player.hasProgress?Bb(i(),this.player,!this.config.hide.runtime):"")}renderArtwork(a){if(this.thumbnail||this.config.background){var b=this.config.background&&(!a||"default"===this.config.artwork)?"url(".concat(this.config.background,")"):this.thumbnail;return Bb(h(),b)}}handlePopup(a){a.stopPropagation(),Ec(this,this._hass,this.config,this.config.tap_action,this.player.id)}renderIcon(a){if(!this.config.hide.icon){if(this.player.active&&a&&"default"===this.config.artwork)return Bb(g(),this.thumbnail,!this.config.hide.artwork_border,this.player.state);var b=!this.config.hide.icon_state&&this.player.isActive;return Bb(f(),b,this.computeIcon())}}renderEntityName(){return this.config.hide.name?void 0:Bb(e(),this.name,this.speakerCount())}renderMediaInfo(){if(!this.config.hide.info){var e=this.player.mediaInfo;return Bb(d(),"short"===this.config.info||!this.player.active,"scroll"===this.config.info,this.overflow,this.overflow,"scroll"===this.config.info?Bb(c(),e.map(a=>Bb(b(),"attr__".concat(a.attr),a.prefix+a.text))):"",e.map(b=>Bb(a(),"attr__".concat(b.attr),b.prefix+b.text)))}}speakerCount(){if(this.config.speaker_group.show_group_count){var a=this.player.groupCount;return 1a.parentNode.clientWidth;this.overflow=!!(b&&this.player.active)&&7.5+a.clientWidth/50}}computeRect(a){var{left:b,width:c}=a.contentRect||a.getBoundingClientRect();this.break=c+2*b<390}computeRTL(a){var b=a.language||"en";return!!a.translationMetadata.translations[b]&&(a.translationMetadata.translations[b].isRTL||!1)}toggleGroupList(){this.edit=!this.edit}fire(a,b,c){var d=c||{},f=null===b||void 0===b?{}:b,g=new Event(a,{bubbles:void 0===d.bubbles||d.bubbles,cancelable:!!d.cancelable,composed:void 0===d.composed||d.composed});return g.detail=f,this.dispatchEvent(g),g}updateIdleStatus(){this._idleTracker&&clearTimeout(this._idleTracker);var a=(Date.now()-new Date(this.player.updatedAt).getTime())/1e3;this._idleTracker=setTimeout(()=>{this.idle=this.player.checkIdleAfter(this.config.idle_view.after),this.player.idle=this.idle,this._idleTracker=null},1e3*(60*this.config.idle_view.after-a))}getCardSize(){return this.config.collapse?1:2}}customElements.define("mini-media-player",Sc)})})(); diff --git a/www/custom_ui/room-glance-card.js b/www/custom_ui/room-glance-card.js index e1314e3..941bd2f 100644 --- a/www/custom_ui/room-glance-card.js +++ b/www/custom_ui/room-glance-card.js @@ -1,4 +1,4 @@ -!function(e){var t={};function s(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(i,n,function(t){return e[t]}.bind(null,n));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=0)}([function(e,t,s){"use strict";s.r(t); +!function(t){var e={};function s(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=t,s.c=e,s.d=function(t,e,i){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)s.d(i,n,function(e){return t[e]}.bind(null,n));return i},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=0)}([function(t,e,s){"use strict";s.r(e); /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -12,7 +12,7 @@ * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const i=new WeakMap,n=e=>"function"==typeof e&&i.has(e),r=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,o=(e,t,s=null)=>{for(;t!==s;){const s=t.nextSibling;e.removeChild(t),t=s}},a={},l={},c=`{{lit-${String(Math.random()).slice(2)}}}`,d=`\x3c!--${c}--\x3e`,h=new RegExp(`${c}|${d}`),p="$lit$";class u{constructor(e,t){this.parts=[],this.element=t;const s=[],i=[],n=document.createTreeWalker(t.content,133,null,!1);let r=0,o=-1,a=0;const{strings:l,values:{length:d}}=e;for(;a0;){const t=l[a],s=g.exec(t)[2],i=s.toLowerCase()+p,n=e.getAttribute(i);e.removeAttribute(i);const r=n.split(h);this.parts.push({type:"attribute",index:o,name:s,strings:r}),a+=r.length-1}}"TEMPLATE"===e.tagName&&(i.push(e),n.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(c)>=0){const i=e.parentNode,n=t.split(h),r=n.length-1;for(let t=0;t{const s=e.length-t.length;return s>=0&&e.slice(s)===t},m=e=>-1!==e.index,_=()=>document.createComment(""),g=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; +const i=new WeakMap,n=t=>"function"==typeof t&&i.has(t),o=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,r=(t,e,s=null)=>{for(;e!==s;){const s=e.nextSibling;t.removeChild(e),e=s}},a={},l={},c=`{{lit-${String(Math.random()).slice(2)}}}`,h=`\x3c!--${c}--\x3e`,d=new RegExp(`${c}|${h}`),p="$lit$";class u{constructor(t,e){this.parts=[],this.element=e;const s=[],i=[],n=document.createTreeWalker(e.content,133,null,!1);let o=0,r=-1,a=0;const{strings:l,values:{length:h}}=t;for(;a0;){const e=l[a],s=g.exec(e)[2],i=s.toLowerCase()+p,n=t.getAttribute(i);t.removeAttribute(i);const o=n.split(d);this.parts.push({type:"attribute",index:r,name:s,strings:o}),a+=o.length-1}}"TEMPLATE"===t.tagName&&(i.push(t),n.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(c)>=0){const i=t.parentNode,n=e.split(d),o=n.length-1;for(let e=0;e{const s=t.length-e.length;return s>=0&&t.slice(s)===e},m=t=>-1!==t.index,_=()=>document.createComment(""),g=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -26,7 +26,7 @@ const i=new WeakMap,n=e=>"function"==typeof e&&i.has(e),r=void 0!==window.custom * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -class v{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this.__parts)void 0!==s&&s.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=r?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],s=this.template.parts,i=document.createTreeWalker(e,133,null,!1);let n,o=0,a=0,l=i.nextNode();for(;o-1||s)&&-1===e.indexOf("--\x3e",n+1);const r=g.exec(e);t+=null===r?e+(s?c:d):e.substr(0,r.index)+r[1]+r[2]+p+r[3]+c}return t+=this.strings[e]}getTemplateElement(){const e=document.createElement("template");return e.innerHTML=this.getHTML(),e}} + */class y{constructor(t,e,s,i){this.strings=t,this.values=e,this.type=s,this.processor=i}getHTML(){const t=this.strings.length-1;let e="",s=!1;for(let i=0;i-1||s)&&-1===t.indexOf("--\x3e",n+1);const o=g.exec(t);e+=null===o?t+(s?c:h):t.substr(0,o.index)+o[1]+o[2]+p+o[3]+c}return e+=this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}} /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -53,7 +53,7 @@ class v{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const S=e=>null===e||!("object"==typeof e||"function"==typeof e),b=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class w{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let e=0;ethis.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;n(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=a,e(this)}if(this.__pendingValue===a)return;const e=this.__pendingValue,t=this.value,s=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=null!=e&&(null==t||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=k(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=a}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const k=e=>e&&(T?{capture:e.capture,passive:e.passive,once:e.once}:e.capture); +const S=t=>null===t||!("object"==typeof t||"function"==typeof t),b=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class w{constructor(t,e,s){this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(let t=0;tthis.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;n(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=a,t(this)}if(this.__pendingValue===a)return;const t=this.__pendingValue,e=this.value,s=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=k(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=a}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const k=t=>t&&(T?{capture:t.capture,passive:t.passive,once:t.once}:t.capture); /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -66,7 +66,7 @@ const S=e=>null===e||!("object"==typeof e||"function"==typeof e),b=e=>Array.isAr * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */const V=new class{handleAttributeExpressions(e,t,s,i){const n=t[0];return"."===n?new N(e,t.slice(1),s).parts:"@"===n?[new E(e,t.slice(1),i.eventContext)]:"?"===n?[new C(e,t.slice(1),s)]:new w(e,t,s).parts}handleTextExpression(e){return new P(e)}}; + */const V=new class{handleAttributeExpressions(t,e,s,i){const n=e[0];return"."===n?new N(t,e.slice(1),s).parts:"@"===n?[new E(t,e.slice(1),i.eventContext)]:"?"===n?[new C(t,e.slice(1),s)]:new w(t,e,s).parts}handleTextExpression(t){return new P(t)}}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -79,7 +79,7 @@ const S=e=>null===e||!("object"==typeof e||"function"==typeof e),b=e=>Array.isAr * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */function O(e){let t=$.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},$.set(e.type,t));let s=t.stringsArray.get(e.strings);if(void 0!==s)return s;const i=e.strings.join(c);return void 0===(s=t.keyString.get(i))&&(s=new u(e,e.getTemplateElement()),t.keyString.set(i,s)),t.stringsArray.set(e.strings,s),s}const $=new Map,R=new WeakMap; + */function O(t){let e=$.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},$.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const i=t.strings.join(c);return void 0===(s=e.keyString.get(i))&&(s=new u(t,t.getTemplateElement()),e.keyString.set(i,s)),e.stringsArray.set(t.strings,s),s}const $=new Map,R=new WeakMap; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -106,7 +106,7 @@ const S=e=>null===e||!("object"==typeof e||"function"==typeof e),b=e=>Array.isAr * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const M=(e,...t)=>new y(e,t,"html",V),j=133;function U(e,t){const{element:{content:s},parts:i}=e,n=document.createTreeWalker(s,j,null,!1);let r=z(i),o=i[r],a=-1,l=0;const c=[];let d=null;for(;n.nextNode();){a++;const e=n.currentNode;for(e.previousSibling===d&&(d=null),t.has(e)&&(c.push(e),null===d&&(d=e)),null!==d&&l++;void 0!==o&&o.index===a;)o.index=null!==d?-1:o.index-l,o=i[r=z(i,r)]}c.forEach(e=>e.parentNode.removeChild(e))}const H=e=>{let t=11===e.nodeType?0:1;const s=document.createTreeWalker(e,j,null,!1);for(;s.nextNode();)t++;return t},z=(e,t=-1)=>{for(let s=t+1;snew y(t,e,"html",V),j=133;function U(t,e){const{element:{content:s},parts:i}=t,n=document.createTreeWalker(s,j,null,!1);let o=z(i),r=i[o],a=-1,l=0;const c=[];let h=null;for(;n.nextNode();){a++;const t=n.currentNode;for(t.previousSibling===h&&(h=null),e.has(t)&&(c.push(t),null===h&&(h=t)),null!==h&&l++;void 0!==r&&r.index===a;)r.index=null!==h?-1:r.index-l,r=i[o=z(i,o)]}c.forEach(t=>t.parentNode.removeChild(t))}const H=t=>{let e=11===t.nodeType?0:1;const s=document.createTreeWalker(t,j,null,!1);for(;s.nextNode();)e++;return e},z=(t,e=-1)=>{for(let s=e+1;snull===e||!("object"==typeof e||"function"==typeof e),b=e=>Array.isAr * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const q=(e,t)=>`${e}--${t}`;let F=!0;void 0===window.ShadyCSS?F=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),F=!1);const L=e=>t=>{const s=q(t.type,e);let i=$.get(s);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},$.set(s,i));let n=i.stringsArray.get(t.strings);if(void 0!==n)return n;const r=t.strings.join(c);if(void 0===(n=i.keyString.get(r))){const s=t.getTemplateElement();F&&window.ShadyCSS.prepareTemplateDom(s,e),n=new u(t,s),i.keyString.set(r,n)}return i.stringsArray.set(t.strings,n),n},I=["html","svg"],B=new Set,W=(e,t,s)=>{B.add(s);const i=e.querySelectorAll("style"),{length:n}=i;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(t.element,s);const r=document.createElement("style");for(let e=0;e{I.forEach(t=>{const s=$.get(q(t,e));void 0!==s&&s.keyString.forEach(e=>{const{element:{content:t}}=e,s=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{s.add(e)}),U(e,s)})})})(s);const o=t.element.content;!function(e,t,s=null){const{element:{content:i},parts:n}=e;if(null==s)return void i.appendChild(t);const r=document.createTreeWalker(i,j,null,!1);let o=z(n),a=0,l=-1;for(;r.nextNode();)for(l++,r.currentNode===s&&(a=H(t),s.parentNode.insertBefore(t,s));-1!==o&&n[o].index===l;){if(a>0){for(;-1!==o;)n[o].index+=a,o=z(n,o);return}o=z(n,o)}}(t,r,o.firstChild),window.ShadyCSS.prepareTemplateStyles(t.element,s);const a=o.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==a)e.insertBefore(a.cloneNode(!0),e.firstChild);else{o.insertBefore(r,o.firstChild);const e=new Set;e.add(r),U(t,e)}}; +const q=(t,e)=>`${t}--${e}`;let F=!0;void 0===window.ShadyCSS?F=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),F=!1);const L=t=>e=>{const s=q(e.type,t);let i=$.get(s);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},$.set(s,i));let n=i.stringsArray.get(e.strings);if(void 0!==n)return n;const o=e.strings.join(c);if(void 0===(n=i.keyString.get(o))){const s=e.getTemplateElement();F&&window.ShadyCSS.prepareTemplateDom(s,t),n=new u(e,s),i.keyString.set(o,n)}return i.stringsArray.set(e.strings,n),n},I=["html","svg"],B=new Set,W=(t,e,s)=>{B.add(s);const i=t.querySelectorAll("style"),{length:n}=i;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(e.element,s);const o=document.createElement("style");for(let t=0;t{I.forEach(e=>{const s=$.get(q(e,t));void 0!==s&&s.keyString.forEach(t=>{const{element:{content:e}}=t,s=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{s.add(t)}),U(t,s)})})})(s);const r=e.element.content;!function(t,e,s=null){const{element:{content:i},parts:n}=t;if(null==s)return void i.appendChild(e);const o=document.createTreeWalker(i,j,null,!1);let r=z(n),a=0,l=-1;for(;o.nextNode();)for(l++,o.currentNode===s&&(a=H(e),s.parentNode.insertBefore(e,s));-1!==r&&n[r].index===l;){if(a>0){for(;-1!==r;)n[r].index+=a,r=z(n,r);return}r=z(n,r)}}(e,o,r.firstChild),window.ShadyCSS.prepareTemplateStyles(e.element,s);const a=r.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==a)t.insertBefore(a.cloneNode(!0),t.firstChild);else{r.insertBefore(o,r.firstChild);const t=new Set;t.add(o),U(e,t)}}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -134,7 +134,7 @@ const q=(e,t)=>`${e}--${t}`;let F=!0;void 0===window.ShadyCSS?F=!1:void 0===wind * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -window.JSCompiler_renameProperty=(e,t)=>e;const J={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},D=(e,t)=>t!==e&&(t==t||e==e),G={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:D},K=Promise.resolve(!0),Q=1,X=4,Y=8,Z=16,ee=32;class te extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=K,this._hasConnectedResolver=void 0,this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach((t,s)=>{const i=this._attributeNameForProperty(s,t);void 0!==i&&(this._attributeToPropertyMap.set(i,s),e.push(i))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e,t=G){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const s="symbol"==typeof e?Symbol():`__${e}`;Object.defineProperty(this.prototype,e,{get(){return this[s]},set(t){const i=this[e];this[s]=t,this._requestUpdate(e,i)},configurable:!0,enumerable:!0})}static finalize(){if(this.hasOwnProperty(JSCompiler_renameProperty("finalized",this))&&this.finalized)return;const e=Object.getPrototypeOf(this);if("function"==typeof e.finalize&&e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const s of t)this.createProperty(s,e[s])}}static _attributeNameForProperty(e,t){const s=t.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,s=D){return s(e,t)}static _propertyValueFromAttribute(e,t){const s=t.type,i=t.converter||J,n="function"==typeof i?i:i.fromAttribute;return n?n(e,s):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const s=t.type,i=t.converter;return(i&&i.toAttribute||J.toAttribute)(e,s)}initialize(){this._saveInstanceProperties(),this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}connectedCallback(){this._updateState=this._updateState|ee,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,s){t!==s&&this._attributeToProperty(e,s)}_propertyToAttribute(e,t,s=G){const i=this.constructor,n=i._attributeNameForProperty(e,s);if(void 0!==n){const e=i._propertyValueToAttribute(t,s);if(void 0===e)return;this._updateState=this._updateState|Y,null==e?this.removeAttribute(n):this.setAttribute(n,e),this._updateState=this._updateState&~Y}}_attributeToProperty(e,t){if(this._updateState&Y)return;const s=this.constructor,i=s._attributeToPropertyMap.get(e);if(void 0!==i){const e=s._classProperties.get(i)||G;this._updateState=this._updateState|Z,this[i]=s._propertyValueFromAttribute(t,e),this._updateState=this._updateState&~Z}}_requestUpdate(e,t){let s=!0;if(void 0!==e){const i=this.constructor,n=i._classProperties.get(e)||G;i._valueHasChanged(this[e],t,n.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==n.reflect||this._updateState&Z||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,n))):s=!1}!this._hasRequestedUpdate&&s&&this._enqueueUpdate()}requestUpdate(e,t){return this._requestUpdate(e,t),this.updateComplete}async _enqueueUpdate(){let e,t;this._updateState=this._updateState|X;const s=this._updatePromise;this._updatePromise=new Promise((s,i)=>{e=s,t=i});try{await s}catch(e){}this._hasConnected||await new Promise(e=>this._hasConnectedResolver=e);try{const e=this.performUpdate();null!=e&&await e}catch(e){t(e)}e(!this._hasRequestedUpdate)}get _hasConnected(){return this._updateState&ee}get _hasRequestedUpdate(){return this._updateState&X}get hasUpdated(){return this._updateState&Q}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{(e=this.shouldUpdate(t))&&this.update(t)}catch(t){throw e=!1,t}finally{this._markUpdated()}e&&(this._updateState&Q||(this._updateState=this._updateState|Q,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~X}get updateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0)}updated(e){}firstUpdated(e){}}te.finalized=!0; +window.JSCompiler_renameProperty=(t,e)=>t;const J={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},D=(t,e)=>e!==t&&(e==e||t==t),G={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:D},K=Promise.resolve(!0),Q=1,X=4,Y=8,Z=16,tt=32;class et extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=K,this._hasConnectedResolver=void 0,this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach((e,s)=>{const i=this._attributeNameForProperty(s,e);void 0!==i&&(this._attributeToPropertyMap.set(i,s),t.push(i))}),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((t,e)=>this._classProperties.set(e,t))}}static createProperty(t,e=G){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const s="symbol"==typeof t?Symbol():`__${t}`;Object.defineProperty(this.prototype,t,{get(){return this[s]},set(e){const i=this[t];this[s]=e,this._requestUpdate(t,i)},configurable:!0,enumerable:!0})}static finalize(){if(this.hasOwnProperty(JSCompiler_renameProperty("finalized",this))&&this.finalized)return;const t=Object.getPrototypeOf(this);if("function"==typeof t.finalize&&t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const s of e)this.createProperty(s,t[s])}}static _attributeNameForProperty(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,s=D){return s(t,e)}static _propertyValueFromAttribute(t,e){const s=e.type,i=e.converter||J,n="function"==typeof i?i:i.fromAttribute;return n?n(t,s):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const s=e.type,i=e.converter;return(i&&i.toAttribute||J.toAttribute)(t,s)}initialize(){this._saveInstanceProperties(),this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}})}_applyInstanceProperties(){this._instanceProperties.forEach((t,e)=>this[e]=t),this._instanceProperties=void 0}connectedCallback(){this._updateState=this._updateState|tt,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,s){e!==s&&this._attributeToProperty(t,s)}_propertyToAttribute(t,e,s=G){const i=this.constructor,n=i._attributeNameForProperty(t,s);if(void 0!==n){const t=i._propertyValueToAttribute(e,s);if(void 0===t)return;this._updateState=this._updateState|Y,null==t?this.removeAttribute(n):this.setAttribute(n,t),this._updateState=this._updateState&~Y}}_attributeToProperty(t,e){if(this._updateState&Y)return;const s=this.constructor,i=s._attributeToPropertyMap.get(t);if(void 0!==i){const t=s._classProperties.get(i)||G;this._updateState=this._updateState|Z,this[i]=s._propertyValueFromAttribute(e,t),this._updateState=this._updateState&~Z}}_requestUpdate(t,e){let s=!0;if(void 0!==t){const i=this.constructor,n=i._classProperties.get(t)||G;i._valueHasChanged(this[t],e,n.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==n.reflect||this._updateState&Z||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,n))):s=!1}!this._hasRequestedUpdate&&s&&this._enqueueUpdate()}requestUpdate(t,e){return this._requestUpdate(t,e),this.updateComplete}async _enqueueUpdate(){let t,e;this._updateState=this._updateState|X;const s=this._updatePromise;this._updatePromise=new Promise((s,i)=>{t=s,e=i});try{await s}catch(t){}this._hasConnected||await new Promise(t=>this._hasConnectedResolver=t);try{const t=this.performUpdate();null!=t&&await t}catch(t){e(t)}t(!this._hasRequestedUpdate)}get _hasConnected(){return this._updateState&tt}get _hasRequestedUpdate(){return this._updateState&X}get hasUpdated(){return this._updateState&Q}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{(t=this.shouldUpdate(e))&&this.update(e)}catch(e){throw t=!1,e}finally{this._markUpdated()}t&&(this._updateState&Q||(this._updateState=this._updateState|Q,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~X}get updateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((t,e)=>this._propertyToAttribute(e,this[e],t)),this._reflectingProperties=void 0)}updated(t){}firstUpdated(t){}}et.finalized=!0; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -148,7 +148,7 @@ window.JSCompiler_renameProperty=(e,t)=>e;const J={toAttribute(e,t){switch(t){ca * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const se=(e,t)=>"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(s){s.createProperty(t.key,e)}}:Object.assign({},t,{finisher(s){s.createProperty(t.key,e)}}),ie=(e,t,s)=>{t.constructor.createProperty(s,e)};function ne(e){return(t,s)=>void 0!==s?ie(e,t,s):se(e,t)}const re="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,oe=Symbol();class ae{constructor(e,t){if(t!==oe)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(re?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const le=(e,...t)=>{const s=t.reduce((t,s,i)=>t+(e=>{if(e instanceof ae)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(s)+e[i+1],e[0]);return new ae(s,oe)}; +const st=(t,e)=>"method"!==e.kind||!e.descriptor||"value"in e.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(s){s.createProperty(e.key,t)}}:Object.assign({},e,{finisher(s){s.createProperty(e.key,t)}}),it=(t,e,s)=>{e.constructor.createProperty(s,t)};function nt(t){return(e,s)=>void 0!==s?it(t,e,s):st(t,e)}const ot="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rt=Symbol();class at{constructor(t,e){if(e!==rt)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(ot?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const lt=(t,...e)=>{const s=e.reduce((e,s,i)=>e+(t=>{if(t instanceof at)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(s)+t[i+1],t[0]);return new at(s,rt)}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -162,7 +162,7 @@ const se=(e,t)=>"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:" * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.2.0");const ce=e=>e.flat?e.flat(1/0):function e(t,s=[]){for(let i=0,n=t.length;i(e.add(t),e),new Set).forEach(e=>t.unshift(e))}else e&&t.push(e);return t}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?re?this.renderRoot.adoptedStyleSheets=e.map(e=>e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){super.update(e);const t=this.render();t instanceof y&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){}}de.finalized=!0,de.render=(e,t,s)=>{const i=s.scopeName,n=R.has(t),r=F&&11===t.nodeType&&!!t.host&&e instanceof y,a=r&&!B.has(i),l=a?document.createDocumentFragment():t;if(((e,t,s)=>{let i=R.get(t);void 0===i&&(o(t,t.firstChild),R.set(t,i=new P(Object.assign({templateFactory:O},s))),i.appendInto(t)),i.setValue(e),i.commit()})(e,l,Object.assign({templateFactory:L(i)},s)),a){const e=R.get(l);R.delete(l),e.value instanceof v&&W(l,e.value.template,i),o(t,t.firstChild),t.appendChild(l),R.set(t,e)}!n&&r&&window.ShadyCSS.styleElement(t.host)},s.d(t,"RoomGlanceCard",function(){return pe});var he=function(e,t,s,i){var n,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,s,o):n(t,s))||o);return r>3&&o&&Object.defineProperty(t,s,o),o};let pe=class extends de{setConfig(e){console.log("Setting config",e),this._config=e}static getCardSize(){return 3}render(){return this._config.scenes.length>=5?M` +(window.litElementVersions||(window.litElementVersions=[])).push("2.2.0");const ct=t=>t.flat?t.flat(1/0):function t(e,s=[]){for(let i=0,n=e.length;i(t.add(e),t),new Set).forEach(t=>e.unshift(t))}else t&&e.push(t);return e}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?ot?this.renderRoot.adoptedStyleSheets=t.map(t=>t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){super.update(t);const e=this.render();e instanceof y&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){}}ht.finalized=!0,ht.render=(t,e,s)=>{const i=s.scopeName,n=R.has(e),o=F&&11===e.nodeType&&!!e.host&&t instanceof y,a=o&&!B.has(i),l=a?document.createDocumentFragment():e;if(((t,e,s)=>{let i=R.get(e);void 0===i&&(r(e,e.firstChild),R.set(e,i=new P(Object.assign({templateFactory:O},s))),i.appendInto(e)),i.setValue(t),i.commit()})(t,l,Object.assign({templateFactory:L(i)},s)),a){const t=R.get(l);R.delete(l),t.value instanceof v&&W(l,t.value.template,i),r(e,e.firstChild),e.appendChild(l),R.set(e,t)}!n&&o&&window.ShadyCSS.styleElement(e.host)},s.d(e,"RoomGlanceCard",function(){return pt});var dt=function(t,e,s,i){var n,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o<3?n(r):o>3?n(e,s,r):n(e,s))||r);return o>3&&r&&Object.defineProperty(e,s,r),r};let pt=class extends ht{setConfig(t){console.log("Setting config",t),this._config=t}static getCardSize(){return 3}render(){return this._config.scenes.length>=5?M` @@ -182,7 +182,7 @@ const se=(e,t)=>"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:"
- ${this._config.scenes.map(e=>this.renderSceneButton(e))} + ${this._config.scenes.map(t=>this.renderSceneButton(t))}
@@ -202,52 +202,52 @@ const se=(e,t)=>"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:"
- ${this._config.scenes.map(e=>this.renderSceneButton(e))} + ${this._config.scenes.map(t=>this.renderSceneButton(t))} ${this.renderLightControl()}
- `}renderSceneButton(e){return M` - + `}renderSceneButton(t){return M` + `}renderLightControl(){return M` - + > - - + `}renderCoverControl(){return M` - `}renderCoverControl(){return M` + - + - + - + - `}serviceHandler(e,t,s={}){const i=this;return function(n){n.stopPropagation(),i.callServiceForAllEntities(e,t,s)}}callServiceForAllEntities(e,t,s={}){if(s.hasOwnProperty("entity_id"))console.log("Calling service with given entity_id",e,t,s),this.hass.callService(e,t,s);else for(let i of this._config.entities)s.entity_id=i,console.log("Calling service",e,t,s),this.hass.callService(e,t,s)}_handleTap(){console.log("Image tap")}_handleHold(){console.log("Image hold")}static get styles(){return le` + > + `}serviceHandler(t,e,s={}){const i=this;return function(n){n.stopPropagation(),i.callServiceForAllEntities(t,e,s)}}callServiceForAllEntities(t,e,s={}){if(s.hasOwnProperty("entity_id"))console.log("Calling service with given entity_id",t,e,s),this.hass.callService(t,e,s);else for(let i of this._config.entities)s.entity_id=i,console.log("Calling service",t,e,s),this.hass.callService(t,e,s)}_handleTap(){console.log("Image tap")}_handleHold(){console.log("Image hold")}static get styles(){return lt` ha-card { position: relative; min-height: 48px; @@ -316,4 +316,4 @@ const se=(e,t)=>"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:" ha-icon.state-on { color: white; } - `}};he([ne()],pe.prototype,"hass",void 0),he([ne()],pe.prototype,"_config",void 0),pe=he([(e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:s,elements:i}=t;return{kind:s,elements:i,finisher(t){window.customElements.define(e,t)}}})(e,t))("room-glance-card")],pe)}]); \ No newline at end of file + `}};dt([nt()],pt.prototype,"hass",void 0),dt([nt()],pt.prototype,"_config",void 0),pt=dt([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:i}=e;return{kind:s,elements:i,finisher(e){window.customElements.define(t,e)}}})(t,e))("room-glance-card")],pt)}]); \ No newline at end of file diff --git a/www/custom_ui/state-card-custom-cover.js b/www/custom_ui/state-card-custom-cover.js index 24bb905..426fd20 100644 --- a/www/custom_ui/state-card-custom-cover.js +++ b/www/custom_ui/state-card-custom-cover.js @@ -12,7 +12,7 @@ * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const i=new WeakMap,n=t=>"function"==typeof t&&i.has(t),r=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,o=(t,e,s=null)=>{for(;e!==s;){const s=e.nextSibling;t.removeChild(e),e=s}},a={},l={},c=`{{lit-${String(Math.random()).slice(2)}}}`,h=`\x3c!--${c}--\x3e`,p=new RegExp(`${c}|${h}`),u="$lit$";class d{constructor(t,e){this.parts=[],this.element=e;const s=[],i=[],n=document.createTreeWalker(e.content,133,null,!1);let r=0,o=-1,a=0;const{strings:l,values:{length:h}}=t;for(;a0;){const e=l[a],s=y.exec(e)[2],i=s.toLowerCase()+u,n=t.getAttribute(i);t.removeAttribute(i);const r=n.split(p);this.parts.push({type:"attribute",index:o,name:s,strings:r}),a+=r.length-1}}"TEMPLATE"===t.tagName&&(i.push(t),n.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(c)>=0){const i=t.parentNode,n=e.split(p),r=n.length-1;for(let e=0;e{const s=t.length-e.length;return s>=0&&t.slice(s)===e},f=t=>-1!==t.index,m=()=>document.createComment(""),y=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; +const i=new WeakMap,n=t=>"function"==typeof t&&i.has(t),r=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,o=(t,e,s=null)=>{for(;e!==s;){const s=e.nextSibling;t.removeChild(e),e=s}},a={},l={},h=`{{lit-${String(Math.random()).slice(2)}}}`,c=`\x3c!--${h}--\x3e`,p=new RegExp(`${h}|${c}`),u="$lit$";class d{constructor(t,e){this.parts=[],this.element=e;const s=[],i=[],n=document.createTreeWalker(e.content,133,null,!1);let r=0,o=-1,a=0;const{strings:l,values:{length:c}}=t;for(;a0;){const e=l[a],s=y.exec(e)[2],i=s.toLowerCase()+u,n=t.getAttribute(i);t.removeAttribute(i);const r=n.split(p);this.parts.push({type:"attribute",index:o,name:s,strings:r}),a+=r.length-1}}"TEMPLATE"===t.tagName&&(i.push(t),n.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(h)>=0){const i=t.parentNode,n=e.split(p),r=n.length-1;for(let e=0;e{const s=t.length-e.length;return s>=0&&t.slice(s)===e},f=t=>-1!==t.index,m=()=>document.createComment(""),y=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -39,7 +39,7 @@ class g{constructor(t,e,s){this.__parts=[],this.template=t,this.processor=e,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */class v{constructor(t,e,s,i){this.strings=t,this.values=e,this.type=s,this.processor=i}getHTML(){const t=this.strings.length-1;let e="",s=!1;for(let i=0;i-1||s)&&-1===t.indexOf("--\x3e",n+1);const r=y.exec(t);e+=null===r?t+(s?c:h):t.substr(0,r.index)+r[1]+r[2]+u+r[3]+c}return e+=this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}} + */class v{constructor(t,e,s,i){this.strings=t,this.values=e,this.type=s,this.processor=i}getHTML(){const t=this.strings.length-1;let e="",s=!1;for(let i=0;i-1||s)&&-1===t.indexOf("--\x3e",n+1);const r=y.exec(t);e+=null===r?t+(s?h:c):t.substr(0,r.index)+r[1]+r[2]+u+r[3]+h}return e+=this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}} /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -79,7 +79,7 @@ const S=t=>null===t||!("object"==typeof t||"function"==typeof t),b=t=>Array.isAr * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */function V(t){let e=k.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},k.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const i=t.strings.join(c);return void 0===(s=e.keyString.get(i))&&(s=new d(t,t.getTemplateElement()),e.keyString.set(i,s)),e.stringsArray.set(t.strings,s),s}const k=new Map,M=new WeakMap; + */function V(t){let e=k.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},k.set(t.type,e));let s=e.stringsArray.get(t.strings);if(void 0!==s)return s;const i=t.strings.join(h);return void 0===(s=e.keyString.get(i))&&(s=new d(t,t.getTemplateElement()),e.keyString.set(i,s)),e.stringsArray.set(t.strings,s),s}const k=new Map,M=new WeakMap; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -106,7 +106,7 @@ const S=t=>null===t||!("object"==typeof t||"function"==typeof t),b=t=>Array.isAr * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const R=(t,...e)=>new v(t,e,"html",E),U=133;function z(t,e){const{element:{content:s},parts:i}=t,n=document.createTreeWalker(s,U,null,!1);let r=$(i),o=i[r],a=-1,l=0;const c=[];let h=null;for(;n.nextNode();){a++;const t=n.currentNode;for(t.previousSibling===h&&(h=null),e.has(t)&&(c.push(t),null===h&&(h=t)),null!==h&&l++;void 0!==o&&o.index===a;)o.index=null!==h?-1:o.index-l,o=i[r=$(i,r)]}c.forEach(t=>t.parentNode.removeChild(t))}const F=t=>{let e=11===t.nodeType?0:1;const s=document.createTreeWalker(t,U,null,!1);for(;s.nextNode();)e++;return e},$=(t,e=-1)=>{for(let s=e+1;snew v(t,e,"html",E),U=133;function z(t,e){const{element:{content:s},parts:i}=t,n=document.createTreeWalker(s,U,null,!1);let r=$(i),o=i[r],a=-1,l=0;const h=[];let c=null;for(;n.nextNode();){a++;const t=n.currentNode;for(t.previousSibling===c&&(c=null),e.has(t)&&(h.push(t),null===c&&(c=t)),null!==c&&l++;void 0!==o&&o.index===a;)o.index=null!==c?-1:o.index-l,o=i[r=$(i,r)]}h.forEach(t=>t.parentNode.removeChild(t))}const F=t=>{let e=11===t.nodeType?0:1;const s=document.createTreeWalker(t,U,null,!1);for(;s.nextNode();)e++;return e},$=(t,e=-1)=>{for(let s=e+1;snull===t||!("object"==typeof t||"function"==typeof t),b=t=>Array.isAr * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const q=(t,e)=>`${t}--${e}`;let I=!0;void 0===window.ShadyCSS?I=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),I=!1);const H=t=>e=>{const s=q(e.type,t);let i=k.get(s);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},k.set(s,i));let n=i.stringsArray.get(e.strings);if(void 0!==n)return n;const r=e.strings.join(c);if(void 0===(n=i.keyString.get(r))){const s=e.getTemplateElement();I&&window.ShadyCSS.prepareTemplateDom(s,t),n=new d(e,s),i.keyString.set(r,n)}return i.stringsArray.set(e.strings,n),n},D=["html","svg"],L=new Set,B=(t,e,s)=>{L.add(s);const i=t.querySelectorAll("style"),{length:n}=i;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(e.element,s);const r=document.createElement("style");for(let t=0;t{D.forEach(e=>{const s=k.get(q(e,t));void 0!==s&&s.keyString.forEach(t=>{const{element:{content:e}}=t,s=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{s.add(t)}),z(t,s)})})})(s);const o=e.element.content;!function(t,e,s=null){const{element:{content:i},parts:n}=t;if(null==s)return void i.appendChild(e);const r=document.createTreeWalker(i,U,null,!1);let o=$(n),a=0,l=-1;for(;r.nextNode();)for(l++,r.currentNode===s&&(a=F(e),s.parentNode.insertBefore(e,s));-1!==o&&n[o].index===l;){if(a>0){for(;-1!==o;)n[o].index+=a,o=$(n,o);return}o=$(n,o)}}(e,r,o.firstChild),window.ShadyCSS.prepareTemplateStyles(e.element,s);const a=o.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==a)t.insertBefore(a.cloneNode(!0),t.firstChild);else{o.insertBefore(r,o.firstChild);const t=new Set;t.add(r),z(e,t)}}; +const q=(t,e)=>`${t}--${e}`;let I=!0;void 0===window.ShadyCSS?I=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),I=!1);const H=t=>e=>{const s=q(e.type,t);let i=k.get(s);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},k.set(s,i));let n=i.stringsArray.get(e.strings);if(void 0!==n)return n;const r=e.strings.join(h);if(void 0===(n=i.keyString.get(r))){const s=e.getTemplateElement();I&&window.ShadyCSS.prepareTemplateDom(s,t),n=new d(e,s),i.keyString.set(r,n)}return i.stringsArray.set(e.strings,n),n},D=["html","svg"],L=new Set,B=(t,e,s)=>{L.add(s);const i=t.querySelectorAll("style"),{length:n}=i;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(e.element,s);const r=document.createElement("style");for(let t=0;t{D.forEach(e=>{const s=k.get(q(e,t));void 0!==s&&s.keyString.forEach(t=>{const{element:{content:e}}=t,s=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{s.add(t)}),z(t,s)})})})(s);const o=e.element.content;!function(t,e,s=null){const{element:{content:i},parts:n}=t;if(null==s)return void i.appendChild(e);const r=document.createTreeWalker(i,U,null,!1);let o=$(n),a=0,l=-1;for(;r.nextNode();)for(l++,r.currentNode===s&&(a=F(e),s.parentNode.insertBefore(e,s));-1!==o&&n[o].index===l;){if(a>0){for(;-1!==o;)n[o].index+=a,o=$(n,o);return}o=$(n,o)}}(e,r,o.firstChild),window.ShadyCSS.prepareTemplateStyles(e.element,s);const a=o.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==a)t.insertBefore(a.cloneNode(!0),t.firstChild);else{o.insertBefore(r,o.firstChild);const t=new Set;t.add(r),z(e,t)}}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -162,7 +162,7 @@ const st=(t,e)=>"method"!==e.kind||!e.descriptor||"value"in e.descriptor?{kind:" * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.0.1");const ot=t=>t.flat?t.flat(1/0):function t(e,s=[]){for(let i=0,n=e.length;i(t.add(e),t),new Set).forEach(t=>e.unshift(t))}else t&&e.push(t);return e}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?rt?this.renderRoot.adoptedStyleSheets=t.map(t=>t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){super.update(t);const e=this.render();e instanceof v&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){}}at.finalized=!0,at.render=(t,e,s)=>{const i=s.scopeName,n=M.has(e),r=I&&11===e.nodeType&&!!e.host&&t instanceof v,a=r&&!L.has(i),l=a?document.createDocumentFragment():e;if(((t,e,s)=>{let i=M.get(e);void 0===i&&(o(e,e.firstChild),M.set(e,i=new C(Object.assign({templateFactory:V},s))),i.appendInto(e)),i.setValue(t),i.commit()})(t,l,Object.assign({templateFactory:H(i)},s)),a){const t=M.get(l);M.delete(l),t.value instanceof g&&B(l,t.value.template,i),o(e,e.firstChild),e.appendChild(l),M.set(e,t)}!n&&r&&window.ShadyCSS.styleElement(e.host)};const lt=(t,e)=>0!=(t.attributes.supported_features&e);class ct{constructor(t,e){this.hass=t,this.stateObj=e,this._attr=e.attributes,this._feat=this._attr.supported_features}get isFullyOpen(){return void 0!==this._attr.current_position?100===this._attr.current_position:"open"===this.stateObj.state}get isFullyClosed(){return void 0!==this._attr.current_position?0===this._attr.current_position:"closed"===this.stateObj.state}get isFullyOpenTilt(){return 100===this._attr.current_tilt_position}get isFullyClosedTilt(){return 0===this._attr.current_tilt_position}get isOpening(){return"opening"===this.stateObj.state}get isClosing(){return"closing"===this.stateObj.state}get supportsOpen(){return lt(this.stateObj,1)}get supportsClose(){return lt(this.stateObj,2)}get supportsSetPosition(){return lt(this.stateObj,4)}get supportsStop(){return lt(this.stateObj,8)}get supportsOpenTilt(){return lt(this.stateObj,16)}get supportsCloseTilt(){return lt(this.stateObj,32)}get supportsStopTilt(){return lt(this.stateObj,64)}get supportsSetTiltPosition(){return lt(this.stateObj,128)}get isTiltOnly(){const t=this.supportsOpen||this.supportsClose||this.supportsStop;return(this.supportsOpenTilt||this.supportsCloseTilt||this.supportsStopTilt)&&!t}openCover(){this.callService("open_cover")}closeCover(){this.callService("close_cover")}stopCover(){this.callService("stop_cover")}openCoverTilt(){this.callService("open_cover_tilt")}closeCoverTilt(){this.callService("close_cover_tilt")}stopCoverTilt(){this.callService("stop_cover_tilt")}setCoverPosition(t){this.callService("set_cover_position",{position:t})}setCoverTiltPosition(t){this.callService("set_cover_tilt_position",{tilt_position:t})}callService(t,e={}){e.entity_id=this.stateObj.entity_id,this.hass.callService("cover",t,e)}}s.d(e,"StateCardCustomCover",function(){return pt});var ht=function(t,e,s,i){var n,r=arguments.length,o=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,s,o):n(e,s))||o);return r>3&&o&&Object.defineProperty(e,s,o),o};let pt=class extends at{constructor(){super(...arguments),this.inDialog=!1}get stateObj(){return this.hass&&this._config?this.hass.states[this._config.entity]:null}setConfig(t){if(!t||!t.entity)throw new Error("Invalid configuration");this._config=t}get entityObj(){if(this.hass&&this.stateObj)return new ct(this.hass,this.stateObj);throw new Error("Trying to get entityObj before setting hass & config")}static getCardSize(){return 1}stateInfoTemplate(){return R` +(window.litElementVersions||(window.litElementVersions=[])).push("2.0.1");const ot=t=>t.flat?t.flat(1/0):function t(e,s=[]){for(let i=0,n=e.length;i(t.add(e),t),new Set).forEach(t=>e.unshift(t))}else t&&e.push(t);return e}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?rt?this.renderRoot.adoptedStyleSheets=t.map(t=>t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){super.update(t);const e=this.render();e instanceof v&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){}}at.finalized=!0,at.render=(t,e,s)=>{const i=s.scopeName,n=M.has(e),r=I&&11===e.nodeType&&!!e.host&&t instanceof v,a=r&&!L.has(i),l=a?document.createDocumentFragment():e;if(((t,e,s)=>{let i=M.get(e);void 0===i&&(o(e,e.firstChild),M.set(e,i=new C(Object.assign({templateFactory:V},s))),i.appendInto(e)),i.setValue(t),i.commit()})(t,l,Object.assign({templateFactory:H(i)},s)),a){const t=M.get(l);M.delete(l),t.value instanceof g&&B(l,t.value.template,i),o(e,e.firstChild),e.appendChild(l),M.set(e,t)}!n&&r&&window.ShadyCSS.styleElement(e.host)};const lt=(t,e)=>0!=(t.attributes.supported_features&e);class ht{constructor(t,e){this.hass=t,this.stateObj=e,this._attr=e.attributes,this._feat=this._attr.supported_features}get isFullyOpen(){return void 0!==this._attr.current_position?100===this._attr.current_position:"open"===this.stateObj.state}get isFullyClosed(){return void 0!==this._attr.current_position?0===this._attr.current_position:"closed"===this.stateObj.state}get isFullyOpenTilt(){return 100===this._attr.current_tilt_position}get isFullyClosedTilt(){return 0===this._attr.current_tilt_position}get isOpening(){return"opening"===this.stateObj.state}get isClosing(){return"closing"===this.stateObj.state}get supportsOpen(){return lt(this.stateObj,1)}get supportsClose(){return lt(this.stateObj,2)}get supportsSetPosition(){return lt(this.stateObj,4)}get supportsStop(){return lt(this.stateObj,8)}get supportsOpenTilt(){return lt(this.stateObj,16)}get supportsCloseTilt(){return lt(this.stateObj,32)}get supportsStopTilt(){return lt(this.stateObj,64)}get supportsSetTiltPosition(){return lt(this.stateObj,128)}get isTiltOnly(){const t=this.supportsOpen||this.supportsClose||this.supportsStop;return(this.supportsOpenTilt||this.supportsCloseTilt||this.supportsStopTilt)&&!t}openCover(){this.callService("open_cover")}closeCover(){this.callService("close_cover")}stopCover(){this.callService("stop_cover")}openCoverTilt(){this.callService("open_cover_tilt")}closeCoverTilt(){this.callService("close_cover_tilt")}stopCoverTilt(){this.callService("stop_cover_tilt")}setCoverPosition(t){this.callService("set_cover_position",{position:t})}setCoverTiltPosition(t){this.callService("set_cover_tilt_position",{tilt_position:t})}callService(t,e={}){e.entity_id=this.stateObj.entity_id,this.hass.callService("cover",t,e)}}s.d(e,"StateCardCustomCover",function(){return pt});var ct=function(t,e,s,i){var n,r=arguments.length,o=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,s,o):n(e,s))||o);return r>3&&o&&Object.defineProperty(e,s,o),o};let pt=class extends at{constructor(){super(...arguments),this.inDialog=!1}get stateObj(){return this.hass&&this._config?this.hass.states[this._config.entity]:null}setConfig(t){if(!t||!t.entity)throw new Error("Invalid configuration");this._config=t}get entityObj(){if(this.hass&&this.stateObj)return new ht(this.hass,this.stateObj);throw new Error("Trying to get entityObj before setting hass & config")}static getCardSize(){return 1}stateInfoTemplate(){return R` State info template `}render(){if(!this._config||!this.hass)return R``;const t=this.entityObj,e=this.hass.states[this._config.entity];return e?R` @@ -180,28 +180,28 @@ const st=(t,e)=>"method"!==e.kind||!e.descriptor||"value"in e.descriptor?{kind:"
- - + - + - + + >
`:R` Does not work :( - `}computeOpenDisabled(t,e){const s=!0===t.attributes.assumed_state;return(e.isFullyOpen||e.isOpening)&&!s}computeClosedDisabled(t,e){const s=!0===t.attributes.assumed_state;return(e.isFullyClosed||e.isClosing)&&!s}onHalfOpenTap(t){const e=this.hass.states[this._config.entity];t.stopPropagation(),this.entityObj.setCoverPosition(e.attributes.half_position)}onOpenTap(t){t.stopPropagation(),this.entityObj.openCover()}onCloseTap(t){t.stopPropagation(),this.entityObj.closeCover()}onStopTap(t){t.stopPropagation(),this.entityObj.stopCover()}};ht([nt()],pt.prototype,"hass",void 0),ht([nt()],pt.prototype,"_config",void 0),ht([nt()],pt.prototype,"stateObj",null),ht([nt()],pt.prototype,"inDialog",void 0),pt=ht([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:i}=e;return{kind:s,elements:i,finisher(e){window.customElements.define(t,e)}}})(t,e))("state-card-custom-cover")],pt)}]); \ No newline at end of file + `}computeOpenDisabled(t,e){const s=!0===t.attributes.assumed_state;return(e.isFullyOpen||e.isOpening)&&!s}computeClosedDisabled(t,e){const s=!0===t.attributes.assumed_state;return(e.isFullyClosed||e.isClosing)&&!s}onHalfOpenTap(t){const e=this.hass.states[this._config.entity];t.stopPropagation(),this.entityObj.setCoverPosition(e.attributes.half_position)}onOpenTap(t){t.stopPropagation(),this.entityObj.openCover()}onCloseTap(t){t.stopPropagation(),this.entityObj.closeCover()}onStopTap(t){t.stopPropagation(),this.entityObj.stopCover()}};ct([nt()],pt.prototype,"hass",void 0),ct([nt()],pt.prototype,"_config",void 0),ct([nt()],pt.prototype,"stateObj",null),ct([nt()],pt.prototype,"inDialog",void 0),pt=ct([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:i}=e;return{kind:s,elements:i,finisher(e){window.customElements.define(t,e)}}})(t,e))("state-card-custom-cover")],pt)}]); \ No newline at end of file