From 0f066ee8c184c030a2f71585e71d27d36e5ad8bd Mon Sep 17 00:00:00 2001 From: "Shaun J.V.Nieuwenhuizen" Date: Sat, 16 Mar 2024 22:08:00 +0200 Subject: [PATCH 1/9] Improve custom entity handling and add more unit handling This commit improves the handling of custom entities, particularly focusing on ensuring the state is not null, undefined, or unknown. It also adds various system features such as conversion from a state to power and auto conversion from a state to kilowatts. In addition, units of electrical current, energy, and power were added to provide spatial and time recognizability context to the measures. This enhancement results in a more detailed and accurate representation of data. It also includes adjustments in energy conversion for better precision and clarity. --- dist/sunsynk-power-flow-card.js | 22 +- package.json | 2 +- src/cards/compact-card.ts | 474 +++++++++-------------------- src/cards/full-card.ts | 406 ++++++------------------ src/const.ts | 49 +++ src/helpers/icons.ts | 6 + src/helpers/utils.ts | 85 ++---- src/index.ts | 24 +- src/inverters/dto/custom-entity.ts | 23 +- src/types.ts | 93 +++--- 10 files changed, 399 insertions(+), 785 deletions(-) create mode 100644 src/helpers/icons.ts diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index fa055061..e6d1ca95 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -1,38 +1,38 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).SunsynkPowerFlowCard={})}(this,(function(t){"use strict";function e(t,e,n,a){var o,r=arguments.length,i=r<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,n,a);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(r<3?o(i):r>3?o(e,n,i):o(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i}"function"==typeof SuppressedError&&SuppressedError; +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SunsynkPowerFlowCard={})}(this,(function(e){"use strict";function t(e,t,n,o){var a,r=arguments.length,i=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i}"function"==typeof SuppressedError&&SuppressedError; /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const n=globalThis,a=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),r=new WeakMap;let i=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(a&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=r.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&r.set(e,t))}return t}toString(){return this.cssText}};const s=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,a)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[a+1]),t[0]);return new i(n,t,o)},l=(t,e)=>{if(a)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const a of e){const e=document.createElement("style"),o=n.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=a.cssText,t.appendChild(e)}},d=a?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return(t=>new i("string"==typeof t?t:t+"",void 0,o))(e)})(t):t +const n=globalThis,o=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),r=new WeakMap;let i=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(o&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=r.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&r.set(t,e))}return e}toString(){return this.cssText}};const s=(e,...t)=>{const n=1===e.length?e[0]:t.reduce(((t,n,o)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[o+1]),e[0]);return new i(n,e,a)},l=(e,t)=>{if(o)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const o of t){const t=document.createElement("style"),a=n.litNonce;void 0!==a&&t.setAttribute("nonce",a),t.textContent=o.cssText,e.appendChild(t)}},d=o?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new i("string"==typeof e?e:e+"",void 0,a))(t)})(e):e /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */,{is:c,defineProperty:u,getOwnPropertyDescriptor:h,getOwnPropertyNames:p,getOwnPropertySymbols:y,getPrototypeOf:g}=Object,m=globalThis,f=m.trustedTypes,v=f?f.emptyScript:"",w=m.reactiveElementPolyfillSupport,_=(t,e)=>t,x={toAttribute(t,e){switch(e){case Boolean:t=t?v:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},b=(t,e)=>!c(t,e),A={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:b};Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;let L=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=A){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),a=this.getPropertyDescriptor(t,n,e);void 0!==a&&u(this.prototype,t,a)}}static getPropertyDescriptor(t,e,n){const{get:a,set:o}=h(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return a?.call(this)},set(e){const r=a?.call(this);o.call(this,e),this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??A}static _$Ei(){if(this.hasOwnProperty(_("elementProperties")))return;const t=g(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(_("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_("properties"))){const t=this.properties,e=[...p(t),...y(t)];for(const n of e)this.createProperty(n,t[n])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,n]of e)this.elementProperties.set(t,n)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(d(t))}else void 0!==t&&e.push(d(t));return e}static _$Eu(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return l(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EC(t,e){const n=this.constructor.elementProperties.get(t),a=this.constructor._$Eu(t,n);if(void 0!==a&&!0===n.reflect){const o=(void 0!==n.converter?.toAttribute?n.converter:x).toAttribute(e,n.type);this._$Em=t,null==o?this.removeAttribute(a):this.setAttribute(a,o),this._$Em=null}}_$AK(t,e){const n=this.constructor,a=n._$Eh.get(t);if(void 0!==a&&this._$Em!==a){const t=n.getPropertyOptions(a),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:x;this._$Em=a,this[a]=o.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,n){if(void 0!==t){if(n??=this.constructor.getPropertyOptions(t),!(n.hasChanged??b)(this[t],e))return;this.P(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,n){this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,n]of t)!0!==n.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}};L.elementStyles=[],L.shadowRootOptions={mode:"open"},L[_("elementProperties")]=new Map,L[_("finalized")]=new Map,w?.({ReactiveElement:L}),(m.reactiveElementVersions??=[]).push("2.0.4"); + */,{is:c,defineProperty:u,getOwnPropertyDescriptor:h,getOwnPropertyNames:p,getOwnPropertySymbols:g,getPrototypeOf:y}=Object,m=globalThis,f=m.trustedTypes,v=f?f.emptyScript:"",w=m.reactiveElementPolyfillSupport,_=(e,t)=>e,x={toAttribute(e,t){switch(t){case Boolean:e=e?v:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},b=(e,t)=>!c(e,t),A={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:b};Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;let P=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=A){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),o=this.getPropertyDescriptor(e,n,t);void 0!==o&&u(this.prototype,e,o)}}static getPropertyDescriptor(e,t,n){const{get:o,set:a}=h(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return o?.call(this)},set(t){const r=o?.call(this);a.call(this,t),this.requestUpdate(e,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??A}static _$Ei(){if(this.hasOwnProperty(_("elementProperties")))return;const e=y(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(_("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_("properties"))){const e=this.properties,t=[...p(e),...g(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(d(e))}else void 0!==e&&t.push(d(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return l(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){const n=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,n);if(void 0!==o&&!0===n.reflect){const a=(void 0!==n.converter?.toAttribute?n.converter:x).toAttribute(t,n.type);this._$Em=e,null==a?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,t){const n=this.constructor,o=n._$Eh.get(e);if(void 0!==o&&this._$Em!==o){const e=n.getPropertyOptions(o),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:x;this._$Em=o,this[o]=a.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){if(n??=this.constructor.getPropertyOptions(e),!(n.hasChanged??b)(this[e],t))return;this.P(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e)!0!==n.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],n)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}};P.elementStyles=[],P.shadowRootOptions={mode:"open"},P[_("elementProperties")]=new Map,P[_("finalized")]=new Map,w?.({ReactiveElement:P}),(m.reactiveElementVersions??=[]).push("2.0.4"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const P=globalThis,E=P.trustedTypes,N=E?E.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",M=`lit$${(Math.random()+"").slice(9)}$`,T="?"+M,k=`<${T}>`,S=document,I=()=>S.createComment(""),D=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,H="[ \t\n\f\r]",z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,G=/>/g,V=RegExp(`>|${H}(?:([^\\s"'>=/]+)(${H}*=${H}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,q=/"/g,j=/^(?:script|style|textarea|title)$/i,Z=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),W=Z(1),U=Z(2),F=Symbol.for("lit-noChange"),Q=Symbol.for("lit-nothing"),X=new WeakMap,Y=S.createTreeWalker(S,129);function J(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==N?N.createHTML(e):e}const K=(t,e)=>{const n=t.length-1,a=[];let o,r=2===e?"":"",i=z;for(let e=0;e"===l[0]?(i=o??z,d=-1):void 0===l[1]?d=-2:(d=i.lastIndex-l[2].length,s=l[1],i=void 0===l[3]?V:'"'===l[3]?q:R):i===q||i===R?i=V:i===B||i===G?i=z:(i=V,o=void 0);const u=i===V&&t[e+1].startsWith("/>")?" ":"";r+=i===z?n+k:d>=0?(a.push(s),n.slice(0,d)+C+n.slice(d)+M+u):n+M+(-2===d?e:u)}return[J(t,r+(t[n]||"")+(2===e?"":"")),a]};class ${constructor({strings:t,_$litType$:e},n){let a;this.parts=[];let o=0,r=0;const i=t.length-1,s=this.parts,[l,d]=K(t,e);if(this.el=$.createElement(l,n),Y.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(a=Y.nextNode())&&s.length0){a.textContent=E?E.emptyScript:"";for(let n=0;nO(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==Q&&D(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,a="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=$.createElement(J(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===a)this._$AH.p(e);else{const t=new et(a,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=X.get(t.strings);return void 0===e&&X.set(t.strings,e=new $(t)),e}k(t){O(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,a=0;for(const o of t)a===e.length?e.push(n=new nt(this.S(I()),this.S(I()),this,this.options)):n=e[a],n._$AI(o),a++;a2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Q}_$AI(t,e=this,n,a){const o=this.strings;let r=!1;if(void 0===o)t=tt(this,t,e,0),r=!D(t)||t!==this._$AH&&t!==F,r&&(this._$AH=t);else{const a=t;let i,s;for(t=o[0],i=0;ie}):void 0,T="$lit$",M=`lit$${(Math.random()+"").slice(9)}$`,N="?"+M,k=`<${N}>`,S=document,I=()=>S.createComment(""),O=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,H="[ \t\n\f\r]",z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,G=/>/g,R=RegExp(`>|${H}(?:([^\\s"'>=/]+)(${H}*=${H}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,j=/"/g,Z=/^(?:script|style|textarea|title)$/i,V=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),W=V(1),U=V(2),Q=Symbol.for("lit-noChange"),F=Symbol.for("lit-nothing"),X=new WeakMap,Y=S.createTreeWalker(S,129);function J(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==E?E.createHTML(t):t}const K=(e,t)=>{const n=e.length-1,o=[];let a,r=2===t?"":"",i=z;for(let t=0;t"===l[0]?(i=a??z,d=-1):void 0===l[1]?d=-2:(d=i.lastIndex-l[2].length,s=l[1],i=void 0===l[3]?R:'"'===l[3]?j:q):i===j||i===q?i=R:i===B||i===G?i=z:(i=R,a=void 0);const u=i===R&&e[t+1].startsWith("/>")?" ":"";r+=i===z?n+k:d>=0?(o.push(s),n.slice(0,d)+T+n.slice(d)+M+u):n+M+(-2===d?t:u)}return[J(e,r+(e[n]||"")+(2===t?"":"")),o]};class ${constructor({strings:e,_$litType$:t},n){let o;this.parts=[];let a=0,r=0;const i=e.length-1,s=this.parts,[l,d]=K(e,t);if(this.el=$.createElement(l,n),Y.currentNode=this.el.content,2===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(o=Y.nextNode())&&s.length0){o.textContent=C?C.emptyScript:"";for(let n=0;nD(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==F&&O(this._$AH)?this._$AA.nextSibling.data=e:this.T(S.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,o="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=$.createElement(J(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===o)this._$AH.p(t);else{const e=new te(o,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=X.get(e.strings);return void 0===t&&X.set(e.strings,t=new $(e)),t}k(e){D(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,o=0;for(const a of e)o===t.length?t.push(n=new ne(this.S(I()),this.S(I()),this,this.options)):n=t[o],n._$AI(a),o++;o2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=F}_$AI(e,t=this,n,o){const a=this.strings;let r=!1;if(void 0===a)e=ee(this,e,t,0),r=!O(e)||e!==this._$AH&&e!==Q,r&&(this._$AH=e);else{const o=e;let i,s;for(e=a[0],i=0;i{const a=n?.renderBefore??e;let o=a._$litPart$;if(void 0===o){const t=n?.renderBefore??null;a._$litPart$=o=new nt(e.insertBefore(I(),t),t,void 0,n??{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return F}}dt._$litElement$=!0,dt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:dt});const ct=globalThis.litElementPolyfillSupport;ct?.({LitElement:dt}),(globalThis.litElementVersions??=[]).push("4.0.4"); +class de extends P{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{const o=n?.renderBefore??t;let a=o._$litPart$;if(void 0===a){const e=n?.renderBefore??null;o._$litPart$=a=new ne(t.insertBefore(I(),e),e,void 0,n??{})}return a._$AI(e),a})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}}de._$litElement$=!0,de.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:de});const ce=globalThis.litElementPolyfillSupport;ce?.({LitElement:de}),(globalThis.litElementVersions??=[]).push("4.0.4"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const ut=t=>(e,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)} +const ue=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */,ht={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:b},pt=(t=ht,e,n)=>{const{kind:a,metadata:o}=n;let r=globalThis.litPropertyMetadata.get(o);if(void 0===r&&globalThis.litPropertyMetadata.set(o,r=new Map),r.set(n.name,t),"accessor"===a){const{name:a}=n;return{set(n){const o=e.get.call(this);e.set.call(this,n),this.requestUpdate(a,o,t)},init(e){return void 0!==e&&this.P(a,void 0,t),e}}}if("setter"===a){const{name:a}=n;return function(n){const o=this[a];e.call(this,n),this.requestUpdate(a,o,t)}}throw Error("Unsupported decorator location: "+a)};function yt(t){return(e,n)=>"object"==typeof n?pt(t,e,n):((t,e,n)=>{const a=e.hasOwnProperty(n);return e.constructor.createProperty(n,a?{...t,wrapped:!0}:t),a?Object.getOwnPropertyDescriptor(e,n):void 0})(t,e,n) + */,he={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:b},pe=(e=he,t,n)=>{const{kind:o,metadata:a}=n;let r=globalThis.litPropertyMetadata.get(a);if(void 0===r&&globalThis.litPropertyMetadata.set(a,r=new Map),r.set(n.name,e),"accessor"===o){const{name:o}=n;return{set(n){const a=t.get.call(this);t.set.call(this,n),this.requestUpdate(o,a,e)},init(t){return void 0!==t&&this.P(o,void 0,e),t}}}if("setter"===o){const{name:o}=n;return function(n){const a=this[o];t.call(this,n),this.requestUpdate(o,a,e)}}throw Error("Unsupported decorator location: "+o)};function ge(e){return(t,n)=>"object"==typeof n?pe(e,t,n):((e,t,n)=>{const o=t.hasOwnProperty(n);return t.constructor.createProperty(n,o?{...e,wrapped:!0}:e),o?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n) /** * @license * Copyright 2017 Google LLC @@ -43,12 +43,12 @@ const ut=t=>(e,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(t,e) * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const gt=(t,e,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,n),n) +const ye=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,n),n) /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */;function mt(t,e){return(n,a,o)=>{const r=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof a?n:o??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return gt(n,a,{get(){let n=t.call(this);return void 0===n&&(n=r(this),(null!==n||this.hasUpdated)&&e.call(this,n)),n}})}return gt(n,a,{get(){return r(this)}})}}function ft(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var vt;const wt=s(vt||(vt=ft(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; dominant-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _t,xt,bt;!function(t){t.Sunsynk="sunsynk",t.Lux="lux",t.GoodweGridMode="goodwe_gridmode",t.Goodwe="goodwe",t.Solis="solis",t.Huawei="huawei",t.FoxESS="foxess",t.Solax="solax",t.Victron="victron",t.Fronius="fronius",t.SolarEdge="solaredge",t.Growatt="growatt",t.Sofar="sofar",t.CESBatteryBox="ces-battery-box"}(_t||(_t={})),function(t){t.Compact="compact",t.Lite="lite",t.Full="full"}(xt||(xt={})),function(t){t.Energy="energy",t.Power="power",t.No="no"}(bt||(bt={}));var At={description:"Et Home Assistant-kort til at emulere Sunsynk-strømflowet, som vises på inverter-skærmen",version:"Version",runtime_to:"KØRSTID TIL",battery_floating:"BATTERI FLYDENDE",charge:"OPLADNING",to:"TIL",daily_load:"DAGLIG BELASTNING",daily_aux:"DAGLIG AUX",daily_grid_buy:"DAGLIG KØB AF ELEKTRICITET FRA NETTET",daily_grid_sell:"DAGLIG SALG AF ELEKTRICITET TIL NETTET",daily_solar:"DAGLIG SOLAR",daily_solar_left:"DAGLIG SOLAR / RENT I DAG",total_solar_generation:"DAGLIG SOLAR / TOTAL SOLAR",daily_charge:"DAGLIG OPLADNING",daily_discharge:"DAGLIG AFLADNING",ratio:"Forhold",timer_off:"Timer slukket",timer_on:"Timer tændt",priority_batt:"Prioritet Batteri",priority_load:"Prioritet Belastning",nonessential_name:"Ikke Væsentlig",aux_name:"Hjælpe",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Væsentlig",autarky:"Autarky",discharging:"Afladning",charging:"Opladning",waiting:"Ventende",standby:"Standby",no_battery:"Ingen batteri",selftest:"Selvtest",normal:"Normal",alarm:"Alarm",fault:"Fejl",days:"dage",hrs:"timer",min:"min",flash:"Flash",check:"Check",idle:"Inaktiv",exporting:"Eksport",importing:"Import",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},Lt={battery:{bat:"Ingen batteriattributter defineret",energy:"Inkluder venligst batterienergiattribut og værdi i Wh, f.eks. 5,32 Batterienergi: 5320",shutdown_soc:"Inkluder venligst batteri shutdown_soc-attribut og værdi, f.eks. shutdown_soc: 20",full_capacity:"Fuld kapacitet skal være mellem 80 og 100",empty_capacity:"Tom kapacitet skal være <= 40",show_daily:"Inkluder venligst attributterne day_battery_charge_70 og day_battery_discharge_71 samt enheds-ID'er"},solar:{sol:"Ingen solattributter defineret",mppts:"Inkluder venligst solens mppts-attribut og værdi; 1,2,3 eller 4, f.eks. mppts: 2",show_daily:"Inkluder venligst day_pv_energy_108-attributten og enheds-ID'en"},grid:{show_daily:"Inkluder venligst day_grid_import_76 og day_grid_export_77-attributterne samt enheds-ID'er"},essential_power:"essential_power-attributten er indstillet til ingen. Inkluder venligst inverter_power_175-attribut og enheds-ID for, at kortet kan beregne denne værdi.",nonessential_power:"nonessential_power-attributten er indstillet til ingen. Inkluder venligst grid_power_169-attribut og enheds-ID for, at kortet kan beregne denne værdi.",missing_entity:"Inkluder venligst attributten og enheds-ID'en"},Pt={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},Et={common:At,errors:Lt,config:Pt},Nt={description:"Eine Home Assistant-Karte zur Emulation des Sunsynk-Stromflusses, der auf dem Inverter-Bildschirm angezeigt wird",version:"Version",runtime_to:"LAUFZEIT BIS",battery_floating:"BATTERIE haltend",charge:"AUFLADEN",to:"ZU",daily_load:"ENERGIE heute",daily_aux:"HILFSANTRIEB heute",daily_grid_buy:"NETZEINKAUF heute",daily_grid_sell:"NETZVERKAUF heute",daily_solar:"SOLAR heute",daily_solar_left:"SOLAR heute / VERBLEIBEND heute",total_solar_generation:"SOLAR heute / TOTAL SOLAR",daily_charge:"AUFLADUNG heute",daily_discharge:"ENTNAHME heute",ratio:"Verhältnis",timer_off:"Timer aus",timer_on:"Timer ein",priority_batt:"Batteriepriorität",priority_load:"Lastpriorität",nonessential_name:"Nebenverbraucher",aux_name:"Hilfsantrieb",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Hauptverbraucher",autarky:"Autark",discharging:"Entladen",charging:"Laden",waiting:"Warten",standby:"Bereitschaft",no_battery:"Keine Batterie",selftest:"Selbsttest",normal:"Normal",alarm:"Alarm",fault:"Fehler",days:"Tage",hrs:"Std",min:"Min",flash:"Flash",check:"Check",idle:"Leerlauf",exporting:"Export",importing:"Import",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},Ct={battery:{bat:"Keine Batterieattribute definiert",energy:"Bitte fügen Sie das Batterieenergieattribut und den Wert in Wh hinzu, z.B. 5.32 Batterieenergie: 5320",shutdown_soc:"Bitte fügen Sie das Batterie-Shutdown-SOC-Attribut und den Wert hinzu, z.B. shutdown_soc: 20",full_capacity:"Die volle Kapazität muss zwischen 80 und 100 liegen",empty_capacity:"Die leere Kapazität muss <= 40 sein",show_daily:"Bitte fügen Sie die Tages-Batterieladung_70- und Tages-Batterieentladung_71-Attribute und die Entity-IDs hinzu"},solar:{sol:"Keine Solarattribute definiert",mppts:"Bitte fügen Sie das Solar-MPPT-Attribut und den Wert hinzu; 1,2,3 oder 4 z.B. mppts: 2",show_daily:"Bitte fügen Sie das Tages-PV-Energie_108-Attribut und die Entity-ID hinzu"},grid:{show_daily:"Bitte fügen Sie die Tages-Grideinspeisung_76- und Tages-Gridexport_77-Attribute und die Entity-IDs hinzu"},essential_power:"Das Essenziell-Stromattribut ist auf 'none' gesetzt. Bitte fügen Sie das Inverter-Power_175-Attribut und die Entity-ID hinzu, damit die Karte diesen Wert berechnen kann.",nonessential_power:"Das Nicht-Essenziell-Stromattribut ist auf 'none' gesetzt. Bitte fügen Sie das Grid-Power_169-Attribut und die Entity-ID hinzu, damit die Karte diesen Wert berechnen kann.",missing_entity:"Bitte fügen Sie das Attribut und die Entity-ID hinzu"},Mt={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},Tt={common:Nt,errors:Ct,config:Mt},kt={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",total_solar_generation:"DAILY SOLAR / TOTAL SOLAR",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Essential",autarky:"Autarky",discharging:"Discharging",charging:"Charging",waiting:"Waiting",standby:"Standby",no_battery:"No Battery",selftest:"Selftest",normal:"Normal",alarm:"Alarm",fault:"Fault",days:"days",hrs:"hrs",min:"min",flash:"Flash",check:"Check",idle:"Idle",exporting:"Export",importing:"Import",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},St={battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 40",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.",missing_entity:"`Please include the attribute and entity ID"},It={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},Dt={common:kt,errors:St,config:It},Ot={description:"Una tarjeta de Home Assistant para emular el flujo de energía Sunsynk que se muestra en la pantalla del inversor",version:"Versión",runtime_to:"TIEMPO DE FUNCIONAMIENTO HASTA",battery_floating:"BATERÍA EN FLOTACIÓN",charge:"CARGA",to:"A",daily_load:"CARGA DIARIA",daily_aux:"AUXILIAR DIARIO",daily_grid_buy:"COMPRA DIARIA DE LA RED",daily_grid_sell:"VENTA DIARIA A LA RED",daily_solar:"SOLAR DIARIO",daily_solar_left:"SOLAR DIARIO / LO QUE QUEDA HOY",total_solar_generation:"SOLAR DIARIO / TOTAL SOLAR",daily_charge:"CARGA DIARIA",daily_discharge:"DESCARGA DIARIA",ratio:"Relación",timer_off:"Temporizador apagado",timer_on:"Temporizador encendido",priority_batt:"Prioridad de la Batería",priority_load:"Prioridad de la Carga",nonessential_name:"No Esencial",aux_name:"Auxiliar",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Esencial",autarky:"Autarky",discharging:"Descargando",charging:"Cargando",waiting:"Esperando",standby:"En Espera",no_battery:"Sin Batería",selftest:"Autoevaluación",normal:"Normal",alarm:"Alarma",fault:"Fallo",days:"dìas",hrs:"horas",min:"min",flash:"Flash",check:"Check",idle:"Inactivo",exporting:"Exportando",importing:"Importando",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},Ht={battery:{bat:"No se han definido atributos de la batería",energy:"Por favor, incluye el atributo de energía de la batería y su valor en Wh, por ejemplo, 5.32 Energía de la batería: 5320",shutdown_soc:"Por favor, incluye el atributo shutdown_soc de la batería y su valor, por ejemplo shutdown_soc: 20",full_capacity:"La capacidad completa debe estar entre 80 y 100",empty_capacity:"La capacidad vacía debe ser <= 40",show_daily:"Por favor, incluye los atributos day_battery_charge_70 y day_battery_discharge_71 y las IDs de las entidades"},solar:{sol:"No se han definido atributos solares",mppts:"Por favor, incluye el atributo mppts solares y su valor; 1,2,3 o 4, por ejemplo, mppts: 2",show_daily:"Por favor, incluye el atributo day_pv_energy_108 y la ID de la entidad"},grid:{show_daily:"Por favor, incluye los atributos day_grid_import_76 y day_grid_export_77 y las IDs de las entidades"},essential_power:"El atributo essential_power está configurado como ninguno. Por favor, incluye el atributo inverter_power_175 y la ID de la entidad para que la tarjeta pueda calcular este valor.",nonessential_power:"El atributo nonessential_power está configurado como ninguno. Por favor, incluye el atributo grid_power_169 y la ID de la entidad para que la tarjeta pueda calcular este valor.",missing_entity:"Por favor, incluye el atributo y la ID de la entidad"},zt={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},Bt={common:Ot,errors:Ht,config:zt},Gt={description:"Home Assistant kaart Sunsynk võimsusvoogu emuleerimiseks, mis kuvatakse inverteri ekraanil",version:"Versioon",runtime_to:"TÖÖAEG KUNI",battery_floating:"UJUV AKU",charge:"LAADIMINE",to:"KUNI",daily_load:"PÄEVA KOORMUS",daily_aux:"PÄEVA ABISTAV",daily_grid_buy:"PÄEVA VÕRGUST OST",daily_grid_sell:"PÄEVA VÕRGU MÜÜK",daily_solar:"PÄEVA PÄIKE",daily_solar_left:"PÄEVA PÄIKE / TÄNA JÄÄNUD",total_solar_generation:"PÄEVA PÄIKE / TOTAL SOLAR",daily_charge:"PÄEVA LAADIMINE",daily_discharge:"PÄEVA TÜHJENDAMINE",ratio:"Suhe",timer_off:"Ajastus välja",timer_on:"Ajastus sisse",priority_batt:"Akuprioriteet",priority_load:"Koormuse prioriteet",nonessential_name:"Mitteoluline",aux_name:"Abiseadmed",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Oluline",autarky:"Autarky",discharging:"Tühjenemine",charging:"Laadimine",waiting:"Ootamine",standby:"Ooterežiim",no_battery:"Puudub aku",selftest:"Eneseanalüüs",normal:"Tavaline",alarm:"Häire",fault:"Rike",days:"päeva",hrs:"tundi",min:"min",flash:"Flash",check:"Check",idle:"Tühikäik",exporting:"Eksport",importing:"Import",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},Vt={battery:{bat:"Aku atribuute pole määratletud",energy:"Palun sisestage aku energiat atribuut ja väärtus Wh-s, näiteks 5,32 Aku energia: 5320",shutdown_soc:"Palun sisestage aku shutdown_soc atribuut ja väärtus, näiteks shutdown_soc: 20",full_capacity:"Täiskasvanu maht peab olema vahemikus 80 kuni 100",empty_capacity:"Tühi mahutavus peab olema <= 40",show_daily:"Palun sisestage päeva_battery_charge_70 ja päeva_battery_discharge_71 atribuudid ning seadmete ID-d"},solar:{sol:"Päikesepaneelide atribuute pole määratletud",mppts:"Palun sisestage päikesepaneelide mppts atribuut ja väärtus; 1,2,3 või 4, näiteks mppts: 2",show_daily:"Palun sisestage päeva_pv_energy_108 atribuut ja seadme ID"},grid:{show_daily:"Palun sisestage päeva_grid_import_76 ja päeva_grid_export_77 atribuudid ning seadmete ID-d"},essential_power:"Olulise võimsuse atribuut on määratud puuduvaks. Palun sisestage inverteri_power_175 atribuut ja seadme ID, et kaart saaks selle väärtuse arvutada.",nonessential_power:"Mittetähtsa võimsuse atribuut on määratud puuduvaks. Palun sisestage võrgu_power_169 atribuut ja seadme ID, et kaart saaks selle väärtuse arvutada.",missing_entity:"Sisestage palun atribuut ja seadme ID"},Rt={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},qt={common:Gt,errors:Vt,config:Rt},jt={description:"Une carte Home Assistant pour émuler les flux d'énergie affichés à l'écran des onduleurs Sunsynk ",version:"Version",runtime_to:"DÉCHARGÉE À",battery_floating:"BATTERIE FLOTTANTE",charge:"CHARGE",to:"À",daily_load:"CHARGE (JOUR)",daily_aux:"CHARGE AUX (JOUR)",daily_grid_buy:"ACHAT (JOUR)",daily_grid_sell:"VENTE (JOUR)",daily_solar:"PRODUCTION (JOUR)",daily_solar_left:"PRODUCTION / RESTANT (JOUR)",total_solar_generation:"PRODUCTION / TOTAL SOLAR",daily_charge:"CHARGE (JOUR)",daily_discharge:"DÉCHARGE (JOUR)",ratio:"Ratio",timer_off:"Prog. Off",timer_on:"Prog. On",priority_batt:"Batterie en 1er",priority_load:"Charges en 1er",nonessential_name:"Non Essentielles",aux_name:"Auxiliaire",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Essentielles",autarky:"AutoConso",discharging:"Décharge",charging:"Charge",waiting:"En attente",standby:"Veille",no_battery:"Pas de batterie",selftest:"Auto-test",normal:"Normal",alarm:"Alarme",fault:"Défaut",days:"jours",hrs:"heures",min:"min",flash:"Flash",check:"Check",idle:"Inactif",exporting:"Exportation",importing:"Importation",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Réseau"},Zt={battery:{bat:"Aucun attribut de batterie défini",energy:"Veuillez inclure l'attribut d'énergie de la batterie et la valeur en Wh, par exemple 5.32 Énergie de la batterie : 5320",shutdown_soc:"Veuillez inclure l'attribut de batterie shutdown_soc et la valeur, par exemple shutdown_soc : 20",full_capacity:"La capacité totale doit être comprise entre 80 et 100",empty_capacity:"La capacité vide doit être <= 40",show_daily:"Veuillez inclure les attributs day_battery_charge_70 et day_battery_discharge_71 ainsi que les ID d'entité"},solar:{sol:"Aucun attribut solaire défini",mppts:"Veuillez inclure l'attribut solaire mppts et la valeur ; 1,2,3 ou 4 par exemple mppts : 2",show_daily:"Veuillez inclure l'attribut day_pv_energy_108 et l'ID d'entité"},grid:{show_daily:"Veuillez inclure les attributs day_grid_import_76 et day_grid_export_77 ainsi que les ID d'entité"},essential_power:"L'attribut essential_power est réglé sur 'none'. Veuillez inclure l'attribut inverter_power_175 et l'ID d'entité afin que la carte puisse calculer cette valeur.",nonessential_power:"L'attribut nonessential_power est réglé sur 'none'. Veuillez inclure l'attribut grid_power_169 et l'ID d'entité afin que la carte puisse calculer cette valeur.",missing_entity:"Veuillez inclure l'attribut et l'ID d'entité"},Wt={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},Ut={common:jt,errors:Zt,config:Wt},Ft={description:"Een Home Assistant-kaart om de Sunsynk energiestroom te emuleren die op het omvormerscherm wordt weergegeven",version:"Versie",runtime_to:"WERKTIJD TOT",battery_floating:"DRIJVENDE BATTERIJ",charge:"LADEN",to:"TOT",daily_load:"DAGELIJKSE BELASTING",daily_aux:"DAGELIJKSE HULP",daily_grid_buy:"DAGELIJKS NETSTROOM KOPEN",daily_grid_sell:"DAGELIJKSE NETSTROOM VERKOPEN",daily_solar:"DAGELIJKSE ZONNE-ENERGIE",daily_solar_left:"DAGELIJKSE ZONNE-ENERGIE / OVER VANDAAG",total_solar_generation:"DAGELIJKSE ZONNE-ENERGIE / TOTAL SOLAR",daily_charge:"DAGELIJKSE LADING",daily_discharge:"DAGELIJKSE ONTLADING",ratio:"Verhouding",timer_off:"Timer uit",timer_on:"Timer aan",priority_batt:"Batterijprioriteit",priority_load:"Belastingsprioriteit",nonessential_name:"Niet-Essentieel",aux_name:"Hulp",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Essentieel",autarky:"Autarky",discharging:"Ontladen",charging:"Opladen",waiting:"Wachten",standby:"Standby",no_battery:"Geen batterij",selftest:"Zelftest",normal:"Normaal",alarm:"Alarm",fault:"Fout",days:"dagen",hrs:"uren",min:"minuten",flash:"Flash",check:"Check",idle:"Inactief",exporting:"Exporteren",importing:"Importeren",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},Qt={battery:{bat:"Geen batterijattributen gedefinieerd",energy:"Voeg alstublieft het batterij-energieattribuut en de waarde in Wh toe, bijvoorbeeld 5.32 Batterij-energie: 5320",shutdown_soc:"Voeg alstublieft het batterij-shutdown_soc-attribuut en de waarde toe, bijvoorbeeld shutdown_soc: 20",full_capacity:"De volledige capaciteit moet tussen 80 en 100 liggen",empty_capacity:"De lege capaciteit moet <= 40 zijn",show_daily:"Voeg alstublieft de attributen day_battery_charge_70 en day_battery_discharge_71 toe, evenals de entiteits-ID's"},solar:{sol:"Geen zonne-attributen gedefinieerd",mppts:"Voeg alstublieft het zonne-mppts-attribuut en de waarde toe; 1,2,3 of 4 bijvoorbeeld mppts: 2",show_daily:"Voeg alstublieft het day_pv_energy_108-attribuut en de entiteits-ID toe"},grid:{show_daily:"Voeg alstublieft de attributen day_grid_import_76 en day_grid_export_77 toe, evenals de entiteits-ID's"},essential_power:"Het essential_power-attribuut is ingesteld op 'geen'. Voeg alstublieft het inverter_power_175-attribuut en de entiteits-ID toe zodat de kaart deze waarde kan berekenen.",nonessential_power:"Het nonessential_power-attribuut is ingesteld op 'geen'. Voeg alstublieft het grid_power_169-attribuut en de entiteits-ID toe zodat de kaart deze waarde kan berekenen.",missing_entity:"Voeg alstublieft het attribuut en de entiteits-ID toe"},Xt={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},Yt={common:Ft,errors:Qt,config:Xt},Jt={description:"Карта Home Assistant для эмуляции потока энергии Sunsynk, отображаемого на экране инвертора",version:"Версия",runtime_to:"ВРЕМЯ ДО",battery_floating:"ПЛАВАЮЩАЯ БАТАРЕЯ",charge:"ЗАРЯД",to:"ДО",daily_load:"ЕЖЕДНЕВНАЯ НАГРУЗКА",daily_aux:"ЕЖЕДНЕВНАЯ ВСПОМОГАТЕЛЬНАЯ",daily_grid_buy:"ЕЖЕДНЕВНАЯ ПОКУПКА ИЗ СЕТИ",daily_grid_sell:"ЕЖЕДНЕВНАЯ ПРОДАЖА В СЕТЬ",daily_solar:"ЕЖЕДНЕВНАЯ СОЛНЕЧНАЯ ЭНЕРГИЯ",daily_solar_left:"ЕЖЕДНЕВНАЯ СОЛНЕЧНАЯ ЭНЕРГИЯ / ОСТАЛОСЬ СЕГОДНЯ",total_solar_generation:"ЕЖЕДНЕВНАЯ СОЛНЕЧНАЯ ЭНЕРГИЯ / TOTAL SOLAR",daily_charge:"ЕЖЕДНЕВНАЯ ЗАРЯДКА",daily_discharge:"ЕЖЕДНЕВНАЯ РАЗРЯДКА",ratio:"Соотношение",timer_off:"Таймер выключен",timer_on:"Таймер включен",priority_batt:"Приоритет батареи",priority_load:"Приоритет нагрузки",nonessential_name:"Не существенное",aux_name:"Вспомогательное",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Существенное",autarky:"Autarky",discharging:"Разряд",charging:"Зарядка",waiting:"Ожидание",standby:"Режим ожидания",no_battery:"Без батареи",selftest:"Самодиагностика",normal:"Нормально",alarm:"Авария",fault:"Неисправность",days:"дни",hrs:"часов",min:"мин",flash:"Flash",check:"Check",idle:"Бездействие",exporting:"Экспорт",importing:"Импорт",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},Kt={battery:{bat:"Не определены атрибуты батареи",energy:"Пожалуйста, включите атрибут батарейной энергии и значение в Втч, например, 5.32 Энергия батареи: 5320",shutdown_soc:"Пожалуйста, включите атрибут батарейного shutdown_soc и значение, например, shutdown_soc: 20",full_capacity:"Полная емкость должна быть в диапазоне от 80 до 100",empty_capacity:"Пустая емкость должна быть <= 40",show_daily:"Пожалуйста, включите атрибуты day_battery_charge_70 и day_battery_discharge_71 и идентификаторы сущностей"},solar:{sol:"Не определены атрибуты солнечной энергии",mppts:"Пожалуйста, включите атрибут солнечных mppts и значение; 1,2,3 или 4, например, mppts: 2",show_daily:"Пожалуйста, включите атрибут day_pv_energy_108 и идентификатор сущности"},grid:{show_daily:"Пожалуйста, включите атрибуты day_grid_import_76 и day_grid_export_77 и идентификаторы сущностей"},essential_power:"Атрибут essential_power установлен на 'none'. Пожалуйста, включите атрибут inverter_power_175 и идентификатор сущности, чтобы карта могла вычислить это значение.",nonessential_power:"Атрибут nonessential_power установлен на 'none'. Пожалуйста, включите атрибут grid_power_169 и идентификатор сущности, чтобы карта могла вычислить это значение.",missing_entity:"Пожалуйста, включите атрибут и идентификатор сущности"},$t={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},te={common:Jt,errors:Kt,config:$t},ee={description:"Karta Home Assistant pro emulaci toku energie, který je zobrazen na displeji měniče Sunsynk",version:"Verze",runtime_to:"ČAS DO",battery_floating:"BATERIE JE NABITÁ",charge:"NABÍT",to:"DO",daily_load:"DNES SPOTŘEBA",daily_aux:"DENNÍ VSTUP",daily_grid_buy:"DNES NÁKUP",daily_grid_sell:"DNES PRODEJ",daily_solar:"DNES VÝROBA",daily_solar_left:"DNES VÝROBA / OČEKÁVANÁ VÝROBA",total_solar_generation:"DNES VÝROBA / CELKOVÁ VÝROBA",daily_charge:"DNES NABÍJENÍ",daily_discharge:"DNES VYBÍJENÍ",ratio:"Poměr",timer_off:"Časovač off",timer_on:"Časovač on",priority_batt:"Nabít Baterii z DS",priority_load:"Nabíjím Baterii z DS",nonessential_name:"Nedostupné",aux_name:"Pomocné",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Nezbytný",autarky:"Vlastní",discharging:"Vybíjí se",charging:"Nabíjí se",waiting:"Čeká",standby:"Standby",no_battery:"Není baterie",selftest:"Vlastní test",normal:"Normální",alarm:"Alarm",fault:"Chyba",days:"dní",hrs:"hod",min:"min",flash:"Flash",check:"Check",idle:"Nečinný",exporting:"Odesílání",importing:"Příjem",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},ne={battery:{bat:"Nejsou definovány žádné atributy baterie",energy:"Uveďte prosím atribut energie baterie a hodnotu ve Wh, např. 5,32 Energie baterie: 5320",shutdown_soc:"Uveďte atribut battery shut down_soc a hodnotu, např. shutdown_soc: 20 shutdown_soc: 20",full_capacity:"Plná kapacita musí být mezi 80 a 100",empty_capacity:"Prázdná kapacita musí být <= 40",show_daily:"Uveďte prosím atributy day_battery_charge_70 a day_battery_discharge_71 a ID entit"},solar:{sol:"Nejsou definovány žádné solar atributy",mppts:"Uveďte prosím atribut a hodnotu solar mppts; 1,2,3 nebo 4 např. mppts: 2",show_daily:"Uveďte prosím atribut day_pv_energy_108 a ID entity"},grid:{show_daily:"Uveďte prosím atributy day_grid_import_76 a day_grid_export_77 a ID entit"},essential_power:"Atribut essential_power je nastaven na hodnotu none. Uveďte prosím atribut inverter_power_175 a ID entity, aby karta mohla vypočítat tuto hodnotu.",nonessential_power:"Atribut neesenciální_výkon je nastaven na hodnotu none. Uveďte prosím atribut grid_power_169 a ID entity, aby karta mohla vypočítat tuto hodnotu.",missing_entity:"Uveďte prosím atribut a ID entity"},ae={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},oe={common:ee,errors:ne,config:ae},re={description:"Una scheda Home Assistant per emulare il flusso di potenza Sunsynk visualizzato sullo schermo dell'inverter",version:"Versione",runtime_to:"DURATA AL",battery_floating:"BATTERY CARICA",charge:"CARICA",to:"A",daily_load:"CONSUMO OGGI",daily_aux:"AUX OGGI",daily_grid_buy:"PRELIEVO OGGI DA RETE",daily_grid_sell:"CESSIONE OGGI IN RETE",daily_solar:"ENERGIA SOLARE OGGI",daily_solar_left:"ENERGIA SOLARE OGGI / STIMA RIMANENTE",total_solar_generation:"ENERGIA SOLARE OGGI / TOTAL SOLAR",daily_charge:"CARICA OGGI",daily_discharge:"SCARICA OGGI",ratio:"Rapporto",timer_off:"Spegnimento timer",timer_on:"Accensione timer",priority_batt:"Priorità batteria",priority_load:"Priorità carico",nonessential_name:" Non Essenziale",aux_name:"Ausiliario",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Essenziale",autarky:"Autarky",discharging:"Scarica",charging:"Carica",waiting:"In attesa",standby:"Standby",no_battery:"Nessuna batteria",selftest:"Auto-test",normal:"Normale",alarm:"Allarme",fault:"Guasto",days:"giorni",hrs:"ore",min:"min",flash:"Flash",check:"Check",idle:"Inattivo",exporting:"Esportazione",importing:"Importazione",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},ie={battery:{bat:"Nessun attributo della batteria definito",energy:"Si prega di includere l'attributo dell'energia della batteria e il valore in Wh, ad esempio 5,32 Energia della batteria: 5320",shutdown_soc:"Si prega di includere l'attributo di spegnimento della batteria e il valore, ad esempio spegnimento_soc: 20",full_capacity:"La capacità massima deve essere compresa tra 80 e 100",empty_capacity:"La capacità vuota deve essere <= 40",show_daily:"Si prega di includere gli attributi day_battery_charge_70 e day_battery_discharge_71 e gli ID delle entità"},solar:{sol:"Nessun attributo solare definito",mppts:"Si prega di includere l'attributo solare mppts e il valore; 1,2,3 o 4, ad esempio mppts: 2",show_daily:"Si prega di includere l'attributo day_pv_energy_108 e l'ID dell'entità"},grid:{show_daily:"Si prega di includere gli attributi day_grid_import_76 e day_grid_export_77 e gli ID delle entità"},essential_power:"L'attributo essential_power è impostato su none. Si prega di includere l'attributo inverter_power_175 e l'ID dell'entità in modo che la scheda possa calcolare questo valore.",nonessential_power:"L'attributo nonessential_power è impostato su none. Si prega di includere l'attributo grid_power_169 e l'ID dell'entità in modo che la scheda possa calcolare questo valore.",missing_entity:"Si prega di includere l'attributo e l'ID dell'entità"},se={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},le={common:re,errors:ie,config:se},de={description:"Una tarjeta de Home Assistant per emular el flxue d'energoa Sunsynk que es mostra a la pantalla de l'inversor",version:"Versió",runtime_to:"TEMPS DE FUNCIONAMENT FINS",battery_floating:"BATERIA EN FLOTACIÓ",charge:"CÀRREGA",to:"A",daily_load:"CÀRREGA DIÀRIA",daily_aux:"AUXILIAR DIARI",daily_grid_buy:"COMPRA DIÀRIA DE LA XARXA",daily_grid_sell:"VENDA DIÀRIA A LA XARXA",daily_solar:"SOLAR DIARI",daily_solar_left:"SOLAR DIARI / RESTA AVUI",total_solar_generation:"SOLAR DIARI / TOTAL SOLAR",daily_charge:"CÀRREGA DIÀRIA",daily_discharge:"DESCÀRREGA DIÀRIA",ratio:"Relació",timer_off:"Temporitzador apagat",timer_on:"Temporitzador encès",priority_batt:"Prioritat de la Bateria",priority_load:"Prioritat de la Càrrega",nonessential_name:"No Esencial",aux_name:"Auxiliar",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Essencial",autarky:"Autarky",discharging:"Descàrrega",charging:"Càrrega",waiting:"Esperant",standby:"En espera",no_battery:"Sense bateria",selftest:"Prova automàtica",normal:"Normal",alarm:"Alarma",fault:"Avaria",days:"dies",hrs:"hrs",min:"min",flash:"Flash",check:"Check",idle:"Inactiu",exporting:"Exportació",importing:"Importació",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},ce={battery:{bat:"No s'han definit atributs de la bateria",energy:"Si us plau, inclou l'atribut d'energia de la bateria i el seu valor a Wh, per exemple, 5.32 Energia de la bateria: 5320",shutdown_soc:"Si us plau, inclou l'atribut shutdown_soc de la bateria i el seu valor, per exemple shutdown_soc: 20",full_capacity:"La capacitat completa ha d'estar entre 80 i 100",empty_capacity:"La capacitat buida ha de ser <= 40",show_daily:"Si us plau, inclou els atributs day_battery_charge_70 i day_battery_discharge_71 i les IDs de les entitats"},solar:{sol:"No s'han definit cap atribut solar",mppts:"Si us plau, inclou l'atribut mppts solars i el seu valor; 1,2,3 o 4, per exemple, mppts: 2",show_daily:"Si us plau, inclou l'atribut day_pv_energy_108 i la ID de l'entitat"},grid:{show_daily:"Si us plau, inclou els atributs day_grid_import_76 i day_grid_export_77 i les IDs de les entitats"},essential_power:"L'atribut essential_power està configurat com a cap. Inclou l'atribut inverter_power_175 i l'ID de l'entitat perquè la targeta pugui calcular aquest valor.",nonessential_power:"L'atribut nonessential_power està configurat com a cap. Inclou l'atribut grid_power_169 i l'ID de l'entitat perquè la targeta pugui calcular aquest valor.",missing_entity:"Si us plau, inclou l'atribut i la ID de l'entitat"},ue={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",decimal_places:"Decimal Places",card_height:"Card Height (px)",card_width:"Card Width (px)",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},he={common:de,errors:ce,config:ue},pe={description:"Karta Home Assistant na emuláciu Sunsynk power flow, ktorý sa zobrazuje na obrazovke invertora",version:"Verzia",runtime_to:"RUNTIME DO",battery_floating:"PLÁVAJÚCA BATÉRIA",charge:"NABÍJANIE",to:"DO",daily_load:"DENNÁ ZÁŤAŽ",daily_aux:"DAILY POM",daily_grid_buy:"SIEŤ DENNÝ NÁKUP",daily_grid_sell:"SIEŤ DENNÝ PREDAJ",daily_solar:"DENNÝ SLNKO",daily_solar_left:"DENNÉ SLNKO / ZOSTÁVA DNES",total_solar_generation:"DENNÉ SLNKO / CELKOVO SLNKO",daily_charge:"DENNÉ NABÍJANIE",daily_discharge:"DENNÉ VYBÍJANIE",ratio:"Pomer",timer_off:"Časovač vypnutý",timer_on:"Časovač zapnutý",priority_batt:"Priorita Bat",priority_load:"Priorita Záťaž",nonessential_name:"Nepodstatné",aux_name:"Pomocné",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Podstatné",autarky:"Autarky",discharging:"Vykladanie",charging:"Nabíjanie",waiting:"Čakanie",standby:"Pohotovostný režim",no_battery:"Žiadna batéria",selftest:"Samotest",normal:"Normálny",alarm:"Poplach",fault:"Porucha",days:"dni",hrs:"hod",min:"min",flash:"Flash",check:"Check",idle:"Nečinnosť",exporting:"Export",importing:"Import",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},ye={battery:{bat:"Nie sú definované žiadne atribúty batérie",energy:"Uveďte atribút energie batérie a hodnotu vo Wh, napr. 5,32 Energia batérie: 5320",shutdown_soc:"Uveďte atribút vypnutia batérie a hodnotu, napr. shutdown_soc: 20",full_capacity:"Plná kapacita musí byť medzi 80 a 100",empty_capacity:"Prázdna kapacita musí byť <= 40",show_daily:"Uveďte atribúty day_battery_charge_70 a day_battery_discharge_71 a ID entity"},solar:{sol:"Nie sú definované žiadne solárne atribúty",mppts:"Uveďte atribút a hodnotu solar mppts; 1,2,3 alebo 4 napr. mppts: 2",show_daily:"Uveďte atribút day_pv_energy_108 a ID entity"},grid:{show_daily:"Uveďte atribúty day_grid_import_76 a day_grid_export_77 a ID entity"},essential_power:"Atribút essential_power je nastavený na hodnotu none. Uveďte atribút inverter_power_175 a ID entity, aby karta vypočítala túto hodnotu.",nonessential_power:"Atribút noesential_power je nastavený na hodnotu none. Uveďte atribút grid_power_169 a ID entity, aby karta vypočítala túto hodnotu.",missing_entity:"`Uveďte atribút a ID entity"},ge={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},me={common:pe,errors:ye,config:ge},fe={description:"Um Card para o Home Assistant que ajuda a emular o fluxo de energia exibido na tela do inversor",version:"Versão",runtime_to:"TEMPO DE ATIVIDADE",battery_floating:"FLUTUAÇÃO DA BATERIA",charge:"CARGA",to:"PARA",daily_load:"USO DIÁRIO",daily_aux:"AUXILIAR DIÁRIO",daily_grid_buy:"CONSUMO DIÁRIO",daily_grid_sell:"ENVIO DIÁRIO",daily_solar:"SOLAR DIÁRIO",daily_solar_left:"PRODUÇÃO DIÁRIA / RESTANTE DIÁRIO",total_solar_generation:"PRODUÇÃO DIÁRIA / PREVISÃO SOLAR",daily_charge:"CARGA DIÁRIA",daily_discharge:"DESCARGA DIÁRIA",ratio:"Proporção",timer_off:"Temporizador desligado",timer_on:"Temporizador ligado",priority_batt:"Prioridade da Bateria",priority_load:"Prioridade de Uso",nonessential_name:"Desnecessário",aux_name:"Auxiliar",pv1_name:"PFV1",pv2_name:"PFV2",pv3_name:"PFV3",pv4_name:"PFV4",essential:"Essencial",autarky:"Autoconsumo",discharging:"Descaregando",charging:"Caregando",waiting:"Aguardando",standby:"Em espera",no_battery:"Sem Bateria",selftest:"Autoteste",normal:"Normal",alarm:"Alarme",fault:"Falta",days:"dìas",hrs:"horas",min:"min",flash:"Flash",check:"Check",idle:"Inativo",exporting:"Exportando",importing:"Importando",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Parado",shutdown:"Desligar",offline:"Offline",running:"Rodando",sleepmode:"Dormindo",grid_name:"Rede"},ve={battery:{bat:"Nenhum atributo de bateria definido",energy:"Inclua o atributo de energia da bateria e seu valor em Wh, por exemplo: 5,32 Potência da bateria: 5320",shutdown_soc:"Inclua o atributo shutdown_soc da bateria e seu valor, por exemplo shutdown_soc: 20",full_capacity:"A capacidade total deve estar entre 80 e 100",empty_capacity:"A capacidade vazia deve ser <= 40",show_daily:"Por favor, inclua os atributos day_battery_charge_70 e day_battery_discharge_71 e os IDs das entidade"},solar:{sol:"Nenhum atributo solar definido",mppts:"Por favor, inclua o atributo solar mppts e seu valor; 1,2,3 ou 4, por exemplo, mppts: 2",show_daily:"Por favor, inclua o atributo day_pv_energy_108 e o ID da entidade"},grid:{show_daily:"Por favor, inclua os atributos day_grid_import_76 e day_grid_export_77 e os IDs das entidade"},essential_power:"O atributo Essential_Power está definido como nenhum. Inclua o atributo inverter_power_175 e o ID da entidade para que o cartão possa calcular esse valor.",nonessential_power:"O atributo nonessential_power está configurado como nenhum. Inclua o atributo grid_power_169 e o ID da entidade para que o cartão possa calcular esse valor.",missing_entity:"Por favor, inclua o atributo e o ID da entidade"},we={title:"Título",title_colour:"Cor do Título",title_size:"Tamanho do Título (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Casas decimais",model:"Modelo",autarky:"Autoconsumo",cardstyle:"Estilo do Cartão",large_font:"Largura da fonte",modern:"Moderno",show_solar:"Exibir Solar",show_battery:"Exibir Bateria",show_grid:"Exibir Rede",show_aux:"Exibir Aux",dynamic_line_width:"Largura da linha dinâmica",max_line_width:"Largura máxima da linha",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Exibir Diário",show_daily_aux:"Exibir Diário Aux",animation_speed:"Velocidade de Animação",max_power:"Potência Max",pv1_name:"PFV1 Name",pv2_name:"PFV2 Name",pv3_name:"PFV3 Name",pv4_name:"PFV4 Name",display_mode:"Mode de Exibição",battery:"Bateria",load1_name:"Nome Uso1",load2_name:"Nome Uso2",load3_name:"Nome Uso3",load4_name:"Nome Uso4",load1_icon:"Icone Uso1",load2_icon:"Icone Uso2",load3_icon:"Icone Uso3",load4_icon:"Icone Uso4",aux_load1_name:"Nome Aux_Uso1",aux_load2_name:"Nome Aux_Uso2",aux_load1_icon:"Nome Aux_Uso3",aux_load2_icon:"Nome Aux_Uso4",show_daily_buy:"Consumo Diário",show_daily_sell:"Produção Diária",no_grid_colour:"Cor No_Grid",grid_off_colour:"Cor Grid_Off",grid_name:"Nome Grid",colour:"Cor",charge_colour:"Cor Charge",aux_colour:"Cor",aux_off_colour:"Cor Off",panel_mode:"Modo do Painel",invert_grid:"Inverter Valores",invert_load:"Inverter Valores",shutdown_soc:"Desligamento do SOC",energy:"Energia",auto_scale:"Escala automática",three_phase:"Trifásico",dynamic_colour:"Cor Dinâmica",dynamic_icon:"Ícone Dinâmico",invert_power:"Potência do Inversor",show_absolute:"Exibir valor absoluto",hide_soc:"Ocultar SOC",invert_aux:"Inverter Aux",show_absolute_aux:"Exibir absoluto_aux",show_nonessential:"Exibir Desnecessário",aux_name:"Nome Aux",aux_type:"Icone Aux",aux_loads:"Aux Loads",essential_name:"Nome Essencial",additional_loads:"Uso Adicional",export_colour:"Cor Expor",nonessential_name:"Nome Desnecessário",nonessential_icon:"Icone Desnecessário",energy_cost_decimals:"Decimais do custo de energia",show_remaining_energy:"Exibir energia restante",cat_title:{title:"Opções de título",general:"Opções gerais",inverter:"Opções do inversor",solar:"Opções Solar",battery:"Opções da Bateria",grid:"Opções da Rede",load:"Opções Load",entities:"Entidades",aux:"Opções do Aux",energy:"Entidade de Enêrgia",bat:"Entidades da Bateria ",sol:"Entidades de Solar",inv:"Entidades do Inversor",ld:"Entidade do Load",gri:"Entidade da Rede"}},_e={common:fe,errors:ve,config:we};const xe={hass:null},be={da:Object.freeze({__proto__:null,common:At,config:Pt,default:Et,errors:Lt}),de:Object.freeze({__proto__:null,common:Nt,config:Mt,default:Tt,errors:Ct}),en:Object.freeze({__proto__:null,common:kt,config:It,default:Dt,errors:St}),es:Object.freeze({__proto__:null,common:Ot,config:zt,default:Bt,errors:Ht}),et:Object.freeze({__proto__:null,common:Gt,config:Rt,default:qt,errors:Vt}),fr:Object.freeze({__proto__:null,common:jt,config:Wt,default:Ut,errors:Zt}),nl:Object.freeze({__proto__:null,common:Ft,config:Xt,default:Yt,errors:Qt}),ru:Object.freeze({__proto__:null,common:Jt,config:$t,default:te,errors:Kt}),cs:Object.freeze({__proto__:null,common:ee,config:ae,default:oe,errors:ne}),it:Object.freeze({__proto__:null,common:re,config:se,default:le,errors:ie}),ca:Object.freeze({__proto__:null,common:de,config:ue,default:he,errors:ce}),sk:Object.freeze({__proto__:null,common:pe,config:ge,default:me,errors:ye}),pt_BR:Object.freeze({__proto__:null,common:fe,config:we,default:_e,errors:ve})};function Ae(t,e="",n=""){const a=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_"),o="".concat(xe.hass?.selectedLanguage||xe.hass?.locale?.language||xe.hass?.language||a);let r;try{r=t.split(".").reduce(((t,e)=>t[e]),be[o])}catch(e){r=t.split(".").reduce(((t,e)=>t[e]),be.en)}return void 0===r&&(r=t.split(".").reduce(((t,e)=>t[e]),be.en)),""!==e&&""!==n&&(r=r.replace(e,n)),r}var Le={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,show_battery:!0,show_grid:!0,card_height:"396px",card_width:"100%",decimal_places:2,dynamic_line_width:!0,max_line_width:4,min_line_width:1,inverter:{modern:!0,colour:"grey",autarky:"power",model:_t.Sunsynk,auto_scale:!0,three_phase:!1},battery:{energy:0,shutdown_soc:20,invert_power:!1,hide_soc:!1,colour:"pink",show_daily:!1,show_remaining_energy:!0,animation_speed:6,max_power:4500,show_absolute:!1,auto_scale:!0,dynamic_colour:!0,linear_gradient:!0},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:Ae("common.pv1_name"),pv2_name:Ae("common.pv2_name"),pv3_name:Ae("common.pv3_name"),pv4_name:Ae("common.pv4_name"),auto_scale:!0,display_mode:1,dynamic_colour:!0},load:{colour:"#5fb6ad",dynamic_colour:!0,dynamic_icon:!0,show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,invert_load:!1,show_absolute_aux:!1,animation_speed:4,max_power:8e3,aux_name:Ae("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",essential_name:Ae("common.essential"),load1_icon:"default",load2_icon:"default",load1_name:Ae("common.load1_name"),load2_name:Ae("common.load2_name"),auto_scale:!0},grid:{colour:"#5490c2",grid_name:Ae("common.grid_name"),show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:Ae("common.nonessential_name"),additional_loads:0,load1_name:"",load2_name:"",load3_name:"",load1_icon:"default",load2_icon:"default",load3_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3,auto_scale:!0,energy_cost_decimals:2,show_absolute:!1}};const Pe=[0,1,2,4],Ee=[0,1,2,3],Ne=[!0,!1],Ce=[!0,!1];var Me;!function(t){t.DATE="date",t.ENUM="enum",t.TIMESTAMP="timestamp",t.APPARENT_POWER="apparent_power",t.ATMOSPHERIC_PRESSURE="atmospheric_pressure",t.BATTERY="battery",t.CO="carbon_monoxide",t.CO2="carbon_dioxide",t.CURRENT="current",t.ENERGY="energy",t.ENERGY_STORAGE="energy_storage",t.FREQUENCY="frequency",t.IRRADIANCE="irradiance",t.MONETARY="monetary",t.POWER_FACTOR="power_factor",t.POWER="power",t.REACTIVE_POWER="reactive_power",t.TEMPERATURE="temperature",t.VOLTAGE="voltage"}(Me||(Me={}));var Te="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ke(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Se={exports:{}};!function(t,e){var n="__lodash_hash_undefined__",a=9007199254740991,o="[object Arguments]",r="[object AsyncFunction]",i="[object Function]",s="[object GeneratorFunction]",l="[object Null]",d="[object Object]",c="[object Proxy]",u="[object Undefined]",h=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,y={};y["[object Float32Array]"]=y["[object Float64Array]"]=y["[object Int8Array]"]=y["[object Int16Array]"]=y["[object Int32Array]"]=y["[object Uint8Array]"]=y["[object Uint8ClampedArray]"]=y["[object Uint16Array]"]=y["[object Uint32Array]"]=!0,y[o]=y["[object Array]"]=y["[object ArrayBuffer]"]=y["[object Boolean]"]=y["[object DataView]"]=y["[object Date]"]=y["[object Error]"]=y[i]=y["[object Map]"]=y["[object Number]"]=y[d]=y["[object RegExp]"]=y["[object Set]"]=y["[object String]"]=y["[object WeakMap]"]=!1;var g="object"==typeof Te&&Te&&Te.Object===Object&&Te,m="object"==typeof self&&self&&self.Object===Object&&self,f=g||m||Function("return this")(),v=e&&!e.nodeType&&e,w=v&&t&&!t.nodeType&&t,_=w&&w.exports===v,x=_&&g.process,b=function(){try{var t=w&&w.require&&w.require("util").types;return t||x&&x.binding&&x.binding("util")}catch(t){}}(),A=b&&b.isTypedArray;var L,P,E,N=Array.prototype,C=Function.prototype,M=Object.prototype,T=f["__core-js_shared__"],k=C.toString,S=M.hasOwnProperty,I=(L=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"",D=M.toString,O=k.call(Object),H=RegExp("^"+k.call(S).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),z=_?f.Buffer:void 0,B=f.Symbol,G=f.Uint8Array,V=z?z.allocUnsafe:void 0,R=(P=Object.getPrototypeOf,E=Object,function(t){return P(E(t))}),q=Object.create,j=M.propertyIsEnumerable,Z=N.splice,W=B?B.toStringTag:void 0,U=function(){try{var t=vt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),F=z?z.isBuffer:void 0,Q=Math.max,X=Date.now,Y=vt(f,"Map"),J=vt(Object,"create"),K=function(){function t(){}return function(e){if(!Tt(e))return{};if(q)return q(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function $(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1},tt.prototype.set=function(t,e){var n=this.__data__,a=it(n,t);return a<0?(++this.size,n.push([t,e])):n[a][1]=e,this},et.prototype.clear=function(){this.size=0,this.__data__={hash:new $,map:new(Y||tt),string:new $}},et.prototype.delete=function(t){var e=ft(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return ft(this,t).get(t)},et.prototype.has=function(t){return ft(this,t).has(t)},et.prototype.set=function(t,e){var n=ft(this,t),a=n.size;return n.set(t,e),this.size+=n.size==a?0:1,this},nt.prototype.clear=function(){this.__data__=new tt,this.size=0},nt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},nt.prototype.get=function(t){return this.__data__.get(t)},nt.prototype.has=function(t){return this.__data__.has(t)},nt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof tt){var a=n.__data__;if(!Y||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new et(a)}return n.set(t,e),this.size=n.size,this};var lt,dt=function(t,e,n){for(var a=-1,o=Object(t),r=n(t),i=r.length;i--;){var s=r[lt?i:++a];if(!1===e(o[s],s,o))break}return t};function ct(t){return null==t?void 0===t?u:l:W&&W in Object(t)?function(t){var e=S.call(t,W),n=t[W];try{t[W]=void 0;var a=!0}catch(t){}var o=D.call(t);a&&(e?t[W]=n:delete t[W]);return o}(t):function(t){return D.call(t)}(t)}function ut(t){return kt(t)&&ct(t)==o}function ht(t){return!(!Tt(t)||function(t){return!!I&&I in t}(t))&&(Ct(t)?H:h).test(function(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function pt(t){if(!Tt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=_t(t),n=[];for(var a in t)("constructor"!=a||!e&&S.call(t,a))&&n.push(a);return n}function yt(t,e,n,a,o){t!==e&&dt(e,(function(r,i){if(o||(o=new nt),Tt(r))!function(t,e,n,a,o,r,i){var s=xt(t,n),l=xt(e,n),c=i.get(l);if(c)return void ot(t,n,c);var u=r?r(s,l,n+"",t,e,i):void 0,h=void 0===u;if(h){var p=Pt(l),y=!p&&Nt(l),g=!p&&!y&&St(l);u=l,p||y||g?Pt(s)?u=s:kt(_=s)&&Et(_)?u=function(t,e){var n=-1,a=t.length;e||(e=Array(a));for(;++n-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(mt);function At(t,e){return t===e||t!=t&&e!=e}var Lt=ut(function(){return arguments}())?ut:function(t){return kt(t)&&S.call(t,"callee")&&!j.call(t,"callee")},Pt=Array.isArray;function Et(t){return null!=t&&Mt(t.length)&&!Ct(t)}var Nt=F||function(){return!1};function Ct(t){if(!Tt(t))return!1;var e=ct(t);return e==i||e==s||e==r||e==c}function Mt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Tt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function kt(t){return null!=t&&"object"==typeof t}var St=A?function(t){return function(e){return t(e)}}(A):function(t){return kt(t)&&Mt(t.length)&&!!y[ct(t)]};function It(t){return Et(t)?at(t,!0):pt(t)}var Dt,Ot=(Dt=function(t,e,n){yt(t,e,n)},gt((function(t,e){var n=-1,a=e.length,o=a>1?e[a-1]:void 0,r=a>2?e[2]:void 0;for(o=Dt.length>3&&"function"==typeof o?(a--,o):void 0,r&&function(t,e,n){if(!Tt(n))return!1;var a=typeof e;return!!("number"==a?Et(n)&&wt(e,n.length):"string"==a&&e in n)&&At(n[e],t)}(e[0],e[1],r)&&(o=a<3?void 0:o,a=1),t=Object(t);++n{const r=t=>t.renderRoot?.querySelector(e)??null;if(t){const{get:e,set:t}="object"==typeof o?n:a??(()=>{const e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return ye(n,o,{get(){let n=e.call(this);return void 0===n&&(n=r(this),(null!==n||this.hasUpdated)&&t.call(this,n)),n}})}return ye(n,o,{get(){return r(this)}})}}function fe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ve;const we=s(ve||(ve=fe(["\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0px;\n }\n\n text { text-anchor: middle; dominant-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var _e,xe,be;!function(e){e.Sunsynk="sunsynk",e.Lux="lux",e.GoodweGridMode="goodwe_gridmode",e.Goodwe="goodwe",e.Solis="solis",e.Huawei="huawei",e.FoxESS="foxess",e.Solax="solax",e.Victron="victron",e.Fronius="fronius",e.SolarEdge="solaredge",e.Growatt="growatt",e.Sofar="sofar",e.CESBatteryBox="ces-battery-box"}(_e||(_e={})),function(e){e.Compact="compact",e.Lite="lite",e.Full="full"}(xe||(xe={})),function(e){e.Energy="energy",e.Power="power",e.No="no"}(be||(be={}));var Ae={description:"Et Home Assistant-kort til at emulere Sunsynk-strømflowet, som vises på inverter-skærmen",version:"Version",runtime_to:"KØRSTID TIL",battery_floating:"BATTERI FLYDENDE",charge:"OPLADNING",to:"TIL",daily_load:"DAGLIG BELASTNING",daily_aux:"DAGLIG AUX",daily_grid_buy:"DAGLIG KØB AF ELEKTRICITET FRA NETTET",daily_grid_sell:"DAGLIG SALG AF ELEKTRICITET TIL NETTET",daily_solar:"DAGLIG SOLAR",daily_solar_left:"DAGLIG SOLAR / RENT I DAG",total_solar_generation:"DAGLIG SOLAR / TOTAL SOLAR",daily_charge:"DAGLIG OPLADNING",daily_discharge:"DAGLIG AFLADNING",ratio:"Forhold",timer_off:"Timer slukket",timer_on:"Timer tændt",priority_batt:"Prioritet Batteri",priority_load:"Prioritet Belastning",nonessential_name:"Ikke Væsentlig",aux_name:"Hjælpe",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Væsentlig",autarky:"Autarky",discharging:"Afladning",charging:"Opladning",waiting:"Ventende",standby:"Standby",no_battery:"Ingen batteri",selftest:"Selvtest",normal:"Normal",alarm:"Alarm",fault:"Fejl",days:"dage",hrs:"timer",min:"min",flash:"Flash",check:"Check",idle:"Inaktiv",exporting:"Eksport",importing:"Import",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},Pe={battery:{bat:"Ingen batteriattributter defineret",energy:"Inkluder venligst batterienergiattribut og værdi i Wh, f.eks. 5,32 Batterienergi: 5320",shutdown_soc:"Inkluder venligst batteri shutdown_soc-attribut og værdi, f.eks. shutdown_soc: 20",full_capacity:"Fuld kapacitet skal være mellem 80 og 100",empty_capacity:"Tom kapacitet skal være <= 40",show_daily:"Inkluder venligst attributterne day_battery_charge_70 og day_battery_discharge_71 samt enheds-ID'er"},solar:{sol:"Ingen solattributter defineret",mppts:"Inkluder venligst solens mppts-attribut og værdi; 1,2,3 eller 4, f.eks. mppts: 2",show_daily:"Inkluder venligst day_pv_energy_108-attributten og enheds-ID'en"},grid:{show_daily:"Inkluder venligst day_grid_import_76 og day_grid_export_77-attributterne samt enheds-ID'er"},essential_power:"essential_power-attributten er indstillet til ingen. Inkluder venligst inverter_power_175-attribut og enheds-ID for, at kortet kan beregne denne værdi.",nonessential_power:"nonessential_power-attributten er indstillet til ingen. Inkluder venligst grid_power_169-attribut og enheds-ID for, at kortet kan beregne denne værdi.",missing_entity:"Inkluder venligst attributten og enheds-ID'en"},Le={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},Ce={common:Ae,errors:Pe,config:Le},Ee={description:"Eine Home Assistant-Karte zur Emulation des Sunsynk-Stromflusses, der auf dem Inverter-Bildschirm angezeigt wird",version:"Version",runtime_to:"LAUFZEIT BIS",battery_floating:"BATTERIE haltend",charge:"AUFLADEN",to:"ZU",daily_load:"ENERGIE heute",daily_aux:"HILFSANTRIEB heute",daily_grid_buy:"NETZEINKAUF heute",daily_grid_sell:"NETZVERKAUF heute",daily_solar:"SOLAR heute",daily_solar_left:"SOLAR heute / VERBLEIBEND heute",total_solar_generation:"SOLAR heute / TOTAL SOLAR",daily_charge:"AUFLADUNG heute",daily_discharge:"ENTNAHME heute",ratio:"Verhältnis",timer_off:"Timer aus",timer_on:"Timer ein",priority_batt:"Batteriepriorität",priority_load:"Lastpriorität",nonessential_name:"Nebenverbraucher",aux_name:"Hilfsantrieb",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Hauptverbraucher",autarky:"Autark",discharging:"Entladen",charging:"Laden",waiting:"Warten",standby:"Bereitschaft",no_battery:"Keine Batterie",selftest:"Selbsttest",normal:"Normal",alarm:"Alarm",fault:"Fehler",days:"Tage",hrs:"Std",min:"Min",flash:"Flash",check:"Check",idle:"Leerlauf",exporting:"Export",importing:"Import",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},Te={battery:{bat:"Keine Batterieattribute definiert",energy:"Bitte fügen Sie das Batterieenergieattribut und den Wert in Wh hinzu, z.B. 5.32 Batterieenergie: 5320",shutdown_soc:"Bitte fügen Sie das Batterie-Shutdown-SOC-Attribut und den Wert hinzu, z.B. shutdown_soc: 20",full_capacity:"Die volle Kapazität muss zwischen 80 und 100 liegen",empty_capacity:"Die leere Kapazität muss <= 40 sein",show_daily:"Bitte fügen Sie die Tages-Batterieladung_70- und Tages-Batterieentladung_71-Attribute und die Entity-IDs hinzu"},solar:{sol:"Keine Solarattribute definiert",mppts:"Bitte fügen Sie das Solar-MPPT-Attribut und den Wert hinzu; 1,2,3 oder 4 z.B. mppts: 2",show_daily:"Bitte fügen Sie das Tages-PV-Energie_108-Attribut und die Entity-ID hinzu"},grid:{show_daily:"Bitte fügen Sie die Tages-Grideinspeisung_76- und Tages-Gridexport_77-Attribute und die Entity-IDs hinzu"},essential_power:"Das Essenziell-Stromattribut ist auf 'none' gesetzt. Bitte fügen Sie das Inverter-Power_175-Attribut und die Entity-ID hinzu, damit die Karte diesen Wert berechnen kann.",nonessential_power:"Das Nicht-Essenziell-Stromattribut ist auf 'none' gesetzt. Bitte fügen Sie das Grid-Power_169-Attribut und die Entity-ID hinzu, damit die Karte diesen Wert berechnen kann.",missing_entity:"Bitte fügen Sie das Attribut und die Entity-ID hinzu"},Me={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},Ne={common:Ee,errors:Te,config:Me},ke={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",daily_solar_left:"DAILY SOLAR / LEFT TODAY",total_solar_generation:"DAILY SOLAR / TOTAL SOLAR",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Essential",autarky:"Autarky",discharging:"Discharging",charging:"Charging",waiting:"Waiting",standby:"Standby",no_battery:"No Battery",selftest:"Selftest",normal:"Normal",alarm:"Alarm",fault:"Fault",days:"days",hrs:"hrs",min:"min",flash:"Flash",check:"Check",idle:"Idle",exporting:"Export",importing:"Import",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},Se={battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 40",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.",missing_entity:"`Please include the attribute and entity ID"},Ie={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},Oe={common:ke,errors:Se,config:Ie},De={description:"Una tarjeta de Home Assistant para emular el flujo de energía Sunsynk que se muestra en la pantalla del inversor",version:"Versión",runtime_to:"TIEMPO DE FUNCIONAMIENTO HASTA",battery_floating:"BATERÍA EN FLOTACIÓN",charge:"CARGA",to:"A",daily_load:"CARGA DIARIA",daily_aux:"AUXILIAR DIARIO",daily_grid_buy:"COMPRA DIARIA DE LA RED",daily_grid_sell:"VENTA DIARIA A LA RED",daily_solar:"SOLAR DIARIO",daily_solar_left:"SOLAR DIARIO / LO QUE QUEDA HOY",total_solar_generation:"SOLAR DIARIO / TOTAL SOLAR",daily_charge:"CARGA DIARIA",daily_discharge:"DESCARGA DIARIA",ratio:"Relación",timer_off:"Temporizador apagado",timer_on:"Temporizador encendido",priority_batt:"Prioridad de la Batería",priority_load:"Prioridad de la Carga",nonessential_name:"No Esencial",aux_name:"Auxiliar",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Esencial",autarky:"Autarky",discharging:"Descargando",charging:"Cargando",waiting:"Esperando",standby:"En Espera",no_battery:"Sin Batería",selftest:"Autoevaluación",normal:"Normal",alarm:"Alarma",fault:"Fallo",days:"dìas",hrs:"horas",min:"min",flash:"Flash",check:"Check",idle:"Inactivo",exporting:"Exportando",importing:"Importando",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},He={battery:{bat:"No se han definido atributos de la batería",energy:"Por favor, incluye el atributo de energía de la batería y su valor en Wh, por ejemplo, 5.32 Energía de la batería: 5320",shutdown_soc:"Por favor, incluye el atributo shutdown_soc de la batería y su valor, por ejemplo shutdown_soc: 20",full_capacity:"La capacidad completa debe estar entre 80 y 100",empty_capacity:"La capacidad vacía debe ser <= 40",show_daily:"Por favor, incluye los atributos day_battery_charge_70 y day_battery_discharge_71 y las IDs de las entidades"},solar:{sol:"No se han definido atributos solares",mppts:"Por favor, incluye el atributo mppts solares y su valor; 1,2,3 o 4, por ejemplo, mppts: 2",show_daily:"Por favor, incluye el atributo day_pv_energy_108 y la ID de la entidad"},grid:{show_daily:"Por favor, incluye los atributos day_grid_import_76 y day_grid_export_77 y las IDs de las entidades"},essential_power:"El atributo essential_power está configurado como ninguno. Por favor, incluye el atributo inverter_power_175 y la ID de la entidad para que la tarjeta pueda calcular este valor.",nonessential_power:"El atributo nonessential_power está configurado como ninguno. Por favor, incluye el atributo grid_power_169 y la ID de la entidad para que la tarjeta pueda calcular este valor.",missing_entity:"Por favor, incluye el atributo y la ID de la entidad"},ze={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},Be={common:De,errors:He,config:ze},Ge={description:"Home Assistant kaart Sunsynk võimsusvoogu emuleerimiseks, mis kuvatakse inverteri ekraanil",version:"Versioon",runtime_to:"TÖÖAEG KUNI",battery_floating:"UJUV AKU",charge:"LAADIMINE",to:"KUNI",daily_load:"PÄEVA KOORMUS",daily_aux:"PÄEVA ABISTAV",daily_grid_buy:"PÄEVA VÕRGUST OST",daily_grid_sell:"PÄEVA VÕRGU MÜÜK",daily_solar:"PÄEVA PÄIKE",daily_solar_left:"PÄEVA PÄIKE / TÄNA JÄÄNUD",total_solar_generation:"PÄEVA PÄIKE / TOTAL SOLAR",daily_charge:"PÄEVA LAADIMINE",daily_discharge:"PÄEVA TÜHJENDAMINE",ratio:"Suhe",timer_off:"Ajastus välja",timer_on:"Ajastus sisse",priority_batt:"Akuprioriteet",priority_load:"Koormuse prioriteet",nonessential_name:"Mitteoluline",aux_name:"Abiseadmed",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Oluline",autarky:"Autarky",discharging:"Tühjenemine",charging:"Laadimine",waiting:"Ootamine",standby:"Ooterežiim",no_battery:"Puudub aku",selftest:"Eneseanalüüs",normal:"Tavaline",alarm:"Häire",fault:"Rike",days:"päeva",hrs:"tundi",min:"min",flash:"Flash",check:"Check",idle:"Tühikäik",exporting:"Eksport",importing:"Import",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},Re={battery:{bat:"Aku atribuute pole määratletud",energy:"Palun sisestage aku energiat atribuut ja väärtus Wh-s, näiteks 5,32 Aku energia: 5320",shutdown_soc:"Palun sisestage aku shutdown_soc atribuut ja väärtus, näiteks shutdown_soc: 20",full_capacity:"Täiskasvanu maht peab olema vahemikus 80 kuni 100",empty_capacity:"Tühi mahutavus peab olema <= 40",show_daily:"Palun sisestage päeva_battery_charge_70 ja päeva_battery_discharge_71 atribuudid ning seadmete ID-d"},solar:{sol:"Päikesepaneelide atribuute pole määratletud",mppts:"Palun sisestage päikesepaneelide mppts atribuut ja väärtus; 1,2,3 või 4, näiteks mppts: 2",show_daily:"Palun sisestage päeva_pv_energy_108 atribuut ja seadme ID"},grid:{show_daily:"Palun sisestage päeva_grid_import_76 ja päeva_grid_export_77 atribuudid ning seadmete ID-d"},essential_power:"Olulise võimsuse atribuut on määratud puuduvaks. Palun sisestage inverteri_power_175 atribuut ja seadme ID, et kaart saaks selle väärtuse arvutada.",nonessential_power:"Mittetähtsa võimsuse atribuut on määratud puuduvaks. Palun sisestage võrgu_power_169 atribuut ja seadme ID, et kaart saaks selle väärtuse arvutada.",missing_entity:"Sisestage palun atribuut ja seadme ID"},qe={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},je={common:Ge,errors:Re,config:qe},Ze={description:"Une carte Home Assistant pour émuler les flux d'énergie affichés à l'écran des onduleurs Sunsynk ",version:"Version",runtime_to:"DÉCHARGÉE À",battery_floating:"BATTERIE FLOTTANTE",charge:"CHARGE",to:"À",daily_load:"CHARGE (JOUR)",daily_aux:"CHARGE AUX (JOUR)",daily_grid_buy:"ACHAT (JOUR)",daily_grid_sell:"VENTE (JOUR)",daily_solar:"PRODUCTION (JOUR)",daily_solar_left:"PRODUCTION / RESTANT (JOUR)",total_solar_generation:"PRODUCTION / TOTAL SOLAR",daily_charge:"CHARGE (JOUR)",daily_discharge:"DÉCHARGE (JOUR)",ratio:"Ratio",timer_off:"Prog. Off",timer_on:"Prog. On",priority_batt:"Batterie en 1er",priority_load:"Charges en 1er",nonessential_name:"Non Essentielles",aux_name:"Auxiliaire",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Essentielles",autarky:"AutoConso",discharging:"Décharge",charging:"Charge",waiting:"En attente",standby:"Veille",no_battery:"Pas de batterie",selftest:"Auto-test",normal:"Normal",alarm:"Alarme",fault:"Défaut",days:"jours",hrs:"heures",min:"min",flash:"Flash",check:"Check",idle:"Inactif",exporting:"Exportation",importing:"Importation",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Réseau"},Ve={battery:{bat:"Aucun attribut de batterie défini",energy:"Veuillez inclure l'attribut d'énergie de la batterie et la valeur en Wh, par exemple 5.32 Énergie de la batterie : 5320",shutdown_soc:"Veuillez inclure l'attribut de batterie shutdown_soc et la valeur, par exemple shutdown_soc : 20",full_capacity:"La capacité totale doit être comprise entre 80 et 100",empty_capacity:"La capacité vide doit être <= 40",show_daily:"Veuillez inclure les attributs day_battery_charge_70 et day_battery_discharge_71 ainsi que les ID d'entité"},solar:{sol:"Aucun attribut solaire défini",mppts:"Veuillez inclure l'attribut solaire mppts et la valeur ; 1,2,3 ou 4 par exemple mppts : 2",show_daily:"Veuillez inclure l'attribut day_pv_energy_108 et l'ID d'entité"},grid:{show_daily:"Veuillez inclure les attributs day_grid_import_76 et day_grid_export_77 ainsi que les ID d'entité"},essential_power:"L'attribut essential_power est réglé sur 'none'. Veuillez inclure l'attribut inverter_power_175 et l'ID d'entité afin que la carte puisse calculer cette valeur.",nonessential_power:"L'attribut nonessential_power est réglé sur 'none'. Veuillez inclure l'attribut grid_power_169 et l'ID d'entité afin que la carte puisse calculer cette valeur.",missing_entity:"Veuillez inclure l'attribut et l'ID d'entité"},We={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},Ue={common:Ze,errors:Ve,config:We},Qe={description:"Een Home Assistant-kaart om de Sunsynk energiestroom te emuleren die op het omvormerscherm wordt weergegeven",version:"Versie",runtime_to:"WERKTIJD TOT",battery_floating:"DRIJVENDE BATTERIJ",charge:"LADEN",to:"TOT",daily_load:"DAGELIJKSE BELASTING",daily_aux:"DAGELIJKSE HULP",daily_grid_buy:"DAGELIJKS NETSTROOM KOPEN",daily_grid_sell:"DAGELIJKSE NETSTROOM VERKOPEN",daily_solar:"DAGELIJKSE ZONNE-ENERGIE",daily_solar_left:"DAGELIJKSE ZONNE-ENERGIE / OVER VANDAAG",total_solar_generation:"DAGELIJKSE ZONNE-ENERGIE / TOTAL SOLAR",daily_charge:"DAGELIJKSE LADING",daily_discharge:"DAGELIJKSE ONTLADING",ratio:"Verhouding",timer_off:"Timer uit",timer_on:"Timer aan",priority_batt:"Batterijprioriteit",priority_load:"Belastingsprioriteit",nonessential_name:"Niet-Essentieel",aux_name:"Hulp",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Essentieel",autarky:"Autarky",discharging:"Ontladen",charging:"Opladen",waiting:"Wachten",standby:"Standby",no_battery:"Geen batterij",selftest:"Zelftest",normal:"Normaal",alarm:"Alarm",fault:"Fout",days:"dagen",hrs:"uren",min:"minuten",flash:"Flash",check:"Check",idle:"Inactief",exporting:"Exporteren",importing:"Importeren",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},Fe={battery:{bat:"Geen batterijattributen gedefinieerd",energy:"Voeg alstublieft het batterij-energieattribuut en de waarde in Wh toe, bijvoorbeeld 5.32 Batterij-energie: 5320",shutdown_soc:"Voeg alstublieft het batterij-shutdown_soc-attribuut en de waarde toe, bijvoorbeeld shutdown_soc: 20",full_capacity:"De volledige capaciteit moet tussen 80 en 100 liggen",empty_capacity:"De lege capaciteit moet <= 40 zijn",show_daily:"Voeg alstublieft de attributen day_battery_charge_70 en day_battery_discharge_71 toe, evenals de entiteits-ID's"},solar:{sol:"Geen zonne-attributen gedefinieerd",mppts:"Voeg alstublieft het zonne-mppts-attribuut en de waarde toe; 1,2,3 of 4 bijvoorbeeld mppts: 2",show_daily:"Voeg alstublieft het day_pv_energy_108-attribuut en de entiteits-ID toe"},grid:{show_daily:"Voeg alstublieft de attributen day_grid_import_76 en day_grid_export_77 toe, evenals de entiteits-ID's"},essential_power:"Het essential_power-attribuut is ingesteld op 'geen'. Voeg alstublieft het inverter_power_175-attribuut en de entiteits-ID toe zodat de kaart deze waarde kan berekenen.",nonessential_power:"Het nonessential_power-attribuut is ingesteld op 'geen'. Voeg alstublieft het grid_power_169-attribuut en de entiteits-ID toe zodat de kaart deze waarde kan berekenen.",missing_entity:"Voeg alstublieft het attribuut en de entiteits-ID toe"},Xe={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},Ye={common:Qe,errors:Fe,config:Xe},Je={description:"Карта Home Assistant для эмуляции потока энергии Sunsynk, отображаемого на экране инвертора",version:"Версия",runtime_to:"ВРЕМЯ ДО",battery_floating:"ПЛАВАЮЩАЯ БАТАРЕЯ",charge:"ЗАРЯД",to:"ДО",daily_load:"ЕЖЕДНЕВНАЯ НАГРУЗКА",daily_aux:"ЕЖЕДНЕВНАЯ ВСПОМОГАТЕЛЬНАЯ",daily_grid_buy:"ЕЖЕДНЕВНАЯ ПОКУПКА ИЗ СЕТИ",daily_grid_sell:"ЕЖЕДНЕВНАЯ ПРОДАЖА В СЕТЬ",daily_solar:"ЕЖЕДНЕВНАЯ СОЛНЕЧНАЯ ЭНЕРГИЯ",daily_solar_left:"ЕЖЕДНЕВНАЯ СОЛНЕЧНАЯ ЭНЕРГИЯ / ОСТАЛОСЬ СЕГОДНЯ",total_solar_generation:"ЕЖЕДНЕВНАЯ СОЛНЕЧНАЯ ЭНЕРГИЯ / TOTAL SOLAR",daily_charge:"ЕЖЕДНЕВНАЯ ЗАРЯДКА",daily_discharge:"ЕЖЕДНЕВНАЯ РАЗРЯДКА",ratio:"Соотношение",timer_off:"Таймер выключен",timer_on:"Таймер включен",priority_batt:"Приоритет батареи",priority_load:"Приоритет нагрузки",nonessential_name:"Не существенное",aux_name:"Вспомогательное",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Существенное",autarky:"Autarky",discharging:"Разряд",charging:"Зарядка",waiting:"Ожидание",standby:"Режим ожидания",no_battery:"Без батареи",selftest:"Самодиагностика",normal:"Нормально",alarm:"Авария",fault:"Неисправность",days:"дни",hrs:"часов",min:"мин",flash:"Flash",check:"Check",idle:"Бездействие",exporting:"Экспорт",importing:"Импорт",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},Ke={battery:{bat:"Не определены атрибуты батареи",energy:"Пожалуйста, включите атрибут батарейной энергии и значение в Втч, например, 5.32 Энергия батареи: 5320",shutdown_soc:"Пожалуйста, включите атрибут батарейного shutdown_soc и значение, например, shutdown_soc: 20",full_capacity:"Полная емкость должна быть в диапазоне от 80 до 100",empty_capacity:"Пустая емкость должна быть <= 40",show_daily:"Пожалуйста, включите атрибуты day_battery_charge_70 и day_battery_discharge_71 и идентификаторы сущностей"},solar:{sol:"Не определены атрибуты солнечной энергии",mppts:"Пожалуйста, включите атрибут солнечных mppts и значение; 1,2,3 или 4, например, mppts: 2",show_daily:"Пожалуйста, включите атрибут day_pv_energy_108 и идентификатор сущности"},grid:{show_daily:"Пожалуйста, включите атрибуты day_grid_import_76 и day_grid_export_77 и идентификаторы сущностей"},essential_power:"Атрибут essential_power установлен на 'none'. Пожалуйста, включите атрибут inverter_power_175 и идентификатор сущности, чтобы карта могла вычислить это значение.",nonessential_power:"Атрибут nonessential_power установлен на 'none'. Пожалуйста, включите атрибут grid_power_169 и идентификатор сущности, чтобы карта могла вычислить это значение.",missing_entity:"Пожалуйста, включите атрибут и идентификатор сущности"},$e={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},et={common:Je,errors:Ke,config:$e},tt={description:"Karta Home Assistant pro emulaci toku energie, který je zobrazen na displeji měniče Sunsynk",version:"Verze",runtime_to:"ČAS DO",battery_floating:"BATERIE JE NABITÁ",charge:"NABÍT",to:"DO",daily_load:"DNES SPOTŘEBA",daily_aux:"DENNÍ VSTUP",daily_grid_buy:"DNES NÁKUP",daily_grid_sell:"DNES PRODEJ",daily_solar:"DNES VÝROBA",daily_solar_left:"DNES VÝROBA / OČEKÁVANÁ VÝROBA",total_solar_generation:"DNES VÝROBA / CELKOVÁ VÝROBA",daily_charge:"DNES NABÍJENÍ",daily_discharge:"DNES VYBÍJENÍ",ratio:"Poměr",timer_off:"Časovač off",timer_on:"Časovač on",priority_batt:"Nabít Baterii z DS",priority_load:"Nabíjím Baterii z DS",nonessential_name:"Nedostupné",aux_name:"Pomocné",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Nezbytný",autarky:"Vlastní",discharging:"Vybíjí se",charging:"Nabíjí se",waiting:"Čeká",standby:"Standby",no_battery:"Není baterie",selftest:"Vlastní test",normal:"Normální",alarm:"Alarm",fault:"Chyba",days:"dní",hrs:"hod",min:"min",flash:"Flash",check:"Check",idle:"Nečinný",exporting:"Odesílání",importing:"Příjem",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},nt={battery:{bat:"Nejsou definovány žádné atributy baterie",energy:"Uveďte prosím atribut energie baterie a hodnotu ve Wh, např. 5,32 Energie baterie: 5320",shutdown_soc:"Uveďte atribut battery shut down_soc a hodnotu, např. shutdown_soc: 20 shutdown_soc: 20",full_capacity:"Plná kapacita musí být mezi 80 a 100",empty_capacity:"Prázdná kapacita musí být <= 40",show_daily:"Uveďte prosím atributy day_battery_charge_70 a day_battery_discharge_71 a ID entit"},solar:{sol:"Nejsou definovány žádné solar atributy",mppts:"Uveďte prosím atribut a hodnotu solar mppts; 1,2,3 nebo 4 např. mppts: 2",show_daily:"Uveďte prosím atribut day_pv_energy_108 a ID entity"},grid:{show_daily:"Uveďte prosím atributy day_grid_import_76 a day_grid_export_77 a ID entit"},essential_power:"Atribut essential_power je nastaven na hodnotu none. Uveďte prosím atribut inverter_power_175 a ID entity, aby karta mohla vypočítat tuto hodnotu.",nonessential_power:"Atribut neesenciální_výkon je nastaven na hodnotu none. Uveďte prosím atribut grid_power_169 a ID entity, aby karta mohla vypočítat tuto hodnotu.",missing_entity:"Uveďte prosím atribut a ID entity"},ot={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},at={common:tt,errors:nt,config:ot},rt={description:"Una scheda Home Assistant per emulare il flusso di potenza Sunsynk visualizzato sullo schermo dell'inverter",version:"Versione",runtime_to:"DURATA AL",battery_floating:"BATTERY CARICA",charge:"CARICA",to:"A",daily_load:"CONSUMO OGGI",daily_aux:"AUX OGGI",daily_grid_buy:"PRELIEVO OGGI DA RETE",daily_grid_sell:"CESSIONE OGGI IN RETE",daily_solar:"ENERGIA SOLARE OGGI",daily_solar_left:"ENERGIA SOLARE OGGI / STIMA RIMANENTE",total_solar_generation:"ENERGIA SOLARE OGGI / TOTAL SOLAR",daily_charge:"CARICA OGGI",daily_discharge:"SCARICA OGGI",ratio:"Rapporto",timer_off:"Spegnimento timer",timer_on:"Accensione timer",priority_batt:"Priorità batteria",priority_load:"Priorità carico",nonessential_name:" Non Essenziale",aux_name:"Ausiliario",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Essenziale",autarky:"Autarky",discharging:"Scarica",charging:"Carica",waiting:"In attesa",standby:"Standby",no_battery:"Nessuna batteria",selftest:"Auto-test",normal:"Normale",alarm:"Allarme",fault:"Guasto",days:"giorni",hrs:"ore",min:"min",flash:"Flash",check:"Check",idle:"Inattivo",exporting:"Esportazione",importing:"Importazione",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},it={battery:{bat:"Nessun attributo della batteria definito",energy:"Si prega di includere l'attributo dell'energia della batteria e il valore in Wh, ad esempio 5,32 Energia della batteria: 5320",shutdown_soc:"Si prega di includere l'attributo di spegnimento della batteria e il valore, ad esempio spegnimento_soc: 20",full_capacity:"La capacità massima deve essere compresa tra 80 e 100",empty_capacity:"La capacità vuota deve essere <= 40",show_daily:"Si prega di includere gli attributi day_battery_charge_70 e day_battery_discharge_71 e gli ID delle entità"},solar:{sol:"Nessun attributo solare definito",mppts:"Si prega di includere l'attributo solare mppts e il valore; 1,2,3 o 4, ad esempio mppts: 2",show_daily:"Si prega di includere l'attributo day_pv_energy_108 e l'ID dell'entità"},grid:{show_daily:"Si prega di includere gli attributi day_grid_import_76 e day_grid_export_77 e gli ID delle entità"},essential_power:"L'attributo essential_power è impostato su none. Si prega di includere l'attributo inverter_power_175 e l'ID dell'entità in modo che la scheda possa calcolare questo valore.",nonessential_power:"L'attributo nonessential_power è impostato su none. Si prega di includere l'attributo grid_power_169 e l'ID dell'entità in modo che la scheda possa calcolare questo valore.",missing_entity:"Si prega di includere l'attributo e l'ID dell'entità"},st={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},lt={common:rt,errors:it,config:st},dt={description:"Una tarjeta de Home Assistant per emular el flxue d'energoa Sunsynk que es mostra a la pantalla de l'inversor",version:"Versió",runtime_to:"TEMPS DE FUNCIONAMENT FINS",battery_floating:"BATERIA EN FLOTACIÓ",charge:"CÀRREGA",to:"A",daily_load:"CÀRREGA DIÀRIA",daily_aux:"AUXILIAR DIARI",daily_grid_buy:"COMPRA DIÀRIA DE LA XARXA",daily_grid_sell:"VENDA DIÀRIA A LA XARXA",daily_solar:"SOLAR DIARI",daily_solar_left:"SOLAR DIARI / RESTA AVUI",total_solar_generation:"SOLAR DIARI / TOTAL SOLAR",daily_charge:"CÀRREGA DIÀRIA",daily_discharge:"DESCÀRREGA DIÀRIA",ratio:"Relació",timer_off:"Temporitzador apagat",timer_on:"Temporitzador encès",priority_batt:"Prioritat de la Bateria",priority_load:"Prioritat de la Càrrega",nonessential_name:"No Esencial",aux_name:"Auxiliar",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Essencial",autarky:"Autarky",discharging:"Descàrrega",charging:"Càrrega",waiting:"Esperant",standby:"En espera",no_battery:"Sense bateria",selftest:"Prova automàtica",normal:"Normal",alarm:"Alarma",fault:"Avaria",days:"dies",hrs:"hrs",min:"min",flash:"Flash",check:"Check",idle:"Inactiu",exporting:"Exportació",importing:"Importació",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},ct={battery:{bat:"No s'han definit atributs de la bateria",energy:"Si us plau, inclou l'atribut d'energia de la bateria i el seu valor a Wh, per exemple, 5.32 Energia de la bateria: 5320",shutdown_soc:"Si us plau, inclou l'atribut shutdown_soc de la bateria i el seu valor, per exemple shutdown_soc: 20",full_capacity:"La capacitat completa ha d'estar entre 80 i 100",empty_capacity:"La capacitat buida ha de ser <= 40",show_daily:"Si us plau, inclou els atributs day_battery_charge_70 i day_battery_discharge_71 i les IDs de les entitats"},solar:{sol:"No s'han definit cap atribut solar",mppts:"Si us plau, inclou l'atribut mppts solars i el seu valor; 1,2,3 o 4, per exemple, mppts: 2",show_daily:"Si us plau, inclou l'atribut day_pv_energy_108 i la ID de l'entitat"},grid:{show_daily:"Si us plau, inclou els atributs day_grid_import_76 i day_grid_export_77 i les IDs de les entitats"},essential_power:"L'atribut essential_power està configurat com a cap. Inclou l'atribut inverter_power_175 i l'ID de l'entitat perquè la targeta pugui calcular aquest valor.",nonessential_power:"L'atribut nonessential_power està configurat com a cap. Inclou l'atribut grid_power_169 i l'ID de l'entitat perquè la targeta pugui calcular aquest valor.",missing_entity:"Si us plau, inclou l'atribut i la ID de l'entitat"},ut={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",decimal_places:"Decimal Places",card_height:"Card Height (px)",card_width:"Card Width (px)",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},ht={common:dt,errors:ct,config:ut},pt={description:"Karta Home Assistant na emuláciu Sunsynk power flow, ktorý sa zobrazuje na obrazovke invertora",version:"Verzia",runtime_to:"RUNTIME DO",battery_floating:"PLÁVAJÚCA BATÉRIA",charge:"NABÍJANIE",to:"DO",daily_load:"DENNÁ ZÁŤAŽ",daily_aux:"DAILY POM",daily_grid_buy:"SIEŤ DENNÝ NÁKUP",daily_grid_sell:"SIEŤ DENNÝ PREDAJ",daily_solar:"DENNÝ SLNKO",daily_solar_left:"DENNÉ SLNKO / ZOSTÁVA DNES",total_solar_generation:"DENNÉ SLNKO / CELKOVO SLNKO",daily_charge:"DENNÉ NABÍJANIE",daily_discharge:"DENNÉ VYBÍJANIE",ratio:"Pomer",timer_off:"Časovač vypnutý",timer_on:"Časovač zapnutý",priority_batt:"Priorita Bat",priority_load:"Priorita Záťaž",nonessential_name:"Nepodstatné",aux_name:"Pomocné",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",essential:"Podstatné",autarky:"Autarky",discharging:"Vykladanie",charging:"Nabíjanie",waiting:"Čakanie",standby:"Pohotovostný režim",no_battery:"Žiadna batéria",selftest:"Samotest",normal:"Normálny",alarm:"Poplach",fault:"Porucha",days:"dni",hrs:"hod",min:"min",flash:"Flash",check:"Check",idle:"Nečinnosť",exporting:"Export",importing:"Import",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid"},gt={battery:{bat:"Nie sú definované žiadne atribúty batérie",energy:"Uveďte atribút energie batérie a hodnotu vo Wh, napr. 5,32 Energia batérie: 5320",shutdown_soc:"Uveďte atribút vypnutia batérie a hodnotu, napr. shutdown_soc: 20",full_capacity:"Plná kapacita musí byť medzi 80 a 100",empty_capacity:"Prázdna kapacita musí byť <= 40",show_daily:"Uveďte atribúty day_battery_charge_70 a day_battery_discharge_71 a ID entity"},solar:{sol:"Nie sú definované žiadne solárne atribúty",mppts:"Uveďte atribút a hodnotu solar mppts; 1,2,3 alebo 4 napr. mppts: 2",show_daily:"Uveďte atribút day_pv_energy_108 a ID entity"},grid:{show_daily:"Uveďte atribúty day_grid_import_76 a day_grid_export_77 a ID entity"},essential_power:"Atribút essential_power je nastavený na hodnotu none. Uveďte atribút inverter_power_175 a ID entity, aby karta vypočítala túto hodnotu.",nonessential_power:"Atribút noesential_power je nastavený na hodnotu none. Uveďte atribút grid_power_169 a ID entity, aby karta vypočítala túto hodnotu.",missing_entity:"`Uveďte atribút a ID entity"},yt={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",model:"Model",autarky:"Autarky",cardstyle:"Card Style",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",display_mode:"Display Mode",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",aux_load1_name:"Load 1 Name",aux_load2_name:"Load 2 Name",aux_load1_icon:"Load 1 Icon",aux_load2_icon:"Load 2 Icon",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",entities:"Entities",aux:"Aux Options",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities"}},mt={common:pt,errors:gt,config:yt},ft={description:"Um Card para o Home Assistant que ajuda a emular o fluxo de energia exibido na tela do inversor",version:"Versão",runtime_to:"TEMPO DE ATIVIDADE",battery_floating:"FLUTUAÇÃO DA BATERIA",charge:"CARGA",to:"PARA",daily_load:"USO DIÁRIO",daily_aux:"AUXILIAR DIÁRIO",daily_grid_buy:"CONSUMO DIÁRIO",daily_grid_sell:"ENVIO DIÁRIO",daily_solar:"SOLAR DIÁRIO",daily_solar_left:"PRODUÇÃO DIÁRIA / RESTANTE DIÁRIO",total_solar_generation:"PRODUÇÃO DIÁRIA / PREVISÃO SOLAR",daily_charge:"CARGA DIÁRIA",daily_discharge:"DESCARGA DIÁRIA",ratio:"Proporção",timer_off:"Temporizador desligado",timer_on:"Temporizador ligado",priority_batt:"Prioridade da Bateria",priority_load:"Prioridade de Uso",nonessential_name:"Desnecessário",aux_name:"Auxiliar",pv1_name:"PFV1",pv2_name:"PFV2",pv3_name:"PFV3",pv4_name:"PFV4",essential:"Essencial",autarky:"Autoconsumo",discharging:"Descaregando",charging:"Caregando",waiting:"Aguardando",standby:"Em espera",no_battery:"Sem Bateria",selftest:"Autoteste",normal:"Normal",alarm:"Alarme",fault:"Falta",days:"dìas",hrs:"horas",min:"min",flash:"Flash",check:"Check",idle:"Inativo",exporting:"Exportando",importing:"Importando",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Parado",shutdown:"Desligar",offline:"Offline",running:"Rodando",sleepmode:"Dormindo",grid_name:"Rede"},vt={battery:{bat:"Nenhum atributo de bateria definido",energy:"Inclua o atributo de energia da bateria e seu valor em Wh, por exemplo: 5,32 Potência da bateria: 5320",shutdown_soc:"Inclua o atributo shutdown_soc da bateria e seu valor, por exemplo shutdown_soc: 20",full_capacity:"A capacidade total deve estar entre 80 e 100",empty_capacity:"A capacidade vazia deve ser <= 40",show_daily:"Por favor, inclua os atributos day_battery_charge_70 e day_battery_discharge_71 e os IDs das entidade"},solar:{sol:"Nenhum atributo solar definido",mppts:"Por favor, inclua o atributo solar mppts e seu valor; 1,2,3 ou 4, por exemplo, mppts: 2",show_daily:"Por favor, inclua o atributo day_pv_energy_108 e o ID da entidade"},grid:{show_daily:"Por favor, inclua os atributos day_grid_import_76 e day_grid_export_77 e os IDs das entidade"},essential_power:"O atributo Essential_Power está definido como nenhum. Inclua o atributo inverter_power_175 e o ID da entidade para que o cartão possa calcular esse valor.",nonessential_power:"O atributo nonessential_power está configurado como nenhum. Inclua o atributo grid_power_169 e o ID da entidade para que o cartão possa calcular esse valor.",missing_entity:"Por favor, inclua o atributo e o ID da entidade"},wt={title:"Título",title_colour:"Cor do Título",title_size:"Tamanho do Título (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Casas decimais",model:"Modelo",autarky:"Autoconsumo",cardstyle:"Estilo do Cartão",large_font:"Largura da fonte",modern:"Moderno",show_solar:"Exibir Solar",show_battery:"Exibir Bateria",show_grid:"Exibir Rede",show_aux:"Exibir Aux",dynamic_line_width:"Largura da linha dinâmica",max_line_width:"Largura máxima da linha",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Exibir Diário",show_daily_aux:"Exibir Diário Aux",animation_speed:"Velocidade de Animação",max_power:"Potência Max",pv1_name:"PFV1 Name",pv2_name:"PFV2 Name",pv3_name:"PFV3 Name",pv4_name:"PFV4 Name",display_mode:"Mode de Exibição",battery:"Bateria",load1_name:"Nome Uso1",load2_name:"Nome Uso2",load3_name:"Nome Uso3",load4_name:"Nome Uso4",load1_icon:"Icone Uso1",load2_icon:"Icone Uso2",load3_icon:"Icone Uso3",load4_icon:"Icone Uso4",aux_load1_name:"Nome Aux_Uso1",aux_load2_name:"Nome Aux_Uso2",aux_load1_icon:"Nome Aux_Uso3",aux_load2_icon:"Nome Aux_Uso4",show_daily_buy:"Consumo Diário",show_daily_sell:"Produção Diária",no_grid_colour:"Cor No_Grid",grid_off_colour:"Cor Grid_Off",grid_name:"Nome Grid",colour:"Cor",charge_colour:"Cor Charge",aux_colour:"Cor",aux_off_colour:"Cor Off",panel_mode:"Modo do Painel",invert_grid:"Inverter Valores",invert_load:"Inverter Valores",shutdown_soc:"Desligamento do SOC",energy:"Energia",auto_scale:"Escala automática",three_phase:"Trifásico",dynamic_colour:"Cor Dinâmica",dynamic_icon:"Ícone Dinâmico",invert_power:"Potência do Inversor",show_absolute:"Exibir valor absoluto",hide_soc:"Ocultar SOC",invert_aux:"Inverter Aux",show_absolute_aux:"Exibir absoluto_aux",show_nonessential:"Exibir Desnecessário",aux_name:"Nome Aux",aux_type:"Icone Aux",aux_loads:"Aux Loads",essential_name:"Nome Essencial",additional_loads:"Uso Adicional",export_colour:"Cor Expor",nonessential_name:"Nome Desnecessário",nonessential_icon:"Icone Desnecessário",energy_cost_decimals:"Decimais do custo de energia",show_remaining_energy:"Exibir energia restante",cat_title:{title:"Opções de título",general:"Opções gerais",inverter:"Opções do inversor",solar:"Opções Solar",battery:"Opções da Bateria",grid:"Opções da Rede",load:"Opções Load",entities:"Entidades",aux:"Opções do Aux",energy:"Entidade de Enêrgia",bat:"Entidades da Bateria ",sol:"Entidades de Solar",inv:"Entidades do Inversor",ld:"Entidade do Load",gri:"Entidade da Rede"}},_t={common:ft,errors:vt,config:wt};const xt={hass:null},bt={da:Object.freeze({__proto__:null,common:Ae,config:Le,default:Ce,errors:Pe}),de:Object.freeze({__proto__:null,common:Ee,config:Me,default:Ne,errors:Te}),en:Object.freeze({__proto__:null,common:ke,config:Ie,default:Oe,errors:Se}),es:Object.freeze({__proto__:null,common:De,config:ze,default:Be,errors:He}),et:Object.freeze({__proto__:null,common:Ge,config:qe,default:je,errors:Re}),fr:Object.freeze({__proto__:null,common:Ze,config:We,default:Ue,errors:Ve}),nl:Object.freeze({__proto__:null,common:Qe,config:Xe,default:Ye,errors:Fe}),ru:Object.freeze({__proto__:null,common:Je,config:$e,default:et,errors:Ke}),cs:Object.freeze({__proto__:null,common:tt,config:ot,default:at,errors:nt}),it:Object.freeze({__proto__:null,common:rt,config:st,default:lt,errors:it}),ca:Object.freeze({__proto__:null,common:dt,config:ut,default:ht,errors:ct}),sk:Object.freeze({__proto__:null,common:pt,config:yt,default:mt,errors:gt}),pt_BR:Object.freeze({__proto__:null,common:ft,config:wt,default:_t,errors:vt})};function At(e,t="",n=""){const o=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_"),a="".concat(xt.hass?.selectedLanguage||xt.hass?.locale?.language||xt.hass?.language||o);let r;try{r=e.split(".").reduce(((e,t)=>e[t]),bt[a])}catch(t){r=e.split(".").reduce(((e,t)=>e[t]),bt.en)}return void 0===r&&(r=e.split(".").reduce(((e,t)=>e[t]),bt.en)),""!==t&&""!==n&&(r=r.replace(t,n)),r}var Pt={cardstyle:"lite",panel_mode:!1,large_font:!1,show_solar:!0,show_battery:!0,show_grid:!0,card_height:"396px",card_width:"100%",decimal_places:2,dynamic_line_width:!0,max_line_width:4,min_line_width:1,inverter:{modern:!0,colour:"grey",autarky:"power",model:_e.Sunsynk,auto_scale:!0,three_phase:!1},battery:{energy:0,shutdown_soc:20,invert_power:!1,hide_soc:!1,colour:"pink",show_daily:!1,show_remaining_energy:!0,animation_speed:6,max_power:4500,show_absolute:!1,auto_scale:!0,dynamic_colour:!0,linear_gradient:!0},solar:{colour:"orange",show_daily:!1,mppts:2,animation_speed:9,max_power:8e3,pv1_name:At("common.pv1_name"),pv2_name:At("common.pv2_name"),pv3_name:At("common.pv3_name"),pv4_name:At("common.pv4_name"),auto_scale:!0,display_mode:1,dynamic_colour:!0},load:{colour:"#5fb6ad",dynamic_colour:!0,dynamic_icon:!0,show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,invert_load:!1,show_absolute_aux:!1,animation_speed:4,max_power:8e3,aux_name:At("common.aux_name"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",essential_name:At("common.essential"),load1_icon:"default",load2_icon:"default",load1_name:At("common.load1_name"),load2_name:At("common.load2_name"),auto_scale:!0},grid:{colour:"#5490c2",grid_name:At("common.grid_name"),show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:At("common.nonessential_name"),additional_loads:0,load1_name:"",load2_name:"",load3_name:"",load1_icon:"default",load2_icon:"default",load3_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3,auto_scale:!0,energy_cost_decimals:2,show_absolute:!1}};const Lt=[0,1,2,4],Ct=[0,1,2,3],Et=[!0,!1],Tt=[!0,!1];var Mt,Nt,kt,St,It;!function(e){e.DATE="date",e.ENUM="enum",e.TIMESTAMP="timestamp",e.APPARENT_POWER="apparent_power",e.ATMOSPHERIC_PRESSURE="atmospheric_pressure",e.BATTERY="battery",e.CO="carbon_monoxide",e.CO2="carbon_dioxide",e.CURRENT="current",e.ENERGY="energy",e.ENERGY_STORAGE="energy_storage",e.FREQUENCY="frequency",e.IRRADIANCE="irradiance",e.MONETARY="monetary",e.POWER_FACTOR="power_factor",e.POWER="power",e.REACTIVE_POWER="reactive_power",e.TEMPERATURE="temperature",e.VOLTAGE="voltage"}(Mt||(Mt={})),function(e){e.WATT="W",e.KILO_WATT="kW",e.BTU_PER_HOUR="BTU/h"}(Nt||(Nt={})),function(e){e.GIGA_JOULE="GJ",e.KILO_WATT_HOUR="kWh",e.MEGA_JOULE="MJ",e.MEGA_WATT_HOUR="MWh",e.WATT_HOUR="Wh"}(kt||(kt={})),function(e){e.MILLIAMPERE="mA",e.AMPERE="A"}(St||(St={})),function(e){e.MILLIVOLT="mV",e.VOLT="V"}(It||(It={}));const Ot={[kt.WATT_HOUR]:[{threshold:1e6,divisor:1e6,targetUnit:kt.MEGA_WATT_HOUR},{threshold:1e3,divisor:1e3,targetUnit:kt.KILO_WATT_HOUR,decimal:1}],[kt.KILO_WATT_HOUR]:[{threshold:1e3,divisor:1e3,targetUnit:kt.MEGA_WATT_HOUR,decimal:2}],[kt.MEGA_WATT_HOUR]:[],[kt.GIGA_JOULE]:[{threshold:1e3,divisor:1e3,targetUnit:kt.MEGA_JOULE}],[kt.MEGA_JOULE]:[]};var Dt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ht(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zt={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",o=9007199254740991,a="[object Arguments]",r="[object AsyncFunction]",i="[object Function]",s="[object GeneratorFunction]",l="[object Null]",d="[object Object]",c="[object Proxy]",u="[object Undefined]",h=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[a]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[i]=g["[object Map]"]=g["[object Number]"]=g[d]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var y="object"==typeof Dt&&Dt&&Dt.Object===Object&&Dt,m="object"==typeof self&&self&&self.Object===Object&&self,f=y||m||Function("return this")(),v=t&&!t.nodeType&&t,w=v&&e&&!e.nodeType&&e,_=w&&w.exports===v,x=_&&y.process,b=function(){try{var e=w&&w.require&&w.require("util").types;return e||x&&x.binding&&x.binding("util")}catch(e){}}(),A=b&&b.isTypedArray;var P,L,C,E=Array.prototype,T=Function.prototype,M=Object.prototype,N=f["__core-js_shared__"],k=T.toString,S=M.hasOwnProperty,I=(P=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||""))?"Symbol(src)_1."+P:"",O=M.toString,D=k.call(Object),H=RegExp("^"+k.call(S).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),z=_?f.Buffer:void 0,B=f.Symbol,G=f.Uint8Array,R=z?z.allocUnsafe:void 0,q=(L=Object.getPrototypeOf,C=Object,function(e){return L(C(e))}),j=Object.create,Z=M.propertyIsEnumerable,V=E.splice,W=B?B.toStringTag:void 0,U=function(){try{var e=ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Q=z?z.isBuffer:void 0,F=Math.max,X=Date.now,Y=ve(f,"Map"),J=ve(Object,"create"),K=function(){function e(){}return function(t){if(!Ne(t))return{};if(j)return j(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function $(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},ee.prototype.set=function(e,t){var n=this.__data__,o=ie(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this},te.prototype.clear=function(){this.size=0,this.__data__={hash:new $,map:new(Y||ee),string:new $}},te.prototype.delete=function(e){var t=fe(this,e).delete(e);return this.size-=t?1:0,t},te.prototype.get=function(e){return fe(this,e).get(e)},te.prototype.has=function(e){return fe(this,e).has(e)},te.prototype.set=function(e,t){var n=fe(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this},ne.prototype.clear=function(){this.__data__=new ee,this.size=0},ne.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ne.prototype.get=function(e){return this.__data__.get(e)},ne.prototype.has=function(e){return this.__data__.has(e)},ne.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ee){var o=n.__data__;if(!Y||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new te(o)}return n.set(e,t),this.size=n.size,this};var le,de=function(e,t,n){for(var o=-1,a=Object(e),r=n(e),i=r.length;i--;){var s=r[le?i:++o];if(!1===t(a[s],s,a))break}return e};function ce(e){return null==e?void 0===e?u:l:W&&W in Object(e)?function(e){var t=S.call(e,W),n=e[W];try{e[W]=void 0;var o=!0}catch(e){}var a=O.call(e);o&&(t?e[W]=n:delete e[W]);return a}(e):function(e){return O.call(e)}(e)}function ue(e){return ke(e)&&ce(e)==a}function he(e){return!(!Ne(e)||function(e){return!!I&&I in e}(e))&&(Te(e)?H:h).test(function(e){if(null!=e){try{return k.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function pe(e){if(!Ne(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=_e(e),n=[];for(var o in e)("constructor"!=o||!t&&S.call(e,o))&&n.push(o);return n}function ge(e,t,n,o,a){e!==t&&de(t,(function(r,i){if(a||(a=new ne),Ne(r))!function(e,t,n,o,a,r,i){var s=xe(e,n),l=xe(t,n),c=i.get(l);if(c)return void ae(e,n,c);var u=r?r(s,l,n+"",e,t,i):void 0,h=void 0===u;if(h){var p=Le(l),g=!p&&Ee(l),y=!p&&!g&&Se(l);u=l,p||g||y?Le(s)?u=s:ke(_=s)&&Ce(_)?u=function(e,t){var n=-1,o=e.length;t||(t=Array(o));for(;++n-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(me);function Ae(e,t){return e===t||e!=e&&t!=t}var Pe=ue(function(){return arguments}())?ue:function(e){return ke(e)&&S.call(e,"callee")&&!Z.call(e,"callee")},Le=Array.isArray;function Ce(e){return null!=e&&Me(e.length)&&!Te(e)}var Ee=Q||function(){return!1};function Te(e){if(!Ne(e))return!1;var t=ce(e);return t==i||t==s||t==r||t==c}function Me(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Ne(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ke(e){return null!=e&&"object"==typeof e}var Se=A?function(e){return function(t){return e(t)}}(A):function(e){return ke(e)&&Me(e.length)&&!!g[ce(e)]};function Ie(e){return Ce(e)?oe(e,!0):pe(e)}var Oe,De=(Oe=function(e,t,n){ge(e,t,n)},ye((function(e,t){var n=-1,o=t.length,a=o>1?t[o-1]:void 0,r=o>2?t[2]:void 0;for(a=Oe.length>3&&"function"==typeof a?(o--,a):void 0,r&&function(e,t,n){if(!Ne(n))return!1;var o=typeof t;return!!("number"==o?Ce(n)&&we(t,n.length):"string"==o&&t in n)&&Ae(n[t],e)}(t[0],t[1],r)&&(a=o<3?void 0:a,o=1),e=Object(e);++n @@ -56,10 +56,10 @@ const gt=(t,e,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"! * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */!function(t,e){(function(){var n,a="Expected a function",o="__lodash_hash_undefined__",r="__lodash_placeholder__",i=16,s=32,l=64,d=128,c=256,u=1/0,h=9007199254740991,p=NaN,y=4294967295,g=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",s],["partialRight",l],["rearg",c]],m="[object Arguments]",f="[object Array]",v="[object Boolean]",w="[object Date]",_="[object Error]",x="[object Function]",b="[object GeneratorFunction]",A="[object Map]",L="[object Number]",P="[object Object]",E="[object Promise]",N="[object RegExp]",C="[object Set]",M="[object String]",T="[object Symbol]",k="[object WeakMap]",S="[object ArrayBuffer]",I="[object DataView]",D="[object Float32Array]",O="[object Float64Array]",H="[object Int8Array]",z="[object Int16Array]",B="[object Int32Array]",G="[object Uint8Array]",V="[object Uint8ClampedArray]",R="[object Uint16Array]",q="[object Uint32Array]",j=/\b__p \+= '';/g,Z=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,Q=RegExp(U.source),X=RegExp(F.source),Y=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tt=/^\w*$/,et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,at=RegExp(nt.source),ot=/^\s+/,rt=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,dt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ut=/\\(\\)?/g,ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,yt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,mt=/^\[object .+?Constructor\]$/,ft=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_t=/($^)/,xt=/['\n\r\u2028\u2029\\]/g,bt="\\ud800-\\udfff",At="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Lt="\\u2700-\\u27bf",Pt="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",Nt="\\ufe0e\\ufe0f",Ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Mt="['’]",Tt="["+bt+"]",kt="["+Ct+"]",St="["+At+"]",It="\\d+",Dt="["+Lt+"]",Ot="["+Pt+"]",Ht="[^"+bt+Ct+It+Lt+Pt+Et+"]",zt="\\ud83c[\\udffb-\\udfff]",Bt="[^"+bt+"]",Gt="(?:\\ud83c[\\udde6-\\uddff]){2}",Vt="[\\ud800-\\udbff][\\udc00-\\udfff]",Rt="["+Et+"]",qt="\\u200d",jt="(?:"+Ot+"|"+Ht+")",Zt="(?:"+Rt+"|"+Ht+")",Wt="(?:['’](?:d|ll|m|re|s|t|ve))?",Ut="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ft="(?:"+St+"|"+zt+")"+"?",Qt="["+Nt+"]?",Xt=Qt+Ft+("(?:"+qt+"(?:"+[Bt,Gt,Vt].join("|")+")"+Qt+Ft+")*"),Yt="(?:"+[Dt,Gt,Vt].join("|")+")"+Xt,Jt="(?:"+[Bt+St+"?",St,Gt,Vt,Tt].join("|")+")",Kt=RegExp(Mt,"g"),$t=RegExp(St,"g"),te=RegExp(zt+"(?="+zt+")|"+Jt+Xt,"g"),ee=RegExp([Rt+"?"+Ot+"+"+Wt+"(?="+[kt,Rt,"$"].join("|")+")",Zt+"+"+Ut+"(?="+[kt,Rt+jt,"$"].join("|")+")",Rt+"?"+jt+"+"+Wt,Rt+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",It,Yt].join("|"),"g"),ne=RegExp("["+qt+bt+At+Nt+"]"),ae=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,oe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,ie={};ie[D]=ie[O]=ie[H]=ie[z]=ie[B]=ie[G]=ie[V]=ie[R]=ie[q]=!0,ie[m]=ie[f]=ie[S]=ie[v]=ie[I]=ie[w]=ie[_]=ie[x]=ie[A]=ie[L]=ie[P]=ie[N]=ie[C]=ie[M]=ie[k]=!1;var se={};se[m]=se[f]=se[S]=se[I]=se[v]=se[w]=se[D]=se[O]=se[H]=se[z]=se[B]=se[A]=se[L]=se[P]=se[N]=se[C]=se[M]=se[T]=se[G]=se[V]=se[R]=se[q]=!0,se[_]=se[x]=se[k]=!1;var le={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},de=parseFloat,ce=parseInt,ue="object"==typeof Te&&Te&&Te.Object===Object&&Te,he="object"==typeof self&&self&&self.Object===Object&&self,pe=ue||he||Function("return this")(),ye=e&&!e.nodeType&&e,ge=ye&&t&&!t.nodeType&&t,me=ge&&ge.exports===ye,fe=me&&ue.process,ve=function(){try{var t=ge&&ge.require&&ge.require("util").types;return t||fe&&fe.binding&&fe.binding("util")}catch(t){}}(),we=ve&&ve.isArrayBuffer,_e=ve&&ve.isDate,xe=ve&&ve.isMap,be=ve&&ve.isRegExp,Ae=ve&&ve.isSet,Le=ve&&ve.isTypedArray;function Pe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ee(t,e,n,a){for(var o=-1,r=null==t?0:t.length;++o-1}function Ie(t,e,n){for(var a=-1,o=null==t?0:t.length;++a-1;);return n}function nn(t,e){for(var n=t.length;n--&&qe(e,t[n],0)>-1;);return n}var an=Fe({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),on=Fe({"&":"&","<":"<",">":">",'"':""","'":"'"});function rn(t){return"\\"+le[t]}function sn(t){return ne.test(t)}function ln(t){var e=-1,n=Array(t.size);return t.forEach((function(t,a){n[++e]=[a,t]})),n}function dn(t,e){return function(n){return t(e(n))}}function cn(t,e){for(var n=-1,a=t.length,o=0,i=[];++n",""":'"',"'":"'"});var fn=function t(e){var rt,bt=(e=null==e?pe:fn.defaults(pe.Object(),e,fn.pick(pe,oe))).Array,At=e.Date,Lt=e.Error,Pt=e.Function,Et=e.Math,Nt=e.Object,Ct=e.RegExp,Mt=e.String,Tt=e.TypeError,kt=bt.prototype,St=Pt.prototype,It=Nt.prototype,Dt=e["__core-js_shared__"],Ot=St.toString,Ht=It.hasOwnProperty,zt=0,Bt=(rt=/[^.]+$/.exec(Dt&&Dt.keys&&Dt.keys.IE_PROTO||""))?"Symbol(src)_1."+rt:"",Gt=It.toString,Vt=Ot.call(Nt),Rt=pe._,qt=Ct("^"+Ot.call(Ht).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jt=me?e.Buffer:n,Zt=e.Symbol,Wt=e.Uint8Array,Ut=jt?jt.allocUnsafe:n,Ft=dn(Nt.getPrototypeOf,Nt),Qt=Nt.create,Xt=It.propertyIsEnumerable,Yt=kt.splice,Jt=Zt?Zt.isConcatSpreadable:n,te=Zt?Zt.iterator:n,ne=Zt?Zt.toStringTag:n,le=function(){try{var t=pr(Nt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ue=e.clearTimeout!==pe.clearTimeout&&e.clearTimeout,he=At&&At.now!==pe.Date.now&&At.now,ye=e.setTimeout!==pe.setTimeout&&e.setTimeout,ge=Et.ceil,fe=Et.floor,ve=Nt.getOwnPropertySymbols,Te=jt?jt.isBuffer:n,Ge=e.isFinite,Fe=kt.join,vn=dn(Nt.keys,Nt),wn=Et.max,_n=Et.min,xn=At.now,bn=e.parseInt,An=Et.random,Ln=kt.reverse,Pn=pr(e,"DataView"),En=pr(e,"Map"),Nn=pr(e,"Promise"),Cn=pr(e,"Set"),Mn=pr(e,"WeakMap"),Tn=pr(Nt,"create"),kn=Mn&&new Mn,Sn={},In=Gr(Pn),Dn=Gr(En),On=Gr(Nn),Hn=Gr(Cn),zn=Gr(Mn),Bn=Zt?Zt.prototype:n,Gn=Bn?Bn.valueOf:n,Vn=Bn?Bn.toString:n;function Rn(t){if(ns(t)&&!Wi(t)&&!(t instanceof Wn)){if(t instanceof Zn)return t;if(Ht.call(t,"__wrapped__"))return Vr(t)}return new Zn(t)}var qn=function(){function t(){}return function(e){if(!es(e))return{};if(Qt)return Qt(e);t.prototype=e;var a=new t;return t.prototype=n,a}}();function jn(){}function Zn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=y,this.__views__=[]}function Un(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function da(t,e,a,o,r,i){var s,l=1&e,d=2&e,c=4&e;if(a&&(s=r?a(t,o,r,i):a(t)),s!==n)return s;if(!es(t))return t;var u=Wi(t);if(u){if(s=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&Ht.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!l)return ko(t,s)}else{var h=mr(t),p=h==x||h==b;if(Xi(t))return Po(t,l);if(h==P||h==m||p&&!r){if(s=d||p?{}:vr(t),!l)return d?function(t,e){return So(t,gr(t),e)}(t,function(t,e){return t&&So(e,Is(e),t)}(s,t)):function(t,e){return So(t,yr(t),e)}(t,ra(s,t))}else{if(!se[h])return r?t:{};s=function(t,e,n){var a=t.constructor;switch(e){case S:return Eo(t);case v:case w:return new a(+t);case I:return function(t,e){var n=e?Eo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case D:case O:case H:case z:case B:case G:case V:case R:case q:return No(t,n);case A:return new a;case L:case M:return new a(t);case N:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case C:return new a;case T:return o=t,Gn?Nt(Gn.call(o)):{}}var o}(t,h,l)}}i||(i=new Yn);var y=i.get(t);if(y)return y;i.set(t,s),ss(t)?t.forEach((function(n){s.add(da(n,e,a,n,t,i))})):as(t)&&t.forEach((function(n,o){s.set(o,da(n,e,a,o,t,i))}));var g=u?n:(c?d?ir:rr:d?Is:Ss)(t);return Ne(g||t,(function(n,o){g&&(n=t[o=n]),na(s,o,da(n,e,a,o,t,i))})),s}function ca(t,e,a){var o=a.length;if(null==t)return!o;for(t=Nt(t);o--;){var r=a[o],i=e[r],s=t[r];if(s===n&&!(r in t)||!i(s))return!1}return!0}function ua(t,e,o){if("function"!=typeof t)throw new Tt(a);return Sr((function(){t.apply(n,o)}),e)}function ha(t,e,n,a){var o=-1,r=Se,i=!0,s=t.length,l=[],d=e.length;if(!s)return l;n&&(e=De(e,Ke(n))),a?(r=Ie,i=!1):e.length>=200&&(r=tn,i=!1,e=new Xn(e));t:for(;++o-1},Fn.prototype.set=function(t,e){var n=this.__data__,a=aa(n,t);return a<0?(++this.size,n.push([t,e])):n[a][1]=e,this},Qn.prototype.clear=function(){this.size=0,this.__data__={hash:new Un,map:new(En||Fn),string:new Un}},Qn.prototype.delete=function(t){var e=ur(this,t).delete(t);return this.size-=e?1:0,e},Qn.prototype.get=function(t){return ur(this,t).get(t)},Qn.prototype.has=function(t){return ur(this,t).has(t)},Qn.prototype.set=function(t,e){var n=ur(this,t),a=n.size;return n.set(t,e),this.size+=n.size==a?0:1,this},Xn.prototype.add=Xn.prototype.push=function(t){return this.__data__.set(t,o),this},Xn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Fn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Fn){var a=n.__data__;if(!En||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new Qn(a)}return n.set(t,e),this.size=n.size,this};var pa=Oo(xa),ya=Oo(ba,!0);function ga(t,e){var n=!0;return pa(t,(function(t,a,o){return n=!!e(t,a,o)})),n}function ma(t,e,a){for(var o=-1,r=t.length;++o0&&n(s)?e>1?va(s,e-1,n,a,o):Oe(o,s):a||(o[o.length]=s)}return o}var wa=Ho(),_a=Ho(!0);function xa(t,e){return t&&wa(t,e,Ss)}function ba(t,e){return t&&_a(t,e,Ss)}function Aa(t,e){return ke(e,(function(e){return Ki(t[e])}))}function La(t,e){for(var a=0,o=(e=xo(e,t)).length;null!=t&&ae}function Ca(t,e){return null!=t&&Ht.call(t,e)}function Ma(t,e){return null!=t&&e in Nt(t)}function Ta(t,e,a){for(var o=a?Ie:Se,r=t[0].length,i=t.length,s=i,l=bt(i),d=1/0,c=[];s--;){var u=t[s];s&&e&&(u=De(u,Ke(e))),d=_n(u.length,d),l[s]=!a&&(e||r>=120&&u.length>=120)?new Xn(s&&u):n}u=t[0];var h=-1,p=l[0];t:for(;++h=s?l:l*("desc"==n[a]?-1:1)}return t.index-e.index}(t,e,n)}))}function Ua(t,e,n){for(var a=-1,o=e.length,r={};++a-1;)s!==t&&Yt.call(s,l,1),Yt.call(t,l,1);return t}function Qa(t,e){for(var n=t?e.length:0,a=n-1;n--;){var o=e[n];if(n==a||o!==r){var r=o;_r(o)?Yt.call(t,o,1):po(t,o)}}return t}function Xa(t,e){return t+fe(An()*(e-t+1))}function Ya(t,e){var n="";if(!t||e<1||e>h)return n;do{e%2&&(n+=t),(e=fe(e/2))&&(t+=t)}while(e);return n}function Ja(t,e){return Ir(Cr(t,e,ol),t+"")}function Ka(t){return Kn(Rs(t))}function $a(t,e){var n=Rs(t);return Hr(n,la(e,0,n.length))}function to(t,e,a,o){if(!es(t))return t;for(var r=-1,i=(e=xo(e,t)).length,s=i-1,l=t;null!=l&&++ro?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var r=bt(o);++a>>1,i=t[r];null!==i&&!ds(i)&&(n?i<=e:i=200){var d=e?null:Jo(t);if(d)return un(d);i=!1,o=tn,l=new Xn}else l=e?[]:s;t:for(;++a=o?t:oo(t,e,a)}var Lo=ue||function(t){return pe.clearTimeout(t)};function Po(t,e){if(e)return t.slice();var n=t.length,a=Ut?Ut(n):new t.constructor(n);return t.copy(a),a}function Eo(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function No(t,e){var n=e?Eo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Co(t,e){if(t!==e){var a=t!==n,o=null===t,r=t==t,i=ds(t),s=e!==n,l=null===e,d=e==e,c=ds(e);if(!l&&!c&&!i&&t>e||i&&s&&d&&!l&&!c||o&&s&&d||!a&&d||!r)return 1;if(!o&&!i&&!c&&t1?a[r-1]:n,s=r>2?a[2]:n;for(i=t.length>3&&"function"==typeof i?(r--,i):n,s&&xr(a[0],a[1],s)&&(i=r<3?n:i,r=1),e=Nt(e);++o-1?r[i?e[s]:s]:n}}function Ro(t){return or((function(e){var o=e.length,r=o,i=Zn.prototype.thru;for(t&&e.reverse();r--;){var s=e[r];if("function"!=typeof s)throw new Tt(a);if(i&&!l&&"wrapper"==lr(s))var l=new Zn([],!0)}for(r=l?r:o;++r1&&w.reverse(),h&&cl))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var h=-1,p=!0,y=2&a?new Xn:n;for(i.set(t,e),i.set(e,t);++h-1&&t%1==0&&t1?"& ":"")+e[a],e=e.join(n>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(a,function(t,e){return Ne(g,(function(n){var a="_."+n[0];e&n[1]&&!Se(t,a)&&t.push(a)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(lt):[]}(a),n)))}function Or(t){var e=0,a=0;return function(){var o=xn(),r=16-(o-a);if(a=o,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(n,arguments)}}function Hr(t,e){var a=-1,o=t.length,r=o-1;for(e=e===n?o:e;++a1?t[e-1]:n;return a="function"==typeof a?(t.pop(),a):n,ii(t,a)}));function pi(t){var e=Rn(t);return e.__chain__=!0,e}function yi(t,e){return e(t)}var gi=or((function(t){var e=t.length,a=e?t[0]:0,o=this.__wrapped__,r=function(e){return sa(e,t)};return!(e>1||this.__actions__.length)&&o instanceof Wn&&_r(a)?((o=o.slice(a,+a+(e?1:0))).__actions__.push({func:yi,args:[r],thisArg:n}),new Zn(o,this.__chain__).thru((function(t){return e&&!t.length&&t.push(n),t}))):this.thru(r)}));var mi=Io((function(t,e,n){Ht.call(t,n)?++t[n]:ia(t,n,1)}));var fi=Vo(Zr),vi=Vo(Wr);function wi(t,e){return(Wi(t)?Ne:pa)(t,cr(e,3))}function _i(t,e){return(Wi(t)?Ce:ya)(t,cr(e,3))}var xi=Io((function(t,e,n){Ht.call(t,n)?t[n].push(e):ia(t,n,[e])}));var bi=Ja((function(t,e,n){var a=-1,o="function"==typeof e,r=Fi(t)?bt(t.length):[];return pa(t,(function(t){r[++a]=o?Pe(e,t,n):ka(t,e,n)})),r})),Ai=Io((function(t,e,n){ia(t,n,e)}));function Li(t,e){return(Wi(t)?De:Va)(t,cr(e,3))}var Pi=Io((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Ei=Ja((function(t,e){if(null==t)return[];var n=e.length;return n>1&&xr(t,e[0],e[1])?e=[]:n>2&&xr(e[0],e[1],e[2])&&(e=[e[0]]),Wa(t,va(e,1),[])})),Ni=he||function(){return pe.Date.now()};function Ci(t,e,a){return e=a?n:e,e=t&&null==e?t.length:e,$o(t,d,n,n,n,n,e)}function Mi(t,e){var o;if("function"!=typeof e)throw new Tt(a);return t=gs(t),function(){return--t>0&&(o=e.apply(this,arguments)),t<=1&&(e=n),o}}var Ti=Ja((function(t,e,n){var a=1;if(n.length){var o=cn(n,dr(Ti));a|=s}return $o(t,a,e,n,o)})),ki=Ja((function(t,e,n){var a=3;if(n.length){var o=cn(n,dr(ki));a|=s}return $o(e,a,t,n,o)}));function Si(t,e,o){var r,i,s,l,d,c,u=0,h=!1,p=!1,y=!0;if("function"!=typeof t)throw new Tt(a);function g(e){var a=r,o=i;return r=i=n,u=e,l=t.apply(o,a)}function m(t){var a=t-c;return c===n||a>=e||a<0||p&&t-u>=s}function f(){var t=Ni();if(m(t))return v(t);d=Sr(f,function(t){var n=e-(t-c);return p?_n(n,s-(t-u)):n}(t))}function v(t){return d=n,y&&r?g(t):(r=i=n,l)}function w(){var t=Ni(),a=m(t);if(r=arguments,i=this,c=t,a){if(d===n)return function(t){return u=t,d=Sr(f,e),h?g(t):l}(c);if(p)return Lo(d),d=Sr(f,e),g(c)}return d===n&&(d=Sr(f,e)),l}return e=fs(e)||0,es(o)&&(h=!!o.leading,s=(p="maxWait"in o)?wn(fs(o.maxWait)||0,e):s,y="trailing"in o?!!o.trailing:y),w.cancel=function(){d!==n&&Lo(d),u=0,r=c=i=d=n},w.flush=function(){return d===n?l:v(Ni())},w}var Ii=Ja((function(t,e){return ua(t,1,e)})),Di=Ja((function(t,e,n){return ua(t,fs(e)||0,n)}));function Oi(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Tt(a);var n=function(){var a=arguments,o=e?e.apply(this,a):a[0],r=n.cache;if(r.has(o))return r.get(o);var i=t.apply(this,a);return n.cache=r.set(o,i)||r,i};return n.cache=new(Oi.Cache||Qn),n}function Hi(t){if("function"!=typeof t)throw new Tt(a);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Oi.Cache=Qn;var zi=bo((function(t,e){var n=(e=1==e.length&&Wi(e[0])?De(e[0],Ke(cr())):De(va(e,1),Ke(cr()))).length;return Ja((function(a){for(var o=-1,r=_n(a.length,n);++o=e})),Zi=Sa(function(){return arguments}())?Sa:function(t){return ns(t)&&Ht.call(t,"callee")&&!Xt.call(t,"callee")},Wi=bt.isArray,Ui=we?Ke(we):function(t){return ns(t)&&Ea(t)==S};function Fi(t){return null!=t&&ts(t.length)&&!Ki(t)}function Qi(t){return ns(t)&&Fi(t)}var Xi=Te||fl,Yi=_e?Ke(_e):function(t){return ns(t)&&Ea(t)==w};function Ji(t){if(!ns(t))return!1;var e=Ea(t);return e==_||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!rs(t)}function Ki(t){if(!es(t))return!1;var e=Ea(t);return e==x||e==b||"[object AsyncFunction]"==e||"[object Proxy]"==e}function $i(t){return"number"==typeof t&&t==gs(t)}function ts(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function es(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ns(t){return null!=t&&"object"==typeof t}var as=xe?Ke(xe):function(t){return ns(t)&&mr(t)==A};function os(t){return"number"==typeof t||ns(t)&&Ea(t)==L}function rs(t){if(!ns(t)||Ea(t)!=P)return!1;var e=Ft(t);if(null===e)return!0;var n=Ht.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ot.call(n)==Vt}var is=be?Ke(be):function(t){return ns(t)&&Ea(t)==N};var ss=Ae?Ke(Ae):function(t){return ns(t)&&mr(t)==C};function ls(t){return"string"==typeof t||!Wi(t)&&ns(t)&&Ea(t)==M}function ds(t){return"symbol"==typeof t||ns(t)&&Ea(t)==T}var cs=Le?Ke(Le):function(t){return ns(t)&&ts(t.length)&&!!ie[Ea(t)]};var us=Qo(Ga),hs=Qo((function(t,e){return t<=e}));function ps(t){if(!t)return[];if(Fi(t))return ls(t)?yn(t):ko(t);if(te&&t[te])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[te]());var e=mr(t);return(e==A?ln:e==C?un:Rs)(t)}function ys(t){return t?(t=fs(t))===u||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function gs(t){var e=ys(t),n=e%1;return e==e?n?e-n:e:0}function ms(t){return t?la(gs(t),0,y):0}function fs(t){if("number"==typeof t)return t;if(ds(t))return p;if(es(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=es(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Je(t);var n=gt.test(t);return n||ft.test(t)?ce(t.slice(2),n?2:8):yt.test(t)?p:+t}function vs(t){return So(t,Is(t))}function ws(t){return null==t?"":uo(t)}var _s=Do((function(t,e){if(Pr(e)||Fi(e))So(e,Ss(e),t);else for(var n in e)Ht.call(e,n)&&na(t,n,e[n])})),xs=Do((function(t,e){So(e,Is(e),t)})),bs=Do((function(t,e,n,a){So(e,Is(e),t,a)})),As=Do((function(t,e,n,a){So(e,Ss(e),t,a)})),Ls=or(sa);var Ps=Ja((function(t,e){t=Nt(t);var a=-1,o=e.length,r=o>2?e[2]:n;for(r&&xr(e[0],e[1],r)&&(o=1);++a1),e})),So(t,ir(t),n),a&&(n=da(n,7,nr));for(var o=e.length;o--;)po(n,e[o]);return n}));var zs=or((function(t,e){return null==t?{}:function(t,e){return Ua(t,e,(function(e,n){return Cs(t,n)}))}(t,e)}));function Bs(t,e){if(null==t)return{};var n=De(ir(t),(function(t){return[t]}));return e=cr(e),Ua(t,n,(function(t,n){return e(t,n[0])}))}var Gs=Ko(Ss),Vs=Ko(Is);function Rs(t){return null==t?[]:$e(t,Ss(t))}var qs=Bo((function(t,e,n){return e=e.toLowerCase(),t+(n?js(e):e)}));function js(t){return Js(ws(t).toLowerCase())}function Zs(t){return(t=ws(t))&&t.replace(wt,an).replace($t,"")}var Ws=Bo((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Us=Bo((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Fs=zo("toLowerCase");var Qs=Bo((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Xs=Bo((function(t,e,n){return t+(n?" ":"")+Js(e)}));var Ys=Bo((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Js=zo("toUpperCase");function Ks(t,e,a){return t=ws(t),(e=a?n:e)===n?function(t){return ae.test(t)}(t)?function(t){return t.match(ee)||[]}(t):function(t){return t.match(dt)||[]}(t):t.match(e)||[]}var $s=Ja((function(t,e){try{return Pe(t,n,e)}catch(t){return Ji(t)?t:new Lt(t)}})),tl=or((function(t,e){return Ne(e,(function(e){e=Br(e),ia(t,e,Ti(t[e],t))})),t}));function el(t){return function(){return t}}var nl=Ro(),al=Ro(!0);function ol(t){return t}function rl(t){return Ha("function"==typeof t?t:da(t,1))}var il=Ja((function(t,e){return function(n){return ka(n,t,e)}})),sl=Ja((function(t,e){return function(n){return ka(t,n,e)}}));function ll(t,e,n){var a=Ss(e),o=Aa(e,a);null!=n||es(e)&&(o.length||!a.length)||(n=e,e=t,t=this,o=Aa(e,Ss(e)));var r=!(es(n)&&"chain"in n&&!n.chain),i=Ki(t);return Ne(o,(function(n){var a=e[n];t[n]=a,i&&(t.prototype[n]=function(){var e=this.__chain__;if(r||e){var n=t(this.__wrapped__);return(n.__actions__=ko(this.__actions__)).push({func:a,args:arguments,thisArg:t}),n.__chain__=e,n}return a.apply(t,Oe([this.value()],arguments))})})),t}function dl(){}var cl=Wo(De),ul=Wo(Me),hl=Wo(Be);function pl(t){return br(t)?Ue(Br(t)):function(t){return function(e){return La(e,t)}}(t)}var yl=Fo(),gl=Fo(!0);function ml(){return[]}function fl(){return!1}var vl=Zo((function(t,e){return t+e}),0),wl=Yo("ceil"),_l=Zo((function(t,e){return t/e}),1),xl=Yo("floor");var bl,Al=Zo((function(t,e){return t*e}),1),Ll=Yo("round"),Pl=Zo((function(t,e){return t-e}),0);return Rn.after=function(t,e){if("function"!=typeof e)throw new Tt(a);return t=gs(t),function(){if(--t<1)return e.apply(this,arguments)}},Rn.ary=Ci,Rn.assign=_s,Rn.assignIn=xs,Rn.assignInWith=bs,Rn.assignWith=As,Rn.at=Ls,Rn.before=Mi,Rn.bind=Ti,Rn.bindAll=tl,Rn.bindKey=ki,Rn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Wi(t)?t:[t]},Rn.chain=pi,Rn.chunk=function(t,e,a){e=(a?xr(t,e,a):e===n)?1:wn(gs(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var r=0,i=0,s=bt(ge(o/e));rr?0:r+a),(o=o===n||o>r?r:gs(o))<0&&(o+=r),o=a>o?0:ms(o);a>>0)?(t=ws(t))&&("string"==typeof e||null!=e&&!is(e))&&!(e=uo(e))&&sn(t)?Ao(yn(t),0,a):t.split(e,a):[]},Rn.spread=function(t,e){if("function"!=typeof t)throw new Tt(a);return e=null==e?0:wn(gs(e),0),Ja((function(n){var a=n[e],o=Ao(n,0,e);return a&&Oe(o,a),Pe(t,this,o)}))},Rn.tail=function(t){var e=null==t?0:t.length;return e?oo(t,1,e):[]},Rn.take=function(t,e,a){return t&&t.length?oo(t,0,(e=a||e===n?1:gs(e))<0?0:e):[]},Rn.takeRight=function(t,e,a){var o=null==t?0:t.length;return o?oo(t,(e=o-(e=a||e===n?1:gs(e)))<0?0:e,o):[]},Rn.takeRightWhile=function(t,e){return t&&t.length?go(t,cr(e,3),!1,!0):[]},Rn.takeWhile=function(t,e){return t&&t.length?go(t,cr(e,3)):[]},Rn.tap=function(t,e){return e(t),t},Rn.throttle=function(t,e,n){var o=!0,r=!0;if("function"!=typeof t)throw new Tt(a);return es(n)&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),Si(t,e,{leading:o,maxWait:e,trailing:r})},Rn.thru=yi,Rn.toArray=ps,Rn.toPairs=Gs,Rn.toPairsIn=Vs,Rn.toPath=function(t){return Wi(t)?De(t,Br):ds(t)?[t]:ko(zr(ws(t)))},Rn.toPlainObject=vs,Rn.transform=function(t,e,n){var a=Wi(t),o=a||Xi(t)||cs(t);if(e=cr(e,4),null==n){var r=t&&t.constructor;n=o?a?new r:[]:es(t)&&Ki(r)?qn(Ft(t)):{}}return(o?Ne:xa)(t,(function(t,a,o){return e(n,t,a,o)})),n},Rn.unary=function(t){return Ci(t,1)},Rn.union=ni,Rn.unionBy=ai,Rn.unionWith=oi,Rn.uniq=function(t){return t&&t.length?ho(t):[]},Rn.uniqBy=function(t,e){return t&&t.length?ho(t,cr(e,2)):[]},Rn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?ho(t,n,e):[]},Rn.unset=function(t,e){return null==t||po(t,e)},Rn.unzip=ri,Rn.unzipWith=ii,Rn.update=function(t,e,n){return null==t?t:yo(t,e,_o(n))},Rn.updateWith=function(t,e,a,o){return o="function"==typeof o?o:n,null==t?t:yo(t,e,_o(a),o)},Rn.values=Rs,Rn.valuesIn=function(t){return null==t?[]:$e(t,Is(t))},Rn.without=si,Rn.words=Ks,Rn.wrap=function(t,e){return Bi(_o(e),t)},Rn.xor=li,Rn.xorBy=di,Rn.xorWith=ci,Rn.zip=ui,Rn.zipObject=function(t,e){return vo(t||[],e||[],na)},Rn.zipObjectDeep=function(t,e){return vo(t||[],e||[],to)},Rn.zipWith=hi,Rn.entries=Gs,Rn.entriesIn=Vs,Rn.extend=xs,Rn.extendWith=bs,ll(Rn,Rn),Rn.add=vl,Rn.attempt=$s,Rn.camelCase=qs,Rn.capitalize=js,Rn.ceil=wl,Rn.clamp=function(t,e,a){return a===n&&(a=e,e=n),a!==n&&(a=(a=fs(a))==a?a:0),e!==n&&(e=(e=fs(e))==e?e:0),la(fs(t),e,a)},Rn.clone=function(t){return da(t,4)},Rn.cloneDeep=function(t){return da(t,5)},Rn.cloneDeepWith=function(t,e){return da(t,5,e="function"==typeof e?e:n)},Rn.cloneWith=function(t,e){return da(t,4,e="function"==typeof e?e:n)},Rn.conformsTo=function(t,e){return null==e||ca(t,e,Ss(e))},Rn.deburr=Zs,Rn.defaultTo=function(t,e){return null==t||t!=t?e:t},Rn.divide=_l,Rn.endsWith=function(t,e,a){t=ws(t),e=uo(e);var o=t.length,r=a=a===n?o:la(gs(a),0,o);return(a-=e.length)>=0&&t.slice(a,r)==e},Rn.eq=Ri,Rn.escape=function(t){return(t=ws(t))&&X.test(t)?t.replace(F,on):t},Rn.escapeRegExp=function(t){return(t=ws(t))&&at.test(t)?t.replace(nt,"\\$&"):t},Rn.every=function(t,e,a){var o=Wi(t)?Me:ga;return a&&xr(t,e,a)&&(e=n),o(t,cr(e,3))},Rn.find=fi,Rn.findIndex=Zr,Rn.findKey=function(t,e){return Ve(t,cr(e,3),xa)},Rn.findLast=vi,Rn.findLastIndex=Wr,Rn.findLastKey=function(t,e){return Ve(t,cr(e,3),ba)},Rn.floor=xl,Rn.forEach=wi,Rn.forEachRight=_i,Rn.forIn=function(t,e){return null==t?t:wa(t,cr(e,3),Is)},Rn.forInRight=function(t,e){return null==t?t:_a(t,cr(e,3),Is)},Rn.forOwn=function(t,e){return t&&xa(t,cr(e,3))},Rn.forOwnRight=function(t,e){return t&&ba(t,cr(e,3))},Rn.get=Ns,Rn.gt=qi,Rn.gte=ji,Rn.has=function(t,e){return null!=t&&fr(t,e,Ca)},Rn.hasIn=Cs,Rn.head=Fr,Rn.identity=ol,Rn.includes=function(t,e,n,a){t=Fi(t)?t:Rs(t),n=n&&!a?gs(n):0;var o=t.length;return n<0&&(n=wn(o+n,0)),ls(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&qe(t,e,n)>-1},Rn.indexOf=function(t,e,n){var a=null==t?0:t.length;if(!a)return-1;var o=null==n?0:gs(n);return o<0&&(o=wn(a+o,0)),qe(t,e,o)},Rn.inRange=function(t,e,a){return e=ys(e),a===n?(a=e,e=0):a=ys(a),function(t,e,n){return t>=_n(e,n)&&t=-9007199254740991&&t<=h},Rn.isSet=ss,Rn.isString=ls,Rn.isSymbol=ds,Rn.isTypedArray=cs,Rn.isUndefined=function(t){return t===n},Rn.isWeakMap=function(t){return ns(t)&&mr(t)==k},Rn.isWeakSet=function(t){return ns(t)&&"[object WeakSet]"==Ea(t)},Rn.join=function(t,e){return null==t?"":Fe.call(t,e)},Rn.kebabCase=Ws,Rn.last=Jr,Rn.lastIndexOf=function(t,e,a){var o=null==t?0:t.length;if(!o)return-1;var r=o;return a!==n&&(r=(r=gs(a))<0?wn(o+r,0):_n(r,o-1)),e==e?function(t,e,n){for(var a=n+1;a--;)if(t[a]===e)return a;return a}(t,e,r):Re(t,Ze,r,!0)},Rn.lowerCase=Us,Rn.lowerFirst=Fs,Rn.lt=us,Rn.lte=hs,Rn.max=function(t){return t&&t.length?ma(t,ol,Na):n},Rn.maxBy=function(t,e){return t&&t.length?ma(t,cr(e,2),Na):n},Rn.mean=function(t){return We(t,ol)},Rn.meanBy=function(t,e){return We(t,cr(e,2))},Rn.min=function(t){return t&&t.length?ma(t,ol,Ga):n},Rn.minBy=function(t,e){return t&&t.length?ma(t,cr(e,2),Ga):n},Rn.stubArray=ml,Rn.stubFalse=fl,Rn.stubObject=function(){return{}},Rn.stubString=function(){return""},Rn.stubTrue=function(){return!0},Rn.multiply=Al,Rn.nth=function(t,e){return t&&t.length?Za(t,gs(e)):n},Rn.noConflict=function(){return pe._===this&&(pe._=Rt),this},Rn.noop=dl,Rn.now=Ni,Rn.pad=function(t,e,n){t=ws(t);var a=(e=gs(e))?pn(t):0;if(!e||a>=e)return t;var o=(e-a)/2;return Uo(fe(o),n)+t+Uo(ge(o),n)},Rn.padEnd=function(t,e,n){t=ws(t);var a=(e=gs(e))?pn(t):0;return e&&ae){var o=t;t=e,e=o}if(a||t%1||e%1){var r=An();return _n(t+r*(e-t+de("1e-"+((r+"").length-1))),e)}return Xa(t,e)},Rn.reduce=function(t,e,n){var a=Wi(t)?He:Qe,o=arguments.length<3;return a(t,cr(e,4),n,o,pa)},Rn.reduceRight=function(t,e,n){var a=Wi(t)?ze:Qe,o=arguments.length<3;return a(t,cr(e,4),n,o,ya)},Rn.repeat=function(t,e,a){return e=(a?xr(t,e,a):e===n)?1:gs(e),Ya(ws(t),e)},Rn.replace=function(){var t=arguments,e=ws(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Rn.result=function(t,e,a){var o=-1,r=(e=xo(e,t)).length;for(r||(r=1,t=n);++oh)return[];var n=y,a=_n(t,y);e=cr(e),t-=y;for(var o=Ye(a,e);++n=i)return t;var l=a-pn(o);if(l<1)return o;var d=s?Ao(s,0,l).join(""):t.slice(0,l);if(r===n)return d+o;if(s&&(l+=d.length-l),is(r)){if(t.slice(l).search(r)){var c,u=d;for(r.global||(r=Ct(r.source,ws(pt.exec(r))+"g")),r.lastIndex=0;c=r.exec(u);)var h=c.index;d=d.slice(0,h===n?l:h)}}else if(t.indexOf(uo(r),l)!=l){var p=d.lastIndexOf(r);p>-1&&(d=d.slice(0,p))}return d+o},Rn.unescape=function(t){return(t=ws(t))&&Q.test(t)?t.replace(U,mn):t},Rn.uniqueId=function(t){var e=++zt;return ws(t)+e},Rn.upperCase=Ys,Rn.upperFirst=Js,Rn.each=wi,Rn.eachRight=_i,Rn.first=Fr,ll(Rn,(bl={},xa(Rn,(function(t,e){Ht.call(Rn.prototype,e)||(bl[e]=t)})),bl),{chain:!1}),Rn.VERSION="4.17.21",Ne(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Rn[t].placeholder=Rn})),Ne(["drop","take"],(function(t,e){Wn.prototype[t]=function(a){a=a===n?1:wn(gs(a),0);var o=this.__filtered__&&!e?new Wn(this):this.clone();return o.__filtered__?o.__takeCount__=_n(a,o.__takeCount__):o.__views__.push({size:_n(a,y),type:t+(o.__dir__<0?"Right":"")}),o},Wn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ne(["filter","map","takeWhile"],(function(t,e){var n=e+1,a=1==n||3==n;Wn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:cr(t,3),type:n}),e.__filtered__=e.__filtered__||a,e}})),Ne(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),Ne(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Wn.prototype[t]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(ol)},Wn.prototype.find=function(t){return this.filter(t).head()},Wn.prototype.findLast=function(t){return this.reverse().find(t)},Wn.prototype.invokeMap=Ja((function(t,e){return"function"==typeof t?new Wn(this):this.map((function(n){return ka(n,t,e)}))})),Wn.prototype.reject=function(t){return this.filter(Hi(cr(t)))},Wn.prototype.slice=function(t,e){t=gs(t);var a=this;return a.__filtered__&&(t>0||e<0)?new Wn(a):(t<0?a=a.takeRight(-t):t&&(a=a.drop(t)),e!==n&&(a=(e=gs(e))<0?a.dropRight(-e):a.take(e-t)),a)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(y)},xa(Wn.prototype,(function(t,e){var a=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),r=Rn[o?"take"+("last"==e?"Right":""):e],i=o||/^find/.test(e);r&&(Rn.prototype[e]=function(){var e=this.__wrapped__,s=o?[1]:arguments,l=e instanceof Wn,d=s[0],c=l||Wi(e),u=function(t){var e=r.apply(Rn,Oe([t],s));return o&&h?e[0]:e};c&&a&&"function"==typeof d&&1!=d.length&&(l=c=!1);var h=this.__chain__,p=!!this.__actions__.length,y=i&&!h,g=l&&!p;if(!i&&c){e=g?e:new Wn(this);var m=t.apply(e,s);return m.__actions__.push({func:yi,args:[u],thisArg:n}),new Zn(m,h)}return y&&g?t.apply(this,s):(m=this.thru(u),y?o?m.value()[0]:m.value():m)})})),Ne(["pop","push","shift","sort","splice","unshift"],(function(t){var e=kt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",a=/^(?:pop|shift)$/.test(t);Rn.prototype[t]=function(){var t=arguments;if(a&&!this.__chain__){var o=this.value();return e.apply(Wi(o)?o:[],t)}return this[n]((function(n){return e.apply(Wi(n)?n:[],t)}))}})),xa(Wn.prototype,(function(t,e){var n=Rn[e];if(n){var a=n.name+"";Ht.call(Sn,a)||(Sn[a]=[]),Sn[a].push({name:e,func:n})}})),Sn[qo(n,2).name]=[{name:"wrapper",func:n}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=ko(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ko(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ko(this.__views__),t},Wn.prototype.reverse=function(){if(this.__filtered__){var t=new Wn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Wi(t),a=e<0,o=n?t.length:0,r=function(t,e,n){var a=-1,o=n.length;for(;++a=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},Rn.prototype.plant=function(t){for(var e,a=this;a instanceof jn;){var o=Vr(a);o.__index__=0,o.__values__=n,e?r.__wrapped__=o:e=o;var r=o;a=a.__wrapped__}return r.__wrapped__=t,e},Rn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Wn){var e=t;return this.__actions__.length&&(e=new Wn(this)),(e=e.reverse()).__actions__.push({func:yi,args:[ei],thisArg:n}),new Zn(e,this.__chain__)}return this.thru(ei)},Rn.prototype.toJSON=Rn.prototype.valueOf=Rn.prototype.value=function(){return mo(this.__wrapped__,this.__actions__)},Rn.prototype.first=Rn.prototype.head,te&&(Rn.prototype[te]=function(){return this}),Rn}();ge?((ge.exports=fn)._=fn,ye._=fn):pe._=fn}).call(Te)}(He,He.exports);var ze,Be,Ge,Ve=He.exports;let Re=class extends( + */!function(e,t){(function(){var n,o="Expected a function",a="__lodash_hash_undefined__",r="__lodash_placeholder__",i=16,s=32,l=64,d=128,c=256,u=1/0,h=9007199254740991,p=NaN,g=4294967295,y=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",s],["partialRight",l],["rearg",c]],m="[object Arguments]",f="[object Array]",v="[object Boolean]",w="[object Date]",_="[object Error]",x="[object Function]",b="[object GeneratorFunction]",A="[object Map]",P="[object Number]",L="[object Object]",C="[object Promise]",E="[object RegExp]",T="[object Set]",M="[object String]",N="[object Symbol]",k="[object WeakMap]",S="[object ArrayBuffer]",I="[object DataView]",O="[object Float32Array]",D="[object Float64Array]",H="[object Int8Array]",z="[object Int16Array]",B="[object Int32Array]",G="[object Uint8Array]",R="[object Uint8ClampedArray]",q="[object Uint16Array]",j="[object Uint32Array]",Z=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,Q=/[&<>"']/g,F=RegExp(U.source),X=RegExp(Q.source),Y=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ee=/^\w*$/,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ne.source),ae=/^\s+/,re=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,fe=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_e=/($^)/,xe=/['\n\r\u2028\u2029\\]/g,be="\\ud800-\\udfff",Ae="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Pe="\\u2700-\\u27bf",Le="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Te="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Me="['’]",Ne="["+be+"]",ke="["+Te+"]",Se="["+Ae+"]",Ie="\\d+",Oe="["+Pe+"]",De="["+Le+"]",He="[^"+be+Te+Ie+Pe+Le+Ce+"]",ze="\\ud83c[\\udffb-\\udfff]",Be="[^"+be+"]",Ge="(?:\\ud83c[\\udde6-\\uddff]){2}",Re="[\\ud800-\\udbff][\\udc00-\\udfff]",qe="["+Ce+"]",je="\\u200d",Ze="(?:"+De+"|"+He+")",Ve="(?:"+qe+"|"+He+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",Ue="(?:['’](?:D|LL|M|RE|S|T|VE))?",Qe="(?:"+Se+"|"+ze+")"+"?",Fe="["+Ee+"]?",Xe=Fe+Qe+("(?:"+je+"(?:"+[Be,Ge,Re].join("|")+")"+Fe+Qe+")*"),Ye="(?:"+[Oe,Ge,Re].join("|")+")"+Xe,Je="(?:"+[Be+Se+"?",Se,Ge,Re,Ne].join("|")+")",Ke=RegExp(Me,"g"),$e=RegExp(Se,"g"),et=RegExp(ze+"(?="+ze+")|"+Je+Xe,"g"),tt=RegExp([qe+"?"+De+"+"+We+"(?="+[ke,qe,"$"].join("|")+")",Ve+"+"+Ue+"(?="+[ke,qe+Ze,"$"].join("|")+")",qe+"?"+Ze+"+"+We,qe+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ie,Ye].join("|"),"g"),nt=RegExp("["+je+be+Ae+Ee+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,at=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[O]=it[D]=it[H]=it[z]=it[B]=it[G]=it[R]=it[q]=it[j]=!0,it[m]=it[f]=it[S]=it[v]=it[I]=it[w]=it[_]=it[x]=it[A]=it[P]=it[L]=it[E]=it[T]=it[M]=it[k]=!1;var st={};st[m]=st[f]=st[S]=st[I]=st[v]=st[w]=st[O]=st[D]=st[H]=st[z]=st[B]=st[A]=st[P]=st[L]=st[E]=st[T]=st[M]=st[N]=st[G]=st[R]=st[q]=st[j]=!0,st[_]=st[x]=st[k]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},dt=parseFloat,ct=parseInt,ut="object"==typeof Dt&&Dt&&Dt.Object===Object&&Dt,ht="object"==typeof self&&self&&self.Object===Object&&self,pt=ut||ht||Function("return this")(),gt=t&&!t.nodeType&&t,yt=gt&&e&&!e.nodeType&&e,mt=yt&&yt.exports===gt,ft=mt&&ut.process,vt=function(){try{var e=yt&&yt.require&&yt.require("util").types;return e||ft&&ft.binding&&ft.binding("util")}catch(e){}}(),wt=vt&&vt.isArrayBuffer,_t=vt&&vt.isDate,xt=vt&&vt.isMap,bt=vt&&vt.isRegExp,At=vt&&vt.isSet,Pt=vt&&vt.isTypedArray;function Lt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ct(e,t,n,o){for(var a=-1,r=null==e?0:e.length;++a-1}function St(e,t,n){for(var o=-1,a=null==e?0:e.length;++o-1;);return n}function nn(e,t){for(var n=e.length;n--&&jt(t,e[n],0)>-1;);return n}var on=Qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),an=Qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rn(e){return"\\"+lt[e]}function sn(e){return nt.test(e)}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e,o){n[++t]=[o,e]})),n}function dn(e,t){return function(n){return e(t(n))}}function cn(e,t){for(var n=-1,o=e.length,a=0,i=[];++n",""":'"',"'":"'"});var fn=function e(t){var re,be=(t=null==t?pt:fn.defaults(pt.Object(),t,fn.pick(pt,at))).Array,Ae=t.Date,Pe=t.Error,Le=t.Function,Ce=t.Math,Ee=t.Object,Te=t.RegExp,Me=t.String,Ne=t.TypeError,ke=be.prototype,Se=Le.prototype,Ie=Ee.prototype,Oe=t["__core-js_shared__"],De=Se.toString,He=Ie.hasOwnProperty,ze=0,Be=(re=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+re:"",Ge=Ie.toString,Re=De.call(Ee),qe=pt._,je=Te("^"+De.call(He).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ze=mt?t.Buffer:n,Ve=t.Symbol,We=t.Uint8Array,Ue=Ze?Ze.allocUnsafe:n,Qe=dn(Ee.getPrototypeOf,Ee),Fe=Ee.create,Xe=Ie.propertyIsEnumerable,Ye=ke.splice,Je=Ve?Ve.isConcatSpreadable:n,et=Ve?Ve.iterator:n,nt=Ve?Ve.toStringTag:n,lt=function(){try{var e=pr(Ee,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=Ae&&Ae.now!==pt.Date.now&&Ae.now,gt=t.setTimeout!==pt.setTimeout&&t.setTimeout,yt=Ce.ceil,ft=Ce.floor,vt=Ee.getOwnPropertySymbols,Dt=Ze?Ze.isBuffer:n,Gt=t.isFinite,Qt=ke.join,vn=dn(Ee.keys,Ee),wn=Ce.max,_n=Ce.min,xn=Ae.now,bn=t.parseInt,An=Ce.random,Pn=ke.reverse,Ln=pr(t,"DataView"),Cn=pr(t,"Map"),En=pr(t,"Promise"),Tn=pr(t,"Set"),Mn=pr(t,"WeakMap"),Nn=pr(Ee,"create"),kn=Mn&&new Mn,Sn={},In=Gr(Ln),On=Gr(Cn),Dn=Gr(En),Hn=Gr(Tn),zn=Gr(Mn),Bn=Ve?Ve.prototype:n,Gn=Bn?Bn.valueOf:n,Rn=Bn?Bn.toString:n;function qn(e){if(ns(e)&&!Wi(e)&&!(e instanceof Wn)){if(e instanceof Vn)return e;if(He.call(e,"__wrapped__"))return Rr(e)}return new Vn(e)}var jn=function(){function e(){}return function(t){if(!ts(t))return{};if(Fe)return Fe(t);e.prototype=t;var o=new e;return e.prototype=n,o}}();function Zn(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Un(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function co(e,t,o,a,r,i){var s,l=1&t,d=2&t,c=4&t;if(o&&(s=r?o(e,a,r,i):o(e)),s!==n)return s;if(!ts(e))return e;var u=Wi(e);if(u){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&He.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return ka(e,s)}else{var h=mr(e),p=h==x||h==b;if(Xi(e))return La(e,l);if(h==L||h==m||p&&!r){if(s=d||p?{}:vr(e),!l)return d?function(e,t){return Sa(e,yr(e),t)}(e,function(e,t){return e&&Sa(t,Is(t),e)}(s,e)):function(e,t){return Sa(e,gr(e),t)}(e,ro(s,e))}else{if(!st[h])return r?e:{};s=function(e,t,n){var o=e.constructor;switch(t){case S:return Ca(e);case v:case w:return new o(+e);case I:return function(e,t){var n=t?Ca(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case O:case D:case H:case z:case B:case G:case R:case q:case j:return Ea(e,n);case A:return new o;case P:case M:return new o(e);case E:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case T:return new o;case N:return a=e,Gn?Ee(Gn.call(a)):{}}var a}(e,h,l)}}i||(i=new Yn);var g=i.get(e);if(g)return g;i.set(e,s),ss(e)?e.forEach((function(n){s.add(co(n,t,o,n,e,i))})):os(e)&&e.forEach((function(n,a){s.set(a,co(n,t,o,a,e,i))}));var y=u?n:(c?d?ir:rr:d?Is:Ss)(e);return Et(y||e,(function(n,a){y&&(n=e[a=n]),no(s,a,co(n,t,o,a,e,i))})),s}function uo(e,t,o){var a=o.length;if(null==e)return!a;for(e=Ee(e);a--;){var r=o[a],i=t[r],s=e[r];if(s===n&&!(r in e)||!i(s))return!1}return!0}function ho(e,t,a){if("function"!=typeof e)throw new Ne(o);return Sr((function(){e.apply(n,a)}),t)}function po(e,t,n,o){var a=-1,r=kt,i=!0,s=e.length,l=[],d=t.length;if(!s)return l;n&&(t=It(t,Kt(n))),o?(r=St,i=!1):t.length>=200&&(r=en,i=!1,t=new Xn(t));e:for(;++a-1},Qn.prototype.set=function(e,t){var n=this.__data__,o=oo(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this},Fn.prototype.clear=function(){this.size=0,this.__data__={hash:new Un,map:new(Cn||Qn),string:new Un}},Fn.prototype.delete=function(e){var t=ur(this,e).delete(e);return this.size-=t?1:0,t},Fn.prototype.get=function(e){return ur(this,e).get(e)},Fn.prototype.has=function(e){return ur(this,e).has(e)},Fn.prototype.set=function(e,t){var n=ur(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,a),this},Xn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.clear=function(){this.__data__=new Qn,this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Yn.prototype.get=function(e){return this.__data__.get(e)},Yn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Qn){var o=n.__data__;if(!Cn||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Fn(o)}return n.set(e,t),this.size=n.size,this};var go=Da(bo),yo=Da(Ao,!0);function mo(e,t){var n=!0;return go(e,(function(e,o,a){return n=!!t(e,o,a)})),n}function fo(e,t,o){for(var a=-1,r=e.length;++a0&&n(s)?t>1?wo(s,t-1,n,o,a):Ot(a,s):o||(a[a.length]=s)}return a}var _o=Ha(),xo=Ha(!0);function bo(e,t){return e&&_o(e,t,Ss)}function Ao(e,t){return e&&xo(e,t,Ss)}function Po(e,t){return Nt(t,(function(t){return Ki(e[t])}))}function Lo(e,t){for(var o=0,a=(t=xa(t,e)).length;null!=e&&ot}function Mo(e,t){return null!=e&&He.call(e,t)}function No(e,t){return null!=e&&t in Ee(e)}function ko(e,t,o){for(var a=o?St:kt,r=e[0].length,i=e.length,s=i,l=be(i),d=1/0,c=[];s--;){var u=e[s];s&&t&&(u=It(u,Kt(t))),d=_n(u.length,d),l[s]=!o&&(t||r>=120&&u.length>=120)?new Xn(s&&u):n}u=e[0];var h=-1,p=l[0];e:for(;++h=s?l:l*("desc"==n[o]?-1:1)}return e.index-t.index}(e,t,n)}))}function Qo(e,t,n){for(var o=-1,a=t.length,r={};++o-1;)s!==e&&Ye.call(s,l,1),Ye.call(e,l,1);return e}function Xo(e,t){for(var n=e?t.length:0,o=n-1;n--;){var a=t[n];if(n==o||a!==r){var r=a;_r(a)?Ye.call(e,a,1):pa(e,a)}}return e}function Yo(e,t){return e+ft(An()*(t-e+1))}function Jo(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=ft(t/2))&&(e+=e)}while(t);return n}function Ko(e,t){return Ir(Tr(e,t,al),e+"")}function $o(e){return Kn(qs(e))}function ea(e,t){var n=qs(e);return Hr(n,lo(t,0,n.length))}function ta(e,t,o,a){if(!ts(e))return e;for(var r=-1,i=(t=xa(t,e)).length,s=i-1,l=e;null!=l&&++ra?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var r=be(a);++o>>1,i=e[r];null!==i&&!ds(i)&&(n?i<=t:i=200){var d=t?null:Ja(e);if(d)return un(d);i=!1,a=en,l=new Xn}else l=t?[]:s;e:for(;++o=a?e:ra(e,t,o)}var Pa=ut||function(e){return pt.clearTimeout(e)};function La(e,t){if(t)return e.slice();var n=e.length,o=Ue?Ue(n):new e.constructor(n);return e.copy(o),o}function Ca(e){var t=new e.constructor(e.byteLength);return new We(t).set(new We(e)),t}function Ea(e,t){var n=t?Ca(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ta(e,t){if(e!==t){var o=e!==n,a=null===e,r=e==e,i=ds(e),s=t!==n,l=null===t,d=t==t,c=ds(t);if(!l&&!c&&!i&&e>t||i&&s&&d&&!l&&!c||a&&s&&d||!o&&d||!r)return 1;if(!a&&!i&&!c&&e1?o[r-1]:n,s=r>2?o[2]:n;for(i=e.length>3&&"function"==typeof i?(r--,i):n,s&&xr(o[0],o[1],s)&&(i=r<3?n:i,r=1),t=Ee(t);++a-1?r[i?t[s]:s]:n}}function qa(e){return ar((function(t){var a=t.length,r=a,i=Vn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Ne(o);if(i&&!l&&"wrapper"==lr(s))var l=new Vn([],!0)}for(r=l?r:a;++r1&&w.reverse(),h&&cl))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var h=-1,p=!0,g=2&o?new Xn:n;for(i.set(e,t),i.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[o],t=t.join(n>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(o,function(e,t){return Et(y,(function(n){var o="_."+n[0];t&n[1]&&!kt(e,o)&&e.push(o)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(le):[]}(o),n)))}function Dr(e){var t=0,o=0;return function(){var a=xn(),r=16-(a-o);if(o=a,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Hr(e,t){var o=-1,a=e.length,r=a-1;for(t=t===n?a:t;++o1?e[t-1]:n;return o="function"==typeof o?(e.pop(),o):n,ii(e,o)}));function pi(e){var t=qn(e);return t.__chain__=!0,t}function gi(e,t){return t(e)}var yi=ar((function(e){var t=e.length,o=t?e[0]:0,a=this.__wrapped__,r=function(t){return so(t,e)};return!(t>1||this.__actions__.length)&&a instanceof Wn&&_r(o)?((a=a.slice(o,+o+(t?1:0))).__actions__.push({func:gi,args:[r],thisArg:n}),new Vn(a,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(r)}));var mi=Ia((function(e,t,n){He.call(e,n)?++e[n]:io(e,n,1)}));var fi=Ra(Vr),vi=Ra(Wr);function wi(e,t){return(Wi(e)?Et:go)(e,cr(t,3))}function _i(e,t){return(Wi(e)?Tt:yo)(e,cr(t,3))}var xi=Ia((function(e,t,n){He.call(e,n)?e[n].push(t):io(e,n,[t])}));var bi=Ko((function(e,t,n){var o=-1,a="function"==typeof t,r=Qi(e)?be(e.length):[];return go(e,(function(e){r[++o]=a?Lt(t,e,n):So(e,t,n)})),r})),Ai=Ia((function(e,t,n){io(e,n,t)}));function Pi(e,t){return(Wi(e)?It:qo)(e,cr(t,3))}var Li=Ia((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ci=Ko((function(e,t){if(null==e)return[];var n=t.length;return n>1&&xr(e,t[0],t[1])?t=[]:n>2&&xr(t[0],t[1],t[2])&&(t=[t[0]]),Uo(e,wo(t,1),[])})),Ei=ht||function(){return pt.Date.now()};function Ti(e,t,o){return t=o?n:t,t=e&&null==t?e.length:t,$a(e,d,n,n,n,n,t)}function Mi(e,t){var a;if("function"!=typeof t)throw new Ne(o);return e=ys(e),function(){return--e>0&&(a=t.apply(this,arguments)),e<=1&&(t=n),a}}var Ni=Ko((function(e,t,n){var o=1;if(n.length){var a=cn(n,dr(Ni));o|=s}return $a(e,o,t,n,a)})),ki=Ko((function(e,t,n){var o=3;if(n.length){var a=cn(n,dr(ki));o|=s}return $a(t,o,e,n,a)}));function Si(e,t,a){var r,i,s,l,d,c,u=0,h=!1,p=!1,g=!0;if("function"!=typeof e)throw new Ne(o);function y(t){var o=r,a=i;return r=i=n,u=t,l=e.apply(a,o)}function m(e){var o=e-c;return c===n||o>=t||o<0||p&&e-u>=s}function f(){var e=Ei();if(m(e))return v(e);d=Sr(f,function(e){var n=t-(e-c);return p?_n(n,s-(e-u)):n}(e))}function v(e){return d=n,g&&r?y(e):(r=i=n,l)}function w(){var e=Ei(),o=m(e);if(r=arguments,i=this,c=e,o){if(d===n)return function(e){return u=e,d=Sr(f,t),h?y(e):l}(c);if(p)return Pa(d),d=Sr(f,t),y(c)}return d===n&&(d=Sr(f,t)),l}return t=fs(t)||0,ts(a)&&(h=!!a.leading,s=(p="maxWait"in a)?wn(fs(a.maxWait)||0,t):s,g="trailing"in a?!!a.trailing:g),w.cancel=function(){d!==n&&Pa(d),u=0,r=c=i=d=n},w.flush=function(){return d===n?l:v(Ei())},w}var Ii=Ko((function(e,t){return ho(e,1,t)})),Oi=Ko((function(e,t,n){return ho(e,fs(t)||0,n)}));function Di(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ne(o);var n=function(){var o=arguments,a=t?t.apply(this,o):o[0],r=n.cache;if(r.has(a))return r.get(a);var i=e.apply(this,o);return n.cache=r.set(a,i)||r,i};return n.cache=new(Di.Cache||Fn),n}function Hi(e){if("function"!=typeof e)throw new Ne(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Di.Cache=Fn;var zi=ba((function(e,t){var n=(t=1==t.length&&Wi(t[0])?It(t[0],Kt(cr())):It(wo(t,1),Kt(cr()))).length;return Ko((function(o){for(var a=-1,r=_n(o.length,n);++a=t})),Vi=Io(function(){return arguments}())?Io:function(e){return ns(e)&&He.call(e,"callee")&&!Xe.call(e,"callee")},Wi=be.isArray,Ui=wt?Kt(wt):function(e){return ns(e)&&Eo(e)==S};function Qi(e){return null!=e&&es(e.length)&&!Ki(e)}function Fi(e){return ns(e)&&Qi(e)}var Xi=Dt||fl,Yi=_t?Kt(_t):function(e){return ns(e)&&Eo(e)==w};function Ji(e){if(!ns(e))return!1;var t=Eo(e);return t==_||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!rs(e)}function Ki(e){if(!ts(e))return!1;var t=Eo(e);return t==x||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function $i(e){return"number"==typeof e&&e==ys(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ns(e){return null!=e&&"object"==typeof e}var os=xt?Kt(xt):function(e){return ns(e)&&mr(e)==A};function as(e){return"number"==typeof e||ns(e)&&Eo(e)==P}function rs(e){if(!ns(e)||Eo(e)!=L)return!1;var t=Qe(e);if(null===t)return!0;var n=He.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Re}var is=bt?Kt(bt):function(e){return ns(e)&&Eo(e)==E};var ss=At?Kt(At):function(e){return ns(e)&&mr(e)==T};function ls(e){return"string"==typeof e||!Wi(e)&&ns(e)&&Eo(e)==M}function ds(e){return"symbol"==typeof e||ns(e)&&Eo(e)==N}var cs=Pt?Kt(Pt):function(e){return ns(e)&&es(e.length)&&!!it[Eo(e)]};var us=Fa(Ro),hs=Fa((function(e,t){return e<=t}));function ps(e){if(!e)return[];if(Qi(e))return ls(e)?gn(e):ka(e);if(et&&e[et])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[et]());var t=mr(e);return(t==A?ln:t==T?un:qs)(e)}function gs(e){return e?(e=fs(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ys(e){var t=gs(e),n=t%1;return t==t?n?t-n:t:0}function ms(e){return e?lo(ys(e),0,g):0}function fs(e){if("number"==typeof e)return e;if(ds(e))return p;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Jt(e);var n=ye.test(e);return n||fe.test(e)?ct(e.slice(2),n?2:8):ge.test(e)?p:+e}function vs(e){return Sa(e,Is(e))}function ws(e){return null==e?"":ua(e)}var _s=Oa((function(e,t){if(Lr(t)||Qi(t))Sa(t,Ss(t),e);else for(var n in t)He.call(t,n)&&no(e,n,t[n])})),xs=Oa((function(e,t){Sa(t,Is(t),e)})),bs=Oa((function(e,t,n,o){Sa(t,Is(t),e,o)})),As=Oa((function(e,t,n,o){Sa(t,Ss(t),e,o)})),Ps=ar(so);var Ls=Ko((function(e,t){e=Ee(e);var o=-1,a=t.length,r=a>2?t[2]:n;for(r&&xr(t[0],t[1],r)&&(a=1);++o1),t})),Sa(e,ir(e),n),o&&(n=co(n,7,nr));for(var a=t.length;a--;)pa(n,t[a]);return n}));var zs=ar((function(e,t){return null==e?{}:function(e,t){return Qo(e,t,(function(t,n){return Ts(e,n)}))}(e,t)}));function Bs(e,t){if(null==e)return{};var n=It(ir(e),(function(e){return[e]}));return t=cr(t),Qo(e,n,(function(e,n){return t(e,n[0])}))}var Gs=Ka(Ss),Rs=Ka(Is);function qs(e){return null==e?[]:$t(e,Ss(e))}var js=Ba((function(e,t,n){return t=t.toLowerCase(),e+(n?Zs(t):t)}));function Zs(e){return Js(ws(e).toLowerCase())}function Vs(e){return(e=ws(e))&&e.replace(we,on).replace($e,"")}var Ws=Ba((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Us=Ba((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Qs=za("toLowerCase");var Fs=Ba((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Xs=Ba((function(e,t,n){return e+(n?" ":"")+Js(t)}));var Ys=Ba((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Js=za("toUpperCase");function Ks(e,t,o){return e=ws(e),(t=o?n:t)===n?function(e){return ot.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var $s=Ko((function(e,t){try{return Lt(e,n,t)}catch(e){return Ji(e)?e:new Pe(e)}})),el=ar((function(e,t){return Et(t,(function(t){t=Br(t),io(e,t,Ni(e[t],e))})),e}));function tl(e){return function(){return e}}var nl=qa(),ol=qa(!0);function al(e){return e}function rl(e){return zo("function"==typeof e?e:co(e,1))}var il=Ko((function(e,t){return function(n){return So(n,e,t)}})),sl=Ko((function(e,t){return function(n){return So(e,n,t)}}));function ll(e,t,n){var o=Ss(t),a=Po(t,o);null!=n||ts(t)&&(a.length||!o.length)||(n=t,t=e,e=this,a=Po(t,Ss(t)));var r=!(ts(n)&&"chain"in n&&!n.chain),i=Ki(e);return Et(a,(function(n){var o=t[n];e[n]=o,i&&(e.prototype[n]=function(){var t=this.__chain__;if(r||t){var n=e(this.__wrapped__);return(n.__actions__=ka(this.__actions__)).push({func:o,args:arguments,thisArg:e}),n.__chain__=t,n}return o.apply(e,Ot([this.value()],arguments))})})),e}function dl(){}var cl=Wa(It),ul=Wa(Mt),hl=Wa(Bt);function pl(e){return br(e)?Ut(Br(e)):function(e){return function(t){return Lo(t,e)}}(e)}var gl=Qa(),yl=Qa(!0);function ml(){return[]}function fl(){return!1}var vl=Va((function(e,t){return e+t}),0),wl=Ya("ceil"),_l=Va((function(e,t){return e/t}),1),xl=Ya("floor");var bl,Al=Va((function(e,t){return e*t}),1),Pl=Ya("round"),Ll=Va((function(e,t){return e-t}),0);return qn.after=function(e,t){if("function"!=typeof t)throw new Ne(o);return e=ys(e),function(){if(--e<1)return t.apply(this,arguments)}},qn.ary=Ti,qn.assign=_s,qn.assignIn=xs,qn.assignInWith=bs,qn.assignWith=As,qn.at=Ps,qn.before=Mi,qn.bind=Ni,qn.bindAll=el,qn.bindKey=ki,qn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Wi(e)?e:[e]},qn.chain=pi,qn.chunk=function(e,t,o){t=(o?xr(e,t,o):t===n)?1:wn(ys(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var r=0,i=0,s=be(yt(a/t));rr?0:r+o),(a=a===n||a>r?r:ys(a))<0&&(a+=r),a=o>a?0:ms(a);o>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=ua(t))&&sn(e)?Aa(gn(e),0,o):e.split(t,o):[]},qn.spread=function(e,t){if("function"!=typeof e)throw new Ne(o);return t=null==t?0:wn(ys(t),0),Ko((function(n){var o=n[t],a=Aa(n,0,t);return o&&Ot(a,o),Lt(e,this,a)}))},qn.tail=function(e){var t=null==e?0:e.length;return t?ra(e,1,t):[]},qn.take=function(e,t,o){return e&&e.length?ra(e,0,(t=o||t===n?1:ys(t))<0?0:t):[]},qn.takeRight=function(e,t,o){var a=null==e?0:e.length;return a?ra(e,(t=a-(t=o||t===n?1:ys(t)))<0?0:t,a):[]},qn.takeRightWhile=function(e,t){return e&&e.length?ya(e,cr(t,3),!1,!0):[]},qn.takeWhile=function(e,t){return e&&e.length?ya(e,cr(t,3)):[]},qn.tap=function(e,t){return t(e),e},qn.throttle=function(e,t,n){var a=!0,r=!0;if("function"!=typeof e)throw new Ne(o);return ts(n)&&(a="leading"in n?!!n.leading:a,r="trailing"in n?!!n.trailing:r),Si(e,t,{leading:a,maxWait:t,trailing:r})},qn.thru=gi,qn.toArray=ps,qn.toPairs=Gs,qn.toPairsIn=Rs,qn.toPath=function(e){return Wi(e)?It(e,Br):ds(e)?[e]:ka(zr(ws(e)))},qn.toPlainObject=vs,qn.transform=function(e,t,n){var o=Wi(e),a=o||Xi(e)||cs(e);if(t=cr(t,4),null==n){var r=e&&e.constructor;n=a?o?new r:[]:ts(e)&&Ki(r)?jn(Qe(e)):{}}return(a?Et:bo)(e,(function(e,o,a){return t(n,e,o,a)})),n},qn.unary=function(e){return Ti(e,1)},qn.union=ni,qn.unionBy=oi,qn.unionWith=ai,qn.uniq=function(e){return e&&e.length?ha(e):[]},qn.uniqBy=function(e,t){return e&&e.length?ha(e,cr(t,2)):[]},qn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ha(e,n,t):[]},qn.unset=function(e,t){return null==e||pa(e,t)},qn.unzip=ri,qn.unzipWith=ii,qn.update=function(e,t,n){return null==e?e:ga(e,t,_a(n))},qn.updateWith=function(e,t,o,a){return a="function"==typeof a?a:n,null==e?e:ga(e,t,_a(o),a)},qn.values=qs,qn.valuesIn=function(e){return null==e?[]:$t(e,Is(e))},qn.without=si,qn.words=Ks,qn.wrap=function(e,t){return Bi(_a(t),e)},qn.xor=li,qn.xorBy=di,qn.xorWith=ci,qn.zip=ui,qn.zipObject=function(e,t){return va(e||[],t||[],no)},qn.zipObjectDeep=function(e,t){return va(e||[],t||[],ta)},qn.zipWith=hi,qn.entries=Gs,qn.entriesIn=Rs,qn.extend=xs,qn.extendWith=bs,ll(qn,qn),qn.add=vl,qn.attempt=$s,qn.camelCase=js,qn.capitalize=Zs,qn.ceil=wl,qn.clamp=function(e,t,o){return o===n&&(o=t,t=n),o!==n&&(o=(o=fs(o))==o?o:0),t!==n&&(t=(t=fs(t))==t?t:0),lo(fs(e),t,o)},qn.clone=function(e){return co(e,4)},qn.cloneDeep=function(e){return co(e,5)},qn.cloneDeepWith=function(e,t){return co(e,5,t="function"==typeof t?t:n)},qn.cloneWith=function(e,t){return co(e,4,t="function"==typeof t?t:n)},qn.conformsTo=function(e,t){return null==t||uo(e,t,Ss(t))},qn.deburr=Vs,qn.defaultTo=function(e,t){return null==e||e!=e?t:e},qn.divide=_l,qn.endsWith=function(e,t,o){e=ws(e),t=ua(t);var a=e.length,r=o=o===n?a:lo(ys(o),0,a);return(o-=t.length)>=0&&e.slice(o,r)==t},qn.eq=qi,qn.escape=function(e){return(e=ws(e))&&X.test(e)?e.replace(Q,an):e},qn.escapeRegExp=function(e){return(e=ws(e))&&oe.test(e)?e.replace(ne,"\\$&"):e},qn.every=function(e,t,o){var a=Wi(e)?Mt:mo;return o&&xr(e,t,o)&&(t=n),a(e,cr(t,3))},qn.find=fi,qn.findIndex=Vr,qn.findKey=function(e,t){return Rt(e,cr(t,3),bo)},qn.findLast=vi,qn.findLastIndex=Wr,qn.findLastKey=function(e,t){return Rt(e,cr(t,3),Ao)},qn.floor=xl,qn.forEach=wi,qn.forEachRight=_i,qn.forIn=function(e,t){return null==e?e:_o(e,cr(t,3),Is)},qn.forInRight=function(e,t){return null==e?e:xo(e,cr(t,3),Is)},qn.forOwn=function(e,t){return e&&bo(e,cr(t,3))},qn.forOwnRight=function(e,t){return e&&Ao(e,cr(t,3))},qn.get=Es,qn.gt=ji,qn.gte=Zi,qn.has=function(e,t){return null!=e&&fr(e,t,Mo)},qn.hasIn=Ts,qn.head=Qr,qn.identity=al,qn.includes=function(e,t,n,o){e=Qi(e)?e:qs(e),n=n&&!o?ys(n):0;var a=e.length;return n<0&&(n=wn(a+n,0)),ls(e)?n<=a&&e.indexOf(t,n)>-1:!!a&&jt(e,t,n)>-1},qn.indexOf=function(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var a=null==n?0:ys(n);return a<0&&(a=wn(o+a,0)),jt(e,t,a)},qn.inRange=function(e,t,o){return t=gs(t),o===n?(o=t,t=0):o=gs(o),function(e,t,n){return e>=_n(t,n)&&e=-9007199254740991&&e<=h},qn.isSet=ss,qn.isString=ls,qn.isSymbol=ds,qn.isTypedArray=cs,qn.isUndefined=function(e){return e===n},qn.isWeakMap=function(e){return ns(e)&&mr(e)==k},qn.isWeakSet=function(e){return ns(e)&&"[object WeakSet]"==Eo(e)},qn.join=function(e,t){return null==e?"":Qt.call(e,t)},qn.kebabCase=Ws,qn.last=Jr,qn.lastIndexOf=function(e,t,o){var a=null==e?0:e.length;if(!a)return-1;var r=a;return o!==n&&(r=(r=ys(o))<0?wn(a+r,0):_n(r,a-1)),t==t?function(e,t,n){for(var o=n+1;o--;)if(e[o]===t)return o;return o}(e,t,r):qt(e,Vt,r,!0)},qn.lowerCase=Us,qn.lowerFirst=Qs,qn.lt=us,qn.lte=hs,qn.max=function(e){return e&&e.length?fo(e,al,To):n},qn.maxBy=function(e,t){return e&&e.length?fo(e,cr(t,2),To):n},qn.mean=function(e){return Wt(e,al)},qn.meanBy=function(e,t){return Wt(e,cr(t,2))},qn.min=function(e){return e&&e.length?fo(e,al,Ro):n},qn.minBy=function(e,t){return e&&e.length?fo(e,cr(t,2),Ro):n},qn.stubArray=ml,qn.stubFalse=fl,qn.stubObject=function(){return{}},qn.stubString=function(){return""},qn.stubTrue=function(){return!0},qn.multiply=Al,qn.nth=function(e,t){return e&&e.length?Wo(e,ys(t)):n},qn.noConflict=function(){return pt._===this&&(pt._=qe),this},qn.noop=dl,qn.now=Ei,qn.pad=function(e,t,n){e=ws(e);var o=(t=ys(t))?pn(e):0;if(!t||o>=t)return e;var a=(t-o)/2;return Ua(ft(a),n)+e+Ua(yt(a),n)},qn.padEnd=function(e,t,n){e=ws(e);var o=(t=ys(t))?pn(e):0;return t&&ot){var a=e;e=t,t=a}if(o||e%1||t%1){var r=An();return _n(e+r*(t-e+dt("1e-"+((r+"").length-1))),t)}return Yo(e,t)},qn.reduce=function(e,t,n){var o=Wi(e)?Ht:Ft,a=arguments.length<3;return o(e,cr(t,4),n,a,go)},qn.reduceRight=function(e,t,n){var o=Wi(e)?zt:Ft,a=arguments.length<3;return o(e,cr(t,4),n,a,yo)},qn.repeat=function(e,t,o){return t=(o?xr(e,t,o):t===n)?1:ys(t),Jo(ws(e),t)},qn.replace=function(){var e=arguments,t=ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},qn.result=function(e,t,o){var a=-1,r=(t=xa(t,e)).length;for(r||(r=1,e=n);++ah)return[];var n=g,o=_n(e,g);t=cr(t),e-=g;for(var a=Yt(o,t);++n=i)return e;var l=o-pn(a);if(l<1)return a;var d=s?Aa(s,0,l).join(""):e.slice(0,l);if(r===n)return d+a;if(s&&(l+=d.length-l),is(r)){if(e.slice(l).search(r)){var c,u=d;for(r.global||(r=Te(r.source,ws(pe.exec(r))+"g")),r.lastIndex=0;c=r.exec(u);)var h=c.index;d=d.slice(0,h===n?l:h)}}else if(e.indexOf(ua(r),l)!=l){var p=d.lastIndexOf(r);p>-1&&(d=d.slice(0,p))}return d+a},qn.unescape=function(e){return(e=ws(e))&&F.test(e)?e.replace(U,mn):e},qn.uniqueId=function(e){var t=++ze;return ws(e)+t},qn.upperCase=Ys,qn.upperFirst=Js,qn.each=wi,qn.eachRight=_i,qn.first=Qr,ll(qn,(bl={},bo(qn,(function(e,t){He.call(qn.prototype,t)||(bl[t]=e)})),bl),{chain:!1}),qn.VERSION="4.17.21",Et(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){qn[e].placeholder=qn})),Et(["drop","take"],(function(e,t){Wn.prototype[e]=function(o){o=o===n?1:wn(ys(o),0);var a=this.__filtered__&&!t?new Wn(this):this.clone();return a.__filtered__?a.__takeCount__=_n(o,a.__takeCount__):a.__views__.push({size:_n(o,g),type:e+(a.__dir__<0?"Right":"")}),a},Wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Et(["filter","map","takeWhile"],(function(e,t){var n=t+1,o=1==n||3==n;Wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:cr(e,3),type:n}),t.__filtered__=t.__filtered__||o,t}})),Et(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Wn.prototype[e]=function(){return this[n](1).value()[0]}})),Et(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Wn.prototype[e]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(al)},Wn.prototype.find=function(e){return this.filter(e).head()},Wn.prototype.findLast=function(e){return this.reverse().find(e)},Wn.prototype.invokeMap=Ko((function(e,t){return"function"==typeof e?new Wn(this):this.map((function(n){return So(n,e,t)}))})),Wn.prototype.reject=function(e){return this.filter(Hi(cr(e)))},Wn.prototype.slice=function(e,t){e=ys(e);var o=this;return o.__filtered__&&(e>0||t<0)?new Wn(o):(e<0?o=o.takeRight(-e):e&&(o=o.drop(e)),t!==n&&(o=(t=ys(t))<0?o.dropRight(-t):o.take(t-e)),o)},Wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Wn.prototype.toArray=function(){return this.take(g)},bo(Wn.prototype,(function(e,t){var o=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),r=qn[a?"take"+("last"==t?"Right":""):t],i=a||/^find/.test(t);r&&(qn.prototype[t]=function(){var t=this.__wrapped__,s=a?[1]:arguments,l=t instanceof Wn,d=s[0],c=l||Wi(t),u=function(e){var t=r.apply(qn,Ot([e],s));return a&&h?t[0]:t};c&&o&&"function"==typeof d&&1!=d.length&&(l=c=!1);var h=this.__chain__,p=!!this.__actions__.length,g=i&&!h,y=l&&!p;if(!i&&c){t=y?t:new Wn(this);var m=e.apply(t,s);return m.__actions__.push({func:gi,args:[u],thisArg:n}),new Vn(m,h)}return g&&y?e.apply(this,s):(m=this.thru(u),g?a?m.value()[0]:m.value():m)})})),Et(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ke[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);qn.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var a=this.value();return t.apply(Wi(a)?a:[],e)}return this[n]((function(n){return t.apply(Wi(n)?n:[],e)}))}})),bo(Wn.prototype,(function(e,t){var n=qn[t];if(n){var o=n.name+"";He.call(Sn,o)||(Sn[o]=[]),Sn[o].push({name:t,func:n})}})),Sn[ja(n,2).name]=[{name:"wrapper",func:n}],Wn.prototype.clone=function(){var e=new Wn(this.__wrapped__);return e.__actions__=ka(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ka(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ka(this.__views__),e},Wn.prototype.reverse=function(){if(this.__filtered__){var e=new Wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Wi(e),o=t<0,a=n?e.length:0,r=function(e,t,n){var o=-1,a=n.length;for(;++o=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},qn.prototype.plant=function(e){for(var t,o=this;o instanceof Zn;){var a=Rr(o);a.__index__=0,a.__values__=n,t?r.__wrapped__=a:t=a;var r=a;o=o.__wrapped__}return r.__wrapped__=e,t},qn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wn){var t=e;return this.__actions__.length&&(t=new Wn(this)),(t=t.reverse()).__actions__.push({func:gi,args:[ti],thisArg:n}),new Vn(t,this.__chain__)}return this.thru(ti)},qn.prototype.toJSON=qn.prototype.valueOf=qn.prototype.value=function(){return ma(this.__wrapped__,this.__actions__)},qn.prototype.first=qn.prototype.head,et&&(qn.prototype[et]=function(){return this}),qn}();yt?((yt.exports=fn)._=fn,gt._=fn):pt._=fn}).call(Dt)}(qt,qt.exports);var jt,Zt,Vt,Wt=qt.exports;let Ut=class extends( /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -function(t){return class extends t{createRenderRoot(){const t=this.constructor,{registry:e,elementDefinitions:n,shadowRootOptions:a}=t;n&&!e&&(t.registry=new CustomElementRegistry,Object.entries(n).forEach((([e,n])=>t.registry.define(e,n))));const o=this.renderOptions.creationScope=this.attachShadow({...a,customElements:t.registry});return l(o,this.constructor.elementStyles),o}}}(dt)){constructor(){super(...arguments),this._computeLabelCallback=t=>Ae("config.".concat(t.name))??t.name}setConfig(t){this._config={...this._config,...t}}render(){return this.hass&&this._config?W(Be||(Be=ft(["\n \n "])),this.hass,this._config,this._computeLabelCallback,[{type:"expandable",title:this._title("title"),schema:[{type:"grid",schema:[{name:"title",selector:{text:{}}},{name:"title_colour",selector:{color_rgb:{}}},{name:"title_size",selector:{text:{}}}]}]},{name:"cardstyle",selector:{select:{options:Object.values(xt).map((t=>({label:Ve.capitalize(t),value:t})))}}},{type:"expandable",title:this._title("general"),schema:[{type:"grid",schema:[{name:"large_font",selector:{boolean:{}}},{name:"panel_mode",selector:{boolean:{}}},{name:"card_height",selector:{text:{}}},{name:"card_width",selector:{text:{}}},{name:"show_solar",selector:{boolean:{}}},{name:"show_battery",selector:{boolean:{}}},{name:"show_grid",selector:{boolean:{}}},{name:"decimal_places",selector:{number:{}}},{name:"dynamic_line_width",selector:{boolean:{}}},{name:"max_line_width",selector:{number:{}}},{name:"min_line_width",selector:{number:{}}}]}]},{type:"expandable",title:this._title("inverter"),schema:[{name:"inverter",type:"grid",schema:[{name:"three_phase",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"model",selector:{select:{options:Object.values(_t).map((t=>({label:Ve.capitalize(t),value:t})))}}},{name:"modern",selector:{boolean:{}}},{name:"autarky",selector:{select:{options:Object.values(bt).map((t=>({label:Ve.capitalize(t),value:t})))}}},{name:"colour",selector:{color_rgb:{}}}]}]},{type:"expandable",title:this._title("solar"),schema:[{name:"solar",type:"grid",schema:[{name:"mppts",selector:{number:{min:0,max:4}}},{name:"show_daily",selector:{boolean:{}}},{name:"pv1_name",selector:{text:{}}},{name:"pv2_name",selector:{text:{}}},{name:"pv3_name",selector:{text:{}}},{name:"pv4_name",selector:{text:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"display_mode",selector:{number:{mode:"box",min:1,max:3}}},{name:"colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"animation_speed",selector:{number:{}}},{name:"max_power",selector:{number:{}}}]}]},{type:"expandable",title:this._title("battery"),schema:[{name:"battery",type:"grid",schema:[{name:"energy",selector:{number:{min:0}}},{name:"shutdown_soc",selector:{number:{mode:"box",min:0,max:100}}},{name:"show_daily",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"invert_power",selector:{boolean:{}}},{name:"show_absolute",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"charge_colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"linear_gradient",selector:{boolean:{}}},{name:"hide_soc",selector:{boolean:{}}},{name:"show_remaining_energy",selector:{boolean:{}}},{name:"animation_speed",selector:{number:{}}},{name:"max_power",selector:{number:{}}}]}]},{type:"expandable",title:this._title("load"),schema:[{name:"load",type:"grid",schema:[{name:"show_daily",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"dynamic_icon",selector:{boolean:{}}},{name:"invert_load",selector:{boolean:{}}},{name:"essential_name",selector:{text:{}}},{name:"additional_loads",selector:{number:{mode:"box",min:0,max:4}}},{name:"load1_name",selector:{text:{}}},{name:"load1_icon",selector:{icon:{}}},{name:"load2_name",selector:{text:{}}},{name:"load2_icon",selector:{icon:{}}},{name:"load3_name",selector:{text:{}}},{name:"load3_icon",selector:{icon:{}}},{name:"load4_name",selector:{text:{}}},{name:"load4_icon",selector:{icon:{}}},{name:"animation_speed",selector:{number:{}}},{name:"max_power",selector:{number:{}}}]},{type:"expandable",title:this._title("aux"),schema:[{name:"load",type:"grid",schema:[{name:"show_aux",selector:{boolean:{}}},{name:"aux_name",selector:{text:{}}},{name:"aux_type",selector:{icon:{}}},{name:"invert_aux",selector:{boolean:{}}},{name:"show_absolute_aux",selector:{boolean:{}}},{name:"aux_colour",selector:{color_rgb:{}}},{name:"aux_off_colour",selector:{color_rgb:{}}},{name:"aux_loads",selector:{number:{mode:"box",min:0,max:2}}},{name:"aux_load1_name",selector:{text:{}}},{name:"aux_load1_icon",selector:{icon:{}}},{name:"aux_load2_name",selector:{text:{}}},{name:"aux_load2_icon",selector:{icon:{}}},{name:"show_daily_aux",selector:{boolean:{}}}]}]}]},{type:"expandable",title:this._title("grid"),schema:[{name:"grid",type:"grid",schema:[{name:"show_daily_buy",selector:{boolean:{}}},{name:"show_daily_sell",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"invert_grid",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"no_grid_colour",selector:{color_rgb:{}}},{name:"export_colour",selector:{color_rgb:{}}},{name:"grid_off_colour",selector:{color_rgb:{}}},{name:"grid_name",selector:{text:{}}},{name:"show_absolute",selector:{boolean:{}}},{name:"energy_cost_decimals",selector:{number:{mode:"box",min:0,max:3}}},{name:"show_nonessential",selector:{boolean:{}}},{name:"additional_loads",selector:{number:{mode:"box",min:0,max:3}}},{name:"nonessential_name",selector:{text:{}}},{name:"nonessential_icon",selector:{icon:{}}},{name:"load1_name",selector:{text:{}}},{name:"load1_icon",selector:{icon:{}}},{name:"load2_name",selector:{text:{}}},{name:"load2_icon",selector:{icon:{}}},{name:"load3_name",selector:{text:{}}},{name:"load3_icon",selector:{icon:{}}},{name:"animation_speed",selector:{number:{}}},{name:"max_power",selector:{number:{}}}]}]},{type:"expandable",title:this._title("entities"),schema:[{type:"expandable",title:this._title("sol"),schema:[{name:"entities",type:"grid",schema:[{name:"day_pv_energy_108",selector:{entity:{device_class:Me.ENERGY}}},{name:"pv1_power_186",selector:{entity:{device_class:Me.POWER}}},{name:"pv2_power_187",selector:{entity:{device_class:Me.POWER}}},{name:"pv3_power_188",selector:{entity:{device_class:Me.POWER}}},{name:"pv4_power_189",selector:{entity:{device_class:Me.POWER}}},{name:"pv1_voltage_109",selector:{entity:{device_class:Me.VOLTAGE}}},{name:"pv1_current_110",selector:{entity:{device_class:Me.CURRENT}}},{name:"pv2_voltage_111",selector:{entity:{device_class:Me.VOLTAGE}}},{name:"pv2_current_112",selector:{entity:{device_class:Me.CURRENT}}},{name:"pv3_voltage_113",selector:{entity:{device_class:Me.VOLTAGE}}},{name:"pv3_current_114",selector:{entity:{device_class:Me.CURRENT}}},{name:"pv4_voltage_115",selector:{entity:{device_class:Me.VOLTAGE}}},{name:"pv4_current_116",selector:{entity:{device_class:Me.CURRENT}}},{name:"pv_total",selector:{entity:{device_class:Me.POWER}}},{name:"solar_sell_247",selector:{entity:{}}},{name:"total_pv_generation",selector:{entity:{device_class:Me.ENERGY}}},{name:"remaining_solar",selector:{entity:{device_class:Me.ENERGY}}},{name:"environment_temp",selector:{entity:{device_class:Me.TEMPERATURE}}}]}]},{type:"expandable",title:this._title("bat"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_power_190",selector:{entity:{device_class:Me.POWER}}},{name:"battery_current_191",selector:{entity:{device_class:Me.CURRENT}}},{name:"battery_temp_182",selector:{entity:{device_class:Me.TEMPERATURE}}},{name:"battery_voltage_183",selector:{entity:{device_class:Me.VOLTAGE}}},{name:"battery_soc_184",selector:{entity:{device_class:Me.BATTERY}}},{name:"day_battery_charge_70",selector:{entity:{device_class:Me.ENERGY}}},{name:"day_battery_discharge_71",selector:{entity:{device_class:Me.ENERGY}}},{name:"battery_rated_capacity",selector:{entity:{}}},{name:"battery_current_direction",selector:{entity:{}}},{name:"battery_status",selector:{entity:{}}}]}]},{type:"expandable",title:this._title("inv"),schema:[{name:"entities",type:"grid",schema:[{name:"inverter_status_59",selector:{entity:{}}},{name:"use_timer_248",selector:{entity:{}}},{name:"priority_load_243",selector:{entity:{}}},{name:"inverter_voltage_154",selector:{entity:{device_class:Me.VOLTAGE}}},{name:"inverter_voltage_L2",selector:{entity:{device_class:Me.VOLTAGE}}},{name:"inverter_voltage_L3",selector:{entity:{device_class:Me.VOLTAGE}}},{name:"load_frequency_192",selector:{entity:{device_class:Me.FREQUENCY}}},{name:"inverter_current_164",selector:{entity:{device_class:Me.CURRENT}}},{name:"inverter_current_L2",selector:{entity:{device_class:Me.CURRENT}}},{name:"inverter_current_L3",selector:{entity:{device_class:Me.CURRENT}}},{name:"inverter_power_175",selector:{entity:{device_class:Me.POWER}}},{name:"grid_power_169",selector:{entity:{device_class:Me.POWER}}},{name:"dc_transformer_temp_90",selector:{entity:{device_class:Me.TEMPERATURE}}},{name:"radiator_temp_91",selector:{entity:{device_class:Me.TEMPERATURE}}},{name:"prog1_time",selector:{entity:{}}},{name:"prog1_capacity",selector:{entity:{}}},{name:"prog1_charge",selector:{entity:{}}},{name:"prog2_time",selector:{entity:{}}},{name:"prog2_capacity",selector:{entity:{}}},{name:"prog2_charge",selector:{entity:{}}},{name:"prog3_time",selector:{entity:{}}},{name:"prog3_capacity",selector:{entity:{}}},{name:"prog3_charge",selector:{entity:{}}},{name:"prog4_time",selector:{entity:{}}},{name:"prog4_capacity",selector:{entity:{}}},{name:"prog4_charge",selector:{entity:{}}},{name:"prog5_time",selector:{entity:{}}},{name:"prog5_capacity",selector:{entity:{}}},{name:"prog5_charge",selector:{entity:{}}},{name:"prog6_time",selector:{entity:{}}},{name:"prog6_capacity",selector:{entity:{}}},{name:"prog6_charge",selector:{entity:{}}}]}]},{type:"expandable",title:this._title("ld"),schema:[{name:"entities",type:"grid",schema:[{name:"day_load_energy_84",selector:{entity:{device_class:Me.ENERGY}}},{name:"day_aux_energy",selector:{entity:{device_class:Me.ENERGY}}},{name:"essential_power",selector:{entity:{device_class:Me.POWER}}},{name:"essential_load1",selector:{entity:{device_class:Me.POWER}}},{name:"essential_load2",selector:{entity:{device_class:Me.POWER}}},{name:"essential_load3",selector:{entity:{device_class:Me.POWER}}},{name:"essential_load4",selector:{entity:{device_class:Me.POWER}}},{name:"essential_load1_extra",selector:{entity:{}}},{name:"essential_load2_extra",selector:{entity:{}}},{name:"load_power_L1",selector:{entity:{device_class:Me.POWER}}},{name:"load_power_L2",selector:{entity:{device_class:Me.POWER}}},{name:"load_power_L3",selector:{entity:{device_class:Me.POWER}}},{name:"aux_power_166",selector:{entity:{device_class:Me.POWER}}},{name:"aux_load1",selector:{entity:{device_class:Me.POWER}}},{name:"aux_load2",selector:{entity:{device_class:Me.POWER}}},{name:"aux_load1_extra",selector:{entity:{}}},{name:"aux_load2_extra",selector:{entity:{}}},{name:"aux_connected_status",selector:{entity:{}}}]}]},{type:"expandable",title:this._title("gri"),schema:[{name:"entities",type:"grid",schema:[{name:"day_grid_import_76",selector:{entity:{device_class:Me.ENERGY}}},{name:"day_grid_export_77",selector:{entity:{device_class:Me.ENERGY}}},{name:"grid_ct_power_172",selector:{entity:{device_class:Me.POWER}}},{name:"grid_ct_power_L2",selector:{entity:{device_class:Me.POWER}}},{name:"grid_ct_power_L3",selector:{entity:{device_class:Me.POWER}}},{name:"grid_ct_power_total",selector:{entity:{device_class:Me.POWER}}},{name:"grid_voltage",selector:{entity:{device_class:Me.VOLTAGE}}},{name:"nonessential_power",selector:{entity:{device_class:Me.POWER}}},{name:"non_essential_load1",selector:{entity:{device_class:Me.POWER}}},{name:"non_essential_load2",selector:{entity:{device_class:Me.POWER}}},{name:"non_essential_load3",selector:{entity:{device_class:Me.POWER}}},{name:"grid_connected_status_194",selector:{entity:{}}},{name:"energy_cost_buy",selector:{entity:{}}},{name:"energy_cost_sell",selector:{entity:{}}},{name:"prepaid_units",selector:{entity:{}}}]}]}]}],(t=>this._valueChanged(t))):W(ze||(ze=ft([""])))}_title(t){return Ae("config.cat_title.".concat(t))??t}_valueChanged(t){!function(t,e,n,a){a=a||{},n=null==n?{}:n;var o=new Event(e,{bubbles:void 0===a.bubbles||a.bubbles,cancelable:Boolean(a.cancelable),composed:void 0===a.composed||a.composed});o.detail=n,t.dispatchEvent(o)}(this,"config-changed",{config:t.detail.value})}};Re.styles=s(Ge||(Ge=ft(["\n\n "]))),e([yt({attribute:!1})],Re.prototype,"hass",void 0),e([function(t){return yt({...t,state:!0,attribute:!1})}()],Re.prototype,"_config",void 0),Re=e([ut("content-card-editor")],Re);class qe{static toNum(t,e=-1,n=!1){let a=Number(t);return Number.isNaN(a)?0:(e>=0&&(a=parseFloat(a.toFixed(e))),n&&(a*=-1),a)}static convertValue(t,e=2){return e=Number.isNaN(e)?2:e,Math.abs(t)>999?"".concat((t/1e3).toFixed(e)," kW"):"".concat(Math.round(t)," W")}static convertValueNew(t,e="",n=2){n=Number.isNaN(n)?2:n;let a=Number(t);if(Number.isNaN(a))return 0;const o=["W","kW","MW","Wh","kWh","MWh"],r=o.findIndex((t=>t.toLowerCase()===e.toLowerCase()));if(-1===r)return Math.round(a);switch(r){case 0:return Math.abs(a)>=1e6?"".concat((a/1e6).toFixed(n)," ").concat(o[2]):Math.abs(a)>=1e3?"".concat((a/1e3).toFixed(n)," ").concat(o[1]):"".concat(Math.round(a)," ").concat(o[r]);case 1:return Math.abs(a)>=1e3?"".concat((a/1e3).toFixed(n)," ").concat(o[2]):Math.abs(a)<1?"".concat(Math.round(1e3*a)," ").concat(o[0]):"".concat(a.toFixed(n)," ").concat(o[r]);case 2:return Math.abs(a)<1?"".concat((1e3*a).toFixed(n)," ").concat(o[1]):"".concat(a.toFixed(n)," ").concat(o[r]);case 3:return Math.abs(a)>=1e6?"".concat((a/1e6).toFixed(1)," ").concat(o[5]):Math.abs(a)>=1e3?"".concat((a/1e3).toFixed(1)," ").concat(o[4]):"".concat(a.toFixed(1)," ").concat(o[r]);case 4:return Math.abs(a)>=1e3?"".concat((a/1e3).toFixed(2)," ").concat(o[5]):"".concat(a.toFixed(1)," ").concat(o[r]);case 5:return Math.abs(a)<1?"".concat((1e3*a).toFixed(1)," ").concat(o[4]):"".concat(a.toFixed(1)," ").concat(o[r]);default:return"".concat(Math.round(a)," ").concat(e)}}static handlePopup(t,e){this._handleClick(t,{action:"more-info"},e)}static _handleClick(t,e,n){if(!n||!t)return;let a;if(t.stopPropagation(),"more-info"===e.action)a=new Event("hass-more-info",{composed:!0}),a.detail={entityId:n},t.target.dispatchEvent(a)}}var je,Ze,We,Ue,Fe,Qe,Xe,Ye,Je,Ke,$e,tn,en,nn,an,on,rn,sn,ln,dn,cn,un,hn,pn,yn,gn,mn,fn,vn,wn,_n,xn,bn,An,Ln,Pn,En,Nn,Cn,Mn,Tn;var kn,Sn,In,Dn,On,Hn,zn,Bn,Gn,Vn,Rn,qn,jn,Zn,Wn,Un,Fn,Qn,Xn,Yn,Jn,Kn,$n,ta,ea,na,aa,oa,ra,ia,sa;class la{constructor(){}getBatteryCapacity(t,e,n,a,o){let r=0;return t>0?r="off"===e||"0"===e||"off-grid"===e.toLowerCase()||!a.show||parseInt(o.state)<=a.capacity?n:a.capacity:t<0&&("off"===e||"0"===e||"off-grid"===e.toLowerCase()||!a.show||parseInt(o.state)>=a.capacity?r=100:parseInt(o.state)=95:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5zM5 6.5 11 6.5 11 7.5H5z",a="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5zM5 6.5 11 6.5 11 7.5H5z",o="green";break;case 85<=parseInt(t.state)&&parseInt(t.state)<95:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5z",a="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5z",o="green";break;case 75<=parseInt(t.state)&&parseInt(t.state)<85:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5z",a="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zH5z",o="#9ACD32";break;case 65<=parseInt(t.state)&&parseInt(t.state)<75:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5z",a="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 11z",o="yellow";break;case 55<=parseInt(t.state)&&parseInt(t.state)<65:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5z",a="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5z",o="yellow";break;case 45<=parseInt(t.state)&&parseInt(t.state)<55:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5z",a="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zH5z",o="yellow";break;case 35<=parseInt(t.state)&&parseInt(t.state)<45:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5z",a="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zH5z",o="orange";break;case 25<=parseInt(t.state)&&parseInt(t.state)<35:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5z",a="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 17z",o="orange";break;case 10<=parseInt(t.state)&&parseInt(t.state)<25:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5z",a="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 19z",o="orange";break;case 0<=parseInt(t.state)&&parseInt(t.state)<10:default:n=e,a=e,o="red"}return{batteryIcon:n,batteryCharge:a,stopColour:o,battery0:e}}}function Ea(t){return{...t,toNum:(e,n)=>qe.toNum(t?.state,e,n),isValid:()=>null!==t?.state&&void 0!==t.state||!1,notEmpty:()=>""!==t?.state||!1,isNaN:()=>Number.isNaN(t?.state)||!0,toPower:e=>"kw"===(t.attributes?.unit_of_measurement||"").toLowerCase()?qe.toNum(1e3*(t?.state||"0"),0,e):qe.toNum(t?.state||"0",0,e)||0,toString:()=>t?.state?.toString()||""}}console.groupCollapsed("%c ⚡ SUNSYNK-POWER-FLOW-CARD %c ".concat(Ae("common.version"),": ").concat("4.24.0"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/slipx06/sunsynk-power-flow-card"),console.groupEnd(),t.SunsynkPowerFlowCard=class extends dt{constructor(){super(...arguments),this.durationPrev={},this.durationCur={}}static get styles(){return wt}static getConfigElement(){return document.createElement("content-card-editor")}static getStubConfig(){return{cardstyle:xt.Lite,show_solar:!0,battery:{energy:0,shutdown_soc:20,show_daily:!0},solar:{show_daily:!0,mppts:2},load:{show_daily:!0},grid:{show_daily_buy:!0,show_daily_sell:!1,show_nonessential:!0},entities:{use_timer_248:"switch.sunsynk_toggle_system_timer",priority_load_243:"switch.sunsynk_toggle_priority_load",inverter_voltage_154:"sensor.sunsynk_inverter_voltage",load_frequency_192:"sensor.sunsynk_load_frequency",inverter_current_164:"sensor.sunsynk_inverter_current",inverter_power_175:"sensor.sunsynk_inverter_power",grid_connected_status_194:"binary_sensor.sunsynk_grid_connected_status",inverter_status_59:"sensor.sunsynk_overall_state",day_battery_charge_70:"sensor.sunsynk_day_battery_charge",day_battery_discharge_71:"sensor.sunsynk_day_battery_discharge",battery_voltage_183:"sensor.sunsynk_battery_voltage",battery_soc_184:"sensor.sunsynk_battery_soc",battery_power_190:"sensor.sunsynk_battery_power",battery_current_191:"sensor.sunsynk_battery_current",grid_power_169:"sensor.sunsynk_grid_power",day_grid_import_76:"sensor.sunsynk_day_grid_import",day_grid_export_77:"sensor.sunsynk_day_grid_export",grid_ct_power_172:"sensor.sunsynk_grid_ct_power",day_load_energy_84:"sensor.sunsynk_day_load_energy",essential_power:"none",nonessential_power:"none",aux_power_166:"sensor.sunsynk_aux_power",day_pv_energy_108:"sensor.sunsynk_day_pv_energy",pv1_power_186:"sensor.sunsynk_pv1_power",pv2_power_187:"sensor.sunsynk_pv2_power",pv1_voltage_109:"sensor.sunsynk_pv1_voltage",pv1_current_110:"sensor.sunsynk_pv1_current",pv2_voltage_111:"sensor.sunsynk_pv2_voltage",pv2_current_112:"sensor.sunsynk_pv2_current"}}}render(){xe.hass=this.hass;const t=this._config,e=this.getEntity("day_battery_discharge_71"),n=this.getEntity("day_battery_charge_70"),a=this.getEntity("day_load_energy_84"),o=this.getEntity("day_grid_import_76"),r=this.getEntity("day_pv_energy_108"),i=this.getEntity("day_grid_export_77"),s=this.getEntity("day_aux_energy"),l=this.getEntity("inverter_voltage_154"),d=this.getEntity("load_frequency_192"),c=this.getEntity("inverter_current_164"),u=this.getEntity("inverter_status_59",{state:""}),h=this.getEntity("inverter_power_175"),p=this.getEntity("priority_load_243",{state:"undefined"}),y=this.getEntity("use_timer_248",{state:"undefined"}),g=this.getEntity("dc_transformer_temp_90",{state:""}),m=this.getEntity("radiator_temp_91",{state:""}),f=this.getEntity("inverter_voltage_L2",{state:""}),v=this.getEntity("inverter_voltage_L3",{state:""}),w=this.getEntity("inverter_current_L2",{state:""}),_=this.getEntity("inverter_current_L3",{state:""}),x=this.getEntity("environment_temp",{state:""}),b=this.getEntity("battery_voltage_183"),A=this.getEntity("battery_soc_184"),L=this.getEntity("battery_power_190"),P=this.getEntity("battery_current_191"),E=this.getEntity("battery_temp_182",{state:""}),N=this.getEntity("battery_status",{state:""}),C=this.getEntity("battery_current_direction",{state:""}),M=this.getEntity("battery_rated_capacity",{state:""}),T=this.getEntity("battery.shutdown_soc",{state:t.battery.shutdown_soc?.toString()??""}),k=this.getEntity("battery.shutdown_soc_offgrid",{state:t.battery.shutdown_soc_offgrid?.toString()??""}),S=this.getEntity("essential_power"),I=this.getEntity("aux_power_166"),D=this.getEntity("nonessential_power"),O=this.getEntity("non_essential_load1"),H=this.getEntity("non_essential_load2"),z=this.getEntity("non_essential_load3"),B=this.getEntity("essential_load1"),G=this.getEntity("essential_load2"),V=this.getEntity("essential_load3"),R=this.getEntity("essential_load4"),q=this.getEntity("aux_connected_status",{state:"on"}),j=this.getEntity("aux_load1"),Z=this.getEntity("aux_load2"),F=this.getEntity("essential_load1_extra"),Q=this.getEntity("essential_load2_extra"),X=this.getEntity("load_power_L1"),Y=this.getEntity("load_power_L2"),J=this.getEntity("load_power_L3"),K=this.getEntity("aux_load1_extra"),$=this.getEntity("aux_load2_extra"),tt=this.getEntity("grid_ct_power_172"),et=this.getEntity("grid_ct_power_L2"),nt=this.getEntity("grid_ct_power_L3"),at=this.getEntity("grid_ct_power_total"),ot=this.getEntity("grid_connected_status_194",{state:"on"}),rt=this.getEntity("grid_power_169"),it=this.getEntity("energy_cost_buy",{state:"",attributes:{unit_of_measurement:""}}),st=this.getEntity("energy_cost_sell",{state:"",attributes:{unit_of_measurement:""}}),lt=this.getEntity("grid_voltage",null),dt=this.getEntity("prepaid_units"),ct=this.getEntity("pv1_voltage_109"),ut=this.getEntity("pv1_current_110"),ht=this.getEntity("pv2_voltage_111"),pt=this.getEntity("pv2_current_112"),yt=this.getEntity("pv3_voltage_113"),gt=this.getEntity("pv3_current_114"),mt=this.getEntity("pv4_voltage_115"),vt=this.getEntity("pv4_current_116"),wt=this.getEntity("pv1_power_186"),xt=this.getEntity("pv2_power_187"),At=this.getEntity("pv3_power_188"),Lt=this.getEntity("pv4_power_189"),Pt=this.getEntity("remaining_solar"),Et=this.getEntity("solar_sell_247",{state:"undefined"}),Nt=this.getEntity("pv_total"),Ct=this.getEntity("total_pv_generation");let{invert_aux:Mt}=t.load,Tt=I.toPower(Mt),{invert_grid:kt}=t.grid,St=tt.toPower(kt),It=et.toPower(kt),Dt=nt.toPower(kt),Ot=at.toPower(kt),Ht=t.entities?.grid_ct_power_total?Ot:St+It+Dt,zt=t.inverter.three_phase?Ht:St,Bt=lt.isNaN()?null:qe.toNum(lt.state),Gt=C.isNaN()?null:parseInt(C.state),Vt=t.inverter?.modern,Rt=this.colourConvert(t.load?.colour),qt=this.colourConvert(t.load?.aux_colour||Rt),jt=this.colourConvert(t.load?.aux_off_colour||Rt);t.title_colour=this.colourConvert(t.title_colour);let Zt=t.load?.show_daily,Wt=t.grid?.show_nonessential,Ut=t.entities?.grid_connected_status_194?ot.state:"on",Ft=t.entities?.aux_connected_status?q.state:"on",Qt=t.entities?.load_frequency_192?d.toNum(2):0,Xt=t.entities?.inverter_voltage_154?t.inverter.three_phase&&(this.isLiteCard||this.isCompactCard)?l.toNum(0):l.toNum(1):0,Yt=t.entities?.inverter_voltage_L2?t.inverter.three_phase&&(this.isLiteCard||this.isCompactCard)?f.toNum(0):f.toNum(1):"",Jt=t.entities?.inverter_voltage_L3?t.inverter.three_phase&&(this.isLiteCard||this.isCompactCard)?v.toNum(0):v.toNum(1):"",Kt=t.entities?.inverter_current_164?c.toNum(1):0,$t=t.entities?.inverter_current_L2?w.toNum(1):"",te=t.entities?.inverter_current_L3?_.toNum(1):"",ee=t.entities?.battery_voltage_183?b.toNum(1):0,ne=t.entities?.inverter_power_175?h.toPower():0,ae=t.entities?.grid_power_169?rt.toPower():0,{invert_load:oe}=t.load,re=t.entities?.load_power_L1?X.toPower(oe):"",ie=t.entities?.load_power_L2?Y.toPower(oe):"",se=t.entities?.load_power_L3?J.toPower(oe):"";const le=this.colourConvert(t.grid?.colour),de=this.colourConvert(t.grid?.export_colour||le),ce=this.colourConvert(t.grid?.no_grid_colour||le);let ue;switch(!0){case zt<0:ue=de;break;case 0===zt:ue=ce;break;default:ue=le}const he=this.colourConvert(t.grid?.grid_off_colour||ue);let pe=t.grid?.additional_loads;Ee.includes(pe)||(pe=0);let ye=t.grid?.show_daily_buy,ge=t.grid?.show_daily_sell,me=this.colourConvert(t.battery?.colour),fe=this.colourConvert(t.battery?.charge_colour||me),ve=t.battery?.show_daily,we=t.solar?.show_daily,_e=t.load?.show_aux;Ce.includes(_e)||(_e=!1);let be=t.load?.show_daily_aux,Le=t.load?.additional_loads;(!Pe.includes(Le)||this.isFullCard&&4===Le)&&(Le=0);let Me=t.load?.aux_loads;Pe.includes(Me)||(Me=0);let Te=t.load?.aux_type,ke=t.load?.aux_load1_icon,Se=t.load?.aux_load2_icon,Ie=t.grid?.nonessential_icon,De=t.grid?.load1_icon,Oe=t.grid?.load2_icon,He=t.grid?.load3_icon,ze=t.load?.load1_icon,Be=t.load?.load2_icon,Ge=t.load?.load3_icon,Ve=t.load?.load4_icon,Re=!!t.entities.remaining_solar&&qe.convertValueNew(Pt.state,Pt.attributes?.unit_of_measurement,1),la=!!t.entities.total_pv_generation&&qe.convertValueNew(Ct.state,Ct.attributes?.unit_of_measurement,2),da=t.large_font,ca=t.panel_mode,ua=this.colourConvert(t.inverter?.colour),ha=t.inverter?.autarky,pa=!(!1===t.entities.use_timer_248||!t.entities.use_timer_248)&&y.state,ya=!(!1===t.entities.priority_load_243||!t.entities.priority_load_243)&&p.state,ga=L.toPower(t.battery?.invert_power);const ma=(t.card_height?this.hass.states[t.card_height]:null)||{state:""};let fa="unavailable"===ma.state||"unknown"===ma.state||""===ma.state?t.card_height:ma.state,va=t.card_width,wa=0===t.grid?.energy_cost_decimals?0:t.grid?.energy_cost_decimals||2,_a=zt>=0?it.toNum(wa):st.toNum(wa),xa=_t.Sunsynk;Object.values(_t).includes(t.inverter.model)&&(xa=t.inverter.model);let ba="";const Aa=La.getInstance(xa);Vt||(ba=Aa.image);let Ea=!1;this.isCompactCard&&(Ea=!0);let Na,Ca,Ma=wt.toPower(),Ta=xt.toPower(),ka=At.toPower(),Sa=Lt.toPower(),Ia=Ma+Ta+ka+Sa,Da=t.entities?.pv_total?Nt.toNum():Ia,Oa=t.solar.dynamic_colour?qe.toNum(Da,0)>10?this.colourConvert(t.solar?.colour):"grey":this.colourConvert(t.solar?.colour),Ha=t.inverter?.three_phase;Ne.includes(Ha)||(Ha=!1);const{essential_power:za,nonessential_power:Ba}=t.entities;Ca=!1===Ha?"none"!==Ba&&Ba?D.toPower():St-ae:"none"!==Ba&&Ba?D.toPower():St+It+Dt-ae,Na="none"!==za&&za?S.toPower(oe):!0===Ha&&t.entities.load_power_L1&&t.entities.load_power_L2?Number(re)+Number(ie)+Number(se):ne+ae-Tt;const Ga={time:this.getEntity("prog1_time",{state:t.entities.prog1_time??""}),capacity:this.getEntity("prog1_capacity",{state:t.entities.prog1_capacity??""}),charge:this.getEntity("prog1_charge",{state:t.entities.prog1_charge??""})},Va={time:this.getEntity("prog2_time",{state:t.entities.prog2_time??""}),capacity:this.getEntity("prog2_capacity",{state:t.entities.prog2_capacity??""}),charge:this.getEntity("prog2_charge",{state:t.entities.prog2_charge??""})},Ra={time:this.getEntity("prog3_time",{state:t.entities.prog3_time??""}),capacity:this.getEntity("prog3_capacity",{state:t.entities.prog3_capacity??""}),charge:this.getEntity("prog3_charge",{state:t.entities.prog3_charge??""})},qa={time:this.getEntity("prog4_time",{state:t.entities.prog4_time??""}),capacity:this.getEntity("prog4_capacity",{state:t.entities.prog4_capacity??""}),charge:this.getEntity("prog4_charge",{state:t.entities.prog4_charge??""})},ja={time:this.getEntity("prog5_time",{state:t.entities.prog5_time??""}),capacity:this.getEntity("prog5_capacity",{state:t.entities.prog5_capacity??""}),charge:this.getEntity("prog5_charge",{state:t.entities.prog5_charge??""})},Za={time:this.getEntity("prog6_time",{state:t.entities.prog6_time??""}),capacity:this.getEntity("prog6_capacity",{state:t.entities.prog6_capacity??""}),charge:this.getEntity("prog6_charge",{state:t.entities.prog6_charge??""})};let Wa=k.toNum(),Ua=T.toNum(),Fa={capacity:Ua,entityID:""};if(!1===pa||"off"===y.state)Fa.show=!1;else if(t.entities.prog1_time&&t.entities.prog2_time&&t.entities.prog3_time&&t.entities.prog4_time&&t.entities.prog5_time&&t.entities.prog6_time){Fa.show=!0;const $o=new Date,tr=[];[Ga,Va,Ra,qa,ja,Za].forEach(((t,e)=>{const[n,a]=t.time.state.split(":").map((function(t){return parseInt(t,10)}));tr[e]=new Date($o.getTime()),tr[e].setHours(n),tr[e].setMinutes(a)}));const[er,nr,ar,or,rr,ir]=tr;function sr(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Fa.charge="none":Fa.charge="both",Fa.capacity=parseInt(t.capacity.state),Fa.entityID=e}$o>=ir||$o=er&&$o=nr&&$o=ar&&$o=or&&$o=rr&&$o50?"on":"off"),null==Gt||Number.isNaN(Gt)||xa==_t.Solis&&0===Gt&&(ga=-ga);let Qa=0;if(t.show_battery)switch(xa){case _t.GoodweGridMode:case _t.Goodwe:case _t.Huawei:ga>0?Qa="on"!==Ut&&"1"!==Ut&&"on-grid"!==Ut.toLowerCase()||Fa.show?"off"!==Ut&&"0"!==Ut&&"off-grid"!==Ut.toLowerCase()||!k.notEmpty()||Fa.show?Ua:Wa:Ua:ga<0&&(Qa=100);break;default:Qa=Aa.getBatteryCapacity(ga,Ut,Ua,Fa,A)}let Xa=0,Ya="",Ja="";let Ka=this.getEntity("battery.energy",{state:t.battery.energy?.toString()??""}).toNum(0);if(ee&&M.notEmpty()&&(Ka=qe.toNum(ee*M.toNum(0),0)),t.show_battery||0!==Ka){0===ga?Xa=(A.toNum()-Ua)/100*Ka*60*60:ga>0?Xa=(A.toNum()-Qa)/100*Ka/ga*60*60:ga<0&&(Xa=(Qa-A.toNum(0))/100*Ka/ga*60*60*-1);const lr=new Date,dr=1e3*Xa,cr=new Date(lr.getTime()+dr),ur=cr.getHours(),hr=cr.getMinutes().toString().padStart(2,"0"),pr=ur.toString().padStart(2,"0");Ya="".concat(pr,":").concat(hr);const yr=Math.floor(Xa/86400),gr=Math.floor(Xa%86400/3600),mr=Math.floor(Xa%3600/60);yr>0&&(Ja+="".concat(yr," ").concat(Ae("common.days"),",")),(gr>0||yr>0)&&(Ja+="".concat(gr," ").concat(Ae("common.hrs"),",")),Ja+="".concat(mr," ").concat(Ae("common.min"))}let $a,to=-2<=P.toNum(0)&&P.toNum(0)<=2&&A.toNum(0)>=99;$a=ga<0&&!to?fe:me;let eo="",no="",ao=u.state,oo=!1;xa==_t.Solis&&(ao=u.isNaN()?u.toString():u.toNum(0));let ro=Aa.statusGroups;if(ro)for(const fr of Object.keys(ro)){const vr=ro[fr],{states:wr,color:_r,message:xr}=vr;if(wr.includes(ao.toLowerCase())){eo=_r,no=xr,oo=!0;break}}oo||("none"!==t.entities?.inverter_status_59&&t.entities?.inverter_status_59?(eo="transparent",no="Status"):(eo="transparent",no=""));let io="transparent",so="";if([_t.GoodweGridMode,_t.Goodwe,_t.Huawei].includes(xa)){let br=Aa.batteryStatusGroups;if(br)for(const Ar of Object.keys(br)){const Lr=br[Ar],{states:Pr,color:Er,message:Nr}=Lr;if(Pr.includes(N.state.toLowerCase())){io=Er,so=Nr,oo=!0;break}}oo||("none"!==t.entities?.battery_status&&t.entities?.battery_status?(io="transparent",so="Status"):(io="transparent",so=""))}let lo=r.toNum()+e.toNum(),co=a.toNum()+n.toNum(),uo=0!=co?Math.max(Math.min(Math.round(100*lo/co),100),0):0,ho=0!=lo?Math.max(Math.min(Math.round(100*co/lo),100),0):0,po=Da+qe.toNum("".concat(ga>0?ga:0))+qe.toNum("".concat(Tt<0?-1*Tt:0)),yo=Na+Ca+qe.toNum("".concat(Tt>0?Tt:0))+qe.toNum("".concat(ga<0?-1*ga:0)),go=0!=yo?Math.max(Math.min(Math.round(100*po/yo),100),0):0,mo=0!=po?Math.max(Math.min(Math.round(100*yo/po),100),0):0,fo=(qe.toNum(t.max_line_width)<1?1:t.max_line_width)-1,vo=qe.toNum(t.min_line_width)||1;let wo=this.getEntity("battery.max_power",{state:t.battery.max_power?.toString()??""}).toNum(),_o=t.solar.max_power?this.dynamicLineWidth(Ma,t.solar.max_power||Ma,fo,vo):vo,xo=t.solar.max_power?this.dynamicLineWidth(Ta,t.solar.max_power||Ta,fo,vo):vo,bo=t.solar.max_power?this.dynamicLineWidth(ka,t.solar.max_power||ka,fo,vo):vo,Ao=t.solar.max_power?this.dynamicLineWidth(Sa,t.solar.max_power||Sa,fo,vo):vo,Lo=t.battery.max_power?this.dynamicLineWidth(Math.abs(ga),wo||Math.abs(ga),fo,vo):vo,Po=t.load.max_power?this.dynamicLineWidth(Math.abs(Na),t.load.max_power||Math.abs(Na),fo,vo):vo,Eo=t.load.max_power?this.dynamicLineWidth(Math.abs(Tt),t.load.max_power||Math.abs(Tt),fo,vo):vo,No=t.grid.max_power?this.dynamicLineWidth(Math.abs(zt),t.grid.max_power||Math.abs(zt),fo,vo):vo,Co=t.grid.max_power?this.dynamicLineWidth(Math.abs(ae),t.grid.max_power||Math.abs(ae),fo,vo):vo,Mo=t.grid.max_power?this.dynamicLineWidth(Math.abs(Ca),t.grid.max_power||Math.abs(Ca),fo,vo):vo,To=t.solar.max_power?this.dynamicLineWidth(Da,t.solar.max_power||Da,fo,vo):vo;if(t&&t.solar&&t.solar.animation_speed){const Cr=t.solar.animation_speed-(t.solar.animation_speed-1)*(Da/(t.solar.max_power||Da));this.changeAnimationSpeed("solar",Cr)}if(t&&t.solar&&t.solar.animation_speed){const Mr=t.solar.animation_speed-(t.solar.animation_speed-1)*(Ma/(t.solar.max_power||Ma));this.changeAnimationSpeed("pv1",Mr)}if(t&&t.solar&&t.solar.animation_speed){const Tr=t.solar.animation_speed-(t.solar.animation_speed-1)*(Ta/(t.solar.max_power||Ta));this.changeAnimationSpeed("pv2",Tr)}if(t&&t.solar&&t.solar.animation_speed){const kr=t.solar.animation_speed-(t.solar.animation_speed-1)*(ka/(t.solar.max_power||ka));this.changeAnimationSpeed("pv3",kr)}if(t&&t.solar&&t.solar.animation_speed){const Sr=t.solar.animation_speed-(t.solar.animation_speed-1)*(Sa/(t.solar.max_power||Sa));this.changeAnimationSpeed("pv4",Sr)}if(t&&t.battery&&t.battery.animation_speed){const Ir=t.battery.animation_speed-(t.battery.animation_speed-1)*(Math.abs(ga)/(t.battery.max_power||Math.abs(ga)));this.changeAnimationSpeed("battery",Ir)}if(t&&t.load&&t.load.animation_speed){const Dr=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(Na)/(t.load.max_power||Math.abs(Na)));this.changeAnimationSpeed("load",Dr)}if(t&&t.load&&t.load.animation_speed){const Or=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(Tt)/(t.load.max_power||Math.abs(Tt)));this.changeAnimationSpeed("aux",Or)}if(t&&t.grid&&t.grid.animation_speed){const Hr=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(zt)/(t.grid.max_power||Math.abs(zt)));this.changeAnimationSpeed("grid1",Hr),this.changeAnimationSpeed("grid",Hr)}if(t&&t.grid&&t.grid.animation_speed){const zr=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(Ca)/(t.grid.max_power||Math.abs(Ca)));this.changeAnimationSpeed("ne",zr)}let ko=t.decimal_places;const So=0===Da?0:"off"!==ya&&ya||ga>0?Da/(Ha?Na+Math.max(Tt,0):Na)*100:(Da-Math.abs(ga))/(Ha?Na+Math.max(Tt,0):Na)*100,Io=ga<=0?0:Math.abs(ga)/(Ha?Na+Math.max(Tt,0):Na)*100,Do=So+Io,Oo=0===Do?0:So/Do*100,Ho=0===Do?0:Io/Do*100;let zo=0,Bo=0;Do>100?(zo=qe.toNum(Oo,0),Bo=qe.toNum(Ho,0)):(zo=qe.toNum(Math.min(So,100),0),Bo=qe.toNum(Math.min(Io,100),0));const Go=0===Da||ga>=0?0:"off"!==ya&&ya?(Da-Na)/Math.abs(ga)*100:Da/Math.abs(ga)*100,Vo=ga>=0||zt<=0?0:"on"===ya?Da-Na>=Math.abs(ga)?0:100*(zt-Math.max(Na-Da,0)/Math.abs(ga)):Da>=Math.abs(ga)?0:(Math.abs(ga)-Da)/Math.abs(ga)*100,Ro=Go+Vo,qo=0===Ro?0:Go/Ro*100,jo=0===Ro?0:Vo/Ro*100;let Zo=0,Wo=0;Ro>100?(Zo=qe.toNum(qo,0),Wo=qe.toNum(jo,0)):(Zo=qe.toNum(Math.min(Go,100),0),Wo=qe.toNum(Math.min(Vo,100),0));let Uo,Fo;switch(!0){case So>=100&&Io<=5&&zt-Ca<50&&t.load.dynamic_icon:Uo="M11.6 3.45zM18.25 19.6v-7.6h2.85L11.6 3.45 2.1 12h2.85v7.6zM11.6 6.015l4.75 4.275V17.7H6.85v-7.41zM6.58 2.8v1.42L8 3.508zm-.4 2.4L5.2 6.184l1.5.5zM2.8 6.58 3.508 8l.712-1.42zM6 2.8H2.8v3.2c.228.068.468.1.708.1 1.432.004 2.596-1.16 2.6-2.6-.004-.236-.04-.472-.108-.7M12.5 3.844l2.25 2.026.5-.5-2.24-2.04zM17.71 8.53 18.2 8.04 15.76 5.84 15.26 6.34ZM20.52 11.09l.48-.49-2.31-2.14-.5.5z M18.1299 5.1169 17.318 4.6482l2.4492-1.6171-.75 1.299.8119.4687-2.4492 1.6171z",Fo=1;break;case Io>=100&&So<=5&&zt-Ca<50&&t.load.dynamic_icon:Uo="M15 9h1V7.5h4V9h1c.55 0 1 .45 1 1v11c0 .55-.45 1-1 1h-6c-.55 0-1-.45-1-1V10c0-.55.45-1 1-1m1 2v3h4v-3h-4m-4-5.31l-5 4.5V18h5v2H5v-8H2l10-9l2.78 2.5H14v1.67l-.24.1L12 5.69Z",Fo=0;break;case So<5&&Io<5&&t.load.dynamic_icon:Uo="M5 20v-8H2l10-9l10 9h-3v8zm7-14.31l-5 4.5V18h10v-7.81zM11.5 18v-4H9l3.5-7v4H15z",Fo=0;break;default:Uo="m15 13l-4 4v-3H2v-2h9V9l4 4M5 20v-4h2v2h10v-7.81l-5-4.5L7.21 10H4.22L12 3l10 9h-3v8H5Z",Fo=0}const{batteryIcon:Qo,batteryCharge:Xo,stopColour:Yo,battery0:Jo}=Pa.convert(A),Ko={config:t,panelMode:ca,compactMode:Ea,cardHeight:fa,cardWidth:va,loadColour:Rt,batteryColour:$a,gridColour:ue,isFloating:to,inverterColour:ua,solarColour:Oa,auxColour:qt,auxOffColour:jt,batteryEnergy:Ka,largeFont:da,batteryPower:ga,batteryDuration:Ja,batteryCapacity:Qa,additionalLoad:Le,essIconSize:Fo,essIcon:Uo,stateUseTimer:y,batteryStateMsg:so,stateBatterySoc:A,inverterProg:Fa,solarShowDaily:we,batteryPercentage:Bo,pvPercentage:zo,loadShowDaily:Zt,stateEnergyCostSell:st,stateEnergyCostBuy:it,loadPowerL1:re,loadPowerL2:ie,loadPowerL3:se,durationCur:this.durationCur,stateEssentialLoad1:B,stateEssentialLoad2:G,stateEssentialLoad3:V,stateEssentialLoad4:R,gridPower:St,gridPowerL2:It,gridPowerL3:Dt,decimalPlaces:ko,stateEssentialLoad1Extra:F,stateEssentialLoad2Extra:Q,loadFrequency:Qt,statePV4Current:vt,gridShowDailyBuy:ye,gridShowDailySell:ge,batteryShowDaily:ve,inverterModel:xa,batteryShutdown:Ua,enableAutarky:ha,autarkyPower:go,ratioPower:mo,ratioEnergy:ho,autarkyEnergy:uo,shutdownOffGrid:Wa,statePV1Current:ut,statePV2Current:pt,statePV3Current:gt,energyCost:_a,inverterCurrent:Kt,inverterCurrentL2:$t,inverterCurrentL3:te,stateRadiatorTemp:m,inverterVoltage:Xt,inverterVoltageL2:Yt,inverterVoltageL3:Jt,batteryVoltage:ee,stateBatteryCurrent:P,batLineWidth:Lo,totalGridPower:zt,solarLineWidth:To,totalPV:Da,loadLineWidth:Po,pvPercentageBat:Zo,gridPercentageBat:Wo,genericInverterImage:Vt,battery0:Jo,essentialPower:Na,pv1LineWidth:_o,pv2LineWidth:xo,pv3LineWidth:bo,pv4LineWidth:Ao,gridLineWidth:No,pv1PowerWatts:Ma,pv2PowerWatts:Ta,pv3PowerWatts:ka,pv4PowerWatts:Sa,stateEnvironmentTemp:x,statePV1Voltage:ct,statePV2Voltage:ht,statePV3Voltage:yt,statePV4Voltage:mt,batteryStateColour:io,inverterStateColour:eo,stateBatteryTemp:E,statePrepaidUnits:dt,stateDCTransformerTemp:g,iconEssentialLoad1:ze,iconEssentialLoad2:Be,iconEssentialLoad3:Ge,iconEssentialLoad4:Ve,enableTimer:pa,stateSolarSell:Et,priorityLoad:ya,inverterImg:ba,stateDayPVEnergy:r,statePV2Power:xt,statePV3Power:At,statePV4Power:Lt,remainingSolar:Re,totalSolarGeneration:la,stateDayLoadEnergy:a,stateDayBatteryDischarge:e,stateDayGridImport:o,stateDayBatteryCharge:n,stateDayGridExport:i,statePVTotal:Nt,statePV1Power:wt,minLineWidth:vo,stopColour:Yo,gridStatus:Ut,batteryCharge:Xo,gridOffColour:he,batteryIcon:Qo,formattedResultTime:Ya,showAux:_e,nonessentialIcon:Ie,showNonessential:Wt,auxStatus:Ft,nonessentialLoads:pe,additionalAuxLoad:Me,stateAuxLoad1Extra:K,stateAuxLoad2Extra:$,iconNonessentialLoad1:De,iconNonessentialLoad2:Oe,iconNonessentialLoad3:He,inverterStateMsg:no,auxType:Te,showDailyAux:be,nonessentialPower:Ca,auxPower:Tt,nonessLineWidth:Mo,grid169LineWidth:Co,auxLineWidth:Eo,iconAuxLoad1:ke,iconAuxLoad2:Se,stateDayAuxEnergy:s,stateAuxLoad1:j,stateAuxLoad2:Z,stateNonessentialLoad1:O,stateNonessentialLoad2:H,stateNonessentialLoad3:z,autoScaledInverterPower:ne,autoScaledGridPower:ae};return this.isFullCard?((t,e,n)=>W(je||(je=ft(["\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 ','\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 ','\n kWh\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 ','\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 ','%\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 ","\n ",'\n W\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 \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 \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 \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 \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 \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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\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 \x3c!-- Nonessential Load Icon --\x3e\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 \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 \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
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\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 \n \n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Aux Icon --\x3e\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 \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\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\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
\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 \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 \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 \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 \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 ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n \n \n ',' V\n \n \n \n \n ',' V\n \n \n \n \n ',' V\n \n \n \n \n ',' Hz\n \n \n \n \n ',' A\n \n \n \n \n ',' A\n \n \n \n \n ',' A\n \n \n \n \n ',' V\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 \n \n ','\n A\n \n \n \n \n ','\n \n \n \n \n ','\n \n \n \n ',' V\n \n \n \n ',' A\n \n \n \n ',' V\n \n \n \n ',' A\n \n \n \n ',' V\n \n \n \n ',' A\n \n \n \n ',' V\n \n \n \n ',' A\n \n \n \n \n ','°\n \n \n \n AC:\n ','°\n \n \n \n DC:\n ','°\n \n \n \n \n ','°\n \n \n \n \n ',"\n \n \n
\n
\n
\n "])),n.loadColour,n.loadColour,n.auxColour,n.auxColour,n.auxOffColour,n.gridColour,n.gridColour,t.title?W(Ze||(Ze=ft(['\n ',""])),t.title_colour||"inherit",t.title_size||"32px",t.title):"",!0!==n.panelMode?"".concat(n.cardHeight):"100%",!0===n.panelMode?"".concat(n.cardWidth):"100%",n.solarColour,1===t.solar.mppts?"none":"",t.show_solar?"":"st12",n.batteryColour,t.show_battery?"":"none",n.gridColour,t.show_grid?"":"none",n.gridColour,t.show_grid?"":"none",n.auxColour,n.showAux?"":"st12",n.loadColour,t.inverter.three_phase?60:50,n.inverterColour,n.solarColour,t.show_solar?"":"st12",n.solarColour,t.show_solar&&1!==t.solar.mppts?"":"st12",n.solarColour,!t.show_solar||[1,2].includes(t.solar.mppts)?"st12":"",n.solarColour,!t.show_solar||[1,2,3].includes(t.solar.mppts)?"st12":"",n.gridColour,n.showNonessential?"":"st12",t.show_grid?"":"none",1===n.nonessentialLoads?"":"none",n.gridColour,t.show_grid&&n.showNonessential?"":"st12",[2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.show_grid&&n.showNonessential&&1!==n.nonessentialLoads?"":"st12",[2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.show_grid&&n.showNonessential&&1!==n.nonessentialLoads?"":"st12",3===n.nonessentialLoads&&t.battery.hide_soc?"":"none",n.gridColour,t.show_grid&&n.showNonessential&&1!==n.nonessentialLoads?"":"st12",n.showAux?"143":"30",n.loadColour,1===n.additionalLoad?"":"none",n.showAux?"373":"376",n.showAux?"149":"30",n.loadColour,2===n.additionalLoad?"":"none",n.showAux?"410":"413",n.showAux?"149":"30",n.loadColour,2===n.additionalLoad?"":"none",n.auxColour,n.showAux?"":"none",[1,2].includes(n.additionalAuxLoad)?"":"st12",n.auxColour,n.showAux?"":"none",2===n.additionalAuxLoad?"":"st12",!0!==n.largeFont?"st14":"st4",t.show_battery?"":"none",0===n.batteryEnergy||n.isFloating||0===n.batteryPower?"transparent":"".concat(n.batteryColour),n.batteryDuration,t.show_battery?"":"none",0===n.batteryEnergy||n.batteryPower<=0||n.isFloating?"transparent":"".concat(n.batteryColour),Ae("common.runtime_to"),n.batteryCapacity,n.formattedResultTime,t.show_battery?"":"none",0===n.batteryEnergy||n.batteryPower>=0||n.isFloating?"transparent":"".concat(n.batteryColour),Ae("common.to"),n.batteryCapacity,Ae("common.charge"),n.formattedResultTime,t.show_battery?"":"none",0!==n.batteryEnergy&&n.isFloating?"".concat(n.batteryColour):"transparent",Ae("common.battery_floating"),t.show_solar?"":"none",n.solarColour,t.solar.pv1_name,t.show_solar&&1!==t.solar.mppts?"":"none",n.solarColour,t.solar.pv2_name,!t.show_solar||[1,2].includes(t.solar.mppts)?"none":"",n.solarColour,t.solar.pv3_name,!t.show_solar||[1,2,3].includes(t.solar.mppts)?"none":"",n.solarColour,t.solar.pv4_name,n.gridColour,t.show_grid?"":"none",t.grid.grid_name,n.inverterColour,n.inverterStateMsg,t.battery.show_remaining_energy?"15":"80",t.show_battery?"":"none",n.batteryColour,n.batteryStateMsg,t.show_battery&&t.battery.show_remaining_energy?"":"none",n.batteryColour,qe.toNum(n.batteryEnergy*(parseFloat(n.stateBatterySoc.state)/100)/1e3,2),[1,2].includes(n.additionalLoad)&&n.showAux?"none":"",n.loadColour,t.load.essential_name,0!==n.additionalLoad&&n.showAux?"":"none",n.loadColour,t.load.essential_name,n.showAux?181:70,1===n.additionalLoad?"":"none",n.loadColour,t.load.load1_name,n.showAux?390:393,n.showAux?178:59,2===n.additionalLoad?"":"none",n.loadColour,t.load.load1_name,n.showAux?426:429,n.showAux?178:59,2===n.additionalLoad?"":"none",n.loadColour,t.load.load2_name,2===n.additionalAuxLoad?"238":"306",n.loadShowDaily&&n.showAux?"".concat(n.loadColour):"transparent",Ae("common.daily_load"),0===n.additionalLoad?"377":"306",0===n.additionalLoad?71:93,!n.loadShowDaily||n.showAux?"transparent":"".concat(n.loadColour),Ae("common.daily_load"),1===t.solar.display_mode?"":"none",n.solarShowDaily&&t.show_solar?"".concat(n.solarColour):"transparent",Ae("common.daily_solar"),2===t.solar.display_mode?"":"none",n.solarShowDaily&&t.show_solar?"".concat(n.solarColour):"transparent",Ae("common.daily_solar_left"),3===t.solar.display_mode?"":"none",n.solarShowDaily&&t.show_solar?"".concat(n.solarColour):"transparent",Ae("common.total_solar_generation"),!0===n.batteryShowDaily&&t.show_battery?"".concat(n.batteryColour):"transparent",Ae("common.daily_charge"),!0===n.batteryShowDaily&&t.show_battery?"".concat(n.batteryColour):"transparent",Ae("common.daily_discharge"),n.showNonessential?"347":"311",n.showNonessential?"253":"368",!0!==n.gridShowDailyBuy?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",Ae("common.daily_grid_buy"),n.showNonessential?"347":"311",n.showNonessential?"222":"337",!0!==n.gridShowDailySell?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",Ae("common.daily_grid_sell"),!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),t.load.aux_name,t.show_grid&&n.showNonessential?"":"none",n.gridColour,t.grid.nonessential_name,t.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.grid.load1_name,t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.grid.load1_name,t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.grid.load2_name,t.battery.hide_soc?"st3 st8":"st12",t.show_grid&&n.showNonessential&&![0,1,2].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.grid.load3_name,n.enableAutarky===bt.No?"none":"",n.enableAutarky===bt.Energy?"st4 st8 left-align":"st12",n.inverterColour,n.autarkyEnergy,n.enableAutarky===bt.No?"none":"",n.enableAutarky===bt.Energy?"st4 st8 left-align":"st12",n.inverterColour,n.ratioEnergy,n.enableAutarky===bt.No?"none":"",n.enableAutarky===bt.Power?"st4 st8 left-align":"st12",n.inverterColour,n.autarkyPower,n.enableAutarky===bt.No?"none":"",n.enableAutarky===bt.Power?"st4 st8 left-align":"st12",n.inverterColour,n.ratioPower,n.enableAutarky===bt.No?"none":"",n.inverterColour,Ae("common.autarky"),n.enableAutarky===bt.No?"none":"",n.inverterColour,Ae("common.ratio"),1===n.additionalAuxLoad?53:14,n.showAux&&0!==n.additionalAuxLoad?"":"none",n.auxColour,t.load.aux_load1_name,!n.showAux||[0,1].includes(n.additionalAuxLoad)?"none":"",n.auxColour,t.load.aux_load2_name,n.showAux&&0!==n.additionalAuxLoad&&t.entities.aux_load1_extra?"":"none",n.auxColour,qe.toNum(n.stateAuxLoad1Extra.state,1),n.stateAuxLoad1Extra.attributes?.unit_of_measurement,n.showAux&&![0,1].includes(n.additionalAuxLoad)&&t.entities.aux_load2_extra?"":"none",n.auxColour,qe.toNum(n.stateAuxLoad2Extra.state,1),n.stateAuxLoad2Extra.attributes?.unit_of_measurement,[1,2].includes(n.additionalAuxLoad)?"238":"306",n.showAux&&!0===n.showDailyAux?"":"none",n.auxColour,Ae("common.daily_aux"),t.inverter.three_phase&&t.entities?.load_power_L1?"":"none",n.loadColour,t.inverter.three_phase&&t.entities?.load_power_L1?n.loadPowerL1:"0",t.inverter.three_phase&&t.entities?.load_power_L2?"| "+n.loadPowerL2:"",t.inverter.three_phase&&t.entities?.load_power_L3?"| "+n.loadPowerL3:"",t.inverter.three_phase?"":"none",t.show_grid?"st3 left-align":"st12",n.gridColour,t.load.auto_scale?"".concat(qe.convertValue(n.gridPower,n.decimalPlaces)||0):"".concat(n.gridPower||0," W"),t.inverter.three_phase&&t.entities?.grid_ct_power_L2?"":"none",t.show_grid?"st3 left-align":"st12",n.gridColour,t.load.auto_scale?"".concat(qe.convertValue(n.gridPowerL2,n.decimalPlaces)||0):"".concat(n.gridPowerL2||0," W"),t.inverter.three_phase&&t.entities?.grid_ct_power_L3?"":"none",t.show_grid?"st3 left-align":"st12",n.gridColour,t.load.auto_scale?"".concat(qe.convertValue(n.gridPowerL3,n.decimalPlaces)||0):"".concat(n.gridPowerL3||0," W"),n.batteryColour,t.battery.hide_soc||!t.show_battery?"st12":"st14 left-align",[_t.GoodweGridMode,_t.Goodwe,_t.Huawei].includes(n.inverterModel)&&t.battery?.shutdown_soc_offgrid?"":"none",n.batteryShutdown,n.batteryColour,t.battery.hide_soc||!t.show_battery?"st12":"st14 left-align",[_t.GoodweGridMode,_t.Goodwe,_t.Huawei].includes(n.inverterModel)&&t.battery?.shutdown_soc_offgrid?"":"none",n.shutdownOffGrid,n.inverterStateColour,t.battery.show_remaining_energy?"8":"73","none"!==t.entities?.battery_status&&t.entities?.battery_status&&t.show_battery?"":"none",n.batteryStateColour,n.showAux?"":"none",[1,2].includes(n.additionalLoad)?"":"st12",n.loadColour,n.showAux?"none":"",1===n.additionalLoad?"":"st12",n.loadColour,n.showAux?"none":"",2===n.additionalLoad?"":"st12",n.loadColour,1===t.solar.mppts?"M 86 175 M 155 250 L 96 250 Q 86 250 86 240 L 86 56 H 70":"M 86 162 L 86 56 Q 86 56 86 56 L 70 56",t.show_solar?"":"st12",n.solarColour,n.pv1LineWidth,Math.min(2+n.pv1LineWidth+Math.max(n.minLineWidth-2,0),8),t.show_solar?"":"st12",Math.round(n.pv1PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv1,t.show_solar&&1!==t.solar.mppts?"":"st12",n.solarColour,n.pv2LineWidth,Math.min(2+n.pv2LineWidth+Math.max(n.minLineWidth-2,0),8),t.show_solar&&1!==t.solar.mppts?"":"st12",Math.round(n.pv2PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv2,!t.show_solar||[1,2].includes(t.solar.mppts)?"st12":"",n.solarColour,n.pv3LineWidth,Math.min(2+n.pv3LineWidth+Math.max(n.minLineWidth-2,0),8),!t.show_solar||[1,2].includes(t.solar.mppts)?"st12":"",Math.round(n.pv3PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv3,!t.show_solar||[1,2,3].includes(t.solar.mppts)?"st12":"",n.solarColour,n.pv4LineWidth,Math.min(2+n.pv4LineWidth+Math.max(n.minLineWidth-2,0),8),!t.show_solar||[1,2,3].includes(t.solar.mppts)?"st12":"",Math.round(n.pv4PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv4,t.show_solar&&1!==t.solar.mppts?"":"st12",n.solarColour,n.solarLineWidth,Math.min(2+n.solarLineWidth+Math.max(n.minLineWidth-2,0),8),t.show_solar&&1!==t.solar.mppts?"":"st12",0===n.totalPV?"transparent":"".concat(n.solarColour),n.durationCur.solar,t.show_battery?"":"st12",n.batteryColour,n.batLineWidth,Math.min(2+n.batLineWidth+Math.max(n.minLineWidth-2,0),8),t.show_battery?"":"st12",n.batteryPower<0||0===n.batteryPower?"transparent":"".concat(n.batteryColour),n.durationCur.battery,Math.min(2+n.batLineWidth+Math.max(n.minLineWidth-2,0),8),t.show_battery?"":"st12",n.batteryPower>0||0===n.batteryPower?"transparent":"".concat(n.batteryColour),n.durationCur.battery,n.gridColour,n.gridLineWidth,t.show_grid?"":"none",Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower<0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",n.durationCur.grid,Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower>0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",n.durationCur.grid,t.inverter.three_phase?"M 421 295 L 421 337":"M 421 295 L 421 310.5",n.gridColour,n.gridLineWidth,t.show_grid?"":"none",Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower<0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",n.durationCur.grid/1.5,Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower>0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",n.durationCur.grid/1.5,n.gridColour,n.nonessLineWidth,t.show_grid?"":"none",n.showNonessential?"":"st12",Math.min(2+n.nonessLineWidth+Math.max(n.minLineWidth-2,0),8),n.showNonessential?"":"st12",n.nonessentialPower<=0?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",n.durationCur.ne/1.5,n.gridColour,n.nonessLineWidth,t.show_grid?"":"none",n.showNonessential?"":"st12",Math.min(2+n.nonessLineWidth+Math.max(n.minLineWidth-2,0),5),n.showNonessential?"":"st12",n.nonessentialPower<=0?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",n.durationCur.ne,n.showAux?"":"st12",n.auxColour,n.auxLineWidth,Math.min(2+n.auxLineWidth+Math.max(n.minLineWidth-2,0),8),n.showAux&&0!==n.auxPower?"":"st12",n.auxPower<0?"transparent":"".concat(n.auxColour),n.durationCur.aux,Math.min(2+n.auxLineWidth+Math.max(n.minLineWidth-2,0),8),n.showAux&&0!==n.auxPower?"":"st12",n.auxPower>0?"transparent":"".concat(n.auxColour),n.durationCur.aux,n.showAux?"":"st12",n.auxColour,n.auxLineWidth,n.gridColour,n.grid169LineWidth,t.show_grid?"":"none",t.inverter.three_phase?"M 180.15 223 L 180.15 235":"M 180.15 212 L 180.15 235",n.inverterColour,n.loadColour,n.loadLineWidth,Math.min(2+n.loadLineWidth+Math.max(n.minLineWidth-2,0),8),0===n.essentialPower?"transparent":"".concat(n.loadColour),n.durationCur.load,n.loadColour,n.loadLineWidth,n.genericInverterImage?1:0,n.inverterColour,t.battery?.show_remaining_energy?"294":"296.25",Number(n.pvPercentageBat)>0?n.solarColour:Number(n.gridPercentageBat)>0?n.gridColour:n.batteryColour,n.pvPercentageBat<2?0:n.pvPercentageBat,Number(n.pvPercentageBat)>0?n.solarColour:Number(n.gridPercentageBat)>0?n.gridColour:n.batteryColour,n.pvPercentageBat<2?0:n.pvPercentageBat,Number(n.gridPercentageBat)>0?n.gridColour:n.batteryColour,Number(n.pvPercentageBat<2?0:n.pvPercentageBat)+Number(n.gridPercentageBat<2?0:n.gridPercentageBat),Number(n.gridPercentageBat)>0?"".concat(n.gridColour):"".concat(n.batteryColour),Number(n.pvPercentageBat<2?0:n.pvPercentageBat)+Number(n.gridPercentageBat<2?0:n.gridPercentageBat),100===Number(n.pvPercentageBat)?n.solarColour:100===Number(n.gridPercentageBat)?n.gridColour:n.batteryColour,100===Number(n.pvPercentageBat)?n.solarColour:100===Number(n.gridPercentageBat)?n.gridColour:n.batteryColour,t.show_battery?"":"st12",t.battery.dynamic_colour?"url(#bLg)":n.batteryColour,t.battery.linear_gradient?n.battery0:n.batteryIcon,t.battery?.show_remaining_energy?"294":"296.25",n.stopColour,t.show_battery?"":"st12",t.battery.linear_gradient?"url(#sLg)":n.batteryColour,t.battery.linear_gradient?"":"none",n.batteryCharge,t.show_solar?"":"st12",n.solarColour,(e=>qe.handlePopup(e,t.entities.grid_connected_status_194)),t.inverter.three_phase?"404":"389",t.inverter.three_phase?"339":"308",t.inverter.three_phase?"34":"65",t.inverter.three_phase?"34":"65",["off","0","off-grid","off grid","offgrid"].includes(n.gridStatus.toLowerCase())?"st12":"",n.gridColour,!t.show_grid||n.totalGridPower<0?"none":"",t.inverter.three_phase?"404":"389",t.inverter.three_phase?"339":"308",t.inverter.three_phase?"34":"65",t.inverter.three_phase?"34":"65",["on","1","on-grid","on grid","ongrid"].includes(n.gridStatus.toLowerCase())?"st12":"",n.gridOffColour,t.show_grid?"":"none",t.inverter.three_phase?"404":"389",t.inverter.three_phase?"339":"308",t.inverter.three_phase?"34":"65",t.inverter.three_phase?"34":"65",["off","0","off-grid","off grid"].includes(n.gridStatus.toLowerCase())?"st12":"",n.gridColour,!t.show_grid||n.totalGridPower>=0?"none":"","default"===n.nonessentialIcon?"1":"0",t.show_grid&&n.showNonessential&&![1,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"oven"===n.nonessentialIcon?"1":"0",t.show_grid&&n.showNonessential&&![1,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"boiler"===n.nonessentialIcon?"1":"0",t.show_grid&&n.showNonessential&&![1,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"pump"===n.nonessentialIcon?"1":"0",t.show_grid&&n.showNonessential&&![1,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"aircon"===n.nonessentialIcon?"1":"0",t.show_grid&&n.showNonessential&&![1,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.show_grid&&n.showNonessential&&![1,2,3].includes(n.nonessentialLoads)?"":"none",n.nonessentialIcon,"default"===n.iconNonessentialLoad1&&"default"===n.iconNonessentialLoad2?"1":"0",t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"default"===n.iconNonessentialLoad1&&"default"!=n.iconNonessentialLoad2?"1":"0",t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"default"!=n.iconNonessentialLoad1&&"default"===n.iconNonessentialLoad2?"1":"0",t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"boiler"===n.iconNonessentialLoad1?"1":"0",t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"boiler"===n.iconNonessentialLoad2?"1":"0",t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"pump"===n.iconNonessentialLoad1?"1":"0",t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"pump"===n.iconNonessentialLoad2?"1":"0",t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"oven"===n.iconNonessentialLoad1?"1":"0",t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"oven"===n.iconNonessentialLoad2?"1":"0",t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"aircon"===n.iconNonessentialLoad1?"1":"0",t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"aircon"===n.iconNonessentialLoad2?"1":"0",t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.iconNonessentialLoad1,t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.iconNonessentialLoad2,t.show_grid&&n.showNonessential&&![0,1,2].includes(n.nonessentialLoads)&&t.battery.hide_soc?"":"none",t.battery.hide_soc?1:0,n.iconNonessentialLoad3,"default"===n.iconNonessentialLoad1?"1":"0",t.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"boiler"===n.iconNonessentialLoad1?"1":"0",t.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"pump"===n.iconNonessentialLoad1?"1":"0",t.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"oven"===n.iconNonessentialLoad1?"1":"0",t.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"aircon"===n.iconNonessentialLoad1?"1":"0",t.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.iconNonessentialLoad1,1===n.essIconSize?"82.5":"78.5",Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.pvPercentage)>0?n.solarColour:n.gridColour,Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),Number(n.pvPercentage)>0?"".concat(n.solarColour):"".concat(n.gridColour),Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,[1,2].includes(n.additionalLoad)&&!n.showAux?"":"none",t.load.dynamic_colour?"url(#Lg)":n.loadColour,n.essIcon,Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.pvPercentage)>0?n.solarColour:n.gridColour,Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),Number(n.pvPercentage)>0?"".concat(n.solarColour):"".concat(n.gridColour),Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,[1,2].includes(n.additionalLoad)&&n.showAux?"":"none",t.load.dynamic_colour?"url(#Lg)":n.loadColour,n.essIcon,1===n.essIconSize?"82.5":"78.5",Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.pvPercentage)>0?n.solarColour:n.gridColour,Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),Number(n.pvPercentage)>0?"".concat(n.solarColour):"".concat(n.gridColour),Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,[1,2].includes(n.additionalLoad)?"none":"",t.load.dynamic_colour?"url(#Lg)":n.loadColour,n.essIcon,(e=>qe.handlePopup(e,t.entities.aux_connected_status)),"default"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),"gen"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),"inverter"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),"oven"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),"boiler"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),"aircon"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),"pump"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"",n.auxType,"on"===n.auxStatus||"1"===n.auxStatus?"aux-icon":"aux-off-icon",n.showAux&&0!==n.additionalAuxLoad?"":"none",n.iconAuxLoad1,!n.showAux||[0,1].includes(n.additionalAuxLoad)?"none":"",n.iconAuxLoad2,"boiler"===n.iconEssentialLoad1&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"boiler"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"boiler"!==n.iconEssentialLoad1||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"boiler"!==n.iconEssentialLoad2||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"boiler"===n.iconEssentialLoad1&&1===n.additionalLoad?"1":"0",!n.showAux||[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"boiler"!==n.iconEssentialLoad1||1!==n.additionalLoad||n.showAux?"0":"1",[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"aircon"===n.iconEssentialLoad1&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"aircon"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"aircon"!==n.iconEssentialLoad1||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"aircon"!==n.iconEssentialLoad2||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"aircon"===n.iconEssentialLoad1&&1===n.additionalLoad?"1":"0",!n.showAux||[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"aircon"!==n.iconEssentialLoad1||1!==n.additionalLoad||n.showAux?"0":"1",[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"pump"===n.iconEssentialLoad1&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"pump"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"pump"!==n.iconEssentialLoad1||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"pump"!==n.iconEssentialLoad2||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"pump"===n.iconEssentialLoad1&&1===n.additionalLoad?"1":"0",!n.showAux||[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"pump"!==n.iconEssentialLoad1||1!==n.additionalLoad||n.showAux?"0":"1",[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"oven"===n.iconEssentialLoad1&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"oven"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"oven"!==n.iconEssentialLoad1||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"oven"!==n.iconEssentialLoad2||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"oven"!==n.iconEssentialLoad1||1!==n.additionalLoad||n.showAux?"0":"1",[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"oven"===n.iconEssentialLoad1&&1===n.additionalLoad?"1":"0",!n.showAux||[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,[0,1].includes(n.additionalLoad)?"none":"",n.showAux?"371":"384",n.showAux?"123":"5",n.iconEssentialLoad1,[0,1].includes(n.additionalLoad)?"none":"",n.showAux?"429":"421",n.showAux?"123":"5",n.iconEssentialLoad2,[0,2].includes(n.additionalLoad)?"none":"",(n.showAux,"336"),n.showAux?"140":"27",n.iconEssentialLoad1,(e=>qe.handlePopup(e,t.entities.use_timer_248)),n.enableAutarky!=bt.No?"232":"249","on"==n.stateUseTimer.state&&n.enableTimer!==bt.No?"":"none",n.inverterColour,n.enableAutarky!=bt.No?"232":"249","off"==n.stateUseTimer.state&&"no"!==n.enableTimer?"":"none",n.inverterColour,n.enableAutarky!=bt.No?"243":"260","on"==n.stateUseTimer.state&&"no"!==n.enableTimer?"":"none",n.inverterColour,Ae("common.timer_on"),n.enableAutarky!=bt.No?"243":"260","off"==n.stateUseTimer.state&&"no"!==n.enableTimer?"":"none",n.inverterColour,Ae("common.timer_off"),(e=>qe.handlePopup(e,t.entities.solar_sell_247)),t.entities.solar_sell_247&&"none"!==t.entities.solar_sell_247&&"off"!==n.stateSolarSell.state&&"0"!==n.stateSolarSell.state&&t.show_solar&&["1","on"].includes(n.stateSolarSell.state)?"":"none",n.solarColour,t.entities.solar_sell_247&&"none"!==t.entities.solar_sell_247&&"on"!==n.stateSolarSell.state&&"1"!==n.stateSolarSell.state&&t.show_solar&&["0","off"].includes(n.stateSolarSell.state)?"":"none",n.solarColour,(e=>qe.handlePopup(e,t.entities.priority_load_243)),"no"!=n.enableAutarky?"251":"268","off"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,"no"!=n.enableAutarky?"251":"268","on"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,n.enableAutarky!=bt.No?"262":"280","on"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,Ae("common.priority_load"),n.enableAutarky!=bt.No?"262":"280","off"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,Ae("common.priority_batt"),n.genericInverterImage?"st12":"",e,(t=>qe.handlePopup(t,n.inverterProg.entityID)),n.enableAutarky!=bt.No?"232":"249",!1===n.inverterProg.show||"none"===t.entities.use_timer_248?"none":"","none"===n.inverterProg.charge?"st12":"",n.inverterColour,n.enableAutarky!=bt.No?"232":"249",!1===n.inverterProg.show||"none"===t.entities.use_timer_248?"none":"","none"===n.inverterProg.charge?"":"st12",n.inverterColour,(e=>qe.handlePopup(e,t.entities.day_pv_energy_108)),1===t.solar.display_mode?"":"none",n.solarShowDaily&&t.show_solar?"".concat(n.solarColour):"transparent",t.solar.auto_scale?qe.convertValueNew(n.stateDayPVEnergy.state,n.stateDayPVEnergy.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayPVEnergy.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.day_pv_energy_108)),2===t.solar.display_mode?"":"none",n.solarShowDaily&&t.show_solar?"".concat(n.solarColour):"transparent",t.solar.auto_scale?"".concat(qe.convertValueNew(n.stateDayPVEnergy.state,n.stateDayPVEnergy.attributes?.unit_of_measurement,1)," / ").concat(n.remainingSolar):"".concat(qe.toNum(n.stateDayPVEnergy.state,1)," kWh / ").concat(n.remainingSolar),(e=>qe.handlePopup(e,t.entities.day_pv_energy_108)),3===t.solar.display_mode?"":"none",n.solarShowDaily&&t.show_solar?"".concat(n.solarColour):"transparent",t.solar.auto_scale?"".concat(qe.convertValueNew(n.stateDayPVEnergy.state,n.stateDayPVEnergy.attributes?.unit_of_measurement,1)," / ").concat(n.totalSolarGeneration):"".concat(qe.toNum(n.stateDayPVEnergy.state,1)," kWh / ").concat(n.totalSolarGeneration),(e=>qe.handlePopup(e,t.entities.day_load_energy_84)),2===n.additionalAuxLoad?"238":"306",n.loadShowDaily&&n.showAux?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateDayLoadEnergy.state,n.stateDayLoadEnergy.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayLoadEnergy.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.day_load_energy_84)),0===n.additionalLoad?"377":"306",0===n.additionalLoad?"57":"80",!n.loadShowDaily||n.showAux?"none":"",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateDayLoadEnergy.state,n.stateDayLoadEnergy.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayLoadEnergy.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.day_battery_charge_70)),!0===n.batteryShowDaily&&t.show_battery?"":"none",n.batteryColour,t.battery.auto_scale?qe.convertValueNew(n.stateDayBatteryCharge.state,n.stateDayBatteryCharge.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayBatteryCharge.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.day_battery_discharge_71)),!0===n.batteryShowDaily&&t.show_battery?"":"none",n.batteryColour,t.battery.auto_scale?qe.convertValueNew(n.stateDayBatteryDischarge.state,n.stateDayBatteryDischarge.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayBatteryDischarge.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.day_grid_import_76)),n.showNonessential?"347":"311",n.showNonessential?"239":"354",t.show_grid&&!0===n.gridShowDailyBuy?"":"none",n.gridColour,t.grid.auto_scale?qe.convertValueNew(n.stateDayGridImport.state,n.stateDayGridImport.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayGridImport.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.day_grid_export_77)),n.showNonessential?"347":"311",n.showNonessential?"209":"323",t.show_grid&&!0===n.gridShowDailySell?"":"none",n.gridColour,t.grid.auto_scale?qe.convertValueNew(n.stateDayGridExport.state,n.stateDayGridExport.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayGridExport.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.day_aux_energy)),[1,2].includes(n.additionalAuxLoad)?"238":"306",n.showAux&&!0===n.showDailyAux?"":"none",n.auxColour,t.load.auto_scale?qe.convertValueNew(n.stateDayAuxEnergy.state,n.stateDayAuxEnergy.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayAuxEnergy.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.essential_load1_extra)),t.entities?.essential_load1_extra&&1===n.additionalLoad&&!n.showAux?"":"none",n.loadColour,qe.toNum(n.stateEssentialLoad1Extra.state,1),n.stateEssentialLoad1Extra.attributes?.unit_of_measurement,(e=>qe.handlePopup(e,t.entities.essential_load1_extra)),t.entities?.essential_load1_extra&&2===n.additionalLoad&&!n.showAux?"":"none",n.loadColour,qe.toNum(n.stateEssentialLoad1Extra.state,1),n.stateEssentialLoad1Extra.attributes?.unit_of_measurement,(e=>qe.handlePopup(e,t.entities.essential_load2_extra)),t.entities?.essential_load2_extra&&2===n.additionalLoad&&!n.showAux?"":"none",n.loadColour,qe.toNum(n.stateEssentialLoad2Extra.state,1),n.stateEssentialLoad2Extra.attributes?.unit_of_measurement,t.inverter.three_phase?t.entities?.grid_ct_power_total?U(We||(We=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.grid_ct_power_total)),t.show_grid&&"none"!==t.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(t.grid.show_absolute?"".concat(Math.abs(parseFloat(qe.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(qe.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):qe.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(t.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," W"):"".concat(n.totalGridPower||0," W"))):U(Ue||(Ue=ft(['\n \n ',"\n "])),t.show_grid&&"none"!==t.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(t.grid.show_absolute?"".concat(Math.abs(parseFloat(qe.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(qe.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):qe.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(t.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," W"):"".concat(n.totalGridPower||0," W"))):U(Fe||(Fe=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.grid_ct_power_172)),t.show_grid&&"none"!==t.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(t.grid.show_absolute?"".concat(Math.abs(parseFloat(qe.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(qe.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):qe.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(t.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," W"):"".concat(n.totalGridPower||0," W"))),t.entities?.pv_total?U(Qe||(Qe=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.pv_total)),!0!==n.largeFont?"st14":"st4",t.show_solar&&1!==t.solar.mppts?"":"none",n.solarColour,t.solar.auto_scale?t.entities?.pv_total?qe.convertValueNew(n.totalPV,n.statePVTotal.attributes?.unit_of_measurement,n.decimalPlaces):qe.convertValue(n.totalPV,n.decimalPlaces)||0:"".concat(qe.toNum(n.totalPV||0,0)," W")):U(Xe||(Xe=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",t.show_solar&&1!==t.solar.mppts?"":"none",n.solarColour,t.solar.auto_scale?t.entities?.pv_total?qe.convertValueNew(n.totalPV,n.statePVTotal.attributes?.unit_of_measurement,n.decimalPlaces):qe.convertValue(n.totalPV,n.decimalPlaces)||0:"".concat(qe.toNum(n.totalPV||0,0)," W")),t.entities?.essential_power&&"none"!==t.entities.essential_power?U(Ye||(Ye=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.essential_power)),!0!==n.largeFont?"st14":"st4",n.loadColour,t.load.auto_scale?"".concat(qe.convertValue(n.essentialPower,n.decimalPlaces)||0):"".concat(n.essentialPower||0," W")):U(Je||(Je=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",n.loadColour,t.load.auto_scale?"".concat(qe.convertValue(n.essentialPower,n.decimalPlaces)||0):"".concat(n.essentialPower||0," W")),t.entities?.nonessential_power?U(Ke||(Ke=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.nonessential_power)),t.show_grid&&n.showNonessential?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(qe.convertValue(n.nonessentialPower,n.decimalPlaces)||0):"".concat(n.nonessentialPower||0," W")):U($e||($e=ft(['\n \n ',"\n "])),t.show_grid&&n.showNonessential?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(qe.convertValue(n.nonessentialPower,n.decimalPlaces)||0):"".concat(n.nonessentialPower||0," W")),t.entities?.aux_power_166?U(tn||(tn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.aux_power_166)),!0!==n.largeFont?"st14":"st4",n.showAux?"":"none",n.auxColour,t.load.auto_scale?"".concat(t.load.show_absolute_aux?"".concat(Math.abs(parseFloat(qe.convertValue(n.auxPower,n.decimalPlaces)))," ").concat(qe.convertValue(n.auxPower,n.decimalPlaces).split(" ")[1]):qe.convertValue(n.auxPower,n.decimalPlaces)||"0"):"".concat(t.load.show_absolute_aux?"".concat(Math.abs(n.auxPower)):n.auxPower||0," W")):U(en||(en=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",n.showAux?"":"none",n.auxColour,t.load.auto_scale?"".concat(t.load.show_absolute_aux?"".concat(Math.abs(parseFloat(qe.convertValue(n.auxPower,n.decimalPlaces)))," ").concat(qe.convertValue(n.auxPower,n.decimalPlaces).split(" ")[1]):qe.convertValue(n.auxPower,n.decimalPlaces)||"0"):"".concat(t.load.show_absolute_aux?"".concat(Math.abs(n.auxPower)):n.auxPower||0," W")),t.entities?.pv1_power_186?U(nn||(nn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.pv1_power_186)),!0!==n.largeFont?"st14":"st4",t.show_solar?"":"none",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV1Power.state,n.statePV1Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV1Power.state,0)," W")):U(an||(an=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",t.show_solar&&"none"!==t.entities.pv1_power_186?"":"none",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV1Power.state,n.statePV1Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV1Power.state,0)," W")),t.entities?.pv2_power_187?U(on||(on=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.pv2_power_187)),!0!==n.largeFont?"st14":"st4",t.show_solar&&1!==t.solar.mppts?"":"none",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV2Power.state,n.statePV2Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV2Power.state,0)," W")):U(rn||(rn=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",t.show_solar&&"none"!==t.entities.pv2_power_187&&1!==t.solar.mppts?"":"none",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV2Power.state,n.statePV2Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV2Power.state,0)," W")),t.entities?.pv3_power_188?U(sn||(sn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.pv3_power_188)),!0!==n.largeFont?"st14":"st4",!t.show_solar||[1,2].includes(t.solar.mppts)?"none":"",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV3Power.state,n.statePV3Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV3Power.state,0)," W")):U(ln||(ln=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",!t.show_solar||"none"===t.entities.pv3_power_188||[1,2].includes(t.solar.mppts)?"none":"",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV3Power.state,n.statePV3Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV3Power.state,0)," W")),t.entities?.pv4_power_189?U(dn||(dn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.pv4_power_189)),!0!==n.largeFont?"st14":"st4",!t.show_solar||[1,2,3].includes(t.solar.mppts)?"none":"",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV4Power.state,n.statePV4Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV4Power.state,0)," W")):U(cn||(cn=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",!t.show_solar||"none"===t.entities.pv4_power_189||[1,2,3].includes(t.solar.mppts)?"none":"",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV4Power.state,n.statePV4Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV4Power.state,0)," W")),t.entities?.aux_load1?U(un||(un=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.aux_load1)),!0!==n.largeFont?"st14":"st4",n.showAux&&0!==n.additionalAuxLoad?"":"none",n.auxColour,t.load.auto_scale?qe.convertValueNew(n.stateAuxLoad1.state,n.stateAuxLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateAuxLoad1.state,0)||0," W")):U(hn||(hn=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",n.showAux&&0!==n.additionalAuxLoad?"":"none",n.auxColour,t.load.auto_scale?qe.convertValueNew(n.stateAuxLoad1.state,n.stateAuxLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateAuxLoad1.state,0)||0," W")),t.entities?.aux_load2?U(pn||(pn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.aux_load2)),!0!==n.largeFont?"st14":"st4",!n.showAux||[0,1].includes(n.additionalAuxLoad)?"none":"",n.auxColour,t.load.auto_scale?qe.convertValueNew(n.stateAuxLoad2.state,n.stateAuxLoad2.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateAuxLoad2.state,0)||0," W")):U(yn||(yn=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",!n.showAux||[0,1].includes(n.additionalAuxLoad)?"none":"",n.auxColour,t.load.auto_scale?qe.convertValueNew(n.stateAuxLoad2.state,n.stateAuxLoad2.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateAuxLoad2.state,0)||0," W")),t.entities?.non_essential_load1?U(gn||(gn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.non_essential_load1)),t.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.grid.auto_scale?qe.convertValueNew(n.stateNonessentialLoad1.state,n.stateNonessentialLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateNonessentialLoad1.state,0)||0," W")):U(mn||(mn=ft(['\n \n ',"\n "])),t.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.grid.auto_scale?qe.convertValueNew(n.stateNonessentialLoad1.state,n.stateNonessentialLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateNonessentialLoad1.state,0)||0," W")),t.entities?.non_essential_load1?U(fn||(fn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.non_essential_load1)),t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.grid.auto_scale?qe.convertValueNew(n.stateNonessentialLoad1.state,n.stateNonessentialLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateNonessentialLoad1.state,0)||0," W")):U(vn||(vn=ft(['\n \n ',"\n "])),t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.grid.auto_scale?qe.convertValueNew(n.stateNonessentialLoad1.state,n.stateNonessentialLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateNonessentialLoad1.state,0)||0," W")),t.entities?.non_essential_load2?U(wn||(wn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.non_essential_load2)),t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.grid.auto_scale?qe.convertValueNew(n.stateNonessentialLoad2.state,n.stateNonessentialLoad2.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateNonessentialLoad2.state,0)||0," W")):U(_n||(_n=ft(['\n \n ',"\n "])),t.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.grid.auto_scale?qe.convertValueNew(n.stateNonessentialLoad2.state,n.stateNonessentialLoad2.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateNonessentialLoad2.state,0)||0," W")),t.entities?.non_essential_load3?U(xn||(xn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.non_essential_load3)),t.battery.hide_soc?"st3":"st12",t.show_grid&&n.showNonessential&&![0,1,2].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.grid.auto_scale?qe.convertValueNew(n.stateNonessentialLoad3.state,n.stateNonessentialLoad3.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateNonessentialLoad3.state,0)||0," W")):U(bn||(bn=ft(['\n \n ',"\n "])),t.battery.hide_soc?"st3":"st12",t.show_grid&&n.showNonessential&&![0,1,2].includes(n.nonessentialLoads)?"":"none",n.gridColour,t.grid.auto_scale?qe.convertValueNew(n.stateNonessentialLoad3.state,n.stateNonessentialLoad3.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateNonessentialLoad3.state,0)||0," W")),t.entities?.essential_load1?U(An||(An=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.essential_load1)),n.showAux?"158":"47",1===n.additionalLoad?"":"none",!0!==n.largeFont?"st14":"st4",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad1.state,n.stateEssentialLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad1.state,0)||0," ").concat(void 0!==n.stateEssentialLoad1.attributes?.unit_of_measurement?n.stateEssentialLoad1.attributes?.unit_of_measurement:"")):U(Ln||(Ln=ft(['\n \n ',"\n "])),n.showAux?"158":"47",1===n.additionalLoad?"":"none",!0!==n.largeFont?"st14":"st4",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad1.state,n.stateEssentialLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad1.state,0)||0," ").concat(void 0!==n.stateEssentialLoad1.attributes?.unit_of_measurement?n.stateEssentialLoad1.attributes?.unit_of_measurement:"")),t.entities?.essential_load1?U(Pn||(Pn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.essential_load1)),n.showAux?"391":"394",n.showAux?"160":"42",2===n.additionalLoad?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad1.state,n.stateEssentialLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad1.state,0)||0," ").concat(void 0!==n.stateEssentialLoad1.attributes?.unit_of_measurement?n.stateEssentialLoad1.attributes?.unit_of_measurement:"")):U(En||(En=ft(['\n \n ',"\n "])),n.showAux?"391":"394",n.showAux?"160":"42",2===n.additionalLoad?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad1.state,n.stateEssentialLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad1.state,0)||0," ").concat(void 0!==n.stateEssentialLoad1.attributes?.unit_of_measurement?n.stateEssentialLoad1.attributes?.unit_of_measurement:"")),t.entities?.essential_load2?U(Nn||(Nn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.essential_load2)),n.showAux?"427":"430",n.showAux?"160":"42",2===n.additionalLoad?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad2.state,n.stateEssentialLoad2.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad2.state,0)||0," ").concat(void 0!==n.stateEssentialLoad2.attributes?.unit_of_measurement?n.stateEssentialLoad2.attributes?.unit_of_measurement:"")):U(Cn||(Cn=ft(['\n \n ',"\n "])),n.showAux?"427":"430",n.showAux?"160":"42",2===n.additionalLoad?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad2.state,n.stateEssentialLoad2.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad2.state,0)||0," ").concat(void 0!==n.stateEssentialLoad2.attributes?.unit_of_measurement?n.stateEssentialLoad2.attributes?.unit_of_measurement:"")),n.totalGridPower>=0?U(Mn||(Mn=ft(['\n \n \n '," ","\n "])),(e=>qe.handlePopup(e,t.entities.energy_cost_buy)),t.show_grid?"st3 right-align":"st12",n.gridColour,t.entities?.energy_cost_buy?"":"none",n.energyCost,n.stateEnergyCostBuy.attributes?.unit_of_measurement):U(Tn||(Tn=ft(['\n \n \n '," ","\n \n "])),(e=>qe.handlePopup(e,t.entities.energy_cost_sell)),t.show_grid?"st3 right-align":"st12",n.gridColour,t.entities?.energy_cost_sell?"":"none",n.energyCost,n.stateEnergyCostSell.attributes?.unit_of_measurement),(e=>qe.handlePopup(e,t.entities.inverter_voltage_154)),t.inverter.three_phase?"164":"170.4",t.show_grid&&"none"!==t.entities.inverter_voltage_154&&t.entities.inverter_voltage_154?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,n.inverterVoltage,(e=>qe.handlePopup(e,t.entities.inverter_voltage_L2)),t.inverter.three_phase&&t.entities?.inverter_voltage_L2?"":"none",t.show_grid?"".concat(!0!==n.largeFont?"st14 st8":"st4 st8"):"st12",n.gridColour,n.inverterVoltageL2,(e=>qe.handlePopup(e,t.entities.inverter_voltage_L3)),t.inverter.three_phase&&t.entities?.inverter_voltage_L3?"":"none",t.show_grid?"".concat(!0!==n.largeFont?"st14 st8":"st4 st8"):"st12",n.gridColour,n.inverterVoltageL3,(e=>qe.handlePopup(e,t.entities.load_frequency_192)),t.inverter.three_phase?"203":"189.5",t.show_grid&&"none"!==t.entities.load_frequency_192&&t.entities.load_frequency_192?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,n.loadFrequency,(e=>qe.handlePopup(e,t.entities.inverter_current_164)),t.inverter.three_phase?"188":"199","none"!==t.entities.inverter_current_164&&t.entities.inverter_current_164?"":"none",!0!==n.largeFont?"st14":"st4",n.inverterColour,n.inverterCurrent,(e=>qe.handlePopup(e,t.entities.inverter_current_L2)),t.inverter.three_phase&&t.entities?.inverter_current_L2?"":"none",!0!==n.largeFont?"st14":"st4",n.inverterColour,n.inverterCurrentL2,(e=>qe.handlePopup(e,t.entities.inverter_current_L3)),t.inverter.three_phase&&t.entities?.inverter_current_L3?"":"none",!0!==n.largeFont?"st14":"st4",n.inverterColour,n.inverterCurrentL3,(e=>qe.handlePopup(e,t.entities.battery_voltage_183)),"none"!==t.entities.battery_voltage_183&&t.entities.battery_voltage_183&&t.show_battery?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",n.batteryVoltage,(e=>qe.handlePopup(e,t.entities.battery_soc_184)),"none"!==t.entities.battery_soc_184&&t.show_battery?"":"none",n.batteryColour,parseInt(n.stateBatterySoc.state),(e=>qe.handlePopup(e,t.entities.battery_soc_184)),n.batteryColour,!1===n.inverterProg.show||"none"===t.entities.battery_soc_184||!t.show_battery||[_t.GoodweGridMode,_t.Goodwe,_t.Huawei].includes(n.inverterModel)||t.battery.hide_soc?"none":"",n.inverterProg.capacity||0,(e=>qe.handlePopup(e,t.entities.battery_soc_184)),n.batteryColour,t.battery.hide_soc||!t.show_battery?"st12":"st13 st8 left-align",[_t.GoodweGridMode,_t.Goodwe,_t.Huawei].includes(n.inverterModel)&&t.battery?.shutdown_soc&&!t.battery?.shutdown_soc_offgrid?"":"none",n.batteryShutdown||0,(e=>qe.handlePopup(e,t.entities.battery_soc_184)),n.batteryColour,t.battery.hide_soc||!t.show_battery?"st12":"st13 st8 left-align",[_t.GoodweGridMode,_t.Goodwe,_t.Huawei].includes(n.inverterModel)&&t.battery?.shutdown_soc_offgrid?"":"none",(e=>qe.handlePopup(e,t.entities.battery_power_190)),"none"!==t.entities.battery_power_190&&t.show_battery?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",t.battery.auto_scale?"".concat(t.battery.show_absolute?"".concat(Math.abs(parseFloat(qe.convertValue(n.batteryPower,n.decimalPlaces)))," ").concat(qe.convertValue(n.batteryPower,n.decimalPlaces).split(" ")[1]):qe.convertValue(n.batteryPower,n.decimalPlaces)||"0"):"".concat(t.battery.show_absolute?"".concat(Math.abs(n.batteryPower)," W"):"".concat(n.batteryPower||0," W")),(e=>qe.handlePopup(e,t.entities.battery_current_191)),"none"!==t.entities.battery_current_191&&t.show_battery?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",t.battery.show_absolute?Math.abs(qe.toNum(n.stateBatteryCurrent.state,1)):qe.toNum(n.stateBatteryCurrent.state,1),(e=>qe.handlePopup(e,t.entities.inverter_power_175)),t.inverter.three_phase?"174":"178","none"===t.entities.inverter_power_175?"none":"",!0!==n.largeFont?"st14":"st4",n.inverterColour,t.inverter.auto_scale?"".concat(qe.convertValue(n.autoScaledInverterPower,n.decimalPlaces)||0):"".concat(n.autoScaledInverterPower," W"),(e=>qe.handlePopup(e,t.entities.grid_power_169)),t.inverter.three_phase?"216":"209",t.show_grid&&"none"!==t.entities.grid_power_169?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(t.grid.show_absolute?"".concat(Math.abs(parseFloat(qe.convertValue(n.autoScaledGridPower,n.decimalPlaces)))," ").concat(qe.convertValue(n.autoScaledGridPower,n.decimalPlaces).split(" ")[1]):qe.convertValue(n.autoScaledGridPower,n.decimalPlaces)||0):"".concat(t.grid.show_absolute?"".concat(Math.abs(n.autoScaledGridPower)," W"):"".concat(n.autoScaledGridPower||0," W")),(e=>qe.handlePopup(e,t.entities.pv1_voltage_109)),t.show_solar&&t.entities.pv1_voltage_109&&"none"!==t.entities.pv1_voltage_109?"":"none",n.solarColour,qe.toNum(n.statePV1Voltage.state,1),(e=>qe.handlePopup(e,t.entities.pv1_current_110)),t.show_solar&&t.entities.pv1_current_110&&"none"!==t.entities.pv1_current_110?"":"none",n.solarColour,qe.toNum(n.statePV1Current.state,1),(e=>qe.handlePopup(e,t.entities.pv2_voltage_111)),t.show_solar&&t.entities.pv2_voltage_111&&"none"!==t.entities.pv2_voltage_111&&1!==t.solar.mppts?"":"none",n.solarColour,qe.toNum(n.statePV2Voltage.state,1),(e=>qe.handlePopup(e,t.entities.pv2_current_112)),t.show_solar&&t.entities.pv2_current_112&&"none"!==t.entities.pv2_current_112&&1!==t.solar.mppts?"":"none",n.solarColour,qe.toNum(n.statePV2Current.state,1),(e=>qe.handlePopup(e,t.entities.pv3_voltage_113)),t.show_solar&&t.entities.pv3_voltage_113&&"none"!==t.entities.pv3_voltage_113&&![1,2].includes(t.solar.mppts)?"":"none",n.solarColour,qe.toNum(n.statePV3Voltage.state,1),(e=>qe.handlePopup(e,t.entities.pv3_current_114)),t.show_solar&&t.entities.pv3_current_114&&"none"!==t.entities.pv3_current_114&&![1,2].includes(t.solar.mppts)?"":"none",n.solarColour,qe.toNum(n.statePV3Current.state,1),(e=>qe.handlePopup(e,t.entities.pv4_voltage_115)),t.show_solar&&t.entities.pv4_voltage_115&&"none"!==t.entities.pv4_voltage_115&&![1,2,3].includes(t.solar.mppts)?"":"none",n.solarColour,qe.toNum(n.statePV4Voltage.state,1),(e=>qe.handlePopup(e,t.entities.pv4_current_116)),t.show_solar&&t.entities.pv4_current_116&&"none"!==t.entities.pv4_current_116&&![1,2,3].includes(t.solar.mppts)?"":"none",n.solarColour,qe.toNum(n.statePV4Current.state,1),(e=>qe.handlePopup(e,t.entities.battery_temp_182)),t.entities?.battery_temp_182?"st3 left-align":"st12",n.batteryColour,t.show_battery?"":"none",qe.toNum(n.stateBatteryTemp.state,1),(e=>qe.handlePopup(e,t.entities.radiator_temp_91)),4===t.solar?.mppts?"110":"158",4===t.solar?.mppts?"237":"153",n.inverterColour,t.entities?.radiator_temp_91?"":"none",qe.toNum(n.stateRadiatorTemp.state,1),(e=>qe.handlePopup(e,t.entities.dc_transformer_temp_90)),n.inverterColour,t.entities?.dc_transformer_temp_90?"":"none",qe.toNum(n.stateDCTransformerTemp.state,1),(e=>qe.handlePopup(e,t.entities.environment_temp)),t.entities?.environment_temp?"st3 left-align":"st12",n.solarColour,t.show_solar?"":"none",qe.toNum(n.stateEnvironmentTemp.state,1),(e=>qe.handlePopup(e,t.entities.prepaid_units)),t.entities?.prepaid_units?"st3 left-align":"st12",n.gridColour,t.show_grid?"":"none",qe.toNum(n.statePrepaidUnits.state,1)))(t,ba,Ko):this.isLiteCard||this.isCompactCard?((t,e,n)=>W(kn||(kn=ft(["\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 \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 \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 ','\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 \n \n ','\n \n \n ','\n \n \n ','\n kWh\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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 ','\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 V\n \n \n \n ',' Hz\n \n \n \n ',"\n ","\n ",'\n A\n \n \n \n \n ',' V\n \n \n \n \n ',' V\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 \n \n ','\n A\n \n \n \n \n ',"\n A\n \n \n ",'\n \n ',' V\n \n \n \n ',' A\n \n \n \n ',' V\n \n \n \n ',' A\n \n \n \n ',' V\n \n \n \n ',' A\n \n \n \n ',' V\n \n \n \n ',' A\n \n \n \n \n ','°\n \n \n \n AC:\n ','°\n \n \n \n DC:\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 ","\n ","\n ","\n ","\n ","\n ",'\n \n \n ',"\n \n \n
\n
\n
\n "])),n.loadColour,n.loadColour,t.title?W(Sn||(Sn=ft(['\n ',""])),t.title_colour||"inherit",t.title_size||"32px",t.title):"",t.show_solar?-.5:0===n.additionalLoad&&t.show_battery?145.33:80,t.show_solar?t.show_battery?406:2===n.additionalLoad?350:300:t.show_battery&&0!==n.additionalLoad?350:270.67,!1===n.panelMode?"".concat(t.show_solar||t.show_battery?t.show_solar?t.show_solar&&!t.show_battery?2===n.additionalLoad?"350px":"300px":"".concat(n.cardHeight):0!==n.additionalLoad?"330px":"246px":"270px"):"".concat(t.show_solar?"100%":"75%"),!0===n.panelMode?"".concat(n.cardWidth):"100%",n.loadColour,n.solarColour,1===t.solar.mppts?"none":"",t.show_solar?"":"st12",n.batteryColour,t.show_battery?"":"none",n.compactMode?"":"st12",n.compactMode?"348":"329.75",n.compactMode?"50":"70",n.compactMode?"7.5":"10.5",n.compactMode?"7.5":"10.5",n.batteryColour,t.show_battery?"":"none",n.compactMode?"st12":"",n.gridColour,t.show_grid?"":"none",1===t.solar.mppts?"205":"154",n.solarColour,t.show_solar?"":"st12",n.solarColour,t.show_solar&&1!==t.solar.mppts?"":"st12",n.solarColour,!t.show_solar||[1,2].includes(t.solar.mppts)?"st12":"",n.solarColour,!t.show_solar||[1,2,3].includes(t.solar.mppts)?"st12":"",n.loadColour,1===n.additionalLoad?"":"none",n.loadColour,2===n.additionalLoad?"":"none",n.loadColour,2===n.additionalLoad?"":"none",n.loadColour,4===n.additionalLoad?"":"none",n.loadColour,4===n.additionalLoad?"":"none",n.loadColour,4===n.additionalLoad?"":"none",n.loadColour,4===n.additionalLoad?"":"none",n.compactMode?"270":"290",!0!==n.largeFont?"st14":"st4",t.show_battery?"":"none",0===n.batteryEnergy||n.isFloating||0===n.batteryPower?"transparent":"".concat(n.batteryColour),n.batteryDuration,n.compactMode?"270":"290",t.show_battery?"":"none",0===n.batteryEnergy||n.batteryPower<=0||n.isFloating?"transparent":"".concat(n.batteryColour),Ae("common.runtime_to"),n.batteryCapacity,n.formattedResultTime,n.compactMode?"270":"290",t.show_battery?"":"none",0===n.batteryEnergy||n.batteryPower>=0||n.isFloating?"transparent":"".concat(n.batteryColour),Ae("common.to"),n.batteryCapacity,Ae("common.charge"),n.formattedResultTime,n.compactMode?"270":"290",t.show_battery?"":"none",0!==n.batteryEnergy&&n.isFloating?"".concat(n.batteryColour):"transparent",Ae("common.battery_floating"),n.compactMode?"132":"77.2",!0===n.batteryShowDaily&&t.show_battery?"".concat(n.batteryColour):"transparent",Ae("common.daily_charge"),n.compactMode?"132":"77.2",!0===n.batteryShowDaily&&t.show_battery?"".concat(n.batteryColour):"transparent",Ae("common.daily_discharge"),[2,4].includes(n.additionalLoad)?"365":"412",[2,4].includes(n.additionalLoad)?"189":"282.1",n.loadShowDaily?"".concat(n.loadColour):"transparent",Ae("common.daily_load"),!0!==n.gridShowDailyBuy?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",Ae("common.daily_grid_buy"),!0!==n.gridShowDailySell?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",Ae("common.daily_grid_sell"),1===t.solar.display_mode?"":"none",n.solarShowDaily&&t.show_solar?"".concat(n.solarColour):"transparent",Ae("common.daily_solar"),2===t.solar.display_mode?"":"none",n.solarShowDaily&&t.show_solar?"".concat(n.solarColour):"transparent",Ae("common.daily_solar_left"),3===t.solar.display_mode?"":"none",n.solarShowDaily&&t.show_solar?"".concat(n.solarColour):"transparent",Ae("common.total_solar_generation"),1===t.solar.mppts?"212.7":"162",t.show_solar?"":"none",n.solarColour,t.solar.pv1_name,t.show_solar&&1!==t.solar.mppts?"":"none",n.solarColour,t.solar.pv2_name,!t.show_solar||[1,2].includes(t.solar.mppts)?"none":"",n.solarColour,t.solar.pv3_name,!t.show_solar||[1,2,3].includes(t.solar.mppts)?"none":"",n.solarColour,t.solar.pv4_name,n.enableAutarky===bt.No?"none":"",n.enableAutarky===bt.Energy?"st4 st8 left-align":"st12",n.inverterColour,n.autarkyEnergy,n.enableAutarky===bt.No?"none":"",n.enableAutarky===bt.Energy?"st4 st8 left-align":"st12",n.inverterColour,n.ratioEnergy,n.enableAutarky===bt.No?"none":"",n.enableAutarky===bt.Power?"st4 st8 left-align":"st12",n.inverterColour,n.autarkyPower,n.enableAutarky===bt.No?"none":"",n.enableAutarky===bt.Power?"st4 st8 left-align":"st12",n.inverterColour,n.ratioPower,n.enableAutarky===bt.No?"none":"",n.inverterColour,Ae("common.autarky"),n.enableAutarky===bt.No?"none":"",n.inverterColour,Ae("common.ratio"),[1,2].includes(n.additionalLoad)?"":"none",n.loadColour,t.load?.load1_name?"".concat(t.load.load1_name):"",2===n.additionalLoad?"":"none",n.loadColour,t.load?.load2_name?"".concat(t.load.load2_name):"",4===n.additionalLoad?"":"none",n.loadColour,t.load?.load1_name?"".concat(t.load.load1_name):"",4===n.additionalLoad?"":"none",n.loadColour,t.load?.load2_name?"".concat(t.load.load2_name):"",4===n.additionalLoad?"":"none",n.loadColour,t.load?.load3_name?"".concat(t.load.load3_name):"",4===n.additionalLoad?"":"none",n.loadColour,t.load?.load4_name?"".concat(t.load.load4_name):"",t.inverter.three_phase&&t.entities?.load_power_L1?"":"none",n.loadColour,t.load.auto_scale?"".concat(qe.convertValue(n.loadPowerL1,n.decimalPlaces)||0):"".concat(n.loadPowerL1||0," W"),t.inverter.three_phase&&t.entities?.load_power_L2?"":"none",n.loadColour,t.load.auto_scale?"".concat(qe.convertValue(n.loadPowerL2,n.decimalPlaces)||0):"".concat(n.loadPowerL2||0," W"),t.inverter.three_phase&&t.entities?.load_power_L3?"":"none",n.loadColour,t.load.auto_scale?"".concat(qe.convertValue(n.loadPowerL3,n.decimalPlaces)||0):"".concat(n.loadPowerL3||0," W"),t.inverter.three_phase?"":"none",t.show_grid?"st3 left-align":"st12",n.gridColour,t.load.auto_scale?"".concat(qe.convertValue(n.gridPower,n.decimalPlaces)||0):"".concat(n.gridPower||0," W"),t.inverter.three_phase&&t.entities?.grid_ct_power_L2?"":"none",t.show_grid?"st3 left-align":"st12",n.gridColour,t.load.auto_scale?"".concat(qe.convertValue(n.gridPowerL2,n.decimalPlaces)||0):"".concat(n.gridPowerL2||0," W"),t.inverter.three_phase&&t.entities?.grid_ct_power_L3?"":"none",t.show_grid?"st3 left-align":"st12",n.gridColour,t.load.auto_scale?"".concat(qe.convertValue(n.gridPowerL3,n.decimalPlaces)||0):"".concat(n.gridPowerL3||0," W"),t.battery.show_remaining_energy?"311":"320",!t.show_battery||n.compactMode?"none":"",n.batteryColour,n.batteryStateMsg,n.compactMode?"270":t.entities?.battery_status?"169":"193",n.compactMode?"338":"323",t.entities?.battery_status||n.compactMode?"st3 left-align":"st3",t.show_battery&&t.battery.show_remaining_energy?"":"none",n.batteryColour,qe.toNum(n.batteryEnergy*(parseFloat(n.stateBatterySoc.state)/100)/1e3,2),n.compactMode?"348.5":"368.5",n.batteryColour,t.battery.hide_soc||!t.show_battery?"st12":"st14 left-align",[_t.GoodweGridMode,_t.Goodwe,_t.Huawei].includes(n.inverterModel)&&t.battery?.shutdown_soc_offgrid?"":"none",n.batteryShutdown,n.compactMode?"348.5":"368.5",n.batteryColour,t.battery.hide_soc||!t.show_battery?"st12":"st14 left-align",[_t.GoodweGridMode,_t.Goodwe,_t.Huawei].includes(n.inverterModel)&&t.battery?.shutdown_soc_offgrid?"":"none",n.shutdownOffGrid,n.inverterStateColour,n.compactMode?"238.5":"162",n.compactMode?"326":t.battery.show_remaining_energy?"310":"319","none"!==t.entities?.battery_status&&t.entities?.battery_status&&t.show_battery?"":"none",n.batteryStateColour,1===t.solar.mppts?"M 239.23 84 L 239 190":"M 187 84 L 187 122 Q 187 132 195 132 L 205 132.03",t.show_solar?"":"st12",n.solarColour,n.pv1LineWidth,Math.min(2+n.pv1LineWidth+Math.max(n.minLineWidth-2,0),8),t.show_solar?"":"st12",Math.round(n.pv1PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv1,t.show_solar&&1!==t.solar.mppts?"":"st12",n.solarColour,n.pv2LineWidth,Math.min(2+n.pv2LineWidth+Math.max(n.minLineWidth-2,0),8),t.show_solar&&1!==t.solar.mppts?"":"st12",Math.round(n.pv2PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv2,!t.show_solar||[1,2].includes(t.solar.mppts)?"st12":"",n.solarColour,n.pv3LineWidth,Math.min(2+n.pv3LineWidth+Math.max(n.minLineWidth-2,0),8),!t.show_solar||[1,2].includes(t.solar.mppts)?"st12":"",Math.round(n.pv3PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv3,!t.show_solar||[1,2,3].includes(t.solar.mppts)?"st12":"",n.solarColour,n.pv4LineWidth,Math.min(2+n.pv4LineWidth+Math.max(n.minLineWidth-2,0),8),!t.show_solar||[1,2,3].includes(t.solar.mppts)?"st12":"",Math.round(n.pv4PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv4,n.compactMode?"M 239 250 L 239 290":"M 239 250 L 239 324",t.show_battery?"":"st12",n.batteryColour,n.batLineWidth,Math.min(2+n.batLineWidth+Math.max(n.minLineWidth-2,0),8),t.show_battery?"":"st12",n.batteryPower<0||0===n.batteryPower?"transparent":"".concat(n.batteryColour),n.durationCur.battery,Math.min(2+n.batLineWidth+Math.max(n.minLineWidth-2,0),8),t.show_battery?"":"st12",n.batteryPower>0||0===n.batteryPower?"transparent":"".concat(n.batteryColour),n.durationCur.battery,t.show_solar&&1!==t.solar.mppts?"":"st12",n.solarColour,n.solarLineWidth,Math.min(2+n.solarLineWidth+Math.max(n.minLineWidth-2,0),8),t.show_solar&&1!==t.solar.mppts?"":"st12",0===n.totalPV?"transparent":"".concat(n.solarColour),n.durationCur.solar,n.gridColour,n.gridLineWidth,t.show_grid?"":"none",Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower<0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",n.durationCur.grid,Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower>0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",n.durationCur.grid,n.gridColour,n.gridLineWidth,t.show_grid?"":"none",Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower<0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",n.durationCur.grid,Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower>0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),t.show_grid?"":"none",n.durationCur.grid,n.loadColour,n.loadLineWidth,Math.min(2+n.loadLineWidth+Math.max(n.minLineWidth-2,0),8),0===n.essentialPower?"transparent":"".concat(n.loadColour),n.durationCur.load,n.loadColour,n.loadLineWidth,Math.min(2+n.loadLineWidth+Math.max(n.minLineWidth-2,0),8),0===n.essentialPower?"transparent":"".concat(n.loadColour),n.durationCur.load,1===n.additionalLoad?"":"st12",n.loadColour,[2,4].includes(n.additionalLoad)?"":"st12",n.loadColour,[2,4].includes(n.additionalLoad)?"":"st12",n.loadColour,"oven"===n.iconEssentialLoad1&&[1,2].includes(n.additionalLoad)?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"oven"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"pump"===n.iconEssentialLoad1&&[1,2].includes(n.additionalLoad)?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"pump"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"aircon"===n.iconEssentialLoad1&&[1,2].includes(n.additionalLoad)?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"aircon"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"boiler"===n.iconEssentialLoad1&&[1,2].includes(n.additionalLoad)?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"boiler"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,[0,4].includes(n.additionalLoad)?"none":"",n.iconEssentialLoad1,[0,1,4].includes(n.additionalLoad)?"none":"",n.iconEssentialLoad2,4===n.additionalLoad?"":"none",n.iconEssentialLoad1,4===n.additionalLoad?"":"none",n.iconEssentialLoad2,4===n.additionalLoad?"":"none",n.iconEssentialLoad3,4===n.additionalLoad?"":"none",n.iconEssentialLoad4,t.show_solar?"":"st12",n.solarColour,n.compactMode?"212.5":"232.5",Number(n.pvPercentageBat)>0?n.solarColour:Number(n.gridPercentageBat)>0?n.gridColour:n.batteryColour,n.pvPercentageBat<2?0:n.pvPercentageBat,Number(n.pvPercentageBat)>0?n.solarColour:Number(n.gridPercentageBat)>0?n.gridColour:n.batteryColour,n.pvPercentageBat<2?0:n.pvPercentageBat,Number(n.gridPercentageBat)>0?n.gridColour:n.batteryColour,Number(n.pvPercentageBat<2?0:n.pvPercentageBat)+Number(n.gridPercentageBat<2?0:n.gridPercentageBat),Number(n.gridPercentageBat)>0?"".concat(n.gridColour):"".concat(n.batteryColour),Number(n.pvPercentageBat<2?0:n.pvPercentageBat)+Number(n.gridPercentageBat<2?0:n.gridPercentageBat),100===Number(n.pvPercentageBat)?n.solarColour:100===Number(n.gridPercentageBat)?n.gridColour:n.batteryColour,100===Number(n.pvPercentageBat)?n.solarColour:100===Number(n.gridPercentageBat)?n.gridColour:n.batteryColour,t.show_battery?"":"st12",t.battery.dynamic_colour?"url(#bLg)":n.batteryColour,t.battery.linear_gradient?n.battery0:n.batteryIcon,n.compactMode?"212.5":"232.5",n.stopColour,t.show_battery?"":"st12",t.battery.linear_gradient?"url(#sLg)":n.batteryColour,t.battery.linear_gradient?"":"none",n.batteryCharge,(e=>qe.handlePopup(e,t.entities.grid_connected_status_194)),["off","0","off-grid","off grid","offgrid"].includes(n.gridStatus.toLowerCase())?"st12":"",n.gridColour,!t.show_grid||n.totalGridPower<0?"none":"",["on","1","on-grid","on grid","ongrid"].includes(n.gridStatus.toLowerCase())?"st12":"",n.gridOffColour,t.show_grid?"":"none",["off","0","off-grid","off grid"].includes(n.gridStatus.toLowerCase())?"st12":"",n.gridColour,!t.show_grid||n.totalGridPower>=0?"none":"",1===n.essIconSize?"405":"402",1===n.essIconSize?"186":"177.5",1===n.essIconSize?"75":"79",1===n.essIconSize?"75":"79",Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.pvPercentage)>0?n.solarColour:n.gridColour,Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),Number(n.pvPercentage)>0?"".concat(n.solarColour):"".concat(n.gridColour),Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,t.load.dynamic_colour?"url(#Lg)":n.loadColour,n.essIcon,n.genericInverterImage?1:0,n.inverterColour,(e=>qe.handlePopup(e,t.entities.use_timer_248)),"on"==n.stateUseTimer.state&&!1!==n.enableTimer?"":"none",n.inverterColour,"off"==n.stateUseTimer.state&&!1!==n.enableTimer?"":"none",n.inverterColour,"off"==n.stateUseTimer.state&&!1!==n.enableTimer?"":"none",n.inverterColour,Ae("common.timer_off"),"on"==n.stateUseTimer.state&&!1!==n.enableTimer?"":"none",n.inverterColour,Ae("common.timer_on"),(e=>qe.handlePopup(e,t.entities.priority_load_243)),"off"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,"on"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,"off"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,Ae("common.priority_batt"),"on"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,Ae("common.priority_load"),(e=>qe.handlePopup(e,t.entities.solar_sell_247)),t.entities.solar_sell_247&&"off"!==n.stateSolarSell.state&&"0"!==n.stateSolarSell.state&&t.show_solar&&["1","on"].includes(n.stateSolarSell.state)?"":"none",n.solarColour,t.entities.solar_sell_247&&"on"!==n.stateSolarSell.state&&"1"!==n.stateSolarSell.state&&t.show_solar&&["0","off"].includes(n.stateSolarSell.state)?"":"none",n.solarColour,n.genericInverterImage?"st12":"",e,(t=>qe.handlePopup(t,n.inverterProg.entityID)),!1===n.inverterProg.show||"none"===t.entities.use_timer_248?"none":"","none"===n.inverterProg.charge?"st12":"",n.inverterColour,!1===n.inverterProg.show||"none"===t.entities.use_timer_248?"none":"","none"===n.inverterProg.charge?"":"st12",n.inverterColour,(e=>qe.handlePopup(e,t.entities.day_battery_charge_70)),n.compactMode?"132":"77.2",!0===n.batteryShowDaily&&t.show_battery?"":"none",n.batteryColour,t.battery.auto_scale?qe.convertValueNew(n.stateDayBatteryCharge.state,n.stateDayBatteryCharge.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayBatteryCharge.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.day_pv_energy_108)),1===t.solar.display_mode?"":"none",n.solarShowDaily&&t.show_solar?"".concat(n.solarColour):"transparent",t.solar.auto_scale?qe.convertValueNew(n.stateDayPVEnergy.state,n.stateDayPVEnergy.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayPVEnergy.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.day_pv_energy_108)),2===t.solar.display_mode?"":"none",n.solarShowDaily&&t.show_solar?"".concat(n.solarColour):"transparent",t.solar.auto_scale?"".concat(qe.convertValueNew(n.stateDayPVEnergy.state,n.stateDayPVEnergy.attributes?.unit_of_measurement,1)," / ").concat(n.remainingSolar):"".concat(qe.toNum(n.stateDayPVEnergy.state,1)," kWh / ").concat(n.remainingSolar),(e=>qe.handlePopup(e,t.entities.day_pv_energy_108)),3===t.solar.display_mode?"":"none",n.solarShowDaily&&t.show_solar?"".concat(n.solarColour):"transparent",t.solar.auto_scale?"".concat(qe.convertValueNew(n.stateDayPVEnergy.state,n.stateDayPVEnergy.attributes?.unit_of_measurement,1)," / ").concat(n.totalSolarGeneration):"".concat(qe.toNum(n.stateDayPVEnergy.state,1)," kWh / ").concat(n.totalSolarGeneration),(e=>qe.handlePopup(e,t.entities.day_battery_discharge_71)),n.compactMode?"132":"77.2",!0===n.batteryShowDaily&&t.show_battery?"":"none",n.batteryColour,t.battery.auto_scale?qe.convertValueNew(n.stateDayBatteryDischarge.state,n.stateDayBatteryDischarge.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayBatteryDischarge.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.day_load_energy_84)),[2,4].includes(n.additionalLoad)?"365":"412",[2,4].includes(n.additionalLoad)?"175":"267.9",n.loadShowDaily?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateDayLoadEnergy.state,n.stateDayLoadEnergy.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayLoadEnergy.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.day_grid_import_76)),t.show_grid&&!0===n.gridShowDailyBuy?"":"none",n.gridColour,t.grid.auto_scale?qe.convertValueNew(n.stateDayGridImport.state,n.stateDayGridImport.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayGridImport.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.day_grid_export_77)),t.show_grid&&!0===n.gridShowDailySell?"":"none",n.gridColour,t.grid.auto_scale?qe.convertValueNew(n.stateDayGridExport.state,n.stateDayGridExport.attributes?.unit_of_measurement,1):"".concat(qe.toNum(n.stateDayGridExport.state,1)," kWh"),(e=>qe.handlePopup(e,t.entities.inverter_voltage_154)),"none"!==t.entities.inverter_voltage_154&&t.entities.inverter_voltage_154?"":"none",n.inverterColour,n.inverterVoltage,t.inverter.three_phase&&t.entities?.inverter_voltage_L2?"| "+n.inverterVoltageL2:"",t.inverter.three_phase&&t.entities?.inverter_voltage_L3?"| "+n.inverterVoltageL3:"",(e=>qe.handlePopup(e,t.entities.load_frequency_192)),"none"!==t.entities.load_frequency_192&&t.entities.load_frequency_192?"":"none",n.inverterColour,n.loadFrequency,(e=>qe.handlePopup(e,t.entities.inverter_current_164)),"none"!==t.entities.inverter_current_164&&t.entities.inverter_current_164?"":"none",n.inverterColour,n.inverterCurrent,t.inverter.three_phase&&t.entities?.inverter_current_L2?"| "+n.inverterCurrentL2:"",t.inverter.three_phase&&t.entities?.inverter_current_L3?"| "+n.inverterCurrentL3:"",(e=>qe.handlePopup(e,t.entities.battery_voltage_183)),"none"!==t.entities.battery_voltage_183&&t.entities.battery_voltage_183&&t.show_battery&&!n.compactMode?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",n.batteryVoltage,(e=>qe.handlePopup(e,t.entities.battery_voltage_183)),"none"!==t.entities.battery_voltage_183&&t.entities.battery_voltage_183&&t.show_battery&&n.compactMode?"":"none",n.batteryColour,n.compactMode?"st3 left-align":"st12",n.batteryVoltage,(e=>qe.handlePopup(e,t.entities.battery_soc_184)),n.compactMode?"270":"290","none"!==t.entities.battery_soc_184&&t.show_battery?"":"none",n.batteryColour,parseInt(n.stateBatterySoc.state),(e=>qe.handlePopup(e,t.entities.battery_soc_184)),n.compactMode?"335":"355",n.batteryColour,!1===n.inverterProg.show||"none"===t.entities.battery_soc_184||!t.show_battery||[_t.GoodweGridMode,_t.Goodwe,_t.Huawei].includes(n.inverterModel)||t.battery.hide_soc?"none":"",n.inverterProg.capacity||0,(e=>qe.handlePopup(e,t.entities.battery_soc_184)),n.compactMode?"335":"355",n.batteryColour,t.battery.hide_soc||!t.show_battery?"st12":"st13 st8 left-align",[_t.GoodweGridMode,_t.Goodwe,_t.Huawei].includes(n.inverterModel)&&t.battery?.shutdown_soc&&!t.battery?.shutdown_soc_offgrid?"":"none",n.batteryShutdown||0,(e=>qe.handlePopup(e,t.entities.battery_soc_184)),n.compactMode?"335":"355",n.batteryColour,t.battery.hide_soc||!t.show_battery?"st12":"st13 st8 left-align",[_t.GoodweGridMode,_t.Goodwe,_t.Huawei].includes(n.inverterModel)&&t.battery.shutdown_soc_offgrid?"":"none",(e=>qe.handlePopup(e,t.entities.battery_power_190)),n.compactMode?"239":"193",n.compactMode?"307":"386","none"!==t.entities.battery_power_190&&t.show_battery?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",t.battery.auto_scale?"".concat(t.battery.show_absolute?"".concat(Math.abs(parseFloat(qe.convertValue(n.batteryPower,n.decimalPlaces)))," ").concat(qe.convertValue(n.batteryPower,n.decimalPlaces).split(" ")[1]):qe.convertValue(n.batteryPower,n.decimalPlaces)||"0"):"".concat(t.battery.show_absolute?"".concat(Math.abs(n.batteryPower)," W"):"".concat(n.batteryPower||0," W")),(e=>qe.handlePopup(e,t.entities.battery_current_191)),t.entities.battery_current_191&&"none"!==t.entities.battery_current_191&&t.show_battery&&!n.compactMode?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",t.battery.show_absolute?Math.abs(qe.toNum(n.stateBatteryCurrent.state,1)):qe.toNum(n.stateBatteryCurrent.state,1),(e=>qe.handlePopup(e,t.entities.battery_current_191)),t.entities.battery_current_191&&"none"!==t.entities.battery_current_191&&t.show_battery&&n.compactMode?"":"none",n.batteryColour,n.compactMode?"st3 left-align":"st12",t.battery.show_absolute?Math.abs(qe.toNum(n.stateBatteryCurrent.state,1)):qe.toNum(n.stateBatteryCurrent.state,1),t.inverter.three_phase?t.entities?.grid_ct_power_total?U(In||(In=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.grid_ct_power_total)),t.show_grid&&"none"!==t.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(t.grid.show_absolute?"".concat(Math.abs(parseFloat(qe.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(qe.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):qe.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(t.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," W"):"".concat(n.totalGridPower||0," W"))):U(Dn||(Dn=ft(['\n \n ',"\n "])),t.show_grid&&"none"!==t.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(t.grid.show_absolute?"".concat(Math.abs(parseFloat(qe.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(qe.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):qe.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(t.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," W"):"".concat(n.totalGridPower||0," W"))):U(On||(On=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.grid_ct_power_172)),t.show_grid&&"none"!==t.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(t.grid.show_absolute?"".concat(Math.abs(parseFloat(qe.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(qe.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):qe.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(t.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," W"):"".concat(n.totalGridPower||0," W"))),(e=>qe.handlePopup(e,t.entities.pv1_voltage_109)),1===t.solar.mppts?"244.7":"194",t.show_solar&&t.entities.pv1_voltage_109&&"none"!==t.entities.pv1_voltage_109?"":"none",n.solarColour,qe.toNum(n.statePV1Voltage.state,1),(e=>qe.handlePopup(e,t.entities.pv1_current_110)),1===t.solar.mppts?"244.7":"194",t.show_solar&&t.entities.pv1_current_110&&"none"!==t.entities.pv1_current_110?"":"none",n.solarColour,qe.toNum(n.statePV1Current.state,1),(e=>qe.handlePopup(e,t.entities.pv2_voltage_111)),t.show_solar&&t.entities.pv2_voltage_111&&"none"!==t.entities.pv2_voltage_111&&1!==t.solar.mppts?"":"none",n.solarColour,qe.toNum(n.statePV2Voltage.state,1),(e=>qe.handlePopup(e,t.entities.pv2_current_112)),t.show_solar&&t.entities.pv2_current_112&&"none"!==t.entities.pv2_current_112&&1!==t.solar.mppts?"":"none",n.solarColour,qe.toNum(n.statePV2Current.state,1),(e=>qe.handlePopup(e,t.entities.pv3_voltage_113)),t.show_solar&&t.entities.pv3_voltage_113&&"none"!==t.entities.pv3_voltage_113&&![1,2].includes(t.solar.mppts)?"":"none",n.solarColour,qe.toNum(n.statePV3Voltage.state,1),(e=>qe.handlePopup(e,t.entities.pv3_current_114)),t.show_solar&&t.entities.pv3_current_114&&"none"!==t.entities.pv3_current_114&&![1,2].includes(t.solar.mppts)?"":"none",n.solarColour,qe.toNum(n.statePV3Current.state,1),(e=>qe.handlePopup(e,t.entities.pv4_voltage_115)),t.show_solar&&t.entities.pv4_voltage_115&&"none"!==t.entities.pv4_voltage_115&&![1,2,3].includes(t.solar.mppts)?"":"none",n.solarColour,qe.toNum(n.statePV4Voltage.state,1),(e=>qe.handlePopup(e,t.entities.pv4_current_116)),t.show_solar&&t.entities.pv4_current_116&&"none"!==t.entities.pv4_current_116&&![1,2,3].includes(t.solar.mppts)?"":"none",n.solarColour,qe.toNum(n.statePV4Current.state,1),(e=>qe.handlePopup(e,t.entities.battery_temp_182)),n.compactMode?"205":"250",n.compactMode?"332":"324.5",t.entities?.battery_temp_182?"st3 left-align":"st12",n.batteryColour,t.show_battery?"":"none",qe.toNum(n.stateBatteryTemp.state,1),(e=>qe.handlePopup(e,t.entities.radiator_temp_91)),n.inverterColour,t.entities?.radiator_temp_91?"":"none",qe.toNum(n.stateRadiatorTemp.state,1),(e=>qe.handlePopup(e,t.entities.dc_transformer_temp_90)),n.inverterColour,t.entities?.dc_transformer_temp_90?"":"none",qe.toNum(n.stateDCTransformerTemp.state,1),(e=>qe.handlePopup(e,t.entities.environment_temp)),t.entities?.environment_temp?"st3 left-align":"st12",n.solarColour,t.show_solar?"":"none",qe.toNum(n.stateEnvironmentTemp.state,1),(e=>qe.handlePopup(e,t.entities.essential_load1_extra)),t.entities?.essential_load1_extra&&[1,2].includes(n.additionalLoad)?"":"none",n.loadColour,qe.toNum(n.stateEssentialLoad1Extra.state,1),n.stateEssentialLoad1Extra.attributes?.unit_of_measurement,(e=>qe.handlePopup(e,t.entities.essential_load2_extra)),t.entities?.essential_load2_extra&&2===n.additionalLoad?"":"none",n.loadColour,qe.toNum(n.stateEssentialLoad2Extra.state,1),n.stateEssentialLoad2Extra.attributes?.unit_of_measurement,n.totalGridPower>=0?U(Hn||(Hn=ft(['\n \n \n '," ","\n \n "])),(e=>qe.handlePopup(e,t.entities.energy_cost_buy)),t.show_grid?"st3 left-align":"st12",n.gridColour,t.entities?.energy_cost_buy?"":"none",n.energyCost,n.stateEnergyCostBuy.attributes?.unit_of_measurement):U(zn||(zn=ft(['\n \n \n '," ","\n \n "])),(e=>qe.handlePopup(e,t.entities.energy_cost_sell)),t.show_grid?"st3 left-align":"st12",n.gridColour,t.entities?.energy_cost_sell?"":"none",n.energyCost,n.stateEnergyCostSell.attributes?.unit_of_measurement),t.entities?.pv_total?U(Bn||(Bn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.pv_total)),!0!==n.largeFont?"st14":"st4",t.show_solar&&1!==t.solar.mppts?"":"none",n.solarColour,t.solar.auto_scale?t.entities?.pv_total?qe.convertValueNew(n.totalPV,n.statePVTotal.attributes?.unit_of_measurement,n.decimalPlaces):qe.convertValue(n.totalPV,n.decimalPlaces)||0:"".concat(qe.toNum(n.totalPV||0,0)," W")):U(Gn||(Gn=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",t.show_solar&&1!==t.solar.mppts?"":"none",n.solarColour,t.solar.auto_scale?t.entities?.pv_total?qe.convertValueNew(n.totalPV,n.statePVTotal.attributes?.unit_of_measurement,n.decimalPlaces):qe.convertValue(n.totalPV,n.decimalPlaces)||0:"".concat(qe.toNum(n.totalPV||0,0)," W")),t.entities?.pv1_power_186?U(Vn||(Vn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.pv1_power_186)),1===t.solar.mppts?"238.8":"188.1",!0!==n.largeFont?"st14":"st4",t.show_solar?"":"none",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV1Power.state,n.statePV1Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV1Power.state,0)," W")):U(Rn||(Rn=ft(['\n \n ',"\n "])),1===t.solar.mppts?"238.8":"188.1",!0!==n.largeFont?"st14":"st4",t.show_solar&&"none"!==t.entities.pv1_power_186?"":"none",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV1Power.state,n.statePV1Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV1Power.state,0)," W")),t.entities?.pv2_power_187?U(qn||(qn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.pv2_power_187)),!0!==n.largeFont?"st14":"st4",t.show_solar&&1!==t.solar.mppts?"":"none",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV2Power.state,n.statePV2Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV2Power.state,0)," W")):U(jn||(jn=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",t.show_solar&&"none"!==t.entities.pv2_power_187&&1!==t.solar.mppts?"":"none",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV2Power.state,n.statePV2Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV2Power.state,0)," W")),t.entities?.pv3_power_188?U(Zn||(Zn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.pv3_power_188)),!0!==n.largeFont?"st14":"st4",!t.show_solar||[1,2].includes(t.solar.mppts)?"none":"",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV3Power.state,n.statePV3Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV3Power.state,0)," W")):U(Wn||(Wn=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",!t.show_solar||"none"===t.entities.pv3_power_188||[1,2].includes(t.solar.mppts)?"none":"",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV3Power.state,n.statePV3Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV3Power.state,0)," W")),t.entities?.pv4_power_189?U(Un||(Un=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.pv4_power_189)),!0!==n.largeFont?"st14":"st4",!t.show_solar||[1,2,3].includes(t.solar.mppts)?"none":"",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV4Power.state,n.statePV4Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV4Power.state,0)," W")):U(Fn||(Fn=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",!t.show_solar||"none"===t.entities.pv4_power_189||[1,2,3].includes(t.solar.mppts)?"none":"",n.solarColour,t.solar.auto_scale?qe.convertValueNew(n.statePV4Power.state,n.statePV4Power.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.statePV4Power.state,0)," W")),t.entities?.essential_power&&"none"!==t.entities.essential_power?U(Qn||(Qn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.essential_power)),!0!==n.largeFont?"st14":"st4",n.loadColour,t.load.auto_scale?"".concat(qe.convertValue(n.essentialPower,n.decimalPlaces)||0):"".concat(n.essentialPower||0," W")):U(Xn||(Xn=ft(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",n.loadColour,t.load.auto_scale?"".concat(qe.convertValue(n.essentialPower,n.decimalPlaces)||0):"".concat(n.essentialPower||0," W")),t.entities?.essential_load1?U(Yn||(Yn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.essential_load1)),[1,2].includes(n.additionalLoad)?"":"none",!0!==n.largeFont?"st14":"st4",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad1.state,n.stateEssentialLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad1.state,0)||0," ").concat(void 0!==n.stateEssentialLoad1.attributes?.unit_of_measurement?n.stateEssentialLoad1.attributes?.unit_of_measurement:"")):U(Jn||(Jn=ft(['\n \n ',"\n "])),[1,2].includes(n.additionalLoad)?"":"none",!0!==n.largeFont?"st14":"st4",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad1.state,n.stateEssentialLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad1.state,0)||0," ").concat(void 0!==n.stateEssentialLoad1.attributes?.unit_of_measurement?n.stateEssentialLoad1.attributes?.unit_of_measurement:"")),t.entities?.essential_load2?U(Kn||(Kn=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.essential_load2)),2===n.additionalLoad?"":"none",!0!==n.largeFont?"st14":"st4",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad2.state,n.stateEssentialLoad2.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad2.state,0)||0," ").concat(void 0!==n.stateEssentialLoad2.attributes?.unit_of_measurement?n.stateEssentialLoad2.attributes?.unit_of_measurement:"")):U($n||($n=ft(['\n \n ',"\n "])),2===n.additionalLoad?"":"none",!0!==n.largeFont?"st14":"st4",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad2.state,n.stateEssentialLoad2.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad2.state,0)||0," ").concat(void 0!==n.stateEssentialLoad2.attributes?.unit_of_measurement?n.stateEssentialLoad2.attributes?.unit_of_measurement:"")),t.entities?.essential_load1?U(ta||(ta=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.essential_load1)),4===n.additionalLoad?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad1.state,n.stateEssentialLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad1.state,0)||0," ").concat(void 0!==n.stateEssentialLoad1.attributes?.unit_of_measurement?n.stateEssentialLoad1.attributes?.unit_of_measurement:"")):U(ea||(ea=ft(['\n \n ',"\n "])),4===n.additionalLoad?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad1.state,n.stateEssentialLoad1.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad1.state,0)||0," ").concat(void 0!==n.stateEssentialLoad1.attributes?.unit_of_measurement?n.stateEssentialLoad1.attributes?.unit_of_measurement:"")),t.entities?.essential_load2?U(na||(na=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.essential_load2)),4===n.additionalLoad?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad2.state,n.stateEssentialLoad2.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad2.state,0)||0," ").concat(void 0!==n.stateEssentialLoad2.attributes?.unit_of_measurement?n.stateEssentialLoad2.attributes?.unit_of_measurement:"")):U(aa||(aa=ft(['\n \n ',"\n "])),4===n.additionalLoad?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad2.state,n.stateEssentialLoad2.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad2.state,0)||0," ").concat(void 0!==n.stateEssentialLoad2.attributes?.unit_of_measurement?n.stateEssentialLoad2.attributes?.unit_of_measurement:"")),t.entities?.essential_load3?U(oa||(oa=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.essential_load3)),4===n.additionalLoad?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad3.state,n.stateEssentialLoad3.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad3.state,0)||0," ").concat(void 0!==n.stateEssentialLoad3.attributes?.unit_of_measurement?n.stateEssentialLoad3.attributes?.unit_of_measurement:"")):U(ra||(ra=ft(['\n \n ',"\n "])),4===n.additionalLoad?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad4.state,n.stateEssentialLoad4.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad3.state,0)||0," ").concat(void 0!==n.stateEssentialLoad3.attributes?.unit_of_measurement?n.stateEssentialLoad3.attributes?.unit_of_measurement:"")),t.entities?.essential_load4?U(ia||(ia=ft(['\n \n \n ',"\n \n "])),(e=>qe.handlePopup(e,t.entities.essential_load4)),4===n.additionalLoad?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad4.state,n.stateEssentialLoad4.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad4.state,0)||0," ").concat(void 0!==n.stateEssentialLoad4.attributes?.unit_of_measurement?n.stateEssentialLoad4.attributes?.unit_of_measurement:"")):U(sa||(sa=ft(['\n \n ',"\n "])),4===n.additionalLoad?"":"none",n.loadColour,t.load.auto_scale?qe.convertValueNew(n.stateEssentialLoad4.state,n.stateEssentialLoad4.attributes?.unit_of_measurement,n.decimalPlaces):"".concat(qe.toNum(n.stateEssentialLoad4.state,0)||0," ").concat(void 0!==n.stateEssentialLoad4.attributes?.unit_of_measurement?n.stateEssentialLoad4.attributes?.unit_of_measurement:"")),(e=>qe.handlePopup(e,t.entities.prepaid_units)),t.entities?.prepaid_units?"st3":"st12",n.gridColour,t.show_grid?"":"none",qe.toNum(n.statePrepaidUnits.state,1)))(t,ba,Ko):void 0}getEntity(t,e={state:"0",attributes:{unit_of_measurement:""}}){let n;const a=String(t).split("."),o=a.length>0?a[0]:null,r=a.length>1?a[1]:null;o&&r?n=this._config[o][r]:o&&(n=this._config.entities[o]);const i=n?this.hass.states[n]:void 0;return Ea(void 0!==i?i:e||{state:void 0})}changeAnimationSpeed(t,e){const n=e>=1?qe.toNum(e,3):1,a=this["".concat(t,"Flow")];this.durationCur[t]=n,a&&this.durationPrev[t]!=n&&a.setCurrentTime(a.getCurrentTime()*(n/this.durationPrev[t])),this.durationPrev[t]=this.durationCur[t]}get isCompactCard(){return this._config.cardstyle==xt.Compact}get isLiteCard(){return this._config.cardstyle==xt.Lite}get isFullCard(){return this._config.cardstyle==xt.Full}colourConvert(t){return t&&Array.isArray(t)?"rgb(".concat(t,")"):t}dynamicLineWidth(t,e,n,a=1){let o;return o=this._config.dynamic_line_width?Math.min(a+Math.min(t/e,1)*n,8):Math.min(a,8),o}setConfig(t){if(t.show_battery&&!t.battery)throw Error(Ae("errors.battery.bat"));if(t.show_battery&&!t.battery.shutdown_soc)throw new Error(Ae("errors.battery.shutdown_soc"));if(t.show_battery&&t.battery.show_daily&&(!t.entities.day_battery_charge_70||!t.entities.day_battery_discharge_71))throw Error(Ae("errors.battery.show_daily"));if(t.show_solar&&!t.solar)throw Error(Ae("errors.solar.sol"));if(t.show_solar&&!t.solar.mppts)throw Error(Ae("errors.solar.mppts"));if(t&&t.solar&&t.show_solar&&t.solar.show_daily&&!t.entities.day_pv_energy_108)throw Error(Ae("errors.solar.show_daily"));if(t&&t.grid&&t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(Ae("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(Ae("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(Ae("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172","pv1_power_186"];for(const n of e)if("pv1_power_186"===n&&t.show_solar&&!t.entities[n]&&!t.entities[n])throw new Error("".concat(Ae("errors.missing_entity")," e.g: ").concat(n,": sensor.example"));const n=t;this._config=Oe({},Le,n)}getCardSize(){return 2}},e([yt()],t.SunsynkPowerFlowCard.prototype,"hass",void 0),e([yt()],t.SunsynkPowerFlowCard.prototype,"_config",void 0),e([mt("#grid-flow")],t.SunsynkPowerFlowCard.prototype,"gridFlow",void 0),e([mt("#grid1-flow")],t.SunsynkPowerFlowCard.prototype,"grid1Flow",void 0),e([mt("#solar-flow")],t.SunsynkPowerFlowCard.prototype,"solarFlow",void 0),e([mt("#pv1-flow")],t.SunsynkPowerFlowCard.prototype,"pv1Flow",void 0),e([mt("#pv2-flow")],t.SunsynkPowerFlowCard.prototype,"pv2Flow",void 0),e([mt("#pv3-flow")],t.SunsynkPowerFlowCard.prototype,"pv3Flow",void 0),e([mt("#pv4-flow")],t.SunsynkPowerFlowCard.prototype,"pv4Flow",void 0),e([mt("#battery-flow")],t.SunsynkPowerFlowCard.prototype,"batteryFlow",void 0),e([mt("#load-flow")],t.SunsynkPowerFlowCard.prototype,"loadFlow",void 0),e([mt("#aux-flow")],t.SunsynkPowerFlowCard.prototype,"auxFlow",void 0),e([mt("#ne-flow")],t.SunsynkPowerFlowCard.prototype,"neFlow",void 0),e([mt("#ne1-flow")],t.SunsynkPowerFlowCard.prototype,"ne1Flow",void 0),t.SunsynkPowerFlowCard=e([ut("sunsynk-power-flow-card")],t.SunsynkPowerFlowCard);try{customElements.define("content-card-editor",Re)}catch(t){}window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!0,description:Ae("common.description"),configurable:!0})})); +function(e){return class extends e{createRenderRoot(){const e=this.constructor,{registry:t,elementDefinitions:n,shadowRootOptions:o}=e;n&&!t&&(e.registry=new CustomElementRegistry,Object.entries(n).forEach((([t,n])=>e.registry.define(t,n))));const a=this.renderOptions.creationScope=this.attachShadow({...o,customElements:e.registry});return l(a,this.constructor.elementStyles),a}}}(de)){constructor(){super(...arguments),this._computeLabelCallback=e=>At("config.".concat(e.name))??e.name}setConfig(e){this._config={...this._config,...e}}render(){return this.hass&&this._config?W(Zt||(Zt=fe(["\n \n "])),this.hass,this._config,this._computeLabelCallback,[{type:"expandable",title:this._title("title"),schema:[{type:"grid",schema:[{name:"title",selector:{text:{}}},{name:"title_colour",selector:{color_rgb:{}}},{name:"title_size",selector:{text:{}}}]}]},{name:"cardstyle",selector:{select:{options:Object.values(xe).map((e=>({label:Wt.capitalize(e),value:e})))}}},{type:"expandable",title:this._title("general"),schema:[{type:"grid",schema:[{name:"large_font",selector:{boolean:{}}},{name:"panel_mode",selector:{boolean:{}}},{name:"card_height",selector:{text:{}}},{name:"card_width",selector:{text:{}}},{name:"show_solar",selector:{boolean:{}}},{name:"show_battery",selector:{boolean:{}}},{name:"show_grid",selector:{boolean:{}}},{name:"decimal_places",selector:{number:{}}},{name:"dynamic_line_width",selector:{boolean:{}}},{name:"max_line_width",selector:{number:{}}},{name:"min_line_width",selector:{number:{}}}]}]},{type:"expandable",title:this._title("inverter"),schema:[{name:"inverter",type:"grid",schema:[{name:"three_phase",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"model",selector:{select:{options:Object.values(_e).map((e=>({label:Wt.capitalize(e),value:e})))}}},{name:"modern",selector:{boolean:{}}},{name:"autarky",selector:{select:{options:Object.values(be).map((e=>({label:Wt.capitalize(e),value:e})))}}},{name:"colour",selector:{color_rgb:{}}}]}]},{type:"expandable",title:this._title("solar"),schema:[{name:"solar",type:"grid",schema:[{name:"mppts",selector:{number:{min:0,max:4}}},{name:"show_daily",selector:{boolean:{}}},{name:"pv1_name",selector:{text:{}}},{name:"pv2_name",selector:{text:{}}},{name:"pv3_name",selector:{text:{}}},{name:"pv4_name",selector:{text:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"display_mode",selector:{number:{mode:"box",min:1,max:3}}},{name:"colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"animation_speed",selector:{number:{}}},{name:"max_power",selector:{number:{}}}]}]},{type:"expandable",title:this._title("battery"),schema:[{name:"battery",type:"grid",schema:[{name:"energy",selector:{number:{min:0}}},{name:"shutdown_soc",selector:{number:{mode:"box",min:0,max:100}}},{name:"show_daily",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"invert_power",selector:{boolean:{}}},{name:"show_absolute",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"charge_colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"linear_gradient",selector:{boolean:{}}},{name:"hide_soc",selector:{boolean:{}}},{name:"show_remaining_energy",selector:{boolean:{}}},{name:"animation_speed",selector:{number:{}}},{name:"max_power",selector:{number:{}}}]}]},{type:"expandable",title:this._title("load"),schema:[{name:"load",type:"grid",schema:[{name:"show_daily",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"dynamic_icon",selector:{boolean:{}}},{name:"invert_load",selector:{boolean:{}}},{name:"essential_name",selector:{text:{}}},{name:"additional_loads",selector:{number:{mode:"box",min:0,max:4}}},{name:"load1_name",selector:{text:{}}},{name:"load1_icon",selector:{icon:{}}},{name:"load2_name",selector:{text:{}}},{name:"load2_icon",selector:{icon:{}}},{name:"load3_name",selector:{text:{}}},{name:"load3_icon",selector:{icon:{}}},{name:"load4_name",selector:{text:{}}},{name:"load4_icon",selector:{icon:{}}},{name:"animation_speed",selector:{number:{}}},{name:"max_power",selector:{number:{}}}]},{type:"expandable",title:this._title("aux"),schema:[{name:"load",type:"grid",schema:[{name:"show_aux",selector:{boolean:{}}},{name:"aux_name",selector:{text:{}}},{name:"aux_type",selector:{icon:{}}},{name:"invert_aux",selector:{boolean:{}}},{name:"show_absolute_aux",selector:{boolean:{}}},{name:"aux_colour",selector:{color_rgb:{}}},{name:"aux_off_colour",selector:{color_rgb:{}}},{name:"aux_loads",selector:{number:{mode:"box",min:0,max:2}}},{name:"aux_load1_name",selector:{text:{}}},{name:"aux_load1_icon",selector:{icon:{}}},{name:"aux_load2_name",selector:{text:{}}},{name:"aux_load2_icon",selector:{icon:{}}},{name:"show_daily_aux",selector:{boolean:{}}}]}]}]},{type:"expandable",title:this._title("grid"),schema:[{name:"grid",type:"grid",schema:[{name:"show_daily_buy",selector:{boolean:{}}},{name:"show_daily_sell",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"invert_grid",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"no_grid_colour",selector:{color_rgb:{}}},{name:"export_colour",selector:{color_rgb:{}}},{name:"grid_off_colour",selector:{color_rgb:{}}},{name:"grid_name",selector:{text:{}}},{name:"show_absolute",selector:{boolean:{}}},{name:"energy_cost_decimals",selector:{number:{mode:"box",min:0,max:3}}},{name:"show_nonessential",selector:{boolean:{}}},{name:"additional_loads",selector:{number:{mode:"box",min:0,max:3}}},{name:"nonessential_name",selector:{text:{}}},{name:"nonessential_icon",selector:{icon:{}}},{name:"load1_name",selector:{text:{}}},{name:"load1_icon",selector:{icon:{}}},{name:"load2_name",selector:{text:{}}},{name:"load2_icon",selector:{icon:{}}},{name:"load3_name",selector:{text:{}}},{name:"load3_icon",selector:{icon:{}}},{name:"animation_speed",selector:{number:{}}},{name:"max_power",selector:{number:{}}}]}]},{type:"expandable",title:this._title("entities"),schema:[{type:"expandable",title:this._title("sol"),schema:[{name:"entities",type:"grid",schema:[{name:"day_pv_energy_108",selector:{entity:{device_class:Mt.ENERGY}}},{name:"pv1_power_186",selector:{entity:{device_class:Mt.POWER}}},{name:"pv2_power_187",selector:{entity:{device_class:Mt.POWER}}},{name:"pv3_power_188",selector:{entity:{device_class:Mt.POWER}}},{name:"pv4_power_189",selector:{entity:{device_class:Mt.POWER}}},{name:"pv1_voltage_109",selector:{entity:{device_class:Mt.VOLTAGE}}},{name:"pv1_current_110",selector:{entity:{device_class:Mt.CURRENT}}},{name:"pv2_voltage_111",selector:{entity:{device_class:Mt.VOLTAGE}}},{name:"pv2_current_112",selector:{entity:{device_class:Mt.CURRENT}}},{name:"pv3_voltage_113",selector:{entity:{device_class:Mt.VOLTAGE}}},{name:"pv3_current_114",selector:{entity:{device_class:Mt.CURRENT}}},{name:"pv4_voltage_115",selector:{entity:{device_class:Mt.VOLTAGE}}},{name:"pv4_current_116",selector:{entity:{device_class:Mt.CURRENT}}},{name:"pv_total",selector:{entity:{device_class:Mt.POWER}}},{name:"solar_sell_247",selector:{entity:{}}},{name:"total_pv_generation",selector:{entity:{device_class:Mt.ENERGY}}},{name:"remaining_solar",selector:{entity:{device_class:Mt.ENERGY}}},{name:"environment_temp",selector:{entity:{device_class:Mt.TEMPERATURE}}}]}]},{type:"expandable",title:this._title("bat"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_power_190",selector:{entity:{device_class:Mt.POWER}}},{name:"battery_current_191",selector:{entity:{device_class:Mt.CURRENT}}},{name:"battery_temp_182",selector:{entity:{device_class:Mt.TEMPERATURE}}},{name:"battery_voltage_183",selector:{entity:{device_class:Mt.VOLTAGE}}},{name:"battery_soc_184",selector:{entity:{device_class:Mt.BATTERY}}},{name:"day_battery_charge_70",selector:{entity:{device_class:Mt.ENERGY}}},{name:"day_battery_discharge_71",selector:{entity:{device_class:Mt.ENERGY}}},{name:"battery_rated_capacity",selector:{entity:{}}},{name:"battery_current_direction",selector:{entity:{}}},{name:"battery_status",selector:{entity:{}}}]}]},{type:"expandable",title:this._title("inv"),schema:[{name:"entities",type:"grid",schema:[{name:"inverter_status_59",selector:{entity:{}}},{name:"use_timer_248",selector:{entity:{}}},{name:"priority_load_243",selector:{entity:{}}},{name:"inverter_voltage_154",selector:{entity:{device_class:Mt.VOLTAGE}}},{name:"inverter_voltage_L2",selector:{entity:{device_class:Mt.VOLTAGE}}},{name:"inverter_voltage_L3",selector:{entity:{device_class:Mt.VOLTAGE}}},{name:"load_frequency_192",selector:{entity:{device_class:Mt.FREQUENCY}}},{name:"inverter_current_164",selector:{entity:{device_class:Mt.CURRENT}}},{name:"inverter_current_L2",selector:{entity:{device_class:Mt.CURRENT}}},{name:"inverter_current_L3",selector:{entity:{device_class:Mt.CURRENT}}},{name:"inverter_power_175",selector:{entity:{device_class:Mt.POWER}}},{name:"grid_power_169",selector:{entity:{device_class:Mt.POWER}}},{name:"dc_transformer_temp_90",selector:{entity:{device_class:Mt.TEMPERATURE}}},{name:"radiator_temp_91",selector:{entity:{device_class:Mt.TEMPERATURE}}},{name:"prog1_time",selector:{entity:{}}},{name:"prog1_capacity",selector:{entity:{}}},{name:"prog1_charge",selector:{entity:{}}},{name:"prog2_time",selector:{entity:{}}},{name:"prog2_capacity",selector:{entity:{}}},{name:"prog2_charge",selector:{entity:{}}},{name:"prog3_time",selector:{entity:{}}},{name:"prog3_capacity",selector:{entity:{}}},{name:"prog3_charge",selector:{entity:{}}},{name:"prog4_time",selector:{entity:{}}},{name:"prog4_capacity",selector:{entity:{}}},{name:"prog4_charge",selector:{entity:{}}},{name:"prog5_time",selector:{entity:{}}},{name:"prog5_capacity",selector:{entity:{}}},{name:"prog5_charge",selector:{entity:{}}},{name:"prog6_time",selector:{entity:{}}},{name:"prog6_capacity",selector:{entity:{}}},{name:"prog6_charge",selector:{entity:{}}}]}]},{type:"expandable",title:this._title("ld"),schema:[{name:"entities",type:"grid",schema:[{name:"day_load_energy_84",selector:{entity:{device_class:Mt.ENERGY}}},{name:"day_aux_energy",selector:{entity:{device_class:Mt.ENERGY}}},{name:"essential_power",selector:{entity:{device_class:Mt.POWER}}},{name:"essential_load1",selector:{entity:{device_class:Mt.POWER}}},{name:"essential_load2",selector:{entity:{device_class:Mt.POWER}}},{name:"essential_load3",selector:{entity:{device_class:Mt.POWER}}},{name:"essential_load4",selector:{entity:{device_class:Mt.POWER}}},{name:"essential_load1_extra",selector:{entity:{}}},{name:"essential_load2_extra",selector:{entity:{}}},{name:"load_power_L1",selector:{entity:{device_class:Mt.POWER}}},{name:"load_power_L2",selector:{entity:{device_class:Mt.POWER}}},{name:"load_power_L3",selector:{entity:{device_class:Mt.POWER}}},{name:"aux_power_166",selector:{entity:{device_class:Mt.POWER}}},{name:"aux_load1",selector:{entity:{device_class:Mt.POWER}}},{name:"aux_load2",selector:{entity:{device_class:Mt.POWER}}},{name:"aux_load1_extra",selector:{entity:{}}},{name:"aux_load2_extra",selector:{entity:{}}},{name:"aux_connected_status",selector:{entity:{}}}]}]},{type:"expandable",title:this._title("gri"),schema:[{name:"entities",type:"grid",schema:[{name:"day_grid_import_76",selector:{entity:{device_class:Mt.ENERGY}}},{name:"day_grid_export_77",selector:{entity:{device_class:Mt.ENERGY}}},{name:"grid_ct_power_172",selector:{entity:{device_class:Mt.POWER}}},{name:"grid_ct_power_L2",selector:{entity:{device_class:Mt.POWER}}},{name:"grid_ct_power_L3",selector:{entity:{device_class:Mt.POWER}}},{name:"grid_ct_power_total",selector:{entity:{device_class:Mt.POWER}}},{name:"grid_voltage",selector:{entity:{device_class:Mt.VOLTAGE}}},{name:"nonessential_power",selector:{entity:{device_class:Mt.POWER}}},{name:"non_essential_load1",selector:{entity:{device_class:Mt.POWER}}},{name:"non_essential_load2",selector:{entity:{device_class:Mt.POWER}}},{name:"non_essential_load3",selector:{entity:{device_class:Mt.POWER}}},{name:"grid_connected_status_194",selector:{entity:{}}},{name:"energy_cost_buy",selector:{entity:{}}},{name:"energy_cost_sell",selector:{entity:{}}},{name:"prepaid_units",selector:{entity:{}}}]}]}]}],(e=>this._valueChanged(e))):W(jt||(jt=fe([""])))}_title(e){return At("config.cat_title.".concat(e))??e}_valueChanged(e){!function(e,t,n,o){o=o||{},n=null==n?{}:n;var a=new Event(t,{bubbles:void 0===o.bubbles||o.bubbles,cancelable:Boolean(o.cancelable),composed:void 0===o.composed||o.composed});a.detail=n,e.dispatchEvent(a)}(this,"config-changed",{config:e.detail.value})}};Ut.styles=s(Vt||(Vt=fe(["\n\n "]))),t([ge({attribute:!1})],Ut.prototype,"hass",void 0),t([function(e){return ge({...e,state:!0,attribute:!1})}()],Ut.prototype,"_config",void 0),Ut=t([ue("content-card-editor")],Ut);class Qt{static toNum(e,t=-1,n=!1){let o=Number(e);return Number.isNaN(o)?0:(t>=0&&(o=parseFloat(o.toFixed(t))),n&&(o*=-1),o)}static convertValue(e,t=2){return t=Number.isNaN(t)?2:t,Math.abs(e)>999?"".concat((e/1e3).toFixed(t)," kW"):"".concat(Math.round(e)," W")}static convertValueNew(e,t=kt.WATT_HOUR,n=2){n=isNaN(n)?2:n;const o=Number(e);if(isNaN(o))return 0;const a=Ot[t];if(!a)return"".concat(Math.round(o)," ").concat(t);for(const e of a)if(Math.abs(o)>=e.threshold){const t=(o/e.divisor).toFixed(e.decimal||n);return"".concat(t," ").concat(e.targetUnit)}return"".concat(o.toFixed(n)," ").concat(t)}static handlePopup(e,t){t&&this._handleClick(e,{action:"more-info"},t)}static _handleClick(e,t,n){if(!n||!e)return;let o;if(e.stopPropagation(),"more-info"===t.action)o=new Event("hass-more-info",{composed:!0}),o.detail={entityId:n},e.target.dispatchEvent(o)}}var Ft,Xt,Yt,Jt,Kt,$t,en,tn,nn,on,an,rn,sn,ln,dn,cn,un,hn,pn,gn,yn,mn,fn,vn,wn,_n,xn,bn;var An,Pn,Ln,Cn,En,Tn,Mn,Nn,kn,Sn,In,On,Dn,Hn,zn,Bn,Gn,Rn,qn;class jn{constructor(){}getBatteryCapacity(e,t,n,o,a){let r=0;return e>0?r="off"===t||"0"===t||"off-grid"===t.toLowerCase()||!o.show||parseInt(a.state)<=o.capacity?n:o.capacity:e<0&&("off"===t||"0"===t||"off-grid"===t.toLowerCase()||!o.show||parseInt(a.state)>=o.capacity?r=100:parseInt(a.state)=95:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5zM5 6.5 11 6.5 11 7.5H5z",o="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5zM5 6.5 11 6.5 11 7.5H5z",a="green";break;case 85<=parseInt(e.state)&&parseInt(e.state)<95:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5z",o="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5z",a="green";break;case 75<=parseInt(e.state)&&parseInt(e.state)<85:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5z",o="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zH5z",a="#9ACD32";break;case 65<=parseInt(e.state)&&parseInt(e.state)<75:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5z",o="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 11z",a="yellow";break;case 55<=parseInt(e.state)&&parseInt(e.state)<65:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5z",o="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5z",a="yellow";break;case 45<=parseInt(e.state)&&parseInt(e.state)<55:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5z",o="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zH5z",a="yellow";break;case 35<=parseInt(e.state)&&parseInt(e.state)<45:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5z",o="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zH5z",a="orange";break;case 25<=parseInt(e.state)&&parseInt(e.state)<35:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5z",o="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 17z",a="orange";break;case 10<=parseInt(e.state)&&parseInt(e.state)<25:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5z",o="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 19z",a="orange";break;case 0<=parseInt(e.state)&&parseInt(e.state)<10:default:n=t,o=t,a="red"}return{batteryIcon:n,batteryCharge:o,stopColour:a,battery0:t}}}function io(e){return{...e,toNum:(t,n)=>Qt.toNum(e?.state,t,n),isValid:()=>null!==e?.state&&void 0!==e.state&&"unknown"!==e.state||!1,notEmpty:()=>""!==e?.state||!1,isNaN:()=>Number.isNaN(e?.state)||!0,toPower:t=>"kw"===(e.attributes?.unit_of_measurement||"").toLowerCase()?Qt.toNum(1e3*(e?.state||"0"),0,t):Qt.toNum(e?.state||"0",0,t)||0,toPowerString:(t,n,o)=>t?Qt.convertValueNew(e?.state,e?.attributes?.unit_of_measurement,n||1):"".concat(Qt.toNum(e?.state,n,o)," ").concat(kt.KILO_WATT_HOUR),toString:()=>e?.state?.toString()||"",getUOM:()=>e?.attributes?.unit_of_measurement||""}}const so="m15 13l-4 4v-3H2v-2h9V9l4 4M5 20v-4h2v2h10v-7.81l-5-4.5L7.21 10H4.22L12 3l10 9h-3v8H5Z",lo="M15 9h1V7.5h4V9h1c.55 0 1 .45 1 1v11c0 .55-.45 1-1 1h-6c-.55 0-1-.45-1-1V10c0-.55.45-1 1-1m1 2v3h4v-3h-4m-4-5.31l-5 4.5V18h5v2H5v-8H2l10-9l2.78 2.5H14v1.67l-.24.1L12 5.69Z",co="M5 20v-8H2l10-9l10 9h-3v8zm7-14.31l-5 4.5V18h10v-7.81zM11.5 18v-4H9l3.5-7v4H15z",uo="M11.6 3.45zM18.25 19.6v-7.6h2.85L11.6 3.45 2.1 12h2.85v7.6zM11.6 6.015l4.75 4.275V17.7H6.85v-7.41zM6.58 2.8v1.42L8 3.508zm-.4 2.4L5.2 6.184l1.5.5zM2.8 6.58 3.508 8l.712-1.42zM6 2.8H2.8v3.2c.228.068.468.1.708.1 1.432.004 2.596-1.16 2.6-2.6-.004-.236-.04-.472-.108-.7M12.5 3.844l2.25 2.026.5-.5-2.24-2.04zM17.71 8.53 18.2 8.04 15.76 5.84 15.26 6.34ZM20.52 11.09l.48-.49-2.31-2.14-.5.5z M18.1299 5.1169 17.318 4.6482l2.4492-1.6171-.75 1.299.8119.4687-2.4492 1.6171z";console.groupCollapsed("%c ⚡ SUNSYNK-POWER-FLOW-CARD %c ".concat(At("common.version"),": ").concat("4.24.1"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/slipx06/sunsynk-power-flow-card"),console.groupEnd(),e.SunsynkPowerFlowCard=class extends de{constructor(){super(...arguments),this.durationPrev={},this.durationCur={}}static get styles(){return we}static getConfigElement(){return document.createElement("content-card-editor")}static getStubConfig(){return{cardstyle:xe.Lite,show_solar:!0,battery:{energy:0,shutdown_soc:20,show_daily:!0},solar:{show_daily:!0,mppts:2},load:{show_daily:!0},grid:{show_daily_buy:!0,show_daily_sell:!1,show_nonessential:!0},entities:{use_timer_248:"switch.sunsynk_toggle_system_timer",priority_load_243:"switch.sunsynk_toggle_priority_load",inverter_voltage_154:"sensor.sunsynk_inverter_voltage",load_frequency_192:"sensor.sunsynk_load_frequency",inverter_current_164:"sensor.sunsynk_inverter_current",inverter_power_175:"sensor.sunsynk_inverter_power",grid_connected_status_194:"binary_sensor.sunsynk_grid_connected_status",inverter_status_59:"sensor.sunsynk_overall_state",day_battery_charge_70:"sensor.sunsynk_day_battery_charge",day_battery_discharge_71:"sensor.sunsynk_day_battery_discharge",battery_voltage_183:"sensor.sunsynk_battery_voltage",battery_soc_184:"sensor.sunsynk_battery_soc",battery_power_190:"sensor.sunsynk_battery_power",battery_current_191:"sensor.sunsynk_battery_current",grid_power_169:"sensor.sunsynk_grid_power",day_grid_import_76:"sensor.sunsynk_day_grid_import",day_grid_export_77:"sensor.sunsynk_day_grid_export",grid_ct_power_172:"sensor.sunsynk_grid_ct_power",day_load_energy_84:"sensor.sunsynk_day_load_energy",essential_power:"none",nonessential_power:"none",aux_power_166:"sensor.sunsynk_aux_power",day_pv_energy_108:"sensor.sunsynk_day_pv_energy",pv1_power_186:"sensor.sunsynk_pv1_power",pv2_power_187:"sensor.sunsynk_pv2_power",pv1_voltage_109:"sensor.sunsynk_pv1_voltage",pv1_current_110:"sensor.sunsynk_pv1_current",pv2_voltage_111:"sensor.sunsynk_pv2_voltage",pv2_current_112:"sensor.sunsynk_pv2_current"}}}render(){xt.hass=this.hass;const e=this._config,t=this.getEntity("day_battery_discharge_71"),n=this.getEntity("day_battery_charge_70"),o=this.getEntity("day_load_energy_84"),a=this.getEntity("day_grid_import_76"),r=this.getEntity("day_pv_energy_108"),i=this.getEntity("day_grid_export_77"),s=this.getEntity("day_aux_energy"),l=this.getEntity("inverter_voltage_154"),d=this.getEntity("load_frequency_192"),c=this.getEntity("inverter_current_164"),u=this.getEntity("inverter_status_59",{state:""}),h=this.getEntity("inverter_power_175"),p=this.getEntity("priority_load_243",{state:"undefined"}),g=this.getEntity("use_timer_248",{state:"undefined"}),y=this.getEntity("dc_transformer_temp_90",{state:""}),m=this.getEntity("radiator_temp_91",{state:""}),f=this.getEntity("inverter_voltage_L2",{state:""}),v=this.getEntity("inverter_voltage_L3",{state:""}),w=this.getEntity("inverter_current_L2",{state:""}),_=this.getEntity("inverter_current_L3",{state:""}),x=this.getEntity("environment_temp",{state:""}),b=this.getEntity("battery_voltage_183"),A=this.getEntity("battery_soc_184"),P=this.getEntity("battery_power_190"),L=this.getEntity("battery_current_191"),C=this.getEntity("battery_temp_182",{state:""}),E=this.getEntity("battery_status",{state:""}),T=this.getEntity("battery_current_direction",{state:""}),M=this.getEntity("battery_rated_capacity",{state:""}),N=this.getEntity("battery.shutdown_soc",{state:e.battery.shutdown_soc?.toString()??""}),k=this.getEntity("battery.shutdown_soc_offgrid",{state:e.battery.shutdown_soc_offgrid?.toString()??""}),S=this.getEntity("essential_power"),I=this.getEntity("aux_power_166"),O=this.getEntity("nonessential_power"),D=this.getEntity("non_essential_load1"),H=this.getEntity("non_essential_load2"),z=this.getEntity("non_essential_load3"),B=this.getEntity("essential_load1"),G=this.getEntity("essential_load2"),R=this.getEntity("essential_load3"),q=this.getEntity("essential_load4"),j=this.getEntity("aux_connected_status",{state:"on"}),Z=this.getEntity("aux_load1"),V=this.getEntity("aux_load2"),Q=this.getEntity("essential_load1_extra"),F=this.getEntity("essential_load2_extra"),X=this.getEntity("load_power_L1"),Y=this.getEntity("load_power_L2"),J=this.getEntity("load_power_L3"),K=this.getEntity("aux_load1_extra"),$=this.getEntity("aux_load2_extra"),ee=this.getEntity("grid_ct_power_172"),te=this.getEntity("grid_ct_power_L2"),ne=this.getEntity("grid_ct_power_L3"),oe=this.getEntity("grid_ct_power_total"),ae=this.getEntity("grid_connected_status_194",{state:"on"}),re=this.getEntity("grid_power_169"),ie=this.getEntity("energy_cost_buy",{state:"",attributes:{unit_of_measurement:""}}),se=this.getEntity("energy_cost_sell",{state:"",attributes:{unit_of_measurement:""}}),le=this.getEntity("grid_voltage",null),de=this.getEntity("prepaid_units"),ce=this.getEntity("pv1_voltage_109"),ue=this.getEntity("pv1_current_110"),he=this.getEntity("pv2_voltage_111"),pe=this.getEntity("pv2_current_112"),ge=this.getEntity("pv3_voltage_113"),ye=this.getEntity("pv3_current_114"),me=this.getEntity("pv4_voltage_115"),ve=this.getEntity("pv4_current_116"),we=this.getEntity("pv1_power_186"),xe=this.getEntity("pv2_power_187"),Ae=this.getEntity("pv3_power_188"),Pe=this.getEntity("pv4_power_189"),Le=this.getEntity("remaining_solar"),Ce=this.getEntity("solar_sell_247",{state:"undefined"}),Ee=this.getEntity("pv_total"),Te=this.getEntity("total_pv_generation");let{invert_aux:Me}=e.load,Ne=I.toPower(Me),{invert_grid:ke}=e.grid,Se=ee.toPower(ke),Ie=te.toPower(ke),Oe=ne.toPower(ke),De=oe.toPower(ke),He=e.entities?.grid_ct_power_total?De:Se+Ie+Oe,ze=e.inverter.three_phase?He:Se,Be=le.isNaN()?null:Qt.toNum(le.state),Ge=T.isNaN()?null:parseInt(T.state),Re=e.inverter?.modern,qe=this.colourConvert(e.load?.colour),je=this.colourConvert(e.load?.aux_colour||qe),Ze=this.colourConvert(e.load?.aux_off_colour||qe);e.title_colour=this.colourConvert(e.title_colour);let Ve=e.load?.show_daily,We=e.grid?.show_nonessential,Ue=e.entities?.grid_connected_status_194?ae.state:"on",Qe=e.entities?.aux_connected_status?j.state:"on",Fe=e.entities?.load_frequency_192?d.toNum(2):0,Xe=e.entities?.inverter_voltage_154?e.inverter.three_phase&&(this.isLiteCard||this.isCompactCard)?l.toNum(0):l.toNum(1):0,Ye=e.entities?.inverter_voltage_L2?e.inverter.three_phase&&(this.isLiteCard||this.isCompactCard)?f.toNum(0):f.toNum(1):"",Je=e.entities?.inverter_voltage_L3?e.inverter.three_phase&&(this.isLiteCard||this.isCompactCard)?v.toNum(0):v.toNum(1):"",Ke=e.entities?.inverter_current_164?c.toNum(1):0,$e=e.entities?.inverter_current_L2?w.toNum(1):"",et=e.entities?.inverter_current_L3?_.toNum(1):"",tt=e.entities?.battery_voltage_183?b.toNum(1):0,nt=e.entities?.inverter_power_175?h.toPower():0,ot=e.entities?.grid_power_169?re.toPower():0,{invert_load:at}=e.load,rt=e.entities?.load_power_L1?X.toPower(at):"",it=e.entities?.load_power_L2?Y.toPower(at):"",st=e.entities?.load_power_L3?J.toPower(at):"";const lt=this.colourConvert(e.grid?.colour),dt=this.colourConvert(e.grid?.export_colour||lt),ct=this.colourConvert(e.grid?.no_grid_colour||lt);let ut;switch(!0){case ze<0:ut=dt;break;case 0===ze:ut=ct;break;default:ut=lt}const ht=this.colourConvert(e.grid?.grid_off_colour||ut);let pt=e.grid?.additional_loads;Ct.includes(pt)||(pt=0);let gt=e.grid?.show_daily_buy,yt=e.grid?.show_daily_sell,mt=this.colourConvert(e.battery?.colour),ft=this.colourConvert(e.battery?.charge_colour||mt),vt=e.battery?.show_daily,wt=e.solar?.show_daily,_t=e.load?.show_aux;Tt.includes(_t)||(_t=!1);let bt=e.load?.show_daily_aux,Pt=e.load?.additional_loads;(!Lt.includes(Pt)||this.isFullCard&&4===Pt)&&(Pt=0);let Mt=e.load?.aux_loads;Lt.includes(Mt)||(Mt=0);let kt=e.load?.aux_type,Ot=e.load?.aux_load1_icon,Dt=e.load?.aux_load2_icon,Ht=e.grid?.nonessential_icon,zt=e.grid?.load1_icon,Bt=e.grid?.load2_icon,Gt=e.grid?.load3_icon,Rt=e.load?.load1_icon,qt=e.load?.load2_icon,jt=e.load?.load3_icon,Zt=e.load?.load4_icon,Vt=!!e.entities.remaining_solar&&Qt.convertValueNew(Le.state,Le.attributes?.unit_of_measurement,1),Wt=!!e.entities.total_pv_generation&&Qt.convertValueNew(Te.state,Te.attributes?.unit_of_measurement,2),Ut=e.large_font,jn=e.panel_mode,Zn=this.colourConvert(e.inverter?.colour),Vn=e.inverter?.autarky,Wn=!(!1===e.entities.use_timer_248||!e.entities.use_timer_248)&&g.state,Un=!(!1===e.entities.priority_load_243||!e.entities.priority_load_243)&&p.state,Qn=P.toPower(e.battery?.invert_power);const Fn=(e.card_height?this.hass.states[e.card_height]:null)||{state:""};let Xn="unavailable"===Fn.state||"unknown"===Fn.state||""===Fn.state?e.card_height:Fn.state,Yn=e.card_width,Jn=0===e.grid?.energy_cost_decimals?0:e.grid?.energy_cost_decimals||2,Kn=ze>=0?ie.toNum(Jn):se.toNum(Jn),$n=_e.Sunsynk;Object.values(_e).includes(e.inverter.model)&&($n=e.inverter.model);let eo="";const to=ao.getInstance($n);Re||(eo=to.image);let no=!1;this.isCompactCard&&(no=!0);let oo,io,ho=we.toPower(),po=xe.toPower(),go=Ae.toPower(),yo=Pe.toPower(),mo=ho+po+go+yo,fo=e.entities?.pv_total?Ee.toNum():mo,vo=e.solar.dynamic_colour?Qt.toNum(fo,0)>10?this.colourConvert(e.solar?.colour):"grey":this.colourConvert(e.solar?.colour),wo=e.inverter?.three_phase;Et.includes(wo)||(wo=!1);const{essential_power:_o,nonessential_power:xo}=e.entities;io=!1===wo?"none"!==xo&&xo?O.toPower():Se-ot:"none"!==xo&&xo?O.toPower():Se+Ie+Oe-ot,oo="none"!==_o&&_o?S.toPower(at):!0===wo&&e.entities.load_power_L1&&e.entities.load_power_L2?Number(rt)+Number(it)+Number(st):nt+ot-Ne;const bo={time:this.getEntity("prog1_time",{state:e.entities.prog1_time??""}),capacity:this.getEntity("prog1_capacity",{state:e.entities.prog1_capacity??""}),charge:this.getEntity("prog1_charge",{state:e.entities.prog1_charge??""})},Ao={time:this.getEntity("prog2_time",{state:e.entities.prog2_time??""}),capacity:this.getEntity("prog2_capacity",{state:e.entities.prog2_capacity??""}),charge:this.getEntity("prog2_charge",{state:e.entities.prog2_charge??""})},Po={time:this.getEntity("prog3_time",{state:e.entities.prog3_time??""}),capacity:this.getEntity("prog3_capacity",{state:e.entities.prog3_capacity??""}),charge:this.getEntity("prog3_charge",{state:e.entities.prog3_charge??""})},Lo={time:this.getEntity("prog4_time",{state:e.entities.prog4_time??""}),capacity:this.getEntity("prog4_capacity",{state:e.entities.prog4_capacity??""}),charge:this.getEntity("prog4_charge",{state:e.entities.prog4_charge??""})},Co={time:this.getEntity("prog5_time",{state:e.entities.prog5_time??""}),capacity:this.getEntity("prog5_capacity",{state:e.entities.prog5_capacity??""}),charge:this.getEntity("prog5_charge",{state:e.entities.prog5_charge??""})},Eo={time:this.getEntity("prog6_time",{state:e.entities.prog6_time??""}),capacity:this.getEntity("prog6_capacity",{state:e.entities.prog6_capacity??""}),charge:this.getEntity("prog6_charge",{state:e.entities.prog6_charge??""})};let To=k.toNum(),Mo=N.toNum(),No={capacity:Mo,entityID:""};if(!1===Wn||"off"===g.state)No.show=!1;else if(e.entities.prog1_time&&e.entities.prog2_time&&e.entities.prog3_time&&e.entities.prog4_time&&e.entities.prog5_time&&e.entities.prog6_time){No.show=!0;const Da=new Date,Ha=[];[bo,Ao,Po,Lo,Co,Eo].forEach(((e,t)=>{const[n,o]=e.time.state.split(":").map((function(e){return parseInt(e,10)}));Ha[t]=new Date(Da.getTime()),Ha[t].setHours(n),Ha[t].setMinutes(o)}));const[za,Ba,Ga,Ra,qa,ja]=Ha;function Za(e,t){"No Grid or Gen"===e.charge.state||"0"===e.charge.state||"off"===e.charge.state?No.charge="none":No.charge="both",No.capacity=parseInt(e.capacity.state),No.entityID=t}Da>=ja||Da=za&&Da=Ba&&Da=Ga&&Da=Ra&&Da=qa&&Da50?"on":"off"),null==Ge||Number.isNaN(Ge)||$n==_e.Solis&&0===Ge&&(Qn=-Qn);let ko=0;if(e.show_battery)switch($n){case _e.GoodweGridMode:case _e.Goodwe:case _e.Huawei:Qn>0?ko="on"!==Ue&&"1"!==Ue&&"on-grid"!==Ue.toLowerCase()||No.show?"off"!==Ue&&"0"!==Ue&&"off-grid"!==Ue.toLowerCase()||!k.notEmpty()||No.show?Mo:To:Mo:Qn<0&&(ko=100);break;default:ko=to.getBatteryCapacity(Qn,Ue,Mo,No,A)}let So=0,Io="",Oo="";let Do=this.getEntity("battery.energy",{state:e.battery.energy?.toString()??""}).toNum(0);if(tt&&M.notEmpty()&&(Do=Qt.toNum(tt*M.toNum(0),0)),e.show_battery||0!==Do){0===Qn?So=(A.toNum()-Mo)/100*Do*60*60:Qn>0?So=(A.toNum()-ko)/100*Do/Qn*60*60:Qn<0&&(So=(ko-A.toNum(0))/100*Do/Qn*60*60*-1);const Va=new Date,Wa=1e3*So,Ua=new Date(Va.getTime()+Wa),Qa=Ua.getHours(),Fa=Ua.getMinutes().toString().padStart(2,"0"),Xa=Qa.toString().padStart(2,"0");Io="".concat(Xa,":").concat(Fa);const Ya=Math.floor(So/86400),Ja=Math.floor(So%86400/3600),Ka=Math.floor(So%3600/60);Ya>0&&(Oo+="".concat(Ya," ").concat(At("common.days"),",")),(Ja>0||Ya>0)&&(Oo+="".concat(Ja," ").concat(At("common.hrs"),",")),Oo+="".concat(Ka," ").concat(At("common.min"))}let Ho,zo=-2<=L.toNum(0)&&L.toNum(0)<=2&&A.toNum(0)>=99;Ho=Qn<0&&!zo?ft:mt;let Bo="",Go="",Ro=u.state,qo=!1;$n==_e.Solis&&(Ro=u.isNaN()?u.toString():u.toNum(0));let jo=to.statusGroups;if(jo)for(const $a of Object.keys(jo)){const er=jo[$a],{states:tr,color:nr,message:or}=er;if(tr.includes(Ro.toLowerCase())){Bo=nr,Go=or,qo=!0;break}}qo||("none"!==e.entities?.inverter_status_59&&e.entities?.inverter_status_59?(Bo="transparent",Go="Status"):(Bo="transparent",Go=""));let Zo="transparent",Vo="";if([_e.GoodweGridMode,_e.Goodwe,_e.Huawei].includes($n)){let ar=to.batteryStatusGroups;if(ar)for(const rr of Object.keys(ar)){const ir=ar[rr],{states:sr,color:lr,message:dr}=ir;if(sr.includes(E.state.toLowerCase())){Zo=lr,Vo=dr,qo=!0;break}}qo||("none"!==e.entities?.battery_status&&e.entities?.battery_status?(Zo="transparent",Vo="Status"):(Zo="transparent",Vo=""))}let Wo=r.toNum()+t.toNum(),Uo=o.toNum()+n.toNum(),Qo=0!=Uo?Math.max(Math.min(Math.round(100*Wo/Uo),100),0):0,Fo=0!=Wo?Math.max(Math.min(Math.round(100*Uo/Wo),100),0):0,Xo=fo+Qt.toNum("".concat(Qn>0?Qn:0))+Qt.toNum("".concat(Ne<0?-1*Ne:0)),Yo=oo+io+Qt.toNum("".concat(Ne>0?Ne:0))+Qt.toNum("".concat(Qn<0?-1*Qn:0)),Jo=0!=Yo?Math.max(Math.min(Math.round(100*Xo/Yo),100),0):0,Ko=0!=Xo?Math.max(Math.min(Math.round(100*Yo/Xo),100),0):0,$o=(Qt.toNum(e.max_line_width)<1?1:e.max_line_width)-1,ea=Qt.toNum(e.min_line_width)||1;let ta=this.getEntity("battery.max_power",{state:e.battery.max_power?.toString()??""}).toNum(),na=e.solar.max_power?this.dynamicLineWidth(ho,e.solar.max_power||ho,$o,ea):ea,oa=e.solar.max_power?this.dynamicLineWidth(po,e.solar.max_power||po,$o,ea):ea,aa=e.solar.max_power?this.dynamicLineWidth(go,e.solar.max_power||go,$o,ea):ea,ra=e.solar.max_power?this.dynamicLineWidth(yo,e.solar.max_power||yo,$o,ea):ea,ia=e.battery.max_power?this.dynamicLineWidth(Math.abs(Qn),ta||Math.abs(Qn),$o,ea):ea,sa=e.load.max_power?this.dynamicLineWidth(Math.abs(oo),e.load.max_power||Math.abs(oo),$o,ea):ea,la=e.load.max_power?this.dynamicLineWidth(Math.abs(Ne),e.load.max_power||Math.abs(Ne),$o,ea):ea,da=e.grid.max_power?this.dynamicLineWidth(Math.abs(ze),e.grid.max_power||Math.abs(ze),$o,ea):ea,ca=e.grid.max_power?this.dynamicLineWidth(Math.abs(ot),e.grid.max_power||Math.abs(ot),$o,ea):ea,ua=e.grid.max_power?this.dynamicLineWidth(Math.abs(io),e.grid.max_power||Math.abs(io),$o,ea):ea,ha=e.solar.max_power?this.dynamicLineWidth(fo,e.solar.max_power||fo,$o,ea):ea;if(e&&e.solar&&e.solar.animation_speed){const cr=e.solar.animation_speed-(e.solar.animation_speed-1)*(fo/(e.solar.max_power||fo));this.changeAnimationSpeed("solar",cr)}if(e&&e.solar&&e.solar.animation_speed){const ur=e.solar.animation_speed-(e.solar.animation_speed-1)*(ho/(e.solar.max_power||ho));this.changeAnimationSpeed("pv1",ur)}if(e&&e.solar&&e.solar.animation_speed){const hr=e.solar.animation_speed-(e.solar.animation_speed-1)*(po/(e.solar.max_power||po));this.changeAnimationSpeed("pv2",hr)}if(e&&e.solar&&e.solar.animation_speed){const pr=e.solar.animation_speed-(e.solar.animation_speed-1)*(go/(e.solar.max_power||go));this.changeAnimationSpeed("pv3",pr)}if(e&&e.solar&&e.solar.animation_speed){const gr=e.solar.animation_speed-(e.solar.animation_speed-1)*(yo/(e.solar.max_power||yo));this.changeAnimationSpeed("pv4",gr)}if(e&&e.battery&&e.battery.animation_speed){const yr=e.battery.animation_speed-(e.battery.animation_speed-1)*(Math.abs(Qn)/(e.battery.max_power||Math.abs(Qn)));this.changeAnimationSpeed("battery",yr)}if(e&&e.load&&e.load.animation_speed){const mr=e.load.animation_speed-(e.load.animation_speed-1)*(Math.abs(oo)/(e.load.max_power||Math.abs(oo)));this.changeAnimationSpeed("load",mr)}if(e&&e.load&&e.load.animation_speed){const fr=e.load.animation_speed-(e.load.animation_speed-1)*(Math.abs(Ne)/(e.load.max_power||Math.abs(Ne)));this.changeAnimationSpeed("aux",fr)}if(e&&e.grid&&e.grid.animation_speed){const vr=e.grid.animation_speed-(e.grid.animation_speed-1)*(Math.abs(ze)/(e.grid.max_power||Math.abs(ze)));this.changeAnimationSpeed("grid1",vr),this.changeAnimationSpeed("grid",vr)}if(e&&e.grid&&e.grid.animation_speed){const wr=e.grid.animation_speed-(e.grid.animation_speed-1)*(Math.abs(io)/(e.grid.max_power||Math.abs(io)));this.changeAnimationSpeed("ne",wr)}let pa=e.decimal_places;const ga=0===fo?0:"off"!==Un&&Un||Qn>0?fo/(wo?oo+Math.max(Ne,0):oo)*100:(fo-Math.abs(Qn))/(wo?oo+Math.max(Ne,0):oo)*100,ya=Qn<=0?0:Math.abs(Qn)/(wo?oo+Math.max(Ne,0):oo)*100,ma=ga+ya,fa=0===ma?0:ga/ma*100,va=0===ma?0:ya/ma*100;let wa=0,_a=0;ma>100?(wa=Qt.toNum(fa,0),_a=Qt.toNum(va,0)):(wa=Qt.toNum(Math.min(ga,100),0),_a=Qt.toNum(Math.min(ya,100),0));const xa=0===fo||Qn>=0?0:"off"!==Un&&Un?(fo-oo)/Math.abs(Qn)*100:fo/Math.abs(Qn)*100,ba=Qn>=0||ze<=0?0:"on"===Un?fo-oo>=Math.abs(Qn)?0:100*(ze-Math.max(oo-fo,0)/Math.abs(Qn)):fo>=Math.abs(Qn)?0:(Math.abs(Qn)-fo)/Math.abs(Qn)*100,Aa=xa+ba,Pa=0===Aa?0:xa/Aa*100,La=0===Aa?0:ba/Aa*100;let Ca,Ea,Ta=0,Ma=0;switch(Aa>100?(Ta=Qt.toNum(Pa,0),Ma=Qt.toNum(La,0)):(Ta=Qt.toNum(Math.min(xa,100),0),Ma=Qt.toNum(Math.min(ba,100),0)),!0){case ga>=100&&ya<=5&&ze-io<50&&e.load.dynamic_icon:Ca=uo,Ea=1;break;case ya>=100&&ga<=5&&ze-io<50&&e.load.dynamic_icon:Ca=lo,Ea=0;break;case ga<5&&ya<5&&e.load.dynamic_icon:Ca=co,Ea=0;break;default:Ca=so,Ea=0}const{batteryIcon:Na,batteryCharge:ka,stopColour:Sa,battery0:Ia}=ro.convert(A),Oa={config:e,panelMode:jn,compactMode:no,cardHeight:Xn,cardWidth:Yn,loadColour:qe,batteryColour:Ho,gridColour:ut,isFloating:zo,inverterColour:Zn,solarColour:vo,auxColour:je,auxOffColour:Ze,batteryEnergy:Do,largeFont:Ut,batteryPower:Qn,batteryDuration:Oo,batteryCapacity:ko,additionalLoad:Pt,essIconSize:Ea,essIcon:Ca,stateUseTimer:g,batteryStateMsg:Vo,stateBatterySoc:A,inverterProg:No,solarShowDaily:wt,batteryPercentage:_a,pvPercentage:wa,loadShowDaily:Ve,stateEnergyCostSell:se,stateEnergyCostBuy:ie,loadPowerL1:rt,loadPowerL2:it,loadPowerL3:st,durationCur:this.durationCur,stateEssentialLoad1:B,stateEssentialLoad2:G,stateEssentialLoad3:R,stateEssentialLoad4:q,gridPower:Se,gridPowerL2:Ie,gridPowerL3:Oe,decimalPlaces:pa,stateEssentialLoad1Extra:Q,stateEssentialLoad2Extra:F,loadFrequency:Fe,statePV4Current:ve,gridShowDailyBuy:gt,gridShowDailySell:yt,batteryShowDaily:vt,inverterModel:$n,batteryShutdown:Mo,enableAutarky:Vn,autarkyPower:Jo,ratioPower:Ko,ratioEnergy:Fo,autarkyEnergy:Qo,shutdownOffGrid:To,statePV1Current:ue,statePV2Current:pe,statePV3Current:ye,energyCost:Kn,inverterCurrent:Ke,inverterCurrentL2:$e,inverterCurrentL3:et,stateRadiatorTemp:m,inverterVoltage:Xe,inverterVoltageL2:Ye,inverterVoltageL3:Je,batteryVoltage:tt,stateBatteryCurrent:L,batLineWidth:ia,totalGridPower:ze,solarLineWidth:ha,totalPV:fo,loadLineWidth:sa,pvPercentageBat:Ta,gridPercentageBat:Ma,genericInverterImage:Re,battery0:Ia,essentialPower:oo,pv1LineWidth:na,pv2LineWidth:oa,pv3LineWidth:aa,pv4LineWidth:ra,gridLineWidth:da,pv1PowerWatts:ho,pv2PowerWatts:po,pv3PowerWatts:go,pv4PowerWatts:yo,stateEnvironmentTemp:x,statePV1Voltage:ce,statePV2Voltage:he,statePV3Voltage:ge,statePV4Voltage:me,batteryStateColour:Zo,inverterStateColour:Bo,stateBatteryTemp:C,statePrepaidUnits:de,stateDCTransformerTemp:y,iconEssentialLoad1:Rt,iconEssentialLoad2:qt,iconEssentialLoad3:jt,iconEssentialLoad4:Zt,enableTimer:Wn,stateSolarSell:Ce,priorityLoad:Un,inverterImg:eo,stateDayPVEnergy:r,statePV2Power:xe,statePV3Power:Ae,statePV4Power:Pe,remainingSolar:Vt,totalSolarGeneration:Wt,stateDayLoadEnergy:o,stateDayBatteryDischarge:t,stateDayGridImport:a,stateDayBatteryCharge:n,stateDayGridExport:i,statePVTotal:Ee,statePV1Power:we,minLineWidth:ea,stopColour:Sa,gridStatus:Ue,batteryCharge:ka,gridOffColour:ht,batteryIcon:Na,formattedResultTime:Io,showAux:_t,nonessentialIcon:Ht,showNonessential:We,auxStatus:Qe,nonessentialLoads:pt,additionalAuxLoad:Mt,stateAuxLoad1Extra:K,stateAuxLoad2Extra:$,iconNonessentialLoad1:zt,iconNonessentialLoad2:Bt,iconNonessentialLoad3:Gt,inverterStateMsg:Go,auxType:kt,showDailyAux:bt,nonessentialPower:io,auxPower:Ne,nonessLineWidth:ua,grid169LineWidth:ca,auxLineWidth:la,iconAuxLoad1:Ot,iconAuxLoad2:Dt,stateDayAuxEnergy:s,stateAuxLoad1:Z,stateAuxLoad2:V,stateNonessentialLoad1:D,stateNonessentialLoad2:H,stateNonessentialLoad3:z,autoScaledInverterPower:nt,autoScaledGridPower:ot};return this.isFullCard?((e,t,n)=>W(Ft||(Ft=fe(["\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 ','\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 ','\n kWh\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 ','\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 ','%\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 ","\n ",'\n W\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 \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 \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 \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\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\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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Nonessential Icon --\x3e\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 \x3c!-- Nonessential Load Icon --\x3e\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 \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 \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
\n \n
\n \n
\n
\n\n \x3c!-- Essential Icon --\x3e\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 \n \n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Aux Icon --\x3e\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 \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\n \x3c!-- Essential Boiler Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Essential Aircon Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Essential Pump Icon --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \x3c!-- Essential Oven Icon --\x3e\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
\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 \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 \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 \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 ','\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 ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n \n \n ',' V\n \n \n \n \n ',' V\n \n \n \n \n ',' V\n \n \n \n \n ',' Hz\n \n \n \n \n ',' A\n \n \n \n \n ',' A\n \n \n \n \n ',' A\n \n \n \n \n ',' V\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 \n \n ','\n A\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 \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 \n \n \n AC:\n ','°\n \n \n \n DC:\n ','°\n \n \n \n \n ','°\n \n \n \n \n ',"\n \n \n
\n
\n
\n "])),n.loadColour,n.loadColour,n.auxColour,n.auxColour,n.auxOffColour,n.gridColour,n.gridColour,e.title?W(Xt||(Xt=fe(['\n ',""])),e.title_colour||"inherit",e.title_size||"32px",e.title):"",!0!==n.panelMode?"".concat(n.cardHeight):"100%",!0===n.panelMode?"".concat(n.cardWidth):"100%",n.solarColour,1===e.solar.mppts?"none":"",e.show_solar?"":"st12",n.batteryColour,e.show_battery?"":"none",n.gridColour,e.show_grid?"":"none",n.gridColour,e.show_grid?"":"none",n.auxColour,n.showAux?"":"st12",n.loadColour,e.inverter.three_phase?60:50,n.inverterColour,n.solarColour,e.show_solar?"":"st12",n.solarColour,e.show_solar&&1!==e.solar.mppts?"":"st12",n.solarColour,!e.show_solar||[1,2].includes(e.solar.mppts)?"st12":"",n.solarColour,!e.show_solar||[1,2,3].includes(e.solar.mppts)?"st12":"",n.gridColour,n.showNonessential?"":"st12",e.show_grid?"":"none",1===n.nonessentialLoads?"":"none",n.gridColour,e.show_grid&&n.showNonessential?"":"st12",[2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,e.show_grid&&n.showNonessential&&1!==n.nonessentialLoads?"":"st12",[2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,e.show_grid&&n.showNonessential&&1!==n.nonessentialLoads?"":"st12",3===n.nonessentialLoads&&e.battery.hide_soc?"":"none",n.gridColour,e.show_grid&&n.showNonessential&&1!==n.nonessentialLoads?"":"st12",n.showAux?"143":"30",n.loadColour,1===n.additionalLoad?"":"none",n.showAux?"373":"376",n.showAux?"149":"30",n.loadColour,2===n.additionalLoad?"":"none",n.showAux?"410":"413",n.showAux?"149":"30",n.loadColour,2===n.additionalLoad?"":"none",n.auxColour,n.showAux?"":"none",[1,2].includes(n.additionalAuxLoad)?"":"st12",n.auxColour,n.showAux?"":"none",2===n.additionalAuxLoad?"":"st12",!0!==n.largeFont?"st14":"st4",e.show_battery?"":"none",0===n.batteryEnergy||n.isFloating||0===n.batteryPower?"transparent":"".concat(n.batteryColour),n.batteryDuration,e.show_battery?"":"none",0===n.batteryEnergy||n.batteryPower<=0||n.isFloating?"transparent":"".concat(n.batteryColour),At("common.runtime_to"),n.batteryCapacity,n.formattedResultTime,e.show_battery?"":"none",0===n.batteryEnergy||n.batteryPower>=0||n.isFloating?"transparent":"".concat(n.batteryColour),At("common.to"),n.batteryCapacity,At("common.charge"),n.formattedResultTime,e.show_battery?"":"none",0!==n.batteryEnergy&&n.isFloating?"".concat(n.batteryColour):"transparent",At("common.battery_floating"),e.show_solar?"":"none",n.solarColour,e.solar.pv1_name,e.show_solar&&1!==e.solar.mppts?"":"none",n.solarColour,e.solar.pv2_name,!e.show_solar||[1,2].includes(e.solar.mppts)?"none":"",n.solarColour,e.solar.pv3_name,!e.show_solar||[1,2,3].includes(e.solar.mppts)?"none":"",n.solarColour,e.solar.pv4_name,n.gridColour,e.show_grid?"":"none",e.grid.grid_name,n.inverterColour,n.inverterStateMsg,e.battery.show_remaining_energy?"15":"80",e.show_battery?"":"none",n.batteryColour,n.batteryStateMsg,e.show_battery&&e.battery.show_remaining_energy?"":"none",n.batteryColour,Qt.toNum(n.batteryEnergy*(n.stateBatterySoc?.toNum()/100)/1e3,2),[1,2].includes(n.additionalLoad)&&n.showAux?"none":"",n.loadColour,e.load.essential_name,0!==n.additionalLoad&&n.showAux?"":"none",n.loadColour,e.load.essential_name,n.showAux?181:70,1===n.additionalLoad?"":"none",n.loadColour,e.load.load1_name,n.showAux?390:393,n.showAux?178:59,2===n.additionalLoad?"":"none",n.loadColour,e.load.load1_name,n.showAux?426:429,n.showAux?178:59,2===n.additionalLoad?"":"none",n.loadColour,e.load.load2_name,2===n.additionalAuxLoad?"238":"306",n.loadShowDaily&&n.showAux?"".concat(n.loadColour):"transparent",At("common.daily_load"),0===n.additionalLoad?"377":"306",0===n.additionalLoad?71:93,!n.loadShowDaily||n.showAux?"transparent":"".concat(n.loadColour),At("common.daily_load"),1===e.solar.display_mode?"":"none",n.solarShowDaily&&e.show_solar?"".concat(n.solarColour):"transparent",At("common.daily_solar"),2===e.solar.display_mode?"":"none",n.solarShowDaily&&e.show_solar?"".concat(n.solarColour):"transparent",At("common.daily_solar_left"),3===e.solar.display_mode?"":"none",n.solarShowDaily&&e.show_solar?"".concat(n.solarColour):"transparent",At("common.total_solar_generation"),!0===n.batteryShowDaily&&e.show_battery?"".concat(n.batteryColour):"transparent",At("common.daily_charge"),!0===n.batteryShowDaily&&e.show_battery?"".concat(n.batteryColour):"transparent",At("common.daily_discharge"),n.showNonessential?"347":"311",n.showNonessential?"253":"368",!0!==n.gridShowDailyBuy?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",At("common.daily_grid_buy"),n.showNonessential?"347":"311",n.showNonessential?"222":"337",!0!==n.gridShowDailySell?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",At("common.daily_grid_sell"),!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),e.load.aux_name,e.show_grid&&n.showNonessential?"":"none",n.gridColour,e.grid.nonessential_name,e.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,e.grid.load1_name,e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,e.grid.load1_name,e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,e.grid.load2_name,e.battery.hide_soc?"st3 st8":"st12",e.show_grid&&n.showNonessential&&![0,1,2].includes(n.nonessentialLoads)?"":"none",n.gridColour,e.grid.load3_name,n.enableAutarky===be.No?"none":"",n.enableAutarky===be.Energy?"st4 st8 left-align":"st12",n.inverterColour,n.autarkyEnergy,n.enableAutarky===be.No?"none":"",n.enableAutarky===be.Energy?"st4 st8 left-align":"st12",n.inverterColour,n.ratioEnergy,n.enableAutarky===be.No?"none":"",n.enableAutarky===be.Power?"st4 st8 left-align":"st12",n.inverterColour,n.autarkyPower,n.enableAutarky===be.No?"none":"",n.enableAutarky===be.Power?"st4 st8 left-align":"st12",n.inverterColour,n.ratioPower,n.enableAutarky===be.No?"none":"",n.inverterColour,At("common.autarky"),n.enableAutarky===be.No?"none":"",n.inverterColour,At("common.ratio"),1===n.additionalAuxLoad?53:14,n.showAux&&0!==n.additionalAuxLoad?"":"none",n.auxColour,e.load.aux_load1_name,!n.showAux||[0,1].includes(n.additionalAuxLoad)?"none":"",n.auxColour,e.load.aux_load2_name,n.showAux&&0!==n.additionalAuxLoad&&e.entities.aux_load1_extra?"":"none",n.auxColour,n.stateAuxLoad1Extra.toNum(1),n.stateAuxLoad1Extra?.getUOM(),n.showAux&&![0,1].includes(n.additionalAuxLoad)&&e.entities.aux_load2_extra?"":"none",n.auxColour,n.stateAuxLoad2Extra.toNum(1),n.stateAuxLoad2Extra?.getUOM(),[1,2].includes(n.additionalAuxLoad)?"238":"306",n.showAux&&!0===n.showDailyAux?"":"none",n.auxColour,At("common.daily_aux"),e.inverter.three_phase&&e.entities?.load_power_L1?"":"none",n.loadColour,e.inverter.three_phase&&e.entities?.load_power_L1?n.loadPowerL1:"0",e.inverter.three_phase&&e.entities?.load_power_L2?"| "+n.loadPowerL2:"",e.inverter.three_phase&&e.entities?.load_power_L3?"| "+n.loadPowerL3:"",e.inverter.three_phase?"":"none",e.show_grid?"st3 left-align":"st12",n.gridColour,e.load.auto_scale?"".concat(Qt.convertValue(n.gridPower,n.decimalPlaces)||0):"".concat(n.gridPower||0," W"),e.inverter.three_phase&&e.entities?.grid_ct_power_L2?"":"none",e.show_grid?"st3 left-align":"st12",n.gridColour,e.load.auto_scale?"".concat(Qt.convertValue(n.gridPowerL2,n.decimalPlaces)||0):"".concat(n.gridPowerL2||0," W"),e.inverter.three_phase&&e.entities?.grid_ct_power_L3?"":"none",e.show_grid?"st3 left-align":"st12",n.gridColour,e.load.auto_scale?"".concat(Qt.convertValue(n.gridPowerL3,n.decimalPlaces)||0):"".concat(n.gridPowerL3||0," W"),n.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st14 left-align",[_e.GoodweGridMode,_e.Goodwe,_e.Huawei].includes(n.inverterModel)&&e.battery?.shutdown_soc_offgrid?"":"none",n.batteryShutdown,n.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st14 left-align",[_e.GoodweGridMode,_e.Goodwe,_e.Huawei].includes(n.inverterModel)&&e.battery?.shutdown_soc_offgrid?"":"none",n.shutdownOffGrid,n.inverterStateColour,e.battery.show_remaining_energy?"8":"73","none"!==e.entities?.battery_status&&e.entities?.battery_status&&e.show_battery?"":"none",n.batteryStateColour,n.showAux?"":"none",[1,2].includes(n.additionalLoad)?"":"st12",n.loadColour,n.showAux?"none":"",1===n.additionalLoad?"":"st12",n.loadColour,n.showAux?"none":"",2===n.additionalLoad?"":"st12",n.loadColour,1===e.solar.mppts?"M 86 175 M 155 250 L 96 250 Q 86 250 86 240 L 86 56 H 70":"M 86 162 L 86 56 Q 86 56 86 56 L 70 56",e.show_solar?"":"st12",n.solarColour,n.pv1LineWidth,Math.min(2+n.pv1LineWidth+Math.max(n.minLineWidth-2,0),8),e.show_solar?"":"st12",Math.round(n.pv1PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv1,e.show_solar&&1!==e.solar.mppts?"":"st12",n.solarColour,n.pv2LineWidth,Math.min(2+n.pv2LineWidth+Math.max(n.minLineWidth-2,0),8),e.show_solar&&1!==e.solar.mppts?"":"st12",Math.round(n.pv2PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv2,!e.show_solar||[1,2].includes(e.solar.mppts)?"st12":"",n.solarColour,n.pv3LineWidth,Math.min(2+n.pv3LineWidth+Math.max(n.minLineWidth-2,0),8),!e.show_solar||[1,2].includes(e.solar.mppts)?"st12":"",Math.round(n.pv3PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv3,!e.show_solar||[1,2,3].includes(e.solar.mppts)?"st12":"",n.solarColour,n.pv4LineWidth,Math.min(2+n.pv4LineWidth+Math.max(n.minLineWidth-2,0),8),!e.show_solar||[1,2,3].includes(e.solar.mppts)?"st12":"",Math.round(n.pv4PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv4,e.show_solar&&1!==e.solar.mppts?"":"st12",n.solarColour,n.solarLineWidth,Math.min(2+n.solarLineWidth+Math.max(n.minLineWidth-2,0),8),e.show_solar&&1!==e.solar.mppts?"":"st12",0===n.totalPV?"transparent":"".concat(n.solarColour),n.durationCur.solar,e.show_battery?"":"st12",n.batteryColour,n.batLineWidth,Math.min(2+n.batLineWidth+Math.max(n.minLineWidth-2,0),8),e.show_battery?"":"st12",n.batteryPower<0||0===n.batteryPower?"transparent":"".concat(n.batteryColour),n.durationCur.battery,Math.min(2+n.batLineWidth+Math.max(n.minLineWidth-2,0),8),e.show_battery?"":"st12",n.batteryPower>0||0===n.batteryPower?"transparent":"".concat(n.batteryColour),n.durationCur.battery,n.gridColour,n.gridLineWidth,e.show_grid?"":"none",Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower<0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",n.durationCur.grid,Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower>0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",n.durationCur.grid,e.inverter.three_phase?"M 421 295 L 421 337":"M 421 295 L 421 310.5",n.gridColour,n.gridLineWidth,e.show_grid?"":"none",Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower<0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",n.durationCur.grid/1.5,Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower>0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",n.durationCur.grid/1.5,n.gridColour,n.nonessLineWidth,e.show_grid?"":"none",n.showNonessential?"":"st12",Math.min(2+n.nonessLineWidth+Math.max(n.minLineWidth-2,0),8),n.showNonessential?"":"st12",n.nonessentialPower<=0?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",n.durationCur.ne/1.5,n.gridColour,n.nonessLineWidth,e.show_grid?"":"none",n.showNonessential?"":"st12",Math.min(2+n.nonessLineWidth+Math.max(n.minLineWidth-2,0),5),n.showNonessential?"":"st12",n.nonessentialPower<=0?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",n.durationCur.ne,n.showAux?"":"st12",n.auxColour,n.auxLineWidth,Math.min(2+n.auxLineWidth+Math.max(n.minLineWidth-2,0),8),n.showAux&&0!==n.auxPower?"":"st12",n.auxPower<0?"transparent":"".concat(n.auxColour),n.durationCur.aux,Math.min(2+n.auxLineWidth+Math.max(n.minLineWidth-2,0),8),n.showAux&&0!==n.auxPower?"":"st12",n.auxPower>0?"transparent":"".concat(n.auxColour),n.durationCur.aux,n.showAux?"":"st12",n.auxColour,n.auxLineWidth,n.gridColour,n.grid169LineWidth,e.show_grid?"":"none",e.inverter.three_phase?"M 180.15 223 L 180.15 235":"M 180.15 212 L 180.15 235",n.inverterColour,n.loadColour,n.loadLineWidth,Math.min(2+n.loadLineWidth+Math.max(n.minLineWidth-2,0),8),0===n.essentialPower?"transparent":"".concat(n.loadColour),n.durationCur.load,n.loadColour,n.loadLineWidth,n.genericInverterImage?1:0,n.inverterColour,e.battery?.show_remaining_energy?"294":"296.25",Number(n.pvPercentageBat)>0?n.solarColour:Number(n.gridPercentageBat)>0?n.gridColour:n.batteryColour,n.pvPercentageBat<2?0:n.pvPercentageBat,Number(n.pvPercentageBat)>0?n.solarColour:Number(n.gridPercentageBat)>0?n.gridColour:n.batteryColour,n.pvPercentageBat<2?0:n.pvPercentageBat,Number(n.gridPercentageBat)>0?n.gridColour:n.batteryColour,Number(n.pvPercentageBat<2?0:n.pvPercentageBat)+Number(n.gridPercentageBat<2?0:n.gridPercentageBat),Number(n.gridPercentageBat)>0?"".concat(n.gridColour):"".concat(n.batteryColour),Number(n.pvPercentageBat<2?0:n.pvPercentageBat)+Number(n.gridPercentageBat<2?0:n.gridPercentageBat),100===Number(n.pvPercentageBat)?n.solarColour:100===Number(n.gridPercentageBat)?n.gridColour:n.batteryColour,100===Number(n.pvPercentageBat)?n.solarColour:100===Number(n.gridPercentageBat)?n.gridColour:n.batteryColour,e.show_battery?"":"st12",e.battery.dynamic_colour?"url(#bLg)":n.batteryColour,e.battery.linear_gradient?n.battery0:n.batteryIcon,e.battery?.show_remaining_energy?"294":"296.25",n.stopColour,e.show_battery?"":"st12",e.battery.linear_gradient?"url(#sLg)":n.batteryColour,e.battery.linear_gradient?"":"none",n.batteryCharge,e.show_solar?"":"st12",n.solarColour,(t=>Qt.handlePopup(t,e.entities.grid_connected_status_194)),e.inverter.three_phase?"404":"389",e.inverter.three_phase?"339":"308",e.inverter.three_phase?"34":"65",e.inverter.three_phase?"34":"65",["off","0","off-grid","off grid","offgrid"].includes(n.gridStatus.toLowerCase())?"st12":"",n.gridColour,!e.show_grid||n.totalGridPower<0?"none":"",e.inverter.three_phase?"404":"389",e.inverter.three_phase?"339":"308",e.inverter.three_phase?"34":"65",e.inverter.three_phase?"34":"65",["on","1","on-grid","on grid","ongrid"].includes(n.gridStatus.toLowerCase())?"st12":"",n.gridOffColour,e.show_grid?"":"none",e.inverter.three_phase?"404":"389",e.inverter.three_phase?"339":"308",e.inverter.three_phase?"34":"65",e.inverter.three_phase?"34":"65",["off","0","off-grid","off grid"].includes(n.gridStatus.toLowerCase())?"st12":"",n.gridColour,!e.show_grid||n.totalGridPower>=0?"none":"","default"===n.nonessentialIcon?"1":"0",e.show_grid&&n.showNonessential&&![1,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"oven"===n.nonessentialIcon?"1":"0",e.show_grid&&n.showNonessential&&![1,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"boiler"===n.nonessentialIcon?"1":"0",e.show_grid&&n.showNonessential&&![1,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"pump"===n.nonessentialIcon?"1":"0",e.show_grid&&n.showNonessential&&![1,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"aircon"===n.nonessentialIcon?"1":"0",e.show_grid&&n.showNonessential&&![1,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,e.show_grid&&n.showNonessential&&![1,2,3].includes(n.nonessentialLoads)?"":"none",n.nonessentialIcon,"default"===n.iconNonessentialLoad1&&"default"===n.iconNonessentialLoad2?"1":"0",e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"default"===n.iconNonessentialLoad1&&"default"!=n.iconNonessentialLoad2?"1":"0",e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"default"!=n.iconNonessentialLoad1&&"default"===n.iconNonessentialLoad2?"1":"0",e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"boiler"===n.iconNonessentialLoad1?"1":"0",e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"boiler"===n.iconNonessentialLoad2?"1":"0",e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"pump"===n.iconNonessentialLoad1?"1":"0",e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"pump"===n.iconNonessentialLoad2?"1":"0",e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"oven"===n.iconNonessentialLoad1?"1":"0",e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"oven"===n.iconNonessentialLoad2?"1":"0",e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"aircon"===n.iconNonessentialLoad1?"1":"0",e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,"aircon"===n.iconNonessentialLoad2?"1":"0",e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.iconNonessentialLoad1,e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.iconNonessentialLoad2,e.show_grid&&n.showNonessential&&![0,1,2].includes(n.nonessentialLoads)&&e.battery.hide_soc?"":"none",e.battery.hide_soc?1:0,n.iconNonessentialLoad3,"default"===n.iconNonessentialLoad1?"1":"0",e.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"boiler"===n.iconNonessentialLoad1?"1":"0",e.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"pump"===n.iconNonessentialLoad1?"1":"0",e.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"oven"===n.iconNonessentialLoad1?"1":"0",e.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,"aircon"===n.iconNonessentialLoad1?"1":"0",e.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,e.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.iconNonessentialLoad1,1===n.essIconSize?"82.5":"78.5",Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.pvPercentage)>0?n.solarColour:n.gridColour,Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),Number(n.pvPercentage)>0?"".concat(n.solarColour):"".concat(n.gridColour),Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,[1,2].includes(n.additionalLoad)&&!n.showAux?"":"none",e.load.dynamic_colour?"url(#Lg)":n.loadColour,n.essIcon,Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.pvPercentage)>0?n.solarColour:n.gridColour,Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),Number(n.pvPercentage)>0?"".concat(n.solarColour):"".concat(n.gridColour),Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,[1,2].includes(n.additionalLoad)&&n.showAux?"":"none",e.load.dynamic_colour?"url(#Lg)":n.loadColour,n.essIcon,1===n.essIconSize?"82.5":"78.5",Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.pvPercentage)>0?n.solarColour:n.gridColour,Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),Number(n.pvPercentage)>0?"".concat(n.solarColour):"".concat(n.gridColour),Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,[1,2].includes(n.additionalLoad)?"none":"",e.load.dynamic_colour?"url(#Lg)":n.loadColour,n.essIcon,(t=>Qt.handlePopup(t,e.entities.aux_connected_status)),"default"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),"gen"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),"inverter"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),"oven"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),"boiler"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),"aircon"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),"pump"===n.auxType?"":"st12",!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"","on"===n.auxStatus||"1"===n.auxStatus?"".concat(n.auxColour):"".concat(n.auxOffColour),!n.showAux||[1,2].includes(n.additionalAuxLoad)?"none":"",n.auxType,"on"===n.auxStatus||"1"===n.auxStatus?"aux-icon":"aux-off-icon",n.showAux&&0!==n.additionalAuxLoad?"":"none",n.iconAuxLoad1,!n.showAux||[0,1].includes(n.additionalAuxLoad)?"none":"",n.iconAuxLoad2,"boiler"===n.iconEssentialLoad1&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"boiler"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"boiler"!==n.iconEssentialLoad1||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"boiler"!==n.iconEssentialLoad2||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"boiler"===n.iconEssentialLoad1&&1===n.additionalLoad?"1":"0",!n.showAux||[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"boiler"!==n.iconEssentialLoad1||1!==n.additionalLoad||n.showAux?"0":"1",[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"aircon"===n.iconEssentialLoad1&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"aircon"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"aircon"!==n.iconEssentialLoad1||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"aircon"!==n.iconEssentialLoad2||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"aircon"===n.iconEssentialLoad1&&1===n.additionalLoad?"1":"0",!n.showAux||[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"aircon"!==n.iconEssentialLoad1||1!==n.additionalLoad||n.showAux?"0":"1",[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"pump"===n.iconEssentialLoad1&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"pump"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"pump"!==n.iconEssentialLoad1||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"pump"!==n.iconEssentialLoad2||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"pump"===n.iconEssentialLoad1&&1===n.additionalLoad?"1":"0",!n.showAux||[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"pump"!==n.iconEssentialLoad1||1!==n.additionalLoad||n.showAux?"0":"1",[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"oven"===n.iconEssentialLoad1&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"oven"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",!n.showAux||[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"oven"!==n.iconEssentialLoad1||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"oven"!==n.iconEssentialLoad2||2!==n.additionalLoad||n.showAux?"0":"1",[0,1].includes(n.additionalLoad)?"none":"",n.loadColour,"oven"!==n.iconEssentialLoad1||1!==n.additionalLoad||n.showAux?"0":"1",[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,"oven"===n.iconEssentialLoad1&&1===n.additionalLoad?"1":"0",!n.showAux||[0,2].includes(n.additionalLoad)?"none":"",n.loadColour,[0,1].includes(n.additionalLoad)?"none":"",n.showAux?"371":"384",n.showAux?"123":"5",n.iconEssentialLoad1,[0,1].includes(n.additionalLoad)?"none":"",n.showAux?"429":"421",n.showAux?"123":"5",n.iconEssentialLoad2,[0,2].includes(n.additionalLoad)?"none":"",(n.showAux,"336"),n.showAux?"140":"27",n.iconEssentialLoad1,(t=>Qt.handlePopup(t,e.entities.use_timer_248)),n.enableAutarky!=be.No?"232":"249","on"==n.stateUseTimer.state&&n.enableTimer!==be.No?"":"none",n.inverterColour,n.enableAutarky!=be.No?"232":"249","off"==n.stateUseTimer.state&&"no"!==n.enableTimer?"":"none",n.inverterColour,n.enableAutarky!=be.No?"243":"260","on"==n.stateUseTimer.state&&"no"!==n.enableTimer?"":"none",n.inverterColour,At("common.timer_on"),n.enableAutarky!=be.No?"243":"260","off"==n.stateUseTimer.state&&"no"!==n.enableTimer?"":"none",n.inverterColour,At("common.timer_off"),(t=>Qt.handlePopup(t,e.entities.solar_sell_247)),e.entities.solar_sell_247&&"none"!==e.entities.solar_sell_247&&"off"!==n.stateSolarSell.state&&"0"!==n.stateSolarSell.state&&e.show_solar&&["1","on"].includes(n.stateSolarSell.state)?"":"none",n.solarColour,e.entities.solar_sell_247&&"none"!==e.entities.solar_sell_247&&"on"!==n.stateSolarSell.state&&"1"!==n.stateSolarSell.state&&e.show_solar&&["0","off"].includes(n.stateSolarSell.state)?"":"none",n.solarColour,(t=>Qt.handlePopup(t,e.entities.priority_load_243)),"no"!=n.enableAutarky?"251":"268","off"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,"no"!=n.enableAutarky?"251":"268","on"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,n.enableAutarky!=be.No?"262":"280","on"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,At("common.priority_load"),n.enableAutarky!=be.No?"262":"280","off"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,At("common.priority_batt"),n.genericInverterImage?"st12":"",t,(e=>Qt.handlePopup(e,n.inverterProg.entityID)),n.enableAutarky!=be.No?"232":"249",!1===n.inverterProg.show||"none"===e.entities.use_timer_248?"none":"","none"===n.inverterProg.charge?"st12":"",n.inverterColour,n.enableAutarky!=be.No?"232":"249",!1===n.inverterProg.show||"none"===e.entities.use_timer_248?"none":"","none"===n.inverterProg.charge?"":"st12",n.inverterColour,(t=>Qt.handlePopup(t,e.entities.day_pv_energy_108)),1===e.solar.display_mode?"":"none",n.solarShowDaily&&e.show_solar?"".concat(n.solarColour):"transparent",n.stateDayPVEnergy.toPowerString(e.solar.auto_scale,1),(t=>Qt.handlePopup(t,e.entities.day_pv_energy_108)),2===e.solar.display_mode?"":"none",n.solarShowDaily&&e.show_solar?"".concat(n.solarColour):"transparent",n.stateDayPVEnergy.toPowerString(e.solar.auto_scale,1),n.remainingSolar,(t=>Qt.handlePopup(t,e.entities.day_pv_energy_108)),3===e.solar.display_mode?"":"none",n.solarShowDaily&&e.show_solar?"".concat(n.solarColour):"transparent",n.stateDayPVEnergy.toPowerString(e.solar.auto_scale,1),n.totalSolarGeneration,(t=>Qt.handlePopup(t,e.entities.day_load_energy_84)),2===n.additionalAuxLoad?"238":"306",n.loadShowDaily&&n.showAux?"":"none",n.loadColour,n.stateDayLoadEnergy.toPowerString(e.load.auto_scale,1),(t=>Qt.handlePopup(t,e.entities.day_load_energy_84)),0===n.additionalLoad?"377":"306",0===n.additionalLoad?"57":"80",!n.loadShowDaily||n.showAux?"none":"",n.loadColour,n.stateDayLoadEnergy.toPowerString(e.load.auto_scale,1),(t=>Qt.handlePopup(t,e.entities.day_battery_charge_70)),!0===n.batteryShowDaily&&e.show_battery?"":"none",n.batteryColour,n.stateDayBatteryCharge.toPowerString(e.battery.auto_scale,1),(t=>Qt.handlePopup(t,e.entities.day_battery_discharge_71)),!0===n.batteryShowDaily&&e.show_battery?"":"none",n.batteryColour,n.stateDayBatteryDischarge.toPowerString(e.battery.auto_scale,1),(t=>Qt.handlePopup(t,e.entities.day_grid_import_76)),n.showNonessential?"347":"311",n.showNonessential?"239":"354",e.show_grid&&!0===n.gridShowDailyBuy?"":"none",n.gridColour,n.stateDayGridImport.toPowerString(e.grid.auto_scale,1),(t=>Qt.handlePopup(t,e.entities.day_grid_export_77)),n.showNonessential?"347":"311",n.showNonessential?"209":"323",e.show_grid&&!0===n.gridShowDailySell?"":"none",n.gridColour,n.stateDayGridExport.toPowerString(e.grid.auto_scale,1),(t=>Qt.handlePopup(t,e.entities.day_aux_energy)),[1,2].includes(n.additionalAuxLoad)?"238":"306",n.showAux&&!0===n.showDailyAux?"":"none",n.auxColour,n.stateDayAuxEnergy.toPowerString(e.load.auto_scale,1),(t=>Qt.handlePopup(t,e.entities.essential_load1_extra)),e.entities?.essential_load1_extra&&1===n.additionalLoad&&!n.showAux?"":"none",n.loadColour,n.stateEssentialLoad1Extra.toNum(1),n.stateEssentialLoad1Extra?.getUOM(),(t=>Qt.handlePopup(t,e.entities.essential_load1_extra)),e.entities?.essential_load1_extra&&2===n.additionalLoad&&!n.showAux?"":"none",n.loadColour,n.stateEssentialLoad1Extra.toNum(1),n.stateEssentialLoad1Extra?.getUOM(),(t=>Qt.handlePopup(t,e.entities.essential_load2_extra)),e.entities?.essential_load2_extra&&2===n.additionalLoad&&!n.showAux?"":"none",n.loadColour,n.stateEssentialLoad2Extra.toNum(1),n.stateEssentialLoad2Extra?.getUOM(),e.inverter.three_phase?e.entities?.grid_ct_power_total?U(Yt||(Yt=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.grid_ct_power_total)),e.show_grid&&"none"!==e.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,e.grid.auto_scale?"".concat(e.grid.show_absolute?"".concat(Math.abs(parseFloat(Qt.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(Qt.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):Qt.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(e.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," W"):"".concat(n.totalGridPower||0," W"))):U(Jt||(Jt=fe(['\n \n ',"\n "])),e.show_grid&&"none"!==e.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,e.grid.auto_scale?"".concat(e.grid.show_absolute?"".concat(Math.abs(parseFloat(Qt.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(Qt.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):Qt.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(e.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," W"):"".concat(n.totalGridPower||0," W"))):U(Kt||(Kt=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.grid_ct_power_172)),e.show_grid&&"none"!==e.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,e.grid.auto_scale?"".concat(e.grid.show_absolute?"".concat(Math.abs(parseFloat(Qt.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(Qt.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):Qt.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(e.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," W"):"".concat(n.totalGridPower||0," W"))),e.entities?.pv_total?U($t||($t=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.pv_total)),!0!==n.largeFont?"st14":"st4",e.show_solar&&1!==e.solar.mppts?"":"none",n.solarColour,e.solar.auto_scale?e.entities?.pv_total?Qt.convertValueNew(n.totalPV,n.statePVTotal?.getUOM(),n.decimalPlaces):Qt.convertValue(n.totalPV,n.decimalPlaces)||0:"".concat(Qt.toNum(n.totalPV||0,0)," W")):U(en||(en=fe(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",e.show_solar&&1!==e.solar.mppts?"":"none",n.solarColour,e.solar.auto_scale?e.entities?.pv_total?Qt.convertValueNew(n.totalPV,n.statePVTotal?.getUOM(),n.decimalPlaces):Qt.convertValue(n.totalPV,n.decimalPlaces)||0:"".concat(Qt.toNum(n.totalPV||0,0)," W")),e.entities?.essential_power&&"none"!==e.entities.essential_power?U(tn||(tn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.essential_power)),!0!==n.largeFont?"st14":"st4",n.loadColour,e.load.auto_scale?"".concat(Qt.convertValue(n.essentialPower,n.decimalPlaces)||0):"".concat(n.essentialPower||0," W")):U(nn||(nn=fe(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",n.loadColour,e.load.auto_scale?"".concat(Qt.convertValue(n.essentialPower,n.decimalPlaces)||0):"".concat(n.essentialPower||0," W")),e.entities?.nonessential_power?U(on||(on=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.nonessential_power)),e.show_grid&&n.showNonessential?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,e.grid.auto_scale?"".concat(Qt.convertValue(n.nonessentialPower,n.decimalPlaces)||0):"".concat(n.nonessentialPower||0," W")):U(an||(an=fe(['\n \n ',"\n "])),e.show_grid&&n.showNonessential?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,e.grid.auto_scale?"".concat(Qt.convertValue(n.nonessentialPower,n.decimalPlaces)||0):"".concat(n.nonessentialPower||0," W")),e.entities?.aux_power_166?U(rn||(rn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.aux_power_166)),!0!==n.largeFont?"st14":"st4",n.showAux?"":"none",n.auxColour,e.load.auto_scale?"".concat(e.load.show_absolute_aux?"".concat(Math.abs(parseFloat(Qt.convertValue(n.auxPower,n.decimalPlaces)))," ").concat(Qt.convertValue(n.auxPower,n.decimalPlaces).split(" ")[1]):Qt.convertValue(n.auxPower,n.decimalPlaces)||"0"):"".concat(e.load.show_absolute_aux?"".concat(Math.abs(n.auxPower)):n.auxPower||0," W")):U(sn||(sn=fe(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",n.showAux?"":"none",n.auxColour,e.load.auto_scale?"".concat(e.load.show_absolute_aux?"".concat(Math.abs(parseFloat(Qt.convertValue(n.auxPower,n.decimalPlaces)))," ").concat(Qt.convertValue(n.auxPower,n.decimalPlaces).split(" ")[1]):Qt.convertValue(n.auxPower,n.decimalPlaces)||"0"):"".concat(e.load.show_absolute_aux?"".concat(Math.abs(n.auxPower)):n.auxPower||0," W")),U(ln||(ln=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.pv1_power_186)),!0!==n.largeFont?"st14":"st4",e.show_solar?"":"none",n.solarColour,n.statePV1Power.toPowerString(e.solar.auto_scale,n.decimalPlaces)),U(dn||(dn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.pv2_power_187)),!0!==n.largeFont?"st14":"st4",e.show_solar&&1!==e.solar.mppts?"":"none",n.solarColour,n.statePV2Power.toPowerString(e.solar.auto_scale,n.decimalPlaces)),U(cn||(cn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.pv3_power_188)),!0!==n.largeFont?"st14":"st4",!e.show_solar||[1,2].includes(e.solar.mppts)?"none":"",n.solarColour,n.statePV3Power.toPowerString(e.solar.auto_scale,n.decimalPlaces)),U(un||(un=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.pv4_power_189)),!0!==n.largeFont?"st14":"st4",!e.show_solar||[1,2,3].includes(e.solar.mppts)?"none":"",n.solarColour,n.statePV4Power.toPowerString(e.solar.auto_scale,n.decimalPlaces)),U(hn||(hn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.aux_load1)),!0!==n.largeFont?"st14":"st4",n.showAux&&0!==n.additionalAuxLoad?"":"none",n.auxColour,n.stateAuxLoad1.toPowerString(e.load.auto_scale,n.decimalPlaces)),U(pn||(pn=fe(['\n \n ',"\n "])),!0!==n.largeFont?"st14":"st4",!n.showAux||[0,1].includes(n.additionalAuxLoad)?"none":"",n.auxColour,n.stateAuxLoad2.toPowerString(e.load.auto_scale,n.decimalPlaces)),U(gn||(gn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.non_essential_load1)),e.show_grid&&n.showNonessential&&![0,2,3].includes(n.nonessentialLoads)?"":"none",n.gridColour,n.stateNonessentialLoad1.toPowerString(e.grid.auto_scale,n.decimalPlaces)),U(yn||(yn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.non_essential_load1)),e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,n.stateNonessentialLoad1.toPowerString(e.grid.auto_scale,n.decimalPlaces)),U(mn||(mn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.non_essential_load2)),e.show_grid&&n.showNonessential&&![0,1].includes(n.nonessentialLoads)?"":"none",n.gridColour,n.stateNonessentialLoad1.toPowerString(e.grid.auto_scale,n.decimalPlaces)),U(fn||(fn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.non_essential_load3)),e.battery.hide_soc?"st3":"st12",e.show_grid&&n.showNonessential&&![0,1,2].includes(n.nonessentialLoads)?"":"none",n.gridColour,n.stateNonessentialLoad3.toPowerString(e.grid.auto_scale,n.decimalPlaces)),U(vn||(vn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.essential_load1)),n.showAux?"158":"47",1===n.additionalLoad?"":"none",!0!==n.largeFont?"st14":"st4",n.loadColour,n.stateEssentialLoad1.toPowerString(e.load.auto_scale,n.decimalPlaces)),U(wn||(wn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.essential_load1)),n.showAux?"391":"394",n.showAux?"160":"42",2===n.additionalLoad?"":"none",n.loadColour,n.stateEssentialLoad1.toPowerString(e.load.auto_scale,n.decimalPlaces)),U(_n||(_n=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.essential_load2)),n.showAux?"427":"430",n.showAux?"160":"42",2===n.additionalLoad?"":"none",n.loadColour,n.stateEssentialLoad2.toPowerString(e.load.auto_scale,n.decimalPlaces)),n.totalGridPower>=0?U(xn||(xn=fe(['\n \n \n '," ","\n "])),(t=>Qt.handlePopup(t,e.entities.energy_cost_buy)),e.show_grid?"st3 right-align":"st12",n.gridColour,e.entities?.energy_cost_buy?"":"none",n.energyCost,n.stateEnergyCostBuy?.getUOM()):U(bn||(bn=fe(['\n \n \n '," ","\n \n "])),(t=>Qt.handlePopup(t,e.entities.energy_cost_sell)),e.show_grid?"st3 right-align":"st12",n.gridColour,e.entities?.energy_cost_sell?"":"none",n.energyCost,n.stateEnergyCostSell?.getUOM()),(t=>Qt.handlePopup(t,e.entities.inverter_voltage_154)),e.inverter.three_phase?"164":"170.4",e.show_grid&&"none"!==e.entities.inverter_voltage_154&&e.entities.inverter_voltage_154?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,n.inverterVoltage,(t=>Qt.handlePopup(t,e.entities.inverter_voltage_L2)),e.inverter.three_phase&&e.entities?.inverter_voltage_L2?"":"none",e.show_grid?"".concat(!0!==n.largeFont?"st14 st8":"st4 st8"):"st12",n.gridColour,n.inverterVoltageL2,(t=>Qt.handlePopup(t,e.entities.inverter_voltage_L3)),e.inverter.three_phase&&e.entities?.inverter_voltage_L3?"":"none",e.show_grid?"".concat(!0!==n.largeFont?"st14 st8":"st4 st8"):"st12",n.gridColour,n.inverterVoltageL3,(t=>Qt.handlePopup(t,e.entities.load_frequency_192)),e.inverter.three_phase?"203":"189.5",e.show_grid&&"none"!==e.entities.load_frequency_192&&e.entities.load_frequency_192?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,n.loadFrequency,(t=>Qt.handlePopup(t,e.entities.inverter_current_164)),e.inverter.three_phase?"188":"199","none"!==e.entities.inverter_current_164&&e.entities.inverter_current_164?"":"none",!0!==n.largeFont?"st14":"st4",n.inverterColour,n.inverterCurrent,(t=>Qt.handlePopup(t,e.entities.inverter_current_L2)),e.inverter.three_phase&&e.entities?.inverter_current_L2?"":"none",!0!==n.largeFont?"st14":"st4",n.inverterColour,n.inverterCurrentL2,(t=>Qt.handlePopup(t,e.entities.inverter_current_L3)),e.inverter.three_phase&&e.entities?.inverter_current_L3?"":"none",!0!==n.largeFont?"st14":"st4",n.inverterColour,n.inverterCurrentL3,(t=>Qt.handlePopup(t,e.entities.battery_voltage_183)),"none"!==e.entities.battery_voltage_183&&e.entities.battery_voltage_183&&e.show_battery?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",n.batteryVoltage,(t=>Qt.handlePopup(t,e.entities.battery_soc_184)),"none"!==e.entities.battery_soc_184&&e.show_battery?"":"none",n.batteryColour,n.stateBatterySoc.toNum(),(t=>Qt.handlePopup(t,e.entities.battery_soc_184)),n.batteryColour,!1===n.inverterProg.show||"none"===e.entities.battery_soc_184||!e.show_battery||[_e.GoodweGridMode,_e.Goodwe,_e.Huawei].includes(n.inverterModel)||e.battery.hide_soc?"none":"",n.inverterProg.capacity||0,(t=>Qt.handlePopup(t,e.entities.battery_soc_184)),n.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st13 st8 left-align",[_e.GoodweGridMode,_e.Goodwe,_e.Huawei].includes(n.inverterModel)&&e.battery?.shutdown_soc&&!e.battery?.shutdown_soc_offgrid?"":"none",n.batteryShutdown||0,(t=>Qt.handlePopup(t,e.entities.battery_soc_184)),n.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st13 st8 left-align",[_e.GoodweGridMode,_e.Goodwe,_e.Huawei].includes(n.inverterModel)&&e.battery?.shutdown_soc_offgrid?"":"none",(t=>Qt.handlePopup(t,e.entities.battery_power_190)),"none"!==e.entities.battery_power_190&&e.show_battery?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",e.battery.auto_scale?"".concat(e.battery.show_absolute?"".concat(Math.abs(parseFloat(Qt.convertValue(n.batteryPower,n.decimalPlaces)))," ").concat(Qt.convertValue(n.batteryPower,n.decimalPlaces).split(" ")[1]):Qt.convertValue(n.batteryPower,n.decimalPlaces)||"0"):"".concat(e.battery.show_absolute?"".concat(Math.abs(n.batteryPower)," W"):"".concat(n.batteryPower||0," W")),(t=>Qt.handlePopup(t,e.entities.battery_current_191)),"none"!==e.entities.battery_current_191&&e.show_battery?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",e.battery.show_absolute?Math.abs(Qt.toNum(n.stateBatteryCurrent.state,1)):Qt.toNum(n.stateBatteryCurrent.state,1),(t=>Qt.handlePopup(t,e.entities.inverter_power_175)),e.inverter.three_phase?"174":"178","none"===e.entities.inverter_power_175?"none":"",!0!==n.largeFont?"st14":"st4",n.inverterColour,e.inverter.auto_scale?"".concat(Qt.convertValue(n.autoScaledInverterPower,n.decimalPlaces)||0):"".concat(n.autoScaledInverterPower," W"),(t=>Qt.handlePopup(t,e.entities.grid_power_169)),e.inverter.three_phase?"216":"209",e.show_grid&&"none"!==e.entities.grid_power_169?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,e.grid.auto_scale?"".concat(e.grid.show_absolute?"".concat(Math.abs(parseFloat(Qt.convertValue(n.autoScaledGridPower,n.decimalPlaces)))," ").concat(Qt.convertValue(n.autoScaledGridPower,n.decimalPlaces).split(" ")[1]):Qt.convertValue(n.autoScaledGridPower,n.decimalPlaces)||0):"".concat(e.grid.show_absolute?"".concat(Math.abs(n.autoScaledGridPower)," W"):"".concat(n.autoScaledGridPower||0," W")),(t=>Qt.handlePopup(t,e.entities.pv1_voltage_109)),e.show_solar&&e.entities.pv1_voltage_109&&"none"!==e.entities.pv1_voltage_109?"":"none",n.solarColour,n.statePV1Voltage.toNum(1),It.VOLT,(t=>Qt.handlePopup(t,e.entities.pv1_current_110)),e.show_solar&&e.entities.pv1_current_110&&"none"!==e.entities.pv1_current_110?"":"none",n.solarColour,n.statePV1Current.toNum(1),St.AMPERE,(t=>Qt.handlePopup(t,e.entities.pv2_voltage_111)),e.show_solar&&e.entities.pv2_voltage_111&&"none"!==e.entities.pv2_voltage_111&&1!==e.solar.mppts?"":"none",n.solarColour,n.statePV2Voltage.toNum(1),It.VOLT,(t=>Qt.handlePopup(t,e.entities.pv2_current_112)),e.show_solar&&e.entities.pv2_current_112&&"none"!==e.entities.pv2_current_112&&1!==e.solar.mppts?"":"none",n.solarColour,n.statePV2Current.toNum(1),St.AMPERE,(t=>Qt.handlePopup(t,e.entities.pv3_voltage_113)),e.show_solar&&e.entities.pv3_voltage_113&&"none"!==e.entities.pv3_voltage_113&&![1,2].includes(e.solar.mppts)?"":"none",n.solarColour,n.statePV3Voltage.toNum(1),It.VOLT,(t=>Qt.handlePopup(t,e.entities.pv3_current_114)),e.show_solar&&e.entities.pv3_current_114&&"none"!==e.entities.pv3_current_114&&![1,2].includes(e.solar.mppts)?"":"none",n.solarColour,n.statePV3Current.toNum(1),St.AMPERE,(t=>Qt.handlePopup(t,e.entities.pv4_voltage_115)),e.show_solar&&e.entities.pv4_voltage_115&&"none"!==e.entities.pv4_voltage_115&&![1,2,3].includes(e.solar.mppts)?"":"none",n.solarColour,n.statePV4Voltage.toNum(1),It.VOLT,(t=>Qt.handlePopup(t,e.entities.pv4_current_116)),e.show_solar&&e.entities.pv4_current_116&&"none"!==e.entities.pv4_current_116&&![1,2,3].includes(e.solar.mppts)?"":"none",n.solarColour,n.statePV4Current.toNum(1),St.AMPERE,(t=>Qt.handlePopup(t,e.entities.battery_temp_182)),e.entities?.battery_temp_182?"st3 left-align":"st12",n.batteryColour,e.show_battery?"":"none",n.stateBatteryTemp.toNum(1),(t=>Qt.handlePopup(t,e.entities.radiator_temp_91)),4===e.solar?.mppts?"110":"158",4===e.solar?.mppts?"237":"153",n.inverterColour,e.entities?.radiator_temp_91?"":"none",n.stateRadiatorTemp.toNum(1),(t=>Qt.handlePopup(t,e.entities.dc_transformer_temp_90)),n.inverterColour,e.entities?.dc_transformer_temp_90?"":"none",n.stateDCTransformerTemp.toNum(1),(t=>Qt.handlePopup(t,e.entities.environment_temp)),e.entities?.environment_temp?"st3 left-align":"st12",n.solarColour,e.show_solar?"":"none",n.stateEnvironmentTemp.toNum(1),(t=>Qt.handlePopup(t,e.entities.prepaid_units)),e.entities?.prepaid_units?"st3 left-align":"st12",n.gridColour,e.show_grid?"":"none",n.statePrepaidUnits.toNum(1)))(e,eo,Oa):this.isLiteCard||this.isCompactCard?((e,t,n)=>W(An||(An=fe(["\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 \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 \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 ','\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 \n \n ','\n \n \n ','\n \n \n ','\n kWh\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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 ','\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 V\n \n \n \n ',' Hz\n \n \n \n ',"\n ","\n ",'\n A\n \n \n \n \n ',' V\n \n \n \n \n ',' V\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 \n \n ','\n A\n \n \n \n \n ',"\n A\n \n \n ",'\n \n ',' V\n \n \n \n ',' A\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 \n ',"\n ",'\n \n \n \n \n ','°\n \n \n \n \n AC:\n ','°\n \n \n \n \n DC:\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 ","\n ","\n ","\n ","\n ","\n ",'\n \n \n ',"\n \n \n
\n
\n
\n "])),n.loadColour,n.loadColour,e.title?W(Pn||(Pn=fe(['\n ',""])),e.title_colour||"inherit",e.title_size||"32px",e.title):"",e.show_solar?-.5:0===n.additionalLoad&&e.show_battery?145.33:80,e.show_solar?e.show_battery?406:2===n.additionalLoad?350:300:e.show_battery&&0!==n.additionalLoad?350:270.67,!1===n.panelMode?"".concat(e.show_solar||e.show_battery?e.show_solar?e.show_solar&&!e.show_battery?2===n.additionalLoad?"350px":"300px":"".concat(n.cardHeight):0!==n.additionalLoad?"330px":"246px":"270px"):"".concat(e.show_solar?"100%":"75%"),!0===n.panelMode?"".concat(n.cardWidth):"100%",n.loadColour,n.solarColour,1===e.solar.mppts?"none":"",e.show_solar?"":"st12",n.batteryColour,e.show_battery?"":"none",n.compactMode?"":"st12",n.compactMode?"348":"329.75",n.compactMode?"50":"70",n.compactMode?"7.5":"10.5",n.compactMode?"7.5":"10.5",n.batteryColour,e.show_battery?"":"none",n.compactMode?"st12":"",n.gridColour,e.show_grid?"":"none",1===e.solar.mppts?"205":"154",n.solarColour,e.show_solar?"":"st12",n.solarColour,e.show_solar&&1!==e.solar.mppts?"":"st12",n.solarColour,!e.show_solar||[1,2].includes(e.solar.mppts)?"st12":"",n.solarColour,!e.show_solar||[1,2,3].includes(e.solar.mppts)?"st12":"",n.loadColour,1===n.additionalLoad?"":"none",n.loadColour,2===n.additionalLoad?"":"none",n.loadColour,2===n.additionalLoad?"":"none",n.loadColour,4===n.additionalLoad?"":"none",n.loadColour,4===n.additionalLoad?"":"none",n.loadColour,4===n.additionalLoad?"":"none",n.loadColour,4===n.additionalLoad?"":"none",n.compactMode?"270":"290",!0!==n.largeFont?"st14":"st4",e.show_battery?"":"none",0===n.batteryEnergy||n.isFloating||0===n.batteryPower?"transparent":"".concat(n.batteryColour),n.batteryDuration,n.compactMode?"270":"290",e.show_battery?"":"none",0===n.batteryEnergy||n.batteryPower<=0||n.isFloating?"transparent":"".concat(n.batteryColour),At("common.runtime_to"),n.batteryCapacity,n.formattedResultTime,n.compactMode?"270":"290",e.show_battery?"":"none",0===n.batteryEnergy||n.batteryPower>=0||n.isFloating?"transparent":"".concat(n.batteryColour),At("common.to"),n.batteryCapacity,At("common.charge"),n.formattedResultTime,n.compactMode?"270":"290",e.show_battery?"":"none",0!==n.batteryEnergy&&n.isFloating?"".concat(n.batteryColour):"transparent",At("common.battery_floating"),n.compactMode?"132":"77.2",!0===n.batteryShowDaily&&e.show_battery?"".concat(n.batteryColour):"transparent",At("common.daily_charge"),n.compactMode?"132":"77.2",!0===n.batteryShowDaily&&e.show_battery?"".concat(n.batteryColour):"transparent",At("common.daily_discharge"),[2,4].includes(n.additionalLoad)?"365":"412",[2,4].includes(n.additionalLoad)?"189":"282.1",n.loadShowDaily?"".concat(n.loadColour):"transparent",At("common.daily_load"),!0!==n.gridShowDailyBuy?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",At("common.daily_grid_buy"),!0!==n.gridShowDailySell?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",At("common.daily_grid_sell"),1===e.solar.display_mode?"":"none",n.solarShowDaily&&e.show_solar?"".concat(n.solarColour):"transparent",At("common.daily_solar"),2===e.solar.display_mode?"":"none",n.solarShowDaily&&e.show_solar?"".concat(n.solarColour):"transparent",At("common.daily_solar_left"),3===e.solar.display_mode?"":"none",n.solarShowDaily&&e.show_solar?"".concat(n.solarColour):"transparent",At("common.total_solar_generation"),1===e.solar.mppts?"212.7":"162",e.show_solar?"":"none",n.solarColour,e.solar.pv1_name,e.show_solar&&1!==e.solar.mppts?"":"none",n.solarColour,e.solar.pv2_name,!e.show_solar||[1,2].includes(e.solar.mppts)?"none":"",n.solarColour,e.solar.pv3_name,!e.show_solar||[1,2,3].includes(e.solar.mppts)?"none":"",n.solarColour,e.solar.pv4_name,n.enableAutarky===be.No?"none":"",n.enableAutarky===be.Energy?"st4 st8 left-align":"st12",n.inverterColour,n.autarkyEnergy,n.enableAutarky===be.No?"none":"",n.enableAutarky===be.Energy?"st4 st8 left-align":"st12",n.inverterColour,n.ratioEnergy,n.enableAutarky===be.No?"none":"",n.enableAutarky===be.Power?"st4 st8 left-align":"st12",n.inverterColour,n.autarkyPower,n.enableAutarky===be.No?"none":"",n.enableAutarky===be.Power?"st4 st8 left-align":"st12",n.inverterColour,n.ratioPower,n.enableAutarky===be.No?"none":"",n.inverterColour,At("common.autarky"),n.enableAutarky===be.No?"none":"",n.inverterColour,At("common.ratio"),[1,2].includes(n.additionalLoad)?"":"none",n.loadColour,e.load?.load1_name?"".concat(e.load.load1_name):"",2===n.additionalLoad?"":"none",n.loadColour,e.load?.load2_name?"".concat(e.load.load2_name):"",4===n.additionalLoad?"":"none",n.loadColour,e.load?.load1_name?"".concat(e.load.load1_name):"",4===n.additionalLoad?"":"none",n.loadColour,e.load?.load2_name?"".concat(e.load.load2_name):"",4===n.additionalLoad?"":"none",n.loadColour,e.load?.load3_name?"".concat(e.load.load3_name):"",4===n.additionalLoad?"":"none",n.loadColour,e.load?.load4_name?"".concat(e.load.load4_name):"",e.inverter.three_phase&&e.entities?.load_power_L1?"":"none",n.loadColour,e.load.auto_scale?"".concat(Qt.convertValue(n.loadPowerL1,n.decimalPlaces)||0):"".concat(n.loadPowerL1||0," ").concat(Nt.WATT),e.inverter.three_phase&&e.entities?.load_power_L2?"":"none",n.loadColour,e.load.auto_scale?"".concat(Qt.convertValue(n.loadPowerL2,n.decimalPlaces)||0):"".concat(n.loadPowerL2||0," ").concat(Nt.WATT),e.inverter.three_phase&&e.entities?.load_power_L3?"":"none",n.loadColour,e.load.auto_scale?"".concat(Qt.convertValue(n.loadPowerL3,n.decimalPlaces)||0):"".concat(n.loadPowerL3||0," ").concat(Nt.WATT),e.inverter.three_phase?"":"none",e.show_grid?"st3 left-align":"st12",n.gridColour,e.load.auto_scale?"".concat(Qt.convertValue(n.gridPower,n.decimalPlaces)||0):"".concat(n.gridPower||0," ").concat(Nt.WATT),e.inverter.three_phase&&e.entities?.grid_ct_power_L2?"":"none",e.show_grid?"st3 left-align":"st12",n.gridColour,e.load.auto_scale?"".concat(Qt.convertValue(n.gridPowerL2,n.decimalPlaces)||0):"".concat(n.gridPowerL2||0," ").concat(Nt.WATT),e.inverter.three_phase&&e.entities?.grid_ct_power_L3?"":"none",e.show_grid?"st3 left-align":"st12",n.gridColour,e.load.auto_scale?"".concat(Qt.convertValue(n.gridPowerL3,n.decimalPlaces)||0):"".concat(n.gridPowerL3||0," ").concat(Nt.WATT),e.battery.show_remaining_energy?"311":"320",!e.show_battery||n.compactMode?"none":"",n.batteryColour,n.batteryStateMsg,n.compactMode?"270":e.entities?.battery_status?"169":"193",n.compactMode?"338":"323",e.entities?.battery_status||n.compactMode?"st3 left-align":"st3",e.show_battery&&e.battery.show_remaining_energy?"":"none",n.batteryColour,Qt.toNum(n.batteryEnergy*(n.stateBatterySoc.toNum(2)/100)/1e3,2),n.compactMode?"348.5":"368.5",n.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st14 left-align",[_e.GoodweGridMode,_e.Goodwe,_e.Huawei].includes(n.inverterModel)&&e.battery?.shutdown_soc_offgrid?"":"none",n.batteryShutdown,n.compactMode?"348.5":"368.5",n.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st14 left-align",[_e.GoodweGridMode,_e.Goodwe,_e.Huawei].includes(n.inverterModel)&&e.battery?.shutdown_soc_offgrid?"":"none",n.shutdownOffGrid,n.inverterStateColour,n.compactMode?"238.5":"162",n.compactMode?"326":e.battery.show_remaining_energy?"310":"319","none"!==e.entities?.battery_status&&e.entities?.battery_status&&e.show_battery?"":"none",n.batteryStateColour,1===e.solar.mppts?"M 239.23 84 L 239 190":"M 187 84 L 187 122 Q 187 132 195 132 L 205 132.03",e.show_solar?"":"st12",n.solarColour,n.pv1LineWidth,Math.min(2+n.pv1LineWidth+Math.max(n.minLineWidth-2,0),8),e.show_solar?"":"st12",Math.round(n.pv1PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv1,e.show_solar&&1!==e.solar.mppts?"":"st12",n.solarColour,n.pv2LineWidth,Math.min(2+n.pv2LineWidth+Math.max(n.minLineWidth-2,0),8),e.show_solar&&1!==e.solar.mppts?"":"st12",Math.round(n.pv2PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv2,!e.show_solar||[1,2].includes(e.solar.mppts)?"st12":"",n.solarColour,n.pv3LineWidth,Math.min(2+n.pv3LineWidth+Math.max(n.minLineWidth-2,0),8),!e.show_solar||[1,2].includes(e.solar.mppts)?"st12":"",Math.round(n.pv3PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv3,!e.show_solar||[1,2,3].includes(e.solar.mppts)?"st12":"",n.solarColour,n.pv4LineWidth,Math.min(2+n.pv4LineWidth+Math.max(n.minLineWidth-2,0),8),!e.show_solar||[1,2,3].includes(e.solar.mppts)?"st12":"",Math.round(n.pv4PowerWatts)<=0?"transparent":"".concat(n.solarColour),n.durationCur.pv4,n.compactMode?"M 239 250 L 239 290":"M 239 250 L 239 324",e.show_battery?"":"st12",n.batteryColour,n.batLineWidth,Math.min(2+n.batLineWidth+Math.max(n.minLineWidth-2,0),8),e.show_battery?"":"st12",n.batteryPower<0||0===n.batteryPower?"transparent":"".concat(n.batteryColour),n.durationCur.battery,Math.min(2+n.batLineWidth+Math.max(n.minLineWidth-2,0),8),e.show_battery?"":"st12",n.batteryPower>0||0===n.batteryPower?"transparent":"".concat(n.batteryColour),n.durationCur.battery,e.show_solar&&1!==e.solar.mppts?"":"st12",n.solarColour,n.solarLineWidth,Math.min(2+n.solarLineWidth+Math.max(n.minLineWidth-2,0),8),e.show_solar&&1!==e.solar.mppts?"":"st12",0===n.totalPV?"transparent":"".concat(n.solarColour),n.durationCur.solar,n.gridColour,n.gridLineWidth,e.show_grid?"":"none",Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower<0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",n.durationCur.grid,Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower>0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",n.durationCur.grid,n.gridColour,n.gridLineWidth,e.show_grid?"":"none",Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower<0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",n.durationCur.grid,Math.min(2+n.gridLineWidth+Math.max(n.minLineWidth-2,0),8),n.totalGridPower>0||0===n.totalGridPower?"transparent":"".concat(n.gridColour),e.show_grid?"":"none",n.durationCur.grid,n.loadColour,n.loadLineWidth,Math.min(2+n.loadLineWidth+Math.max(n.minLineWidth-2,0),8),0===n.essentialPower?"transparent":"".concat(n.loadColour),n.durationCur.load,n.loadColour,n.loadLineWidth,Math.min(2+n.loadLineWidth+Math.max(n.minLineWidth-2,0),8),0===n.essentialPower?"transparent":"".concat(n.loadColour),n.durationCur.load,1===n.additionalLoad?"":"st12",n.loadColour,[2,4].includes(n.additionalLoad)?"":"st12",n.loadColour,[2,4].includes(n.additionalLoad)?"":"st12",n.loadColour,"oven"===n.iconEssentialLoad1&&[1,2].includes(n.additionalLoad)?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"oven"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"pump"===n.iconEssentialLoad1&&[1,2].includes(n.additionalLoad)?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"pump"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"aircon"===n.iconEssentialLoad1&&[1,2].includes(n.additionalLoad)?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"aircon"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"boiler"===n.iconEssentialLoad1&&[1,2].includes(n.additionalLoad)?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,"boiler"===n.iconEssentialLoad2&&2===n.additionalLoad?"1":"0",0===n.additionalLoad?"none":"",n.loadColour,[0,4].includes(n.additionalLoad)?"none":"",n.iconEssentialLoad1,[0,1,4].includes(n.additionalLoad)?"none":"",n.iconEssentialLoad2,4===n.additionalLoad?"":"none",n.iconEssentialLoad1,4===n.additionalLoad?"":"none",n.iconEssentialLoad2,4===n.additionalLoad?"":"none",n.iconEssentialLoad3,4===n.additionalLoad?"":"none",n.iconEssentialLoad4,e.show_solar?"":"st12",n.solarColour,n.compactMode?"212.5":"232.5",Number(n.pvPercentageBat)>0?n.solarColour:Number(n.gridPercentageBat)>0?n.gridColour:n.batteryColour,n.pvPercentageBat<2?0:n.pvPercentageBat,Number(n.pvPercentageBat)>0?n.solarColour:Number(n.gridPercentageBat)>0?n.gridColour:n.batteryColour,n.pvPercentageBat<2?0:n.pvPercentageBat,Number(n.gridPercentageBat)>0?n.gridColour:n.batteryColour,Number(n.pvPercentageBat<2?0:n.pvPercentageBat)+Number(n.gridPercentageBat<2?0:n.gridPercentageBat),Number(n.gridPercentageBat)>0?"".concat(n.gridColour):"".concat(n.batteryColour),Number(n.pvPercentageBat<2?0:n.pvPercentageBat)+Number(n.gridPercentageBat<2?0:n.gridPercentageBat),100===Number(n.pvPercentageBat)?n.solarColour:100===Number(n.gridPercentageBat)?n.gridColour:n.batteryColour,100===Number(n.pvPercentageBat)?n.solarColour:100===Number(n.gridPercentageBat)?n.gridColour:n.batteryColour,e.show_battery?"":"st12",e.battery.dynamic_colour?"url(#bLg)":n.batteryColour,e.battery.linear_gradient?n.battery0:n.batteryIcon,n.compactMode?"212.5":"232.5",n.stopColour,e.show_battery?"":"st12",e.battery.linear_gradient?"url(#sLg)":n.batteryColour,e.battery.linear_gradient?"":"none",n.batteryCharge,(t=>Qt.handlePopup(t,e.entities.grid_connected_status_194)),["off","0","off-grid","off grid","offgrid"].includes(n.gridStatus.toLowerCase())?"st12":"",n.gridColour,!e.show_grid||n.totalGridPower<0?"none":"",["on","1","on-grid","on grid","ongrid"].includes(n.gridStatus.toLowerCase())?"st12":"",n.gridOffColour,e.show_grid?"":"none",["off","0","off-grid","off grid"].includes(n.gridStatus.toLowerCase())?"st12":"",n.gridColour,!e.show_grid||n.totalGridPower>=0?"none":"",1===n.essIconSize?"405":"402",1===n.essIconSize?"186":"177.5",1===n.essIconSize?"75":"79",1===n.essIconSize?"75":"79",Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.batteryPercentage)>0?n.batteryColour:Number(n.pvPercentage)>0?n.solarColour:n.gridColour,n.batteryPercentage<2?0:n.batteryPercentage,Number(n.pvPercentage)>0?n.solarColour:n.gridColour,Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),Number(n.pvPercentage)>0?"".concat(n.solarColour):"".concat(n.gridColour),Number(n.batteryPercentage<2?0:n.batteryPercentage)+Number(n.pvPercentage<2?0:n.pvPercentage),100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,100===Number(n.batteryPercentage)?n.batteryColour:100===Number(n.pvPercentage)?n.solarColour:n.gridColour,e.load.dynamic_colour?"url(#Lg)":n.loadColour,n.essIcon,n.genericInverterImage?1:0,n.inverterColour,(t=>Qt.handlePopup(t,e.entities.use_timer_248)),"on"==n.stateUseTimer.state&&!1!==n.enableTimer?"":"none",n.inverterColour,"off"==n.stateUseTimer.state&&!1!==n.enableTimer?"":"none",n.inverterColour,"off"==n.stateUseTimer.state&&!1!==n.enableTimer?"":"none",n.inverterColour,At("common.timer_off"),"on"==n.stateUseTimer.state&&!1!==n.enableTimer?"":"none",n.inverterColour,At("common.timer_on"),(t=>Qt.handlePopup(t,e.entities.priority_load_243)),"off"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,"on"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,"off"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,At("common.priority_batt"),"on"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,At("common.priority_load"),(t=>Qt.handlePopup(t,e.entities.solar_sell_247)),e.entities.solar_sell_247&&"off"!==n.stateSolarSell.state&&"0"!==n.stateSolarSell.state&&e.show_solar&&["1","on"].includes(n.stateSolarSell.state)?"":"none",n.solarColour,e.entities.solar_sell_247&&"on"!==n.stateSolarSell.state&&"1"!==n.stateSolarSell.state&&e.show_solar&&["0","off"].includes(n.stateSolarSell.state)?"":"none",n.solarColour,n.genericInverterImage?"st12":"",t,(e=>Qt.handlePopup(e,n.inverterProg.entityID)),!1===n.inverterProg.show||"none"===e.entities.use_timer_248?"none":"","none"===n.inverterProg.charge?"st12":"",n.inverterColour,!1===n.inverterProg.show||"none"===e.entities.use_timer_248?"none":"","none"===n.inverterProg.charge?"":"st12",n.inverterColour,(t=>Qt.handlePopup(t,e.entities.day_battery_charge_70)),n.compactMode?"132":"77.2",!0===n.batteryShowDaily&&e.show_battery?"":"none",n.batteryColour,n.stateDayBatteryCharge?.toPowerString(e.battery.auto_scale),(t=>Qt.handlePopup(t,e.entities.day_pv_energy_108)),1===e.solar.display_mode?"":"none",n.solarShowDaily&&e.show_solar?"".concat(n.solarColour):"transparent",n.stateDayPVEnergy?.toPowerString(e.solar.auto_scale),(t=>Qt.handlePopup(t,e.entities.day_pv_energy_108)),2===e.solar.display_mode?"":"none",n.solarShowDaily&&e.show_solar?"".concat(n.solarColour):"transparent",n.stateDayPVEnergy?.toPowerString(e.solar.auto_scale)+" / "+n.remainingSolar,(t=>Qt.handlePopup(t,e.entities.day_pv_energy_108)),3===e.solar.display_mode?"":"none",n.solarShowDaily&&e.show_solar?"".concat(n.solarColour):"transparent",n.stateDayPVEnergy?.toPowerString(e.solar.auto_scale)+" / "+n.totalSolarGeneration,(t=>Qt.handlePopup(t,e.entities.day_battery_discharge_71)),n.compactMode?"132":"77.2",!0===n.batteryShowDaily&&e.show_battery?"":"none",n.batteryColour,n.stateDayBatteryDischarge?.toPowerString(e.solar.auto_scale),(t=>Qt.handlePopup(t,e.entities.day_load_energy_84)),[2,4].includes(n.additionalLoad)?"365":"412",[2,4].includes(n.additionalLoad)?"175":"267.9",n.loadShowDaily?"":"none",n.loadColour,n.stateDayLoadEnergy?.toPowerString(e.load.auto_scale),(t=>Qt.handlePopup(t,e.entities.day_grid_import_76)),e.show_grid&&!0===n.gridShowDailyBuy?"":"none",n.gridColour,n.stateDayGridImport?.toPowerString(e.grid.auto_scale),(t=>Qt.handlePopup(t,e.entities.day_grid_export_77)),e.show_grid&&!0===n.gridShowDailySell?"":"none",n.gridColour,n.stateDayGridExport?.toPowerString(e.grid.auto_scale),(t=>Qt.handlePopup(t,e.entities.inverter_voltage_154)),"none"!==e.entities.inverter_voltage_154&&e.entities.inverter_voltage_154?"":"none",n.inverterColour,n.inverterVoltage,e.inverter.three_phase&&e.entities?.inverter_voltage_L2?"| "+n.inverterVoltageL2:"",e.inverter.three_phase&&e.entities?.inverter_voltage_L3?"| "+n.inverterVoltageL3:"",(t=>Qt.handlePopup(t,e.entities.load_frequency_192)),"none"!==e.entities.load_frequency_192&&e.entities.load_frequency_192?"":"none",n.inverterColour,n.loadFrequency,(t=>Qt.handlePopup(t,e.entities.inverter_current_164)),"none"!==e.entities.inverter_current_164&&e.entities.inverter_current_164?"":"none",n.inverterColour,n.inverterCurrent,e.inverter.three_phase&&e.entities?.inverter_current_L2?"| "+n.inverterCurrentL2:"",e.inverter.three_phase&&e.entities?.inverter_current_L3?"| "+n.inverterCurrentL3:"",(t=>Qt.handlePopup(t,e.entities.battery_voltage_183)),"none"!==e.entities.battery_voltage_183&&e.entities.battery_voltage_183&&e.show_battery&&!n.compactMode?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",n.batteryVoltage,(t=>Qt.handlePopup(t,e.entities.battery_voltage_183)),"none"!==e.entities.battery_voltage_183&&e.entities.battery_voltage_183&&e.show_battery&&n.compactMode?"":"none",n.batteryColour,n.compactMode?"st3 left-align":"st12",n.batteryVoltage,(t=>Qt.handlePopup(t,e.entities.battery_soc_184)),n.compactMode?"270":"290","none"!==e.entities.battery_soc_184&&e.show_battery&&n.stateBatterySoc.isValid()?"":"none",n.batteryColour,n.stateBatterySoc.toNum(1),(t=>Qt.handlePopup(t,e.entities.battery_soc_184)),n.compactMode?"335":"355",n.batteryColour,!1===n.inverterProg.show||"none"===e.entities.battery_soc_184||!e.show_battery||[_e.GoodweGridMode,_e.Goodwe,_e.Huawei].includes(n.inverterModel)||e.battery.hide_soc?"none":"",n.inverterProg.capacity||0,(t=>Qt.handlePopup(t,e.entities.battery_soc_184)),n.compactMode?"335":"355",n.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st13 st8 left-align",[_e.GoodweGridMode,_e.Goodwe,_e.Huawei].includes(n.inverterModel)&&e.battery?.shutdown_soc&&!e.battery?.shutdown_soc_offgrid?"":"none",n.batteryShutdown||0,(t=>Qt.handlePopup(t,e.entities.battery_soc_184)),n.compactMode?"335":"355",n.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st13 st8 left-align",[_e.GoodweGridMode,_e.Goodwe,_e.Huawei].includes(n.inverterModel)&&e.battery.shutdown_soc_offgrid?"":"none",(t=>Qt.handlePopup(t,e.entities.battery_power_190)),n.compactMode?"239":"193",n.compactMode?"307":"386","none"!==e.entities.battery_power_190&&e.show_battery?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",e.battery.auto_scale?"".concat(e.battery.show_absolute?"".concat(Math.abs(parseFloat(Qt.convertValue(n.batteryPower,n.decimalPlaces)))," ").concat(Qt.convertValue(n.batteryPower,n.decimalPlaces).split(" ")[1]):Qt.convertValue(n.batteryPower,n.decimalPlaces)||"0"):"".concat(e.battery.show_absolute?"".concat(Math.abs(n.batteryPower)," ").concat(Nt.WATT):"".concat(n.batteryPower||0," ").concat(Nt.WATT)),(t=>Qt.handlePopup(t,e.entities.battery_current_191)),e.entities.battery_current_191&&"none"!==e.entities.battery_current_191&&e.show_battery&&!n.compactMode&&n.stateBatteryCurrent.isValid()?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",e.battery.show_absolute?Math.abs(n.stateBatteryCurrent.toNum(1)):n.stateBatteryCurrent.toNum(1),(t=>Qt.handlePopup(t,e.entities.battery_current_191)),e.entities.battery_current_191&&"none"!==e.entities.battery_current_191&&e.show_battery&&n.compactMode&&n.stateBatteryCurrent.isValid()?"":"none",n.batteryColour,n.compactMode?"st3 left-align":"st12",e.battery.show_absolute?Math.abs(n.stateBatteryCurrent.toNum(1)):n.stateBatteryCurrent.toNum(1),e.inverter.three_phase?e.entities?.grid_ct_power_total?U(Ln||(Ln=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.grid_ct_power_total)),e.show_grid&&"none"!==e.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,e.grid.auto_scale?"".concat(e.grid.show_absolute?"".concat(Math.abs(parseFloat(Qt.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(Qt.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):Qt.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(e.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," ").concat(Nt.WATT):"".concat(n.totalGridPower||0," ").concat(Nt.WATT))):U(Cn||(Cn=fe(['\n \n ',"\n "])),e.show_grid&&"none"!==e.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,e.grid.auto_scale?"".concat(e.grid.show_absolute?"".concat(Math.abs(parseFloat(Qt.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(Qt.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):Qt.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(e.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," ").concat(Nt.WATT):"".concat(n.totalGridPower||0," ").concat(Nt.WATT))):U(En||(En=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.grid_ct_power_172)),e.show_grid&&"none"!==e.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,e.grid.auto_scale?"".concat(e.grid.show_absolute?"".concat(Math.abs(parseFloat(Qt.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(Qt.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):Qt.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(e.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," ").concat(Nt.WATT):"".concat(n.totalGridPower||0," ").concat(Nt.WATT))),(t=>Qt.handlePopup(t,e.entities.pv1_voltage_109)),1===e.solar.mppts?"244.7":"194",e.show_solar&&e.entities.pv1_voltage_109&&"none"!==e.entities.pv1_voltage_109&&n.statePV1Voltage.isValid()?"":"none",n.solarColour,n.statePV1Voltage.toNum(1),(t=>Qt.handlePopup(t,e.entities.pv1_current_110)),1===e.solar.mppts?"244.7":"194",e.show_solar&&e.entities.pv1_current_110&&"none"!==e.entities.pv1_current_110&&n.statePV1Current.isValid()?"":"none",n.solarColour,n.statePV1Current.toNum(1),(t=>Qt.handlePopup(t,e.entities.pv2_voltage_111)),e.show_solar&&e.entities.pv2_voltage_111&&"none"!==e.entities.pv2_voltage_111&&1!==e.solar.mppts&&n.statePV2Voltage.isValid()?"":"none",n.solarColour,n.statePV2Voltage.toNum(1),It.VOLT,(t=>Qt.handlePopup(t,e.entities.pv2_current_112)),e.show_solar&&e.entities.pv2_current_112&&"none"!==e.entities.pv2_current_112&&1!==e.solar.mppts&&n.statePV2Current.isValid()?"":"none",n.solarColour,n.statePV2Current.toNum(1),St.AMPERE,(t=>Qt.handlePopup(t,e.entities.pv3_voltage_113)),e.show_solar&&e.entities.pv3_voltage_113&&"none"!==e.entities.pv3_voltage_113&&![1,2].includes(e.solar.mppts)&&n.statePV3Voltage.isValid()?"":"none",n.solarColour,n.statePV3Voltage.toNum(1),It.VOLT,(t=>Qt.handlePopup(t,e.entities.pv3_current_114)),e.show_solar&&e.entities.pv3_current_114&&"none"!==e.entities.pv3_current_114&&![1,2].includes(e.solar.mppts)&&n.statePV3Current.isValid()?"":"none",n.solarColour,n.statePV3Current.toNum(1),St.AMPERE,(t=>Qt.handlePopup(t,e.entities.pv4_voltage_115)),e.show_solar&&e.entities.pv4_voltage_115&&"none"!==e.entities.pv4_voltage_115&&![1,2,3].includes(e.solar.mppts)&&n.statePV4Voltage.isValid()?"":"none",n.solarColour,n.statePV4Voltage.toNum(1),It.VOLT,(t=>Qt.handlePopup(t,e.entities.pv4_current_116)),e.show_solar&&e.entities.pv4_current_116&&"none"!==e.entities.pv4_current_116&&![1,2,3].includes(e.solar.mppts)&&n.statePV4Current.isValid()?"":"none",n.solarColour,n.statePV4Current.toNum(1),St.AMPERE,(t=>Qt.handlePopup(t,e.entities.battery_temp_182)),n.compactMode?"205":"250",n.compactMode?"332":"324.5",e.entities?.battery_temp_182?"st3 left-align":"st12",n.batteryColour,e.show_battery&&n.stateBatteryTemp.isValid()?"":"none",n.stateBatteryTemp.toNum(1),(t=>Qt.handlePopup(t,e.entities.radiator_temp_91)),n.inverterColour,e.entities?.radiator_temp_91||!n.stateRadiatorTemp.isValid()?"":"none",n.stateRadiatorTemp.toNum(1),(t=>Qt.handlePopup(t,e.entities.dc_transformer_temp_90)),n.inverterColour,e.entities?.dc_transformer_temp_90||!n.stateDCTransformerTemp.isValid()?"":"none",n.stateDCTransformerTemp.toNum(1),(t=>Qt.handlePopup(t,e.entities.environment_temp)),e.entities?.environment_temp?"st3 left-align":"st12",n.solarColour,e.show_solar&&n.stateEnvironmentTemp.isValid()?"":"none",n.stateEnvironmentTemp.toNum(1),(t=>Qt.handlePopup(t,e.entities.essential_load1_extra)),e.entities?.essential_load1_extra&&[1,2].includes(n.additionalLoad)||!n.stateEssentialLoad1Extra.isValid()?"":"none",n.loadColour,n.stateEssentialLoad1Extra.toNum(1),n.stateEssentialLoad1Extra.getUOM(),(t=>Qt.handlePopup(t,e.entities.essential_load2_extra)),e.entities?.essential_load2_extra&&2===n.additionalLoad||!n.stateEssentialLoad2Extra.isValid()?"":"none",n.loadColour,n.stateEssentialLoad2Extra.toNum(1),n.stateEssentialLoad2Extra.getUOM(),n.totalGridPower>=0?U(Tn||(Tn=fe(['\n \n \n '," ","\n \n "])),(t=>Qt.handlePopup(t,e.entities.energy_cost_buy)),e.show_grid?"st3 left-align":"st12",n.gridColour,e.entities?.energy_cost_buy||!n.stateEnergyCostBuy.isValid()?"":"none",n.energyCost,n.stateEnergyCostBuy.getUOM()):U(Mn||(Mn=fe(['\n \n \n '," ","\n \n "])),(t=>Qt.handlePopup(t,e.entities.energy_cost_sell)),e.show_grid?"st3 left-align":"st12",n.gridColour,e.entities?.energy_cost_sell||!n.stateEnergyCostSell.isValid()?"":"none",n.energyCost,n.stateEnergyCostSell.getUOM()),U(Nn||(Nn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.pv_total)),!0!==n.largeFont?"st14":"st4",e.show_solar&&1!==e.solar.mppts&&n.statePVTotal.isValid()?"":"none",n.solarColour,e.solar.auto_scale?e.entities?.pv_total?Qt.convertValueNew(n.totalPV,n.statePVTotal.getUOM(),n.decimalPlaces):Qt.convertValue(n.totalPV,n.decimalPlaces)||0:"".concat(Qt.toNum(n.totalPV||0,0)," ").concat(Nt.WATT)),U(kn||(kn=fe(['\n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.pv1_power_186)),1===e.solar.mppts?"238.8":"188.1",!0!==n.largeFont?"st14":"st4",e.show_solar&&n.statePV1Power.isValid()?"":"none",n.solarColour,n.statePV1Power?.toPowerString(e.solar.auto_scale,n.decimalPlaces)),U(Sn||(Sn=fe(['\n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.pv2_power_187)),!0!==n.largeFont?"st14":"st4",e.show_solar&&1!==e.solar.mppts&&n.statePV2Power.isValid()?"":"none",n.solarColour,n.statePV2Power?.toPowerString(e.solar.auto_scale,n.decimalPlaces)),U(In||(In=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.pv3_power_188)),!0!==n.largeFont?"st14":"st4",e.show_solar&&![1,2].includes(e.solar.mppts)&&n.statePV3Power.isValid()?"":"none",n.solarColour,n.statePV3Power?.toPowerString(e.solar.auto_scale,n.decimalPlaces)),U(On||(On=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.pv4_power_189)),!0!==n.largeFont?"st14":"st4",e.show_solar&&![1,2,3].includes(e.solar.mppts)&&n.statePV4Power.isValid()?"":"none",n.solarColour,n.statePV4Power?.toPowerString(e.solar.auto_scale,n.decimalPlaces)),U(Dn||(Dn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.essential_power)),!0!==n.largeFont?"st14":"st4",n.loadColour,e.load.auto_scale?"".concat(Qt.convertValue(n.essentialPower,n.decimalPlaces)||0):"".concat(n.essentialPower||0," ").concat(Nt.WATT)),U(Hn||(Hn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.essential_load1)),[1,2].includes(n.additionalLoad)&&n.stateEssentialLoad1.isValid()?"":"none",!0!==n.largeFont?"st14":"st4",n.loadColour,n.stateEssentialLoad1?.toPowerString(e.load.auto_scale,n.decimalPlaces)),U(zn||(zn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.essential_load2)),2===n.additionalLoad&&n.stateEssentialLoad2.isValid()?"":"none",!0!==n.largeFont?"st14":"st4",n.loadColour,n.stateEssentialLoad2?.toPowerString(e.load.auto_scale,n.decimalPlaces)),U(Bn||(Bn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.essential_load1)),4===n.additionalLoad&&n.stateEssentialLoad1.isValid()?"":"none",n.loadColour,n.stateEssentialLoad1?.toPowerString(e.load.auto_scale,n.decimalPlaces)),U(Gn||(Gn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.essential_load2)),4===n.additionalLoad&&n.stateEssentialLoad2.isValid()?"":"none",n.loadColour,n.stateEssentialLoad2?.toPowerString(e.load.auto_scale,n.decimalPlaces)),U(Rn||(Rn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.essential_load3)),4===n.additionalLoad&&n.stateEssentialLoad3.isValid()?"":"none",n.loadColour,n.stateEssentialLoad3?.toPowerString(e.load.auto_scale,n.decimalPlaces)),U(qn||(qn=fe(['\n \n \n ',"\n \n "])),(t=>Qt.handlePopup(t,e.entities.essential_load4)),4===n.additionalLoad&&n.stateEssentialLoad4.isValid()?"":"none",n.loadColour,n.stateEssentialLoad4?.toPowerString(e.load.auto_scale,n.decimalPlaces)),(t=>Qt.handlePopup(t,e.entities.prepaid_units)),e.entities?.prepaid_units?"st3":"st12",n.gridColour,e.show_grid?"":"none",n.statePrepaidUnits.toNum(1)))(e,eo,Oa):void 0}getEntity(e,t={state:"0",attributes:{unit_of_measurement:""}}){let n;const o=String(e).split(".");o.length>1?n=this._config[o[0]][o[1]]:o.length>0&&(n=this._config.entities[o[0]]);const a=n?this.hass.states[n]:void 0;return io(void 0!==a?a:t||{state:void 0})}changeAnimationSpeed(e,t){const n=t>=1?Qt.toNum(t,3):1,o=this["".concat(e,"Flow")];this.durationCur[e]=n,o&&this.durationPrev[e]!=n&&o.setCurrentTime(o.getCurrentTime()*(n/this.durationPrev[e])),this.durationPrev[e]=this.durationCur[e]}get isCompactCard(){return this._config.cardstyle==xe.Compact}get isLiteCard(){return this._config.cardstyle==xe.Lite}get isFullCard(){return this._config.cardstyle==xe.Full}colourConvert(e){return e&&Array.isArray(e)?"rgb(".concat(e,")"):e}dynamicLineWidth(e,t,n,o=1){let a;return a=this._config.dynamic_line_width?Math.min(o+Math.min(e/t,1)*n,8):Math.min(o,8),a}setConfig(e){if(e.show_battery&&!e.battery)throw Error(At("errors.battery.bat"));if(e.show_battery&&!e.battery.shutdown_soc)throw new Error(At("errors.battery.shutdown_soc"));if(e.show_battery&&e.battery.show_daily&&(!e.entities.day_battery_charge_70||!e.entities.day_battery_discharge_71))throw Error(At("errors.battery.show_daily"));if(e.show_solar&&!e.solar)throw Error(At("errors.solar.sol"));if(e.show_solar&&!e.solar.mppts)throw Error(At("errors.solar.mppts"));if(e&&e.solar&&e.show_solar&&e.solar.show_daily&&!e.entities.day_pv_energy_108)throw Error(At("errors.solar.show_daily"));if(e&&e.grid&&e.grid.show_daily_buy&&!e.entities.day_grid_import_76||e&&e.grid&&e.grid.show_daily_sell&&!e.entities.day_grid_export_77)throw Error(At("errors.grid.show_daily"));if(e&&e.entities&&"none"===e.entities.essential_power&&!e.entities.inverter_power_175||e&&e.entities&&"none"===e.entities.essential_power&&"none"===e.entities.inverter_power_175)throw Error(At("errors.essential_power"));if(e&&e.entities&&"none"===e.entities.nonessential_power&&!e.entities.grid_power_169)throw Error(At("errors.nonessential_power"));const t=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172","pv1_power_186"];for(const n of t)if("pv1_power_186"===n&&e.show_solar&&!e.entities[n]&&!e.entities[n])throw new Error("".concat(At("errors.missing_entity")," e.g: ").concat(n,": sensor.example"));const n=e;this._config=Rt({},Pt,n)}getCardSize(){return 2}},t([ge()],e.SunsynkPowerFlowCard.prototype,"hass",void 0),t([ge()],e.SunsynkPowerFlowCard.prototype,"_config",void 0),t([me("#grid-flow")],e.SunsynkPowerFlowCard.prototype,"gridFlow",void 0),t([me("#grid1-flow")],e.SunsynkPowerFlowCard.prototype,"grid1Flow",void 0),t([me("#solar-flow")],e.SunsynkPowerFlowCard.prototype,"solarFlow",void 0),t([me("#pv1-flow")],e.SunsynkPowerFlowCard.prototype,"pv1Flow",void 0),t([me("#pv2-flow")],e.SunsynkPowerFlowCard.prototype,"pv2Flow",void 0),t([me("#pv3-flow")],e.SunsynkPowerFlowCard.prototype,"pv3Flow",void 0),t([me("#pv4-flow")],e.SunsynkPowerFlowCard.prototype,"pv4Flow",void 0),t([me("#battery-flow")],e.SunsynkPowerFlowCard.prototype,"batteryFlow",void 0),t([me("#load-flow")],e.SunsynkPowerFlowCard.prototype,"loadFlow",void 0),t([me("#aux-flow")],e.SunsynkPowerFlowCard.prototype,"auxFlow",void 0),t([me("#ne-flow")],e.SunsynkPowerFlowCard.prototype,"neFlow",void 0),t([me("#ne1-flow")],e.SunsynkPowerFlowCard.prototype,"ne1Flow",void 0),e.SunsynkPowerFlowCard=t([ue("sunsynk-power-flow-card")],e.SunsynkPowerFlowCard);try{customElements.define("content-card-editor",Ut)}catch(e){}window.customCards=window.customCards||[],window.customCards.push({type:"sunsynk-power-flow-card",name:"Sunsynk Power Flow Card",preview:!0,description:At("common.description"),configurable:!0})})); diff --git a/package.json b/package.json index f12f721c..2202ded7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sunsynk-power-flow-card", - "version": "4.24.0", + "version": "4.24.1", "description": "A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.", "main": "sunsynk-power-flow-card.js", "scripts": { diff --git a/src/cards/compact-card.ts b/src/cards/compact-card.ts index 11a86cd7..0f723be2 100644 --- a/src/cards/compact-card.ts +++ b/src/cards/compact-card.ts @@ -2,6 +2,7 @@ import {html, svg} from 'lit'; import {localize} from '../localize/localize'; import {Utils} from '../helpers/utils'; import {AutarkyType, DataDto, InverterModel, sunsynkPowerFlowCardConfig} from '../types'; +import {UnitOfElectricalCurrent, UnitOfElectricPotential, UnitOfPower} from '../const'; export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string, data: DataDto) => { return html` @@ -38,7 +39,8 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str class="${data.compactMode ? '' : 'st12'}"/> @@ -102,7 +104,8 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str fill="${data.batteryEnergy === 0 || !data.isFloating ? 'transparent' : `${data.batteryColour}`}"> ${localize('common.battery_floating')} - ${localize('common.daily_charge')} @@ -158,19 +161,23 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str display="${!config.show_solar || [1, 2, 3].includes(config.solar.mppts) ? 'none' : ''}" fill="${data.solarColour}">${config.solar.pv4_name} - ${data.autarkyEnergy}% - ${data.ratioEnergy}% - ${data.autarkyPower}% - ${data.ratioPower}% @@ -207,38 +214,39 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str - ${config.load.auto_scale ? `${Utils.convertValue(data.loadPowerL1, data.decimalPlaces) || 0}` : `${data.loadPowerL1 || 0} W`} + ${config.load.auto_scale ? `${Utils.convertValue(data.loadPowerL1, data.decimalPlaces) || 0}` : `${data.loadPowerL1 || 0} ${UnitOfPower.WATT}`} - ${config.load.auto_scale ? `${Utils.convertValue(data.loadPowerL2, data.decimalPlaces) || 0}` : `${data.loadPowerL2 || 0} W`} + ${config.load.auto_scale ? `${Utils.convertValue(data.loadPowerL2, data.decimalPlaces) || 0}` : `${data.loadPowerL2 || 0} ${UnitOfPower.WATT}`} - ${config.load.auto_scale ? `${Utils.convertValue(data.loadPowerL3, data.decimalPlaces) || 0}` : `${data.loadPowerL3 || 0} W`} + ${config.load.auto_scale ? `${Utils.convertValue(data.loadPowerL3, data.decimalPlaces) || 0}` : `${data.loadPowerL3 || 0} ${UnitOfPower.WATT}`} - ${config.load.auto_scale ? `${Utils.convertValue(data.gridPower, data.decimalPlaces) || 0}` : `${data.gridPower || 0} W`} + ${config.load.auto_scale ? `${Utils.convertValue(data.gridPower, data.decimalPlaces) || 0}` : `${data.gridPower || 0} ${UnitOfPower.WATT}`} - ${config.load.auto_scale ? `${Utils.convertValue(data.gridPowerL2, data.decimalPlaces) || 0}` : `${data.gridPowerL2 || 0} W`} + ${config.load.auto_scale ? `${Utils.convertValue(data.gridPowerL2, data.decimalPlaces) || 0}` : `${data.gridPowerL2 || 0} ${UnitOfPower.WATT}`} - ${config.load.auto_scale ? `${Utils.convertValue(data.gridPowerL3, data.decimalPlaces) || 0}` : `${data.gridPowerL3 || 0} W`} + ${config.load.auto_scale ? `${Utils.convertValue(data.gridPowerL3, data.decimalPlaces) || 0}` : `${data.gridPowerL3 || 0} ${UnitOfPower.WATT}`} + display="${!config.show_battery || data.compactMode ? 'none' : ''}" + fill="${data.batteryColour}"> ${data.batteryStateMsg} - ${Utils.toNum(((data.batteryEnergy * (parseFloat(data.stateBatterySoc.state) / 100) / 1000)), 2)} + ${Utils.toNum((data.batteryEnergy * (data.stateBatterySoc.toNum(2) / 100) / 1000), 2)} kWh - ${data.batteryShutdown} % - ${data.shutdownOffGrid} % @@ -761,40 +771,28 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str class="st10 left-align" display="${data.batteryShowDaily !== true || !config.show_battery ? 'none' : ''}" fill="${data.batteryColour}"> - ${config.battery.auto_scale - ? Utils.convertValueNew(data.stateDayBatteryCharge.state, data.stateDayBatteryCharge.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayBatteryCharge.state, 1)} kWh` - } + ${data.stateDayBatteryCharge?.toPowerString(config.battery.auto_scale)} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${config.solar.auto_scale - ? Utils.convertValueNew(data.stateDayPVEnergy.state, data.stateDayPVEnergy.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayPVEnergy.state, 1)} kWh` - } + ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale)} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${config.solar.auto_scale - ? `${Utils.convertValueNew(data.stateDayPVEnergy.state, data.stateDayPVEnergy.attributes?.unit_of_measurement, 1)} / ${data.remainingSolar}` - : `${Utils.toNum(data.stateDayPVEnergy.state, 1)} kWh / ${data.remainingSolar}` - } + ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale) + ' / ' + data.remainingSolar} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${config.solar.auto_scale - ? `${Utils.convertValueNew(data.stateDayPVEnergy.state, data.stateDayPVEnergy.attributes?.unit_of_measurement, 1)} / ${data.totalSolarGeneration}` - : `${Utils.toNum(data.stateDayPVEnergy.state, 1)} kWh / ${data.totalSolarGeneration}` - } + ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale) + ' / ' + data.totalSolarGeneration} Utils.handlePopup(e, config.entities.day_battery_discharge_71)}> @@ -802,10 +800,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str class="st10 left-align" display="${data.batteryShowDaily !== true || !config.show_battery ? 'none' : ''}" fill="${data.batteryColour}"> - ${config.battery.auto_scale - ? Utils.convertValueNew(data.stateDayBatteryDischarge.state, data.stateDayBatteryDischarge.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayBatteryDischarge.state, 1)} kWh` - } + ${data.stateDayBatteryDischarge?.toPowerString(config.solar.auto_scale)} Utils.handlePopup(e, config.entities.day_load_energy_84)}> @@ -814,30 +809,21 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str y="${[2, 4].includes(data.additionalLoad) ? '175' : '267.9'}" class="st10 left-align" display="${!data.loadShowDaily ? 'none' : ''}" fill="${data.loadColour}"> - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateDayLoadEnergy.state, data.stateDayLoadEnergy.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayLoadEnergy.state, 1)} kWh` - } + ${data.stateDayLoadEnergy?.toPowerString(config.load.auto_scale)} Utils.handlePopup(e, config.entities.day_grid_import_76)}> - ${config.grid.auto_scale - ? Utils.convertValueNew(data.stateDayGridImport.state, data.stateDayGridImport.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayGridImport.state, 1)} kWh` - } + ${data.stateDayGridImport?.toPowerString(config.grid.auto_scale)} Utils.handlePopup(e, config.entities.day_grid_export_77)}> - ${config.grid.auto_scale - ? Utils.convertValueNew(data.stateDayGridExport.state, data.stateDayGridExport.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayGridExport.state, 1)} kWh` - } + ${data.stateDayGridExport?.toPowerString(config.grid.auto_scale)} Utils.handlePopup(e, config.entities.inverter_voltage_154)}> @@ -882,13 +868,14 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str Utils.handlePopup(e, config.entities.battery_soc_184)}> - ${parseInt(data.stateBatterySoc.state)} % + ${data.stateBatterySoc.toNum(1)} % Utils.handlePopup(e, config.entities.battery_soc_184)}> - Utils.handlePopup(e, config.entities.battery_soc_184)}> - @@ -907,7 +895,8 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str Utils.handlePopup(e, config.entities.battery_soc_184)}> - | @@ -923,25 +912,25 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str ? `${Math.abs(parseFloat(Utils.convertValue(data.batteryPower, data.decimalPlaces)))} ${Utils.convertValue(data.batteryPower, data.decimalPlaces).split(' ')[1]}` : Utils.convertValue(data.batteryPower, data.decimalPlaces) || '0'}` : `${config.battery.show_absolute - ? `${Math.abs(data.batteryPower)} W` - : `${data.batteryPower || 0} W` + ? `${Math.abs(data.batteryPower)} ${UnitOfPower.WATT}` + : `${data.batteryPower || 0} ${UnitOfPower.WATT}` }` } Utils.handlePopup(e, config.entities.battery_current_191)}> - ${config.battery.show_absolute ? Math.abs(Utils.toNum(data.stateBatteryCurrent.state, 1)) : Utils.toNum(data.stateBatteryCurrent.state, 1)} + ${config.battery.show_absolute ? Math.abs(data.stateBatteryCurrent.toNum(1)) : data.stateBatteryCurrent.toNum(1)} A Utils.handlePopup(e, config.entities.battery_current_191)}> - ${config.battery.show_absolute ? Math.abs(Utils.toNum(data.stateBatteryCurrent.state, 1)) : Utils.toNum(data.stateBatteryCurrent.state, 1)} + ${config.battery.show_absolute ? Math.abs(data.stateBatteryCurrent.toNum(1)) : data.stateBatteryCurrent.toNum(1)} A @@ -957,8 +946,8 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str ? `${Math.abs(parseFloat(Utils.convertValue(data.totalGridPower, data.decimalPlaces)))} ${Utils.convertValue(data.totalGridPower, data.decimalPlaces).split(' ')[1]}` : Utils.convertValue(data.totalGridPower, data.decimalPlaces) || 0}` : `${config.grid.show_absolute - ? `${Math.abs(data.totalGridPower)} W` - : `${data.totalGridPower || 0} W` + ? `${Math.abs(data.totalGridPower)} ${UnitOfPower.WATT}` + : `${data.totalGridPower || 0} ${UnitOfPower.WATT}` }` } @@ -972,8 +961,8 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str ? `${Math.abs(parseFloat(Utils.convertValue(data.totalGridPower, data.decimalPlaces)))} ${Utils.convertValue(data.totalGridPower, data.decimalPlaces).split(' ')[1]}` : Utils.convertValue(data.totalGridPower, data.decimalPlaces) || 0}` : `${config.grid.show_absolute - ? `${Math.abs(data.totalGridPower)} W` - : `${data.totalGridPower || 0} W` + ? `${Math.abs(data.totalGridPower)} ${UnitOfPower.WATT}` + : `${data.totalGridPower || 0} ${UnitOfPower.WATT}` }` } ` @@ -987,8 +976,8 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str ? `${Math.abs(parseFloat(Utils.convertValue(data.totalGridPower, data.decimalPlaces)))} ${Utils.convertValue(data.totalGridPower, data.decimalPlaces).split(' ')[1]}` : Utils.convertValue(data.totalGridPower, data.decimalPlaces) || 0}` : `${config.grid.show_absolute - ? `${Math.abs(data.totalGridPower)} W` - : `${data.totalGridPower || 0} W` + ? `${Math.abs(data.totalGridPower)} ${UnitOfPower.WATT}` + : `${data.totalGridPower || 0} ${UnitOfPower.WATT}` }` } @@ -997,94 +986,104 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str Utils.handlePopup(e, config.entities.pv1_voltage_109)}> ${Utils.toNum(data.statePV1Voltage.state, 1)} V + display="${!config.show_solar || !config.entities.pv1_voltage_109 || config.entities.pv1_voltage_109 === 'none' || !data.statePV1Voltage.isValid() ? 'none' : ''}" + fill="${data.solarColour}">${data.statePV1Voltage.toNum(1)} V Utils.handlePopup(e, config.entities.pv1_current_110)}> ${Utils.toNum(data.statePV1Current.state, 1)} A + display="${!config.show_solar || !config.entities.pv1_current_110 || config.entities.pv1_current_110 === 'none' || !data.statePV1Current.isValid() ? 'none' : ''}" + fill="${data.solarColour}">${data.statePV1Current.toNum(1)} A Utils.handlePopup(e, config.entities.pv2_voltage_111)}> ${Utils.toNum(data.statePV2Voltage.state, 1)} V + display="${!config.show_solar || !config.entities.pv2_voltage_111 || config.entities.pv2_voltage_111 === 'none' || config.solar.mppts === 1 || !data.statePV2Voltage.isValid() ? 'none' : ''}" + fill="${data.solarColour}">${data.statePV2Voltage.toNum(1)} + ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.pv2_current_112)}> ${Utils.toNum(data.statePV2Current.state, 1)} A + display="${!config.show_solar || !config.entities.pv2_current_112 || config.entities.pv2_current_112 === 'none' || config.solar.mppts === 1 || !data.statePV2Current.isValid() ? 'none' : ''}" + fill="${data.solarColour}">${data.statePV2Current.toNum(1)} + ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.pv3_voltage_113)}> ${Utils.toNum(data.statePV3Voltage.state, 1)} V + display="${!config.show_solar || !config.entities.pv3_voltage_113 || config.entities.pv3_voltage_113 === 'none' || [1, 2].includes(config.solar.mppts) || !data.statePV3Voltage.isValid() ? 'none' : ''}" + fill="${data.solarColour}">${data.statePV3Voltage.toNum(1)} + ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.pv3_current_114)}> ${Utils.toNum(data.statePV3Current.state, 1)} A + display="${!config.show_solar || !config.entities.pv3_current_114 || config.entities.pv3_current_114 === 'none' || [1, 2].includes(config.solar.mppts) || !data.statePV3Current.isValid() ? 'none' : ''}" + fill="${data.solarColour}">${data.statePV3Current.toNum(1)} + ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.pv4_voltage_115)}> ${Utils.toNum(data.statePV4Voltage.state, 1)} V + display="${!config.show_solar || !config.entities.pv4_voltage_115 || config.entities.pv4_voltage_115 === 'none' || [1, 2, 3].includes(config.solar.mppts) || !data.statePV4Voltage.isValid() ? 'none' : ''}" + fill="${data.solarColour}">${data.statePV4Voltage.toNum(1)} + ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.pv4_current_116)}> ${Utils.toNum(data.statePV4Current.state, 1)} A + display="${!config.show_solar || !config.entities.pv4_current_116 || config.entities.pv4_current_116 === 'none' || [1, 2, 3].includes(config.solar.mppts) || !data.statePV4Current.isValid() ? 'none' : ''}" + fill="${data.solarColour}">${data.statePV4Current.toNum(1)} + ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.battery_temp_182)}> - ${Utils.toNum(data.stateBatteryTemp.state, 1)}° + fill="${data.batteryColour}" + display="${!config.show_battery || !data.stateBatteryTemp.isValid() ? 'none' : ''}"> + ${data.stateBatteryTemp.toNum(1)}° Utils.handlePopup(e, config.entities.radiator_temp_91)}> AC: - ${Utils.toNum(data.stateRadiatorTemp.state, 1)}° + display="${config.entities?.radiator_temp_91 || !data.stateRadiatorTemp.isValid() ? '' : 'none'}"> + AC: + ${data.stateRadiatorTemp.toNum(1)}° Utils.handlePopup(e, config.entities.dc_transformer_temp_90)}> DC: - ${Utils.toNum(data.stateDCTransformerTemp.state, 1)}° + display="${config.entities?.dc_transformer_temp_90 || !data.stateDCTransformerTemp.isValid() ? '' : 'none'}"> + DC: + ${data.stateDCTransformerTemp.toNum(1)}° Utils.handlePopup(e, config.entities.environment_temp)}> - ${Utils.toNum(data.stateEnvironmentTemp.state, 1)}° + fill="${data.solarColour}" + display="${!config.show_solar || !data.stateEnvironmentTemp.isValid() ? 'none' : ''}"> + ${data.stateEnvironmentTemp.toNum(1)}° Utils.handlePopup(e, config.entities.essential_load1_extra)}> - ${Utils.toNum(data.stateEssentialLoad1Extra.state, 1)} - ${data.stateEssentialLoad1Extra.attributes?.unit_of_measurement} + ${data.stateEssentialLoad1Extra.toNum(1)} + ${data.stateEssentialLoad1Extra.getUOM()} Utils.handlePopup(e, config.entities.essential_load2_extra)}> - ${Utils.toNum(data.stateEssentialLoad2Extra.state, 1)} - ${data.stateEssentialLoad2Extra.attributes?.unit_of_measurement} + ${data.stateEssentialLoad2Extra.toNum(1)} + ${data.stateEssentialLoad2Extra.getUOM()} ${data.totalGridPower >= 0 @@ -1092,326 +1091,135 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str Utils.handlePopup(e, config.entities.energy_cost_buy)}> - ${data.energyCost} ${data.stateEnergyCostBuy.attributes?.unit_of_measurement} + display="${config.entities?.energy_cost_buy || !data.stateEnergyCostBuy.isValid() ? '' : 'none'}" > + ${data.energyCost} ${data.stateEnergyCostBuy.getUOM()} ` : svg` Utils.handlePopup(e, config.entities.energy_cost_sell)}> - ${data.energyCost} ${data.stateEnergyCostSell.attributes?.unit_of_measurement} + display="${config.entities?.energy_cost_sell || !data.stateEnergyCostSell.isValid() ? '' : 'none'}" > + ${data.energyCost} ${data.stateEnergyCostSell.getUOM()} `} - ${config.entities?.pv_total - ? svg` + ${svg` Utils.handlePopup(e, config.entities.pv_total)}> ${config.solar.auto_scale - ? config.entities?.pv_total - ? Utils.convertValueNew(data.totalPV, data.statePVTotal.attributes?.unit_of_measurement, data.decimalPlaces) - : Utils.convertValue(data.totalPV, data.decimalPlaces) || 0 - : `${Utils.toNum(data.totalPV || 0, 0)} W` - } + ? config.entities?.pv_total + ? Utils.convertValueNew(data.totalPV, data.statePVTotal.getUOM(), data.decimalPlaces) + : Utils.convertValue(data.totalPV, data.decimalPlaces) || 0 + : `${Utils.toNum(data.totalPV || 0, 0)} ${UnitOfPower.WATT}` + } ` - : svg` - - ${config.solar.auto_scale - ? config.entities?.pv_total - ? Utils.convertValueNew(data.totalPV, data.statePVTotal.attributes?.unit_of_measurement, data.decimalPlaces) - : Utils.convertValue(data.totalPV, data.decimalPlaces) || 0 - : `${Utils.toNum(data.totalPV || 0, 0)} W` - } - ` } - ${config.entities?.pv1_power_186 - ? svg` - Utils.handlePopup(e, config.entities.pv1_power_186)}> - Utils.handlePopup(e, config.entities.pv1_power_186)}> + - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV1Power.state, data.statePV1Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV1Power.state, 0)} W` - } + ${data.statePV1Power?.toPowerString(config.solar.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV1Power.state, data.statePV1Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV1Power.state, 0)} W` - } - ` } - ${config.entities?.pv2_power_187 - ? svg` - Utils.handlePopup(e, config.entities.pv2_power_187)}> + ${svg` Utils.handlePopup(e, config.entities.pv2_power_187)}> - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV2Power.state, data.statePV2Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV2Power.state, 0)} W` - } + ${data.statePV2Power?.toPowerString(config.solar.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV2Power.state, data.statePV2Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV2Power.state, 0)} W` - } - ` + } - ${config.entities?.pv3_power_188 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.pv3_power_188)}> - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV3Power.state, data.statePV3Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV3Power.state, 0)} W` - } + ${data.statePV3Power?.toPowerString(config.solar.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV3Power.state, data.statePV3Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV3Power.state, 0)} W` - } - ` } - ${config.entities?.pv4_power_189 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.pv4_power_189)}> - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV4Power.state, data.statePV4Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV4Power.state, 0)} W` - } + ${data.statePV4Power?.toPowerString(config.solar.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV4Power.state, data.statePV4Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV4Power.state, 0)} W` - } - ` } - ${config.entities?.essential_power && config.entities.essential_power !== 'none' - ? svg` + ${svg` Utils.handlePopup(e, config.entities.essential_power)}> - ${config.load.auto_scale ? `${Utils.convertValue(data.essentialPower, data.decimalPlaces) || 0}` : `${data.essentialPower || 0} W`} + ${config.load.auto_scale ? `${Utils.convertValue(data.essentialPower, data.decimalPlaces) || 0}` : `${data.essentialPower || 0} ${UnitOfPower.WATT}`} ` - : svg` - - ${config.load.auto_scale ? `${Utils.convertValue(data.essentialPower, data.decimalPlaces) || 0}` : `${data.essentialPower || 0} W`} - ` } - ${config.entities?.essential_load1 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.essential_load1)}> - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad1.state, data.stateEssentialLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad1.state, 0) || 0} ${ - data.stateEssentialLoad1.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad1.attributes?.unit_of_measurement - : '' - }` - } + ${data.stateEssentialLoad1?.toPowerString(config.load.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad1.state, data.stateEssentialLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad1.state, 0) || 0} ${ - data.stateEssentialLoad1.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad1.attributes?.unit_of_measurement - : '' - }` - } - ` } - ${config.entities?.essential_load2 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.essential_load2)}> - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad2.state, data.stateEssentialLoad2.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad2.state, 0) || 0} ${ - data.stateEssentialLoad2.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad2.attributes?.unit_of_measurement - : '' - }` - } + ${data.stateEssentialLoad2?.toPowerString(config.load.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad2.state, data.stateEssentialLoad2.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad2.state, 0) || 0} ${ - data.stateEssentialLoad2.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad2.attributes?.unit_of_measurement - : '' - }` - } - ` } - ${config.entities?.essential_load1 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.essential_load1)}> - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad1.state, data.stateEssentialLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad1.state, 0) || 0} ${ - data.stateEssentialLoad1.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad1.attributes?.unit_of_measurement - : '' - }` - } + ${data.stateEssentialLoad1?.toPowerString(config.load.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad1.state, data.stateEssentialLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad1.state, 0) || 0} ${ - data.stateEssentialLoad1.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad1.attributes?.unit_of_measurement - : '' - }` - } - ` } - ${config.entities?.essential_load2 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.essential_load2)}> - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad2.state, data.stateEssentialLoad2.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad2.state, 0) || 0} ${ - data.stateEssentialLoad2.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad2.attributes?.unit_of_measurement - : '' - }` - } + ${data.stateEssentialLoad2?.toPowerString(config.load.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad2.state, data.stateEssentialLoad2.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad2.state, 0) || 0} ${ - data.stateEssentialLoad2.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad2.attributes?.unit_of_measurement - : '' - }` - } - ` } - ${config.entities?.essential_load3 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.essential_load3)}> - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad3.state, data.stateEssentialLoad3.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad3.state, 0) || 0} ${ - data.stateEssentialLoad3.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad3.attributes?.unit_of_measurement - : '' - }` - } + ${data.stateEssentialLoad3?.toPowerString(config.load.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad4.state, data.stateEssentialLoad4.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad3.state, 0) || 0} ${ - data.stateEssentialLoad3.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad3.attributes?.unit_of_measurement - : '' - }` - } - ` } - ${config.entities?.essential_load4 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.essential_load4)}> - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad4.state, data.stateEssentialLoad4.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad4.state, 0) || 0} ${ - data.stateEssentialLoad4.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad4.attributes?.unit_of_measurement - : '' - }` - } + ${data.stateEssentialLoad4?.toPowerString(config.load.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad4.state, data.stateEssentialLoad4.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad4.state, 0) || 0} ${ - data.stateEssentialLoad4.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad4.attributes?.unit_of_measurement - : '' - }` - } - ` } Utils.handlePopup(e, config.entities.prepaid_units)}> - ${Utils.toNum(data.statePrepaidUnits.state, 1)} + ${data.statePrepaidUnits.toNum(1)} diff --git a/src/cards/full-card.ts b/src/cards/full-card.ts index c83aefe2..c363efa7 100644 --- a/src/cards/full-card.ts +++ b/src/cards/full-card.ts @@ -2,6 +2,7 @@ import {html, svg} from 'lit'; import {localize} from '../localize/localize'; import {AutarkyType, DataDto, InverterModel, sunsynkPowerFlowCardConfig} from '../types'; import { Utils } from '../helpers/utils'; +import {UnitOfElectricalCurrent, UnitOfElectricPotential} from '../const'; export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string, data: DataDto) => { return html` @@ -175,7 +176,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string - ${Utils.toNum(((data.batteryEnergy * (parseFloat(data.stateBatterySoc.state) / 100) / 1000)), 2)} + ${Utils.toNum((data.batteryEnergy * (data.stateBatterySoc?.toNum() / 100) / 1000), 2)} kWh - ${Utils.toNum(data.stateAuxLoad1Extra.state, 1)} - ${data.stateAuxLoad1Extra.attributes?.unit_of_measurement} + ${data.stateAuxLoad1Extra.toNum(1)} + ${data.stateAuxLoad1Extra?.getUOM()} - ${Utils.toNum(data.stateAuxLoad2Extra.state, 1)} - ${data.stateAuxLoad2Extra.attributes?.unit_of_measurement} + ${data.stateAuxLoad2Extra.toNum(1)} + ${data.stateAuxLoad2Extra?.getUOM()} + . @@ -779,13 +781,15 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string d="M 12 3 z z M 19 20 v -8 h 3 L 12 3 L 2 12 h 3 v 8 z M 12 5.7 l 5 4.5 V 18 H 7 v -7.8 z"/> + height="32" viewBox="0 0 24 24" + opacity="${data.iconNonessentialLoad1 === 'boiler' ? '1' : '0'}"> + height="32" viewBox="0 0 24 24" + opacity="${data.iconNonessentialLoad2 === 'boiler' ? '1' : '0'}"> @@ -815,13 +819,15 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string d="M3 7.5A4.5 4.5 0 0 1 7.5 3h17A4.5 4.5 0 0 1 29 7.5v17a4.5 4.5 0 0 1-4.5 4.5h-17A4.5 4.5 0 0 1 3 24.5v-17Zm24 0A2.5 2.5 0 0 0 24.5 5h-17A2.5 2.5 0 0 0 5 7.5V11h22V7.5Zm0 17V13H5v11.5A2.5 2.5 0 0 0 7.5 27h17a2.5 2.5 0 0 0 2.5-2.5Zm-17-15a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3Zm6 0a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3ZM23.5 8a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0ZM9 23v-6h14v6H9Zm-.5-8A1.5 1.5 0 0 0 7 16.5v7A1.5 1.5 0 0 0 8.5 25h15a1.5 1.5 0 0 0 1.5-1.5v-7a1.5 1.5 0 0 0-1.5-1.5h-15Z"/> + height="25" viewBox="0 0 24 24" + opacity="${data.iconNonessentialLoad1 === 'aircon' ? '1' : '0'}"> + height="25" viewBox="0 0 24 24" + opacity="${data.iconNonessentialLoad2 === 'aircon' ? '1' : '0'}"> @@ -859,13 +865,15 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string + height="32" viewBox="0 0 24 24" + opacity="${data.iconNonessentialLoad1 === 'default' ? '1' : '0'}"> + height="32" viewBox="0 0 24 24" + opacity="${data.iconNonessentialLoad1 === 'boiler' ? '1' : '0'}"> @@ -883,7 +891,8 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string d="M3 7.5A4.5 4.5 0 0 1 7.5 3h17A4.5 4.5 0 0 1 29 7.5v17a4.5 4.5 0 0 1-4.5 4.5h-17A4.5 4.5 0 0 1 3 24.5v-17Zm24 0A2.5 2.5 0 0 0 24.5 5h-17A2.5 2.5 0 0 0 5 7.5V11h22V7.5Zm0 17V13H5v11.5A2.5 2.5 0 0 0 7.5 27h17a2.5 2.5 0 0 0 2.5-2.5Zm-17-15a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3Zm6 0a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3ZM23.5 8a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0ZM9 23v-6h14v6H9Zm-.5-8A1.5 1.5 0 0 0 7 16.5v7A1.5 1.5 0 0 0 8.5 25h15a1.5 1.5 0 0 0 1.5-1.5v-7a1.5 1.5 0 0 0-1.5-1.5h-15Z"/> + height="25" viewBox="0 0 24 24" + opacity="${data.iconNonessentialLoad1 === 'aircon' ? '1' : '0'}"> @@ -1323,12 +1332,14 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string fill="${data.inverterColour}" d="m15 13l-4 4v-3H2v-2h9V9l4 4M5 20v-4h2v2h10v-7.81l-5-4.5L7.21 10H4.22L12 3l10 9h-3v8H5Z"/> - ${localize('common.priority_load')} - ${localize('common.priority_batt')} @@ -1361,30 +1372,22 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string - ${config.solar.auto_scale - ? Utils.convertValueNew(data.stateDayPVEnergy.state, data.stateDayPVEnergy.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayPVEnergy.state, 1)} kWh` - } + ${data.stateDayPVEnergy.toPowerString(config.solar.auto_scale, 1)} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${config.solar.auto_scale - ? `${Utils.convertValueNew(data.stateDayPVEnergy.state, data.stateDayPVEnergy.attributes?.unit_of_measurement, 1)} / ${data.remainingSolar}` - : `${Utils.toNum(data.stateDayPVEnergy.state, 1)} kWh / ${data.remainingSolar}` - } + ${data.stateDayPVEnergy.toPowerString(config.solar.auto_scale, 1)} / ${data.remainingSolar} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${config.solar.auto_scale - ? `${Utils.convertValueNew(data.stateDayPVEnergy.state, data.stateDayPVEnergy.attributes?.unit_of_measurement, 1)} / ${data.totalSolarGeneration}` - : `${Utils.toNum(data.stateDayPVEnergy.state, 1)} kWh / ${data.totalSolarGeneration}` - } + ${data.stateDayPVEnergy.toPowerString(config.solar.auto_scale, 1)} / + ${data.totalSolarGeneration} Utils.handlePopup(e, config.entities.day_load_energy_84)}> @@ -1392,10 +1395,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string class="st10 left-align" display="${!data.loadShowDaily || !data.showAux ? 'none' : ''}" fill="${data.loadColour}"> - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateDayLoadEnergy.state, data.stateDayLoadEnergy.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayLoadEnergy.state, 1)} kWh` - } + ${data.stateDayLoadEnergy.toPowerString(config.load.auto_scale, 1)} Utils.handlePopup(e, config.entities.day_load_energy_84)}> @@ -1403,30 +1403,21 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string y="${data.additionalLoad === 0 ? '57' : '80'}" class="st10 left-align" display="${!data.loadShowDaily || data.showAux ? 'none' : ''}" fill="${data.loadColour}"> - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateDayLoadEnergy.state, data.stateDayLoadEnergy.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayLoadEnergy.state, 1)} kWh` - } + ${data.stateDayLoadEnergy.toPowerString(config.load.auto_scale, 1)} Utils.handlePopup(e, config.entities.day_battery_charge_70)}> - ${config.battery.auto_scale - ? Utils.convertValueNew(data.stateDayBatteryCharge.state, data.stateDayBatteryCharge.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayBatteryCharge.state, 1)} kWh` - } + ${data.stateDayBatteryCharge.toPowerString(config.battery.auto_scale, 1)} Utils.handlePopup(e, config.entities.day_battery_discharge_71)}> - ${config.battery.auto_scale - ? Utils.convertValueNew(data.stateDayBatteryDischarge.state, data.stateDayBatteryDischarge.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayBatteryDischarge.state, 1)} kWh` - } + ${data.stateDayBatteryDischarge.toPowerString(config.battery.auto_scale, 1)} Utils.handlePopup(e, config.entities.day_grid_import_76)}> @@ -1434,10 +1425,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string y="${!data.showNonessential ? '354' : '239'}" class="st10 left-align" display="${!config.show_grid || data.gridShowDailyBuy !== true ? 'none' : ''}" fill="${data.gridColour}"> - ${config.grid.auto_scale - ? Utils.convertValueNew(data.stateDayGridImport.state, data.stateDayGridImport.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayGridImport.state, 1)} kWh` - } + ${data.stateDayGridImport.toPowerString(config.grid.auto_scale, 1)} Utils.handlePopup(e, config.entities.day_grid_export_77)}> @@ -1445,10 +1433,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string y="${!data.showNonessential ? '323' : '209'}" class="st10 left-align" display="${!config.show_grid || data.gridShowDailySell !== true ? 'none' : ''}" fill="${data.gridColour}"> - ${config.grid.auto_scale - ? Utils.convertValueNew(data.stateDayGridExport.state, data.stateDayGridExport.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayGridExport.state, 1)} kWh` - } + ${data.stateDayGridExport.toPowerString(config.grid.auto_scale, 1)} Utils.handlePopup(e, config.entities.day_aux_energy)}> @@ -1457,34 +1442,31 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string y="12" class="st10 left-align" display="${!data.showAux || data.showDailyAux !== true ? 'none' : ''}" fill="${data.auxColour}"> - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateDayAuxEnergy.state, data.stateDayAuxEnergy.attributes?.unit_of_measurement, 1) - : `${Utils.toNum(data.stateDayAuxEnergy.state, 1)} kWh` - } + ${data.stateDayAuxEnergy.toPowerString(config.load.auto_scale, 1)} Utils.handlePopup(e, config.entities.essential_load1_extra)}> - ${Utils.toNum(data.stateEssentialLoad1Extra.state, 1)} - ${data.stateEssentialLoad1Extra.attributes?.unit_of_measurement} + ${data.stateEssentialLoad1Extra.toNum(1)} + ${data.stateEssentialLoad1Extra?.getUOM()} Utils.handlePopup(e, config.entities.essential_load1_extra)}> - ${Utils.toNum(data.stateEssentialLoad1Extra.state, 1)} - ${data.stateEssentialLoad1Extra.attributes?.unit_of_measurement} + ${data.stateEssentialLoad1Extra.toNum(1)} + ${data.stateEssentialLoad1Extra?.getUOM()} Utils.handlePopup(e, config.entities.essential_load2_extra)}> - ${Utils.toNum(data.stateEssentialLoad2Extra.state, 1)} - ${data.stateEssentialLoad2Extra.attributes?.unit_of_measurement} + ${data.stateEssentialLoad2Extra.toNum(1)} + ${data.stateEssentialLoad2Extra?.getUOM()} ${config.inverter.three_phase @@ -1544,7 +1526,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string fill="${data.solarColour}"> ${config.solar.auto_scale ? config.entities?.pv_total - ? Utils.convertValueNew(data.totalPV, data.statePVTotal.attributes?.unit_of_measurement, data.decimalPlaces) + ? Utils.convertValueNew(data.totalPV, data.statePVTotal?.getUOM(), data.decimalPlaces) : Utils.convertValue(data.totalPV, data.decimalPlaces) || 0 : `${Utils.toNum(data.totalPV || 0, 0)} W` } @@ -1556,7 +1538,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string fill="${data.solarColour}"> ${config.solar.auto_scale ? config.entities?.pv_total - ? Utils.convertValueNew(data.totalPV, data.statePVTotal.attributes?.unit_of_measurement, data.decimalPlaces) + ? Utils.convertValueNew(data.totalPV, data.statePVTotal?.getUOM(), data.decimalPlaces) : Utils.convertValue(data.totalPV, data.decimalPlaces) || 0 : `${Utils.toNum(data.totalPV || 0, 0)} W` } @@ -1623,315 +1605,117 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string } ` } - ${config.entities?.pv1_power_186 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.pv1_power_186)}> - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV1Power.state, data.statePV1Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV1Power.state, 0)} W` - } + ${data.statePV1Power.toPowerString(config.solar.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV1Power.state, data.statePV1Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV1Power.state, 0)} W` - } - ` } - ${config.entities?.pv2_power_187 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.pv2_power_187)}> - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV2Power.state, data.statePV2Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV2Power.state, 0)} W` - } + ${data.statePV2Power.toPowerString(config.solar.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV2Power.state, data.statePV2Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV2Power.state, 0)} W` - } - ` } - ${config.entities?.pv3_power_188 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.pv3_power_188)}> - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV3Power.state, data.statePV3Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV3Power.state, 0)} W` - } + ${data.statePV3Power.toPowerString(config.solar.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV3Power.state, data.statePV3Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV3Power.state, 0)} W`} - ` } - ${config.entities?.pv4_power_189 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.pv4_power_189)}> - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV4Power.state, data.statePV4Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV4Power.state, 0)} W` - } + ${data.statePV4Power.toPowerString(config.solar.auto_scale, data.decimalPlaces)} - ` - : svg` - - ${config.solar.auto_scale - ? Utils.convertValueNew(data.statePV4Power.state, data.statePV4Power.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.statePV4Power.state, 0)} W` - } - ` - } - ${config.entities?.aux_load1 - ? svg` + `} + ${svg` Utils.handlePopup(e, config.entities.aux_load1)}> - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateAuxLoad1.state, data.stateAuxLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateAuxLoad1.state, 0) || 0} W` - } - - ` - : svg` - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateAuxLoad1.state, data.stateAuxLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateAuxLoad1.state, 0) || 0} W` - } - ` - } - ${config.entities?.aux_load2 - ? svg` - Utils.handlePopup(e, config.entities.aux_load2)}> - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateAuxLoad2.state, data.stateAuxLoad2.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateAuxLoad2.state, 0) || 0} W` - } + ${data.stateAuxLoad1.toPowerString(config.load.auto_scale, data.decimalPlaces)} - ` - : svg` + `} + ${svg` - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateAuxLoad2.state, data.stateAuxLoad2.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateAuxLoad2.state, 0) || 0} W` - } + ${data.stateAuxLoad2.toPowerString(config.load.auto_scale, data.decimalPlaces)} ` } - ${config.entities?.non_essential_load1 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.non_essential_load1)}> - ${config.grid.auto_scale - ? Utils.convertValueNew(data.stateNonessentialLoad1.state, data.stateNonessentialLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateNonessentialLoad1.state, 0) || 0} W` - } + ${data.stateNonessentialLoad1.toPowerString(config.grid.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.grid.auto_scale - ? Utils.convertValueNew(data.stateNonessentialLoad1.state, data.stateNonessentialLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateNonessentialLoad1.state, 0) || 0} W` - } - ` } - ${config.entities?.non_essential_load1 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.non_essential_load1)}> - ${config.grid.auto_scale - ? Utils.convertValueNew(data.stateNonessentialLoad1.state, data.stateNonessentialLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateNonessentialLoad1.state, 0) || 0} W` - } + ${data.stateNonessentialLoad1.toPowerString(config.grid.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.grid.auto_scale - ? Utils.convertValueNew(data.stateNonessentialLoad1.state, data.stateNonessentialLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateNonessentialLoad1.state, 0) || 0} W` - } - ` } - ${config.entities?.non_essential_load2 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.non_essential_load2)}> - ${config.grid.auto_scale - ? Utils.convertValueNew(data.stateNonessentialLoad2.state, data.stateNonessentialLoad2.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateNonessentialLoad2.state, 0) || 0} W` - } + ${data.stateNonessentialLoad1.toPowerString(config.grid.auto_scale, data.decimalPlaces)} - ` - : svg` - - ${config.grid.auto_scale - ? Utils.convertValueNew(data.stateNonessentialLoad2.state, data.stateNonessentialLoad2.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateNonessentialLoad2.state, 0) || 0} W` - } - ` - } - ${config.entities?.non_essential_load3 - ? svg` + `} + ${svg` Utils.handlePopup(e, config.entities.non_essential_load3)}> - ${config.grid.auto_scale - ? Utils.convertValueNew(data.stateNonessentialLoad3.state, data.stateNonessentialLoad3.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateNonessentialLoad3.state, 0) || 0} W` - } + ${data.stateNonessentialLoad3.toPowerString(config.grid.auto_scale, data.decimalPlaces)} - ` - : svg` - - ${config.grid.auto_scale - ? Utils.convertValueNew(data.stateNonessentialLoad3.state, data.stateNonessentialLoad3.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateNonessentialLoad3.state, 0) || 0} W` - } - ` - } - ${config.entities?.essential_load1 - ? svg` + `} + ${svg` Utils.handlePopup(e, config.entities.essential_load1)}> - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad1.state, data.stateEssentialLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad1.state, 0) || 0} ${ - data.stateEssentialLoad1.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad1.attributes?.unit_of_measurement - : '' - }` - } + ${data.stateEssentialLoad1.toPowerString(config.load.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad1.state, data.stateEssentialLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad1.state, 0) || 0} ${ - data.stateEssentialLoad1.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad1.attributes?.unit_of_measurement - : '' - }` - } - ` } - ${config.entities?.essential_load1 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.essential_load1)}> - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad1.state, data.stateEssentialLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad1.state, 0) || 0} ${ - data.stateEssentialLoad1.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad1.attributes?.unit_of_measurement - : '' - }` - } + ${data.stateEssentialLoad1.toPowerString(config.load.auto_scale, data.decimalPlaces)} ` - : svg` - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad1.state, data.stateEssentialLoad1.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad1.state, 0) || 0} ${ - data.stateEssentialLoad1.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad1.attributes?.unit_of_measurement - : '' - }` - } - ` } - ${config.entities?.essential_load2 - ? svg` + ${svg` Utils.handlePopup(e, config.entities.essential_load2)}> - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad2.state, data.stateEssentialLoad2.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad2.state, 0) || 0} ${ - data.stateEssentialLoad2.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad2.attributes?.unit_of_measurement - : '' - }` - } + ${data.stateEssentialLoad2.toPowerString(config.load.auto_scale, data.decimalPlaces) + } ` - : svg` - - ${config.load.auto_scale - ? Utils.convertValueNew(data.stateEssentialLoad2.state, data.stateEssentialLoad2.attributes?.unit_of_measurement, data.decimalPlaces) - : `${Utils.toNum(data.stateEssentialLoad2.state, 0) || 0} ${ - data.stateEssentialLoad2.attributes?.unit_of_measurement !== undefined - ? data.stateEssentialLoad2.attributes?.unit_of_measurement - : '' - }` - } - ` } ${data.totalGridPower >= 0 ? svg` @@ -1939,14 +1723,14 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string - ${data.energyCost} ${data.stateEnergyCostBuy.attributes?.unit_of_measurement} + ${data.energyCost} ${data.stateEnergyCostBuy?.getUOM()} ` : svg` Utils.handlePopup(e, config.entities.energy_cost_sell)}> - ${data.energyCost} ${data.stateEnergyCostSell.attributes?.unit_of_measurement} + ${data.energyCost} ${data.stateEnergyCostSell?.getUOM()} ` } @@ -2015,7 +1799,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string - ${parseInt(data.stateBatterySoc.state)} % + ${data.stateBatterySoc.toNum()} % Utils.handlePopup(e, config.entities.battery_soc_184)}> @@ -2099,56 +1883,64 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string Utils.handlePopup(e, config.entities.pv1_voltage_109)}> ${Utils.toNum(data.statePV1Voltage.state, 1)} V + fill="${data.solarColour}">${data.statePV1Voltage.toNum(1)} + ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.pv1_current_110)}> ${Utils.toNum(data.statePV1Current.state, 1)} A + fill="${data.solarColour}">${data.statePV1Current.toNum(1)} + ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.pv2_voltage_111)}> ${Utils.toNum(data.statePV2Voltage.state, 1)} V + fill="${data.solarColour}">${data.statePV2Voltage.toNum(1)} + ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.pv2_current_112)}> ${Utils.toNum(data.statePV2Current.state, 1)} A + fill="${data.solarColour}">${data.statePV2Current.toNum(1)} + ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.pv3_voltage_113)}> ${Utils.toNum(data.statePV3Voltage.state, 1)} V + fill="${data.solarColour}">${data.statePV3Voltage.toNum(1)} + ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.pv3_current_114)}> ${Utils.toNum(data.statePV3Current.state, 1)} A + fill="${data.solarColour}">${data.statePV3Current.toNum(1)} + ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.pv4_voltage_115)}> ${Utils.toNum(data.statePV4Voltage.state, 1)} V + fill="${data.solarColour}">${data.statePV4Voltage.toNum(1)} + ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.pv4_current_116)}> ${Utils.toNum(data.statePV4Current.state, 1)} A + fill="${data.solarColour}">${data.statePV4Current.toNum(1)} + ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.battery_temp_182)}> - ${Utils.toNum(data.stateBatteryTemp.state, 1)}° + ${data.stateBatteryTemp.toNum(1)}° Utils.handlePopup(e, config.entities.radiator_temp_91)}> @@ -2156,27 +1948,27 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string y="${config.solar?.mppts === 4 ? '237' : '153'}" class="st3 left-align" fill="${data.inverterColour}" display="${config.entities?.radiator_temp_91 ? '' : 'none'}">AC: - ${Utils.toNum(data.stateRadiatorTemp.state, 1)}° + ${data.stateRadiatorTemp.toNum(1)}° Utils.handlePopup(e, config.entities.dc_transformer_temp_90)}> DC: - ${Utils.toNum(data.stateDCTransformerTemp.state, 1)}° + ${data.stateDCTransformerTemp.toNum(1)}° Utils.handlePopup(e, config.entities.environment_temp)}> - ${Utils.toNum(data.stateEnvironmentTemp.state, 1)}° + ${data.stateEnvironmentTemp.toNum(1)}° Utils.handlePopup(e, config.entities.prepaid_units)}> - ${Utils.toNum(data.statePrepaidUnits.state, 1)} + ${data.statePrepaidUnits.toNum(1)} diff --git a/src/const.ts b/src/const.ts index 5f3d16c0..828daadd 100644 --- a/src/const.ts +++ b/src/const.ts @@ -28,3 +28,52 @@ export const enum SensorDeviceClass { TEMPERATURE = "temperature", VOLTAGE = "voltage" } + +export const enum UnitOfPower { + WATT = "W", + KILO_WATT = "kW", + BTU_PER_HOUR = "BTU/h", +} + +export const enum UnitOfEnergy { + GIGA_JOULE = "GJ", + KILO_WATT_HOUR = "kWh", + MEGA_JOULE = "MJ", + MEGA_WATT_HOUR = "MWh", + WATT_HOUR = "Wh", +} + +export const enum UnitOfElectricalCurrent { + MILLIAMPERE = "mA", + AMPERE = "A" +} + +export const enum UnitOfElectricPotential { + MILLIVOLT = "mV", + VOLT = "V" +} + +type ConversionRule = { + threshold: number; + divisor: number; + targetUnit: UnitOfEnergy; + decimal?: number; +}; + +export const unitOfEnergyConversionRules: Record = { + [UnitOfEnergy.WATT_HOUR]: [{threshold: 1e6, divisor: 1e6, targetUnit: UnitOfEnergy.MEGA_WATT_HOUR}, { + threshold: 1e3, + divisor: 1e3, + targetUnit: UnitOfEnergy.KILO_WATT_HOUR, + decimal: 1 + }], + [UnitOfEnergy.KILO_WATT_HOUR]: [{ + threshold: 1e3, + divisor: 1e3, + targetUnit: UnitOfEnergy.MEGA_WATT_HOUR, + decimal: 2 + }], + [UnitOfEnergy.MEGA_WATT_HOUR]: [], + [UnitOfEnergy.GIGA_JOULE]: [{threshold: 1e3, divisor: 1e3, targetUnit: UnitOfEnergy.MEGA_JOULE}], + [UnitOfEnergy.MEGA_JOULE]: [], +}; diff --git a/src/helpers/icons.ts b/src/helpers/icons.ts new file mode 100644 index 00000000..ddb19d73 --- /dev/null +++ b/src/helpers/icons.ts @@ -0,0 +1,6 @@ +export const icons = { + ess: 'm15 13l-4 4v-3H2v-2h9V9l4 4M5 20v-4h2v2h10v-7.81l-5-4.5L7.21 10H4.22L12 3l10 9h-3v8H5Z', + essBat: 'M15 9h1V7.5h4V9h1c.55 0 1 .45 1 1v11c0 .55-.45 1-1 1h-6c-.55 0-1-.45-1-1V10c0-.55.45-1 1-1m1 2v3h4v-3h-4m-4-5.31l-5 4.5V18h5v2H5v-8H2l10-9l2.78 2.5H14v1.67l-.24.1L12 5.69Z', + essGrid: 'M5 20v-8H2l10-9l10 9h-3v8zm7-14.31l-5 4.5V18h10v-7.81zM11.5 18v-4H9l3.5-7v4H15z', + essPv: 'M11.6 3.45zM18.25 19.6v-7.6h2.85L11.6 3.45 2.1 12h2.85v7.6zM11.6 6.015l4.75 4.275V17.7H6.85v-7.41zM6.58 2.8v1.42L8 3.508zm-.4 2.4L5.2 6.184l1.5.5zM2.8 6.58 3.508 8l.712-1.42zM6 2.8H2.8v3.2c.228.068.468.1.708.1 1.432.004 2.596-1.16 2.6-2.6-.004-.236-.04-.472-.108-.7M12.5 3.844l2.25 2.026.5-.5-2.24-2.04zM17.71 8.53 18.2 8.04 15.76 5.84 15.26 6.34ZM20.52 11.09l.48-.49-2.31-2.14-.5.5z M18.1299 5.1169 17.318 4.6482l2.4492-1.6171-.75 1.299.8119.4687-2.4492 1.6171z' +} diff --git a/src/helpers/utils.ts b/src/helpers/utils.ts index dc6bbfc7..07561b00 100644 --- a/src/helpers/utils.ts +++ b/src/helpers/utils.ts @@ -1,3 +1,5 @@ +import {UnitOfEnergy, unitOfEnergyConversionRules} from '../const'; + export class Utils { static toNum(val: string | number, decimals: number = -1, invert: boolean = false): number { let numberValue = Number(val); @@ -22,85 +24,32 @@ export class Utils { } } - static convertValueNew(value: string | number, unit: string = '', decimal: number = 2) { - - decimal = Number.isNaN(decimal) ? 2 : decimal; - let numberValue = Number(value); - if (Number.isNaN(numberValue)) { - return 0; - } + static convertValueNew(value: string | number, unit: UnitOfEnergy | string = UnitOfEnergy.WATT_HOUR, decimal: number = 2) { + decimal = isNaN(decimal) ? 2 : decimal; + const numberValue = Number(value); + if (isNaN(numberValue)) return 0; - const units = ['W', 'kW', 'MW', 'Wh', 'kWh', 'MWh']; + const rules = unitOfEnergyConversionRules[unit]; + if (!rules) return `${Math.round(numberValue)} ${unit}`; - // Find the index of the unit in the units array - const unitIndex = units.findIndex(u => u.toLowerCase() === unit.toLowerCase()); - - //console.log(`Input: ${value} ${unit}`); - //console.log(`Unit Index: ${unitIndex}`); - - // Check if the unit is in the allowed units array - if (unitIndex !== -1) { - // Perform the conversion based on the unit index - switch (unitIndex) { - case 0: // W - if (Math.abs(numberValue) >= 1e6) { - return `${(numberValue / 1e6).toFixed(decimal)} ${units[2]}`; - } else if (Math.abs(numberValue) >= 1e3) { - return `${(numberValue / 1e3).toFixed(decimal)} ${units[1]}`; - } else { - return `${Math.round(numberValue)} ${units[unitIndex]}`; - } - case 1: // kW - if (Math.abs(numberValue) >= 1e3) { - return `${(numberValue / 1e3).toFixed(decimal)} ${units[2]}`; - } else if (Math.abs(numberValue) < 1) { - return `${Math.round(numberValue * 1000)} ${units[0]}`; - } else { - return `${numberValue.toFixed(decimal)} ${units[unitIndex]}`; - } - case 2: // MW - if (Math.abs(numberValue) < 1) { - return `${(numberValue * 1000).toFixed(decimal)} ${units[1]}`; - } else { - return `${numberValue.toFixed(decimal)} ${units[unitIndex]}`; - } - case 3: // Wh - if (Math.abs(numberValue) >= 1e6) { - return `${(numberValue / 1e6).toFixed(1)} ${units[5]}`; - } else if (Math.abs(numberValue) >= 1e3) { - return `${(numberValue / 1e3).toFixed(1)} ${units[4]}`; - } else { - return `${numberValue.toFixed(1)} ${units[unitIndex]}`; - } - case 4: // kWh - if (Math.abs(numberValue) >= 1e3) { - return `${(numberValue / 1e3).toFixed(2)} ${units[5]}`; - //} else if (Math.abs(numberValue) < 1) { - // return `${(numberValue * 1000).toFixed(1)} ${units[3]}`; - } else { - return `${numberValue.toFixed(1)} ${units[unitIndex]}`; - } - case 5: // MWh - if (Math.abs(numberValue) < 1) { - return `${(numberValue * 1000).toFixed(1)} ${units[4]}`; - } else { - return `${numberValue.toFixed(1)} ${units[unitIndex]}`; - } - default: - return `${Math.round(numberValue)} ${unit}`; + for (const rule of rules) { + if (Math.abs(numberValue) >= rule.threshold) { + const convertedValue = (numberValue / rule.divisor).toFixed(rule.decimal || decimal); + return `${convertedValue} ${rule.targetUnit}`; } - } else { - // If the unit is not in the allowed units, return the numeric value without unit - return Math.round(numberValue); } + + return `${numberValue.toFixed(decimal)} ${unit}`; } static handlePopup(e, entityId) { + if(!entityId) + return; this._handleClick(e, {action: 'more-info'}, entityId); } private static _handleClick(event, actionConfig, entityId) { - if(!entityId || !event) + if (!entityId || !event) return; event.stopPropagation(); let e; diff --git a/src/index.ts b/src/index.ts index 3957c9b3..bc82b0c6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,6 +15,7 @@ import {globalData} from './helpers/globals'; import {InverterFactory} from './inverters/inverter-factory'; import {BatteryIconManager} from './helpers/battery-icon-manager'; import {convertToCustomEntity, CustomEntity} from './inverters/dto/custom-entity'; +import {icons} from './helpers/icons'; console.groupCollapsed( `%c ⚡ SUNSYNK-POWER-FLOW-CARD %c ${localize('common.version')}: ${CARD_VERSION} `, @@ -878,28 +879,23 @@ export class SunsynkPowerFlowCard extends LitElement { //console.log(`${pvPercentageBat} % PV to charge battery, ${gridPercentageBat} % Grid to charge battery`); - const essBat = 'M15 9h1V7.5h4V9h1c.55 0 1 .45 1 1v11c0 .55-.45 1-1 1h-6c-.55 0-1-.45-1-1V10c0-.55.45-1 1-1m1 2v3h4v-3h-4m-4-5.31l-5 4.5V18h5v2H5v-8H2l10-9l2.78 2.5H14v1.67l-.24.1L12 5.69Z'; - const essGrid = 'M5 20v-8H2l10-9l10 9h-3v8zm7-14.31l-5 4.5V18h10v-7.81zM11.5 18v-4H9l3.5-7v4H15z'; - const essPv = 'M11.6 3.45zM18.25 19.6v-7.6h2.85L11.6 3.45 2.1 12h2.85v7.6zM11.6 6.015l4.75 4.275V17.7H6.85v-7.41zM6.58 2.8v1.42L8 3.508zm-.4 2.4L5.2 6.184l1.5.5zM2.8 6.58 3.508 8l.712-1.42zM6 2.8H2.8v3.2c.228.068.468.1.708.1 1.432.004 2.596-1.16 2.6-2.6-.004-.236-.04-.472-.108-.7M12.5 3.844l2.25 2.026.5-.5-2.24-2.04zM17.71 8.53 18.2 8.04 15.76 5.84 15.26 6.34ZM20.52 11.09l.48-.49-2.31-2.14-.5.5z M18.1299 5.1169 17.318 4.6482l2.4492-1.6171-.75 1.299.8119.4687-2.4492 1.6171z'; - const ess = 'm15 13l-4 4v-3H2v-2h9V9l4 4M5 20v-4h2v2h10v-7.81l-5-4.5L7.21 10H4.22L12 3l10 9h-3v8H5Z'; - let essIcon: string; let essIconSize: number; switch (true) { case pvPercentageRaw >= 100 && batteryPercentageRaw <= 5 && (totalGridPower - nonessentialPower) < 50 && config.load.dynamic_icon: - essIcon = essPv; + essIcon = icons.essPv; essIconSize = 1; break; case batteryPercentageRaw >= 100 && pvPercentageRaw <= 5 && (totalGridPower - nonessentialPower) < 50 && config.load.dynamic_icon: - essIcon = essBat; + essIcon = icons.essBat; essIconSize = 0; break; case pvPercentageRaw < 5 && batteryPercentageRaw < 5 && config.load.dynamic_icon: - essIcon = essGrid; + essIcon = icons.essGrid; essIconSize = 0; break; default: - essIcon = ess; + essIcon = icons.ess; essIconSize = 0; break; } @@ -1093,13 +1089,11 @@ export class SunsynkPowerFlowCard extends LitElement { let entityString; const props = String(entity).split("."); - const ent = props.length > 0 ? props[0] : null; - const prop = props.length > 1 ? props[1] : null; - if (ent && prop) { - entityString = this._config[ent][prop] - } else if (ent) { - entityString = this._config.entities[ent] + if (props.length > 1) { + entityString = this._config[props[0]][props[1]] + } else if (props.length > 0) { + entityString = this._config.entities[props[0]] } const state = entityString ? this.hass.states[entityString] : undefined; diff --git a/src/inverters/dto/custom-entity.ts b/src/inverters/dto/custom-entity.ts index dd06c6db..7343de63 100644 --- a/src/inverters/dto/custom-entity.ts +++ b/src/inverters/dto/custom-entity.ts @@ -1,6 +1,6 @@ import {HassEntity} from 'home-assistant-js-websocket/dist/types'; import {Utils} from '../../helpers/utils'; -import {globalData} from '../../helpers/globals'; +import {UnitOfElectricalCurrent, UnitOfEnergy, UnitOfPower} from '../../const'; /** * CustomEntity interface represents a custom entity in Home Assistant. @@ -19,7 +19,7 @@ export interface CustomEntity extends HassEntity { toString(): string; /** - * Checks that the state is not null or undefined + * Checks that the state is not null, undefined or unknown */ isValid(): boolean; @@ -35,6 +35,16 @@ export interface CustomEntity extends HassEntity { * @param invert */ toPower(invert?: boolean): number; + + /** + * Auto converts the state to watts/kilowatts, with the suffix + * @param invert + * @param decimals + * @param scale + */ + toPowerString(scale?: boolean, decimals?: number, invert?: boolean): string; + + getUOM(): UnitOfPower | UnitOfEnergy | UnitOfElectricalCurrent } // Function to convert HassEntity to CustomEntity @@ -42,12 +52,17 @@ export function convertToCustomEntity(entity: any): CustomEntity { return { ...entity, toNum: (decimals?: number, invert?: boolean) => Utils.toNum(entity?.state, decimals, invert), - isValid: () => entity?.state !== null && entity.state !== undefined || false, + isValid: () => entity?.state !== null && entity.state !== undefined && entity.state !== 'unknown' || false, notEmpty: () => entity?.state !== '' || false, isNaN: () => Number.isNaN(entity?.state) || true, toPower: (invert?: boolean) => (entity.attributes?.unit_of_measurement || '').toLowerCase() === 'kw' ? Utils.toNum(((entity?.state || '0') * 1000), 0, invert) : Utils.toNum((entity?.state || '0'), 0, invert) || 0, - toString: () => entity?.state?.toString() || '' + toPowerString: (scale?: boolean, decimals?: number, invert?: boolean) => + scale ? + Utils.convertValueNew(entity?.state, entity?.attributes?.unit_of_measurement, decimals || 1) : + `${Utils.toNum(entity?.state, decimals, invert)} ${UnitOfEnergy.KILO_WATT_HOUR}`, + toString: () => entity?.state?.toString() || '', + getUOM: () => entity?.attributes?.unit_of_measurement || '' } } diff --git a/src/types.ts b/src/types.ts index cd2fdcef..366bcec9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,5 @@ import {LovelaceCard, LovelaceCardConfig} from "custom-card-helpers"; +import {CustomEntity} from './inverters/dto/custom-entity'; declare global { interface HTMLElementTagNameMap { @@ -256,7 +257,7 @@ export interface InverterSettings { } export interface DataDto { - config, + config: sunsynkPowerFlowCardConfig, panelMode, compactMode, cardHeight, @@ -319,7 +320,7 @@ export interface DataDto { gridPercentageBat, genericInverterImage, battery0, - essentialPower, + essentialPower: number, pv1LineWidth, pv2LineWidth, pv3LineWidth, @@ -368,49 +369,49 @@ export interface DataDto { iconAuxLoad2, autoScaledInverterPower, autoScaledGridPower, - stateDayLoadEnergy, - stateDayBatteryDischarge, - stateDayGridImport, - stateDayBatteryCharge, - stateDayGridExport, - stateDayPVEnergy, - stateDayAuxEnergy, + stateDayLoadEnergy: CustomEntity, + stateDayBatteryDischarge: CustomEntity, + stateDayGridImport: CustomEntity, + stateDayBatteryCharge: CustomEntity, + stateDayGridExport: CustomEntity, + stateDayPVEnergy: CustomEntity, + stateDayAuxEnergy: CustomEntity, inverterProg, - stateUseTimer, - stateBatterySoc, - stateEnergyCostSell, - stateEnergyCostBuy, - stateEssentialLoad1, - stateEssentialLoad2, - stateEssentialLoad3, - stateEssentialLoad4, - stateEssentialLoad1Extra, - stateEssentialLoad2Extra, - statePV4Current, - statePV1Current, - statePV2Current, - statePV3Current, - stateRadiatorTemp, - stateBatteryCurrent, - stateEnvironmentTemp, - statePV1Voltage, - statePV2Voltage, - statePV3Voltage, - statePV4Voltage, - stateBatteryTemp, - statePrepaidUnits, - stateDCTransformerTemp, - stateSolarSell, - statePV2Power, - statePV3Power, - statePV4Power, - statePVTotal, - statePV1Power, - stateAuxLoad1Extra, - stateAuxLoad2Extra, - stateAuxLoad1, - stateAuxLoad2, - stateNonessentialLoad1, - stateNonessentialLoad2, - stateNonessentialLoad3 + stateUseTimer: CustomEntity, + stateBatterySoc: CustomEntity, + stateEnergyCostSell: CustomEntity, + stateEnergyCostBuy: CustomEntity, + stateEssentialLoad1: CustomEntity, + stateEssentialLoad2: CustomEntity, + stateEssentialLoad3: CustomEntity, + stateEssentialLoad4: CustomEntity, + stateEssentialLoad1Extra: CustomEntity, + stateEssentialLoad2Extra: CustomEntity, + statePV4Current: CustomEntity, + statePV1Current: CustomEntity, + statePV2Current: CustomEntity, + statePV3Current: CustomEntity, + stateRadiatorTemp: CustomEntity, + stateBatteryCurrent: CustomEntity, + stateEnvironmentTemp: CustomEntity, + statePV1Voltage: CustomEntity, + statePV2Voltage: CustomEntity, + statePV3Voltage: CustomEntity, + statePV4Voltage: CustomEntity, + stateBatteryTemp: CustomEntity, + statePrepaidUnits: CustomEntity, + stateDCTransformerTemp: CustomEntity, + stateSolarSell: CustomEntity, + statePV2Power: CustomEntity, + statePV3Power: CustomEntity, + statePV4Power: CustomEntity, + statePVTotal: CustomEntity, + statePV1Power: CustomEntity, + stateAuxLoad1Extra: CustomEntity, + stateAuxLoad2Extra: CustomEntity, + stateAuxLoad1: CustomEntity, + stateAuxLoad2: CustomEntity, + stateNonessentialLoad1: CustomEntity, + stateNonessentialLoad2: CustomEntity, + stateNonessentialLoad3: CustomEntity } From f3f7c635f8390188d9387d1c9fae589ce9765762 Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Sun, 17 Mar 2024 01:46:12 +0200 Subject: [PATCH 2/9] remove href if entities do not have state information plus some other updates --- src/cards/compact-card.ts | 238 +++++++++++++++++++------------------- 1 file changed, 119 insertions(+), 119 deletions(-) diff --git a/src/cards/compact-card.ts b/src/cards/compact-card.ts index 0f723be2..a8e0feea 100644 --- a/src/cards/compact-card.ts +++ b/src/cards/compact-card.ts @@ -769,28 +769,28 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str Utils.handlePopup(e, config.entities.day_battery_charge_70)}> ${data.stateDayBatteryCharge?.toPowerString(config.battery.auto_scale)} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale)} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale) + ' / ' + data.remainingSolar} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale) + ' / ' + data.totalSolarGeneration} @@ -798,7 +798,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str Utils.handlePopup(e, config.entities.day_battery_discharge_71)}> ${data.stateDayBatteryDischarge?.toPowerString(config.solar.auto_scale)} @@ -807,21 +807,21 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str ${data.stateDayLoadEnergy?.toPowerString(config.load.auto_scale)} Utils.handlePopup(e, config.entities.day_grid_import_76)}> ${data.stateDayGridImport?.toPowerString(config.grid.auto_scale)} Utils.handlePopup(e, config.entities.day_grid_export_77)}> ${data.stateDayGridExport?.toPowerString(config.grid.auto_scale)} @@ -832,7 +832,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str class="st3 left-align" fill="${data.inverterColour}">${data.inverterVoltage} ${config.inverter.three_phase && config.entities?.inverter_voltage_L2 ? '| ' + data.inverterVoltageL2 : ''} ${config.inverter.three_phase && config.entities?.inverter_voltage_L3 ? '| ' + data.inverterVoltageL3 : ''} - V + ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.load_frequency_192)}> @@ -847,7 +847,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str class="st3 left-align" fill="${data.inverterColour}">${data.inverterCurrent} ${config.inverter.three_phase && config.entities?.inverter_current_L2 ? '| ' + data.inverterCurrentL2 : ''} ${config.inverter.three_phase && config.entities?.inverter_current_L3 ? '| ' + data.inverterCurrentL3 : ''} - A + ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.battery_voltage_183)}> @@ -855,7 +855,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str display="${config.entities.battery_voltage_183 === 'none' || !config.entities.battery_voltage_183 || !config.show_battery || data.compactMode ? 'none' : ''}" fill=${data.batteryColour} class="${data.largeFont !== true ? 'st14' : 'st4'} st8"> - ${data.batteryVoltage} V + ${data.batteryVoltage} ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.battery_voltage_183)}> @@ -863,14 +863,14 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str display="${config.entities.battery_voltage_183 === 'none' || !config.entities.battery_voltage_183 || !config.show_battery || !data.compactMode ? 'none' : ''}" fill=${data.batteryColour} class="${data.compactMode ? 'st3 left-align' : 'st12'}"> - ${data.batteryVoltage} V + ${data.batteryVoltage} ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.battery_soc_184)}> - ${data.stateBatterySoc.toNum(1)} % + ${data.stateBatterySoc.toNum(0)} % Utils.handlePopup(e, config.entities.battery_soc_184)}> @@ -923,7 +923,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str display="${!config.entities.battery_current_191 || config.entities.battery_current_191 === 'none' || !config.show_battery || data.compactMode || !data.stateBatteryCurrent.isValid() ? 'none' : ''}" fill=${data.batteryColour} class="${data.largeFont !== true ? 'st14' : 'st4'} st8"> ${config.battery.show_absolute ? Math.abs(data.stateBatteryCurrent.toNum(1)) : data.stateBatteryCurrent.toNum(1)} - A + ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.battery_current_191)}> @@ -931,7 +931,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str display="${!config.entities.battery_current_191 || config.entities.battery_current_191 === 'none' || !config.show_battery || !data.compactMode || !data.stateBatteryCurrent.isValid() ? 'none' : ''}" fill=${data.batteryColour} class="${data.compactMode ? 'st3 left-align' : 'st12'}"> ${config.battery.show_absolute ? Math.abs(data.stateBatteryCurrent.toNum(1)) : data.stateBatteryCurrent.toNum(1)} - A + ${UnitOfElectricalCurrent.AMPERE} ${config.inverter.three_phase @@ -1050,14 +1050,14 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str Utils.handlePopup(e, config.entities.radiator_temp_91)}> + display="${config.entities?.radiator_temp_91 && data.stateRadiatorTemp.isValid() ? '' : 'none'}"> AC: ${data.stateRadiatorTemp.toNum(1)}° Utils.handlePopup(e, config.entities.dc_transformer_temp_90)}> + display="${config.entities?.dc_transformer_temp_90 && data.stateDCTransformerTemp.isValid() ? '' : 'none'}"> DC: ${data.stateDCTransformerTemp.toNum(1)}° @@ -1072,7 +1072,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str Utils.handlePopup(e, config.entities.essential_load1_extra)}> ${data.stateEssentialLoad1Extra.toNum(1)} ${data.stateEssentialLoad1Extra.getUOM()} @@ -1080,7 +1080,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str Utils.handlePopup(e, config.entities.essential_load2_extra)}> ${data.stateEssentialLoad2Extra.toNum(1)} ${data.stateEssentialLoad2Extra.getUOM()} @@ -1091,7 +1091,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str Utils.handlePopup(e, config.entities.energy_cost_buy)}> + display="${config.entities?.energy_cost_buy && data.stateEnergyCostBuy.isValid() ? '' : 'none'}" > ${data.energyCost} ${data.stateEnergyCostBuy.getUOM()} ` @@ -1099,126 +1099,126 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str Utils.handlePopup(e, config.entities.energy_cost_sell)}> + display="${config.entities?.energy_cost_sell && data.stateEnergyCostSell.isValid() ? '' : 'none'}" > ${data.energyCost} ${data.stateEnergyCostSell.getUOM()} `} - ${svg` + + ${config.entities?.pv_total + ? svg` Utils.handlePopup(e, config.entities.pv_total)}> ${config.solar.auto_scale - ? config.entities?.pv_total - ? Utils.convertValueNew(data.totalPV, data.statePVTotal.getUOM(), data.decimalPlaces) - : Utils.convertValue(data.totalPV, data.decimalPlaces) || 0 - : `${Utils.toNum(data.totalPV || 0, 0)} ${UnitOfPower.WATT}` - } - - ` - } - ${svg` Utils.handlePopup(e, config.entities.pv1_power_186)}> - - ${data.statePV1Power?.toPowerString(config.solar.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` Utils.handlePopup(e, config.entities.pv2_power_187)}> - - ${data.statePV2Power?.toPowerString(config.solar.auto_scale, data.decimalPlaces)} - - ` - - } - ${svg` - Utils.handlePopup(e, config.entities.pv3_power_188)}> - - ${data.statePV3Power?.toPowerString(config.solar.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` - Utils.handlePopup(e, config.entities.pv4_power_189)}> - - ${data.statePV4Power?.toPowerString(config.solar.auto_scale, data.decimalPlaces)} + ? config.entities?.pv_total + ? Utils.convertValueNew(data.totalPV, data.statePVTotal.getUOM(), data.decimalPlaces) + : Utils.convertValue(data.totalPV, data.decimalPlaces) || 0 + : `${Utils.toNum(data.totalPV || 0, 0)} ${UnitOfPower.WATT}` + } ` + : svg` + + ${config.solar.auto_scale + ? config.entities?.pv_total + ? Utils.convertValueNew(data.totalPV, data.statePVTotal.getUOM(), data.decimalPlaces) + : Utils.convertValue(data.totalPV, data.decimalPlaces) || 0 + : `${Utils.toNum(data.totalPV || 0, 0)} ${UnitOfPower.WATT}` + } + ` } - ${svg` + Utils.handlePopup(e, config.entities.pv1_power_186)}> + + ${data.statePV1Power?.toPowerString(config.solar.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.pv2_power_187)}> + + ${data.statePV2Power?.toPowerString(config.solar.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.pv3_power_188)}> + + ${data.statePV3Power?.toPowerString(config.solar.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.pv4_power_189)}> + + ${data.statePV4Power?.toPowerString(config.solar.auto_scale, data.decimalPlaces)} + + + ${config.entities?.essential_power && config.entities.essential_power !== 'none' + ? svg` Utils.handlePopup(e, config.entities.essential_power)}> ${config.load.auto_scale ? `${Utils.convertValue(data.essentialPower, data.decimalPlaces) || 0}` : `${data.essentialPower || 0} ${UnitOfPower.WATT}`} ` + : svg` + + ${config.load.auto_scale ? `${Utils.convertValue(data.essentialPower, data.decimalPlaces) || 0}` : `${data.essentialPower || 0} ${UnitOfPower.WATT}`} + ` } - ${svg` - Utils.handlePopup(e, config.entities.essential_load1)}> - - ${data.stateEssentialLoad1?.toPowerString(config.load.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` - Utils.handlePopup(e, config.entities.essential_load2)}> - - ${data.stateEssentialLoad2?.toPowerString(config.load.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` - Utils.handlePopup(e, config.entities.essential_load1)}> - - ${data.stateEssentialLoad1?.toPowerString(config.load.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` - Utils.handlePopup(e, config.entities.essential_load2)}> - - ${data.stateEssentialLoad2?.toPowerString(config.load.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` - Utils.handlePopup(e, config.entities.essential_load3)}> - - ${data.stateEssentialLoad3?.toPowerString(config.load.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` - Utils.handlePopup(e, config.entities.essential_load4)}> - - ${data.stateEssentialLoad4?.toPowerString(config.load.auto_scale, data.decimalPlaces)} - - ` - } + Utils.handlePopup(e, config.entities.essential_load1)}> + + ${data.stateEssentialLoad1?.toPowerString(config.load.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.essential_load2)}> + + ${data.stateEssentialLoad2?.toPowerString(config.load.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.essential_load1)}> + + ${data.stateEssentialLoad1?.toPowerString(config.load.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.essential_load2)}> + + ${data.stateEssentialLoad2?.toPowerString(config.load.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.essential_load3)}> + + ${data.stateEssentialLoad3?.toPowerString(config.load.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.essential_load4)}> + + ${data.stateEssentialLoad4?.toPowerString(config.load.auto_scale, data.decimalPlaces)} + + Utils.handlePopup(e, config.entities.prepaid_units)}> + fill="${data.gridColour}" display="${!config.show_grid || !data.statePrepaidUnits.isValid() ? 'none' : ''}"> ${data.statePrepaidUnits.toNum(1)} From 8545192733c0c86ddd5f2983ac77b04594f99116 Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Sun, 17 Mar 2024 11:24:39 +0200 Subject: [PATCH 3/9] update default unit to match entity --- src/inverters/dto/custom-entity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inverters/dto/custom-entity.ts b/src/inverters/dto/custom-entity.ts index 7343de63..4753e6d7 100644 --- a/src/inverters/dto/custom-entity.ts +++ b/src/inverters/dto/custom-entity.ts @@ -61,7 +61,7 @@ export function convertToCustomEntity(entity: any): CustomEntity { toPowerString: (scale?: boolean, decimals?: number, invert?: boolean) => scale ? Utils.convertValueNew(entity?.state, entity?.attributes?.unit_of_measurement, decimals || 1) : - `${Utils.toNum(entity?.state, decimals, invert)} ${UnitOfEnergy.KILO_WATT_HOUR}`, + `${Utils.toNum(entity?.state, decimals, invert)} ${entity?.attributes?.unit_of_measurement}`, toString: () => entity?.state?.toString() || '', getUOM: () => entity?.attributes?.unit_of_measurement || '' } From c6bbc295c5a5b70ab1cefe64851c1bd21331ff6b Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Sun, 17 Mar 2024 11:59:42 +0200 Subject: [PATCH 4/9] add initial support for conversion rules to include power values --- src/const.ts | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/const.ts b/src/const.ts index 828daadd..d54893fb 100644 --- a/src/const.ts +++ b/src/const.ts @@ -32,6 +32,7 @@ export const enum SensorDeviceClass { export const enum UnitOfPower { WATT = "W", KILO_WATT = "kW", + MEGA_WATT = "MW", BTU_PER_HOUR = "BTU/h", } @@ -53,14 +54,16 @@ export const enum UnitOfElectricPotential { VOLT = "V" } +type UnitOfEnergyOrPower = UnitOfEnergy | UnitOfPower; + type ConversionRule = { threshold: number; divisor: number; - targetUnit: UnitOfEnergy; + targetUnit: UnitOfEnergyOrPower; decimal?: number; }; -export const unitOfEnergyConversionRules: Record = { +export const unitOfEnergyConversionRules: Record = { [UnitOfEnergy.WATT_HOUR]: [{threshold: 1e6, divisor: 1e6, targetUnit: UnitOfEnergy.MEGA_WATT_HOUR}, { threshold: 1e3, divisor: 1e3, @@ -76,4 +79,18 @@ export const unitOfEnergyConversionRules: Record [UnitOfEnergy.MEGA_WATT_HOUR]: [], [UnitOfEnergy.GIGA_JOULE]: [{threshold: 1e3, divisor: 1e3, targetUnit: UnitOfEnergy.MEGA_JOULE}], [UnitOfEnergy.MEGA_JOULE]: [], + [UnitOfPower.WATT]: [{threshold: 1e6, divisor: 1e6, targetUnit: UnitOfPower.MEGA_WATT}, { + threshold: 1e3, + divisor: 1e3, + targetUnit: UnitOfPower.KILO_WATT, + decimal: 1 + }], + [UnitOfPower.KILO_WATT]: [{ + threshold: 1e3, + divisor: 1e3, + targetUnit: UnitOfPower.MEGA_WATT, + decimal: 2 + }], + [UnitOfPower.MEGA_WATT]: [], + [UnitOfPower.BTU_PER_HOUR]: [], }; From 9376e2755b10a4b410ad33a4e635ff0e06397b76 Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Sun, 17 Mar 2024 12:18:52 +0200 Subject: [PATCH 5/9] dont force decimals for power conversion. Set fixed decimal for kWh. Change default decimal to 0 --- src/cards/compact-card.ts | 16 ++++++++-------- src/const.ts | 2 -- src/inverters/dto/custom-entity.ts | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/cards/compact-card.ts b/src/cards/compact-card.ts index a8e0feea..ddcc62af 100644 --- a/src/cards/compact-card.ts +++ b/src/cards/compact-card.ts @@ -771,28 +771,28 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str class="st10 left-align" display="${data.batteryShowDaily !== true || !config.show_battery || !data.stateDayBatteryCharge.isValid() ? 'none' : ''}" fill="${data.batteryColour}"> - ${data.stateDayBatteryCharge?.toPowerString(config.battery.auto_scale)} + ${data.stateDayBatteryCharge?.toPowerString(config.battery.auto_scale, 1)} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale)} + ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale, 1)} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale) + ' / ' + data.remainingSolar} + ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale, 1) + ' / ' + data.remainingSolar} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale) + ' / ' + data.totalSolarGeneration} + ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale, 1) + ' / ' + data.totalSolarGeneration} Utils.handlePopup(e, config.entities.day_battery_discharge_71)}> @@ -800,7 +800,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str class="st10 left-align" display="${data.batteryShowDaily !== true || !config.show_battery || !data.stateDayBatteryDischarge.isValid() ? 'none' : ''}" fill="${data.batteryColour}"> - ${data.stateDayBatteryDischarge?.toPowerString(config.solar.auto_scale)} + ${data.stateDayBatteryDischarge?.toPowerString(config.solar.auto_scale, 1)} Utils.handlePopup(e, config.entities.day_load_energy_84)}> @@ -809,21 +809,21 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str y="${[2, 4].includes(data.additionalLoad) ? '175' : '267.9'}" class="st10 left-align" display="${!data.loadShowDaily || !data.stateDayLoadEnergy.isValid() ? 'none' : ''}" fill="${data.loadColour}"> - ${data.stateDayLoadEnergy?.toPowerString(config.load.auto_scale)} + ${data.stateDayLoadEnergy?.toPowerString(config.load.auto_scale, 1)} Utils.handlePopup(e, config.entities.day_grid_import_76)}> - ${data.stateDayGridImport?.toPowerString(config.grid.auto_scale)} + ${data.stateDayGridImport?.toPowerString(config.grid.auto_scale, 1)} Utils.handlePopup(e, config.entities.day_grid_export_77)}> - ${data.stateDayGridExport?.toPowerString(config.grid.auto_scale)} + ${data.stateDayGridExport?.toPowerString(config.grid.auto_scale, 1)} Utils.handlePopup(e, config.entities.inverter_voltage_154)}> diff --git a/src/const.ts b/src/const.ts index d54893fb..4583d984 100644 --- a/src/const.ts +++ b/src/const.ts @@ -83,13 +83,11 @@ export const unitOfEnergyConversionRules: Record scale ? - Utils.convertValueNew(entity?.state, entity?.attributes?.unit_of_measurement, decimals || 1) : + Utils.convertValueNew(entity?.state, entity?.attributes?.unit_of_measurement, decimals || 0) : `${Utils.toNum(entity?.state, decimals, invert)} ${entity?.attributes?.unit_of_measurement}`, toString: () => entity?.state?.toString() || '', getUOM: () => entity?.attributes?.unit_of_measurement || '' From b3bf8c8e858ec21da0ab6bfd464d5460facf9e91 Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Sun, 17 Mar 2024 13:02:01 +0200 Subject: [PATCH 6/9] remove default unit. Round power values less than 1000. --- src/const.ts | 2 +- src/helpers/utils.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/const.ts b/src/const.ts index 4583d984..0f79bd4d 100644 --- a/src/const.ts +++ b/src/const.ts @@ -54,7 +54,7 @@ export const enum UnitOfElectricPotential { VOLT = "V" } -type UnitOfEnergyOrPower = UnitOfEnergy | UnitOfPower; +export type UnitOfEnergyOrPower = UnitOfEnergy | UnitOfPower; type ConversionRule = { threshold: number; diff --git a/src/helpers/utils.ts b/src/helpers/utils.ts index 07561b00..00422fdb 100644 --- a/src/helpers/utils.ts +++ b/src/helpers/utils.ts @@ -1,4 +1,4 @@ -import {UnitOfEnergy, unitOfEnergyConversionRules} from '../const'; +import {UnitOfEnergy, UnitOfPower, UnitOfEnergyOrPower, unitOfEnergyConversionRules} from '../const'; export class Utils { static toNum(val: string | number, decimals: number = -1, invert: boolean = false): number { @@ -24,7 +24,7 @@ export class Utils { } } - static convertValueNew(value: string | number, unit: UnitOfEnergy | string = UnitOfEnergy.WATT_HOUR, decimal: number = 2) { + static convertValueNew(value: string | number, unit: UnitOfEnergyOrPower | string = '', decimal: number = 2) { decimal = isNaN(decimal) ? 2 : decimal; const numberValue = Number(value); if (isNaN(numberValue)) return 0; @@ -32,6 +32,10 @@ export class Utils { const rules = unitOfEnergyConversionRules[unit]; if (!rules) return `${Math.round(numberValue)} ${unit}`; + if (unit === UnitOfPower.WATT && Math.abs(numberValue) < 1000) { + return `${Math.round(numberValue)} ${unit}`; + }; + for (const rule of rules) { if (Math.abs(numberValue) >= rule.threshold) { const convertedValue = (numberValue / rule.divisor).toFixed(rule.decimal || decimal); From 17b26edcb8692afd262973d139921377a54056a2 Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Sun, 17 Mar 2024 13:12:01 +0200 Subject: [PATCH 7/9] dont set decimals when auto scale false. Return empty string when no unit of measurment --- src/inverters/dto/custom-entity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inverters/dto/custom-entity.ts b/src/inverters/dto/custom-entity.ts index 60b3e8a0..2cfd5f83 100644 --- a/src/inverters/dto/custom-entity.ts +++ b/src/inverters/dto/custom-entity.ts @@ -61,7 +61,7 @@ export function convertToCustomEntity(entity: any): CustomEntity { toPowerString: (scale?: boolean, decimals?: number, invert?: boolean) => scale ? Utils.convertValueNew(entity?.state, entity?.attributes?.unit_of_measurement, decimals || 0) : - `${Utils.toNum(entity?.state, decimals, invert)} ${entity?.attributes?.unit_of_measurement}`, + `${Utils.toNum(entity?.state, 0, invert)} ${entity?.attributes?.unit_of_measurement || ''}`, toString: () => entity?.state?.toString() || '', getUOM: () => entity?.attributes?.unit_of_measurement || '' } From a0b596967087c90ffccf319026f4de541643c984 Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Sun, 17 Mar 2024 13:33:15 +0200 Subject: [PATCH 8/9] always scale daily energy values --- src/cards/compact-card.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cards/compact-card.ts b/src/cards/compact-card.ts index ddcc62af..ae28706d 100644 --- a/src/cards/compact-card.ts +++ b/src/cards/compact-card.ts @@ -771,28 +771,28 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str class="st10 left-align" display="${data.batteryShowDaily !== true || !config.show_battery || !data.stateDayBatteryCharge.isValid() ? 'none' : ''}" fill="${data.batteryColour}"> - ${data.stateDayBatteryCharge?.toPowerString(config.battery.auto_scale, 1)} + ${data.stateDayBatteryCharge?.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale, 1)} + ${data.stateDayPVEnergy?.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale, 1) + ' / ' + data.remainingSolar} + ${data.stateDayPVEnergy?.toPowerString(true, 1) + ' / ' + data.remainingSolar} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${data.stateDayPVEnergy?.toPowerString(config.solar.auto_scale, 1) + ' / ' + data.totalSolarGeneration} + ${data.stateDayPVEnergy?.toPowerString(true, 1) + ' / ' + data.totalSolarGeneration} Utils.handlePopup(e, config.entities.day_battery_discharge_71)}> @@ -800,7 +800,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str class="st10 left-align" display="${data.batteryShowDaily !== true || !config.show_battery || !data.stateDayBatteryDischarge.isValid() ? 'none' : ''}" fill="${data.batteryColour}"> - ${data.stateDayBatteryDischarge?.toPowerString(config.solar.auto_scale, 1)} + ${data.stateDayBatteryDischarge?.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.day_load_energy_84)}> @@ -809,21 +809,21 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str y="${[2, 4].includes(data.additionalLoad) ? '175' : '267.9'}" class="st10 left-align" display="${!data.loadShowDaily || !data.stateDayLoadEnergy.isValid() ? 'none' : ''}" fill="${data.loadColour}"> - ${data.stateDayLoadEnergy?.toPowerString(config.load.auto_scale, 1)} + ${data.stateDayLoadEnergy?.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.day_grid_import_76)}> - ${data.stateDayGridImport?.toPowerString(config.grid.auto_scale, 1)} + ${data.stateDayGridImport?.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.day_grid_export_77)}> - ${data.stateDayGridExport?.toPowerString(config.grid.auto_scale, 1)} + ${data.stateDayGridExport?.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.inverter_voltage_154)}> From 55b01d54ca20bf886bf49f2734161cfd28a444b9 Mon Sep 17 00:00:00 2001 From: Paul Orffer Date: Sun, 17 Mar 2024 15:37:35 +0200 Subject: [PATCH 9/9] apply checks to full card --- src/cards/compact-card.ts | 4 +- src/cards/full-card.ts | 358 ++++++++++++++++++-------------------- 2 files changed, 169 insertions(+), 193 deletions(-) diff --git a/src/cards/compact-card.ts b/src/cards/compact-card.ts index ae28706d..689859b4 100644 --- a/src/cards/compact-card.ts +++ b/src/cards/compact-card.ts @@ -2,7 +2,7 @@ import {html, svg} from 'lit'; import {localize} from '../localize/localize'; import {Utils} from '../helpers/utils'; import {AutarkyType, DataDto, InverterModel, sunsynkPowerFlowCardConfig} from '../types'; -import {UnitOfElectricalCurrent, UnitOfElectricPotential, UnitOfPower} from '../const'; +import {UnitOfElectricalCurrent, UnitOfElectricPotential, UnitOfEnergy, UnitOfPower} from '../const'; export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string, data: DataDto) => { return html` @@ -255,7 +255,7 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str display="${!config.show_battery || !config.battery.show_remaining_energy ? 'none' : ''}" fill="${data.batteryColour}"> ${Utils.toNum((data.batteryEnergy * (data.stateBatterySoc.toNum(2) / 100) / 1000), 2)} - kWh + ${UnitOfEnergy.KILO_WATT_HOUR} { return html` @@ -177,7 +177,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string display="${!config.show_battery || !config.battery.show_remaining_energy ? 'none' : ''}" fill="${data.batteryColour}"> ${Utils.toNum((data.batteryEnergy * (data.stateBatterySoc?.toNum() / 100) / 1000), 2)} - kWh + ${UnitOfEnergy.KILO_WATT_HOUR} - ${config.load.auto_scale ? `${Utils.convertValue(data.gridPower, data.decimalPlaces) || 0}` : `${data.gridPower || 0} W`} + ${config.load.auto_scale ? `${Utils.convertValue(data.gridPower, data.decimalPlaces) || 0}` : `${data.gridPower || 0} ${UnitOfPower.WATT}`} - ${config.load.auto_scale ? `${Utils.convertValue(data.gridPowerL2, data.decimalPlaces) || 0}` : `${data.gridPowerL2 || 0} W`} + ${config.load.auto_scale ? `${Utils.convertValue(data.gridPowerL2, data.decimalPlaces) || 0}` : `${data.gridPowerL2 || 0} ${UnitOfPower.WATT}`} - ${config.load.auto_scale ? `${Utils.convertValue(data.gridPowerL3, data.decimalPlaces) || 0}` : `${data.gridPowerL3 || 0} W`} + ${config.load.auto_scale ? `${Utils.convertValue(data.gridPowerL3, data.decimalPlaces) || 0}` : `${data.gridPowerL3 || 0} ${UnitOfPower.WATT}`} - . - - - @@ -1370,84 +1366,84 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${data.stateDayPVEnergy.toPowerString(config.solar.auto_scale, 1)} + ${data.stateDayPVEnergy.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${data.stateDayPVEnergy.toPowerString(config.solar.auto_scale, 1)} / ${data.remainingSolar} + ${data.stateDayPVEnergy.toPowerString(true, 1)} / ${data.remainingSolar} Utils.handlePopup(e, config.entities.day_pv_energy_108)}> - ${data.stateDayPVEnergy.toPowerString(config.solar.auto_scale, 1)} / + ${data.stateDayPVEnergy.toPowerString(true, 1)} / ${data.totalSolarGeneration} Utils.handlePopup(e, config.entities.day_load_energy_84)}> - ${data.stateDayLoadEnergy.toPowerString(config.load.auto_scale, 1)} + ${data.stateDayLoadEnergy.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.day_load_energy_84)}> - ${data.stateDayLoadEnergy.toPowerString(config.load.auto_scale, 1)} + ${data.stateDayLoadEnergy.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.day_battery_charge_70)}> - ${data.stateDayBatteryCharge.toPowerString(config.battery.auto_scale, 1)} + ${data.stateDayBatteryCharge.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.day_battery_discharge_71)}> - ${data.stateDayBatteryDischarge.toPowerString(config.battery.auto_scale, 1)} + ${data.stateDayBatteryDischarge.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.day_grid_import_76)}> - ${data.stateDayGridImport.toPowerString(config.grid.auto_scale, 1)} + ${data.stateDayGridImport.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.day_grid_export_77)}> - ${data.stateDayGridExport.toPowerString(config.grid.auto_scale, 1)} + ${data.stateDayGridExport.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.day_aux_energy)}> - ${data.stateDayAuxEnergy.toPowerString(config.load.auto_scale, 1)} + ${data.stateDayAuxEnergy.toPowerString(true, 1)} Utils.handlePopup(e, config.entities.essential_load1_extra)}> ${data.stateEssentialLoad1Extra.toNum(1)} ${data.stateEssentialLoad1Extra?.getUOM()} @@ -1455,7 +1451,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string Utils.handlePopup(e, config.entities.essential_load1_extra)}> ${data.stateEssentialLoad1Extra.toNum(1)} ${data.stateEssentialLoad1Extra?.getUOM()} @@ -1463,7 +1459,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string Utils.handlePopup(e, config.entities.essential_load2_extra)}> ${data.stateEssentialLoad2Extra.toNum(1)} ${data.stateEssentialLoad2Extra?.getUOM()} @@ -1481,8 +1477,8 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string ? `${Math.abs(parseFloat(Utils.convertValue(data.totalGridPower, data.decimalPlaces)))} ${Utils.convertValue(data.totalGridPower, data.decimalPlaces).split(' ')[1]}` : Utils.convertValue(data.totalGridPower, data.decimalPlaces) || 0}` : `${config.grid.show_absolute - ? `${Math.abs(data.totalGridPower)} W` - : `${data.totalGridPower || 0} W` + ? `${Math.abs(data.totalGridPower)} ${UnitOfPower.WATT}` + : `${data.totalGridPower || 0} ${UnitOfPower.WATT}` }` } @@ -1496,8 +1492,8 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string ? `${Math.abs(parseFloat(Utils.convertValue(data.totalGridPower, data.decimalPlaces)))} ${Utils.convertValue(data.totalGridPower, data.decimalPlaces).split(' ')[1]}` : Utils.convertValue(data.totalGridPower, data.decimalPlaces) || 0}` : `${config.grid.show_absolute - ? `${Math.abs(data.totalGridPower)} W` - : `${data.totalGridPower || 0} W` + ? `${Math.abs(data.totalGridPower)} ${UnitOfPower.WATT}` + : `${data.totalGridPower || 0} ${UnitOfPower.WATT}` }` } ` @@ -1511,8 +1507,8 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string ? `${Math.abs(parseFloat(Utils.convertValue(data.totalGridPower, data.decimalPlaces)))} ${Utils.convertValue(data.totalGridPower, data.decimalPlaces).split(' ')[1]}` : Utils.convertValue(data.totalGridPower, data.decimalPlaces) || 0}` : `${config.grid.show_absolute - ? `${Math.abs(data.totalGridPower)} W` - : `${data.totalGridPower || 0} W` + ? `${Math.abs(data.totalGridPower)} ${UnitOfPower.WATT}` + : `${data.totalGridPower || 0} ${UnitOfPower.WATT}` }` } @@ -1522,25 +1518,25 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string ? svg` Utils.handlePopup(e, config.entities.pv_total)}> ${config.solar.auto_scale ? config.entities?.pv_total ? Utils.convertValueNew(data.totalPV, data.statePVTotal?.getUOM(), data.decimalPlaces) : Utils.convertValue(data.totalPV, data.decimalPlaces) || 0 - : `${Utils.toNum(data.totalPV || 0, 0)} W` + : `${Utils.toNum(data.totalPV || 0, 0)} ${UnitOfPower.WATT}` } ` : svg` ${config.solar.auto_scale ? config.entities?.pv_total ? Utils.convertValueNew(data.totalPV, data.statePVTotal?.getUOM(), data.decimalPlaces) : Utils.convertValue(data.totalPV, data.decimalPlaces) || 0 - : `${Utils.toNum(data.totalPV || 0, 0)} W` + : `${Utils.toNum(data.totalPV || 0, 0)} ${UnitOfPower.WATT}` } ` } @@ -1549,13 +1545,13 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string Utils.handlePopup(e, config.entities.essential_power)}> - ${config.load.auto_scale ? `${Utils.convertValue(data.essentialPower, data.decimalPlaces) || 0}` : `${data.essentialPower || 0} W`} + ${config.load.auto_scale ? `${Utils.convertValue(data.essentialPower, data.decimalPlaces) || 0}` : `${data.essentialPower || 0} ${UnitOfPower.WATT}`} ` : svg` - ${config.load.auto_scale ? `${Utils.convertValue(data.essentialPower, data.decimalPlaces) || 0}` : `${data.essentialPower || 0} W`} + ${config.load.auto_scale ? `${Utils.convertValue(data.essentialPower, data.decimalPlaces) || 0}` : `${data.essentialPower || 0} ${UnitOfPower.WATT}`} ` } ${config.entities?.nonessential_power @@ -1564,7 +1560,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string - ${config.grid.auto_scale ? `${Utils.convertValue(data.nonessentialPower, data.decimalPlaces) || 0}` : `${data.nonessentialPower || 0} W`} + ${config.grid.auto_scale ? `${Utils.convertValue(data.nonessentialPower, data.decimalPlaces) || 0}` : `${data.nonessentialPower || 0} ${UnitOfPower.WATT}`} ` : svg` @@ -1572,7 +1568,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string display="${!config.show_grid || !data.showNonessential ? 'none' : ''}" class="${data.largeFont !== true ? 'st14' : 'st4'} st8" fill="${data.gridColour}"> - ${config.grid.auto_scale ? `${Utils.convertValue(data.nonessentialPower, data.decimalPlaces) || 0}` : `${data.nonessentialPower || 0} W`} + ${config.grid.auto_scale ? `${Utils.convertValue(data.nonessentialPower, data.decimalPlaces) || 0}` : `${data.nonessentialPower || 0} ${UnitOfPower.WATT}`} ` } ${config.entities?.aux_power_166 @@ -1587,7 +1583,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string : Utils.convertValue(data.auxPower, data.decimalPlaces) || '0'}` : `${config.load.show_absolute_aux ? `${Math.abs(data.auxPower)}` - : data.auxPower || 0} W` + : data.auxPower || 0} ${UnitOfPower.WATT}` } ` @@ -1601,135 +1597,115 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string : Utils.convertValue(data.auxPower, data.decimalPlaces) || '0'}` : `${config.load.show_absolute_aux ? `${Math.abs(data.auxPower)}` - : data.auxPower || 0} W` + : data.auxPower || 0} ${UnitOfPower.WATT}` } ` } - ${svg` - Utils.handlePopup(e, config.entities.pv1_power_186)}> - - ${data.statePV1Power.toPowerString(config.solar.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` - Utils.handlePopup(e, config.entities.pv2_power_187)}> - - ${data.statePV2Power.toPowerString(config.solar.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` - Utils.handlePopup(e, config.entities.pv3_power_188)}> - - ${data.statePV3Power.toPowerString(config.solar.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` - Utils.handlePopup(e, config.entities.pv4_power_189)}> - - ${data.statePV4Power.toPowerString(config.solar.auto_scale, data.decimalPlaces)} - - `} - ${svg` - Utils.handlePopup(e, config.entities.aux_load1)}> - - ${data.stateAuxLoad1.toPowerString(config.load.auto_scale, data.decimalPlaces)} - - `} - ${svg` - - ${data.stateAuxLoad2.toPowerString(config.load.auto_scale, data.decimalPlaces)} - ` - } - ${svg` - Utils.handlePopup(e, config.entities.non_essential_load1)}> - - ${data.stateNonessentialLoad1.toPowerString(config.grid.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` - Utils.handlePopup(e, config.entities.non_essential_load1)}> - - ${data.stateNonessentialLoad1.toPowerString(config.grid.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` - Utils.handlePopup(e, config.entities.non_essential_load2)}> - - ${data.stateNonessentialLoad1.toPowerString(config.grid.auto_scale, data.decimalPlaces)} - - `} - ${svg` - Utils.handlePopup(e, config.entities.non_essential_load3)}> - - ${data.stateNonessentialLoad3.toPowerString(config.grid.auto_scale, data.decimalPlaces)} - - `} - ${svg` - Utils.handlePopup(e, config.entities.essential_load1)}> - - ${data.stateEssentialLoad1.toPowerString(config.load.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` - Utils.handlePopup(e, config.entities.essential_load1)}> - - ${data.stateEssentialLoad1.toPowerString(config.load.auto_scale, data.decimalPlaces)} - - ` - } - ${svg` - Utils.handlePopup(e, config.entities.essential_load2)}> - - ${data.stateEssentialLoad2.toPowerString(config.load.auto_scale, data.decimalPlaces) - } - - ` - } + Utils.handlePopup(e, config.entities.pv1_power_186)}> + + ${data.statePV1Power.toPowerString(config.solar.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.pv2_power_187)}> + + ${data.statePV2Power.toPowerString(config.solar.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.pv3_power_188)}> + + ${data.statePV3Power.toPowerString(config.solar.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.pv4_power_189)}> + + ${data.statePV4Power.toPowerString(config.solar.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.aux_load1)}> + + ${data.stateAuxLoad1.toPowerString(config.load.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.aux_load2)}> + + ${data.stateAuxLoad2.toPowerString(config.load.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.non_essential_load1)}> + + ${data.stateNonessentialLoad1.toPowerString(config.grid.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.non_essential_load1)}> + + ${data.stateNonessentialLoad1.toPowerString(config.grid.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.non_essential_load2)}> + + ${data.stateNonessentialLoad1.toPowerString(config.grid.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.non_essential_load3)}> + + ${data.stateNonessentialLoad3.toPowerString(config.grid.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.essential_load1)}> + + ${data.stateEssentialLoad1.toPowerString(config.load.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.essential_load1)}> + + ${data.stateEssentialLoad1.toPowerString(config.load.auto_scale, data.decimalPlaces)} + + + Utils.handlePopup(e, config.entities.essential_load2)}> + + ${data.stateEssentialLoad2.toPowerString(config.load.auto_scale, data.decimalPlaces)} + + ${data.totalGridPower >= 0 ? svg` Utils.handlePopup(e, config.entities.energy_cost_buy)}> + display="${config.entities?.energy_cost_buy && data.stateEnergyCostBuy.isValid() ? '' : 'none'}" > ${data.energyCost} ${data.stateEnergyCostBuy?.getUOM()} ` : svg` Utils.handlePopup(e, config.entities.energy_cost_sell)}> + display="${config.entities?.energy_cost_sell && data.stateEnergyCostSell.isValid() ? '' : 'none'}" > ${data.energyCost} ${data.stateEnergyCostSell?.getUOM()} ` @@ -1739,7 +1715,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string y="${config.inverter.three_phase ? '164' : '170.4'}" display="${!config.show_grid || config.entities.inverter_voltage_154 === 'none' || !config.entities.inverter_voltage_154 ? 'none' : ''}" class="${data.largeFont !== true ? 'st14' : 'st4'} st8" fill="${data.gridColour}"> - ${data.inverterVoltage} V + ${data.inverterVoltage} ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.inverter_voltage_L2)}> @@ -1747,7 +1723,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string display="${config.inverter.three_phase && config.entities?.inverter_voltage_L2 ? '' : 'none'}" class="${!config.show_grid ? 'st12' : `${data.largeFont !== true ? 'st14 st8' : 'st4 st8'}`}" fill="${data.gridColour}"> - ${data.inverterVoltageL2} V + ${data.inverterVoltageL2} ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.inverter_voltage_L3)}> @@ -1755,7 +1731,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string display="${config.inverter.three_phase && config.entities?.inverter_voltage_L3 ? '' : 'none'}" class="${!config.show_grid ? 'st12' : `${data.largeFont !== true ? 'st14 st8' : 'st4 st8'}`}" fill="${data.gridColour}"> - ${data.inverterVoltageL3} V + ${data.inverterVoltageL3} ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.load_frequency_192)}> @@ -1771,33 +1747,33 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string y="${config.inverter.three_phase ? '188' : '199'}" display="${config.entities.inverter_current_164 === 'none' || !config.entities.inverter_current_164 ? 'none' : ''}" class="${data.largeFont !== true ? 'st14' : 'st4'} st8" fill="${data.inverterColour}"> - ${data.inverterCurrent} A + ${data.inverterCurrent} ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.inverter_current_L2)}> - ${data.inverterCurrentL2} A + ${data.inverterCurrentL2} ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.inverter_current_L3)}> - ${data.inverterCurrentL3} A + ${data.inverterCurrentL3} ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.battery_voltage_183)}> - ${data.batteryVoltage} V + ${data.batteryVoltage} ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.battery_soc_184)}> ${data.stateBatterySoc.toNum()} % @@ -1837,21 +1813,21 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string ? `${Math.abs(parseFloat(Utils.convertValue(data.batteryPower, data.decimalPlaces)))} ${Utils.convertValue(data.batteryPower, data.decimalPlaces).split(' ')[1]}` : Utils.convertValue(data.batteryPower, data.decimalPlaces) || '0'}` : `${config.battery.show_absolute - ? `${Math.abs(data.batteryPower)} W` - : `${data.batteryPower || 0} W` + ? `${Math.abs(data.batteryPower)} ${UnitOfPower.WATT}` + : `${data.batteryPower || 0} ${UnitOfPower.WATT}` }` } Utils.handlePopup(e, config.entities.battery_current_191)}> ${config.battery.show_absolute ? Math.abs(Utils.toNum(data.stateBatteryCurrent.state, 1)) : Utils.toNum(data.stateBatteryCurrent.state, 1) } - A + ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.inverter_power_175)}> @@ -1861,7 +1837,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string class="${data.largeFont !== true ? 'st14' : 'st4'} st8" fill="${data.inverterColour}"> ${config.inverter.auto_scale ? `${Utils.convertValue(data.autoScaledInverterPower, data.decimalPlaces) || 0}` - : `${data.autoScaledInverterPower} W`} + : `${data.autoScaledInverterPower} ${UnitOfPower.WATT}`} Utils.handlePopup(e, config.entities.grid_power_169)}> @@ -1874,64 +1850,64 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string ? `${Math.abs(parseFloat(Utils.convertValue(data.autoScaledGridPower, data.decimalPlaces)))} ${Utils.convertValue(data.autoScaledGridPower, data.decimalPlaces).split(' ')[1]}` : Utils.convertValue(data.autoScaledGridPower, data.decimalPlaces) || 0}` : `${config.grid.show_absolute - ? `${Math.abs(data.autoScaledGridPower)} W` - : `${data.autoScaledGridPower || 0} W` + ? `${Math.abs(data.autoScaledGridPower)} ${UnitOfPower.WATT}` + : `${data.autoScaledGridPower || 0} ${UnitOfPower.WATT}` }` } Utils.handlePopup(e, config.entities.pv1_voltage_109)}> ${data.statePV1Voltage.toNum(1)} ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.pv1_current_110)}> ${data.statePV1Current.toNum(1)} ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.pv2_voltage_111)}> ${data.statePV2Voltage.toNum(1)} ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.pv2_current_112)}> ${data.statePV2Current.toNum(1)} ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.pv3_voltage_113)}> ${data.statePV3Voltage.toNum(1)} ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.pv3_current_114)}> ${data.statePV3Current.toNum(1)} ${UnitOfElectricalCurrent.AMPERE} Utils.handlePopup(e, config.entities.pv4_voltage_115)}> ${data.statePV4Voltage.toNum(1)} ${UnitOfElectricPotential.VOLT} Utils.handlePopup(e, config.entities.pv4_current_116)}> ${data.statePV4Current.toNum(1)} ${UnitOfElectricalCurrent.AMPERE} @@ -1939,7 +1915,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string Utils.handlePopup(e, config.entities.battery_temp_182)}> + fill="${data.batteryColour}" display="${!config.show_battery || !data.stateBatteryTemp.isValid() ? 'none' : ''}"> ${data.stateBatteryTemp.toNum(1)}° @@ -1947,27 +1923,27 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string AC: + display="${config.entities?.radiator_temp_91 && data.stateRadiatorTemp.isValid() ? '' : 'none'}">AC: ${data.stateRadiatorTemp.toNum(1)}° Utils.handlePopup(e, config.entities.dc_transformer_temp_90)}> DC: + display="${config.entities?.dc_transformer_temp_90 && data.stateDCTransformerTemp.isValid() ? '' : 'none'}">DC: ${data.stateDCTransformerTemp.toNum(1)}° Utils.handlePopup(e, config.entities.environment_temp)}> + fill="${data.solarColour}" display="${!config.show_solar || !data.stateEnvironmentTemp.isValid() ? 'none' : ''}"> ${data.stateEnvironmentTemp.toNum(1)}° Utils.handlePopup(e, config.entities.prepaid_units)}> + fill="${data.gridColour}" display="${!config.show_grid || !data.statePrepaidUnits.isValid() ? 'none' : ''}"> ${data.statePrepaidUnits.toNum(1)}