From 7c86aa19b9e31b1f18a64954a8f8969cb66427d8 Mon Sep 17 00:00:00 2001 From: molikk Date: Tue, 6 Aug 2024 20:04:48 +0200 Subject: [PATCH] essential load item reorder --- dist/mlk-power-flow-card.js | 6 +- src/cards/compact-card.ts | 10 +- src/cards/compact/essentialLoad.ts | 123 +++- src/cards/compact/load.ts | 1 + src/const.ts | 2 +- src/editor.ts | 2 +- src/index.ts | 78 +- src/types.ts | 1055 ++++++++++++++-------------- 8 files changed, 715 insertions(+), 562 deletions(-) diff --git a/dist/mlk-power-flow-card.js b/dist/mlk-power-flow-card.js index 4f18325..b7623f8 100644 --- a/dist/mlk-power-flow-card.js +++ b/dist/mlk-power-flow-card.js @@ -9,13 +9,13 @@ const e=globalThis,n=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */,{is:s,defineProperty:l,getOwnPropertyDescriptor:c,getOwnPropertyNames:d,getOwnPropertySymbols:u,getPrototypeOf:h}=Object,g=globalThis,f=g.trustedTypes,m=f?f.emptyScript:"",y=g.reactiveElementPolyfillSupport,p=(t,e)=>t,v={toAttribute(t,e){switch(e){case Boolean:t=t?m: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}},A=(t,e)=>!s(t,e),w={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:A};Symbol.metadata??=Symbol("metadata"),g.litPropertyMetadata??=new WeakMap;let b=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=w){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&&l(this.prototype,t,a)}}static getPropertyDescriptor(t,e,n){const{get:a,set:o}=c(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)??w}static _$Ei(){if(this.hasOwnProperty(p("elementProperties")))return;const t=h(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(p("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(p("properties"))){const t=this.properties,e=[...d(t),...u(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(i(t))}else void 0!==t&&e.push(i(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((t,a)=>{if(n)t.adoptedStyleSheets=a.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const n of a){const a=document.createElement("style"),o=e.litNonce;void 0!==o&&a.setAttribute("nonce",o),a.textContent=n.cssText,t.appendChild(a)}})(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:v).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:v;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??A)(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){}};b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[p("elementProperties")]=new Map,b[p("finalized")]=new Map,y?.({ReactiveElement:b}),(g.reactiveElementVersions??=[]).push("2.0.4"); + */,{is:s,defineProperty:l,getOwnPropertyDescriptor:c,getOwnPropertyNames:d,getOwnPropertySymbols:u,getPrototypeOf:g}=Object,h=globalThis,f=h.trustedTypes,m=f?f.emptyScript:"",y=h.reactiveElementPolyfillSupport,p=(t,e)=>t,v={toAttribute(t,e){switch(e){case Boolean:t=t?m: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}},A=(t,e)=>!s(t,e),w={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:A};Symbol.metadata??=Symbol("metadata"),h.litPropertyMetadata??=new WeakMap;let b=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=w){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&&l(this.prototype,t,a)}}static getPropertyDescriptor(t,e,n){const{get:a,set:o}=c(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)??w}static _$Ei(){if(this.hasOwnProperty(p("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(p("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(p("properties"))){const t=this.properties,e=[...d(t),...u(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(i(t))}else void 0!==t&&e.push(i(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((t,a)=>{if(n)t.adoptedStyleSheets=a.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const n of a){const a=document.createElement("style"),o=e.litNonce;void 0!==o&&a.setAttribute("nonce",o),a.textContent=n.cssText,t.appendChild(a)}})(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:v).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:v;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??A)(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){}};b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[p("elementProperties")]=new Map,b[p("finalized")]=new Map,y?.({ReactiveElement:b}),(h.reactiveElementVersions??=[]).push("2.0.4"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const x=globalThis,E=x.trustedTypes,L=E?E.createPolicy("lit-html",{createHTML:t=>t}):void 0,P="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,C="?"+M,N=`<${C}>`,z=document,T=()=>z.createComment(""),k=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,j="[ \t\n\f\r]",D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,R=/>/g,G=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,S=/"/g,I=/^(?:script|style|textarea|title)$/i,H=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),V=H(1),Q=H(2),U=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),Z=new WeakMap,Y=z.createTreeWalker(z,129);function X(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==L?L.createHTML(e):e}const F=(t,e)=>{const n=t.length-1,a=[];let o,r=2===e?"":"",i=D;for(let e=0;e"===l[0]?(i=o??D,c=-1):void 0===l[1]?c=-2:(c=i.lastIndex-l[2].length,s=l[1],i=void 0===l[3]?G:'"'===l[3]?S:B):i===S||i===B?i=G:i===_||i===R?i=D:(i=G,o=void 0);const u=i===G&&t[e+1].startsWith("/>")?" ":"";r+=i===D?n+N:c>=0?(a.push(s),n.slice(0,c)+P+n.slice(c)+M+u):n+M+(-2===c?e:u)}return[X(t,r+(t[n]||"")+(2===e?"":"")),a]};class J{constructor({strings:t,_$litType$:e},n){let a;this.parts=[];let o=0,r=0;const i=t.length-1,s=this.parts,[l,c]=F(t,e);if(this.el=J.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!==W&&k(this._$AH)?this._$AA.nextSibling.data=t:this.T(z.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=J.createElement(X(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===a)this._$AH.p(e);else{const t=new q(a,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=Z.get(t.strings);return void 0===e&&Z.set(t.strings,e=new J(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 $(this.S(T()),this.S(T()),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=W}_$AI(t,e=this,n,a){const o=this.strings;let r=!1;if(void 0===o)t=K(this,t,e,0),r=!k(t)||t!==this._$AH&&t!==U,r&&(this._$AH=t);else{const a=t;let i,s;for(t=o[0],i=0;it}):void 0,P="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,C="?"+M,N=`<${C}>`,z=document,T=()=>z.createComment(""),k=t=>null===t||"object"!=typeof t&&"function"!=typeof t,_=Array.isArray,O="[ \t\n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,R=/>/g,G=RegExp(`>|${O}(?:([^\\s"'>=/]+)(${O}*=${O}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,S=/"/g,I=/^(?:script|style|textarea|title)$/i,H=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),V=H(1),Q=H(2),U=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),Z=new WeakMap,Y=z.createTreeWalker(z,129);function X(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==L?L.createHTML(e):e}const F=(t,e)=>{const n=t.length-1,a=[];let o,r=2===e?"":"",i=j;for(let e=0;e"===l[0]?(i=o??j,c=-1):void 0===l[1]?c=-2:(c=i.lastIndex-l[2].length,s=l[1],i=void 0===l[3]?G:'"'===l[3]?S:B):i===S||i===B?i=G:i===D||i===R?i=j:(i=G,o=void 0);const u=i===G&&t[e+1].startsWith("/>")?" ":"";r+=i===j?n+N:c>=0?(a.push(s),n.slice(0,c)+P+n.slice(c)+M+u):n+M+(-2===c?e:u)}return[X(t,r+(t[n]||"")+(2===e?"":"")),a]};class J{constructor({strings:t,_$litType$:e},n){let a;this.parts=[];let o=0,r=0;const i=t.length-1,s=this.parts,[l,c]=F(t,e);if(this.el=J.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;n_(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!==W&&k(this._$AH)?this._$AA.nextSibling.data=t:this.T(z.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=J.createElement(X(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===a)this._$AH.p(e);else{const t=new q(a,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=Z.get(t.strings);return void 0===e&&Z.set(t.strings,e=new J(t)),e}k(t){_(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 $(this.S(T()),this.S(T()),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=W}_$AI(t,e=this,n,a){const o=this.strings;let r=!1;if(void 0===o)t=K(this,t,e,0),r=!k(t)||t!==this._$AH&&t!==U,r&&(this._$AH=t);else{const a=t;let i,s;for(t=o[0],i=0;i(e,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(t,e) * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -function ht(t,e){return(e,n,a)=>((t,e,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,n),n))(e,n,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}function gt(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var ft;const mt=((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 r(n,t,a)})(ft||(ft=gt(["\n text_debug {\n outline: 1px solid blue;\n }\n \n \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: 0;\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 .st15{font-size:8px;}\n .st16{font-size:7px;}\n\n "])));var yt,pt;!function(t){t.Azzurro="azzurro",t.CESBatteryBox="ces-battery-box",t.Deye="deye",t.E3dc="e3dc",t.FoxESS="foxess",t.Fronius="fronius",t.Goodwe="goodwe",t.GoodweGridMode="goodwe_gridmode",t.Growatt="growatt",t.Huawei="huawei",t.Lux="lux",t.MPPSolar="mppsolar",t.PowMr="powmr",t.SMASolar="smasolar",t.Solax="solax",t.SolarEdge="solaredge",t.Sofar="sofar",t.Solis="solis",t.Sunsynk="sunsynk",t.Victron="victron",t.EasunSMW8_SA="Easun SMW8kW SA"}(yt||(yt={})),function(t){t.Energy="energy",t.Power="power",t.AutoSelf="auto&self",t.No="no"}(pt||(pt={}));var vt={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_name:"DAILY SOLAR",monthly_solar_name:"MONTHLY SOLAR",yearly_solar_name:"YEARLY SOLAR",total_solar_generation_name:"TOTAL SOLAR",remaining_solar_name:"LEFT SOLAR",tomorrow_solar_name:"TOMORROW",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",pv5_name:"PV5",essential:"Essential",autarky:"Autarky",autarkySelf:"Self use",autarkyAuto:"Auto cons",discharging:"Discharging",charging:"Charging",waiting:"Waiting",standby:"Standby",no_battery:"No Battery",selftest:"Selftest",normal:"Normal",alarm:"Alarm",fault:"Fault",days:"d",hrs:"h",min:"m",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",limit:"Limit",on:"On",off:"Off",lowpower:"Low Power",bulk:"Bulk",absorption:"Absorption",float:"Float",storage:"Storage",equalize:"Equalize",passthru:"Passthru",inverting:"Inverting",powerassist:"Power Assist",powersupply:"Power Supply",sustain:"Sustain",externalcontrol:"External Control"},At={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"},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",decimal_places_energy:"Decimal Places (Daily Energy)",viewbox_min_x:"min-x",viewbox_min_y:"min-y",viewbox_width:"width",viewbox_height:"height",model:"Model",autarky:"Autarky",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_max_power:"PV1 Max Power",pv2_max_power:"PV2 Max Power",pv3_max_power:"PV3 Max Power",pv4_max_power:"PV4 Max Power",pv5_max_power:"PV5 Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",pv5_name:"PV5 Name",daily_solar_name:"Daily solar production Name",monthly_solar_name:"Monthly solar production name",yearly_solar_name:"Yearly solar production name",total_solar_generation_name:"Total solar generation name",remaining_solar_name:"Today's left solar production name",tomorrow_solar_name:"Tomorrow solar production name",display_mode:"Display Mode",visualize_efficiency:"Show PVs Efficiency",show_mppt_production:"Show PVs production",show_mppt_efficiency:"Show PVs efficiency %",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load5_name:"Load 5 Name",load6_name:"Load 6 Name",load7_name:"Load 7 Name",load8_name:"Load 8 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",load5_icon:"Load 5 Icon",load6_icon:"Load 6 Icon",load7_icon:"Load 7 Icon",load8_icon:"Load 8 Icon",aux_load1_name:"Aux Load 1 Name",aux_load2_name:"Aux Load 2 Name",aux_load1_icon:"Aux Load 1 Icon",aux_load2_icon:"Aux Load 2 Icon",aux_dynamic_colour:"Aux Dynamic Colour",off_threshold:"Off Threshold",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",animate:"Animate 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",shutdown_soc_offgrid:"Shutdown SOC (Off Grid)",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_daily_name:"Daily 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",path_threshold:"Path Threshold",label_daily_grid_buy:"Daily Grid Buy Label",label_daily_grid_sell:"Daily Grid Sell Label",cat_title:{title:"Title Options",general:"General Options",adv_viewbox:"Adv. ViewBox Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",additional_load:"Additional Load Options",aux_load:"Aux Load Options",entities:"Entities",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",inv_prog:"Programs Entities",ld:"Load Entities",ess_ld:"Essential Load Entities",gri:"Grid Entities",sensor:"Optional Sensors",max_power:"PV Max Power",mppt_options:"MPPTs options",solar_production:"Solar Production"}},bt={common:vt,errors:At,config:wt};const xt={hass:null},Et={en:Object.freeze({__proto__:null,common:vt,config:wt,default:bt,errors:At})};function Lt(t,e="",n=""){const a=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_"),o="".concat(xt.hass?.selectedLanguage||xt.hass?.locale?.language||xt.hass?.language||a);let r;try{r=t.split(".").reduce(((t,e)=>t[e]),Et[o])}catch(e){r=t.split(".").reduce(((t,e)=>t[e]),Et.en)}return void 0===r&&(r=t.split(".").reduce(((t,e)=>t[e]),Et.en)),""!==e&&""!==n&&(r=r.replace(e,n)),r}var Pt={panel_mode:!1,large_font:!1,show_solar:!0,show_battery:!0,show_grid:!0,card_height:"396px",card_width:"100%",decimal_places:2,decimal_places_energy:1,dynamic_line_width:!0,max_line_width:4,min_line_width:1,inverter:{modern:!0,colour:"grey",autarky:"power",model:yt.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,animate:!0,path_threshold:100},solar:{colour:"orange",mppts:2,animation_speed:9,max_power:8e3,pv1_name:Lt("common.pv1_name"),pv2_name:Lt("common.pv2_name"),pv3_name:Lt("common.pv3_name"),pv4_name:Lt("common.pv4_name"),pv5_name:Lt("common.pv5_name"),auto_scale:!0,display_mode:1,dynamic_colour:!0,visualize_efficiency:!0,off_threshold:10,show_mppt_production:!0,show_mppt_efficiency:!1},load:{colour:"#5fb6ad",dynamic_colour:!0,dynamic_icon:!0,aux_dynamic_colour:!0,off_threshold: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_colour:"#5fb6ad",aux_name:Lt("common.aux_name"),aux_daily_name:Lt("common.daily_aux"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",essential_name:Lt("common.essential"),load1_icon:"default",load2_icon:"default",load1_name:Lt("common.load1_name"),load2_name:Lt("common.load2_name"),auto_scale:!0,path_threshold:100},grid:{colour:"#5490c2",grid_name:Lt("common.grid_name"),label_daily_grid_buy:Lt("common.daily_grid_buy"),label_daily_grid_sell:Lt("common.daily_grid_sell"),show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:Lt("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,off_threshold:0}};const Mt=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],Ct=[0,1,2,3],Nt=[!0,!1],zt=[!0,!1],Tt=[0,1,2],kt=["off","0","off-grid","off grid","offgrid"],Ot=["on","1","on-grid","on grid","ongrid"],jt="mlk-content-card-editor";var Dt,_t,Rt,Gt,Bt,St;!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"}(Dt||(Dt={})),function(t){t.WATT="W",t.KILO_WATT="kW",t.MEGA_WATT="MW",t.BTU_PER_HOUR="BTU/h"}(_t||(_t={})),function(t){t.GIGA_JOULE="GJ",t.KILO_WATT_HOUR="kWh",t.MEGA_JOULE="MJ",t.MEGA_WATT_HOUR="MWh",t.WATT_HOUR="Wh"}(Rt||(Rt={})),function(t){t.MILLIAMPERE="mA",t.AMPERE="A"}(Gt||(Gt={})),function(t){t.MILLIVOLT="mV",t.VOLT="V"}(Bt||(Bt={})),function(t){t.HERTZ="Hz"}(St||(St={}));const It={[Rt.WATT_HOUR]:[{threshold:1e6,divisor:1e6,targetUnit:Rt.MEGA_WATT_HOUR},{threshold:1e3,divisor:1e3,targetUnit:Rt.KILO_WATT_HOUR,decimal:1}],[Rt.KILO_WATT_HOUR]:[{threshold:1e3,divisor:1e3,targetUnit:Rt.MEGA_WATT_HOUR,decimal:2}],[Rt.MEGA_WATT_HOUR]:[],[Rt.GIGA_JOULE]:[{threshold:1e3,divisor:1e3,targetUnit:Rt.MEGA_JOULE}],[Rt.MEGA_JOULE]:[],[_t.WATT]:[{threshold:1e6,divisor:1e6,targetUnit:_t.MEGA_WATT},{threshold:1e3,divisor:1e3,targetUnit:_t.KILO_WATT}],[_t.KILO_WATT]:[{threshold:1e3,divisor:1e3,targetUnit:_t.MEGA_WATT}],[_t.MEGA_WATT]:[],[_t.BTU_PER_HOUR]:[]};var Ht="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Vt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Qt={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]",c="[object Object]",d="[object Proxy]",u="[object Undefined]",h=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,f={};f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f[o]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object Boolean]"]=f["[object DataView]"]=f["[object Date]"]=f["[object Error]"]=f[i]=f["[object Map]"]=f["[object Number]"]=f[c]=f["[object RegExp]"]=f["[object Set]"]=f["[object String]"]=f["[object WeakMap]"]=!1;var m="object"==typeof Ht&&Ht&&Ht.Object===Object&&Ht,y="object"==typeof self&&self&&self.Object===Object&&self,p=m||y||Function("return this")(),v=e&&!e.nodeType&&e,A=v&&t&&!t.nodeType&&t,w=A&&A.exports===v,b=w&&m.process,x=function(){try{var t=A&&A.require&&A.require("util").types;return t||b&&b.binding&&b.binding("util")}catch(t){}}(),E=x&&x.isTypedArray;var L,P=Array.prototype,M=Function.prototype,C=Object.prototype,N=p["__core-js_shared__"],z=M.toString,T=C.hasOwnProperty,k=(L=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"",O=C.toString,j=z.call(Object),D=RegExp("^"+z.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_=w?p.Buffer:void 0,R=p.Symbol,G=p.Uint8Array;_&&_.allocUnsafe;var B,S,I=(B=Object.getPrototypeOf,S=Object,function(t){return B(S(t))}),H=Object.create,V=C.propertyIsEnumerable,Q=P.splice,U=R?R.toStringTag:void 0,W=function(){try{var t=yt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Z=_?_.isBuffer:void 0,Y=Math.max,X=Date.now,F=yt(p,"Map"),J=yt(Object,"create"),K=function(){function t(){}return function(e){if(!Nt(e))return{};if(H)return H(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function q(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1},$.prototype.set=function(t,e){var n=this.__data__,a=rt(n,t);return a<0?(++this.size,n.push([t,e])):n[a][1]=e,this},tt.prototype.clear=function(){this.size=0,this.__data__={hash:new q,map:new(F||$),string:new q}},tt.prototype.delete=function(t){var e=mt(this,t).delete(t);return this.size-=e?1:0,e},tt.prototype.get=function(t){return mt(this,t).get(t)},tt.prototype.has=function(t){return mt(this,t).has(t)},tt.prototype.set=function(t,e){var n=mt(this,t),a=n.size;return n.set(t,e),this.size+=n.size==a?0:1,this},et.prototype.clear=function(){this.__data__=new $,this.size=0},et.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},et.prototype.get=function(t){return this.__data__.get(t)},et.prototype.has=function(t){return this.__data__.has(t)},et.prototype.set=function(t,e){var n=this.__data__;if(n instanceof $){var a=n.__data__;if(!F||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new tt(a)}return n.set(t,e),this.size=n.size,this};var st=function(t,e,n){for(var a=-1,o=Object(t),r=n(t),i=r.length;i--;){var s=r[++a];if(!1===e(o[s],s,o))break}return t};function lt(t){return null==t?void 0===t?u:l:U&&U in Object(t)?function(t){var e=T.call(t,U),n=t[U];try{t[U]=void 0;var a=!0}catch(t){}var o=O.call(t);a&&(e?t[U]=n:delete t[U]);return o}(t):function(t){return O.call(t)}(t)}function ct(t){return zt(t)&<(t)==o}function dt(t){return!(!Nt(t)||function(t){return!!k&&k in t}(t))&&(Mt(t)?D:h).test(function(t){if(null!=t){try{return z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function ut(t){if(!Nt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=vt(t),n=[];for(var a in t)("constructor"!=a||!e&&T.call(t,a))&&n.push(a);return n}function ht(t,e,n,a,o){t!==e&&st(e,(function(r,i){if(o||(o=new et),Nt(r))!function(t,e,n,a,o,r,i){var s=At(t,n),l=At(e,n),d=i.get(l);if(d)return void at(t,n,d);var u=r?r(s,l,n+"",t,e,i):void 0,h=void 0===u;if(h){var g=Et(l),f=!g&&Pt(l),m=!g&&!f&&Tt(l);u=l,g||f||m?Et(s)?u=s:zt(y=s)&&Lt(y)?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)}}(ft);function bt(t,e){return t===e||t!=t&&e!=e}var xt=ct(function(){return arguments}())?ct:function(t){return zt(t)&&T.call(t,"callee")&&!V.call(t,"callee")},Et=Array.isArray;function Lt(t){return null!=t&&Ct(t.length)&&!Mt(t)}var Pt=Z||function(){return!1};function Mt(t){if(!Nt(t))return!1;var e=lt(t);return e==i||e==s||e==r||e==d}function Ct(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Nt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function zt(t){return null!=t&&"object"==typeof t}var Tt=E?function(t){return function(e){return t(e)}}(E):function(t){return zt(t)&&Ct(t.length)&&!!f[lt(t)]};function kt(t){return Lt(t)?nt(t):ut(t)}var Ot,jt=(Ot=function(t,e,n){ht(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=Ot.length>3&&"function"==typeof o?(a--,o):void 0,r&&function(t,e,n){if(!Nt(n))return!1;var a=typeof e;return!!("number"==a?Lt(n)&&pt(e,n.length):"string"==a&&e in n)&&bt(n[e],t)}(e[0],e[1],r)&&(o=a<3?void 0:o,a=1),t=Object(t);++n=0&&(o=parseFloat(o.toFixed(e))),n&&(o*=-1),a&&(o=Math.abs(o)),o)}static convertValue(t,e=2){return e=Number.isNaN(e)?2:e,Math.abs(t)>=1e6?"".concat((t/1e6).toFixed(e)," MW"):Math.abs(t)>=1e3?"".concat((t/1e3).toFixed(e)," kW"):"".concat(Math.round(t)," W")}static convertValueNew(t,e="",n=2){n=isNaN(n)?2:n;const a=Number(t);if(isNaN(a))return Number(0).toFixed(n);const o=It[e];if(!o)return"".concat(this.toNum(a,n)," ").concat(e);if(e===_t.WATT&&Math.abs(a)<1e3)return"".concat(Math.round(a)," ").concat(e);if(e===_t.KILO_WATT&&Math.abs(a)<1)return"".concat(Math.round(1e3*a)," W");if(e===_t.MEGA_WATT&&Math.abs(a)<1)return"".concat((1e3*a).toFixed(n)," kW");for(const t of o)if(Math.abs(a)>=t.threshold){const e=(a/t.divisor).toFixed(t.decimal||n);return"".concat(e," ").concat(t.targetUnit)}return"".concat(a.toFixed(n)," ").concat(e)}static handlePopup(t,e){e&&(t.preventDefault(),this._handleClick(t,{action:"more-info"},e))}static _handleClick(t,e,n){if(t&&n)if(t.stopPropagation(),"more-info"===e.action)this._dispatchMoreInfoEvent(t,n);else console.warn("Action '".concat(e.action,"' is not supported."))}static _dispatchMoreInfoEvent(t,e){if(Mn.isPopupOpen)return;Mn.isPopupOpen=!0;const n=new CustomEvent("hass-more-info",{composed:!0,detail:{entityId:e}});history.pushState({popupOpen:!0},"",window.location.href),t.target.dispatchEvent(n);const a=()=>{Mn.isPopupOpen&&(Mn.isPopupOpen=!1,window.removeEventListener("popstate",a),history.back())};window.addEventListener("popstate",a,{once:!0})}}Mn.isPopupOpen=!1;class Cn{static generateDailyLoad(t,e){return Q(Ut||(Ut=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),(t=>Mn.handlePopup(t,e.entities.day_load_energy_84)),this.LOAD_X-5,t.loadShowDaily&&t.stateDayLoadEnergy.isValid()?"":"none",t.loadColour,t.stateDayLoadEnergy?.toPowerString(!0,t.decimalPlacesEnergy),this.LOAD_X-5,t.loadShowDaily?"".concat(t.loadColour):"transparent",Lt("common.daily_load"))}static generateFlowLines(t,e){const n=this.LOAD_X+3-264.7-70,a=264.7+n/2,o=a+70,r=o+n/2,i="M ".concat(264.7," 218.5 L ").concat(a," 218.5"),s="M ".concat(o," 218.5 L ").concat(r," 218.5");return Q(Wt||(Wt=gt(['\n\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t'])),i,e.load.dynamic_colour?t.flowColour:t.loadColour,t.loadLineWidth,Math.min(2+t.loadLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.essentialPower?"transparent":"".concat(e.load.dynamic_colour?t.flowColour:t.loadColour),t.durationCur.load,s,e.load.dynamic_colour?t.flowColour:t.loadColour,t.loadLineWidth,Math.min(2+t.loadLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.essentialPower?"transparent":"".concat(e.load.dynamic_colour?t.flowColour:t.loadColour),t.durationCur.load)}static generatePowers(t,e){const n=400+(this.LOAD_X-400)/2-30;return Q(Zt||(Zt=gt(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),n,e.inverter.three_phase&&e.entities?.load_power_L1?"":"none",t.loadColour,e.load.auto_scale?"".concat(Mn.convertValue(t.loadPowerL1,t.decimalPlaces)||0):"".concat(t.loadPowerL1||0," ").concat(_t.WATT),n,e.inverter.three_phase&&e.entities?.load_power_L2?"":"none",t.loadColour,e.load.auto_scale?"".concat(Mn.convertValue(t.loadPowerL2,t.decimalPlaces)||0):"".concat(t.loadPowerL2||0," ").concat(_t.WATT),n,e.inverter.three_phase&&e.entities?.load_power_L3?"":"none",t.loadColour,e.load.auto_scale?"".concat(Mn.convertValue(t.loadPowerL3,t.decimalPlaces)||0):"".concat(t.loadPowerL3||0," ").concat(_t.WATT))}static generateShapeAndName(t,e){const n=400+(this.LOAD_X-400)/2-101.3;return Q(Yt||(Yt=gt(['\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),n,t.loadColour,n+3,t.loadColour,e.load.essential_name)}static generateTotalLoad(t,e){const n=400+(this.LOAD_X-400)/2-65.3;return Q(Xt||(Xt=gt(["\n\t\t\t","\n\t\t"])),e.entities?.essential_power&&"none"!==e.entities.essential_power?Q(Ft||(Ft=gt(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\t\n\t\t\t\t"])),(t=>Mn.handlePopup(t,e.entities.essential_power)),n,!0!==t.largeFont?"st14":"st4",t.loadColour,e.load.auto_scale?"".concat(Mn.convertValue(t.essentialPower,t.decimalPlaces)||0):"".concat(t.essentialPower||0," ").concat(_t.WATT)):Q(Jt||(Jt=gt(['\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t"])),n,!0!==t.largeFont?"st14":"st4",t.loadColour,e.load.auto_scale?"".concat(Mn.convertValue(t.essentialPower,t.decimalPlaces)||0):"".concat(t.essentialPower||0," ").concat(_t.WATT)))}static generateIcon(t,e){return Q(Kt||(Kt=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t'])),1===t.essIconSize?this.LOAD_X+5:this.LOAD_X+2,1===t.essIconSize?"186":"177.5",1===t.essIconSize?"75":"79",1===t.essIconSize?"75":"79",t.gridPercentage>0?t.gridColour:t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage,t.gridPercentage>0?t.gridColour:t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage,t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage+t.batteryPercentage,t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage+t.batteryPercentage,t.solarColour,t.solarColour,e.load.dynamic_colour?"url(#Lg)":t.loadColour,t.essIcon)}}Cn.LOAD_X=418,Cn.GAP=8,Cn.rowAux=3,Cn.row1=35,Cn.row2=110,Cn.row3=185,Cn.row4=260,Cn.row5=335,Cn.column1=Cn.LOAD_X-43-Cn.GAP/2,Cn.column2=Cn.LOAD_X,Cn.column3=Cn.column2+43+Cn.GAP/2,Cn.column4=Cn.column3+43+Cn.GAP/2,Cn.yGaps=[26,55,37,67],Cn.xGaps=[53,43,63.5];class Nn{static getIconWithCondition(t,e,n,a,o,r=30){return Q(qt||(qt=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
'])),t?"":"none",e,n,r,r,a,o)}static getIcon(t,e,n,a,o=30){return Q($t||($t=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
'])),t,e,o,o,n,a)}static getIconLink(t,e){return Q(te||(te=gt(["\n\t\t","\n\t\t"])),t?Q(ee||(ee=gt(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t\t",'\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t\n\t\t\t"])),n,t,e,o,r,a,c.isValid()||m.isValidSwitch()?"":"none",t,e,s,l,a,i?"".concat(i):"",!c.isValid()&&m.isValidSwitch()?Q(oe||(oe=gt(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t"])),(t=>Mn.handlePopup(t,m.entity_id)),t,e,d,u,a,Lt("common."+(m?.toOnOff()||"off"))):Q(re||(re=gt(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\t\n\t\t\t\t"])),(t=>Mn.handlePopup(t,c.entity_id)),t,e,d,u,c.isValid()?"":"none",a,c?.toPowerString(y,p)),(t=>Mn.handlePopup(t,h.entity_id)),t,e,g,f,h.isValid()?"":"none",a,h.toNum(1),h.getUOM())}static generateEssentialLoad(t,e,n,a,o,r,i,s,l,c,d,u=Cn.xGaps,h=Cn.yGaps){const g=Nn.getIconLink(i.entity_id,Nn.getIcon(c+u[0],d,e,"essload".concat(t,"_small-icon")));return Q(ie||(ie=gt(["\n\t\t\t\t",""])),Nn.generateLoadItem("es",t,g,n,c+u[1],d+h[0],a,c+u[2],d+h[1],o,c+u[2],d+h[2],r,c+u[2],d+h[3],i,s,l))}static generateGridLoad(t,e,n,a,o,r,i,s,l,c,d,u=Cn.xGaps,h=Cn.yGaps){const g=Nn.getIconLink(i.entity_id,Nn.getIcon(c+u[0],d,e,"nes-load".concat(t,"_small-icon")));return Q(se||(se=gt(["\n\t\t\t\t",""])),Nn.generateLoadItem("nes",t,g,n,c+u[1],d+h[0],a,c+u[2],d+h[1],o,c+u[2],d+h[2],r,c+u[2],d+h[3],i,s,l))}static generateAuxLoad(t,e,n,a,o,r,i,s,l,c,d,u=Cn.xGaps,h=Cn.yGaps){const g=Nn.getIconLink(i.entity_id,Nn.getIcon(c+u[0],d,e,"aux-load".concat(t,"_small-icon")));return Q(le||(le=gt(["\n\t\t\t\t",""])),Nn.generateLoadItem("aux",t,g,n,c+u[1],d+h[0],a,c+u[2],d+h[1],o,c+u[2],d+h[2],r,c+u[2],d+h[3],i,s,l))}static generateFrequency(t,e,n,a,o,r){return t?.isValid()?Q(ce||(ce=gt(['\n \n '," ","\n \n "])),(e=>Mn.handlePopup(e,t?.entity_id)),n,a,o,t?.isValid()?"":"none",r,e,t.toStr(1,!1),St.HERTZ):""}static generatePhaseAmperage(t,e,n,a,o){return Q(de||(de=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t'," ","\n\t\t\t\t\n\t\t\t"])),(t=>Mn.handlePopup(t,e.entity_id)),t,n,a,e.isValid()?"":"none",o,e.toStr(1)||0,Gt.AMPERE)}static generatePhaseVoltage(t,e,n,a,o){return Q(ue||(ue=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t'," ","\n\t\t\t\t\n\t\t\t"])),(t=>Mn.handlePopup(t,e.entity_id)),t,n,a,e.isValid()?"":"none",o,e.toStr(1)||0,Bt.VOLT)}static generatePhasePower(t,e,n,a,o,r,i){return Q(he||(he=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t"])),(t=>Mn.handlePopup(t,e.entity_id)),t,n,a,e.isValid()?"":"none",r,o?"".concat(Mn.convertValue(e,i)||0):"".concat(e||0," ").concat(_t.WATT))}}class zn{static generateLines(t,e){const n=e.load.show_aux||!1,a=Cn.column2+Cn.xGaps[1]-(Cn.column2-Cn.column1-41)/2,o="M ".concat(a," 190 L ").concat(a," ").concat(n?"171.5":"156"),r="M ".concat(a," 190 L ").concat(a," 156"),i="M ".concat(a," 286 L ").concat(a," 247"),s="M ".concat(a," 362 L ").concat(a," 306"),l="M ".concat(a," 136 L ").concat(a," 81");return t.additionalLoad>8?Q(ge||(ge=gt([""]))):Q(fe||(fe=gt(['\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t'])),o,t.additionalLoad<4?"":"st12",t.loadColour,r,t.additionalLoad>=4?"":"st12",t.loadColour,i,t.additionalLoad>=2?"":"st12",t.loadColour,s,t.additionalLoad>=5?"":"st12",t.loadColour,l,t.additionalLoad>=7&&!e.load.show_aux?"":"st12",t.loadColour)}static generateLoad1(t,e){const n=e.load.show_aux||!1,a=this.mainX+5,o=this.mainX,r=this.mainX+42,i=this.mainX+45,s=Nn.getIconWithCondition(t.additionalLoad<=3,a,n?113:95,t.iconEssentialLoad1,"essload1-icon",36),l=Nn.getIconLink(e.entities.essential_load1_toggle,s);return Q(me||(me=gt(["",""])),t.additionalLoad>=4?Q(ye||(ye=gt(["\n\t\t\t",""])),Nn.generateEssentialLoad(1,t.iconEssentialLoad1,t.dynamicColourEssentialLoad1,e.load?.load1_name,t.stateEssentialLoad1,t.stateEssentialLoad1Extra,t.stateEssentialLoad1Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column1,Cn.row2)):Q(pe||(pe=gt(["","\n\t\t\t"])),t.additionalLoad>=1?Q(ve||(ve=gt(["\n\t\t\t\t\t",'\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t','\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\n\t\t\t\t\t"])),l,o,n?"141":"126",t.dynamicColourEssentialLoad1,t.additionalLoad<=3?"":"none",n?i:r,n?"133":"118",t.additionalLoad<=3?"":"none",t.dynamicColourEssentialLoad1,e.load?.load1_name?"".concat(e.load.load1_name):"",(t=>Mn.handlePopup(t,e.entities.essential_load1)),r,n?"158":"143",t.additionalLoad<=3&&t.stateEssentialLoad1.isValid()?"":"none",!0!==t.largeFont?"st14":"st4",t.dynamicColourEssentialLoad1,t.stateEssentialLoad1?.toPowerString(e.load.auto_scale,t.decimalPlaces),(t=>Mn.handlePopup(t,e.entities.essential_load1_extra)),i,n?"182":"167",e.entities?.essential_load1_extra&&t.additionalLoad<=3&&t.stateEssentialLoad1Extra.isValid()?"":"none",t.dynamicColourEssentialLoad1,t.stateEssentialLoad1Extra.toNum(1),t.stateEssentialLoad1Extra.getUOM()):""))}static generateLoad2(t,e){const n=this.mainX+5,a=this.mainX,o=this.mainX+42,r=this.mainX+45,i=Nn.getIcon(n,250,t.iconEssentialLoad2,"essload2-icon",36),s=Nn.getIconLink(e.entities.essential_load2_toggle,i);return Q(Ae||(Ae=gt(["",""])),t.additionalLoad>=4?Q(we||(we=gt(["\n\t\t\t",""])),Nn.generateEssentialLoad(2,t.iconEssentialLoad2,t.dynamicColourEssentialLoad2,e.load?.load2_name,t.stateEssentialLoad2,t.stateEssentialLoad2Extra,t.stateEssentialLoad2Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column2,Cn.row2)):Q(be||(be=gt(["",""])),3===t.additionalLoad?Q(xe||(xe=gt(["\n\t\t\t\t\t",""])),Nn.generateEssentialLoad(2,t.iconEssentialLoad2,t.dynamicColourEssentialLoad2,e.load?.load2_name,t.stateEssentialLoad2,t.stateEssentialLoad2Extra,t.stateEssentialLoad2Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column1,Cn.row4)):Q(Ee||(Ee=gt(["",""])),2===t.additionalLoad?Q(Le||(Le=gt(["\n\t\t\t\t\t\t",'\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t"])),s,a,t.dynamicColourEssentialLoad2,o,t.dynamicColourEssentialLoad2,e.load?.load2_name?"".concat(e.load.load2_name):"",(t=>Mn.handlePopup(t,e.entities.essential_load2)),o,t.stateEssentialLoad2.isValid()?"":"none",!0!==t.largeFont?"st14":"st4",t.dynamicColourEssentialLoad2,t.stateEssentialLoad2?.toPowerString(e.load.auto_scale,t.decimalPlaces),(t=>Mn.handlePopup(t,e.entities.essential_load2_extra)),r,t.stateEssentialLoad2Extra.isValid()?"":"none",t.dynamicColourEssentialLoad2,t.stateEssentialLoad2Extra.toNum(1),t.stateEssentialLoad2Extra.getUOM()):Q(Pe||(Pe=gt([""]))))))}static generateLoad3(t,e){return Q(Me||(Me=gt(["",""])),3===t.additionalLoad?Q(Ce||(Ce=gt(["\n\t\t\t\t",""])),Nn.generateEssentialLoad(3,t.iconEssentialLoad3,t.dynamicColourEssentialLoad3,e.load?.load3_name,t.stateEssentialLoad3,t.stateEssentialLoad3Extra,t.stateEssentialLoad3Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column2,Cn.row4)):Q(Ne||(Ne=gt(["",""])),t.additionalLoad>=4?Q(ze||(ze=gt(["\n\t\t\t\t\t",""])),Nn.generateEssentialLoad(3,t.iconEssentialLoad3,t.dynamicColourEssentialLoad3,e.load?.load3_name,t.stateEssentialLoad3,t.stateEssentialLoad3Extra,t.stateEssentialLoad3Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column1,Cn.row4)):Q(Te||(Te=gt([""])))))}static generateLoad4(t,e){return Q(ke||(ke=gt(["",""])),t.additionalLoad>=4?Q(Oe||(Oe=gt(["\n\t\t\t\t",""])),Nn.generateEssentialLoad(4,t.iconEssentialLoad4,t.dynamicColourEssentialLoad4,e.load?.load4_name,t.stateEssentialLoad4,t.stateEssentialLoad4Extra,t.stateEssentialLoad4Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column2,Cn.row4)):Q(je||(je=gt([""]))))}static generateLoad5(t,e){return Q(De||(De=gt(["",""])),t.additionalLoad>=5?Q(_e||(_e=gt(["\n\t\t\t\t",""])),Nn.generateEssentialLoad(5,t.iconEssentialLoad5,t.dynamicColourEssentialLoad5,e.load?.load5_name,t.stateEssentialLoad5,t.stateEssentialLoad5Extra,t.stateEssentialLoad5Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column1,Cn.row5)):Q(Re||(Re=gt([""]))))}static generateLoad6(t,e){return Q(Ge||(Ge=gt(["",""])),t.additionalLoad>=6?Q(Be||(Be=gt(["\n\t\t\t\t",""])),Nn.generateEssentialLoad(6,t.iconEssentialLoad6,t.dynamicColourEssentialLoad6,e.load?.load6_name,t.stateEssentialLoad6,t.stateEssentialLoad6Extra,t.stateEssentialLoad6Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column2,Cn.row5)):Q(Se||(Se=gt([""]))))}static generateLoad7(t,e){return Q(Ie||(Ie=gt(["",""])),t.additionalLoad>=7&&!e.load.show_aux?Q(He||(He=gt(["\n\t\t\t\t",""])),Nn.generateEssentialLoad(7,t.iconEssentialLoad7,t.dynamicColourEssentialLoad7,e.load?.load7_name,t.stateEssentialLoad7,t.stateEssentialLoad7Extra,t.stateEssentialLoad7Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column1,Cn.row1)):Q(Ve||(Ve=gt([""]))))}static generateLoad8(t,e){return Q(Qe||(Qe=gt(["",""])),t.additionalLoad>=8&&!e.load.show_aux?Q(Ue||(Ue=gt(["\n\t\t\t\t",""])),Nn.generateEssentialLoad(8,t.iconEssentialLoad8,t.dynamicColourEssentialLoad8,e.load?.load8_name,t.stateEssentialLoad8,t.stateEssentialLoad8Extra,t.stateEssentialLoad8Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column2,Cn.row1)):Q(We||(We=gt([""]))))}static generateLoad9(t,e){return Q(Ze||(Ze=gt(["",""])),t.additionalLoad>=9?Q(Ye||(Ye=gt(["\n\t\t\t\t",""])),Nn.generateEssentialLoad(9,t.iconEssentialLoad9,t.dynamicColourEssentialLoad9,e.load?.load9_name,t.stateEssentialLoad9,t.stateEssentialLoad9Extra,t.stateEssentialLoad9Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column3,Cn.row3)):Q(Xe||(Xe=gt([""]))))}static generateLoad10(t,e){return Q(Fe||(Fe=gt(["",""])),t.additionalLoad>=10?Q(Je||(Je=gt(["\n\t\t\t\t",""])),Nn.generateEssentialLoad(10,t.iconEssentialLoad10,t.dynamicColourEssentialLoad10,e.load?.load10_name,t.stateEssentialLoad10,t.stateEssentialLoad10Extra,t.stateEssentialLoad10Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column3,Cn.row2)):Q(Ke||(Ke=gt([""]))))}static generateLoad11(t,e){return Q(qe||(qe=gt(["",""])),t.additionalLoad>=11?Q($e||($e=gt(["\n\t\t\t",""])),Nn.generateEssentialLoad(11,t.iconEssentialLoad11,t.dynamicColourEssentialLoad11,e.load?.load11_name,t.stateEssentialLoad11,t.stateEssentialLoad11Extra,t.stateEssentialLoad11Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column3,Cn.row4)):Q(tn||(tn=gt([""]))))}static generateLoad12(t,e){return Q(en||(en=gt(["",""])),t.additionalLoad>=12?Q(nn||(nn=gt(["\n\t\t\t",""])),Nn.generateEssentialLoad(12,t.iconEssentialLoad12,t.dynamicColourEssentialLoad12,e.load?.load12_name,t.stateEssentialLoad12,t.stateEssentialLoad12Extra,t.stateEssentialLoad12Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column3,Cn.row5)):Q(an||(an=gt([""]))))}static generateLoad13(t,e){return Q(on||(on=gt(["",""])),t.additionalLoad>=13&&!e.load.show_aux?Q(rn||(rn=gt(["\n\t\t\t",""])),Nn.generateEssentialLoad(13,t.iconEssentialLoad13,t.dynamicColourEssentialLoad13,e.load?.load13_name,t.stateEssentialLoad13,t.stateEssentialLoad13Extra,t.stateEssentialLoad13Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column3,Cn.row1)):Q(sn||(sn=gt([""]))))}static generateLoad14(t,e){return Q(ln||(ln=gt(["",""])),t.additionalLoad>=14?Q(cn||(cn=gt(["\n\t\t\t\t",""])),Nn.generateEssentialLoad(14,t.iconEssentialLoad14,t.dynamicColourEssentialLoad14,e.load?.load14_name,t.stateEssentialLoad14,t.stateEssentialLoad14Extra,t.stateEssentialLoad14Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column4,Cn.row3)):Q(dn||(dn=gt([""]))))}static generateLoad15(t,e){return Q(un||(un=gt(["",""])),t.additionalLoad>=15?Q(hn||(hn=gt(["\n\t\t\t\t",""])),Nn.generateEssentialLoad(15,t.iconEssentialLoad15,t.dynamicColourEssentialLoad15,e.load?.load15_name,t.stateEssentialLoad15,t.stateEssentialLoad15Extra,t.stateEssentialLoad15Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column4,Cn.row2)):Q(gn||(gn=gt([""]))))}static generateLoad16(t,e){return Q(fn||(fn=gt(["",""])),t.additionalLoad>=16?Q(mn||(mn=gt(["\n\t\t\t",""])),Nn.generateEssentialLoad(16,t.iconEssentialLoad16,t.dynamicColourEssentialLoad16,e.load?.load16_name,t.stateEssentialLoad16,t.stateEssentialLoad16Extra,t.stateEssentialLoad16Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column4,Cn.row4)):Q(yn||(yn=gt([""]))))}static generateLoad17(t,e){return Q(pn||(pn=gt(["",""])),t.additionalLoad>=17?Q(vn||(vn=gt(["\n\t\t\t",""])),Nn.generateEssentialLoad(17,t.iconEssentialLoad17,t.dynamicColourEssentialLoad17,e.load?.load17_name,t.stateEssentialLoad17,t.stateEssentialLoad17Extra,t.stateEssentialLoad17Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column4,Cn.row5)):Q(An||(An=gt([""]))))}static generateLoad18(t,e){return Q(wn||(wn=gt(["",""])),t.additionalLoad>=18&&!e.load.show_aux?Q(bn||(bn=gt(["\n\t\t\t",""])),Nn.generateEssentialLoad(18,t.iconEssentialLoad18,t.dynamicColourEssentialLoad18,e.load?.load18_name,t.stateEssentialLoad18,t.stateEssentialLoad18Extra,t.stateEssentialLoad18Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column4,Cn.row1)):Q(xn||(xn=gt([""]))))}}zn.mainX=Cn.LOAD_X;class Tn{static getTexts(t){const e=this.mainX,n=this.mainX+46;return Q(En||(En=gt(['\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t\n\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t',"\n\t\t\t \n "])),e,this.mainY,t.enableAutarky===pt.No?"none":"",t.enableAutarky===pt.Energy?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyEnergy,n,this.mainY,t.enableAutarky===pt.No?"none":"",t.enableAutarky===pt.Energy?"st4 st8 left-align":"st12",t.inverterColour,t.ratioEnergy,e,this.mainY,t.enableAutarky===pt.No?"none":"",t.enableAutarky===pt.Power?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyPower,n,this.mainY,t.enableAutarky===pt.No?"none":"",t.enableAutarky===pt.Power?"st4 st8 left-align":"st12",t.inverterColour,t.ratioPower,e,this.mainY,t.enableAutarky===pt.No?"none":"",t.enableAutarky===pt.AutoSelf?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyAuto,n,this.mainY,t.enableAutarky===pt.No?"none":"",t.enableAutarky===pt.AutoSelf?"st4 st8 left-align":"st12",t.inverterColour,t.autarkySelf,e,this.mainY+13,t.enableAutarky===pt.No?"none":"",t.inverterColour,t.enableAutarky===pt.AutoSelf?Lt("common.autarkyAuto"):Lt("common.autarky"),n,this.mainY+13,t.enableAutarky===pt.No?"none":"",t.inverterColour,t.enableAutarky===pt.AutoSelf?Lt("common.autarkySelf"):Lt("common.ratio"))}}Tn.mainX=150,Tn.mainY=267;class kn{static getStyle(t){return V(Ln||(Ln=gt(["\n\t\t\t"])),t.dynamicColourEssentialLoad1,t.dynamicColourEssentialLoad2,t.dynamicColourEssentialLoad1,t.dynamicColourEssentialLoad2,t.dynamicColourEssentialLoad3,t.dynamicColourEssentialLoad4,t.dynamicColourEssentialLoad5,t.dynamicColourEssentialLoad6,t.dynamicColourEssentialLoad7,t.dynamicColourEssentialLoad8,t.dynamicColourEssentialLoad9,t.dynamicColourEssentialLoad10,t.dynamicColourEssentialLoad11,t.dynamicColourEssentialLoad12,t.dynamicColourEssentialLoad13,t.dynamicColourEssentialLoad14,t.dynamicColourEssentialLoad15,t.dynamicColourEssentialLoad16,t.dynamicColourEssentialLoad17,t.dynamicColourEssentialLoad18,t.auxDynamicColourLoad1,t.auxDynamicColourLoad2,t.dynamicColourNonEssentialLoad,t.dynamicColourNonEssentialLoad1,t.dynamicColourNonEssentialLoad2,t.dynamicColourNonEssentialLoad3,t.customGridIconColour,t.inverterColour)}}const On="m15 13l-4 4v-3H2v-2h9V9l4 4M5 20v-4h2v2h10v-7.81l-5-4.5L7.21 10H4.22L12 3l10 9h-3v8H5Z",jn="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",Dn="M5 20v-8H2l10-9l10 9h-3v8zm7-14.31l-5 4.5V18h10v-7.81zM11.5 18v-4H9l3.5-7v4H15z",_n="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",Rn="M35 887 l-27 -23 0 -404 0 -404 27 -23 c26 -23 28 -23 329 -23 284 0 305 1 327 19 l24 19 0 412 0 412 -24 19 c-22 18 -43 19 -327 19 -301 0 -303 0 -329 -23z m585 -157 l0 -80 -255 0 -255 0 0 80 0 80 255 0 255 0 0 -80z m-242 -229 c44 -34 40 -46 -14 -46 -60 0 -97 -38 -93 -94 5 -64 -23 -80 -35 -20 -9 44 24 113 63 134 35 18 34 15 21 50 -11 29 -14 30 58 -24z m110 -129 c4 -51 -19 -97 -59 -117 -27 -14 -30 -20 -23 -48 l6 -31 -51 43 c-29 24 -49 46 -46 49 3 4 23 5 44 3 58 -4 95 32 97 95 3 60 1 57 17 52 6 -3 13 -23 15 -46z",Gn="M15 1H9v2h6V1zm-4 13h2V8h-2v6zm8.03-6.61l1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42A8.962 8.962 0 0 0 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9a8.994 8.994 0 0 0 7.03-14.61zM12 20c-3.87 0-7-3.13-7-7s3.13-7 7-7s7 3.13 7 7s-3.13 7-7 7z",Bn="m19.95 17.15l-1.5-1.5q.275-.675.413-1.337T19 13q0-2.9-2.05-4.95T12 6q-.6 0-1.275.125t-1.4.4l-1.5-1.5q.95-.5 2.012-.763T12 4q1.5 0 2.938.5t2.712 1.45l1.4-1.4l1.4 1.4l-1.4 1.4q.95 1.275 1.45 2.713T21 13q0 1.05-.263 2.087t-.787 2.063ZM13 10.2V8h-2v.2l2 2Zm6.8 12.4l-2.4-2.4q-1.2.875-2.588 1.338T12 22q-1.85 0-3.488-.713T5.65 19.35q-1.225-1.225-1.938-2.863T3 13q0-1.5.463-2.888T4.8 7.6L1.4 4.2l1.4-1.4l18.4 18.4l-1.4 1.4ZM12 20q1.05 0 2.05-.325t1.875-.925L6.2 9.025q-.6.875-.9 1.875T5 13q0 2.9 2.05 4.95T12 20ZM9 3V1h6v2H9Zm2.075 10.875Zm2.825-2.8Z",Sn="m5.18 5.45l-1.78-.9L4.66 2h8.47l1.27 2.55l-1.78.89L11.9 4h-6l-.72 1.45M15.5 8H11l-.8-3H7.6l-.79 3H2.28L1 10.55l1.79.89L3.5 10h10.78l.72 1.45l1.79-.89L15.5 8m-.83 14H12.6l-.24-.9l-3.46-5.2l-3.47 5.2l-.23.9H3.13L6 11h2.09l-.36 1.35L8.9 14.1l1.16-1.75L9.71 11h2.07l2.89 11M8.3 15l-.9-1.35l-1.18 4.48L8.3 15m3.28 3.12l-1.18-4.48L9.5 15l2.08 3.12M23 16l-4-4v3h-4v2h4v3l4-4Z",In="M 26 16 L 22 12 L 22 15 L 18 15 L 18 17 L 22 17 L 22 20 L 26 16 Z M 22.1 21.5 L 2.4 1.7 L 1.1 3 L 6.1 8 L 5.4 8 L 4.1 10.5 L 5.9 11.4 L 6.6 10 L 8.1 10 L 9.1 11 L 6.2 22 L 8.3 22 L 8.5 21.1 L 12 15.9 L 15.5 21.1 L 15.7 22 L 17.8 22 L 17 18.8 L 20.9 22.7 L 22.1 21.5 M 9.3 18.1 L 10.5 13.6 L 11.4 14.9 L 9.3 18.1 M 14.7 18.1 L 12.6 15 L 12.8 14.7 L 14.1 16 L 14.7 18.1 M 14.2 11 L 14.9 11 L 15.1 11.9 L 14.2 11 M 14.1 8 L 18.6 8 L 19.9 10.6 L 18.1 11.5 L 17.4 10 L 13.2 10 L 10.2 7 L 10.7 5 L 13.3 5 L 14.1 8 M 8.4 5.2 L 6.9 3.7 L 7.8 2 L 16.3 2 L 17.6 4.5 L 15.8 5.4 L 15 4 L 9 4 L 8.4 5.2 Z",Hn="M15.95 21.175L13.1 18.35l1.425-1.4l1.425 1.4l3.525-3.525l1.425 1.4l-4.95 4.95ZM8 22q-.425 0-.713-.288T7 21V5q0-.425.288-.713T8 4h2V2h4v2h2q.425 0 .713.288T17 5v7q-.525 0-1.025.088T15 12.35V6H9v14h2.35q.2.575.488 1.075t.687.925H8Zm1-2h2.35H11h.35H9Z",Vn="m15 13l-4 4v-3H2v-2h9V9l4 4M5 20v-4h2v2h10v-7.81l-5-4.5L7.21 10H4.22L12 3l10 9h-3v8H5Z",Qn="M11.5 19h1v-1.85l3.5-3.5V9H8v4.65l3.5 3.5V19Zm-2 2v-3L6 14.5V9q0-.825.588-1.413T8 7h1L8 8V3h2v4h4V3h2v5l-1-1h1q.825 0 1.413.588T18 9v5.5L14.5 18v3h-5Zm2.5-7Z",Un="M10 3H8v1.88l2 2zm6 6v3.88l1.8 1.8l.2-.2V9c0-1.1-.9-2-2-2V3h-2v4h-3.88l2 2H16zM4.12 3.84L2.71 5.25L6 8.54v5.96L9.5 18v3h5v-3l.48-.48l4.47 4.47l1.41-1.41L4.12 3.84zm8.38 13.33V19h-1v-1.83L8 13.65v-3.11l5.57 5.57l-1.07 1.06z",Wn="m5.39 5.45-1.78-.9L4.87 2h8.47l1.27 2.55-1.78.89L12.11 4h-6zM15.73 8H11.2l-.79-3h-2.6L7 8H2.5l-1.29 2.55 1.79.89.73-1.44H14.5l.71 1.45 1.79-.89zm-.85 14h-2.07l-.24-.9-3.46-5.2-3.47 5.2-.23.9H3.34l2.89-11h2.07l-.36 1.35 1.17 1.75 1.16-1.75-.35-1.35H12zm-6.38-7-.89-1.35-1.18 4.48zm3.29 3.12-1.18-4.48-.9 1.36zM15 16l4-4v3H23v2h-4v3z",Zn="M22.1 21.5L2.4 1.7L1.1 3l5 5h-.7l-1.3 2.5l1.8.9l.7-1.4h1.5l1 1l-2.9 11h2.1l.2-.9l3.5-5.2l3.5 5.2l.2.9h2.1l-.8-3.2l3.9 3.9l1.2-1.2M9.3 18.1l1.2-4.5l.9 1.3l-2.1 3.2m5.4 0L12.6 15l.2-.3l1.3 1.3l.6 2.1m-.5-7.1h.7l.2.9l-.9-.9m-.1-3h4.5l1.3 2.6l-1.8.9l-.7-1.5h-4.2l-3-3l.5-2h2.6l.8 3M8.4 5.2L6.9 3.7L7.8 2h8.5l1.3 2.5l-1.8.9L15 4H9l-.6 1.2Z",Yn="m8.28 5.45l-1.78-.9L7.76 2h8.47l1.27 2.55l-1.78.89L15 4H9l-.72 1.45M18.62 8h-4.53l-.79-3h-2.6l-.79 3H5.38L4.1 10.55l1.79.89l.73-1.44h10.76l.72 1.45l1.79-.89L18.62 8m-.85 14H15.7l-.24-.9L12 15.9l-3.47 5.2l-.23.9H6.23l2.89-11h2.07l-.36 1.35L12 14.1l1.16-1.75l-.35-1.35h2.07l2.89 11m-6.37-7l-.9-1.35l-1.18 4.48L11.4 15m3.28 3.12l-1.18-4.48l-.9 1.36l2.08 3.12Z",Xn="M11.45 2v3.55L15 3.77L11.45 2m-1 6L8 10.46l3.75 1.25L10.45 8M2 11.45L3.77 15l1.78-3.55H2M10 2H2v8c.57.17 1.17.25 1.77.25c3.58.01 6.49-2.9 6.5-6.5c-.01-.59-.1-1.18-.27-1.75m7 20v-6h-3l5-9v6h3l-5 9Z";var Fn,Jn,Kn,qn,$n,ta,ea,na,aa,oa,ra,ia,sa,la,ca,da,ua,ha,ga,fa,ma,ya,pa,va,Aa,wa,ba,xa,Ea,La,Pa,Ma,Ca,Na,za,Ta,ka,Oa,ja,Da,_a,Ra,Ga,Ba,Sa,Ia,Ha,Va,Qa,Ua,Wa,Za,Ya,Xa,Fa,Ja,Ka,qa,$a,to,eo,no,ao,oo,ro,io,so,lo,co,uo,ho,go,fo,mo,yo,po,vo,Ao,wo,bo,xo,Eo,Lo,Po,Mo,Co,No,zo,To,ko,Oo,jo,Do,_o,Ro,Go,Bo,So,Io,Ho,Vo,Qo,Uo,Wo,Zo,Yo,Xo,Fo,Jo,Ko,qo,$o,tr,er,nr,ar,or,rr,ir,sr,lr,cr,dr,ur,hr,gr,fr,mr,yr,pr,vr,Ar;class wr{static set decimalPlacesEnergy(t){this._decimalPlacesEnergy=t}static set solarColour(t){this._solarColour=t}static get solarColour(){return this._solarColour}static get decimalPlacesEnergy(){return this._decimalPlacesEnergy}static get decimalPlaces(){return this._decimalPlaces}static set decimalPlaces(t){this._decimalPlaces=t}static generateSolarPower(t,e){return Q(Fn||(Fn=gt(['\n\t\t\t\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t',"%\n\t\t\t\n\t\t\t","\n\t\t"])),e.solar.visualize_efficiency?"url(#SlG)":t.solarColour,1===e.solar.mppts?"none":"",e.show_solar?"":"st12",0===t.totalPVEfficiency?"grey":t.solarColour,t.totalPVEfficiency,0===t.totalPVEfficiency?"grey":t.solarColour,t.totalPVEfficiency,t.totalPVEfficiency<100?"grey":t.solarColour,t.totalPVEfficiency<100?"grey":t.solarColour,e.show_solar&&1!==e.solar.mppts?"":"st12",t.solarColour,t.solarLineWidth,Math.min(2+t.solarLineWidth+Math.max(t.minLineWidth-2,0),8),e.show_solar&&1!==e.solar.mppts?"":"st12",0===t.totalPV?"transparent":"".concat(t.solarColour),t.durationCur.solar,e.solar.show_mppt_efficiency?"st3 st8 right-align":"st12",1===e.solar.mppts?"none":"",t.solarColour,t.totalPVEfficiency,t.statePVTotal.isValid()?Q(Jn||(Jn=gt(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t"])),(t=>Mn.handlePopup(t,e.entities.pv_total)),!0!==t.largeFont?"st14":"st4",e.show_solar&&1!==e.solar.mppts?"":"none",t.solarColour,e.solar.auto_scale?Mn.convertValueNew(t.totalPV,t.statePVTotal.getUOM(),t.decimalPlaces):"".concat(Mn.toNum(t.totalPV||0,0)," ").concat(_t.WATT)):Q(Kn||(Kn=gt(['\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t"])),!0!==t.largeFont?"st14":"st4",e.show_solar&&1!==e.solar.mppts?"":"none",t.solarColour,e.solar.auto_scale?Mn.convertValue(t.totalPV,t.decimalPlaces)||0:"".concat(Mn.toNum(t.totalPV||0,0)," ").concat(_t.WATT)))}static generateSolarHeader(t,e){let n,a=Q(qn||(qn=gt([""]))),o=Q($n||($n=gt([""]))),r=Q(ta||(ta=gt([""]))),i=Q(ea||(ea=gt([""]))),s=Q(na||(na=gt([""]))),l=Q(aa||(aa=gt([""]))),c=this.countGenerationElements(t);if(0==c)return Q(oa||(oa=gt([""])));n=this.setStartPosition(c),t.stateTomorrowSolar.isValid()&&(l=this.getProduction("tomorrow_solar_name",t.stateTomorrowSolar,n,e)),t.stateRemainingSolar.isValid()&&(s=this.getProduction("remaining_solar_name",t.stateRemainingSolar,n,e)),t.stateTotalSolarGeneration.isValid()&&(i=this.getProduction("total_solar_generation_name",t.stateTotalSolarGeneration,n,e)),t.stateYearlyPVEnergy.isValid()&&(r=this.getProduction("yearly_solar_name",t.stateYearlyPVEnergy,n,e)),t.stateMonthlyPVEnergy.isValid()&&(o=this.getProduction("monthly_solar_name",t.stateMonthlyPVEnergy,n,e)),t.stateDailyPVEnergy.isValid()&&(a=this.getProduction("daily_solar_name",t.stateDailyPVEnergy,n,e)),n.x-=2+n.gap/2;const d=Q(ra||(ra=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t'])),n.x,t.solarColour,Xn),u=Q(ia||(ia=gt(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"°\n\t\t\t\t\t\n\t\t\t\t"])),(t=>Mn.handlePopup(t,e.entities.environment_temp)),n.x,e.entities?.environment_temp?"st3 left-align":"st12",t.solarColour,t.stateEnvironmentTemp.isValid()?"":"none",t.stateEnvironmentTemp.toNum(1));return Q(sa||(sa=gt(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t"])),d,u,a,o,r,i,s,l)}static setStartPosition(t){switch(t){case 1:return{x:260,gap:0};case 2:return{x:330,gap:0};default:return{x:400,gap:0}}}static countGenerationElements(t){let e=0;return t.stateTomorrowSolar.isValid()&&e++,t.stateRemainingSolar.isValid()&&e++,t.stateTotalSolarGeneration.isValid()&&e++,t.stateYearlyPVEnergy.isValid()&&e++,t.stateMonthlyPVEnergy.isValid()&&e++,t.stateDailyPVEnergy.isValid()&&e++,e++}static getProduction(t,e,n,a){const o=n.x,r=e?.toPowerString(!0,this.decimalPlacesEnergy)||"0",i=a.solar[t]?a.solar[t]:Lt("common."+t),s=this.getTextWidth(r,"16px Roboto"),l=this.getTextWidth(i,"9px Roboto");return n.gap=Math.max(l,s),n.x-=n.gap+8,Q(la||(la=gt(['\n \n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n \n ',"\n "])),(t=>Mn.handlePopup(t,e.entity_id)),t,o-n.gap/2,this.solarColour,r,t,o-n.gap/2,this.solarColour,i)}static getTextWidth(t,e){const n=document.createElement("canvas").getContext("2d");let a=0;return null!==n&&(n.font=e,a=Math.round(n.measureText(t)?.width)),a}static getPositions(t,e){switch(t){case 1:switch(e){case 1:return[205,"M 239.23 84 L 239 190",230,244.7,238.8,230];case 2:return[158,"M 193 84 L 193 122 Q 193 132 201 132 L 205 132.03",188,198,192,188];case 3:case 4:return[82,"M 117 84 L 117 125 Q 117 132 124 132 L 205 132.03",113,121,116,113];case 5:return[4,"M 39 84 L 39 125 Q 39 132 46 132 L 205 132.03",35,44,38,35]}break;case 2:switch(e){case 2:return[254,"M 289 84.5 L 289 125 Q 289 132 282 132 L 275 132",281,296,289.5,296];case 3:case 4:return[158,"M 193 84 L 193 122 Q 193 132 201 132 L 205 132.03",188,198,192,188];case 5:return[82,"M 117 84 L 117 125 Q 117 132 124 132 L 205 132.03",113,121,116,113]}break;case 3:switch(e){case 3:case 4:return[254,"M 289 84.5 L 289 125 Q 289 132 282 132 L 275 132",281,296,289.5,296];case 5:return[158,"M 193 84 L 193 122 Q 193 132 201 132 L 205 132.03",188,198,192,188]}break;case 4:switch(e){case 4:return[330,"M 365 85 L 365 125 Q 365 132 358 132 L 275 132",357,372,366,372];case 5:return[254,"M 289 84.5 L 289 125 Q 289 132 282 132 L 275 132",281,296,289.5,296]}break;case 5:return[330,"M 365 85 L 365 125 Q 365 132 358 132 L 275 132",357,372,366,372]}return[]}static generateMppt1(t,e){const n=this.getPositions(1,e.solar.mppts);return Q(ca||(ca=gt(["",""])),e.show_solar?Q(da||(da=gt(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "])),this.generateFrame(n,"pv1",t.PV1Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv1",t.statePV1Power,t.durationCur.pv1,t.pv1LineWidth,t.minLineWidth),this.generateName(n[0],e.solar.pv1_name),this.generateEfficiency(n,t.PV1Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV1Energy,e.solar.show_mppt_production),this.generateVoltage(n,t.statePV1Voltage),this.generateAmperage(n,t.statePV1Current),this.generatePower(n,t.statePV1Power,e.solar.auto_scale,t.largeFont)):Q(ua||(ua=gt([""]))))}static generateMppt2(t,e){const n=this.getPositions(2,e.solar.mppts);return Q(ha||(ha=gt(["",""])),e.show_solar&&e.solar.mppts>=2?Q(ga||(ga=gt(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t\t ","\n "])),this.generateFrame(n,"PV2",t.PV2Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv2",t.statePV2Power,t.durationCur.pv2,t.pv2LineWidth,t.minLineWidth),this.generateName(n[0],e.solar.pv2_name),this.generateEfficiency(n,t.PV2Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV2Energy,e.solar.show_mppt_production),this.generateVoltage(n,t.statePV2Voltage),this.generateAmperage(n,t.statePV2Current),this.generatePower(n,t.statePV2Power,e.solar.auto_scale,t.largeFont)):Q(fa||(fa=gt([""]))))}static generateMppt3(t,e){const n=this.getPositions(3,e.solar.mppts);return Q(ma||(ma=gt(["",""])),e.show_solar&&e.solar.mppts>=3?Q(ya||(ya=gt(["\n ","\n ","\n ","\t\t\t\n ","\n ","\n ","\n ","\n\t\t\t ","\n "])),this.generateFrame(n,"PV3",t.PV3Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv3",t.statePV3Power,t.durationCur.pv3,t.pv3LineWidth,t.minLineWidth),this.generateName(n[0],e.solar.pv3_name),this.generateEfficiency(n,t.PV3Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV3Energy,e.solar.show_mppt_production),this.generateVoltage(n,t.statePV3Voltage),this.generateAmperage(n,t.statePV3Current),this.generatePower(n,t.statePV3Power,e.solar.auto_scale,t.largeFont)):Q(pa||(pa=gt([""]))))}static generateMppt4(t,e){const n=this.getPositions(4,e.solar.mppts);return Q(va||(va=gt(["",""])),e.show_solar&&e.solar.mppts>=4?Q(Aa||(Aa=gt(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "])),this.generateFrame(n,"PV4",t.PV4Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv4",t.statePV4Power,t.durationCur.pv4,t.pv4LineWidth,t.minLineWidth),this.generateName(n[0],e.solar.pv4_name),this.generateEfficiency(n,t.PV4Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV4Energy,e.solar.show_mppt_production),this.generateVoltage(n,t.statePV4Voltage),this.generateAmperage(n,t.statePV4Current),this.generatePower(n,t.statePV4Power,e.solar.auto_scale,t.largeFont)):Q(wa||(wa=gt([""]))))}static generateMppt5(t,e){const n=this.getPositions(5,e.solar.mppts);return Q(ba||(ba=gt(["",""])),e.show_solar&&e.solar.mppts>=5?Q(xa||(xa=gt(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t\t ","\n\t\t\t "])),this.generateFrame(n,"PV5",t.PV5Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv5",t.statePV5Power,t.durationCur.pv5,t.pv5LineWidth,t.minLineWidth),this.generateName(n[0],e.solar.pv5_name),this.generateEfficiency(n,t.PV5Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV5Energy,e.solar.show_mppt_production),this.generateVoltage(n,t.statePV5Voltage),this.generateAmperage(n,t.statePV5Current),this.generatePower(n,t.statePV5Power,e.solar.auto_scale,t.largeFont)):Q(Ea||(Ea=gt([""]))))}static generatePower(t,e,n,a){return Q(La||(La=gt(['\n \n \n ',"\n \n\t\t\t "])),(t=>Mn.handlePopup(t,e.entity_id)),t[4],!0!==a?"st14":"st4",e.isValid()?"":"none",this.solarColour,n?Mn.convertValue(e,this.decimalPlaces)||0:e.toNum(0)+" "+_t.WATT)}static generateFrame(t,e,n,a){return Q(Pa||(Pa=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t'])),e,t[0],e,a?"url(#"+e+"LG)":this.solarColour,e,0===n?"grey":this.solarColour,n,0===n?"grey":this.solarColour,n,n<100?"grey":this.solarColour,n<100?"grey":this.solarColour)}static generateFlowLine(t,e,n,a,o,r){const i=n.toPower();return Q(Ma||(Ma=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t"])),e,e,t[1],this.solarColour,o,e,Math.min(2+o+Math.max(r-2,0),8),Math.round(i)<=0?"transparent":"".concat(this.solarColour),a,this.pvLineMap[e])}static generateName(t,e){return Q(Ca||(Ca=gt(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t"])),t+3,this._solarColour,e)}static generateEfficiency(t,e,n){return Q(Na||(Na=gt(['\n \n ',"%\n "])),t[2],n?"st3 st8 right-align":"st12",n?"":"none",this.solarColour,e)}static generateEnergy(t,e,n){return Q(za||(za=gt(['\n \n \n ',"\n \n "])),(t=>Mn.handlePopup(t,e.entity_id)),t[2],n&&e.isValid()?"":"none",this.solarColour,e.toPowerString(!0,0))}static generateVoltage(t,e){return Q(Ta||(Ta=gt(['\n \n ',"","\n \n "])),(t=>Mn.handlePopup(t,e.entity_id)),t[3],e.isValid()?"":"none",this.solarColour,e.toNum(1),Bt.VOLT)}static generateAmperage(t,e){return Q(ka||(ka=gt(['\n \n\t\t\t\t\n\t\t\t\t\t',"","\n\t\t\t\t\n\t\t\t"])),(t=>Mn.handlePopup(t,e.entity_id)),t[3],e.isValid()?"":"none",this.solarColour,e.toNum(1),Gt.AMPERE)}static generateSolarSellIcon(t,e){return Q(Oa||(Oa=gt(['\n \n \n \n \n \n \n \n '])),(t=>Mn.handlePopup(t,e.entities.solar_sell_247)),e.entities.solar_sell_247&&"off"!==t.stateSolarSell.state&&"0"!==t.stateSolarSell.state&&["1","on"].includes(t.stateSolarSell.state)?"":"none",t.solarColour,Sn,e.entities.solar_sell_247&&"on"!==t.stateSolarSell.state&&"1"!==t.stateSolarSell.state&&["0","off"].includes(t.stateSolarSell.state)?"":"none",t.solarColour,In)}}wr._solarColour="orange",wr._decimalPlacesEnergy=2,wr._decimalPlaces=2,wr.pvLineMap={pv1:"#pv1-line",pv2:"#pv2-line",pv3:"#pv3-line",pv4:"#pv4-line",pv5:"#pv5-line"};class br{static generateShapes(t,e){return Q(ja||(ja=gt(['\n\t\t\t\n\t\t'])),t.batteryColour,e.show_battery?"":"none")}static generatePower(t,e){return Q(Da||(Da=gt(['\n\t\t\t\t\n \n ',"\n \n \n\t\t"])),(t=>Mn.handlePopup(t,e.entities.battery_power_190)),"none"===e.entities.battery_power_190?"none":"",t.batteryColour,!0!==t.largeFont?"st14":"st4",e.battery.auto_scale?"".concat(e.battery.show_absolute?Mn.convertValueNew(Math.abs(t.stateBatteryPower.toNum(t.decimalPlaces)),t.stateBatteryPower.getUOM(),t.decimalPlaces):Mn.convertValueNew(t.stateBatteryPower.toNum(t.decimalPlaces),t.stateBatteryPower.getUOM(),t.decimalPlaces)||"0"):"".concat(t.stateBatteryPower.toStr(e.decimal_places,e.battery?.invert_power,e.battery.show_absolute)," ").concat(_t.WATT))}static generateCircle(t,e){return Q(_a||(_a=gt(['\n\t\t\t\t'])),"none"!==e.entities?.battery_status&&e.entities?.battery_status?"":"none",t.batteryStateColour)}static generateVoltage(t){return Q(Ra||(Ra=gt(['\n\t\t\t\t\n \n '," ","\n \n \n\t\t"])),(e=>Mn.handlePopup(e,t.stateBatteryVoltage.entity_id)),t.stateBatteryVoltage.isValid()?"":"none",t.batteryColour,t.stateBatteryVoltage.toStr(t.decimalPlaces),Bt.VOLT)}static generateCurrent(t,e){return Q(Ga||(Ga=gt(['\n\t\t\t\t\n \n '," ","\n \n \n\t\t"])),(e=>Mn.handlePopup(e,t.stateBatteryCurrent.entity_id)),t.stateBatteryCurrent.isValid()?"":"none",t.batteryColour,t.stateBatteryCurrent.toStr(t.decimalPlaces,!1,e.battery.show_absolute),Gt.AMPERE)}static generateTemp(t){return Q(Ba||(Ba=gt(['\n\t\t\t\t\n \n ',"°\n \n \n \n\t\t"])),(e=>Mn.handlePopup(e,t.stateBatteryTemp.entity_id)),t.batteryColour,t.stateBatteryTemp.isValid()?"":"none",t.stateBatteryTemp.toNum(1))}static generateDuration(t,e){return Q(Sa||(Sa=gt(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t'," ","% @",'\n\t\t\t\n\t\t\t\n\t\t\t\t'," ","% @",'\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\t\t\n\t\t"])),!0!==t.largeFont?"st14":"st4",e.show_battery?"":"none",0===t.batteryEnergy||t.isFloating||0===t.batteryPower?"transparent":"".concat(t.batteryColour),t.batteryDuration,e.show_battery?"":"none",0===t.batteryEnergy||t.batteryPower<=0||t.isFloating?"transparent":"".concat(t.batteryColour),Lt("common.runtime_to"),t.batteryCapacity,t.formattedResultTime,e.show_battery?"":"none",0===t.batteryEnergy||t.batteryPower>=0||t.isFloating?"transparent":"".concat(t.batteryColour),Lt("common.to"),t.batteryCapacity,t.formattedResultTime,e.show_battery?"":"none",0!==t.batteryEnergy&&t.isFloating?"".concat(t.batteryColour):"transparent",Lt("common.battery_floating"))}static generateDailyCharge(t,e){return Q(Ia||(Ia=gt(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),!0===t.batteryShowDaily&&e.show_battery?"".concat(t.batteryColour):"transparent",Lt("common.daily_charge"),(t=>Mn.handlePopup(t,e.entities.day_battery_charge_70)),!0===t.batteryShowDaily&&e.show_battery&&t.stateDayBatteryCharge.isValid()?"":"none",t.batteryColour,t.stateDayBatteryCharge?.toPowerString(!0,t.decimalPlacesEnergy))}static generateDailyDischarge(t,e){return Q(Ha||(Ha=gt(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),!0===t.batteryShowDaily&&e.show_battery?"".concat(t.batteryColour):"transparent",Lt("common.daily_discharge"),(t=>Mn.handlePopup(t,e.entities.day_battery_discharge_71)),!0===t.batteryShowDaily&&e.show_battery&&t.stateDayBatteryDischarge.isValid()?"":"none",t.batteryColour,t.stateDayBatteryDischarge?.toPowerString(!0,t.decimalPlacesEnergy))}static generateFlowLines(t,e){return Q(Va||(Va=gt(['\n \t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t'])),e.show_battery?"":"st12",e.battery.dynamic_colour?t.flowBatColour:t.batteryColour,t.batLineWidth,Math.min(2+t.batLineWidth+Math.max(t.minLineWidth-2,0),8),e.show_battery?"":"st12",t.batteryPower<=0?"transparent":"".concat(t.batteryColour),t.durationCur.battery,Math.min(2+t.batLineWidth+Math.max(t.minLineWidth-2,0),8),e.show_battery?"":"st12",t.batteryPower>=0?"transparent":"".concat(e.battery.dynamic_colour?t.flowBatColour:t.batteryColour),t.durationCur.battery)}static generateSOC(t,e){return Q(Qa||(Qa=gt(['\n\t\t\t\t\n\t \n\t ','%\n\t \n\t \n\t\t \n |\n '])),(e=>Mn.handlePopup(e,t.stateBatterySoc.entity_id)),t.stateBatterySoc.isValid()?"":"none",t.batteryColour,e.battery.hide_soc?"st12":"st13 st8 left-align",t.stateBatterySoc.toStr(100===t.stateBatterySoc.toNum(0)?0:1),t.batteryColour,e.battery.hide_soc?"st12":"st13 st8 left-align",!t.inverterProg.show&&e.battery.shutdown_soc_offgrid?"":"none")}static generateSOH(t){return Q(Ua||(Ua=gt(['\n\t\t\t\t\n \n ',"%\n \n "])),(e=>Mn.handlePopup(e,t.stateBatterySOH.entity_id)),t.stateBatterySOH.isValid()?"st3 left-align":"st12",t.batteryColour,!t.stateBatterySOH.isValid()||t.stateBatteryTemp.isValid()?"none":"",t.stateBatterySOH.toNum(0))}static generateCapacity(t,e){return Q(Wa||(Wa=gt(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t\t","\n\t\t\t"])),e.show_battery&&e.battery.show_remaining_energy?"":"none",t.batteryColour,Mn.toNum(t.batteryEnergy*(t.stateBatterySoc.toNum(2)/100)/1e3,2),Rt.KILO_WATT_HOUR)}static generateShutdownSOC(t,e){return Q(Za||(Za=gt(['\n\t\t\t\n\t\t\t\t','%\n\t\t\t\n\t\t\t\n\t\t\t\t','%\n\t\t\t\n\t\t\t\n \n | ','%\n \n \n \n \n | ',"%\n \n "])),t.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st14 left-align",!t.inverterProg.show&&e.battery?.shutdown_soc_offgrid?"":"none",t.batteryShutdown,t.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st14 left-align",!t.inverterProg.show&&e.battery?.shutdown_soc_offgrid?"":"none",t.shutdownOffGrid,(t=>Mn.handlePopup(t,e.entities.battery_soc_184)),t.batteryColour,!t.inverterProg.show||"none"===e.entities.battery_soc_184||e.battery.hide_soc?"none":"",t.inverterProg.capacity||0,(t=>Mn.handlePopup(t,e.entities.battery_soc_184)),t.batteryColour,e.battery.hide_soc?"st12":"st13 st8 left-align",t.inverterProg.show||!e.battery?.shutdown_soc||e.battery?.shutdown_soc_offgrid?"none":"",t.batteryShutdown||0)}static generateBatteryGradient(t,e){return Q(Ya||(Ya=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t'])),t.gridPercentageBat>0?t.gridColour:t.pvPercentageBat>0?t.solarColour:t.batteryColour,t.gridPercentageBat<2?0:t.gridPercentageBat,t.gridPercentageBat>0?t.gridColour:t.pvPercentageBat>0?t.solarColour:t.batteryColour,t.gridPercentageBat<2?0:t.gridPercentageBat,t.pvPercentageBat>0?t.solarColour:t.batteryColour,(t.gridPercentageBat<2?0:t.gridPercentageBat)+(t.pvPercentageBat<2?0:t.pvPercentageBat),t.pvPercentageBat>0?t.solarColour:t.batteryColour,(t.gridPercentageBat<2?0:t.gridPercentageBat)+(t.pvPercentageBat<2?0:t.pvPercentageBat),t.batteryColour,t.batteryColour,e.show_battery?"":"st12",e.battery.dynamic_colour?"url(#bLg)":t.batteryColour,e.battery.linear_gradient?t.battery0:t.batteryIcon,t.stopColour,e.battery.animate?"y2":"none",e.show_battery?"":"st12",e.battery.linear_gradient?"url(#sLg)":t.batteryColour,e.battery.linear_gradient?"":"none",t.batteryCharge)}}class xr{static get gridColour(){return this._gridColour}static set gridColour(t){this._gridColour=t}static get decimalPlaces(){return this._decimalPlaces}static set decimalPlaces(t){this._decimalPlaces=t}static generateShapeAndName(t,e){return Q(Xa||(Xa=gt(['\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t"])),t.gridColour,t.gridColour,e.grid.grid_name)}static generatePhases(t,e){return Q(Fa||(Fa=gt(["\n\t\t\t","\n\t\t\t","\n\t\t\t","\n\t\t\t\n\t\t\t","\n\t\t\t","\n\t\t\t","\n\t\t\t\n\t\t\t","\n\t\t\t","\n\t\t\t","\n\t\t"])),Nn.generatePhasePower("L1",t.stateGridPowerL1,this._col1X,241,e.grid.auto_scale,this.gridColour,this.decimalPlaces),Nn.generatePhasePower("L2",t.stateGridPowerL2,this._col1X,254,e.grid.auto_scale,this.gridColour,this.decimalPlaces),Nn.generatePhasePower("L3",t.stateGridPowerL3,this._col1X,267,e.grid.auto_scale,this.gridColour,this.decimalPlaces),Nn.generatePhaseVoltage("L1",t.stateGridVoltageL1,this._col1X,195,this.gridColour),Nn.generatePhaseVoltage("L2",t.stateGridVoltageL2,this._col1X,182,this.gridColour),Nn.generatePhaseVoltage("L3",t.stateGridVoltageL3,this._col1X,169,this.gridColour),Nn.generatePhaseAmperage("L1",t.stateGridCurrentL1,this._col2X,195,this.gridColour),Nn.generatePhaseAmperage("L2",t.stateGridCurrentL2,this._col2X,182,this.gridColour),Nn.generatePhaseAmperage("L3",t.stateGridCurrentL3,this._col2X,169,this.gridColour))}static generateFrequency(t){return Q(Ja||(Ja=gt(["",""])),Nn.generateFrequency(t.stateGridFrequency,t.gridColour,"grid_frequency",this._col1X,208,"right-align"))}static generateEnergyCost(t,e){return Q(Ka||(Ka=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t'," ",'\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t'," ","\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Mn.handlePopup(t,e.entities.energy_cost_buy)),this._col3X,t.gridImportColour,e.entities?.energy_cost_buy&&t.stateEnergyCostBuy.isValid()?"":"none",t.stateEnergyCostBuy.toStr(e.grid?.energy_cost_decimals||2),t.stateEnergyCostBuy.getUOM(),(t=>Mn.handlePopup(t,e.entities.energy_cost_sell)),this._col3X,t.gridExportColour,e.entities?.energy_cost_sell&&t.stateEnergyCostSell.isValid()?"":"none",t.stateEnergyCostSell.toStr(e.grid?.energy_cost_decimals||2),t.stateEnergyCostSell.getUOM())}static generateFlowLines(t){return Q(qa||(qa=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t'])),t.gridColour,t.gridLineWidth,Math.min(2+t.gridLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.totalGridPower?"transparent":"".concat(t.gridColour),t.durationCur.grid,t.totalGridPower>0?"0;1":"1;0",t.gridColour,t.gridLineWidth,Math.min(2+t.gridLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.totalGridPower?"transparent":"".concat(t.gridColour),t.durationCur.grid,t.totalGridPower>0?"0;1":"1;0")}static generateIcon(t,e){return Q($a||($a=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t'])),(t=>Mn.handlePopup(t,e.entities.grid_connected_status_194)),kt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridColour,t.totalGridPower<0||e.grid.import_icon?"none":"",Yn,Ot.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridOffColour,e.grid.disconnected_icon?"none":"",Zn,kt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridColour,t.totalGridPower>=0||e.grid.export_icon?"none":"",Wn,(t=>Mn.handlePopup(t,e.entities.grid_connected_status_194)),e.grid.import_icon||e.grid.disconnected_icon||e.grid.export_icon?"":"none",t.customGridIcon)}static generatePrepaidUnits(t,e){return Q(to||(to=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t'," ","\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Mn.handlePopup(t,e.entities.prepaid_units)),e.entities?.prepaid_units?"st3":"st12",t.gridColour,t.statePrepaidUnits.isValid()?"":"none",t.statePrepaidUnits.toStr(1),e.grid.prepaid_unit_name)}static generateDailyImport(t,e){return Q(eo||(eo=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),(t=>Mn.handlePopup(t,e.entities.day_grid_import_76)),!0===t.gridShowDailyBuy&&t.stateDayGridImport.isValid()?"":"none",t.gridColour,t.stateDayGridImport?.toPowerString(!0,t.decimalPlacesEnergy),!0!==t.gridShowDailyBuy?"transparent":"".concat(t.gridColour),e.grid.label_daily_grid_buy)}static generateDailyExport(t,e){return Q(no||(no=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),(t=>Mn.handlePopup(t,e.entities.day_grid_export_77)),!0===t.gridShowDailySell&&t.stateDayGridExport.isValid()?"":"none",t.gridColour,t.stateDayGridExport?.toPowerString(!0,t.decimalPlacesEnergy),!0!==t.gridShowDailySell?"transparent":"".concat(t.gridColour),e.grid.label_daily_grid_sell)}static generateLimit(t,e){return Q(ao||(ao=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',": ","\n\t\t\t\t\n\t\t\t"])),(t=>Mn.handlePopup(t,e.entities.max_sell_power)),["off","0"].includes(t.stateSolarSell.state)?"grey":t.gridColour,t.stateMaxSellPower.isValid&&e.entities?.max_sell_power?"":"none",Lt("common.limit"),t.stateMaxSellPower.toPowerString(e.grid.auto_scale,t.decimalPlaces))}static generateTotalGridPower(t,e){return Q(oo||(oo=gt(["\n\t\t\t","\t\t\n\t\t"])),e.inverter.three_phase?e.entities?.grid_ct_power_total?Q(ro||(ro=gt(['\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\n\t\t\t\t\t"])),(t=>Mn.handlePopup(t,e.entities.grid_ct_power_total)),"none"===e.entities.grid_ct_power_172?"none":"",!0!==t.largeFont?"st14":"st4",t.gridColour,e.grid.auto_scale?"".concat(e.grid.show_absolute?"".concat(Math.abs(parseFloat(Mn.convertValue(t.totalGridPower,t.decimalPlaces)))," ").concat(Mn.convertValue(t.totalGridPower,t.decimalPlaces).split(" ")[1]):Mn.convertValue(t.totalGridPower,t.decimalPlaces)||0):"".concat(e.grid.show_absolute?"".concat(Math.abs(t.totalGridPower)," ").concat(_t.WATT):"".concat(t.totalGridPower||0," ").concat(_t.WATT))):Q(io||(io=gt(['\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\t"])),"none"===e.entities.grid_ct_power_172?"none":"",!0!==t.largeFont?"st14":"st4",t.gridColour,e.grid.auto_scale?"".concat(e.grid.show_absolute?"".concat(Math.abs(parseFloat(Mn.convertValue(t.totalGridPower,t.decimalPlaces)))," ").concat(Mn.convertValue(t.totalGridPower,t.decimalPlaces).split(" ")[1]):Mn.convertValue(t.totalGridPower,t.decimalPlaces)||0):"".concat(e.grid.show_absolute?"".concat(Math.abs(t.totalGridPower)," ").concat(_t.WATT):"".concat(t.totalGridPower||0," ").concat(_t.WATT))):Q(so||(so=gt(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\t\n\t\t\t\t"])),(t=>Mn.handlePopup(t,e.entities.grid_ct_power_172)),"none"===e.entities.grid_ct_power_172?"none":"",!0!==t.largeFont?"st14":"st4",t.gridColour,e.grid.auto_scale?"".concat(e.grid.show_absolute?"".concat(Math.abs(parseFloat(Mn.convertValue(t.totalGridPower,t.decimalPlaces)))," ").concat(Mn.convertValue(t.totalGridPower,t.decimalPlaces).split(" ")[1]):Mn.convertValue(t.totalGridPower,t.decimalPlaces)||0):"".concat(e.grid.show_absolute?"".concat(Math.abs(t.totalGridPower)," ").concat(_t.WATT):"".concat(t.totalGridPower||0," ").concat(_t.WATT))))}}xr._col1X=103,xr._col2X=107,xr._col3X=137,xr._gridColour="gray";class Er{static generateInverterImage(t,e){return Q(lo||(lo=gt(["\n\t\t\t",""])),t.genericInverterImage?Q(co||(co=gt(['\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t'])),t.inverterColour,Rn):Q(uo||(uo=gt([''])),e))}static generateTimerInfo(t,e){return Q(ho||(ho=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t','\n\t\t\t\t\n\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Mn.handlePopup(t,e.entities.use_timer_248)),"on"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Gn,"off"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Bn,"off"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Lt("common.timer_off"),"on"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Lt("common.timer_on"))}static generateFrequency(t){return Q(go||(go=gt(["",""])),Nn.generateFrequency(t.stateLoadFrequency,t.inverterColour,"load_frequency_192",301,208,"right-align"))}static generatePhases(t,e){let n=[195,182,169];return(e.load.show_aux||!t.stateInverterVoltageL3.isValid()&&!t.stateInverterCurrentL3.isValid())&&(n=[198,188,178]),Q(fo||(fo=gt(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t\t\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"])),Nn.generatePhaseVoltage("L1",t.stateInverterVoltageL1,301.7,n[0],t.inverterColour),Nn.generatePhaseVoltage("L2",t.stateInverterVoltageL2,301.7,n[1],t.inverterColour),Nn.generatePhaseVoltage("L3",t.stateInverterVoltageL3,301.7,n[2],t.inverterColour),Nn.generatePhaseAmperage("L1",t.stateInverterCurrentL1,305.7,n[0],t.inverterColour),Nn.generatePhaseAmperage("L2",t.stateInverterCurrentL2,305.7,n[1],t.inverterColour),Nn.generatePhaseAmperage("L3",t.stateInverterCurrentL3,305.7,n[2],t.inverterColour))}static generatePriorityLoad(t,e){return Q(mo||(mo=gt(["",""])),"on"===t.priorityLoad?Q(yo||(yo=gt(['\n\t\t\t\t\t\t\n \n \n \n ',"\n \n "])),(t=>Mn.handlePopup(t,e.entities.priority_load_243)),"on"!==t.priorityLoad||"no"===t.priorityLoad&&t.priorityLoad?"none":"",t.inverterColour,Vn,"on"!==t.priorityLoad||"no"===t.priorityLoad&&t.priorityLoad?"none":"",t.inverterColour,Lt("common.priority_load")):Q(po||(po=gt(['\n\t\t\t\t\t\t\n \n \n \n ',"\n \n "])),(t=>Mn.handlePopup(t,e.entities.priority_load_243)),"off"!==t.priorityLoad||"no"===t.priorityLoad&&t.priorityLoad?"none":"",t.inverterColour,Hn,"off"!==t.priorityLoad||"no"===t.priorityLoad&&t.priorityLoad?"none":"",t.inverterColour,Lt("common.priority_batt")))}static generateInverterProgram(t){return Q(vo||(vo=gt(['\n\t\t\t\n \n \n \n \n \n \n \n\t\t'])),(e=>Mn.handlePopup(e,t.inverterProg.entityID)),!1===t.inverterProg.show||"no"===t.enableTimer?"none":"","none"===t.inverterProg.charge||"off"!=t.stateUseTimer.state&&"on"!=t.stateUseTimer.state?"st12":"",t.inverterColour,Qn,!1===t.inverterProg.show||"no"===t.enableTimer?"none":"","none"!==t.inverterProg.charge||"off"!==t.stateUseTimer.state&&"on"!==t.stateUseTimer.state?"st12":"",t.inverterColour,Un)}static generateTemperatures(t,e){let n=e.inverter?.ac_icon?Nn.getIcon(178,218,e.inverter.ac_icon,"small_ac_dc_icon",16):Q(Ao||(Ao=gt(['\n\t\t\t\t\n AC:\n '])),t.inverterColour,e.entities?.radiator_temp_91&&t.stateRadiatorTemp.isValid()?"":"none"),a=e.inverter?.dc_icon?Nn.getIcon(178,230,e.inverter.dc_icon,"small_ac_dc_icon",16):Q(wo||(wo=gt(['\n\t\t\t\n DC:\n '])),t.inverterColour,e.entities?.dc_transformer_temp_90&&t.stateDCTransformerTemp.isValid()?"":"none");return Q(bo||(bo=gt(['\n \n ','°\n \n \n \n ',"°\n \n \n\t\t"])),(t=>Mn.handlePopup(t,e.entities.radiator_temp_91)),n,t.inverterColour,e.entities?.radiator_temp_91&&t.stateRadiatorTemp.isValid()?"":"none",t.stateRadiatorTemp.toStr(1,!1),(t=>Mn.handlePopup(t,e.entities.dc_transformer_temp_90)),a,t.inverterColour,e.entities?.dc_transformer_temp_90&&t.stateDCTransformerTemp.isValid()?"":"none",t.stateDCTransformerTemp.toStr(1,!1))}static buildGradientStops(t){let e=Q(xo||(xo=gt([''])));return t<2?(e=Q(Eo||(Eo=gt(["",''])),e),e):(e=t<=30?Q(Lo||(Lo=gt(["",''])),e,t):Q(Po||(Po=gt(["",''])),e),e=t<=40?Q(Mo||(Mo=gt(["",''])),e,t):Q(Co||(Co=gt(["",''])),e),e=t<=60?Q(No||(No=gt(["",''])),e,t):Q(zo||(zo=gt(["",''])),e),e=t<=90?Q(To||(To=gt(["",''])),e,t):Q(ko||(ko=gt(["",''])),e),t<=100?(e=Q(Oo||(Oo=gt(["",''])),e,t),Q(Do||(Do=gt(["",''])),e,t)):(e=Q(jo||(jo=gt(["",''])),e),e))}static generateInverterLoad(t,e){let n,a=yt.Sunsynk;if(!t.stateInverterLoadPercentage.isValid())return"";if(Object.values(yt).includes(e.inverter.model)&&(a=e.inverter.model),e.inverter.modern)return Q(_o||(_o=gt(['\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t ','\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t'])),this.buildGradientStops(t.stateInverterLoadPercentage.toNum(0)));switch(a){case yt.Azzurro:n=[213.5,179.5,51,67,3];break;case yt.Fronius:n=[213.5,179.5,51,73,10];break;case yt.Huawei:case yt.SolarEdge:n=[213.5,179.5,51,73,5];break;default:n=[213.5,179.5,51,73,2]}return Q(Ro||(Ro=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t ','\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t'])),n[0],n[1],n[2],n[3],this.buildGradientStops(t.stateInverterLoadPercentage.toNum(0)),n[2]-2,n[3]-2,n[4],n[4])}static generateInverterState(t,e){let n,a=yt.Sunsynk;if(Object.values(yt).includes(e.inverter.model)&&(a=e.inverter.model),e.inverter.modern)return Q(Go||(Go=gt(['\n\t\t\t\t\n\t\t\t\t\n\t \n\t ',"\n\t \n\t \n\t\t\t"])),t.inverterStateColour,t.inverterStateColour,e.entities.inverter_status_59&&t.inverterStateMsg?"":"none",(t=>Mn.handlePopup(t,e.entities.inverter_status_59)),e.entities.inverter_status_59&&t.inverterStateMsg?"":"none",t.inverterStateMsg);switch(a){case yt.Azzurro:n=[235,222,7,6,239,240];break;case yt.Deye:n=[233.5,205.5,12,6,239,225];break;case yt.Fronius:n=[222,230,11,9,239,246];break;case yt.Goodwe:case yt.GoodweGridMode:n=[222,236,31,3,239,225];break;case yt.Growatt:n=[250,224,11,6,239,247];break;case yt.EasunSMW8_SA:case yt.MPPSolar:n=[233,242,11,5,239,234];break;case yt.PowMr:n=[233,190,12,5,239,230];break;case yt.Sunsynk:n=[234,208,10,6,239,225];break;case yt.SolarEdge:n=[234,206,22,5,2,239,225];break;case yt.Sofar:n=[233,230,12,4,239,245];break;case yt.Solis:n=[249,198,8,17,239,232];break;case yt.Victron:n=[218,217,18,7.5,239,231];break;default:return Q(Bo||(Bo=gt(['\n\t\t\t\t\t\n\t\t\t\t'])),t.inverterStateColour)}return Q(So||(So=gt(['\n\t\t\t\n\t\t\t\n \n ',"\n \n \n\t\t"])),n[0],n[1],n[2],n[3],t.inverterStateColour,t.inverterStateColour,e.entities.inverter_status_59&&t.inverterStateMsg?"":"none",(t=>Mn.handlePopup(t,e.entities.inverter_status_59)),n[4],n[5],t.inverterStateColour,e.entities.inverter_status_59&&t.inverterStateMsg?"":"none",t.inverterStateMsg)}}class Lr{static getPositions(t,e){switch(t){case 1:switch(e){case 1:return 86;case 2:return 43;case 3:return 0}break;case 2:switch(e){case 2:return 86;case 3:return 43}break;case 3:return 86}return 0}static generateLoad1(t,e){const n=this.getPositions(1,e.grid.additional_loads);return Q(Io||(Io=gt(["",""])),t.nonessentialLoads>=1?Q(Ho||(Ho=gt(["\n\t\t\t\t",""])),Nn.generateGridLoad(1,t.iconNonessentialLoad1,t.dynamicColourNonEssentialLoad1,e.grid?.load1_name,t.stateNonessentialLoad1,t.stateNonEssentialLoad1Extra,t.stateNonEssentialLoad1Toggle,e.grid.auto_scale,t.decimalPlaces,n,Cn.row5,[11,0,20.5])):Q(Vo||(Vo=gt([""]))))}static generateLoad2(t,e){const n=this.getPositions(2,e.grid.additional_loads);return Q(Qo||(Qo=gt(["",""])),t.nonessentialLoads>=2?Q(Uo||(Uo=gt(["\n\t\t\t\t",""])),Nn.generateGridLoad(2,t.iconNonessentialLoad2,t.dynamicColourNonEssentialLoad2,e.grid?.load2_name,t.stateNonessentialLoad2,t.stateNonEssentialLoad2Extra,t.stateNonEssentialLoad2Toggle,e.grid.auto_scale,t.decimalPlaces,n,Cn.row5,[11,0,20.5])):Q(Wo||(Wo=gt([""]))))}static generateLoad3(t,e){const n=this.getPositions(3,e.grid.additional_loads);return Q(Zo||(Zo=gt(["",""])),t.nonessentialLoads>=3?Q(Yo||(Yo=gt(["\n\t\t\t\t",""])),Nn.generateGridLoad(3,t.iconNonessentialLoad3,t.dynamicColourNonEssentialLoad3,e.grid?.load3_name,t.stateNonessentialLoad3,t.stateNonEssentialLoad3Extra,t.stateNonEssentialLoad3Toggle,e.grid.auto_scale,t.decimalPlaces,n,Cn.row5,[11,0,20.5])):Q(Xo||(Xo=gt([""]))))}static getLines(t,e){switch(t){case 1:switch(e){case 1:return"M 109 328L 109 333";case 2:return"M 66 328 L 66 333";case 3:return"M 23 328 L 23 333"}break;case 2:switch(e){case 2:return"M 109 328L 109 333";case 3:return"M 66 328 L 66 333"}break;case 3:return"M 109 328L 109 333"}return""}static generateIcon(t){const e=Nn.getIconWithCondition(t.nonessentialLoads>=1,68,290,t.nonessentialIcon,"nes-load-icon",32);return Q(Fo||(Fo=gt(["",""])),e)}static generateLines(t,e){return Q(Jo||(Jo=gt(['\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t'])),this.getLines(1,e.grid.additional_loads),e.grid.additional_loads>=1?"":"st12",t.dynamicColourNonEssentialLoad1,this.getLines(2,e.grid.additional_loads),e.grid.additional_loads>=2?"":"st12",t.dynamicColourNonEssentialLoad2,this.getLines(3,e.grid.additional_loads),e.grid.additional_loads>=3?"":"st12",t.dynamicColourNonEssentialLoad3)}static generateFlowLine(t,e){const n=(()=>{switch(e.grid.additional_loads){case 1:return 109;case 2:return 66;case 3:return 23}})(),a="M ".concat(n," 328 L 135 328 Q 140 328 140 323 L 140 320");return Q(Ko||(Ko=gt(['\n\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t \n\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t'])),a,t.dynamicColourNonEssentialLoad,t.nonessLineWidth,Math.min(2+t.nonessLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.nonessentialLoads?"transparent":"".concat(t.dynamicColourNonEssentialLoad),t.durationCur.ne,t.dynamicColourNonEssentialLoad,t.nonessLineWidth,Math.min(2+t.nonessLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.nonessentialLoads?"transparent":"".concat(t.dynamicColourNonEssentialLoad),t.durationCur.ne)}static generateShapeAndName(t,e){return Q(qo||(qo=gt(['\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),t.dynamicColourNonEssentialLoad,0===t.nonessentialLoads?"none":"",t.dynamicColourNonEssentialLoad,e.grid.nonessential_name)}static generateTotalPower(t,e){return Q($o||($o=gt(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t"])),0===t.nonessentialLoads?"none":"",!0!==t.largeFont?"st14":"st4",t.dynamicColourNonEssentialLoad,e.grid.auto_scale?Mn.convertValue(t.nonessentialPower,t.decimalPlaces)||0:"".concat(t.nonessentialPower||0," ").concat(_t.WATT))}}class Pr{static generateShapes(t,e){const n=400+(Cn.LOAD_X-400)/2-101.3;return Q(tr||(tr=gt(['\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),n,t.auxDynamicColour,n+3,t.auxDynamicColour,e.load.aux_name)}static generateLines(t){let e=t.auxLineWidth;const n=400+(Cn.LOAD_X-400)/2-101.3;return Q(er||(er=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t'])),n,t.auxDynamicColour,e,Math.min(2+e+Math.max(t.minLineWidth-2,0),8),0==Math.round(t.auxPower)?"transparent":"".concat(t.auxDynamicColour),t.durationCur.aux,t.auxPower>0?"0;1":"1;0",n+70,n+70,n+70+27,n+70+27,n+70+27,n+70+27,n+70+27+5,Cn.column1+Cn.xGaps[1],t.auxDynamicColour,e,Math.min(2+e+Math.max(t.minLineWidth-2,0),8),0==Math.round(t.auxPower)?"transparent":"".concat(t.auxDynamicColour),2*t.durationCur.aux,t.auxPower>0?"0;1":"1;0")}static generateLoad1(t,e){return Q(nr||(nr=gt(["",""])),e.load.aux_loads>=1?Q(ar||(ar=gt(["\n\t\t\t\t",""])),Nn.generateAuxLoad(1,t.iconAuxLoad1,t.auxDynamicColourLoad1,e.load?.aux_load1_name,t.stateAuxLoad1,t.stateAuxLoad1Extra,t.stateAuxLoad1Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column1,Cn.rowAux)):Q(or||(or=gt([""]))))}static generateLoad2(t,e){return Q(rr||(rr=gt(["",""])),e.load.aux_loads>=2?Q(ir||(ir=gt(["\n\t\t\t\t",""])),Nn.generateAuxLoad(2,t.iconAuxLoad2,t.auxDynamicColourLoad2,e.load?.aux_load2_name,t.stateAuxLoad2,t.stateAuxLoad2Extra,t.stateAuxLoad2Toggle,e.load.auto_scale,t.decimalPlaces,Cn.column2,Cn.rowAux)):Q(sr||(sr=gt([""]))))}static generateTotalLoad(t,e){const n=400+(this.mainX-400)/2-65.3,a=e.grid.auto_scale?Mn.convertValue(t.auxPower,t.decimalPlaces)||0:"".concat(t.auxPower||0," ").concat(_t.WATT);return Q(lr||(lr=gt(["\n\t\t\t","\n\t\t"])),t.stateAuxPower.isValid()?Q(cr||(cr=gt(['\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t ',"\n\t\t\t\t\t\t\n\t\t\t\t\t"])),(t=>Mn.handlePopup(t,e.stateAuxPower.entity_id)),n,!0!==t.largeFont?"st14":"st4",t.auxDynamicColour,a):Q(dr||(dr=gt(['\n\t\t\t\t\t\n\t\t\t\t\t\t ',"\n\t\t\t\t\t"])),n,!0!==t.largeFont?"st14":"st4",t.auxDynamicColour,a))}static generateDailyLoad(t,e){return Q(ur||(ur=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),(t=>Mn.handlePopup(t,e.entities.day_load_energy_84)),this.mainX+10,t.showDailyAux&&t.stateDayAuxEnergy.isValid()?"":"none",t.auxDynamicColour,t.stateDayAuxEnergy?.toPowerString(!0,t.decimalPlacesEnergy),this.mainX+10,t.showDailyAux?"".concat(t.auxDynamicColour):"transparent",e.load?.aux_daily_name?e.load?.aux_daily_name:Lt("common.daily_aux"))}}Pr.mainX=Cn.LOAD_X;class Mr{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="gold";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="gold";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="gold";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 Kr(t){let e=null!==t?.state&&"unknown"!==t.state&&void 0!==t.state&&null!=t?.entity_id&&t.entity_id,n=""!==t?.state&&e;return{...t,toNum:(e,n)=>Mn.toNum(t?.state,e,n),toStr:(e,n,a)=>Mn.toNum(t?.state,e,n,a).toFixed(e),isValid:()=>e||!1,isValidSwitch:()=>e&&["on","off","On","Off","ON","OFF",0,1,!0,!1].includes(t?.state)||!1,notEmpty:()=>n||!1,isNaN:()=>null===t?.state||Number.isNaN(t?.state),toPower:e=>{const n=(t.attributes?.unit_of_measurement||"").toLowerCase();return"kw"===n||"kwh"===n?Mn.toNum(1e3*(t?.state||"0"),0,e):"mw"===n||"mwh"===n?Mn.toNum(1e6*(t?.state||"0"),0,e):Mn.toNum(t?.state||"0",0,e)||0},toPowerString:(e,n,a)=>e?Mn.convertValueNew(t?.state,t?.attributes?.unit_of_measurement,n):"".concat(Mn.toNum(t?.state,n,a).toFixed(n)," ").concat(t?.attributes?.unit_of_measurement||""),toString:()=>t?.state?.toString()||"",toOnOff:()=>["on","On","ON",1,!0].includes(t?.state)?"on":"off",getUOM:()=>t?.attributes?.unit_of_measurement||""}}console.groupCollapsed("%c ⚡ POWER-FLOW-CARD by Molikk %c ".concat(Lt("common.version"),": ").concat("0.10.2"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/molikk/mlk-power-flow-card"),console.groupEnd();let qr=class extends it{constructor(){super(...arguments),this.GREY_COLOUR="grey",this.durationPrev={},this.durationCur={}}static get styles(){return mt}static async getConfigElement(){return await Promise.resolve().then((function(){return li})),document.createElement(jt)}static getStubConfig(){return{show_solar:!0,battery:{energy:0,shutdown_soc:20,show_daily:!0},solar:{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 t=this._config,e=this.getEntity("entities.day_battery_discharge_71"),n=this.getEntity("entities.day_battery_charge_70"),a=this.getEntity("entities.day_load_energy_84"),o=this.getEntity("entities.day_grid_import_76"),r=this.getEntity("entities.day_grid_export_77"),i=this.getEntity("entities.day_aux_energy"),s=this.getEntity("entities.load_frequency_192"),l=this.getEntity("entities.inverter_status_59",{state:""}),c=this.getEntity("entities.inverter_power_175"),d=this.getEntity("entities.priority_load_243",{state:t.entities.priority_load_243?.toString()??"false"}),u=this.getEntity("entities.use_timer_248",{state:t.entities.use_timer_248?.toString()??"false"}),h=this.getEntity("entities.dc_transformer_temp_90",{state:""}),g=this.getEntity("entities.radiator_temp_91",{state:""}),f=this.getEntity("entities.inverter_voltage_154"),m=this.getEntity("entities.inverter_voltage_L2",{state:""}),y=this.getEntity("entities.inverter_voltage_L3",{state:""}),p=this.getEntity("entities.inverter_current_164"),v=this.getEntity("entities.inverter_current_L2",{state:""}),A=this.getEntity("entities.inverter_current_L3",{state:""}),w=this.getEntity("entities.environment_temp",{state:""}),b=this.getEntity("entities.inverter_load_percentage"),x=this.getEntity("entities.battery_voltage_183"),E=this.getEntity("entities.battery_soc_184"),L=this.getEntity("entities.battery_power_190"),P=this.getEntity("entities.battery_current_191"),M=this.getEntity("entities.battery_temp_182",{state:""}),C=this.getEntity("entities.battery_status",{state:""}),N=this.getEntity("entities.battery_current_direction",{state:""}),z=this.getEntity("entities.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()??""}),O=this.getEntity("entities.battery_soh",{state:""}),j=this.getEntity("entities.essential_power"),D=this.getEntity("entities.aux_power_166"),_=this.getEntity("entities.nonessential_power"),R=this.getEntity("entities.non_essential_load1"),G=this.getEntity("entities.non_essential_load2"),B=this.getEntity("entities.non_essential_load3"),S=this.getEntity("entities.non_essential_load1_extra"),I=this.getEntity("entities.non_essential_load2_extra"),H=this.getEntity("entities.non_essential_load3_extra"),U=this.getEntity("entities.non_essential_load1_toggle"),W=this.getEntity("entities.non_essential_load2_toggle"),Z=this.getEntity("entities.non_essential_load3_toggle"),Y=this.getEntity("entities.essential_load1"),X=this.getEntity("entities.essential_load2"),F=this.getEntity("entities.essential_load3"),J=this.getEntity("entities.essential_load4"),K=this.getEntity("entities.essential_load5"),q=this.getEntity("entities.essential_load6"),$=this.getEntity("entities.essential_load7"),tt=this.getEntity("entities.essential_load8"),et=this.getEntity("entities.essential_load9"),nt=this.getEntity("entities.essential_load10"),at=this.getEntity("entities.essential_load11"),ot=this.getEntity("entities.essential_load12"),rt=this.getEntity("entities.essential_load13"),it=this.getEntity("entities.essential_load14"),st=this.getEntity("entities.essential_load15"),lt=this.getEntity("entities.essential_load16"),ct=this.getEntity("entities.essential_load17"),dt=this.getEntity("entities.essential_load18"),ut=this.getEntity("entities.essential_load1_extra"),ht=this.getEntity("entities.essential_load2_extra"),ft=this.getEntity("entities.essential_load3_extra"),mt=this.getEntity("entities.essential_load4_extra"),pt=this.getEntity("entities.essential_load5_extra"),vt=this.getEntity("entities.essential_load6_extra"),At=this.getEntity("entities.essential_load7_extra"),wt=this.getEntity("entities.essential_load8_extra"),bt=this.getEntity("entities.essential_load9_extra"),Et=this.getEntity("entities.essential_load10_extra"),Pt=this.getEntity("entities.essential_load11_extra"),jt=this.getEntity("entities.essential_load12_extra"),Dt=this.getEntity("entities.essential_load13_extra"),_t=this.getEntity("entities.essential_load14_extra"),Rt=this.getEntity("entities.essential_load15_extra"),Gt=this.getEntity("entities.essential_load16_extra"),Bt=this.getEntity("entities.essential_load17_extra"),St=this.getEntity("entities.essential_load18_extra"),It=this.getEntity("entities.essential_load1_toggle"),Ht=this.getEntity("entities.essential_load2_toggle"),Vt=this.getEntity("entities.essential_load3_toggle"),Qt=this.getEntity("entities.essential_load4_toggle"),Ut=this.getEntity("entities.essential_load5_toggle"),Wt=this.getEntity("entities.essential_load6_toggle"),Zt=this.getEntity("entities.essential_load7_toggle"),Yt=this.getEntity("entities.essential_load8_toggle"),Xt=this.getEntity("entities.essential_load9_toggle"),Ft=this.getEntity("entities.essential_load10_toggle"),Jt=this.getEntity("entities.essential_load11_toggle"),Kt=this.getEntity("entities.essential_load12_toggle"),qt=this.getEntity("entities.essential_load13_toggle"),$t=this.getEntity("entities.essential_load14_toggle"),te=this.getEntity("entities.essential_load15_toggle"),ee=this.getEntity("entities.essential_load16_toggle"),ne=this.getEntity("entities.essential_load17_toggle"),ae=this.getEntity("entities.essential_load18_toggle"),oe=this.getEntity("entities.load_power_L1"),re=this.getEntity("entities.load_power_L2"),ie=this.getEntity("entities.load_power_L3"),se=this.getEntity("entities.aux_load1"),le=this.getEntity("entities.aux_load2"),ce=this.getEntity("entities.aux_load1_extra"),de=this.getEntity("entities.aux_load2_extra"),ue=this.getEntity("entities.aux_load1_toggle"),he=this.getEntity("entities.aux_load2_toggle"),ge=this.getEntity("entities.grid_frequency"),fe=this.getEntity("entities.grid_ct_power_172"),me=this.getEntity("entities.grid_ct_power_L2"),ye=this.getEntity("entities.grid_ct_power_L3"),pe=this.getEntity("entities.grid_voltage_L1"),ve=this.getEntity("entities.grid_voltage_L2"),Ae=this.getEntity("entities.grid_voltage_L3"),we=this.getEntity("entities.grid_current_L1"),be=this.getEntity("entities.grid_current_L2"),xe=this.getEntity("entities.grid_current_L3"),Ee=this.getEntity("entities.grid_ct_power_total"),Le=this.getEntity("entities.grid_connected_status_194",{state:"on"}),Pe=this.getEntity("entities.grid_power_169"),Me=this.getEntity("entities.energy_cost_buy",{state:"",attributes:{unit_of_measurement:""}}),Ce=this.getEntity("entities.energy_cost_sell",{state:"",attributes:{unit_of_measurement:""}}),Ne=this.getEntity("entities.grid_voltage",null),ze=this.getEntity("entities.prepaid_units"),Te=this.getEntity("entities.max_sell_power"),ke=this.getEntity("entities.pv1_voltage_109"),Oe=this.getEntity("entities.pv1_current_110"),je=this.getEntity("entities.pv2_voltage_111"),De=this.getEntity("entities.pv2_current_112"),_e=this.getEntity("entities.pv3_voltage_113"),Re=this.getEntity("entities.pv3_current_114"),Ge=this.getEntity("entities.pv4_voltage_115"),Be=this.getEntity("entities.pv4_current_116"),Se=this.getEntity("entities.pv5_voltage"),Ie=this.getEntity("entities.pv5_current"),He=this.getEntity("entities.pv1_power_186"),Ve=this.getEntity("entities.pv2_power_187"),Qe=this.getEntity("entities.pv3_power_188"),Ue=this.getEntity("entities.pv4_power_189"),We=this.getEntity("entities.pv5_power"),Ze=this.getEntity("entities.pv1_production"),Ye=this.getEntity("entities.pv2_production"),Xe=this.getEntity("entities.pv3_production"),Fe=this.getEntity("entities.pv4_production"),Je=this.getEntity("entities.pv5_production"),Ke=this.getEntity("entities.solar_sell_247",{state:"undefined"}),qe=this.getEntity("entities.pv_total"),$e=this.getEntity("entities.day_pv_energy_108"),tn=this.getEntity("entities.monthly_pv_generation"),en=this.getEntity("entities.yearly_pv_generation"),nn=this.getEntity("entities.total_pv_generation"),an=this.getEntity("entities.remaining_solar"),on=this.getEntity("entities.tomorrow_solar"),{invert_aux:rn}=t.load,sn=D?.isValid()?D.toPower(rn):(se?.toPower(rn)||0)+(le?.toPower(rn)||0),{invert_grid:ln}=t.grid,cn=fe.toPower(ln),dn=me.toPower(ln),un=ye.toPower(ln),hn=t.entities?.grid_ct_power_total?Ee.toPower(ln):cn+dn+un,gn=t.inverter.three_phase?hn:cn,fn=Ne.isNaN()?null:Ne.toNum(0),mn=N.isNaN()?null:N.toNum(0),yn=t.inverter?.modern,pn=t.decimal_places,vn=t.decimal_places_energy,An=this.colourConvert(t.load?.colour),wn=this.calculateEssentialLoadColour(Y,It,t.load?.off_threshold)||An,bn=this.calculateEssentialLoadColour(X,Ht,t.load?.off_threshold)||An,xn=this.calculateEssentialLoadColour(F,Vt,t.load?.off_threshold)||An,En=this.calculateEssentialLoadColour(J,Qt,t.load?.off_threshold)||An,Ln=this.calculateEssentialLoadColour(K,Ut,t.load?.off_threshold)||An,Pn=this.calculateEssentialLoadColour(q,Wt,t.load?.off_threshold)||An,Nn=this.calculateEssentialLoadColour($,Zt,t.load?.off_threshold)||An,Rn=this.calculateEssentialLoadColour(tt,Yt,t.load?.off_threshold)||An,Gn=this.calculateEssentialLoadColour(et,Xt,t.load?.off_threshold)||An,Bn=this.calculateEssentialLoadColour(nt,Ft,t.load?.off_threshold)||An,Sn=this.calculateEssentialLoadColour(at,Jt,t.load?.off_threshold)||An,In=this.calculateEssentialLoadColour(ot,Kt,t.load?.off_threshold)||An,Hn=this.calculateEssentialLoadColour(rt,qt,t.load?.off_threshold)||An,Vn=this.calculateEssentialLoadColour(it,$t,t.load?.off_threshold)||An,Qn=this.calculateEssentialLoadColour(st,te,t.load?.off_threshold)||An,Un=this.calculateEssentialLoadColour(lt,ee,t.load?.off_threshold)||An,Wn=this.calculateEssentialLoadColour(ct,ne,t.load?.off_threshold)||An,Zn=this.calculateEssentialLoadColour(dt,ae,t.load?.off_threshold)||An;t.title_colour=this.colourConvert(t.title_colour);const Yn=t.load?.show_daily,Xn=t.grid?.show_nonessential;let Fn=t.entities?.grid_connected_status_194?Le.state:"on";Ot.includes(Fn.toLowerCase())||kt.includes(Fn.toLowerCase())||(Fn="on");const Jn=t.entities?.battery_voltage_183?x.toNum(1):0,Kn=t.entities?.inverter_power_175?c.toPower():0,qn=t.entities?.grid_power_169?Pe.toPower():hn,{invert_load:$n}=t.load,ta=t.entities?.load_power_L1?oe.toPower($n):"",ea=t.entities?.load_power_L2?re.toPower($n):"",na=t.entities?.load_power_L3?ie.toPower($n):"",aa=this.colourConvert(t.grid?.colour),oa=this.colourConvert(t.grid?.export_colour||aa),ra=this.colourConvert(t.grid?.no_grid_colour||aa);let ia;switch(!0){case gn<0:ia=oa;break;case gn>=0&&gn<=Mn.toNum(t.grid?.off_threshold,0):ia=ra;break;default:ia=aa}const sa=Math.abs(R.toPower(!1)+G.toPower(!1)+B.toPower(!1))>Mn.toNum(t.grid?.off_threshold,0)?R.toPower(!1)+G.toPower(!1)+B.toPower(!1)>0?aa:oa:this.GREY_COLOUR,la=this.getDynamicColorWithToggle(R,U,t.grid?.off_threshold,aa,oa),ca=this.getDynamicColorWithToggle(G,W,t.grid?.off_threshold,aa,oa),da=this.getDynamicColorWithToggle(B,Z,t.grid?.off_threshold,aa,oa),ua=this.colourConvert(t.grid?.grid_off_colour||ia),ha=this.colourConvert(t.load?.aux_colour),ga=this.colourConvert(t.load?.aux_off_colour||this.GREY_COLOUR),fa=this.calculateAuxLoadColour(se,ue,t.load?.off_threshold)||ha,ma=this.calculateAuxLoadColour(le,he,t.load?.off_threshold)||ha;let ya=ga;ya=fa!=ga?fa:ya,ya=ma!=ga?ma:ya,ya=D.isValid()&&Math.abs(D.toPower())>Mn.toNum(t.load?.off_threshold,0)?ha:ya;let pa=t.grid?.additional_loads;Ct.includes(pa)||(pa=0);const va=t.grid?.show_daily_buy,Aa=t.grid?.show_daily_sell,wa=this.colourConvert(t.battery?.colour),ba=this.colourConvert(t.battery?.charge_colour||wa),xa=t.battery?.show_daily;let Ea=t.load?.show_aux;zt.includes(Ea)||(Ea=!1);const La=t.load?.show_daily_aux;let Pa=t.load?.additional_loads;Mt.includes(Pa)||(Pa=0);let Ma=t.load?.aux_loads;Tt.includes(Ma)||(Ma=0);const Ca=t.load?.aux_type,Na=this.getEntity("load.load1_icon",{state:t.load?.load1_icon?.toString()??""}).state,za=this.getEntity("load.load2_icon",{state:t.load?.load2_icon?.toString()??""}).state,Ta=this.getEntity("load.load3_icon",{state:t.load?.load3_icon?.toString()??""}).state,ka=this.getEntity("load.load4_icon",{state:t.load?.load4_icon?.toString()??""}).state,Oa=this.getEntity("load.load5_icon",{state:t.load?.load5_icon?.toString()??""}).state,ja=this.getEntity("load.load6_icon",{state:t.load?.load6_icon?.toString()??""}).state,Da=this.getEntity("load.load7_icon",{state:t.load?.load7_icon?.toString()??""}).state,_a=this.getEntity("load.load8_icon",{state:t.load?.load8_icon?.toString()??""}).state,Ra=this.getEntity("load.load9_icon",{state:t.load?.load9_icon?.toString()??""}).state,Ga=this.getEntity("load.load10_icon",{state:t.load?.load10_icon?.toString()??""}).state,Ba=this.getEntity("load.load11_icon",{state:t.load?.load11_icon?.toString()??""}).state,Sa=this.getEntity("load.load12_icon",{state:t.load?.load12_icon?.toString()??""}).state,Ia=this.getEntity("load.load13_icon",{state:t.load?.load13_icon?.toString()??""}).state,Ha=this.getEntity("load.load14_icon",{state:t.load?.load14_icon?.toString()??""}).state,Va=this.getEntity("load.load15_icon",{state:t.load?.load15_icon?.toString()??""}).state,Qa=this.getEntity("load.load16_icon",{state:t.load?.load16_icon?.toString()??""}).state,Ua=this.getEntity("load.load17_icon",{state:t.load?.load17_icon?.toString()??""}).state,Wa=this.getEntity("load.load18_icon",{state:t.load?.load18_icon?.toString()??""}).state,Za=this.getEntity("load.aux_load1_icon",{state:t.load?.aux_load1_icon?.toString()??""}).state,Ya=this.getEntity("load.aux_load2_icon",{state:t.load?.aux_load2_icon?.toString()??""}).state,Xa=this.getEntity("grid.nonessential_icon",{state:t.grid?.nonessential_icon?.toString()??""}).state,Fa=this.getEntity("grid.load1_icon",{state:t.grid?.load1_icon?.toString()??""}).state,Ja=this.getEntity("grid.load2_icon",{state:t.grid?.load2_icon?.toString()??""}).state,Ka=this.getEntity("grid.load3_icon",{state:t.grid?.load3_icon?.toString()??""}).state,qa=this.getEntity("grid.import_icon",{state:t.grid?.import_icon?.toString()??""}).state,$a=this.getEntity("grid.disconnected_icon",{state:t.grid?.disconnected_icon?.toString()??""}).state,to=this.getEntity("grid.export_icon",{state:t.grid?.export_icon?.toString()??""}).state,eo=t.large_font,no=t.panel_mode,ao=this.colourConvert(t.inverter?.colour),oo=t.inverter?.autarky,ro=!!t.entities.use_timer_248&&u.state,io=!!t.entities.priority_load_243&&d.state;let so=L.toPower(t.battery?.invert_power);const lo=this.getEntity("card_height",{state:t.card_height?.toString()??""}).state,co=this.getEntity("card_width",{state:t.card_width?.toString()??""}).state,uo=0===t.grid?.energy_cost_decimals?0:t.grid?.energy_cost_decimals||2,ho=gn>=0?Me.toNum(uo):Ce.toNum(uo);let go=yt.Sunsynk;Object.values(yt).includes(t.inverter.model)&&(go=t.inverter.model);let fo="";const mo=Fr.getInstance(go);yn||(fo=mo.image);const yo=He.toPower(),po=Ve.toPower(),vo=Qe.toPower(),Ao=Ue.toPower(),wo=We.toPower(),bo=yo+po+vo+Ao+wo,xo=t.entities?.pv_total?qe.toNum():bo,Eo=t.solar.dynamic_colour?Mn.toNum(xo,0)>Mn.toNum(t.solar?.off_threshold,0)?this.colourConvert(t.solar?.colour):this.GREY_COLOUR:this.colourConvert(t.solar?.colour);let Lo,Po,Mo=t.inverter?.three_phase;Nt.includes(Mo)||(Mo=!1);const{essential_power:Co,nonessential_power:No}=t.entities;Po=t.entities?.grid_power_169?!1===Mo?"none"!==No&&No?_.toPower():cn-qn:"none"!==No&&No?_.toPower():cn+dn+un-qn:R.toPower()+G.toPower()+B.toPower(),Lo="none"!==Co&&Co?j.toPower($n):!0===Mo&&t.entities.load_power_L1&&t.entities.load_power_L2&&t.entities.load_power_L3?Number(ta)+Number(ea)+Number(na):t.entities.inverter_power_175?Kn+qn-sn:xo+so+qn-sn;const zo={time:this.getEntity("entities.prog1_time",{state:t.entities.prog1_time??""}),capacity:this.getEntity("entities.prog1_capacity",{state:t.entities.prog1_capacity??""}),charge:this.getEntity("entities.prog1_charge",{state:t.entities.prog1_charge??""})},To={time:this.getEntity("entities.prog2_time",{state:t.entities.prog2_time??""}),capacity:this.getEntity("entities.prog2_capacity",{state:t.entities.prog2_capacity??""}),charge:this.getEntity("entities.prog2_charge",{state:t.entities.prog2_charge??""})},ko={time:this.getEntity("entities.prog3_time",{state:t.entities.prog3_time??""}),capacity:this.getEntity("entities.prog3_capacity",{state:t.entities.prog3_capacity??""}),charge:this.getEntity("entities.prog3_charge",{state:t.entities.prog3_charge??""})},Oo={time:this.getEntity("entities.prog4_time",{state:t.entities.prog4_time??""}),capacity:this.getEntity("entities.prog4_capacity",{state:t.entities.prog4_capacity??""}),charge:this.getEntity("entities.prog4_charge",{state:t.entities.prog4_charge??""})},jo={time:this.getEntity("entities.prog5_time",{state:t.entities.prog5_time??""}),capacity:this.getEntity("entities.prog5_capacity",{state:t.entities.prog5_capacity??""}),charge:this.getEntity("entities.prog5_charge",{state:t.entities.prog5_charge??""})},Do={time:this.getEntity("entities.prog6_time",{state:t.entities.prog6_time??""}),capacity:this.getEntity("entities.prog6_capacity",{state:t.entities.prog6_capacity??""}),charge:this.getEntity("entities.prog6_charge",{state:t.entities.prog6_charge??""})},_o=k.toNum(),Ro=T.toNum(),Go={capacity:Ro,entityID:""};switch(!0){case"off"===u.state:case!ro:case!t.entities.prog1_time:case!t.entities.prog2_time:case!t.entities.prog3_time:case!t.entities.prog4_time:case!t.entities.prog5_time:case!t.entities.prog6_time:Go.show=!1;break;default:Go.show=!0;const Mi=new Date,Ci=[];[zo,To,ko,Oo,jo,Do].forEach(((t,e)=>{const[n,a]=t.time.state.split(":").map((t=>parseInt(t,10)));Ci[e]=new Date(Mi.getTime()),Ci[e].setHours(n),Ci[e].setMinutes(a)}));const[Ni,zi,Ti,ki,Oi,ji]=Ci;function Di(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Go.charge="none":Go.charge="both",Go.capacity=parseInt(t.capacity.state),Go.entityID=e}Mi>=ji||Mi=Ni&&Mi=zi&&Mi=Ti&&Mi=ki&&Mi=Oi&&Mi50?"on":"off"),null!=mn&&go==yt.Solis&&0===mn&&(so=-so);let Bo=0;if(t.show_battery)if(!0==!Go.show)so>0?Bo="on"!==Fn&&"1"!==Fn&&"on-grid"!==Fn.toLowerCase()||Go.show?"off"!==Fn&&"0"!==Fn&&"off-grid"!==Fn.toLowerCase()||!k.notEmpty()||Go.show?Ro:_o:Ro:so<0&&(Bo=100);else Bo=mo.getBatteryCapacity(so,Fn,Ro,Go,E);let So=0,Io="",Ho="";let Vo=this.getEntity("battery.energy",{state:t.battery.energy?.toString()??""}).toPower(!1);if(Jn&&z.notEmpty()&&(Vo=Mn.toNum(Jn*z.toNum(0),0)),t.show_battery||0!==Vo){0===so?So=(E.toNum()-Ro)/100*Vo*60*60:so>0?So=(E.toNum()-Bo)/100*Vo/so*60*60:so<0&&(So=(Bo-E.toNum(0))/100*Vo/so*60*60*-1);const _i=new Date,Ri=1e3*So,Gi=new Date(_i.getTime()+Ri),Bi=Gi.getHours(),Si=Gi.getMinutes().toString().padStart(2,"0"),Ii=Bi.toString().padStart(2,"0");Io="".concat(Ii,":").concat(Si);const Hi=Math.floor(So/86400),Vi=Math.floor(So%86400/3600),Qi=Math.floor(So%3600/60);if(Hi>0&&(Ho+="".concat(Hi).concat(Lt("common.days")," ")),Vi>0){const Ui=Hi>0&&Vi<10?"0".concat(Vi):"".concat(Vi);Ho+="".concat(Ui).concat(Lt("common.hrs")," ")}Ho+="".concat(Qi).concat(Lt("common.min"))}const Qo=-2<=P.toNum(0)&&P.toNum(0)<=2&&E.toNum(0)>=99;let Uo;Uo=so<0&&!Qo?ba:wa;let Wo="",Zo="",Yo=l.state,Xo=!1;go==yt.Solis&&(Yo=l.isNaN()?l.toString():l.toNum(0).toString());const Fo=mo.statusGroups;if(Fo)for(const Wi of Object.keys(Fo)){const Zi=Fo[Wi],{states:Yi,color:Xi,message:Fi}=Zi;if(Yi.includes(Yo.toLowerCase())){Wo=Xi,Zo=Fi,Xo=!0;break}}Xo||("none"!==t.entities?.inverter_status_59&&t.entities?.inverter_status_59?(Wo="transparent",Zo="Status"):(Wo="transparent",Zo=""));let Jo="transparent",Ko="";if([yt.GoodweGridMode,yt.Goodwe,yt.Huawei].includes(go)){const Ji=mo.batteryStatusGroups;if(Ji)for(const Ki of Object.keys(Ji)){const qi=Ji[Ki],{states:$i,color:ts,message:es}=qi;if($i.includes(C.state.toLowerCase())){Jo=ts,Ko=es,Xo=!0;break}}Xo||("none"!==t.entities?.battery_status&&t.entities?.battery_status?(Jo="transparent",Ko="Status"):(Jo="transparent",Ko=""))}const qo=$e.toNum()+e.toNum(),$o=a.toNum()+n.toNum(),tr=0!=$o?Math.max(Math.min(Math.round(100*qo/$o),100),0):0,er=0!=qo?Math.max(Math.min(Math.round(100*$o/qo),100),0):0,nr=xo+Mn.toNum("".concat(so>0?so:0))+Mn.toNum("".concat(sn<0?-1*sn:0)),ar=Lo+Math.max(Po,0)+Mn.toNum("".concat(sn>0?sn:0))+Mn.toNum("".concat(so<0?-1*so:0)),or=0!=ar?Math.max(Math.min(Math.round(100*nr/ar),100),0):0,rr=0!=nr?Math.max(Math.min(Math.round(100*ar/nr),100),0):0,ir=(Mn.toNum(t.max_line_width)<1?1:t.max_line_width)-1,sr=Mn.toNum(t.min_line_width)||1,lr=$e.toNum()+e.toNum()+o.toNum(),cr=0!=qo?Math.max(Math.min(Math.round(1e3*$o/qo)/10,100),0):0,dr=0!=lr?Math.max(Math.min(Math.round(1e3*qo/lr)/10,100),0):0,ur=this.getEntity("battery.max_power",{state:t.battery.max_power?.toString()??""}),Mr=this.getEntity("solar.max_power",{state:t.solar.max_power?.toString()??""}),Cr=this.getEntity("load.max_power",{state:t.load.max_power?.toString()??""}),Nr=this.getEntity("grid.max_power",{state:t.grid.max_power?.toString()??""}),zr=t.solar.max_power?this.dynamicLineWidth(yo,Mr.toNum()||yo,ir,sr):sr,Tr=t.solar.max_power?this.dynamicLineWidth(po,Mr.toNum()||po,ir,sr):sr,kr=t.solar.max_power?this.dynamicLineWidth(vo,Mr.toNum()||vo,ir,sr):sr,Or=t.solar.max_power?this.dynamicLineWidth(Ao,Mr.toNum()||Ao,ir,sr):sr,jr=t.solar.max_power?this.dynamicLineWidth(wo,Mr.toNum()||wo,ir,sr):sr,Dr=t.battery.max_power?this.dynamicLineWidth(Math.abs(so),ur.toNum(0)||Math.abs(so),ir,sr):sr,_r=t.load.max_power?this.dynamicLineWidth(Math.abs(Lo),Cr.toNum()||Math.abs(Lo),ir,sr):sr,Rr=t.load.max_power?this.dynamicLineWidth(Math.abs(sn),Cr.toNum()||Math.abs(sn),ir,sr):sr,Gr=t.grid.max_power?this.dynamicLineWidth(Math.abs(gn),Nr.toNum()||Math.abs(gn),ir,sr):sr,Br=t.grid.max_power?this.dynamicLineWidth(Math.abs(qn),Nr.toNum()||Math.abs(qn),ir,sr):sr,Sr=t.grid.max_power?this.dynamicLineWidth(Math.abs(Po),Nr.toNum()||Math.abs(Po),ir,sr):sr,Ir=t.solar.max_power?this.dynamicLineWidth(xo,Mr.toNum()||xo,ir,sr):sr;if(t&&t.solar&&t.solar.animation_speed){const ns=t.solar.animation_speed-(t.solar.animation_speed-1)*(xo/(Mr.toNum()||xo));this.changeAnimationSpeed("solar",ns)}if(t&&t.solar&&t.solar.animation_speed){const as=t.solar.animation_speed-(t.solar.animation_speed-1)*(yo/(Mr.toNum()||yo));this.changeAnimationSpeed("pv1",as)}if(t&&t.solar&&t.solar.animation_speed){const os=t.solar.animation_speed-(t.solar.animation_speed-1)*(po/(Mr.toNum()||po));this.changeAnimationSpeed("pv2",os)}if(t&&t.solar&&t.solar.animation_speed){const rs=t.solar.animation_speed-(t.solar.animation_speed-1)*(vo/(Mr.toNum()||vo));this.changeAnimationSpeed("pv3",rs)}if(t&&t.solar&&t.solar.animation_speed){const is=t.solar.animation_speed-(t.solar.animation_speed-1)*(Ao/(Mr.toNum()||Ao));this.changeAnimationSpeed("pv4",is)}if(t&&t.solar&&t.solar.animation_speed){const ss=t.solar.animation_speed-(t.solar.animation_speed-1)*(wo/(Mr.toNum()||wo));this.changeAnimationSpeed("pv5",ss)}if(t&&t.battery&&t.battery.animation_speed){const ls=t.battery.animation_speed-(t.battery.animation_speed-1)*(Math.abs(so)/(ur.toNum(0)||Math.abs(so)));this.changeAnimationSpeed("battery",ls)}if(t&&t.load&&t.load.animation_speed){const cs=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(Lo)/(Cr.toNum()||Math.abs(Lo)));this.changeAnimationSpeed("load",cs),this.changeAnimationSpeed("load1",cs)}if(t&&t.load&&t.load.animation_speed){const ds=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(sn)/(Cr.toNum()||Math.abs(sn)));this.changeAnimationSpeed("aux",ds),this.changeAnimationSpeed("aux1",ds)}if(t&&t.grid&&t.grid.animation_speed){const us=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(gn)/(Nr.toNum()||Math.abs(gn)));this.changeAnimationSpeed("grid1",us),this.changeAnimationSpeed("grid",us),this.changeAnimationSpeed("grid2",us)}if(t&&t.grid&&t.grid.animation_speed){const hs=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(Po)/(Nr.toNum()||Math.abs(Po)));this.changeAnimationSpeed("ne",hs)}const Hr=0===xo?0:"off"!==io&&io||so>0?xo/(Mo?Lo+Math.max(sn,0):Lo)*100:(xo-Math.abs(so))/(Mo?Lo+Math.max(sn,0):Lo)*100,Vr=so<=0?0:Math.abs(so)/(Mo?Lo+Math.max(sn,0):Lo)*100,Qr=Hr+Vr,Ur=0===Qr?0:Hr/Qr*100,Wr=0===Qr?0:Vr/Qr*100;let Zr,Yr,Xr=0;Qr>=100||0==gn?(Zr=Mn.toNum(Ur,0),Yr=Mn.toNum(Wr,0)):(Zr=Mn.toNum(Math.min(Hr,100),0),Yr=Mn.toNum(Math.min(Vr,100),0),Xr=100-(Zr+Yr));const Kr=0===xo||so>=0?0:"off"!==io&&io?(xo-Lo)/Math.abs(so)*100:xo/Math.abs(so)*100,qr=so>=0||gn<=0?0:"on"===io?xo-Lo>=Math.abs(so)?0:(gn-Math.max(Lo-xo,0))/Math.abs(so)*100:xo>=Math.abs(so)?0:(Math.abs(so)-xo)/Math.abs(so)*100,$r=Kr+qr,ti=0===$r?0:Kr/$r*100,ei=0===$r?0:qr/$r*100;let ni,ai,oi,ri,ii,si,li;switch($r>=100||0==gn?(ni=Mn.toNum(ti,0),ai=Mn.toNum(ei,0)):(ni=Mn.toNum(Math.min(Kr,100),0),ai=Mn.toNum(Math.min(qr,100),0)),!0){case ni>=Mn.toNum(t.battery?.path_threshold,0):oi=Eo;break;case ai>=Mn.toNum(t.battery?.path_threshold,0):oi=ia;break;default:oi=Uo}switch(!0){case Zr>=Mn.toNum(t.load?.path_threshold,0):ri=Eo;break;case Yr>=Mn.toNum(t.load?.path_threshold,0):ri=Uo;break;case Xr>=Mn.toNum(t.load?.path_threshold,0):ri=ia;break;default:ri=An}switch(!0){case Zr>=Mn.toNum(t.load?.path_threshold,0):ii=Eo;break;case Yr>=Mn.toNum(t.load?.path_threshold,0):ii=Uo;break;case Xr>=Mn.toNum(t.load?.path_threshold,0):case ai>=Mn.toNum(t.battery?.path_threshold,0):ii=ia;break;default:ii=ao}switch(!0){case Hr>=100&&Vr<=5&&gn-Po<50&&t.load.dynamic_icon:si=_n,li=1;break;case Vr>=100&&Hr<=5&&gn-Po<50&&t.load.dynamic_icon:si=jn,li=0;break;case Hr<5&&Vr<5&&Xr>0&&t.load.dynamic_icon:si=Dn,li=0;break;default:si=On,li=0}const{batteryIcon:ci,batteryCharge:di,stopColour:ui,battery0:hi}=Jr.convert(E),gi=this.getEntity("solar.pv1_max_power",{state:t.solar.pv1_max_power?.toString()??""}),fi=this.getEntity("solar.pv2_max_power",{state:t.solar.pv2_max_power?.toString()??""}),mi=this.getEntity("solar.pv3_max_power",{state:t.solar.pv3_max_power?.toString()??""}),yi=this.getEntity("solar.pv4_max_power",{state:t.solar.pv4_max_power?.toString()??""}),pi=this.getEntity("solar.pv5_max_power",{state:t.solar.pv5_max_power?.toString()??""}),vi=t.solar.max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Mn.toNum(Math.min(xo/Mr.toNum()*100,200),0):100,Ai=t.solar.pv1_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Mn.toNum(Math.min(yo/gi.toNum()*100,200),0):100,wi=t.solar.pv2_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Mn.toNum(Math.min(po/fi.toNum()*100,200),0):100,bi=t.solar.pv3_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Mn.toNum(Math.min(vo/mi.toNum()*100,200),0):100,xi=t.solar.pv4_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Mn.toNum(Math.min(Ao/yi.toNum()*100,200),0):100,Ei=t.solar.pv5_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Mn.toNum(Math.min(wo/pi.toNum()*100,200),0):100;let Li,Pi;switch(!0){case gn<0&&Ot.includes(Fn.toLowerCase()):Li=to,Pi=ia;break;case gn>=0&&Ot.includes(Fn.toLowerCase()):Li=qa,Pi=ia;break;case 0===gn&&kt.includes(Fn.toLowerCase()):Li=$a,Pi=ua;break;default:Li=qa,Pi=ia}return((t,e,n)=>{wr.solarColour=n.solarColour,wr.decimalPlacesEnergy=n.decimalPlacesEnergy,wr.decimalPlaces=n.decimalPlaces,xr.gridColour=n.gridColour,xr.decimalPlaces=n.decimalPlaces;let a=t.viewbox?.viewbox_min_x?t.viewbox.viewbox_min_x:0,o=t.viewbox?.viewbox_min_y?t.viewbox.viewbox_min_y:t.show_solar||n.additionalLoad>6?0:n.additionalLoad>0||!t.show_battery?80:146,r=t.viewbox?.viewbox_width?t.viewbox.viewbox_width:t.load.aux_loads>3||n.additionalLoad>13?600:t.load.aux_loads>2||n.additionalLoad>8?552:505,i=t.viewbox?.viewbox_height?t.viewbox.viewbox_height:t.show_solar?t.show_battery?408:n.additionalLoad>=2?400:300:t.show_battery&&n.additionalLoad>0?350:271;return V(hr||(hr=gt(["\n\t\t\t\n\t\t\t\t",'\n\t\t\t\t
\n\t\t\t\t\t','\n\t\t\t\t\t\n\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\n\n\t\t\t\t\t\t","\n\n\n\t\t\t\t\t\t","\n\n\t\t\t\t\t\t","\n\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t"])),kn.getStyle(n),t.title?V(gr||(gr=gt(['\n\t\t\t\t\t\t',""])),t.title_colour||"inherit",t.title_size||"32px",t.title):"",a,o,r,i,!1===n.panelMode?"".concat(t.show_solar||t.show_battery?t.show_solar?t.show_solar&&!t.show_battery?n.additionalLoad>=2?"400px":"300px":"".concat(n.cardHeight):0!==n.additionalLoad?"330px":"246px":"270px"):"".concat(t.show_solar?"100%":"75%"),!0===n.panelMode?"".concat(n.cardWidth):"100%",t.show_grid?Q(fr||(fr=gt(["\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t "])),xr.generateShapeAndName(n,t),xr.generateDailyImport(n,t),xr.generateDailyExport(n,t),xr.generateFlowLines(n),xr.generateIcon(n,t),xr.generateEnergyCost(n,t),xr.generatePhases(n,t),xr.generatePrepaidUnits(n,t),xr.generateLimit(n,t),xr.generateTotalGridPower(n,t),xr.generateFrequency(n)):"",t.show_grid&&t.grid.show_nonessential?Q(mr||(mr=gt(["\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t "])),Lr.generateShapeAndName(n,t),Lr.generateLoad1(n,t),Lr.generateLoad2(n,t),Lr.generateLoad3(n,t),Lr.generateLines(n,t),Lr.generateFlowLine(n,t),Lr.generateTotalPower(n,t),Lr.generateIcon(n)):"",t.show_solar?Q(yr||(yr=gt(["\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t "])),wr.generateSolarHeader(n,t),wr.generateMppt1(n,t),wr.generateMppt2(n,t),wr.generateMppt3(n,t),wr.generateMppt4(n,t),wr.generateMppt5(n,t),wr.generateSolarPower(n,t),wr.generateSolarSellIcon(n,t)):"",Tn.getTexts(n),t.show_battery?Q(pr||(pr=gt(["\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t "," \n\t "," \n\t "," \n\t ","\n\t "])),br.generateShapes(n,t),br.generatePower(n,t),br.generateDuration(n,t),br.generateDailyCharge(n,t),br.generateDailyDischarge(n,t),br.generateSOC(n,t),br.generateSOH(n),br.generateCapacity(n,t),br.generateShutdownSOC(n,t),br.generateFlowLines(n,t),br.generateBatteryGradient(n,t),br.generateVoltage(n),br.generateCurrent(n,t),br.generateTemp(n)):"",n.additionalLoad>0?Q(vr||(vr=gt(["\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t "])),zn.generateLines(n,t),zn.generateLoad1(n,t),zn.generateLoad2(n,t),zn.generateLoad3(n,t),zn.generateLoad4(n,t),zn.generateLoad5(n,t),zn.generateLoad6(n,t),zn.generateLoad7(n,t),zn.generateLoad8(n,t),zn.generateLoad9(n,t),zn.generateLoad10(n,t),zn.generateLoad11(n,t),zn.generateLoad12(n,t),zn.generateLoad13(n,t),zn.generateLoad14(n,t),zn.generateLoad15(n,t),zn.generateLoad16(n,t),zn.generateLoad17(n,t),zn.generateLoad18(n,t)):"",n.showAux?Q(Ar||(Ar=gt(["\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t"])),Pr.generateShapes(n,t),Pr.generateLines(n),Pr.generateLoad1(n,t),Pr.generateLoad2(n,t),Pr.generateTotalLoad(n,t),Pr.generateDailyLoad(n,t)):"",Cn.generateShapeAndName(n,t),Cn.generateFlowLines(n,t),Cn.generateIcon(n,t),Cn.generatePowers(n,t),Cn.generateTotalLoad(n,t),Cn.generateDailyLoad(n,t),Er.generateTimerInfo(n,t),Er.generatePriorityLoad(n,t),Er.generateInverterImage(n,e),Er.generateInverterState(n,t),Er.generateInverterLoad(n,t),Er.generateInverterProgram(n),Er.generatePhases(n,t),Er.generateFrequency(n),Er.generateTemperatures(n,t))})(t,fo,{config:t,panelMode:no,compactMode:!0,cardHeight:lo,cardWidth:co,loadColour:An,batteryColour:Uo,gridColour:ia,gridImportColour:aa,gridExportColour:oa,isFloating:Qo,inverterColour:ao,solarColour:Eo,auxOffColour:ga,batteryEnergy:Vo,largeFont:eo,batteryPower:so,stateBatteryPower:L,batteryDuration:Ho,batteryCapacity:Bo,additionalLoad:Pa,essIconSize:li,essIcon:si,stateUseTimer:u,batteryStateMsg:Ko,stateBatterySoc:E,inverterProg:Go,batteryPercentage:Yr,pvPercentage:Zr,loadShowDaily:Yn,stateEnergyCostSell:Ce,stateEnergyCostBuy:Me,loadPowerL1:ta,loadPowerL2:ea,loadPowerL3:na,durationCur:this.durationCur,stateEssentialLoad1:Y,stateEssentialLoad2:X,stateEssentialLoad3:F,stateEssentialLoad4:J,stateEssentialLoad5:K,stateEssentialLoad6:q,stateEssentialLoad7:$,stateEssentialLoad8:tt,stateEssentialLoad9:et,stateEssentialLoad10:nt,stateEssentialLoad11:at,stateEssentialLoad12:ot,stateEssentialLoad13:rt,stateEssentialLoad14:it,stateEssentialLoad15:st,stateEssentialLoad16:lt,stateEssentialLoad17:ct,stateEssentialLoad18:dt,stateGridPowerL1:fe,stateGridPowerL2:me,stateGridPowerL3:ye,stateGridVoltageL1:pe,stateGridVoltageL2:ve,stateGridVoltageL3:Ae,stateGridCurrentL1:we,stateGridCurrentL2:be,stateGridCurrentL3:xe,decimalPlaces:pn,decimalPlacesEnergy:vn,stateEssentialLoad1Extra:ut,stateEssentialLoad2Extra:ht,stateEssentialLoad3Extra:ft,stateEssentialLoad4Extra:mt,stateEssentialLoad5Extra:pt,stateEssentialLoad6Extra:vt,stateEssentialLoad7Extra:At,stateEssentialLoad8Extra:wt,stateEssentialLoad9Extra:bt,stateEssentialLoad10Extra:Et,stateEssentialLoad11Extra:Pt,stateEssentialLoad12Extra:jt,stateEssentialLoad13Extra:Dt,stateEssentialLoad14Extra:_t,stateEssentialLoad15Extra:Rt,stateEssentialLoad16Extra:Gt,stateEssentialLoad17Extra:Bt,stateEssentialLoad18Extra:St,stateEssentialLoad1Toggle:It,stateEssentialLoad2Toggle:Ht,stateEssentialLoad3Toggle:Vt,stateEssentialLoad4Toggle:Qt,stateEssentialLoad5Toggle:Ut,stateEssentialLoad6Toggle:Wt,stateEssentialLoad7Toggle:Zt,stateEssentialLoad8Toggle:Yt,stateEssentialLoad9Toggle:Xt,stateEssentialLoad10Toggle:Ft,stateEssentialLoad11Toggle:Jt,stateEssentialLoad12Toggle:Kt,stateEssentialLoad13Toggle:qt,stateEssentialLoad14Toggle:$t,stateEssentialLoad15Toggle:te,stateEssentialLoad16Toggle:ee,stateEssentialLoad17Toggle:ne,stateEssentialLoad18Toggle:ae,stateNonEssentialLoad1Extra:S,stateNonEssentialLoad2Extra:I,stateNonEssentialLoad3Extra:H,stateNonEssentialLoad1Toggle:U,stateNonEssentialLoad2Toggle:W,stateNonEssentialLoad3Toggle:Z,gridShowDailyBuy:va,gridShowDailySell:Aa,batteryShowDaily:xa,inverterModel:go,batteryShutdown:Ro,enableAutarky:oo,autarkyPower:or,ratioPower:rr,ratioEnergy:er,autarkyEnergy:tr,autarkyAuto:cr,autarkySelf:dr,shutdownOffGrid:_o,statePV1Current:Oe,statePV2Current:De,statePV3Current:Re,statePV4Current:Be,statePV5Current:Ie,energyCost:ho,stateInverterCurrentL1:p,stateInverterCurrentL2:v,stateInverterCurrentL3:A,stateRadiatorTemp:g,stateInverterVoltageL1:f,stateInverterVoltageL2:m,stateInverterVoltageL3:y,stateBatteryVoltage:x,stateBatteryCurrent:P,batLineWidth:Dr,totalGridPower:gn,solarLineWidth:Ir,totalPV:xo,loadLineWidth:_r,pvPercentageBat:ni,gridPercentageBat:ai,genericInverterImage:yn,battery0:hi,essentialPower:Lo,pv1LineWidth:zr,pv2LineWidth:Tr,pv3LineWidth:kr,pv4LineWidth:Or,pv5LineWidth:jr,gridLineWidth:Gr,stateEnvironmentTemp:w,statePV1Voltage:ke,statePV2Voltage:je,statePV3Voltage:_e,statePV4Voltage:Ge,statePV5Voltage:Se,batteryStateColour:Jo,inverterStateColour:Wo,stateBatteryTemp:M,statePrepaidUnits:ze,stateDCTransformerTemp:h,stateInverterLoadPercentage:b,iconEssentialLoad1:Na,iconEssentialLoad2:za,iconEssentialLoad3:Ta,iconEssentialLoad4:ka,iconEssentialLoad5:Oa,iconEssentialLoad6:ja,iconEssentialLoad7:Da,iconEssentialLoad8:_a,iconEssentialLoad9:Ra,iconEssentialLoad10:Ga,iconEssentialLoad11:Ba,iconEssentialLoad12:Sa,iconEssentialLoad13:Ia,iconEssentialLoad14:Ha,iconEssentialLoad15:Va,iconEssentialLoad16:Qa,iconEssentialLoad17:Ua,iconEssentialLoad18:Wa,enableTimer:ro,stateSolarSell:Ke,priorityLoad:io,inverterImg:fo,stateDailyPVEnergy:$e,stateMonthlyPVEnergy:tn,stateYearlyPVEnergy:en,stateTotalSolarGeneration:nn,stateRemainingSolar:an,stateTomorrowSolar:on,statePV2Power:Ve,statePV3Power:Qe,statePV4Power:Ue,statePV5Power:We,statePV1Energy:Ze,statePV2Energy:Ye,statePV3Energy:Xe,statePV4Energy:Fe,statePV5Energy:Je,stateDayLoadEnergy:a,stateDayBatteryDischarge:e,stateDayGridImport:o,stateDayBatteryCharge:n,stateDayGridExport:r,statePVTotal:qe,statePV1Power:He,minLineWidth:sr,stopColour:ui,gridStatus:Fn,batteryCharge:di,gridOffColour:ua,batteryIcon:ci,formattedResultTime:Io,showAux:Ea,nonessentialIcon:Xa,showNonessential:Xn,nonessentialLoads:pa,iconNonessentialLoad1:Fa,iconNonessentialLoad2:Ja,iconNonessentialLoad3:Ka,inverterStateMsg:Zo,auxType:Ca,showDailyAux:La,nonessentialPower:Po,nonessLineWidth:Sr,grid169LineWidth:Br,auxLineWidth:Rr,iconAuxLoad1:Za,iconAuxLoad2:Ya,stateDayAuxEnergy:i,additionalAuxLoad:Ma,auxPower:sn,stateAuxPower:D,stateAuxLoad1:se,stateAuxLoad2:le,stateAuxLoad1Extra:ce,stateAuxLoad2Extra:de,stateAuxLoad1Toggle:ue,stateAuxLoad2Toggle:he,stateNonessentialLoad1:R,stateNonessentialLoad2:G,stateNonessentialLoad3:B,autoScaledInverterPower:Kn,autoScaledGridPower:qn,auxDynamicColour:ya,auxDynamicColourLoad1:fa,auxDynamicColourLoad2:ma,stateMaxSellPower:Te,totalPVEfficiency:vi,PV1Efficiency:Ai,PV2Efficiency:wi,PV3Efficiency:bi,PV4Efficiency:xi,PV5Efficiency:Ei,gridPercentage:Xr,flowColour:ri,flowBatColour:oi,flowInvColour:ii,dynamicColourEssentialLoad1:wn,dynamicColourEssentialLoad2:bn,dynamicColourEssentialLoad3:xn,dynamicColourEssentialLoad4:En,dynamicColourEssentialLoad5:Ln,dynamicColourEssentialLoad6:Pn,dynamicColourEssentialLoad7:Nn,dynamicColourEssentialLoad8:Rn,dynamicColourEssentialLoad9:Gn,dynamicColourEssentialLoad10:Bn,dynamicColourEssentialLoad11:Sn,dynamicColourEssentialLoad12:In,dynamicColourEssentialLoad13:Hn,dynamicColourEssentialLoad14:Vn,dynamicColourEssentialLoad15:Qn,dynamicColourEssentialLoad16:Un,dynamicColourEssentialLoad17:Wn,dynamicColourEssentialLoad18:Zn,dynamicColourNonEssentialLoad:sa,dynamicColourNonEssentialLoad1:la,dynamicColourNonEssentialLoad2:ca,dynamicColourNonEssentialLoad3:da,stateBatterySOH:O,customGridIcon:Li,customGridIconColour:Pi,stateLoadFrequency:s,stateGridFrequency:ge})}getEntity(t,e={state:"0",attributes:{unit_of_measurement:""}}){const n=String(t).split(".");let a;a=n.length>1?this._config[n[0]][n[1]]:n.length>0?this._config[n[0]]:"";const o=a?this.hass.states[a]:void 0;return Kr(void 0!==o?o:e||{state:void 0})}changeAnimationSpeed(t,e){const n=e>=1?Mn.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]}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}calculateAuxLoadColour(t,e,n){let a=this.colourConvert(this._config.load?.aux_colour);return this._config.load.aux_dynamic_colour?e.isValidSwitch()?"on"===e.toOnOff()?a:this.GREY_COLOUR:Math.abs(t.toPower(!1))>Mn.toNum(n,0)?a:this.GREY_COLOUR:a}calculateEssentialLoadColour(t,e,n){let a=this.colourConvert(this._config.load?.colour);return this._config.load.dynamic_colour?e.isValidSwitch()?"on"===e.toOnOff()?a:this.GREY_COLOUR:Math.abs(t.toPower(!1))>Mn.toNum(n,0)?a:this.GREY_COLOUR:a}getDynamicColorWithToggle(t,e,n,a,o,r=this.GREY_COLOUR){return e.isValidSwitch()?"on"===e.toOnOff()?a:r:Math.abs(t.toPower(!1))>Mn.toNum(n,0)?t.toPower(!1)>0?a:o:this.GREY_COLOUR}setConfig(t){if(t.show_battery&&!t.battery)throw Error(Lt("errors.battery.bat"));if(t.show_battery&&!t.battery.shutdown_soc)throw new Error(Lt("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(Lt("errors.battery.show_daily"));if(t.show_solar&&!t.solar)throw Error(Lt("errors.solar.sol"));if(t.show_solar&&!t.solar.mppts)throw Error(Lt("errors.solar.mppts"));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(Lt("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(Lt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(Lt("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(Lt("errors.missing_entity")," e.g: ").concat(n,": sensor.example"));const n=t;this._config=Pn({},Pt,n)}};var $r,ti;t([ut()],qr.prototype,"hass",void 0),t([ut()],qr.prototype,"_config",void 0),t([ht("#grid-flow")],qr.prototype,"gridFlow",void 0),t([ht("#grid1-flow")],qr.prototype,"grid1Flow",void 0),t([ht("#solar-flow")],qr.prototype,"solarFlow",void 0),t([ht("#pv1-flow")],qr.prototype,"pv1Flow",void 0),t([ht("#pv2-flow")],qr.prototype,"pv2Flow",void 0),t([ht("#pv3-flow")],qr.prototype,"pv3Flow",void 0),t([ht("#pv4-flow")],qr.prototype,"pv4Flow",void 0),t([ht("#pv5-flow")],qr.prototype,"pv5Flow",void 0),t([ht("#battery-flow")],qr.prototype,"batteryFlow",void 0),t([ht("#load-flow")],qr.prototype,"loadFlow",void 0),t([ht("#aux-flow")],qr.prototype,"auxFlow",void 0),t([ht("#ne-flow")],qr.prototype,"neFlow",void 0),t([ht("#ne1-flow")],qr.prototype,"ne1Flow",void 0),qr=t([lt("mlk-power-flow-card")],qr),window.customCards.push({type:"mlk-power-flow-card",name:"Power Flow Card by Molikk",preview:!0,description:Lt("common.description"),configurable:!0}),function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}($r||($r={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(ti||(ti={}));var ei,ni,ai={exports:{}};ei=ai,ni=ai.exports,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",a="__lodash_placeholder__",o=16,r=32,i=64,s=128,l=256,c=1/0,d=9007199254740991,u=NaN,h=4294967295,g=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",r],["partialRight",i],["rearg",l]],f="[object Arguments]",m="[object Array]",y="[object Boolean]",p="[object Date]",v="[object Error]",A="[object Function]",w="[object GeneratorFunction]",b="[object Map]",x="[object Number]",E="[object Object]",L="[object Promise]",P="[object RegExp]",M="[object Set]",C="[object String]",N="[object Symbol]",z="[object WeakMap]",T="[object ArrayBuffer]",k="[object DataView]",O="[object Float32Array]",j="[object Float64Array]",D="[object Int8Array]",_="[object Int16Array]",R="[object Int32Array]",G="[object Uint8Array]",B="[object Uint8ClampedArray]",S="[object Uint16Array]",I="[object Uint32Array]",H=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,Q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,Z=RegExp(U.source),Y=RegExp(W.source),X=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),nt=/^\s+/,at=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,rt=/\{\n\/\* \[wrapped with (.+)\] \*/,it=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ut=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,ft=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,pt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,At=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",bt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="\\u2700-\\u27bf",Et="a-z\\xdf-\\xf6\\xf8-\\xff",Lt="A-Z\\xc0-\\xd6\\xd8-\\xde",Pt="\\ufe0e\\ufe0f",Mt="\\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",Ct="['’]",Nt="["+wt+"]",zt="["+Mt+"]",Tt="["+bt+"]",kt="\\d+",Ot="["+xt+"]",jt="["+Et+"]",Dt="[^"+wt+Mt+kt+xt+Et+Lt+"]",_t="\\ud83c[\\udffb-\\udfff]",Rt="[^"+wt+"]",Gt="(?:\\ud83c[\\udde6-\\uddff]){2}",Bt="[\\ud800-\\udbff][\\udc00-\\udfff]",St="["+Lt+"]",It="\\u200d",Vt="(?:"+jt+"|"+Dt+")",Qt="(?:"+St+"|"+Dt+")",Ut="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Zt="(?:"+Tt+"|"+_t+")?",Yt="["+Pt+"]?",Xt=Yt+Zt+"(?:"+It+"(?:"+[Rt,Gt,Bt].join("|")+")"+Yt+Zt+")*",Ft="(?:"+[Ot,Gt,Bt].join("|")+")"+Xt,Jt="(?:"+[Rt+Tt+"?",Tt,Gt,Bt,Nt].join("|")+")",Kt=RegExp(Ct,"g"),qt=RegExp(Tt,"g"),$t=RegExp(_t+"(?="+_t+")|"+Jt+Xt,"g"),te=RegExp([St+"?"+jt+"+"+Ut+"(?="+[zt,St,"$"].join("|")+")",Qt+"+"+Wt+"(?="+[zt,St+Vt,"$"].join("|")+")",St+"?"+Vt+"+"+Ut,St+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",kt,Ft].join("|"),"g"),ee=RegExp("["+It+wt+bt+Pt+"]"),ne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ae=["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"],oe=-1,re={};re[O]=re[j]=re[D]=re[_]=re[R]=re[G]=re[B]=re[S]=re[I]=!0,re[f]=re[m]=re[T]=re[y]=re[k]=re[p]=re[v]=re[A]=re[b]=re[x]=re[E]=re[P]=re[M]=re[C]=re[z]=!1;var ie={};ie[f]=ie[m]=ie[T]=ie[k]=ie[y]=ie[p]=ie[O]=ie[j]=ie[D]=ie[_]=ie[R]=ie[b]=ie[x]=ie[E]=ie[P]=ie[M]=ie[C]=ie[N]=ie[G]=ie[B]=ie[S]=ie[I]=!0,ie[v]=ie[A]=ie[z]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,ce=parseInt,de="object"==typeof Ht&&Ht&&Ht.Object===Object&&Ht,ue="object"==typeof self&&self&&self.Object===Object&&self,he=de||ue||Function("return this")(),ge=ni&&!ni.nodeType&&ni,fe=ge&&ei&&!ei.nodeType&&ei,me=fe&&fe.exports===ge,ye=me&&de.process,pe=function(){try{var t=fe&&fe.require&&fe.require("util").types;return t||ye&&ye.binding&&ye.binding("util")}catch(t){}}(),ve=pe&&pe.isArrayBuffer,Ae=pe&&pe.isDate,we=pe&&pe.isMap,be=pe&&pe.isRegExp,xe=pe&&pe.isSet,Ee=pe&&pe.isTypedArray;function Le(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 Pe(t,e,n,a){for(var o=-1,r=null==t?0:t.length;++o-1}function ke(t,e,n){for(var a=-1,o=null==t?0:t.length;++a-1;);return n}function tn(t,e){for(var n=t.length;n--&&Ie(e,t[n],0)>-1;);return n}var en=We({"À":"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"}),nn=We({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(t){return"\\"+se[t]}function on(t){return ee.test(t)}function rn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,a){n[++e]=[a,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function ln(t,e){for(var n=-1,o=t.length,r=0,i=[];++n",""":'"',"'":"'"}),mn=function at(wt){var bt,xt=(wt=null==wt?he:mn.defaults(he.Object(),wt,mn.pick(he,ae))).Array,Et=wt.Date,Lt=wt.Error,Pt=wt.Function,Mt=wt.Math,Ct=wt.Object,Nt=wt.RegExp,zt=wt.String,Tt=wt.TypeError,kt=xt.prototype,Ot=Pt.prototype,jt=Ct.prototype,Dt=wt["__core-js_shared__"],_t=Ot.toString,Rt=jt.hasOwnProperty,Gt=0,Bt=(bt=/[^.]+$/.exec(Dt&&Dt.keys&&Dt.keys.IE_PROTO||""))?"Symbol(src)_1."+bt:"",St=jt.toString,It=_t.call(Ct),Ht=he._,Vt=Nt("^"+_t.call(Rt).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qt=me?wt.Buffer:t,Ut=wt.Symbol,Wt=wt.Uint8Array,Zt=Qt?Qt.allocUnsafe:t,Yt=sn(Ct.getPrototypeOf,Ct),Xt=Ct.create,Ft=jt.propertyIsEnumerable,Jt=kt.splice,$t=Ut?Ut.isConcatSpreadable:t,ee=Ut?Ut.iterator:t,se=Ut?Ut.toStringTag:t,de=function(){try{var t=gr(Ct,"defineProperty");return t({},"",{}),t}catch(t){}}(),ue=wt.clearTimeout!==he.clearTimeout&&wt.clearTimeout,ge=Et&&Et.now!==he.Date.now&&Et.now,fe=wt.setTimeout!==he.setTimeout&&wt.setTimeout,ye=Mt.ceil,pe=Mt.floor,Ge=Ct.getOwnPropertySymbols,We=Qt?Qt.isBuffer:t,yn=wt.isFinite,pn=kt.join,vn=sn(Ct.keys,Ct),An=Mt.max,wn=Mt.min,bn=Et.now,xn=wt.parseInt,En=Mt.random,Ln=kt.reverse,Pn=gr(wt,"DataView"),Mn=gr(wt,"Map"),Cn=gr(wt,"Promise"),Nn=gr(wt,"Set"),zn=gr(wt,"WeakMap"),Tn=gr(Ct,"create"),kn=zn&&new zn,On={},jn=Sr(Pn),Dn=Sr(Mn),_n=Sr(Cn),Rn=Sr(Nn),Gn=Sr(zn),Bn=Ut?Ut.prototype:t,Sn=Bn?Bn.valueOf:t,In=Bn?Bn.toString:t;function Hn(t){if(ns(t)&&!Wi(t)&&!(t instanceof Wn)){if(t instanceof Un)return t;if(Rt.call(t,"__wrapped__"))return Ir(t)}return new Un(t)}var Vn=function(){function e(){}return function(n){if(!es(n))return{};if(Xt)return Xt(n);e.prototype=n;var a=new e;return e.prototype=t,a}}();function Qn(){}function Un(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Zn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=n?e:n)),e}function ca(e,n,a,o,r,i){var s,l=1&n,c=2&n,d=4&n;if(a&&(s=r?a(e,o,r,i):a(e)),s!==t)return s;if(!es(e))return e;var u=Wi(e);if(u){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Rt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!l)return ko(e,s)}else{var h=yr(e),g=h==A||h==w;if(Fi(e))return Po(e,l);if(h==E||h==f||g&&!r){if(s=c||g?{}:vr(e),!l)return c?function(t,e){return Oo(t,mr(t),e)}(e,function(t,e){return t&&Oo(e,js(e),t)}(s,e)):function(t,e){return Oo(t,fr(t),e)}(e,ra(s,e))}else{if(!ie[h])return r?e:{};s=function(t,e,n){var a,o=t.constructor;switch(e){case T:return Mo(t);case y:case p:return new o(+t);case k:return function(t,e){var n=e?Mo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case O:case j:case D:case _:case R:case G:case B:case S:case I:return Co(t,n);case b:return new o;case x:case C:return new o(t);case P:return function(t){var e=new t.constructor(t.source,ut.exec(t));return e.lastIndex=t.lastIndex,e}(t);case M:return new o;case N:return a=t,Sn?Ct(Sn.call(a)):{}}}(e,h,l)}}i||(i=new Jn);var m=i.get(e);if(m)return m;i.set(e,s),ss(e)?e.forEach((function(t){s.add(ca(t,n,a,t,e,i))})):as(e)&&e.forEach((function(t,o){s.set(o,ca(t,n,a,o,e,i))}));var v=u?t:(d?c?ir:rr:c?js:Os)(e);return Me(v||e,(function(t,o){v&&(t=e[o=t]),na(s,o,ca(t,n,a,o,e,i))})),s}function da(e,n,a){var o=a.length;if(null==e)return!o;for(e=Ct(e);o--;){var r=a[o],i=n[r],s=e[r];if(s===t&&!(r in e)||!i(s))return!1}return!0}function ua(n,a,o){if("function"!=typeof n)throw new Tt(e);return Or((function(){n.apply(t,o)}),a)}function ha(t,e,n,a){var o=-1,r=Te,i=!0,s=t.length,l=[],c=e.length;if(!s)return l;n&&(e=Oe(e,Je(n))),a?(r=ke,i=!1):e.length>=200&&(r=qe,i=!1,e=new Fn(e));t:for(;++o-1},Yn.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},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Zn,map:new(Mn||Yn),string:new Zn}},Xn.prototype.delete=function(t){var e=ur(this,t).delete(t);return this.size-=e?1:0,e},Xn.prototype.get=function(t){return ur(this,t).get(t)},Xn.prototype.has=function(t){return ur(this,t).has(t)},Xn.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},Fn.prototype.add=Fn.prototype.push=function(t){return this.__data__.set(t,n),this},Fn.prototype.has=function(t){return this.__data__.has(t)},Jn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Jn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Jn.prototype.get=function(t){return this.__data__.get(t)},Jn.prototype.has=function(t){return this.__data__.has(t)},Jn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Yn){var a=n.__data__;if(!Mn||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xn(a)}return n.set(t,e),this.size=n.size,this};var ga=_o(ba),fa=_o(xa,!0);function ma(t,e){var n=!0;return ga(t,(function(t,a,o){return n=!!e(t,a,o)})),n}function ya(e,n,a){for(var o=-1,r=e.length;++o0&&n(s)?e>1?va(s,e-1,n,a,o):je(o,s):a||(o[o.length]=s)}return o}var Aa=Ro(),wa=Ro(!0);function ba(t,e){return t&&Aa(t,e,Os)}function xa(t,e){return t&&wa(t,e,Os)}function Ea(t,e){return ze(e,(function(e){return qi(t[e])}))}function La(e,n){for(var a=0,o=(n=bo(n,e)).length;null!=e&&ae}function Na(t,e){return null!=t&&Rt.call(t,e)}function za(t,e){return null!=t&&e in Ct(t)}function Ta(e,n,a){for(var o=a?ke:Te,r=e[0].length,i=e.length,s=i,l=xt(i),c=1/0,d=[];s--;){var u=e[s];s&&n&&(u=Oe(u,Je(n))),c=wn(u.length,c),l[s]=!a&&(n||r>=120&&u.length>=120)?new Fn(s&&u):t}u=e[0];var h=-1,g=l[0];t:for(;++h=s?l:l*("desc"==n[a]?-1:1)}return t.index-e.index}(t,e,n)}))}function Za(t,e,n){for(var a=-1,o=e.length,r={};++a-1;)s!==t&&Jt.call(s,l,1),Jt.call(t,l,1);return t}function Xa(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;wr(o)?Jt.call(t,o,1):go(t,o)}}return t}function Fa(t,e){return t+pe(En()*(e-t+1))}function Ja(t,e){var n="";if(!t||e<1||e>d)return n;do{e%2&&(n+=t),(e=pe(e/2))&&(t+=t)}while(e);return n}function Ka(t,e){return jr(Nr(t,e,ol),t+"")}function qa(t){return qn(Hs(t))}function $a(t,e){var n=Hs(t);return Rr(n,la(e,0,n.length))}function to(e,n,a,o){if(!es(e))return e;for(var r=-1,i=(n=bo(n,e)).length,s=i-1,l=e;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=xt(o);++a>>1,i=t[r];null!==i&&!cs(i)&&(n?i<=e:i=200){var c=e?null:Ko(t);if(c)return cn(c);i=!1,o=qe,l=new Fn}else l=e?[]:s;t:for(;++a=o?e:oo(e,n,a)}var Lo=ue||function(t){return he.clearTimeout(t)};function Po(t,e){if(e)return t.slice();var n=t.length,a=Zt?Zt(n):new t.constructor(n);return t.copy(a),a}function Mo(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Co(t,e){var n=e?Mo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function No(e,n){if(e!==n){var a=e!==t,o=null===e,r=e==e,i=cs(e),s=n!==t,l=null===n,c=n==n,d=cs(n);if(!l&&!d&&!i&&e>n||i&&s&&c&&!l&&!d||o&&s&&c||!a&&c||!r)return 1;if(!o&&!i&&!d&&e1?a[r-1]:t,s=r>2?a[2]:t;for(i=e.length>3&&"function"==typeof i?(r--,i):t,s&&br(a[0],a[1],s)&&(i=r<3?t:i,r=1),n=Ct(n);++o-1?r[i?n[s]:s]:t}}function Ho(n){return or((function(a){var o=a.length,r=o,i=Un.prototype.thru;for(n&&a.reverse();r--;){var s=a[r];if("function"!=typeof s)throw new Tt(e);if(i&&!l&&"wrapper"==lr(s))var l=new Un([],!0)}for(r=l?r:o;++r1&&A.reverse(),h&&dl))return!1;var d=i.get(e),u=i.get(n);if(d&&u)return d==n&&u==e;var h=-1,g=!0,f=2&a?new Fn:t;for(i.set(e,n),i.set(n,e);++h-1&&t%1==0&&t1?"& ":"")+e[a],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(a,function(t,e){return Me(g,(function(n){var a="_."+n[0];e&n[1]&&!Te(t,a)&&t.push(a)})),t.sort()}(function(t){var e=t.match(rt);return e?e[1].split(it):[]}(a),n)))}function _r(e){var n=0,a=0;return function(){var o=bn(),r=16-(o-a);if(a=o,r>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Rr(e,n){var a=-1,o=e.length,r=o-1;for(n=n===t?o:n;++a1?e[n-1]:t;return a="function"==typeof a?(e.pop(),a):t,ii(e,a)}));function gi(t){var e=Hn(t);return e.__chain__=!0,e}function fi(t,e){return e(t)}var mi=or((function(e){var n=e.length,a=n?e[0]:0,o=this.__wrapped__,r=function(t){return sa(t,e)};return!(n>1||this.__actions__.length)&&o instanceof Wn&&wr(a)?((o=o.slice(a,+a+(n?1:0))).__actions__.push({func:fi,args:[r],thisArg:t}),new Un(o,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(r)})),yi=jo((function(t,e,n){Rt.call(t,n)?++t[n]:ia(t,n,1)})),pi=Io(Ur),vi=Io(Wr);function Ai(t,e){return(Wi(t)?Me:ga)(t,dr(e,3))}function wi(t,e){return(Wi(t)?Ce:fa)(t,dr(e,3))}var bi=jo((function(t,e,n){Rt.call(t,n)?t[n].push(e):ia(t,n,[e])})),xi=Ka((function(t,e,n){var a=-1,o="function"==typeof e,r=Yi(t)?xt(t.length):[];return ga(t,(function(t){r[++a]=o?Le(e,t,n):ka(t,e,n)})),r})),Ei=jo((function(t,e,n){ia(t,n,e)}));function Li(t,e){return(Wi(t)?Oe:Ia)(t,dr(e,3))}var Pi=jo((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Mi=Ka((function(t,e){if(null==t)return[];var n=e.length;return n>1&&br(t,e[0],e[1])?e=[]:n>2&&br(e[0],e[1],e[2])&&(e=[e[0]]),Wa(t,va(e,1),[])})),Ci=ge||function(){return he.Date.now()};function Ni(e,n,a){return n=a?t:n,n=e&&null==n?e.length:n,$o(e,s,t,t,t,t,n)}function zi(n,a){var o;if("function"!=typeof a)throw new Tt(e);return n=ms(n),function(){return--n>0&&(o=a.apply(this,arguments)),n<=1&&(a=t),o}}var Ti=Ka((function(t,e,n){var a=1;if(n.length){var o=ln(n,cr(Ti));a|=r}return $o(t,a,e,n,o)})),ki=Ka((function(t,e,n){var a=3;if(n.length){var o=ln(n,cr(ki));a|=r}return $o(e,a,t,n,o)}));function Oi(n,a,o){var r,i,s,l,c,d,u=0,h=!1,g=!1,f=!0;if("function"!=typeof n)throw new Tt(e);function m(e){var a=r,o=i;return r=i=t,u=e,l=n.apply(o,a)}function y(e){var n=e-d;return d===t||n>=a||n<0||g&&e-u>=s}function p(){var t=Ci();if(y(t))return v(t);c=Or(p,function(t){var e=a-(t-d);return g?wn(e,s-(t-u)):e}(t))}function v(e){return c=t,f&&r?m(e):(r=i=t,l)}function A(){var e=Ci(),n=y(e);if(r=arguments,i=this,d=e,n){if(c===t)return function(t){return u=t,c=Or(p,a),h?m(t):l}(d);if(g)return Lo(c),c=Or(p,a),m(d)}return c===t&&(c=Or(p,a)),l}return a=ps(a)||0,es(o)&&(h=!!o.leading,s=(g="maxWait"in o)?An(ps(o.maxWait)||0,a):s,f="trailing"in o?!!o.trailing:f),A.cancel=function(){c!==t&&Lo(c),u=0,r=d=i=c=t},A.flush=function(){return c===t?l:v(Ci())},A}var ji=Ka((function(t,e){return ua(t,1,e)})),Di=Ka((function(t,e,n){return ua(t,ps(e)||0,n)}));function _i(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Tt(e);var a=function(){var e=arguments,o=n?n.apply(this,e):e[0],r=a.cache;if(r.has(o))return r.get(o);var i=t.apply(this,e);return a.cache=r.set(o,i)||r,i};return a.cache=new(_i.Cache||Xn),a}function Ri(t){if("function"!=typeof t)throw new Tt(e);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)}}_i.Cache=Xn;var Gi=xo((function(t,e){var n=(e=1==e.length&&Wi(e[0])?Oe(e[0],Je(dr())):Oe(va(e,1),Je(dr()))).length;return Ka((function(a){for(var o=-1,r=wn(a.length,n);++o=e})),Ui=Oa(function(){return arguments}())?Oa:function(t){return ns(t)&&Rt.call(t,"callee")&&!Ft.call(t,"callee")},Wi=xt.isArray,Zi=ve?Je(ve):function(t){return ns(t)&&Ma(t)==T};function Yi(t){return null!=t&&ts(t.length)&&!qi(t)}function Xi(t){return ns(t)&&Yi(t)}var Fi=We||pl,Ji=Ae?Je(Ae):function(t){return ns(t)&&Ma(t)==p};function Ki(t){if(!ns(t))return!1;var e=Ma(t);return e==v||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!rs(t)}function qi(t){if(!es(t))return!1;var e=Ma(t);return e==A||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function $i(t){return"number"==typeof t&&t==ms(t)}function ts(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}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=we?Je(we):function(t){return ns(t)&&yr(t)==b};function os(t){return"number"==typeof t||ns(t)&&Ma(t)==x}function rs(t){if(!ns(t)||Ma(t)!=E)return!1;var e=Yt(t);if(null===e)return!0;var n=Rt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&_t.call(n)==It}var is=be?Je(be):function(t){return ns(t)&&Ma(t)==P},ss=xe?Je(xe):function(t){return ns(t)&&yr(t)==M};function ls(t){return"string"==typeof t||!Wi(t)&&ns(t)&&Ma(t)==C}function cs(t){return"symbol"==typeof t||ns(t)&&Ma(t)==N}var ds=Ee?Je(Ee):function(t){return ns(t)&&ts(t.length)&&!!re[Ma(t)]},us=Xo(Sa),hs=Xo((function(t,e){return t<=e}));function gs(t){if(!t)return[];if(Yi(t))return ls(t)?hn(t):ko(t);if(ee&&t[ee])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ee]());var e=yr(t);return(e==b?rn:e==M?cn:Hs)(t)}function fs(t){return t?(t=ps(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ms(t){var e=fs(t),n=e%1;return e==e?n?e-n:e:0}function ys(t){return t?la(ms(t),0,h):0}function ps(t){if("number"==typeof t)return t;if(cs(t))return u;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=Fe(t);var n=gt.test(t);return n||mt.test(t)?ce(t.slice(2),n?2:8):ht.test(t)?u:+t}function vs(t){return Oo(t,js(t))}function As(t){return null==t?"":uo(t)}var ws=Do((function(t,e){if(Pr(e)||Yi(e))Oo(e,Os(e),t);else for(var n in e)Rt.call(e,n)&&na(t,n,e[n])})),bs=Do((function(t,e){Oo(e,js(e),t)})),xs=Do((function(t,e,n,a){Oo(e,js(e),t,a)})),Es=Do((function(t,e,n,a){Oo(e,Os(e),t,a)})),Ls=or(sa),Ps=Ka((function(e,n){e=Ct(e);var a=-1,o=n.length,r=o>2?n[2]:t;for(r&&br(n[0],n[1],r)&&(o=1);++a1),e})),Oo(t,ir(t),n),a&&(n=ca(n,7,nr));for(var o=e.length;o--;)go(n,e[o]);return n})),Gs=or((function(t,e){return null==t?{}:function(t,e){return Za(t,e,(function(e,n){return Ns(t,n)}))}(t,e)}));function Bs(t,e){if(null==t)return{};var n=Oe(ir(t),(function(t){return[t]}));return e=dr(e),Za(t,n,(function(t,n){return e(t,n[0])}))}var Ss=qo(Os),Is=qo(js);function Hs(t){return null==t?[]:Ke(t,Os(t))}var Vs=Bo((function(t,e,n){return e=e.toLowerCase(),t+(n?Qs(e):e)}));function Qs(t){return Ks(As(t).toLowerCase())}function Us(t){return(t=As(t))&&t.replace(pt,en).replace(qt,"")}var Ws=Bo((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Zs=Bo((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ys=Go("toLowerCase"),Xs=Bo((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Fs=Bo((function(t,e,n){return t+(n?" ":"")+Ks(e)})),Js=Bo((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ks=Go("toUpperCase");function qs(e,n,a){return e=As(e),(n=a?t:n)===t?function(t){return ne.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(st)||[]}(e):e.match(n)||[]}var $s=Ka((function(e,n){try{return Le(e,t,n)}catch(t){return Ki(t)?t:new Lt(t)}})),tl=or((function(t,e){return Me(e,(function(e){e=Br(e),ia(t,e,Ti(t[e],t))})),t}));function el(t){return function(){return t}}var nl=Ho(),al=Ho(!0);function ol(t){return t}function rl(t){return Ra("function"==typeof t?t:ca(t,1))}var il=Ka((function(t,e){return function(n){return ka(n,t,e)}})),sl=Ka((function(t,e){return function(n){return ka(t,n,e)}}));function ll(t,e,n){var a=Os(e),o=Ea(e,a);null!=n||es(e)&&(o.length||!a.length)||(n=e,e=t,t=this,o=Ea(e,Os(e)));var r=!(es(n)&&"chain"in n&&!n.chain),i=qi(t);return Me(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,je([this.value()],arguments))})})),t}function cl(){}var dl=Wo(Oe),ul=Wo(Ne),hl=Wo(Re);function gl(t){return xr(t)?Ue(Br(t)):function(t){return function(e){return La(e,t)}}(t)}var fl=Yo(),ml=Yo(!0);function yl(){return[]}function pl(){return!1}var vl,Al=Uo((function(t,e){return t+e}),0),wl=Jo("ceil"),bl=Uo((function(t,e){return t/e}),1),xl=Jo("floor"),El=Uo((function(t,e){return t*e}),1),Ll=Jo("round"),Pl=Uo((function(t,e){return t-e}),0);return Hn.after=function(t,n){if("function"!=typeof n)throw new Tt(e);return t=ms(t),function(){if(--t<1)return n.apply(this,arguments)}},Hn.ary=Ni,Hn.assign=ws,Hn.assignIn=bs,Hn.assignInWith=xs,Hn.assignWith=Es,Hn.at=Ls,Hn.before=zi,Hn.bind=Ti,Hn.bindAll=tl,Hn.bindKey=ki,Hn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Wi(t)?t:[t]},Hn.chain=gi,Hn.chunk=function(e,n,a){n=(a?br(e,n,a):n===t)?1:An(ms(n),0);var o=null==e?0:e.length;if(!o||n<1)return[];for(var r=0,i=0,s=xt(ye(o/n));rr?0:r+a),(o=o===t||o>r?r:ms(o))<0&&(o+=r),o=a>o?0:ys(o);a>>0)?(e=As(e))&&("string"==typeof n||null!=n&&!is(n))&&!(n=uo(n))&&on(e)?Eo(hn(e),0,a):e.split(n,a):[]},Hn.spread=function(t,n){if("function"!=typeof t)throw new Tt(e);return n=null==n?0:An(ms(n),0),Ka((function(e){var a=e[n],o=Eo(e,0,n);return a&&je(o,a),Le(t,this,o)}))},Hn.tail=function(t){var e=null==t?0:t.length;return e?oo(t,1,e):[]},Hn.take=function(e,n,a){return e&&e.length?oo(e,0,(n=a||n===t?1:ms(n))<0?0:n):[]},Hn.takeRight=function(e,n,a){var o=null==e?0:e.length;return o?oo(e,(n=o-(n=a||n===t?1:ms(n)))<0?0:n,o):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?mo(t,dr(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?mo(t,dr(e,3)):[]},Hn.tap=function(t,e){return e(t),t},Hn.throttle=function(t,n,a){var o=!0,r=!0;if("function"!=typeof t)throw new Tt(e);return es(a)&&(o="leading"in a?!!a.leading:o,r="trailing"in a?!!a.trailing:r),Oi(t,n,{leading:o,maxWait:n,trailing:r})},Hn.thru=fi,Hn.toArray=gs,Hn.toPairs=Ss,Hn.toPairsIn=Is,Hn.toPath=function(t){return Wi(t)?Oe(t,Br):cs(t)?[t]:ko(Gr(As(t)))},Hn.toPlainObject=vs,Hn.transform=function(t,e,n){var a=Wi(t),o=a||Fi(t)||ds(t);if(e=dr(e,4),null==n){var r=t&&t.constructor;n=o?a?new r:[]:es(t)&&qi(r)?Vn(Yt(t)):{}}return(o?Me:ba)(t,(function(t,a,o){return e(n,t,a,o)})),n},Hn.unary=function(t){return Ni(t,1)},Hn.union=ni,Hn.unionBy=ai,Hn.unionWith=oi,Hn.uniq=function(t){return t&&t.length?ho(t):[]},Hn.uniqBy=function(t,e){return t&&t.length?ho(t,dr(e,2)):[]},Hn.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?ho(e,t,n):[]},Hn.unset=function(t,e){return null==t||go(t,e)},Hn.unzip=ri,Hn.unzipWith=ii,Hn.update=function(t,e,n){return null==t?t:fo(t,e,wo(n))},Hn.updateWith=function(e,n,a,o){return o="function"==typeof o?o:t,null==e?e:fo(e,n,wo(a),o)},Hn.values=Hs,Hn.valuesIn=function(t){return null==t?[]:Ke(t,js(t))},Hn.without=si,Hn.words=qs,Hn.wrap=function(t,e){return Bi(wo(e),t)},Hn.xor=li,Hn.xorBy=ci,Hn.xorWith=di,Hn.zip=ui,Hn.zipObject=function(t,e){return vo(t||[],e||[],na)},Hn.zipObjectDeep=function(t,e){return vo(t||[],e||[],to)},Hn.zipWith=hi,Hn.entries=Ss,Hn.entriesIn=Is,Hn.extend=bs,Hn.extendWith=xs,ll(Hn,Hn),Hn.add=Al,Hn.attempt=$s,Hn.camelCase=Vs,Hn.capitalize=Qs,Hn.ceil=wl,Hn.clamp=function(e,n,a){return a===t&&(a=n,n=t),a!==t&&(a=(a=ps(a))==a?a:0),n!==t&&(n=(n=ps(n))==n?n:0),la(ps(e),n,a)},Hn.clone=function(t){return ca(t,4)},Hn.cloneDeep=function(t){return ca(t,5)},Hn.cloneDeepWith=function(e,n){return ca(e,5,n="function"==typeof n?n:t)},Hn.cloneWith=function(e,n){return ca(e,4,n="function"==typeof n?n:t)},Hn.conformsTo=function(t,e){return null==e||da(t,e,Os(e))},Hn.deburr=Us,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=bl,Hn.endsWith=function(e,n,a){e=As(e),n=uo(n);var o=e.length,r=a=a===t?o:la(ms(a),0,o);return(a-=n.length)>=0&&e.slice(a,r)==n},Hn.eq=Hi,Hn.escape=function(t){return(t=As(t))&&Y.test(t)?t.replace(W,nn):t},Hn.escapeRegExp=function(t){return(t=As(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Hn.every=function(e,n,a){var o=Wi(e)?Ne:ma;return a&&br(e,n,a)&&(n=t),o(e,dr(n,3))},Hn.find=pi,Hn.findIndex=Ur,Hn.findKey=function(t,e){return Be(t,dr(e,3),ba)},Hn.findLast=vi,Hn.findLastIndex=Wr,Hn.findLastKey=function(t,e){return Be(t,dr(e,3),xa)},Hn.floor=xl,Hn.forEach=Ai,Hn.forEachRight=wi,Hn.forIn=function(t,e){return null==t?t:Aa(t,dr(e,3),js)},Hn.forInRight=function(t,e){return null==t?t:wa(t,dr(e,3),js)},Hn.forOwn=function(t,e){return t&&ba(t,dr(e,3))},Hn.forOwnRight=function(t,e){return t&&xa(t,dr(e,3))},Hn.get=Cs,Hn.gt=Vi,Hn.gte=Qi,Hn.has=function(t,e){return null!=t&&pr(t,e,Na)},Hn.hasIn=Ns,Hn.head=Yr,Hn.identity=ol,Hn.includes=function(t,e,n,a){t=Yi(t)?t:Hs(t),n=n&&!a?ms(n):0;var o=t.length;return n<0&&(n=An(o+n,0)),ls(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&Ie(t,e,n)>-1},Hn.indexOf=function(t,e,n){var a=null==t?0:t.length;if(!a)return-1;var o=null==n?0:ms(n);return o<0&&(o=An(a+o,0)),Ie(t,e,o)},Hn.inRange=function(e,n,a){return n=fs(n),a===t?(a=n,n=0):a=fs(a),function(t,e,n){return t>=wn(e,n)&&t=-9007199254740991&&t<=d},Hn.isSet=ss,Hn.isString=ls,Hn.isSymbol=cs,Hn.isTypedArray=ds,Hn.isUndefined=function(e){return e===t},Hn.isWeakMap=function(t){return ns(t)&&yr(t)==z},Hn.isWeakSet=function(t){return ns(t)&&"[object WeakSet]"==Ma(t)},Hn.join=function(t,e){return null==t?"":pn.call(t,e)},Hn.kebabCase=Ws,Hn.last=Kr,Hn.lastIndexOf=function(e,n,a){var o=null==e?0:e.length;if(!o)return-1;var r=o;return a!==t&&(r=(r=ms(a))<0?An(o+r,0):wn(r,o-1)),n==n?function(t,e,n){for(var a=n+1;a--;)if(t[a]===e)return a;return a}(e,n,r):Se(e,Ve,r,!0)},Hn.lowerCase=Zs,Hn.lowerFirst=Ys,Hn.lt=us,Hn.lte=hs,Hn.max=function(e){return e&&e.length?ya(e,ol,Ca):t},Hn.maxBy=function(e,n){return e&&e.length?ya(e,dr(n,2),Ca):t},Hn.mean=function(t){return Qe(t,ol)},Hn.meanBy=function(t,e){return Qe(t,dr(e,2))},Hn.min=function(e){return e&&e.length?ya(e,ol,Sa):t},Hn.minBy=function(e,n){return e&&e.length?ya(e,dr(n,2),Sa):t},Hn.stubArray=yl,Hn.stubFalse=pl,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=El,Hn.nth=function(e,n){return e&&e.length?Ua(e,ms(n)):t},Hn.noConflict=function(){return he._===this&&(he._=Ht),this},Hn.noop=cl,Hn.now=Ci,Hn.pad=function(t,e,n){t=As(t);var a=(e=ms(e))?un(t):0;if(!e||a>=e)return t;var o=(e-a)/2;return Zo(pe(o),n)+t+Zo(ye(o),n)},Hn.padEnd=function(t,e,n){t=As(t);var a=(e=ms(e))?un(t):0;return e&&an){var o=e;e=n,n=o}if(a||e%1||n%1){var r=En();return wn(e+r*(n-e+le("1e-"+((r+"").length-1))),n)}return Fa(e,n)},Hn.reduce=function(t,e,n){var a=Wi(t)?De:Ze,o=arguments.length<3;return a(t,dr(e,4),n,o,ga)},Hn.reduceRight=function(t,e,n){var a=Wi(t)?_e:Ze,o=arguments.length<3;return a(t,dr(e,4),n,o,fa)},Hn.repeat=function(e,n,a){return n=(a?br(e,n,a):n===t)?1:ms(n),Ja(As(e),n)},Hn.replace=function(){var t=arguments,e=As(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(e,n,a){var o=-1,r=(n=bo(n,e)).length;for(r||(r=1,e=t);++od)return[];var n=h,a=wn(t,h);e=dr(e),t-=h;for(var o=Xe(a,e);++n=i)return e;var l=a-un(o);if(l<1)return o;var c=s?Eo(s,0,l).join(""):e.slice(0,l);if(r===t)return c+o;if(s&&(l+=c.length-l),is(r)){if(e.slice(l).search(r)){var d,u=c;for(r.global||(r=Nt(r.source,As(ut.exec(r))+"g")),r.lastIndex=0;d=r.exec(u);)var h=d.index;c=c.slice(0,h===t?l:h)}}else if(e.indexOf(uo(r),l)!=l){var g=c.lastIndexOf(r);g>-1&&(c=c.slice(0,g))}return c+o},Hn.unescape=function(t){return(t=As(t))&&Z.test(t)?t.replace(U,fn):t},Hn.uniqueId=function(t){var e=++Gt;return As(t)+e},Hn.upperCase=Js,Hn.upperFirst=Ks,Hn.each=Ai,Hn.eachRight=wi,Hn.first=Yr,ll(Hn,(vl={},ba(Hn,(function(t,e){Rt.call(Hn.prototype,e)||(vl[e]=t)})),vl),{chain:!1}),Hn.VERSION="4.17.21",Me(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hn[t].placeholder=Hn})),Me(["drop","take"],(function(e,n){Wn.prototype[e]=function(a){a=a===t?1:An(ms(a),0);var o=this.__filtered__&&!n?new Wn(this):this.clone();return o.__filtered__?o.__takeCount__=wn(a,o.__takeCount__):o.__views__.push({size:wn(a,h),type:e+(o.__dir__<0?"Right":"")}),o},Wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Me(["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:dr(t,3),type:n}),e.__filtered__=e.__filtered__||a,e}})),Me(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),Me(["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=Ka((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(Ri(dr(t)))},Wn.prototype.slice=function(e,n){e=ms(e);var a=this;return a.__filtered__&&(e>0||n<0)?new Wn(a):(e<0?a=a.takeRight(-e):e&&(a=a.drop(e)),n!==t&&(a=(n=ms(n))<0?a.dropRight(-n):a.take(n-e)),a)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(h)},ba(Wn.prototype,(function(e,n){var a=/^(?:filter|find|map|reject)|While$/.test(n),o=/^(?:head|last)$/.test(n),r=Hn[o?"take"+("last"==n?"Right":""):n],i=o||/^find/.test(n);r&&(Hn.prototype[n]=function(){var n=this.__wrapped__,s=o?[1]:arguments,l=n instanceof Wn,c=s[0],d=l||Wi(n),u=function(t){var e=r.apply(Hn,je([t],s));return o&&h?e[0]:e};d&&a&&"function"==typeof c&&1!=c.length&&(l=d=!1);var h=this.__chain__,g=!!this.__actions__.length,f=i&&!h,m=l&&!g;if(!i&&d){n=m?n:new Wn(this);var y=e.apply(n,s);return y.__actions__.push({func:fi,args:[u],thisArg:t}),new Un(y,h)}return f&&m?e.apply(this,s):(y=this.thru(u),f?o?y.value()[0]:y.value():y)})})),Me(["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);Hn.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)}))}})),ba(Wn.prototype,(function(t,e){var n=Hn[e];if(n){var a=n.name+"";Rt.call(On,a)||(On[a]=[]),On[a].push({name:e,func:n})}})),On[Vo(t,2).name]=[{name:"wrapper",func:t}],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){for(var a=-1,o=n.length;++a=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Hn.prototype.plant=function(e){for(var n,a=this;a instanceof Qn;){var o=Ir(a);o.__index__=0,o.__values__=t,n?r.__wrapped__=o:n=o;var r=o;a=a.__wrapped__}return r.__wrapped__=e,n},Hn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wn){var n=e;return this.__actions__.length&&(n=new Wn(this)),(n=n.reverse()).__actions__.push({func:fi,args:[ei],thisArg:t}),new Un(n,this.__chain__)}return this.thru(ei)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return yo(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,ee&&(Hn.prototype[ee]=function(){return this}),Hn}();fe?((fe.exports=mn)._=mn,ge._=mn):he._=mn}.call(Ht);var oi,ri,ii=ai.exports;let si=class extends it{constructor(){super(...arguments),this._computeLabelCallback=t=>Lt("config.".concat(t.name))??t.name}setConfig(t){this._config={...this._config,...t}}render(){return this._config&&this.hass?V(ri||(ri=gt(["\n\t\t\t\t\t\n\t\t"])),this.hass,this._config,this._computeLabelCallback.bind(this),[{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:{}}}]}]},{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:"dynamic_line_width",selector:{boolean:{}}},{name:"max_line_width",selector:{number:{}}},{name:"min_line_width",selector:{number:{}}},{name:"decimal_places",selector:{number:{}}},{name:"decimal_places_energy",selector:{number:{}}}]},{type:"expandable",title:this._title("adv_viewbox"),schema:[{name:"viewbox",type:"grid",schema:[{name:"viewbox_min_x",selector:{number:{}}},{name:"viewbox_min_y",selector:{number:{}}},{name:"viewbox_width",selector:{number:{}}},{name:"viewbox_height",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(yt).map((t=>({label:ii.capitalize(t),value:t})))}}},{name:"modern",selector:{boolean:{}}},{name:"autarky",selector:{select:{options:Object.values(pt).map((t=>({label:ii.capitalize(t),value:t})))}}},{name:"colour",selector:{color_rgb:{}}},{name:"ac_icon",selector:{icon:{}}},{name:"dc_icon",selector:{icon:{}}}]}]},{type:"expandable",title:this._title("solar"),schema:[{name:"solar",type:"grid",schema:[{name:"mppts",selector:{number:{min:1,max:5}}},{name:"auto_scale",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"animation_speed",selector:{number:{}}},{name:"off_threshold",selector:{number:{}}}]},{type:"expandable",title:this._title("solar_production"),schema:[{name:"solar",type:"grid",schema:[{name:"daily_solar_name",selector:{text:{}}},{name:"monthly_solar_name",selector:{text:{}}},{name:"yearly_solar_name",selector:{text:{}}},{name:"total_solar_generation_name",selector:{text:{}}},{name:"remaining_solar_name",selector:{text:{}}},{name:"tomorrow_solar_name",selector:{text:{}}}]}]},{type:"expandable",title:this._title("max_power"),schema:[{name:"solar",type:"grid",schema:[{name:"max_power",selector:{number:{}}},{name:"pv1_max_power",selector:{number:{}}},{name:"pv2_max_power",selector:{number:{}}},{name:"pv3_max_power",selector:{number:{}}},{name:"pv4_max_power",selector:{number:{}}},{name:"pv5_max_power",selector:{number:{}}}]}]},{type:"expandable",title:this._title("mppt_options"),schema:[{name:"solar",type:"grid",schema:[{name:"pv1_name",selector:{text:{}}},{name:"pv2_name",selector:{text:{}}},{name:"pv3_name",selector:{text:{}}},{name:"pv4_name",selector:{text:{}}},{name:"pv5_name",selector:{text:{}}},{name:"visualize_efficiency",selector:{boolean:{}}},{name:"show_mppt_efficiency",selector:{boolean:{}}},{name:"show_mppt_production",selector:{boolean:{}}}]}]}]},{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:"shutdown_soc_offgrid",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:"animate",selector:{boolean:{}}},{name:"animation_speed",selector:{number:{}}},{name:"hide_soc",selector:{boolean:{}}},{name:"show_remaining_energy",selector:{boolean:{}}},{name:"max_power",selector:{number:{}}},{name:"path_threshold",selector:{number:{}}}]},{type:"expandable",title:this._title("sensor"),schema:[{name:"battery",type:"grid",schema:[{name:"energy",selector:{entity:{}}},{name:"shutdown_soc",selector:{entity:{}}},{name:"shutdown_soc_offgrid",selector:{entity:{}}},{name:"max_power",selector:{entity:{}}}]}]}]},{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:18}}},{name:"animation_speed",selector:{number:{}}},{name:"max_power",selector:{number:{}}},{name:"off_threshold",selector:{number:{}}},{name:"path_threshold",selector:{number:{}}}]},{type:"expandable",title:this._title("additional_load"),schema:[{name:"load",type:"grid",schema:[{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:"load5_name",selector:{text:{}}},{name:"load5_icon",selector:{icon:{}}},{name:"load6_name",selector:{text:{}}},{name:"load6_icon",selector:{icon:{}}},{name:"load7_name",selector:{text:{}}},{name:"load7_icon",selector:{icon:{}}},{name:"load8_name",selector:{text:{}}},{name:"load8_icon",selector:{icon:{}}},{name:"load9_name",selector:{text:{}}},{name:"load9_icon",selector:{icon:{}}},{name:"load10_name",selector:{text:{}}},{name:"load10_icon",selector:{icon:{}}},{name:"load11_name",selector:{text:{}}},{name:"load11_icon",selector:{icon:{}}},{name:"load12_name",selector:{text:{}}},{name:"load12_icon",selector:{icon:{}}},{name:"load13_name",selector:{text:{}}},{name:"load13_icon",selector:{icon:{}}},{name:"load14_name",selector:{text:{}}},{name:"load14_icon",selector:{icon:{}}},{name:"load15_name",selector:{text:{}}},{name:"load15_icon",selector:{icon:{}}},{name:"load16_name",selector:{text:{}}},{name:"load16_icon",selector:{icon:{}}},{name:"load17_name",selector:{text:{}}},{name:"load17_icon",selector:{icon:{}}},{name:"load18_name",selector:{text:{}}},{name:"load18_icon",selector:{icon:{}}}]}]},{type:"expandable",title:this._title("aux_load"),schema:[{name:"load",type:"grid",schema:[{name:"show_aux",selector:{boolean:{}}},{name:"aux_name",selector:{text:{}}},{name:"aux_daily_name",selector:{text:{}}},{name:"aux_type",selector:{icon:{}}},{name:"invert_aux",selector:{boolean:{}}},{name:"show_absolute_aux",selector:{boolean:{}}},{name:"aux_dynamic_colour",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:"grid_name",selector:{text:{}}},{name:"max_power",selector:{number:{}}},{name:"show_daily_buy",selector:{boolean:{}}},{name:"label_daily_grid_buy",selector:{text:{}}},{name:"show_daily_sell",selector:{boolean:{}}},{name:"label_daily_grid_sell",selector:{text:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"invert_grid",selector:{boolean:{}}},{name:"show_absolute",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:"energy_cost_decimals",selector:{number:{mode:"box",min:0,max:3}}},{name:"animation_speed",selector:{number:{}}},{name:"off_threshold",selector:{number:{}}},{name:"import_icon",selector:{icon:{}}},{name:"export_icon",selector:{icon:{}}},{name:"disconnected_icon",selector:{icon:{}}},{name:"prepaid_unit_name",selector:{text:{}}},{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:{}}}]},{type:"expandable",title:this._title("additional_load"),schema:[{name:"grid",type:"grid",schema:[{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:{}}}]}]}]},{type:"expandable",title:this._title("entities"),schema:[{type:"expandable",title:this._title("sol"),schema:[{name:"entities",type:"grid",schema:[{name:"pv_total",selector:{entity:{device_class:Dt.POWER}}},{name:"day_pv_energy_108",selector:{entity:{device_class:Dt.ENERGY}}},{name:"monthly_pv_generation",selector:{entity:{device_class:Dt.ENERGY}}},{name:"yearly_pv_generation",selector:{entity:{device_class:Dt.ENERGY}}},{name:"total_pv_generation",selector:{entity:{device_class:Dt.ENERGY}}},{name:"remaining_solar",selector:{entity:{device_class:Dt.ENERGY}}},{name:"tomorrow_solar",selector:{entity:{device_class:Dt.ENERGY}}},{name:"pv1_power_186",selector:{entity:{device_class:Dt.POWER}}},{name:"pv1_production",selector:{entity:{device_class:Dt.ENERGY}}},{name:"pv1_voltage_109",selector:{entity:{device_class:Dt.VOLTAGE}}},{name:"pv1_current_110",selector:{entity:{device_class:Dt.CURRENT}}},{name:"pv2_power_187",selector:{entity:{device_class:Dt.POWER}}},{name:"pv2_production",selector:{entity:{device_class:Dt.ENERGY}}},{name:"pv2_voltage_111",selector:{entity:{device_class:Dt.VOLTAGE}}},{name:"pv2_current_112",selector:{entity:{device_class:Dt.CURRENT}}},{name:"pv3_power_188",selector:{entity:{device_class:Dt.POWER}}},{name:"pv3_production",selector:{entity:{device_class:Dt.ENERGY}}},{name:"pv3_voltage_113",selector:{entity:{device_class:Dt.VOLTAGE}}},{name:"pv3_current_114",selector:{entity:{device_class:Dt.CURRENT}}},{name:"pv4_power_189",selector:{entity:{device_class:Dt.POWER}}},{name:"pv4_production",selector:{entity:{device_class:Dt.ENERGY}}},{name:"pv4_voltage_115",selector:{entity:{device_class:Dt.VOLTAGE}}},{name:"pv4_current_116",selector:{entity:{device_class:Dt.CURRENT}}},{name:"pv5_power",selector:{entity:{device_class:Dt.POWER}}},{name:"pv5_production",selector:{entity:{device_class:Dt.ENERGY}}},{name:"pv5_voltage",selector:{entity:{device_class:Dt.VOLTAGE}}},{name:"pv5_current",selector:{entity:{device_class:Dt.CURRENT}}},{name:"solar_sell_247",selector:{entity:{}}},{name:"environment_temp",selector:{entity:{device_class:Dt.TEMPERATURE}}}]}]},{type:"expandable",title:this._title("bat"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_power_190",selector:{entity:{device_class:Dt.POWER}}},{name:"battery_soc_184",selector:{entity:{device_class:Dt.BATTERY}}},{name:"battery_current_191",selector:{entity:{device_class:Dt.CURRENT}}},{name:"battery_voltage_183",selector:{entity:{device_class:Dt.VOLTAGE}}},{name:"battery_temp_182",selector:{entity:{device_class:Dt.TEMPERATURE}}},{name:"day_battery_charge_70",selector:{entity:{device_class:Dt.ENERGY}}},{name:"day_battery_discharge_71",selector:{entity:{device_class:Dt.ENERGY}}},{name:"battery_rated_capacity",selector:{entity:{}}},{name:"battery_soh",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:"inverter_voltage_154",selector:{entity:{device_class:Dt.VOLTAGE}}},{name:"inverter_voltage_L2",selector:{entity:{device_class:Dt.VOLTAGE}}},{name:"inverter_voltage_L3",selector:{entity:{device_class:Dt.VOLTAGE}}},{name:"load_frequency_192",selector:{entity:{device_class:Dt.FREQUENCY}}},{name:"inverter_current_164",selector:{entity:{device_class:Dt.CURRENT}}},{name:"inverter_current_L2",selector:{entity:{device_class:Dt.CURRENT}}},{name:"inverter_current_L3",selector:{entity:{device_class:Dt.CURRENT}}},{name:"inverter_power_175",selector:{entity:{device_class:Dt.POWER}}},{name:"grid_power_169",selector:{entity:{device_class:Dt.POWER}}},{name:"dc_transformer_temp_90",selector:{entity:{device_class:Dt.TEMPERATURE}}},{name:"radiator_temp_91",selector:{entity:{device_class:Dt.TEMPERATURE}}},{name:"inverter_load_percentage",selector:{entity:{domain:"sensor",unit_of_measurement:"%"}}},{name:"use_timer_248",selector:{entity:{}}},{name:"priority_load_243",selector:{entity:{}}}]},{type:"expandable",title:this._title("inv_prog"),schema:[{name:"entities",type:"grid",schema:[{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:Dt.ENERGY}}},{name:"day_aux_energy",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_power",selector:{entity:{device_class:Dt.POWER}}},{name:"load_power_L1",selector:{entity:{device_class:Dt.POWER}}},{name:"load_power_L2",selector:{entity:{device_class:Dt.POWER}}},{name:"load_power_L3",selector:{entity:{device_class:Dt.POWER}}},{name:"aux_power_166",selector:{entity:{device_class:Dt.POWER}}},{name:"aux_load1",selector:{entity:{device_class:Dt.POWER}}},{name:"aux_load1_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"aux_load1_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"aux_load2",selector:{entity:{device_class:Dt.POWER}}},{name:"aux_load2_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"aux_load2_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]},{type:"expandable",title:this._title("ess_ld"),schema:[{name:"entities",type:"grid",schema:[{name:"essential_load1",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load1_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load1_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load2",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load2_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load2_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load3",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load3_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load3_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load4",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load4_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load4_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load5",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load5_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load5_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load6",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load6_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load6_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load7",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load7_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load7_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load8",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load8_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load8_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load9",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load9_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load9_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load10",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load10_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load10_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load11",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load11_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load11_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load12",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load12_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load12_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load13",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load13_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load13_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load14",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load14_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load14_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load15",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load15_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load15_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load16",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load16_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load16_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load17",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load17_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load17_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load18",selector:{entity:{device_class:Dt.POWER}}},{name:"essential_load18_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"essential_load18_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]}]},{type:"expandable",title:this._title("gri"),schema:[{name:"entities",type:"grid",schema:[{name:"day_grid_import_76",selector:{entity:{device_class:Dt.ENERGY}}},{name:"day_grid_export_77",selector:{entity:{device_class:Dt.ENERGY}}},{name:"grid_frequency",selector:{entity:{device_class:Dt.FREQUENCY}}},{name:"grid_ct_power_172",selector:{entity:{device_class:Dt.POWER}}},{name:"grid_ct_power_L2",selector:{entity:{device_class:Dt.POWER}}},{name:"grid_ct_power_L3",selector:{entity:{device_class:Dt.POWER}}},{name:"grid_voltage_L1",selector:{entity:{device_class:Dt.VOLTAGE}}},{name:"grid_voltage_L2",selector:{entity:{device_class:Dt.VOLTAGE}}},{name:"grid_voltage_L3",selector:{entity:{device_class:Dt.VOLTAGE}}},{name:"grid_current_L1",selector:{entity:{device_class:Dt.CURRENT}}},{name:"grid_current_L2",selector:{entity:{device_class:Dt.CURRENT}}},{name:"grid_current_L3",selector:{entity:{device_class:Dt.CURRENT}}},{name:"grid_ct_power_total",selector:{entity:{device_class:Dt.POWER}}},{name:"grid_voltage",selector:{entity:{device_class:Dt.VOLTAGE}}},{name:"nonessential_power",selector:{entity:{device_class:Dt.POWER}}},{name:"non_essential_load1",selector:{entity:{device_class:Dt.POWER}}},{name:"non_essential_load1_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"non_essential_load1_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"non_essential_load2",selector:{entity:{device_class:Dt.POWER}}},{name:"non_essential_load2_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"non_essential_load2_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"non_essential_load3",selector:{entity:{device_class:Dt.POWER}}},{name:"non_essential_load3_extra",selector:{entity:{device_class:Dt.ENERGY}}},{name:"non_essential_load3_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"grid_connected_status_194",selector:{entity:{}}},{name:"energy_cost_buy",selector:{entity:{}}},{name:"energy_cost_sell",selector:{entity:{}}},{name:"prepaid_units",selector:{entity:{}}},{name:"max_sell_power",selector:{entity:{device_class:Dt.POWER}}}]}]}]}],this._valueChanged.bind(this)):V(oi||(oi=gt([""])))}_title(t){return Lt("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})}};t([ut()],si.prototype,"hass",void 0),t([ut()],si.prototype,"_config",void 0),t([ut()],si.prototype,"lovelace",void 0),si=t([lt(jt)],si);var li=Object.freeze({__proto__:null,get ConfigurationCardEditor(){return si}});export{qr as PowerFlowCard}; +function gt(t,e){return(e,n,a)=>((t,e,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,n),n))(e,n,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}function ht(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var ft;const mt=((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 r(n,t,a)})(ft||(ft=ht(["\n text_debug {\n outline: 1px solid blue;\n }\n \n \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: 0;\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 .st15{font-size:8px;}\n .st16{font-size:7px;}\n\n "])));var yt,pt;!function(t){t.Azzurro="azzurro",t.CESBatteryBox="ces-battery-box",t.Deye="deye",t.E3dc="e3dc",t.FoxESS="foxess",t.Fronius="fronius",t.Goodwe="goodwe",t.GoodweGridMode="goodwe_gridmode",t.Growatt="growatt",t.Huawei="huawei",t.Lux="lux",t.MPPSolar="mppsolar",t.PowMr="powmr",t.SMASolar="smasolar",t.Solax="solax",t.SolarEdge="solaredge",t.Sofar="sofar",t.Solis="solis",t.Sunsynk="sunsynk",t.Victron="victron",t.EasunSMW8_SA="Easun SMW8kW SA"}(yt||(yt={})),function(t){t.Energy="energy",t.Power="power",t.AutoSelf="auto&self",t.No="no"}(pt||(pt={}));var vt={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_name:"DAILY SOLAR",monthly_solar_name:"MONTHLY SOLAR",yearly_solar_name:"YEARLY SOLAR",total_solar_generation_name:"TOTAL SOLAR",remaining_solar_name:"LEFT SOLAR",tomorrow_solar_name:"TOMORROW",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",pv5_name:"PV5",essential:"Essential",autarky:"Autarky",autarkySelf:"Self use",autarkyAuto:"Auto cons",discharging:"Discharging",charging:"Charging",waiting:"Waiting",standby:"Standby",no_battery:"No Battery",selftest:"Selftest",normal:"Normal",alarm:"Alarm",fault:"Fault",days:"d",hrs:"h",min:"m",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",limit:"Limit",on:"On",off:"Off",lowpower:"Low Power",bulk:"Bulk",absorption:"Absorption",float:"Float",storage:"Storage",equalize:"Equalize",passthru:"Passthru",inverting:"Inverting",powerassist:"Power Assist",powersupply:"Power Supply",sustain:"Sustain",externalcontrol:"External Control"},At={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"},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",decimal_places_energy:"Decimal Places (Daily Energy)",viewbox_min_x:"min-x",viewbox_min_y:"min-y",viewbox_width:"width",viewbox_height:"height",model:"Model",autarky:"Autarky",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_max_power:"PV1 Max Power",pv2_max_power:"PV2 Max Power",pv3_max_power:"PV3 Max Power",pv4_max_power:"PV4 Max Power",pv5_max_power:"PV5 Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",pv5_name:"PV5 Name",daily_solar_name:"Daily solar production Name",monthly_solar_name:"Monthly solar production name",yearly_solar_name:"Yearly solar production name",total_solar_generation_name:"Total solar generation name",remaining_solar_name:"Today's left solar production name",tomorrow_solar_name:"Tomorrow solar production name",display_mode:"Display Mode",visualize_efficiency:"Show PVs Efficiency",show_mppt_production:"Show PVs production",show_mppt_efficiency:"Show PVs efficiency %",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load5_name:"Load 5 Name",load6_name:"Load 6 Name",load7_name:"Load 7 Name",load8_name:"Load 8 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",load5_icon:"Load 5 Icon",load6_icon:"Load 6 Icon",load7_icon:"Load 7 Icon",load8_icon:"Load 8 Icon",aux_load1_name:"Aux Load 1 Name",aux_load2_name:"Aux Load 2 Name",aux_load1_icon:"Aux Load 1 Icon",aux_load2_icon:"Aux Load 2 Icon",aux_dynamic_colour:"Aux Dynamic Colour",off_threshold:"Off Threshold",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",animate:"Animate 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",shutdown_soc_offgrid:"Shutdown SOC (Off Grid)",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_daily_name:"Daily 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",path_threshold:"Path Threshold",label_daily_grid_buy:"Daily Grid Buy Label",label_daily_grid_sell:"Daily Grid Sell Label",cat_title:{title:"Title Options",general:"General Options",adv_viewbox:"Adv. ViewBox Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",additional_load:"Additional Load Options",aux_load:"Aux Load Options",entities:"Entities",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",inv_prog:"Programs Entities",ld:"Load Entities",ess_ld:"Essential Load Entities",gri:"Grid Entities",sensor:"Optional Sensors",max_power:"PV Max Power",mppt_options:"MPPTs options",solar_production:"Solar Production"}},bt={common:vt,errors:At,config:wt};const xt={hass:null},Et={en:Object.freeze({__proto__:null,common:vt,config:wt,default:bt,errors:At})};function Lt(t,e="",n=""){const a=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_"),o="".concat(xt.hass?.selectedLanguage||xt.hass?.locale?.language||xt.hass?.language||a);let r;try{r=t.split(".").reduce(((t,e)=>t[e]),Et[o])}catch(e){r=t.split(".").reduce(((t,e)=>t[e]),Et.en)}return void 0===r&&(r=t.split(".").reduce(((t,e)=>t[e]),Et.en)),""!==e&&""!==n&&(r=r.replace(e,n)),r}var Pt={panel_mode:!1,large_font:!1,show_solar:!0,show_battery:!0,show_grid:!0,card_height:"396px",card_width:"100%",decimal_places:2,decimal_places_energy:1,dynamic_line_width:!0,max_line_width:4,min_line_width:1,inverter:{modern:!0,colour:"grey",autarky:"power",model:yt.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,animate:!0,path_threshold:100},solar:{colour:"orange",mppts:2,animation_speed:9,max_power:8e3,pv1_name:Lt("common.pv1_name"),pv2_name:Lt("common.pv2_name"),pv3_name:Lt("common.pv3_name"),pv4_name:Lt("common.pv4_name"),pv5_name:Lt("common.pv5_name"),auto_scale:!0,display_mode:1,dynamic_colour:!0,visualize_efficiency:!0,off_threshold:10,show_mppt_production:!0,show_mppt_efficiency:!1},load:{colour:"#5fb6ad",dynamic_colour:!0,dynamic_icon:!0,aux_dynamic_colour:!0,off_threshold: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_colour:"#5fb6ad",aux_name:Lt("common.aux_name"),aux_daily_name:Lt("common.daily_aux"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",essential_name:Lt("common.essential"),load1_icon:"default",load2_icon:"default",load1_name:Lt("common.load1_name"),load2_name:Lt("common.load2_name"),auto_scale:!0,path_threshold:100},grid:{colour:"#5490c2",grid_name:Lt("common.grid_name"),label_daily_grid_buy:Lt("common.daily_grid_buy"),label_daily_grid_sell:Lt("common.daily_grid_sell"),show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:Lt("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,off_threshold:0}};const Mt=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],Ct=[0,1,2,3],Nt=[!0,!1],zt=[!0,!1],Tt=[0,1,2],kt=["off","0","off-grid","off grid","offgrid"],_t=["on","1","on-grid","on grid","ongrid"],Ot="mlk-content-card-editor";var jt,Dt,Rt,Gt,Bt,St;!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"}(jt||(jt={})),function(t){t.WATT="W",t.KILO_WATT="kW",t.MEGA_WATT="MW",t.BTU_PER_HOUR="BTU/h"}(Dt||(Dt={})),function(t){t.GIGA_JOULE="GJ",t.KILO_WATT_HOUR="kWh",t.MEGA_JOULE="MJ",t.MEGA_WATT_HOUR="MWh",t.WATT_HOUR="Wh"}(Rt||(Rt={})),function(t){t.MILLIAMPERE="mA",t.AMPERE="A"}(Gt||(Gt={})),function(t){t.MILLIVOLT="mV",t.VOLT="V"}(Bt||(Bt={})),function(t){t.HERTZ="Hz"}(St||(St={}));const It={[Rt.WATT_HOUR]:[{threshold:1e6,divisor:1e6,targetUnit:Rt.MEGA_WATT_HOUR},{threshold:1e3,divisor:1e3,targetUnit:Rt.KILO_WATT_HOUR,decimal:1}],[Rt.KILO_WATT_HOUR]:[{threshold:1e3,divisor:1e3,targetUnit:Rt.MEGA_WATT_HOUR,decimal:2}],[Rt.MEGA_WATT_HOUR]:[],[Rt.GIGA_JOULE]:[{threshold:1e3,divisor:1e3,targetUnit:Rt.MEGA_JOULE}],[Rt.MEGA_JOULE]:[],[Dt.WATT]:[{threshold:1e6,divisor:1e6,targetUnit:Dt.MEGA_WATT},{threshold:1e3,divisor:1e3,targetUnit:Dt.KILO_WATT}],[Dt.KILO_WATT]:[{threshold:1e3,divisor:1e3,targetUnit:Dt.MEGA_WATT}],[Dt.MEGA_WATT]:[],[Dt.BTU_PER_HOUR]:[]};var Ht="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Vt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Qt={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]",c="[object Object]",d="[object Proxy]",u="[object Undefined]",g=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,f={};f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f[o]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object Boolean]"]=f["[object DataView]"]=f["[object Date]"]=f["[object Error]"]=f[i]=f["[object Map]"]=f["[object Number]"]=f[c]=f["[object RegExp]"]=f["[object Set]"]=f["[object String]"]=f["[object WeakMap]"]=!1;var m="object"==typeof Ht&&Ht&&Ht.Object===Object&&Ht,y="object"==typeof self&&self&&self.Object===Object&&self,p=m||y||Function("return this")(),v=e&&!e.nodeType&&e,A=v&&t&&!t.nodeType&&t,w=A&&A.exports===v,b=w&&m.process,x=function(){try{var t=A&&A.require&&A.require("util").types;return t||b&&b.binding&&b.binding("util")}catch(t){}}(),E=x&&x.isTypedArray;var L,P=Array.prototype,M=Function.prototype,C=Object.prototype,N=p["__core-js_shared__"],z=M.toString,T=C.hasOwnProperty,k=(L=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"",_=C.toString,O=z.call(Object),j=RegExp("^"+z.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),D=w?p.Buffer:void 0,R=p.Symbol,G=p.Uint8Array;D&&D.allocUnsafe;var B,S,I=(B=Object.getPrototypeOf,S=Object,function(t){return B(S(t))}),H=Object.create,V=C.propertyIsEnumerable,Q=P.splice,U=R?R.toStringTag:void 0,W=function(){try{var t=yt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Z=D?D.isBuffer:void 0,Y=Math.max,X=Date.now,F=yt(p,"Map"),J=yt(Object,"create"),K=function(){function t(){}return function(e){if(!Nt(e))return{};if(H)return H(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function q(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1},$.prototype.set=function(t,e){var n=this.__data__,a=rt(n,t);return a<0?(++this.size,n.push([t,e])):n[a][1]=e,this},tt.prototype.clear=function(){this.size=0,this.__data__={hash:new q,map:new(F||$),string:new q}},tt.prototype.delete=function(t){var e=mt(this,t).delete(t);return this.size-=e?1:0,e},tt.prototype.get=function(t){return mt(this,t).get(t)},tt.prototype.has=function(t){return mt(this,t).has(t)},tt.prototype.set=function(t,e){var n=mt(this,t),a=n.size;return n.set(t,e),this.size+=n.size==a?0:1,this},et.prototype.clear=function(){this.__data__=new $,this.size=0},et.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},et.prototype.get=function(t){return this.__data__.get(t)},et.prototype.has=function(t){return this.__data__.has(t)},et.prototype.set=function(t,e){var n=this.__data__;if(n instanceof $){var a=n.__data__;if(!F||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new tt(a)}return n.set(t,e),this.size=n.size,this};var st=function(t,e,n){for(var a=-1,o=Object(t),r=n(t),i=r.length;i--;){var s=r[++a];if(!1===e(o[s],s,o))break}return t};function lt(t){return null==t?void 0===t?u:l:U&&U in Object(t)?function(t){var e=T.call(t,U),n=t[U];try{t[U]=void 0;var a=!0}catch(t){}var o=_.call(t);a&&(e?t[U]=n:delete t[U]);return o}(t):function(t){return _.call(t)}(t)}function ct(t){return zt(t)&<(t)==o}function dt(t){return!(!Nt(t)||function(t){return!!k&&k in t}(t))&&(Mt(t)?j:g).test(function(t){if(null!=t){try{return z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function ut(t){if(!Nt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=vt(t),n=[];for(var a in t)("constructor"!=a||!e&&T.call(t,a))&&n.push(a);return n}function gt(t,e,n,a,o){t!==e&&st(e,(function(r,i){if(o||(o=new et),Nt(r))!function(t,e,n,a,o,r,i){var s=At(t,n),l=At(e,n),d=i.get(l);if(d)return void at(t,n,d);var u=r?r(s,l,n+"",t,e,i):void 0,g=void 0===u;if(g){var h=Et(l),f=!h&&Pt(l),m=!h&&!f&&Tt(l);u=l,h||f||m?Et(s)?u=s:zt(y=s)&&Lt(y)?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)}}(ft);function bt(t,e){return t===e||t!=t&&e!=e}var xt=ct(function(){return arguments}())?ct:function(t){return zt(t)&&T.call(t,"callee")&&!V.call(t,"callee")},Et=Array.isArray;function Lt(t){return null!=t&&Ct(t.length)&&!Mt(t)}var Pt=Z||function(){return!1};function Mt(t){if(!Nt(t))return!1;var e=lt(t);return e==i||e==s||e==r||e==d}function Ct(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Nt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function zt(t){return null!=t&&"object"==typeof t}var Tt=E?function(t){return function(e){return t(e)}}(E):function(t){return zt(t)&&Ct(t.length)&&!!f[lt(t)]};function kt(t){return Lt(t)?nt(t):ut(t)}var _t,Ot=(_t=function(t,e,n){gt(t,e,n)},ht((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=_t.length>3&&"function"==typeof o?(a--,o):void 0,r&&function(t,e,n){if(!Nt(n))return!1;var a=typeof e;return!!("number"==a?Lt(n)&&pt(e,n.length):"string"==a&&e in n)&&bt(n[e],t)}(e[0],e[1],r)&&(o=a<3?void 0:o,a=1),t=Object(t);++n=0&&(o=parseFloat(o.toFixed(e))),n&&(o*=-1),a&&(o=Math.abs(o)),o)}static convertValue(t,e=2){return e=Number.isNaN(e)?2:e,Math.abs(t)>=1e6?"".concat((t/1e6).toFixed(e)," MW"):Math.abs(t)>=1e3?"".concat((t/1e3).toFixed(e)," kW"):"".concat(Math.round(t)," W")}static convertValueNew(t,e="",n=2){n=isNaN(n)?2:n;const a=Number(t);if(isNaN(a))return Number(0).toFixed(n);const o=It[e];if(!o)return"".concat(this.toNum(a,n)," ").concat(e);if(e===Dt.WATT&&Math.abs(a)<1e3)return"".concat(Math.round(a)," ").concat(e);if(e===Dt.KILO_WATT&&Math.abs(a)<1)return"".concat(Math.round(1e3*a)," W");if(e===Dt.MEGA_WATT&&Math.abs(a)<1)return"".concat((1e3*a).toFixed(n)," kW");for(const t of o)if(Math.abs(a)>=t.threshold){const e=(a/t.divisor).toFixed(t.decimal||n);return"".concat(e," ").concat(t.targetUnit)}return"".concat(a.toFixed(n)," ").concat(e)}static handlePopup(t,e){e&&(t.preventDefault(),this._handleClick(t,{action:"more-info"},e))}static _handleClick(t,e,n){if(t&&n)if(t.stopPropagation(),"more-info"===e.action)this._dispatchMoreInfoEvent(t,n);else console.warn("Action '".concat(e.action,"' is not supported."))}static _dispatchMoreInfoEvent(t,e){if(Hn.isPopupOpen)return;Hn.isPopupOpen=!0;const n=new CustomEvent("hass-more-info",{composed:!0,detail:{entityId:e}});history.pushState({popupOpen:!0},"",window.location.href),t.target.dispatchEvent(n);const a=()=>{Hn.isPopupOpen&&(Hn.isPopupOpen=!1,window.removeEventListener("popstate",a),history.back())};window.addEventListener("popstate",a,{once:!0})}}Hn.isPopupOpen=!1;class Vn{static generateDailyLoad(t,e){return Q(Ut||(Ut=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),(t=>Hn.handlePopup(t,e.entities.day_load_energy_84)),this.LOAD_X-5,t.loadShowDaily&&t.stateDayLoadEnergy.isValid()?"":"none",t.loadColour,t.stateDayLoadEnergy?.toPowerString(!0,t.decimalPlacesEnergy),this.LOAD_X-5,t.loadShowDaily?"".concat(t.loadColour):"transparent",Lt("common.daily_load"))}static generateFlowLines(t,e){const n=this.LOAD_X+3-264.7-70,a=264.7+n/2,o=a+70,r=o+n/2,i="M ".concat(264.7," 218.5 L ").concat(a," 218.5"),s="M ".concat(o," 218.5 L ").concat(r," 218.5");return Q(Wt||(Wt=ht(['\n\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t'])),i,e.load.dynamic_colour?t.flowColour:t.loadColour,t.loadLineWidth,Math.min(2+t.loadLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.essentialPower?"transparent":"".concat(e.load.dynamic_colour?t.flowColour:t.loadColour),t.durationCur.load,s,e.load.dynamic_colour?t.flowColour:t.loadColour,t.loadLineWidth,Math.min(2+t.loadLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.essentialPower?"transparent":"".concat(e.load.dynamic_colour?t.flowColour:t.loadColour),t.durationCur.load)}static generatePowers(t,e){const n=400+(this.LOAD_X-400)/2-30;return Q(Zt||(Zt=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),n,e.inverter.three_phase&&e.entities?.load_power_L1?"":"none",t.loadColour,e.load.auto_scale?"".concat(Hn.convertValue(t.loadPowerL1,t.decimalPlaces)||0):"".concat(t.loadPowerL1||0," ").concat(Dt.WATT),n,e.inverter.three_phase&&e.entities?.load_power_L2?"":"none",t.loadColour,e.load.auto_scale?"".concat(Hn.convertValue(t.loadPowerL2,t.decimalPlaces)||0):"".concat(t.loadPowerL2||0," ").concat(Dt.WATT),n,e.inverter.three_phase&&e.entities?.load_power_L3?"":"none",t.loadColour,e.load.auto_scale?"".concat(Hn.convertValue(t.loadPowerL3,t.decimalPlaces)||0):"".concat(t.loadPowerL3||0," ").concat(Dt.WATT))}static generateShapeAndName(t,e){const n=400+(this.LOAD_X-400)/2-101.3;return Q(Yt||(Yt=ht(['\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),n,t.loadColour,n+3,t.loadColour,e.load.essential_name)}static generateTotalLoad(t,e){const n=400+(this.LOAD_X-400)/2-65.3;return Q(Xt||(Xt=ht(["\n\t\t\t","\n\t\t"])),e.entities?.essential_power&&"none"!==e.entities.essential_power?Q(Ft||(Ft=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\t\n\t\t\t\t"])),(t=>Hn.handlePopup(t,e.entities.essential_power)),n,!0!==t.largeFont?"st14":"st4",t.loadColour,e.load.auto_scale?"".concat(Hn.convertValue(t.essentialPower,t.decimalPlaces)||0):"".concat(t.essentialPower||0," ").concat(Dt.WATT)):Q(Jt||(Jt=ht(['\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t"])),n,!0!==t.largeFont?"st14":"st4",t.loadColour,e.load.auto_scale?"".concat(Hn.convertValue(t.essentialPower,t.decimalPlaces)||0):"".concat(t.essentialPower||0," ").concat(Dt.WATT)))}static generateIcon(t,e){return Q(Kt||(Kt=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t'])),1===t.essIconSize?this.LOAD_X+5:this.LOAD_X+2,1===t.essIconSize?"186":"177.5",1===t.essIconSize?"75":"79",1===t.essIconSize?"75":"79",t.gridPercentage>0?t.gridColour:t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage,t.gridPercentage>0?t.gridColour:t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage,t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage+t.batteryPercentage,t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage+t.batteryPercentage,t.solarColour,t.solarColour,e.load.dynamic_colour?"url(#Lg)":t.loadColour,t.essIcon)}}Vn.LOAD_X=418,Vn.GAP=8,Vn.rowAux=3,Vn.row1=35,Vn.row2=110,Vn.row3=185,Vn.row4=260,Vn.row5=335,Vn.column1=Vn.LOAD_X-43-Vn.GAP/2,Vn.column2=Vn.LOAD_X,Vn.column3=Vn.column2+43+Vn.GAP/2,Vn.column4=Vn.column3+43+Vn.GAP/2,Vn.column5=Vn.column4+43+Vn.GAP/2,Vn.yGaps=[26,55,37,67],Vn.xGaps=[53,43,63.5];class Qn{static getIconWithCondition(t,e,n,a,o,r=30){return Q(qt||(qt=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
'])),t?"":"none",e,n,r,r,a,o)}static getIcon(t,e,n,a,o=30){return Q($t||($t=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
'])),t,e,o,o,n,a)}static getIconLink(t,e){return Q(te||(te=ht(["\n\t\t","\n\t\t"])),t?Q(ee||(ee=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t\t",'\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t\n\t\t\t"])),n,t,e,o,r,a,c.isValid()||m.isValidSwitch()?"":"none",t,e,s,l,a,i?"".concat(i):"",!c.isValid()&&m.isValidSwitch()?Q(oe||(oe=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t"])),(t=>Hn.handlePopup(t,m.entity_id)),t,e,d,u,a,Lt("common."+(m?.toOnOff()||"off"))):Q(re||(re=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\t\n\t\t\t\t"])),(t=>Hn.handlePopup(t,c.entity_id)),t,e,d,u,c.isValid()?"":"none",a,c?.toPowerString(y,p)),(t=>Hn.handlePopup(t,g.entity_id)),t,e,h,f,g.isValid()?"":"none",a,g.toNum(1),g.getUOM())}static generateEssentialLoad(t,e,n,a,o,r,i,s,l,c,d,u=Vn.xGaps,g=Vn.yGaps){const h=Qn.getIconLink(i.entity_id,Qn.getIcon(c+u[0],d,e,"essload".concat(t,"_small-icon")));return Q(ie||(ie=ht(["\n\t\t\t\t",""])),Qn.generateLoadItem("es",t,h,n,c+u[1],d+g[0],a,c+u[2],d+g[1],o,c+u[2],d+g[2],r,c+u[2],d+g[3],i,s,l))}static generateGridLoad(t,e,n,a,o,r,i,s,l,c,d,u=Vn.xGaps,g=Vn.yGaps){const h=Qn.getIconLink(i.entity_id,Qn.getIcon(c+u[0],d,e,"nes-load".concat(t,"_small-icon")));return Q(se||(se=ht(["\n\t\t\t\t",""])),Qn.generateLoadItem("nes",t,h,n,c+u[1],d+g[0],a,c+u[2],d+g[1],o,c+u[2],d+g[2],r,c+u[2],d+g[3],i,s,l))}static generateAuxLoad(t,e,n,a,o,r,i,s,l,c,d,u=Vn.xGaps,g=Vn.yGaps){const h=Qn.getIconLink(i.entity_id,Qn.getIcon(c+u[0],d,e,"aux-load".concat(t,"_small-icon")));return Q(le||(le=ht(["\n\t\t\t\t",""])),Qn.generateLoadItem("aux",t,h,n,c+u[1],d+g[0],a,c+u[2],d+g[1],o,c+u[2],d+g[2],r,c+u[2],d+g[3],i,s,l))}static generateFrequency(t,e,n,a,o,r){return t?.isValid()?Q(ce||(ce=ht(['\n \n '," ","\n \n "])),(e=>Hn.handlePopup(e,t?.entity_id)),n,a,o,t?.isValid()?"":"none",r,e,t.toStr(1,!1),St.HERTZ):""}static generatePhaseAmperage(t,e,n,a,o){return Q(de||(de=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t'," ","\n\t\t\t\t\n\t\t\t"])),(t=>Hn.handlePopup(t,e.entity_id)),t,n,a,e.isValid()?"":"none",o,e.toStr(1)||0,Gt.AMPERE)}static generatePhaseVoltage(t,e,n,a,o){return Q(ue||(ue=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t'," ","\n\t\t\t\t\n\t\t\t"])),(t=>Hn.handlePopup(t,e.entity_id)),t,n,a,e.isValid()?"":"none",o,e.toStr(1)||0,Bt.VOLT)}static generatePhasePower(t,e,n,a,o,r,i){return Q(ge||(ge=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t"])),(t=>Hn.handlePopup(t,e.entity_id)),t,n,a,e.isValid()?"":"none",r,o?"".concat(Hn.convertValue(e,i)||0):"".concat(e||0," ").concat(Dt.WATT))}}class Un{static generateLines(t,e){const n=e.load.show_aux||!1,a=Vn.column2+Vn.xGaps[1]-(Vn.column2-Vn.column1-41)/2,o="M ".concat(a," 190 L ").concat(a," ").concat(n?"171.5":"156"),r="M ".concat(a," 190 L ").concat(a," 156"),i="M ".concat(a," 286 L ").concat(a," 247"),s="M ".concat(a," 362 L ").concat(a," 306"),l="M ".concat(a," 136 L ").concat(a," 81");return t.additionalLoad>8?Q(he||(he=ht([""]))):Q(fe||(fe=ht(['\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t'])),o,t.additionalLoad<4?"":"st12",t.loadColour,r,t.additionalLoad>=4?"":"st12",t.loadColour,i,t.additionalLoad>=2?"":"st12",t.loadColour,s,t.additionalLoad>=5?"":"st12",t.loadColour,l,t.additionalLoad>=7&&!e.load.show_aux?"":"st12",t.loadColour)}static generateLoad1(t,e){const n=e.load.show_aux||!1,a=this.mainX+5,o=this.mainX,r=this.mainX+42,i=this.mainX+45,s=Qn.getIconWithCondition(t.additionalLoad<=3,a,n?113:95,t.iconEssentialLoad1,"essload1-icon",36),l=Qn.getIconLink(t.stateEssentialLoad1Toggle.entity_id,s);return Q(me||(me=ht(["",""])),t.additionalLoad>=4?Q(ye||(ye=ht(["\n\t\t\t",""])),Qn.generateEssentialLoad(1,t.iconEssentialLoad1,t.dynamicColourEssentialLoad1,e.load?.load1_name,t.stateEssentialLoad1,t.stateEssentialLoad1Extra,t.stateEssentialLoad1Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column1,Vn.row2)):Q(pe||(pe=ht(["","\n\t\t\t"])),t.additionalLoad>=1?Q(ve||(ve=ht(["\n\t\t\t\t\t",'\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t','\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\n\t\t\t\t\t"])),l,o,n?"141":"126",t.dynamicColourEssentialLoad1,t.additionalLoad<=3?"":"none",n?i:r,n?"133":"118",t.additionalLoad<=3?"":"none",t.dynamicColourEssentialLoad1,e.load?.load1_name?"".concat(e.load.load1_name):"",(e=>Hn.handlePopup(e,t.stateEssentialLoad1.entity_id)),r,n?"158":"143",t.additionalLoad<=3&&t.stateEssentialLoad1.isValid()?"":"none",!0!==t.largeFont?"st14":"st4",t.dynamicColourEssentialLoad1,t.stateEssentialLoad1?.toPowerString(e.load.auto_scale,t.decimalPlaces),(e=>Hn.handlePopup(e,t.stateEssentialLoad1Extra.entity_id)),i,n?"182":"167",t.stateEssentialLoad1Extra.entity_id&&t.additionalLoad<=3&&t.stateEssentialLoad1Extra.isValid()?"":"none",t.dynamicColourEssentialLoad1,t.stateEssentialLoad1Extra.toNum(1),t.stateEssentialLoad1Extra.getUOM()):""))}static generateLoad2(t,e){const n=this.mainX+5,a=this.mainX,o=this.mainX+42,r=this.mainX+45,i=Qn.getIcon(n,250,t.iconEssentialLoad2,"essload2-icon",36),s=Qn.getIconLink(t.stateEssentialLoad2Toggle.entity_id,i);return Q(Ae||(Ae=ht(["",""])),t.additionalLoad>=4?Q(we||(we=ht(["\n\t\t\t",""])),Qn.generateEssentialLoad(2,t.iconEssentialLoad2,t.dynamicColourEssentialLoad2,e.load?.load2_name,t.stateEssentialLoad2,t.stateEssentialLoad2Extra,t.stateEssentialLoad2Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column2,Vn.row2)):Q(be||(be=ht(["",""])),3===t.additionalLoad?Q(xe||(xe=ht(["\n\t\t\t\t\t",""])),Qn.generateEssentialLoad(2,t.iconEssentialLoad2,t.dynamicColourEssentialLoad2,e.load?.load2_name,t.stateEssentialLoad2,t.stateEssentialLoad2Extra,t.stateEssentialLoad2Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column1,Vn.row4)):Q(Ee||(Ee=ht(["",""])),2===t.additionalLoad?Q(Le||(Le=ht(["\n\t\t\t\t\t\t",'\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t"])),s,a,t.dynamicColourEssentialLoad2,o,t.dynamicColourEssentialLoad2,e.load?.load2_name?"".concat(e.load.load2_name):"",(e=>Hn.handlePopup(e,t.stateEssentialLoad2.entity_id)),o,t.stateEssentialLoad2.isValid()?"":"none",!0!==t.largeFont?"st14":"st4",t.dynamicColourEssentialLoad2,t.stateEssentialLoad2?.toPowerString(e.load.auto_scale,t.decimalPlaces),(e=>Hn.handlePopup(e,t.stateEssentialLoad2Extra.entity_id)),r,t.stateEssentialLoad2Extra.isValid()?"":"none",t.dynamicColourEssentialLoad2,t.stateEssentialLoad2Extra.toNum(1),t.stateEssentialLoad2Extra.getUOM()):Q(Pe||(Pe=ht([""]))))))}static generateLoad3(t,e){return Q(Me||(Me=ht(["",""])),3===t.additionalLoad?Q(Ce||(Ce=ht(["\n\t\t\t\t",""])),Qn.generateEssentialLoad(3,t.iconEssentialLoad3,t.dynamicColourEssentialLoad3,e.load?.load3_name,t.stateEssentialLoad3,t.stateEssentialLoad3Extra,t.stateEssentialLoad3Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column2,Vn.row4)):Q(Ne||(Ne=ht(["",""])),t.additionalLoad>=4?Q(ze||(ze=ht(["\n\t\t\t\t\t",""])),Qn.generateEssentialLoad(3,t.iconEssentialLoad3,t.dynamicColourEssentialLoad3,e.load?.load3_name,t.stateEssentialLoad3,t.stateEssentialLoad3Extra,t.stateEssentialLoad3Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column1,Vn.row4)):Q(Te||(Te=ht([""])))))}static generateLoad4(t,e){return Q(ke||(ke=ht(["",""])),t.additionalLoad>=4?Q(_e||(_e=ht(["\n\t\t\t\t",""])),Qn.generateEssentialLoad(4,t.iconEssentialLoad4,t.dynamicColourEssentialLoad4,e.load?.load4_name,t.stateEssentialLoad4,t.stateEssentialLoad4Extra,t.stateEssentialLoad4Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column2,Vn.row4)):Q(Oe||(Oe=ht([""]))))}static generateLoad5(t,e){return Q(je||(je=ht(["",""])),t.additionalLoad>=5?Q(De||(De=ht(["\n\t\t\t\t",""])),Qn.generateEssentialLoad(5,t.iconEssentialLoad5,t.dynamicColourEssentialLoad5,e.load?.load5_name,t.stateEssentialLoad5,t.stateEssentialLoad5Extra,t.stateEssentialLoad5Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column1,Vn.row5)):Q(Re||(Re=ht([""]))))}static generateLoad6(t,e){return Q(Ge||(Ge=ht(["",""])),t.additionalLoad>=6?Q(Be||(Be=ht(["\n\t\t\t\t",""])),Qn.generateEssentialLoad(6,t.iconEssentialLoad6,t.dynamicColourEssentialLoad6,e.load?.load6_name,t.stateEssentialLoad6,t.stateEssentialLoad6Extra,t.stateEssentialLoad6Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column2,Vn.row5)):Q(Se||(Se=ht([""]))))}static generateLoad7(t,e){return Q(Ie||(Ie=ht(["",""])),t.additionalLoad>=7&&!e.load.show_aux?Q(He||(He=ht(["\n\t\t\t\t",""])),Qn.generateEssentialLoad(7,t.iconEssentialLoad7,t.dynamicColourEssentialLoad7,e.load?.load7_name,t.stateEssentialLoad7,t.stateEssentialLoad7Extra,t.stateEssentialLoad7Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column1,Vn.row1)):Q(Ve||(Ve=ht([""]))))}static generateLoad8(t,e){return Q(Qe||(Qe=ht(["",""])),t.additionalLoad>=8&&!e.load.show_aux?Q(Ue||(Ue=ht(["\n\t\t\t\t",""])),Qn.generateEssentialLoad(8,t.iconEssentialLoad8,t.dynamicColourEssentialLoad8,e.load?.load8_name,t.stateEssentialLoad8,t.stateEssentialLoad8Extra,t.stateEssentialLoad8Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column2,Vn.row1)):Q(We||(We=ht([""]))))}static generateLoad9(t,e){return Q(Ze||(Ze=ht(["",""])),t.additionalLoad>=9&&!e.load.show_aux?Q(Ye||(Ye=ht(["\n\t\t\t\t",""])),Qn.generateEssentialLoad(9,t.iconEssentialLoad9,t.dynamicColourEssentialLoad9,e.load?.load9_name,t.stateEssentialLoad9,t.stateEssentialLoad9Extra,t.stateEssentialLoad9Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column3,Vn.row1)):Q(Xe||(Xe=ht([""]))))}static generateLoad10(t,e){return Q(Fe||(Fe=ht(["",""])),t.additionalLoad>=10?Q(Je||(Je=ht(["\n\t\t\t\t",""])),Qn.generateEssentialLoad(10,t.iconEssentialLoad10,t.dynamicColourEssentialLoad10,e.load?.load10_name,t.stateEssentialLoad10,t.stateEssentialLoad10Extra,t.stateEssentialLoad10Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column3,Vn.row2)):Q(Ke||(Ke=ht([""]))))}static generateLoad11(t,e){return Q(qe||(qe=ht(["",""])),t.additionalLoad>=11?Q($e||($e=ht(["\n\t\t\t",""])),Qn.generateEssentialLoad(11,t.iconEssentialLoad11,t.dynamicColourEssentialLoad11,e.load?.load11_name,t.stateEssentialLoad11,t.stateEssentialLoad11Extra,t.stateEssentialLoad11Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column3,Vn.row3)):Q(tn||(tn=ht([""]))))}static generateLoad12(t,e){return Q(en||(en=ht(["",""])),t.additionalLoad>=12?Q(nn||(nn=ht(["\n\t\t\t",""])),Qn.generateEssentialLoad(12,t.iconEssentialLoad12,t.dynamicColourEssentialLoad12,e.load?.load12_name,t.stateEssentialLoad12,t.stateEssentialLoad12Extra,t.stateEssentialLoad12Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column3,Vn.row4)):Q(an||(an=ht([""]))))}static generateLoad13(t,e){return Q(on||(on=ht(["",""])),t.additionalLoad>=13?Q(rn||(rn=ht(["\n\t\t\t",""])),Qn.generateEssentialLoad(13,t.iconEssentialLoad13,t.dynamicColourEssentialLoad13,e.load?.load13_name,t.stateEssentialLoad13,t.stateEssentialLoad13Extra,t.stateEssentialLoad13Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column3,Vn.row5)):Q(sn||(sn=ht([""]))))}static generateLoad14(t,e){return Q(ln||(ln=ht(["",""])),t.additionalLoad>=14&&!e.load.show_aux?Q(cn||(cn=ht(["\n\t\t\t\t",""])),Qn.generateEssentialLoad(14,t.iconEssentialLoad14,t.dynamicColourEssentialLoad14,e.load?.load14_name,t.stateEssentialLoad14,t.stateEssentialLoad14Extra,t.stateEssentialLoad14Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column4,Vn.row1)):Q(dn||(dn=ht([""]))))}static generateLoad15(t,e){return Q(un||(un=ht(["",""])),t.additionalLoad>=15?Q(gn||(gn=ht(["\n\t\t\t\t",""])),Qn.generateEssentialLoad(15,t.iconEssentialLoad15,t.dynamicColourEssentialLoad15,e.load?.load15_name,t.stateEssentialLoad15,t.stateEssentialLoad15Extra,t.stateEssentialLoad15Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column4,Vn.row2)):Q(hn||(hn=ht([""]))))}static generateLoad16(t,e){return Q(fn||(fn=ht(["",""])),t.additionalLoad>=16?Q(mn||(mn=ht(["\n\t\t\t",""])),Qn.generateEssentialLoad(16,t.iconEssentialLoad16,t.dynamicColourEssentialLoad16,e.load?.load16_name,t.stateEssentialLoad16,t.stateEssentialLoad16Extra,t.stateEssentialLoad16Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column4,Vn.row3)):Q(yn||(yn=ht([""]))))}static generateLoad17(t,e){return Q(pn||(pn=ht(["",""])),t.additionalLoad>=17?Q(vn||(vn=ht(["\n\t\t\t",""])),Qn.generateEssentialLoad(17,t.iconEssentialLoad17,t.dynamicColourEssentialLoad17,e.load?.load17_name,t.stateEssentialLoad17,t.stateEssentialLoad17Extra,t.stateEssentialLoad17Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column4,Vn.row4)):Q(An||(An=ht([""]))))}static generateLoad18(t,e){return Q(wn||(wn=ht(["",""])),t.additionalLoad>=18&&!e.load.show_aux?Q(bn||(bn=ht(["\n\t\t\t",""])),Qn.generateEssentialLoad(18,t.iconEssentialLoad18,t.dynamicColourEssentialLoad18,e.load?.load18_name,t.stateEssentialLoad18,t.stateEssentialLoad18Extra,t.stateEssentialLoad18Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column4,Vn.row5)):Q(xn||(xn=ht([""]))))}static generateLoad19(t,e){return Q(En||(En=ht(["",""])),t.additionalLoad>=19&&!e.load.show_aux?Q(Ln||(Ln=ht(["\n\t\t\t\t",""])),Qn.generateEssentialLoad(19,t.iconEssentialLoad19,t.dynamicColourEssentialLoad19,e.load?.load19_name,t.stateEssentialLoad19,t.stateEssentialLoad19Extra,t.stateEssentialLoad19Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column5,Vn.row1)):Q(Pn||(Pn=ht([""]))))}static generateLoad20(t,e){return Q(Mn||(Mn=ht(["",""])),t.additionalLoad>=20?Q(Cn||(Cn=ht(["\n\t\t\t\t",""])),Qn.generateEssentialLoad(20,t.iconEssentialLoad20,t.dynamicColourEssentialLoad20,e.load?.load20_name,t.stateEssentialLoad20,t.stateEssentialLoad20Extra,t.stateEssentialLoad20Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column5,Vn.row2)):Q(Nn||(Nn=ht([""]))))}static generateLoad21(t,e){return Q(zn||(zn=ht(["",""])),t.additionalLoad>=21?Q(Tn||(Tn=ht(["\n\t\t\t",""])),Qn.generateEssentialLoad(21,t.iconEssentialLoad21,t.dynamicColourEssentialLoad21,e.load?.load21_name,t.stateEssentialLoad21,t.stateEssentialLoad21Extra,t.stateEssentialLoad21Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column5,Vn.row3)):Q(kn||(kn=ht([""]))))}static generateLoad22(t,e){return Q(_n||(_n=ht(["",""])),t.additionalLoad>=22?Q(On||(On=ht(["\n\t\t\t",""])),Qn.generateEssentialLoad(22,t.iconEssentialLoad22,t.dynamicColourEssentialLoad22,e.load?.load22_name,t.stateEssentialLoad22,t.stateEssentialLoad22Extra,t.stateEssentialLoad22Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column5,Vn.row4)):Q(jn||(jn=ht([""]))))}static generateLoad23(t,e){return Q(Dn||(Dn=ht(["",""])),t.additionalLoad>=23?Q(Rn||(Rn=ht(["\n\t\t\t",""])),Qn.generateEssentialLoad(23,t.iconEssentialLoad23,t.dynamicColourEssentialLoad23,e.load?.load23_name,t.stateEssentialLoad23,t.stateEssentialLoad23Extra,t.stateEssentialLoad23Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column5,Vn.row5)):Q(Gn||(Gn=ht([""]))))}}Un.mainX=Vn.LOAD_X;class Wn{static getTexts(t){const e=this.mainX,n=this.mainX+46;return Q(Bn||(Bn=ht(['\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t\n\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t',"\n\t\t\t \n "])),e,this.mainY,t.enableAutarky===pt.No?"none":"",t.enableAutarky===pt.Energy?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyEnergy,n,this.mainY,t.enableAutarky===pt.No?"none":"",t.enableAutarky===pt.Energy?"st4 st8 left-align":"st12",t.inverterColour,t.ratioEnergy,e,this.mainY,t.enableAutarky===pt.No?"none":"",t.enableAutarky===pt.Power?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyPower,n,this.mainY,t.enableAutarky===pt.No?"none":"",t.enableAutarky===pt.Power?"st4 st8 left-align":"st12",t.inverterColour,t.ratioPower,e,this.mainY,t.enableAutarky===pt.No?"none":"",t.enableAutarky===pt.AutoSelf?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyAuto,n,this.mainY,t.enableAutarky===pt.No?"none":"",t.enableAutarky===pt.AutoSelf?"st4 st8 left-align":"st12",t.inverterColour,t.autarkySelf,e,this.mainY+13,t.enableAutarky===pt.No?"none":"",t.inverterColour,t.enableAutarky===pt.AutoSelf?Lt("common.autarkyAuto"):Lt("common.autarky"),n,this.mainY+13,t.enableAutarky===pt.No?"none":"",t.inverterColour,t.enableAutarky===pt.AutoSelf?Lt("common.autarkySelf"):Lt("common.ratio"))}}Wn.mainX=150,Wn.mainY=267;class Zn{static getStyle(t){return V(Sn||(Sn=ht(["\n\t\t\t"])),t.dynamicColourEssentialLoad1,t.dynamicColourEssentialLoad2,t.dynamicColourEssentialLoad1,t.dynamicColourEssentialLoad2,t.dynamicColourEssentialLoad3,t.dynamicColourEssentialLoad4,t.dynamicColourEssentialLoad5,t.dynamicColourEssentialLoad6,t.dynamicColourEssentialLoad7,t.dynamicColourEssentialLoad8,t.dynamicColourEssentialLoad9,t.dynamicColourEssentialLoad10,t.dynamicColourEssentialLoad11,t.dynamicColourEssentialLoad12,t.dynamicColourEssentialLoad13,t.dynamicColourEssentialLoad14,t.dynamicColourEssentialLoad15,t.dynamicColourEssentialLoad16,t.dynamicColourEssentialLoad17,t.dynamicColourEssentialLoad18,t.auxDynamicColourLoad1,t.auxDynamicColourLoad2,t.dynamicColourNonEssentialLoad,t.dynamicColourNonEssentialLoad1,t.dynamicColourNonEssentialLoad2,t.dynamicColourNonEssentialLoad3,t.customGridIconColour,t.inverterColour)}}const Yn="m15 13l-4 4v-3H2v-2h9V9l4 4M5 20v-4h2v2h10v-7.81l-5-4.5L7.21 10H4.22L12 3l10 9h-3v8H5Z",Xn="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",Fn="M5 20v-8H2l10-9l10 9h-3v8zm7-14.31l-5 4.5V18h10v-7.81zM11.5 18v-4H9l3.5-7v4H15z",Jn="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",Kn="M35 887 l-27 -23 0 -404 0 -404 27 -23 c26 -23 28 -23 329 -23 284 0 305 1 327 19 l24 19 0 412 0 412 -24 19 c-22 18 -43 19 -327 19 -301 0 -303 0 -329 -23z m585 -157 l0 -80 -255 0 -255 0 0 80 0 80 255 0 255 0 0 -80z m-242 -229 c44 -34 40 -46 -14 -46 -60 0 -97 -38 -93 -94 5 -64 -23 -80 -35 -20 -9 44 24 113 63 134 35 18 34 15 21 50 -11 29 -14 30 58 -24z m110 -129 c4 -51 -19 -97 -59 -117 -27 -14 -30 -20 -23 -48 l6 -31 -51 43 c-29 24 -49 46 -46 49 3 4 23 5 44 3 58 -4 95 32 97 95 3 60 1 57 17 52 6 -3 13 -23 15 -46z",qn="M15 1H9v2h6V1zm-4 13h2V8h-2v6zm8.03-6.61l1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42A8.962 8.962 0 0 0 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9a8.994 8.994 0 0 0 7.03-14.61zM12 20c-3.87 0-7-3.13-7-7s3.13-7 7-7s7 3.13 7 7s-3.13 7-7 7z",$n="m19.95 17.15l-1.5-1.5q.275-.675.413-1.337T19 13q0-2.9-2.05-4.95T12 6q-.6 0-1.275.125t-1.4.4l-1.5-1.5q.95-.5 2.012-.763T12 4q1.5 0 2.938.5t2.712 1.45l1.4-1.4l1.4 1.4l-1.4 1.4q.95 1.275 1.45 2.713T21 13q0 1.05-.263 2.087t-.787 2.063ZM13 10.2V8h-2v.2l2 2Zm6.8 12.4l-2.4-2.4q-1.2.875-2.588 1.338T12 22q-1.85 0-3.488-.713T5.65 19.35q-1.225-1.225-1.938-2.863T3 13q0-1.5.463-2.888T4.8 7.6L1.4 4.2l1.4-1.4l18.4 18.4l-1.4 1.4ZM12 20q1.05 0 2.05-.325t1.875-.925L6.2 9.025q-.6.875-.9 1.875T5 13q0 2.9 2.05 4.95T12 20ZM9 3V1h6v2H9Zm2.075 10.875Zm2.825-2.8Z",ta="m5.18 5.45l-1.78-.9L4.66 2h8.47l1.27 2.55l-1.78.89L11.9 4h-6l-.72 1.45M15.5 8H11l-.8-3H7.6l-.79 3H2.28L1 10.55l1.79.89L3.5 10h10.78l.72 1.45l1.79-.89L15.5 8m-.83 14H12.6l-.24-.9l-3.46-5.2l-3.47 5.2l-.23.9H3.13L6 11h2.09l-.36 1.35L8.9 14.1l1.16-1.75L9.71 11h2.07l2.89 11M8.3 15l-.9-1.35l-1.18 4.48L8.3 15m3.28 3.12l-1.18-4.48L9.5 15l2.08 3.12M23 16l-4-4v3h-4v2h4v3l4-4Z",ea="M 26 16 L 22 12 L 22 15 L 18 15 L 18 17 L 22 17 L 22 20 L 26 16 Z M 22.1 21.5 L 2.4 1.7 L 1.1 3 L 6.1 8 L 5.4 8 L 4.1 10.5 L 5.9 11.4 L 6.6 10 L 8.1 10 L 9.1 11 L 6.2 22 L 8.3 22 L 8.5 21.1 L 12 15.9 L 15.5 21.1 L 15.7 22 L 17.8 22 L 17 18.8 L 20.9 22.7 L 22.1 21.5 M 9.3 18.1 L 10.5 13.6 L 11.4 14.9 L 9.3 18.1 M 14.7 18.1 L 12.6 15 L 12.8 14.7 L 14.1 16 L 14.7 18.1 M 14.2 11 L 14.9 11 L 15.1 11.9 L 14.2 11 M 14.1 8 L 18.6 8 L 19.9 10.6 L 18.1 11.5 L 17.4 10 L 13.2 10 L 10.2 7 L 10.7 5 L 13.3 5 L 14.1 8 M 8.4 5.2 L 6.9 3.7 L 7.8 2 L 16.3 2 L 17.6 4.5 L 15.8 5.4 L 15 4 L 9 4 L 8.4 5.2 Z",na="M15.95 21.175L13.1 18.35l1.425-1.4l1.425 1.4l3.525-3.525l1.425 1.4l-4.95 4.95ZM8 22q-.425 0-.713-.288T7 21V5q0-.425.288-.713T8 4h2V2h4v2h2q.425 0 .713.288T17 5v7q-.525 0-1.025.088T15 12.35V6H9v14h2.35q.2.575.488 1.075t.687.925H8Zm1-2h2.35H11h.35H9Z",aa="m15 13l-4 4v-3H2v-2h9V9l4 4M5 20v-4h2v2h10v-7.81l-5-4.5L7.21 10H4.22L12 3l10 9h-3v8H5Z",oa="M11.5 19h1v-1.85l3.5-3.5V9H8v4.65l3.5 3.5V19Zm-2 2v-3L6 14.5V9q0-.825.588-1.413T8 7h1L8 8V3h2v4h4V3h2v5l-1-1h1q.825 0 1.413.588T18 9v5.5L14.5 18v3h-5Zm2.5-7Z",ra="M10 3H8v1.88l2 2zm6 6v3.88l1.8 1.8l.2-.2V9c0-1.1-.9-2-2-2V3h-2v4h-3.88l2 2H16zM4.12 3.84L2.71 5.25L6 8.54v5.96L9.5 18v3h5v-3l.48-.48l4.47 4.47l1.41-1.41L4.12 3.84zm8.38 13.33V19h-1v-1.83L8 13.65v-3.11l5.57 5.57l-1.07 1.06z",ia="m5.39 5.45-1.78-.9L4.87 2h8.47l1.27 2.55-1.78.89L12.11 4h-6zM15.73 8H11.2l-.79-3h-2.6L7 8H2.5l-1.29 2.55 1.79.89.73-1.44H14.5l.71 1.45 1.79-.89zm-.85 14h-2.07l-.24-.9-3.46-5.2-3.47 5.2-.23.9H3.34l2.89-11h2.07l-.36 1.35 1.17 1.75 1.16-1.75-.35-1.35H12zm-6.38-7-.89-1.35-1.18 4.48zm3.29 3.12-1.18-4.48-.9 1.36zM15 16l4-4v3H23v2h-4v3z",sa="M22.1 21.5L2.4 1.7L1.1 3l5 5h-.7l-1.3 2.5l1.8.9l.7-1.4h1.5l1 1l-2.9 11h2.1l.2-.9l3.5-5.2l3.5 5.2l.2.9h2.1l-.8-3.2l3.9 3.9l1.2-1.2M9.3 18.1l1.2-4.5l.9 1.3l-2.1 3.2m5.4 0L12.6 15l.2-.3l1.3 1.3l.6 2.1m-.5-7.1h.7l.2.9l-.9-.9m-.1-3h4.5l1.3 2.6l-1.8.9l-.7-1.5h-4.2l-3-3l.5-2h2.6l.8 3M8.4 5.2L6.9 3.7L7.8 2h8.5l1.3 2.5l-1.8.9L15 4H9l-.6 1.2Z",la="m8.28 5.45l-1.78-.9L7.76 2h8.47l1.27 2.55l-1.78.89L15 4H9l-.72 1.45M18.62 8h-4.53l-.79-3h-2.6l-.79 3H5.38L4.1 10.55l1.79.89l.73-1.44h10.76l.72 1.45l1.79-.89L18.62 8m-.85 14H15.7l-.24-.9L12 15.9l-3.47 5.2l-.23.9H6.23l2.89-11h2.07l-.36 1.35L12 14.1l1.16-1.75l-.35-1.35h2.07l2.89 11m-6.37-7l-.9-1.35l-1.18 4.48L11.4 15m3.28 3.12l-1.18-4.48l-.9 1.36l2.08 3.12Z",ca="M11.45 2v3.55L15 3.77L11.45 2m-1 6L8 10.46l3.75 1.25L10.45 8M2 11.45L3.77 15l1.78-3.55H2M10 2H2v8c.57.17 1.17.25 1.77.25c3.58.01 6.49-2.9 6.5-6.5c-.01-.59-.1-1.18-.27-1.75m7 20v-6h-3l5-9v6h3l-5 9Z";var da,ua,ga,ha,fa,ma,ya,pa,va,Aa,wa,ba,xa,Ea,La,Pa,Ma,Ca,Na,za,Ta,ka,_a,Oa,ja,Da,Ra,Ga,Ba,Sa,Ia,Ha,Va,Qa,Ua,Wa,Za,Ya,Xa,Fa,Ja,Ka,qa,$a,to,eo,no,ao,oo,ro,io,so,lo,co,uo,go,ho,fo,mo,yo,po,vo,Ao,wo,bo,xo,Eo,Lo,Po,Mo,Co,No,zo,To,ko,_o,Oo,jo,Do,Ro,Go,Bo,So,Io,Ho,Vo,Qo,Uo,Wo,Zo,Yo,Xo,Fo,Jo,Ko,qo,$o,tr,er,nr,ar,or,rr,ir,sr,lr,cr,dr,ur,gr,hr,fr,mr,yr,pr,vr,Ar,wr,br,xr,Er,Lr,Pr,Mr,Cr,Nr,zr,Tr,kr,_r,Or,jr;class Dr{static set decimalPlacesEnergy(t){this._decimalPlacesEnergy=t}static set solarColour(t){this._solarColour=t}static get solarColour(){return this._solarColour}static get decimalPlacesEnergy(){return this._decimalPlacesEnergy}static get decimalPlaces(){return this._decimalPlaces}static set decimalPlaces(t){this._decimalPlaces=t}static generateSolarPower(t,e){return Q(da||(da=ht(['\n\t\t\t\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t',"%\n\t\t\t\n\t\t\t","\n\t\t"])),e.solar.visualize_efficiency?"url(#SlG)":t.solarColour,1===e.solar.mppts?"none":"",e.show_solar?"":"st12",0===t.totalPVEfficiency?"grey":t.solarColour,t.totalPVEfficiency,0===t.totalPVEfficiency?"grey":t.solarColour,t.totalPVEfficiency,t.totalPVEfficiency<100?"grey":t.solarColour,t.totalPVEfficiency<100?"grey":t.solarColour,e.show_solar&&1!==e.solar.mppts?"":"st12",t.solarColour,t.solarLineWidth,Math.min(2+t.solarLineWidth+Math.max(t.minLineWidth-2,0),8),e.show_solar&&1!==e.solar.mppts?"":"st12",0===t.totalPV?"transparent":"".concat(t.solarColour),t.durationCur.solar,e.solar.show_mppt_efficiency?"st3 st8 right-align":"st12",1===e.solar.mppts?"none":"",t.solarColour,t.totalPVEfficiency,t.statePVTotal.isValid()?Q(ua||(ua=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t"])),(t=>Hn.handlePopup(t,e.entities.pv_total)),!0!==t.largeFont?"st14":"st4",e.show_solar&&1!==e.solar.mppts?"":"none",t.solarColour,e.solar.auto_scale?Hn.convertValueNew(t.totalPV,t.statePVTotal.getUOM(),t.decimalPlaces):"".concat(Hn.toNum(t.totalPV||0,0)," ").concat(Dt.WATT)):Q(ga||(ga=ht(['\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t"])),!0!==t.largeFont?"st14":"st4",e.show_solar&&1!==e.solar.mppts?"":"none",t.solarColour,e.solar.auto_scale?Hn.convertValue(t.totalPV,t.decimalPlaces)||0:"".concat(Hn.toNum(t.totalPV||0,0)," ").concat(Dt.WATT)))}static generateSolarHeader(t,e){let n,a=Q(ha||(ha=ht([""]))),o=Q(fa||(fa=ht([""]))),r=Q(ma||(ma=ht([""]))),i=Q(ya||(ya=ht([""]))),s=Q(pa||(pa=ht([""]))),l=Q(va||(va=ht([""]))),c=this.countGenerationElements(t);if(0==c)return Q(Aa||(Aa=ht([""])));n=this.setStartPosition(c),t.stateTomorrowSolar.isValid()&&(l=this.getProduction("tomorrow_solar_name",t.stateTomorrowSolar,n,e)),t.stateRemainingSolar.isValid()&&(s=this.getProduction("remaining_solar_name",t.stateRemainingSolar,n,e)),t.stateTotalSolarGeneration.isValid()&&(i=this.getProduction("total_solar_generation_name",t.stateTotalSolarGeneration,n,e)),t.stateYearlyPVEnergy.isValid()&&(r=this.getProduction("yearly_solar_name",t.stateYearlyPVEnergy,n,e)),t.stateMonthlyPVEnergy.isValid()&&(o=this.getProduction("monthly_solar_name",t.stateMonthlyPVEnergy,n,e)),t.stateDailyPVEnergy.isValid()&&(a=this.getProduction("daily_solar_name",t.stateDailyPVEnergy,n,e)),n.x-=2+n.gap/2;const d=Q(wa||(wa=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t'])),n.x,t.solarColour,ca),u=Q(ba||(ba=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"°\n\t\t\t\t\t\n\t\t\t\t"])),(t=>Hn.handlePopup(t,e.entities.environment_temp)),n.x,e.entities?.environment_temp?"st3 left-align":"st12",t.solarColour,t.stateEnvironmentTemp.isValid()?"":"none",t.stateEnvironmentTemp.toNum(1));return Q(xa||(xa=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t"])),d,u,a,o,r,i,s,l)}static setStartPosition(t){switch(t){case 1:return{x:260,gap:0};case 2:return{x:330,gap:0};default:return{x:400,gap:0}}}static countGenerationElements(t){let e=0;return t.stateTomorrowSolar.isValid()&&e++,t.stateRemainingSolar.isValid()&&e++,t.stateTotalSolarGeneration.isValid()&&e++,t.stateYearlyPVEnergy.isValid()&&e++,t.stateMonthlyPVEnergy.isValid()&&e++,t.stateDailyPVEnergy.isValid()&&e++,e++}static getProduction(t,e,n,a){const o=n.x,r=e?.toPowerString(!0,this.decimalPlacesEnergy)||"0",i=a.solar[t]?a.solar[t]:Lt("common."+t),s=this.getTextWidth(r,"16px Roboto"),l=this.getTextWidth(i,"9px Roboto");return n.gap=Math.max(l,s),n.x-=n.gap+8,Q(Ea||(Ea=ht(['\n \n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n \n ',"\n "])),(t=>Hn.handlePopup(t,e.entity_id)),t,o-n.gap/2,this.solarColour,r,t,o-n.gap/2,this.solarColour,i)}static getTextWidth(t,e){const n=document.createElement("canvas").getContext("2d");let a=0;return null!==n&&(n.font=e,a=Math.round(n.measureText(t)?.width)),a}static getPositions(t,e){switch(t){case 1:switch(e){case 1:return[205,"M 239.23 84 L 239 190",230,244.7,238.8,230];case 2:return[158,"M 193 84 L 193 122 Q 193 132 201 132 L 205 132.03",188,198,192,188];case 3:case 4:return[82,"M 117 84 L 117 125 Q 117 132 124 132 L 205 132.03",113,121,116,113];case 5:return[4,"M 39 84 L 39 125 Q 39 132 46 132 L 205 132.03",35,44,38,35]}break;case 2:switch(e){case 2:return[254,"M 289 84.5 L 289 125 Q 289 132 282 132 L 275 132",281,296,289.5,296];case 3:case 4:return[158,"M 193 84 L 193 122 Q 193 132 201 132 L 205 132.03",188,198,192,188];case 5:return[82,"M 117 84 L 117 125 Q 117 132 124 132 L 205 132.03",113,121,116,113]}break;case 3:switch(e){case 3:case 4:return[254,"M 289 84.5 L 289 125 Q 289 132 282 132 L 275 132",281,296,289.5,296];case 5:return[158,"M 193 84 L 193 122 Q 193 132 201 132 L 205 132.03",188,198,192,188]}break;case 4:switch(e){case 4:return[330,"M 365 85 L 365 125 Q 365 132 358 132 L 275 132",357,372,366,372];case 5:return[254,"M 289 84.5 L 289 125 Q 289 132 282 132 L 275 132",281,296,289.5,296]}break;case 5:return[330,"M 365 85 L 365 125 Q 365 132 358 132 L 275 132",357,372,366,372]}return[]}static generateMppt1(t,e){const n=this.getPositions(1,e.solar.mppts);return Q(La||(La=ht(["",""])),e.show_solar?Q(Pa||(Pa=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "])),this.generateFrame(n,"pv1",t.PV1Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv1",t.statePV1Power,t.durationCur.pv1,t.pv1LineWidth,t.minLineWidth),this.generateName(n[0],e.solar.pv1_name),this.generateEfficiency(n,t.PV1Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV1Energy,e.solar.show_mppt_production),this.generateVoltage(n,t.statePV1Voltage),this.generateAmperage(n,t.statePV1Current),this.generatePower(n,t.statePV1Power,e.solar.auto_scale,t.largeFont)):Q(Ma||(Ma=ht([""]))))}static generateMppt2(t,e){const n=this.getPositions(2,e.solar.mppts);return Q(Ca||(Ca=ht(["",""])),e.show_solar&&e.solar.mppts>=2?Q(Na||(Na=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t\t ","\n "])),this.generateFrame(n,"PV2",t.PV2Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv2",t.statePV2Power,t.durationCur.pv2,t.pv2LineWidth,t.minLineWidth),this.generateName(n[0],e.solar.pv2_name),this.generateEfficiency(n,t.PV2Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV2Energy,e.solar.show_mppt_production),this.generateVoltage(n,t.statePV2Voltage),this.generateAmperage(n,t.statePV2Current),this.generatePower(n,t.statePV2Power,e.solar.auto_scale,t.largeFont)):Q(za||(za=ht([""]))))}static generateMppt3(t,e){const n=this.getPositions(3,e.solar.mppts);return Q(Ta||(Ta=ht(["",""])),e.show_solar&&e.solar.mppts>=3?Q(ka||(ka=ht(["\n ","\n ","\n ","\t\t\t\n ","\n ","\n ","\n ","\n\t\t\t ","\n "])),this.generateFrame(n,"PV3",t.PV3Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv3",t.statePV3Power,t.durationCur.pv3,t.pv3LineWidth,t.minLineWidth),this.generateName(n[0],e.solar.pv3_name),this.generateEfficiency(n,t.PV3Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV3Energy,e.solar.show_mppt_production),this.generateVoltage(n,t.statePV3Voltage),this.generateAmperage(n,t.statePV3Current),this.generatePower(n,t.statePV3Power,e.solar.auto_scale,t.largeFont)):Q(_a||(_a=ht([""]))))}static generateMppt4(t,e){const n=this.getPositions(4,e.solar.mppts);return Q(Oa||(Oa=ht(["",""])),e.show_solar&&e.solar.mppts>=4?Q(ja||(ja=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "])),this.generateFrame(n,"PV4",t.PV4Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv4",t.statePV4Power,t.durationCur.pv4,t.pv4LineWidth,t.minLineWidth),this.generateName(n[0],e.solar.pv4_name),this.generateEfficiency(n,t.PV4Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV4Energy,e.solar.show_mppt_production),this.generateVoltage(n,t.statePV4Voltage),this.generateAmperage(n,t.statePV4Current),this.generatePower(n,t.statePV4Power,e.solar.auto_scale,t.largeFont)):Q(Da||(Da=ht([""]))))}static generateMppt5(t,e){const n=this.getPositions(5,e.solar.mppts);return Q(Ra||(Ra=ht(["",""])),e.show_solar&&e.solar.mppts>=5?Q(Ga||(Ga=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t\t ","\n\t\t\t "])),this.generateFrame(n,"PV5",t.PV5Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv5",t.statePV5Power,t.durationCur.pv5,t.pv5LineWidth,t.minLineWidth),this.generateName(n[0],e.solar.pv5_name),this.generateEfficiency(n,t.PV5Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV5Energy,e.solar.show_mppt_production),this.generateVoltage(n,t.statePV5Voltage),this.generateAmperage(n,t.statePV5Current),this.generatePower(n,t.statePV5Power,e.solar.auto_scale,t.largeFont)):Q(Ba||(Ba=ht([""]))))}static generatePower(t,e,n,a){return Q(Sa||(Sa=ht(['\n \n \n ',"\n \n\t\t\t "])),(t=>Hn.handlePopup(t,e.entity_id)),t[4],!0!==a?"st14":"st4",e.isValid()?"":"none",this.solarColour,n?Hn.convertValue(e,this.decimalPlaces)||0:e.toNum(0)+" "+Dt.WATT)}static generateFrame(t,e,n,a){return Q(Ia||(Ia=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t'])),e,t[0],e,a?"url(#"+e+"LG)":this.solarColour,e,0===n?"grey":this.solarColour,n,0===n?"grey":this.solarColour,n,n<100?"grey":this.solarColour,n<100?"grey":this.solarColour)}static generateFlowLine(t,e,n,a,o,r){const i=n.toPower();return Q(Ha||(Ha=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t"])),e,e,t[1],this.solarColour,o,e,Math.min(2+o+Math.max(r-2,0),8),Math.round(i)<=0?"transparent":"".concat(this.solarColour),a,this.pvLineMap[e])}static generateName(t,e){return Q(Va||(Va=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t"])),t+3,this._solarColour,e)}static generateEfficiency(t,e,n){return Q(Qa||(Qa=ht(['\n \n ',"%\n "])),t[2],n?"st3 st8 right-align":"st12",n?"":"none",this.solarColour,e)}static generateEnergy(t,e,n){return Q(Ua||(Ua=ht(['\n \n \n ',"\n \n "])),(t=>Hn.handlePopup(t,e.entity_id)),t[2],n&&e.isValid()?"":"none",this.solarColour,e.toPowerString(!0,0))}static generateVoltage(t,e){return Q(Wa||(Wa=ht(['\n \n ',"","\n \n "])),(t=>Hn.handlePopup(t,e.entity_id)),t[3],e.isValid()?"":"none",this.solarColour,e.toNum(1),Bt.VOLT)}static generateAmperage(t,e){return Q(Za||(Za=ht(['\n \n\t\t\t\t\n\t\t\t\t\t',"","\n\t\t\t\t\n\t\t\t"])),(t=>Hn.handlePopup(t,e.entity_id)),t[3],e.isValid()?"":"none",this.solarColour,e.toNum(1),Gt.AMPERE)}static generateSolarSellIcon(t,e){return Q(Ya||(Ya=ht(['\n \n \n \n \n \n \n \n '])),(t=>Hn.handlePopup(t,e.entities.solar_sell_247)),e.entities.solar_sell_247&&"off"!==t.stateSolarSell.state&&"0"!==t.stateSolarSell.state&&["1","on"].includes(t.stateSolarSell.state)?"":"none",t.solarColour,ta,e.entities.solar_sell_247&&"on"!==t.stateSolarSell.state&&"1"!==t.stateSolarSell.state&&["0","off"].includes(t.stateSolarSell.state)?"":"none",t.solarColour,ea)}}Dr._solarColour="orange",Dr._decimalPlacesEnergy=2,Dr._decimalPlaces=2,Dr.pvLineMap={pv1:"#pv1-line",pv2:"#pv2-line",pv3:"#pv3-line",pv4:"#pv4-line",pv5:"#pv5-line"};class Rr{static generateShapes(t,e){return Q(Xa||(Xa=ht(['\n\t\t\t\n\t\t'])),t.batteryColour,e.show_battery?"":"none")}static generatePower(t,e){return Q(Fa||(Fa=ht(['\n\t\t\t\t\n \n ',"\n \n \n\t\t"])),(t=>Hn.handlePopup(t,e.entities.battery_power_190)),"none"===e.entities.battery_power_190?"none":"",t.batteryColour,!0!==t.largeFont?"st14":"st4",e.battery.auto_scale?"".concat(e.battery.show_absolute?Hn.convertValueNew(Math.abs(t.stateBatteryPower.toNum(t.decimalPlaces)),t.stateBatteryPower.getUOM(),t.decimalPlaces):Hn.convertValueNew(t.stateBatteryPower.toNum(t.decimalPlaces),t.stateBatteryPower.getUOM(),t.decimalPlaces)||"0"):"".concat(t.stateBatteryPower.toStr(e.decimal_places,e.battery?.invert_power,e.battery.show_absolute)," ").concat(Dt.WATT))}static generateCircle(t,e){return Q(Ja||(Ja=ht(['\n\t\t\t\t'])),"none"!==e.entities?.battery_status&&e.entities?.battery_status?"":"none",t.batteryStateColour)}static generateVoltage(t){return Q(Ka||(Ka=ht(['\n\t\t\t\t\n \n '," ","\n \n \n\t\t"])),(e=>Hn.handlePopup(e,t.stateBatteryVoltage.entity_id)),t.stateBatteryVoltage.isValid()?"":"none",t.batteryColour,t.stateBatteryVoltage.toStr(t.decimalPlaces),Bt.VOLT)}static generateCurrent(t,e){return Q(qa||(qa=ht(['\n\t\t\t\t\n \n '," ","\n \n \n\t\t"])),(e=>Hn.handlePopup(e,t.stateBatteryCurrent.entity_id)),t.stateBatteryCurrent.isValid()?"":"none",t.batteryColour,t.stateBatteryCurrent.toStr(t.decimalPlaces,!1,e.battery.show_absolute),Gt.AMPERE)}static generateTemp(t){return Q($a||($a=ht(['\n\t\t\t\t\n \n ',"°\n \n \n \n\t\t"])),(e=>Hn.handlePopup(e,t.stateBatteryTemp.entity_id)),t.batteryColour,t.stateBatteryTemp.isValid()?"":"none",t.stateBatteryTemp.toNum(1))}static generateDuration(t,e){return Q(to||(to=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t'," ","% @",'\n\t\t\t\n\t\t\t\n\t\t\t\t'," ","% @",'\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\t\t\n\t\t"])),!0!==t.largeFont?"st14":"st4",e.show_battery?"":"none",0===t.batteryEnergy||t.isFloating||0===t.batteryPower?"transparent":"".concat(t.batteryColour),t.batteryDuration,e.show_battery?"":"none",0===t.batteryEnergy||t.batteryPower<=0||t.isFloating?"transparent":"".concat(t.batteryColour),Lt("common.runtime_to"),t.batteryCapacity,t.formattedResultTime,e.show_battery?"":"none",0===t.batteryEnergy||t.batteryPower>=0||t.isFloating?"transparent":"".concat(t.batteryColour),Lt("common.to"),t.batteryCapacity,t.formattedResultTime,e.show_battery?"":"none",0!==t.batteryEnergy&&t.isFloating?"".concat(t.batteryColour):"transparent",Lt("common.battery_floating"))}static generateDailyCharge(t,e){return Q(eo||(eo=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),!0===t.batteryShowDaily&&e.show_battery?"".concat(t.batteryColour):"transparent",Lt("common.daily_charge"),(t=>Hn.handlePopup(t,e.entities.day_battery_charge_70)),!0===t.batteryShowDaily&&e.show_battery&&t.stateDayBatteryCharge.isValid()?"":"none",t.batteryColour,t.stateDayBatteryCharge?.toPowerString(!0,t.decimalPlacesEnergy))}static generateDailyDischarge(t,e){return Q(no||(no=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),!0===t.batteryShowDaily&&e.show_battery?"".concat(t.batteryColour):"transparent",Lt("common.daily_discharge"),(t=>Hn.handlePopup(t,e.entities.day_battery_discharge_71)),!0===t.batteryShowDaily&&e.show_battery&&t.stateDayBatteryDischarge.isValid()?"":"none",t.batteryColour,t.stateDayBatteryDischarge?.toPowerString(!0,t.decimalPlacesEnergy))}static generateFlowLines(t,e){return Q(ao||(ao=ht(['\n \t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t'])),e.show_battery?"":"st12",e.battery.dynamic_colour?t.flowBatColour:t.batteryColour,t.batLineWidth,Math.min(2+t.batLineWidth+Math.max(t.minLineWidth-2,0),8),e.show_battery?"":"st12",t.batteryPower<=0?"transparent":"".concat(t.batteryColour),t.durationCur.battery,Math.min(2+t.batLineWidth+Math.max(t.minLineWidth-2,0),8),e.show_battery?"":"st12",t.batteryPower>=0?"transparent":"".concat(e.battery.dynamic_colour?t.flowBatColour:t.batteryColour),t.durationCur.battery)}static generateSOC(t,e){return Q(oo||(oo=ht(['\n\t\t\t\t\n\t \n\t ','%\n\t \n\t \n\t\t \n |\n '])),(e=>Hn.handlePopup(e,t.stateBatterySoc.entity_id)),t.stateBatterySoc.isValid()?"":"none",t.batteryColour,e.battery.hide_soc?"st12":"st13 st8 left-align",t.stateBatterySoc.toStr(100===t.stateBatterySoc.toNum(0)?0:1),t.batteryColour,e.battery.hide_soc?"st12":"st13 st8 left-align",!t.inverterProg.show&&e.battery.shutdown_soc_offgrid?"":"none")}static generateSOH(t){return Q(ro||(ro=ht(['\n\t\t\t\t\n \n ',"%\n \n "])),(e=>Hn.handlePopup(e,t.stateBatterySOH.entity_id)),t.stateBatterySOH.isValid()?"st3 left-align":"st12",t.batteryColour,!t.stateBatterySOH.isValid()||t.stateBatteryTemp.isValid()?"none":"",t.stateBatterySOH.toNum(0))}static generateCapacity(t,e){return Q(io||(io=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t\t","\n\t\t\t"])),e.show_battery&&e.battery.show_remaining_energy?"":"none",t.batteryColour,Hn.toNum(t.batteryEnergy*(t.stateBatterySoc.toNum(2)/100)/1e3,2),Rt.KILO_WATT_HOUR)}static generateShutdownSOC(t,e){return Q(so||(so=ht(['\n\t\t\t\n\t\t\t\t','%\n\t\t\t\n\t\t\t\n\t\t\t\t','%\n\t\t\t\n\t\t\t\n \n | ','%\n \n \n \n \n | ',"%\n \n "])),t.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st14 left-align",!t.inverterProg.show&&e.battery?.shutdown_soc_offgrid?"":"none",t.batteryShutdown,t.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st14 left-align",!t.inverterProg.show&&e.battery?.shutdown_soc_offgrid?"":"none",t.shutdownOffGrid,(t=>Hn.handlePopup(t,e.entities.battery_soc_184)),t.batteryColour,!t.inverterProg.show||"none"===e.entities.battery_soc_184||e.battery.hide_soc?"none":"",t.inverterProg.capacity||0,(t=>Hn.handlePopup(t,e.entities.battery_soc_184)),t.batteryColour,e.battery.hide_soc?"st12":"st13 st8 left-align",t.inverterProg.show||!e.battery?.shutdown_soc||e.battery?.shutdown_soc_offgrid?"none":"",t.batteryShutdown||0)}static generateBatteryGradient(t,e){return Q(lo||(lo=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t'])),t.gridPercentageBat>0?t.gridColour:t.pvPercentageBat>0?t.solarColour:t.batteryColour,t.gridPercentageBat<2?0:t.gridPercentageBat,t.gridPercentageBat>0?t.gridColour:t.pvPercentageBat>0?t.solarColour:t.batteryColour,t.gridPercentageBat<2?0:t.gridPercentageBat,t.pvPercentageBat>0?t.solarColour:t.batteryColour,(t.gridPercentageBat<2?0:t.gridPercentageBat)+(t.pvPercentageBat<2?0:t.pvPercentageBat),t.pvPercentageBat>0?t.solarColour:t.batteryColour,(t.gridPercentageBat<2?0:t.gridPercentageBat)+(t.pvPercentageBat<2?0:t.pvPercentageBat),t.batteryColour,t.batteryColour,e.show_battery?"":"st12",e.battery.dynamic_colour?"url(#bLg)":t.batteryColour,e.battery.linear_gradient?t.battery0:t.batteryIcon,t.stopColour,e.battery.animate?"y2":"none",e.show_battery?"":"st12",e.battery.linear_gradient?"url(#sLg)":t.batteryColour,e.battery.linear_gradient?"":"none",t.batteryCharge)}}class Gr{static get gridColour(){return this._gridColour}static set gridColour(t){this._gridColour=t}static get decimalPlaces(){return this._decimalPlaces}static set decimalPlaces(t){this._decimalPlaces=t}static generateShapeAndName(t,e){return Q(co||(co=ht(['\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t"])),t.gridColour,t.gridColour,e.grid.grid_name)}static generatePhases(t,e){return Q(uo||(uo=ht(["\n\t\t\t","\n\t\t\t","\n\t\t\t","\n\t\t\t\n\t\t\t","\n\t\t\t","\n\t\t\t","\n\t\t\t\n\t\t\t","\n\t\t\t","\n\t\t\t","\n\t\t"])),Qn.generatePhasePower("L1",t.stateGridPowerL1,this._col1X,241,e.grid.auto_scale,this.gridColour,this.decimalPlaces),Qn.generatePhasePower("L2",t.stateGridPowerL2,this._col1X,254,e.grid.auto_scale,this.gridColour,this.decimalPlaces),Qn.generatePhasePower("L3",t.stateGridPowerL3,this._col1X,267,e.grid.auto_scale,this.gridColour,this.decimalPlaces),Qn.generatePhaseVoltage("L1",t.stateGridVoltageL1,this._col1X,195,this.gridColour),Qn.generatePhaseVoltage("L2",t.stateGridVoltageL2,this._col1X,182,this.gridColour),Qn.generatePhaseVoltage("L3",t.stateGridVoltageL3,this._col1X,169,this.gridColour),Qn.generatePhaseAmperage("L1",t.stateGridCurrentL1,this._col2X,195,this.gridColour),Qn.generatePhaseAmperage("L2",t.stateGridCurrentL2,this._col2X,182,this.gridColour),Qn.generatePhaseAmperage("L3",t.stateGridCurrentL3,this._col2X,169,this.gridColour))}static generateFrequency(t){return Q(go||(go=ht(["",""])),Qn.generateFrequency(t.stateGridFrequency,t.gridColour,"grid_frequency",this._col1X,208,"right-align"))}static generateEnergyCost(t,e){return Q(ho||(ho=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t'," ",'\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t'," ","\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Hn.handlePopup(t,e.entities.energy_cost_buy)),this._col3X,t.gridImportColour,e.entities?.energy_cost_buy&&t.stateEnergyCostBuy.isValid()?"":"none",t.stateEnergyCostBuy.toStr(e.grid?.energy_cost_decimals||2),t.stateEnergyCostBuy.getUOM(),(t=>Hn.handlePopup(t,e.entities.energy_cost_sell)),this._col3X,t.gridExportColour,e.entities?.energy_cost_sell&&t.stateEnergyCostSell.isValid()?"":"none",t.stateEnergyCostSell.toStr(e.grid?.energy_cost_decimals||2),t.stateEnergyCostSell.getUOM())}static generateFlowLines(t){return Q(fo||(fo=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t'])),t.gridColour,t.gridLineWidth,Math.min(2+t.gridLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.totalGridPower?"transparent":"".concat(t.gridColour),t.durationCur.grid,t.totalGridPower>0?"0;1":"1;0",t.gridColour,t.gridLineWidth,Math.min(2+t.gridLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.totalGridPower?"transparent":"".concat(t.gridColour),t.durationCur.grid,t.totalGridPower>0?"0;1":"1;0")}static generateIcon(t,e){return Q(mo||(mo=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t'])),(t=>Hn.handlePopup(t,e.entities.grid_connected_status_194)),kt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridColour,t.totalGridPower<0||e.grid.import_icon?"none":"",la,_t.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridOffColour,e.grid.disconnected_icon?"none":"",sa,kt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridColour,t.totalGridPower>=0||e.grid.export_icon?"none":"",ia,(t=>Hn.handlePopup(t,e.entities.grid_connected_status_194)),e.grid.import_icon||e.grid.disconnected_icon||e.grid.export_icon?"":"none",t.customGridIcon)}static generatePrepaidUnits(t,e){return Q(yo||(yo=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t'," ","\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Hn.handlePopup(t,e.entities.prepaid_units)),e.entities?.prepaid_units?"st3":"st12",t.gridColour,t.statePrepaidUnits.isValid()?"":"none",t.statePrepaidUnits.toStr(1),e.grid.prepaid_unit_name)}static generateDailyImport(t,e){return Q(po||(po=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),(t=>Hn.handlePopup(t,e.entities.day_grid_import_76)),!0===t.gridShowDailyBuy&&t.stateDayGridImport.isValid()?"":"none",t.gridColour,t.stateDayGridImport?.toPowerString(!0,t.decimalPlacesEnergy),!0!==t.gridShowDailyBuy?"transparent":"".concat(t.gridColour),e.grid.label_daily_grid_buy)}static generateDailyExport(t,e){return Q(vo||(vo=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),(t=>Hn.handlePopup(t,e.entities.day_grid_export_77)),!0===t.gridShowDailySell&&t.stateDayGridExport.isValid()?"":"none",t.gridColour,t.stateDayGridExport?.toPowerString(!0,t.decimalPlacesEnergy),!0!==t.gridShowDailySell?"transparent":"".concat(t.gridColour),e.grid.label_daily_grid_sell)}static generateLimit(t,e){return Q(Ao||(Ao=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',": ","\n\t\t\t\t\n\t\t\t"])),(t=>Hn.handlePopup(t,e.entities.max_sell_power)),["off","0"].includes(t.stateSolarSell.state)?"grey":t.gridColour,t.stateMaxSellPower.isValid&&e.entities?.max_sell_power?"":"none",Lt("common.limit"),t.stateMaxSellPower.toPowerString(e.grid.auto_scale,t.decimalPlaces))}static generateTotalGridPower(t,e){return Q(wo||(wo=ht(["\n\t\t\t","\t\t\n\t\t"])),e.inverter.three_phase?e.entities?.grid_ct_power_total?Q(bo||(bo=ht(['\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\n\t\t\t\t\t"])),(t=>Hn.handlePopup(t,e.entities.grid_ct_power_total)),"none"===e.entities.grid_ct_power_172?"none":"",!0!==t.largeFont?"st14":"st4",t.gridColour,e.grid.auto_scale?"".concat(e.grid.show_absolute?"".concat(Math.abs(parseFloat(Hn.convertValue(t.totalGridPower,t.decimalPlaces)))," ").concat(Hn.convertValue(t.totalGridPower,t.decimalPlaces).split(" ")[1]):Hn.convertValue(t.totalGridPower,t.decimalPlaces)||0):"".concat(e.grid.show_absolute?"".concat(Math.abs(t.totalGridPower)," ").concat(Dt.WATT):"".concat(t.totalGridPower||0," ").concat(Dt.WATT))):Q(xo||(xo=ht(['\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\t"])),"none"===e.entities.grid_ct_power_172?"none":"",!0!==t.largeFont?"st14":"st4",t.gridColour,e.grid.auto_scale?"".concat(e.grid.show_absolute?"".concat(Math.abs(parseFloat(Hn.convertValue(t.totalGridPower,t.decimalPlaces)))," ").concat(Hn.convertValue(t.totalGridPower,t.decimalPlaces).split(" ")[1]):Hn.convertValue(t.totalGridPower,t.decimalPlaces)||0):"".concat(e.grid.show_absolute?"".concat(Math.abs(t.totalGridPower)," ").concat(Dt.WATT):"".concat(t.totalGridPower||0," ").concat(Dt.WATT))):Q(Eo||(Eo=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\t\n\t\t\t\t"])),(t=>Hn.handlePopup(t,e.entities.grid_ct_power_172)),"none"===e.entities.grid_ct_power_172?"none":"",!0!==t.largeFont?"st14":"st4",t.gridColour,e.grid.auto_scale?"".concat(e.grid.show_absolute?"".concat(Math.abs(parseFloat(Hn.convertValue(t.totalGridPower,t.decimalPlaces)))," ").concat(Hn.convertValue(t.totalGridPower,t.decimalPlaces).split(" ")[1]):Hn.convertValue(t.totalGridPower,t.decimalPlaces)||0):"".concat(e.grid.show_absolute?"".concat(Math.abs(t.totalGridPower)," ").concat(Dt.WATT):"".concat(t.totalGridPower||0," ").concat(Dt.WATT))))}}Gr._col1X=103,Gr._col2X=107,Gr._col3X=137,Gr._gridColour="gray";class Br{static generateInverterImage(t,e){return Q(Lo||(Lo=ht(["\n\t\t\t",""])),t.genericInverterImage?Q(Po||(Po=ht(['\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t'])),t.inverterColour,Kn):Q(Mo||(Mo=ht([''])),e))}static generateTimerInfo(t,e){return Q(Co||(Co=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t','\n\t\t\t\t\n\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Hn.handlePopup(t,e.entities.use_timer_248)),"on"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,qn,"off"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,$n,"off"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Lt("common.timer_off"),"on"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Lt("common.timer_on"))}static generateFrequency(t){return Q(No||(No=ht(["",""])),Qn.generateFrequency(t.stateLoadFrequency,t.inverterColour,"load_frequency_192",301,208,"right-align"))}static generatePhases(t,e){let n=[195,182,169];return(e.load.show_aux||!t.stateInverterVoltageL3.isValid()&&!t.stateInverterCurrentL3.isValid())&&(n=[198,188,178]),Q(zo||(zo=ht(["\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t\t\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t\t","\n\t\t\t"])),Qn.generatePhaseVoltage("L1",t.stateInverterVoltageL1,301.7,n[0],t.inverterColour),Qn.generatePhaseVoltage("L2",t.stateInverterVoltageL2,301.7,n[1],t.inverterColour),Qn.generatePhaseVoltage("L3",t.stateInverterVoltageL3,301.7,n[2],t.inverterColour),Qn.generatePhaseAmperage("L1",t.stateInverterCurrentL1,305.7,n[0],t.inverterColour),Qn.generatePhaseAmperage("L2",t.stateInverterCurrentL2,305.7,n[1],t.inverterColour),Qn.generatePhaseAmperage("L3",t.stateInverterCurrentL3,305.7,n[2],t.inverterColour))}static generatePriorityLoad(t,e){return Q(To||(To=ht(["",""])),"on"===t.priorityLoad?Q(ko||(ko=ht(['\n\t\t\t\t\t\t\n \n \n \n ',"\n \n "])),(t=>Hn.handlePopup(t,e.entities.priority_load_243)),"on"!==t.priorityLoad||"no"===t.priorityLoad&&t.priorityLoad?"none":"",t.inverterColour,aa,"on"!==t.priorityLoad||"no"===t.priorityLoad&&t.priorityLoad?"none":"",t.inverterColour,Lt("common.priority_load")):Q(_o||(_o=ht(['\n\t\t\t\t\t\t\n \n \n \n ',"\n \n "])),(t=>Hn.handlePopup(t,e.entities.priority_load_243)),"off"!==t.priorityLoad||"no"===t.priorityLoad&&t.priorityLoad?"none":"",t.inverterColour,na,"off"!==t.priorityLoad||"no"===t.priorityLoad&&t.priorityLoad?"none":"",t.inverterColour,Lt("common.priority_batt")))}static generateInverterProgram(t){return Q(Oo||(Oo=ht(['\n\t\t\t\n \n \n \n \n \n \n \n\t\t'])),(e=>Hn.handlePopup(e,t.inverterProg.entityID)),!1===t.inverterProg.show||"no"===t.enableTimer?"none":"","none"===t.inverterProg.charge||"off"!=t.stateUseTimer.state&&"on"!=t.stateUseTimer.state?"st12":"",t.inverterColour,oa,!1===t.inverterProg.show||"no"===t.enableTimer?"none":"","none"!==t.inverterProg.charge||"off"!==t.stateUseTimer.state&&"on"!==t.stateUseTimer.state?"st12":"",t.inverterColour,ra)}static generateTemperatures(t,e){let n=e.inverter?.ac_icon?Qn.getIcon(178,218,e.inverter.ac_icon,"small_ac_dc_icon",16):Q(jo||(jo=ht(['\n\t\t\t\t\n AC:\n '])),t.inverterColour,e.entities?.radiator_temp_91&&t.stateRadiatorTemp.isValid()?"":"none"),a=e.inverter?.dc_icon?Qn.getIcon(178,230,e.inverter.dc_icon,"small_ac_dc_icon",16):Q(Do||(Do=ht(['\n\t\t\t\n DC:\n '])),t.inverterColour,e.entities?.dc_transformer_temp_90&&t.stateDCTransformerTemp.isValid()?"":"none");return Q(Ro||(Ro=ht(['\n \n ','°\n \n \n \n ',"°\n \n \n\t\t"])),(t=>Hn.handlePopup(t,e.entities.radiator_temp_91)),n,t.inverterColour,e.entities?.radiator_temp_91&&t.stateRadiatorTemp.isValid()?"":"none",t.stateRadiatorTemp.toStr(1,!1),(t=>Hn.handlePopup(t,e.entities.dc_transformer_temp_90)),a,t.inverterColour,e.entities?.dc_transformer_temp_90&&t.stateDCTransformerTemp.isValid()?"":"none",t.stateDCTransformerTemp.toStr(1,!1))}static buildGradientStops(t){let e=Q(Go||(Go=ht([''])));return t<2?(e=Q(Bo||(Bo=ht(["",''])),e),e):(e=t<=30?Q(So||(So=ht(["",''])),e,t):Q(Io||(Io=ht(["",''])),e),e=t<=40?Q(Ho||(Ho=ht(["",''])),e,t):Q(Vo||(Vo=ht(["",''])),e),e=t<=60?Q(Qo||(Qo=ht(["",''])),e,t):Q(Uo||(Uo=ht(["",''])),e),e=t<=90?Q(Wo||(Wo=ht(["",''])),e,t):Q(Zo||(Zo=ht(["",''])),e),t<=100?(e=Q(Yo||(Yo=ht(["",''])),e,t),Q(Fo||(Fo=ht(["",''])),e,t)):(e=Q(Xo||(Xo=ht(["",''])),e),e))}static generateInverterLoad(t,e){let n,a=yt.Sunsynk;if(!t.stateInverterLoadPercentage.isValid())return"";if(Object.values(yt).includes(e.inverter.model)&&(a=e.inverter.model),e.inverter.modern)return Q(Jo||(Jo=ht(['\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t ','\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t'])),this.buildGradientStops(t.stateInverterLoadPercentage.toNum(0)));switch(a){case yt.Azzurro:n=[213.5,179.5,51,67,3];break;case yt.Fronius:n=[213.5,179.5,51,73,10];break;case yt.Huawei:case yt.SolarEdge:n=[213.5,179.5,51,73,5];break;default:n=[213.5,179.5,51,73,2]}return Q(Ko||(Ko=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t ','\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t'])),n[0],n[1],n[2],n[3],this.buildGradientStops(t.stateInverterLoadPercentage.toNum(0)),n[2]-2,n[3]-2,n[4],n[4])}static generateInverterState(t,e){let n,a=yt.Sunsynk;if(Object.values(yt).includes(e.inverter.model)&&(a=e.inverter.model),e.inverter.modern)return Q(qo||(qo=ht(['\n\t\t\t\t\n\t\t\t\t\n\t \n\t ',"\n\t \n\t \n\t\t\t"])),t.inverterStateColour,t.inverterStateColour,e.entities.inverter_status_59&&t.inverterStateMsg?"":"none",(t=>Hn.handlePopup(t,e.entities.inverter_status_59)),e.entities.inverter_status_59&&t.inverterStateMsg?"":"none",t.inverterStateMsg);switch(a){case yt.Azzurro:n=[235,222,7,6,239,240];break;case yt.Deye:n=[233.5,205.5,12,6,239,225];break;case yt.Fronius:n=[222,230,11,9,239,246];break;case yt.Goodwe:case yt.GoodweGridMode:n=[222,236,31,3,239,225];break;case yt.Growatt:n=[250,224,11,6,239,247];break;case yt.EasunSMW8_SA:case yt.MPPSolar:n=[233,242,11,5,239,234];break;case yt.PowMr:n=[233,190,12,5,239,230];break;case yt.Sunsynk:n=[234,208,10,6,239,225];break;case yt.SolarEdge:n=[234,206,22,5,2,239,225];break;case yt.Sofar:n=[233,230,12,4,239,245];break;case yt.Solis:n=[249,198,8,17,239,232];break;case yt.Victron:n=[218,217,18,7.5,239,231];break;default:return Q($o||($o=ht(['\n\t\t\t\t\t\n\t\t\t\t'])),t.inverterStateColour)}return Q(tr||(tr=ht(['\n\t\t\t\n\t\t\t\n \n ',"\n \n \n\t\t"])),n[0],n[1],n[2],n[3],t.inverterStateColour,t.inverterStateColour,e.entities.inverter_status_59&&t.inverterStateMsg?"":"none",(t=>Hn.handlePopup(t,e.entities.inverter_status_59)),n[4],n[5],t.inverterStateColour,e.entities.inverter_status_59&&t.inverterStateMsg?"":"none",t.inverterStateMsg)}}class Sr{static getPositions(t,e){switch(t){case 1:switch(e){case 1:return 86;case 2:return 43;case 3:return 0}break;case 2:switch(e){case 2:return 86;case 3:return 43}break;case 3:return 86}return 0}static generateLoad1(t,e){const n=this.getPositions(1,e.grid.additional_loads);return Q(er||(er=ht(["",""])),t.nonessentialLoads>=1?Q(nr||(nr=ht(["\n\t\t\t\t",""])),Qn.generateGridLoad(1,t.iconNonessentialLoad1,t.dynamicColourNonEssentialLoad1,e.grid?.load1_name,t.stateNonessentialLoad1,t.stateNonEssentialLoad1Extra,t.stateNonEssentialLoad1Toggle,e.grid.auto_scale,t.decimalPlaces,n,Vn.row5,[11,0,20.5])):Q(ar||(ar=ht([""]))))}static generateLoad2(t,e){const n=this.getPositions(2,e.grid.additional_loads);return Q(or||(or=ht(["",""])),t.nonessentialLoads>=2?Q(rr||(rr=ht(["\n\t\t\t\t",""])),Qn.generateGridLoad(2,t.iconNonessentialLoad2,t.dynamicColourNonEssentialLoad2,e.grid?.load2_name,t.stateNonessentialLoad2,t.stateNonEssentialLoad2Extra,t.stateNonEssentialLoad2Toggle,e.grid.auto_scale,t.decimalPlaces,n,Vn.row5,[11,0,20.5])):Q(ir||(ir=ht([""]))))}static generateLoad3(t,e){const n=this.getPositions(3,e.grid.additional_loads);return Q(sr||(sr=ht(["",""])),t.nonessentialLoads>=3?Q(lr||(lr=ht(["\n\t\t\t\t",""])),Qn.generateGridLoad(3,t.iconNonessentialLoad3,t.dynamicColourNonEssentialLoad3,e.grid?.load3_name,t.stateNonessentialLoad3,t.stateNonEssentialLoad3Extra,t.stateNonEssentialLoad3Toggle,e.grid.auto_scale,t.decimalPlaces,n,Vn.row5,[11,0,20.5])):Q(cr||(cr=ht([""]))))}static getLines(t,e){switch(t){case 1:switch(e){case 1:return"M 109 328L 109 333";case 2:return"M 66 328 L 66 333";case 3:return"M 23 328 L 23 333"}break;case 2:switch(e){case 2:return"M 109 328L 109 333";case 3:return"M 66 328 L 66 333"}break;case 3:return"M 109 328L 109 333"}return""}static generateIcon(t){const e=Qn.getIconWithCondition(t.nonessentialLoads>=1,68,290,t.nonessentialIcon,"nes-load-icon",32);return Q(dr||(dr=ht(["",""])),e)}static generateLines(t,e){return Q(ur||(ur=ht(['\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t'])),this.getLines(1,e.grid.additional_loads),e.grid.additional_loads>=1?"":"st12",t.dynamicColourNonEssentialLoad1,this.getLines(2,e.grid.additional_loads),e.grid.additional_loads>=2?"":"st12",t.dynamicColourNonEssentialLoad2,this.getLines(3,e.grid.additional_loads),e.grid.additional_loads>=3?"":"st12",t.dynamicColourNonEssentialLoad3)}static generateFlowLine(t,e){const n=(()=>{switch(e.grid.additional_loads){case 1:return 109;case 2:return 66;case 3:return 23}})(),a="M ".concat(n," 328 L 135 328 Q 140 328 140 323 L 140 320");return Q(gr||(gr=ht(['\n\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t \n\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t'])),a,t.dynamicColourNonEssentialLoad,t.nonessLineWidth,Math.min(2+t.nonessLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.nonessentialLoads?"transparent":"".concat(t.dynamicColourNonEssentialLoad),t.durationCur.ne,t.dynamicColourNonEssentialLoad,t.nonessLineWidth,Math.min(2+t.nonessLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.nonessentialLoads?"transparent":"".concat(t.dynamicColourNonEssentialLoad),t.durationCur.ne)}static generateShapeAndName(t,e){return Q(hr||(hr=ht(['\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),t.dynamicColourNonEssentialLoad,0===t.nonessentialLoads?"none":"",t.dynamicColourNonEssentialLoad,e.grid.nonessential_name)}static generateTotalPower(t,e){return Q(fr||(fr=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t"])),0===t.nonessentialLoads?"none":"",!0!==t.largeFont?"st14":"st4",t.dynamicColourNonEssentialLoad,e.grid.auto_scale?Hn.convertValue(t.nonessentialPower,t.decimalPlaces)||0:"".concat(t.nonessentialPower||0," ").concat(Dt.WATT))}}class Ir{static generateShapes(t,e){const n=400+(Vn.LOAD_X-400)/2-101.3;return Q(mr||(mr=ht(['\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),n,t.auxDynamicColour,n+3,t.auxDynamicColour,e.load.aux_name)}static generateLines(t){let e=t.auxLineWidth;const n=400+(Vn.LOAD_X-400)/2-101.3;return Q(yr||(yr=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t'])),n,t.auxDynamicColour,e,Math.min(2+e+Math.max(t.minLineWidth-2,0),8),0==Math.round(t.auxPower)?"transparent":"".concat(t.auxDynamicColour),t.durationCur.aux,t.auxPower>0?"0;1":"1;0",n+70,n+70,n+70+27,n+70+27,n+70+27,n+70+27,n+70+27+5,Vn.column1+Vn.xGaps[1],t.auxDynamicColour,e,Math.min(2+e+Math.max(t.minLineWidth-2,0),8),0==Math.round(t.auxPower)?"transparent":"".concat(t.auxDynamicColour),2*t.durationCur.aux,t.auxPower>0?"0;1":"1;0")}static generateLoad1(t,e){return Q(pr||(pr=ht(["",""])),e.load.aux_loads>=1?Q(vr||(vr=ht(["\n\t\t\t\t",""])),Qn.generateAuxLoad(1,t.iconAuxLoad1,t.auxDynamicColourLoad1,e.load?.aux_load1_name,t.stateAuxLoad1,t.stateAuxLoad1Extra,t.stateAuxLoad1Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column1,Vn.rowAux)):Q(Ar||(Ar=ht([""]))))}static generateLoad2(t,e){return Q(wr||(wr=ht(["",""])),e.load.aux_loads>=2?Q(br||(br=ht(["\n\t\t\t\t",""])),Qn.generateAuxLoad(2,t.iconAuxLoad2,t.auxDynamicColourLoad2,e.load?.aux_load2_name,t.stateAuxLoad2,t.stateAuxLoad2Extra,t.stateAuxLoad2Toggle,e.load.auto_scale,t.decimalPlaces,Vn.column2,Vn.rowAux)):Q(xr||(xr=ht([""]))))}static generateTotalLoad(t,e){const n=400+(this.mainX-400)/2-65.3,a=e.grid.auto_scale?Hn.convertValue(t.auxPower,t.decimalPlaces)||0:"".concat(t.auxPower||0," ").concat(Dt.WATT);return Q(Er||(Er=ht(["\n\t\t\t","\n\t\t"])),t.stateAuxPower.isValid()?Q(Lr||(Lr=ht(['\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t ',"\n\t\t\t\t\t\t\n\t\t\t\t\t"])),(t=>Hn.handlePopup(t,e.stateAuxPower.entity_id)),n,!0!==t.largeFont?"st14":"st4",t.auxDynamicColour,a):Q(Pr||(Pr=ht(['\n\t\t\t\t\t\n\t\t\t\t\t\t ',"\n\t\t\t\t\t"])),n,!0!==t.largeFont?"st14":"st4",t.auxDynamicColour,a))}static generateDailyLoad(t,e){return Q(Mr||(Mr=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),(t=>Hn.handlePopup(t,e.entities.day_load_energy_84)),this.mainX+10,t.showDailyAux&&t.stateDayAuxEnergy.isValid()?"":"none",t.auxDynamicColour,t.stateDayAuxEnergy?.toPowerString(!0,t.decimalPlacesEnergy),this.mainX+10,t.showDailyAux?"".concat(t.auxDynamicColour):"transparent",e.load?.aux_daily_name?e.load?.aux_daily_name:Lt("common.daily_aux"))}}Ir.mainX=Vn.LOAD_X;class Hr{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="gold";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="gold";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="gold";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 gi(t){let e=null!==t?.state&&"unknown"!==t.state&&void 0!==t.state&&null!=t?.entity_id&&t.entity_id,n=""!==t?.state&&e;return{...t,toNum:(e,n)=>Hn.toNum(t?.state,e,n),toStr:(e,n,a)=>Hn.toNum(t?.state,e,n,a).toFixed(e),isValid:()=>e||!1,isValidSwitch:()=>e&&["on","off","On","Off","ON","OFF",0,1,!0,!1].includes(t?.state)||!1,notEmpty:()=>n||!1,isNaN:()=>null===t?.state||Number.isNaN(t?.state),toPower:e=>{const n=(t.attributes?.unit_of_measurement||"").toLowerCase();return"kw"===n||"kwh"===n?Hn.toNum(1e3*(t?.state||"0"),0,e):"mw"===n||"mwh"===n?Hn.toNum(1e6*(t?.state||"0"),0,e):Hn.toNum(t?.state||"0",0,e)||0},toPowerString:(e,n,a)=>e?Hn.convertValueNew(t?.state,t?.attributes?.unit_of_measurement,n):"".concat(Hn.toNum(t?.state,n,a).toFixed(n)," ").concat(t?.attributes?.unit_of_measurement||""),toString:()=>t?.state?.toString()||"",toOnOff:()=>["on","On","ON",1,!0].includes(t?.state)?"on":"off",getUOM:()=>t?.attributes?.unit_of_measurement||""}}console.groupCollapsed("%c ⚡ POWER-FLOW-CARD by Molikk %c ".concat(Lt("common.version"),": ").concat("0.10.2"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/molikk/mlk-power-flow-card"),console.groupEnd();let hi=class extends it{constructor(){super(...arguments),this.GREY_COLOUR="grey",this.durationPrev={},this.durationCur={}}static get styles(){return mt}static async getConfigElement(){return await Promise.resolve().then((function(){return Ei})),document.createElement(Ot)}static getStubConfig(){return{show_solar:!0,battery:{energy:0,shutdown_soc:20,show_daily:!0},solar:{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 t=this._config,e=this.getEntity("entities.day_battery_discharge_71"),n=this.getEntity("entities.day_battery_charge_70"),a=this.getEntity("entities.day_load_energy_84"),o=this.getEntity("entities.day_grid_import_76"),r=this.getEntity("entities.day_grid_export_77"),i=this.getEntity("entities.day_aux_energy"),s=this.getEntity("entities.load_frequency_192"),l=this.getEntity("entities.inverter_status_59",{state:""}),c=this.getEntity("entities.inverter_power_175"),d=this.getEntity("entities.priority_load_243",{state:t.entities.priority_load_243?.toString()??"false"}),u=this.getEntity("entities.use_timer_248",{state:t.entities.use_timer_248?.toString()??"false"}),g=this.getEntity("entities.dc_transformer_temp_90",{state:""}),h=this.getEntity("entities.radiator_temp_91",{state:""}),f=this.getEntity("entities.inverter_voltage_154"),m=this.getEntity("entities.inverter_voltage_L2",{state:""}),y=this.getEntity("entities.inverter_voltage_L3",{state:""}),p=this.getEntity("entities.inverter_current_164"),v=this.getEntity("entities.inverter_current_L2",{state:""}),A=this.getEntity("entities.inverter_current_L3",{state:""}),w=this.getEntity("entities.environment_temp",{state:""}),b=this.getEntity("entities.inverter_load_percentage"),x=this.getEntity("entities.battery_voltage_183"),E=this.getEntity("entities.battery_soc_184"),L=this.getEntity("entities.battery_power_190"),P=this.getEntity("entities.battery_current_191"),M=this.getEntity("entities.battery_temp_182",{state:""}),C=this.getEntity("entities.battery_status",{state:""}),N=this.getEntity("entities.battery_current_direction",{state:""}),z=this.getEntity("entities.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()??""}),_=this.getEntity("entities.battery_soh",{state:""}),O=this.getEntity("entities.essential_power"),j=this.getEntity("entities.aux_power_166"),D=this.getEntity("entities.nonessential_power"),R=this.getEntity("entities.non_essential_load1"),G=this.getEntity("entities.non_essential_load2"),B=this.getEntity("entities.non_essential_load3"),S=this.getEntity("entities.non_essential_load1_extra"),I=this.getEntity("entities.non_essential_load2_extra"),H=this.getEntity("entities.non_essential_load3_extra"),U=this.getEntity("entities.non_essential_load1_toggle"),W=this.getEntity("entities.non_essential_load2_toggle"),Z=this.getEntity("entities.non_essential_load3_toggle"),Y=this.getEntity("entities.essential_load1"),X=this.getEntity("entities.essential_load2"),F=this.getEntity("entities.essential_load3"),J=this.getEntity("entities.essential_load4"),K=this.getEntity("entities.essential_load5"),q=this.getEntity("entities.essential_load6"),$=this.getEntity("entities.essential_load7"),tt=this.getEntity("entities.essential_load8"),et=this.getEntity("entities.essential_load9"),nt=this.getEntity("entities.essential_load10"),at=this.getEntity("entities.essential_load11"),ot=this.getEntity("entities.essential_load12"),rt=this.getEntity("entities.essential_load13"),it=this.getEntity("entities.essential_load14"),st=this.getEntity("entities.essential_load15"),lt=this.getEntity("entities.essential_load16"),ct=this.getEntity("entities.essential_load17"),dt=this.getEntity("entities.essential_load18"),ut=this.getEntity("entities.essential_load19"),gt=this.getEntity("entities.essential_load20"),ft=this.getEntity("entities.essential_load21"),mt=this.getEntity("entities.essential_load22"),pt=this.getEntity("entities.essential_load23"),vt=this.getEntity("entities.essential_load1_extra"),At=this.getEntity("entities.essential_load2_extra"),wt=this.getEntity("entities.essential_load3_extra"),bt=this.getEntity("entities.essential_load4_extra"),Et=this.getEntity("entities.essential_load5_extra"),Pt=this.getEntity("entities.essential_load6_extra"),Ot=this.getEntity("entities.essential_load7_extra"),jt=this.getEntity("entities.essential_load8_extra"),Dt=this.getEntity("entities.essential_load9_extra"),Rt=this.getEntity("entities.essential_load10_extra"),Gt=this.getEntity("entities.essential_load11_extra"),Bt=this.getEntity("entities.essential_load12_extra"),St=this.getEntity("entities.essential_load13_extra"),It=this.getEntity("entities.essential_load14_extra"),Ht=this.getEntity("entities.essential_load15_extra"),Vt=this.getEntity("entities.essential_load16_extra"),Qt=this.getEntity("entities.essential_load17_extra"),Ut=this.getEntity("entities.essential_load18_extra"),Wt=this.getEntity("entities.essential_load19_extra"),Zt=this.getEntity("entities.essential_load20_extra"),Yt=this.getEntity("entities.essential_load21_extra"),Xt=this.getEntity("entities.essential_load22_extra"),Ft=this.getEntity("entities.essential_load23_extra"),Jt=this.getEntity("entities.essential_load1_toggle"),Kt=this.getEntity("entities.essential_load2_toggle"),qt=this.getEntity("entities.essential_load3_toggle"),$t=this.getEntity("entities.essential_load4_toggle"),te=this.getEntity("entities.essential_load5_toggle"),ee=this.getEntity("entities.essential_load6_toggle"),ne=this.getEntity("entities.essential_load7_toggle"),ae=this.getEntity("entities.essential_load8_toggle"),oe=this.getEntity("entities.essential_load9_toggle"),re=this.getEntity("entities.essential_load10_toggle"),ie=this.getEntity("entities.essential_load11_toggle"),se=this.getEntity("entities.essential_load12_toggle"),le=this.getEntity("entities.essential_load13_toggle"),ce=this.getEntity("entities.essential_load14_toggle"),de=this.getEntity("entities.essential_load15_toggle"),ue=this.getEntity("entities.essential_load16_toggle"),ge=this.getEntity("entities.essential_load17_toggle"),he=this.getEntity("entities.essential_load18_toggle"),fe=this.getEntity("entities.essential_load19_toggle"),me=this.getEntity("entities.essential_load20_toggle"),ye=this.getEntity("entities.essential_load21_toggle"),pe=this.getEntity("entities.essential_load22_toggle"),ve=this.getEntity("entities.essential_load23_toggle"),Ae=this.getEntity("entities.load_power_L1"),we=this.getEntity("entities.load_power_L2"),be=this.getEntity("entities.load_power_L3"),xe=this.getEntity("entities.aux_load1"),Ee=this.getEntity("entities.aux_load2"),Le=this.getEntity("entities.aux_load1_extra"),Pe=this.getEntity("entities.aux_load2_extra"),Me=this.getEntity("entities.aux_load1_toggle"),Ce=this.getEntity("entities.aux_load2_toggle"),Ne=this.getEntity("entities.grid_frequency"),ze=this.getEntity("entities.grid_ct_power_172"),Te=this.getEntity("entities.grid_ct_power_L2"),ke=this.getEntity("entities.grid_ct_power_L3"),_e=this.getEntity("entities.grid_voltage_L1"),Oe=this.getEntity("entities.grid_voltage_L2"),je=this.getEntity("entities.grid_voltage_L3"),De=this.getEntity("entities.grid_current_L1"),Re=this.getEntity("entities.grid_current_L2"),Ge=this.getEntity("entities.grid_current_L3"),Be=this.getEntity("entities.grid_ct_power_total"),Se=this.getEntity("entities.grid_connected_status_194",{state:"on"}),Ie=this.getEntity("entities.grid_power_169"),He=this.getEntity("entities.energy_cost_buy",{state:"",attributes:{unit_of_measurement:""}}),Ve=this.getEntity("entities.energy_cost_sell",{state:"",attributes:{unit_of_measurement:""}}),Qe=this.getEntity("entities.grid_voltage",null),Ue=this.getEntity("entities.prepaid_units"),We=this.getEntity("entities.max_sell_power"),Ze=this.getEntity("entities.pv1_voltage_109"),Ye=this.getEntity("entities.pv1_current_110"),Xe=this.getEntity("entities.pv2_voltage_111"),Fe=this.getEntity("entities.pv2_current_112"),Je=this.getEntity("entities.pv3_voltage_113"),Ke=this.getEntity("entities.pv3_current_114"),qe=this.getEntity("entities.pv4_voltage_115"),$e=this.getEntity("entities.pv4_current_116"),tn=this.getEntity("entities.pv5_voltage"),en=this.getEntity("entities.pv5_current"),nn=this.getEntity("entities.pv1_power_186"),an=this.getEntity("entities.pv2_power_187"),on=this.getEntity("entities.pv3_power_188"),rn=this.getEntity("entities.pv4_power_189"),sn=this.getEntity("entities.pv5_power"),ln=this.getEntity("entities.pv1_production"),cn=this.getEntity("entities.pv2_production"),dn=this.getEntity("entities.pv3_production"),un=this.getEntity("entities.pv4_production"),gn=this.getEntity("entities.pv5_production"),hn=this.getEntity("entities.solar_sell_247",{state:"undefined"}),fn=this.getEntity("entities.pv_total"),mn=this.getEntity("entities.day_pv_energy_108"),yn=this.getEntity("entities.monthly_pv_generation"),pn=this.getEntity("entities.yearly_pv_generation"),vn=this.getEntity("entities.total_pv_generation"),An=this.getEntity("entities.remaining_solar"),wn=this.getEntity("entities.tomorrow_solar"),{invert_aux:bn}=t.load,xn=j?.isValid()?j.toPower(bn):(xe?.toPower(bn)||0)+(Ee?.toPower(bn)||0),{invert_grid:En}=t.grid,Ln=ze.toPower(En),Pn=Te.toPower(En),Mn=ke.toPower(En),Cn=t.entities?.grid_ct_power_total?Be.toPower(En):Ln+Pn+Mn,Nn=t.inverter.three_phase?Cn:Ln,zn=Qe.isNaN()?null:Qe.toNum(0),Tn=N.isNaN()?null:N.toNum(0),kn=t.inverter?.modern,_n=t.decimal_places,On=t.decimal_places_energy,jn=this.colourConvert(t.load?.colour),Dn=this.calculateEssentialLoadColour(Y,Jt,t.load?.off_threshold)||jn,Rn=this.calculateEssentialLoadColour(X,Kt,t.load?.off_threshold)||jn,Gn=this.calculateEssentialLoadColour(F,qt,t.load?.off_threshold)||jn,Bn=this.calculateEssentialLoadColour(J,$t,t.load?.off_threshold)||jn,Sn=this.calculateEssentialLoadColour(K,te,t.load?.off_threshold)||jn,In=this.calculateEssentialLoadColour(q,ee,t.load?.off_threshold)||jn,Qn=this.calculateEssentialLoadColour($,ne,t.load?.off_threshold)||jn,Kn=this.calculateEssentialLoadColour(tt,ae,t.load?.off_threshold)||jn,qn=this.calculateEssentialLoadColour(et,oe,t.load?.off_threshold)||jn,$n=this.calculateEssentialLoadColour(nt,re,t.load?.off_threshold)||jn,ta=this.calculateEssentialLoadColour(at,ie,t.load?.off_threshold)||jn,ea=this.calculateEssentialLoadColour(ot,se,t.load?.off_threshold)||jn,na=this.calculateEssentialLoadColour(rt,le,t.load?.off_threshold)||jn,aa=this.calculateEssentialLoadColour(it,ce,t.load?.off_threshold)||jn,oa=this.calculateEssentialLoadColour(st,de,t.load?.off_threshold)||jn,ra=this.calculateEssentialLoadColour(lt,ue,t.load?.off_threshold)||jn,ia=this.calculateEssentialLoadColour(ct,ge,t.load?.off_threshold)||jn,sa=this.calculateEssentialLoadColour(dt,he,t.load?.off_threshold)||jn,la=this.calculateEssentialLoadColour(ut,fe,t.load?.off_threshold)||jn,ca=this.calculateEssentialLoadColour(gt,me,t.load?.off_threshold)||jn,da=this.calculateEssentialLoadColour(ft,ye,t.load?.off_threshold)||jn,ua=this.calculateEssentialLoadColour(mt,pe,t.load?.off_threshold)||jn,ga=this.calculateEssentialLoadColour(pt,ve,t.load?.off_threshold)||jn;t.title_colour=this.colourConvert(t.title_colour);const ha=t.load?.show_daily,fa=t.grid?.show_nonessential;let ma=t.entities?.grid_connected_status_194?Se.state:"on";_t.includes(ma.toLowerCase())||kt.includes(ma.toLowerCase())||(ma="on");const ya=t.entities?.battery_voltage_183?x.toNum(1):0,pa=t.entities?.inverter_power_175?c.toPower():0,va=t.entities?.grid_power_169?Ie.toPower():Cn,{invert_load:Aa}=t.load,wa=t.entities?.load_power_L1?Ae.toPower(Aa):"",ba=t.entities?.load_power_L2?we.toPower(Aa):"",xa=t.entities?.load_power_L3?be.toPower(Aa):"",Ea=this.colourConvert(t.grid?.colour),La=this.colourConvert(t.grid?.export_colour||Ea),Pa=this.colourConvert(t.grid?.no_grid_colour||Ea);let Ma;switch(!0){case Nn<0:Ma=La;break;case Nn>=0&&Nn<=Hn.toNum(t.grid?.off_threshold,0):Ma=Pa;break;default:Ma=Ea}const Ca=Math.abs(R.toPower(!1)+G.toPower(!1)+B.toPower(!1))>Hn.toNum(t.grid?.off_threshold,0)?R.toPower(!1)+G.toPower(!1)+B.toPower(!1)>0?Ea:La:this.GREY_COLOUR,Na=this.getDynamicColorWithToggle(R,U,t.grid?.off_threshold,Ea,La),za=this.getDynamicColorWithToggle(G,W,t.grid?.off_threshold,Ea,La),Ta=this.getDynamicColorWithToggle(B,Z,t.grid?.off_threshold,Ea,La),ka=this.colourConvert(t.grid?.grid_off_colour||Ma),_a=this.colourConvert(t.load?.aux_colour),Oa=this.colourConvert(t.load?.aux_off_colour||this.GREY_COLOUR),ja=this.calculateAuxLoadColour(xe,Me,t.load?.off_threshold)||_a,Da=this.calculateAuxLoadColour(Ee,Ce,t.load?.off_threshold)||_a;let Ra=Oa;Ra=ja!=Oa?ja:Ra,Ra=Da!=Oa?Da:Ra,Ra=j.isValid()&&Math.abs(j.toPower())>Hn.toNum(t.load?.off_threshold,0)?_a:Ra;let Ga=t.grid?.additional_loads;Ct.includes(Ga)||(Ga=0);const Ba=t.grid?.show_daily_buy,Sa=t.grid?.show_daily_sell,Ia=this.colourConvert(t.battery?.colour),Ha=this.colourConvert(t.battery?.charge_colour||Ia),Va=t.battery?.show_daily;let Qa=t.load?.show_aux;zt.includes(Qa)||(Qa=!1);const Ua=t.load?.show_daily_aux;let Wa=t.load?.additional_loads;Mt.includes(Wa)||(Wa=0);let Za=t.load?.aux_loads;Tt.includes(Za)||(Za=0);const Ya=t.load?.aux_type,Xa=this.getEntity("load.load1_icon",{state:t.load?.load1_icon?.toString()??""}).state,Fa=this.getEntity("load.load2_icon",{state:t.load?.load2_icon?.toString()??""}).state,Ja=this.getEntity("load.load3_icon",{state:t.load?.load3_icon?.toString()??""}).state,Ka=this.getEntity("load.load4_icon",{state:t.load?.load4_icon?.toString()??""}).state,qa=this.getEntity("load.load5_icon",{state:t.load?.load5_icon?.toString()??""}).state,$a=this.getEntity("load.load6_icon",{state:t.load?.load6_icon?.toString()??""}).state,to=this.getEntity("load.load7_icon",{state:t.load?.load7_icon?.toString()??""}).state,eo=this.getEntity("load.load8_icon",{state:t.load?.load8_icon?.toString()??""}).state,no=this.getEntity("load.load9_icon",{state:t.load?.load9_icon?.toString()??""}).state,ao=this.getEntity("load.load10_icon",{state:t.load?.load10_icon?.toString()??""}).state,oo=this.getEntity("load.load11_icon",{state:t.load?.load11_icon?.toString()??""}).state,ro=this.getEntity("load.load12_icon",{state:t.load?.load12_icon?.toString()??""}).state,io=this.getEntity("load.load13_icon",{state:t.load?.load13_icon?.toString()??""}).state,so=this.getEntity("load.load14_icon",{state:t.load?.load14_icon?.toString()??""}).state,lo=this.getEntity("load.load15_icon",{state:t.load?.load15_icon?.toString()??""}).state,co=this.getEntity("load.load16_icon",{state:t.load?.load16_icon?.toString()??""}).state,uo=this.getEntity("load.load17_icon",{state:t.load?.load17_icon?.toString()??""}).state,go=this.getEntity("load.load18_icon",{state:t.load?.load18_icon?.toString()??""}).state,ho=this.getEntity("load.load19_icon",{state:t.load?.load19_icon?.toString()??""}).state,fo=this.getEntity("load.load20_icon",{state:t.load?.load20_icon?.toString()??""}).state,mo=this.getEntity("load.load21_icon",{state:t.load?.load21_icon?.toString()??""}).state,yo=this.getEntity("load.load22_icon",{state:t.load?.load22_icon?.toString()??""}).state,po=this.getEntity("load.load23_icon",{state:t.load?.load23_icon?.toString()??""}).state,vo=this.getEntity("load.aux_load1_icon",{state:t.load?.aux_load1_icon?.toString()??""}).state,Ao=this.getEntity("load.aux_load2_icon",{state:t.load?.aux_load2_icon?.toString()??""}).state,wo=this.getEntity("grid.nonessential_icon",{state:t.grid?.nonessential_icon?.toString()??""}).state,bo=this.getEntity("grid.load1_icon",{state:t.grid?.load1_icon?.toString()??""}).state,xo=this.getEntity("grid.load2_icon",{state:t.grid?.load2_icon?.toString()??""}).state,Eo=this.getEntity("grid.load3_icon",{state:t.grid?.load3_icon?.toString()??""}).state,Lo=this.getEntity("grid.import_icon",{state:t.grid?.import_icon?.toString()??""}).state,Po=this.getEntity("grid.disconnected_icon",{state:t.grid?.disconnected_icon?.toString()??""}).state,Mo=this.getEntity("grid.export_icon",{state:t.grid?.export_icon?.toString()??""}).state,Co=t.large_font,No=t.panel_mode,zo=this.colourConvert(t.inverter?.colour),To=t.inverter?.autarky,ko=!!t.entities.use_timer_248&&u.state,_o=!!t.entities.priority_load_243&&d.state;let Oo=L.toPower(t.battery?.invert_power);const jo=this.getEntity("card_height",{state:t.card_height?.toString()??""}).state,Do=this.getEntity("card_width",{state:t.card_width?.toString()??""}).state,Ro=0===t.grid?.energy_cost_decimals?0:t.grid?.energy_cost_decimals||2,Go=Nn>=0?He.toNum(Ro):Ve.toNum(Ro);let Bo=yt.Sunsynk;Object.values(yt).includes(t.inverter.model)&&(Bo=t.inverter.model);let So="";const Io=di.getInstance(Bo);kn||(So=Io.image);const Ho=nn.toPower(),Vo=an.toPower(),Qo=on.toPower(),Uo=rn.toPower(),Wo=sn.toPower(),Zo=Ho+Vo+Qo+Uo+Wo,Yo=t.entities?.pv_total?fn.toNum():Zo,Xo=t.solar.dynamic_colour?Hn.toNum(Yo,0)>Hn.toNum(t.solar?.off_threshold,0)?this.colourConvert(t.solar?.colour):this.GREY_COLOUR:this.colourConvert(t.solar?.colour);let Fo,Jo,Ko=t.inverter?.three_phase;Nt.includes(Ko)||(Ko=!1);const{essential_power:qo,nonessential_power:$o}=t.entities;Jo=t.entities?.grid_power_169?!1===Ko?"none"!==$o&&$o?D.toPower():Ln-va:"none"!==$o&&$o?D.toPower():Ln+Pn+Mn-va:R.toPower()+G.toPower()+B.toPower(),Fo="none"!==qo&&qo?O.toPower(Aa):!0===Ko&&t.entities.load_power_L1&&t.entities.load_power_L2&&t.entities.load_power_L3?Number(wa)+Number(ba)+Number(xa):t.entities.inverter_power_175?pa+va-xn:Yo+Oo+va-xn;const tr={time:this.getEntity("entities.prog1_time",{state:t.entities.prog1_time??""}),capacity:this.getEntity("entities.prog1_capacity",{state:t.entities.prog1_capacity??""}),charge:this.getEntity("entities.prog1_charge",{state:t.entities.prog1_charge??""})},er={time:this.getEntity("entities.prog2_time",{state:t.entities.prog2_time??""}),capacity:this.getEntity("entities.prog2_capacity",{state:t.entities.prog2_capacity??""}),charge:this.getEntity("entities.prog2_charge",{state:t.entities.prog2_charge??""})},nr={time:this.getEntity("entities.prog3_time",{state:t.entities.prog3_time??""}),capacity:this.getEntity("entities.prog3_capacity",{state:t.entities.prog3_capacity??""}),charge:this.getEntity("entities.prog3_charge",{state:t.entities.prog3_charge??""})},ar={time:this.getEntity("entities.prog4_time",{state:t.entities.prog4_time??""}),capacity:this.getEntity("entities.prog4_capacity",{state:t.entities.prog4_capacity??""}),charge:this.getEntity("entities.prog4_charge",{state:t.entities.prog4_charge??""})},or={time:this.getEntity("entities.prog5_time",{state:t.entities.prog5_time??""}),capacity:this.getEntity("entities.prog5_capacity",{state:t.entities.prog5_capacity??""}),charge:this.getEntity("entities.prog5_charge",{state:t.entities.prog5_charge??""})},rr={time:this.getEntity("entities.prog6_time",{state:t.entities.prog6_time??""}),capacity:this.getEntity("entities.prog6_capacity",{state:t.entities.prog6_capacity??""}),charge:this.getEntity("entities.prog6_charge",{state:t.entities.prog6_charge??""})},ir=k.toNum(),sr=T.toNum(),lr={capacity:sr,entityID:""};switch(!0){case"off"===u.state:case!ko:case!t.entities.prog1_time:case!t.entities.prog2_time:case!t.entities.prog3_time:case!t.entities.prog4_time:case!t.entities.prog5_time:case!t.entities.prog6_time:lr.show=!1;break;default:lr.show=!0;const Ki=new Date,qi=[];[tr,er,nr,ar,or,rr].forEach(((t,e)=>{const[n,a]=t.time.state.split(":").map((t=>parseInt(t,10)));qi[e]=new Date(Ki.getTime()),qi[e].setHours(n),qi[e].setMinutes(a)}));const[$i,ts,es,ns,as,os]=qi;function rs(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?lr.charge="none":lr.charge="both",lr.capacity=parseInt(t.capacity.state),lr.entityID=e}Ki>=os||Ki<$i?rs(rr,t.entities.prog6_charge):Ki>=$i&&Ki=ts&&Ki=es&&Ki=ns&&Ki=as&&Ki50?"on":"off"),null!=Tn&&Bo==yt.Solis&&0===Tn&&(Oo=-Oo);let cr=0;if(t.show_battery)if(!0==!lr.show)Oo>0?cr="on"!==ma&&"1"!==ma&&"on-grid"!==ma.toLowerCase()||lr.show?"off"!==ma&&"0"!==ma&&"off-grid"!==ma.toLowerCase()||!k.notEmpty()||lr.show?sr:ir:sr:Oo<0&&(cr=100);else cr=Io.getBatteryCapacity(Oo,ma,sr,lr,E);let dr=0,ur="",gr="";let hr=this.getEntity("battery.energy",{state:t.battery.energy?.toString()??""}).toPower(!1);if(ya&&z.notEmpty()&&(hr=Hn.toNum(ya*z.toNum(0),0)),t.show_battery||0!==hr){0===Oo?dr=(E.toNum()-sr)/100*hr*60*60:Oo>0?dr=(E.toNum()-cr)/100*hr/Oo*60*60:Oo<0&&(dr=(cr-E.toNum(0))/100*hr/Oo*60*60*-1);const is=new Date,ss=1e3*dr,ls=new Date(is.getTime()+ss),cs=ls.getHours(),ds=ls.getMinutes().toString().padStart(2,"0"),us=cs.toString().padStart(2,"0");ur="".concat(us,":").concat(ds);const gs=Math.floor(dr/86400),hs=Math.floor(dr%86400/3600),fs=Math.floor(dr%3600/60);if(gs>0&&(gr+="".concat(gs).concat(Lt("common.days")," ")),hs>0){const ms=gs>0&&hs<10?"0".concat(hs):"".concat(hs);gr+="".concat(ms).concat(Lt("common.hrs")," ")}gr+="".concat(fs).concat(Lt("common.min"))}const fr=-2<=P.toNum(0)&&P.toNum(0)<=2&&E.toNum(0)>=99;let mr;mr=Oo<0&&!fr?Ha:Ia;let yr="",pr="",vr=l.state,Ar=!1;Bo==yt.Solis&&(vr=l.isNaN()?l.toString():l.toNum(0).toString());const wr=Io.statusGroups;if(wr)for(const ys of Object.keys(wr)){const ps=wr[ys],{states:vs,color:As,message:ws}=ps;if(vs.includes(vr.toLowerCase())){yr=As,pr=ws,Ar=!0;break}}Ar||("none"!==t.entities?.inverter_status_59&&t.entities?.inverter_status_59?(yr="transparent",pr="Status"):(yr="transparent",pr=""));let br="transparent",xr="";if([yt.GoodweGridMode,yt.Goodwe,yt.Huawei].includes(Bo)){const bs=Io.batteryStatusGroups;if(bs)for(const xs of Object.keys(bs)){const Es=bs[xs],{states:Ls,color:Ps,message:Ms}=Es;if(Ls.includes(C.state.toLowerCase())){br=Ps,xr=Ms,Ar=!0;break}}Ar||("none"!==t.entities?.battery_status&&t.entities?.battery_status?(br="transparent",xr="Status"):(br="transparent",xr=""))}const Er=mn.toNum()+e.toNum(),Lr=a.toNum()+n.toNum(),Pr=0!=Lr?Math.max(Math.min(Math.round(100*Er/Lr),100),0):0,Mr=0!=Er?Math.max(Math.min(Math.round(100*Lr/Er),100),0):0,Hr=Yo+Hn.toNum("".concat(Oo>0?Oo:0))+Hn.toNum("".concat(xn<0?-1*xn:0)),Vr=Fo+Math.max(Jo,0)+Hn.toNum("".concat(xn>0?xn:0))+Hn.toNum("".concat(Oo<0?-1*Oo:0)),Qr=0!=Vr?Math.max(Math.min(Math.round(100*Hr/Vr),100),0):0,Ur=0!=Hr?Math.max(Math.min(Math.round(100*Vr/Hr),100),0):0,Wr=(Hn.toNum(t.max_line_width)<1?1:t.max_line_width)-1,Zr=Hn.toNum(t.min_line_width)||1,Yr=mn.toNum()+e.toNum()+o.toNum(),Xr=0!=Er?Math.max(Math.min(Math.round(1e3*Lr/Er)/10,100),0):0,Fr=0!=Yr?Math.max(Math.min(Math.round(1e3*Er/Yr)/10,100),0):0,Jr=this.getEntity("battery.max_power",{state:t.battery.max_power?.toString()??""}),Kr=this.getEntity("solar.max_power",{state:t.solar.max_power?.toString()??""}),qr=this.getEntity("load.max_power",{state:t.load.max_power?.toString()??""}),$r=this.getEntity("grid.max_power",{state:t.grid.max_power?.toString()??""}),ti=t.solar.max_power?this.dynamicLineWidth(Ho,Kr.toNum()||Ho,Wr,Zr):Zr,ei=t.solar.max_power?this.dynamicLineWidth(Vo,Kr.toNum()||Vo,Wr,Zr):Zr,ni=t.solar.max_power?this.dynamicLineWidth(Qo,Kr.toNum()||Qo,Wr,Zr):Zr,ai=t.solar.max_power?this.dynamicLineWidth(Uo,Kr.toNum()||Uo,Wr,Zr):Zr,oi=t.solar.max_power?this.dynamicLineWidth(Wo,Kr.toNum()||Wo,Wr,Zr):Zr,ri=t.battery.max_power?this.dynamicLineWidth(Math.abs(Oo),Jr.toNum(0)||Math.abs(Oo),Wr,Zr):Zr,ii=t.load.max_power?this.dynamicLineWidth(Math.abs(Fo),qr.toNum()||Math.abs(Fo),Wr,Zr):Zr,si=t.load.max_power?this.dynamicLineWidth(Math.abs(xn),qr.toNum()||Math.abs(xn),Wr,Zr):Zr,li=t.grid.max_power?this.dynamicLineWidth(Math.abs(Nn),$r.toNum()||Math.abs(Nn),Wr,Zr):Zr,ci=t.grid.max_power?this.dynamicLineWidth(Math.abs(va),$r.toNum()||Math.abs(va),Wr,Zr):Zr,gi=t.grid.max_power?this.dynamicLineWidth(Math.abs(Jo),$r.toNum()||Math.abs(Jo),Wr,Zr):Zr,hi=t.solar.max_power?this.dynamicLineWidth(Yo,Kr.toNum()||Yo,Wr,Zr):Zr;if(t&&t.solar&&t.solar.animation_speed){const Cs=t.solar.animation_speed-(t.solar.animation_speed-1)*(Yo/(Kr.toNum()||Yo));this.changeAnimationSpeed("solar",Cs)}if(t&&t.solar&&t.solar.animation_speed){const Ns=t.solar.animation_speed-(t.solar.animation_speed-1)*(Ho/(Kr.toNum()||Ho));this.changeAnimationSpeed("pv1",Ns)}if(t&&t.solar&&t.solar.animation_speed){const zs=t.solar.animation_speed-(t.solar.animation_speed-1)*(Vo/(Kr.toNum()||Vo));this.changeAnimationSpeed("pv2",zs)}if(t&&t.solar&&t.solar.animation_speed){const Ts=t.solar.animation_speed-(t.solar.animation_speed-1)*(Qo/(Kr.toNum()||Qo));this.changeAnimationSpeed("pv3",Ts)}if(t&&t.solar&&t.solar.animation_speed){const ks=t.solar.animation_speed-(t.solar.animation_speed-1)*(Uo/(Kr.toNum()||Uo));this.changeAnimationSpeed("pv4",ks)}if(t&&t.solar&&t.solar.animation_speed){const _s=t.solar.animation_speed-(t.solar.animation_speed-1)*(Wo/(Kr.toNum()||Wo));this.changeAnimationSpeed("pv5",_s)}if(t&&t.battery&&t.battery.animation_speed){const Os=t.battery.animation_speed-(t.battery.animation_speed-1)*(Math.abs(Oo)/(Jr.toNum(0)||Math.abs(Oo)));this.changeAnimationSpeed("battery",Os)}if(t&&t.load&&t.load.animation_speed){const js=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(Fo)/(qr.toNum()||Math.abs(Fo)));this.changeAnimationSpeed("load",js),this.changeAnimationSpeed("load1",js)}if(t&&t.load&&t.load.animation_speed){const Ds=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(xn)/(qr.toNum()||Math.abs(xn)));this.changeAnimationSpeed("aux",Ds),this.changeAnimationSpeed("aux1",Ds)}if(t&&t.grid&&t.grid.animation_speed){const Rs=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(Nn)/($r.toNum()||Math.abs(Nn)));this.changeAnimationSpeed("grid1",Rs),this.changeAnimationSpeed("grid",Rs),this.changeAnimationSpeed("grid2",Rs)}if(t&&t.grid&&t.grid.animation_speed){const Gs=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(Jo)/($r.toNum()||Math.abs(Jo)));this.changeAnimationSpeed("ne",Gs)}const fi=0===Yo?0:"off"!==_o&&_o||Oo>0?Yo/(Ko?Fo+Math.max(xn,0):Fo)*100:(Yo-Math.abs(Oo))/(Ko?Fo+Math.max(xn,0):Fo)*100,mi=Oo<=0?0:Math.abs(Oo)/(Ko?Fo+Math.max(xn,0):Fo)*100,yi=fi+mi,pi=0===yi?0:fi/yi*100,vi=0===yi?0:mi/yi*100;let Ai,wi,bi=0;yi>=100||0==Nn?(Ai=Hn.toNum(pi,0),wi=Hn.toNum(vi,0)):(Ai=Hn.toNum(Math.min(fi,100),0),wi=Hn.toNum(Math.min(mi,100),0),bi=100-(Ai+wi));const xi=0===Yo||Oo>=0?0:"off"!==_o&&_o?(Yo-Fo)/Math.abs(Oo)*100:Yo/Math.abs(Oo)*100,Ei=Oo>=0||Nn<=0?0:"on"===_o?Yo-Fo>=Math.abs(Oo)?0:(Nn-Math.max(Fo-Yo,0))/Math.abs(Oo)*100:Yo>=Math.abs(Oo)?0:(Math.abs(Oo)-Yo)/Math.abs(Oo)*100,Li=xi+Ei,Pi=0===Li?0:xi/Li*100,Mi=0===Li?0:Ei/Li*100;let Ci,Ni,zi,Ti,ki,_i,Oi;switch(Li>=100||0==Nn?(Ci=Hn.toNum(Pi,0),Ni=Hn.toNum(Mi,0)):(Ci=Hn.toNum(Math.min(xi,100),0),Ni=Hn.toNum(Math.min(Ei,100),0)),!0){case Ci>=Hn.toNum(t.battery?.path_threshold,0):zi=Xo;break;case Ni>=Hn.toNum(t.battery?.path_threshold,0):zi=Ma;break;default:zi=mr}switch(!0){case Ai>=Hn.toNum(t.load?.path_threshold,0):Ti=Xo;break;case wi>=Hn.toNum(t.load?.path_threshold,0):Ti=mr;break;case bi>=Hn.toNum(t.load?.path_threshold,0):Ti=Ma;break;default:Ti=jn}switch(!0){case Ai>=Hn.toNum(t.load?.path_threshold,0):ki=Xo;break;case wi>=Hn.toNum(t.load?.path_threshold,0):ki=mr;break;case bi>=Hn.toNum(t.load?.path_threshold,0):case Ni>=Hn.toNum(t.battery?.path_threshold,0):ki=Ma;break;default:ki=zo}switch(!0){case fi>=100&&mi<=5&&Nn-Jo<50&&t.load.dynamic_icon:_i=Jn,Oi=1;break;case mi>=100&&fi<=5&&Nn-Jo<50&&t.load.dynamic_icon:_i=Xn,Oi=0;break;case fi<5&&mi<5&&bi>0&&t.load.dynamic_icon:_i=Fn,Oi=0;break;default:_i=Yn,Oi=0}const{batteryIcon:ji,batteryCharge:Di,stopColour:Ri,battery0:Gi}=ui.convert(E),Bi=this.getEntity("solar.pv1_max_power",{state:t.solar.pv1_max_power?.toString()??""}),Si=this.getEntity("solar.pv2_max_power",{state:t.solar.pv2_max_power?.toString()??""}),Ii=this.getEntity("solar.pv3_max_power",{state:t.solar.pv3_max_power?.toString()??""}),Hi=this.getEntity("solar.pv4_max_power",{state:t.solar.pv4_max_power?.toString()??""}),Vi=this.getEntity("solar.pv5_max_power",{state:t.solar.pv5_max_power?.toString()??""}),Qi=t.solar.max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(Yo/Kr.toNum()*100,200),0):100,Ui=t.solar.pv1_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(Ho/Bi.toNum()*100,200),0):100,Wi=t.solar.pv2_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(Vo/Si.toNum()*100,200),0):100,Zi=t.solar.pv3_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(Qo/Ii.toNum()*100,200),0):100,Yi=t.solar.pv4_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(Uo/Hi.toNum()*100,200),0):100,Xi=t.solar.pv5_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(Wo/Vi.toNum()*100,200),0):100;let Fi,Ji;switch(!0){case Nn<0&&_t.includes(ma.toLowerCase()):Fi=Mo,Ji=Ma;break;case Nn>=0&&_t.includes(ma.toLowerCase()):Fi=Lo,Ji=Ma;break;case 0===Nn&&kt.includes(ma.toLowerCase()):Fi=Po,Ji=ka;break;default:Fi=Lo,Ji=Ma}return((t,e,n)=>{Dr.solarColour=n.solarColour,Dr.decimalPlacesEnergy=n.decimalPlacesEnergy,Dr.decimalPlaces=n.decimalPlaces,Gr.gridColour=n.gridColour,Gr.decimalPlaces=n.decimalPlaces;let a=t.viewbox?.viewbox_min_x?t.viewbox.viewbox_min_x:0,o=t.viewbox?.viewbox_min_y?t.viewbox.viewbox_min_y:t.show_solar||n.additionalLoad>6?0:n.additionalLoad>0||!t.show_battery?80:146,r=t.viewbox?.viewbox_width?t.viewbox.viewbox_width:t.load.aux_loads>4||n.additionalLoad>18?648:t.load.aux_loads>3||n.additionalLoad>13?600:t.load.aux_loads>2||n.additionalLoad>8?552:505,i=t.viewbox?.viewbox_height?t.viewbox.viewbox_height:t.show_solar?t.show_battery?408:n.additionalLoad>=2?400:300:t.show_battery&&n.additionalLoad>0?350:271;return V(Cr||(Cr=ht(["\n\t\t\t\n\t\t\t\t",'\n\t\t\t\t
\n\t\t\t\t\t','\n\t\t\t\t\t\n\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\n\n\t\t\t\t\t\t","\n\n\n\t\t\t\t\t\t","\n\n\t\t\t\t\t\t","\n\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t"])),Zn.getStyle(n),t.title?V(Nr||(Nr=ht(['\n\t\t\t\t\t\t',""])),t.title_colour||"inherit",t.title_size||"32px",t.title):"",a,o,r,i,!1===n.panelMode?"".concat(t.show_solar||t.show_battery?t.show_solar?t.show_solar&&!t.show_battery?n.additionalLoad>=2?"400px":"300px":"".concat(n.cardHeight):0!==n.additionalLoad?"330px":"246px":"270px"):"".concat(t.show_solar?"100%":"75%"),!0===n.panelMode?"".concat(n.cardWidth):"100%",t.show_grid?Q(zr||(zr=ht(["\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t "])),Gr.generateShapeAndName(n,t),Gr.generateDailyImport(n,t),Gr.generateDailyExport(n,t),Gr.generateFlowLines(n),Gr.generateIcon(n,t),Gr.generateEnergyCost(n,t),Gr.generatePhases(n,t),Gr.generatePrepaidUnits(n,t),Gr.generateLimit(n,t),Gr.generateTotalGridPower(n,t),Gr.generateFrequency(n)):"",t.show_grid&&t.grid.show_nonessential?Q(Tr||(Tr=ht(["\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t "])),Sr.generateShapeAndName(n,t),Sr.generateLoad1(n,t),Sr.generateLoad2(n,t),Sr.generateLoad3(n,t),Sr.generateLines(n,t),Sr.generateFlowLine(n,t),Sr.generateTotalPower(n,t),Sr.generateIcon(n)):"",t.show_solar?Q(kr||(kr=ht(["\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t "])),Dr.generateSolarHeader(n,t),Dr.generateMppt1(n,t),Dr.generateMppt2(n,t),Dr.generateMppt3(n,t),Dr.generateMppt4(n,t),Dr.generateMppt5(n,t),Dr.generateSolarPower(n,t),Dr.generateSolarSellIcon(n,t)):"",Wn.getTexts(n),t.show_battery?Q(_r||(_r=ht(["\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t "," \n\t "," \n\t "," \n\t ","\n\t "])),Rr.generateShapes(n,t),Rr.generatePower(n,t),Rr.generateDuration(n,t),Rr.generateDailyCharge(n,t),Rr.generateDailyDischarge(n,t),Rr.generateSOC(n,t),Rr.generateSOH(n),Rr.generateCapacity(n,t),Rr.generateShutdownSOC(n,t),Rr.generateFlowLines(n,t),Rr.generateBatteryGradient(n,t),Rr.generateVoltage(n),Rr.generateCurrent(n,t),Rr.generateTemp(n)):"",n.additionalLoad>0?Q(Or||(Or=ht(["\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t "])),Un.generateLines(n,t),Un.generateLoad1(n,t),Un.generateLoad2(n,t),Un.generateLoad3(n,t),Un.generateLoad4(n,t),Un.generateLoad5(n,t),Un.generateLoad6(n,t),Un.generateLoad7(n,t),Un.generateLoad8(n,t),Un.generateLoad9(n,t),Un.generateLoad10(n,t),Un.generateLoad11(n,t),Un.generateLoad12(n,t),Un.generateLoad13(n,t),Un.generateLoad14(n,t),Un.generateLoad15(n,t),Un.generateLoad16(n,t),Un.generateLoad17(n,t),Un.generateLoad18(n,t),Un.generateLoad19(n,t),Un.generateLoad20(n,t),Un.generateLoad21(n,t),Un.generateLoad22(n,t),Un.generateLoad23(n,t)):"",n.showAux?Q(jr||(jr=ht(["\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t"])),Ir.generateShapes(n,t),Ir.generateLines(n),Ir.generateLoad1(n,t),Ir.generateLoad2(n,t),Ir.generateTotalLoad(n,t),Ir.generateDailyLoad(n,t)):"",Vn.generateShapeAndName(n,t),Vn.generateFlowLines(n,t),Vn.generateIcon(n,t),Vn.generatePowers(n,t),Vn.generateTotalLoad(n,t),Vn.generateDailyLoad(n,t),Br.generateTimerInfo(n,t),Br.generatePriorityLoad(n,t),Br.generateInverterImage(n,e),Br.generateInverterState(n,t),Br.generateInverterLoad(n,t),Br.generateInverterProgram(n),Br.generatePhases(n,t),Br.generateFrequency(n),Br.generateTemperatures(n,t))})(t,So,{config:t,panelMode:No,compactMode:!0,cardHeight:jo,cardWidth:Do,loadColour:jn,batteryColour:mr,gridColour:Ma,gridImportColour:Ea,gridExportColour:La,isFloating:fr,inverterColour:zo,solarColour:Xo,auxOffColour:Oa,batteryEnergy:hr,largeFont:Co,batteryPower:Oo,stateBatteryPower:L,batteryDuration:gr,batteryCapacity:cr,additionalLoad:Wa,essIconSize:Oi,essIcon:_i,stateUseTimer:u,batteryStateMsg:xr,stateBatterySoc:E,inverterProg:lr,batteryPercentage:wi,pvPercentage:Ai,loadShowDaily:ha,stateEnergyCostSell:Ve,stateEnergyCostBuy:He,loadPowerL1:wa,loadPowerL2:ba,loadPowerL3:xa,durationCur:this.durationCur,stateGridPowerL1:ze,stateGridPowerL2:Te,stateGridPowerL3:ke,stateGridVoltageL1:_e,stateGridVoltageL2:Oe,stateGridVoltageL3:je,stateGridCurrentL1:De,stateGridCurrentL2:Re,stateGridCurrentL3:Ge,decimalPlaces:_n,decimalPlacesEnergy:On,stateEssentialLoad1:Y,stateEssentialLoad2:X,stateEssentialLoad3:F,stateEssentialLoad4:J,stateEssentialLoad5:K,stateEssentialLoad6:q,stateEssentialLoad7:$,stateEssentialLoad8:tt,stateEssentialLoad9:et,stateEssentialLoad10:nt,stateEssentialLoad11:at,stateEssentialLoad12:ot,stateEssentialLoad13:rt,stateEssentialLoad14:it,stateEssentialLoad15:st,stateEssentialLoad16:lt,stateEssentialLoad17:ct,stateEssentialLoad18:dt,stateEssentialLoad19:ut,stateEssentialLoad20:gt,stateEssentialLoad21:ft,stateEssentialLoad22:mt,stateEssentialLoad23:pt,stateEssentialLoad1Extra:vt,stateEssentialLoad2Extra:At,stateEssentialLoad3Extra:wt,stateEssentialLoad4Extra:bt,stateEssentialLoad5Extra:Et,stateEssentialLoad6Extra:Pt,stateEssentialLoad7Extra:Ot,stateEssentialLoad8Extra:jt,stateEssentialLoad9Extra:Dt,stateEssentialLoad10Extra:Rt,stateEssentialLoad11Extra:Gt,stateEssentialLoad12Extra:Bt,stateEssentialLoad13Extra:St,stateEssentialLoad14Extra:It,stateEssentialLoad15Extra:Ht,stateEssentialLoad16Extra:Vt,stateEssentialLoad17Extra:Qt,stateEssentialLoad18Extra:Ut,stateEssentialLoad19Extra:Wt,stateEssentialLoad20Extra:Zt,stateEssentialLoad21Extra:Yt,stateEssentialLoad22Extra:Xt,stateEssentialLoad23Extra:Ft,stateEssentialLoad1Toggle:Jt,stateEssentialLoad2Toggle:Kt,stateEssentialLoad3Toggle:qt,stateEssentialLoad4Toggle:$t,stateEssentialLoad5Toggle:te,stateEssentialLoad6Toggle:ee,stateEssentialLoad7Toggle:ne,stateEssentialLoad8Toggle:ae,stateEssentialLoad9Toggle:oe,stateEssentialLoad10Toggle:re,stateEssentialLoad11Toggle:ie,stateEssentialLoad12Toggle:se,stateEssentialLoad13Toggle:le,stateEssentialLoad14Toggle:ce,stateEssentialLoad15Toggle:de,stateEssentialLoad16Toggle:ue,stateEssentialLoad17Toggle:ge,stateEssentialLoad18Toggle:he,stateEssentialLoad19Toggle:fe,stateEssentialLoad20Toggle:me,stateEssentialLoad21Toggle:ye,stateEssentialLoad22Toggle:pe,stateEssentialLoad23Toggle:ve,stateNonessentialLoad1:R,stateNonessentialLoad2:G,stateNonessentialLoad3:B,stateNonEssentialLoad1Extra:S,stateNonEssentialLoad2Extra:I,stateNonEssentialLoad3Extra:H,stateNonEssentialLoad1Toggle:U,stateNonEssentialLoad2Toggle:W,stateNonEssentialLoad3Toggle:Z,gridShowDailyBuy:Ba,gridShowDailySell:Sa,batteryShowDaily:Va,inverterModel:Bo,batteryShutdown:sr,enableAutarky:To,autarkyPower:Qr,ratioPower:Ur,ratioEnergy:Mr,autarkyEnergy:Pr,autarkyAuto:Xr,autarkySelf:Fr,shutdownOffGrid:ir,statePV1Current:Ye,statePV2Current:Fe,statePV3Current:Ke,statePV4Current:$e,statePV5Current:en,energyCost:Go,stateInverterCurrentL1:p,stateInverterCurrentL2:v,stateInverterCurrentL3:A,stateRadiatorTemp:h,stateInverterVoltageL1:f,stateInverterVoltageL2:m,stateInverterVoltageL3:y,stateBatteryVoltage:x,stateBatteryCurrent:P,batLineWidth:ri,totalGridPower:Nn,solarLineWidth:hi,totalPV:Yo,loadLineWidth:ii,pvPercentageBat:Ci,gridPercentageBat:Ni,genericInverterImage:kn,battery0:Gi,essentialPower:Fo,pv1LineWidth:ti,pv2LineWidth:ei,pv3LineWidth:ni,pv4LineWidth:ai,pv5LineWidth:oi,gridLineWidth:li,stateEnvironmentTemp:w,statePV1Voltage:Ze,statePV2Voltage:Xe,statePV3Voltage:Je,statePV4Voltage:qe,statePV5Voltage:tn,batteryStateColour:br,inverterStateColour:yr,stateBatteryTemp:M,statePrepaidUnits:Ue,stateDCTransformerTemp:g,stateInverterLoadPercentage:b,iconEssentialLoad1:Xa,iconEssentialLoad2:Fa,iconEssentialLoad3:Ja,iconEssentialLoad4:Ka,iconEssentialLoad5:qa,iconEssentialLoad6:$a,iconEssentialLoad7:to,iconEssentialLoad8:eo,iconEssentialLoad9:no,iconEssentialLoad10:ao,iconEssentialLoad11:oo,iconEssentialLoad12:ro,iconEssentialLoad13:io,iconEssentialLoad14:so,iconEssentialLoad15:lo,iconEssentialLoad16:co,iconEssentialLoad17:uo,iconEssentialLoad18:go,iconEssentialLoad19:ho,iconEssentialLoad20:fo,iconEssentialLoad21:mo,iconEssentialLoad22:yo,iconEssentialLoad23:po,enableTimer:ko,stateSolarSell:hn,priorityLoad:_o,inverterImg:So,stateDailyPVEnergy:mn,stateMonthlyPVEnergy:yn,stateYearlyPVEnergy:pn,stateTotalSolarGeneration:vn,stateRemainingSolar:An,stateTomorrowSolar:wn,statePV2Power:an,statePV3Power:on,statePV4Power:rn,statePV5Power:sn,statePV1Energy:ln,statePV2Energy:cn,statePV3Energy:dn,statePV4Energy:un,statePV5Energy:gn,stateDayLoadEnergy:a,stateDayBatteryDischarge:e,stateDayGridImport:o,stateDayBatteryCharge:n,stateDayGridExport:r,statePVTotal:fn,statePV1Power:nn,minLineWidth:Zr,stopColour:Ri,gridStatus:ma,batteryCharge:Di,gridOffColour:ka,batteryIcon:ji,formattedResultTime:ur,showAux:Qa,nonessentialIcon:wo,showNonessential:fa,nonessentialLoads:Ga,iconNonessentialLoad1:bo,iconNonessentialLoad2:xo,iconNonessentialLoad3:Eo,inverterStateMsg:pr,auxType:Ya,showDailyAux:Ua,nonessentialPower:Jo,nonessLineWidth:gi,grid169LineWidth:ci,auxLineWidth:si,iconAuxLoad1:vo,iconAuxLoad2:Ao,stateDayAuxEnergy:i,additionalAuxLoad:Za,auxPower:xn,stateAuxPower:j,stateAuxLoad1:xe,stateAuxLoad2:Ee,stateAuxLoad1Extra:Le,stateAuxLoad2Extra:Pe,stateAuxLoad1Toggle:Me,stateAuxLoad2Toggle:Ce,autoScaledInverterPower:pa,autoScaledGridPower:va,auxDynamicColour:Ra,auxDynamicColourLoad1:ja,auxDynamicColourLoad2:Da,stateMaxSellPower:We,totalPVEfficiency:Qi,PV1Efficiency:Ui,PV2Efficiency:Wi,PV3Efficiency:Zi,PV4Efficiency:Yi,PV5Efficiency:Xi,gridPercentage:bi,flowColour:Ti,flowBatColour:zi,flowInvColour:ki,dynamicColourEssentialLoad1:Dn,dynamicColourEssentialLoad2:Rn,dynamicColourEssentialLoad3:Gn,dynamicColourEssentialLoad4:Bn,dynamicColourEssentialLoad5:Sn,dynamicColourEssentialLoad6:In,dynamicColourEssentialLoad7:Qn,dynamicColourEssentialLoad8:Kn,dynamicColourEssentialLoad9:qn,dynamicColourEssentialLoad10:$n,dynamicColourEssentialLoad11:ta,dynamicColourEssentialLoad12:ea,dynamicColourEssentialLoad13:na,dynamicColourEssentialLoad14:aa,dynamicColourEssentialLoad15:oa,dynamicColourEssentialLoad16:ra,dynamicColourEssentialLoad17:ia,dynamicColourEssentialLoad18:sa,dynamicColourEssentialLoad19:la,dynamicColourEssentialLoad20:ca,dynamicColourEssentialLoad21:da,dynamicColourEssentialLoad22:ua,dynamicColourEssentialLoad23:ga,dynamicColourNonEssentialLoad:Ca,dynamicColourNonEssentialLoad1:Na,dynamicColourNonEssentialLoad2:za,dynamicColourNonEssentialLoad3:Ta,stateBatterySOH:_,customGridIcon:Fi,customGridIconColour:Ji,stateLoadFrequency:s,stateGridFrequency:Ne})}getEntity(t,e={state:"0",attributes:{unit_of_measurement:""}}){const n=String(t).split(".");let a;a=n.length>1?this._config[n[0]][n[1]]:n.length>0?this._config[n[0]]:"";const o=a?this.hass.states[a]:void 0;return gi(void 0!==o?o:e||{state:void 0})}changeAnimationSpeed(t,e){const n=e>=1?Hn.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]}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}calculateAuxLoadColour(t,e,n){let a=this.colourConvert(this._config.load?.aux_colour);return this._config.load.aux_dynamic_colour?e.isValidSwitch()?"on"===e.toOnOff()?a:this.GREY_COLOUR:Math.abs(t.toPower(!1))>Hn.toNum(n,0)?a:this.GREY_COLOUR:a}calculateEssentialLoadColour(t,e,n){let a=this.colourConvert(this._config.load?.colour);return this._config.load.dynamic_colour?e.isValidSwitch()?"on"===e.toOnOff()?a:this.GREY_COLOUR:Math.abs(t.toPower(!1))>Hn.toNum(n,0)?a:this.GREY_COLOUR:a}getDynamicColorWithToggle(t,e,n,a,o,r=this.GREY_COLOUR){return e.isValidSwitch()?"on"===e.toOnOff()?a:r:Math.abs(t.toPower(!1))>Hn.toNum(n,0)?t.toPower(!1)>0?a:o:this.GREY_COLOUR}setConfig(t){if(t.show_battery&&!t.battery)throw Error(Lt("errors.battery.bat"));if(t.show_battery&&!t.battery.shutdown_soc)throw new Error(Lt("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(Lt("errors.battery.show_daily"));if(t.show_solar&&!t.solar)throw Error(Lt("errors.solar.sol"));if(t.show_solar&&!t.solar.mppts)throw Error(Lt("errors.solar.mppts"));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(Lt("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(Lt("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(Lt("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(Lt("errors.missing_entity")," e.g: ").concat(n,": sensor.example"));const n=t;this._config=In({},Pt,n)}};var fi,mi;t([ut()],hi.prototype,"hass",void 0),t([ut()],hi.prototype,"_config",void 0),t([gt("#grid-flow")],hi.prototype,"gridFlow",void 0),t([gt("#grid1-flow")],hi.prototype,"grid1Flow",void 0),t([gt("#solar-flow")],hi.prototype,"solarFlow",void 0),t([gt("#pv1-flow")],hi.prototype,"pv1Flow",void 0),t([gt("#pv2-flow")],hi.prototype,"pv2Flow",void 0),t([gt("#pv3-flow")],hi.prototype,"pv3Flow",void 0),t([gt("#pv4-flow")],hi.prototype,"pv4Flow",void 0),t([gt("#pv5-flow")],hi.prototype,"pv5Flow",void 0),t([gt("#battery-flow")],hi.prototype,"batteryFlow",void 0),t([gt("#load-flow")],hi.prototype,"loadFlow",void 0),t([gt("#aux-flow")],hi.prototype,"auxFlow",void 0),t([gt("#ne-flow")],hi.prototype,"neFlow",void 0),t([gt("#ne1-flow")],hi.prototype,"ne1Flow",void 0),hi=t([lt("mlk-power-flow-card")],hi),window.customCards.push({type:"mlk-power-flow-card",name:"Power Flow Card by Molikk",preview:!0,description:Lt("common.description"),configurable:!0}),function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(fi||(fi={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(mi||(mi={}));var yi,pi,vi={exports:{}};yi=vi,pi=vi.exports,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",a="__lodash_placeholder__",o=16,r=32,i=64,s=128,l=256,c=1/0,d=9007199254740991,u=NaN,g=4294967295,h=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",r],["partialRight",i],["rearg",l]],f="[object Arguments]",m="[object Array]",y="[object Boolean]",p="[object Date]",v="[object Error]",A="[object Function]",w="[object GeneratorFunction]",b="[object Map]",x="[object Number]",E="[object Object]",L="[object Promise]",P="[object RegExp]",M="[object Set]",C="[object String]",N="[object Symbol]",z="[object WeakMap]",T="[object ArrayBuffer]",k="[object DataView]",_="[object Float32Array]",O="[object Float64Array]",j="[object Int8Array]",D="[object Int16Array]",R="[object Int32Array]",G="[object Uint8Array]",B="[object Uint8ClampedArray]",S="[object Uint16Array]",I="[object Uint32Array]",H=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,Q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,Z=RegExp(U.source),Y=RegExp(W.source),X=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),nt=/^\s+/,at=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,rt=/\{\n\/\* \[wrapped with (.+)\] \*/,it=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ut=/\w*$/,gt=/^[-+]0x[0-9a-f]+$/i,ht=/^0b[01]+$/i,ft=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,pt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,At=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",bt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="\\u2700-\\u27bf",Et="a-z\\xdf-\\xf6\\xf8-\\xff",Lt="A-Z\\xc0-\\xd6\\xd8-\\xde",Pt="\\ufe0e\\ufe0f",Mt="\\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",Ct="['’]",Nt="["+wt+"]",zt="["+Mt+"]",Tt="["+bt+"]",kt="\\d+",_t="["+xt+"]",Ot="["+Et+"]",jt="[^"+wt+Mt+kt+xt+Et+Lt+"]",Dt="\\ud83c[\\udffb-\\udfff]",Rt="[^"+wt+"]",Gt="(?:\\ud83c[\\udde6-\\uddff]){2}",Bt="[\\ud800-\\udbff][\\udc00-\\udfff]",St="["+Lt+"]",It="\\u200d",Vt="(?:"+Ot+"|"+jt+")",Qt="(?:"+St+"|"+jt+")",Ut="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Zt="(?:"+Tt+"|"+Dt+")?",Yt="["+Pt+"]?",Xt=Yt+Zt+"(?:"+It+"(?:"+[Rt,Gt,Bt].join("|")+")"+Yt+Zt+")*",Ft="(?:"+[_t,Gt,Bt].join("|")+")"+Xt,Jt="(?:"+[Rt+Tt+"?",Tt,Gt,Bt,Nt].join("|")+")",Kt=RegExp(Ct,"g"),qt=RegExp(Tt,"g"),$t=RegExp(Dt+"(?="+Dt+")|"+Jt+Xt,"g"),te=RegExp([St+"?"+Ot+"+"+Ut+"(?="+[zt,St,"$"].join("|")+")",Qt+"+"+Wt+"(?="+[zt,St+Vt,"$"].join("|")+")",St+"?"+Vt+"+"+Ut,St+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",kt,Ft].join("|"),"g"),ee=RegExp("["+It+wt+bt+Pt+"]"),ne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ae=["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"],oe=-1,re={};re[_]=re[O]=re[j]=re[D]=re[R]=re[G]=re[B]=re[S]=re[I]=!0,re[f]=re[m]=re[T]=re[y]=re[k]=re[p]=re[v]=re[A]=re[b]=re[x]=re[E]=re[P]=re[M]=re[C]=re[z]=!1;var ie={};ie[f]=ie[m]=ie[T]=ie[k]=ie[y]=ie[p]=ie[_]=ie[O]=ie[j]=ie[D]=ie[R]=ie[b]=ie[x]=ie[E]=ie[P]=ie[M]=ie[C]=ie[N]=ie[G]=ie[B]=ie[S]=ie[I]=!0,ie[v]=ie[A]=ie[z]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,ce=parseInt,de="object"==typeof Ht&&Ht&&Ht.Object===Object&&Ht,ue="object"==typeof self&&self&&self.Object===Object&&self,ge=de||ue||Function("return this")(),he=pi&&!pi.nodeType&&pi,fe=he&&yi&&!yi.nodeType&&yi,me=fe&&fe.exports===he,ye=me&&de.process,pe=function(){try{var t=fe&&fe.require&&fe.require("util").types;return t||ye&&ye.binding&&ye.binding("util")}catch(t){}}(),ve=pe&&pe.isArrayBuffer,Ae=pe&&pe.isDate,we=pe&&pe.isMap,be=pe&&pe.isRegExp,xe=pe&&pe.isSet,Ee=pe&&pe.isTypedArray;function Le(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 Pe(t,e,n,a){for(var o=-1,r=null==t?0:t.length;++o-1}function ke(t,e,n){for(var a=-1,o=null==t?0:t.length;++a-1;);return n}function tn(t,e){for(var n=t.length;n--&&Ie(e,t[n],0)>-1;);return n}var en=We({"À":"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"}),nn=We({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(t){return"\\"+se[t]}function on(t){return ee.test(t)}function rn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,a){n[++e]=[a,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function ln(t,e){for(var n=-1,o=t.length,r=0,i=[];++n",""":'"',"'":"'"}),mn=function at(wt){var bt,xt=(wt=null==wt?ge:mn.defaults(ge.Object(),wt,mn.pick(ge,ae))).Array,Et=wt.Date,Lt=wt.Error,Pt=wt.Function,Mt=wt.Math,Ct=wt.Object,Nt=wt.RegExp,zt=wt.String,Tt=wt.TypeError,kt=xt.prototype,_t=Pt.prototype,Ot=Ct.prototype,jt=wt["__core-js_shared__"],Dt=_t.toString,Rt=Ot.hasOwnProperty,Gt=0,Bt=(bt=/[^.]+$/.exec(jt&&jt.keys&&jt.keys.IE_PROTO||""))?"Symbol(src)_1."+bt:"",St=Ot.toString,It=Dt.call(Ct),Ht=ge._,Vt=Nt("^"+Dt.call(Rt).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qt=me?wt.Buffer:t,Ut=wt.Symbol,Wt=wt.Uint8Array,Zt=Qt?Qt.allocUnsafe:t,Yt=sn(Ct.getPrototypeOf,Ct),Xt=Ct.create,Ft=Ot.propertyIsEnumerable,Jt=kt.splice,$t=Ut?Ut.isConcatSpreadable:t,ee=Ut?Ut.iterator:t,se=Ut?Ut.toStringTag:t,de=function(){try{var t=hr(Ct,"defineProperty");return t({},"",{}),t}catch(t){}}(),ue=wt.clearTimeout!==ge.clearTimeout&&wt.clearTimeout,he=Et&&Et.now!==ge.Date.now&&Et.now,fe=wt.setTimeout!==ge.setTimeout&&wt.setTimeout,ye=Mt.ceil,pe=Mt.floor,Ge=Ct.getOwnPropertySymbols,We=Qt?Qt.isBuffer:t,yn=wt.isFinite,pn=kt.join,vn=sn(Ct.keys,Ct),An=Mt.max,wn=Mt.min,bn=Et.now,xn=wt.parseInt,En=Mt.random,Ln=kt.reverse,Pn=hr(wt,"DataView"),Mn=hr(wt,"Map"),Cn=hr(wt,"Promise"),Nn=hr(wt,"Set"),zn=hr(wt,"WeakMap"),Tn=hr(Ct,"create"),kn=zn&&new zn,_n={},On=Sr(Pn),jn=Sr(Mn),Dn=Sr(Cn),Rn=Sr(Nn),Gn=Sr(zn),Bn=Ut?Ut.prototype:t,Sn=Bn?Bn.valueOf:t,In=Bn?Bn.toString:t;function Hn(t){if(ns(t)&&!Wi(t)&&!(t instanceof Wn)){if(t instanceof Un)return t;if(Rt.call(t,"__wrapped__"))return Ir(t)}return new Un(t)}var Vn=function(){function e(){}return function(n){if(!es(n))return{};if(Xt)return Xt(n);e.prototype=n;var a=new e;return e.prototype=t,a}}();function Qn(){}function Un(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Zn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=n?e:n)),e}function ca(e,n,a,o,r,i){var s,l=1&n,c=2&n,d=4&n;if(a&&(s=r?a(e,o,r,i):a(e)),s!==t)return s;if(!es(e))return e;var u=Wi(e);if(u){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Rt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!l)return ko(e,s)}else{var g=yr(e),h=g==A||g==w;if(Fi(e))return Po(e,l);if(g==E||g==f||h&&!r){if(s=c||h?{}:vr(e),!l)return c?function(t,e){return _o(t,mr(t),e)}(e,function(t,e){return t&&_o(e,Os(e),t)}(s,e)):function(t,e){return _o(t,fr(t),e)}(e,ra(s,e))}else{if(!ie[g])return r?e:{};s=function(t,e,n){var a,o=t.constructor;switch(e){case T:return Mo(t);case y:case p:return new o(+t);case k:return function(t,e){var n=e?Mo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case _:case O:case j:case D:case R:case G:case B:case S:case I:return Co(t,n);case b:return new o;case x:case C:return new o(t);case P:return function(t){var e=new t.constructor(t.source,ut.exec(t));return e.lastIndex=t.lastIndex,e}(t);case M:return new o;case N:return a=t,Sn?Ct(Sn.call(a)):{}}}(e,g,l)}}i||(i=new Jn);var m=i.get(e);if(m)return m;i.set(e,s),ss(e)?e.forEach((function(t){s.add(ca(t,n,a,t,e,i))})):as(e)&&e.forEach((function(t,o){s.set(o,ca(t,n,a,o,e,i))}));var v=u?t:(d?c?ir:rr:c?Os:_s)(e);return Me(v||e,(function(t,o){v&&(t=e[o=t]),na(s,o,ca(t,n,a,o,e,i))})),s}function da(e,n,a){var o=a.length;if(null==e)return!o;for(e=Ct(e);o--;){var r=a[o],i=n[r],s=e[r];if(s===t&&!(r in e)||!i(s))return!1}return!0}function ua(n,a,o){if("function"!=typeof n)throw new Tt(e);return _r((function(){n.apply(t,o)}),a)}function ga(t,e,n,a){var o=-1,r=Te,i=!0,s=t.length,l=[],c=e.length;if(!s)return l;n&&(e=_e(e,Je(n))),a?(r=ke,i=!1):e.length>=200&&(r=qe,i=!1,e=new Fn(e));t:for(;++o-1},Yn.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},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Zn,map:new(Mn||Yn),string:new Zn}},Xn.prototype.delete=function(t){var e=ur(this,t).delete(t);return this.size-=e?1:0,e},Xn.prototype.get=function(t){return ur(this,t).get(t)},Xn.prototype.has=function(t){return ur(this,t).has(t)},Xn.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},Fn.prototype.add=Fn.prototype.push=function(t){return this.__data__.set(t,n),this},Fn.prototype.has=function(t){return this.__data__.has(t)},Jn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Jn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Jn.prototype.get=function(t){return this.__data__.get(t)},Jn.prototype.has=function(t){return this.__data__.has(t)},Jn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Yn){var a=n.__data__;if(!Mn||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xn(a)}return n.set(t,e),this.size=n.size,this};var ha=Do(ba),fa=Do(xa,!0);function ma(t,e){var n=!0;return ha(t,(function(t,a,o){return n=!!e(t,a,o)})),n}function ya(e,n,a){for(var o=-1,r=e.length;++o0&&n(s)?e>1?va(s,e-1,n,a,o):Oe(o,s):a||(o[o.length]=s)}return o}var Aa=Ro(),wa=Ro(!0);function ba(t,e){return t&&Aa(t,e,_s)}function xa(t,e){return t&&wa(t,e,_s)}function Ea(t,e){return ze(e,(function(e){return qi(t[e])}))}function La(e,n){for(var a=0,o=(n=bo(n,e)).length;null!=e&&ae}function Na(t,e){return null!=t&&Rt.call(t,e)}function za(t,e){return null!=t&&e in Ct(t)}function Ta(e,n,a){for(var o=a?ke:Te,r=e[0].length,i=e.length,s=i,l=xt(i),c=1/0,d=[];s--;){var u=e[s];s&&n&&(u=_e(u,Je(n))),c=wn(u.length,c),l[s]=!a&&(n||r>=120&&u.length>=120)?new Fn(s&&u):t}u=e[0];var g=-1,h=l[0];t:for(;++g=s?l:l*("desc"==n[a]?-1:1)}return t.index-e.index}(t,e,n)}))}function Za(t,e,n){for(var a=-1,o=e.length,r={};++a-1;)s!==t&&Jt.call(s,l,1),Jt.call(t,l,1);return t}function Xa(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;wr(o)?Jt.call(t,o,1):ho(t,o)}}return t}function Fa(t,e){return t+pe(En()*(e-t+1))}function Ja(t,e){var n="";if(!t||e<1||e>d)return n;do{e%2&&(n+=t),(e=pe(e/2))&&(t+=t)}while(e);return n}function Ka(t,e){return Or(Nr(t,e,ol),t+"")}function qa(t){return qn(Hs(t))}function $a(t,e){var n=Hs(t);return Rr(n,la(e,0,n.length))}function to(e,n,a,o){if(!es(e))return e;for(var r=-1,i=(n=bo(n,e)).length,s=i-1,l=e;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=xt(o);++a>>1,i=t[r];null!==i&&!cs(i)&&(n?i<=e:i=200){var c=e?null:Ko(t);if(c)return cn(c);i=!1,o=qe,l=new Fn}else l=e?[]:s;t:for(;++a=o?e:oo(e,n,a)}var Lo=ue||function(t){return ge.clearTimeout(t)};function Po(t,e){if(e)return t.slice();var n=t.length,a=Zt?Zt(n):new t.constructor(n);return t.copy(a),a}function Mo(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Co(t,e){var n=e?Mo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function No(e,n){if(e!==n){var a=e!==t,o=null===e,r=e==e,i=cs(e),s=n!==t,l=null===n,c=n==n,d=cs(n);if(!l&&!d&&!i&&e>n||i&&s&&c&&!l&&!d||o&&s&&c||!a&&c||!r)return 1;if(!o&&!i&&!d&&e1?a[r-1]:t,s=r>2?a[2]:t;for(i=e.length>3&&"function"==typeof i?(r--,i):t,s&&br(a[0],a[1],s)&&(i=r<3?t:i,r=1),n=Ct(n);++o-1?r[i?n[s]:s]:t}}function Ho(n){return or((function(a){var o=a.length,r=o,i=Un.prototype.thru;for(n&&a.reverse();r--;){var s=a[r];if("function"!=typeof s)throw new Tt(e);if(i&&!l&&"wrapper"==lr(s))var l=new Un([],!0)}for(r=l?r:o;++r1&&A.reverse(),g&&dl))return!1;var d=i.get(e),u=i.get(n);if(d&&u)return d==n&&u==e;var g=-1,h=!0,f=2&a?new Fn:t;for(i.set(e,n),i.set(n,e);++g-1&&t%1==0&&t1?"& ":"")+e[a],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(a,function(t,e){return Me(h,(function(n){var a="_."+n[0];e&n[1]&&!Te(t,a)&&t.push(a)})),t.sort()}(function(t){var e=t.match(rt);return e?e[1].split(it):[]}(a),n)))}function Dr(e){var n=0,a=0;return function(){var o=bn(),r=16-(o-a);if(a=o,r>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Rr(e,n){var a=-1,o=e.length,r=o-1;for(n=n===t?o:n;++a1?e[n-1]:t;return a="function"==typeof a?(e.pop(),a):t,ii(e,a)}));function hi(t){var e=Hn(t);return e.__chain__=!0,e}function fi(t,e){return e(t)}var mi=or((function(e){var n=e.length,a=n?e[0]:0,o=this.__wrapped__,r=function(t){return sa(t,e)};return!(n>1||this.__actions__.length)&&o instanceof Wn&&wr(a)?((o=o.slice(a,+a+(n?1:0))).__actions__.push({func:fi,args:[r],thisArg:t}),new Un(o,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(r)})),yi=Oo((function(t,e,n){Rt.call(t,n)?++t[n]:ia(t,n,1)})),pi=Io(Ur),vi=Io(Wr);function Ai(t,e){return(Wi(t)?Me:ha)(t,dr(e,3))}function wi(t,e){return(Wi(t)?Ce:fa)(t,dr(e,3))}var bi=Oo((function(t,e,n){Rt.call(t,n)?t[n].push(e):ia(t,n,[e])})),xi=Ka((function(t,e,n){var a=-1,o="function"==typeof e,r=Yi(t)?xt(t.length):[];return ha(t,(function(t){r[++a]=o?Le(e,t,n):ka(t,e,n)})),r})),Ei=Oo((function(t,e,n){ia(t,n,e)}));function Li(t,e){return(Wi(t)?_e:Ia)(t,dr(e,3))}var Pi=Oo((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Mi=Ka((function(t,e){if(null==t)return[];var n=e.length;return n>1&&br(t,e[0],e[1])?e=[]:n>2&&br(e[0],e[1],e[2])&&(e=[e[0]]),Wa(t,va(e,1),[])})),Ci=he||function(){return ge.Date.now()};function Ni(e,n,a){return n=a?t:n,n=e&&null==n?e.length:n,$o(e,s,t,t,t,t,n)}function zi(n,a){var o;if("function"!=typeof a)throw new Tt(e);return n=ms(n),function(){return--n>0&&(o=a.apply(this,arguments)),n<=1&&(a=t),o}}var Ti=Ka((function(t,e,n){var a=1;if(n.length){var o=ln(n,cr(Ti));a|=r}return $o(t,a,e,n,o)})),ki=Ka((function(t,e,n){var a=3;if(n.length){var o=ln(n,cr(ki));a|=r}return $o(e,a,t,n,o)}));function _i(n,a,o){var r,i,s,l,c,d,u=0,g=!1,h=!1,f=!0;if("function"!=typeof n)throw new Tt(e);function m(e){var a=r,o=i;return r=i=t,u=e,l=n.apply(o,a)}function y(e){var n=e-d;return d===t||n>=a||n<0||h&&e-u>=s}function p(){var t=Ci();if(y(t))return v(t);c=_r(p,function(t){var e=a-(t-d);return h?wn(e,s-(t-u)):e}(t))}function v(e){return c=t,f&&r?m(e):(r=i=t,l)}function A(){var e=Ci(),n=y(e);if(r=arguments,i=this,d=e,n){if(c===t)return function(t){return u=t,c=_r(p,a),g?m(t):l}(d);if(h)return Lo(c),c=_r(p,a),m(d)}return c===t&&(c=_r(p,a)),l}return a=ps(a)||0,es(o)&&(g=!!o.leading,s=(h="maxWait"in o)?An(ps(o.maxWait)||0,a):s,f="trailing"in o?!!o.trailing:f),A.cancel=function(){c!==t&&Lo(c),u=0,r=d=i=c=t},A.flush=function(){return c===t?l:v(Ci())},A}var Oi=Ka((function(t,e){return ua(t,1,e)})),ji=Ka((function(t,e,n){return ua(t,ps(e)||0,n)}));function Di(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Tt(e);var a=function(){var e=arguments,o=n?n.apply(this,e):e[0],r=a.cache;if(r.has(o))return r.get(o);var i=t.apply(this,e);return a.cache=r.set(o,i)||r,i};return a.cache=new(Di.Cache||Xn),a}function Ri(t){if("function"!=typeof t)throw new Tt(e);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)}}Di.Cache=Xn;var Gi=xo((function(t,e){var n=(e=1==e.length&&Wi(e[0])?_e(e[0],Je(dr())):_e(va(e,1),Je(dr()))).length;return Ka((function(a){for(var o=-1,r=wn(a.length,n);++o=e})),Ui=_a(function(){return arguments}())?_a:function(t){return ns(t)&&Rt.call(t,"callee")&&!Ft.call(t,"callee")},Wi=xt.isArray,Zi=ve?Je(ve):function(t){return ns(t)&&Ma(t)==T};function Yi(t){return null!=t&&ts(t.length)&&!qi(t)}function Xi(t){return ns(t)&&Yi(t)}var Fi=We||pl,Ji=Ae?Je(Ae):function(t){return ns(t)&&Ma(t)==p};function Ki(t){if(!ns(t))return!1;var e=Ma(t);return e==v||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!rs(t)}function qi(t){if(!es(t))return!1;var e=Ma(t);return e==A||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function $i(t){return"number"==typeof t&&t==ms(t)}function ts(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}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=we?Je(we):function(t){return ns(t)&&yr(t)==b};function os(t){return"number"==typeof t||ns(t)&&Ma(t)==x}function rs(t){if(!ns(t)||Ma(t)!=E)return!1;var e=Yt(t);if(null===e)return!0;var n=Rt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Dt.call(n)==It}var is=be?Je(be):function(t){return ns(t)&&Ma(t)==P},ss=xe?Je(xe):function(t){return ns(t)&&yr(t)==M};function ls(t){return"string"==typeof t||!Wi(t)&&ns(t)&&Ma(t)==C}function cs(t){return"symbol"==typeof t||ns(t)&&Ma(t)==N}var ds=Ee?Je(Ee):function(t){return ns(t)&&ts(t.length)&&!!re[Ma(t)]},us=Xo(Sa),gs=Xo((function(t,e){return t<=e}));function hs(t){if(!t)return[];if(Yi(t))return ls(t)?gn(t):ko(t);if(ee&&t[ee])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ee]());var e=yr(t);return(e==b?rn:e==M?cn:Hs)(t)}function fs(t){return t?(t=ps(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ms(t){var e=fs(t),n=e%1;return e==e?n?e-n:e:0}function ys(t){return t?la(ms(t),0,g):0}function ps(t){if("number"==typeof t)return t;if(cs(t))return u;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=Fe(t);var n=ht.test(t);return n||mt.test(t)?ce(t.slice(2),n?2:8):gt.test(t)?u:+t}function vs(t){return _o(t,Os(t))}function As(t){return null==t?"":uo(t)}var ws=jo((function(t,e){if(Pr(e)||Yi(e))_o(e,_s(e),t);else for(var n in e)Rt.call(e,n)&&na(t,n,e[n])})),bs=jo((function(t,e){_o(e,Os(e),t)})),xs=jo((function(t,e,n,a){_o(e,Os(e),t,a)})),Es=jo((function(t,e,n,a){_o(e,_s(e),t,a)})),Ls=or(sa),Ps=Ka((function(e,n){e=Ct(e);var a=-1,o=n.length,r=o>2?n[2]:t;for(r&&br(n[0],n[1],r)&&(o=1);++a1),e})),_o(t,ir(t),n),a&&(n=ca(n,7,nr));for(var o=e.length;o--;)ho(n,e[o]);return n})),Gs=or((function(t,e){return null==t?{}:function(t,e){return Za(t,e,(function(e,n){return Ns(t,n)}))}(t,e)}));function Bs(t,e){if(null==t)return{};var n=_e(ir(t),(function(t){return[t]}));return e=dr(e),Za(t,n,(function(t,n){return e(t,n[0])}))}var Ss=qo(_s),Is=qo(Os);function Hs(t){return null==t?[]:Ke(t,_s(t))}var Vs=Bo((function(t,e,n){return e=e.toLowerCase(),t+(n?Qs(e):e)}));function Qs(t){return Ks(As(t).toLowerCase())}function Us(t){return(t=As(t))&&t.replace(pt,en).replace(qt,"")}var Ws=Bo((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Zs=Bo((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ys=Go("toLowerCase"),Xs=Bo((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Fs=Bo((function(t,e,n){return t+(n?" ":"")+Ks(e)})),Js=Bo((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ks=Go("toUpperCase");function qs(e,n,a){return e=As(e),(n=a?t:n)===t?function(t){return ne.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(st)||[]}(e):e.match(n)||[]}var $s=Ka((function(e,n){try{return Le(e,t,n)}catch(t){return Ki(t)?t:new Lt(t)}})),tl=or((function(t,e){return Me(e,(function(e){e=Br(e),ia(t,e,Ti(t[e],t))})),t}));function el(t){return function(){return t}}var nl=Ho(),al=Ho(!0);function ol(t){return t}function rl(t){return Ra("function"==typeof t?t:ca(t,1))}var il=Ka((function(t,e){return function(n){return ka(n,t,e)}})),sl=Ka((function(t,e){return function(n){return ka(t,n,e)}}));function ll(t,e,n){var a=_s(e),o=Ea(e,a);null!=n||es(e)&&(o.length||!a.length)||(n=e,e=t,t=this,o=Ea(e,_s(e)));var r=!(es(n)&&"chain"in n&&!n.chain),i=qi(t);return Me(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 cl(){}var dl=Wo(_e),ul=Wo(Ne),gl=Wo(Re);function hl(t){return xr(t)?Ue(Br(t)):function(t){return function(e){return La(e,t)}}(t)}var fl=Yo(),ml=Yo(!0);function yl(){return[]}function pl(){return!1}var vl,Al=Uo((function(t,e){return t+e}),0),wl=Jo("ceil"),bl=Uo((function(t,e){return t/e}),1),xl=Jo("floor"),El=Uo((function(t,e){return t*e}),1),Ll=Jo("round"),Pl=Uo((function(t,e){return t-e}),0);return Hn.after=function(t,n){if("function"!=typeof n)throw new Tt(e);return t=ms(t),function(){if(--t<1)return n.apply(this,arguments)}},Hn.ary=Ni,Hn.assign=ws,Hn.assignIn=bs,Hn.assignInWith=xs,Hn.assignWith=Es,Hn.at=Ls,Hn.before=zi,Hn.bind=Ti,Hn.bindAll=tl,Hn.bindKey=ki,Hn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Wi(t)?t:[t]},Hn.chain=hi,Hn.chunk=function(e,n,a){n=(a?br(e,n,a):n===t)?1:An(ms(n),0);var o=null==e?0:e.length;if(!o||n<1)return[];for(var r=0,i=0,s=xt(ye(o/n));rr?0:r+a),(o=o===t||o>r?r:ms(o))<0&&(o+=r),o=a>o?0:ys(o);a>>0)?(e=As(e))&&("string"==typeof n||null!=n&&!is(n))&&!(n=uo(n))&&on(e)?Eo(gn(e),0,a):e.split(n,a):[]},Hn.spread=function(t,n){if("function"!=typeof t)throw new Tt(e);return n=null==n?0:An(ms(n),0),Ka((function(e){var a=e[n],o=Eo(e,0,n);return a&&Oe(o,a),Le(t,this,o)}))},Hn.tail=function(t){var e=null==t?0:t.length;return e?oo(t,1,e):[]},Hn.take=function(e,n,a){return e&&e.length?oo(e,0,(n=a||n===t?1:ms(n))<0?0:n):[]},Hn.takeRight=function(e,n,a){var o=null==e?0:e.length;return o?oo(e,(n=o-(n=a||n===t?1:ms(n)))<0?0:n,o):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?mo(t,dr(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?mo(t,dr(e,3)):[]},Hn.tap=function(t,e){return e(t),t},Hn.throttle=function(t,n,a){var o=!0,r=!0;if("function"!=typeof t)throw new Tt(e);return es(a)&&(o="leading"in a?!!a.leading:o,r="trailing"in a?!!a.trailing:r),_i(t,n,{leading:o,maxWait:n,trailing:r})},Hn.thru=fi,Hn.toArray=hs,Hn.toPairs=Ss,Hn.toPairsIn=Is,Hn.toPath=function(t){return Wi(t)?_e(t,Br):cs(t)?[t]:ko(Gr(As(t)))},Hn.toPlainObject=vs,Hn.transform=function(t,e,n){var a=Wi(t),o=a||Fi(t)||ds(t);if(e=dr(e,4),null==n){var r=t&&t.constructor;n=o?a?new r:[]:es(t)&&qi(r)?Vn(Yt(t)):{}}return(o?Me:ba)(t,(function(t,a,o){return e(n,t,a,o)})),n},Hn.unary=function(t){return Ni(t,1)},Hn.union=ni,Hn.unionBy=ai,Hn.unionWith=oi,Hn.uniq=function(t){return t&&t.length?go(t):[]},Hn.uniqBy=function(t,e){return t&&t.length?go(t,dr(e,2)):[]},Hn.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?go(e,t,n):[]},Hn.unset=function(t,e){return null==t||ho(t,e)},Hn.unzip=ri,Hn.unzipWith=ii,Hn.update=function(t,e,n){return null==t?t:fo(t,e,wo(n))},Hn.updateWith=function(e,n,a,o){return o="function"==typeof o?o:t,null==e?e:fo(e,n,wo(a),o)},Hn.values=Hs,Hn.valuesIn=function(t){return null==t?[]:Ke(t,Os(t))},Hn.without=si,Hn.words=qs,Hn.wrap=function(t,e){return Bi(wo(e),t)},Hn.xor=li,Hn.xorBy=ci,Hn.xorWith=di,Hn.zip=ui,Hn.zipObject=function(t,e){return vo(t||[],e||[],na)},Hn.zipObjectDeep=function(t,e){return vo(t||[],e||[],to)},Hn.zipWith=gi,Hn.entries=Ss,Hn.entriesIn=Is,Hn.extend=bs,Hn.extendWith=xs,ll(Hn,Hn),Hn.add=Al,Hn.attempt=$s,Hn.camelCase=Vs,Hn.capitalize=Qs,Hn.ceil=wl,Hn.clamp=function(e,n,a){return a===t&&(a=n,n=t),a!==t&&(a=(a=ps(a))==a?a:0),n!==t&&(n=(n=ps(n))==n?n:0),la(ps(e),n,a)},Hn.clone=function(t){return ca(t,4)},Hn.cloneDeep=function(t){return ca(t,5)},Hn.cloneDeepWith=function(e,n){return ca(e,5,n="function"==typeof n?n:t)},Hn.cloneWith=function(e,n){return ca(e,4,n="function"==typeof n?n:t)},Hn.conformsTo=function(t,e){return null==e||da(t,e,_s(e))},Hn.deburr=Us,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=bl,Hn.endsWith=function(e,n,a){e=As(e),n=uo(n);var o=e.length,r=a=a===t?o:la(ms(a),0,o);return(a-=n.length)>=0&&e.slice(a,r)==n},Hn.eq=Hi,Hn.escape=function(t){return(t=As(t))&&Y.test(t)?t.replace(W,nn):t},Hn.escapeRegExp=function(t){return(t=As(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Hn.every=function(e,n,a){var o=Wi(e)?Ne:ma;return a&&br(e,n,a)&&(n=t),o(e,dr(n,3))},Hn.find=pi,Hn.findIndex=Ur,Hn.findKey=function(t,e){return Be(t,dr(e,3),ba)},Hn.findLast=vi,Hn.findLastIndex=Wr,Hn.findLastKey=function(t,e){return Be(t,dr(e,3),xa)},Hn.floor=xl,Hn.forEach=Ai,Hn.forEachRight=wi,Hn.forIn=function(t,e){return null==t?t:Aa(t,dr(e,3),Os)},Hn.forInRight=function(t,e){return null==t?t:wa(t,dr(e,3),Os)},Hn.forOwn=function(t,e){return t&&ba(t,dr(e,3))},Hn.forOwnRight=function(t,e){return t&&xa(t,dr(e,3))},Hn.get=Cs,Hn.gt=Vi,Hn.gte=Qi,Hn.has=function(t,e){return null!=t&&pr(t,e,Na)},Hn.hasIn=Ns,Hn.head=Yr,Hn.identity=ol,Hn.includes=function(t,e,n,a){t=Yi(t)?t:Hs(t),n=n&&!a?ms(n):0;var o=t.length;return n<0&&(n=An(o+n,0)),ls(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&Ie(t,e,n)>-1},Hn.indexOf=function(t,e,n){var a=null==t?0:t.length;if(!a)return-1;var o=null==n?0:ms(n);return o<0&&(o=An(a+o,0)),Ie(t,e,o)},Hn.inRange=function(e,n,a){return n=fs(n),a===t?(a=n,n=0):a=fs(a),function(t,e,n){return t>=wn(e,n)&&t=-9007199254740991&&t<=d},Hn.isSet=ss,Hn.isString=ls,Hn.isSymbol=cs,Hn.isTypedArray=ds,Hn.isUndefined=function(e){return e===t},Hn.isWeakMap=function(t){return ns(t)&&yr(t)==z},Hn.isWeakSet=function(t){return ns(t)&&"[object WeakSet]"==Ma(t)},Hn.join=function(t,e){return null==t?"":pn.call(t,e)},Hn.kebabCase=Ws,Hn.last=Kr,Hn.lastIndexOf=function(e,n,a){var o=null==e?0:e.length;if(!o)return-1;var r=o;return a!==t&&(r=(r=ms(a))<0?An(o+r,0):wn(r,o-1)),n==n?function(t,e,n){for(var a=n+1;a--;)if(t[a]===e)return a;return a}(e,n,r):Se(e,Ve,r,!0)},Hn.lowerCase=Zs,Hn.lowerFirst=Ys,Hn.lt=us,Hn.lte=gs,Hn.max=function(e){return e&&e.length?ya(e,ol,Ca):t},Hn.maxBy=function(e,n){return e&&e.length?ya(e,dr(n,2),Ca):t},Hn.mean=function(t){return Qe(t,ol)},Hn.meanBy=function(t,e){return Qe(t,dr(e,2))},Hn.min=function(e){return e&&e.length?ya(e,ol,Sa):t},Hn.minBy=function(e,n){return e&&e.length?ya(e,dr(n,2),Sa):t},Hn.stubArray=yl,Hn.stubFalse=pl,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=El,Hn.nth=function(e,n){return e&&e.length?Ua(e,ms(n)):t},Hn.noConflict=function(){return ge._===this&&(ge._=Ht),this},Hn.noop=cl,Hn.now=Ci,Hn.pad=function(t,e,n){t=As(t);var a=(e=ms(e))?un(t):0;if(!e||a>=e)return t;var o=(e-a)/2;return Zo(pe(o),n)+t+Zo(ye(o),n)},Hn.padEnd=function(t,e,n){t=As(t);var a=(e=ms(e))?un(t):0;return e&&an){var o=e;e=n,n=o}if(a||e%1||n%1){var r=En();return wn(e+r*(n-e+le("1e-"+((r+"").length-1))),n)}return Fa(e,n)},Hn.reduce=function(t,e,n){var a=Wi(t)?je:Ze,o=arguments.length<3;return a(t,dr(e,4),n,o,ha)},Hn.reduceRight=function(t,e,n){var a=Wi(t)?De:Ze,o=arguments.length<3;return a(t,dr(e,4),n,o,fa)},Hn.repeat=function(e,n,a){return n=(a?br(e,n,a):n===t)?1:ms(n),Ja(As(e),n)},Hn.replace=function(){var t=arguments,e=As(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(e,n,a){var o=-1,r=(n=bo(n,e)).length;for(r||(r=1,e=t);++od)return[];var n=g,a=wn(t,g);e=dr(e),t-=g;for(var o=Xe(a,e);++n=i)return e;var l=a-un(o);if(l<1)return o;var c=s?Eo(s,0,l).join(""):e.slice(0,l);if(r===t)return c+o;if(s&&(l+=c.length-l),is(r)){if(e.slice(l).search(r)){var d,u=c;for(r.global||(r=Nt(r.source,As(ut.exec(r))+"g")),r.lastIndex=0;d=r.exec(u);)var g=d.index;c=c.slice(0,g===t?l:g)}}else if(e.indexOf(uo(r),l)!=l){var h=c.lastIndexOf(r);h>-1&&(c=c.slice(0,h))}return c+o},Hn.unescape=function(t){return(t=As(t))&&Z.test(t)?t.replace(U,fn):t},Hn.uniqueId=function(t){var e=++Gt;return As(t)+e},Hn.upperCase=Js,Hn.upperFirst=Ks,Hn.each=Ai,Hn.eachRight=wi,Hn.first=Yr,ll(Hn,(vl={},ba(Hn,(function(t,e){Rt.call(Hn.prototype,e)||(vl[e]=t)})),vl),{chain:!1}),Hn.VERSION="4.17.21",Me(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hn[t].placeholder=Hn})),Me(["drop","take"],(function(e,n){Wn.prototype[e]=function(a){a=a===t?1:An(ms(a),0);var o=this.__filtered__&&!n?new Wn(this):this.clone();return o.__filtered__?o.__takeCount__=wn(a,o.__takeCount__):o.__views__.push({size:wn(a,g),type:e+(o.__dir__<0?"Right":"")}),o},Wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Me(["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:dr(t,3),type:n}),e.__filtered__=e.__filtered__||a,e}})),Me(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),Me(["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=Ka((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(Ri(dr(t)))},Wn.prototype.slice=function(e,n){e=ms(e);var a=this;return a.__filtered__&&(e>0||n<0)?new Wn(a):(e<0?a=a.takeRight(-e):e&&(a=a.drop(e)),n!==t&&(a=(n=ms(n))<0?a.dropRight(-n):a.take(n-e)),a)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(g)},ba(Wn.prototype,(function(e,n){var a=/^(?:filter|find|map|reject)|While$/.test(n),o=/^(?:head|last)$/.test(n),r=Hn[o?"take"+("last"==n?"Right":""):n],i=o||/^find/.test(n);r&&(Hn.prototype[n]=function(){var n=this.__wrapped__,s=o?[1]:arguments,l=n instanceof Wn,c=s[0],d=l||Wi(n),u=function(t){var e=r.apply(Hn,Oe([t],s));return o&&g?e[0]:e};d&&a&&"function"==typeof c&&1!=c.length&&(l=d=!1);var g=this.__chain__,h=!!this.__actions__.length,f=i&&!g,m=l&&!h;if(!i&&d){n=m?n:new Wn(this);var y=e.apply(n,s);return y.__actions__.push({func:fi,args:[u],thisArg:t}),new Un(y,g)}return f&&m?e.apply(this,s):(y=this.thru(u),f?o?y.value()[0]:y.value():y)})})),Me(["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);Hn.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)}))}})),ba(Wn.prototype,(function(t,e){var n=Hn[e];if(n){var a=n.name+"";Rt.call(_n,a)||(_n[a]=[]),_n[a].push({name:e,func:n})}})),_n[Vo(t,2).name]=[{name:"wrapper",func:t}],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){for(var a=-1,o=n.length;++a=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Hn.prototype.plant=function(e){for(var n,a=this;a instanceof Qn;){var o=Ir(a);o.__index__=0,o.__values__=t,n?r.__wrapped__=o:n=o;var r=o;a=a.__wrapped__}return r.__wrapped__=e,n},Hn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wn){var n=e;return this.__actions__.length&&(n=new Wn(this)),(n=n.reverse()).__actions__.push({func:fi,args:[ei],thisArg:t}),new Un(n,this.__chain__)}return this.thru(ei)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return yo(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,ee&&(Hn.prototype[ee]=function(){return this}),Hn}();fe?((fe.exports=mn)._=mn,he._=mn):ge._=mn}.call(Ht);var Ai,wi,bi=vi.exports;let xi=class extends it{constructor(){super(...arguments),this._computeLabelCallback=t=>Lt("config.".concat(t.name))??t.name}setConfig(t){this._config={...this._config,...t}}render(){return this._config&&this.hass?V(wi||(wi=ht(["\n\t\t\t\t\t\n\t\t"])),this.hass,this._config,this._computeLabelCallback.bind(this),[{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:{}}}]}]},{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:"dynamic_line_width",selector:{boolean:{}}},{name:"max_line_width",selector:{number:{}}},{name:"min_line_width",selector:{number:{}}},{name:"decimal_places",selector:{number:{}}},{name:"decimal_places_energy",selector:{number:{}}}]},{type:"expandable",title:this._title("adv_viewbox"),schema:[{name:"viewbox",type:"grid",schema:[{name:"viewbox_min_x",selector:{number:{}}},{name:"viewbox_min_y",selector:{number:{}}},{name:"viewbox_width",selector:{number:{}}},{name:"viewbox_height",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(yt).map((t=>({label:bi.capitalize(t),value:t})))}}},{name:"modern",selector:{boolean:{}}},{name:"autarky",selector:{select:{options:Object.values(pt).map((t=>({label:bi.capitalize(t),value:t})))}}},{name:"colour",selector:{color_rgb:{}}},{name:"ac_icon",selector:{icon:{}}},{name:"dc_icon",selector:{icon:{}}}]}]},{type:"expandable",title:this._title("solar"),schema:[{name:"solar",type:"grid",schema:[{name:"mppts",selector:{number:{min:1,max:5}}},{name:"auto_scale",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"animation_speed",selector:{number:{}}},{name:"off_threshold",selector:{number:{}}}]},{type:"expandable",title:this._title("solar_production"),schema:[{name:"solar",type:"grid",schema:[{name:"daily_solar_name",selector:{text:{}}},{name:"monthly_solar_name",selector:{text:{}}},{name:"yearly_solar_name",selector:{text:{}}},{name:"total_solar_generation_name",selector:{text:{}}},{name:"remaining_solar_name",selector:{text:{}}},{name:"tomorrow_solar_name",selector:{text:{}}}]}]},{type:"expandable",title:this._title("max_power"),schema:[{name:"solar",type:"grid",schema:[{name:"max_power",selector:{number:{}}},{name:"pv1_max_power",selector:{number:{}}},{name:"pv2_max_power",selector:{number:{}}},{name:"pv3_max_power",selector:{number:{}}},{name:"pv4_max_power",selector:{number:{}}},{name:"pv5_max_power",selector:{number:{}}}]}]},{type:"expandable",title:this._title("mppt_options"),schema:[{name:"solar",type:"grid",schema:[{name:"pv1_name",selector:{text:{}}},{name:"pv2_name",selector:{text:{}}},{name:"pv3_name",selector:{text:{}}},{name:"pv4_name",selector:{text:{}}},{name:"pv5_name",selector:{text:{}}},{name:"visualize_efficiency",selector:{boolean:{}}},{name:"show_mppt_efficiency",selector:{boolean:{}}},{name:"show_mppt_production",selector:{boolean:{}}}]}]}]},{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:"shutdown_soc_offgrid",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:"animate",selector:{boolean:{}}},{name:"animation_speed",selector:{number:{}}},{name:"hide_soc",selector:{boolean:{}}},{name:"show_remaining_energy",selector:{boolean:{}}},{name:"max_power",selector:{number:{}}},{name:"path_threshold",selector:{number:{}}}]},{type:"expandable",title:this._title("sensor"),schema:[{name:"battery",type:"grid",schema:[{name:"energy",selector:{entity:{}}},{name:"shutdown_soc",selector:{entity:{}}},{name:"shutdown_soc_offgrid",selector:{entity:{}}},{name:"max_power",selector:{entity:{}}}]}]}]},{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:23}}},{name:"animation_speed",selector:{number:{}}},{name:"max_power",selector:{number:{}}},{name:"off_threshold",selector:{number:{}}},{name:"path_threshold",selector:{number:{}}}]},{type:"expandable",title:this._title("additional_load"),schema:[{name:"load",type:"grid",schema:[{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:"load5_name",selector:{text:{}}},{name:"load5_icon",selector:{icon:{}}},{name:"load6_name",selector:{text:{}}},{name:"load6_icon",selector:{icon:{}}},{name:"load7_name",selector:{text:{}}},{name:"load7_icon",selector:{icon:{}}},{name:"load8_name",selector:{text:{}}},{name:"load8_icon",selector:{icon:{}}},{name:"load9_name",selector:{text:{}}},{name:"load9_icon",selector:{icon:{}}},{name:"load10_name",selector:{text:{}}},{name:"load10_icon",selector:{icon:{}}},{name:"load11_name",selector:{text:{}}},{name:"load11_icon",selector:{icon:{}}},{name:"load12_name",selector:{text:{}}},{name:"load12_icon",selector:{icon:{}}},{name:"load13_name",selector:{text:{}}},{name:"load13_icon",selector:{icon:{}}},{name:"load14_name",selector:{text:{}}},{name:"load14_icon",selector:{icon:{}}},{name:"load15_name",selector:{text:{}}},{name:"load15_icon",selector:{icon:{}}},{name:"load16_name",selector:{text:{}}},{name:"load16_icon",selector:{icon:{}}},{name:"load17_name",selector:{text:{}}},{name:"load17_icon",selector:{icon:{}}},{name:"load18_name",selector:{text:{}}},{name:"load18_icon",selector:{icon:{}}}]}]},{type:"expandable",title:this._title("aux_load"),schema:[{name:"load",type:"grid",schema:[{name:"show_aux",selector:{boolean:{}}},{name:"aux_name",selector:{text:{}}},{name:"aux_daily_name",selector:{text:{}}},{name:"aux_type",selector:{icon:{}}},{name:"invert_aux",selector:{boolean:{}}},{name:"show_absolute_aux",selector:{boolean:{}}},{name:"aux_dynamic_colour",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:"grid_name",selector:{text:{}}},{name:"max_power",selector:{number:{}}},{name:"show_daily_buy",selector:{boolean:{}}},{name:"label_daily_grid_buy",selector:{text:{}}},{name:"show_daily_sell",selector:{boolean:{}}},{name:"label_daily_grid_sell",selector:{text:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"invert_grid",selector:{boolean:{}}},{name:"show_absolute",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:"energy_cost_decimals",selector:{number:{mode:"box",min:0,max:3}}},{name:"animation_speed",selector:{number:{}}},{name:"off_threshold",selector:{number:{}}},{name:"import_icon",selector:{icon:{}}},{name:"export_icon",selector:{icon:{}}},{name:"disconnected_icon",selector:{icon:{}}},{name:"prepaid_unit_name",selector:{text:{}}},{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:{}}}]},{type:"expandable",title:this._title("additional_load"),schema:[{name:"grid",type:"grid",schema:[{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:{}}}]}]}]},{type:"expandable",title:this._title("entities"),schema:[{type:"expandable",title:this._title("sol"),schema:[{name:"entities",type:"grid",schema:[{name:"pv_total",selector:{entity:{device_class:jt.POWER}}},{name:"day_pv_energy_108",selector:{entity:{device_class:jt.ENERGY}}},{name:"monthly_pv_generation",selector:{entity:{device_class:jt.ENERGY}}},{name:"yearly_pv_generation",selector:{entity:{device_class:jt.ENERGY}}},{name:"total_pv_generation",selector:{entity:{device_class:jt.ENERGY}}},{name:"remaining_solar",selector:{entity:{device_class:jt.ENERGY}}},{name:"tomorrow_solar",selector:{entity:{device_class:jt.ENERGY}}},{name:"pv1_power_186",selector:{entity:{device_class:jt.POWER}}},{name:"pv1_production",selector:{entity:{device_class:jt.ENERGY}}},{name:"pv1_voltage_109",selector:{entity:{device_class:jt.VOLTAGE}}},{name:"pv1_current_110",selector:{entity:{device_class:jt.CURRENT}}},{name:"pv2_power_187",selector:{entity:{device_class:jt.POWER}}},{name:"pv2_production",selector:{entity:{device_class:jt.ENERGY}}},{name:"pv2_voltage_111",selector:{entity:{device_class:jt.VOLTAGE}}},{name:"pv2_current_112",selector:{entity:{device_class:jt.CURRENT}}},{name:"pv3_power_188",selector:{entity:{device_class:jt.POWER}}},{name:"pv3_production",selector:{entity:{device_class:jt.ENERGY}}},{name:"pv3_voltage_113",selector:{entity:{device_class:jt.VOLTAGE}}},{name:"pv3_current_114",selector:{entity:{device_class:jt.CURRENT}}},{name:"pv4_power_189",selector:{entity:{device_class:jt.POWER}}},{name:"pv4_production",selector:{entity:{device_class:jt.ENERGY}}},{name:"pv4_voltage_115",selector:{entity:{device_class:jt.VOLTAGE}}},{name:"pv4_current_116",selector:{entity:{device_class:jt.CURRENT}}},{name:"pv5_power",selector:{entity:{device_class:jt.POWER}}},{name:"pv5_production",selector:{entity:{device_class:jt.ENERGY}}},{name:"pv5_voltage",selector:{entity:{device_class:jt.VOLTAGE}}},{name:"pv5_current",selector:{entity:{device_class:jt.CURRENT}}},{name:"solar_sell_247",selector:{entity:{}}},{name:"environment_temp",selector:{entity:{device_class:jt.TEMPERATURE}}}]}]},{type:"expandable",title:this._title("bat"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_power_190",selector:{entity:{device_class:jt.POWER}}},{name:"battery_soc_184",selector:{entity:{device_class:jt.BATTERY}}},{name:"battery_current_191",selector:{entity:{device_class:jt.CURRENT}}},{name:"battery_voltage_183",selector:{entity:{device_class:jt.VOLTAGE}}},{name:"battery_temp_182",selector:{entity:{device_class:jt.TEMPERATURE}}},{name:"day_battery_charge_70",selector:{entity:{device_class:jt.ENERGY}}},{name:"day_battery_discharge_71",selector:{entity:{device_class:jt.ENERGY}}},{name:"battery_rated_capacity",selector:{entity:{}}},{name:"battery_soh",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:"inverter_voltage_154",selector:{entity:{device_class:jt.VOLTAGE}}},{name:"inverter_voltage_L2",selector:{entity:{device_class:jt.VOLTAGE}}},{name:"inverter_voltage_L3",selector:{entity:{device_class:jt.VOLTAGE}}},{name:"load_frequency_192",selector:{entity:{device_class:jt.FREQUENCY}}},{name:"inverter_current_164",selector:{entity:{device_class:jt.CURRENT}}},{name:"inverter_current_L2",selector:{entity:{device_class:jt.CURRENT}}},{name:"inverter_current_L3",selector:{entity:{device_class:jt.CURRENT}}},{name:"inverter_power_175",selector:{entity:{device_class:jt.POWER}}},{name:"grid_power_169",selector:{entity:{device_class:jt.POWER}}},{name:"dc_transformer_temp_90",selector:{entity:{device_class:jt.TEMPERATURE}}},{name:"radiator_temp_91",selector:{entity:{device_class:jt.TEMPERATURE}}},{name:"inverter_load_percentage",selector:{entity:{domain:"sensor",unit_of_measurement:"%"}}},{name:"use_timer_248",selector:{entity:{}}},{name:"priority_load_243",selector:{entity:{}}}]},{type:"expandable",title:this._title("inv_prog"),schema:[{name:"entities",type:"grid",schema:[{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:jt.ENERGY}}},{name:"day_aux_energy",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_power",selector:{entity:{device_class:jt.POWER}}},{name:"load_power_L1",selector:{entity:{device_class:jt.POWER}}},{name:"load_power_L2",selector:{entity:{device_class:jt.POWER}}},{name:"load_power_L3",selector:{entity:{device_class:jt.POWER}}},{name:"aux_power_166",selector:{entity:{device_class:jt.POWER}}},{name:"aux_load1",selector:{entity:{device_class:jt.POWER}}},{name:"aux_load1_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"aux_load1_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"aux_load2",selector:{entity:{device_class:jt.POWER}}},{name:"aux_load2_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"aux_load2_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]},{type:"expandable",title:this._title("ess_ld"),schema:[{name:"entities",type:"grid",schema:[{name:"essential_load1",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load1_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load1_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load2",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load2_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load2_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load3",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load3_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load3_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load4",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load4_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load4_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load5",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load5_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load5_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load6",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load6_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load6_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load7",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load7_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load7_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load8",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load8_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load8_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load9",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load9_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load9_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load10",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load10_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load10_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load11",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load11_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load11_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load12",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load12_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load12_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load13",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load13_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load13_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load14",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load14_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load14_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load15",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load15_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load15_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load16",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load16_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load16_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load17",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load17_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load17_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load18",selector:{entity:{device_class:jt.POWER}}},{name:"essential_load18_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"essential_load18_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]}]},{type:"expandable",title:this._title("gri"),schema:[{name:"entities",type:"grid",schema:[{name:"day_grid_import_76",selector:{entity:{device_class:jt.ENERGY}}},{name:"day_grid_export_77",selector:{entity:{device_class:jt.ENERGY}}},{name:"grid_frequency",selector:{entity:{device_class:jt.FREQUENCY}}},{name:"grid_ct_power_172",selector:{entity:{device_class:jt.POWER}}},{name:"grid_ct_power_L2",selector:{entity:{device_class:jt.POWER}}},{name:"grid_ct_power_L3",selector:{entity:{device_class:jt.POWER}}},{name:"grid_voltage_L1",selector:{entity:{device_class:jt.VOLTAGE}}},{name:"grid_voltage_L2",selector:{entity:{device_class:jt.VOLTAGE}}},{name:"grid_voltage_L3",selector:{entity:{device_class:jt.VOLTAGE}}},{name:"grid_current_L1",selector:{entity:{device_class:jt.CURRENT}}},{name:"grid_current_L2",selector:{entity:{device_class:jt.CURRENT}}},{name:"grid_current_L3",selector:{entity:{device_class:jt.CURRENT}}},{name:"grid_ct_power_total",selector:{entity:{device_class:jt.POWER}}},{name:"grid_voltage",selector:{entity:{device_class:jt.VOLTAGE}}},{name:"nonessential_power",selector:{entity:{device_class:jt.POWER}}},{name:"non_essential_load1",selector:{entity:{device_class:jt.POWER}}},{name:"non_essential_load1_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"non_essential_load1_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"non_essential_load2",selector:{entity:{device_class:jt.POWER}}},{name:"non_essential_load2_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"non_essential_load2_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"non_essential_load3",selector:{entity:{device_class:jt.POWER}}},{name:"non_essential_load3_extra",selector:{entity:{device_class:jt.ENERGY}}},{name:"non_essential_load3_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"grid_connected_status_194",selector:{entity:{}}},{name:"energy_cost_buy",selector:{entity:{}}},{name:"energy_cost_sell",selector:{entity:{}}},{name:"prepaid_units",selector:{entity:{}}},{name:"max_sell_power",selector:{entity:{device_class:jt.POWER}}}]}]}]}],this._valueChanged.bind(this)):V(Ai||(Ai=ht([""])))}_title(t){return Lt("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})}};t([ut()],xi.prototype,"hass",void 0),t([ut()],xi.prototype,"_config",void 0),t([ut()],xi.prototype,"lovelace",void 0),xi=t([lt(Ot)],xi);var Ei=Object.freeze({__proto__:null,get ConfigurationCardEditor(){return xi}});export{hi as PowerFlowCard}; diff --git a/src/cards/compact-card.ts b/src/cards/compact-card.ts index 797a95c..d8b0ea9 100644 --- a/src/cards/compact-card.ts +++ b/src/cards/compact-card.ts @@ -22,8 +22,9 @@ export const compactCard = (config: PowerFlowCardConfig, inverterImg: string, da let miny = config.viewbox?.viewbox_min_y ? config.viewbox.viewbox_min_y : ((config.show_solar || data.additionalLoad > 6) ? 0 : (data.additionalLoad > 0 || !config.show_battery ? 80 : 146)); let width = config.viewbox?.viewbox_width ? config.viewbox.viewbox_width - :(config.load.aux_loads > 3 || data.additionalLoad > 13) ? 600 - : (config.load.aux_loads > 2 || data.additionalLoad > 8) ? 552 : 505; + :(config.load.aux_loads > 4 || data.additionalLoad > 18) ? 648 + :(config.load.aux_loads > 3 || data.additionalLoad > 13) ? 600 + : (config.load.aux_loads > 2 || data.additionalLoad > 8) ? 552 : 505; let height = config.viewbox?.viewbox_height ? config.viewbox.viewbox_height : (config.show_solar ? (config.show_battery ? 408 : (data.additionalLoad >= 2 ? 400 : 300)) : (config.show_battery ? (data.additionalLoad > 0 ? 350 : 271) : 271)); @@ -124,6 +125,11 @@ export const compactCard = (config: PowerFlowCardConfig, inverterImg: string, da ${EssentialLoad.generateLoad16(data, config)} ${EssentialLoad.generateLoad17(data, config)} ${EssentialLoad.generateLoad18(data, config)} + ${EssentialLoad.generateLoad19(data, config)} + ${EssentialLoad.generateLoad20(data, config)} + ${EssentialLoad.generateLoad21(data, config)} + ${EssentialLoad.generateLoad22(data, config)} + ${EssentialLoad.generateLoad23(data, config)} ` : `` } diff --git a/src/cards/compact/essentialLoad.ts b/src/cards/compact/essentialLoad.ts index 2bc8e3f..ff7c154 100644 --- a/src/cards/compact/essentialLoad.ts +++ b/src/cards/compact/essentialLoad.ts @@ -52,7 +52,7 @@ export class EssentialLoad { const extraColumn2 = this.mainX + 45; const icon1_big = LoadUtils.getIconWithCondition(data.additionalLoad <= 3, iconBig, isAux ? 113 : 95, data.iconEssentialLoad1, 'essload1-icon', 36); - const icon1_big_link = LoadUtils.getIconLink(config.entities.essential_load1_toggle, icon1_big); + const icon1_big_link = LoadUtils.getIconLink(data.stateEssentialLoad1Toggle.entity_id, icon1_big); return svg`${data.additionalLoad >= 4 ? @@ -79,7 +79,7 @@ export class EssentialLoad { fill="${data.dynamicColourEssentialLoad1}"> ${config.load?.load1_name ? `${config.load.load1_name}` : ''} - Utils.handlePopup(e, config.entities.essential_load1)}> + Utils.handlePopup(e, data.stateEssentialLoad1.entity_id)}> - Utils.handlePopup(e, config.entities.essential_load1_extra)}> + Utils.handlePopup(e, data.stateEssentialLoad1Extra.entity_id)}> ${data.stateEssentialLoad1Extra.toNum(1)} ${data.stateEssentialLoad1Extra.getUOM()} @@ -108,7 +108,7 @@ export class EssentialLoad { const extraColumn2 = this.mainX + 45; const icon2_big = LoadUtils.getIcon(iconBig, 250, data.iconEssentialLoad2, 'essload2-icon', 36); - const icon2_big_link = LoadUtils.getIconLink(config.entities.essential_load2_toggle, icon2_big); + const icon2_big_link = LoadUtils.getIconLink(data.stateEssentialLoad2Toggle.entity_id, icon2_big); return svg`${data.additionalLoad >= 4 ? svg` @@ -142,7 +142,7 @@ export class EssentialLoad { fill="${data.dynamicColourEssentialLoad2}"> ${config.load?.load2_name ? `${config.load.load2_name}` : ''} - Utils.handlePopup(e, config.entities.essential_load2)}> + Utils.handlePopup(e, data.stateEssentialLoad2.entity_id)}> - Utils.handlePopup(e, config.entities.essential_load2_extra)}> + Utils.handlePopup(e, data.stateEssentialLoad2Extra.entity_id)}> @@ -281,10 +281,9 @@ export class EssentialLoad { }`; } - static generateLoad9(data: DataDto, config: PowerFlowCardConfig) { - return svg`${data.additionalLoad >= 9 ? + return svg`${data.additionalLoad >= 9 && !config.load.show_aux ? svg` ${LoadUtils.generateEssentialLoad(9, data.iconEssentialLoad9, data.dynamicColourEssentialLoad9, @@ -293,7 +292,7 @@ export class EssentialLoad { data.stateEssentialLoad9Extra, data.stateEssentialLoad9Toggle, config.load.auto_scale, data.decimalPlaces, - Load.column3, Load.row3, + Load.column3, Load.row1, )}` : svg`` }`; @@ -327,7 +326,7 @@ export class EssentialLoad { data.stateEssentialLoad11Extra, data.stateEssentialLoad11Toggle, config.load.auto_scale, data.decimalPlaces, - Load.column3, Load.row4, + Load.column3, Load.row3, )}` : svg`` }`; @@ -344,7 +343,7 @@ export class EssentialLoad { data.stateEssentialLoad12Extra, data.stateEssentialLoad12Toggle, config.load.auto_scale, data.decimalPlaces, - Load.column3, Load.row5, + Load.column3, Load.row4, )}` : svg`` }`; @@ -352,7 +351,7 @@ export class EssentialLoad { static generateLoad13(data: DataDto, config: PowerFlowCardConfig) { - return svg`${data.additionalLoad >= 13 && !config.load.show_aux ? + return svg`${data.additionalLoad >= 13 ? svg` ${LoadUtils.generateEssentialLoad(13, data.iconEssentialLoad13, data.dynamicColourEssentialLoad13, @@ -361,7 +360,7 @@ export class EssentialLoad { data.stateEssentialLoad13Extra, data.stateEssentialLoad13Toggle, config.load.auto_scale, data.decimalPlaces, - Load.column3, Load.row1, + Load.column3, Load.row5, )}` : svg`` }`; @@ -369,7 +368,7 @@ export class EssentialLoad { static generateLoad14(data: DataDto, config: PowerFlowCardConfig) { - return svg`${data.additionalLoad >= 14 ? + return svg`${data.additionalLoad >= 14 && !config.load.show_aux ? svg` ${LoadUtils.generateEssentialLoad(14, data.iconEssentialLoad14, data.dynamicColourEssentialLoad14, @@ -378,7 +377,7 @@ export class EssentialLoad { data.stateEssentialLoad14Extra, data.stateEssentialLoad14Toggle, config.load.auto_scale, data.decimalPlaces, - Load.column4, Load.row3, + Load.column4, Load.row1, )}` : svg`` }`; @@ -412,7 +411,7 @@ export class EssentialLoad { data.stateEssentialLoad16Extra, data.stateEssentialLoad16Toggle, config.load.auto_scale, data.decimalPlaces, - Load.column4, Load.row4, + Load.column4, Load.row3, )}` : svg`` }`; @@ -429,7 +428,7 @@ export class EssentialLoad { data.stateEssentialLoad17Extra, data.stateEssentialLoad17Toggle, config.load.auto_scale, data.decimalPlaces, - Load.column4, Load.row5, + Load.column4, Load.row4, )}` : svg`` }`; @@ -446,7 +445,93 @@ export class EssentialLoad { data.stateEssentialLoad18Extra, data.stateEssentialLoad18Toggle, config.load.auto_scale, data.decimalPlaces, - Load.column4, Load.row1, + Load.column4, Load.row5, + )}` + : svg`` + }`; + } + + + static generateLoad19(data: DataDto, config: PowerFlowCardConfig) { + + return svg`${data.additionalLoad >= 19 && !config.load.show_aux ? + svg` + ${LoadUtils.generateEssentialLoad(19, data.iconEssentialLoad19, + data.dynamicColourEssentialLoad19, + config.load?.load19_name, + data.stateEssentialLoad19, + data.stateEssentialLoad19Extra, + data.stateEssentialLoad19Toggle, + config.load.auto_scale, data.decimalPlaces, + Load.column5, Load.row1, + )}` + : svg`` + }`; + } + + static generateLoad20(data: DataDto, config: PowerFlowCardConfig) { + + return svg`${data.additionalLoad >= 20 ? + svg` + ${LoadUtils.generateEssentialLoad(20, data.iconEssentialLoad20, + data.dynamicColourEssentialLoad20, + config.load?.load20_name, + data.stateEssentialLoad20, + data.stateEssentialLoad20Extra, + data.stateEssentialLoad20Toggle, + config.load.auto_scale, data.decimalPlaces, + Load.column5, Load.row2, + )}` + : svg`` + }`; + } + + static generateLoad21(data: DataDto, config: PowerFlowCardConfig) { + + return svg`${data.additionalLoad >= 21 ? + svg` + ${LoadUtils.generateEssentialLoad(21, data.iconEssentialLoad21, + data.dynamicColourEssentialLoad21, + config.load?.load21_name, + data.stateEssentialLoad21, + data.stateEssentialLoad21Extra, + data.stateEssentialLoad21Toggle, + config.load.auto_scale, data.decimalPlaces, + Load.column5, Load.row3, + )}` + : svg`` + }`; + } + + static generateLoad22(data: DataDto, config: PowerFlowCardConfig) { + + return svg`${data.additionalLoad >= 22 ? + svg` + ${LoadUtils.generateEssentialLoad(22, data.iconEssentialLoad22, + data.dynamicColourEssentialLoad22, + config.load?.load22_name, + data.stateEssentialLoad22, + data.stateEssentialLoad22Extra, + data.stateEssentialLoad22Toggle, + config.load.auto_scale, data.decimalPlaces, + Load.column5, Load.row4, + )}` + : svg`` + }`; + } + + static generateLoad23(data: DataDto, config: PowerFlowCardConfig) { + + return svg`${data.additionalLoad >= 23 ? + svg` + ${LoadUtils.generateEssentialLoad(23, data.iconEssentialLoad23, + data.dynamicColourEssentialLoad23, + config.load?.load23_name, + data.stateEssentialLoad23, + data.stateEssentialLoad23Extra, + data.stateEssentialLoad23Toggle, + config.load.auto_scale, data.decimalPlaces, + Load.column5, Load.row5, )}` : svg`` }`; diff --git a/src/cards/compact/load.ts b/src/cards/compact/load.ts index e983f2b..f9ab245 100644 --- a/src/cards/compact/load.ts +++ b/src/cards/compact/load.ts @@ -17,6 +17,7 @@ export class Load { public static readonly column2: number = Load.LOAD_X; public static readonly column3: number = Load.column2 + 43 + Load.GAP / 2; public static readonly column4: number = Load.column3 + 43 + Load.GAP / 2; + public static readonly column5: number = Load.column4 + 43 + Load.GAP / 2; public static readonly yGaps = [26, 55, 37, 67]; //shape, name, power, energy public static readonly xGaps = [53, 43, 63.5]; //icon, shape, names diff --git a/src/const.ts b/src/const.ts index 62a5536..42c457f 100644 --- a/src/const.ts +++ b/src/const.ts @@ -2,7 +2,7 @@ import { version } from '../package.json'; export const CARD_VERSION = version; -export const validLoadValues = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]; +export const validLoadValues = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]; export const validNonLoadValues = [0, 1, 2, 3]; export const valid3phase = [true, false]; export const validAux = [true, false]; diff --git a/src/editor.ts b/src/editor.ts index a63fef3..06b89ef 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -256,7 +256,7 @@ export class ConfigurationCardEditor extends LitElement implements LovelaceCardE { 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: 18 } } }, + { name: 'additional_loads', selector: { number: { mode: 'box', min: 0, max: 23 } } }, { name: 'animation_speed', selector: { number: {} } }, { name: 'max_power', selector: { number: {} } }, { name: 'off_threshold', selector: { number: {} } }, diff --git a/src/index.ts b/src/index.ts index 57a7fb3..c129383 100644 --- a/src/index.ts +++ b/src/index.ts @@ -194,6 +194,11 @@ export class PowerFlowCard extends LitElement { const stateEssentialLoad16 = this.getEntity('entities.essential_load16'); const stateEssentialLoad17 = this.getEntity('entities.essential_load17'); const stateEssentialLoad18 = this.getEntity('entities.essential_load18'); + const stateEssentialLoad19 = this.getEntity('entities.essential_load19'); + const stateEssentialLoad20 = this.getEntity('entities.essential_load20'); + const stateEssentialLoad21 = this.getEntity('entities.essential_load21'); + const stateEssentialLoad22 = this.getEntity('entities.essential_load22'); + const stateEssentialLoad23 = this.getEntity('entities.essential_load23'); const stateEssentialLoad1Extra = this.getEntity('entities.essential_load1_extra'); const stateEssentialLoad2Extra = this.getEntity('entities.essential_load2_extra'); const stateEssentialLoad3Extra = this.getEntity('entities.essential_load3_extra'); @@ -212,6 +217,11 @@ export class PowerFlowCard extends LitElement { const stateEssentialLoad16Extra = this.getEntity('entities.essential_load16_extra'); const stateEssentialLoad17Extra = this.getEntity('entities.essential_load17_extra'); const stateEssentialLoad18Extra = this.getEntity('entities.essential_load18_extra'); + const stateEssentialLoad19Extra = this.getEntity('entities.essential_load19_extra'); + const stateEssentialLoad20Extra = this.getEntity('entities.essential_load20_extra'); + const stateEssentialLoad21Extra = this.getEntity('entities.essential_load21_extra'); + const stateEssentialLoad22Extra = this.getEntity('entities.essential_load22_extra'); + const stateEssentialLoad23Extra = this.getEntity('entities.essential_load23_extra'); const stateEssentialLoad1Toggle = this.getEntity('entities.essential_load1_toggle'); const stateEssentialLoad2Toggle = this.getEntity('entities.essential_load2_toggle'); const stateEssentialLoad3Toggle = this.getEntity('entities.essential_load3_toggle'); @@ -230,6 +240,11 @@ export class PowerFlowCard extends LitElement { const stateEssentialLoad16Toggle = this.getEntity('entities.essential_load16_toggle'); const stateEssentialLoad17Toggle = this.getEntity('entities.essential_load17_toggle'); const stateEssentialLoad18Toggle = this.getEntity('entities.essential_load18_toggle'); + const stateEssentialLoad19Toggle = this.getEntity('entities.essential_load19_toggle'); + const stateEssentialLoad20Toggle = this.getEntity('entities.essential_load20_toggle'); + const stateEssentialLoad21Toggle = this.getEntity('entities.essential_load21_toggle'); + const stateEssentialLoad22Toggle = this.getEntity('entities.essential_load22_toggle'); + const stateEssentialLoad23Toggle = this.getEntity('entities.essential_load23_toggle'); const stateLoadPowerL1 = this.getEntity('entities.load_power_L1'); const stateLoadPowerL2 = this.getEntity('entities.load_power_L2'); const stateLoadPowerL3 = this.getEntity('entities.load_power_L3'); @@ -337,6 +352,11 @@ export class PowerFlowCard extends LitElement { const dynamicColourEssentialLoad16 = this.calculateEssentialLoadColour(stateEssentialLoad16, stateEssentialLoad16Toggle, config.load?.off_threshold) || loadColour; const dynamicColourEssentialLoad17 = this.calculateEssentialLoadColour(stateEssentialLoad17, stateEssentialLoad17Toggle, config.load?.off_threshold) || loadColour; const dynamicColourEssentialLoad18 = this.calculateEssentialLoadColour(stateEssentialLoad18, stateEssentialLoad18Toggle, config.load?.off_threshold) || loadColour; + const dynamicColourEssentialLoad19 = this.calculateEssentialLoadColour(stateEssentialLoad19, stateEssentialLoad19Toggle, config.load?.off_threshold) || loadColour; + const dynamicColourEssentialLoad20 = this.calculateEssentialLoadColour(stateEssentialLoad20, stateEssentialLoad20Toggle, config.load?.off_threshold) || loadColour; + const dynamicColourEssentialLoad21 = this.calculateEssentialLoadColour(stateEssentialLoad21, stateEssentialLoad21Toggle, config.load?.off_threshold) || loadColour; + const dynamicColourEssentialLoad22 = this.calculateEssentialLoadColour(stateEssentialLoad22, stateEssentialLoad22Toggle, config.load?.off_threshold) || loadColour; + const dynamicColourEssentialLoad23 = this.calculateEssentialLoadColour(stateEssentialLoad23, stateEssentialLoad23Toggle, config.load?.off_threshold) || loadColour; config.title_colour = this.colourConvert(config.title_colour); @@ -453,6 +473,11 @@ export class PowerFlowCard extends LitElement { const iconEssentialLoad16 = this.getEntity('load.load16_icon', { state: config.load?.load16_icon?.toString() ?? '' }).state; const iconEssentialLoad17 = this.getEntity('load.load17_icon', { state: config.load?.load17_icon?.toString() ?? '' }).state; const iconEssentialLoad18 = this.getEntity('load.load18_icon', { state: config.load?.load18_icon?.toString() ?? '' }).state; + const iconEssentialLoad19 = this.getEntity('load.load19_icon', { state: config.load?.load19_icon?.toString() ?? '' }).state; + const iconEssentialLoad20 = this.getEntity('load.load20_icon', { state: config.load?.load20_icon?.toString() ?? '' }).state; + const iconEssentialLoad21 = this.getEntity('load.load21_icon', { state: config.load?.load21_icon?.toString() ?? '' }).state; + const iconEssentialLoad22 = this.getEntity('load.load22_icon', { state: config.load?.load22_icon?.toString() ?? '' }).state; + const iconEssentialLoad23 = this.getEntity('load.load23_icon', { state: config.load?.load23_icon?.toString() ?? '' }).state; const iconAuxLoad1 = this.getEntity('load.aux_load1_icon', { state: config.load?.aux_load1_icon?.toString() ?? '' }).state; const iconAuxLoad2 = this.getEntity('load.aux_load2_icon', { state: config.load?.aux_load2_icon?.toString() ?? '' }).state; const nonessentialIcon = this.getEntity('grid.nonessential_icon', { state: config.grid?.nonessential_icon?.toString() ?? '' }).state; @@ -1171,6 +1196,17 @@ export class PowerFlowCard extends LitElement { loadPowerL2, loadPowerL3, durationCur: this.durationCur, + stateGridPowerL1, + stateGridPowerL2, + stateGridPowerL3, + stateGridVoltageL1, + stateGridVoltageL2, + stateGridVoltageL3, + stateGridCurrentL1, + stateGridCurrentL2, + stateGridCurrentL3, + decimalPlaces, + decimalPlacesEnergy, stateEssentialLoad1, stateEssentialLoad2, stateEssentialLoad3, @@ -1189,17 +1225,11 @@ export class PowerFlowCard extends LitElement { stateEssentialLoad16, stateEssentialLoad17, stateEssentialLoad18, - stateGridPowerL1, - stateGridPowerL2, - stateGridPowerL3, - stateGridVoltageL1, - stateGridVoltageL2, - stateGridVoltageL3, - stateGridCurrentL1, - stateGridCurrentL2, - stateGridCurrentL3, - decimalPlaces, - decimalPlacesEnergy, + stateEssentialLoad19, + stateEssentialLoad20, + stateEssentialLoad21, + stateEssentialLoad22, + stateEssentialLoad23, stateEssentialLoad1Extra, stateEssentialLoad2Extra, stateEssentialLoad3Extra, @@ -1218,6 +1248,11 @@ export class PowerFlowCard extends LitElement { stateEssentialLoad16Extra, stateEssentialLoad17Extra, stateEssentialLoad18Extra, + stateEssentialLoad19Extra, + stateEssentialLoad20Extra, + stateEssentialLoad21Extra, + stateEssentialLoad22Extra, + stateEssentialLoad23Extra, stateEssentialLoad1Toggle, stateEssentialLoad2Toggle, stateEssentialLoad3Toggle, @@ -1236,6 +1271,14 @@ export class PowerFlowCard extends LitElement { stateEssentialLoad16Toggle, stateEssentialLoad17Toggle, stateEssentialLoad18Toggle, + stateEssentialLoad19Toggle, + stateEssentialLoad20Toggle, + stateEssentialLoad21Toggle, + stateEssentialLoad22Toggle, + stateEssentialLoad23Toggle, + stateNonessentialLoad1, + stateNonessentialLoad2, + stateNonessentialLoad3, stateNonEssentialLoad1Extra, stateNonEssentialLoad2Extra, stateNonEssentialLoad3Extra, @@ -1316,6 +1359,11 @@ export class PowerFlowCard extends LitElement { iconEssentialLoad16, iconEssentialLoad17, iconEssentialLoad18, + iconEssentialLoad19, + iconEssentialLoad20, + iconEssentialLoad21, + iconEssentialLoad22, + iconEssentialLoad23, enableTimer, stateSolarSell, priorityLoad, @@ -1375,9 +1423,6 @@ export class PowerFlowCard extends LitElement { stateAuxLoad2Extra, stateAuxLoad1Toggle, stateAuxLoad2Toggle, - stateNonessentialLoad1, - stateNonessentialLoad2, - stateNonessentialLoad3, autoScaledInverterPower, autoScaledGridPower, auxDynamicColour, @@ -1412,6 +1457,11 @@ export class PowerFlowCard extends LitElement { dynamicColourEssentialLoad16, dynamicColourEssentialLoad17, dynamicColourEssentialLoad18, + dynamicColourEssentialLoad19, + dynamicColourEssentialLoad20, + dynamicColourEssentialLoad21, + dynamicColourEssentialLoad22, + dynamicColourEssentialLoad23, dynamicColourNonEssentialLoad, dynamicColourNonEssentialLoad1, dynamicColourNonEssentialLoad2, diff --git a/src/types.ts b/src/types.ts index 541713c..3dd4f62 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,439 +1,425 @@ -import {LovelaceCard, LovelaceCardConfig} from "custom-card-helpers"; -import {CustomEntity} from './inverters/dto/custom-entity'; +import { LovelaceCard, LovelaceCardConfig } from 'custom-card-helpers'; +import { CustomEntity } from './inverters/dto/custom-entity'; declare global { - interface HTMLElementTagNameMap { - 'mlk-power-flow-card': LovelaceCard; - } + interface HTMLElementTagNameMap { + 'mlk-power-flow-card': LovelaceCard; + } } export enum InverterModel { - Azzurro = 'azzurro', - CESBatteryBox = 'ces-battery-box', - Deye = 'deye', - E3dc = 'e3dc', - FoxESS = 'foxess', - Fronius = 'fronius', - Goodwe = 'goodwe', - GoodweGridMode = 'goodwe_gridmode', - Growatt = 'growatt', - Huawei = 'huawei', - Lux = 'lux', - MPPSolar = 'mppsolar', - PowMr = 'powmr', - SMASolar = 'smasolar', - Solax = 'solax', - SolarEdge = 'solaredge', - Sofar = 'sofar', - Solis = 'solis', - Sunsynk = 'sunsynk', - Victron = 'victron', - EasunSMW8_SA = 'Easun SMW8kW SA', + Azzurro = 'azzurro', + CESBatteryBox = 'ces-battery-box', + Deye = 'deye', + E3dc = 'e3dc', + FoxESS = 'foxess', + Fronius = 'fronius', + Goodwe = 'goodwe', + GoodweGridMode = 'goodwe_gridmode', + Growatt = 'growatt', + Huawei = 'huawei', + Lux = 'lux', + MPPSolar = 'mppsolar', + PowMr = 'powmr', + SMASolar = 'smasolar', + Solax = 'solax', + SolarEdge = 'solaredge', + Sofar = 'sofar', + Solis = 'solis', + Sunsynk = 'sunsynk', + Victron = 'victron', + EasunSMW8_SA = 'Easun SMW8kW SA', } export enum AutarkyType { - Energy = 'energy', - Power = 'power', - AutoSelf = 'auto&self', - No = 'no' + Energy = 'energy', + Power = 'power', + AutoSelf = 'auto&self', + No = 'no' } export interface PowerFlowCardConfig extends LovelaceCardConfig { - type: string; - panel_mode?: boolean; - large_font?: boolean; - show_solar: boolean; - show_battery: boolean; - show_grid: boolean; - card_height?: string; - card_width?: string; - decimal_places?: number; - decimal_places_energy?: number; - dynamic_line_width?: boolean; - max_line_width: number; - min_line_width: number; + type: string; + panel_mode?: boolean; + large_font?: boolean; + show_solar: boolean; + show_battery: boolean; + show_grid: boolean; + card_height?: string; + card_width?: string; + decimal_places?: number; + decimal_places_energy?: number; + dynamic_line_width?: boolean; + max_line_width: number; + min_line_width: number; viewbox: { viewbox_min_x: number, viewbox_min_y: number, viewbox_width: number, viewbox_height: number, }, - inverter: { - modern: boolean; - colour: string; - autarky: AutarkyType; - model: InverterModel; - auto_scale: boolean; - three_phase: boolean; - ac_icon: string; - dc_icon: string; - } - battery: { - energy: any; - shutdown_soc: any; - shutdown_soc_offgrid: any; - hide_soc: boolean; - invert_power: boolean; - colour: string; - charge_colour: string; - show_daily: boolean; - animation_speed: number; - max_power: any; - full_capacity: number; - empty_capacity: number; - show_absolute: boolean; - auto_scale: boolean; - show_remaining_energy: boolean; - dynamic_colour: boolean; - linear_gradient: boolean; - animate: boolean; - path_threshold: number, - } - solar: { - colour: string; - mppts: number; - animation_speed: number; - max_power: number; - pv1_name: string; - pv1_max_power: number; - pv2_name: string; - pv2_max_power: number; - pv3_name: string; - pv3_max_power: number; - pv4_name: string; - pv4_max_power: number; - pv5_name: string; - pv5_max_power: number; - auto_scale: boolean; - dynamic_colour: boolean; - efficiency: number; - visualize_efficiency: boolean; - off_threshold: number; - show_mppt_production: boolean; - show_mppt_efficiency: boolean; - } - load: { - colour: string; - dynamic_colour: boolean; - aux_dynamic_colour: boolean; - dynamic_icon: boolean; - show_daily: boolean; - invert_aux: boolean; - invert_load: boolean; - show_absolute_aux: boolean, - animation_speed: number; - max_power: number; - aux_name: string; - aux_daily_name: string; - aux_type: string; - aux_colour: string; - aux_off_colour: string; - off_threshold: number; - additional_loads: number; - aux_loads: number; - aux_load1_name: string; - aux_load2_name: string; - aux_load1_icon: string; - aux_load2_icon: string; - load1_name: string; - load2_name: string; - load3_name: string; - load4_name: string; - load5_name: string; - load6_name: string; - load7_name: string; - load8_name: string; - load9_name: string - load10_name: string; - load11_name: string; - load12_name: string; - load13_name: string; - load14_name: string; - load15_name: string; - load16_name: string; - load17_name: string; - load18_name: string; - load1_icon: string; - load2_icon: string; - load3_icon: string; - load4_icon: string; - load5_icon: string; - load6_icon: string; - load7_icon: string; - load8_icon: string; - load9_icon: string; - load10_icon: string; - load11_icon: string; - load12_icon: string; - load13_icon: string; - load14_icon: string; - load15_icon: string; - load16_icon: string; - load17_icon: string; - load18_icon: string; - show_aux: boolean; - show_daily_aux: boolean; - auto_scale: boolean; - essential_name: string, - path_threshold: number, - } - grid: { - colour: string; - grid_name: string; - label_daily_grid_buy: string; - label_daily_grid_sell: string; - export_colour: string; - no_grid_colour: string; - grid_off_colour: string; - show_daily_buy: boolean; - show_daily_sell: boolean; - show_nonessential: boolean; - nonessential_icon: string; - nonessential_name: string; - additional_loads: number; - load1_name: string; - load2_name: string; - load3_name: string; - load1_icon: string; - load2_icon: string; - load3_icon: string; - invert_grid: boolean; - animation_speed: number; - max_power: number; - auto_scale: boolean; - energy_cost_decimals: number; - show_absolute: boolean; - off_threshold: number; - import_icon: string; - export_icon: string; - disconnected_icon: string; - prepaid_unit_name: string; - } - entities: ConfigCardEntities + inverter: { + modern: boolean; + colour: string; + autarky: AutarkyType; + model: InverterModel; + auto_scale: boolean; + three_phase: boolean; + ac_icon: string; + dc_icon: string; + } + battery: { + energy: any; + shutdown_soc: any; + shutdown_soc_offgrid: any; + hide_soc: boolean; + invert_power: boolean; + colour: string; + charge_colour: string; + show_daily: boolean; + animation_speed: number; + max_power: any; + full_capacity: number; + empty_capacity: number; + show_absolute: boolean; + auto_scale: boolean; + show_remaining_energy: boolean; + dynamic_colour: boolean; + linear_gradient: boolean; + animate: boolean; + path_threshold: number, + } + solar: { + colour: string; + mppts: number; + animation_speed: number; + max_power: number; + pv1_name: string; + pv1_max_power: number; + pv2_name: string; + pv2_max_power: number; + pv3_name: string; + pv3_max_power: number; + pv4_name: string; + pv4_max_power: number; + pv5_name: string; + pv5_max_power: number; + auto_scale: boolean; + dynamic_colour: boolean; + efficiency: number; + visualize_efficiency: boolean; + off_threshold: number; + show_mppt_production: boolean; + show_mppt_efficiency: boolean; + } + load: { + colour: string; + dynamic_colour: boolean; + aux_dynamic_colour: boolean; + dynamic_icon: boolean; + show_daily: boolean; + invert_aux: boolean; + invert_load: boolean; + show_absolute_aux: boolean, + animation_speed: number; + max_power: number; + aux_name: string; + aux_daily_name: string; + aux_type: string; + aux_colour: string; + aux_off_colour: string; + off_threshold: number; + additional_loads: number; + aux_loads: number; + aux_load1_name: string; + aux_load2_name: string; + aux_load1_icon: string; + aux_load2_icon: string; + load1_name: string; + load2_name: string; + load3_name: string; + load4_name: string; + load5_name: string; + load6_name: string; + load7_name: string; + load8_name: string; + load9_name: string; + load10_name: string; + load11_name: string; + load12_name: string; + load13_name: string; + load14_name: string; + load15_name: string; + load16_name: string; + load17_name: string; + load18_name: string; + load19_name: string; + load20_name: string; + load21_name: string; + load22_name: string; + load23_name: string; + load1_icon: string; + load2_icon: string; + load3_icon: string; + load4_icon: string; + load5_icon: string; + load6_icon: string; + load7_icon: string; + load8_icon: string; + load9_icon: string; + load10_icon: string; + load11_icon: string; + load12_icon: string; + load13_icon: string; + load14_icon: string; + load15_icon: string; + load16_icon: string; + load17_icon: string; + load18_icon: string; + load19_icon: string; + load20_icon: string; + load21_icon: string; + load22_icon: string; + load23_icon: string; + show_aux: boolean; + show_daily_aux: boolean; + auto_scale: boolean; + essential_name: string, + path_threshold: number, + } + grid: { + colour: string; + grid_name: string; + label_daily_grid_buy: string; + label_daily_grid_sell: string; + export_colour: string; + no_grid_colour: string; + grid_off_colour: string; + show_daily_buy: boolean; + show_daily_sell: boolean; + show_nonessential: boolean; + nonessential_icon: string; + nonessential_name: string; + additional_loads: number; + load1_name: string; + load2_name: string; + load3_name: string; + load1_icon: string; + load2_icon: string; + load3_icon: string; + invert_grid: boolean; + animation_speed: number; + max_power: number; + auto_scale: boolean; + energy_cost_decimals: number; + show_absolute: boolean; + off_threshold: number; + import_icon: string; + export_icon: string; + disconnected_icon: string; + prepaid_unit_name: string; + } + entities: ConfigCardEntities } export interface ConfigCardEntities { - use_timer_248: any, - priority_load_243: any, - inverter_voltage_154: string, - grid_frequency: string, - load_frequency_192: string, - inverter_current_164: string, - inverter_power_175: string, - grid_connected_status_194: string, - inverter_status_59: string, - day_battery_charge_70: string, - day_battery_discharge_71: string, - battery_voltage_183: string, - battery_soc_184: string, - battery_power_190: string, - battery_current_191: string, - battery_rated_capacity: string; - battery_soh: string; - grid_power_169: string, - grid_voltage: string, - day_grid_import_76: string, - day_grid_export_77: string, - grid_ct_power_172: string, - grid_ct_power_total: string, - day_load_energy_84: string, - essential_power: string, - nonessential_power: string, - aux_power_166: string, - day_pv_energy_108: string, - monthly_pv_energy: string, - yearly_pv_energy: string, - pv1_power_186: string, - pv2_power_187: string, - pv1_voltage_109: string, - pv1_current_110: string, - pv2_voltage_111: string, - pv2_current_112: string, - pv3_voltage_113: string, - pv3_current_114: string, - pv3_power_188: string, - pv4_voltage_115: string, - pv4_current_116: string, - pv4_power_189: string, - pv5_voltage: string, - pv5_current: string, - pv5_power: string, - remaining_solar: string, - tomorrow_solar: string, - battery_temp_182: string, - dc_transformer_temp_90: string, - environment_temp: string, - radiator_temp_91: string, - inverter_load_percentage: string, - non_essential_load1: string, - non_essential_load2: string, - non_essential_load3: string, - non_essential_load1_extra: string, - non_essential_load2_extra: string, - non_essential_load3_extra: string, - non_essential_load1_toggle: string, - non_essential_load2_toggle: string, - non_essential_load3_toggle: string, - energy_cost_buy: string, - solar_sell_247: string, - essential_load1_toggle: string - essential_load2_toggle: string, - essential_load3_toggle: string, - essential_load4_toggle: string, - essential_load5_toggle: string, - essential_load6_toggle: string, - essential_load7_toggle: string, - essential_load8_toggle: string, - essential_load1: string - essential_load2: string, - essential_load3: string, - essential_load4: string, - essential_load5: string, - essential_load6: string, - essential_load7: string, - essential_load8: string, - battery_status: string, - pv_total: string, - aux_load1: string, - aux_load2: string, + use_timer_248: any, + priority_load_243: any, + inverter_voltage_154: string, + grid_frequency: string, + load_frequency_192: string, + inverter_current_164: string, + inverter_power_175: string, + grid_connected_status_194: string, + inverter_status_59: string, + day_battery_charge_70: string, + day_battery_discharge_71: string, + battery_voltage_183: string, + battery_soc_184: string, + battery_power_190: string, + battery_current_191: string, + battery_rated_capacity: string; + battery_soh: string; + grid_power_169: string, + grid_voltage: string, + day_grid_import_76: string, + day_grid_export_77: string, + grid_ct_power_172: string, + grid_ct_power_total: string, + day_load_energy_84: string, + essential_power: string, + nonessential_power: string, + aux_power_166: string, + day_pv_energy_108: string, + monthly_pv_energy: string, + yearly_pv_energy: string, + pv1_power_186: string, + pv2_power_187: string, + pv1_voltage_109: string, + pv1_current_110: string, + pv2_voltage_111: string, + pv2_current_112: string, + pv3_voltage_113: string, + pv3_current_114: string, + pv3_power_188: string, + pv4_voltage_115: string, + pv4_current_116: string, + pv4_power_189: string, + pv5_voltage: string, + pv5_current: string, + pv5_power: string, + remaining_solar: string, + tomorrow_solar: string, + battery_temp_182: string, + dc_transformer_temp_90: string, + environment_temp: string, + radiator_temp_91: string, + inverter_load_percentage: string, + non_essential_load1: string, + non_essential_load2: string, + non_essential_load3: string, + non_essential_load1_extra: string, + non_essential_load2_extra: string, + non_essential_load3_extra: string, + non_essential_load1_toggle: string, + non_essential_load2_toggle: string, + non_essential_load3_toggle: string, + energy_cost_buy: string, + solar_sell_247: string, + battery_status: string, + pv_total: string, + aux_load1: string, + aux_load2: string, aux_load1_extra: string, aux_load2_extra: string, aux_load1_toggle: string, aux_load2_toggle: string, - day_aux_energy: string, - energy_cost_sell: string, - essential_load1_extra: string, - essential_load2_extra: string, - essential_load3_extra: string, - essential_load4_extra: string, - essential_load5_extra: string, - essential_load6_extra: string, - essential_load7_extra: string, - essential_load8_extra: string, - inverter_voltage_L2: string, - inverter_voltage_L3: string, - inverter_current_L2: string, - inverter_current_L3: string, - grid_ct_power_L2: string, - grid_ct_power_L3: string, - load_power_L1: string, - load_power_L2: string, - load_power_L3: string, - total_pv_generation: string, - battery_current_direction: string, - prepaid_units: string, - prepaid_unit_name: string, - prog1_time: string, - prog2_time: string, - prog3_time: string, - prog4_time: string, - prog5_time: string, - prog6_time: string, - prog1_capacity: string, - prog2_capacity: string, - prog3_capacity: string, - prog4_capacity: string, - prog5_capacity: string, - prog6_capacity: string, - prog1_charge: string, - prog2_charge: string, - prog3_charge: string, - prog4_charge: string, - prog5_charge: string, - prog6_charge: string, - max_sell_power: string, + day_aux_energy: string, + energy_cost_sell: string, + inverter_voltage_L2: string, + inverter_voltage_L3: string, + inverter_current_L2: string, + inverter_current_L3: string, + grid_ct_power_L2: string, + grid_ct_power_L3: string, + load_power_L1: string, + load_power_L2: string, + load_power_L3: string, + total_pv_generation: string, + battery_current_direction: string, + prepaid_units: string, + prepaid_unit_name: string, + prog1_time: string, + prog2_time: string, + prog3_time: string, + prog4_time: string, + prog5_time: string, + prog6_time: string, + prog1_capacity: string, + prog2_capacity: string, + prog3_capacity: string, + prog4_capacity: string, + prog5_capacity: string, + prog6_capacity: string, + prog1_charge: string, + prog2_charge: string, + prog3_charge: string, + prog4_charge: string, + prog5_charge: string, + prog6_charge: string, + max_sell_power: string, } export interface InverterSettings { - entityID: string; - show?: boolean; - charge?: string; - capacity: number; + entityID: string; + show?: boolean; + charge?: string; + capacity: number; } export interface DataDto { - config: PowerFlowCardConfig, - panelMode, - compactMode, - cardHeight, - cardWidth, - loadColour: string, - batteryColour: string, - gridColour: string, - gridImportColour: string, - gridExportColour: string, - isFloating: boolean, - inverterColour: string, - solarColour: string, - auxOffColour: string, - batteryEnergy, - largeFont, - batteryPower, - stateBatteryPower: CustomEntity, - batteryDuration, - batteryCapacity, - additionalLoad, - essIconSize, - essIcon: string, - batteryStateMsg, - batteryPercentage, - pvPercentage, - loadShowDaily, - loadPowerL1, - loadPowerL2, - loadPowerL3, - durationCur, - stateGridPowerL1: CustomEntity, - stateGridPowerL2: CustomEntity, - stateGridPowerL3: CustomEntity, - stateGridVoltageL1: CustomEntity, - stateGridVoltageL2: CustomEntity, - stateGridVoltageL3: CustomEntity, - stateGridCurrentL1: CustomEntity, - stateGridCurrentL2: CustomEntity, - stateGridCurrentL3: CustomEntity, - decimalPlaces, - decimalPlacesEnergy, - gridShowDailyBuy, - gridShowDailySell, - batteryShowDaily, - inverterModel, - batteryShutdown, - enableAutarky, - autarkyPower, - ratioPower, - ratioEnergy, - autarkyEnergy, - autarkyAuto, - autarkySelf, - shutdownOffGrid, - energyCost, - stateInverterCurrentL1: CustomEntity, - stateInverterCurrentL2: CustomEntity, - stateInverterCurrentL3: CustomEntity, - stateInverterVoltageL1: CustomEntity, - stateInverterVoltageL2: CustomEntity, - stateInverterVoltageL3: CustomEntity, - stateBatteryVoltage: CustomEntity, - batLineWidth, - totalGridPower, - solarLineWidth, - totalPV, - loadLineWidth, - pvPercentageBat, - gridPercentageBat, - genericInverterImage, - battery0, - essentialPower: number, - pv1LineWidth, - pv2LineWidth, - pv3LineWidth, - pv4LineWidth, - pv5LineWidth, - gridLineWidth, - batteryStateColour: string, - inverterStateColour: string, + config: PowerFlowCardConfig, + panelMode, + compactMode, + cardHeight, + cardWidth, + loadColour: string, + batteryColour: string, + gridColour: string, + gridImportColour: string, + gridExportColour: string, + isFloating: boolean, + inverterColour: string, + solarColour: string, + auxOffColour: string, + batteryEnergy, + largeFont, + batteryPower, + stateBatteryPower: CustomEntity, + batteryDuration, + batteryCapacity, + additionalLoad, + essIconSize, + essIcon: string, + batteryStateMsg, + batteryPercentage, + pvPercentage, + loadShowDaily, + loadPowerL1, + loadPowerL2, + loadPowerL3, + durationCur, + stateGridPowerL1: CustomEntity, + stateGridPowerL2: CustomEntity, + stateGridPowerL3: CustomEntity, + stateGridVoltageL1: CustomEntity, + stateGridVoltageL2: CustomEntity, + stateGridVoltageL3: CustomEntity, + stateGridCurrentL1: CustomEntity, + stateGridCurrentL2: CustomEntity, + stateGridCurrentL3: CustomEntity, + decimalPlaces, + decimalPlacesEnergy, + gridShowDailyBuy, + gridShowDailySell, + batteryShowDaily, + inverterModel, + batteryShutdown, + enableAutarky, + autarkyPower, + ratioPower, + ratioEnergy, + autarkyEnergy, + autarkyAuto, + autarkySelf, + shutdownOffGrid, + energyCost, + stateInverterCurrentL1: CustomEntity, + stateInverterCurrentL2: CustomEntity, + stateInverterCurrentL3: CustomEntity, + stateInverterVoltageL1: CustomEntity, + stateInverterVoltageL2: CustomEntity, + stateInverterVoltageL3: CustomEntity, + stateBatteryVoltage: CustomEntity, + batLineWidth, + totalGridPower, + solarLineWidth, + totalPV, + loadLineWidth, + pvPercentageBat, + gridPercentageBat, + genericInverterImage, + battery0, + essentialPower: number, + pv1LineWidth, + pv2LineWidth, + pv3LineWidth, + pv4LineWidth, + pv5LineWidth, + gridLineWidth, + batteryStateColour: string, + inverterStateColour: string, iconEssentialLoad1: string, iconEssentialLoad2: string, iconEssentialLoad3: string, @@ -452,65 +438,70 @@ export interface DataDto { iconEssentialLoad16: string, iconEssentialLoad17: string, iconEssentialLoad18: string, - enableTimer, - priorityLoad, - inverterImg, - minLineWidth, - stopColour: string, - gridStatus, - batteryCharge, - gridOffColour: string, - batteryIcon:string, - formattedResultTime, - showAux, - nonessentialIcon:string, - showNonessential, - nonessentialLoads, - additionalAuxLoad, - iconNonessentialLoad1: string, - iconNonessentialLoad2: string, - iconNonessentialLoad3: string, - inverterStateMsg, - auxType, - showDailyAux, + iconEssentialLoad19: string, + iconEssentialLoad20: string, + iconEssentialLoad21: string, + iconEssentialLoad22: string, + iconEssentialLoad23: string, + enableTimer, + priorityLoad, + inverterImg, + minLineWidth, + stopColour: string, + gridStatus, + batteryCharge, + gridOffColour: string, + batteryIcon: string, + formattedResultTime, + showAux, + nonessentialIcon: string, + showNonessential, + nonessentialLoads, + additionalAuxLoad, + iconNonessentialLoad1: string, + iconNonessentialLoad2: string, + iconNonessentialLoad3: string, + inverterStateMsg, + auxType, + showDailyAux, auxPower, - stateAuxPower : CustomEntity, + stateAuxPower: CustomEntity, nonessentialPower, - nonessLineWidth, - grid169LineWidth, - auxLineWidth, - iconAuxLoad1: string, - iconAuxLoad2: string, - autoScaledInverterPower, - autoScaledGridPower, - auxDynamicColour: string, - auxDynamicColourLoad1: string, - auxDynamicColourLoad2: string, - stateDayLoadEnergy: CustomEntity, - stateDayBatteryDischarge: CustomEntity, - stateDayGridImport: CustomEntity, - stateDayBatteryCharge: CustomEntity, - stateDayGridExport: CustomEntity, - stateDailyPVEnergy: CustomEntity, - stateMonthlyPVEnergy: CustomEntity, - stateYearlyPVEnergy: CustomEntity, - stateTotalSolarGeneration: CustomEntity, - stateRemainingSolar: CustomEntity, - stateTomorrowSolar: CustomEntity, - stateDayAuxEnergy: CustomEntity, - inverterProg, - stateUseTimer: CustomEntity, - stateBatterySoc: CustomEntity, - stateEnergyCostSell: CustomEntity, - stateEnergyCostBuy: CustomEntity, - stateEssentialLoad1: CustomEntity, - stateEssentialLoad2: CustomEntity, - stateEssentialLoad3: CustomEntity, - stateEssentialLoad4: CustomEntity, - stateEssentialLoad5: CustomEntity, - stateEssentialLoad6: CustomEntity, - stateEssentialLoad7: CustomEntity, - stateEssentialLoad8: CustomEntity, + nonessLineWidth, + grid169LineWidth, + auxLineWidth, + iconAuxLoad1: string, + iconAuxLoad2: string, + autoScaledInverterPower, + autoScaledGridPower, + auxDynamicColour: string, + auxDynamicColourLoad1: string, + auxDynamicColourLoad2: string, + stateDayLoadEnergy: CustomEntity, + stateDayBatteryDischarge: CustomEntity, + stateDayGridImport: CustomEntity, + stateDayBatteryCharge: CustomEntity, + stateDayGridExport: CustomEntity, + stateDailyPVEnergy: CustomEntity, + stateMonthlyPVEnergy: CustomEntity, + stateYearlyPVEnergy: CustomEntity, + stateTotalSolarGeneration: CustomEntity, + stateRemainingSolar: CustomEntity, + stateTomorrowSolar: CustomEntity, + stateDayAuxEnergy: CustomEntity, + inverterProg, + stateUseTimer: CustomEntity, + stateBatterySoc: CustomEntity, + stateEnergyCostSell: CustomEntity, + stateEnergyCostBuy: CustomEntity, + stateEssentialLoad1: CustomEntity, + stateEssentialLoad2: CustomEntity, + stateEssentialLoad3: CustomEntity, + stateEssentialLoad4: CustomEntity, + stateEssentialLoad5: CustomEntity, + stateEssentialLoad6: CustomEntity, + stateEssentialLoad7: CustomEntity, + stateEssentialLoad8: CustomEntity, stateEssentialLoad9: CustomEntity, stateEssentialLoad10: CustomEntity, stateEssentialLoad11: CustomEntity, @@ -521,6 +512,11 @@ export interface DataDto { stateEssentialLoad16: CustomEntity, stateEssentialLoad17: CustomEntity, stateEssentialLoad18: CustomEntity, + stateEssentialLoad19: CustomEntity, + stateEssentialLoad20: CustomEntity, + stateEssentialLoad21: CustomEntity, + stateEssentialLoad22: CustomEntity, + stateEssentialLoad23: CustomEntity, stateEssentialLoad1Extra: CustomEntity, stateEssentialLoad2Extra: CustomEntity, stateEssentialLoad3Extra: CustomEntity, @@ -539,6 +535,11 @@ export interface DataDto { stateEssentialLoad16Extra: CustomEntity, stateEssentialLoad17Extra: CustomEntity, stateEssentialLoad18Extra: CustomEntity, + stateEssentialLoad19Extra: CustomEntity, + stateEssentialLoad20Extra: CustomEntity, + stateEssentialLoad21Extra: CustomEntity, + stateEssentialLoad22Extra: CustomEntity, + stateEssentialLoad23Extra: CustomEntity, stateEssentialLoad1Toggle: CustomEntity, stateEssentialLoad2Toggle: CustomEntity, stateEssentialLoad3Toggle: CustomEntity, @@ -557,61 +558,66 @@ export interface DataDto { stateEssentialLoad16Toggle: CustomEntity, stateEssentialLoad17Toggle: CustomEntity, stateEssentialLoad18Toggle: CustomEntity, - stateNonessentialLoad1: CustomEntity, - stateNonessentialLoad2: CustomEntity, - stateNonessentialLoad3: CustomEntity, - stateNonEssentialLoad1Extra: CustomEntity, - stateNonEssentialLoad2Extra: CustomEntity, - stateNonEssentialLoad3Extra: CustomEntity, - stateNonEssentialLoad1Toggle: CustomEntity, - stateNonEssentialLoad2Toggle: CustomEntity, - stateNonEssentialLoad3Toggle: CustomEntity, - stateRadiatorTemp: CustomEntity, - stateBatteryCurrent: CustomEntity, - stateEnvironmentTemp: CustomEntity, - stateBatteryTemp: CustomEntity, - statePrepaidUnits: CustomEntity, - stateDCTransformerTemp: CustomEntity, - stateInverterLoadPercentage: CustomEntity, - stateSolarSell: CustomEntity, - statePV1Current: CustomEntity, - statePV2Current: CustomEntity, - statePV3Current: CustomEntity, - statePV4Current: CustomEntity, - statePV5Current: CustomEntity, - statePV1Voltage: CustomEntity, - statePV2Voltage: CustomEntity, - statePV3Voltage: CustomEntity, - statePV4Voltage: CustomEntity, - statePV5Voltage: CustomEntity, - statePV1Power: CustomEntity, - statePV2Power: CustomEntity, - statePV3Power: CustomEntity, - statePV4Power: CustomEntity, - statePV5Power: CustomEntity, - statePVTotal: CustomEntity, - statePV1Energy: CustomEntity, - statePV2Energy: CustomEntity, - statePV3Energy: CustomEntity, - statePV4Energy: CustomEntity, - statePV5Energy: CustomEntity, + stateEssentialLoad19Toggle: CustomEntity, + stateEssentialLoad20Toggle: CustomEntity, + stateEssentialLoad21Toggle: CustomEntity, + stateEssentialLoad22Toggle: CustomEntity, + stateEssentialLoad23Toggle: CustomEntity, + stateNonessentialLoad1: CustomEntity, + stateNonessentialLoad2: CustomEntity, + stateNonessentialLoad3: CustomEntity, + stateNonEssentialLoad1Extra: CustomEntity, + stateNonEssentialLoad2Extra: CustomEntity, + stateNonEssentialLoad3Extra: CustomEntity, + stateNonEssentialLoad1Toggle: CustomEntity, + stateNonEssentialLoad2Toggle: CustomEntity, + stateNonEssentialLoad3Toggle: CustomEntity, + stateRadiatorTemp: CustomEntity, + stateBatteryCurrent: CustomEntity, + stateEnvironmentTemp: CustomEntity, + stateBatteryTemp: CustomEntity, + statePrepaidUnits: CustomEntity, + stateDCTransformerTemp: CustomEntity, + stateInverterLoadPercentage: CustomEntity, + stateSolarSell: CustomEntity, + statePV1Current: CustomEntity, + statePV2Current: CustomEntity, + statePV3Current: CustomEntity, + statePV4Current: CustomEntity, + statePV5Current: CustomEntity, + statePV1Voltage: CustomEntity, + statePV2Voltage: CustomEntity, + statePV3Voltage: CustomEntity, + statePV4Voltage: CustomEntity, + statePV5Voltage: CustomEntity, + statePV1Power: CustomEntity, + statePV2Power: CustomEntity, + statePV3Power: CustomEntity, + statePV4Power: CustomEntity, + statePV5Power: CustomEntity, + statePVTotal: CustomEntity, + statePV1Energy: CustomEntity, + statePV2Energy: CustomEntity, + statePV3Energy: CustomEntity, + statePV4Energy: CustomEntity, + statePV5Energy: CustomEntity, stateAuxLoad1Extra: CustomEntity, stateAuxLoad2Extra: CustomEntity, stateAuxLoad1Toggle: CustomEntity, stateAuxLoad2Toggle: CustomEntity, - stateAuxLoad1: CustomEntity, - stateAuxLoad2: CustomEntity, - stateMaxSellPower: CustomEntity, - totalPVEfficiency, - PV1Efficiency, - PV2Efficiency, - PV3Efficiency, - PV4Efficiency, - PV5Efficiency, - gridPercentage, - flowColour: string, - flowBatColour: string, - flowInvColour: string, + stateAuxLoad1: CustomEntity, + stateAuxLoad2: CustomEntity, + stateMaxSellPower: CustomEntity, + totalPVEfficiency, + PV1Efficiency, + PV2Efficiency, + PV3Efficiency, + PV4Efficiency, + PV5Efficiency, + gridPercentage, + flowColour: string, + flowBatColour: string, + flowInvColour: string, dynamicColourEssentialLoad1: string, dynamicColourEssentialLoad2: string, dynamicColourEssentialLoad3: string, @@ -630,13 +636,18 @@ export interface DataDto { dynamicColourEssentialLoad16: string, dynamicColourEssentialLoad17: string, dynamicColourEssentialLoad18: string, - dynamicColourNonEssentialLoad: string, - dynamicColourNonEssentialLoad1: string, - dynamicColourNonEssentialLoad2: string, - dynamicColourNonEssentialLoad3: string, - stateBatterySOH: CustomEntity, - customGridIcon: string, - customGridIconColour: string, - stateLoadFrequency: CustomEntity, - stateGridFrequency: CustomEntity; + dynamicColourEssentialLoad19: string, + dynamicColourEssentialLoad20: string, + dynamicColourEssentialLoad21: string, + dynamicColourEssentialLoad22: string, + dynamicColourEssentialLoad23: string, + dynamicColourNonEssentialLoad: string, + dynamicColourNonEssentialLoad1: string, + dynamicColourNonEssentialLoad2: string, + dynamicColourNonEssentialLoad3: string, + stateBatterySOH: CustomEntity, + customGridIcon: string, + customGridIconColour: string, + stateLoadFrequency: CustomEntity, + stateGridFrequency: CustomEntity; }