Created
November 7, 2021 17:47
-
-
Save regevbr/bdf7c75599ad53fe3cdd62d1245801b9 to your computer and use it in GitHub Desktop.
mini-climate-card-bundle icons fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){"use strict";function a(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 b(b){for(var d,e=1;e<arguments.length;e++)d=null==arguments[e]?{}:arguments[e],e%2?a(Object(d),!0).forEach(function(a){c(b,a,d[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(d)):a(Object(d)).forEach(function(a){Object.defineProperty(b,a,Object.getOwnPropertyDescriptor(d,a))});return b}function c(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function d(a,b){return b||(b=a.slice(0)),Object.freeze(Object.defineProperties(a,{raw:{value:Object.freeze(b)}}))}function e(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function f(a){return function(){var b=this,c=arguments;return new Promise(function(d,f){function g(a){e(i,d,f,g,h,"next",a)}function h(a){e(i,d,f,g,h,"throw",a)}var i=a.apply(b,c);g(void 0)})}}var g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa;(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b():"function"==typeof define&&define.amd?define(b):b()})(this,function(){var a=Number.isNaN,c=Math.round;function e(a,b){for(var{element:{content:d},parts:c}=a,e=document.createTreeWalker(d,133,null,!1),f=za(c),g=c[f],h=-1,i=0,j=[],k=null;e.nextNode();){h++;var l=e.currentNode;for(l.previousSibling===k&&(k=null),b.has(l)&&(j.push(l),null===k&&(k=l)),null!==k&&i++;g!==void 0&&g.index===h;)g.index=null===k?g.index-i:-1,f=za(c,f),g=c[f]}j.forEach(a=>a.parentNode.removeChild(a))}function ba(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,{element:{content:e},parts:d}=a;if(null===c||void 0===c)return void e.appendChild(b);for(var f=document.createTreeWalker(e,133,null,!1),g=za(d),h=0,i=-1;f.nextNode();){i++;var j=f.currentNode;for(j===c&&(h=ya(b),c.parentNode.insertBefore(b,c));-1!==g&&d[g].index===i;){if(0<h){for(;-1!==g;)d[g].index+=h,g=za(d,g);return}g=za(d,g)}}}function ca(a){var b=Ua.get(a.type);void 0===b&&(b={stringsArray:new WeakMap,keyString:new Map},Ua.set(a.type,b));var c=b.stringsArray.get(a.strings);if(void 0!==c)return c;var d=a.strings.join(pa);return c=b.keyString.get(d),void 0===c&&(c=new ta(a,a.getTemplateElement()),b.keyString.set(d,c)),b.stringsArray.set(a.strings,c),c}function da(a,b){function c(){f&&(f=!1,a()),g&&e()}function d(){Db(c)}function e(){var a=Date.now();if(f){if(a-h<2)return;g=!0}else f=!0,g=!1,setTimeout(d,b);h=a}var f=!1,g=!1,h=0;return e}function ea(a){return parseFloat(a)||0}function fa(a){for(var b=[],c=1;c<arguments.length;c++)b[c-1]=arguments[c];return b.reduce(function(b,c){var d=a["border-"+c+"-width"];return b+ea(d)},0)}function ga(a){for(var b=["top","right","bottom","left"],c={},d=0,e=b;d<e.length;d++){var f=e[d],g=a["padding-"+f];c[f]=ea(g)}return c}function ha(a){var b=a.getBBox();return ma(0,0,b.width,b.height)}function ia(a){var b=Math.abs,d=a.clientWidth,e=a.clientHeight;if(!d&&!e)return Jb;var f=Ib(a).getComputedStyle(a),g=ga(f),h=g.left+g.right,i=g.top+g.bottom,j=ea(f.width),k=ea(f.height);if("border-box"===f.boxSizing&&(c(j+h)!==d&&(j-=fa(f,"left","right")+h),c(k+i)!==e&&(k-=fa(f,"top","bottom")+i)),!ja(a)){var l=c(j+h)-d,m=c(k+i)-e;1!==b(l)&&(j-=l),1!==b(m)&&(k-=m)}return ma(g.left,g.top,j,k)}function ja(a){return a===Ib(a).document.documentElement}function ka(a){return Bb?Kb(a)?ha(a):ia(a):Jb}function la(a){var b=a.x,c=a.y,d=a.width,e=a.height,f="undefined"==typeof DOMRectReadOnly?Object:DOMRectReadOnly,g=Object.create(f.prototype);return Hb(g,{x:b,y:c,width:d,height:e,top:c,right:b+d,bottom:e+c,left:b}),g}function ma(a,b,c,d){return{x:a,y:b,width:c,height:d}}var na="undefined"!=typeof window&&null!=window.customElements&&window.customElements.polyfillWrapFlushCallback!==void 0,oa=function(a,b){for(var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;b!==c;){var d=b.nextSibling;a.removeChild(b),b=d}},pa="{{lit-".concat((Math.random()+"").slice(2),"}}"),qa="<!--".concat(pa,"-->"),ra=new RegExp("".concat(pa,"|").concat(qa)),sa="$lit$";class ta{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<l;){if(c=f.nextNode(),null===c){f.currentNode=e.pop();continue}if(h++,1===c.nodeType){if(c.hasAttributes()){for(var m=c.attributes,{length:o}=m,p=0,q=0;q<o;q++)ua(m[q].name,sa)&&p++;for(;0<p--;){var r=k[j],t=xa.exec(r)[2],u=t.toLowerCase()+sa,v=c.getAttribute(u);c.removeAttribute(u);var C=v.split(ra);this.parts.push({type:"attribute",index:h,name:t,strings:C}),j+=C.length-1}}"TEMPLATE"===c.tagName&&(e.push(c),f.currentNode=c.content)}else if(3===c.nodeType){var D=c.data;if(0<=D.indexOf(pa)){for(var w=c.parentNode,x=D.split(ra),y=x.length-1,z=0;z<y;z++){var A=void 0,B=x[z];if(""===B)A=wa();else{var E=xa.exec(B);null!==E&&ua(E[2],sa)&&(B=B.slice(0,E.index)+E[1]+E[2].slice(0,-sa.length)+E[3]),A=document.createTextNode(B)}w.insertBefore(A,c),this.parts.push({type:"node",index:++h})}""===x[y]?(w.insertBefore(wa(),c),d.push(c)):c.data=x[y],j+=y}}else if(8===c.nodeType)if(c.data===pa){var F=c.parentNode;(null===c.previousSibling||h===g)&&(h++,F.insertBefore(wa(),c)),g=h,this.parts.push({type:"node",index:h}),null===c.nextSibling?c.data="":(d.push(c),h--),j++}else for(var G=-1;-1!==(G=c.data.indexOf(pa,G+1));)this.parts.push({type:"node",index:-1}),j++}for(var H of d)H.parentNode.removeChild(H)}}var ua=(a,b)=>{var c=a.length-b.length;return 0<=c&&a.slice(c)===b},va=a=>-1!==a.index,wa=()=>document.createComment(""),xa=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,ya=a=>{for(var b=11===a.nodeType?0:1,c=document.createTreeWalker(a,133,null,!1);c.nextNode();)b++;return b},za=function(a){for(var b,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:-1,d=c+1;d<a.length;d++)if(b=a[d],va(b))return d;return-1},Aa=new WeakMap,Ba=a=>function(){var b=a(...arguments);return Aa.set(b,!0),b},Ca=a=>"function"==typeof a&&Aa.has(a),Da={},Ea={};class Fa{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=na?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<d.length;){if(a=d[f],!va(a)){this.__parts.push(void 0),f++;continue}for(;g<a.index;)g++,"TEMPLATE"===h.nodeName&&(c.push(h),e.currentNode=h.content),null===(h=e.nextNode())&&(e.currentNode=c.pop(),h=e.nextNode());if("node"===a.type){var i=this.processor.handleTextExpression(this.options);i.insertAfterNode(h.previousSibling),this.__parts.push(i)}else this.__parts.push(...this.processor.handleAttributeExpressions(h,a.name,a.strings,this.options));f++}return na&&(document.adoptNode(b),customElements.upgrade(b)),b}}var Ga=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:a=>a}),Ha=" ".concat(pa," ");class Ia{constructor(a,b,c,d){this.strings=a,this.values=b,this.type=c,this.processor=d}getHTML(){for(var a=this.strings.length-1,b="",c=!1,d=0;d<a;d++){var e=this.strings[d],f=e.lastIndexOf("<!--");c=(-1<f||c)&&-1===e.indexOf("-->",f+1);var g=xa.exec(e);b+=null===g?e+(c?Ha:qa):e.substr(0,g.index)+g[1]+g[2]+sa+g[3]+pa}return b+=this.strings[a],b}getTemplateElement(){var a=document.createElement("template"),b=this.getHTML();return void 0!==Ga&&(b=Ga.createHTML(b)),a.innerHTML=b,a}}var Ja=a=>null===a||"object"!=typeof a&&"function"!=typeof a,Ka=a=>Array.isArray(a)||!!(a&&a[Symbol.iterator]);class La{constructor(a,b,c){this.dirty=!0,this.element=a,this.name=b,this.strings=c,this.parts=[];for(var d=0;d<c.length-1;d++)this.parts[d]=this._createPart()}_createPart(){return new Ma(this)}_getValue(){var a=this.strings,b=a.length-1,c=this.parts;if(1===b&&""===a[0]&&""===a[1]){var f=c[0].value;if("symbol"==typeof f)return f+"";if("string"==typeof f||!Ka(f))return f}for(var d="",e=0;e<b;e++){d+=a[e];var g=c[e];if(void 0!==g){var h=g.value;if(Ja(h)||!Ka(h))d+="string"==typeof h?h:h+"";else for(var j of h)d+="string"==typeof j?j:j+""}}return d+=a[b],d}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class Ma{constructor(a){this.value=void 0,this.committer=a}setValue(a){a===Da||Ja(a)&&a===this.value||(this.value=a,!Ca(a)&&(this.committer.dirty=!0))}commit(){for(;Ca(this.value);){var a=this.value;this.value=Da,a(this)}this.value===Da||this.committer.commit()}}class Na{constructor(a){this.value=void 0,this.__pendingValue=void 0,this.options=a}appendInto(a){this.startNode=a.appendChild(wa()),this.endNode=a.appendChild(wa())}insertAfterNode(a){this.startNode=a,this.endNode=a.nextSibling}appendIntoPart(a){a.__insert(this.startNode=wa()),a.__insert(this.endNode=wa())}insertAfterPart(a){a.__insert(this.startNode=wa()),this.endNode=a.endNode,a.endNode=this.startNode}setValue(a){this.__pendingValue=a}commit(){if(null!==this.startNode.parentNode){for(;Ca(this.__pendingValue);){var b=this.__pendingValue;this.__pendingValue=Da,b(this)}var a=this.__pendingValue;a===Da||(Ja(a)?a!==this.value&&this.__commitText(a):a instanceof Ia?this.__commitTemplateResult(a):a instanceof Node?this.__commitNode(a):Ka(a)?this.__commitIterable(a):a===Ea?(this.value=Ea,this.clear()):this.__commitText(a))}}__insert(a){this.endNode.parentNode.insertBefore(a,this.endNode)}__commitNode(a){this.value===a||(this.clear(),this.__insert(a),this.value=a)}__commitText(a){var b=this.startNode.nextSibling;a=null==a?"":a;var c="string"==typeof a?a:a+"";b===this.endNode.previousSibling&&3===b.nodeType?b.data=c:this.__commitNode(document.createTextNode(c)),this.value=a}__commitTemplateResult(a){var b=this.options.templateFactory(a);if(this.value instanceof Fa&&this.value.template===b)this.value.update(a.values);else{var c=new Fa(b,a.processor,this.options),d=c._clone();c.update(a.values),this.__commitNode(d),this.value=c}}__commitIterable(a){Array.isArray(this.value)||(this.value=[],this.clear());var b,c=this.value,d=0;for(var e of a)b=c[d],void 0===b&&(b=new Na(this.options),c.push(b),0===d?b.appendIntoPart(this):b.insertAfterPart(c[d-1])),b.setValue(e),b.commit(),d++;d<c.length&&(c.length=d,this.clear(b&&b.endNode))}clear(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:this.startNode;oa(this.startNode.parentNode,a.nextSibling,this.endNode)}}class Oa{constructor(a,b,c){if(this.value=void 0,this.__pendingValue=void 0,2!==c.length||""!==c[0]||""!==c[1])throw new Error("Boolean attributes can only contain a single expression");this.element=a,this.name=b,this.strings=c}setValue(a){this.__pendingValue=a}commit(){for(;Ca(this.__pendingValue);){var b=this.__pendingValue;this.__pendingValue=Da,b(this)}if(this.__pendingValue!==Da){var a=!!this.__pendingValue;this.value!==a&&(a?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=a),this.__pendingValue=Da}}}class Pa extends La{constructor(a,b,c){super(a,b,c),this.single=2===c.length&&""===c[0]&&""===c[1]}_createPart(){return new Qa(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class Qa extends Ma{}var Ra=!1;(()=>{try{var a={get capture(){return Ra=!0,!1}};window.addEventListener("test",a,a),window.removeEventListener("test",a,a)}catch(a){}})();class Sa{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(;Ca(this.__pendingValue);){var d=this.__pendingValue;this.__pendingValue=Da,d(this)}if(this.__pendingValue!==Da){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=Ta(a),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=a,this.__pendingValue=Da}}handleEvent(a){"function"==typeof this.value?this.value.call(this.eventContext||this.element,a):this.value.handleEvent(a)}}var Ta=a=>a&&(Ra?{capture:a.capture,passive:a.passive,once:a.once}:a.capture),Ua=new Map,Va=new WeakMap,Wa=(a,b,c)=>{var d=Va.get(b);d===void 0&&(oa(b,b.firstChild),Va.set(b,d=new Na(Object.assign({templateFactory:ca},c))),d.appendInto(b)),d.setValue(a),d.commit()};var Xa=new class{handleAttributeExpressions(a,b,c,d){var e=b[0];if("."===e){var g=new Pa(a,b.slice(1),c);return g.parts}if("@"===e)return[new Sa(a,b.slice(1),d.eventContext)];if("?"===e)return[new Oa(a,b.slice(1),c)];var f=new La(a,b,c);return f.parts}handleTextExpression(a){return new Na(a)}};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");var Ya=function(a){for(var b=arguments.length,c=Array(1<b?b-1:0),d=1;d<b;d++)c[d-1]=arguments[d];return new Ia(a,c,"html",Xa)},Za=(a,b)=>"".concat(a,"--").concat(b),$a=!0;"undefined"==typeof window.ShadyCSS?$a=!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."),$a=!1);var ab,bb=a=>b=>{var c=Za(b.type,a),d=Ua.get(c);void 0===d&&(d={stringsArray:new WeakMap,keyString:new Map},Ua.set(c,d));var e=d.stringsArray.get(b.strings);if(void 0!==e)return e;var f=b.strings.join(pa);if(e=d.keyString.get(f),void 0===e){var g=b.getTemplateElement();$a&&window.ShadyCSS.prepareTemplateDom(g,a),e=new ta(b,g),d.keyString.set(f,e)}return d.stringsArray.set(b.strings,e),e},cb=["html","svg"],db=a=>{cb.forEach(b=>{var c=Ua.get(Za(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)}),e(a,c)})})},eb=new Set,fb=(a,b,c)=>{eb.add(a);var d=!c?document.createElement("template"):c.element,f=b.querySelectorAll("style"),{length:g}=f;if(0===g)return void window.ShadyCSS.prepareTemplateStyles(d,a);for(var h,j=document.createElement("style"),k=0;k<g;k++)h=f[k],h.parentNode.removeChild(h),j.textContent+=h.textContent;db(a);var l=d.content;!c?l.insertBefore(j,l.firstChild):ba(c,j,l.firstChild),window.ShadyCSS.prepareTemplateStyles(d,a);var m=l.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==m)b.insertBefore(m.cloneNode(!0),b.firstChild);else if(!!c){l.insertBefore(j,l.firstChild);var n=new Set;n.add(j),e(c,n)}},gb=(a,b,c)=>{if(!c||"object"!=typeof c||!c.scopeName)throw new Error("The `scopeName` option is required.");var d=c.scopeName,e=Va.has(b),f=$a&&11===b.nodeType&&!!b.host,g=f&&!eb.has(d),h=g?document.createDocumentFragment():b;if(Wa(a,h,Object.assign({templateFactory:bb(d)},c)),g){var i=Va.get(h);Va.delete(h);var j=i.value instanceof Fa?i.value.template:void 0;fb(d,h,j),oa(b,b.firstChild),b.appendChild(h),Va.set(b,i)}!e&&f&&window.ShadyCSS.styleElement(b.host)};window.JSCompiler_renameProperty=a=>a;var 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=1,lb=4,mb=8,nb=16,ob="finalized";class pb extends HTMLElement{constructor(){super(),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<arguments.length&&void 0!==arguments[1]?arguments[1]:jb;if(this._ensureClassProperties(),this._classProperties.set(a,b),!(b.noAccessor||this.prototype.hasOwnProperty(a))){var c="symbol"==typeof a?Symbol():"__".concat(a),d=this.getPropertyDescriptor(a,c,b);void 0!==d&&Object.defineProperty(this.prototype,a,d)}}static getPropertyDescriptor(a,b,c){return{get(){return this[b]},set(d){var e=this[a];this[b]=d,this.requestUpdateInternal(a,e,c)},configurable:!0,enumerable:!0}}static getPropertyOptions(a){return this._classProperties&&this._classProperties.get(a)||jb}static finalize(){var a=Object.getPrototypeOf(this);if(a.hasOwnProperty(ob)||a.finalize(),this[ob]=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){var b=this.properties,c=[...Object.getOwnPropertyNames(b),...("function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(b):[])];for(var d of c)this.createProperty(d,b[d])}}static _attributeNameForProperty(a,b){var c=b.attribute;return!1===c?void 0:"string"==typeof c?c:"string"==typeof a?a.toLowerCase():void 0}static _valueHasChanged(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:ib;return c(a,b)}static _propertyValueFromAttribute(a,b){var c=b.type,d=b.converter||hb,e="function"==typeof d?d:d.fromAttribute;return e?e(a,c):a}static _propertyValueToAttribute(a,b){if(void 0!==b.reflect){var c=b.type,d=b.converter,e=d&&d.toAttribute||hb.toAttribute;return e(a,c)}}initialize(){this._updateState=0,this._updatePromise=new Promise(a=>this._enableUpdatingResolver=a),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((a,b)=>{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=2<arguments.length&&arguments[2]!==void 0?arguments[2]:jb,d=this.constructor,e=d._attributeNameForProperty(a,c);if(e!==void 0){var f=d._propertyValueToAttribute(b,c);if(f===void 0)return;this._updateState|=mb,null==f?this.removeAttribute(e):this.setAttribute(e,f),this._updateState&=~mb}}_attributeToProperty(a,b){if(!(this._updateState&mb)){var c=this.constructor,d=c._attributeToPropertyMap.get(a);if(void 0!==d){var e=c.getPropertyOptions(d);this._updateState|=nb,this[d]=c._propertyValueFromAttribute(b,e),this._updateState&=~nb}}}requestUpdateInternal(a,b,c){var d=!0;if(a!==void 0){var e=this.constructor;c=c||e.getPropertyOptions(a),e._valueHasChanged(this[a],b,c.hasChanged)?(!this._changedProperties.has(a)&&this._changedProperties.set(a,b),!0===c.reflect&&!(this._updateState&nb)&&(this._reflectingProperties===void 0&&(this._reflectingProperties=new Map),this._reflectingProperties.set(a,c))):d=!1}!this._hasRequestedUpdate&&d&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(a,b){return this.requestUpdateInternal(a,b),this.updateComplete}_enqueueUpdate(){var a=this;return f(function*(){a._updateState|=lb;try{yield a._updatePromise}catch(a){}var b=a.performUpdate();return null!=b&&(yield b),!a._hasRequestedUpdate})()}get _hasRequestedUpdate(){return this._updateState&lb}get hasUpdated(){return this._updateState&kb}performUpdate(){if(this._hasRequestedUpdate){this._instanceProperties&&this._applyInstanceProperties();var a=!1,b=this._changedProperties;try{a=this.shouldUpdate(b),a?this.update(b):this._markUpdated()}catch(b){throw a=!1,this._markUpdated(),b}a&&(!(this._updateState&kb)&&(this._updateState|=kb,this.firstUpdated(b)),this.updated(b))}}_markUpdated(){this._changedProperties=new Map,this._updateState&=~lb}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(){return!0}update(){this._reflectingProperties!==void 0&&0<this._reflectingProperties.size&&(this._reflectingProperties.forEach((a,b)=>this._propertyToAttribute(b,this[b],a)),this._reflectingProperties=void 0),this._markUpdated()}updated(){}firstUpdated(){}}ab=ob,pb[ab]=!0;var qb=Element.prototype,rb=qb.msMatchesSelector||qb.webkitMatchesSelector,sb=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,tb=Symbol();class ub{constructor(a,b){if(b!==tb)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=a}get styleSheet(){return void 0===this._styleSheet&&(sb?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}var vb=a=>new ub(a+"",tb),wb=a=>{if(a instanceof ub)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."))},xb=function(a){for(var b=arguments.length,c=Array(1<b?b-1:0),d=1;d<b;d++)c[d-1]=arguments[d];var e=c.reduce((b,c,d)=>b+wb(c)+a[d+1],a[0]);return new ub(e,tb)};(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");var yb={};class zb extends pb{static getStyles(){return this.styles}static _getUniqueStyles(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_styles",this))){var a=this.getStyles();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=void 0===a?[]:[a];this._styles=this._styles.map(a=>{if(a instanceof CSSStyleSheet&&!sb){var b=Array.prototype.slice.call(a.cssRules).reduce((a,b)=>a+b.cssText,"");return vb(b)}return a})}}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){var a=this.constructor._styles;0===a.length||(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow?sb?this.renderRoot.adoptedStyleSheets=a.map(a=>a instanceof CSSStyleSheet?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!==yb&&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 yb}}zb.finalized=!0,zb.render=gb,zb.shadowRootOptions={mode:"open"};var Ab=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__;d<e.length;d++)c=e[d],a.call(b,c[1],c[0])},b}():Map}(),Bb="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,Cb=function(){return"undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")()}(),Db=function(){return"function"==typeof requestAnimationFrame?requestAnimationFrame.bind(Cb):function(a){return setTimeout(function(){return a(Date.now())},1e3/60)}}(),Eb=["top","right","bottom","left","width","height","size","weight"],Fb="undefined"!=typeof MutationObserver,Gb=function(){function a(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=da(this.refresh.bind(this),20)}return a.prototype.addObserver=function(a){~this.observers_.indexOf(a)||this.observers_.push(a),this.connected_||this.connect_()},a.prototype.removeObserver=function(a){var b=this.observers_,c=b.indexOf(a);~c&&b.splice(c,1),!b.length&&this.connected_&&this.disconnect_()},a.prototype.refresh=function(){var a=this.updateObservers_();a&&this.refresh()},a.prototype.updateObservers_=function(){var a=this.observers_.filter(function(a){return a.gatherActive(),a.hasActive()});return a.forEach(function(a){return a.broadcastActive()}),0<a.length},a.prototype.connect_=function(){!Bb||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Fb?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},a.prototype.disconnect_=function(){Bb&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},a.prototype.onTransitionEnd_=function(a){var b=a.propertyName,c=void 0===b?"":b,d=Eb.some(function(a){return!!~c.indexOf(a)});d&&this.refresh()},a.getInstance=function(){return this.instance_||(this.instance_=new a),this.instance_},a.instance_=null,a}(),Hb=function(a,b){for(var c,d=0,e=Object.keys(b);d<e.length;d++)c=e[d],Object.defineProperty(a,c,{value:b[c],enumerable:!1,writable:!1,configurable:!0});return a},Ib=function(a){var b=a&&a.ownerDocument&&a.ownerDocument.defaultView;return b||Cb},Jb=ma(0,0,0,0),Kb=function(){return"undefined"==typeof SVGGraphicsElement?function(a){return a instanceof Ib(a).SVGElement&&"function"==typeof a.getBBox}:function(a){return a instanceof Ib(a).SVGGraphicsElement}}(),Lb=function(){function a(a){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ma(0,0,0,0),this.target=a}return a.prototype.isActive=function(){var a=ka(this.target);return this.contentRect_=a,a.width!==this.broadcastWidth||a.height!==this.broadcastHeight},a.prototype.broadcastRect=function(){var a=this.contentRect_;return this.broadcastWidth=a.width,this.broadcastHeight=a.height,a},a}(),Mb=function(){return function(a,b){var c=la(b);Hb(this,{target:a,contentRect:c})}}(),Nb=function(){function a(a,b,c){if(this.activeObservations_=[],this.observations_=new Ab,"function"!=typeof a)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=a,this.controller_=b,this.callbackCtx_=c}return a.prototype.observe=function(a){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(a instanceof Ib(a).Element))throw new TypeError("parameter 1 is not of type \"Element\".");var b=this.observations_;b.has(a)||(b.set(a,new Lb(a)),this.controller_.addObserver(this),this.controller_.refresh())}},a.prototype.unobserve=function(a){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(a instanceof Ib(a).Element))throw new TypeError("parameter 1 is not of type \"Element\".");var b=this.observations_;b.has(a)&&(b.delete(a),!b.size&&this.controller_.removeObserver(this))}},a.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},a.prototype.gatherActive=function(){var a=this;this.clearActive(),this.observations_.forEach(function(b){b.isActive()&&a.activeObservations_.push(b)})},a.prototype.broadcastActive=function(){if(this.hasActive()){var a=this.callbackCtx_,b=this.activeObservations_.map(function(a){return new Mb(a.target,a.broadcastRect())});this.callback_.call(a,b,a),this.clearActive()}},a.prototype.clearActive=function(){this.activeObservations_.splice(0)},a.prototype.hasActive=function(){return 0<this.activeObservations_.length},a}(),Ob="undefined"==typeof WeakMap?new Ab:new WeakMap,Pb=function(){function a(b){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var c=Gb.getInstance(),d=new Nb(b,c,this);Ob.set(this,d)}return a}();["observe","unobserve","disconnect"].forEach(function(a){Pb.prototype[a]=function(){var b;return(b=Ob.get(this))[a].apply(b,arguments)}});var Qb=function(){return"undefined"==typeof Cb.ResizeObserver?Pb:Cb.ResizeObserver}();class Rb{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 Sb=new WeakMap,Tb=Ba(a=>b=>{if(!(b instanceof Ma)||b instanceof Qa||"class"!==b.committer.name||1<b.committer.parts.length)throw new Error("The `classMap` directive must be used in the `class` attribute and must be the only part in the attribute.");var{committer:c}=b,{element:d}=c,e=Sb.get(b);void 0===e&&(d.setAttribute("class",c.strings.join(" ")),Sb.set(b,e=new Set));var f=d.classList||new Rb(d);for(var g in e.forEach(b=>{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()}),Ub=new WeakMap,Vb=Ba(a=>b=>{if(!(b instanceof Ma)||b instanceof Qa||"style"!==b.committer.name||1<b.committer.parts.length)throw new Error("The `styleMap` directive must be used in the style attribute and must be the only part in the attribute.");var{committer:c}=b,{style:d}=c.element,e=Ub.get(b);for(var f in void 0===e&&(d.cssText=c.strings.join(" "),Ub.set(b,e=new Set)),e.forEach(b=>{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])}),Wb=xb(g||(g=d(["\n :host {\n overflow: visible !important;\n display: block;\n --mc-scale: var(--mini-climate-scale, 1);\n --mc-unit: calc(var(--mc-scale) * 40px);\n --mc-name-font-weight: var(--mini-climate-name-font-weight, 400);\n --mc-info-font-weight: var(--mini-climate-info-font-weight, 300);\n --mc-entity-info-left-offset: 8px;\n --mc-accent-color: var(--mini-climate-accent-color, var(--accent-color, #f39c12));\n --mc-text-color: var(--mini-climate-base-color, var(--primary-text-color, #000));\n --mc-active-color: var(--mc-accent-color);\n --mc-button-color: var(--mini-climate-button-color, var(--paper-item-icon-color, #44739e));\n --mc-icon-color:\n var(--mini-climate-icon-color,\n var(--mini-climate-base-color,\n var(--paper-item-icon-color, #44739e)));\n --mc-icon-active-color: var(--paper-item-icon-active-color, --mc-active-color);\n --mc-info-opacity: 1;\n --mc-bg-opacity: var(--mini-climate-background-opacity, 1);\n color: var(--mc-text-color);\n --mc-dropdown-unit: calc(var(--mc-unit) * .75);\n --paper-item-min-height: var(--mc-unit);\n --mdc-icon-button-size: calc(var(--mc-unit) * 0.75);\n }\n ha-card.--group {\n box-shadow: none;\n }\n ha-card.--bg {\n --mc-info-opacity: .75;\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(--mc-unit) * 0.35);\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 header {\n display: none;\n }\n .mc__bg {\n background: var(--ha-card-background, var(--card-background-color, 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(--mc-bg-opacity);\n border-radius: var(--ha-card-border-radius, 0);\n }\n ha-card.--group .mc__bg {\n background: none;\n }\n .mc-climate {\n align-self: flex-end;\n box-sizing: border-box;\n position: relative;\n padding: 16px 16px 0px 16px;\n transition: padding .25s ease-out;\n width: 100%;\n will-change: padding;\n }\n .flex {\n display: flex;\n display: -ms-flexbox;\n display: -webkit-flex;\n flex-direction: row;\n }\n .mc-climate__core {\n position: relative;\n padding-right: 5px;\n }\n .entity__info {\n user-select: none;\n margin-left: var(--mc-entity-info-left-offset);\n flex: 1;\n min-width: 0;\n white-space: nowrap;\n }\n .entity__icon {\n color: var(--mc-icon-color);\n white-space: nowrap;\n }\n .entity__icon[color] {\n color: var(--mc-icon-active-color);\n }\n .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(--mc-unit);\n width: var(--mc-unit);\n min-width: var(--mc-unit);\n line-height: var(--mc-unit);\n margin-right: calc(var(--mc-unit) / 5);\n position: relative;\n text-align: center;\n will-change: border-color;\n transition: border-color .25s ease-out;\n }\n .entity__info__name {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n line-height: calc(var(--mc-unit) / 2);\n color: var(--mc-text-color);\n font-weight: var(--mc-name-font-weight);\n }\n .entity__secondary_info {\n margin-top: -2px;\n }\n ha-card.--initial .mc-climate {\n padding: 16px 16px 5px 16px;\n }\n ha-card.--unavailable .mc-climate {\n padding: 16px;\n }\n ha-card.--group .mc-climate {\n padding: 2px 0 0 0;\n }\n .toggle-button {\n width: calc(var(--mc-unit) * .75);\n height: calc(var(--mc-unit) * .75);\n --mdc-icon-button-size: calc(var(--mc-unit) * .75);\n color: var(--mc-icon-color);\n margin-left: auto;\n margin-top: calc(var(--mc-unit) * -.125);\n margin-right: calc(var(--mc-unit) * .05);\n }\n .toggle-button.open {\n transform: rotate(180deg);\n color: var(--mc-active-color)\n }\n .wrap {\n display: flex;\n flex-direction: row;\n }\n .entity__controls {\n margin-left: auto;\n display: flex;\n white-space: nowrap;\n margin-top: calc(var(--mc-unit) * -.25);\n }\n .ctl-wrap {\n display: flex;\n flex-direction: row;\n margin-left: auto;\n margin-top: auto;\n margin-bottom: 0;\n }\n .bottom {\n margin-top: calc(var(--mc-unit) * .05);\n height: calc(var(--mc-unit) * .625);;\n }\n .entity__info__name_wrap {\n margin-right: 10px;\n max-width: calc(calc(var(--mc-card-width) - 191.3px) / 1.43);\n min-width: calc(var(--mc-unit) * 2.5);\n cursor: pointer;\n height: var(--mc-unit);\n }\n mc-buttons {\n width: 100%;\n justify-content: space-evenly;\n display: flex;\n }\n mc-temperature {\n min-width: 0;\n }\n .--unavailable .ctl-wrap {\n margin-left: auto;\n margin-top: auto;\n margin-bottom: auto;\n }\n .--unavailable .entity__info {\n margin-top: auto;\n margin-bottom: auto;\n }\n .mc-toggle_content {\n margin-top: calc(var(--mc-unit) * .05);\n }\n .ctl-wrap mc-dropdown, .ctl-wrap mc-button {\n min-width: calc(var(--mc-unit) * .75);\n margin-right: 3px;\n }\n .ctl-wrap mc-button {\n width: calc(var(--mc-unit) * 0.75);\n height: calc(var(--mc-unit) * 0.75);\n }\n"]))),Xb=xb(h||(h=d(["\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(--mc-unit) * .6);\n height: calc(var(--mc-unit) * .6);\n }\n ha-icon-button {\n color: var(--mc-button-color);\n transition: color .25s;\n }\n ha-icon-button[color] {\n color: var(--mc-icon-active-color) !important;\n opacity: 1 !important;\n }\n ha-icon-button[inactive] {\n opacity: .5;\n }\n"]))),Yb=(a,c,d,f)=>{var g;if(d)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=b({},d.service_data);c.callService(h,i,j);break}case"url":{if(!d.url)return;window.location.href=d.url}}},Zb=function(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"unknown",d=a.selectedLanguage||a.language,e=a.resources[d];if(!e)return c;for(var f,g=0;g<b.length;g+=1)if(f=b[g],e[f])return e[f];return c};console.info("%c MINI-CLIMATE-CARD %c ".concat("v1.2.8"," "),"color: white; background: coral; font-weight: 700;","color: coral; background: white; font-weight: 700;");var $b={DEFAULT:"mdi:air-conditioner",FAN:"mdi:fan",OFF:"mdi:power",HEAT:"mdi:weather-sunny",AUTO:"mdi:cached",COOL:"mdi:snowflake",DRY:"mdi:water",FAN_ONLY:"mdi:fan",TOGGLE:"mdi:dots-horizontal",UP:"mdi:chevron-up",DOWN:"mdi:chevron-down"},_b=["closed","locked","off"],ac=["unavailable","unknown"],bc=["more-info","navigate","call-service","url"],cc="-";class dc extends zb{static get properties(){return{indicators:{type:Object}}}handlePopup(a,b){a.stopPropagation(),Yb(this,b.hass,b.config.tap_action,b.entity.entity_id)}renderIcon(a){var{icon:b}=a;return b?Ya(i||(i=d(["<ha-icon style="," class='state__value_icon' .icon=","></ha-icon>"])),Vb(a.iconStyle),b):""}renderUnit(a){return a?Ya(j||(j=d(["<span class='state__uom'>","</span>"])),a):""}renderIndicator(a){if(!a)return"";var b=a.config&&a.config.tap_action&&a.config.tap_action.action,c=b&&bc.includes(b)?"pointer":"";return Ya(k||(k=d(["\n <div class='state ","' @click=",">\n ","\n <span class='state__value'>","</span>\n ","\n </div>\n "])),c,b=>this.handlePopup(b,a),this.renderIcon(a),a.value,this.renderUnit(a.unit))}render(){var a=this;return Ya(l||(l=d(["\n <div class='mc-indicators__container'>\n ","\n </div>\n "])),Object.entries(this.indicators).map(b=>a.renderIndicator(b[1])))}static get styles(){return xb(m||(m=d(["\n :host {\n position: relative;\n box-sizing: border-box;\n font-size: calc(var(--mc-unit) * .35);\n line-height: calc(var(--mc-unit) * .35);\n }\n .mc-indicators__container {\n display: flex;\n flex-wrap: wrap;\n margin-right: calc(var(--mc-unit) * .075);\n }\n .state {\n position: relative;\n display: flex;\n flex-wrap: nowrap;\n margin-right: calc(var(--mc-unit) * .1);\n }\n .pointer {\n cursor: pointer\n }\n .state__value_icon {\n height: calc(var(--mc-unit) * .475);\n width: calc(var(--mc-unit) * .5);\n color: var(--mc-icon-color);\n --mdc-icon-size: calc(var(--mc-unit) * 0.5);\n }\n .state__value {\n margin: 0 1px;\n font-weight: var(--mc-info-font-weight);\n line-height: calc(var(--mc-unit) * .475);\n }\n .state__uom {\n font-size: calc(var(--mc-unit) * .275);\n line-height: calc(var(--mc-unit) * .525);\n margin-left: 1px;\n height: calc(var(--mc-unit) * .475);\n opacity: 0.8;\n }\n "])))}}customElements.define("mc-indicators",dc);class ec extends zb{static get properties(){return{items:[],label:String,selected:String,icon:String,active:Boolean,disabled:Boolean}}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 Ya(n||(n=d(["\n <paper-menu-button\n class='mc-dropdown'\n noink no-animations\n .horizontalAlign=","\n .verticalAlign=","\n .verticalOffset=","\n .dynamicAlign=","\n ?disabled=","\n @click=",">\n <ha-icon-button class='mc-dropdown__button icon' slot='dropdown-trigger'\n .icon=","\n ?disabled=","\n ?color=",">\n <ha-icon .icon=","></ha-icon>\n </ha-icon-button>\n <paper-listbox slot=\"dropdown-content\" .selected="," @iron-select=",">\n ","\n </paper-listbox>\n </paper-menu-button>\n "])),"right","top",44,!0,this.disabled,a=>a.stopPropagation(),this.icon,this.disabled,this.active,this.icon,this.selectedId,this.onChange,this.items.map(a=>Ya(o||(o=d(["\n <paper-item value=",">\n <span class='mc-dropdown__item__label'>","</span>\n </paper-item>"])),a.id||a.name,a.name)))}static get styles(){return[Xb,xb(p||(p=d(["\n :host {\n position: relative;\n overflow: hidden;\n --paper-item-min-height: 40px;\n }\n paper-menu-button\n :host([disabled]) {\n opacity: .25;\n pointer-events: none;\n }\n :host([faded]) {\n opacity: .75;\n }\n .mc-dropdown {\n padding: 0;\n display: block;\n }\n ha-icon-button[disabled] {\n opacity: .25;\n pointer-events: none;\n }\n .mc-dropdown__button.icon {\n margin: 0;\n }\n ha-icon-button {\n width: calc(var(--mc-dropdown-unit));\n height: calc(var(--mc-dropdown-unit));\n --mdc-icon-button-size: calc(var(--mc-dropdown-unit));\n }\n paper-item > *:nth-child(2) {\n margin-left: 4px;\n }\n paper-menu-button[focused] ha-icon-button {\n color: var(--mc-accent-color);\n }\n paper-menu-button[focused] ha-icon-button[focused] {\n color: var(--mc-text-color);\n transform: rotate(0deg);\n }\n "])))]}}customElements.define("mc-dropdown-base",ec);class fc extends zb{constructor(){super(),this.mode={}}static get properties(){return{mode:{type:Object}}}get calcIcon(){if(this.selected){if(this.selected.icon)return this.selected.icon;if(void 0!==this.selected.id&&null!==this.selected.id){var a=this.selected.id.toString().toUpperCase();if(a in $b)return $b[a]}}return""}get selected(){return this.mode.source.find(a=>a.id===this.mode.state)||{}}get sources(){return this.mode.source.filter(a=>!a.hide).map(a=>({name:a.name,id:a.id,type:"source"}))}handleChange(a){a.stopPropagation();var b=a.detail.id;this.mode.handleChange(b)}render(){return Ya(q||(q=d(["\n <mc-dropdown-base\n @change=","\n .items=","\n .icon=","\n style=","\n .active=","\n .selected=",">\n </mc-dropdown-base>\n "])),this.handleChange,this.sources,this.calcIcon,Vb(this.mode.style),this.mode.isActive(this.mode.state),this.selected.id)}static get styles(){return xb(r||(r=d(["\n :host {\n min-width: calc(var(--mc-unit) * .85);\n --mc-dropdown-unit: calc(var(--mc-unit) * .75);\n --paper-item-min-height: var(--mc-unit);\n }\n "])))}}customElements.define("mc-mode-menu",fc);class gc extends zb{constructor(){super(),this.dropdown={},this.timer=void 0,this._state=void 0}static get properties(){return{dropdown:{type:Object}}}handleChange(a){var b=this;a.stopPropagation();var c=a.detail.id,{entity:d}=this.dropdown;return this._state=c,this.dropdown.handleChange(c),this.timer&&clearTimeout(this.timer),this.timer=setTimeout(f(function*(){if(b.dropdown.entity===d)return b._state=void 0!==b.dropdown.state&&null!==b.dropdown.state?b.dropdown.state.toString():"",b.requestUpdate("_state")}),this.dropdown.actionTimeout),this.requestUpdate("_state")}render(){return Ya(s||(s=d(["\n <mc-dropdown-base\n style=","\n @change=","\n .items=","\n .icon=","\n .disabled=\"","\"\n .active=","\n .selected=",">\n </mc-dropdown-base>\n "])),Vb(this.dropdown.style),a=>this.handleChange(a),this.dropdown.source,this.dropdown.icon,this.dropdown.disabled,this.dropdown.isActive(this._state),this._state)}updated(a){if(a.has("dropdown"))return this._state=void 0!==this.dropdown.state&&null!==this.dropdown.state?this.dropdown.state.toString():"",this.timer&&clearTimeout(this.timer),this.requestUpdate("_state")}static get styles(){return[Xb,xb(t||(t=d(["\n :host {\n position: relative;\n box-sizing: border-box;\n margin: 0;\n overflow: hidden;\n transition: background .5s;\n }\n :host([color]) {\n background: var(--mc-active-color);\n transition: background .25s;\n opacity: 1;\n }\n :host([disabled]) {\n opacity: .25;\n pointer-events: none;\n }\n "])))]}}customElements.define("mc-dropdown",gc);class hc extends zb{constructor(){super(),this._isOn=!1,this.timer=void 0}static get properties(){return{button:{type:Object}}}handleToggle(a){var b=this;a.stopPropagation();var{entity:c}=this.button;return this._isOn=!this._isOn,this.button.handleToggle(),this.timer&&clearTimeout(this.timer),this.timer=setTimeout(f(function*(){if(b.button.entity===c)return b._isOn=b.button.isOn,b.requestUpdate("_isOn")}),this.button.actionTimeout),this.requestUpdate("_isOn")}render(){return Ya(u||(u=d(["\n <ha-icon-button\n style=","\n .icon=","\n @click=","\n ?disabled=\"","\"\n ?color=",">\n <ha-icon .icon=","></ha-icon>\n </ha-icon-button>\n "])),Vb(this.button.style),this.button.icon,a=>this.handleToggle(a),this.button.disabled||this.button.isUnavailable,this._isOn,this.button.icon)}updated(a){if(a.has("button"))return this._isOn=this.button.isOn,this.timer&&clearTimeout(this.timer),this.requestUpdate("_isOn")}static get styles(){return[Xb,xb(v||(v=d(["\n :host {\n position: relative;\n box-sizing: border-box;\n margin: 0;\n overflow: hidden;\n transition: background .5s;\n }\n :host([color]) {\n background: var(--mc-active-color);\n transition: background .25s;\n opacity: 1;\n }\n :host([disabled]) {\n opacity: .25;\n pointer-events: none;\n }\n "])))]}}customElements.define("mc-button",hc);class ic extends zb{static get properties(){return{buttons:{}}}renderButton(a){return a.isUnavailable?"":Ya(w||(w=d(["\n <mc-button\n class=\"custom-button\"\n .button=",">\n </mc-button>\n "])),a)}renderDropdown(a){return Ya(x||(x=d(["\n <mc-dropdown\n .dropdown=",">\n </mc-dropdown>\n "])),a)}renderInternal(a){return"dropdown"===a.type?this.renderDropdown(a):this.renderButton(a)}render(){var a=this;return Ya(y||(y=d(["",""])),Object.entries(this.buttons).map(a=>a[1]).filter(a=>"main"!==a.location&&!a.hide).sort((c,a)=>c.order>a.order?1:a.order>c.order?-1:0).map(b=>a.renderInternal(b)))}static get styles(){return[Xb,xb(z||(z=d(["\n :host {\n position: relative;\n box-sizing: border-box;\n margin: 0;\n overflow: hidden;\n transition: background .5s;\n --paper-item-min-height: var(--mc-unit);\n --mc-dropdown-unit: var(--mc-unit);\n --mdc-icon-button-size: calc(var(--mc-unit));\n }\n :host([color]) {\n background: var(--mc-active-color);\n transition: background .25s;\n opacity: 1;\n }\n :host([disabled]) {\n opacity: .25;\n pointer-events: none;\n }\n mc-button {\n width: calc(var(--mc-unit));\n height: calc(var(--mc-unit));\n }\n "])))]}}customElements.define("mc-buttons",ic);class jc extends zb{static get properties(){return{temperature:Object,changing:Boolean,target:Number}}get targetStr(){var a=this.temperature.step.toString().split(".");return a[1]?parseFloat(this.target.toString()).toFixed(a[1].length):this.target}renderTemperature(){return void 0===this.temperature.value?"":Ya(A||(A=d(["\n <span class='state__value'>/</span>\n <span class='state__value'>","</span>"])),this.temperature.value)}render(){if(!this.temperature)return"";var a=this.changing?"changing":"",{unit:b}=this.temperature;return Ya(B||(B=d(["\n <div class='state ellipsis'>\n <span class='state__value ","'>","</span>\n ","\n <span class='state__uom'>","</span>\n </div>\n "])),a,this.targetStr,this.renderTemperature(),b)}static get styles(){return xb(C||(C=d(["\n .state {\n margin-top:calc(var(--mc-unit) * .15);\n }\n .state__value {\n font-weight: var(--mc-info-font-weight);\n line-height: calc(var(--mc-unit) * .475);\n font-size: calc(var(--mc-unit) * .475);\n }\n .state__uom {\n font-size: calc(var(--mc-unit) * 0.35);\n font-weight: var(--mc-name-font-weight);\n opacity: 0.6;\n line-height: calc(var(--mc-unit) * 0.475);\n }\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .changing {\n color: var(--mc-accent-color);\n }\n "])))}}customElements.define("mc-temperature",jc);class kc extends zb{constructor(){super(),this.timeout=800}static get properties(){return{targetTemperature:{type:Object}}}increment(a){a.stopPropagation();var b=this.targetTemperature.increment();b&&(this.temp_last_changed=Date.now(),this.targetTemperatureChanged())}decrement(a){a.stopPropagation();var b=this.targetTemperature.decrement();b&&(this.temp_last_changed=Date.now(),this.targetTemperatureChanged())}sendChangeEvent(a){var b=new CustomEvent("changing",{detail:{changing:a}});this.dispatchEvent(b)}targetTemperatureChanged(){this.temp_last_changed&&(this.sendChangeEvent(!0),window.setTimeout(()=>{var a=Date.now();if(a-this.temp_last_changed>=this.timeout){var{value:b}=this.targetTemperature;try{this.targetTemperature.update(b)}finally{this.sendChangeEvent(!1),this.temp_last_changed=null}}},this.timeout+10))}render(){return this.targetTemperature?Ya(D||(D=d(["\n <div class='controls-wrap'>\n <ha-icon-button class='temp --up'\n .icon=","\n @click=",">\n <ha-icon .icon=","></ha-icon>\n </ha-icon-button>\n <ha-icon-button class='temp --down'\n .icon=","\n @click=",">\n <ha-icon .icon=","></ha-icon>\n </ha-icon-button>\n </div>\n "])),this.targetTemperature.icons.up,a=>this.increment(a),this.targetTemperature.icons.up,this.targetTemperature.icons.down,a=>this.decrement(a),this.targetTemperature.icons.down):""}static get styles(){return xb(E||(E=d(["\n .controls-wrap {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n .temp {\n width: calc(var(--mc-unit) * .75);\n height: calc(var(--mc-unit) * .75);\n --mdc-icon-button-size: calc(var(--mc-unit) * .75);\n color: var(--mc-icon-color);\n }\n .temp.--up {\n margin-top: -2px;\n }\n .temp.--down {\n margin-top: -2px;\n }\n .temp.--down {\n margin-top: auto;\n }\n "])))}}customElements.define("mc-target-temperature",kc);class lc extends zb{constructor(){super(),this.fanMode={},this.config={},this.timer=void 0,this._selected={},this.source={}}static get properties(){return{fanMode:{type:Object},config:{type:Object}}}get selectedIndex(){return this.fanMode.source.map(a=>a.id).indexOf(this._selected.id)}handleChange(a){var b=this,c=a.target.selected;if(c!==this.selectedIndex&&this.fanMode.source[c]){clearTimeout(this.timer);var d=this.fanMode.source[c],{entity:e}=this.fanMode,g=this._selected;return this._selected=d,this.timer=setTimeout(f(function*(){if(b.fanMode.entity===e)return b._selected=g,b.requestUpdate("_selected")}),this.fanMode.actionTimeout),this.fanMode.handleChange(d.id),this.requestUpdate("_selected")}}renderFanMode(){var a=this._selected?this._selected.name:this.fanMode.state,b=this.config.secondary_info.icon?this.config.secondary_info.icon:this.fanMode.icon;return Ya(F||(F=d(["\n <ha-icon class='icon' .icon=","></ha-icon>\n <span class='name'>","</span>\n "])),b,a)}renderFanModeDropdown(){return Ya(G||(G=d(["\n <paper-menu-button\n class='mc-dropdown'\n noink no-animations\n .horizontalAlign=","\n .verticalAlign=","\n .verticalOffset=","\n ?disabled=","\n .dynamicAlign=",">\n <div class=\"wrap\" slot='dropdown-trigger'>\n ","\n </div>\n <paper-listbox slot=\"dropdown-content\" .selected="," @iron-select=",">\n ","\n </paper-listbox>\n </paper-menu-button>\n "])),"right","top",44,this.fanMode.disabled,!0,this.renderFanMode(),this.selectedIndex,this.handleChange,this.fanMode.source.map(a=>Ya(H||(H=d(["\n <paper-item value=",">\n <span class='mc-dropdown__item__label'>","</span>\n </paper-item>"])),a.id||a.name,a.name)))}render(){var{type:a}=this.config.secondary_info;return"fan-mode-dropdown"===a?this.renderFanModeDropdown():this.renderFanMode()}updated(a){a.has("fanMode")&&(clearTimeout(this.timer),this._selected=this.fanMode.selected,this.requestUpdate("_selected").then())}static get styles(){return[Xb,xb(I||(I=d(["\n paper-menu-button {\n padding: 0;\n }\n .name {\n font-size: calc(var(--mc-unit) * .35);\n font-weight: var(--mc-info-font-weight);\n line-height: calc(var(--mc-unit) * .5);\n vertical-align: middle;\n display: inline-block;\n }\n .icon {\n color: var(--mc-icon-color);\n height: calc(var(--mc-unit) * .475);\n width: calc(var(--mc-unit) * .5);\n min-width: calc(var(--mc-unit) * .5);\n --mdc-icon-size: calc(var(--mc-unit) * 0.5);\n }\n "])))]}}customElements.define("mc-fan-mode-secondary",lc);class mc extends zb{constructor(){super(),this.fanMode={},this.hvacMode={},this.config={},this.climate={}}static get properties(){return{fanMode:{type:Object},config:{type:Object},hvacMode:{type:Object},climate:{type:Object}}}renderHvacAction(){var a=this.climate.hvacAction;if(!a)return"";var b=a.icon?a.icon:this.config.secondary_info.icon,c=b?"":"gray";return Ya(J||(J=d(["\n ","\n <span class='name ","'>","</span>\n "])),b?Ya(K||(K=d(["<ha-icon class='icon' .icon=","></ha-icon>"])),b):"",c,a.name)}renderHvacMode(){var{hvacMode:a}=this,b=a.selected||{},c=b.icon?b.icon:this.config.secondary_info.icon;return Ya(L||(L=d(["\n ","\n <span class='name'>","</span>\n "])),c?Ya(M||(M=d(["<ha-icon class='icon' .icon=","></ha-icon>"])),c):"",b.name)}render(){var{type:a}=this.config.secondary_info;return"hvac-mode"===a?this.renderHvacMode():"hvac-action"===a?this.renderHvacAction():"last-changed"===a?Ya(N||(N=d(["<ha-relative-time .hass="," .datetime=","></ha-relative-time>"])),this.climate.hass,this.climate.lastChanged):Ya(O||(O=d(["<mc-fan-mode-secondary .fanMode="," .config=","></mc-fan-mode-secondary>"])),this.fanMode,this.config)}static get styles(){return[Xb,xb(P||(P=d(["\n ha-relative-time, .gray {\n color: #727272;\n }\n .name {\n font-size: calc(var(--mc-unit) * .35);\n font-weight: var(--mc-info-font-weight);\n line-height: calc(var(--mc-unit) * .5);\n vertical-align: middle;\n display: inline-block;\n }\n .icon {\n color: var(--mc-icon-color);\n height: calc(var(--mc-unit) * .475);\n width: calc(var(--mc-unit) * .5);\n min-width: calc(var(--mc-unit) * .5);\n --mdc-icon-size: calc(var(--mc-unit) * 0.5);\n }\n "])))]}}customElements.define("mc-secondary-info",mc);var nc=a=>a?_b.includes(a)||ac.includes(a)?_b.includes(a)&&!ac.includes(a)?"on":a:"off":a,oc=(a,b)=>a?b?b.attribute?a.attributes[b.attribute]:a.state:a.state:void 0,pc=(a,b)=>+"".concat(c(+"".concat(a,"e").concat(b)),"e-").concat(b),qc=(a,b)=>{try{return new Function("","return ".concat(a)).call(b||{})}catch(b){throw new Error("\n[COMPILE ERROR]: [".concat(b.toString(),"]\n[SOURCE]: ").concat(a,"\n"))}};class rc{constructor(a,b,c){this.temperatureEntity=a||{},this.targetTemperatureEntity=b||{},this.config=c}get unit(){return this.config.temperature.unit||this.config.target_temperature.unit}get step(){var a=this.targetTemperatureEntity;return"step"in this.config.target_temperature?this.config.target_temperature.step:a&&a.attributes&&a.attributes.target_temp_step?a.attributes.target_temp_step:1}get value(){var a=this.rawValue;if(a!==void 0){if("fixed"in this.config.temperature)return parseFloat(a.toString()).toFixed(this.config.temperature.fixed);if("round"in this.config.temperature)return pc(a,this.config.temperature.round)}return a}get rawValue(){return oc(this.temperatureEntity,this.config.temperature.source)}}class sc{constructor(a,b,c){this.entity=a||{},this.config=b,this._hass=c,this.min=this.getMin(),this.max=this.getMax(),this.step=this.getStep()}get hass(){return this._hass}get icons(){return this.config.target_temperature.icons}getStep(){return"step"in this.config.target_temperature?parseFloat(this.config.target_temperature.step):this.entity&&this.entity.attributes&&this.entity.attributes.target_temp_step?parseFloat(this.entity.attributes.target_temp_step):1}getMin(){return"min"in this.config.target_temperature?parseFloat(this.config.target_temperature.min):this.entity&&this.entity.attributes&&this.entity.attributes.min_temp?parseFloat(this.entity.attributes.min_temp):16}getMax(){return"max"in this.config.target_temperature?parseFloat(this.config.target_temperature.max):this.entity&&this.entity.attributes&&this.entity.attributes.max_temp?parseFloat(this.entity.attributes.max_temp):30}_floatOrPlaceholder(b){return a(b)?cc:b}get value(){if(this._targetTemperature!==void 0)return this._floatOrPlaceholder(parseFloat(this._targetTemperature));var a=oc(this.entity,this.config.target_temperature.source);return this._floatOrPlaceholder(parseFloat(a))}set value(a){this._targetTemperature=parseFloat(a)}increment(){var a=this.value;if(a===cc)return!1;var b=this._round(this.value+this.step);return this.value=b<=this.max?b<=this.min?this.min:b:this.max,a!==this.value}decrement(){var a=this.value;if(a===cc)return!1;var b=this._round(this.value-this.step);return this.value=b>=this.min?b:this.min,a!==this.value}_round(a){var b=this.step.toString().split(".");return b[1]?parseFloat(a.toFixed(b[1].length)):c(a)}update(a){if(this.config.target_temperature.functions.change_action){var b=this.hass[this.config.entity];return this.config.target_temperature.functions.change_action(a,this.entity,b)}return this.hass.callService("climate","set_temperature",{entity_id:this.entity.entity_id,temperature:a})}}class tc{constructor(a,b,c,d){this.config=b||{},this.entity=a||{},this.climate=c||{},this._hass=d||{}}get id(){return this.config.id}get location(){return this.config.location||"bottom"}get hass(){return this._hass}get type(){return this.config.type}get order(){return this.config.order}get hide(){return this.config.hide}get icon(){return this.config.icon}get originalState(){return oc(this.entity,this.config.state)}get state(){var a=this.originalState;return this.config.functions.state&&this.config.functions.state.mapper&&(a=this.config.functions.state.mapper(a,this.entity,this.climate.entity,this.climate.mode)),a}isActive(a){return!!this.config.functions.active&&this.config.functions.active(a,this.entity,this.climate.entity,this.climate.mode)}get isUnavailable(){return this.entity===void 0||ac.includes(this.state)}get isOn(){return this.entity!==void 0&&!_b.includes(this.state)&&!ac.includes(this.state)}get disabled(){return!!this.config.functions.disabled&&this.config.functions.disabled(this.state,this.entity,this.climate.entity,this.climate.mode)}get style(){return this.config.functions.style?this.config.functions.style(this.state,this.entity,this.climate.entity,this.climate.mode)||{}:{}}get source(){var{functions:a}=this.config,c=Object.entries(this.config.source||{}).filter(a=>{var[b]=a;return"__filter"!==b}).map(a=>{var[c,d]=a;return"object"==typeof d?b({id:c},d||{}):{id:c,name:d}});return c.some(a=>"order"in a)&&(c=c.sort((c,a)=>c.order>a.order?1:a.order>c.order?-1:0)),a.source&&a.source.filter?a.source.filter(c,this.state,this.entity,this.climate.entity,this.climate.mode):c}get selected(){var{state:a}=this;return void 0===a||null===a?void 0:this.source.find(b=>b.id===a.toString())}get actionTimeout(){return"action_timeout"in this.config?this.config.action_timeout:2e3}handleToggle(){return this.config.functions.toggle_action?this.config.functions.toggle_action(this.state,this.entity,this.climate.entity,this.climate.mode):this.climate.callService("switch","toggle",{entity_id:this.entity.entity_id})}handleChange(a){return this.config.functions.change_action?this.config.functions.change_action(a,this.state,this.entity,this.climate.entity,this.climate.mode):void 0}}class uc{constructor(a,b,c,d){this.config=b||{},this.entity=a||{},this.climate=c||{},this._hass=d||{}}get id(){return this.config.id}get hass(){return this._hass}get originalValue(){return oc(this.entity,this.config.source)}get value(){var b=this.originalValue;return this.config.functions.mapper&&(b=this.config.functions.mapper(b,this.entity,this.climate.entity,this.climate.mode)),"round"in this.config&&!1===a(b)&&(b=pc(b,this.config.round)),b}get unit(){return this.config.unit}get icon(){if(this.config.functions.icon&&this.config.functions.icon.template)return this.config.functions.icon.template(this.value,this.entity,this.climate.entity,this.climate.mode);return this.config.icon&&"string"==typeof this.config.icon?this.config.icon:""}get iconStyle(){return this.config.functions.icon&&this.config.functions.icon.style?this.config.functions.icon.style(this.value,this.entity,this.climate.entity,this.climate.mode)||{}:{}}}class vc{constructor(a,c,d){this.hass=a||{},this.config=c||{},this.entity=d||{},this.state=d.state,this.attr=b({friendly_name:"",temperature:16,current_temperature:24,fan_mode:"",hvac_modes:[],target_temp_step:void 0,min_temp:void 0,max_temp:void 0,hvac_action:"",fan_modes:[]},d.attributes||{})}get lastChanged(){return this.entity.last_changed}get hvacAction(){var a=this.config.secondary_info&&this.config.secondary_info.source||{},c=this.attr.hvac_action,d={id:c};return d.name=Zb(this.hass,["".concat("state_attributes.climate.hvac_action",".").concat(c)],c),c in a&&("string"==typeof a[c]?d.name=a[c]:d=b(b({},d),a[c])),d}get mode(){return this._hvac_mode}set mode(a){this._hvac_mode=a}get defaultHvacModes(){for(var a=this.attr.hvac_modes,b=[],c=0;c<a.length;c+=1){var d=a[c],e=["state.climate.".concat(d),"component.climate.state._.".concat(d)],f={id:d,name:Zb(this.hass,e,d)},g=d.toString().toUpperCase();g in $b&&(f.icon=$b[g]),b.push(f)}return b}get defaultFanModes(){for(var a,b=this.attr.fan_modes,c={},d=0;d<b.length;d+=1)a=b[d],c[a]=Zb(this.hass,["".concat("state_attributes.climate.fan_mode",".").concat(a)],a);return c}get id(){return this.entity.entity_id}get icon(){return this.attr.icon}get name(){return this.attr.friendly_name||""}get isOff(){return this.entity!==void 0&&_b.includes(this.state)&&!ac.includes(this.state)}get isActive(){return!1===this.isOff&&!1===this.isUnavailable||!1}get isUnavailable(){return this.entity===void 0||ac.includes(this.state)}get isOn(){return this.entity!==void 0&&!_b.includes(this.state)&&!ac.includes(this.state)}callService(a,c,d){return this.hass.callService(a,c,b({entity_id:this.config.entity},d))}}class wc{constructor(a,b,c){this.config=b||{},this.entity=a||{},this.climate=c||{}}get hide(){return this.config.hide}get originalState(){return oc(this.entity,this.config.state)}get state(){var a=this.originalState;return this.config.functions.state&&this.config.functions.state.mapper&&(a=this.config.functions.state.mapper(a,this.entity,this.climate.entity)),a}isActive(a){return!!this.config.functions.active&&this.config.functions.active(a,this.entity,this.climate.entity)}get disabled(){return!!this.config.functions.disabled&&this.config.functions.disabled(this.state,this.entity,this.climate.entity)}get style(){return this.config.functions.style?this.config.functions.style(this.state,this.entity,this.climate.entity)||{}:{}}get source(){var{functions:a}=this.config,c=Object.entries(this.config.source||{}).filter(a=>{var[b]=a;return"__filter"!==b}).map(a=>{var[c,d]=a;return"object"==typeof d?b({id:c},d||{}):{id:c,name:d}});return c.some(a=>"order"in a)&&(c=c.sort((c,a)=>c.order>a.order?1:a.order>c.order?-1:0)),a.source&&a.source.filter?a.source.filter(c,this.state,this.entity,this.climate.entity):c}get selected(){var{state:a}=this;return void 0===a||null===a?void 0:this.source.find(b=>b.id===a.toString())}handleChange(a){return this.config.functions.change_action?this.config.functions.change_action(a,this.entity,this.climate.entity):void 0}}customElements.get("ha-icon-button")||customElements.define("ha-icon-button",class extends customElements.get("paper-icon-button"){});class xc extends zb{constructor(){super(),this.initial=!0,this.toggle=!1,this.temperature={},this.targetTemperature={},this.buttons={},this.indicators={},this.hvacMode={},this.targetTemperatureChanging=!1,this.climate={},this.targetTemperatureValue=0,this.width=0}static get properties(){return{_hass:{type:Object},config:{type:Object},entity:{type:Object},climate:{type:Object},initial:{type:Boolean},toggle:{type:Boolean}}}static get styles(){return[Xb,Wb]}set hass(a){if(a){var b=a.states[this.config.entity];this._hass=a;var c=!1;b&&this.entity!==b&&(this.entity=b,this.climate=new vc(a,this.config,b),c=!0),this.updateIndicators(c),this.updateButtons(c),this.updateTemperature(c),this.updateTargetTemperature(c),this.updateHvacMode(c),this.climate.mode=this.hvacMode.selected}}get hass(){return this._hass}get name(){return this.config.name||this.climate.name}updateIndicators(a){for(var b={},c=!1,d=0;d<this.config.indicators.length;d+=1){var e=this.config.indicators[d],{id:f}=e,g=e.source.entity||this.climate.id,h=this.hass.states[g];h&&(b[f]=new uc(h,e,this.climate,this.hass)),h!==(this.indicators[f]&&this.indicators[f].entity)&&(c=!0)}(c||a)&&(this.indicators=b)}updateTemperature(a){if(!this.targetTemperatureChanging){var b=this.config.temperature.source.entity||this.config.entity,c=this.hass.states[b],d=this.config.target_temperature.source&&this.config.target_temperature.source.entity||this.config.entity,e=this.hass.states[d],f=new rc(c,e,this.config);(this.temperature.rawValue!==f.rawValue||this.temperature.target!==f.target||a)&&(this.temperature=f)}}updateTargetTemperature(a){if(!this.targetTemperatureChanging){var b=this.config.target_temperature.source&&this.config.target_temperature.source.entity||this.config.entity,c=this.hass.states[b];(this.targetTemperature.entity!==c||a)&&(this.targetTemperature=new sc(c,this.config,this.hass),this.targetTemperatureValue=this.targetTemperature.value)}}updateHvacMode(a){var b=this.config.hvac_mode,c=b.state&&b.state.entity||this.climate.id,d=this.hass.states[c];(d&&d!==(this.hvacMode&&this.hvacMode.entity)||a)&&(this.hvacMode=new wc(d,b,this.climate))}updateButtons(a){for(var b={},c=!1,d=0;d<this.config.buttons.length;d+=1){var e=this.config.buttons[d],{id:f}=e,g=e.state&&e.state.entity||this.climate.id,h=this.hass.states[g];h&&(b[f]=new tc(h,e,this.climate,this.hass)),h!==(this.buttons[f]&&this.buttons[f].entity)&&(c=!0)}(c||a)&&(this.buttons=b)}getButtonsConfig(a){for(var b=Object.entries(a.buttons||{}),c=[],d=0;d<b.length;d+=1){var e=b[d][0],f=b[d][1],g=this.getButtonConfig(f,a);g.id=e,"order"in g||(g.order=d+1),c.push(g)}return c}getButtonConfig(a,c){var d=b({icon:"mdi:radiobox-marked",type:"button",toggle_action:void 0},a);d.functions={};var e=b({},a);return e.call_service=(a,b,c)=>this.hass.callService(a,b,c),e.entity_config=c,e.toggle_state=nc,d.disabled&&(d.functions.disabled=qc(d.disabled,e)),d.state&&d.state.mapper&&(d.functions.state={mapper:qc(d.state.mapper,e)}),d.active&&(d.functions.active=qc(d.active,e)),d.source&&d.source.__filter&&(d.functions.source={filter:qc(d.source.__filter,e)}),d.toggle_action&&(d.functions.toggle_action=qc(d.toggle_action,e)),d.change_action&&(d.functions.change_action=qc(d.change_action,e)),d.style&&(d.functions.style=qc(d.style,e)),d}getFanModeConfig(a){var c=b({id:"fan_mode",icon:"mdi:fan",type:"dropdown",order:0,state:{attribute:"fan_mode"},change_action:(a,b,c)=>{var d={fan_mode:a,entity_id:c.entity_id};return this.call_service("climate","set_fan_mode",d)}},a.fan_mode||{});c=this.getButtonConfig(c,a);var{functions:d}=c;return d.active||(d.active=()=>this.climate.isOn),c}getIndicatorConfig(a,c,d){var e=b({id:a,source:{enitity:void 0,attribute:void 0,mapper:void 0},icon:""},c);e.tap_action="string"==typeof c.tap_action?{action:c.tap_action}:b({action:"none"},e.tap_action||{}),e.functions=e.functions||{};var f=b({},c);return f.entity_config=d,f.toggle_state=nc,e.source.mapper&&(e.functions.mapper=qc(e.source.mapper,f)),"object"==typeof e.icon&&(e.functions.icon={},e.icon.template&&(e.functions.icon.template=qc(e.icon.template,f)),e.icon.style&&(e.functions.icon.style=qc(e.icon.style,f))),e}getIndicatorsConfig(a){return Object.entries(a.indicators||{}).map(b=>this.getIndicatorConfig(b[0],b[1]||{},a)).filter(a=>!a.hide)}getTargetTemperatureConfig(a){var c=b({unit:"\xB0C",source:{entity:void 0,attribute:"temperature"}},a.target_temperature||{});c.icons=b({up:$b.UP,down:$b.DOWN},c.icons||{}),c.functions={};var d=b({},a.target_temperature||{});return d.call_service=(a,b,c)=>this.hass.callService(a,b,c),d.entity_config=a,d.toggle_state=nc,c.change_action&&(c.functions.change_action=qc(c.change_action,d)),c}getHvacModeConfig(a){var c=b({type:"dropdown",change_action:(a,b)=>{var c={hvac_mode:a,entity_id:b.entity_id};return this.call_service("climate","set_hvac_mode",c)}},a.hvac_mode||{});c=this.getButtonConfig(c,this.config);var{functions:d}=c;return d.active||(d.active=()=>this.climate.isOn),c}setConfig(a){var c=["climate","fan"];if(!a.entity||!1===c.includes(a.entity.split(".")[0]))throw new Error("Specify an entity from within domains: [".concat(c.join(", "),"]."));this.config=b({tap_action:{action:"more-info",navigation_path:"",url:"",entity:"",service:"",service_data:{}}},a),this.config.indicators=this.getIndicatorsConfig(a),this.config.buttons=this.getButtonsConfig(a),this.fanModeConfig=this.getFanModeConfig(a),this.config.buttons.push(this.fanModeConfig),this.config.target_temperature=this.getTargetTemperatureConfig(a),this.config.temperature=b({round:1,unit:"\xB0C",source:{entity:void 0,attribute:"current_temperature"}},a.temperature||{}),this.config.hvac_mode=this.getHvacModeConfig(this.config),this.config.toggle=b({icon:$b.TOGGLE,hide:!1,default:!1},a.toggle||{}),this.config.secondary_info="string"==typeof a.secondary_info?{type:a.secondary_info}:b({type:"fan_mode"},a.secondary_info||{}),this.toggle=this.config.toggle.default}renderCtlWrap(){if(this.climate.isUnavailable)return Ya(Q||(Q=d(["\n <span class=\"label ellipsis\"> \n ","\n </span>\n "])),Zb(this.hass,["state.default.unavailable"],"Unavailable"));var a=Object.entries(this.buttons).map(a=>a[1]).filter(a=>"main"===a.location&&!a.hide).sort((c,a)=>c.order>a.order?1:a.order>c.order?-1:0);return Ya(R||(R=d(["\n ","\n ","\n <mc-temperature\n .temperature=","\n .target=","\n .changing=",">\n </mc-temperature>\n "])),a.map(a=>"dropdown"===a.type?Ya(S||(S=d(["<mc-dropdown .dropdown=","></mc-dropdown>"])),a):Ya(T||(T=d(["<mc-button .button=","></mc-button>"])),a)),this.hvacMode.hide?"":Ya(U||(U=d(["<mc-mode-menu .mode=","></mc-mode-menu>"])),this.hvacMode),this.temperature,this.targetTemperatureValue,this.targetTemperatureChanging)}renderEntityControls(){return this.climate.isUnavailable?"":Ya(V||(V=d(["\n <div class=\"entity__controls\">\n <mc-target-temperature\n .targetTemperature=","\n @changing=\"","\">\n </mc-target-temperature>\n </div>\n "])),this.targetTemperature,a=>this.handleChangingTargetTemperature(a))}render(){var a="fan-mode-dropdown"!==this.config.secondary_info.type;return Ya(W||(W=d(["\n <ha-card\n class=","\n style=",">\n <div class='mc__bg'></div>\n <div class='mc-climate'>\n <div class='mc-climate__core flex'>\n ","\n <div class='entity__info'>\n <div class=\"wrap\">\n <div class=\"entity__info__name_wrap\" @click=",">\n ","\n </div>\n <div class=\"ctl-wrap ellipsis\">\n ","\n </div>\n </div>\n ","\n </div>\n ","\n </div>\n ","\n </div>\n </ha-card>\n "])),this.computeClasses(),this.computeStyles(),this.renderIcon(),b=>this.handlePopup(b,a),this.renderEntityName(),this.renderCtlWrap(),this.renderBottomPanel(),this.renderEntityControls(),this.renderTogglePanel())}handleChangingTargetTemperature(a){return this.targetTemperatureValue=this.targetTemperature.value,this.targetTemperatureChanging=a.detail.changing,this.requestUpdate("targetTemperatureChanging")}handlePopup(a,b){b&&(a.stopPropagation(),Yb(this,this.hass,this.config.tap_action,this.climate.id))}handleToggle(a){a.stopPropagation(),this.toggle=!this.toggle}toggleButtonCls(){return this.toggle?"open":""}renderIcon(){var a=this.climate.isActive;return Ya(X||(X=d(["\n <div class='entity__icon' ?color=",">\n <ha-icon .icon="," ></ha-icon>\n </div>"])),a,this.computeIcon())}renderTogglePanel(){return this.toggle?Ya(Y||(Y=d(["\n <div class=\"mc-toggle_content\">\n <mc-buttons\n .buttons=",">\n </mc-buttons>\n </div>\n "])),this.buttons):""}renderBottomPanel(){return this.climate.isUnavailable?"":Ya(Z||(Z=d(["\n <div class='bottom flex'>\n <mc-indicators\n .indicators=",">\n </mc-indicators>\n ","\n </div>\n "])),this.indicators,this.renderToggleButton())}renderToggleButton(){return 0===this.config.buttons.filter(a=>!a.hide&&"main"!==a.location).length?"":this.config.toggle.hide?"":Ya($||($=d(["\n <ha-icon-button class='toggle-button ","'\n .icon=","\n @click=",">\n <ha-icon .icon=","></ha-icon>\n </ha-icon-button>\n "])),this.toggleButtonCls(),this.config.toggle.icon,a=>this.handleToggle(a),this.config.toggle.icon)}renderEntityName(){return Ya(_||(_=d(["\n <div class='entity__info__name' @click=",">\n ","\n </div>\n ","\n "])),a=>this.handlePopup(a,!0),this.name,this.renderSecondaryInfo())}renderSecondaryInfo(){return this.climate.isUnavailable?"":Ya(aa||(aa=d(["\n <div class='entity__secondary_info ellipsis'>\n <mc-secondary-info\n .climate=","\n .config=","\n .hvacMode=","\n .fanMode=",">\n </mc-secondary-info>\n </div>"])),this.climate,this.config,this.hvacMode,this.buttons.fan_mode)}computeIcon(){return this.config.icon?this.config.icon:this.climate.icon||$b.DEFAULT}computeClasses(){var{config:a}=0<arguments.length&&arguments[0]!==void 0?arguments[0]:this;return Tb({"--initial":this.initial,"--collapse":a.collapse,"--group":a.group,"--more-info":"none"!==a.tap_action,"--inactive":!this.climate.isActive,"--unavailable":this.climate.isUnavailable})}computeStyles(){var{scale:a}=this.config;return Vb(b(b({},a&&{"--mc-unit":"".concat(40*a,"px")}),{"--mc-card-width":"".concat(this.width,"px")}))}initDefaultFanModeSource(){var a=this.fanModeConfig,c=Object.entries(a.source||{}).filter(a=>"__filter"!==a[0]),{entity:d}=this.climate;d&&0===c.length&&d.attributes&&d.attributes.fan_modes&&(a.source=b(b({},this.climate.defaultFanModes),a.source||{}))}initDefaultHvacModeSource(){var a=this.config.hvac_mode,c=Object.entries(a.source||{}).filter(a=>"__filter"!==a[0]),{entity:d}=this.climate;d&&0===c.length&&(a.source=b(b({},this.climate.defaultHvacModes),a.source||{}))}firstUpdated(a){super.firstUpdated(a),a.has("climate")&&(this.initDefaultFanModeSource(),this.initDefaultHvacModeSource(),this.requestUpdate("climate").then()),a.has("targetTemperature")&&(this.targetTemperatureValue=this.targetTemperature.value,this.requestUpdate("targetTemperatureValue").then());var b=new Qb(a=>{var b=a.find(a=>a.target===this);b&&b.contentRect&&this.width!==b.contentRect.width&&(this.width=b.contentRect.width,this.requestUpdate("width").then())});b.observe(this)}}customElements.define("mini-climate",xc)})})(); |
what do you mean by HACStag query parameter? example?
Got it.. thanks for the temporary solutions
Got it.. thanks for the temporary solutions
don't mention it
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps: